order.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  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) && item.finishStatus == 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.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" style="color:#13ce66">&#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 }}{{ item.goodsUnit }}</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 && item.resaleStatus == 0">
  39. <view class="an" style="color: blue;" @click.stop="resale(item)">订单转售</view>
  40. </template>
  41. <template v-if="item.peopleConfirmStatus == 1 && item.Sxb010Status == 1 && item.finishStatus == 0 && item.refundStatus == 0">
  42. <view class="an" style="color: #f44336" @click.stop="orderRefund(item.id)">退款</view>
  43. </template>
  44. <!-- <template v-if="item.resaleStatus == 1 && item.beingOrder == 0">
  45. <view class="an" style="color: #f44336" @click.stop="updateResalePrice(item.id)">修改转售价格</view>
  46. </template> -->
  47. </view>
  48. </view>
  49. <view class="loading" v-if="loadMore"><u-loadmore :status="loadMore ? 'loading' : 'nomore'" /></view>
  50. <u-empty v-if="!loadMore && list.length == 0"></u-empty>
  51. </view>
  52. </view>
  53. </template>
  54. <script>
  55. export default {
  56. data() {
  57. return {
  58. tab: [
  59. {
  60. name: '全部',
  61. peopleConfirmStatus: '', //边民确认状态
  62. cooperEntrustStatus: '', //互助委托申报确认状态
  63. applyConfirmStatus: '', //进口申报确认状态
  64. finishStatus: '', //订单完成状态
  65. resaleStatus: '' //订单转售状态
  66. },
  67. {
  68. name: '未进口',
  69. peopleConfirmStatus: 1,
  70. cooperEntrustStatus: 1,
  71. applyConfirmStatus: 1,
  72. finishStatus: 0,
  73. resaleStatus: 0
  74. },
  75. {
  76. name: '已进口',
  77. peopleConfirmStatus: 1,
  78. finishStatus: 1,
  79. resaleStatus: 0
  80. },
  81. {
  82. name: '已转售',
  83. peopleConfirmStatus: 1,
  84. finishStatus: 1,
  85. resaleStatus: 1
  86. }
  87. ],
  88. param: {
  89. pageNo: 1,
  90. pageSize: 10
  91. },
  92. list: [],
  93. loadMore: true,
  94. id: '',
  95. flag: '',
  96. };
  97. },
  98. onLoad() {
  99. this.getData();
  100. uni.$on('face', res => {
  101. if(this.flag == 1) {
  102. this.http.request({
  103. url: '/level-one-server/app/TbOrder/confirmOrder',
  104. data: { orderId: this.id },
  105. success: resp => {
  106. uni.showToast({ title: '订单确认成功' });
  107. this.refresh();
  108. }
  109. });
  110. } else if(this.flag == 2) {
  111. this.http.request({
  112. url: '/level-one-server/app/TbOrder/applyOrder',
  113. data: { orderId: this.id },
  114. success: resp => {
  115. uni.showToast({ title: '进口申报确认成功' });
  116. this.refresh();
  117. }
  118. });
  119. }
  120. })
  121. },
  122. methods: {
  123. getData() {
  124. this.http.request({
  125. url: '/level-one-server/app/TbOrder/getList',
  126. loading: 'false',
  127. data: this.param,
  128. success: res => {
  129. this.loadMore = parseInt(res.data.pageCount) > this.param.pageNo;
  130. if (res.data.data) {
  131. this.list.push(...res.data.data);
  132. console.log("---1---="+this.list[0].finishStatus)
  133. console.log("---2---="+this.list[0].resaleStatus)
  134. }
  135. }
  136. });
  137. },
  138. // 点击tab切换
  139. click(e) {
  140. console.log(e);
  141. this.param.peopleConfirmStatus = e.peopleConfirmStatus;
  142. this.param.cooperEntrustStatus = e.cooperEntrustStatus;
  143. this.param.applyConfirmStatus = e.applyConfirmStatus;
  144. this.param.finishStatus = e.finishStatus;
  145. this.param.resaleStatus = e.resaleStatus;
  146. this.refresh();
  147. },
  148. detail(item) {
  149. uni.navigateTo({url: '/pages/market/one/leader/detail?id=' + item.id});
  150. },
  151. resale(item) {
  152. uni.navigateTo({url: '/pages/market/two/leader/resale?item=' + JSON.stringify(item)});
  153. },
  154. orderRefund(id) {
  155. this.http.request({
  156. url: '/level-one-server/app/TbOrder/orderRefund',
  157. data: { id: id },
  158. method: 'POST',
  159. success: resp => {
  160. uni.showToast({ title: '操作成功' });
  161. this.refresh();
  162. }
  163. });
  164. },
  165. updateResalePrice(id) {
  166. uni.navigateTo({url: '/pages/market/two/leader/updatePrice?id=' + id});
  167. },
  168. // 刷新数据
  169. refresh() {
  170. this.loadMore = true;
  171. this.param.pageNo = 1;
  172. this.list = [];
  173. this.getData();
  174. }
  175. },
  176. //下拉刷新
  177. onPullDownRefresh() {
  178. setTimeout(() => {
  179. this.refresh();
  180. uni.stopPullDownRefresh();
  181. }, 1000);
  182. },
  183. //上拉加载
  184. onReachBottom() {
  185. if (this.loadMore) {
  186. this.param.pageNo++;
  187. this.getData();
  188. }
  189. }
  190. };
  191. </script>
  192. <style lang="scss">
  193. page {
  194. background-color: $pg;
  195. }
  196. .state{
  197. margin-right: -70px;
  198. }
  199. </style>