From d3c114325bb88b330dfdd447e383971797771b7b Mon Sep 17 00:00:00 2001 From: YunaiV Date: Sat, 30 Sep 2023 22:07:57 +0800 Subject: [PATCH] =?UTF-8?q?wallet=EF=BC=9A=E6=8E=A5=E5=85=A5=E6=94=AF?= =?UTF-8?q?=E4=BB=98=E6=94=B6=E9=93=B6=E5=8F=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/goods/cashier/index.vue | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/pages/goods/cashier/index.vue b/pages/goods/cashier/index.vue index e394cc19..262c2ef2 100644 --- a/pages/goods/cashier/index.vue +++ b/pages/goods/cashier/index.vue @@ -20,8 +20,8 @@ {{item.name}} - - {{item.title}} ¥{{ item.number }} + + {{item.title}} ¥{{ fen2yuan(wallet.balance || 0) }} {{item.title}} @@ -40,7 +40,9 @@ import numberScroll from '@/components/numberScroll.vue' import * as PayOrderApi from '@/api/pay/order.js'; import * as PayChannelApi from '@/api/pay/channel.js'; - export default { + import * as WalletApi from '@/api/pay/wallet.js'; + import {fen2yuan} from "../../../utils/util"; + export default { components: { CountDown, numberScroll @@ -52,6 +54,8 @@ payPrice: 0, // 支付金额 invalidTime: 0, // 过期时间 + wallet: {}, + channelCode: '', // 选中的支付渠道 channels: [{ // 支付方式 name: '微信支付', // 微信公众号 @@ -72,6 +76,7 @@ name: '余额支付', icon: "icon-yuezhifu", title: '可用余额', + code: "wallet" }, { name: '模拟支付', icon: "icon-yuezhifu", @@ -106,6 +111,7 @@ this.getCashierOrder() }, methods: { + fen2yuan, getCashierOrder() { uni.showLoading({ title: '加载订单中' @@ -305,6 +311,11 @@ this.payType(this.channels[0].code) } }) + + // 3. // 获得钱包 + WalletApi.getPayWallet().then(res=>{ + this.wallet = res.data; + }) }, /** * 设置支付方式