peopleOrders.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  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">
  10. <text class="icon">&#xe830;</text>
  11. <text>未确认</text>
  12. </view>
  13. <view class="state" v-if="item.peopleConfirmStatus == 1">
  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>
  33. <view class="loading" v-if="loadMore"><u-loadmore :status="loadMore ? 'loading' : 'nomore'" /></view>
  34. <u-empty v-if="!loadMore && list.length == 0"></u-empty>
  35. </view>
  36. </view>
  37. </template>
  38. <script>
  39. export default {
  40. data() {
  41. return {
  42. tab: [
  43. {
  44. name: '全部',
  45. peopleConfirmStatus: '', //边民确认状态
  46. finishStatus: '', //订单完成状态
  47. resaleStatus: '' //订单转售状态
  48. },
  49. {
  50. name: '待确认',
  51. peopleConfirmStatus: 0,
  52. finishStatus: 0,
  53. resaleStatus: 0
  54. },
  55. {
  56. name: '申报中',
  57. peopleConfirmStatus: 1,
  58. finishStatus: 0,
  59. resaleStatus: 0
  60. },
  61. {
  62. name: '已完成',
  63. peopleConfirmStatus: 1,
  64. finishStatus: 1,
  65. resaleStatus: 0
  66. },
  67. {
  68. name: '已转售',
  69. peopleConfirmStatus: 1,
  70. finishStatus: 1,
  71. resaleStatus: 1
  72. }
  73. ],
  74. param: {
  75. pageNo: 1,
  76. pageSize: 10
  77. },
  78. user:this.getUser(),
  79. list: [],
  80. loadMore: false,
  81. collageOrdersId: ''
  82. };
  83. },
  84. onLoad(e) {
  85. if(e.collageOrdersId) {
  86. this.collageOrdersId = e.collageOrdersId;
  87. this.getData();
  88. }
  89. },
  90. methods: {
  91. getData() {
  92. this.http.request({
  93. url: '/level-one-server/app/TbOrder/getList',
  94. loading: 'false',
  95. data: {collageOrdersId : this.collageOrdersId},
  96. success: res => {
  97. this.loadMore = parseInt(res.data.pageCount) > this.param.pageNo;
  98. if (res.data.data) {
  99. this.list.push(...res.data.data);
  100. }
  101. }
  102. });
  103. },
  104. // 点击tab切换
  105. click(e) {
  106. console.log(e);
  107. this.param.peopleConfirmStatus = e.appeopleConfirmStatusply;
  108. this.param.finishStatus = e.finishStatus;
  109. this.param.resaleStatus = e.resaleStatus;
  110. this.refresh();
  111. },
  112. detail(item) {
  113. uni.navigateTo({url: '/pages/market/one/leader/detail?id=' + item.id});
  114. },
  115. // 刷新数据
  116. refresh() {
  117. this.loadMore = true;
  118. this.param.pageNo = 1;
  119. this.list = [];
  120. this.getData();
  121. },
  122. },
  123. //下拉刷新
  124. onPullDownRefresh() {
  125. setTimeout(() => {
  126. this.refresh();
  127. uni.stopPullDownRefresh();
  128. }, 1000);
  129. },
  130. //上拉加载
  131. onReachBottom() {
  132. if (this.loadMore) {
  133. this.param.pageNo++;
  134. this.getData();
  135. }
  136. }
  137. };
  138. </script>
  139. <style lang="scss">
  140. page {
  141. background-color: $pg;
  142. }
  143. .state{
  144. margin-right: -70px;
  145. }
  146. </style>