微信小程序页面迁移校验之前 P5任务处理之前

This commit is contained in:
Neo
2026-03-09 01:19:21 +08:00
parent 263bf96035
commit 6e20987d2f
1112 changed files with 153824 additions and 219694 deletions

View File

@@ -0,0 +1,31 @@
import { mockUserProfile } from '../../utils/mock-data'
import { getMenuRoute, navigateTo } from '../../utils/router'
// TODO: 联调时替换为真实 API 获取用户信息
Page({
data: {
userInfo: mockUserProfile,
},
onMenuTap(e: WechatMiniprogram.TouchEvent) {
const key = e.currentTarget.dataset.key as string
const route = getMenuRoute(key)
if (route) {
navigateTo(route)
}
},
onLogout() {
wx.showModal({
title: '确认退出',
content: '确认退出当前账号吗?',
confirmColor: '#e34d59',
success(res) {
if (res.confirm) {
wx.clearStorageSync()
wx.reLaunch({ url: '/pages/login/login' })
}
},
})
},
})