diff --git a/.vscode/css-data.json b/.vscode/css-data.json new file mode 100644 index 0000000..8698fa0 --- /dev/null +++ b/.vscode/css-data.json @@ -0,0 +1,7 @@ +{ + "version": 1.1, + "properties": [{ "name": "foo", "description": "Foo property" }], + "atDirectives": [{ "name": "@foo", "description": "Foo at directive" }], + "pseudoClasses": [{ "name": ":foo", "description": "Foo pseudo class" }], + "pseudoElements": [{ "name": "::foo", "description": "Foo pseudo elements" }] +} diff --git a/.vscode/settings.json b/.vscode/settings.json index 7095e9f..83a744d 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -7,4 +7,7 @@ "css.intUnit": "rpx", "css.floatUnit": "rpx" }, + "css.customData": [ + ".vscode/css-data.json" + ], } diff --git a/project.private.config.json b/project.private.config.json index 2357198..ba50025 100644 --- a/project.private.config.json +++ b/project.private.config.json @@ -23,11 +23,46 @@ "miniprogram": { "list": [ { + "name": "start", + "pathName": "pages/start/index", + "query": "", + "scene": null, + "launchMode": "default" + }, + { + "name": "医生-患者列表", + "pathName": "pages/d_patient/index", + "query": "", + "launchMode": "default", + "scene": null + }, + { + "name": "医生-个人信息", + "pathName": "pages/d_userInfo/index", + "query": "", + "launchMode": "default", + "scene": null + }, + { + "name": "患者-直播详情页", + "pathName": "patient/pages/liveDetail/index", + "query": "id=5", + "launchMode": "default", + "scene": null + }, + { + "name": "医生-患者详情", + "pathName": "pages/d_patientDetail/index", + "query": "id=10", + "launchMode": "default", + "scene": null + }, + { "name": "患者-直播结果页", "pathName": "patient/pages/liveResult/index", "query": "id=5", - "scene": null, - "launchMode": "default" + "launchMode": "default", + "scene": null }, { "name": "患者-医生详情", diff --git a/src/app.json b/src/app.json index de8e074..b10c04e 100644 --- a/src/app.json +++ b/src/app.json @@ -12,7 +12,9 @@ "pages/d_interactive/index", "pages/d_interactiveDoctor/index", "pages/d_patientDetail/index", - "pages/d_userInfo/index" + "pages/d_userInfo/index", + "pages/d_invite/index", + "pages/d_patient/index" ], "subPackages": [ { diff --git a/src/app.ts b/src/app.ts index 5f14f66..0ca31f0 100644 --- a/src/app.ts +++ b/src/app.ts @@ -1,15 +1,15 @@ -import component from '@/utils/component'; -import relativeTime from '@/utils/dayjs/relativeTime.js'; -import page from '@/utils/page'; -import { request } from '@/utils/request'; -import { parseScene } from './utils/util'; -const dayjs = require('dayjs'); -const licia = require('miniprogram-licia'); +import component from '@/utils/component' +import relativeTime from '@/utils/dayjs/relativeTime.js' +import page from '@/utils/page' +import { request } from '@/utils/request' +import { parseScene } from './utils/util' +const dayjs = require('dayjs') +const licia = require('miniprogram-licia') -require('/utils/dayjs/day-zh-cn.js'); +require('/utils/dayjs/day-zh-cn.js') -dayjs.locale('zh-cn'); // 全局使用 -dayjs.extend(relativeTime); +dayjs.locale('zh-cn') // 全局使用 +dayjs.extend(relativeTime) App({ globalData: { @@ -30,6 +30,7 @@ App({ isLogin: 0, isNewReg: 0, loginType: 0, + anyWhere: false, scene: {}, @@ -98,21 +99,21 @@ App({ }, }, onLaunch() { - Page = page as WechatMiniprogram.Page.Constructor; - Component = component as WechatMiniprogram.Component.Constructor; + Page = page as WechatMiniprogram.Page.Constructor + Component = component as WechatMiniprogram.Component.Constructor - wx.ajax = licia.curry(request)({ gUrl: this.globalData.url }); + wx.ajax = licia.curry(request)({ gUrl: this.globalData.url }) - this.startLogin(); + this.startLogin() wx.setInnerAudioOption({ obeyMuteSwitch: false, mixWithOther: false, - }); + }) }, onShow(options) { if (options.query.scene) { - this.globalData.scene = parseScene(options.query.scene); + this.globalData.scene = parseScene(options.query.scene) } }, startLogin(callback) { @@ -125,16 +126,16 @@ App({ code: res.code, }, }).then((res: any) => { - this.globalData.loginState = res.loginState; - this.globalData.isLogin = res.isLogin; - this.globalData.isNewReg = res.isNewReg; - this.globalData.loginType = res.loginType; + this.globalData.loginState = res.loginState + this.globalData.isLogin = res.isLogin + this.globalData.isNewReg = res.isNewReg + this.globalData.loginType = res.loginType if (callback) { - callback(); + callback() } - }); + }) }, - }); + }) }, updateLoginInfo(callback?: (any) => void) { wx.ajax({ @@ -142,87 +143,95 @@ App({ url: '?r=xd/user/get-account-info', data: {}, }).then((res) => { - this.globalData.isLogin = res.isLogin; - this.globalData.loginType = res.loginType; - this.globalData.isNewReg = res.isNewReg; + this.globalData.isLogin = res.isLogin + this.globalData.loginType = res.loginType + this.globalData.isNewReg = res.isNewReg if (callback) { - callback(res); + callback(res) } - }); + }) }, waitLogin({ type = [0] } = { type: 'any' }) { return new Promise((resolve) => { const checkLogin = () => { if (this.globalData.loginState) { if (this.checkLoginType(type as pageType[] | 'any')) { - resolve(); + resolve() } - return; + return } setTimeout(() => { - checkLogin(); - }, 500); - }; - checkLogin(); - }); + checkLogin() + }, 500) + } + checkLogin() + }) }, - checkLoginType(type) { - const { loginType, isLogin, isNewReg } = this.globalData; + checkLoginType(type, backPath = '') { + const { loginType, isLogin, isNewReg } = this.globalData + if(backPath){ + app.globalData.backPath = backPath + } if (type === 'any') { - return true; + return true } if (isLogin !== 1) { if (type.includes(0) && [0, 1].includes(loginType)) { - return true; + return true } - if (loginType === 1) { + if ([0, 1].includes(loginType)) { wx.reLaunch({ url: '/patient/pages/login/index', - }); + }) + return false } if (loginType === 2) { wx.reLaunch({ url: '/pages/login/index', - }); + }) + return false } - return false; + return false } if (isNewReg !== 1) { const typePageUrl = { - 1: '/patient/pages/entryInfo/index', + 1: '/patient/pages/enterInfo/index', 2: '/pages/login/index', - }[loginType as 1 | 2]; + }[loginType as 1 | 2] wx.reLaunch({ url: typePageUrl, - }); - return false; + fail(err) { + console.log(err) + }, + }) + return false } if (!type.includes(loginType)) { const typePageUrl = { 1: '/patient/pages/index/index', 2: '/pages/home/index', - }[loginType as 1 | 2]; + }[loginType as 1 | 2] wx.reLaunch({ url: typePageUrl, - }); - return false; + }) + return false } - return true; + return true }, getUserInfo(type: 0 | 1 | 2): Promise { const url = { 2: '?r=xd/doctor/index/get-doctor', - }[type]; + }[type] return wx.ajax({ method: 'GET', url, data: {}, - }) as Promise; + }) as Promise }, mpBehavior(data) { wx.ajax({ @@ -231,23 +240,23 @@ App({ data, loading: false, showMsg: false, - }); + }) }, getMenuInfo(self) { - const menuButtonInfo = wx.getMenuButtonBoundingClientRect(); + const menuButtonInfo = wx.getMenuButtonBoundingClientRect() self.setData({ menuButtonInfo, - }); + }) }, // zd相关函数 zdMpBehavior(data: { PageName: string; doctor?: boolean }) { - const { loginType } = this.globalData; - if (loginType === 0) return; - let url = '?r=zd/mp-behavior/add'; + const { loginType } = this.globalData + if (loginType === 0) return + let url = '?r=zd/mp-behavior/add' if (data.doctor) { - url = '?r=zd/doctor/mp-behavior/add'; + url = '?r=zd/doctor/mp-behavior/add' } - delete data.doctor; + delete data.doctor wx.ajax({ method: 'POST', url, @@ -255,90 +264,90 @@ App({ loading: false, showMsg: false, }).then((res) => { - console.log('res: ', res); - }); + console.log('res: ', res) + }) }, zdGetTheme() { return new Promise((resolve) => { - resolve('PATIENT'); - }); + resolve('PATIENT') + }) }, zdWaitLogin({ isReg = true, loginPage = false, pub = false } = { isReg: true, loginPage: false, pub: false }) { - let time: number; + let time: number const regFun = (resolve) => { if (this.zdVerifySys(pub)) { if (this.globalData.loginType === 1) { - this.zdRegistrationVerification(() => resolve(), loginPage); + this.zdRegistrationVerification(() => resolve(), loginPage) } else { - resolve(); + resolve() } } - }; + } const unRegFun = (resolve) => { - if (!this.zdVerifySys(pub)) return; - resolve(); - }; + if (!this.zdVerifySys(pub)) return + resolve() + } return new Promise((resolve: (value?) => void) => { if (isReg) { if (Object.keys(this.globalData.zdUserInfo).length) { - regFun(resolve); - return; + regFun(resolve) + return } time = setInterval(() => { if (Object.keys(this.globalData.zdUserInfo).length) { - clearInterval(time); - regFun(resolve); + clearInterval(time) + regFun(resolve) } - }, 500); - return; + }, 500) + return } - this.globalData.anyWhere = true; + this.globalData.anyWhere = true if (this.globalData.loginState) { - unRegFun(resolve); - return; + unRegFun(resolve) + return } time = setInterval(() => { if (this.globalData.loginState) { - clearInterval(time); - unRegFun(resolve); + clearInterval(time) + unRegFun(resolve) } - }, 500); - }); + }, 500) + }) }, zdRegistrationVerification(callback: () => void, loginPage = false) { // 1-空白用户,2-注册用户,3-疾病患者,4-用药患者 - const { PatientId, AuditStatus, isFollow, UserType } = this.globalData.zdUserInfo; - const { anyWhere, first } = this.globalData; + const { PatientId, AuditStatus, isFollow, UserType } = this.globalData.zdUserInfo + const { anyWhere, first } = this.globalData if (loginPage || (anyWhere && first)) { - callback(); - return; + callback() + return } if (UserType == 4) { - this.globalData.first = false; - callback(); - return; + this.globalData.first = false + callback() + return } if (UserType == 1) { - this.globalData.registChannel = 0; - this.globalData.first = false; + this.globalData.registChannel = 0 + this.globalData.first = false wx.reLaunch({ url: '/patient/pages/login/index', - }); - return; + }) + return } - let urlKey = ''; + let urlKey = '' if (!PatientId) { - urlKey = 'enterInfo'; + urlKey = 'enterInfo' } else if (AuditStatus == 0) { - urlKey = 'noCert'; + urlKey = 'noCert' } else if (AuditStatus == 1) { - urlKey = isFollow ? 'nopending' : 'pending'; + urlKey = isFollow ? 'nopending' : 'pending' } else if (AuditStatus == 2) { - urlKey = 'reject'; + urlKey = 'reject' } let navUrl = { enterInfo: '/patient/pages/enterInfo/index', @@ -346,29 +355,29 @@ App({ reject: '/patient/pages/enterInfo/index', pending: '/patient/pages/enterInfo/index', nopending: '/patient/pages/enterInfo/index', - }[urlKey]; + }[urlKey] if (navUrl && first) { - this.globalData.registChannel = 0; - this.globalData.first = false; + this.globalData.registChannel = 0 + this.globalData.first = false wx.reLaunch({ url: navUrl, - }); - this.globalData.first = false; - return; + }) + this.globalData.first = false + return } - this.globalData.first = false; - callback(); + this.globalData.first = false + callback() }, zdVerifySys(pub = false) { // 1:患者 2:医生 - const { loginType, isLogin, anyWhere } = this.globalData; - const pages = getCurrentPages(); - const currentPage = pages[pages.length - 1]; - const url = currentPage.route; - const options = currentPage.options; - const ignorePath = ['pages/start/index']; + const { loginType, isLogin, anyWhere } = this.globalData + const pages = getCurrentPages() + const currentPage = pages[pages.length - 1] + const url = currentPage.route + const options = currentPage.options + const ignorePath = ['pages/start/index'] // 未登录用户 if (!isLogin) { @@ -376,80 +385,80 @@ App({ if (url.includes('doctor/pages')) { wx.reLaunch({ url: '/doctor/pages/d_login/index', - }); - return false; + }) + return false } // 患者端随便看看 if (anyWhere) { - return true; + return true } wx.reLaunch({ url: '/patient/pages/login/index', - }); - return false; + }) + return false } - if (ignorePath.includes(url)) return true; + if (ignorePath.includes(url)) return true if (loginType === 1) { if (url.includes('doctor/pages')) { wx.reLaunch({ url: '/pages/index/index', - }); - return false; + }) + return false } else { - return true; + return true } } if (loginType === 2 && !pub) { if (url.includes('doctor/pages')) { - return true; + return true } else { const params = Object.entries(options) .map(([key, value]) => `${key}=${value}`) - .join('&'); + .join('&') wx.reLaunch({ url: '/doctor/pages/d_trans/index?path=' + encodeURIComponent(`/${url}?${params}`), - }); - return false; + }) + return false } } - return true; + return true }, zdPermissionVerification(grade = 1, registChannel = 0, backPage = null, regBusinessId = '') { // 1-空白用户,2-注册用户,3-疾病患者,4-用药患者 - const { PatientId, AuditStatus, isFollow, UserType } = this.globalData.zdUserInfo; - const that = this; - this.globalData.registChannel = registChannel; - this.globalData.regBusinessId = regBusinessId; - let isReject = false; + const { PatientId, AuditStatus, isFollow, UserType } = this.globalData.zdUserInfo + 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; + }) + isReject = true } if (grade == 3 && Number(UserType) < 3) { if (UserType == 1) { wx.reLaunch({ url: '/patient/pages/login/index', - }); - isReject = true; + }) + isReject = true } if (UserType == 2) { - let urlKey = ''; + let urlKey = '' if (!PatientId) { - urlKey = 'enterInfo'; + urlKey = 'enterInfo' } else if (AuditStatus == 0) { - urlKey = 'noCert'; + urlKey = 'noCert' } else if (AuditStatus == 1) { if (backPage && (backPage as string).includes('liveResult')) { - urlKey = 'liveResult'; + urlKey = 'liveResult' } else { - urlKey = isFollow ? 'nopending' : 'pending'; + urlKey = isFollow ? 'nopending' : 'pending' } } else if (AuditStatus == 2) { - urlKey = 'reject'; + urlKey = 'reject' } let navUrl = { enterInfo: '/patient/pages/enterInfo/index', @@ -458,55 +467,55 @@ App({ pending: '/patient/pages/enterInfo/index', nopending: '/patient/pages/enterInfo/index', liveResult: backPage, - }[urlKey]; + }[urlKey] if (urlKey == 'liveResult') { wx.navigateTo({ url: navUrl as string, - }); + }) } else { wx.reLaunch({ url: navUrl as string, - }); + }) } - isReject = true; + isReject = true } } if (grade == 4 && Number(UserType) < 4) { wx.reLaunch({ url: '/patient/pages/vipLogin/index', - }); - isReject = true; + }) + isReject = true } if (isReject) { - that.globalData.backPage = backPage; - reject(null); - return; + that.globalData.backPage = backPage + reject(null) + return } - resolve(null); - }); + resolve(null) + }) }, getZdUserInfo(self, update = false, callback = (_zdUserInfo) => {}) { if (this.globalData.zdUserInfo?.UserId && !update) { self?.setData({ zdUserInfo: this.globalData.zdUserInfo, - }); - callback(this.globalData.zdUserInfo); - return; + }) + callback(this.globalData.zdUserInfo) + return } wx.ajax({ method: 'GET', url: '?r=zd/account/info', showMsg: false, }).then((res) => { - res.UserType = res.UserType || 1; + res.UserType = res.UserType || 1 if (res.UserType > 2) { - this.globalData.anyWhere = false; + this.globalData.anyWhere = false } - this.globalData.zdUserInfo = res; + this.globalData.zdUserInfo = res self?.setData({ zdUserInfo: res, - }); - const { doctorId, inviteChan } = this.globalData.scene; + }) + const { doctorId, inviteChan } = this.globalData.scene if (doctorId && res.InviteDoctorId != doctorId && this.globalData.isLogin && res.PatientId) { wx.ajax({ method: 'POST', @@ -515,9 +524,9 @@ App({ inviteDoctorId: doctorId, inviteChannel: inviteChan, }, - }); + }) } - callback(res); - }); + callback(res) + }) }, -}); +}) diff --git a/src/components/patient-tab-bar/index.ts b/src/components/patient-tab-bar/index.ts index 33f3520..e8f11ac 100644 --- a/src/components/patient-tab-bar/index.ts +++ b/src/components/patient-tab-bar/index.ts @@ -71,29 +71,12 @@ Component({ onChange() {}, handleNav(e) { const { index } = e.currentTarget.dataset - const { list, config } = this.data + const { list } = this.data const pagePath = list[index].pagePath app.globalData.BeginnerCardId = '' - if (pagePath == '/patient/pages/my/index') { - app.zdPermissionVerification(2, 0, `/patient/pages/index/index`).then(() => { - wx.reLaunch({ - url: pagePath, - }) - }) - } else if (pagePath == '/patient/pages/repository/index' && config.picTextEbookStatus == 1) { - app.zdPermissionVerification(2, 0, `/pages/repository/index`).then(() => { - const webviewUrl = encodeURIComponent( - `${app.globalData.url}/zdcare/#/cover?loginState=${app.globalData.loginState}`, - ) - wx.navigateTo({ - url: `/patient/pages/webview/index?url=${webviewUrl}`, - }) - }) - } else { - wx.reLaunch({ - url: pagePath, - }) - } + wx.reLaunch({ + url: pagePath, + }) }, }, }) diff --git a/src/gift/pages/myHealthRecord/index.ts b/src/gift/pages/myHealthRecord/index.ts index 87c70ef..ccbc6d6 100644 --- a/src/gift/pages/myHealthRecord/index.ts +++ b/src/gift/pages/myHealthRecord/index.ts @@ -991,7 +991,7 @@ Page({ if (index != 0) return; wx.showModal({ title: '确认删除?', - confirmColor: '#cf5375', + confirmColor: '#8c75d0', success: (res) => { if (res.confirm) { wx.ajax({ @@ -1048,7 +1048,7 @@ Page({ } wx.showModal({ title: '确认删除?', - confirmColor: '#cf5375', + confirmColor: '#8c75d0', success: (res) => { if (res.confirm) { wx.ajax({ diff --git a/src/images/icon4.png b/src/images/icon4.png index 9b87869..52e7975 100644 Binary files a/src/images/icon4.png and b/src/images/icon4.png differ diff --git a/src/images/icon45.png b/src/images/icon45.png new file mode 100644 index 0000000..05421a0 Binary files /dev/null and b/src/images/icon45.png differ diff --git a/src/images/icon46.png b/src/images/icon46.png new file mode 100644 index 0000000..344c87a Binary files /dev/null and b/src/images/icon46.png differ diff --git a/src/images/icon47.png b/src/images/icon47.png new file mode 100644 index 0000000..143b354 Binary files /dev/null and b/src/images/icon47.png differ diff --git a/src/images/icon48.png b/src/images/icon48.png new file mode 100644 index 0000000..77c8b3f Binary files /dev/null and b/src/images/icon48.png differ diff --git a/src/images/icon49.png b/src/images/icon49.png new file mode 100644 index 0000000..3c126ea Binary files /dev/null and b/src/images/icon49.png differ diff --git a/src/images/icon5.png b/src/images/icon5.png index 7e8a884..10bf525 100644 Binary files a/src/images/icon5.png and b/src/images/icon5.png differ diff --git a/src/images/icon50.png b/src/images/icon50.png new file mode 100644 index 0000000..9355ba4 Binary files /dev/null and b/src/images/icon50.png differ diff --git a/src/images/icon51.png b/src/images/icon51.png new file mode 100644 index 0000000..5e6ca5e Binary files /dev/null and b/src/images/icon51.png differ diff --git a/src/images/icon52.png b/src/images/icon52.png new file mode 100644 index 0000000..9219a80 Binary files /dev/null and b/src/images/icon52.png differ diff --git a/src/images/icon53.png b/src/images/icon53.png new file mode 100644 index 0000000..55c5102 Binary files /dev/null and b/src/images/icon53.png differ diff --git a/src/images/icon54.png b/src/images/icon54.png new file mode 100644 index 0000000..e3143a4 Binary files /dev/null and b/src/images/icon54.png differ diff --git a/src/images/icon55.png b/src/images/icon55.png new file mode 100644 index 0000000..a0d9f2b Binary files /dev/null and b/src/images/icon55.png differ diff --git a/src/images/icon56.png b/src/images/icon56.png new file mode 100644 index 0000000..91f5a34 Binary files /dev/null and b/src/images/icon56.png differ diff --git a/src/images/icon57.png b/src/images/icon57.png new file mode 100644 index 0000000..8431028 Binary files /dev/null and b/src/images/icon57.png differ diff --git a/src/images/icon58.png b/src/images/icon58.png new file mode 100644 index 0000000..db3417b Binary files /dev/null and b/src/images/icon58.png differ diff --git a/src/images/icon59.png b/src/images/icon59.png new file mode 100644 index 0000000..978574f Binary files /dev/null and b/src/images/icon59.png differ diff --git a/src/images/icon6.png b/src/images/icon6.png index e2826d6..bece660 100644 Binary files a/src/images/icon6.png and b/src/images/icon6.png differ diff --git a/src/images/icon60.png b/src/images/icon60.png new file mode 100644 index 0000000..37375d8 Binary files /dev/null and b/src/images/icon60.png differ diff --git a/src/images/icon61.png b/src/images/icon61.png new file mode 100644 index 0000000..0393997 Binary files /dev/null and b/src/images/icon61.png differ diff --git a/src/images/icon62.png b/src/images/icon62.png new file mode 100644 index 0000000..c31f905 Binary files /dev/null and b/src/images/icon62.png differ diff --git a/src/images/icon63.png b/src/images/icon63.png new file mode 100644 index 0000000..d259b13 Binary files /dev/null and b/src/images/icon63.png differ diff --git a/src/images/icon64.png b/src/images/icon64.png new file mode 100644 index 0000000..09cb576 Binary files /dev/null and b/src/images/icon64.png differ diff --git a/src/images/icon65.png b/src/images/icon65.png new file mode 100644 index 0000000..3dfce2f Binary files /dev/null and b/src/images/icon65.png differ diff --git a/src/images/icon66.png b/src/images/icon66.png new file mode 100644 index 0000000..6eead7e Binary files /dev/null and b/src/images/icon66.png differ diff --git a/src/images/icon67.png b/src/images/icon67.png new file mode 100644 index 0000000..5b0fede Binary files /dev/null and b/src/images/icon67.png differ diff --git a/src/images/invite-card.png b/src/images/invite-card.png new file mode 100644 index 0000000..bed552d Binary files /dev/null and b/src/images/invite-card.png differ diff --git a/src/images/start.png b/src/images/start.png new file mode 100644 index 0000000..d8aec36 Binary files /dev/null and b/src/images/start.png differ diff --git a/src/images/title7.png b/src/images/title7.png new file mode 100644 index 0000000..a65789d Binary files /dev/null and b/src/images/title7.png differ diff --git a/src/images/title8.png b/src/images/title8.png new file mode 100644 index 0000000..6c2084d Binary files /dev/null and b/src/images/title8.png differ diff --git a/src/images/title9.png b/src/images/title9.png new file mode 100644 index 0000000..8dcbffa Binary files /dev/null and b/src/images/title9.png differ diff --git a/src/pages/d_interactive/index.json b/src/pages/d_interactive/index.json index 3a50fc6..0ad641f 100644 --- a/src/pages/d_interactive/index.json +++ b/src/pages/d_interactive/index.json @@ -1,5 +1,6 @@ { - "navigationStyle": "custom", + "navigationBarTitleText": "互动", + "navigationStyle": "default", "usingComponents": { "zd-navBar": "/components/zd-navBar/navBar", "van-icon": "@vant/weapp/icon/index", diff --git a/src/pages/d_interactive/index.scss b/src/pages/d_interactive/index.scss index b6ae878..907024c 100644 --- a/src/pages/d_interactive/index.scss +++ b/src/pages/d_interactive/index.scss @@ -1,5 +1,5 @@ page { - background-color: rgba(242, 244, 245, 1); + background-color: rgba(246, 248, 249, 1); padding-bottom: calc(140rpx + env(safe-area-inset-bottom)); } .page { @@ -7,20 +7,19 @@ page { .page-header { position: sticky; top: 0; - padding: 30rpx; - box-shadow: 0rpx 8rpx 16rpx 0rpx rgba(40, 48, 49, 0.04); + padding: 32rpx 40rpx; z-index: 10; + background-color: rgba(246, 248, 249, 1); .wrap { display: flex; align-items: center; .search { flex: 1; - padding: 18rpx 32rpx; + padding: 12rpx 32rpx; display: flex; align-items: center; gap: 16rpx; - background: linear-gradient(to top, #ffffff 0%, #ebf3f4 100%); - box-shadow: 0rpx 8rpx 8rpx 0rpx rgba(40, 48, 49, 0.04); + background: #ffffff; border-radius: 140rpx 140rpx 140rpx 140rpx; border: 2rpx solid #ffffff; .icon { @@ -37,60 +36,16 @@ page { } .clear { margin-left: 32rpx; - width: 44rpx; - height: 44rpx; - } - } - .navbar { - margin-top: 32rpx; - display: flex; - justify-content: space-between; - align-items: center; - .nav { - position: relative; - flex: 1; - text-align: center; - font-size: 32rpx; - color: rgba(103, 113, 114, 1); - transition: all 0.3s; - .dot { - padding: 0 4rpx; - position: absolute; - left: 50%; - transform: translateX(35rpx); - top: 0; - min-width: 18rpx; - height: 26rpx; - font-size: 18rpx; - line-height: 26rpx; - color: rgba(255, 255, 255, 1); - border-radius: 50%; - background: rgba(215, 108, 108, 1); - } - &.active { - font-size: 32rpx; - color: rgba(98, 190, 208, 1); - font-weight: bold; - &::after { - position: absolute; - bottom: -30rpx; - left: 50%; - transform: translateX(-50%); - content: ''; - width: 52rpx; - height: 8rpx; - border-radius: 24rpx 24rpx 0 0; - background: #62bed0; - } - } + width: 56rpx; + height: 56rpx; } } } .list { - margin: 30rpx; + margin: 30rpx 40rpx; .list-item { margin-bottom: 24rpx; - padding: 30rpx; + padding: 32rpx; border-radius: 24rpx; background-color: #fff; display: flex; @@ -123,8 +78,8 @@ page { align-items: center; justify-content: space-between; .name { - font-size: 32rpx; - color: rgba(40, 48, 49, 1); + font-size: 36rpx; + color: rgba(33, 29, 46, 1); font-weight: bold; } .date { @@ -147,10 +102,10 @@ page { } } .content { - margin-top: 20rpx; + margin-top: 16rpx; max-width: 18em; font-size: 28rpx; - color: rgba(154, 161, 162, 1); + color: rgba(105, 104, 110, 1); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; diff --git a/src/pages/d_interactive/index.wxml b/src/pages/d_interactive/index.wxml index 3672782..698a127 100644 --- a/src/pages/d_interactive/index.wxml +++ b/src/pages/d_interactive/index.wxml @@ -1,28 +1,20 @@ - - + - + - + diff --git a/src/pages/d_interactiveDoctor/index.json b/src/pages/d_interactiveDoctor/index.json index 279a451..cc0b65f 100644 --- a/src/pages/d_interactiveDoctor/index.json +++ b/src/pages/d_interactiveDoctor/index.json @@ -1,8 +1,9 @@ { "navigationBarTitleText": "互动", - "navigationStyle": "default", + "navigationStyle": "custom", "usingComponents": { "van-icon": "@vant/weapp/icon/index", + "navbar": "/components/navbar/index", "van-popup": "@vant/weapp/popup/index" } } diff --git a/src/pages/d_interactiveDoctor/index.scss b/src/pages/d_interactiveDoctor/index.scss index 4bf683d..640d12c 100644 --- a/src/pages/d_interactiveDoctor/index.scss +++ b/src/pages/d_interactiveDoctor/index.scss @@ -3,20 +3,23 @@ page { } .page { height: 100vh; + box-sizing: border-box; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; .page-header { + margin: 0 30rpx; padding-bottom: 30rpx; - border-radius: 0 0 24rpx 24rpx; - background-color: #fff; + background: linear-gradient(53deg, #ffffff 0%, rgba(255, 255, 255, 0.46) 100%); + border-radius: 24rpx 24rpx 24rpx 24rpx; + border: 2rpx solid #ffffff; .user { flex-shrink: 0; padding: 36rpx 30rpx 0; display: flex; - align-items: center; justify-content: space-between; + align-items: center; .avatar { width: 104rpx; height: 104rpx; @@ -24,147 +27,32 @@ page { } .wrap { flex: 1; - padding: 0 20rpx; + padding: 0 16rpx; .name { - display: flex; - justify-content: space-between; - align-items: center; font-size: 40rpx; color: rgba(40, 48, 49, 1); font-weight: bold; - .tip { - display: block; - padding: 2rpx 16rpx; + .edc { + margin-left: 10rpx; + display: inline-block; + padding: 0 8rpx; font-size: 24rpx; - color: #fff; - border-radius: 0 30rpx 30rpx 30rpx; - background-color: #67baca; - } - .detail { - flex-shrink: 0; - font-size: 28rpx; - color: rgba(103, 186, 202, 1); + color: rgba(255, 255, 255, 1); font-weight: normal; + background-color: rgba(185, 130, 255, 1); } } - .tags { + .date { margin-top: 20rpx; - display: flex; - flex-wrap: wrap; - gap: 12rpx; - .tag { - padding: 4rpx 16rpx; - font-size: 22rpx; - color: rgba(103, 113, 114, 1); - border-radius: 8rpx; - background-color: rgba(242, 244, 245, 1); - } - } - } - } - .adl { - margin: 32rpx 30rpx 0; - background: #ffffff; - box-shadow: 0rpx 8rpx 32rpx 0rpx rgba(40, 48, 49, 0.04); - border-radius: 24rpx 24rpx 24rpx 24rpx; - border: 2rpx solid #f8f9f9; - .a-header { - display: flex; - align-items: flex-start; - flex-direction: column; - .content { - border-radius: 24rpx 0 24rpx 0; - padding: 14rpx 28rpx; font-size: 28rpx; - line-height: 1; - color: rgba(98, 190, 208, 1); - background-color: rgba(242, 248, 249, 1); - } - .box { - width: 40rpx; - height: 40rpx; - background-color: rgba(242, 248, 249, 1); + color: rgba(105, 104, 110, 1); } } - .a-content { - position: relative; - z-index: 1; - margin-top: -40rpx; - padding: 32rpx 30rpx; - background-color: #fff; - border-radius: 24rpx; - .row { - display: flex; - align-items: center; - gap: 20rpx; - &:first-of-type { - margin-bottom: 24rpx; - } - .label { - flex-shrink: 0; - font-size: 28rpx; - color: rgba(154, 161, 162, 1); - } - .num { - min-width: 3em; - font-size: 28rpx; - color: rgba(40, 48, 49, 1); - } - .tag { - display: flex; - align-items: center; - background-color: rgba(232, 245, 248, 1); - border-radius: 12rpx; - .t-label { - padding: 8rpx 12rpx; - font-size: 24rpx; - color: rgba(255, 255, 255, 1); - background-color: rgba(103, 186, 202, 1); - border-radius: 12rpx; - display: flex; - align-items: center; - gap: 8rpx; - flex-shrink: 0; - .icon { - width: 24rpx; - height: 24rpx; - } - } - .t-content { - padding: 0 16rpx 0 8rpx; - display: flex; - align-items: center; - font-size: 28rpx; - color: rgba(103, 186, 202, 1); - display: flex; - align-items: center; - gap: 4rpx; - flex-shrink: 0; - .icon { - width: 24rpx; - height: 28rpx; - } - } - &.tag-warn { - background-color: rgba(227, 220, 64, 0.1); - .t-label { - background-color: rgba(225, 217, 45, 1); - } - .t-content { - color: rgba(225, 217, 45, 1); - } - } - &.tag-error { - background-color: rgba(248, 234, 234, 1); - .t-label { - background-color: rgba(215, 108, 108, 1); - } - .t-content { - color: rgba(215, 108, 108, 1); - } - } - } - } + .detail { + flex-shrink: 0; + font-size: 28rpx; + color: rgba(185, 130, 255, 1); + font-weight: normal; } } } @@ -200,7 +88,7 @@ page { .guide { margin-bottom: 32rpx; padding: 32rpx 30rpx; - border-radius: 0 32rpx 32rpx; + border-radius: 32rpx; background: linear-gradient(13deg, #ffffff 8%, #e8f0f1 100%); border: 2rpx solid #ffffff; .title { @@ -252,7 +140,7 @@ page { margin-bottom: 32rpx; padding: 26rpx 32rpx; background-color: #fff; - border-radius: 0 32rpx 32rpx; + border-radius: 32rpx; font-size: 32rpx; color: rgba(40, 48, 49, 1); white-space: pre-line; @@ -321,8 +209,8 @@ page { .guide { margin-bottom: 32rpx; padding: 32rpx 30rpx; - border-radius: 32rpx 0 32rpx 32rpx; - background: linear-gradient(13deg, #ffffff 8%, #e8f0f1 100%); + border-radius: 32rpx 32rpx; + background: linear-gradient(180deg, #f6efff 0%, #ffffff 100%); border: 2rpx solid #ffffff; .title { font-size: 32rpx; @@ -337,10 +225,13 @@ page { .list { .l-item { display: flex; - align-items: center; gap: 16rpx; margin-bottom: 30rpx; + &:last-of-type { + margin-bottom: 0; + } .order { + margin-top: 6rpx; flex-shrink: 0; width: 28rpx; height: 28rpx; @@ -350,11 +241,11 @@ page { justify-content: center; color: rgba(255, 255, 255, 1); border-radius: 6rpx; - background: #67baca; + background: linear-gradient(197deg, #ffbcf9 0%, #b982ff 100%); } .content { font-size: 32rpx; - color: rgba(40, 48, 49, 1); + color: rgba(33, 29, 46, 1); } } } @@ -372,8 +263,8 @@ page { .message { margin-bottom: 32rpx; padding: 26rpx 32rpx; - background: #67baca; - border-radius: 32rpx 0 32rpx 32rpx; + background: rgba(185, 130, 255, 1); + border-radius: 32rpx; font-size: 32rpx; color: #fff; white-space: pre-line; @@ -382,10 +273,10 @@ page { margin-bottom: 32rpx; padding: 26rpx 32rpx; background-color: #fff; - border-radius: 32rpx 0 32rpx 32rpx; + border-radius: 32rpx; .w-title { font-size: 32rpx; - color: rgba(40, 48, 49, 1); + color: rgba(33, 29, 46, 1); text-align: right; } .w-container { @@ -408,7 +299,7 @@ page { justify-content: center; font-size: 32rpx; color: rgba(255, 255, 255, 1); - background-color: rgba(103, 186, 202, 1); + background-color: rgba(185, 130, 255, 1); } .content { width: 156rpx; @@ -417,8 +308,8 @@ page { align-items: center; justify-content: center; font-size: 32rpx; - color: rgba(40, 48, 49, 1); - background-color: rgba(242, 244, 245, 1); + color: rgba(33, 29, 46, 1); + background-color: rgba(234, 238, 240, 1); } &:first-of-type { .label { @@ -439,13 +330,21 @@ page { &:not(:last-of-type) { border-bottom: 2rpx solid #fff; } + &:nth-of-type(2n) { + .label { + background-color: rgba(214, 181, 255, 1); + } + .content { + background-color: rgba(246, 248, 249, 1); + } + } } } } .adl { margin-bottom: 32rpx; padding: 32rpx 156rpx 34rpx 30rpx; - border-radius: 0 32rpx 32rpx; + border-radius: 32rpx; background: linear-gradient(141deg, #edfcff 0%, #d4f3f9 100%); border: 2rpx solid #fff; .title { @@ -478,7 +377,7 @@ page { .audio { margin-bottom: 32rpx; padding: 22rpx 24rpx; - border-radius: 32rpx 0 32rpx 32rpx; + border-radius: 32rpx; background: #67baca; min-width: 218rpx; font-size: 32rpx; @@ -497,7 +396,7 @@ page { margin-bottom: 32rpx; padding: 26rpx 32rpx; background-color: #fff; - border-radius: 32rpx 0 32rpx 32rpx; + border-radius: 32rpx; .content { font-size: 28rpx; color: #283031; diff --git a/src/pages/d_interactiveDoctor/index.ts b/src/pages/d_interactiveDoctor/index.ts index a324810..ce2a42d 100644 --- a/src/pages/d_interactiveDoctor/index.ts +++ b/src/pages/d_interactiveDoctor/index.ts @@ -1,23 +1,23 @@ -import dayjs from 'dayjs'; +import dayjs from 'dayjs' -const app = getApp(); +const app = getApp() interface IMessageItem { - msgId: string; - msgContentType: '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9'; // 1:文本 2: 出诊时间 3: adl卡片 4: 语音 5: 欢迎语 6:补充真实姓名 7: 提醒完善信息 8: 复诊卡片 9:患者恢复复诊消息 - msgContent: any; - msgVisitTime: string; - msgVisitTimeType?: string; - msgFromType: '1' | '2'; // 1: 患者 2: 医生 - isPlay?: boolean; - msgCreateTime: string; // 消息创建时间 - msgCreateTimeName?: string; // 消息创建时间 - showTime?: boolean; + msgId: string + msgContentType: '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' // 1:文本 2: 出诊时间 3: adl卡片 4: 语音 5: 欢迎语 6:补充真实姓名 7: 提醒完善信息 8: 复诊卡片 9:患者恢复复诊消息 + msgContent: any + msgVisitTime: string + msgVisitTimeType?: string + msgFromType: '1' | '2' // 1: 患者 2: 医生 + isPlay?: boolean + msgCreateTime: string // 消息创建时间 + msgCreateTimeName?: string // 消息创建时间 + showTime?: boolean } interface Item { - wordId: string; - word: string; + wordId: string + word: string } Page({ @@ -47,23 +47,23 @@ Page({ onLoad(options) { this.innerAudioContext = wx.createInnerAudioContext({ useWebAudioImplement: true, - }); + }) this.setData({ patientId: options.patientId, - }); + }) }, onShow() { app.waitLogin({ type: [2] }).then((_res) => { - app.zdMpBehavior({ doctor: true, PageName: 'PG_DOCTORINTERACTIONDETAIL' }); - this.getDoctorDetail(); - this.getPatientDetail(); - this.getMessageList(); - this.getWordList(); - }); + app.zdMpBehavior({ doctor: true, PageName: 'PG_DOCTORINTERACTIONDETAIL' }) + this.getDoctorDetail() + this.getPatientDetail() + this.getMessageList() + this.getWordList() + }) }, onUnload() { if (this.innerAudioContext) { - this.innerAudioContext.stop(); + this.innerAudioContext.stop() } }, getDoctorDetail() { @@ -74,8 +74,8 @@ Page({ }).then((res) => { this.setData({ doctor: res.doctor, - }); - }); + }) + }) }, getPatientDetail() { wx.ajax({ @@ -86,19 +86,19 @@ Page({ }, }).then((res) => { if (res.LastAdlTime) { - res.LastAdlTimeName = dayjs(res.LastAdlTime).from(dayjs().format('YYYY-MM-DD')).replace(' ', ''); + res.LastAdlTimeName = dayjs(res.LastAdlTime).from(dayjs().format('YYYY-MM-DD')).replace(' ', '') } this.setData({ patientDetail: res, - }); - }); + }) + }) }, getMessageList() { - if (this.data.isLoad || this.data.isFinish) return; + if (this.data.isLoad || this.data.isFinish) return this.setData({ isLoad: true, - }); - const nextMsgId = this.data.nextMsgId; + }) + const nextMsgId = this.data.nextMsgId wx.ajax({ method: 'GET', url: '?r=zd/doctor/message-interact/doctor-get-message-list', @@ -109,21 +109,21 @@ Page({ }).then((res) => { res.messageList.map((item) => { if (item.msgContentType === '4') { - item.msgContent = JSON.parse(item.msgContent); + item.msgContent = JSON.parse(item.msgContent) } if (item.msgContentType === '2') { - item.msgVisitTime = item.msgVisitTimeType == 2 ? item.msgVisitTime : JSON.parse(item.msgVisitTime); + item.msgVisitTime = item.msgVisitTimeType == 2 ? item.msgVisitTime : JSON.parse(item.msgVisitTime) } if (item.msgContentType === '5') { - item.welcomeMsg = JSON.parse(item.welcomeMsg); + item.welcomeMsg = JSON.parse(item.welcomeMsg) } if (item.msgContentType === '9') { - item.ReVisitInfo = JSON.parse(item.ReVisitInfo); - item.ReVisitInfo.visitDateName = dayjs(item.ReVisitInfo.visitDate).format('YYYY年M月DD日'); + item.ReVisitInfo = JSON.parse(item.ReVisitInfo) + item.ReVisitInfo.visitDateName = dayjs(item.ReVisitInfo.visitDate).format('YYYY年M月DD日') } - return item; - }); + return item + }) if (!this.data.nextMsgId && !res.messageList.length) { res.messageList = [ { @@ -133,7 +133,7 @@ Page({ msgVisitTime: '', msgFromType: '2', }, - ]; + ] } this.setData({ messageList: [...res.messageList.reverse(), ...this.data.messageList], @@ -144,16 +144,16 @@ Page({ adlMsgId: res.adlMsgId, isLoad: false, isFinish: nextMsgId === res.nextMsgId, - }); - this.filterCreateTime(); + }) + this.filterCreateTime() if (!nextMsgId) { - this.handleView(); + this.handleView() } - }); + }) }, scrolltoupper(e) { if (e.detail.direction === 'top') { - this.getMessageList(); + this.getMessageList() } }, getWordList() { @@ -164,15 +164,15 @@ Page({ }).then((res) => { this.setData({ wordList: res, - }); - }); + }) + }) }, handleSendDate() { - app.zdMpBehavior({ doctor: true, PageName: 'BTN_DOCTORINTERACTIONDETAILMYCLINICTIME' }); + app.zdMpBehavior({ doctor: true, PageName: 'BTN_DOCTORINTERACTIONDETAILMYCLINICTIME' }) const { messageList, doctor: { Clinic }, - } = this.data; + } = this.data if (!Clinic || (Array.isArray(Clinic) && !Clinic.length)) { wx.showModal({ title: '完善出诊时间?', @@ -183,11 +183,11 @@ Page({ if (res.confirm) { wx.navigateTo({ url: '/pages/d_userInfo/index', - }); + }) } }, - }); - return; + }) + return } wx.showModal({ title: '提示', @@ -208,40 +208,40 @@ Page({ msgCreateTime: dayjs().format('YYYY-MM-DD HH:mm:ss'), }, ], - }); - this.filterCreateTime(); + }) + this.filterCreateTime() wx.ajax({ method: 'POST', url: '?r=zd/doctor/message-interact/send-visit-time', data: { patientId: this.data.patientId, }, - }); - this.handleView(); + }) + this.handleView() } }, - }); + }) }, handleSendShow() { - app.zdMpBehavior({ doctor: true, PageName: 'BTN_DOCTORINTERACTIONDETAILSENDMESSAGE' }); + app.zdMpBehavior({ doctor: true, PageName: 'BTN_DOCTORINTERACTIONDETAILSENDMESSAGE' }) this.setData({ messageListShow: true, - }); + }) }, handlePopupMessageClose() { this.setData({ messageListShow: false, - }); + }) }, handleWord(e) { - const { index } = e.currentTarget.dataset; + const { index } = e.currentTarget.dataset this.setData({ wordIndex: index, - }); + }) }, handleSendWord() { - const { messageList, wordList, wordIndex } = this.data; - const { wordId, word } = wordList[wordIndex]; + const { messageList, wordList, wordIndex } = this.data + const { wordId, word } = wordList[wordIndex] this.setData({ messageList: [ ...messageList, @@ -254,10 +254,10 @@ Page({ msgCreateTime: dayjs().format('YYYY-MM-DD HH:mm:ss'), }, ], - }); - this.filterCreateTime(); - this.handlePopupMessageClose(); - this.handleView(); + }) + this.filterCreateTime() + this.handlePopupMessageClose() + this.handleView() wx.ajax({ method: 'POST', url: '?r=zd/doctor/message-interact/send-word-message', @@ -265,30 +265,30 @@ Page({ patientId: this.data.patientId, wordId, }, - }); + }) }, handleSendUserConform(e) { - const { id } = e.currentTarget.dataset; + const { id } = e.currentTarget.dataset const title = { 6: '发送后患者将收到补充姓名通知', 7: '发送后患者将收到完善信息通知', - }[id]; + }[id] wx.showModal({ title, confirmColor: '#62bed0', success: (res) => { if (res.confirm) { - this.handleSendUser(id); + this.handleSendUser(id) } }, - }); + }) }, handleSendUser(id) { - const { messageList } = this.data; + const { messageList } = this.data const content = { 6: '请完善您的真实姓名,以便我清楚了解您的病情', 7: '请完善您的个人信息,以便我清楚了解您的病情', - }[id]; + }[id] this.setData({ messageList: [ ...messageList, @@ -301,110 +301,110 @@ Page({ msgCreateTime: dayjs().format('YYYY-MM-DD HH:mm:ss'), }, ], - }); - this.filterCreateTime(); - this.handlePopupMessageClose(); - this.handleView(); + }) + this.filterCreateTime() + this.handlePopupMessageClose() + this.handleView() const url = { 6: '?r=zd/doctor/message-interact/send-remind-name', 7: '?r=zd/doctor/message-interact/send-remind-init', - }[id]; + }[id] wx.ajax({ method: 'POST', url, data: { patientId: this.data.patientId, }, - }); + }) }, formatTime(date: string) { - let msgCreateTimeName = ''; + let msgCreateTimeName = '' if (dayjs().format('YYYY-MM-DD') === dayjs(date).format('YYYY-MM-DD')) { - msgCreateTimeName = dayjs(date).format('HH:mm'); + msgCreateTimeName = dayjs(date).format('HH:mm') } else if (dayjs().format('YYYY-MM-DD') === dayjs(date).add(1, 'day').format('YYYY-MM-DD')) { - msgCreateTimeName = `昨天 ${dayjs(date).format('HH:mm')}`; + msgCreateTimeName = `昨天 ${dayjs(date).format('HH:mm')}` } else if (dayjs().diff(date, 'day') < 7) { - msgCreateTimeName = dayjs(date).format(`dddd HH:mm`); + msgCreateTimeName = dayjs(date).format(`dddd HH:mm`) } else { - msgCreateTimeName = dayjs(date).format('YYYY-MM-DD HH:mm'); + msgCreateTimeName = dayjs(date).format('YYYY-MM-DD HH:mm') } - return msgCreateTimeName; + return msgCreateTimeName }, filterCreateTime() { - const gapTime = 5 * 60 * 1000; - const { messageList } = this.data; + const gapTime = 5 * 60 * 1000 + const { messageList } = this.data - let preTime = 0; + let preTime = 0 messageList.forEach((item, index) => { if (index === 0) { - item.showTime = true; - preTime = dayjs(item.msgCreateTime).valueOf(); - item.msgCreateTimeName = this.formatTime(item.msgCreateTime); + item.showTime = true + preTime = dayjs(item.msgCreateTime).valueOf() + item.msgCreateTimeName = this.formatTime(item.msgCreateTime) } else { - const curTime = dayjs(item.msgCreateTime).valueOf(); + const curTime = dayjs(item.msgCreateTime).valueOf() if (curTime - preTime > gapTime) { - item.showTime = true; - item.msgCreateTimeName = this.formatTime(item.msgCreateTime); - preTime = dayjs(item.msgCreateTime).valueOf(); + item.showTime = true + item.msgCreateTimeName = this.formatTime(item.msgCreateTime) + preTime = dayjs(item.msgCreateTime).valueOf() } } - }); + }) this.setData({ messageList, - }); + }) }, handleView(index = -1) { this.setData({ scrollIntoView: index > -1 ? `view${index}` : `place`, - }); + }) }, handlePatientDetail() { - app.zdMpBehavior({ doctor: true, PageName: 'BTN_DOCTORINTERACTIONDETAILPATIENTFILE' }); + app.zdMpBehavior({ doctor: true, PageName: 'BTN_DOCTORINTERACTIONDETAILPATIENTFILE' }) wx.navigateTo({ url: `/pages/d_patientDetail/index?id=${this.data.patientId}`, - }); + }) }, handleAudio(e) { - const { index } = e.currentTarget.dataset; - const { messageList } = this.data; - const messageItem = messageList[index]; - const { url } = messageItem.msgContent[0]; + const { index } = e.currentTarget.dataset + const { messageList } = this.data + const messageItem = messageList[index] + const { url } = messageItem.msgContent[0] if (this.innerAudioContext) { if (messageItem.isPlay) { - this.innerAudioContext.stop(); - messageItem.isPlay = false; + this.innerAudioContext.stop() + messageItem.isPlay = false this.setData({ messageList, - }); - return; + }) + return } - this.innerAudioContext.stop(); - this.innerAudioContext.src = url; - this.innerAudioContext.play(); - messageItem.isPlay = true; + this.innerAudioContext.stop() + this.innerAudioContext.src = url + this.innerAudioContext.play() + messageItem.isPlay = true this.innerAudioContext.onEnded(() => { - messageItem.isPlay = false; + messageItem.isPlay = false this.setData({ messageList, - }); - }); + }) + }) this.innerAudioContext.onStop(() => { - messageItem.isPlay = false; + messageItem.isPlay = false this.setData({ messageList, - }); - }); + }) + }) this.setData({ messageList, - }); + }) } }, handleAdl() { wx.showToast({ title: '患者点击此按钮可进入ADL测评页面', icon: 'none', - }); + }) }, handleReferral() { wx.showModal({ @@ -433,11 +433,14 @@ Page({ msgCreateTime: dayjs().format('YYYY-MM-DD HH:mm:ss'), }, ], - }); - this.handleView(); - }); + }) + this.handleView() + }) } }, - }); + }) }, -}); + handleBack() { + wx.navigateBack() + }, +}) diff --git a/src/pages/d_interactiveDoctor/index.wxml b/src/pages/d_interactiveDoctor/index.wxml index b27b4a0..d149637 100644 --- a/src/pages/d_interactiveDoctor/index.wxml +++ b/src/pages/d_interactiveDoctor/index.wxml @@ -1,4 +1,10 @@ - + + + + @@ -6,117 +12,12 @@ {{patientDetail.patientName}} - - 提醒补充真实姓名 - - - - 患者档案 - - - - - - {{tag}} - - - - - - - 最近一次测评:{{patientDetail.LastAdlTimeName}} - - - - - 最新ADL评分 - {{patientDetail.AdlScore}} - - - - 已达标 - - - - - {{patientDetail.TotalScoreChange}} - - - - - - 接近达标 - - - - - {{patientDetail.TotalScoreChange}} - - - - - - 待达标 - - - - - {{patientDetail.TotalScoreChange}} - - - - - 最新激素用量 - {{patientDetail.SteroidDailyDose}}mg - - - - 已达标 - - - - - {{patientDetail.SteroidDailyDoseChange}}mg - - - - - - 待达标 - - - - - {{patientDetail.SteroidDailyDoseChange}}mg - + EDC患者 + 上次就诊时间:2025-08-10 + 查看档案 @@ -144,17 +45,23 @@ {{message.msgContent}} - + 我最近一次复诊时间是{{message.ReVisitInfo.visitDateName}} 我的方案是 1.激素 - 2.传统免疫抑制剂(如他克莫司、吗 替麦考酚酯等) + + 2.传统免疫抑制剂(如他克莫司、吗 替麦考酚酯等) + 3.静脉输注丙种球蛋白 4.血浆置换 - 5.B细胞抑制剂(如:利妥昔单抗、泰 它西普、伊奈利珠单抗) + + 5.B细胞抑制剂(如:利妥昔单抗、泰 它西普、伊奈利珠单抗) + 6.FcRn拮抗剂(如:艾加莫德) - 7.C5补体抑制剂(如:依库珠单抗) + + 7.C5补体抑制剂(如:依库珠单抗) + 8.中药或中成药 9.其他 @@ -172,10 +79,6 @@ {{item.question}} - - {{message.welcomeMsg.guideClick}} - - {{message.msgContent}} @@ -252,18 +155,10 @@ 发送消息 - - - 完善个人信息 - 我的出诊时间 - - - 复诊提醒 - diff --git a/src/pages/d_invite/index.json b/src/pages/d_invite/index.json new file mode 100644 index 0000000..6a47e59 --- /dev/null +++ b/src/pages/d_invite/index.json @@ -0,0 +1,7 @@ +{ + "navigationBarTitleText": "重症肌无力医生端", + "navigationStyle": "default", + "usingComponents": { + "customPoster": "/components/customPoster/index" + } +} diff --git a/src/pages/d_invite/index.scss b/src/pages/d_invite/index.scss new file mode 100644 index 0000000..446a9ba --- /dev/null +++ b/src/pages/d_invite/index.scss @@ -0,0 +1,29 @@ +page{ + background-color: #c65174; +} +.page { + position: relative; + height: 1448rpx; + .poster { + width: 100%; + height: 100%; + } + .btn { + position: absolute; + bottom: 88rpx; + left: 50%; + transform: translateX(-50%); + margin: 36rpx auto; + padding: 18rpx 44rpx; + font-size: 36rpx; + line-height: 48rpx; + font-weight: bold; + display: flex; + align-items: center; + justify-content: center; + color: rgba(255, 255, 255, 1); + border-radius: 64rpx 64rpx 64rpx 64rpx; + border: 1px solid rgba(255, 255, 255, 1); + box-sizing: border-box; + } +} diff --git a/src/pages/d_invite/index.ts b/src/pages/d_invite/index.ts new file mode 100644 index 0000000..9b87de7 --- /dev/null +++ b/src/pages/d_invite/index.ts @@ -0,0 +1,114 @@ +const app = getApp() + +Page({ + data: { + doctor: {}, + hospital: {}, + qrCode: '', + + posterUrl: '', + params: {}, + }, + onLoad() { + const SystemInfo = app.globalSystemInfo + if (SystemInfo) { + const { bottom } = SystemInfo.capsulePosition + this.setData({ + bottom, + }) + } + app.waitLogin().then((_res) => { + wx.showLoading({ + title: '加载中', + }) + app.mpBehavior({ doctor: true, PageName: 'PG_DOCTORINVITEPATIENT' }) + this.getDetail() + }) + }, + getDetail() { + wx.ajax({ + method: 'GET', + url: '?r=zd/doctor/account/info', + data: {}, + }).then((res) => { + this.setData({ + doctor: res.doctor, + hospital: res.hospital, + }) + this.getPrepare(res.doctor.Id) + }) + }, + getPrepare(id) { + wx.ajax({ + method: 'POST', + url: '?r=poster/prepare', + data: { + posterId: 'doctor_mini', + doctorId: id, + }, + }).then((res) => { + this.setData({ + params: res, + }) + }) + }, + getQrCode() { + this.setData({ + qrCode: `${app.globalData.url}?r=zd/doctor/account/mp-info&loginState=${app.globalData.loginState}`, + }) + }, + handleDownload() { + wx.showToast({ + title: '请长按海报图片进行保存', + icon: 'none', + }) + // wx.showLoading({ + // title: '加载中', + // }) + // wx.downloadFile({ + // url: this.data.posterUrl, + // success: (res) => { + // if (res.statusCode === 200) { + // wx.saveImageToPhotosAlbum({ + // filePath: res.tempFilePath, + // success: () => { + // wx.hideLoading() + // wx.showToast({ + // title: '保存成功,请到相册中查看', + // }) + // }, + // fail: () => { + // wx.hideLoading() + // wx.showToast({ + // icon: 'none', + // title: '保存失败,请稍后重试', + // }) + // }, + // }) + // } else { + // wx.hideLoading() + // wx.showToast({ + // icon: 'none', + // title: '下载失败,请稍后重试', + // }) + // } + // }, + // fail: () => { + // wx.hideLoading() + // wx.showToast({ + // icon: 'none', + // title: '下载失败,请稍后重试', + // }) + // }, + // }) + }, + handlePosterFinish(e: any) { + this.setData({ + posterUrl: e.detail, + }) + wx.hideLoading() + }, + handleBack() { + wx.navigateBack() + }, +}) diff --git a/src/pages/d_invite/index.wxml b/src/pages/d_invite/index.wxml new file mode 100644 index 0000000..1fd0ca2 --- /dev/null +++ b/src/pages/d_invite/index.wxml @@ -0,0 +1,6 @@ + + + 长按图片保存 + + + diff --git a/src/pages/d_patient/index.json b/src/pages/d_patient/index.json new file mode 100644 index 0000000..9970e44 --- /dev/null +++ b/src/pages/d_patient/index.json @@ -0,0 +1,9 @@ +{ + "navigationStyle": "default", + "navigationBarTitleText": "患者列表", + "usingComponents": { + "navbar": "/components/navbar/index", + "van-icon": "@vant/weapp/icon/index", + "van-popup": "@vant/weapp/popup/index" + } +} diff --git a/src/pages/d_patient/index.scss b/src/pages/d_patient/index.scss new file mode 100644 index 0000000..8c2cd55 --- /dev/null +++ b/src/pages/d_patient/index.scss @@ -0,0 +1,344 @@ +page { + background-color: rgba(242, 244, 245, 1); + padding-bottom: calc(140rpx + env(safe-area-inset-bottom)); +} + +.page { + min-height: 100vh; + + .page-header { + position: sticky; + top: 0; + padding: 30rpx; + box-shadow: 0rpx 8rpx 16rpx 0rpx rgba(40, 48, 49, 0.04); + background-color: #fff; + z-index: 10; + + .search { + padding: 12rpx 32rpx; + display: flex; + align-items: center; + gap: 16rpx; + background: rgba(246, 248, 249, 1); + border-radius: 140rpx 140rpx 140rpx 140rpx; + + .icon { + width: 40rpx; + height: 40rpx; + } + + .input { + flex: 1; + font-size: 28rpx; + } + + .input-place { + color: rgba(173, 179, 180, 1); + } + } + .navbar { + margin-top: 32rpx; + display: flex; + justify-content: space-between; + align-items: center; + .nav { + position: relative; + flex: 1; + text-align: center; + font-size: 32rpx; + color: rgba(105, 104, 110, 1); + transition: all 0.3s; + .dot { + padding: 0 4rpx; + position: absolute; + left: 50%; + transform: translateX(35rpx); + top: 0; + min-width: 18rpx; + height: 26rpx; + font-size: 18rpx; + line-height: 26rpx; + color: rgba(255, 255, 255, 1); + border-radius: 50%; + background: rgba(215, 108, 108, 1); + } + &.active { + font-size: 32rpx; + color: rgba(33, 29, 46, 1); + font-weight: bold; + &::after { + position: absolute; + bottom: -30rpx; + left: 50%; + transform: translateX(-50%); + content: ''; + width: 38rpx; + height: 8rpx; + border-radius: 12rpx; + background: rgba(185, 130, 255, 1); + } + } + } + } + } + + .total-line { + padding: 34rpx 30rpx 0; + display: flex; + justify-content: space-between; + align-items: center; + + .wrap { + display: flex; + align-items: center; + gap: 20rpx; + + .user { + font-size: 32rpx; + color: rgba(154, 161, 162, 1); + + .num { + margin-left: 10rpx; + color: rgba(43, 160, 184, 1); + } + } + + .message { + font-size: 32rpx; + color: rgba(43, 160, 184, 1); + } + } + + .btn { + padding: 10rpx 32rpx; + font-size: 32rpx; + line-height: 1; + color: rgba(98, 190, 208, 1); + background: #ffffff; + border-radius: 80rpx 80rpx 80rpx 80rpx; + border: 2rpx solid #62bed0; + display: flex; + align-items: center; + + .icon { + width: 32rpx; + height: 32rpx; + } + } + } + + .list { + margin: 0 30rpx; + + .list-item { + margin-top: 24rpx; + padding: 32rpx; + background: #ffffff; + border-radius: 24rpx 24rpx 24rpx 24rpx; + display: flex; + align-items: center; + .avatar { + flex-shrink: 0; + .avatar-img { + width: 100rpx; + height: 100rpx; + border-radius: 50%; + } + } + .container { + flex: 1; + padding-left: 20rpx; + .title { + display: flex; + align-items: center; + justify-content: space-between; + .name { + font-size: 36rpx; + color: rgba(33, 29, 46, 1); + font-weight: bold; + .edc { + margin-left: 16rpx; + display: inline-block; + padding: 0 8rpx; + font-size: 24rpx; + color: rgba(255, 255, 255, 1); + border-radius: 4rpx; + font-weight: normal; + background-color: rgba(185, 130, 255, 1); + } + } + } + .replay-date { + margin-top: 16rpx; + font-size: 28rpx; + color: #9aa1a2; + } + } + + .send { + padding: 8rpx 22rpx; + font-size: 24rpx; + color: rgba(185, 130, 255, 1); + line-height: 1; + border-radius: 32rpx 32rpx 32rpx 32rpx; + border: 2rpx solid rgba(185, 130, 255, 1); + display: flex; + align-items: center; + gap: 8rpx; + .icon { + width: 28rpx; + height: 28rpx; + } + } + } + } +} + +.popup { + padding: 92rpx 30rpx calc(30rpx + env(safe-area-inset-bottom)); + + .form { + max-height: 60vh; + overflow-y: auto; + overflow-x: hidden; + + .form-item { + margin-bottom: 48rpx; + + .f-title { + font-size: 36rpx; + color: rgba(40, 48, 49, 1); + font-weight: bold; + } + + .select { + margin-top: 24rpx; + display: grid; + grid-template-columns: repeat(3, 1fr); + gap: 16rpx; + + .s-item { + padding: 18rpx 0; + text-align: center; + border-radius: 12rpx; + font-size: 28rpx; + color: rgba(103, 113, 114, 1); + background: #f2f4f5; + + &.active { + color: #fff; + background-color: rgba(103, 186, 202, 1); + } + } + } + + .custom { + margin-top: 16rpx; + display: flex; + align-items: center; + gap: 12rpx; + + .c-item { + padding: 18rpx 24rpx; + display: flex; + align-items: center; + font-size: 32rpx; + color: rgba(103, 113, 114, 1); + border-radius: 12rpx; + background-color: rgba(242, 244, 245, 1); + + .input { + padding: 0; + margin: 0; + width: 3em; + font-size: 32rpx; + line-height: 1; + } + + .input-place { + color: rgba(194, 201, 202, 1); + line-height: 1; + } + } + } + + .date { + margin-top: 24rpx; + display: flex; + align-items: center; + justify-content: space-between; + + .picker { + flex: 1; + + .d-item { + flex: 1; + display: flex; + align-items: center; + justify-content: space-between; + padding: 18rpx 32rpx; + background: #f7f8f9; + border-radius: 12rpx 12rpx 12rpx 12rpx; + + .icon { + width: 32rpx; + height: 32rpx; + } + + .content { + font-size: 32rpx; + color: #677172; + + &:empty::after { + content: attr(data-place); + color: rgba(194, 201, 202, 1); + } + } + } + } + + .sion { + flex-shrink: 0; + margin: 0 14rpx; + font-size: 32rpx; + color: #677172; + } + } + } + } + + .p-footer { + margin-top: 32rpx; + display: flex; + justify-content: space-between; + align-items: center; + gap: 26rpx; + + .reset { + flex: 1; + height: 84rpx; + font-size: 36rpx; + color: rgba(103, 186, 202, 1); + display: flex; + justify-content: center; + align-items: center; + box-sizing: border-box; + background: #ffffff; + border-radius: 98rpx 98rpx 98rpx 98rpx; + border: 2rpx solid #67baca; + } + + .submit { + flex: 1; + height: 84rpx; + font-size: 36rpx; + color: #ffffff; + display: flex; + justify-content: center; + align-items: center; + box-sizing: border-box; + background: rgba(103, 186, 202, 1); + border-radius: 98rpx 98rpx 98rpx 98rpx; + } + } +} diff --git a/src/pages/d_patient/index.ts b/src/pages/d_patient/index.ts new file mode 100644 index 0000000..f5a9475 --- /dev/null +++ b/src/pages/d_patient/index.ts @@ -0,0 +1,212 @@ +import dayjs from 'dayjs' +const filterColumns = {} + +const app = getApp() + +Page({ + data: { + active: 0, + + list: [] as any[], + total: 0, + pagination: { + page: 1, + pages: 1, + count: 1, + }, + + // form + Search: '', + HasAdl: 0, + DoubleStandard: 0, + AdlTime: 0, + AdlScore: [] as any, + AdlScoreChange: [], + AdlScoreChangeType: 0, + AdlScoreChangeMax: '', + AdlScoreChangeMin: '', + SteroidDailyDose: [] as any, + SteroidDailyDoseChange: [] as any, + IsThisWeekAdl: 0, + PharyngealSymptoms: 0, + AntibodyType: 0, + ThyroidAbnormal: 0, + PreviousConvulsion: 0, + TraditionalImmunosuppressant: 0, + MedicalInsuranceType: 0, + BindStartDate: '', + BindEndDate: '', + + HasAdlIndex: 0, + HasAdlName: '全部', + DoubleStandardIndex: 0, + DoubleStandardName: '全部', + AdlTimeIndex: 0, + AdlTimeName: '全部', + + ...filterColumns, + }, + onLoad(options) { + this.setData({ + BindStartDate: options.BindStartDate || '', + BindEndDate: options.BindEndDate || '', + HasAdl: Number(options.HasAdl || ''), + DoubleStandard: Number(options.DoubleStandard || ''), + AdlScore: options.AdlScore ? options.AdlScore.split('-').map(Number) : [], + SteroidDailyDose: options.SteroidDailyDose ? options.SteroidDailyDose.split('-').map(Number) : [], + IsThisWeekAdl: Number(options.IsThisWeekAdl || ''), + }) + }, + onShow() { + app.waitLogin().then((_res) => { + app.zdMpBehavior({ doctor: true, PageName: 'PG_DOCTORPATIENTLIST' }) + this.getList() + }) + }, + handleReset() { + this.setData({ + Search: '', + HasAdl: 0, + HasAdlIndex: 0, + HasAdlName: '全部', + DoubleStandard: 0, + DoubleStandardIndex: 0, + DoubleStandardName: '全部', + AdlTime: 0, + AdlTimeName: '全部', + AdlScore: [], + AdlScoreChange: [], + AdlScoreChangeType: 0, + AdlScoreChangeMax: '', + AdlScoreChangeMin: '', + SteroidDailyDose: [], + SteroidDailyDoseChange: [], + IsThisWeekAdl: 0, + PharyngealSymptoms: 0, + AntibodyType: 0, + ThyroidAbnormal: 0, + PreviousConvulsion: 0, + TraditionalImmunosuppressant: 0, + MedicalInsuranceType: 0, + BindStartDate: '', + BindEndDate: '', + }) + this.getList() + }, + handleTapSearch() { + app.zdMpBehavior({ doctor: true, PageName: 'BTN_DOCTORPATIENTLISTSEARCH' }) + }, + handleNav(e) { + const { active } = e.currentTarget.dataset + this.setData({ + active, + }) + this.handleSearch() + }, + handleSearch() { + this.getList() + }, + getList(newPage = 1) { + const { active } = this.data + const params = { + search: this.data.Search, + } + const url = { + 0: '?r=zd/doctor/patient/get-my-list', + 1: '?r=zd/doctor/patient/get-my-list&IsEDC=1', + }[active] as string + wx.ajax({ + method: 'GET', + url, + data: { + page: newPage, + ...params, + }, + }).then((res) => { + res.list.forEach((item) => { + if (item.BecomePatientTime) { + item.BecomePatientTime = dayjs(item.BecomePatientTime).format('YYYY-MM-DD') + } + }) + const list = res.page === 1 ? res.list : [...this.data.list, ...res.list] + this.setData({ + total: res.count, + list, + pagination: { + page: res.page, + pages: res.pages, + count: res.count, + }, + }) + }) + }, + onReachBottom() { + const { page, pages } = this.data.pagination + if (pages > page) { + this.getList(page + 1) + } + }, + handlePickerChange(e: any) { + const { key } = e.currentTarget.dataset + const index = e.detail.value + const data = this.data[`${key}Column`] + + this.setData({ + [`${key}Index`]: index, + [`${key}Name`]: data[index].value, + [`${key}`]: data[index].id, + }) + this.handleSearch() + }, + handleRadio(e: any) { + const { key, index } = e.currentTarget.dataset + const data = this.data[`${key}Column`] + this.setData({ + [`${key}`]: data[index].id, + [`${key}Name`]: data[index].value, + [`${key}Index`]: index, + }) + }, + handleCheckbox(e: any) { + const { index, key } = e.currentTarget.dataset + const data = this.data[`${key}Column`] + const oldValue = this.data[`${key}`] + const value = oldValue.includes(data[index].id) + ? oldValue.filter((item: any) => item !== data[index].id) + : [...oldValue, data[index].id] + + this.setData({ + [`${key}`]: data[index].id ? value : [], + }) + }, + handleDetail(e: any) { + app.zdMpBehavior({ doctor: true, PageName: 'BTN_DOCTORPATIENTLISTVIEW' }) + const { index } = e.currentTarget.dataset + const item = this.data.list[index] + + wx.navigateTo({ + url: `/pages/d_patientDetail/index?id=${item.PatientId}`, + }) + }, + handleSend(e) { + const { index } = e.currentTarget.dataset + wx.navigateTo({ + url: `/pages/d_interactiveDoctor/index?patientId=${this.data.list[index].PatientId}`, + }) + }, + handleSendGroup() { + app.zdMpBehavior({ doctor: true, PageName: 'BTN_DOCTORPATIENTLISTMASSMESSAGE' }) + wx.navigateTo({ + url: '/pages/d_taskList/index', + }) + }, + onShareAppMessage() { + return { + title: '重症肌无力加油站,重拾生活掌控感!', + path: '/pages/d_patient/index', + } + }, + handleBack() { + wx.navigateBack() + }, +}) diff --git a/src/pages/d_patient/index.wxml b/src/pages/d_patient/index.wxml new file mode 100644 index 0000000..35fcd0e --- /dev/null +++ b/src/pages/d_patient/index.wxml @@ -0,0 +1,46 @@ + + + + + + + + + + + 我的患者 + {{unReadCount}} + + EDC患者 + + + + + + + + + + + {{item.Name}} + EDC患者 + + + 入组时间:{{item.BecomePatientTime}} + + 消息 + + + + + + diff --git a/src/pages/d_patient/index.wxs b/src/pages/d_patient/index.wxs new file mode 100644 index 0000000..fe90f39 --- /dev/null +++ b/src/pages/d_patient/index.wxs @@ -0,0 +1,12 @@ +function include(value, arr) { + for (var i = 0; i < arr.length; i++) { + if (arr[i] === value) { + return true + } + } + return false +} + +module.exports = { + include: include, +} diff --git a/src/pages/d_patientDetail/index.json b/src/pages/d_patientDetail/index.json index 466dd2c..0e09395 100644 --- a/src/pages/d_patientDetail/index.json +++ b/src/pages/d_patientDetail/index.json @@ -1,10 +1,9 @@ { "navigationStyle": "custom", "usingComponents": { - "zd-navBar": "/components/zd-navBar/navBar", + "navbar": "/components/navbar/index", "van-icon": "@vant/weapp/icon/index", "van-popup": "@vant/weapp/popup/index", - "ec-canvas": "/components/ec-canvas/ec-canvas", - "toast": "/components/toast/index" + "ec-canvas": "/components/ec-canvas/ec-canvas" } } diff --git a/src/pages/d_patientDetail/index.scss b/src/pages/d_patientDetail/index.scss index 655a40b..83e6554 100644 --- a/src/pages/d_patientDetail/index.scss +++ b/src/pages/d_patientDetail/index.scss @@ -1,15 +1,16 @@ page { - background-color: rgba(242, 244, 245, 1); - padding-bottom: calc(140rpx + env(safe-area-inset-bottom)); + background-color: rgba(246, 248, 249, 1); } .page { width: 100vw; overflow-x: hidden; min-height: 100vh; .banner { - margin: 40rpx 30rpx 32rpx; - padding: 36rpx 20rpx; - background: #ffffff; + margin: 40rpx 30rpx 0; + padding: 0 20rpx; + background: linear-gradient(53deg, #ffffff 0%, rgba(255, 255, 255, 0.46) 100%); + border-radius: 24rpx 24rpx 24rpx 24rpx; + border: 2rpx solid #ffffff; border-radius: 24rpx 24rpx 24rpx 24rpx; position: relative; .watermark { @@ -26,55 +27,74 @@ page { } } .banner-container { - .user { - display: flex; - .avatar { - .avatar-img { - width: 100rpx; - height: 100rpx; - border-radius: 50%; + position: relative; + z-index: 3; + padding: 120rpx 0 38rpx; + .avatar { + position: absolute; + left: 50%; + top: 0; + transform: translate(-50%, -50%); + .avatar-img { + width: 174rpx; + height: 174rpx; + border-radius: 50%; + } + .icon { + position: absolute; + bottom: 0; + right: 0; + width: 40rpx; + height: 40rpx; + } + } + .w-header { + text-align: center; + .name { + font-size: 48rpx; + color: rgba(33, 29, 46, 1); + font-weight: bold; + .age { + display: inline; + color: rgba(173, 172, 178, 1); + font-weight: normal; + .sub { + font-size: 28rpx; + } } } + .tel { + margin-top: 28rpx; + font-size: 28rpx; + color: rgba(33, 29, 46, 1); + display: flex; + align-items: center; + justify-content: center; + .tel-icon { + margin-left: 10rpx; + width: 40rpx; + height: 40rpx; + } + } + .date { + margin-top: 28rpx; + font-size: 28rpx; + color: rgba(105, 104, 110, 1); + } + .send { + margin-left: 32rpx; + width: 92rpx; + height: 32rpx; + font-size: 22rpx; + color: rgba(103, 186, 202, 1); + text-align: center; + border: 1px solid #67baca; + border-radius: 58rpx 58rpx 58rpx 58rpx; + } + } + .user { .wrap { padding-left: 20rpx; - .w-header { - display: flex; - align-items: center; - flex-wrap: wrap; - gap: 8rpx; - .name { - font-size: 32rpx; - color: rgba(40, 48, 49, 1); - font-weight: bold; - } - .icon { - width: 32rpx; - height: 32rpx; - } - .tel { - position: relative; - z-index: 3; - font-size: 32rpx; - color: rgba(154, 161, 162, 1); - display: flex; - align-items: center; - .tel-icon { - margin-left: 10rpx; - width: 32rpx; - height: 32rpx; - } - } - .send { - margin-left: 32rpx; - width: 92rpx; - height: 32rpx; - font-size: 22rpx; - color: rgba(103, 186, 202, 1); - text-align: center; - border: 1px solid #67baca; - border-radius: 58rpx 58rpx 58rpx 58rpx; - } - } .w-tags { margin-top: 28rpx; display: flex; @@ -307,463 +327,66 @@ page { } } } - - .chart-container { - margin: 30rpx; - padding: 30rpx; - border-radius: 24rpx; - background-color: #fff; - position: relative; - .watermark { - position: absolute; - top: 80rpx; - z-index: 2; - font-size: 36rpx; - line-height: 58rpx; - color: rgba(0, 0, 0, 0.05); - transform: rotate(-12deg); - text-align: center; - .p { - max-width: 90vw; - white-space: wrap; - } - } - .container { - .c-nav { - position: relative; - z-index: 3; - display: flex; - padding: 8rpx; - border-radius: 98rpx; - background-color: #f2f4f5; - .nav-item { - flex: 1; - padding: 12rpx; - font-size: 32rpx; - color: #677172; - text-align: center; - &.active { - color: #fff; - border-radius: 62rpx; - background-color: #62bed0; - } - } - } - .filter { - position: relative; - z-index: 3; - margin-top: 32rpx; - display: flex; - gap: 16rpx; - align-items: center; - border-radius: 80rpx 80rpx 80rpx 80rpx; - .type { - padding: 10rpx 32rpx; - display: flex; - align-items: center; - justify-content: center; - font-size: 28rpx; - color: rgba(103, 113, 114, 1); - background-color: rgba(242, 244, 245, 1); - border-radius: 34rpx; - .icon { - width: 24rpx; - height: 24rpx; - } - } - .range { - padding: 10rpx 32rpx; - display: flex; - align-items: center; - font-size: 28rpx; - color: rgba(103, 113, 114, 1); - border-radius: 34rpx; - background-color: rgba(242, 244, 245, 1); - .icon { - width: 24rpx; - height: 24rpx; - } - } + .info-card { + margin: 24rpx 30rpx 0; + padding: 0 32rpx; + background: linear-gradient(53deg, #ffffff 0%, rgba(255, 255, 255, 0.87) 100%); + border-radius: 24rpx 24rpx 24rpx 24rpx; + border: 2rpx solid #ffffff; + .row { + padding: 32rpx; + display: flex; + border-bottom: 1px solid rgba(173, 172, 178, 0.1); + &:last-of-type { + border: none; } - .card { - margin: 32rpx 0 0; - padding: 20rpx; - background: #ffffff; - box-shadow: 0rpx 8rpx 32rpx 0rpx rgba(40, 48, 49, 0.04); - border-radius: 24rpx 24rpx 24rpx 24rpx; - border: 2rpx solid #f8f9f9; - .pie { - height: 376rpx; - } - .line { - border-top: 1px dashed rgba(242, 244, 245, 1); - } - .w-header { - padding-top: 32rpx; - display: flex; - justify-content: space-between; - .title { - font-size: 32rpx; - color: #484848; - } - .legend { - display: flex; - align-items: center; - gap: 25rpx; - .item { - font-size: 20rpx; - color: #4f4f4f; - display: flex; - align-items: center; - .logo { - margin-right: 8rpx; - width: 16rpx; - height: 16rpx; - border-radius: 50%; - background-color: #cf5375; - &.hormone { - background-color: #3192a1; - } - } - .icon { - margin-right: 8rpx; - width: 17rpx; - height: 24rpx; - } - } - } - } - .column { - height: 400rpx; - } + .label { + width: 11em; + font-size: 32rpx; + color: rgba(173, 172, 178, 1); } - .module { - margin-top: 30rpx; - .module-header { - display: flex; - .date { - flex-shrink: 0; - font-size: 24rpx; - color: #333333; - } - .tags { - margin-left: 14rpx; - flex: 1; - display: flex; - flex-wrap: nowrap; - overflow-x: scroll; - white-space: nowrap; - &::-webkit-scrollbar { - display: none; - } - .tag1 { - margin-left: 14rpx; - padding: 0 12rpx; - background: #d86687; - border-radius: 6rpx; - font-size: 24rpx; - line-height: 36rpx; - text-align: center; - color: #ffffff; - } - .tag2 { - margin-left: 14rpx; - padding: 0 12rpx; - background: #0b184f; - border-radius: 6rpx; - font-size: 24rpx; - line-height: 36rpx; - text-align: center; - color: #ffffff; - } - .tag3 { - margin-left: 14rpx; - padding: 0 12rpx; - background: #24d8c8; - border-radius: 6rpx; - font-size: 24rpx; - line-height: 36rpx; - text-align: center; - color: #ffffff; - } - } - } - .module-container { - margin-top: 24rpx; - display: flex; - .aside { - margin-right: 30rpx; - padding-left: 14rpx; - border-right: 1px dashed #dddddd; - } - .m-card { - flex: 1; - box-shadow: 0 4rpx 29rpx 0rpx rgba(207, 83, 116, 0.25); - border-radius: 24rpx; - .card-header { - padding: 20rpx 18rpx 4rpx 48rpx; - border-radius: 24rpx 24rpx 0 0; - display: flex; - align-items: center; - justify-content: space-between; - box-shadow: 8rpx 8rpx 16rpx 0rpx rgba(143, 217, 226, 0.1); - &.grade1 { - background: linear-gradient(90deg, #26dac9 7%, rgba(143, 217, 226, 0) 70%, rgba(143, 217, 226, 0) 100%); - } - &.grade2 { - background: linear-gradient( - 90deg, - rgba(235, 111, 87, 1) 7%, - rgba(143, 217, 226, 0) 70%, - rgba(143, 217, 226, 0) 100% - ); - } - &.grade3 { - background: linear-gradient( - 90deg, - rgba(207, 83, 117, 1) 7%, - rgba(143, 217, 226, 0) 70%, - rgba(143, 217, 226, 0) 100% - ); - } - .num { - display: flex; - align-items: baseline; - font-size: 96rpx; - line-height: 1; - color: #ffffff; - letter-spacing: 4rpx; - .sub { - font-size: 24rpx; - color: #fff; - } - } - .num-detail { - display: flex; - .n-item { - width: 73rpx; - &.active { - .box { - background-color: #cf5375; - } - } - .box { - width: 45rpx; - height: 45rpx; - width: 45rpx; - height: 45rpx; - font-size: 32rpx; - color: #fff; - text-align: center; - line-height: 45rpx; - background: #333333; - border-radius: 12rpx 12rpx 12rpx 12rpx; - } - .name { - font-size: 24rpx; - line-height: 48rpx; - color: rgba(51, 51, 51, 0.5); - } - } - } - .status { - font-size: 24rpx; - color: #989898; - text-align: right; - .s-num { - font-size: 32rpx; - } - .s-core { - font-size: 24rpx; - color: #989898; - // background: #484848; - border-radius: 6rpx; - } - } - } - .card-container { - padding: 8rpx 23rpx 20rpx; - border-radius: 0 0 24rpx 24rpx; - background-color: #fff; - .cc-title { - text-indent: 22rpx; - font-size: 24rpx; - color: rgba(79, 79, 79, 1); - } - .cc-content { - margin-top: 12rpx; - padding: 16rpx 20rpx; - border-radius: 24rpx; - background-color: rgba(249, 249, 249, 1); - .line { - font-size: 24rpx; - color: #666666; - line-height: 36rpx; - .dot { - color: #666666; - font-weight: bold; - } - .red { - color: #cf5375; - } - .green { - color: #25d9c8; - } - } - } - .fold { - margin-top: 16rpx; - .fold-header { - display: flex; - justify-content: flex-end; - font-size: 24rpx; - color: rgba(204, 204, 204, 1); - } - .fold-container { - padding-top: 10rpx; - height: 500rpx; - overflow: hidden; - transition: all 0.5s; - &.hide { - padding: 0; - height: 0; - } - .fold-img { - width: 100%; - } - .scurt { - width: 100%; - border: 1px solid rgba(0, 0, 0, 0.1); - box-sizing: border-box; - .s-header { - display: flex; - height: 40rpx; - margin-bottom: -1px; - border-bottom: 1rpx solid rgba(0, 0, 0, 0.1); - .none { - flex-shrink: 0; - width: 226rpx; - background-color: rgba(228, 228, 228, 1); - } - .bar { - flex: 1; - display: flex; - .num { - flex: 1; - text-align: center; - font-size: 24rpx; - color: #fff; - line-height: 40rpx; - } - } - } - .s-body { - display: flex; - .s-aside { - width: 28rpx; - background-color: rgba(102, 102, 102, 0.15); - flex-shrink: 0; - .sa-item { - display: flex; - text-align: center; - justify-content: center; - align-items: center; - font-size: 18rpx; - color: rgba(102, 102, 102, 1); - line-height: 1; - overflow: hidden; - &:not(:last-of-type) { - margin-bottom: -1px; - border-bottom: 1px solid rgba(0, 0, 0, 0.1); - } - } - .sa-item1 { - height: 158rpx; - } - .sa-item2 { - height: 54rpx; - } - .sa-item3 { - height: 106rpx; - } - .sa-item4 { - height: 108rpx; - } - } - .s-container { - flex: 1; - .sc-row { - display: flex; - height: 54rpx; - overflow: hidden; - .sc-title { - width: 198rpx; - font-size: 18rpx; - color: rgba(102, 102, 102, 1); - text-align: center; - line-height: 53rpx; - } - .sc-col { - margin-left: -1px; - border-left: 1px solid rgba(0, 0, 0, 0.1); - flex: 1; - text-align: center; - .icon { - margin-top: 11rpx; - width: 32rpx; - height: 32rpx; - } - } - } - .sc-row:not(:last-of-type) { - margin-bottom: -1px; - border-bottom: 1px solid rgba(0, 0, 0, 0.1); - } - .sc-row:nth-of-type(2n-1) { - background-color: rgba(217, 217, 217, 0.2); - } - } - } - } - } - } - } - } - .drug-card { - margin-top: 30rpx; - flex: 1; - box-shadow: 0 4rpx 29rpx 0rpx rgba(207, 83, 116, 0.25); - border-radius: 24rpx; - .d-header { - border-radius: 24rpx 0 0 0; - padding: 20rpx 50rpx; - display: flex; - align-items: center; - justify-content: space-between; - background: linear-gradient(95deg, #26dac9 7%, rgba(143, 217, 226, 0) 100%); - .name { - font-size: 28rpx; - color: #ffffff; - } - .status { - font-size: 22rpx; - color: #5b6363; - .num { - font-size: 22rpx; - color: #cf5375; - } - } - } - .content { - padding: 20rpx 50rpx; - font-size: 22rpx; - color: #666666; - } - } - } + .content { + font-size: 32rpx; + color: rgba(33, 29, 46, 1); } } } + .edc-card { + margin: 24rpx 30rpx 0; + padding: 30rpx 32rpx; + display: flex; + align-items: center; + gap: 24rpx; + background-color: #fff; + border-radius: 24rpx; + .icon { + width: 48rpx; + height: 48rpx; + } + .content { + font-size: 32rpx; + color: rgba(33, 29, 46, 1); + font-weight: bold; + } + } + .footer { + margin: 60rpx 30rpx 0; + display: flex; + align-items: center; + gap: 26rpx; + .btn { + flex: 1; + height: 88rpx; + background: #ffffff; + font-size: 32rpx; + color: rgba(185, 130, 255, 1); + display: flex; + align-items: center; + justify-content: center; + border-radius: 48rpx 48rpx 48rpx 48rpx; + border: 2rpx solid #b982ff; + } + } } .popup-remark { @@ -882,3 +505,5 @@ page { } } } + + diff --git a/src/pages/d_patientDetail/index.ts b/src/pages/d_patientDetail/index.ts index 30a6ffc..e4994b8 100644 --- a/src/pages/d_patientDetail/index.ts +++ b/src/pages/d_patientDetail/index.ts @@ -1,14 +1,9 @@ -import dayjs from 'dayjs'; +import dayjs from 'dayjs' -const app = getApp(); +const app = getApp() -let echarts: any = null; Page({ data: { - toastShow: false, - toastType: 'patientDetailSafeDoctor', - toastParams: {} as any, - showTel: false, doctor: {}, @@ -166,26 +161,16 @@ Page({ count: 1, }, }, - ecDataTrendComponent1: null as any, - ecDataTrendComponent2: null as any, - ecDataTrendComponent3: null as any, - ecDataTrendComponent4: null as any, async onLoad(option) { this.setData({ id: option.id, - }); - echarts = await require.async('../../gift/compontnts/echart/echarts.js'); - this.ecDataTrendComponent1 = this.selectComponent('#chart1'); - this.ecDataTrendComponent2 = this.selectComponent('#chart2'); - this.ecDataTrendComponent3 = this.selectComponent('#chart3'); - this.ecDataTrendComponent4 = this.selectComponent('#chart4'); + }) app.waitLogin({ type: [2] }).then(async (_res) => { - app.zdMpBehavior({ doctor: true, PageName: 'PG_DOCTORPATIENTDETAIL' }); - this.getDoctorDetail(); - await this.getDetail(); - this.handleNav({ currentTarget: { dataset: { index: '0' } } }, false); - }); + app.zdMpBehavior({ doctor: true, PageName: 'PG_DOCTORPATIENTDETAIL' }) + this.getDoctorDetail() + await this.getDetail() + }) }, getDoctorDetail() { wx.ajax({ @@ -196,14 +181,8 @@ Page({ this.setData({ doctor: res.doctor, hospital: res.hospital, - toastShow: true, - toastType: 'patientDetailSafeDoctor', - toastParams: { - Name: res.doctor.Name, - HospitalName: res.hospital.Name, - }, - }); - }); + }) + }) }, getDetail() { return wx @@ -214,57 +193,57 @@ Page({ }) .then((res) => { if (res.LastAdlTime) { - res.LastAdlTimeName = dayjs(res.LastAdlTime).from(dayjs().format('YYYY-MM-DD')).replace(' ', ''); + res.LastAdlTimeName = dayjs(res.LastAdlTime).from(dayjs().format('YYYY-MM-DD')).replace(' ', '') } if (res.LastUseDrugsTime) { res.LastUseDrugsTimeName = dayjs().format('YYYY-MM-DD') === res.LastUseDrugsTime ? '' - : dayjs(res.LastUseDrugsTime).from(dayjs().format('YYYY-MM-DD')).replace(' ', ''); + : dayjs(res.LastUseDrugsTime).from(dayjs().format('YYYY-MM-DD')).replace(' ', '') } this.setData({ detail: { ...res, hideName: res.Name.replace(/^(.)(.*)$/, (_, first, rest) => first + '*'.repeat(rest.length)), }, - }); - }); + }) + }) }, handleTypeChange(e) { - const index = e.detail.value; - const { typeRange, nav } = this.data; - const type = typeRange[index].id; - const typeName = typeRange[index].value; - let EndDate = ''; - let StartDate = ''; + const index = e.detail.value + const { typeRange, nav } = this.data + const type = typeRange[index].id + const typeName = typeRange[index].value + let EndDate = '' + let StartDate = '' if (type === '1') { - EndDate = dayjs().format('YYYY-MM-DD'); - StartDate = dayjs().subtract(6, 'd').format('YYYY-MM-DD'); + EndDate = dayjs().format('YYYY-MM-DD') + StartDate = dayjs().subtract(6, 'd').format('YYYY-MM-DD') } else if (type === '2') { - EndDate = dayjs().format('YYYY-MM'); - StartDate = dayjs().subtract(1, 'M').format('YYYY-MM'); + EndDate = dayjs().format('YYYY-MM') + StartDate = dayjs().subtract(1, 'M').format('YYYY-MM') } else if (type === '3') { - EndDate = dayjs().format('YYYY'); - StartDate = dayjs().subtract(1, 'y').format('YYYY'); + EndDate = dayjs().format('YYYY') + StartDate = dayjs().subtract(1, 'y').format('YYYY') } this.setData({ type, typeName, EndDate, StartDate, - }); + }) if (nav === '0') { - this.getGraph(); + this.getGraph() } else { - this.getAdlList(); + this.getAdlList() } }, handleChange() { - const { nav } = this.data; + const { nav } = this.data if (nav === '0') { - this.getGraph(); + this.getGraph() } else { - this.getAdlList(); + this.getAdlList() } }, getGraph() { @@ -279,50 +258,50 @@ Page({ count: 0, }, }).then(async (res) => { - this.initChart1(res.adlSummary); - this.initChart2(res.adlSummary); + this.initChart1(res.adlSummary) + this.initChart2(res.adlSummary) const medication = res.medication.map((item) => { return { Date: item.InjectionDate, ...item, - }; - }); - const list = res.list; - const newList: any[] = this.mergeArr(list, medication); - const chart3 = await this.initChart3(newList as never[]); - const chart4 = await this.initChart4(newList as never[]); - echarts.connect([chart3, chart4]); - }); + } + }) + const list = res.list + const newList: any[] = this.mergeArr(list, medication) + const chart3 = await this.initChart3(newList as never[]) + const chart4 = await this.initChart4(newList as never[]) + echarts.connect([chart3, chart4]) + }) }, mergeArr(array1: any[] = [], array2: any[] = []) { // 合并两个数组中相同Date字段的对象 - const mergedArray: any[] = []; - const mergedMap = new Map(); + const mergedArray: any[] = [] + const mergedMap = new Map() array1.concat(array2).forEach((obj) => { - const date = obj.Date; + const date = obj.Date if (mergedMap.has(date)) { - mergedMap.get(date).push(obj); + mergedMap.get(date).push(obj) } else { - mergedMap.set(date, [obj]); + mergedMap.set(date, [obj]) } - }); + }) mergedMap.forEach((objs: any) => { if (objs.length === 1) { - mergedArray.push(objs[0]); + mergedArray.push(objs[0]) } else { - const mergedObj = objs.reduce((acc, cur) => ({ ...acc, ...cur })); - mergedArray.push(mergedObj); + const mergedObj = objs.reduce((acc, cur) => ({ ...acc, ...cur })) + mergedArray.push(mergedObj) } - }); + }) // 按照Date字段对合并后的数组进行排序 mergedArray.sort((a, b) => { - return a.Date.localeCompare(b.Date); - }); - return mergedArray; + return a.Date.localeCompare(b.Date) + }) + return mergedArray }, initChart1(adlSummary = {}) { this.ecDataTrendComponent1.init((canvas, width, height, dpr) => { @@ -330,8 +309,8 @@ Page({ width, height, devicePixelRatio: dpr, // new - }); - canvas.setChart(chart); + }) + canvas.setChart(chart) const option = { tooltip: { @@ -369,13 +348,13 @@ Page({ maxSurfaceAngle: 80, }, labelLayout(params) { - const isLeft = params.labelRect.x < chart.getWidth() / 2; - const points = params.labelLinePoints; + const isLeft = params.labelRect.x < chart.getWidth() / 2 + const points = params.labelLinePoints // Update the end point. - points[2][0] = isLeft ? params.labelRect.x : params.labelRect.x + params.labelRect.width; + points[2][0] = isLeft ? params.labelRect.x : params.labelRect.x + params.labelRect.width return { labelLinePoints: points, - }; + } }, data: [ { value: adlSummary.adlNearNum, name: 'ADL接近达标' }, @@ -391,11 +370,11 @@ Page({ }, }, ], - }; + } - chart.setOption(option); - return chart; - }); + chart.setOption(option) + return chart + }) }, initChart2(adlSummary = {}) { this.ecDataTrendComponent2.init((canvas, width, height, dpr) => { @@ -403,8 +382,8 @@ Page({ width, height, devicePixelRatio: dpr, // new - }); - canvas.setChart(chart); + }) + canvas.setChart(chart) const option = { tooltip: { @@ -442,13 +421,13 @@ Page({ maxSurfaceAngle: 80, }, labelLayout(params) { - const isLeft = params.labelRect.x < chart.getWidth() / 2; - const points = params.labelLinePoints; + const isLeft = params.labelRect.x < chart.getWidth() / 2 + const points = params.labelLinePoints // Update the end point. - points[2][0] = isLeft ? params.labelRect.x : params.labelRect.x + params.labelRect.width; + points[2][0] = isLeft ? params.labelRect.x : params.labelRect.x + params.labelRect.width return { labelLinePoints: points, - }; + } }, data: [ { value: adlSummary.SteroidDailyDoseUnStandardNum, name: '激素未达标' }, @@ -463,24 +442,24 @@ Page({ }, }, ], - }; + } - chart.setOption(option); - return chart; - }); + chart.setOption(option) + return chart + }) }, initChart3(defaultList = []) { - const { userInfo } = this.data; - const list: any = defaultList; + const { userInfo } = this.data + const list: any = defaultList return new Promise((reslove) => { this.ecDataTrendComponent3.init((canvas, width, height, dpr) => { const chart = echarts.init(canvas, null, { width, height, devicePixelRatio: dpr, // new - }); - canvas.setChart(chart); + }) + canvas.setChart(chart) const option: any = { tooltip: { @@ -528,7 +507,7 @@ Page({ data: list.map((item) => dayjs(item.Date).format('MM-DD')), axisLabel: { formatter() { - return ''; + return '' }, }, }, @@ -601,7 +580,7 @@ Page({ endValue: list.length - 1, filterMode: 'none', }, - }; + } if (this.data.detail.UserType === 4) { const markLineData = list @@ -623,8 +602,8 @@ Page({ color: '#25D9C8', offset: [60, 0], }, - }; - }); + } + }) option.series.push({ name: '用药', data: list.map((item) => (item.InjectionBottles ? 0 : null)), @@ -647,7 +626,7 @@ Page({ symbol: ['none', 'none'], data: markLineData, }, - }); + }) // option.series.push({ // name: "用药时间", // data: list.map((item: any) => (item.InjectionBottles ? item.TotalScore : 0)), @@ -669,23 +648,23 @@ Page({ // }); } - chart.setOption(option); - reslove(chart); - return chart; - }); - }); + chart.setOption(option) + reslove(chart) + return chart + }) + }) }, initChart4(defaultList = []) { - const { userInfo } = this.data; - const list: any = defaultList; + const { userInfo } = this.data + const list: any = defaultList return new Promise((reslove) => { this.ecDataTrendComponent4.init((canvas, width, height, dpr) => { const chart = echarts.init(canvas, null, { width, height, devicePixelRatio: dpr, // new - }); - canvas.setChart(chart); + }) + canvas.setChart(chart) const option: any = { tooltip: { @@ -738,12 +717,12 @@ Page({ type: 'value', minInterval: 1, max(value) { - return value.max + 20 > 999 ? 999 : value.max + 20; + return value.max + 20 > 999 ? 999 : value.max + 20 }, axisLabel: { // width: 20, formatter(value: number) { - return value; + return value }, }, }, @@ -765,7 +744,7 @@ Page({ color: '#18474e', z: 11, formatter({ value }) { - return `${value}mg`; + return `${value}mg` }, }, itemStyle: { @@ -829,7 +808,7 @@ Page({ endValue: list.length - 1, filterMode: 'none', }, - }; + } if (this.data.detail.UserType === 4) { const markLineData = list .filter((item) => item.InjectionBottles) @@ -849,9 +828,9 @@ Page({ color: '#25D9C8', offset: [60, 0], }, - }; - }); - const maxValue = Math.max(...list.map((item) => item.SteroidDailyDose)); + } + }) + const maxValue = Math.max(...list.map((item) => item.SteroidDailyDose)) option.series.push({ name: '用药', data: list.map((item) => (item.InjectionBottles ? 0 : null)), @@ -874,7 +853,7 @@ Page({ symbol: ['none', 'none'], data: markLineData, }, - }); + }) // option.series.push({ // name: "用药时间", // data: list.map((item: any) => (item.InjectionBottles ? item.TotalScore : 0)), @@ -896,37 +875,37 @@ Page({ // }); } - chart.setOption(option); - reslove(chart); - return chart; - }); - }); + chart.setOption(option) + reslove(chart) + return chart + }) + }) }, handleRemark() { - app.zdMpBehavior({ doctor: true, PageName: 'BTN_DOCTORPATIENTDETAILREMARK' }); + app.zdMpBehavior({ doctor: true, PageName: 'BTN_DOCTORPATIENTDETAILREMARK' }) this.setData({ popupRemarkShow: true, remark: this.data.detail.DoctorRemark, - }); + }) setTimeout(() => { this.setData({ remarkFocus: true, - }); - }, 300); + }) + }, 300) }, handleRemarkClose() { this.setData({ popupRemarkShow: false, remarkFocus: false, remark: '', - }); + }) }, handleRemarkSubmit() { if (!this.data.remark) { wx.showToast({ icon: 'none', title: '请输入备注', - }); + }) } wx.ajax({ method: 'POST', @@ -936,34 +915,34 @@ Page({ DoctorRemark: this.data.remark, }, }).then((_res) => { - this.handleRemarkClose(); - this.getDetail(); - }); + this.handleRemarkClose() + this.getDetail() + }) }, handleEditUser() { - app.zdMpBehavior({ doctor: true, PageName: 'BTN_DOCTORPATIENTDETAILEDIT' }); + app.zdMpBehavior({ doctor: true, PageName: 'BTN_DOCTORPATIENTDETAILEDIT' }) this.setData({ popupEditShow: true, - }); + }) }, handleUserCancel() { this.setData({ popupEditShow: false, - }); + }) }, handleUserSubmit() { - this.handleUserCancel(); - this.handlePatientUpdate(); + this.handleUserCancel() + this.handlePatientUpdate() }, handleRadio(e) { - const { id, key } = e.currentTarget.dataset; + const { id, key } = e.currentTarget.dataset this.setData({ [`detail.${key}`]: id, - }); + }) }, handlePatientUpdate() { - const { detail } = this.data; + const { detail } = this.data wx.ajax({ method: 'POST', url: '?r=zd/doctor/patient/update', @@ -979,35 +958,35 @@ Page({ wx.showToast({ icon: 'none', title: '更新成功', - }); - this.getDetail(); - }); + }) + this.getDetail() + }) }, handleBack() { - wx.navigateBack(); + wx.navigateBack() }, handleSend() { - app.zdMpBehavior({ doctor: true, PageName: 'BTN_DOCTORPATIENTDETAILMESSAGE' }); + app.zdMpBehavior({ doctor: true, PageName: 'BTN_DOCTORPATIENTDETAILMESSAGE' }) wx.navigateTo({ url: `/pages/d_interactiveDoctor/index?patientId=${this.data.detail.PatientId}`, - }); + }) }, handleNav(e, mp = true) { - const { index } = e.currentTarget.dataset; + const { index } = e.currentTarget.dataset if (index == 0 && mp) { - app.zdMpBehavior({ doctor: true, PageName: 'BTN_DOCTORPATIENTDETAILREPORTGUIDE' }); + app.zdMpBehavior({ doctor: true, PageName: 'BTN_DOCTORPATIENTDETAILREPORTGUIDE' }) } if (index == 1 && mp) { - app.zdMpBehavior({ doctor: true, PageName: 'BTN_DOCTORPATIENTDETAILNOTEGUIDE' }); + app.zdMpBehavior({ doctor: true, PageName: 'BTN_DOCTORPATIENTDETAILNOTEGUIDE' }) } this.setData({ nav: index, - }); - this.handleTypeChange({ detail: { value: '2' } }); + }) + this.handleTypeChange({ detail: { value: '2' } }) }, getAdlList(newPage = 1) { - const { detail, EndDate, StartDate, type } = this.data; + const { detail, EndDate, StartDate, type } = this.data wx.ajax({ method: 'GET', url: '?r=zd/doctor/patient/adl-list', @@ -1020,20 +999,20 @@ Page({ }, }).then((res) => { res.list.map((item) => { - let grade = 1; + let grade = 1 if (item.TotalScore < 5) { - grade = 1; + grade = 1 } else if (item.TotalScore >= 5 && item.TotalScore < 15) { - grade = 2; + grade = 2 } else { - grade = 3; + grade = 3 } - item.grade = grade; - item.fold = false; - return item; - }); + item.grade = grade + item.fold = false + return item + }) - const adlList = res.page === 1 ? res.list : [...this.data.adlList, ...res.list]; + const adlList = res.page === 1 ? res.list : [...this.data.adlList, ...res.list] this.setData({ adlList, pagination: { @@ -1041,35 +1020,46 @@ Page({ pages: res.pages, count: res.count, }, - }); - }); + }) + }) }, onReachBottom() { - const { page, pages } = this.data.pagination; - const nav = this.data.nav; + const { page, pages } = this.data.pagination + const nav = this.data.nav if (pages > page && nav === '1') { - this.getAdlList(page + 1); + this.getAdlList(page + 1) } }, handleFold(e) { - const { index } = e.currentTarget.dataset; + const { index } = e.currentTarget.dataset this.setData({ [`adlList[${index}].fold`]: !this.data.adlList[index].fold, - }); + }) }, handleAdlDetail() {}, handleToastOk() { this.setData({ toastShow: false, - }); + }) }, handleToastCancel() { - wx.navigateBack(); + wx.navigateBack() }, handleToggleTel() { - console.log(11111); + console.log(11111) this.setData({ showTel: !this.data.showTel, - }); + }) + }, + handleEDC() { + wx.ajax({ + method: 'POST', + url: '?r=zd/doctor/patient/set-edc', + data: { patientId: this.data.detail.PatientId }, + }).then((res) => { + this.setData({ + ['detail.IsEDC']: this.data.detail.IsEDC == 1 ? 2 : 1, + }) + }) }, -}); +}) diff --git a/src/pages/d_patientDetail/index.wxml b/src/pages/d_patientDetail/index.wxml index c770edf..d985e57 100644 --- a/src/pages/d_patientDetail/index.wxml +++ b/src/pages/d_patientDetail/index.wxml @@ -1,453 +1,61 @@ + + + + -