fix: 修复登录跳转与支付展示异常
修复 H5 未登录扫码跳转登录页路径错误,补充手机号登录印尼/中国区号选择与校验,并修正支付方式单选及币种符号展示,避免支付页显示和选择异常。 Made-with: Cursor
This commit is contained in:
@@ -40,7 +40,7 @@
|
||||
</view>
|
||||
<view class="price-item">
|
||||
<text class="label">{{ $t('payment.deposit') }}</text>
|
||||
<text class="value">¥ {{ orderInfo.deposit || '90' }}</text>
|
||||
<text class="value">{{ currencySymbol }} {{ orderInfo.deposit || '90' }}</text>
|
||||
</view>
|
||||
<!-- <view class="price-item">
|
||||
<text class="label">{{ $t('payment.package') }}</text>
|
||||
@@ -49,7 +49,7 @@
|
||||
<view class="price-item total">
|
||||
<text class="label">{{ $t('payment.total') }}</text>
|
||||
<view class="total-value">
|
||||
<text class="currency">¥</text>
|
||||
<text class="currency">{{ currencySymbol }}</text>
|
||||
<text class="amount">{{ totalAmount }}</text>
|
||||
</view>
|
||||
</view>
|
||||
@@ -61,7 +61,7 @@
|
||||
<view class="card-title-bar"></view>
|
||||
<view class="card-title">{{ $t('payment.paymentMethod') }}</view>
|
||||
</view>
|
||||
<view class="payment-method-item" v-for="item in paymentMethods" :key="item.paymentMethodType"
|
||||
<view class="payment-method-item" v-for="(item, idx) in paymentMethods" :key="`${item.paymentMethodType}-${idx}`"
|
||||
@click="selectPaymentMethod(item.paymentMethodType)">
|
||||
<view class="method-left">
|
||||
<text class="method-name">{{ item.paymentMethodName }}</text>
|
||||
@@ -76,7 +76,7 @@
|
||||
<!-- 底部操作栏 -->
|
||||
<view class="bottom-bar">
|
||||
<view class="pay-btn" @click="handlePayment">
|
||||
<text class="currency-small">¥</text>
|
||||
<text class="currency-small">{{ currencySymbol }}</text>
|
||||
<text class="amount-large">{{ totalAmount }}</text>
|
||||
<text class="pay-text">{{ $t('payment.payNow') }}</text>
|
||||
</view>
|
||||
@@ -156,6 +156,14 @@
|
||||
return deposit.toFixed(2)
|
||||
})
|
||||
|
||||
const getCurrencySymbolByMethod = (methodType) => {
|
||||
if (methodType === 'ALIPAY_ID') return 'Rp'
|
||||
if (methodType === 'ALIPAY_HK') return 'HK$'
|
||||
return '¥'
|
||||
}
|
||||
|
||||
const currencySymbol = computed(() => getCurrencySymbolByMethod(selectedPaymentMethod.value))
|
||||
|
||||
// 加载订单信息
|
||||
const loadOrderInfo = async () => {
|
||||
// 检查 orderId 是否存在,如果不存在则尝试从缓存获取
|
||||
@@ -295,6 +303,8 @@
|
||||
try {
|
||||
const osType = getOsType();
|
||||
const res = await getAntomPaymentMethods(orderInfo.value.orderNo, osType);
|
||||
console.log(res.data);
|
||||
console.log(res.data.paymentOptions,'支付方式');
|
||||
// if (res.code === 200 && res.data && res.data.paymentOptions) {
|
||||
// res.data.paymentOptions.forEach(item => {
|
||||
// methods.push({
|
||||
@@ -303,10 +313,14 @@
|
||||
// });
|
||||
// });
|
||||
// }
|
||||
//因后端约束,固定支付方式ALIPAY_HK
|
||||
// 每条选项的 paymentMethodType 必须唯一下发到 Antom 的 paymentType 参数,否则 v-for 的 key 与单选态会异常
|
||||
methods.push({
|
||||
paymentMethodType:'ALIPAY_HK',
|
||||
paymentMethodName:'ALIPAY_HK'
|
||||
paymentMethodType: 'ALIPAY_HK',
|
||||
paymentMethodName: t('payment.alipayHk')
|
||||
})
|
||||
methods.push({
|
||||
paymentMethodType: 'ALIPAY_ID',
|
||||
paymentMethodName: t('payment.alipayId')
|
||||
})
|
||||
} catch (error) {
|
||||
console.error('获取 Antom 支付方式失败:', error);
|
||||
|
||||
Reference in New Issue
Block a user