diff --git a/README.md b/README.md index 4b5e8d1..5d0a7de 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ showModel颜色统一 ```ts wx.showModal({ - confirmColor: '#00B4C5', + confirmColor: '#8c75d0', cancelColor: '#141515', }); ``` diff --git a/src/app.ts b/src/app.ts index d2d2a0a..26de277 100644 --- a/src/app.ts +++ b/src/app.ts @@ -99,15 +99,11 @@ App({ }); return false; } - - if (loginType !== type) { - const typePageUrl = { - 2: '/pages/index/index', - }[type as 2]; + if (loginType !== 2) { wx.reLaunch({ - url: typePageUrl, + url: '/pages/login/index', }); - return false; + return false } return true; diff --git a/src/components/popup/index.scss b/src/components/popup/index.scss index bc90913..9d47f6d 100644 --- a/src/components/popup/index.scss +++ b/src/components/popup/index.scss @@ -3,6 +3,7 @@ width: 630rpx; box-sizing: border-box; .container { + margin-top: -60rpx; padding: 32rpx; background: linear-gradient(180deg, #ebe4ff 0%, #ffffff 100%); border-radius: 24rpx; @@ -45,6 +46,7 @@ font-size: 28rpx; color: rgba(173, 172, 178, 1); .tag { + margin-left: 10rpx; display: inline-block; font-size: 24rpx; color: rgba(255, 255, 255, 1); diff --git a/src/components/popup/index.wxml b/src/components/popup/index.wxml index e0a2b1c..e2d14cc 100644 --- a/src/components/popup/index.wxml +++ b/src/components/popup/index.wxml @@ -17,16 +17,13 @@ - XX医生 + {{params.Name}}医生 - 北京天坛医院 - 三甲 + {{params.HospitalName}} + {{params.HospitalClassificationName}}{{params.HospitalLevel}} @@ -42,5 +39,10 @@ - + diff --git a/src/pages/home/index.ts b/src/pages/home/index.ts index 672baab..24b3444 100644 --- a/src/pages/home/index.ts +++ b/src/pages/home/index.ts @@ -5,10 +5,10 @@ const app = getApp(); Page({ data: { popupShow: false, - // popupType: 'popup1', // 绑定医生弹窗 + popupType: 'popup1', // 绑定医生弹窗 // popupType: 'popup2', // 去关注弹窗 // popupType: 'popup3', // 问题反馈弹窗 - popupType: 'popup4', // 登录失败弹窗 + // popupType: 'popup4', // 登录失败弹窗 popupParams: { close: true, } as any, @@ -34,9 +34,28 @@ Page({ this.setData({ userInfo, }); + this.getTab(); }); }); }, + getTab() { + wx.ajax({ + method: 'GET', + url: '?r=xd/doctor/index/is-welcome', + data: {}, + }).then((res) => { + if (res.IsWelcome === 1) { + this.setData({ + popupShow: true, + popupType: 'popup1', + popupParams: { + close: true, + ...this.data.userInfo, + }, + }); + } + }); + }, handleWebview() { const encodeUrl = encodeURIComponent('https://dct.meddb.cn'); wx.navigateTo({ @@ -119,11 +138,30 @@ Page({ url: `/pages/informationDetail/index?id=${id}`, }); }, + handleMore() { + wx.switchTab({ + url: '/pages/information/index', + }); + }, handlePopupOk() { const { popupType } = this.data; }, handlePopupCancel() { const { popupType } = this.data; + if (popupType === 'popup1') { + wx.ajax({ + method: 'POST', + url: '?r=xd/doctor/index/cancel-welcome', + data: {}, + }).then(() => { + this.setData({ + popupShow: false, + popupType: '', + popupParams: {}, + }); + }); + return; + } this.setData({ popupShow: false, }); diff --git a/src/pages/home/index.wxml b/src/pages/home/index.wxml index 74d5a57..456e9de 100644 --- a/src/pages/home/index.wxml +++ b/src/pages/home/index.wxml @@ -11,7 +11,7 @@ - {{userInfo.welcome}},{{userInfo.Name}} + {{userInfo.welcome}},{{userInfo.Name}}医生 {{userInfo.HospitalName}} {{userInfo.HospitalClassificationName}}{{userInfo.HospitalLevel}} @@ -48,7 +48,7 @@ - + 查看全部 diff --git a/src/pages/information/index.ts b/src/pages/information/index.ts index d6f57ac..8bef9a3 100644 --- a/src/pages/information/index.ts +++ b/src/pages/information/index.ts @@ -11,7 +11,7 @@ Page({ count: 1, }, }, - onLoad() { + onShow() { app.waitLogin({ type: 2 }).then(() => { this.getList(); }); diff --git a/src/pages/informationDetail/index.json b/src/pages/informationDetail/index.json index 0759c99..62f76bf 100644 --- a/src/pages/informationDetail/index.json +++ b/src/pages/informationDetail/index.json @@ -1,6 +1,6 @@ { "navigationStyle": "default", - "navigationBarTitleText": "资料库详情页", + "navigationBarTitleText": "资料详情页", "usingComponents": { "mp-html": "mp-html" } diff --git a/src/pages/informationDetail/index.scss b/src/pages/informationDetail/index.scss index 5172c27..d5f2d41 100644 --- a/src/pages/informationDetail/index.scss +++ b/src/pages/informationDetail/index.scss @@ -1,5 +1,5 @@ .page { - padding: 40rpx; + padding: 40rpx 40rpx 200rpx; .title { font-size: 40rpx; color: rgba(33, 29, 46, 1); @@ -72,7 +72,7 @@ position: fixed; bottom: 0px; left: 0; - padding: 18rpx 40rpx; + padding: 18rpx 40rpx calc(30rpx + env(safe-area-inset-bottom)); width: 100%; box-sizing: border-box; background-color: #fff; diff --git a/src/pages/informationDetail/index.ts b/src/pages/informationDetail/index.ts index 5db0af1..f949e41 100644 --- a/src/pages/informationDetail/index.ts +++ b/src/pages/informationDetail/index.ts @@ -52,13 +52,15 @@ Page({ title: '加载中', mask: true, }); - app.mpBehavior({ PositionId: '1', OperateType: '1', OperateId: detail.Id as string }); + app.mpBehavior({ PositionId: '1', OperateType: '2', OperateId: detail.Id as string }); wx.downloadFile({ url: detail.FileUrl, + filePath: `${wx.env.USER_DATA_PATH}/${detail.FileName}`, success: (res) => { if (res.statusCode === 200) { wx.openDocument({ - filePath: res.tempFilePath, + showMenu: true, + filePath: res.filePath, success: () => { wx.hideLoading(); }, @@ -78,7 +80,7 @@ Page({ }); } }, - fail() { + fail(err) { wx.hideLoading(); wx.showToast({ title: '下载文件失败', diff --git a/src/pages/informationDetail/index.wxml b/src/pages/informationDetail/index.wxml index e68a7ab..3b595da 100644 --- a/src/pages/informationDetail/index.wxml +++ b/src/pages/informationDetail/index.wxml @@ -8,7 +8,7 @@ - + {{detail.FileName}} {{detail.FileSizeName}} @@ -22,7 +22,7 @@ - {{detail.CreateWorkerName}} + TED规范化诊治中心 diff --git a/src/pages/login/index.ts b/src/pages/login/index.ts index 817e85b..ba79e97 100644 --- a/src/pages/login/index.ts +++ b/src/pages/login/index.ts @@ -90,9 +90,20 @@ Page({ mobile, code, }, - }).then((res) => { - this.submitCallback(res); - }); + showMsg: false, + }) + .then((res) => { + this.submitCallback(res); + }) + .catch(() => { + this.setData({ + popupShow: true, + popupType: 'popup4', + popupParams: { + close: true, + }, + }); + }); }, handleWxSubmit(e: WechatMiniprogram.CustomEvent) { const { iv, encryptedData } = e.detail; @@ -104,9 +115,20 @@ Page({ iv: encodeURIComponent(iv), encryptedData: encodeURIComponent(encryptedData), }, - }).then((res) => { - this.submitCallback(res); - }); + showMsg: false, + }) + .then((res) => { + this.submitCallback(res); + }) + .catch(() => { + this.setData({ + popupShow: true, + popupType: 'popup4', + popupParams: { + close: true, + }, + }); + }); } }, submitCallback(res) { @@ -137,6 +159,11 @@ Page({ url: '/doc/pages/doc1/index', }); }, + handlePopupCancel() { + this.setData({ + popupShow: false, + }); + }, }); export {}; diff --git a/src/pages/my/index.json b/src/pages/my/index.json index f76c897..100f6f6 100644 --- a/src/pages/my/index.json +++ b/src/pages/my/index.json @@ -1,6 +1,7 @@ { "navigationStyle": "custom", "usingComponents": { + "navbar": "/components/navbar/index", "popup": "/components/popup/index" } } diff --git a/src/pages/my/index.scss b/src/pages/my/index.scss index cd10f55..b1262e0 100644 --- a/src/pages/my/index.scss +++ b/src/pages/my/index.scss @@ -38,6 +38,8 @@ page { font-size: 28rpx; color: rgba(173, 172, 178, 1); .tag { + vertical-align: 0rpx; + margin-left: 10rpx; display: inline-block; font-size: 24rpx; color: rgba(255, 255, 255, 1); diff --git a/src/pages/my/index.ts b/src/pages/my/index.ts index 642ed90..59a3261 100644 --- a/src/pages/my/index.ts +++ b/src/pages/my/index.ts @@ -33,6 +33,7 @@ Page({ handleLoginOut() { wx.showModal({ title: '是否确认退出登录?', + confirmColor: '#8c75d0', success: (res) => { if (res.confirm) { wx.ajax({ diff --git a/src/pages/my/index.wxml b/src/pages/my/index.wxml index 6eacbbc..0e760b9 100644 --- a/src/pages/my/index.wxml +++ b/src/pages/my/index.wxml @@ -1,3 +1,5 @@ + +