This commit is contained in:
@@ -2,10 +2,16 @@
|
||||
<view class="card user-info-card interactive">
|
||||
<view class="flex-row-g20">
|
||||
<view class="user-details flex-col-g8">
|
||||
<view class="flex-row-g20">
|
||||
<view class="info-copy-row">
|
||||
<view class="title">{{ currentCardNo || '-' }}</view>
|
||||
<image class="copy-icon" src="/static/复制.png" mode="aspectFit"
|
||||
@tap.stop="copyText(currentCardNo, '号码')" aria-label="复制号码"></image>
|
||||
</view>
|
||||
<view v-if="!isDevice" class="info-copy-row">
|
||||
<view class="caption">ICCID:{{ deviceInfo.iccid || '-' }}</view>
|
||||
<image class="copy-icon" src="/static/复制.png" mode="aspectFit"
|
||||
@tap.stop="copyText(deviceInfo.iccid, 'ICCID')" aria-label="复制ICCID"></image>
|
||||
</view>
|
||||
<view v-if="!isDevice" class="caption">ICCID:{{ deviceInfo.iccid || '-' }}</view>
|
||||
<view class="caption">套餐名称:{{ deviceInfo.packageName || '-' }}</view>
|
||||
<view class="caption" :class="{ 'expiry-warning': isExpiring }">
|
||||
套餐到期时间:{{ deviceInfo.expireDate || '-' }}
|
||||
@@ -44,6 +50,15 @@
|
||||
return Boolean(packageName && packageName !== '-');
|
||||
});
|
||||
|
||||
const copyText = (value, label) => {
|
||||
const text = String(value || '').trim();
|
||||
if (!text || text === '-') return;
|
||||
uni.setClipboardData({
|
||||
data: text,
|
||||
success: () => uni.showToast({ title: `${label}已复制`, icon: 'success' })
|
||||
});
|
||||
};
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
@@ -56,6 +71,19 @@
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.info-copy-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12rpx;
|
||||
}
|
||||
|
||||
.copy-icon {
|
||||
width: 28rpx;
|
||||
height: 28rpx;
|
||||
flex-shrink: 0;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.renew-button {
|
||||
margin: 24rpx 0 0;
|
||||
width: 180rpx;
|
||||
|
||||
Reference in New Issue
Block a user