This commit is contained in:
@@ -103,7 +103,7 @@
|
|||||||
<!-- 蓝色个人信息区域 -->
|
<!-- 蓝色个人信息区域 -->
|
||||||
<view class="user-header">
|
<view class="user-header">
|
||||||
<view class="user-info">
|
<view class="user-info">
|
||||||
<view class="avatar-wrapper">
|
<view class="avatar-wrapper" @click="handleAvatarClick">
|
||||||
<image class="avatar" :src="userInfo.avatar || '/static/default-avatar.png'" mode="aspectFill" />
|
<image class="avatar" :src="userInfo.avatar || '/static/default-avatar.png'" mode="aspectFill" />
|
||||||
</view>
|
</view>
|
||||||
<view class="user-detail">
|
<view class="user-detail">
|
||||||
@@ -122,6 +122,13 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
<!-- 退出登录 -->
|
||||||
|
<view class="menu-list logout-btn" @click="handleLogout">
|
||||||
|
<view class="menu-item">
|
||||||
|
<text class="menu-text" style="color: #e4393c; text-align: center; width: 100%;">退出登录</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
<!-- 开发调试工具(仅开发环境显示) -->
|
<!-- 开发调试工具(仅开发环境显示) -->
|
||||||
<view v-if="isDev" class="dev-tools">
|
<view v-if="isDev" class="dev-tools">
|
||||||
<view class="dev-tools-title">开发工具</view>
|
<view class="dev-tools-title">开发工具</view>
|
||||||
@@ -171,6 +178,8 @@ export default {
|
|||||||
categoryList: [],
|
categoryList: [],
|
||||||
activeCategory: 'all',
|
activeCategory: 'all',
|
||||||
userInfo: { nickname: '', phone: '', avatar: '' },
|
userInfo: { nickname: '', phone: '', avatar: '' },
|
||||||
|
avatarClickCount: 0,
|
||||||
|
avatarClickTimer: null,
|
||||||
menuList: [
|
menuList: [
|
||||||
{ title: '我的订单', action: 'order' },
|
{ title: '我的订单', action: 'order' },
|
||||||
{ title: '常见问题', action: 'faq' },
|
{ title: '常见问题', action: 'faq' },
|
||||||
@@ -309,6 +318,39 @@ export default {
|
|||||||
},
|
},
|
||||||
handleNavPrev() { this.currentTab = 'home'; },
|
handleNavPrev() { this.currentTab = 'home'; },
|
||||||
handleNavNext() { uni.showToast({ title: '暂无下一页', icon: 'none' }); },
|
handleNavNext() { uni.showToast({ title: '暂无下一页', icon: 'none' }); },
|
||||||
|
handleAvatarClick() {
|
||||||
|
this.avatarClickCount++;
|
||||||
|
clearTimeout(this.avatarClickTimer);
|
||||||
|
|
||||||
|
if (this.avatarClickCount >= 10) {
|
||||||
|
// 点击10次,清除缓存
|
||||||
|
this.avatarClickCount = 0;
|
||||||
|
this.clearCacheAndReload();
|
||||||
|
} else {
|
||||||
|
// 2秒后重置计数
|
||||||
|
this.avatarClickTimer = setTimeout(() => {
|
||||||
|
this.avatarClickCount = 0;
|
||||||
|
}, 2000);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
handleLogout() {
|
||||||
|
uni.showModal({
|
||||||
|
title: '退出登录',
|
||||||
|
content: '确定要退出登录吗?',
|
||||||
|
success: (res) => {
|
||||||
|
if (res.confirm) {
|
||||||
|
this.clearCacheAndReload();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
clearCacheAndReload() {
|
||||||
|
uni.clearStorageSync();
|
||||||
|
uni.showToast({ title: '已退出登录', icon: 'success' });
|
||||||
|
setTimeout(() => {
|
||||||
|
location.reload();
|
||||||
|
}, 1000);
|
||||||
|
},
|
||||||
onVConsoleChange(e) {
|
onVConsoleChange(e) {
|
||||||
const enabled = e.detail.value;
|
const enabled = e.detail.value;
|
||||||
if (enabled) {
|
if (enabled) {
|
||||||
@@ -457,6 +499,7 @@ page { height: 100%; background-color: #fff; }
|
|||||||
.menu-item:last-child { border-bottom: none; }
|
.menu-item:last-child { border-bottom: none; }
|
||||||
.menu-text { font-size: 30rpx; color: #333; }
|
.menu-text { font-size: 30rpx; color: #333; }
|
||||||
.menu-arrow { font-size: 28rpx; color: #ccc; }
|
.menu-arrow { font-size: 28rpx; color: #ccc; }
|
||||||
|
.logout-btn { margin-top: 20rpx; }
|
||||||
|
|
||||||
/* 开发工具区域 */
|
/* 开发工具区域 */
|
||||||
.dev-tools { margin-top: 20rpx; background-color: #fff; border-radius: 16rpx; overflow: hidden; }
|
.dev-tools { margin-top: 20rpx; background-color: #fff; border-radius: 16rpx; overflow: hidden; }
|
||||||
|
|||||||
Reference in New Issue
Block a user