From 7d933131fffc30016c7b725f8288609ccd0f4afc Mon Sep 17 00:00:00 2001 From: wikiboss Date: Thu, 17 Sep 2026 16:19:36 +0800 Subject: [PATCH] =?UTF-8?q?feat(uniapp):=20=E5=AF=B9=E9=BD=90=E9=92=B1?= =?UTF-8?q?=E5=8C=85=E4=BD=99=E9=A2=9D=E9=A1=B5=E9=9D=A2=E9=BB=91=E9=87=91?= =?UTF-8?q?=E5=B0=8A=E4=BA=AB=E5=8D=A1=E7=89=87=E4=B8=8E=E6=94=B6=E6=94=AF?= =?UTF-8?q?=E6=98=8E=E7=BB=86=E5=8D=A1=E7=89=87=E6=B5=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/verify_wallet_money_spec.js | 75 +++ uniapp/pages/user/wallet/money.vue | 989 ++++++++++++++++++----------- 2 files changed, 708 insertions(+), 356 deletions(-) create mode 100644 tests/verify_wallet_money_spec.js diff --git a/tests/verify_wallet_money_spec.js b/tests/verify_wallet_money_spec.js new file mode 100644 index 0000000..f034ca9 --- /dev/null +++ b/tests/verify_wallet_money_spec.js @@ -0,0 +1,75 @@ +const fs = require('fs'); +const path = require('path'); + +let passed = 0; +let failed = 0; + +function assert(condition, testName, detail = '') { + if (condition) { + console.log(` [PASS] ${testName}`); + passed++; + } else { + console.error(` [FAIL] ${testName} - ${detail}`); + failed++; + } +} + +console.log("========================================================"); +console.log(" 钱包余额页面对齐黑金卡片与流水卡片流规格测试"); +console.log("========================================================\n"); + +// 1. 验证 money.vue 存在性 +const moneyVuePath = path.resolve(__dirname, '../uniapp/pages/user/wallet/money.vue'); +assert(fs.existsSync(moneyVuePath), 'money.vue 文件存在'); +const content = fs.readFileSync(moneyVuePath, 'utf-8'); + +// 2. 验证黑金尊享卡片结构 +assert( + content.includes('asset-card') && content.includes('money-hero'), + '包含黑金资产卡片与核心大字数结构', + '未升级为 asset-card 结构' +); + +// 3. 验证余额与充值按钮 +assert( + content.includes('userInfo.money') && + content.includes('/pages/pay/recharge') && + content.includes('充值'), + '包含余额展示与充值跳转入口', + '缺少余额绑定或充值入口' +); + +// 4. 验证金额显隐切换 +assert( + content.includes('showMoney') && + (content.includes('cicon-eye') || content.includes('cicon-eye-off')), + '支持余额明文/掩码显隐切换', + '缺少显隐切换逻辑' +); + +// 5. 验证流水列表卡片流升级 +assert( + content.includes('log-card'), + '收支明细升级为独立 log-card 卡片流', + '仍采用普通边框单行列表' +); + +// 6. 验证总收入与总支出统计 +assert( + content.includes('pagination.income') && content.includes('pagination.expense'), + '包含当前筛选周期总收入与总支出统计', + '缺少收支统计' +); + +// 7. 移除失效的 wallet_card_bg.png 依赖 +assert( + !content.includes('wallet_card_bg.png'), + '移除对失效旧背景图 wallet_card_bg.png 的硬编码依赖', + '仍依赖旧版失效背景图' +); + +console.log("\n--------------------------------------------------------"); +console.log(`测试执行结果: 通过 ${passed} 项, 失败 ${failed} 项`); +console.log("========================================================"); + +process.exit(failed === 0 ? 0 : 1); diff --git a/uniapp/pages/user/wallet/money.vue b/uniapp/pages/user/wallet/money.vue index e147732..27e47ca 100644 --- a/uniapp/pages/user/wallet/money.vue +++ b/uniapp/pages/user/wallet/money.vue @@ -1,356 +1,633 @@ - - - - - + + + + +