小说小程序前端代码仓库(小程序)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

248 lines
7.1 KiB

  1. <!-- 钱包流水页面 -->
  2. <template>
  3. <view class="walletflow-page">
  4. <!-- 顶部导航栏 -->
  5. <uv-navbar title="钱包流水" :autoBack="true" fixed placeholder titleStyle="color: #333; font-weight: 700;" :border="false" />
  6. <!-- 账户余额卡片 -->
  7. <view class="balance-card">
  8. <view class="balance-label">账户</view>
  9. <view class="balance-row">
  10. <text class="balance-amount">{{ balance }}</text>
  11. <button class="recharge-btn" @click="goRecharge">充值</button>
  12. </view>
  13. </view>
  14. <!-- tab和流水列表卡片 -->
  15. <view class="flow-card">
  16. <view class="tab-header">
  17. <view :class="['tab-item', {active: activeTab === 0}]" @click="activeTab = 0">
  18. 充值
  19. <view v-if="activeTab === 0" class="tab-underline"></view>
  20. </view>
  21. <view :class="['tab-item', {active: activeTab === 1}]" @click="activeTab = 1">
  22. 支付
  23. <view v-if="activeTab === 1" class="tab-underline"></view>
  24. </view>
  25. </view>
  26. <scroll-view scroll-y class="flow-list">
  27. <view v-if="activeTab === 0">
  28. <view class="flow-item" v-for="(item, idx) in rechargeList" :key="idx">
  29. <view class="flow-item-row">
  30. <view class="flow-item-left">
  31. <view class="flow-title">{{ item.title }}</view>
  32. <view class="flow-date">{{ item.date }}</view>
  33. </view>
  34. <view class="flow-amount plus">+{{ item.amount }}</view>
  35. </view>
  36. </view>
  37. </view>
  38. <view v-else>
  39. <view class="flow-item" v-for="(item, idx) in payList" :key="idx">
  40. <view class="flow-item-row">
  41. <view class="flow-item-left">
  42. <view class="flow-title">{{ item.title }}</view>
  43. <view class="flow-date">{{ item.date }}</view>
  44. </view>
  45. <view class="flow-amount minus">-{{ item.amount }}</view>
  46. </view>
  47. </view>
  48. </view>
  49. </scroll-view>
  50. </view>
  51. </view>
  52. </template>
  53. <script>
  54. export default {
  55. data() {
  56. return {
  57. balance: 34532,
  58. activeTab: 0,
  59. rechargeList: [
  60. { title: '豆豆充值', date: '2025.03.18', amount: 55 },
  61. { title: '豆豆充值', date: '2025.03.18', amount: 55 },
  62. { title: '豆豆充值', date: '2025.03.18', amount: 55 },
  63. { title: '推荐票', date: '2025.03.18', amount: 5 },
  64. { title: '豆豆充值', date: '2025.03.18', amount: 55 },
  65. { title: '豆豆充值', date: '2025.03.18', amount: 55 },
  66. { title: '豆豆充值', date: '2025.03.18', amount: 55 },
  67. { title: '豆豆充值', date: '2025.03.18', amount: 55 },
  68. { title: '豆豆充值', date: '2025.03.18', amount: 55 },
  69. { title: '豆豆充值', date: '2025.03.18', amount: 55 },
  70. { title: '豆豆充值', date: '2025.03.18', amount: 55 },
  71. { title: '豆豆充值', date: '2025.03.18', amount: 55 },
  72. { title: '豆豆充值', date: '2025.03.18', amount: 55 },
  73. { title: '豆豆充值', date: '2025.03.18', amount: 55 },
  74. ],
  75. payList: [
  76. { title: '章节支付', date: '2025.03.18', amount: 10 },
  77. { title: '章节支付', date: '2025.03.18', amount: 10 },
  78. { title: '章节支付', date: '2025.03.18', amount: 10 },
  79. { title: '章节支付', date: '2025.03.18', amount: 10 },
  80. { title: '章节支付', date: '2025.03.18', amount: 10 },
  81. { title: '章节支付', date: '2025.03.18', amount: 10 },
  82. { title: '章节支付', date: '2025.03.18', amount: 10 },
  83. { title: '章节支付', date: '2025.03.18', amount: 10 },
  84. { title: '章节支付', date: '2025.03.18', amount: 10 },
  85. { title: '章节支付', date: '2025.03.18', amount: 10 },
  86. { title: '章节支付', date: '2025.03.18', amount: 10 },
  87. { title: '章节支付', date: '2025.03.18', amount: 10 },
  88. { title: '章节支付', date: '2025.03.18', amount: 10 },
  89. { title: '章节支付', date: '2025.03.18', amount: 10 },
  90. { title: '章节支付', date: '2025.03.18', amount: 10 },
  91. ]
  92. }
  93. },
  94. methods: {
  95. goRecharge() {
  96. uni.showToast({ title: '充值功能开发中', icon: 'none' })
  97. }
  98. }
  99. }
  100. </script>
  101. <style lang="scss" scoped>
  102. .walletflow-page {
  103. min-height: 100vh;
  104. background: linear-gradient(180deg, #f8f8fc 0%, #fff 100%);
  105. padding-bottom: 30rpx;
  106. }
  107. .balance-card {
  108. background: linear-gradient(90deg, #f7f2fa 0%, #fbeaf2 100%);
  109. border-radius: 18rpx;
  110. margin: 24rpx 12rpx 0 12rpx;
  111. padding: 18rpx 24rpx 14rpx 24rpx;
  112. box-shadow: none;
  113. border: 1rpx solid #ede7ef;
  114. position: relative;
  115. display: flex;
  116. flex-direction: column;
  117. min-height: 130rpx;
  118. justify-content: center;
  119. .balance-label {
  120. color: #bbb;
  121. font-size: 26rpx;
  122. margin-bottom: 8rpx;
  123. }
  124. .balance-row {
  125. display: flex;
  126. align-items: center;
  127. margin-top: 0;
  128. position: relative;
  129. .balance-amount {
  130. color: #e94f7a;
  131. font-size: 48rpx;
  132. font-weight: bold;
  133. }
  134. .recharge-btn {
  135. position: absolute;
  136. right: 0;
  137. top: 50%;
  138. transform: translateY(-50%);
  139. background: linear-gradient(90deg, #ffb6c1 0%, #fa5a99 100%);
  140. color: #fff;
  141. font-size: 28rpx;
  142. border-radius: 32rpx;
  143. padding: 0 40rpx;
  144. height: 56rpx;
  145. line-height: 56rpx;
  146. font-weight: 500;
  147. border: none;
  148. box-shadow: none;
  149. display: flex;
  150. align-items: center;
  151. justify-content: center;
  152. }
  153. }
  154. }
  155. .flow-card {
  156. background: #fff;
  157. border-radius: 20rpx;
  158. margin: 32rpx 16rpx 0 16rpx;
  159. box-shadow: 0 4rpx 24rpx 0 rgba(0,0,0,0.06);
  160. padding-bottom: 8rpx;
  161. overflow: hidden;
  162. }
  163. .tab-header {
  164. display: flex;
  165. margin: 0;
  166. background: #fff;
  167. border-top-left-radius: 20rpx;
  168. border-top-right-radius: 20rpx;
  169. overflow: hidden;
  170. .tab-item {
  171. flex: 1;
  172. text-align: center;
  173. font-size: 30rpx;
  174. color: #888;
  175. padding: 0 0 18rpx 0;
  176. font-weight: bold;
  177. background: transparent;
  178. position: relative;
  179. &.active {
  180. color: #223a7a;
  181. font-weight: bold;
  182. }
  183. .tab-underline {
  184. position: absolute;
  185. left: 50%;
  186. bottom: 0;
  187. transform: translateX(-50%);
  188. width: 44rpx;
  189. height: 4rpx;
  190. background: #223a7a;
  191. border-radius: 2rpx;
  192. margin-top: 4rpx;
  193. }
  194. }
  195. }
  196. .flow-list {
  197. margin: 0;
  198. padding: 0 16rpx;
  199. max-height: 75vh;
  200. background: #fff;
  201. }
  202. .flow-item {
  203. border-bottom: 1px solid #f5f5f5;
  204. padding: 18rpx 0 8rpx 0;
  205. &:last-child {
  206. border-bottom: none;
  207. }
  208. .flow-item-row {
  209. display: flex;
  210. align-items: flex-start;
  211. justify-content: space-between;
  212. padding-right: 45rpx;
  213. padding-left: 15rpx;
  214. }
  215. .flow-item-left {
  216. display: flex;
  217. flex-direction: column;
  218. align-items: flex-start;
  219. .flow-title {
  220. font-size: 28rpx;
  221. color: #222;
  222. font-weight: 500;
  223. margin-bottom: 2rpx;
  224. }
  225. .flow-date {
  226. color: #bbb;
  227. font-size: 22rpx;
  228. margin-top: 0;
  229. }
  230. }
  231. .flow-amount {
  232. font-size: 26rpx;
  233. font-weight: 500;
  234. margin-left: 24rpx;
  235. margin-top: 2rpx;
  236. &.plus {
  237. color: #223a7a;
  238. }
  239. &.minus {
  240. color: #e94f7a;
  241. }
  242. }
  243. }
  244. </style>