distributionOrder.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. <template>
  2. <view class="distribution-order-container">
  3. <JHeader title="我的分销订单" width="50" height="50" style="padding: 24upx 0 0;"></JHeader>
  4. <view v-if="findMySalesDatalist && findMySalesDatalist.length">
  5. <view v-for="(item, index) in findMySalesDatalist" :key="index" class="flex-center clientList-box">
  6. <view class="directAward-box font-color-656 fs26">
  7. <view class="directAward-icon flex-row-plus flex-items flex-sp-between" @click="arrowTypeChange(index)">
  8. <view class="flex-column-plus font-color-333 fs30">
  9. <label class="orderId-box">订单号:{{ item.orderId }}</label>
  10. <view class="orderId-box mar-top-20">
  11. 佣金:<label class="font-color-C5AA7B">¥{{ item.commission }}</label>
  12. </view>
  13. </view>
  14. <view>
  15. <tui-icon
  16. :name="item.ifOpen ? 'arrowup' : 'arrowdown'" :size="30" unit="upx" margin="0"
  17. color="#b7b7b7"
  18. ></tui-icon>
  19. </view>
  20. </view>
  21. <view v-if="item.ifOpen == true" class="upBox">
  22. <view class="flex-row-plus flex-items mar-top-30 flex-sp-between">
  23. <label class="orderId-box font-color-999 fs26">商品数:{{ item.products }}</label>
  24. <label class="orderId-box font-color-999 fs26">实付金额:¥{{ item.price }}</label>
  25. </view>
  26. <view class="flex-row-plus flex-items mar-top-30 flex-sp-between">
  27. <label class="orderId-box font-color-999 fs26">下单人:{{ item.customerName }}</label>
  28. <label class="commission-box mar-left-70 font-color-999 fs26">
  29. 状态:<text class="state" :class="{ current: item.state == 0 }">
  30. {{ item.state === 0 ? '未结算' : '已结算' }}
  31. </text>
  32. </label>
  33. </view>
  34. </view>
  35. </view>
  36. </view>
  37. </view>
  38. <view style="padding-bottom: 45upx;">
  39. <LoadingMore
  40. :status="!isEmpty && !findMySalesDatalist.length
  41. ? 'loading' : !isEmpty && findMySalesDatalist.length && (findMySalesDatalist.length >= findMySalesDataTotal) ? 'no-more' : ''"
  42. >
  43. </LoadingMore>
  44. <tui-no-data v-if="isEmpty" :fixed="false" style="margin-top: 60upx;">这里空空如也~</tui-no-data>
  45. </view>
  46. </view>
  47. </template>
  48. <script>
  49. import { getDistributorOrderApi } from '../../../api/anotherTFInterface'
  50. export default {
  51. name: 'DistributionOrder',
  52. data() {
  53. return {
  54. isEmpty: false,
  55. findMySalesDatalist: [],
  56. findMySalesDataTotal: 0,
  57. queryInfo: {
  58. page: 1,
  59. pageSize: 20,
  60. shopId: 0,
  61. distributorId: 0
  62. }
  63. }
  64. },
  65. onLoad(options) {
  66. this.queryInfo.shopId = options.shopId
  67. this.queryInfo.distributorId = options.distributorId
  68. this.getSalesOrderPage()
  69. },
  70. methods: {
  71. getSalesOrderPage(isLoadmore) {
  72. uni.showLoading()
  73. getDistributorOrderApi(this.queryInfo).then((res) => {
  74. this.findMySalesDataTotal = res.data.total
  75. if (isLoadmore) {
  76. this.findMySalesDatalist.push(...res.data.list)
  77. } else {
  78. this.findMySalesDatalist = res.data.list
  79. }
  80. this.isEmpty = this.findMySalesDatalist.length === 0
  81. uni.hideLoading()
  82. })
  83. .catch((e) => {
  84. uni.hideLoading()
  85. })
  86. },
  87. arrowTypeChange(arrowTypeId) {
  88. this.findMySalesDatalist[arrowTypeId].ifOpen = this.findMySalesDatalist[arrowTypeId].ifOpen != true
  89. }
  90. },
  91. onReachBottom() {
  92. if (this.findMySalesDatalist.length < this.findMySalesDataTotal) {
  93. ++this.queryInfo.page
  94. this.getSalesOrderPage(true)
  95. }
  96. }
  97. }
  98. </script>
  99. <style lang="less" scoped>
  100. .distribution-order-container {
  101. min-height: 100%;
  102. background-color: #F8F8F8;
  103. box-sizing: border-box;
  104. .directAward-box {
  105. width: 95%;
  106. display: flex;
  107. justify-content: flex-start;
  108. flex-direction: column;
  109. background-color: #FFFFFF;
  110. padding: 40upx 20upx;
  111. margin-top: 30upx;
  112. .orderId-box {
  113. width: 320upx;
  114. }
  115. .commission-box {
  116. width: 340upx;
  117. }
  118. .state {
  119. color: #16BB89;
  120. }
  121. .current {
  122. color: #C83732 !important;
  123. }
  124. .upBox {
  125. border-top: 1upx solid #EDEDED;
  126. margin-top: 30upx;
  127. }
  128. }
  129. }
  130. </style>