withdrawalLog.vue 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261
  1. <template>
  2. <!-- 提现记录 -->
  3. <s-layout class="wallet-wrap" :bgStyle="{'backgroundColor':'#ffffff'}" :title="t('wallet.withdrawal_records')" navbar="normal">
  4. <view class="model-box ss-flex-col">
  5. <scroll-view class="list-box" scroll-y="true" @touchmove.stop>
  6. <view v-if="state.pagination.total > 0" style="padding: 20rpx;">
  7. <view class="list-item ss-flex ss-col-center ss-row-between "
  8. v-for="(item,index) in state.pagination.list" :key="item.id"
  9. style="padding:0;padding: 20rpx 0;border-bottom: 1px solid #c4c4c4;">
  10. <view class="ss-flex ss-col-center" style="width: 100%;">
  11. <view class="ss-flex ss-m-t-10"
  12. style="flex-direction: column;align-items: flex-start;width: 100%;">
  13. <view class="name" style="width: 100%;">
  14. {{item.withdrawalType === 1 ? t('wallet.wechat') : item.withdrawalType === 2 ? t('wallet.alipay') : t('wallet.bank_card')}}
  15. ({{item.withdrawalAccount}})
  16. <text style="float: right;" class="color-red">
  17. ¥{{fen2yuan(item.amount) }} ({{t('wallet.consumption_points')+ points2point(item.withdrawConsumption)}})
  18. </text>
  19. </view>
  20. <view class="time " style="width: 100%;">
  21. {{sheep.$helper.timeFormat(item.createTime, 'yyyy-mm-dd hh:MM')}}
  22. <text style="float: right;" >{{item.status ? item.status === 1 ? t('wallet.credited') : t('wallet.withdrawal_failed') : t('wallet.withdrawing')}}</text>
  23. </view>
  24. </view>
  25. </view>
  26. </view>
  27. </view>
  28. <s-empty v-else text="暂无数据" paddingTop="200" icon="/static/data-empty.png" />
  29. <uni-load-more v-if="state.pagination.total > 0" :status="state.loadStatus" :content-text="{
  30. contentdown: t('common.click_to_load_more'),
  31. }" @tap="onLoadMore(true)" @scrolltolower="onLoadMore(true)" />
  32. </scroll-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 {
  47. points2point,
  48. fen2yuan
  49. } from '@/sheep/hooks/useGoods';
  50. import _ from 'lodash';
  51. import dayjs from 'dayjs';
  52. import PointApi from '@/sheep/api/member/point';
  53. import {
  54. resetPagination
  55. } from '@/sheep/util';
  56. import WithdrawalApi from '@/sheep/api/distri/withdrawal';
  57. import { t } from '@/locale'
  58. const userWallet = computed(() => sheep.$store('user').userWallet);
  59. const statusBarHeight = sheep.$platform.device.statusBarHeight * 2;
  60. const userInfo = computed(() => sheep.$store('user').userInfo);
  61. const sys_navBar = sheep.$platform.navbar;
  62. const state = reactive({
  63. currentTab: 0,
  64. pagination: {
  65. list: [],
  66. total: 0,
  67. pageSize: 10,
  68. pageNo: 1,
  69. },
  70. loadStatus: '',
  71. });
  72. async function getLogList() {
  73. state.loadStatus = 'loading';
  74. // isFreeze为true是冻结佣金 isFreeze为false是已拿到的佣金
  75. let {
  76. code,
  77. data
  78. } = await WithdrawalApi.getWithdrawalPage({
  79. pageNo: state.pagination.pageNo,
  80. pageSize: state.pagination.pageSize,
  81. });
  82. if (code !== 0) {
  83. return;
  84. }
  85. let list = _.concat(state.pagination.list, data.list);
  86. state.pagination.list = list;
  87. state.pagination.total = data.total;
  88. state.loadStatus = state.pagination.list.length < state.pagination.total ? 'more' : 'noMore';
  89. }
  90. onLoad(() => {
  91. getLogList();
  92. });
  93. function onLoadMore() {
  94. if (state.loadStatus === 'noMore') {
  95. return;
  96. }
  97. state.pagination.pageNo++;
  98. getLogList();
  99. }
  100. onReachBottom(() => {
  101. onLoadMore();
  102. });
  103. </script>
  104. <style lang="scss" scoped>
  105. .color-red {
  106. color: red;
  107. }
  108. .color-green {
  109. color: green;
  110. }
  111. .score-box {
  112. margin: 20rpx;
  113. border-radius: 20rpx;
  114. padding-top: 100rpx;
  115. }
  116. .avatar-box {
  117. width: 100rpx;
  118. height: 100rpx;
  119. border-radius: 50%;
  120. overflow: hidden;
  121. .avatar-img {
  122. width: 100%;
  123. height: 100%;
  124. }
  125. }
  126. .value-box {
  127. width: 100rpx;
  128. height: 100rpx;
  129. line-height: 100rpx;
  130. text-align: center;
  131. border-radius: 50%;
  132. border: 2px solid #f6f6f6;
  133. }
  134. .btn {
  135. width: 300rpx;
  136. background: linear-gradient(90deg, var(--ui-BG-Main), var(--ui-BG-Main-gradient));
  137. border-radius: 20rpx;
  138. font-size: 30rpx;
  139. font-weight: 500;
  140. line-height: 80rpx;
  141. color: $white;
  142. position: relative;
  143. z-index: 1;
  144. }
  145. .header-box {
  146. width: 100%;
  147. background: linear-gradient(180deg, var(--ui-BG-Main) 0%, var(--ui-BG-Main-gradient) 100%) no-repeat;
  148. background-size: 750rpx 100%;
  149. padding: 0 0 120rpx 0;
  150. box-sizing: border-box;
  151. .score-box {
  152. height: 100%;
  153. .all-num {
  154. font-size: 50rpx;
  155. font-weight: bold;
  156. color: #fff;
  157. font-family: OPPOSANS;
  158. }
  159. .all-title {
  160. font-size: 26rpx;
  161. font-weight: 500;
  162. color: #fff;
  163. }
  164. .cicon-help-o {
  165. color: #fff;
  166. font-size: 28rpx;
  167. }
  168. }
  169. }
  170. // 筛选
  171. .filter-box {
  172. height: 114rpx;
  173. background-color: $bg-page;
  174. .total-box {
  175. font-size: 24rpx;
  176. font-weight: 500;
  177. color: $dark-9;
  178. }
  179. .date-btn {
  180. background-color: $white;
  181. line-height: 54rpx;
  182. border-radius: 27rpx;
  183. padding: 0 20rpx;
  184. font-size: 24rpx;
  185. font-weight: 500;
  186. color: $dark-6;
  187. .ss-seldate-icon {
  188. font-size: 50rpx;
  189. color: $dark-9;
  190. }
  191. }
  192. }
  193. .list-box {
  194. // width: 600rpx;
  195. // padding: 0 30rpx;
  196. overflow-y: auto;
  197. height: 100vh;
  198. .list-item {
  199. background: #fff;
  200. // border-bottom: 1rpx solid #dfdfdf;
  201. padding: 30rpx;
  202. .name {
  203. font-size: 28rpx;
  204. font-weight: 500;
  205. color: rgba(102, 102, 102, 1);
  206. line-height: 28rpx;
  207. // margin-bottom: 20rpx;
  208. }
  209. .time {
  210. font-size: 24rpx;
  211. font-weight: 500;
  212. color: rgba(196, 196, 196, 1);
  213. line-height: 24px;
  214. }
  215. .add {
  216. font-size: 30rpx;
  217. font-weight: 500;
  218. color: #e6b873;
  219. }
  220. .minus {
  221. font-size: 30rpx;
  222. font-weight: 500;
  223. color: $dark-3;
  224. }
  225. }
  226. }
  227. </style>