index.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458
  1. <template>
  2. <view class="container">
  3. <!-- 导航栏 -->
  4. <view class="nav-bar">
  5. <view class="nav-left" @click="navBack">
  6. <image class="back-icon" src="/static/icons/chevron_right_dark.svg"></image>
  7. </view>
  8. <text class="nav-title">我的钱包</text>
  9. <view class="nav-right"></view>
  10. </view>
  11. <!-- 钱包卡片 -->
  12. <view class="wallet-card">
  13. <!-- 背景装饰圆 -->
  14. <view class="bg-circle big"></view>
  15. <view class="bg-circle small"></view>
  16. <view class="card-content">
  17. <view class="card-top">
  18. <view class="app-info">
  19. <image class="app-logo" src="/static/icons/wallet_white.svg" mode="aspectFit"></image>
  20. <text class="app-name">履约者APP</text>
  21. </view>
  22. <view class="bill-btn" @click="navToBill">
  23. <text>账单</text>
  24. </view>
  25. </view>
  26. <view class="balance-container">
  27. <view class="balance-main">
  28. <text class="balance-label">账户余额 (元)</text>
  29. <text class="balance-num">2575.00</text>
  30. </view>
  31. <view class="balance-pending">
  32. <text class="pending-label">待入账 (元)</text>
  33. <text class="pending-num">580.00</text>
  34. </view>
  35. </view>
  36. </view>
  37. </view>
  38. <!-- 最近记录区域 -->
  39. <view class="record-container">
  40. <view class="record-header">
  41. <text class="header-title">最近账户余额变动记录</text>
  42. <view class="header-more" @click="navToBill">
  43. <text>查看全部</text>
  44. <image class="more-icon" src="/static/icons/arrow_right_gray.svg"></image>
  45. </view>
  46. </view>
  47. <!-- Tabs -->
  48. <view class="tabs-row">
  49. <view class="tab-item" :class="{ active: currentTab === 0 }" @click="switchTab(0)">
  50. <text>全部</text>
  51. <view class="tab-line" v-if="currentTab === 0"></view>
  52. </view>
  53. <view class="tab-item" :class="{ active: currentTab === 1 }" @click="switchTab(1)">
  54. <text>收入</text>
  55. <view class="tab-line" v-if="currentTab === 1"></view>
  56. </view>
  57. <view class="tab-item" :class="{ active: currentTab === 2 }" @click="switchTab(2)">
  58. <text>支出</text>
  59. <view class="tab-line" v-if="currentTab === 2"></view>
  60. </view>
  61. </view>
  62. <!-- 列表 -->
  63. <view class="record-list">
  64. <view class="list-item" v-for="(item, index) in displayList" :key="index">
  65. <view class="item-left">
  66. <text class="item-title">{{ item.title }}</text>
  67. <text class="item-desc">{{ item.desc }}</text>
  68. <text class="item-time">{{ item.time }}</text>
  69. </view>
  70. <view class="item-right">
  71. <text class="item-amount" :class="{ income: item.type === 'income', expense: item.type === 'expense' }">
  72. {{ item.type === 'income' ? '+' : '' }}{{ item.amount }}
  73. </text>
  74. <view class="item-tag">
  75. <text>{{ item.tag }}</text>
  76. </view>
  77. </view>
  78. </view>
  79. </view>
  80. </view>
  81. </view>
  82. </template>
  83. <script>
  84. export default {
  85. data() {
  86. return {
  87. currentTab: 0,
  88. list: [
  89. {
  90. title: '订单服务费用',
  91. desc: '订单 T1002839 完成结算',
  92. time: '2026-02-03 14:30',
  93. amount: '20.00',
  94. type: 'income',
  95. tag: '订单'
  96. },
  97. {
  98. title: '奖励费用',
  99. desc: '早高峰冲单奖励',
  100. time: '2026-02-03 10:00',
  101. amount: '15.00',
  102. type: 'income',
  103. tag: '奖励'
  104. },
  105. {
  106. title: '惩罚金额',
  107. desc: '超时送达扣款',
  108. time: '2026-02-02 18:20',
  109. amount: '-10.00',
  110. type: 'expense',
  111. tag: '惩罚'
  112. },
  113. {
  114. title: '后台转账',
  115. desc: '2026年1月工资发放',
  116. time: '2026-02-01 09:00',
  117. amount: '3500.00',
  118. type: 'income',
  119. tag: '工资'
  120. }
  121. ]
  122. }
  123. },
  124. computed: {
  125. displayList() {
  126. if (this.currentTab === 0) return this.list;
  127. if (this.currentTab === 1) return this.list.filter(item => item.type === 'income');
  128. if (this.currentTab === 2) return this.list.filter(item => item.type === 'expense');
  129. return [];
  130. }
  131. },
  132. methods: {
  133. navBack() {
  134. uni.navigateBack();
  135. },
  136. navToBill() {
  137. uni.navigateTo({
  138. url: '/pages/mine/wallet/bill'
  139. });
  140. },
  141. switchTab(index) {
  142. this.currentTab = index;
  143. }
  144. }
  145. }
  146. </script>
  147. <style>
  148. /* 基础容器 */
  149. .container {
  150. background-color: #F8F9FA;
  151. min-height: 100vh;
  152. display: flex;
  153. flex-direction: column;
  154. }
  155. /* 导航栏 */
  156. .nav-bar {
  157. background-color: #fff;
  158. padding-top: var(--status-bar-height);
  159. padding-left: 30rpx;
  160. padding-right: 30rpx;
  161. height: 88rpx;
  162. box-sizing: content-box;
  163. display: flex;
  164. justify-content: space-between;
  165. align-items: center;
  166. position: sticky;
  167. top: 0;
  168. z-index: 100;
  169. }
  170. .nav-left {
  171. height: 100%;
  172. display: flex;
  173. align-items: center;
  174. width: 60rpx; /* 增大点击区域 */
  175. }
  176. /* 复用通用图标并旋转 */
  177. .back-icon {
  178. width: 40rpx;
  179. height: 40rpx;
  180. transform: rotate(180deg);
  181. }
  182. /* 导航标题 */
  183. .nav-title {
  184. font-size: 28rpx;
  185. font-weight: bold;
  186. color: #333;
  187. }
  188. .nav-right {
  189. width: 60rpx;
  190. }
  191. /* 钱包卡片 */
  192. .wallet-card {
  193. margin: 20rpx 30rpx 0;
  194. /* 增加高度以优化内部间距 (原220rpx -> 300rpx) */
  195. height: 300rpx;
  196. background: linear-gradient(135deg, #FF6B00 0%, #FF8F00 100%);
  197. border-radius: 20rpx;
  198. position: relative;
  199. overflow: hidden;
  200. color: #fff;
  201. box-shadow: 0 4rpx 16rpx rgba(255, 107, 0, 0.15);
  202. }
  203. .bg-circle {
  204. position: absolute;
  205. border-radius: 50%;
  206. background: rgba(255,255,255,0.08);
  207. }
  208. .bg-circle.big {
  209. width: 400rpx;
  210. height: 400rpx;
  211. right: -100rpx;
  212. bottom: -150rpx;
  213. }
  214. .bg-circle.small {
  215. width: 200rpx;
  216. height: 200rpx;
  217. right: 80rpx;
  218. bottom: 40rpx;
  219. }
  220. .card-content {
  221. position: relative;
  222. z-index: 1;
  223. padding: 30rpx; /* 增加内边距 */
  224. height: 100%;
  225. box-sizing: border-box;
  226. display: flex;
  227. flex-direction: column;
  228. /* justify-content: space-between; */
  229. }
  230. .card-top {
  231. display: flex;
  232. justify-content: space-between;
  233. align-items: center;
  234. }
  235. .app-info {
  236. display: flex;
  237. align-items: center;
  238. }
  239. .app-logo {
  240. width: 28rpx; /* 图标调小 */
  241. height: 28rpx;
  242. background-color: transparent; /* SVG不需要背景色 */
  243. margin-right: 10rpx;
  244. border-radius: 0;
  245. }
  246. .app-name {
  247. font-size: 26rpx; /* 调小:13pt */
  248. font-weight: 500;
  249. }
  250. .bill-btn {
  251. font-size: 26rpx; /* 13pt */
  252. opacity: 0.9;
  253. }
  254. .bill-btn text {
  255. font-size: 26rpx; /* 调小:13pt */
  256. opacity: 0.95;
  257. }
  258. .balance-container {
  259. margin-top: auto; /* Push to bottom */
  260. display: flex;
  261. justify-content: space-between;
  262. align-items: flex-end;
  263. padding-bottom: 10rpx; /* Align with bottom padding visual */
  264. }
  265. .balance-main {
  266. display: flex;
  267. flex-direction: column;
  268. }
  269. .balance-label {
  270. font-size: 24rpx; /* 12pt */
  271. opacity: 0.9;
  272. margin-bottom: 4rpx;
  273. }
  274. .balance-num {
  275. font-size: 48rpx; /* 调整适中,不至于太小也不太大 */
  276. font-weight: bold;
  277. line-height: 1.1;
  278. }
  279. .balance-pending {
  280. display: flex;
  281. flex-direction: column;
  282. align-items: flex-end;
  283. margin-bottom: 10rpx;
  284. }
  285. .pending-label {
  286. font-size: 24rpx; /* 12pt */
  287. opacity: 0.9;
  288. margin-bottom: 4rpx;
  289. }
  290. .pending-num {
  291. font-size: 28rpx; /* 14pt */
  292. font-weight: bold;
  293. }
  294. /* 记录区域 */
  295. .record-container {
  296. flex: 1;
  297. background-color: #fff;
  298. margin: 24rpx 24rpx 0; /* 调整边距 */
  299. border-radius: 20rpx 20rpx 0 0;
  300. padding: 30rpx 24rpx;
  301. }
  302. .record-header {
  303. display: flex;
  304. justify-content: space-between;
  305. align-items: center;
  306. margin-bottom: 24rpx;
  307. }
  308. .header-title {
  309. font-size: 28rpx; /* 14pt */
  310. font-weight: bold;
  311. color: #333;
  312. }
  313. .header-more {
  314. display: flex;
  315. align-items: center;
  316. font-size: 24rpx; /* 12pt */
  317. color: #999;
  318. }
  319. .more-icon {
  320. width: 24rpx;
  321. height: 24rpx;
  322. margin-left: 6rpx;
  323. /* Ensure icon color is visible - svgs are usually static. display:block just in case */
  324. display: block;
  325. }
  326. /* Tabs */
  327. .tabs-row {
  328. display: flex;
  329. border-bottom: 1rpx solid #f5f5f5;
  330. margin-bottom: 10rpx;
  331. }
  332. .tab-item {
  333. margin-right: 40rpx;
  334. padding-bottom: 12rpx;
  335. font-size: 28rpx; /* 14pt */
  336. color: #666;
  337. position: relative;
  338. display: flex;
  339. flex-direction: column;
  340. align-items: center;
  341. }
  342. .tab-item.active {
  343. font-weight: bold;
  344. color: #333;
  345. }
  346. .tab-line {
  347. width: 28rpx;
  348. height: 4rpx;
  349. background-color: #FF6B00;
  350. border-radius: 4rpx;
  351. position: absolute;
  352. bottom: 0;
  353. }
  354. /* 列表 */
  355. .list-item {
  356. display: flex;
  357. justify-content: space-between;
  358. padding: 24rpx 0;
  359. border-bottom: 1rpx solid #f9f9f9;
  360. }
  361. .item-left {
  362. display: flex;
  363. flex-direction: column;
  364. }
  365. .item-title {
  366. font-size: 28rpx; /* 14pt (Green Box) */
  367. color: #333;
  368. margin-bottom: 8rpx;
  369. font-weight: 500;
  370. }
  371. .item-desc {
  372. font-size: 26rpx; /* 13pt (Red Box) */
  373. color: #999;
  374. margin-bottom: 6rpx;
  375. }
  376. .item-time {
  377. font-size: 24rpx; /* 12pt */
  378. color: #ccc;
  379. }
  380. .item-right {
  381. display: flex;
  382. flex-direction: column;
  383. /* align-items: flex-end; 保持右对齐 */
  384. text-align: right;
  385. }
  386. .item-amount {
  387. font-size: 28rpx; /* 14pt */
  388. font-weight: bold;
  389. margin-bottom: 8rpx;
  390. }
  391. .item-amount.income {
  392. color: #4CAF50;
  393. }
  394. .item-amount.expense {
  395. color: #333;
  396. }
  397. .item-tag {
  398. display: inline-flex;
  399. justify-content: flex-end;
  400. }
  401. .item-tag text {
  402. background-color: #F5F5F5;
  403. padding: 4rpx 12rpx;
  404. border-radius: 6rpx;
  405. font-size: 22rpx; /* 11pt */
  406. color: #999;
  407. }
  408. </style>