fix(支付): 根据企业登录状态自动选择支付方式
当用户是企业登录时,默认选择余额支付,否则选择微信支付。同时修复企业登录状态下余额支付选项的显示问题。
This commit is contained in:
parent
999625ccd0
commit
c7c8c0ce21
|
@ -22,7 +22,15 @@ const { tel, userid: ab98Userid, name } = storeToRefs(ab98UserStore)
|
||||||
const selectedPayment = ref<'wechat' | 'balance'>('wechat')
|
const selectedPayment = ref<'wechat' | 'balance'>('wechat')
|
||||||
const contact = ref("")
|
const contact = ref("")
|
||||||
const remark = ref("")
|
const remark = ref("")
|
||||||
const submitting = ref(false)
|
const submitting = ref(false);
|
||||||
|
|
||||||
|
watch(corpidLogin, (newValue) => {
|
||||||
|
if (newValue) {
|
||||||
|
selectedPayment.value = 'balance';
|
||||||
|
} else {
|
||||||
|
selectedPayment.value = 'wechat';
|
||||||
|
}
|
||||||
|
}, { immediate: true });
|
||||||
|
|
||||||
function callWxJsApi(paymentInfo: WxJsApiPreCreateResponse) {
|
function callWxJsApi(paymentInfo: WxJsApiPreCreateResponse) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
|
@ -194,7 +202,7 @@ async function handleSubmit() {
|
||||||
<van-icon v-if="selectedPayment === 'wechat'" name="success" class="check-icon" />
|
<van-icon v-if="selectedPayment === 'wechat'" name="success" class="check-icon" />
|
||||||
</van-cell>
|
</van-cell>
|
||||||
|
|
||||||
<van-cell
|
<van-cell v-if="corpidLogin"
|
||||||
:class="['payment-option', { selected: selectedPayment === 'balance', disabled: balance < totalPrice }]"
|
:class="['payment-option', { selected: selectedPayment === 'balance', disabled: balance < totalPrice }]"
|
||||||
@click="selectedPayment = 'balance'">
|
@click="selectedPayment = 'balance'">
|
||||||
<van-icon name="balance-o" class="method-icon" />
|
<van-icon name="balance-o" class="method-icon" />
|
||||||
|
|
Loading…
Reference in New Issue