This commit is contained in:
@@ -3,7 +3,7 @@
|
|||||||
<view class="card-header">
|
<view class="card-header">
|
||||||
<view class="title">功能菜单</view>
|
<view class="title">功能菜单</view>
|
||||||
<!-- <view class="header-actions">
|
<!-- <view class="header-actions">
|
||||||
<button class="btn-apple btn-primary" @tap="$emit('sync')">运营商数据同步</button>
|
<button class="btn-apple btn-primary" @tap="$emit('sync')">运营数据同步</button>
|
||||||
</view> -->
|
</view> -->
|
||||||
</view>
|
</view>
|
||||||
<view class="function-grid">
|
<view class="function-grid">
|
||||||
@@ -82,9 +82,9 @@
|
|||||||
<view class="function-item interactive card-interactive" @tap="$emit('enter', 'wallet')" role="button"
|
<view class="function-item interactive card-interactive" @tap="$emit('enter', 'wallet')" role="button"
|
||||||
tabindex="0">
|
tabindex="0">
|
||||||
<view class="function-icon">
|
<view class="function-icon">
|
||||||
<image src="/static/wallet.png" mode="aspectFit" alt="我的钱包"></image>
|
<image src="/static/wallet.png" mode="aspectFit" alt="钱包"></image>
|
||||||
</view>
|
</view>
|
||||||
<view class="function-name">我的钱包</view>
|
<view class="function-name">{{ walletText }}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="function-item interactive card-interactive" v-if="isDevice" @tap="$emit('enter', 'recover')"
|
<view class="function-item interactive card-interactive" v-if="isDevice" @tap="$emit('enter', 'recover')"
|
||||||
role="button" tabindex="0">
|
role="button" tabindex="0">
|
||||||
@@ -114,6 +114,8 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
|
import { computed } from 'vue';
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
realNameStatus: {
|
realNameStatus: {
|
||||||
type: String,
|
type: String,
|
||||||
@@ -126,17 +128,21 @@
|
|||||||
isDevice: {
|
isDevice: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: true
|
default: true
|
||||||
|
},
|
||||||
|
walletBalance: {
|
||||||
|
type: [Number, String],
|
||||||
|
default: 0
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
const emit = defineEmits(['enter', 'sync']);
|
const emit = defineEmits(['enter', 'sync']);
|
||||||
|
|
||||||
|
const walletText = computed(() => '钱包(¥:' + (props.walletBalance ?? 0) + ')');
|
||||||
|
|
||||||
const handleBindPhone = () => {
|
const handleBindPhone = () => {
|
||||||
if (props.alreadyBindPhone) {
|
if (props.alreadyBindPhone) {
|
||||||
// 已绑定,不可点击
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// 未绑定,可以点击进入绑定页面
|
|
||||||
emit('enter', 'bind');
|
emit('enter', 'bind');
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
@@ -189,4 +195,4 @@
|
|||||||
.text-primary {
|
.text-primary {
|
||||||
color: var(--primary) !important;
|
color: var(--primary) !important;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
<view class="flex-row-g20">
|
<view class="flex-row-g20">
|
||||||
<view class="title">{{ currentCardNo || '-' }}</view>
|
<view class="title">{{ currentCardNo || '-' }}</view>
|
||||||
</view>
|
</view>
|
||||||
|
<view class="caption">套餐名称:{{ deviceInfo.packageName || '-' }}</view>
|
||||||
<view class="caption">套餐到期时间:{{ deviceInfo.expireDate || '-' }}</view>
|
<view class="caption">套餐到期时间:{{ deviceInfo.expireDate || '-' }}</view>
|
||||||
</view>
|
</view>
|
||||||
<view v-if="isDevice" class="tag-apple" :class="onlineStatus === '在线' ? 'tag-success' : 'tag-warning'">
|
<view v-if="isDevice" class="tag-apple" :class="onlineStatus === '在线' ? 'tag-success' : 'tag-warning'">
|
||||||
@@ -30,14 +31,12 @@
|
|||||||
currentCardNo: { type: String, default: '' },
|
currentCardNo: { type: String, default: '' },
|
||||||
deviceInfo: { type: Object, default: () => ({}) },
|
deviceInfo: { type: Object, default: () => ({}) },
|
||||||
onlineStatus: { type: String, default: '离线' },
|
onlineStatus: { type: String, default: '离线' },
|
||||||
networkStatus: { type: String, default: '离线' },
|
networkStatus: { type: [String, Number], default: '离线' },
|
||||||
isDevice: { type: Boolean, default: true }
|
isDevice: { type: Boolean, default: true }
|
||||||
});
|
});
|
||||||
|
|
||||||
// 默认头像
|
|
||||||
const defaultAvatar = 'https://img1.baidu.com/it/u=2462918877,1866131262&fm=253&fmt=auto&app=138&f=JPEG?w=506&h=500';
|
const defaultAvatar = 'https://img1.baidu.com/it/u=2462918877,1866131262&fm=253&fmt=auto&app=138&f=JPEG?w=506&h=500';
|
||||||
|
|
||||||
// 用户头像,优先使用 store 中的头像,否则使用默认头像
|
|
||||||
const avatarUrl = computed(() => {
|
const avatarUrl = computed(() => {
|
||||||
return userStore.state.userInfo.avatar || defaultAvatar;
|
return userStore.state.userInfo.avatar || defaultAvatar;
|
||||||
});
|
});
|
||||||
@@ -46,14 +45,23 @@
|
|||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
.user-info-card {
|
.user-info-card {
|
||||||
color: var(--text-primary);
|
color: var(--text-primary);
|
||||||
|
|
||||||
.user-avatar {
|
.user-avatar {
|
||||||
width: 80rpx;
|
width: 80rpx;
|
||||||
height: 80rpx;
|
height: 80rpx;
|
||||||
border-radius: var(--radius-medium);
|
border-radius: var(--radius-medium);
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
border: 2rpx solid var(--border-light);
|
border: 2rpx solid var(--border-light);
|
||||||
image { width: 100%; height: 100%; object-fit: cover; }
|
|
||||||
|
image {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
object-fit: cover;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.user-details {
|
||||||
|
flex: 1;
|
||||||
}
|
}
|
||||||
.user-details { flex: 1; }
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
<!-- <VoiceCard v-if="!userInfo.isDevice" :voiceStats="voiceStats" :dateRangeText="dateRangeText"
|
<!-- <VoiceCard v-if="!userInfo.isDevice" :voiceStats="voiceStats" :dateRangeText="dateRangeText"
|
||||||
@openDatePicker="openDateRangePicker" /> -->
|
@openDatePicker="openDateRangePicker" /> -->
|
||||||
|
|
||||||
<TrafficCard :identifier="currentCardNo" @packageLoaded="handlePackageLoaded" />
|
<TrafficCard :identifier="currentCardNo" />
|
||||||
|
|
||||||
<!-- <WhitelistCard v-if="!userInfo.isDevice" :whitelistData="whitelistData" @refresh="refreshWhitelist"
|
<!-- <WhitelistCard v-if="!userInfo.isDevice" :whitelistData="whitelistData" @refresh="refreshWhitelist"
|
||||||
@add="showAddWhitelistDialog" @showSms="showSmsCodeDialog" /> -->
|
@add="showAddWhitelistDialog" @showSms="showSmsCodeDialog" /> -->
|
||||||
@@ -17,7 +17,7 @@
|
|||||||
<WifiCard v-if="userInfo.isDevice" :deviceInfo="deviceInfo" @modify="modifyWifi" @copy="copy" />
|
<WifiCard v-if="userInfo.isDevice" :deviceInfo="deviceInfo" @modify="modifyWifi" @copy="copy" />
|
||||||
|
|
||||||
<FunctionCard :realNameStatus="realNameStatus" :alreadyBindPhone="alreadyBindPhone"
|
<FunctionCard :realNameStatus="realNameStatus" :alreadyBindPhone="alreadyBindPhone"
|
||||||
:isDevice="userInfo.isDevice" @enter="enterDetail" @sync="onSync">
|
:isDevice="userInfo.isDevice" :walletBalance="deviceInfo.walletBalance" @enter="enterDetail" @sync="onSync">
|
||||||
<!-- 修改WIFI弹窗 -->
|
<!-- 修改WIFI弹窗 -->
|
||||||
<up-popup :show="showModifyWifi" mode="center" @close="showModifyWifi=false">
|
<up-popup :show="showModifyWifi" mode="center" @close="showModifyWifi=false">
|
||||||
<view class="wifi-popup">
|
<view class="wifi-popup">
|
||||||
@@ -147,7 +147,9 @@
|
|||||||
connect: 0,
|
connect: 0,
|
||||||
network_status: 1,
|
network_status: 1,
|
||||||
status: 1,
|
status: 1,
|
||||||
|
packageName: '-',
|
||||||
expireDate: '-',
|
expireDate: '-',
|
||||||
|
walletBalance: 0,
|
||||||
currentIccid: '-',
|
currentIccid: '-',
|
||||||
category: '-',
|
category: '-',
|
||||||
phone: '-',
|
phone: '-',
|
||||||
@@ -206,6 +208,11 @@
|
|||||||
let smsCodePhone = ref('');
|
let smsCodePhone = ref('');
|
||||||
let smsCode = ref('');
|
let smsCode = ref('');
|
||||||
|
|
||||||
|
const formatDate = (dateStr) => {
|
||||||
|
if (!dateStr) return '-';
|
||||||
|
return dateStr.split('T')[0] || '-';
|
||||||
|
};
|
||||||
|
|
||||||
const loadAssetInfo = async () => {
|
const loadAssetInfo = async () => {
|
||||||
const identifier = userStore.state.identifier;
|
const identifier = userStore.state.identifier;
|
||||||
if (!identifier) return;
|
if (!identifier) return;
|
||||||
@@ -222,6 +229,9 @@
|
|||||||
deviceInfo.imei = data.imei || '-';
|
deviceInfo.imei = data.imei || '-';
|
||||||
deviceInfo.asset_type = data.asset_type || 'device';
|
deviceInfo.asset_type = data.asset_type || 'device';
|
||||||
deviceInfo.bound_phone = data.bound_phone || '';
|
deviceInfo.bound_phone = data.bound_phone || '';
|
||||||
|
deviceInfo.packageName = data.current_package || '-';
|
||||||
|
deviceInfo.expireDate = formatDate(data.current_package_expires_at);
|
||||||
|
deviceInfo.walletBalance = data.wallet_balance ?? 0;
|
||||||
isRealName.value = data.real_name_status === 1;
|
isRealName.value = data.real_name_status === 1;
|
||||||
realNameStatus.value = data.real_name_status === 1 ? '已实名' : '未实名';
|
realNameStatus.value = data.real_name_status === 1 ? '已实名' : '未实名';
|
||||||
boundPhone.value = data.bound_phone || '';
|
boundPhone.value = data.bound_phone || '';
|
||||||
|
|||||||
Reference in New Issue
Block a user