Order.vue 3.3 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.shopName}}</view>
  9. <view class="con">
  10. <view class="productName omit">{{ item.goodsNames }}</view>
  11. <view class="desc omit">
  12. <text>{{ item.sumGrossWt }} kg</text>
  13. <text>{{ item.fieldName }}</text>
  14. </view>
  15. <view class="price">¥ {{ item.sumAmt }}</view>
  16. </view>
  17. <view class="clear"></view>
  18. <view class="op">
  19. <view class="date">{{ item.declTime }}</view>
  20. </view>
  21. </view>
  22. <view class="loading" v-if="loadMore"><u-loadmore :status="loadMore ? 'loading' : 'nomore'" /></view>
  23. <u-empty v-if="!loadMore && list.length == 0"></u-empty>
  24. </view>
  25. </view>
  26. </template>
  27. <script>
  28. export default {
  29. data() {
  30. return {
  31. tab: [
  32. ],
  33. param: {
  34. pageNo: 1,
  35. pageSize: 10
  36. },
  37. list: [],
  38. loadMore: true,
  39. show: false,
  40. value: 0
  41. };
  42. },
  43. onLoad() {
  44. this.getData();
  45. uni.$on("refreshPage", res => {
  46. this.refresh();
  47. })
  48. },
  49. methods: {
  50. getData() {
  51. this.http.request({
  52. url: '/level-one-server/app/HtTradeSettlement/getList',
  53. loading: 'false',
  54. data: this.param,
  55. success: res => {
  56. this.loadMore = parseInt(res.data.pageCount) > this.param.pageNo;
  57. if (res.data.data) {
  58. this.list.push(...res.data.data);
  59. }
  60. this.list.map(item => {
  61. if (item.callCarStatus == 1) {
  62. item.enterpriseConfirm = 3
  63. } else if (item.callCarStatus == 2) {
  64. item.enterpriseConfirm = 4
  65. }
  66. })
  67. }
  68. });
  69. },
  70. // 商家确认
  71. confirm(id, goodsId, status, content) {
  72. //enterprise_confirm:'商铺确认情况[0=待确认,1=已确认,2=拒绝]'
  73. uni.showModal({
  74. title: '提示',
  75. content: content,
  76. success: res => {
  77. if (res.confirm) {
  78. this.http.request({
  79. url: '/level-one-server/app/TbOrder/updateEnterpriseConfirm',
  80. data: {
  81. id: id,
  82. goodsId: goodsId,
  83. enterpriseConfirm: status
  84. },
  85. method: 'POST',
  86. success: resp => {
  87. uni.showToast({
  88. title: '操作成功'
  89. });
  90. this.refresh();
  91. }
  92. });
  93. }
  94. }
  95. });
  96. },
  97. //点击tab切换
  98. click(e) {
  99. this.param.enterpriseConfirm = e.enterpriseConfirm;
  100. this.param.isOrders = e.isOrders;
  101. this.refresh();
  102. },
  103. detail(item) {
  104. uni.navigateTo({
  105. url: '/pages/market/one/enterprise/detail?id=' + item.id
  106. });
  107. },
  108. //刷新数据
  109. refresh() {
  110. this.loadMore = true;
  111. this.param.pageNo = 1;
  112. this.list = [];
  113. this.getData();
  114. },
  115. // 弹窗显示司机信息
  116. showPop(item) {
  117. // this.show = !this.show
  118. uni.navigateTo({
  119. url: '/pages/market/one/merchant/order/vehice?item=' + JSON.stringify(item)
  120. })
  121. },
  122. close() {
  123. this.show = false
  124. this.refresh()
  125. },
  126. },
  127. //下拉刷新
  128. onPullDownRefresh() {
  129. setTimeout(() => {
  130. this.refresh();
  131. uni.stopPullDownRefresh();
  132. }, 1000);
  133. },
  134. //上拉加载
  135. onReachBottom() {
  136. if (this.loadMore) {
  137. this.param.pageNo++;
  138. this.getData();
  139. }
  140. }
  141. };
  142. </script>
  143. <style lang="scss">
  144. page {
  145. background-color: $pg;
  146. }
  147. </style>