wallet.vue 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  1. <template>
  2. <Theme>
  3. <view class="wrap">
  4. <Navbar fixed border title="钱包" page="wallet">
  5. <template #right>
  6. <view class="nav_right" @click.stop="rightClick">
  7. <trans _t="账单" />
  8. </view>
  9. </template>
  10. </Navbar>
  11. <view class="wallet_top" id="tops">
  12. <view class="wallet_header">
  13. <view class="wallet_header_content">
  14. <trans class="cont_title" _t="余额" />
  15. <view class="wallet_money">
  16. <text class="currency">{{ symbol.symbol }}</text>
  17. <text>{{ Moneyhtml(userInfo.money) }}</text>
  18. </view>
  19. <view class="wallet_btn">
  20. <view
  21. class="btn recharge"
  22. @click="handleTo('/pages/bank/recharge')"
  23. >
  24. <trans _t="充值" />
  25. </view>
  26. <view
  27. class="btn withdrawal"
  28. @click="handleTo('/pages/bank/withdraw')"
  29. >
  30. <trans _t="提现" />
  31. </view>
  32. </view>
  33. </view>
  34. </view>
  35. </view>
  36. <view class="content">
  37. <view class="cont">
  38. <List url="/users/account/lists" ref="listRef">
  39. <template #item="{ item }">
  40. <view class="list">
  41. <view class="list_top">
  42. <view class="title">{{ item.title }}</view>
  43. <view class="money"
  44. >{{ symbol.symbol }}&nbsp;{{ Moneyhtml(item.setup) }}</view
  45. >
  46. </view>
  47. <view class="date">{{ useGlobal().$format(item.indate) }}</view>
  48. </view>
  49. </template>
  50. </List>
  51. </view>
  52. </view>
  53. </view>
  54. </Theme>
  55. </template>
  56. <script setup>
  57. import Navbar from "@/components/navbar";
  58. import { computed, ref, onMounted, nextTick } from "vue";
  59. import { useSystemStore, useUserStore } from "@/store";
  60. import List from "@/components/list";
  61. import { useGlobal, Toast, Moneyhtml } from "@/utils";
  62. import { onReachBottom } from "@dcloudio/uni-app";
  63. const useSystem = useSystemStore();
  64. const useUser = useUserStore();
  65. const listRef = ref(null);
  66. const currency = computed(() => useSystem.getCurrency);
  67. const userInfo = computed(() => useUser.getuserInfo);
  68. const symbol = computed(() => useSystem.getSymbol);
  69. const rightClick = () => {
  70. uni.navigateTo({ url: "/pages/bank/account" });
  71. };
  72. const handleTo = (url) => {
  73. uni.navigateTo({ url });
  74. };
  75. onMounted(() => {
  76. nextTick(() => {
  77. listRef.value && listRef.value.getData();
  78. });
  79. });
  80. onReachBottom(() => {
  81. nextTick(() => {
  82. listRef.value && listRef.value.scrolltolower();
  83. });
  84. });
  85. </script>
  86. <style lang="less" scoped>
  87. @import url("@/style.less");
  88. .wrap {
  89. min-height: 100vh;
  90. background-color: var(--bg);
  91. .nav_right {
  92. color: var(--text);
  93. .size(24rpx);
  94. }
  95. .wallet_top {
  96. .wallet_header {
  97. background-color: var(--black);
  98. padding: 24rpx;
  99. &_content {
  100. background-color: var(--light);
  101. border-radius: 16rpx;
  102. padding: 24rpx;
  103. .ver();
  104. flex-direction: column;
  105. .cont_title {
  106. color: var(--text-01);
  107. .size(28rpx);
  108. text-align: center;
  109. font-weight: 700;
  110. line-height: 60rpx;
  111. }
  112. .wallet_money {
  113. line-height: 100rpx;
  114. .size(48rpx);
  115. color: var(--text);
  116. font-weight: 700;
  117. .currency {
  118. // .size(28rpx);
  119. margin-right: 8rpx;
  120. }
  121. }
  122. .wallet_btn {
  123. .flex();
  124. column-gap: 24rpx;
  125. .btn {
  126. width: 240rpx;
  127. height: 38px;
  128. padding: 16rpx 30rpx;
  129. border: 1px solid var(--black);
  130. background-color: var(--black);
  131. border-radius: 16rpx;
  132. .size(24rpx);
  133. color: var(--light);
  134. text-align: center;
  135. }
  136. .withdrawal {
  137. color: var(--black);
  138. background-color: var(--light);
  139. }
  140. }
  141. }
  142. }
  143. }
  144. .content {
  145. padding: 0 24rpx;
  146. .list {
  147. padding: 24rpx;
  148. background-color: var(--light);
  149. margin-top: 24rpx;
  150. border-radius: 12rpx;
  151. border-bottom: var(--bor);
  152. &_top {
  153. .flex_position(space-between);
  154. .size(28rpx);
  155. .title {
  156. color: var(--text);
  157. }
  158. .money {
  159. font-weight: 700;
  160. color: var(--danger);
  161. }
  162. }
  163. .date {
  164. color: var(--text-02);
  165. .size(24rpx);
  166. text-align: right;
  167. margin-top: 8rpx;
  168. }
  169. }
  170. }
  171. }
  172. </style>