在线更新换位置

This commit is contained in:
wong
2025-11-18 14:14:29 +08:00
parent fb9e61aafe
commit f7c0679abc
2 changed files with 156 additions and 20 deletions

View File

@@ -54,13 +54,37 @@
<!-- #endif -->
<view v-if="show" class="side-menu-container">
<view class="side-menu-mask" @tap="closeSideMenu"></view>
<view class="side-menu-mask" @tap="closeSideMenu" @touchstart="closeSettingsDropdown"></view>
<view class="side-menu">
<view class="side-menu-header">
<text class="side-menu-title">AI数智员工</text>
<!-- <text class="close-icon" @tap="closeSideMenu">
<u-icon name="close" color="#333" size="24"></u-icon>
</text> -->
<!-- #ifdef APP-PLUS -->
<view class="header-right">
<view class="settings-btn" @tap="toggleSettingsDropdown">
<view class="settings-btn-content">
<u-icon name="setting" color="#333" size="24"></u-icon>
<text v-if="!checkingUpdate && hasNewVersion" class="version-badge"></text>
</view>
</view>
<!-- 设置下拉菜单 -->
<view v-if="showSettingsDropdown" class="settings-dropdown">
<view class="dropdown-item combined-item" @tap="handleCheckUpdate(false)">
<view class="icon-container">
<u-icon name="reload" color="#5096ff" size="24"></u-icon>
</view>
<view class="text-container">
<view class="text-top">
<text class="main-text">检查更新</text>
<text v-if="!checkingUpdate && hasNewVersion" class="update-badge"></text>
</view>
<view class="text-bottom">
<text class="version-info">当前版本 {{ currentVersion }}</text>
</view>
</view>
</view>
</view>
</view>
<!-- #endif -->
</view>
@@ -170,21 +194,6 @@
</view>
</view>
</view>
<!-- #ifdef APP-PLUS -->
<view class="module-item" @tap="() => handleCheckUpdate(false)">
<view class="module-left">
<view class="module-icon green">
<text class="iconfont icon-shezhi" style="color: #33cc99; font-size: 24px;"></text>
</view>
<view class="module-info">
<text class="module-name">检查更新</text>
<text class="module-desc" v-if="!checkingUpdate && !hasNewVersion">当前版本 {{ currentVersion }}</text>
<text class="module-desc" v-if="checkingUpdate" style="color: #33cc99;">检查中...</text>
<text class="module-desc" v-if="!checkingUpdate && hasNewVersion" style="color: #ff6699;">发现新版本 {{ latestVersion }}</text>
</view>
</view>
</view>
<!-- #endif -->
<view class="module-item" @tap="showSettings" v-if='hide'>
<view class="module-left">
@@ -262,6 +271,7 @@
data() {
return {
hide : false,
showSettingsDropdown: false, // 控制设置下拉菜单显示
functionStatus: {
'autoLike': false,
'momentsSync': false,
@@ -374,6 +384,18 @@
},
closeSideMenu() {
this.$emit('close');
// 关闭设置下拉菜单
this.showSettingsDropdown = false;
},
// 切换设置下拉菜单
toggleSettingsDropdown() {
this.showSettingsDropdown = !this.showSettingsDropdown;
},
// 点击页面其他区域关闭下拉菜单
closeSettingsDropdown() {
this.showSettingsDropdown = false;
},
// 获取功能开关状态
async getFunctionStatus() {
@@ -947,6 +969,7 @@
align-items: center;
padding: 20px 15px;
border-bottom: 1px solid #f5f5f5;
position: relative;
}
.side-menu-title {
@@ -960,6 +983,119 @@
padding: 0 10px;
}
.header-right {
position: relative;
}
.settings-btn {
width: 40px;
height: 40px;
display: flex;
align-items: center;
justify-content: center;
border-radius: 50%;
position: relative;
}
.settings-btn-content {
display: flex;
align-items: center;
justify-content: center;
}
.version-badge {
position: absolute;
top: 0;
right: 0;
font-size: 10px;
color: #fff;
background-color: #ff6699;
border-radius: 8px;
min-width: 16px;
height: 16px;
padding: 0 4px;
font-weight: bold;
display: flex;
align-items: center;
justify-content: center;
transform: translate(50%, -30%);
}
.settings-dropdown {
position: absolute;
top: 100%;
right: 0;
width: 160px;
background-color: #fff;
border-radius: 8px;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
z-index: 100;
margin-top: 5px;
overflow: hidden;
}
.dropdown-item {
display: flex;
align-items: center;
padding: 12px 15px;
transition: background-color 0.2s;
}
.dropdown-item:active {
background-color: #f5f5f5;
}
.combined-item {
display: flex;
align-items: center;
padding: 12px 15px;
}
.icon-container {
display: flex;
align-items: center;
justify-content: center;
margin-right: 12px;
}
.text-container {
flex: 1;
}
.text-top {
display: flex;
align-items: center;
margin-bottom: 4px;
}
.main-text {
font-size: 14px;
color: #333;
font-weight: 500;
}
.version-info {
font-size: 12px;
color: #999;
}
.dropdown-text {
font-size: 14px;
color: #333;
margin-left: 8px;
flex: 1;
}
.update-badge {
font-size: 12px;
color: #fff;
background-color: #ff6699;
border-radius: 10px;
padding: 2px 6px;
font-weight: bold;
}
.function-module {
padding: 15px;
}

View File

@@ -2,7 +2,7 @@
"name" : "AI数智员工",
"appid" : "__UNI__9421F6C",
"description" : "",
"versionName" : "1.1.1",
"versionName" : "1.1.2",
"versionCode" : "100",
"transformPx" : false,
/* 5+App */