scoreToMoney.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. <!-- 我的佣金 -->
  2. <template>
  3. <s-layout class="wallet-wrap" :bgStyle="{'backgroundColor':'#ffffff'}" title="佣金兑换" navbar="normal">
  4. <view class="score-box bg-white ss-flex-col ss-row-center ">
  5. <view >
  6. <view class="all-title ss-m-r-8 " style="border: 4rpx solid var(--ui-BG-Main);
  7. width: 100%;
  8. box-sizing: border-box;
  9. height: 120rpx;text-indent: 20rpx;border-radius: 20rpx;line-height: 120rpx;">到数字人民币钱包:钱包地址/未绑定----></view>
  10. </view>
  11. <view class="ss-m-y-80 ">
  12. <view class="all-title ss-m-r-8 ss-m-b-10">提现金额</view>
  13. <view class="all-title ss-m-r-8 ss-m-y-30">
  14. <input class="uni-input " style="border: 4rpx solid var(--ui-BG-Main);
  15. width: 100%;
  16. box-sizing: border-box;
  17. height: 100rpx;text-indent: 20rpx;border-radius: 20rpx;" type="number" placeholder="请输入金额" />
  18. </view>
  19. <view class="all-title ss-m-r-8 ss-m-b-10 text-center">您当前可兑换金额:¥0</view>
  20. </view>
  21. <view class="ss-m-b-40 ss-flex ss-row-center">
  22. <view class="all-title ss-m-r-80" @tap="sheep.$router.back('/pages/user/wallet/score')">
  23. <button class="btn ss-reset-button ui-Shadow-Main">
  24. 取消
  25. </button>
  26. </view>
  27. <view class="all-title ss-m-r-8">
  28. <button class="btn ss-reset-button ui-Shadow-Main">
  29. 确定
  30. </button>
  31. </view>
  32. </view>
  33. </view>
  34. </s-layout>
  35. </template>
  36. <script setup>
  37. import sheep from '@/sheep';
  38. import {
  39. onLoad,
  40. onReachBottom
  41. } from '@dcloudio/uni-app';
  42. import {
  43. computed,
  44. reactive
  45. } from 'vue';
  46. import _ from 'lodash';
  47. import dayjs from 'dayjs';
  48. import PointApi from '@/sheep/api/member/point';
  49. import {
  50. resetPagination
  51. } from '@/sheep/util';
  52. const statusBarHeight = sheep.$platform.device.statusBarHeight * 2;
  53. const userInfo = computed(() => sheep.$store('user').userInfo);
  54. const sys_navBar = sheep.$platform.navbar;
  55. const state = reactive({
  56. currentTab: 0,
  57. pagination: {
  58. list: 0,
  59. total: 0,
  60. pageSize: 6,
  61. pageNo: 1,
  62. },
  63. loadStatus: '',
  64. date: [],
  65. today: '',
  66. showModel: false,
  67. showQueModel: false
  68. });
  69. const close = () => {
  70. state.showModel = false
  71. state.showQueModel = false
  72. }
  73. const tabMaps = [{
  74. name: '全部',
  75. value: 'all',
  76. },
  77. {
  78. name: '收入',
  79. value: 'true',
  80. },
  81. {
  82. name: '支出',
  83. value: 'false',
  84. },
  85. ];
  86. const dateFilterText = computed(() => {
  87. if (state.date[0] === state.date[1]) {
  88. return state.date[0];
  89. } else {
  90. return state.date.join('~');
  91. }
  92. });
  93. async function getLogList() {
  94. state.loadStatus = 'loading';
  95. let {
  96. code,
  97. data
  98. } = await PointApi.getPointRecordPage({
  99. pageNo: state.pagination.pageNo,
  100. pageSize: state.pagination.pageSize,
  101. addStatus: state.currentTab > 0 ? tabMaps[state.currentTab].value : undefined,
  102. 'createTime[0]': state.date[0] + ' 00:00:00',
  103. 'createTime[1]': state.date[1] + ' 23:59:59',
  104. });
  105. if (code !== 0) {
  106. return;
  107. }
  108. state.pagination.list = data.list;
  109. state.pagination.total = data.total;
  110. state.loadStatus = state.pagination.list.length < state.pagination.total ? 'more' : 'noMore';
  111. }
  112. onLoad(() => {
  113. state.today = dayjs().format('YYYY-MM-DD');
  114. state.date = [state.today, state.today];
  115. getLogList();
  116. });
  117. function onChange(e) {
  118. state.currentTab = e.index;
  119. resetPagination(state.pagination);
  120. getLogList();
  121. }
  122. function onChangeTime(e) {
  123. state.date[0] = e[0];
  124. state.date[1] = e[e.length - 1];
  125. resetPagination(state.pagination);
  126. getLogList();
  127. }
  128. function onLoadMore() {
  129. if (state.loadStatus === 'noMore') {
  130. return;
  131. }
  132. state.pagination.pageNo++;
  133. getLogList();
  134. }
  135. onReachBottom(() => {
  136. onLoadMore();
  137. });
  138. </script>
  139. <style lang="scss" scoped>
  140. .score-box {
  141. margin: 20rpx;
  142. border-radius: 20rpx;
  143. padding-top: 50rpx;
  144. }
  145. input {}
  146. .btn {
  147. width: 200rpx;
  148. background: linear-gradient(90deg, var(--ui-BG-Main), var(--ui-BG-Main-gradient));
  149. border-radius: 20rpx;
  150. font-size: 30rpx;
  151. font-weight: 500;
  152. line-height: 80rpx;
  153. color: $white;
  154. position: relative;
  155. z-index: 1;
  156. }
  157. </style>