Browse Source

复诊提醒上线

dev
kola-web 3 weeks ago
parent
commit
663e31b035
  1. 2
      project.config.json
  2. 17
      src/app.ts
  3. 2
      src/components/popup/index.wxml
  4. 2
      src/components/toast/index.wxml
  5. 2
      src/patient/pages/followForm/index.scss
  6. 5
      src/patient/pages/followForm/index.ts
  7. 4
      src/patient/pages/followForm/index.wxml
  8. 1
      src/patient/pages/index/index.scss
  9. 23
      src/patient/pages/index/index.ts
  10. 6
      src/patient/pages/index/index.wxml
  11. 37
      src/patient/pages/interactivePatient/index.ts
  12. 28
      src/patient/pages/my/index.ts
  13. 2
      src/patient/pages/my/index.wxml

2
project.config.json

@ -71,5 +71,5 @@
} }
] ]
}, },
"appid": "wxf9ce8010f1ad24aa" "appid": "wx71ac9c27c3c3e3f4"
} }

17
src/app.ts

@ -18,15 +18,15 @@ App<IAppOption>({
// 测试号 wx2b0bb13edf717c1d // 测试号 wx2b0bb13edf717c1d
// dev // dev
// appid:wxf9ce8010f1ad24aa // appid:wxf9ce8010f1ad24aa
url: 'https://m.xd.hbraas.com', // url: 'https://m.xd.hbraas.com',
upFileUrl: 'https://m.xd.hbraas.com/', // upFileUrl: 'https://m.xd.hbraas.com/',
imageUrl: 'https://m.xd.hbraas.com/xd/', // imageUrl: 'https://m.xd.hbraas.com/xd/',
// pro // pro
// appid:wx71ac9c27c3c3e3f4 // appid:wx71ac9c27c3c3e3f4
// url: 'https://m.xd.hbsaas.com', url: 'https://m.xd.hbsaas.com',
// upFileUrl: 'https://m.xd.hbsaas.com/', upFileUrl: 'https://m.xd.hbsaas.com/',
// imageUrl: 'https://m.xd.hbsaas.com/api/xd/', imageUrl: 'https://m.xd.hbsaas.com/api/xd/',
loginState: '', loginState: '',
isLogin: 0, isLogin: 0,
@ -125,13 +125,14 @@ App<IAppOption>({
this.handleUpdateMiniprogram() this.handleUpdateMiniprogram()
}, },
onShow(options) { onShow() {
const options = wx.getEnterOptionsSync()
if (options.query.scene) { if (options.query.scene) {
this.globalData.scene = parseScene(options.query.scene) this.globalData.scene = parseScene(options.query.scene)
} else if (options.query.proMethodId) { } else if (options.query.proMethodId) {
this.globalData.scene.proMethodId = options.query.proMethodId this.globalData.scene.proMethodId = options.query.proMethodId
} }
if (this.globalData.scene?.doctorId) { if (this.globalData.scene?.doctorId && options.query.scene) {
this.globalData.scanDoctor = true this.globalData.scanDoctor = true
} }
}, },

2
src/components/popup/index.wxml

@ -255,7 +255,7 @@
<image class="badge" src="{{imageUrl}}icon173.png?t={{Timestamp}}"></image> <image class="badge" src="{{imageUrl}}icon173.png?t={{Timestamp}}"></image>
<view class="popup-container"> <view class="popup-container">
<view class="title">档案已保存</view> <view class="title">档案已保存</view>
<view class="content">下次就医时可出示该卡给医生</view> <view class="content">下次就医时可出示给医生</view>
<view class="p-footer"> <view class="p-footer">
<view class="sure" bind:tap="handleOk">知道了</view> <view class="sure" bind:tap="handleOk">知道了</view>
</view> </view>

2
src/components/toast/index.wxml

@ -859,7 +859,7 @@
<view class="title"> <view class="title">
记录复诊信息 记录复诊信息
<view></view> <view></view>
持续更新健康情况 持续关注健康情况
</view> </view>
<view class="p-footer"> <view class="p-footer">
<view class="sure" bind:tap="handleOk">去记录</view> <view class="sure" bind:tap="handleOk">去记录</view>

2
src/patient/pages/followForm/index.scss

@ -13,6 +13,7 @@ page {
margin-left: -32rpx; margin-left: -32rpx;
font-size: 36rpx; font-size: 36rpx;
color: rgba(33, 29, 46, 1); color: rgba(33, 29, 46, 1);
font-weight: bold;
display: flex; display: flex;
align-items: center; align-items: center;
gap: 22rpx; gap: 22rpx;
@ -28,6 +29,7 @@ page {
text-align: right; text-align: right;
font-size: 28rpx; font-size: 28rpx;
color: rgba(185, 130, 255, 1); color: rgba(185, 130, 255, 1);
font-weight: normal;
} }
} }
.c-title1 { .c-title1 {

5
src/patient/pages/followForm/index.ts

@ -15,9 +15,11 @@ Page({
popupShow: false, popupShow: false,
popupType: 'popup19', popupType: 'popup19',
popupParams: {} as any, popupParams: {} as any,
today: '',
}, },
onLoad(options: any) { onLoad(options: any) {
this.setData({ today: this.formatDate(new Date()) })
app.waitLogin({ type: [1] }).then(() => { app.waitLogin({ type: [1] }).then(() => {
this.getEnum().then(() => { this.getEnum().then(() => {
if (options.id) { if (options.id) {
@ -206,7 +208,8 @@ Page({
const { popupType } = this.data const { popupType } = this.data
this.setData({ popupShow: false }) this.setData({ popupShow: false })
if (popupType === 'popup19') { if (popupType === 'popup19') {
this.handlePopupCancel() wx.redirectTo({ url: '/patient/pages/follow/index' })
this.setData({ popupShow: false })
} }
}, },

4
src/patient/pages/followForm/index.wxml

@ -1,7 +1,7 @@
<view class="page"> <view class="page">
<view class="card"> <view class="card">
<view class="c-title">您的复诊时间</view> <view class="c-title">您的复诊时间</view>
<picker mode="date" value="{{visitTime}}" bind:change="onVisitDateChange"> <picker mode="date" value="{{visitTime}}" end="{{today}}" bind:change="onVisitDateChange">
<view class="date {{visitTime ? 'active' : ''}}"> <view class="date {{visitTime ? 'active' : ''}}">
<view class="content">{{visitTime || '年 / 月 / 日'}}</view> <view class="content">{{visitTime || '年 / 月 / 日'}}</view>
<van-icon name="arrow-down" /> <van-icon name="arrow-down" />
@ -43,7 +43,7 @@
</view> </view>
</van-stepper> </van-stepper>
</view> </view>
<view class="tip">注:替妥尤单抗常规疗程共 8 次注射(每3周1次)</view> <view class="tip">替妥尤单抗常规疗程共 8 次注射(每21天1次)</view>
</view> </view>
<view class="card"> <view class="card">

1
src/patient/pages/index/index.scss

@ -111,6 +111,7 @@ page {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
gap: 22rpx;
.icon { .icon {
width: 92rpx; width: 92rpx;
height: 92rpx; height: 92rpx;

23
src/patient/pages/index/index.ts

@ -168,6 +168,7 @@ Page({
toastType: 'followGuide', toastType: 'followGuide',
toastParams: { close: true }, toastParams: { close: true },
}) })
return
} }
const noteGuideShown = wx.getStorageSync('noteGuideShown') const noteGuideShown = wx.getStorageSync('noteGuideShown')
@ -539,26 +540,20 @@ Page({
}) })
this.handleToastCancel(null, false) this.handleToastCancel(null, false)
} else if (toastType === 'followGuide') { } else if (toastType === 'followGuide') {
if (!toastParams.scanDoctor) { wx.ajax({
wx.ajax({ method: 'POST',
method: 'POST', url: '?r=zd/popup/add-record',
url: '?r=zd/popup/add-record', data: { type: 4 },
data: { type: 4 }, }).then(() => {
}).then(() => {
wx.navigateTo({
url: '/patient/pages/followForm/index',
})
})
} else {
wx.navigateTo({ wx.navigateTo({
url: '/patient/pages/followForm/index', url: '/patient/pages/followForm/index',
}) })
} })
this.handleToastCancel(null, false) this.handleToastCancel(null, false)
} }
}, },
handleToastCancel(_e = null, sure = true) { handleToastCancel(_e = null, sure = true) {
const { toastType, toastParams } = this.data const { toastType } = this.data
if (toastType === 'doubleStandards' && sure) { if (toastType === 'doubleStandards' && sure) {
wx.ajax({ wx.ajax({
method: 'POST', method: 'POST',
@ -587,7 +582,7 @@ Page({
url: '?r=zd/popup/close-need-popup', url: '?r=zd/popup/close-need-popup',
data: { type: 1 }, data: { type: 1 },
}) })
} else if (toastType === 'followGuide' && sure && !toastParams.scanDoctor) { } else if (toastType === 'followGuide' && sure) {
wx.ajax({ wx.ajax({
method: 'POST', method: 'POST',
url: '?r=zd/popup/add-record', url: '?r=zd/popup/add-record',

6
src/patient/pages/index/index.wxml

@ -35,12 +35,12 @@
</view> </view>
<image class="more" src="{{imageUrl}}icon118.png?t={{Timestamp}}"></image> <image class="more" src="{{imageUrl}}icon118.png?t={{Timestamp}}"></image>
</view> </view>
<view class="follow" wx:if="{{zdUserInfo.UserType>=3}}"> <view class="follow">
<view class="empty" wx:if="{{!followLatest}}" bind:tap="handleFollowEmpty"> <view class="empty" wx:if="{{!followLatest || zdUserInfo.UserType < 3}}" bind:tap="handleFollowEmpty">
<image class="icon" src="{{imageUrl}}icon170.png?t={{Timestamp}}"></image> <image class="icon" src="{{imageUrl}}icon170.png?t={{Timestamp}}"></image>
<view class="content">设置复诊提醒</view> <view class="content">设置复诊提醒</view>
</view> </view>
<view class="f-container" wx:if="{{followLatest}}" bind:tap="handleFollow"> <view class="f-container" wx:elif="{{followLatest}}" bind:tap="handleFollow">
<image <image
class="pos" class="pos"
wx:if="{{followLatest.remainingDays < 0}}" wx:if="{{followLatest.remainingDays < 0}}"

37
src/patient/pages/interactivePatient/index.ts

@ -81,6 +81,7 @@ Page({
zdUserInfo: {}, zdUserInfo: {},
customMessage: '', customMessage: '',
}, },
innerAudioContext: null as WechatMiniprogram.InnerAudioContext | null, innerAudioContext: null as WechatMiniprogram.InnerAudioContext | null,
onLoad(options) { onLoad(options) {
@ -149,8 +150,7 @@ Page({
}) })
}, },
getMessageList() { getMessageList() {
if (this.data.isLoad || this.data.isFinish) if (this.data.isLoad || this.data.isFinish) return
return
this.setData({ this.setData({
isLoad: true, isLoad: true,
}) })
@ -182,7 +182,7 @@ Page({
const missionReasonList = rawInfo.missionReasonList || {} const missionReasonList = rawInfo.missionReasonList || {}
const reasonList = rawInfo.reasonList || [] const reasonList = rawInfo.reasonList || []
// 将对象转换为数组 {key, label, isSelected} 格式 // 将对象转换为数组 {key, label, isSelected} 格式
item.ReVisitInfo = Object.keys(missionReasonList).map(key => ({ item.ReVisitInfo = Object.keys(missionReasonList).map((key) => ({
key, key,
label: missionReasonList[key], label: missionReasonList[key],
isSelected: reasonList.includes(key), isSelected: reasonList.includes(key),
@ -202,7 +202,7 @@ Page({
const reasonInfoList = rawInfo.reasonInfoList || {} const reasonInfoList = rawInfo.reasonInfoList || {}
item.followUpTitle = rawInfo.title || '没能按时复诊的主要原因是?' item.followUpTitle = rawInfo.title || '没能按时复诊的主要原因是?'
// 将 reasonInfoList 对象转换为数组 // 将 reasonInfoList 对象转换为数组
item.ReVisitInfo = Object.keys(reasonInfoList).map(key => reasonInfoList[key]) item.ReVisitInfo = Object.keys(reasonInfoList).map((key) => reasonInfoList[key])
} }
return item return item
@ -297,14 +297,11 @@ Page({
let msgCreateTimeName = '' let msgCreateTimeName = ''
if (dayjs().format('YYYY-MM-DD') === dayjs(date).format('YYYY-MM-DD')) { 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')) {
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) {
else if (dayjs().diff(date, 'day') < 7) {
msgCreateTimeName = dayjs(date).format(`dddd HH:mm`) msgCreateTimeName = dayjs(date).format(`dddd HH:mm`)
} } else {
else {
msgCreateTimeName = dayjs(date).format('YYYY-MM-DD HH:mm') msgCreateTimeName = dayjs(date).format('YYYY-MM-DD HH:mm')
} }
return msgCreateTimeName return msgCreateTimeName
@ -319,8 +316,7 @@ Page({
item.showTime = true item.showTime = true
preTime = dayjs(item.msgCreateTime).valueOf() preTime = dayjs(item.msgCreateTime).valueOf()
item.msgCreateTimeName = this.formatTime(item.msgCreateTime) item.msgCreateTimeName = this.formatTime(item.msgCreateTime)
} } else {
else {
const curTime = dayjs(item.msgCreateTime).valueOf() const curTime = dayjs(item.msgCreateTime).valueOf()
if (curTime - preTime > gapTime) { if (curTime - preTime > gapTime) {
item.showTime = true item.showTime = true
@ -348,7 +344,7 @@ Page({
}, },
handleRead() { handleRead() {
const { firstNotReadMsgId, messageList } = this.data const { firstNotReadMsgId, messageList } = this.data
const index = messageList.findIndex(item => `${item.msgId}` === `${firstNotReadMsgId}`) const index = messageList.findIndex((item) => `${item.msgId}` === `${firstNotReadMsgId}`)
this.handleView(index) this.handleView(index)
this.setData({ this.setData({
unReadCount: 0, unReadCount: 0,
@ -419,8 +415,7 @@ Page({
this.handleSendCustomMessage(customMessage) this.handleSendCustomMessage(customMessage)
}, },
handleSendCustomMessage(customMessage: string) { handleSendCustomMessage(customMessage: string) {
if (!customMessage) if (!customMessage) return
return
const { messageList } = this.data const { messageList } = this.data
wx.ajax({ wx.ajax({
method: 'POST', method: 'POST',
@ -541,8 +536,7 @@ Page({
const { messageList } = this.data const { messageList } = this.data
const message = messageList[mindex] const message = messageList[mindex]
if (Number(message.followUpStatus) > 0) if (Number(message.followUpStatus) > 0) return
return
wx.ajax({ wx.ajax({
method: 'POST', method: 'POST',
@ -570,8 +564,7 @@ Page({
const index = selectedReasons.indexOf(key) const index = selectedReasons.indexOf(key)
if (index > -1) { if (index > -1) {
selectedReasons.splice(index, 1) selectedReasons.splice(index, 1)
} } else {
else {
selectedReasons.push(key) selectedReasons.push(key)
} }
@ -640,9 +633,9 @@ Page({
method: 'POST', method: 'POST',
url: '?r=zd/message-interact/send-reply-followup-reason', url: '?r=zd/message-interact/send-reply-followup-reason',
data: { data: {
'msgId': message.msgId, msgId: message.msgId,
'reasonList[0]': 'other', 'reasonList[0]': 'other',
'otherReason': otherReason.trim(), otherReason: otherReason.trim(),
}, },
loading: true, loading: true,
}).then(() => { }).then(() => {
@ -663,7 +656,7 @@ Page({
}, },
handleResetFollowUp() { handleResetFollowUp() {
wx.navigateTo({ wx.navigateTo({
url: '/patient/pages/follow/index', url: '/patient/pages/followForm/index',
}) })
}, },
handleNextFollowUp() { handleNextFollowUp() {

28
src/patient/pages/my/index.ts

@ -15,6 +15,8 @@ Page({
adlNewRecord: {} as any, adlNewRecord: {} as any,
followLatest: null as any,
toastShow: false, toastShow: false,
toastType: '', toastType: '',
// toastType: 'guideEnterInfo', // toastType: 'guideEnterInfo',
@ -49,11 +51,11 @@ Page({
app.getZdUserInfo(this, true, () => {}) app.getZdUserInfo(this, true, () => {})
this.getScore() this.getScore()
this.getPopup() this.getPopup()
this.getFollowLatest()
}) })
}, },
async getPopup() { async getPopup() {
if (this.data.toastShow) if (this.data.toastShow) return
return
const data1 = await wx.ajax({ const data1 = await wx.ajax({
method: 'GET', method: 'GET',
@ -70,6 +72,25 @@ Page({
}) })
} }
}, },
getFollowLatest() {
wx.ajax({
method: 'GET',
url: '?r=xd/follow-up-reminder/latest',
data: {},
})
.then((res: any) => {
if (res && res.nextVisitTime) {
this.setData({
followLatest: true,
})
} else {
this.setData({ followLatest: null })
}
})
.catch(() => {
this.setData({ followLatest: null })
})
},
getScore() { getScore() {
wx.ajax({ wx.ajax({
method: 'GET', method: 'GET',
@ -171,8 +192,7 @@ Page({
}) })
this.handleToastCancel(null, false) this.handleToastCancel(null, false)
}) })
} } else if (toastType === 'guideEnterInfoJump') {
else if (toastType === 'guideEnterInfoJump') {
wx.navigateTo({ wx.navigateTo({
url: '/patient/pages/personalInformation/index', url: '/patient/pages/personalInformation/index',
}) })

2
src/patient/pages/my/index.wxml

@ -29,7 +29,7 @@
<image class="icon" src="{{imageUrl}}icon175.png?t={{Timestamp}}"></image> <image class="icon" src="{{imageUrl}}icon175.png?t={{Timestamp}}"></image>
健康档案 健康档案
</view> </view>
<view class="kkd-item" bind:tap="routerTo" data-url="/patient/pages/follow/index"> <view class="kkd-item" bind:tap="routerTo" data-url="{{followLatest ? '/patient/pages/follow/index' : '/patient/pages/followForm/index'}}">
<image class="icon" src="{{imageUrl}}icon176.png?t={{Timestamp}}"></image> <image class="icon" src="{{imageUrl}}icon176.png?t={{Timestamp}}"></image>
复诊记录 复诊记录
</view> </view>

Loading…
Cancel
Save