Browse Source

refactor: 优化患者详情页与手机号修改页主题适配

1. 为changePhone页面添加主题专属样式与id标识
2. 修复toast弹窗背景图与样式的主题适配逻辑
3. 优化患者详情页健康问答展示逻辑与文案
4. 移除患者详情页冗余的图表相关代码
master
kola-web 3 weeks ago
parent
commit
3ba97c85d9
  1. 11
      project.private.config.json
  2. 12
      src/components/toast/index.scss
  3. 4
      src/components/toast/index.wxml
  4. 153
      src/doctor/pages/d_patientDetail/index.ts
  5. 4
      src/doctor/pages/d_patientDetail/index.wxml
  6. BIN
      src/images/bg34.png
  7. 11
      src/pages/changePhone/index.scss
  8. 2
      src/pages/changePhone/index.wxml

11
project.private.config.json

@ -22,13 +22,20 @@
"miniprogram": { "miniprogram": {
"list": [ "list": [
{ {
"name": "患者-健康档案", "name": "患者-更改手机号",
"pathName": "pages/qaForm/index", "pathName": "pages/changePhone/index",
"query": "", "query": "",
"scene": null, "scene": null,
"launchMode": "default" "launchMode": "default"
}, },
{ {
"name": "患者-健康档案",
"pathName": "pages/qaForm/index",
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "患者-记录就诊时间", "name": "患者-记录就诊时间",
"pathName": "pages/signIn/index", "pathName": "pages/signIn/index",
"query": "", "query": "",

12
src/components/toast/index.scss

@ -2349,6 +2349,16 @@
background: linear-gradient(to right, rgba(14, 182, 109, 1), rgba(0, 210, 119, 1)); background: linear-gradient(to right, rgba(14, 182, 109, 1), rgba(0, 210, 119, 1));
border-radius: 24rpx 24rpx 24rpx 24rpx; border-radius: 24rpx 24rpx 24rpx 24rpx;
} }
&.durg {
.content {
.high {
color: rgba(22, 121, 203, 1);
}
}
.btn {
background: linear-gradient(270deg, #5956e9 0%, #b384f4 100%);
}
}
} }
.close { .close {
margin: 68rpx auto 0; margin: 68rpx auto 0;
@ -2356,7 +2366,7 @@
width: 64rpx; width: 64rpx;
height: 64rpx; height: 64rpx;
} }
&.popup-dedicated-doctor-drug { &.drug {
.popup-container { .popup-container {
.btn { .btn {
background-color: rgba(37, 217, 200, 1); background-color: rgba(37, 217, 200, 1);

4
src/components/toast/index.wxml

@ -659,10 +659,10 @@
</view> </view>
</view> </view>
</view> </view>
<view class="popup-dedicated-doctor" wx:if="{{type == 'dedicatedDoctor'}}"> <view class="popup-dedicated-doctor {{theme === 'DRUG' && 'drug'}}" wx:if="{{type == 'dedicatedDoctor'}}">
<view <view
class="popup-container" class="popup-container"
style="background: url('{{imageUrl}}bg26.png?t={{Timestamp}}') no-repeat top center/100%" style="background: url('{{imageUrl}}{{theme === 'DRUG' ? 'bg34' : 'bg26'}}.png?t={{Timestamp}}') no-repeat top center/100%"
> >
<view class="content"> <view class="content">
<view> <view>

153
src/doctor/pages/d_patientDetail/index.ts

@ -2,7 +2,6 @@ import dayjs from 'dayjs'
const app = getApp<IAppOption>() const app = getApp<IAppOption>()
let echarts: any = null
Page({ Page({
data: { data: {
toastShow: false, toastShow: false,
@ -17,33 +16,6 @@ Page({
id: '', id: '',
remark: '', remark: '',
detail: {} as any, detail: {} as any,
ec: {
lazyLoad: true,
},
fields: {
1: 'day',
2: 'month',
3: 'year',
},
StartDate: '',
EndDate: '',
typeRange: [
{
id: '1',
value: '按天',
},
{
id: '2',
value: '按月',
},
{
id: '3',
value: '按年',
},
],
type: '3',
typeName: '按年',
userInfo: {}, userInfo: {},
popupRemarkShow: false, popupRemarkShow: false,
@ -122,8 +94,6 @@ Page({
}, },
], ],
nav: '0',
ageRangeMap: { ageRangeMap: {
1: '<40岁', 1: '<40岁',
2: '40-49岁', 2: '40-49岁',
@ -139,40 +109,6 @@ Page({
}, },
adlList: [] as any, adlList: [] as any,
tableData: [
{
title: '说话',
key: 'TalkingScore',
},
{
title: '咀嚼',
key: 'ChewScore',
},
{
title: '吞咽',
key: 'SwallowScore',
},
{
title: '呼吸',
key: 'BreathScore',
},
{
title: '刷牙梳头能力受损',
key: 'BrushTeethAndCombHairScore',
},
{
title: '从椅子上起身能力受损',
key: 'GetUpFromChairScore',
},
{
title: '复视/重影',
key: 'DoubleVisionScore',
},
{
title: '眼睑下垂',
key: 'DroopyEyelidsScore',
},
],
pagination: { pagination: {
page: 1, page: 1,
@ -180,25 +116,14 @@ Page({
count: 1, count: 1,
}, },
}, },
ecDataTrendComponent1: null as any, onLoad(option) {
ecDataTrendComponent2: null as any,
ecDataTrendComponent3: null as any,
ecDataTrendComponent4: null as any,
async onLoad(option) {
this.setData({ this.setData({
id: option.id, id: option.id,
}) })
echarts = await require.async('../../../resource/components/echart/echarts.js')
this.ecDataTrendComponent1 = this.selectComponent('#chart1')
this.ecDataTrendComponent2 = this.selectComponent('#chart2')
this.ecDataTrendComponent3 = this.selectComponent('#chart3')
this.ecDataTrendComponent4 = this.selectComponent('#chart4')
app.waitLogin().then(async (_res) => { app.waitLogin().then(async (_res) => {
app.mpBehavior({ doctor: true, PageName: 'PG_DOCTORPATIENTDETAIL' }) app.mpBehavior({ doctor: true, PageName: 'PG_DOCTORPATIENTDETAIL' })
this.getDoctorDetail() this.getDoctorDetail()
await this.getDetail() await this.getDetail()
this.handleNav({ currentTarget: { dataset: { index: '0' } } }, false)
}) })
}, },
getDoctorDetail() { getDoctorDetail() {
@ -242,10 +167,13 @@ Page({
res.HealthQA.questions.forEach((q: any) => { res.HealthQA.questions.forEach((q: any) => {
q.isAnswerArray = Array.isArray(q.AnswerText) q.isAnswerArray = Array.isArray(q.AnswerText)
if (q.isAnswerArray) { if (q.isAnswerArray) {
q.AnswerTextArr = q.AnswerText q.AnswerTextArr = q.AnswerText.filter((a: any) => a !== null && a !== undefined)
q.AnswerTextStr = q.AnswerText.join('、') + (q.OtherText ? `${q.OtherText}` : '') q.AnswerTextStr = q.AnswerTextArr.join('、') + (q.OtherText ? `${q.OtherText}` : '')
} else { } else {
q.AnswerTextStr = q.AnswerText + (q.OtherText ? `${q.OtherText}` : '') q.AnswerTextStr = q.AnswerText || ''
if (q.AnswerTextStr && q.OtherText) {
q.AnswerTextStr += `${q.OtherText}`
}
} }
}) })
} }
@ -257,72 +185,7 @@ Page({
}) })
}) })
}, },
handleTypeChange(e) { handleRemark() {
const index = e.detail.value
const { typeRange, nav } = this.data
const type = typeRange[index].id
const typeName = typeRange[index].value
let EndDate = ''
let StartDate = ''
if (type === '1') {
EndDate = dayjs().format('YYYY-MM-DD')
StartDate = dayjs().subtract(6, 'd').format('YYYY-MM-DD')
} else if (type === '2') {
EndDate = dayjs().format('YYYY-MM')
StartDate = dayjs().subtract(1, 'M').format('YYYY-MM')
} else if (type === '3') {
EndDate = dayjs().format('YYYY')
StartDate = dayjs().subtract(1, 'y').format('YYYY')
}
this.setData({
type,
typeName,
EndDate,
StartDate,
})
if (nav === '0') {
this.getGraph()
} else {
this.getAdlList()
}
},
handleChange() {
const { nav } = this.data
if (nav === '0') {
this.getGraph()
} else {
this.getAdlList()
}
},
getGraph() {
wx.ajax({
method: 'GET',
url: '?r=igg4/doctor/patient/adl-graph',
data: {
patientId: this.data.id,
StartDate: this.data.StartDate,
EndDate: this.data.EndDate,
DateType: this.data.type,
count: 0,
},
}).then(async (res) => {
this.initChart1(res.adlSummary)
this.initChart2(res.adlSummary)
const medication = res.medication.map((item) => {
return {
Date: item.InjectionDate,
...item,
}
})
const list = res.list
const newList: any[] = this.mergeArr(list, medication)
const chart3 = await this.initChart3(newList as never[])
const chart4 = await this.initChart4(newList as never[])
echarts.connect([chart3, chart4])
})
},
mergeArr(array1: any[] = [], array2: any[] = []) {
// 合并两个数组中相同Date字段的对象 // 合并两个数组中相同Date字段的对象
const mergedArray: any[] = [] const mergedArray: any[] = []
const mergedMap = new Map() const mergedMap = new Map()

4
src/doctor/pages/d_patientDetail/index.wxml

@ -18,14 +18,14 @@
<view class="container"> <view class="container">
<block wx:if="{{detail.HealthQA && detail.HealthQA.hasSubmitted && detail.HealthQA.questions.length > 0}}"> <block wx:if="{{detail.HealthQA && detail.HealthQA.hasSubmitted && detail.HealthQA.questions.length > 0}}">
<view class="row" wx:for="{{detail.HealthQA.questions}}" wx:key="QuestionNo"> <view class="row" wx:for="{{detail.HealthQA.questions}}" wx:key="QuestionNo">
<view class="label">{{item.QuestionContent}}</view> <view class="label">{{item.DoctorTitle}}</view>
<view class="content" wx:if="{{item.AnswerTextStr}}"> <view class="content" wx:if="{{item.AnswerTextStr}}">
<text wx:if="{{!item.isAnswerArray}}">{{item.AnswerTextStr}}</text> <text wx:if="{{!item.isAnswerArray}}">{{item.AnswerTextStr}}</text>
<block wx:else> <block wx:else>
<view wx:for="{{item.AnswerTextArr}}" wx:for-item="ans" wx:key="index">{{ans}}<text wx:if="{{item.OtherText && index === item.AnswerTextArr.length - 1}}">({{item.OtherText}})</text></view> <view wx:for="{{item.AnswerTextArr}}" wx:for-item="ans" wx:key="index">{{ans}}<text wx:if="{{item.OtherText && index === item.AnswerTextArr.length - 1}}">({{item.OtherText}})</text></view>
</block> </block>
</view> </view>
<view class="content" wx:else>未作答</view> <view class="content" wx:else></view>
</view> </view>
</block> </block>
<view class="row"> <view class="row">

BIN
src/images/bg34.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 206 KiB

11
src/pages/changePhone/index.scss

@ -8,7 +8,7 @@
border: 1rpx solid #edeff0; border: 1rpx solid #edeff0;
display: flex; display: flex;
.place-input { .place-input {
color: rgba(33, 33, 32, 0.40); color: rgba(33, 33, 32, 0.4);
} }
.input { .input {
flex: 1; flex: 1;
@ -34,3 +34,12 @@
border-radius: 12rpx; border-radius: 12rpx;
} }
} }
#drug-page {
.btn {
color: rgba(22, 121, 203, 1);
}
.submit {
background: linear-gradient(270deg, #5956e9 0%, #b384f4 100%);
}
}

2
src/pages/changePhone/index.wxml

@ -1,4 +1,4 @@
<view class="page"> <view class="page" id="{{theme === 'DRUG' && 'drug-page'}}">
<view class="form"> <view class="form">
<view class="row"> <view class="row">
<input <input

Loading…
Cancel
Save