list.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. <template>
  2. <view>
  3. <view class="tab">
  4. <u-tabs :list="tab" @click="click" :lineHeight="5"></u-tabs>
  5. </view>
  6. <view class="goodsManageList">
  7. <view class="item" v-for="(item, index) in list" :key="index" @click="detail(item)">
  8. <view class="top">
  9. <view class="title omit">八角茴香(未磨) (可食用)八角茴香(未磨) (可食用)八角茴香(未磨) (可食用)</view>
  10. <view class="icon">&#xe852;</view>
  11. <view class="clear"></view>
  12. </view>
  13. <view class="con">
  14. <view class="flex fs">
  15. <view class="f left" style="flex: 0.5">
  16. <view class="tag">净重:50吨</view>
  17. </view>
  18. <view class="f left">
  19. <view class="tag">2023-08-03 22:37:02</view>
  20. </view>
  21. </view>
  22. </view>
  23. <view class="op">
  24. <view class="flex">
  25. <view class="f rline">
  26. <text class="icon" style="color: #ff660d">&#xe668;</text>
  27. <text>编辑</text>
  28. </view>
  29. <view class="f">
  30. <text class="icon" style="color: #0081ff">&#xe743;</text>
  31. <text>发布</text>
  32. </view>
  33. </view>
  34. </view>
  35. <view class="clear"></view>
  36. </view>
  37. </view>
  38. </view>
  39. </template>
  40. <script>
  41. export default {
  42. data() {
  43. return {
  44. tab: [
  45. { name: '全部', goodsStatus: '' },
  46. { name: '未报价', goodsStatus: 1 },
  47. { name: '已报价', goodsStatus: 0 },
  48. // { name: '已接单', goodsStatus: 0 },
  49. // { name: '已确认', goodsStatus: 0 },
  50. // { name: '已完成', goodsStatus: 0 }
  51. ],
  52. list: [{}, {}, {}, {}, {}],
  53. param: { pageNo: 1, pageSize: 10, isOrders: 0 },
  54. loadMore: true
  55. };
  56. },
  57. onLoad(e) {
  58. //this.getData();
  59. this.goodsDemandList()
  60. },
  61. methods: {
  62. getData() {
  63. this.http.request({
  64. url: '/level-one-server/app/TbGoodsTransit/getTransitList',
  65. data: this.param,
  66. loading: 'false',
  67. success: res => {
  68. this.loadMore = parseInt(res.data.pageCount) > this.param.pageNo;
  69. this.list.push(...res.data.data);
  70. }
  71. });
  72. },
  73. //当前已被报价的需求列表
  74. goodsDemandList() {
  75. this.http.request({
  76. url: '/level-two-server/app/TbGoodsDemand/goodsDemandList',
  77. data: this.param,
  78. loading: 'false',
  79. success: res => {
  80. this.loadMore = parseInt(res.data.pageCount) > this.param.pageNo;
  81. // this.list.push(...res.data.data);
  82. }
  83. });
  84. },
  85. //处理已被报价的需求
  86. disposeOrders() {
  87. let params = {
  88. disposeStatus: 1,
  89. goodsDemandId: 1,
  90. demandQuotationId: 1
  91. }
  92. this.http.request({
  93. url: '/level-two-server/app/TbGoodsDemand/disposeOrders',
  94. data: params,
  95. loading: 'false',
  96. success: res => {
  97. this.loadMore = parseInt(res.data.pageCount) > this.param.pageNo;
  98. // this.list.push(...res.data.data);
  99. }
  100. });
  101. },
  102. //点击tab切换
  103. click(e) {
  104. this.param.goodsStatus = e.goodsStatus;
  105. this.refresh();
  106. },
  107. detail(item) {
  108. uni.navigateTo({ url: '/pages/market/two/purchaser/buy/detail?id=' + item.id });
  109. },
  110. //刷新数据
  111. refresh() {
  112. this.loadMore = true;
  113. this.param.pageNo = 1;
  114. this.list = [];
  115. this.getData();
  116. }
  117. },
  118. //下拉刷新
  119. onPullDownRefresh() {
  120. setTimeout(() => {
  121. this.refresh();
  122. uni.stopPullDownRefresh();
  123. }, 1000);
  124. },
  125. //上拉加载
  126. onReachBottom() {
  127. if (this.loadMore) {
  128. this.param.pageNo++;
  129. this.getData();
  130. }
  131. },
  132. onNavigationBarButtonTap() {
  133. uni.navigateTo({ url: '/pages/market/two/purchaser/buy/add' });
  134. }
  135. };
  136. </script>
  137. <style lang="scss">
  138. page {
  139. background-color: $pg;
  140. }
  141. </style>