cooperation.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. <template>
  2. <view>
  3. <view class="goodsList">
  4. <view class="item" v-for="(item, index) in list" :key="index" @click="detail(item)">
  5. <view class="title">
  6. {{ item.enterpriseName }}
  7. <view class="state" v-if="item.cooperEntrustStatus == 0">
  8. <text class="icon">&#xe830;</text>
  9. <text>未确认</text>
  10. </view>
  11. <view class="state" v-if="item.cooperEntrustStatus == 1">
  12. <text class="icon" style="color: #13ce66">&#xe830;</text>
  13. <text>已确认</text>
  14. </view>
  15. </view>
  16. <image src="../../../../static/news.jpg" mode="aspectFill" class="pic"></image>
  17. <view class="con">
  18. <view class="productName omit">{{ item.goodsNames }}</view>
  19. <view class="desc omit">
  20. <text>重量 {{ item.totalWeight }}</text>
  21. <text>{{ item.tradeAreaName }}</text>
  22. </view>
  23. <view class="price">¥ {{ item.totalPrice }}</view>
  24. </view>
  25. <view class="clear"></view>
  26. <view class="op">
  27. <view class="date">{{ item.createTime }}</view>
  28. <template v-if="item.peopleConfirmStatus == 1 && item.cooperEntrustStatus == 0">
  29. <view class="an" style="color: #f44336" @click.stop="cooperOrder(item.id)">确认委托</view>
  30. </template>
  31. </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. param: {
  43. pageNo: 1,
  44. pageSize: 10,
  45. peopleConfirmStatus: 1, //边民确认状态
  46. //cooperEntrustStatus: 0,//互助委托申报确认状态
  47. applyConfirmStatus: 0, //进口申报确认状态
  48. finishStatus: 0, //订单完成状态
  49. resaleStatus: 0 //订单转售状态
  50. },
  51. list: [],
  52. loadMore: true,
  53. };
  54. },
  55. onLoad() {
  56. this.getData();
  57. },
  58. methods: {
  59. getData() {
  60. this.http.request({
  61. url: '/level-one-server/app/TbOrder/getList',
  62. loading: 'false',
  63. data: this.param,
  64. success: res => {
  65. this.loadMore = parseInt(res.data.pageCount) > this.param.pageNo;
  66. if (res.data.data) {
  67. this.list.push(...res.data.data);
  68. }
  69. }
  70. });
  71. },
  72. //互助委托申报确认
  73. cooperOrder(id) {
  74. this.http.request({
  75. url: '/level-one-server/app/TbOrder/cooperOrder',
  76. loading: 'false',
  77. data: { orderId: id },
  78. success: res => {
  79. uni.showToast({ title: '互助委托确认成功' });
  80. this.refresh();
  81. }
  82. });
  83. },
  84. detail(item) {
  85. uni.navigateTo({ url: '/pages/market/one/leader/detail?id=' + item.id });
  86. },
  87. // 刷新数据
  88. refresh() {
  89. this.loadMore = true;
  90. this.param.pageNo = 1;
  91. this.list = [];
  92. this.getData();
  93. }
  94. },
  95. //下拉刷新
  96. onPullDownRefresh() {
  97. setTimeout(() => {
  98. this.refresh();
  99. uni.stopPullDownRefresh();
  100. }, 1000);
  101. },
  102. //上拉加载
  103. onReachBottom() {
  104. if (this.loadMore) {
  105. this.param.pageNo++;
  106. this.getData();
  107. }
  108. }
  109. };
  110. </script>
  111. <style lang="scss">
  112. page {
  113. background-color: $pg;
  114. }
  115. .state {
  116. margin-right: -70px;
  117. }
  118. </style>