7 changed files with 73 additions and 40 deletions
|
Before Width: | Height: | Size: 682 KiB After Width: | Height: | Size: 696 KiB |
@ -1,47 +1,54 @@ |
|||||||
const app = getApp<IAppOption>(); |
const app = getApp<IAppOption>() |
||||||
|
|
||||||
Page({ |
Page({ |
||||||
data: {}, |
data: {}, |
||||||
onLoad() { |
onLoad() { |
||||||
app.waitLogin().then(() => { |
app.waitLogin().then(() => { |
||||||
const { isLogin, isNewReg, loginType } = app.globalData; |
const { isLogin, isNewReg, loginType, scene } = app.globalData |
||||||
if (isLogin === 0) { |
if (isLogin === 0) { |
||||||
|
// 未登录用户,扫医生邀请码,重定向到患者登录页
|
||||||
|
if (scene?.doctorId) { |
||||||
|
wx.reLaunch({ |
||||||
|
url: '/patient/pages/login/index', |
||||||
|
}) |
||||||
|
return |
||||||
|
} |
||||||
wx.reLaunch({ |
wx.reLaunch({ |
||||||
url: '/patient/pages/index/index', |
url: '/patient/pages/index/index', |
||||||
}); |
}) |
||||||
return; |
return |
||||||
} |
} |
||||||
if (loginType === 0) { |
if (loginType === 0) { |
||||||
wx.reLaunch({ |
wx.reLaunch({ |
||||||
url: '/patient/pages/index/index', |
url: '/patient/pages/index/index', |
||||||
}); |
}) |
||||||
return; |
return |
||||||
} |
} |
||||||
if (loginType === 1) { |
if (loginType === 1) { |
||||||
if (isNewReg === 1) { |
if (isNewReg === 1) { |
||||||
wx.reLaunch({ |
wx.reLaunch({ |
||||||
url: '/patient/pages/index/index', |
url: '/patient/pages/index/index', |
||||||
}); |
}) |
||||||
return; |
return |
||||||
} |
} |
||||||
wx.reLaunch({ |
wx.reLaunch({ |
||||||
url: '/patient/pages/enterInfo/index', |
url: '/patient/pages/enterInfo/index', |
||||||
}); |
}) |
||||||
return; |
return |
||||||
} |
} |
||||||
if (loginType === 2) { |
if (loginType === 2) { |
||||||
if (isNewReg === 1) { |
if (isNewReg === 1) { |
||||||
wx.reLaunch({ |
wx.reLaunch({ |
||||||
url: '/pages/home/index', |
url: '/pages/home/index', |
||||||
}); |
}) |
||||||
return; |
return |
||||||
} |
} |
||||||
wx.reLaunch({ |
wx.reLaunch({ |
||||||
url: '/pages/login/index', |
url: '/pages/login/index', |
||||||
}); |
}) |
||||||
} |
} |
||||||
}); |
}) |
||||||
}, |
}, |
||||||
}); |
}) |
||||||
|
|
||||||
export {}; |
export {} |
||||||
|
|||||||
Loading…
Reference in new issue