diff --git a/src/common/apis/shop/type.ts b/src/common/apis/shop/type.ts index 4f0c723..da2b66f 100644 --- a/src/common/apis/shop/type.ts +++ b/src/common/apis/shop/type.ts @@ -200,6 +200,8 @@ export interface ab98UserDTO { address?: string; /** 是否已注册(0未注册 1已注册) */ registered?: boolean; + /** 借呗余额 单位分 */ + ab98Balance?: number; } export interface OpenCabinetApiData { diff --git a/src/pages/me/index.vue b/src/pages/me/index.vue index ee7796a..311a707 100644 --- a/src/pages/me/index.vue +++ b/src/pages/me/index.vue @@ -11,7 +11,7 @@ const route = useRoute(); const wxStore = useWxStore(); const ab98UserStore = useAb98UserStore(); -const { balance, useBalance, balanceLimit, name: qyName } = storeToRefs(wxStore); +const { balance, useBalance, balanceLimit, name: qyName, ab98User } = storeToRefs(wxStore); const { name: userName, sex: userSex, face_img } = storeToRefs(ab98UserStore); const name = computed(() => { @@ -20,6 +20,13 @@ const name = computed(() => { const userAvatar = face_img.value ? face_img.value : `${publicPath}img/1.jpg`; +const ab98BalanceInYuan = computed(() => { + if (ab98User.value && ab98User.value.ab98Balance !== undefined) { + return (ab98User.value.ab98Balance / 100).toFixed(2); + } + return '0.00'; +}); + const handleLogout = () => { showConfirmDialog({ title: '退出登录', @@ -77,6 +84,10 @@ wxStore.refreshBalance();
剩余借呗
{{ balance }}
+ diff --git a/src/pages/product/components/checkout.vue b/src/pages/product/components/checkout.vue index 14df125..a9b8ad0 100644 --- a/src/pages/product/components/checkout.vue +++ b/src/pages/product/components/checkout.vue @@ -121,6 +121,14 @@ async function handleSubmit() { } } + // 检查是否有可用支付方式 + if (supportedPayments.value.length === 0) { + return showConfirmDialog({ + title: "提示", + message: "没有支持的支付方法,请从微信进入智借还" + }); + } + if (!openid.value && !wxStore.isFakeQyLogin) { return showConfirmDialog({ title: "登录提示", diff --git a/src/pinia/stores/wx.ts b/src/pinia/stores/wx.ts index 1bb010b..3ef2bc7 100644 --- a/src/pinia/stores/wx.ts +++ b/src/pinia/stores/wx.ts @@ -68,6 +68,10 @@ export const useWxStore = defineStore("wx", () => { balance.value = res.data.balance; useBalance.value = res.data.useBalance; balanceLimit.value = res.data.balanceLimit; + + if (res.data.ab98User) { + setAb98User(res.data.ab98User); + } } } }