order.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  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.createName }}</view>
  9. <view>
  10. <view class="state" style="color: red" v-if="item.purchaserId === null || item.purchaserId === '' || item.purchaserId === undefined">待下单</view>
  11. <view class="state" style="color: red" v-else>已下单</view>
  12. </view>
  13. <view class="state" style="color: #4581fb" v-if="item.isPay == 1 && item.payTax == 0">已支付</view>
  14. <view class="state" style="color: #13ce66" v-if="item.payTax == 1 && item.orderFinish == 1">已完成</view>
  15. <image src="../../../../static/news.jpg" mode="aspectFill" class="pic"></image>
  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: '全部', isPay: '', payTax: '', orderFinish: ''},
  40. { name: '已支付', isPay: 1, payTax: 0, orderFinish: 0},
  41. { name: '已完成', isPay: 1, payTax: 1, orderFinish: 1}
  42. ],
  43. param: { pageNo: 1, pageSize: 10 },
  44. list: [],
  45. loadMore: true
  46. };
  47. },
  48. onLoad() {
  49. this.getData();
  50. uni.$on('goodsHandle', res => {
  51. this.refresh();
  52. });
  53. },
  54. methods: {
  55. getData() {
  56. this.http.request({
  57. url: '/level-two-server/app/TbOrders/getLeaderOrderList',
  58. loading: 'false',
  59. data: this.param,
  60. success: res => {
  61. this.loadMore = parseInt(res.data.pageCount) > this.param.pageNo;
  62. this.list.push(...res.data.data);
  63. console.log("purchaserId="+this.list[0].purchaserId)
  64. }
  65. });
  66. },
  67. //点击tab切换
  68. click(e) {
  69. this.param.isPay = e.isPay;
  70. this.param.payTax = e.payTax;
  71. this.param.orderFinish = e.orderFinish;
  72. this.refresh();
  73. },
  74. payTax(item) {
  75. uni.navigateTo({ url: '/pages/market/two/leader/feeDetail?resalePrice=' + item.resalePrice +'&id=' + item.id});
  76. },
  77. detail(item) {
  78. uni.navigateTo({ url: '/pages/market/two/leader/detail?id=' + item.id });
  79. },
  80. //刷新数据
  81. refresh() {
  82. this.loadMore = true;
  83. this.param.pageNo = 1;
  84. this.list = [];
  85. this.getData();
  86. }
  87. },
  88. //下拉刷新
  89. onPullDownRefresh() {
  90. setTimeout(() => {
  91. this.refresh();
  92. uni.stopPullDownRefresh();
  93. }, 1000);
  94. },
  95. //上拉加载
  96. onReachBottom() {
  97. if (this.loadMore) {
  98. this.param.pageNo++;
  99. this.getData();
  100. }
  101. },
  102. onNavigationBarButtonTap() {
  103. uni.navigateTo({ url: '/pages/goodsManage/oneMarket/editGoods' });
  104. }
  105. };
  106. </script>
  107. <style lang="scss">
  108. page {
  109. background-color: $pg;
  110. }
  111. </style>