order.vue 4.6 KB

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