wallet.vue 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. <template>
  2. <view class="wallet">
  3. <z-paging
  4. ref="pagingRef"
  5. class="paginng-contaner"
  6. :default-page-size="20"
  7. :use-refresher-status-bar-placeholder="true"
  8. v-model="list"
  9. @query="handleQuery"
  10. >
  11. <!-- 余额 -->
  12. <view class="blance">
  13. <view class="flex-center-between">
  14. <view class="color_fff">
  15. <text class="font_size60 bold mr20">{{appStore.userInfo?.rechargeBalance}}</text>
  16. <text class="font_size30">{{appStore.moneyUnit}}</text>
  17. </view>
  18. <view class="order_btn plain chongzhi font_size30" @click="toRecharge">充值</view>
  19. </view>
  20. <view class="color_fff font_size25 mt20">账户余额 ( {{appStore.moneyUnit}} )</view>
  21. </view>
  22. <!-- 账户明细 -->
  23. <view class="padding30 accountDetails bg_color_f5">
  24. <view class="flex-center-flex-start mb20">
  25. <view class="line_vertical"></view>
  26. <view class="font_size30 bold">账户明细</view>
  27. </view>
  28. <view class="bg_color_fff border_radius_20 padding30">
  29. <view class="flex-center-between paddingTB20 border_bottom" v-for="item in list" :key="item.recordId">
  30. <view class="flex_1">
  31. <!-- 交易类型(0=充值,1=消费,2=退款) -->
  32. <view class="font_size25 bold">
  33. {{item.transactionTypeName}}
  34. </view>
  35. <view class="font_size20 color_999 mt10">{{item.createTime}}</view>
  36. </view>
  37. <!-- 交易金额(充值/退款为正,消费为负) -->
  38. <view class="flex-column-end">
  39. <text class="font_size40 color_price">{{item.amount}}</text>
  40. <text class="font_size25 gray">余额{{item.balanceAfter}}</text>
  41. </view>
  42. </view>
  43. </view>
  44. </view>
  45. </z-paging>
  46. </view>
  47. </template>
  48. <script setup>
  49. import { ref } from "vue";
  50. import { getRecordList } from "@/api/user";
  51. import { useAppStore } from "@/stores/app"
  52. const appStore = useAppStore();
  53. const pagingRef = ref();
  54. const list = ref([]);
  55. // 下拉刷新和滚动底部会自动触发此方法
  56. async function handleQuery(page, pageSize, from) {
  57. try {
  58. const params = {
  59. pageNum: page,
  60. pageSize,
  61. reasonable:false,
  62. orderByColumn: 'createTime',
  63. isAsc: 'desc'
  64. };
  65. const { rows } = await getRecordList(params);
  66. pagingRef.value.complete(rows);
  67. } catch (e) {
  68. console.log('msg-comment',e)
  69. pagingRef.value.complete(false);
  70. }
  71. }
  72. function toRecharge(){
  73. uni.navigateTo({
  74. url: '/pages/recharge/recharge'
  75. });
  76. }
  77. </script>
  78. <style lang="less" scoped>
  79. .wallet{
  80. .blance{
  81. padding: 80rpx 60rpx;
  82. background-color: #fb7145;
  83. }
  84. .chongzhi{
  85. color: #fb7145;
  86. padding: 10rpx 40rpx;
  87. border-radius: 50rpx;
  88. }
  89. .line_vertical{
  90. background-color: #fb7145;
  91. margin-right: 20rpx;
  92. }
  93. .accountDetails{
  94. border-radius: 30rpx 30rpx 0 0;
  95. position: relative;
  96. top: -30rpx;
  97. padding-bottom: 0;
  98. }
  99. }
  100. </style>