fix: 设备首页不显示iccid
All checks were successful
构建并部署前端到生产环境 / build-and-deploy (push) Successful in 2m8s

This commit is contained in:
luo
2026-07-20 10:25:39 +08:00
parent d90a51ebf4
commit 59696a7e8e
5 changed files with 12 additions and 66 deletions

View File

@@ -5,16 +5,6 @@
<view class="flex-row-g20"> <view class="flex-row-g20">
<view class="title">{{ currentCardNo || '-' }}</view> <view class="title">{{ currentCardNo || '-' }}</view>
</view> </view>
<view class="iccid-row caption">
<text>ICCID: {{ deviceInfo.iccid || '-' }}</text>
<button
v-if="deviceInfo.iccid && deviceInfo.iccid !== '-'"
class="copy-btn"
@tap.stop="$emit('copy', deviceInfo.iccid)"
>
复制
</button>
</view>
<view class="caption">套餐名称{{ deviceInfo.packageName || '-' }}</view> <view class="caption">套餐名称{{ deviceInfo.packageName || '-' }}</view>
<view class="caption">套餐到期时间{{ deviceInfo.expireDate || '-' }}</view> <view class="caption">套餐到期时间{{ deviceInfo.expireDate || '-' }}</view>
</view> </view>
@@ -37,7 +27,6 @@
isDevice: { type: Boolean, default: true } isDevice: { type: Boolean, default: true }
}); });
defineEmits(['copy']);
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
@@ -48,28 +37,5 @@
flex: 1; flex: 1;
} }
.iccid-row {
display: flex;
align-items: center;
gap: 12rpx;
flex-wrap: wrap;
}
.copy-btn {
margin: 0;
padding: 0 12rpx;
min-height: 36rpx;
line-height: 36rpx;
border: none;
border-radius: 6rpx;
background: rgba(10, 132, 255, 0.12);
color: var(--primary);
font-size: 22rpx;
font-weight: 600;
}
.copy-btn::after {
border: none;
}
} }
</style> </style>

View File

@@ -1,7 +1,7 @@
<template> <template>
<view class="container"> <view class="container">
<UserInfoCard :currentCardNo="currentCardNo" :deviceInfo="deviceInfo" :onlineStatus="onlineStatus" <UserInfoCard :currentCardNo="currentCardNo" :deviceInfo="deviceInfo" :onlineStatus="onlineStatus"
:isDevice="userInfo.isDevice" :networkStatus="deviceInfo.network_status" @copy="copy" /> :isDevice="userInfo.isDevice" :networkStatus="deviceInfo.network_status" />
<DeviceStatusCard v-if="userInfo.isDevice" :deviceInfo="deviceInfo" :isRealName="isRealName" <DeviceStatusCard v-if="userInfo.isDevice" :deviceInfo="deviceInfo" :isRealName="isRealName"
:isDevice="userInfo.isDevice" @authentication="enterDetail('authentication')" /> :isDevice="userInfo.isDevice" @authentication="enterDetail('authentication')" />

View File

@@ -155,15 +155,7 @@
</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-item" :class="{ active: rechargePaymentMethod === 'alipay' }" @tap="selectRechargePaymentMethod('alipay')">
<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 v-else 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>
<text class="method-name">支付宝支付</text> <text class="method-name">支付宝支付</text>
@@ -226,15 +218,13 @@
const selectedAmount = ref(null); const selectedAmount = ref(null);
const isCustomAmount = ref(false); const isCustomAmount = ref(false);
const customAmount = ref(''); const customAmount = ref('');
const rechargePaymentMethod = ref('wechat'); const rechargePaymentMethod = ref('alipay');
const rechargeSubmitting = ref(false); const rechargeSubmitting = ref(false);
const rechargeOrderSubmittingKey = ref(null); const rechargeOrderSubmittingKey = ref(null);
const isDeviceAsset = ref(true); const isDeviceAsset = ref(true);
let assetTypePromise = null; let assetTypePromise = null;
const paymentMethodOptions = computed(() => [ const paymentMethodOptions = computed(() => [
isDeviceAsset.value { label: '支付宝支付', value: 'alipay' }
? { label: '微信支付', value: 'wechat' }
: { label: '支付宝支付', value: 'alipay' }
]); ]);
const rechargeAmounts = [ const rechargeAmounts = [
{ value: 1000, label: '10' }, { value: 1000, label: '10' },
@@ -308,7 +298,7 @@
return rechargeOrderSubmittingKey.value === getRechargeOrderSubmitKey(rechargeOrder); return rechargeOrderSubmittingKey.value === getRechargeOrderSubmitKey(rechargeOrder);
}; };
const getDefaultRechargePaymentMethod = () => isDeviceAsset.value ? 'wechat' : 'alipay'; const getDefaultRechargePaymentMethod = () => 'alipay';
const normalizeRechargePaymentMethod = () => { const normalizeRechargePaymentMethod = () => {
const defaultMethod = getDefaultRechargePaymentMethod(); const defaultMethod = getDefaultRechargePaymentMethod();

View File

@@ -100,9 +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: 'alipay' },
? { label: '微信支付', value: 'wechat' }
: { label: '支付宝支付', value: 'alipay' },
{ label: '钱包支付', value: 'wallet' } { label: '钱包支付', value: 'wallet' }
]); ]);
const filterOptions = [ const filterOptions = [

View File

@@ -59,15 +59,7 @@
</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-item" :class="{ active: paymentMethod === 'alipay' }" @tap="selectPaymentMethod('alipay')">
<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 v-else 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>
<text class="method-name">支付宝支付</text> <text class="method-name">支付宝支付</text>
@@ -117,7 +109,7 @@
const currentPackage = ref(null); const currentPackage = ref(null);
const packageList = reactive([]); const packageList = reactive([]);
const loading = ref(false); const loading = ref(false);
const paymentMethod = ref('wechat'); const paymentMethod = ref('alipay');
const walletBalance = ref(0); const walletBalance = ref(0);
const paySubmitting = ref(false); const paySubmitting = ref(false);
const isDeviceAsset = ref(true); const isDeviceAsset = ref(true);
@@ -135,12 +127,12 @@
return `${allowance} ${unit}`; return `${allowance} ${unit}`;
}; };
const getDefaultPaymentMethod = () => isDeviceAsset.value ? 'wechat' : 'alipay'; const getDefaultPaymentMethod = () => 'alipay';
const isPaymentMethodAvailable = (method) => { const isPaymentMethodAvailable = (method) => {
if (method === 'wallet') return true; if (method === 'wallet') return true;
if (method === 'wechat') return isDeviceAsset.value; if (method === 'wechat') return false;
if (method === 'alipay') return !isDeviceAsset.value; if (method === 'alipay') return true;
return false; return false;
}; };
@@ -243,7 +235,7 @@
const getCreateOrderPaymentMethod = () => { const getCreateOrderPaymentMethod = () => {
if (paymentMethod.value === 'alipay') return 'alipay'; if (paymentMethod.value === 'alipay') return 'alipay';
if (paymentMethod.value === 'wallet' && !isDeviceAsset.value) return 'alipay'; if (paymentMethod.value === 'wallet') return 'alipay';
return undefined; return undefined;
}; };