order.vue 3.0 KB

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