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

390 lines
7.4 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. import BackArrow from './components/BackArrow.vue';
  55. export default {
  56. components: {
  57. BackArrow,
  58. },
  59. data() {
  60. return {
  61. balance: 34532,
  62. activeTab: 0,
  63. rechargeList: [{
  64. title: '豆豆充值',
  65. date: '2025.03.18',
  66. amount: 55
  67. },
  68. {
  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: 5
  82. },
  83. {
  84. title: '豆豆充值',
  85. date: '2025.03.18',
  86. amount: 55
  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. payList: [{
  135. title: '章节支付',
  136. date: '2025.03.18',
  137. amount: 10
  138. },
  139. {
  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. }
  211. },
  212. methods: {
  213. goRecharge() {
  214. uni.showToast({
  215. title: '充值功能开发中',
  216. icon: 'none'
  217. })
  218. }
  219. }
  220. }
  221. </script>
  222. <style lang="scss" scoped>
  223. .walletflow-page {
  224. min-height: 100vh;
  225. background: linear-gradient(180deg, #f8f8fc 0%, #fff 100%);
  226. padding-bottom: 30rpx;
  227. }
  228. .balance-card {
  229. background: linear-gradient(90deg, #f7f2fa 0%, #fbeaf2 100%);
  230. border-radius: 18rpx;
  231. margin: 24rpx 12rpx 0 12rpx;
  232. padding: 18rpx 24rpx 14rpx 24rpx;
  233. box-shadow: none;
  234. border: 1rpx solid #ede7ef;
  235. position: relative;
  236. display: flex;
  237. flex-direction: column;
  238. min-height: 130rpx;
  239. justify-content: center;
  240. .balance-label {
  241. color: #bbb;
  242. font-size: 26rpx;
  243. margin-bottom: 8rpx;
  244. }
  245. .balance-row {
  246. display: flex;
  247. align-items: center;
  248. margin-top: 0;
  249. position: relative;
  250. .balance-amount {
  251. color: #e94f7a;
  252. font-size: 48rpx;
  253. font-weight: bold;
  254. }
  255. .recharge-btn {
  256. position: absolute;
  257. right: 0;
  258. top: 50%;
  259. transform: translateY(-50%);
  260. background: linear-gradient(90deg, #ffb6c1 0%, #fa5a99 100%);
  261. color: #fff;
  262. font-size: 28rpx;
  263. border-radius: 32rpx;
  264. padding: 0 40rpx;
  265. height: 56rpx;
  266. line-height: 56rpx;
  267. font-weight: 500;
  268. border: none;
  269. box-shadow: none;
  270. display: flex;
  271. align-items: center;
  272. justify-content: center;
  273. }
  274. }
  275. }
  276. .flow-card {
  277. background: #fff;
  278. border-radius: 20rpx;
  279. margin: 32rpx 16rpx 0 16rpx;
  280. box-shadow: 0 4rpx 24rpx 0 rgba(0, 0, 0, 0.06);
  281. padding-bottom: 8rpx;
  282. overflow: hidden;
  283. }
  284. .tab-header {
  285. display: flex;
  286. margin: 0;
  287. background: #fff;
  288. border-top-left-radius: 20rpx;
  289. border-top-right-radius: 20rpx;
  290. overflow: hidden;
  291. .tab-item {
  292. flex: 1;
  293. text-align: center;
  294. font-size: 30rpx;
  295. color: #888;
  296. padding: 0 0 18rpx 0;
  297. font-weight: bold;
  298. background: transparent;
  299. position: relative;
  300. &.active {
  301. color: #223a7a;
  302. font-weight: bold;
  303. }
  304. .tab-underline {
  305. position: absolute;
  306. left: 50%;
  307. bottom: 0;
  308. transform: translateX(-50%);
  309. width: 44rpx;
  310. height: 4rpx;
  311. background: #223a7a;
  312. border-radius: 2rpx;
  313. margin-top: 4rpx;
  314. }
  315. }
  316. }
  317. .flow-list {
  318. margin: 0;
  319. padding: 0 16rpx;
  320. max-height: 75vh;
  321. background: #fff;
  322. }
  323. .flow-item {
  324. border-bottom: 1px solid #f5f5f5;
  325. padding: 18rpx 0 8rpx 0;
  326. &:last-child {
  327. border-bottom: none;
  328. }
  329. .flow-item-row {
  330. display: flex;
  331. align-items: flex-start;
  332. justify-content: space-between;
  333. padding-right: 45rpx;
  334. padding-left: 15rpx;
  335. }
  336. .flow-item-left {
  337. display: flex;
  338. flex-direction: column;
  339. align-items: flex-start;
  340. .flow-title {
  341. font-size: 28rpx;
  342. color: #222;
  343. font-weight: 500;
  344. margin-bottom: 2rpx;
  345. }
  346. .flow-date {
  347. color: #bbb;
  348. font-size: 22rpx;
  349. margin-top: 0;
  350. }
  351. }
  352. .flow-amount {
  353. font-size: 26rpx;
  354. font-weight: 500;
  355. margin-left: 24rpx;
  356. margin-top: 2rpx;
  357. &.plus {
  358. color: #223a7a;
  359. }
  360. &.minus {
  361. color: #e94f7a;
  362. }
  363. }
  364. }
  365. </style>