order.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  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" style="width: 97%;font-size: 17px;">
  9. <span v-if="item.purchaserId === null || item.purchaserId === '' || item.purchaserId === undefined">车牌号 {{ item.veNo }}</span>
  10. <span v-else>采购商 {{ item.purchaserName }}</span>
  11. <span>
  12. <view class="state" v-if="item.purchaserId === null || item.purchaserId === '' || item.purchaserId === undefined"><text class="icon">&#xe830;</text>待下单</view>
  13. <view class="state" v-else><text class="icon" style="color: #13ce66">&#xe830;</text>已下单</view>
  14. </span>
  15. </view>
  16. <view class="con">
  17. <view class="productName omit">{{ item.goodsName }}</view>
  18. <view class="desc omit">
  19. <text>{{ item.tradeAreaName }}</text>
  20. </view>
  21. <view class="price">上架金额 ¥ {{ item.resalePrice }}</view>
  22. </view>
  23. <view class="clear"></view>
  24. <view class="op">
  25. <view class="date">{{ item.createTime }}</view>
  26. <!-- <view class="an" style="color: #4581fb" @click.stop="payTax(item)" v-if="item.isPay == 1 && item.payTax == 0">去缴费税</view> -->
  27. </view>
  28. </view>
  29. <view class="loading" v-if="loadMore"><u-loadmore :status="loadMore ? 'loading' : 'nomore'" /></view>
  30. <u-empty v-if="!loadMore && list.length == 0"></u-empty>
  31. </view>
  32. </view>
  33. </template>
  34. <script>
  35. export default {
  36. data() {
  37. return {
  38. tab: [
  39. { name: '全部'},
  40. { name: '待下单'},
  41. { name: '已下单'},
  42. ],
  43. param: { pageNo: 1, pageSize: 10 },
  44. list: [],
  45. isOrderList: [],
  46. noOrderList: [],
  47. loadMore: true
  48. };
  49. },
  50. onLoad() {
  51. this.getData();
  52. uni.$on('goodsHandle', res => {
  53. this.refresh();
  54. });
  55. },
  56. methods: {
  57. getData(e) {
  58. this.http.request({
  59. url: '/level-two-server/app/TbOrders/getLeaderOrderList',
  60. loading: 'false',
  61. data: this.param,
  62. success: res => {
  63. this.loadMore = parseInt(res.data.pageCount) > this.param.pageNo;
  64. this.list.push(...res.data.data);
  65. this.noOrderList = this.list.filter(item => item.purchaserId === null || item.purchaserId === '' || item.purchaserId === undefined);
  66. this.isOrderList = this.list.filter(item => !this.noOrderList.includes(item));
  67. if(e != undefined && e.name == '待下单') {
  68. this.list = this.noOrderList;
  69. }
  70. if(e != undefined && e.name == '已下单') {
  71. this.list = this.isOrderList;
  72. }
  73. }
  74. });
  75. },
  76. //点击tab切换
  77. click(e) {
  78. this.refresh(e);
  79. },
  80. payTax(item) {
  81. uni.navigateTo({ url: '/pages/market/two/leader/feeDetail?resalePrice=' + item.resalePrice +'&id=' + item.id});
  82. },
  83. detail(item) {
  84. uni.navigateTo({ url: '/pages/market/two/leader/detail?id=' + item.id });
  85. },
  86. //刷新数据
  87. refresh(e) {
  88. this.loadMore = true;
  89. this.param.pageNo = 1;
  90. this.list = [];
  91. this.noOrderList = [];
  92. this.isOrderList = [];
  93. this.getData(e);
  94. }
  95. },
  96. //下拉刷新
  97. onPullDownRefresh() {
  98. setTimeout(() => {
  99. this.refresh();
  100. uni.stopPullDownRefresh();
  101. }, 1000);
  102. },
  103. //上拉加载
  104. onReachBottom() {
  105. if (this.loadMore) {
  106. this.param.pageNo++;
  107. this.getData();
  108. }
  109. },
  110. onNavigationBarButtonTap() {
  111. uni.navigateTo({ url: '/pages/goodsManage/oneMarket/editGoods' });
  112. }
  113. };
  114. </script>
  115. <style lang="scss">
  116. page {
  117. background-color: $pg;
  118. }
  119. </style>