distribution.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. <template>
  2. <view class="distribution">
  3. <view class="distribution-block">
  4. <!-- <view class="title" @click="handleCollapse(item.id)">
  5. <text>{{item.label}}</text>
  6. <u-icon :name="getIsOpenItem(item.id) ? 'arrow-down-fill' : 'arrow-up-fill'" color="#9D9D9D" size="12">
  7. </u-icon>
  8. </view> -->
  9. <view class="list" v-for="info in list" :key="info.id">
  10. <view class="item">
  11. <view class="display-flex-between">
  12. <view class="code">
  13. 订单编号:{{info.order_no}}
  14. </view>
  15. <view class="time">
  16. {{info.date}}
  17. </view>
  18. </view>
  19. <view class="display-flex-between">
  20. <view class="name">
  21. <text style="color: #696969;font-weight: 400;">用户昵称:</text>{{info.order_user}}
  22. </view>
  23. <view class="amount">
  24. <text class="color-red">¥{{info.amount}}</text>
  25. <!-- <text style="font-weight: 400;">({{info.status == 0 ? '冻结':'解冻'}})</text> -->
  26. </view>
  27. </view>
  28. <view class="display-flex-between">
  29. <view class="name">
  30. <text style="color: #696969;font-weight: 400;">订单金额:</text>¥{{info.order_amount}}
  31. </view>
  32. <view class="amount">
  33. <text>{{info.status == 0 ? '冻结':'解冻'}}</text>
  34. </view>
  35. </view>
  36. </view>
  37. </view>
  38. </view>
  39. </view>
  40. </template>
  41. <script>
  42. export default {
  43. data() {
  44. return {
  45. collapseIds: ["00000"],
  46. list: [],
  47. page: 1,
  48. pageSize: 10,
  49. total: 0,
  50. };
  51. },
  52. onLoad() {
  53. this.getData(true)
  54. },
  55. onReachBottom() {
  56. this.getData()
  57. },
  58. methods: {
  59. getData(initFlag) {
  60. if (!initFlag) {
  61. if (this.page * this.pageSize < this.total) {
  62. this.page++
  63. } else {
  64. return
  65. }
  66. } else {
  67. this.page = 1
  68. this.total = 0
  69. this.list = []
  70. }
  71. let sendData = {
  72. page: this.page,
  73. pageSize: this.pageSize
  74. }
  75. this.$api.getDistributionData(sendData).then(res => {
  76. this.list = this.list.concat(res.data.list)
  77. // this.list = [{ order_no: 1111, order_user: '测试', date: '2022-09-20 13:77:11', amount: 1000 }]
  78. this.total = res.data.page.total
  79. })
  80. },
  81. getIsOpenItem(id) {
  82. return this.collapseIds.includes(id)
  83. },
  84. handleCollapse(id) {
  85. if (this.getIsOpenItem(id)) {
  86. this.collapseIds = this.collapseIds.filter(c => c !== id)
  87. console.log('this.collapseIds', this.collapseIds)
  88. } else {
  89. this.collapseIds.push(id)
  90. }
  91. }
  92. }
  93. }
  94. </script>
  95. <style lang="scss" scoped>
  96. .distribution {
  97. height: 100%;
  98. background-color: #F5F6F8;
  99. padding: 20rpx 20rpx 40rpx;
  100. box-sizing: border-box;
  101. &-block {
  102. &:nth-child(n+2) {
  103. margin-top: 20rpx;
  104. }
  105. .title {
  106. height: 76rpx;
  107. background: #ECECEC;
  108. border-radius: 10rpx;
  109. display: flex;
  110. align-items: center;
  111. font-size: 26rpx;
  112. font-weight: 500;
  113. color: #222423;
  114. line-height: 1;
  115. padding: 0 24rpx;
  116. text {
  117. margin-right: 8rpx;
  118. }
  119. }
  120. .item {
  121. // height: 159rpx;
  122. background: #FFFFFF;
  123. border-radius: 10rpx;
  124. padding: 20rpx 25rpx;
  125. margin-top: 15rpx;
  126. // display: flex;
  127. // justify-content: space-between;
  128. // align-items: center;
  129. .code {
  130. font-size: 28rpx;
  131. font-weight: 500;
  132. color: #222423;
  133. line-height: 39rpx;
  134. }
  135. .name {
  136. font-size: 28rpx;
  137. font-weight: bold;
  138. color: #232323;
  139. line-height: 39rpx;
  140. margin-top: 18rpx;
  141. }
  142. .time {
  143. font-size: 24rpx;
  144. font-family: PingFang SC-Medium, PingFang SC;
  145. font-weight: 500;
  146. color: #B2B2B2;
  147. line-height: 34rpx;
  148. }
  149. .amount {
  150. text-align: right;
  151. margin-top: 18rpx;
  152. font-size: 32rpx;
  153. font-family: PingFang SC-Bold, PingFang SC;
  154. font-weight: bold;
  155. line-height: 46rpx;
  156. }
  157. }
  158. }
  159. }
  160. </style>