|
|
|
|
@ -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() { |
|
|
|
|
|