小说小程序前端代码仓库(小程序)
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.

395 lines
7.5 KiB

  1. <!-- 钱包流水页面 -->
  2. <template>
  3. <view class="walletflow-page">
  4. <!-- 顶部导航栏 -->
  5. <uv-navbar title="钱包流水" :autoBack="true" fixed placeholder titleStyle="color: #333; font-weight: 700;"
  6. :border="false">
  7. <template #left>
  8. <BackArrow :size="56" color="#333" />
  9. </template>
  10. </uv-navbar>
  11. <!-- 账户余额卡片 -->
  12. <view class="balance-card">
  13. <view class="balance-label">账户</view>
  14. <view class="balance-row">
  15. <text class="balance-amount">{{ balance }}</text>
  16. <button class="recharge-btn" @click="goRecharge">充值</button>
  17. </view>
  18. </view>
  19. <!-- tab和流水列表卡片 -->
  20. <view class="flow-card">
  21. <view class="tab-header">
  22. <view :class="['tab-item', {active: activeTab === 0}]" @click="activeTab = 0">
  23. 充值
  24. <view v-if="activeTab === 0" class="tab-underline"></view>
  25. </view>
  26. <view :class="['tab-item', {active: activeTab === 1}]" @click="activeTab = 1">
  27. 支付
  28. <view v-if="activeTab === 1" class="tab-underline"></view>
  29. </view>
  30. </view>
  31. <scroll-view scroll-y class="flow-list">
  32. <view v-if="activeTab === 0">
  33. <view class="flow-item" v-for="(item, idx) in rechargeList" :key="idx">
  34. <view class="flow-item-row">
  35. <view class="flow-item-left">
  36. <view class="flow-title">{{ item.title }}</view>
  37. <view class="flow-date">{{ item.date }}</view>
  38. </view>
  39. <view class="flow-amount plus">+{{ item.amount }}</view>
  40. </view>
  41. </view>
  42. </view>
  43. <view v-else>
  44. <view class="flow-item" v-for="(item, idx) in payList" :key="idx">
  45. <view class="flow-item-row">
  46. <view class="flow-item-left">
  47. <view class="flow-title">{{ item.title }}</view>
  48. <view class="flow-date">{{ item.date }}</view>
  49. </view>
  50. <view class="flow-amount minus">-{{ item.amount }}</view>
  51. </view>
  52. </view>
  53. </view>
  54. </scroll-view>
  55. </view>
  56. </view>
  57. </template>
  58. <script>
  59. import BackArrow from './components/BackArrow.vue';
  60. export default {
  61. components: {
  62. BackArrow,
  63. },
  64. data() {
  65. return {
  66. balance: 34532,
  67. activeTab: 0,
  68. rechargeList: [{
  69. title: '豆豆充值',
  70. date: '2025.03.18',
  71. amount: 55
  72. },
  73. {
  74. title: '豆豆充值',
  75. date: '2025.03.18',
  76. amount: 55
  77. },
  78. {
  79. title: '豆豆充值',
  80. date: '2025.03.18',
  81. amount: 55
  82. },
  83. {
  84. title: '推荐票',
  85. date: '2025.03.18',
  86. amount: 5
  87. },
  88. {
  89. title: '豆豆充值',
  90. date: '2025.03.18',
  91. amount: 55
  92. },
  93. {
  94. title: '豆豆充值',
  95. date: '2025.03.18',
  96. amount: 55
  97. },
  98. {
  99. title: '豆豆充值',
  100. date: '2025.03.18',
  101. amount: 55
  102. },
  103. {
  104. title: '豆豆充值',
  105. date: '2025.03.18',
  106. amount: 55
  107. },
  108. {
  109. title: '豆豆充值',
  110. date: '2025.03.18',
  111. amount: 55
  112. },
  113. {
  114. title: '豆豆充值',
  115. date: '2025.03.18',
  116. amount: 55
  117. },
  118. {
  119. title: '豆豆充值',
  120. date: '2025.03.18',
  121. amount: 55
  122. },
  123. {
  124. title: '豆豆充值',
  125. date: '2025.03.18',
  126. amount: 55
  127. },
  128. {
  129. title: '豆豆充值',
  130. date: '2025.03.18',
  131. amount: 55
  132. },
  133. {
  134. title: '豆豆充值',
  135. date: '2025.03.18',
  136. amount: 55
  137. },
  138. ],
  139. payList: [{
  140. title: '章节支付',
  141. date: '2025.03.18',
  142. amount: 10
  143. },
  144. {
  145. title: '章节支付',
  146. date: '2025.03.18',
  147. amount: 10
  148. },
  149. {
  150. title: '章节支付',
  151. date: '2025.03.18',
  152. amount: 10
  153. },
  154. {
  155. title: '章节支付',
  156. date: '2025.03.18',
  157. amount: 10
  158. },
  159. {
  160. title: '章节支付',
  161. date: '2025.03.18',
  162. amount: 10
  163. },
  164. {
  165. title: '章节支付',
  166. date: '2025.03.18',
  167. amount: 10
  168. },
  169. {
  170. title: '章节支付',
  171. date: '2025.03.18',
  172. amount: 10
  173. },
  174. {
  175. title: '章节支付',
  176. date: '2025.03.18',
  177. amount: 10
  178. },
  179. {
  180. title: '章节支付',
  181. date: '2025.03.18',
  182. amount: 10
  183. },
  184. {
  185. title: '章节支付',
  186. date: '2025.03.18',
  187. amount: 10
  188. },
  189. {
  190. title: '章节支付',
  191. date: '2025.03.18',
  192. amount: 10
  193. },
  194. {
  195. title: '章节支付',
  196. date: '2025.03.18',
  197. amount: 10
  198. },
  199. {
  200. title: '章节支付',
  201. date: '2025.03.18',
  202. amount: 10
  203. },
  204. {
  205. title: '章节支付',
  206. date: '2025.03.18',
  207. amount: 10
  208. },
  209. {
  210. title: '章节支付',
  211. date: '2025.03.18',
  212. amount: 10
  213. },
  214. ]
  215. }
  216. },
  217. methods: {
  218. goRecharge() {
  219. uni.showToast({
  220. title: '充值功能开发中',
  221. icon: 'none'
  222. })
  223. }
  224. }
  225. }
  226. </script>
  227. <style lang="scss" scoped>
  228. .walletflow-page {
  229. min-height: 100vh;
  230. background: linear-gradient(180deg, #f8f8fc 0%, #fff 100%);
  231. padding-bottom: 30rpx;
  232. }
  233. .balance-card {
  234. background: linear-gradient(90deg, #f7f2fa 0%, #fbeaf2 100%);
  235. border-radius: 18rpx;
  236. margin: 24rpx 12rpx 0 12rpx;
  237. padding: 18rpx 24rpx 14rpx 24rpx;
  238. box-shadow: none;
  239. border: 1rpx solid #ede7ef;
  240. position: relative;
  241. display: flex;
  242. flex-direction: column;
  243. min-height: 130rpx;
  244. justify-content: center;
  245. .balance-label {
  246. color: #bbb;
  247. font-size: 26rpx;
  248. margin-bottom: 8rpx;
  249. }
  250. .balance-row {
  251. display: flex;
  252. align-items: center;
  253. margin-top: 0;
  254. position: relative;
  255. .balance-amount {
  256. color: #e94f7a;
  257. font-size: 48rpx;
  258. font-weight: bold;
  259. }
  260. .recharge-btn {
  261. position: absolute;
  262. right: 0;
  263. top: 50%;
  264. transform: translateY(-50%);
  265. background: linear-gradient(90deg, #ffb6c1 0%, #fa5a99 100%);
  266. color: #fff;
  267. font-size: 28rpx;
  268. border-radius: 32rpx;
  269. padding: 0 40rpx;
  270. height: 56rpx;
  271. line-height: 56rpx;
  272. font-weight: 500;
  273. border: none;
  274. box-shadow: none;
  275. display: flex;
  276. align-items: center;
  277. justify-content: center;
  278. }
  279. }
  280. }
  281. .flow-card {
  282. background: #fff;
  283. border-radius: 20rpx;
  284. margin: 32rpx 16rpx 0 16rpx;
  285. box-shadow: 0 4rpx 24rpx 0 rgba(0, 0, 0, 0.06);
  286. padding-bottom: 8rpx;
  287. overflow: hidden;
  288. }
  289. .tab-header {
  290. display: flex;
  291. margin: 0;
  292. background: #fff;
  293. border-top-left-radius: 20rpx;
  294. border-top-right-radius: 20rpx;
  295. overflow: hidden;
  296. .tab-item {
  297. flex: 1;
  298. text-align: center;
  299. font-size: 30rpx;
  300. color: #888;
  301. padding: 0 0 18rpx 0;
  302. font-weight: bold;
  303. background: transparent;
  304. position: relative;
  305. &.active {
  306. color: #223a7a;
  307. font-weight: bold;
  308. }
  309. .tab-underline {
  310. position: absolute;
  311. left: 50%;
  312. bottom: 0;
  313. transform: translateX(-50%);
  314. width: 44rpx;
  315. height: 4rpx;
  316. background: #223a7a;
  317. border-radius: 2rpx;
  318. margin-top: 4rpx;
  319. }
  320. }
  321. }
  322. .flow-list {
  323. margin: 0;
  324. padding: 0 16rpx;
  325. max-height: 75vh;
  326. background: #fff;
  327. }
  328. .flow-item {
  329. border-bottom: 1px solid #f5f5f5;
  330. padding: 18rpx 0 8rpx 0;
  331. &:last-child {
  332. border-bottom: none;
  333. }
  334. .flow-item-row {
  335. display: flex;
  336. align-items: flex-start;
  337. justify-content: space-between;
  338. padding-right: 45rpx;
  339. padding-left: 15rpx;
  340. }
  341. .flow-item-left {
  342. display: flex;
  343. flex-direction: column;
  344. align-items: flex-start;
  345. .flow-title {
  346. font-size: 28rpx;
  347. color: #222;
  348. font-weight: 500;
  349. margin-bottom: 2rpx;
  350. }
  351. .flow-date {
  352. color: #bbb;
  353. font-size: 22rpx;
  354. margin-top: 0;
  355. }
  356. }
  357. .flow-amount {
  358. font-size: 26rpx;
  359. font-weight: 500;
  360. margin-left: 24rpx;
  361. margin-top: 2rpx;
  362. &.plus {
  363. color: #223a7a;
  364. }
  365. &.minus {
  366. color: #e94f7a;
  367. }
  368. }
  369. }
  370. </style>