order.vue 4.6 KB

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