order.vue 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251
  1. <template>
  2. <view>
  3. <view class="tab">
  4. <u-tabs :list="tab" @click="click" :lineHeight="5"></u-tabs>
  5. </view>
  6. <view class="goodsList">
  7. <view class="item" v-for="(item, index) in list" :key="index" @click="detail(item)">
  8. <view class="title">{{ item.borderName }}
  9. <view class="state" v-if="item.finishStatus == 1 && item.upStatus == 1">
  10. <text class="icon" style="color:#13ce66">&#xe830;</text>
  11. <text>待上架</text>
  12. </view>
  13. <view class="state" v-if="item.finishStatus == 1 && item.upStatus == 2&&item.resaleStatus == 0">
  14. <text class="icon" style="color:#13ce66">&#xe830;</text>
  15. <text>已上架</text>
  16. </view>
  17. <view class="state" v-if="item.resaleStatus == 1&& item.upStatus == 2">
  18. <text class="icon" style="color: #13ce66">&#xe830;</text>
  19. <text>已转售</text>
  20. </view>
  21. </view>
  22. <view style="margin-bottom: 9px;width: 80%;font-size: 18px;">{{ item.enterpriseName }}</view>
  23. <!-- <image src="../../../../static/news.jpg" mode="aspectFill" class="pic"></image> -->
  24. <view class="con">
  25. <view class="productName omit">{{ item.goodsNames }}</view>
  26. <view class="desc omit">
  27. <text>重量 {{ item.totalWeight }}{{ item.goodsUnit }}</text>
  28. <text>{{ item.veNo }}</text>
  29. </view>
  30. <view class="price">¥ {{ item.totalPrice }}</view>
  31. </view>
  32. <view class="clear"></view>
  33. <view class="op">
  34. <view class="date">{{ item.createTime }}</view>
  35. <template v-if="item.finishStatus == 1 && item.upStatus != 2">
  36. <view class="an down_btn" style="background-color: #3c9cff;color: white;" @click.stop="resale(item)">上架</view>
  37. </template>
  38. <!-- <template v-if="item.resaleStatus == 0 && item.beingOrder == 0&& item.upStatus == 2"> -->
  39. <template v-if="item.resaleStatus == 0 && item.beingOrder == 0&& item.upStatus == 2&&item.finishStatus==1">
  40. <view class="an down_btn" @click.stop="downOrder(item)">下架</view>
  41. </template>
  42. </view>
  43. </view>
  44. <view class="loading" v-if="loadMore"><u-loadmore :status="loadMore ? 'loading' : 'nomore'" /></view>
  45. <u-empty v-if="!loadMore && list.length == 0"></u-empty>
  46. </view>
  47. </view>
  48. </template>
  49. <script>
  50. export default {
  51. data() {
  52. return {
  53. user: {},
  54. tab: [{
  55. name: '全部',
  56. peopleConfirmStatus: '', //边民确认状态
  57. cooperEntrustStatus: '', //互助委托申报确认状态
  58. applyConfirmStatus: '', //进口申报确认状态
  59. finishStatus: 1, //订单完成状态
  60. resaleStatus: '' //订单转售状态
  61. },
  62. {
  63. name: '待上架',
  64. finishStatus: 1,
  65. resaleStatus: 0,
  66. upStatus: 1
  67. },
  68. {
  69. name: '已上架',
  70. finishStatus: 1,
  71. resaleStatus: 0,
  72. upStatus: 2
  73. },
  74. {
  75. name: '已转售',
  76. finishStatus: 1,
  77. resaleStatus: 1,
  78. upStatus: 2
  79. }
  80. ],
  81. param: {
  82. pageNo: 1,
  83. pageSize: 10,
  84. finishStatus:1
  85. },
  86. list: [],
  87. loadMore: true,
  88. id: '',
  89. flag: '',
  90. };
  91. },
  92. onLoad() {
  93. this.user = this.getUser()
  94. uni.$on('face', res => {
  95. if (this.flag == 1) {
  96. this.http.request({
  97. url: '/level-one-server/app/TbOrder/confirmOrder',
  98. data: {
  99. orderId: this.id
  100. },
  101. success: resp => {
  102. uni.showToast({
  103. title: '订单确认成功'
  104. });
  105. this.refresh();
  106. }
  107. });
  108. } else if (this.flag == 2) {
  109. this.http.request({
  110. url: '/level-one-server/app/TbOrder/applyOrder',
  111. data: {
  112. orderId: this.id
  113. },
  114. success: resp => {
  115. uni.showToast({
  116. title: '进口申报确认成功'
  117. });
  118. this.refresh();
  119. }
  120. });
  121. }
  122. })
  123. },
  124. onShow() {
  125. this.getData();
  126. },
  127. methods: {
  128. downOrder(item) {
  129. uni.showModal({
  130. title: '提示',
  131. content: '确定下架?',
  132. success: res => {
  133. if (res.confirm) {
  134. this.http.request({
  135. url: '/level-one-server/app/TbOrder/down',
  136. data: {
  137. id: item.id
  138. },
  139. success: res => {
  140. uni.showToast({
  141. title: '提交成功'
  142. });
  143. item.upStatus = 1;
  144. }
  145. });
  146. }
  147. }
  148. });
  149. },
  150. getData() {
  151. this.http.request({
  152. url: '/level-one-server/app/TbOrder/getList',
  153. loading: 'false',
  154. data: this.param,
  155. success: res => {
  156. this.loadMore = parseInt(res.data.pageCount) > this.param.pageNo;
  157. if (res.data.data) {
  158. this.list = res.data.data;
  159. console.log("---1---=" + this.list[0].finishStatus)
  160. console.log("---2---=" + this.list[0].resaleStatus)
  161. }
  162. }
  163. });
  164. },
  165. // 点击tab切换
  166. click(e) {
  167. console.log(e);
  168. this.param.peopleConfirmStatus = e.peopleConfirmStatus;
  169. this.param.cooperEntrustStatus = e.cooperEntrustStatus;
  170. this.param.applyConfirmStatus = e.applyConfirmStatus;
  171. this.param.finishStatus = e.finishStatus;
  172. this.param.resaleStatus = e.resaleStatus;
  173. this.param.upStatus = e.upStatus;
  174. this.refresh();
  175. },
  176. detail(item) {
  177. uni.navigateTo({
  178. url: '/pages/market/one/leader/detail?id=' + item.id
  179. });
  180. },
  181. resale(item) {
  182. uni.navigateTo({
  183. url: '/pages/market/two/leader/resale?item=' + JSON.stringify(item)
  184. });
  185. },
  186. orderRefund(id) {
  187. this.http.request({
  188. url: '/level-one-server/app/TbOrder/orderRefund',
  189. data: {
  190. id: id
  191. },
  192. method: 'POST',
  193. success: resp => {
  194. uni.showToast({
  195. title: '操作成功'
  196. });
  197. this.refresh();
  198. }
  199. });
  200. },
  201. updateResalePrice(id) {
  202. uni.navigateTo({
  203. url: '/pages/market/two/leader/updatePrice?id=' + id
  204. });
  205. },
  206. // 刷新数据
  207. refresh() {
  208. this.loadMore = true;
  209. this.param.pageNo = 1;
  210. this.list = [];
  211. this.getData();
  212. }
  213. },
  214. //下拉刷新
  215. onPullDownRefresh() {
  216. setTimeout(() => {
  217. this.refresh();
  218. uni.stopPullDownRefresh();
  219. }, 1000);
  220. },
  221. //上拉加载
  222. onReachBottom() {
  223. if (this.loadMore) {
  224. this.param.pageNo++;
  225. this.getData();
  226. }
  227. }
  228. };
  229. </script>
  230. <style lang="scss">
  231. page {
  232. background-color: $pg;
  233. }
  234. .state {
  235. margin-right: -70px;
  236. }
  237. .down_btn {
  238. color: #f0f4f7;
  239. width: 44px;
  240. background: #f9ae3d;
  241. text-align: center;
  242. border-radius: 10px;
  243. font-size: 12px;
  244. padding: 2px 5px;
  245. }
  246. </style>