From 8d60cb6200d832d0cc95d69e6dfb27e3664e40df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E6=AF=85?= <1335909236@qq.com> Date: Fri, 10 Oct 2025 11:41:43 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E6=88=90=E9=92=B1=E5=8C=85=E6=A8=A1?= =?UTF-8?q?=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/wallet.js | 4 + packages/storeManagement/index/index.vue | 31 +++++-- packages/storeManagement/wallet/index.vue | 95 ++++++++++---------- packages/workOrderDashboard/guide/index.vue | 51 ++++++++--- packages/workOrderDashboard/wallet/index.vue | 68 +++++++------- 5 files changed, 146 insertions(+), 103 deletions(-) create mode 100644 api/wallet.js diff --git a/api/wallet.js b/api/wallet.js new file mode 100644 index 00000000..4188f57e --- /dev/null +++ b/api/wallet.js @@ -0,0 +1,4 @@ +export const apiArr = { + walletList: "/api/v2/wechat/wallet/list", // 商户钱包 + walletChangeList: "/api/v2/wechat/wallet/change/list", // 商户钱包变更详情 +}; \ No newline at end of file diff --git a/packages/storeManagement/index/index.vue b/packages/storeManagement/index/index.vue index 07bfaa07..767fa0c9 100644 --- a/packages/storeManagement/index/index.vue +++ b/packages/storeManagement/index/index.vue @@ -25,16 +25,16 @@ 钱包 - - 999.00元 + + {{ walletInfo.guarantee ? walletInfo.guarantee.toFixed(2) : "0.00" }}元 保证金 - - 999.00元 + + {{ walletInfo.receivable ? walletInfo.receivable.toFixed(2) : "0.00" }}元 应收 - - 999.00元 + + {{ walletInfo.handling_fee ? walletInfo.handling_fee.toFixed(2) : "0.00" }}元 手续费 @@ -98,6 +98,7 @@ import { import { apiArr } from '../../../api/community'; +import { apiArr as walletApi } from '../../../api/wallet'; export default { @@ -125,6 +126,7 @@ export default { url: "/packages/customerService/chattingRecords/index", } ], + walletInfo: {}, } }, onLoad(options) { @@ -135,8 +137,16 @@ export default { this.getShopList(); }, - methods: { + // 获取钱包信息 + getWalletInfo() { + const params = { + merchant_id: this.selectedShop.id, + } + request(walletApi.walletList, 'POST', params, { silent: false }).then(res => { + this.walletInfo = res; + }) + }, // 获取商家列表 getShopList() { request(apiArr.getShopList, 'POST', {}, { silent: false }).then(res => { @@ -146,11 +156,14 @@ export default { this.shopList = res.rows; if (this.shopList.length > 0) { this.selectedShop = this.shopList[0]; + // 确保selectedShop有值后再调用getWalletInfo() + this.getWalletInfo(); } }) }, - goWallet(type) { - NavgateTo('/packages/storeManagement/wallet/index?type=' + type); + // 跳转钱包页面 + goWallet(type, amount) { + NavgateTo('/packages/storeManagement/wallet/index?type=' + type + '&merchant_id=' + this.selectedShop.id + '&amount=' + amount); }, changeTab(index) { this.active = index; diff --git a/packages/storeManagement/wallet/index.vue b/packages/storeManagement/wallet/index.vue index b131e426..79fc62da 100644 --- a/packages/storeManagement/wallet/index.vue +++ b/packages/storeManagement/wallet/index.vue @@ -15,11 +15,11 @@ {{ topVal }}(元) {{ balance }} - - - - + + + @@ -27,44 +27,48 @@ - + + + 暂无变动记录 - + - {{ record.name }} - {{ record.time }} + {{ record.change_reason == 1 ? '下单' : '退单' }} - {{ + record.related_order }} + {{ record.change_time }} - {{ - record.amount.startsWith('+') ? '+' : '-' }} - ¥{{ - record.amount.replace(/[+-]/, '') }} + {{ + record.change_reason == 1 ? '+' : '-' }} + ¥{{ + record.amount_change }} - 余:¥{{ record.remain }} + 余:¥{{ record.balance_after }} - {{ - record.amount.startsWith('+') ? '收款' : '退款' }} + {{ + record.change_reason == 1 ? '收款' : '退款' }} - {{ - record.amount.startsWith('+') ? '+' : '-' }} - ¥{{ - record.amount.replace(/[+-]/, '') }} + {{ + record.change_reason == 1 ? '+' : '-' }} + ¥{{ + record.amount_change }} 手续费 - {{ record.amount.startsWith('+') ? '+' : '-' }} - ¥{{ record.amount.replace(/[+-]/, '') }} + {{ record.change_reason == 1 ? '+' : '-' }} + ¥{{ record.amount_change }} @@ -74,27 +78,16 @@