list.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  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 },
  54. loadMore: true
  55. };
  56. },
  57. onLoad(e) {
  58. //this.getData();
  59. },
  60. methods: {
  61. getData() {
  62. this.http.request({
  63. url: '/level-one-server/app/TbGoodsTransit/getTransitList',
  64. data: this.param,
  65. loading: 'false',
  66. success: res => {
  67. this.loadMore = parseInt(res.data.pageCount) > this.param.pageNo;
  68. this.list.push(...res.data.data);
  69. }
  70. });
  71. },
  72. //点击tab切换
  73. click(e) {
  74. this.param.goodsStatus = e.goodsStatus;
  75. this.refresh();
  76. },
  77. detail(item) {
  78. uni.navigateTo({ url: '/pages/market/two/purchaser/buy/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/market/two/purchaser/buy/add' });
  104. }
  105. };
  106. </script>
  107. <style lang="scss">
  108. page {
  109. background-color: $pg;
  110. }
  111. </style>