|
|
|
@ -170,7 +170,7 @@ App<IAppOption>({
@@ -170,7 +170,7 @@ App<IAppOption>({
|
|
|
|
|
checkLoginType(type, backPath = '') { |
|
|
|
|
const { loginType, isLogin, isNewReg } = this.globalData |
|
|
|
|
if (backPath) { |
|
|
|
|
app.globalData.backPath = backPath |
|
|
|
|
this.globalData.backPath = backPath |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (type === 'any') { |
|
|
|
@ -235,6 +235,16 @@ App<IAppOption>({
@@ -235,6 +235,16 @@ App<IAppOption>({
|
|
|
|
|
}, |
|
|
|
|
mpBehavior(data: { PageName: string }) { |
|
|
|
|
console.log(data) |
|
|
|
|
let url = '?r=zd/mp-behavior/add' |
|
|
|
|
wx.ajax({ |
|
|
|
|
method: 'POST', |
|
|
|
|
url, |
|
|
|
|
data, |
|
|
|
|
loading: false, |
|
|
|
|
showMsg: false, |
|
|
|
|
}).then((res) => { |
|
|
|
|
console.log('res: ', res) |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
oldMpBehavior(data) { |
|
|
|
|
wx.ajax({ |
|
|
|
@ -428,67 +438,25 @@ App<IAppOption>({
@@ -428,67 +438,25 @@ App<IAppOption>({
|
|
|
|
|
return true |
|
|
|
|
}, |
|
|
|
|
zdPermissionVerification(grade = 1, registChannel = 0, backPage = null, regBusinessId = '') { |
|
|
|
|
// 1-空白用户,2-注册用户,3-疾病患者,4-用药患者
|
|
|
|
|
const { PatientId, AuditStatus, isFollow, UserType } = this.globalData.zdUserInfo |
|
|
|
|
const { isLogin, isNewReg } = this.globalData |
|
|
|
|
const that = this |
|
|
|
|
this.globalData.registChannel = registChannel |
|
|
|
|
this.globalData.regBusinessId = regBusinessId |
|
|
|
|
let isReject = false |
|
|
|
|
return new Promise((resolve, reject) => { |
|
|
|
|
if (grade == 2 && Number(UserType) < 2) { |
|
|
|
|
wx.reLaunch({ |
|
|
|
|
url: '/patient/pages/login/index', |
|
|
|
|
}) |
|
|
|
|
isReject = true |
|
|
|
|
} |
|
|
|
|
if (grade == 3 && Number(UserType) < 3) { |
|
|
|
|
if (UserType == 1) { |
|
|
|
|
if (grade > 1) { |
|
|
|
|
if (!isLogin) { |
|
|
|
|
wx.reLaunch({ |
|
|
|
|
url: '/patient/pages/login/index', |
|
|
|
|
}) |
|
|
|
|
isReject = true |
|
|
|
|
} |
|
|
|
|
if (UserType == 2) { |
|
|
|
|
let urlKey = '' |
|
|
|
|
if (!PatientId) { |
|
|
|
|
urlKey = 'enterInfo' |
|
|
|
|
} else if (AuditStatus == 0) { |
|
|
|
|
urlKey = 'noCert' |
|
|
|
|
} else if (AuditStatus == 1) { |
|
|
|
|
if (backPage && (backPage as string).includes('liveResult')) { |
|
|
|
|
urlKey = 'liveResult' |
|
|
|
|
} else { |
|
|
|
|
urlKey = isFollow ? 'nopending' : 'pending' |
|
|
|
|
} |
|
|
|
|
} else if (AuditStatus == 2) { |
|
|
|
|
urlKey = 'reject' |
|
|
|
|
} |
|
|
|
|
let navUrl = { |
|
|
|
|
enterInfo: '/patient/pages/enterInfo/index', |
|
|
|
|
noCert: '/patient/pages/enterInfo/index', |
|
|
|
|
reject: '/patient/pages/enterInfo/index', |
|
|
|
|
pending: '/patient/pages/enterInfo/index', |
|
|
|
|
nopending: '/patient/pages/enterInfo/index', |
|
|
|
|
liveResult: backPage, |
|
|
|
|
}[urlKey] |
|
|
|
|
if (urlKey == 'liveResult') { |
|
|
|
|
wx.navigateTo({ |
|
|
|
|
url: navUrl as string, |
|
|
|
|
}) |
|
|
|
|
} else { |
|
|
|
|
} else if (!isNewReg) { |
|
|
|
|
wx.reLaunch({ |
|
|
|
|
url: navUrl as string, |
|
|
|
|
url: '/patient/pages/enterInfo/index', |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
isReject = true |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (grade == 4 && Number(UserType) < 4) { |
|
|
|
|
wx.reLaunch({ |
|
|
|
|
url: '/patient/pages/vipLogin/index', |
|
|
|
|
}) |
|
|
|
|
isReject = true |
|
|
|
|
} |
|
|
|
|
if (isReject) { |
|
|
|
|
that.globalData.backPage = backPage |
|
|
|
|
reject(null) |
|
|
|
|