committed by
trae-solo-agent
co-authored by
Claude Sonnet 4.6 noreply@anthropic.com
parent
031227710d
commit
d3f399d1ad
+4
-36
@@ -11,11 +11,6 @@ Page({
|
||||
// 身份行副行,loadUserInfo 时由手机号脱敏填入
|
||||
account: '',
|
||||
phone: '',
|
||||
sex: '',
|
||||
birth: '',
|
||||
email: '',
|
||||
idnumber: '',
|
||||
ssn: '',
|
||||
isLoggedIn: false
|
||||
},
|
||||
// 菜单分组:按"用途"而非"是不是陪诊"分,三组才立得住。
|
||||
@@ -34,10 +29,6 @@ Page({
|
||||
name: '就诊人',
|
||||
icon: 'user-checked',
|
||||
bindtap: 'onTapHealth'
|
||||
}, {
|
||||
name: '邮寄地址',
|
||||
icon: 'location',
|
||||
bindtap: 'onTapAddress'
|
||||
}]
|
||||
}, {
|
||||
groupName: '帮助与支持',
|
||||
@@ -68,12 +59,9 @@ Page({
|
||||
}]
|
||||
},
|
||||
|
||||
onLoad() {
|
||||
this.loadUserInfo()
|
||||
},
|
||||
|
||||
onShow() {
|
||||
this.loadUserInfo()
|
||||
const app = getApp()
|
||||
app.waitForAuth().finally(() => this.loadUserInfo())
|
||||
// 同步自定义 tabBar 选中态(我的为第 2 项)
|
||||
if (typeof this.getTabBar === 'function' && this.getTabBar()) {
|
||||
this.getTabBar().setData({
|
||||
@@ -96,12 +84,7 @@ Page({
|
||||
'userInfo.phone': profile.mobile || '',
|
||||
// 身份行副行(微信那行是微信号):本应用没有账号体系,
|
||||
// 等价标识是手机号,脱敏成 138****1234 后再上屏
|
||||
'userInfo.account': this.maskMobile(profile.mobile || ''),
|
||||
'userInfo.sex': profile.sex || '',
|
||||
'userInfo.birth': profile.birth ? this.formatDate(profile.birth) : '',
|
||||
'userInfo.email': profile.email || '',
|
||||
'userInfo.idnumber': profile.idnumber || '',
|
||||
'userInfo.ssn': profile.ssn || ''
|
||||
'userInfo.account': this.maskMobile(profile.mobile || '')
|
||||
})
|
||||
} else {
|
||||
// 未登录(含刚退出登录):身份行收敛回默认态。
|
||||
@@ -124,17 +107,8 @@ Page({
|
||||
return `${digits.slice(0, 3)}****${digits.slice(7)}`
|
||||
},
|
||||
|
||||
formatDate(date) {
|
||||
if (!date) return ''
|
||||
const d = new Date(date)
|
||||
const year = d.getFullYear()
|
||||
const month = String(d.getMonth() + 1).padStart(2, '0')
|
||||
const day = String(d.getDate()).padStart(2, '0')
|
||||
return `${year}-${month}-${day}`
|
||||
},
|
||||
|
||||
// 顶部身份行整行可点,但未登录时不该跳进"填完才被拦"的资料页
|
||||
// (个人信息与邮寄地址改真页面后系统返回键归页面栈管,
|
||||
// (个人信息改真页面后系统返回键归页面栈管,
|
||||
// 不再像原来的浮层那样被系统返回键直接退出小程序)
|
||||
onTapProfile() {
|
||||
if (!this.data.userInfo.isLoggedIn) return
|
||||
@@ -143,12 +117,6 @@ Page({
|
||||
})
|
||||
},
|
||||
|
||||
onTapAddress() {
|
||||
wx.navigateTo({
|
||||
url: '/pages/mine/addressedit'
|
||||
})
|
||||
},
|
||||
|
||||
onTapHealth() {
|
||||
wx.navigateTo({
|
||||
url: '/pages/health/profilelist'
|
||||
|
||||
Reference in New Issue
Block a user