RechargeCustomBusiness.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. <template>
  2. <view style="width: 100%;height: 100%;">
  3. <scroll-view
  4. scroll-y style="height: 100%;" @scrolltolower="handleScrolltolower"
  5. >
  6. <view v-if="rechargeList && rechargeList.length">
  7. <view v-for="(item, index) in rechargeList" :key="index">
  8. <tui-collapse
  9. :index="index" :current="currentIndexRecharge" hd-bg-color="#ffffff"
  10. @click="changeCurrentRecharge"
  11. >
  12. <template #title>
  13. <tui-list-cell background-color="transparent" padding="26upx 80upx 26upx 30upx">
  14. <view style="display: flex;justify-content: space-between;align-items: center;">
  15. <view>ID:{{ item.id }}</view>
  16. <view style="font-size: 26upx;color: #605D52;text-align: right;">
  17. <view>客户余额:{{ item.buyerUserBalance }}</view>
  18. <view>充值余额:{{ item.recharge }}</view>
  19. </view>
  20. </view>
  21. </tui-list-cell>
  22. </template>
  23. <template #content>
  24. <view style="margin: 0 24upx;background-color: #ebebea;">
  25. <view v-if="item.orderList && item.orderList.length">
  26. <tui-list-view title="">
  27. <tui-list-cell
  28. v-for="part in item.orderList" :key="part.orderFormid"
  29. background-color="transparent"
  30. >
  31. <view style="display: flex;justify-content: space-between;align-items: center;padding-left: 16upx;">
  32. <text>订单ID:{{ part.orderFormid || '--' }}</text>
  33. <text>状态:{{ orderTypeEnum[part.state] || '--' }}</text>
  34. </view>
  35. <view style="display: flex;justify-content: space-between;align-items: center;padding-left: 16upx;">
  36. <text style="color: red;">总价:¥{{ part.orderPrice || '0' }}</text>
  37. <text style="color: red;">支付:¥{{ part.price || '0' }}</text>
  38. </view>
  39. </tui-list-cell>
  40. </tui-list-view>
  41. </view>
  42. <view v-else style="padding: 28upx 0;text-align: center;">
  43. 客户消费订单列表空空如也~
  44. </view>
  45. </view>
  46. </template>
  47. </tui-collapse>
  48. </view>
  49. </view>
  50. <view style="padding-bottom: 45upx;">
  51. <LoadingMore
  52. :status="!isEmpty && !rechargeList.length
  53. ? 'loading' : !isEmpty && rechargeList.length && (rechargeList.length >= rechargeTotal) ? 'no-more' : ''"
  54. >
  55. </LoadingMore>
  56. <tui-no-data v-if="isEmpty" :fixed="false" style="margin-top: 60upx;">暂无客户充值数据</tui-no-data>
  57. </view>
  58. </scroll-view>
  59. </view>
  60. </template>
  61. <script>
  62. import { orderTypeEnum } from '../../../../components/ATFOrderInfo/config'
  63. import { getbBusinessByRechargeCustomApi } from '../../../../api/anotherTFInterface'
  64. export default {
  65. name: 'RechargeCustomBusiness',
  66. props: {},
  67. data() {
  68. return {
  69. queryInfo: {
  70. page: 1,
  71. pageSize: 10
  72. },
  73. rechargeTotal: 0,
  74. isEmpty: false,
  75. rechargeList: [],
  76. currentIndexRecharge: 0,
  77. orderTypeEnum
  78. }
  79. },
  80. created() {
  81. // console.log(this.$refs)
  82. // this.getShopRechargeCustom()
  83. },
  84. methods: {
  85. getShopRechargeCustom(isLoadmore) {
  86. uni.showLoading()
  87. getbBusinessByRechargeCustomApi({ ...this.queryInfo })
  88. .then((res) => {
  89. this.rechargeTotal = res.data.total
  90. if (isLoadmore) {
  91. this.rechargeList.push(...res.data.records)
  92. } else {
  93. this.rechargeList = res.data.records
  94. }
  95. this.isEmpty = this.rechargeList.length === 0
  96. uni.hideLoading()
  97. })
  98. .catch(() => {
  99. uni.hideLoading()
  100. })
  101. },
  102. changeCurrentRecharge(e) {
  103. // 可关闭自身
  104. this.currentIndexRecharge = this.currentIndexRecharge == e.index ? -1 : e.index
  105. },
  106. handleScrolltolower() {
  107. if (this.rechargeList.length < this.rechargeTotal) {
  108. ++this.queryInfo.page
  109. this.getShopRechargeCustom(true)
  110. }
  111. }
  112. }
  113. }
  114. </script>
  115. <style lang="less" scoped></style>