Browse Source

随访bug处理

dev
kola-web 3 weeks ago
parent
commit
b1b6b20d7f
  1. 42
      src/app.ts
  2. 3
      src/pages/d_interactiveDoctor/index.scss
  3. 1
      src/patient/pages/follow/index.scss
  4. 10
      src/patient/pages/follow/index.ts
  5. 74
      src/patient/pages/followForm/index.ts
  6. 8
      src/patient/pages/followForm/index.wxml
  7. 94
      src/patient/pages/index/index.ts
  8. 8
      src/patient/pages/index/index.wxml
  9. 3
      src/patient/pages/interactivePatient/index.scss
  10. 2
      src/patient/pages/my/index.wxml

42
src/app.ts

@ -104,6 +104,8 @@ App<IAppOption>({ @@ -104,6 +104,8 @@ App<IAppOption>({
sub: false,
tmplIds: [],
},
scanDoctor: false,
},
onLaunch() {
const appid = wx.getAccountInfoSync().miniProgram.appId
@ -126,10 +128,12 @@ App<IAppOption>({ @@ -126,10 +128,12 @@ App<IAppOption>({
onShow(options) {
if (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
}
if (this.globalData.scene?.doctorId) {
this.globalData.scanDoctor = true
}
},
startLogin(callback) {
wx.login({
@ -248,7 +252,7 @@ App<IAppOption>({ @@ -248,7 +252,7 @@ App<IAppOption>({
data: {},
}) as Promise<never>
},
mpBehavior(data: { doctor?: boolean, PageName: string }) {
mpBehavior(data: { doctor?: boolean; PageName: string }) {
let url = '?r=zd/mp-behavior/add'
if (data.doctor) {
url = '?r=zd/doctor/mp-behavior/add'
@ -280,10 +284,9 @@ App<IAppOption>({ @@ -280,10 +284,9 @@ App<IAppOption>({
})
},
// zd相关函数
zdMpBehavior(data: { PageName: string, doctor?: boolean }) {
zdMpBehavior(data: { PageName: string; doctor?: boolean }) {
const { loginType } = this.globalData
if (loginType === 0)
return
if (loginType === 0) return
let url = '?r=zd/mp-behavior/add'
if (data.doctor) {
url = '?r=zd/doctor/mp-behavior/add'
@ -310,15 +313,13 @@ App<IAppOption>({ @@ -310,15 +313,13 @@ App<IAppOption>({
if (this.zdVerifySys(pub)) {
if (this.globalData.loginType === 1) {
this.zdRegistrationVerification(() => resolve(), loginPage)
}
else {
} else {
resolve()
}
}
}
const unRegFun = (resolve) => {
if (!this.zdVerifySys(pub))
return
if (!this.zdVerifySys(pub)) return
resolve()
}
return new Promise((resolve: (value?) => void) => {
@ -376,14 +377,11 @@ App<IAppOption>({ @@ -376,14 +377,11 @@ App<IAppOption>({
let urlKey = ''
if (!PatientId) {
urlKey = 'enterInfo'
}
else if (AuditStatus == 0) {
} else if (AuditStatus == 0) {
urlKey = 'noCert'
}
else if (AuditStatus == 1) {
} else if (AuditStatus == 1) {
urlKey = isFollow ? 'nopending' : 'pending'
}
else if (AuditStatus == 2) {
} else if (AuditStatus == 2) {
urlKey = 'reject'
}
const navUrl = {
@ -434,8 +432,7 @@ App<IAppOption>({ @@ -434,8 +432,7 @@ App<IAppOption>({
})
return false
}
if (ignorePath.includes(url))
return true
if (ignorePath.includes(url)) return true
if (loginType === 1) {
if (url.includes('doctor/pages')) {
@ -443,16 +440,14 @@ App<IAppOption>({ @@ -443,16 +440,14 @@ App<IAppOption>({
url: '/pages/index/index',
})
return false
}
else {
} else {
return true
}
}
if (loginType === 2 && !pub) {
if (url.includes('doctor/pages')) {
return true
}
else {
} else {
const params = Object.entries(options)
.map(([key, value]) => `${key}=${value}`)
.join('&')
@ -477,8 +472,7 @@ App<IAppOption>({ @@ -477,8 +472,7 @@ App<IAppOption>({
url: '/patient/pages/login/index',
})
isReject = true
}
else if (!isNewReg) {
} else if (!isNewReg) {
wx.reLaunch({
url: '/patient/pages/enterInfo/index',
})

3
src/pages/d_interactiveDoctor/index.scss

@ -208,9 +208,6 @@ page { @@ -208,9 +208,6 @@ page {
display: inline;
font-weight: bold;
}
.value {
display: inline;
}
&::before {
margin-left: -30rpx;
margin-right: 20rpx;

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

@ -79,6 +79,7 @@ page { @@ -79,6 +79,7 @@ page {
gap: 20rpx;
font-size: 32rpx;
color: rgba(105, 104, 110, 1);
white-space: pre-line;
&::before {
margin-top: 16rpx;
flex-shrink: 0;

10
src/patient/pages/follow/index.ts

@ -24,10 +24,12 @@ Page({ @@ -24,10 +24,12 @@ Page({
},
getEnum() {
return wx.ajax({
return wx
.ajax({
method: 'GET',
url: '?r=xd/follow-up-reminder/enum',
}).then((res: any) => {
})
.then((res: any) => {
const tp = res.treatmentPlan || {}
const planMap: Record<string, string> = {}
Object.keys(tp).forEach((key) => {
@ -51,8 +53,8 @@ Page({ @@ -51,8 +53,8 @@ Page({
const planKeys = item.treatmentPlan ? item.treatmentPlan.split(',') : []
const planList = planKeys.map((key: string) => {
const label = planMap[key] || key
if (key === '5' && item.usageCount) {
return `${label}${item.usageCount}次使用`
if (key === '5' && item.teprotumumabCount) {
return `${label} \n ${item.teprotumumabCount}次使用`
}
return label
})

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

@ -13,9 +13,8 @@ Page({ @@ -13,9 +13,8 @@ Page({
nextVisitPreset: '',
intervalOptions: [] as any[],
popupShow: false,
popupType: 'popup16',
popupType: 'popup19',
popupParams: {} as any,
hasChange: false,
},
onLoad(options: any) {
@ -33,18 +32,20 @@ Page({ @@ -33,18 +32,20 @@ Page({
},
getEnum() {
return wx.ajax({
return wx
.ajax({
method: 'GET',
url: '?r=xd/follow-up-reminder/enum',
}).then((res: any) => {
})
.then((res: any) => {
const tp = res.treatmentPlan || {}
const planOptions = Object.keys(tp).map(key => ({
const planOptions = Object.keys(tp).map((key) => ({
value: key,
label: tp[key],
isSelected: false,
}))
const nvi = res.nextVisitInterval || {}
const intervalOptions = Object.keys(nvi).map(key => ({
const intervalOptions = Object.keys(nvi).map((key) => ({
value: key,
label: nvi[key],
}))
@ -74,18 +75,17 @@ Page({ @@ -74,18 +75,17 @@ Page({
treatmentPlan,
teprotumumabCount: res.teprotumumabCount || 1,
nextVisitTime: res.nextVisitTime || '',
hasChange: false,
})
this.updatePlanOptions(treatmentPlan)
})
},
onVisitDateChange(e: any) {
this.setData({ visitTime: e.detail.value, hasChange: true })
this.setData({ visitTime: e.detail.value })
},
onNextDateChange(e: any) {
this.setData({ nextVisitTime: e.detail.value, nextVisitPreset: '', hasChange: true })
this.setData({ nextVisitTime: e.detail.value, nextVisitPreset: '' })
},
togglePlan(e: any) {
@ -94,16 +94,15 @@ Page({ @@ -94,16 +94,15 @@ Page({
const index = treatmentPlan.indexOf(value)
if (index > -1) {
treatmentPlan.splice(index, 1)
}
else {
} else {
treatmentPlan.push(value)
}
this.setData({ treatmentPlan, hasChange: true })
this.setData({ treatmentPlan })
this.updatePlanOptions(treatmentPlan)
},
onStepperChange(e: any) {
this.setData({ teprotumumabCount: e.detail, hasChange: true })
this.setData({ teprotumumabCount: e.detail })
},
onNextPresetChange(e: any) {
@ -116,15 +115,13 @@ Page({ @@ -116,15 +115,13 @@ Page({
const date = new Date(visitTime)
if (preset === '21') {
date.setDate(date.getDate() + 21)
}
else if (preset === '30') {
} else if (preset === '30') {
date.setMonth(date.getMonth() + 1)
}
else if (preset === '60') {
} else if (preset === '60') {
date.setMonth(date.getMonth() + 2)
}
const nextVisitTime = this.formatDate(date)
this.setData({ nextVisitPreset: preset, nextVisitTime, hasChange: true })
this.setData({ nextVisitPreset: preset, nextVisitTime })
},
formatDate(date: Date) {
@ -164,38 +161,33 @@ Page({ @@ -164,38 +161,33 @@ Page({
wx.showToast({ title: '更新成功', icon: 'none' })
setTimeout(() => wx.navigateBack(), 1500)
})
}
else {
} else {
wx.ajax({
method: 'POST',
url: '?r=xd/follow-up-reminder/create',
data,
loading: true,
}).then(() => {
wx.showToast({ title: '创建成功', icon: 'none' })
setTimeout(() => wx.navigateBack(), 1500)
this.setData({
popupShow: true,
popupType: 'popup19',
popupParams: {},
})
})
}
},
handleCancel() {
if (this.data.hasChange) {
this.setData({ popupShow: true, popupType: 'popup16' })
}
else {
wx.navigateBack()
}
},
handleDelete() {
this.setData({ popupShow: true, popupType: 'popup15' })
},
handlePopupOk() {
const { popupType } = this.data
this.setData({ popupShow: false })
if (popupType === 'popup15') {
// 删除确认
wx.showModal({
title: '确认删除?',
confirmColor: '#8c75d0',
cancelColor: '#141515',
success: (res) => {
if (res.confirm) {
wx.ajax({
method: 'POST',
url: '?r=xd/follow-up-reminder/delete',
@ -206,9 +198,15 @@ Page({ @@ -206,9 +198,15 @@ Page({
setTimeout(() => wx.navigateBack(), 1500)
})
}
else {
// 保存记录
this.handleSubmit()
},
})
},
handlePopupOk() {
const { popupType } = this.data
this.setData({ popupShow: false })
if (popupType === 'popup19') {
this.handlePopupCancel()
}
},

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

@ -17,7 +17,9 @@ @@ -17,7 +17,9 @@
wx:key="value"
bind:tap="togglePlan"
data-value="{{item.value}}"
>{{item.label}}</view>
>
{{item.label}}
</view>
</view>
<view class="card" wx:if="{{showUsageCount}}">
@ -62,7 +64,9 @@ @@ -62,7 +64,9 @@
wx:key="value"
bind:tap="onNextPresetChange"
data-value="{{item.value}}"
>{{item.label}}</view>
>
{{item.label}}
</view>
</view>
</view>

94
src/patient/pages/index/index.ts

@ -53,6 +53,8 @@ Page({ @@ -53,6 +53,8 @@ Page({
followLatest: null as any,
options: {} as any,
enterJump: false,
},
onLoad(options) {
const systemInfo = wx.getSystemInfoSync()
@ -72,8 +74,7 @@ Page({ @@ -72,8 +74,7 @@ Page({
if (options.jump == '1') {
this.setData({
toastShow: true,
toastType: 'guideEnterInfoJump',
enterJump: true,
})
}
@ -116,8 +117,26 @@ Page({ @@ -116,8 +117,26 @@ Page({
},
async getPopup() {
// https://fa0ci3qr2z.feishu.cn/wiki/EBX6woN7xiaartkYkBpcfbYQnfn
if (this.data.toastShow)
if (this.data.toastShow) return
if (app.globalData.scanDoctor) {
this.setData({
toastShow: true,
toastType: 'followGuide',
toastParams: { close: true, scanDoctor: true },
})
app.globalData.scanDoctor = false
return
}
if (this.data.enterJump) {
this.setData({
toastShow: true,
toastType: 'guideEnterInfoJump',
enterJump: false,
})
return
}
const data4 = await wx.ajax({
method: 'GET',
@ -126,6 +145,7 @@ Page({ @@ -126,6 +145,7 @@ Page({
type: 1,
},
})
if (data4.showAlert) {
this.setData({
toastShow: data4.showAlert,
@ -208,7 +228,8 @@ Page({ @@ -208,7 +228,8 @@ Page({
method: 'GET',
url: '?r=xd/follow-up-reminder/latest',
data: {},
}).then((res: any) => {
})
.then((res: any) => {
if (res && res.nextVisitTime) {
const date = dayjs(res.nextVisitTime)
const year = date.format('YYYY')
@ -223,11 +244,11 @@ Page({ @@ -223,11 +244,11 @@ Page({
week: date.format('dddd'),
},
})
}
else {
} else {
this.setData({ followLatest: null })
}
}).catch(() => {
})
.catch(() => {
this.setData({ followLatest: null })
})
},
@ -276,13 +297,11 @@ Page({ @@ -276,13 +297,11 @@ Page({
// 设置显示状态
if (code === 'medicalInsurance' && showStatus == 1) {
statusMap.medicalInsuranceShow = true
if (openStatus == 1)
statusMap.medicalInsuranceJump = true
if (openStatus == 1) statusMap.medicalInsuranceJump = true
}
if (code === 'hospitalMap' && showStatus == 1) {
statusMap.hospitalMapShow = true
if (openStatus == 1)
statusMap.hospitalMapJump = true
if (openStatus == 1) statusMap.hospitalMapJump = true
}
if (code === 'adl' && showStatus == 1) {
statusMap.qolShow = true
@ -402,8 +421,7 @@ Page({ @@ -402,8 +421,7 @@ Page({
})
return
}
if (!url)
return
if (!url) return
if (code === 'doctor') {
app.mpBehavior({ PageName: 'BTN_PatientHomeDoctorCard' })
}
@ -437,8 +455,8 @@ Page({ @@ -437,8 +455,8 @@ Page({
},
handleAddQol() {
const { qolDetail } = this.data
const url
= qolDetail.Id && qolDetail.isTodayRecord
const url =
qolDetail.Id && qolDetail.isTodayRecord
? `/patient/pages/qolAdd/index?id=${qolDetail.Id}&edit=1`
: `/patient/pages/qol/index`
wx.navigateTo({
@ -459,8 +477,7 @@ Page({ @@ -459,8 +477,7 @@ Page({
wx.navigateTo({
url: `/patient/pages/hormones/index?id=${hormoneDetail.recordId}`,
})
}
else {
} else {
wx.navigateTo({
url: '/patient/pages/hormonesStart/index',
})
@ -470,20 +487,18 @@ Page({ @@ -470,20 +487,18 @@ Page({
app.zdPermissionVerification(3, 0, '')
},
handleToastOk() {
const { toastType } = this.data
const { toastType, toastParams } = this.data
if (toastType === 'ndrlAldAlert') {
wx.navigateTo({
url: '/patient/pages/adl/index?nrdl=1',
})
this.handleToastCancel()
}
else if (toastType === 'doubleStandards') {
} else if (toastType === 'doubleStandards') {
wx.navigateTo({
url: '/patient/pages/adl/index',
})
this.handleToastCancel()
}
else if (toastType === 'dedicatedDoctor') {
} else if (toastType === 'dedicatedDoctor') {
wx.ajax({
method: 'POST',
url: '?r=zd/popup/close-popup',
@ -496,8 +511,7 @@ Page({ @@ -496,8 +511,7 @@ Page({
})
})
this.handleToastCancel(null, false)
}
else if (toastType === 'medical-guide') {
} else if (toastType === 'medical-guide') {
wx.ajax({
method: 'POST',
url: '?r=zd/popup/add-record',
@ -508,8 +522,7 @@ Page({ @@ -508,8 +522,7 @@ Page({
})
})
this.handleToastCancel(null, false)
}
else if (toastType === 'guideEnterInfo') {
} else if (toastType === 'guideEnterInfo') {
wx.ajax({
method: 'POST',
url: '?r=zd/popup/close-need-popup',
@ -520,14 +533,13 @@ Page({ @@ -520,14 +533,13 @@ Page({
})
this.handleToastCancel(null, false)
})
}
else if (toastType === 'guideEnterInfoJump') {
} else if (toastType === 'guideEnterInfoJump') {
wx.navigateTo({
url: '/patient/pages/personalInformation/index',
})
this.handleToastCancel(null, false)
}
else if (toastType === 'followGuide') {
} else if (toastType === 'followGuide') {
if (!toastParams.scanDoctor) {
wx.ajax({
method: 'POST',
url: '?r=zd/popup/add-record',
@ -537,11 +549,16 @@ Page({ @@ -537,11 +549,16 @@ Page({
url: '/patient/pages/followForm/index',
})
})
} else {
wx.navigateTo({
url: '/patient/pages/followForm/index',
})
}
this.handleToastCancel(null, false)
}
},
handleToastCancel(_e = null, sure = true) {
const { toastType } = this.data
const { toastType, toastParams } = this.data
if (toastType === 'doubleStandards' && sure) {
wx.ajax({
method: 'POST',
@ -550,8 +567,7 @@ Page({ @@ -550,8 +567,7 @@ Page({
Type: 5,
},
})
}
else if (toastType === 'dedicatedDoctor' && sure) {
} else if (toastType === 'dedicatedDoctor' && sure) {
wx.ajax({
method: 'POST',
url: '?r=zd/popup/close-popup',
@ -559,22 +575,19 @@ Page({ @@ -559,22 +575,19 @@ Page({
Type: 6,
},
})
}
else if (toastType === 'medical-guide' && sure) {
} else if (toastType === 'medical-guide' && sure) {
wx.ajax({
method: 'POST',
url: '?r=zd/popup/add-record',
data: { type: 3 },
})
}
else if (toastType === 'guideEnterInfo' && sure) {
} else if (toastType === 'guideEnterInfo' && sure) {
wx.ajax({
method: 'POST',
url: '?r=zd/popup/close-need-popup',
data: { type: 1 },
})
}
else if (toastType === 'followGuide' && sure) {
} else if (toastType === 'followGuide' && sure && !toastParams.scanDoctor) {
wx.ajax({
method: 'POST',
url: '?r=zd/popup/add-record',
@ -617,8 +630,7 @@ Page({ @@ -617,8 +630,7 @@ Page({
infoList: list,
})
})
}
else {
} else {
wx.ajax({
method: 'POST',
url: '?r=zd/pic-text/collection',

8
src/patient/pages/index/index.wxml

@ -35,13 +35,17 @@ @@ -35,13 +35,17 @@
</view>
<image class="more" src="{{imageUrl}}icon118.png?t={{Timestamp}}"></image>
</view>
<view class="follow">
<view class="follow" wx:if="{{zdUserInfo.UserType>=3}}">
<view class="empty" wx:if="{{!followLatest}}" 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">
<image class="pos" wx:if="{{followLatest.remainingDays < 0}}" src="{{imageUrl}}bg61.png?t={{Timestamp}}"></image>
<image
class="pos"
wx:if="{{followLatest.remainingDays < 0}}"
src="{{imageUrl}}bg61.png?t={{Timestamp}}"
></image>
<view class="aside" style="background: url('{{imageUrl}}bg60.png?t={{Timestamp}}') no-repeat top center/100%">
<block wx:if="{{followLatest.remainingDays >= 0}}">
<view class="a-num">{{followLatest.remainingDays}}</view>

3
src/patient/pages/interactivePatient/index.scss

@ -619,9 +619,6 @@ page { @@ -619,9 +619,6 @@ page {
display: inline;
font-weight: bold;
}
.value {
display: inline;
}
&::before {
margin-left: -30rpx;
margin-right: 20rpx;

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

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

Loading…
Cancel
Save