diff --git a/src/app.ts b/src/app.ts index ee0714e..b5e631d 100644 --- a/src/app.ts +++ b/src/app.ts @@ -115,28 +115,40 @@ App({ }) }, checkLoginType(type: 0 | 1 | 2) { - const { loginType, isLogin } = this.globalData.initLoginInfo - if (!isLogin) { - if (type === 0) { - return true - } else { - wx.reLaunch({ - url: '/pages/index/index', - }) - } + const { loginType, isLogin, isReg } = this.globalData.initLoginInfo + + if (type === 0) { + return true + } + + if (isLogin !== 1) { + wx.reLaunch({ + url: '/pages/index/index', + }) return false } - if (loginType === type) { - return true + if (isReg !== 1) { + const typePageUrl = { + 1: '/patient/pages/entryInfo/index', + 2: '/doctor/pages/login/index', + }[loginType as 1 | 2] + wx.reLaunch({ + url: typePageUrl, + }) + return false } - const typePageUrl = { - 1: '/patient/pages/index/index', - 2: '/doctor/pages/index/index', - }[loginType as 1 | 2] - wx.reLaunch({ - url: typePageUrl, - }) - return false + + if (loginType !== type) { + const typePageUrl = { + 1: '/patient/pages/index/index', + 2: '/doctor/pages/index/index', + }[loginType as 1 | 2] + wx.reLaunch({ + url: typePageUrl, + }) + } + + return true }, mpBehavior(data: { PageName: string }) { wx.ajax({ @@ -150,11 +162,11 @@ App({ }) }, - getUserInfo(type: 1 | 2 | 3 = 1) { + getUserInfo(type: 0 | 1 | 2 = 0) { const url = { - 1: '?r=wtx/user/userinfo', - 2: '?r=wtx/account/info', - 3: '?r=wtx/doctor/account/info', + 0: '?r=wtx/user/userinfo', + 1: '?r=wtx/account/info', + 2: '?r=wtx/doctor/account/info', }[type] return wx.ajax({ method: 'GET', diff --git a/src/components/popup/index.scss b/src/components/popup/index.scss index fa8185c..2e322c7 100644 --- a/src/components/popup/index.scss +++ b/src/components/popup/index.scss @@ -898,6 +898,7 @@ color: rgba(161, 164, 172, 1); } .tag { + vertical-align: 2rpx; display: inline-block; font-size: 20rpx; color: rgba(255, 255, 255, 1); diff --git a/src/components/popup/index.wxml b/src/components/popup/index.wxml index 6192668..891cca1 100644 --- a/src/components/popup/index.wxml +++ b/src/components/popup/index.wxml @@ -235,7 +235,7 @@ 取消 - 提交 + 确定 @@ -256,15 +256,12 @@ - + - 王青 + {{params.name}} - 北京积水潭医院龙泽院区 - 三甲 + {{params.hostipal}} + {{params.className}}{{params.levelName}} @@ -296,8 +293,8 @@ - 取消 - 确定 + 取消 + 确定 diff --git a/src/components/popupDoctor/index.scss b/src/components/popupDoctor/index.scss index e77322b..cc1b327 100644 --- a/src/components/popupDoctor/index.scss +++ b/src/components/popupDoctor/index.scss @@ -56,7 +56,7 @@ .col { .content { margin-right: 8rpx; - display: inline-block; + display: inline; font-size: 32rpx; color: rgba(1, 1, 5, 1); max-height: 30vh; diff --git a/src/doctor/pages/changeTel/index.wxml b/src/doctor/pages/changeTel/index.wxml index 7f6067e..4101d77 100644 --- a/src/doctor/pages/changeTel/index.wxml +++ b/src/doctor/pages/changeTel/index.wxml @@ -26,5 +26,5 @@ - + diff --git a/src/doctor/pages/login/index.ts b/src/doctor/pages/login/index.ts index 20c77bc..a4f11a9 100644 --- a/src/doctor/pages/login/index.ts +++ b/src/doctor/pages/login/index.ts @@ -100,7 +100,7 @@ Page({ } }, submitCallback() { - app.getUserInfo(3).then(() => { + app.getUserInfo(2).then(() => { wx.reLaunch({ url: `/doctor/pages/index/index`, }) diff --git a/src/doctor/pages/my/index.ts b/src/doctor/pages/my/index.ts index e7a7747..2c2c281 100644 --- a/src/doctor/pages/my/index.ts +++ b/src/doctor/pages/my/index.ts @@ -11,7 +11,7 @@ Page({ }, onLoad() { app.waitLogin().then(() => { - app.getUserInfo(3).then((userInfo) => { + app.getUserInfo(2).then((userInfo) => { this.setData({ userInfo, // 数字变红 diff --git a/src/images/icon22.png b/src/images/icon22.png index a4ac5fa..80d2f0f 100644 Binary files a/src/images/icon22.png and b/src/images/icon22.png differ diff --git a/src/pages/applyFrom/index.wxml b/src/pages/applyFrom/index.wxml index fa2c45a..bc24d98 100644 --- a/src/pages/applyFrom/index.wxml +++ b/src/pages/applyFrom/index.wxml @@ -24,7 +24,7 @@ class="input" placeholder-class="place-input" type="text" - placeholder="如何称呼您" + placeholder="如何称呼{{Relation == 1 ? '您的' : '患者'}}" /> @@ -34,7 +34,7 @@ - {{BirthMonth}} + {{BirthMonth}} @@ -48,7 +48,7 @@ - {{ProvinceName ? ProvinceName+ '/' : ProvinceName }}{{CityName}} + {{ProvinceName ? ProvinceName+ '/' : ProvinceName }}{{CityName}} diff --git a/src/pages/my/index.ts b/src/pages/my/index.ts index eda2551..79a97df 100644 --- a/src/pages/my/index.ts +++ b/src/pages/my/index.ts @@ -8,7 +8,7 @@ Page({ showPatient: false, }, - onLoad() { + onShow() { app.waitLogin().then(() => { app.mpBehavior({ PageName: 'BTN_MY_NAV' }) app.getUserInfo().then((userInfo) => { diff --git a/src/pages/start/index.ts b/src/pages/start/index.ts index c63c7c7..50cfc26 100644 --- a/src/pages/start/index.ts +++ b/src/pages/start/index.ts @@ -16,8 +16,14 @@ Page({ }) } if (initLoginInfo.loginType === 1) { + if (initLoginInfo.isReg === 1) { + wx.reLaunch({ + url: '/patient/pages/index/index', + }) + return + } wx.reLaunch({ - url: '/patient/pages/index/index', + url: '/patient/pages/entryInfo/login', }) } if (initLoginInfo.loginType === 2) { diff --git a/src/patient/pages/askPatient/index.scss b/src/patient/pages/askPatient/index.scss index 7e6f965..7258338 100644 --- a/src/patient/pages/askPatient/index.scss +++ b/src/patient/pages/askPatient/index.scss @@ -45,14 +45,20 @@ page { } .name { margin: -20rpx auto 0; + padding: 0 0.5em; width: 116rpx; height: 36rpx; line-height: 36rpx; font-size: 24rpx; color: rgba(255, 255, 255, 1); text-align: center; + box-sizing: border-box; background: linear-gradient(356deg, #f23a2f 0%, #fc684f 100%); border-radius: 35rpx 35rpx 35rpx 35rpx; + max-width: 5em; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; } } } diff --git a/src/patient/pages/askPatient/index.ts b/src/patient/pages/askPatient/index.ts index 21be853..86c2ce4 100644 --- a/src/patient/pages/askPatient/index.ts +++ b/src/patient/pages/askPatient/index.ts @@ -56,7 +56,7 @@ Page({ userInfo: {}, }, onLoad() { - app.waitLogin().then(() => { + app.waitLogin({ type: 1 }).then(() => { app.mpBehavior({ PageName: 'PG_FAQ' }) app.getUserInfo().then((userInfo) => { this.setData({ @@ -68,6 +68,11 @@ Page({ this.getMessageList() }) }, + onShow() { + if (app.globalData.loginState) { + this.getBindDoctorList() + } + }, getBindDoctorList() { wx.ajax({ method: 'GET', @@ -266,6 +271,13 @@ Page({ messageList, }) }, + handleSendDate() { + this.setData({ + popupShow: true, + popupType: 'selectDoctor', + popupParams: {}, + }) + }, handleQuestionTab(e) { const { index } = e.currentTarget.dataset this.setData({ @@ -288,6 +300,11 @@ Page({ url: '/patient/pages/doctorList/index', }) }, + handlePopupCancel() { + this.setData({ + popupShow: false, + }) + }, handleBack() { wx.navigateBack() }, diff --git a/src/patient/pages/askPatient/index.wxml b/src/patient/pages/askPatient/index.wxml index bbc6b07..64d0447 100644 --- a/src/patient/pages/askPatient/index.wxml +++ b/src/patient/pages/askPatient/index.wxml @@ -124,7 +124,7 @@ 我要提问 - + 出诊时间 diff --git a/src/patient/pages/bindDoctor/index.ts b/src/patient/pages/bindDoctor/index.ts index 8c72fce..b2d9dea 100644 --- a/src/patient/pages/bindDoctor/index.ts +++ b/src/patient/pages/bindDoctor/index.ts @@ -73,6 +73,10 @@ Page({ }) }, handlePopupOk() { + const { popupType } = this.data + if (popupType === 'bindDoctor') { + wx.navigateBack() + } this.handlePopupCancel() }, handlePopupCancel() { diff --git a/src/patient/pages/changeTel/index.wxml b/src/patient/pages/changeTel/index.wxml index 7f6067e..4101d77 100644 --- a/src/patient/pages/changeTel/index.wxml +++ b/src/patient/pages/changeTel/index.wxml @@ -26,5 +26,5 @@ - + diff --git a/src/patient/pages/doctorList/index.ts b/src/patient/pages/doctorList/index.ts index ed75b9b..1f27ce8 100644 --- a/src/patient/pages/doctorList/index.ts +++ b/src/patient/pages/doctorList/index.ts @@ -3,6 +3,12 @@ const app = getApp() Page({ data: { doctorList: [], + + pagination: { + page: 1, + pages: 1, + count: 1, + }, }, onShow() { app.waitLogin({ type: 1 }).then(() => { @@ -17,6 +23,7 @@ Page({ }).then((res) => { this.setData({ doctorList: res, + ['pagination.count']: res.length, }) }) }, diff --git a/src/patient/pages/doctorList/index.wxml b/src/patient/pages/doctorList/index.wxml index 4f507a2..60a1360 100644 --- a/src/patient/pages/doctorList/index.wxml +++ b/src/patient/pages/doctorList/index.wxml @@ -20,5 +20,7 @@ {{item.introduce}} + + diff --git a/src/patient/pages/entryInfo/index.json b/src/patient/pages/entryInfo/index.json index 5d0894b..35e99ca 100644 --- a/src/patient/pages/entryInfo/index.json +++ b/src/patient/pages/entryInfo/index.json @@ -1,6 +1,7 @@ { "navigationStyle": "custom", "usingComponents": { - "pickerArea": "/components/pickerArea/index" + "pickerArea": "/components/pickerArea/index", + "navbar": "/components/navbar/index" } } diff --git a/src/patient/pages/entryInfo/index.ts b/src/patient/pages/entryInfo/index.ts index 6ef8102..b6f9a11 100644 --- a/src/patient/pages/entryInfo/index.ts +++ b/src/patient/pages/entryInfo/index.ts @@ -95,6 +95,9 @@ Page({ }) }) }, + handleBack() { + wx.navigateBack() + }, }) export {} diff --git a/src/patient/pages/entryInfo/index.wxml b/src/patient/pages/entryInfo/index.wxml index d8405c8..79a2163 100644 --- a/src/patient/pages/entryInfo/index.wxml +++ b/src/patient/pages/entryInfo/index.wxml @@ -1,3 +1,6 @@ + + + - {{birthMonth}} + {{birthMonth}} @@ -41,12 +44,12 @@ - {{provinceName ? provinceName+ '/' : provinceName }}{{cityName}} + {{provinceName ? provinceName+ '/' : provinceName }}{{cityName}} 立即加入 - 取消 + 取消 diff --git a/src/patient/pages/family/index.scss b/src/patient/pages/family/index.scss index 747b374..04f504c 100644 --- a/src/patient/pages/family/index.scss +++ b/src/patient/pages/family/index.scss @@ -7,7 +7,7 @@ page { .container { margin-top: 184rpx; position: relative; - background: linear-gradient(292deg, #ffffff 0%, #fff3f2 100%); + background: linear-gradient( 291deg, #FFFFFF 0%, #FFFCFC 55%, #FFF7F7 100%); border-radius: 24rpx 24rpx 24rpx 24rpx; border: 2rpx solid #ffffff; padding: 136rpx 40rpx 48rpx; @@ -43,6 +43,7 @@ page { display: block; width: 296rpx; height: 296rpx; + border-radius: 50%; } .tip { margin-top: 22rpx; diff --git a/src/patient/pages/familyList/index.scss b/src/patient/pages/familyList/index.scss index b13b220..d18c9d6 100644 --- a/src/patient/pages/familyList/index.scss +++ b/src/patient/pages/familyList/index.scss @@ -13,6 +13,8 @@ page { justify-content: space-between; .wrap { .w-header { + display: flex; + align-items: center; .name { display: inline; font-size: 32rpx; @@ -30,13 +32,13 @@ page { border-radius: 4rpx; } } - .date{ + .date { margin-top: 20rpx; font-size: 28rpx; color: rgba(161, 164, 172, 1); } } - .unbind{ + .unbind { flex-shrink: 0; padding: 32rpx 0 32rpx 32rpx; font-size: 28rpx; diff --git a/src/patient/pages/familyList/index.ts b/src/patient/pages/familyList/index.ts index 09bd388..e525c65 100644 --- a/src/patient/pages/familyList/index.ts +++ b/src/patient/pages/familyList/index.ts @@ -8,7 +8,7 @@ Page({ onLoad() { app.waitLogin().then(() => { this.getList() - app.getUserInfo(2).then((res) => { + app.getUserInfo(1).then((res) => { this.setData({ userInfo: res, }) diff --git a/src/patient/pages/familyList/index.wxml b/src/patient/pages/familyList/index.wxml index 3ac24a3..4548ea6 100644 --- a/src/patient/pages/familyList/index.wxml +++ b/src/patient/pages/familyList/index.wxml @@ -2,9 +2,9 @@ - ID:{{userInfo.PatientId}} - ID:{{userInfo.PatientId}}亲友 - {{item.RelationType === '1' ? '本人': '亲友'}} + {{userInfo.PatientName}} + {{userInfo.PatientName}}亲友 + 本人 绑定时间:{{item.BindPatientTime}} diff --git a/src/patient/pages/familyScan/index.ts b/src/patient/pages/familyScan/index.ts index b123e8c..ae56c92 100644 --- a/src/patient/pages/familyScan/index.ts +++ b/src/patient/pages/familyScan/index.ts @@ -20,6 +20,12 @@ Page({ }, onShow() { app.waitLogin().then(() => { + if (app.globalData.initLoginInfo.loginType === 2) { + wx.reLaunch({ + url: '/doctor/pages/index/index', + }) + return + } app.getUserInfo().then(() => { this.getMpPatientInfo() }) @@ -35,12 +41,10 @@ Page({ loading: true, }).then((res) => { let RelationType = res.HasSelf == 1 ? '2' : '' - if (!res.PatientId) { - if (!this.data.ignoreAgreement) { - wx.navigateTo({ - url: `/patient/pages/login/index?page=/patient/pages/familyScan/index`, - }) - } + if (!res.isLogin) { + wx.navigateTo({ + url: `/patient/pages/login/index?back=1`, + }) } this.setData({ mpPatientInfo: res, @@ -59,7 +63,7 @@ Page({ resetBind: true, }) }, - handleSwitchRType(e) { + handleSwitchType(e) { const { type } = e.currentTarget.dataset this.setData({ RelationType: type, diff --git a/src/patient/pages/familyScan/index.wxml b/src/patient/pages/familyScan/index.wxml index 4cc26f7..98f8bbd 100644 --- a/src/patient/pages/familyScan/index.wxml +++ b/src/patient/pages/familyScan/index.wxml @@ -55,7 +55,7 @@ 请选择您的身份? 本人 - + 亲友 diff --git a/src/patient/pages/index/index.scss b/src/patient/pages/index/index.scss index 05ae735..b228022 100644 --- a/src/patient/pages/index/index.scss +++ b/src/patient/pages/index/index.scss @@ -105,13 +105,14 @@ page { } .name { margin: -20rpx auto 0; - padding: 4rpx 20rpx; + padding: 4rpx 0.5em; font-size: 20rpx; color: #fff; line-height: 24rpx; background: linear-gradient(356deg, #f23a2f 0%, #fc684f 100%); border-radius: 28rpx 28rpx 28rpx 28rpx; - max-width: 4em; + max-width: 5em; + box-sizing: border-box; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; @@ -127,8 +128,10 @@ page { } .name { margin: -20rpx auto 0; - padding: 4rpx 20rpx; + padding: 4rpx 0.5em; + width: 5em; font-size: 20rpx; + box-sizing: border-box; color: rgba(161, 164, 172, 1); line-height: 24rpx; } diff --git a/src/patient/pages/index/index.ts b/src/patient/pages/index/index.ts index ab510c6..f800e57 100644 --- a/src/patient/pages/index/index.ts +++ b/src/patient/pages/index/index.ts @@ -20,7 +20,7 @@ Page({ }, onLoad() { app.waitLogin().then(() => { - app.getUserInfo(2).then((userInfo) => { + app.getUserInfo(1).then((userInfo) => { this.setData({ userInfo, Days: userInfo.Days.replace( @@ -38,6 +38,11 @@ Page({ }) }) }, + onShow() { + if (app.globalData.loginState) { + this.getBindDoctorList() + } + }, getBindDoctorList() { wx.ajax({ method: 'GET', @@ -152,6 +157,9 @@ Page({ }, handlePopupCancel() { const { popupType } = this.data + if (popupType === 'bindDoctor') { + this.getBindDoctorList() + } if (popupType === 'conformBindDoctorQuestion') { wx.ajax({ method: 'POST', diff --git a/src/patient/pages/index/index.wxml b/src/patient/pages/index/index.wxml index 9ab00a0..2547669 100644 --- a/src/patient/pages/index/index.wxml +++ b/src/patient/pages/index/index.wxml @@ -7,10 +7,7 @@ > - + Hi!{{userInfo.PatientName}} @@ -24,7 +21,13 @@ - + {{item.doctorName}} diff --git a/src/patient/pages/login/index.json b/src/patient/pages/login/index.json index 17c750f..613b839 100644 --- a/src/patient/pages/login/index.json +++ b/src/patient/pages/login/index.json @@ -1,6 +1,8 @@ { "navigationStyle": "custom", "usingComponents": { - "van-divider": "@vant/weapp/divider/index" + "van-divider": "@vant/weapp/divider/index", + "navbar": "/components/navbar/index", + "van-checkbox": "@vant/weapp/checkbox/index" } } diff --git a/src/patient/pages/login/index.scss b/src/patient/pages/login/index.scss index dd5b225..bdb046f 100644 --- a/src/patient/pages/login/index.scss +++ b/src/patient/pages/login/index.scss @@ -106,12 +106,17 @@ margin-top: -8rpx; transform: scale(0.8); } + .wx-checkbox-input.wx-checkbox-input-checked { + background: rgba(246, 74, 58, 1); + border-color: rgba(246, 74, 58, 1); + color: #ffffff; + } } .link { color: rgba(246, 74, 58, 1); } } - .family-tip{ + .family-tip { margin-top: 58rpx; font-size: 28rpx; color: rgba(246, 74, 58, 1); diff --git a/src/patient/pages/login/index.ts b/src/patient/pages/login/index.ts index 75df527..c10239b 100644 --- a/src/patient/pages/login/index.ts +++ b/src/patient/pages/login/index.ts @@ -12,8 +12,14 @@ Page({ check1: false, check2: false, check3: false, + + backPage: false, + }, + onLoad(options) { + this.setData({ + backPage: options.back === '1', + }) }, - onLoad() {}, getCode() { if (timer) return const mobile = this.data.mobile @@ -101,8 +107,10 @@ Page({ } }, submitCallback() { - app.getUserInfo(2).then((res) => { - if (res.PatientId) { + app.getUserInfo(1).then((res) => { + if (this.data.backPage) { + wx.navigateBack() + } else if (res.PatientId) { wx.reLaunch({ url: `/patient/pages/index/index`, }) @@ -118,6 +126,9 @@ Page({ showTel: !this.data.showTel, }) }, + handleBack() { + wx.navigateBack() + }, }) export {} diff --git a/src/patient/pages/login/index.wxml b/src/patient/pages/login/index.wxml index 26aa6c3..f657b7b 100644 --- a/src/patient/pages/login/index.wxml +++ b/src/patient/pages/login/index.wxml @@ -1,10 +1,20 @@ + + + 欢迎加入愈见守护 - + 或者 @@ -39,7 +49,7 @@ - + 我特此同意 《个人信息及隐私协议政策》 @@ -47,7 +57,7 @@ - + 我特此同意 《用户协议》 @@ -55,7 +65,7 @@ - + 我特此同意 《个人信息共享知情同意书》 diff --git a/src/patient/pages/my/index.ts b/src/patient/pages/my/index.ts index 6635fd9..04bd0a6 100644 --- a/src/patient/pages/my/index.ts +++ b/src/patient/pages/my/index.ts @@ -11,7 +11,7 @@ Page({ }, onLoad() { app.waitLogin().then(() => { - app.getUserInfo().then((userInfo) => { + app.getUserInfo(1).then((userInfo) => { this.setData({ userInfo, // 数字变红 diff --git a/src/patient/pages/my/index.wxml b/src/patient/pages/my/index.wxml index 30bc15b..4e98397 100644 --- a/src/patient/pages/my/index.wxml +++ b/src/patient/pages/my/index.wxml @@ -8,7 +8,7 @@ - 你好 + {{userInfo.PatientName}} 今天是陪伴您的第 @@ -27,6 +27,11 @@ 个人信息 + + + 我的亲友 + + @@ -35,11 +40,6 @@ - - - 我的亲友 - - diff --git a/src/patient/pages/userInfo/index.ts b/src/patient/pages/userInfo/index.ts index 50ba5cd..0f35aad 100644 --- a/src/patient/pages/userInfo/index.ts +++ b/src/patient/pages/userInfo/index.ts @@ -16,7 +16,7 @@ Page({ }, onLoad() { app.waitLogin().then(() => { - app.getUserInfo(2).then((userInfo) => { + app.getUserInfo(1).then((userInfo) => { this.setData({ name: userInfo.PatientName, birthMonth: userInfo.PatientBirth, @@ -51,8 +51,11 @@ Page({ provinceId, cityId, }, - }).then((res) => { - console.log('res: ', res) + }).then(() => { + wx.showToast({ + icon: 'none', + title: '保存成功', + }) }) }, handleTel() { diff --git a/typings/index.d.ts b/typings/index.d.ts index da41466..624cda7 100644 --- a/typings/index.d.ts +++ b/typings/index.d.ts @@ -44,7 +44,7 @@ interface IAppOption { [propName: string]: any } - getUserInfo: (type?: 1 | 2 | 3) => Promise + getUserInfo: (type?: 0 | 1 | 2) => Promise startLogin: (callback?: () => void) => void waitLogin: (params?: { type?: 0 | 1 | 2 | 'any' }) => Promise checkLoginType: (type: 0 | 1 | 2) => boolean