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

387 lines
7.3 KiB

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