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 @@ @@ -71,5 +71,5 @@
}
]
},
"appid": "wxf9ce8010f1ad24aa"
"appid": "wx71ac9c27c3c3e3f4"
}

17
src/app.ts

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

2
src/components/popup/index.wxml

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

2
src/components/toast/index.wxml

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

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

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

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

@ -15,9 +15,11 @@ Page({ @@ -15,9 +15,11 @@ Page({
popupShow: false,
popupType: 'popup19',
popupParams: {} as any,
today: '',
},
onLoad(options: any) {
this.setData({ today: this.formatDate(new Date()) })
app.waitLogin({ type: [1] }).then(() => {
this.getEnum().then(() => {
if (options.id) {
@ -206,7 +208,8 @@ Page({ @@ -206,7 +208,8 @@ Page({
const { popupType } = this.data
this.setData({ popupShow: false })
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 @@ @@ -1,7 +1,7 @@
<view class="page">
<view class="card">
<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="content">{{visitTime || '年 / 月 / 日'}}</view>
<van-icon name="arrow-down" />
@ -43,7 +43,7 @@ @@ -43,7 +43,7 @@
</view>
</van-stepper>
</view>
<view class="tip">注:替妥尤单抗常规疗程共 8 次注射(每3周1次)</view>
<view class="tip">替妥尤单抗常规疗程共 8 次注射(每21天1次)</view>
</view>
<view class="card">

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

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

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

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

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

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

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

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

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

@ -15,6 +15,8 @@ Page({ @@ -15,6 +15,8 @@ Page({
adlNewRecord: {} as any,
followLatest: null as any,
toastShow: false,
toastType: '',
// toastType: 'guideEnterInfo',
@ -49,11 +51,11 @@ Page({ @@ -49,11 +51,11 @@ Page({
app.getZdUserInfo(this, true, () => {})
this.getScore()
this.getPopup()
this.getFollowLatest()
})
},
async getPopup() {
if (this.data.toastShow)
return
if (this.data.toastShow) return
const data1 = await wx.ajax({
method: 'GET',
@ -70,6 +72,25 @@ Page({ @@ -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() {
wx.ajax({
method: 'GET',
@ -171,8 +192,7 @@ Page({ @@ -171,8 +192,7 @@ Page({
})
this.handleToastCancel(null, false)
})
}
else if (toastType === 'guideEnterInfoJump') {
} else if (toastType === 'guideEnterInfoJump') {
wx.navigateTo({
url: '/patient/pages/personalInformation/index',
})

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

@ -29,7 +29,7 @@ @@ -29,7 +29,7 @@
<image class="icon" src="{{imageUrl}}icon175.png?t={{Timestamp}}"></image>
健康档案
</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>
复诊记录
</view>

Loading…
Cancel
Save