小程序浮层动作项按钮化并统一按钮样式
自动发布开发环境 Nacos 配置 / publish (push) Successful in 27s

This commit is contained in:
2026-11-07 00:38:22 +08:00
parent a5f050286b
commit 1482bda1fa
31 changed files with 322 additions and 78 deletions
+7 -5
View File
@@ -5,6 +5,7 @@ const { buildProfileCard } = require('../../utils/profile-card')
const profileCache = require('../../utils/profile-cache')
const authApi = require('../../api/auth')
const { showErrorToast } = require('../../utils/toast')
const { showActionModal } = require('../../utils/action-modal')
function resolveRoleText(type) {
const role = Number(type)
@@ -118,13 +119,14 @@ Page({
},
async logout() {
const confirmed = await new Promise(resolve => wx.showModal({
const result = await showActionModal(this, {
title: '退出登录',
content: '退出后将关闭自动登录,并清除本机提醒设置。',
success: result => resolve(result.confirm),
fail: () => resolve(false)
}))
if (!confirmed) return
cancelText: '取消',
confirmText: '确定',
confirmType: 'danger'
})
if (!result.confirm) return
try { await authApi.logout() } catch (error) {}
getApp().logoutDevice()
wx.reLaunch({ url: '/pages/login/index' })
+4 -1
View File
@@ -1,3 +1,6 @@
{
"navigationBarTitleText": "我的"
"navigationBarTitleText": "我的",
"usingComponents": {
"action-modal": "/components/action-modal/index"
}
}
+1
View File
@@ -60,4 +60,5 @@
</view>
<button class="profile-logout" bindtap="logout">退出登录</button>
<action-modal id="actionModal" />
</view>