wallet.vue 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252
  1. <template>
  2. <view class="wallet-page">
  3. <!-- 余额卡片 -->
  4. <view class="balance-card">
  5. <view class="card-header">
  6. <text>我的余额</text>
  7. <view class="detail-link" @click="goToDetail">
  8. 提现明细
  9. <u-icon name="arrow-right" color="#FFFFFF" size="26" top="4rpx"></u-icon>
  10. </view>
  11. </view>
  12. <view class="amount flex-c">
  13. <text class="number">¥ 30.00</text>
  14. </view>
  15. <view class="balance-info flex-c">
  16. (可用余额¥20.00 提现中¥10.00)
  17. </view>
  18. <view class="flex-c">
  19. <view class="withdraw-btn" @click="handleWithdraw">
  20. 提现
  21. </view>
  22. </view>
  23. </view>
  24. <!-- 余额明细列表 -->
  25. <view class="detail-section">
  26. <view class="section-header">
  27. <text>余额明细</text>
  28. <view class="filter" @click="toggleFilter">
  29. 分类
  30. <u-icon name="arrow-down" color="#333" size="26"></u-icon>
  31. </view>
  32. </view>
  33. <view class="detail-list">
  34. <view class="detail-item" v-for="(item, index) in detailList" :key="index">
  35. <view class="item-left">
  36. <text class="title">{{ item.title }}</text>
  37. <text class="time">{{ item.time }}</text>
  38. </view>
  39. <view class="item-right">
  40. <text :class="['amount', item.amount > 0 ? 'income' : 'expense']">
  41. {{ item.amount > 0 ? '+' : '-' }}{{ Math.abs(item.amount).toFixed(2) }}
  42. </text>
  43. <text class="status">{{ item.status }}</text>
  44. </view>
  45. </view>
  46. </view>
  47. </view>
  48. <!-- 分类选择弹窗 -->
  49. <category-popup :show.sync="showCategoryPopup" @confirm="onCategoryConfirm"></category-popup>
  50. </view>
  51. </template>
  52. <script>
  53. import CategoryPopup from '../components/category-popup.vue'
  54. export default {
  55. components: {
  56. CategoryPopup
  57. },
  58. data() {
  59. return {
  60. showCategoryPopup: false,
  61. detailList: [{
  62. title: '微信提现',
  63. time: '2021.2.25 10:48:32',
  64. amount: -36.00,
  65. status: '提现中'
  66. },
  67. {
  68. title: '微信提现',
  69. time: '2021.2.25 10:48:32',
  70. amount: -36.00,
  71. status: '提现完成'
  72. },
  73. {
  74. title: '微信提现',
  75. time: '2021.2.25 10:48:32',
  76. amount: -36.00,
  77. status: '提现完成'
  78. },
  79. {
  80. title: '合伙人收入',
  81. time: '2021.2.25 10:48:32',
  82. amount: 100.00,
  83. status: ''
  84. }
  85. ]
  86. }
  87. },
  88. methods: {
  89. onCategoryConfirm(selectedCategories) {
  90. console.log('选中的分类:', selectedCategories)
  91. // 这里处理分类筛选逻辑
  92. },
  93. goToDetail() {
  94. uni.navigateTo({
  95. url: '/pages-mine/pages/withdraw-detail'
  96. })
  97. },
  98. handleWithdraw() {
  99. uni.navigateTo({
  100. url: '/pages-mine/pages/withdraw'
  101. })
  102. },
  103. toggleFilter() {
  104. // 实现筛选功能
  105. this.showCategoryPopup = !this.showCategoryPopup
  106. }
  107. }
  108. }
  109. </script>
  110. <style lang="scss" scoped>
  111. .wallet-page {
  112. min-height: 100vh;
  113. background: #F5F5F5;
  114. padding: 10rpx 30rpx;
  115. box-sizing: border-box;
  116. .balance-card {
  117. background: #38C148;
  118. border-radius: 20rpx;
  119. padding: 30rpx 40rpx;
  120. color: #FFFFFF;
  121. .card-header {
  122. display: flex;
  123. justify-content: space-between;
  124. align-items: center;
  125. font-size: 28rpx;
  126. .detail-link {
  127. display: flex;
  128. align-items: center;
  129. opacity: 0.9;
  130. }
  131. }
  132. .amount {
  133. margin: 40rpx 0 20rpx;
  134. .symbol {
  135. font-size: 40rpx;
  136. margin-right: 8rpx;
  137. }
  138. .number {
  139. font-size: 80rpx;
  140. font-weight: 500;
  141. }
  142. }
  143. .balance-info {
  144. font-size: 26rpx;
  145. opacity: 0.9;
  146. }
  147. .withdraw-btn {
  148. margin-top: 40rpx;
  149. height: 60rpx;
  150. line-height: 60rpx;
  151. text-align: center;
  152. background: rgba(255, 255, 255, 0.2);
  153. border-radius: 14rpx;
  154. font-size: 28rpx;
  155. width: 200rpx;
  156. }
  157. }
  158. .detail-section {
  159. background: #FFFFFF;
  160. border-radius: 20rpx;
  161. margin-top: 20rpx;
  162. padding: 0 30rpx;
  163. .section-header {
  164. display: flex;
  165. justify-content: space-between;
  166. align-items: center;
  167. height: 100rpx;
  168. font-size: 30rpx;
  169. color: #333;
  170. border-bottom: 1px solid #EEEEEE;
  171. .filter {
  172. display: flex;
  173. align-items: center;
  174. color: #666;
  175. font-size: 28rpx;
  176. margin-right: 8rpx;
  177. }
  178. }
  179. .detail-list {
  180. .detail-item {
  181. display: flex;
  182. justify-content: space-between;
  183. align-items: center;
  184. padding: 30rpx 0;
  185. border-bottom: 1px solid #EEEEEE;
  186. &:last-child {
  187. border-bottom: none;
  188. }
  189. .item-left {
  190. .title {
  191. font-size: 28rpx;
  192. color: #333;
  193. margin-bottom: 10rpx;
  194. display: block;
  195. }
  196. .time {
  197. font-size: 24rpx;
  198. color: #999;
  199. }
  200. }
  201. .item-right {
  202. text-align: right;
  203. .amount {
  204. display: block;
  205. font-size: 32rpx;
  206. margin-bottom: 10rpx;
  207. font-weight: 500;
  208. &.income {
  209. color: #FF5B5B;
  210. }
  211. &.expense {
  212. color: #38C148;
  213. }
  214. }
  215. .status {
  216. font-size: 24rpx;
  217. color: #999;
  218. }
  219. }
  220. }
  221. }
  222. }
  223. }
  224. </style>