peopleOrders.vue 3.8 KB

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