Browse Source

录入信息页,必填项调整

dev
kola-web 3 days ago
parent
commit
544f2a3ac0
  1. 31
      src/patient/pages/enterInfo/index.ts
  2. 42
      src/patient/pages/enterInfo/index.wxml

31
src/patient/pages/enterInfo/index.ts

@ -74,12 +74,13 @@ Page({
}, },
// 同步 picker 的数组与索引 // 同步 picker 的数组与索引
_syncPickerData() { _syncPickerData() {
const { CurrentTreatmentPlanList, currentTreatmentPlan, TeprotumumabInfusionCountList, teprotumumabInfusionCount } = this.data const { CurrentTreatmentPlanList, currentTreatmentPlan, TeprotumumabInfusionCountList, teprotumumabInfusionCount } =
this.data
const cpKeys = Object.keys(CurrentTreatmentPlanList) const cpKeys = Object.keys(CurrentTreatmentPlanList)
const cpNames = cpKeys.map(k => CurrentTreatmentPlanList[k]) const cpNames = cpKeys.map((k) => CurrentTreatmentPlanList[k])
const cpIndex = cpKeys.indexOf(String(currentTreatmentPlan)) const cpIndex = cpKeys.indexOf(String(currentTreatmentPlan))
const icKeys = Object.keys(TeprotumumabInfusionCountList) const icKeys = Object.keys(TeprotumumabInfusionCountList)
const icNames = icKeys.map(k => TeprotumumabInfusionCountList[k]) const icNames = icKeys.map((k) => TeprotumumabInfusionCountList[k])
const icIndex = icKeys.indexOf(String(teprotumumabInfusionCount)) const icIndex = icKeys.indexOf(String(teprotumumabInfusionCount))
this.setData({ this.setData({
currentTreatmentPlanNames: cpNames, currentTreatmentPlanNames: cpNames,
@ -283,8 +284,8 @@ Page({
}) })
}, },
handleNext() { handleNext() {
const { name, gender, ageRange, relationType, diseaseStage } = this.data const { name, gender, ageRange, relationType } = this.data
if (!name || !gender || !ageRange || !relationType || !diseaseStage) { if (!name || !gender || !ageRange || !relationType) {
wx.showToast({ title: '完善个人信息,可获得【医生】更多关注', icon: 'none' }) wx.showToast({ title: '完善个人信息,可获得【医生】更多关注', icon: 'none' })
return return
} }
@ -315,8 +316,7 @@ Page({
}, },
handleSubmit() { handleSubmit() {
app.mpBehavior({ PageName: 'BTN_PatientInfoComfirm' }) app.mpBehavior({ PageName: 'BTN_PatientInfoComfirm' })
if (this.data.submiting) if (this.data.submiting) return
return
const { const {
name, name,
gender, gender,
@ -343,17 +343,14 @@ Page({
} = this.data } = this.data
const { registrationSource, registChannel, regBusinessId, WorkerId, IsAliQiWei } = app.globalData const { registrationSource, registChannel, regBusinessId, WorkerId, IsAliQiWei } = app.globalData
const { doctorId, inviteChan, proMethodId } = app.globalData.scene const { doctorId, inviteChan, proMethodId } = app.globalData.scene
const { showTeprotumumabFields } = this.data if (!name || !gender || !ageRange) {
if (!name || !gender || !ageRange || !relationType || !diseaseStage || !diseasePeriod
|| !firstDiagnosisDate || !isRelapse || !currentTreatmentPlan || !Object.values(pastTreatmentPlan).some(v => v)
|| (showTeprotumumabFields && (!teprotumumabFirstInfusionDate || !teprotumumabInfusionCount))) {
wx.showToast({ title: '完善个人信息,可获得【医生】更多关注', icon: 'none' }) wx.showToast({ title: '完善个人信息,可获得【医生】更多关注', icon: 'none' })
return return
} }
const backPage = app.globalData.backPage const backPage = app.globalData.backPage
const navUrl const navUrl =
= typeof backPage === 'string' && backPage.includes('liveResult') ? backPage : '/patient/pages/certReslove/index' typeof backPage === 'string' && backPage.includes('liveResult') ? backPage : '/patient/pages/certReslove/index'
this.setData({ this.setData({
submiting: true, submiting: true,
@ -384,7 +381,9 @@ Page({
FirstDiagnosisDate: firstDiagnosisDate, FirstDiagnosisDate: firstDiagnosisDate,
IsRelapse: isRelapse, IsRelapse: isRelapse,
CurrentTreatmentPlan: currentTreatmentPlan, CurrentTreatmentPlan: currentTreatmentPlan,
PastTreatmentPlan: Object.keys(pastTreatmentPlan).filter(k => pastTreatmentPlan[k]).join(','), PastTreatmentPlan: Object.keys(pastTreatmentPlan)
.filter((k) => pastTreatmentPlan[k])
.join(','),
TeprotumumabFirstInfusionDate: teprotumumabFirstInfusionDate || '', TeprotumumabFirstInfusionDate: teprotumumabFirstInfusionDate || '',
TeprotumumabInfusionCount: teprotumumabInfusionCount || '', TeprotumumabInfusionCount: teprotumumabInfusionCount || '',
@ -414,8 +413,8 @@ Page({
handleVisitors() { handleVisitors() {
app.mpBehavior({ PageName: 'BTN_PatientInfoSkip' }) app.mpBehavior({ PageName: 'BTN_PatientInfoSkip' })
const backPage = app.globalData.backPage const backPage = app.globalData.backPage
const navUrl const navUrl =
= typeof backPage === 'string' && backPage.includes('liveResult') typeof backPage === 'string' && backPage.includes('liveResult')
? backPage.replace('liveResult', 'liveDetail') ? backPage.replace('liveResult', 'liveDetail')
: '/patient/pages/index/index?visitors=1' : '/patient/pages/index/index?visitors=1'
wx.ajax({ wx.ajax({

42
src/patient/pages/enterInfo/index.wxml

@ -54,7 +54,7 @@
{{item}} {{item}}
</view> </view>
</view> </view>
<view class="row-title required">您的甲状腺眼病分级</view> <view class="row-title">您的甲状腺眼病分级</view>
<view class="row row-age"> <view class="row row-age">
<view <view
class="age-item {{diseaseStage==index && 'active'}}" class="age-item {{diseaseStage==index && 'active'}}"
@ -68,7 +68,7 @@
</view> </view>
</view> </view>
<view class="content" wx:elif="{{step==1}}"> <view class="content" wx:elif="{{step==1}}">
<view class="row-title required" style="margin-top: 10rpx">您的甲状腺眼病分期</view> <view class="row-title" style="margin-top: 10rpx">您的甲状腺眼病分期</view>
<view class="row row-age"> <view class="row row-age">
<view <view
class="age-item {{diseasePeriod==index && 'active'}}" class="age-item {{diseasePeriod==index && 'active'}}"
@ -81,7 +81,7 @@
</view> </view>
</view> </view>
<view class="row-title required" style="margin-top: 10rpx">首次确诊甲状腺眼病的日期</view> <view class="row-title" style="margin-top: 10rpx">首次确诊甲状腺眼病的日期</view>
<picker mode="date" end="{{today}}" value="{{firstDiagnosisDate}}" bindchange="handleFirstDiagnosisDateChange"> <picker mode="date" end="{{today}}" value="{{firstDiagnosisDate}}" bindchange="handleFirstDiagnosisDateChange">
<view class="date-select"> <view class="date-select">
<view class="date-content" data-place="请选择日期">{{firstDiagnosisDate}}</view> <view class="date-content" data-place="请选择日期">{{firstDiagnosisDate}}</view>
@ -89,7 +89,7 @@
</view> </view>
</picker> </picker>
<view class="row-title required" style="margin-top: 10rpx">当前是否为复发</view> <view class="row-title" style="margin-top: 10rpx">当前是否为复发</view>
<view class="row row-age"> <view class="row row-age">
<view <view
class="age-item {{isRelapse==index && 'active'}}" class="age-item {{isRelapse==index && 'active'}}"
@ -102,15 +102,21 @@
</view> </view>
</view> </view>
<view class="row-title required" style="margin-top: 10rpx">您正在进行的治疗方案</view> <view class="row-title" style="margin-top: 10rpx">您正在进行的治疗方案</view>
<picker mode="selector" range="{{currentTreatmentPlanNames}}" value="{{currentTreatmentPlanIndex}}" bindchange="handleCurrentTreatmentPlanChange"> <picker
mode="selector"
range="{{currentTreatmentPlanNames}}"
value="{{currentTreatmentPlanIndex}}"
bindchange="handleCurrentTreatmentPlanChange"
>
<view class="date-select"> <view class="date-select">
<!-- prettier-ignore -->
<view class="date-content" data-place="请选择治疗方案">{{CurrentTreatmentPlanList[currentTreatmentPlan] || ''}}</view> <view class="date-content" data-place="请选择治疗方案">{{CurrentTreatmentPlanList[currentTreatmentPlan] || ''}}</view>
<van-icon class="more" name="arrow-down" /> <van-icon class="more" name="arrow-down" />
</view> </view>
</picker> </picker>
<view class="row-title required" style="margin-top: 10rpx">您的既往治疗方案(多选)</view> <view class="row-title" style="margin-top: 10rpx">您的既往治疗方案(多选)</view>
<view class="row row-past-treatment"> <view class="row row-past-treatment">
<view <view
class="age-item {{pastTreatmentPlan[index] && 'active'}}" class="age-item {{pastTreatmentPlan[index] && 'active'}}"
@ -124,18 +130,30 @@
</view> </view>
<block wx:if="{{showTeprotumumabFields}}"> <block wx:if="{{showTeprotumumabFields}}">
<view class="row-title required" style="margin-top: 10rpx">替妥尤首次输注时间</view> <view class="row-title" style="margin-top: 10rpx">替妥尤首次输注时间</view>
<picker mode="date" end="{{today}}" value="{{teprotumumabFirstInfusionDate}}" bindchange="handleTeprotumumabFirstInfusionDateChange"> <picker
mode="date"
end="{{today}}"
value="{{teprotumumabFirstInfusionDate}}"
bindchange="handleTeprotumumabFirstInfusionDateChange"
>
<view class="date-select"> <view class="date-select">
<view class="date-content" data-place="请选择日期">{{teprotumumabFirstInfusionDate}}</view> <view class="date-content" data-place="请选择日期">{{teprotumumabFirstInfusionDate}}</view>
<van-icon class="more" name="arrow-down" /> <van-icon class="more" name="arrow-down" />
</view> </view>
</picker> </picker>
<view class="row-title required" style="margin-top: 10rpx">替妥尤已输注的次数</view> <view class="row-title" style="margin-top: 10rpx">替妥尤已输注的次数</view>
<picker mode="selector" range="{{teprotumumabInfusionCountNames}}" value="{{teprotumumabInfusionCountIndex}}" bindchange="handleTeprotumumabInfusionCountChange"> <picker
mode="selector"
range="{{teprotumumabInfusionCountNames}}"
value="{{teprotumumabInfusionCountIndex}}"
bindchange="handleTeprotumumabInfusionCountChange"
>
<view class="date-select"> <view class="date-select">
<view class="date-content" data-place="请选择已输注的次数">{{TeprotumumabInfusionCountList[teprotumumabInfusionCount] || ''}}</view> <view class="date-content" data-place="请选择已输注的次数">
{{TeprotumumabInfusionCountList[teprotumumabInfusionCount] || ''}}
</view>
<van-icon class="more" name="arrow-down" /> <van-icon class="more" name="arrow-down" />
</view> </view>
</picker> </picker>

Loading…
Cancel
Save