feat: 设备: 微信和支付宝/卡: 支付宝
All checks were successful
构建并部署前端到生产环境 / build-and-deploy (push) Successful in 1m43s

This commit is contained in:
luo
2026-07-27 16:32:45 +08:00
parent 59696a7e8e
commit 189d64c290
3 changed files with 20 additions and 2 deletions

View File

@@ -155,6 +155,14 @@
</view> </view>
<view class="payment-methods"> <view class="payment-methods">
<view v-if="isDeviceAsset" class="method-item" :class="{ active: rechargePaymentMethod === 'wechat' }" @tap="selectRechargePaymentMethod('wechat')">
<view class="method-left">
<image class="method-icon" src="/static/wechat.png" mode="aspectFit"></image>
<text class="method-name">微信支付</text>
</view>
<view class="method-radio" :class="{ checked: rechargePaymentMethod === 'wechat' }"></view>
</view>
<view class="method-item" :class="{ active: rechargePaymentMethod === 'alipay' }" @tap="selectRechargePaymentMethod('alipay')"> <view class="method-item" :class="{ active: rechargePaymentMethod === 'alipay' }" @tap="selectRechargePaymentMethod('alipay')">
<view class="method-left"> <view class="method-left">
<view class="method-icon method-badge method-badge-alipay"></view> <view class="method-icon method-badge method-badge-alipay"></view>
@@ -224,6 +232,7 @@
const isDeviceAsset = ref(true); const isDeviceAsset = ref(true);
let assetTypePromise = null; let assetTypePromise = null;
const paymentMethodOptions = computed(() => [ const paymentMethodOptions = computed(() => [
...(isDeviceAsset.value ? [{ label: '微信支付', value: 'wechat' }] : []),
{ label: '支付宝支付', value: 'alipay' } { label: '支付宝支付', value: 'alipay' }
]); ]);
const rechargeAmounts = [ const rechargeAmounts = [
@@ -377,7 +386,7 @@
}; };
const selectRechargePaymentMethod = (method) => { const selectRechargePaymentMethod = (method) => {
if (method !== getDefaultRechargePaymentMethod()) return; if (!paymentMethodOptions.value.some((item) => item.value === method)) return;
rechargePaymentMethod.value = method; rechargePaymentMethod.value = method;
}; };

View File

@@ -100,6 +100,7 @@
const isDeviceAsset = ref(true); const isDeviceAsset = ref(true);
let assetTypePromise = null; let assetTypePromise = null;
const paymentMethodOptions = computed(() => [ const paymentMethodOptions = computed(() => [
...(isDeviceAsset.value ? [{ label: '微信支付', value: 'wechat' }] : []),
{ label: '支付宝支付', value: 'alipay' }, { label: '支付宝支付', value: 'alipay' },
{ label: '钱包支付', value: 'wallet' } { label: '钱包支付', value: 'wallet' }
]); ]);

View File

@@ -59,6 +59,14 @@
</view> </view>
<view class="payment-methods"> <view class="payment-methods">
<view v-if="isDeviceAsset" class="method-item" :class="{ active: paymentMethod === 'wechat' }" @tap="selectPaymentMethod('wechat')">
<view class="method-left">
<image class="method-icon" src="/static/wechat.png" mode="aspectFit"></image>
<text class="method-name">微信支付</text>
</view>
<view class="method-radio" :class="{ checked: paymentMethod === 'wechat' }"></view>
</view>
<view class="method-item" :class="{ active: paymentMethod === 'alipay' }" @tap="selectPaymentMethod('alipay')"> <view class="method-item" :class="{ active: paymentMethod === 'alipay' }" @tap="selectPaymentMethod('alipay')">
<view class="method-left"> <view class="method-left">
<view class="method-icon method-badge method-badge-alipay"></view> <view class="method-icon method-badge method-badge-alipay"></view>
@@ -131,7 +139,7 @@
const isPaymentMethodAvailable = (method) => { const isPaymentMethodAvailable = (method) => {
if (method === 'wallet') return true; if (method === 'wallet') return true;
if (method === 'wechat') return false; if (method === 'wechat') return isDeviceAsset.value;
if (method === 'alipay') return true; if (method === 'alipay') return true;
return false; return false;
}; };