order.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  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.enterpriseName }}
  9. <view class="state" v-if="item.peopleConfirmStatus == 0 || item.cooperEntrustStatus == 0 || item.applyConfirmStatus == 0">
  10. <text class="icon">&#xe830;</text>
  11. <text>未确认</text>
  12. </view>
  13. <view class="state" v-if="item.resaleStatus == 1">
  14. <text class="icon" style="color: #13ce66">&#xe830;</text>
  15. <text>已转售</text>
  16. </view>
  17. </view>
  18. <image src="../../../../static/news.jpg" mode="aspectFill" class="pic"></image>
  19. <view class="con">
  20. <view class="productName omit">{{ item.goodsNames }}</view>
  21. <view class="desc omit">
  22. <text>重量 {{ item.totalWeight }}</text>
  23. <text>{{ item.tradeAreaName }}</text>
  24. </view>
  25. <view class="price">¥ {{ item.totalPrice }}</view>
  26. </view>
  27. <view class="clear"></view>
  28. <view class="op">
  29. <view class="date">{{ item.createTime }}</view>
  30. <template v-if="item.peopleConfirmStatus == 1 && item.applyConfirmStatus == 1 && item.apply == 1 && item.resaleStatus == 0">
  31. <view class="an" style="color: #f44336" @click.stop="resale(item)">订单转售</view>
  32. </template>
  33. </view>
  34. </view>
  35. <view class="loading" v-if="loadMore"><u-loadmore :status="loadMore ? 'loading' : 'nomore'" /></view>
  36. <u-empty v-if="!loadMore && list.length == 0"></u-empty>
  37. </view>
  38. </view>
  39. </template>
  40. <script>
  41. export default {
  42. data() {
  43. return {
  44. tab: [
  45. {
  46. name: '全部',
  47. peopleConfirmStatus: '', //边民确认状态
  48. cooperEntrustStatus: '', //互助委托申报确认状态
  49. applyConfirmStatus: '', //进口申报确认状态
  50. finishStatus: '', //订单完成状态
  51. resaleStatus: '' //订单转售状态
  52. },
  53. {
  54. name: '进口中',
  55. finishStatus: 0,
  56. resaleStatus: 0
  57. },
  58. {
  59. name: '已完成',
  60. peopleConfirmStatus: 1,
  61. cooperEntrustStatus: 1,
  62. applyConfirmStatus: 1,
  63. finishStatus: 1,
  64. resaleStatus: 0
  65. },
  66. {
  67. name: '已转售',
  68. peopleConfirmStatus: 1,
  69. cooperEntrustStatus: 1,
  70. applyConfirmStatus: 1,
  71. finishStatus: 1,
  72. resaleStatus: 1
  73. }
  74. ],
  75. param: {
  76. pageNo: 1,
  77. pageSize: 10
  78. },
  79. list: [],
  80. loadMore: true,
  81. id: '',
  82. flag: '',
  83. };
  84. },
  85. onLoad() {
  86. this.getData();
  87. uni.$on('face', res => {
  88. if(this.flag == 1) {
  89. this.http.request({
  90. url: '/level-one-server/app/TbOrder/confirmOrder',
  91. data: { orderId: this.id },
  92. success: resp => {
  93. uni.showToast({ title: '订单确认成功' });
  94. this.refresh();
  95. }
  96. });
  97. } else if(this.flag == 2) {
  98. this.http.request({
  99. url: '/level-one-server/app/TbOrder/applyOrder',
  100. data: { orderId: this.id },
  101. success: resp => {
  102. uni.showToast({ title: '进口申报确认成功' });
  103. this.refresh();
  104. }
  105. });
  106. }
  107. })
  108. },
  109. methods: {
  110. getData() {
  111. this.http.request({
  112. url: '/level-one-server/app/TbOrder/getList',
  113. loading: 'false',
  114. data: this.param,
  115. success: res => {
  116. this.loadMore = parseInt(res.data.pageCount) > this.param.pageNo;
  117. if (res.data.data) {
  118. this.list.push(...res.data.data);
  119. }
  120. }
  121. });
  122. },
  123. // 点击tab切换
  124. click(e) {
  125. console.log(e);
  126. this.param.peopleConfirmStatus = e.peopleConfirmStatus;
  127. this.param.cooperEntrustStatus = e.cooperEntrustStatus;
  128. this.param.applyConfirmStatus = e.applyConfirmStatus;
  129. this.param.apply = e.apply;
  130. this.param.finishStatus = e.finishStatus;
  131. this.param.resaleStatus = e.resaleStatus;
  132. this.refresh();
  133. },
  134. detail(item) {
  135. uni.navigateTo({url: '/pages/market/one/leader/detail?id=' + item.id});
  136. },
  137. resale(item) {
  138. uni.navigateTo({url: '/pages/market/two/leader/resale?item=' + JSON.stringify(item)});
  139. },
  140. // 刷新数据
  141. refresh() {
  142. this.loadMore = true;
  143. this.param.pageNo = 1;
  144. this.list = [];
  145. this.getData();
  146. }
  147. },
  148. //下拉刷新
  149. onPullDownRefresh() {
  150. setTimeout(() => {
  151. this.refresh();
  152. uni.stopPullDownRefresh();
  153. }, 1000);
  154. },
  155. //上拉加载
  156. onReachBottom() {
  157. if (this.loadMore) {
  158. this.param.pageNo++;
  159. this.getData();
  160. }
  161. }
  162. };
  163. </script>
  164. <style lang="scss">
  165. page {
  166. background-color: $pg;
  167. }
  168. .state{
  169. margin-right: -70px;
  170. }
  171. </style>