reflectList.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. <template>
  2. <view class="app-container">
  3. <uv-navbar
  4. title="提现明细"
  5. placeholder
  6. autoBack
  7. bgColor="#ffffff"
  8. ></uv-navbar>
  9. <view class="main-list">
  10. <view
  11. class="main-list-item"
  12. v-for="(item, index) in dataList"
  13. :key="index"
  14. @click.stop="handleWithdraw(item)"
  15. >
  16. <view class="item-view u-flex-center-sb">
  17. <text class="time">{{ item.createTime }}</text>
  18. <text v-if="item.status == 1">待审核</text>
  19. <text class="status" v-if="item.status == 3">已到账</text>
  20. <text v-if="item.status == 2">提现失败</text>
  21. </view>
  22. <view class="item-view u-flex-center-sb">
  23. <view class="lable">提现金额:</view>
  24. <view class="value u-flex-center">
  25. <text class="num">¥{{ item.amount }}</text>
  26. <uv-icon name="arrow-right" color="#1a1a1a" size="30rpx"></uv-icon>
  27. </view>
  28. </view>
  29. </view>
  30. </view>
  31. <noData v-if="dataList == 0" :config="{ top: 10, content: '暂无数据~' }" />
  32. <loadMore v-if="dataList.length > 0" :status="status" />
  33. </view>
  34. </template>
  35. <script setup>
  36. import { ref } from "vue";
  37. import { onLoad, onReachBottom, onPullDownRefresh } from "@dcloudio/uni-app";
  38. import { withdrawalPage_Api } from "@/api/userInfo.js";
  39. import { agentWithdrawalPage_Api } from "@/api/agencyCenter.js";
  40. const pageType = ref("1"); // 1:用户 2:代理商
  41. const params = ref({ pageNum: 1, pageSize: 10 });
  42. const dataList = ref([]);
  43. const status = ref("loading");
  44. const handleWithdraw = (item) => {
  45. uni.navigateTo({
  46. url: `/pages/user/wallet/reflectDetails?pageType=${pageType.value}&id=${item.id}`,
  47. });
  48. };
  49. // 查询提现明细
  50. const getList = () => {
  51. status.value = "loading";
  52. uni.showLoading({
  53. title: "加载中...",
  54. mask: true,
  55. });
  56. let url =
  57. pageType.value == "1" ? withdrawalPage_Api : agentWithdrawalPage_Api;
  58. url(params.value)
  59. .then((res) => {
  60. uni.hideLoading();
  61. if (res && res.code == 200) {
  62. uni.stopPullDownRefresh();
  63. dataList.value = dataList.value.concat(res.rows);
  64. if (res.total <= dataList.value.length) {
  65. status.value = "noMore";
  66. } else {
  67. status.value = "more";
  68. }
  69. }
  70. })
  71. .catch((err) => {
  72. uni.hideLoading();
  73. });
  74. };
  75. onLoad((options) => {
  76. if (options.pageType) {
  77. pageType.value = options.pageType;
  78. }
  79. getList();
  80. });
  81. onReachBottom(() => {
  82. if (status.value !== "loading" && status.value !== "noMore") {
  83. params.value.pageNum++;
  84. getList();
  85. }
  86. });
  87. onPullDownRefresh(() => {
  88. params.value.pageNum = 1;
  89. dataList.value = [];
  90. getList();
  91. });
  92. </script>
  93. <style lang="scss" scoped>
  94. .app-container {
  95. padding: 54rpx;
  96. box-sizing: border-box;
  97. .main-list {
  98. .main-list-item {
  99. padding: 30rpx 0;
  100. border-bottom: 1rpx solid #f0f0f0;
  101. .item-view {
  102. font-size: 26rpx;
  103. margin-bottom: 10rpx;
  104. &:last-child {
  105. margin-bottom: 0;
  106. }
  107. .time {
  108. color: #999999;
  109. }
  110. .status {
  111. color: #00c220;
  112. }
  113. .lable {
  114. font-size: 28rpx;
  115. font-weight: 700;
  116. color: #1a1a1a;
  117. }
  118. .value {
  119. .num {
  120. font-size: 28rpx;
  121. font-weight: 400;
  122. color: #da4f4f;
  123. }
  124. }
  125. }
  126. }
  127. }
  128. }
  129. </style>