sdsd
This commit is contained in:
parent
75bc3d6d94
commit
018d52976d
@ -5,6 +5,7 @@ let modeText = ''
|
||||
|
||||
Page({
|
||||
data: {
|
||||
isIOS: false, // 添加 iOS 设备检测
|
||||
personInfo: {
|
||||
username: '',
|
||||
sex: 1,
|
||||
@ -127,6 +128,9 @@ Page({
|
||||
onLoad() {
|
||||
// this.initAreaData();
|
||||
this.getPersonalInfo()
|
||||
this.setData({
|
||||
isIOS: wx.getSystemInfoSync().platform === 'ios'
|
||||
})
|
||||
},
|
||||
async getPersonalInfo() {
|
||||
const info = await request('patient/basic/0')
|
||||
@ -496,11 +500,18 @@ Page({
|
||||
list
|
||||
} = e.currentTarget.dataset;
|
||||
modeText = mode
|
||||
this.setData({
|
||||
selectVisible: true,
|
||||
selectValue: this.data.personInfo[mode] ? this.data.personInfo[mode] : '',
|
||||
selectList: list
|
||||
})
|
||||
|
||||
// 所有设备都使用相同的处理逻辑,避免层级问题
|
||||
// 先让所有输入框失焦
|
||||
wx.hideKeyboard();
|
||||
|
||||
setTimeout(() => {
|
||||
this.setData({
|
||||
selectVisible: true,
|
||||
selectValue: this.data.personInfo[mode] ? this.data.personInfo[mode] : '',
|
||||
selectList: list
|
||||
})
|
||||
}, 100)
|
||||
},
|
||||
onSelectChange(e) {
|
||||
const {
|
||||
@ -520,4 +531,13 @@ Page({
|
||||
})
|
||||
|
||||
},
|
||||
onPickerCancel() {
|
||||
this.setData({
|
||||
selectVisible: false
|
||||
})
|
||||
// 确保键盘状态正确
|
||||
setTimeout(() => {
|
||||
wx.hideKeyboard();
|
||||
}, 50)
|
||||
},
|
||||
});
|
||||
@ -8,7 +8,7 @@
|
||||
</view>
|
||||
<view class="info-item">
|
||||
<t-cell class="info-edit__cell" required title="姓名" bordered="{{false}}">
|
||||
<t-input bind:change="onNameChange" always-embed="{{true}}" align="right" borderless placeholder="请输入患者姓名" slot="note" value="{{personInfo.username}}"/>
|
||||
<t-input bind:change="onNameChange" always-embed="{{isIOS}}" align="right" borderless placeholder="请输入患者姓名" slot="note" value="{{personInfo.username}}"/>
|
||||
</t-cell>
|
||||
<view class="info-edit__tips" wx:if="{{errorStatus.name}}">姓名字数在2至20之间</view>
|
||||
</view>
|
||||
@ -20,61 +20,61 @@
|
||||
</view>
|
||||
<view class="info-item">
|
||||
<t-cell class="info-edit__cell" title="身份证号" bordered="{{false}}">
|
||||
<t-input type="idcard" always-embed="{{true}}" bind:change="onIdInput" align="right" borderless placeholder="请输入身份证号" slot="note" value="{{personInfo.id_number}}" />
|
||||
<t-input type="idcard" always-embed="{{isIOS}}" bind:change="onIdInput" align="right" borderless placeholder="请输入身份证号" slot="note" value="{{personInfo.id_number}}" />
|
||||
</t-cell>
|
||||
<view class="info-edit__tips" wx:if="{{errorStatus.id}}">身份证号输入有误</view>
|
||||
</view>
|
||||
<view class="info-item">
|
||||
<t-cell required arrow bind:click="showPicker" data-mode="birth" title="出生日期" bordered="{{false}}">
|
||||
<t-input align="right" always-embed="{{true}}" borderless placeholder="请输选择" readonly slot="note" value="{{personInfo.birthday}}" />
|
||||
<t-input align="right" always-embed="{{isIOS}}" borderless placeholder="请输选择" readonly slot="note" value="{{personInfo.birthday}}" />
|
||||
</t-cell>
|
||||
<view class="info-edit__tips" wx:if="{{errorStatus.birthday}}">请选择出生日期</view>
|
||||
</view>
|
||||
<view class="info-item">
|
||||
<t-cell class="info-edit__cell" align="right" required title="年龄" bordered="{{false}}">
|
||||
<t-input align="right" always-embed="{{true}}" borderless placeholder="请输入" readonly slot="note" value="{{personInfo.age}}" type="digit"/>
|
||||
<t-input align="right" always-embed="{{isIOS}}" borderless placeholder="请输入" readonly slot="note" value="{{personInfo.age}}" type="digit"/>
|
||||
</t-cell>
|
||||
<view class="info-edit__tips" wx:if="{{errorStatus.age}}">请输入年龄</view>
|
||||
</view>
|
||||
<view class="info-item">
|
||||
<t-cell class="info-edit__cell" required title="出生体重" bordered="{{false}}">
|
||||
<t-input align="right" always-embed="{{true}}" bind:change="onWeightInput" borderless placeholder="请输入" slot="note" value="{{personInfo.birth_weight}}" suffix="g" type="digit"/>
|
||||
<t-input align="right" always-embed="{{isIOS}}" bind:change="onWeightInput" borderless placeholder="请输入" slot="note" value="{{personInfo.birth_weight}}" suffix="g" type="digit"/>
|
||||
</t-cell>
|
||||
<view class="info-edit__tips" wx:if="{{errorStatus.birth_weight}}">请输入出生体重</view>
|
||||
</view>
|
||||
<view class="info-item">
|
||||
<t-cell required arrow bind:click="showPicker" data-mode="operative" title="胆道闭锁手术时间" bordered="{{false}}">
|
||||
<t-input align="right" always-embed="{{true}}" borderless placeholder="请选择" readonly slot="note" value="{{personInfo.operative_date}}" />
|
||||
<t-input align="right" always-embed="{{isIOS}}" borderless placeholder="请选择" readonly slot="note" value="{{personInfo.operative_date}}" />
|
||||
</t-cell>
|
||||
<view class="info-edit__tips" wx:if="{{errorStatus.operative_date}}">请选择胆道闭锁手术时间</view>
|
||||
</view>
|
||||
<view class="info-item">
|
||||
<t-cell title="胎次" required arrow bordered="{{false}}" bind:click="showSelect" data-mode="parity_number" data-list="{{parity_numberList}}" >
|
||||
<t-input align="right" always-embed="{{true}}" borderless placeholder="请选择" readonly slot="note" value="{{parity_numberList[personInfo.parity_number - 1].label}}" />
|
||||
<t-input align="right" always-embed="{{isIOS}}" borderless placeholder="请选择" readonly slot="note" value="{{parity_numberList[personInfo.parity_number - 1].label}}" />
|
||||
</t-cell>
|
||||
<view class="info-edit__tips" wx:if="{{errorStatus.parity_number}}">请选择胎次</view>
|
||||
</view>
|
||||
<view class="info-item">
|
||||
<t-cell title="产次" required arrow bordered="{{false}}" bind:click="showSelect" data-mode="birth_number" data-list="{{birth_numberList}}" >
|
||||
<t-input align="right" always-embed="{{true}}" borderless placeholder="请选择" readonly slot="note" value="{{birth_numberList[personInfo.birth_number - 1].label}}" />
|
||||
<t-input align="right" always-embed="{{isIOS}}" borderless placeholder="请选择" readonly slot="note" value="{{birth_numberList[personInfo.birth_number - 1].label}}" />
|
||||
</t-cell>
|
||||
<view class="info-edit__tips" wx:if="{{errorStatus.birth_number}}">请选择产次</view>
|
||||
</view>
|
||||
<view class="info-item">
|
||||
<t-cell title="受孕方式" required arrow bordered="{{false}}" bind:click="showSelect" data-mode="conception_type" data-list="{{conception_typeList}}">
|
||||
<t-input align="right" always-embed="{{true}}" borderless placeholder="请选择" readonly slot="note" value="{{conception_typeList[personInfo.conception_type - 1].label}}" />
|
||||
<t-input align="right" always-embed="{{isIOS}}" borderless placeholder="请选择" readonly slot="note" value="{{conception_typeList[personInfo.conception_type - 1].label}}" />
|
||||
</t-cell>
|
||||
<view class="info-edit__tips" wx:if="{{errorStatus.conception_type}}">请选择受孕方式</view>
|
||||
</view>
|
||||
<view class="info-item">
|
||||
<t-cell class="info-edit__cell" required bordered="{{false}}" title="孕周">
|
||||
<t-input align="right" always-embed="{{true}}" suffix="周" bind:change="onWeekInput" borderless placeholder="请输入" slot="note" value="{{personInfo.gestational_week}}" type="digit" />
|
||||
<t-input align="right" always-embed="{{isIOS}}" suffix="周" bind:change="onWeekInput" borderless placeholder="请输入" slot="note" value="{{personInfo.gestational_week}}" type="digit" />
|
||||
</t-cell>
|
||||
<view class="info-edit__tips" wx:if="{{errorStatus.gestational_week}}">请输入孕周</view>
|
||||
</view>
|
||||
<view class="info-item">
|
||||
<t-cell title="产检是否有异常(如有,请填写)" bordered="{{false}}" required arrow bind:click="showSelect" data-mode="prenatal_check_type" data-list="{{prenatal_checkList}}" >
|
||||
<t-input align="right" always-embed="{{true}}" borderless placeholder="请选择" readonly slot="note" value="{{prenatal_checkList[personInfo.prenatal_check_type - 1].label}}" />
|
||||
<t-input align="right" always-embed="{{isIOS}}" borderless placeholder="请选择" readonly slot="note" value="{{prenatal_checkList[personInfo.prenatal_check_type - 1].label}}" />
|
||||
</t-cell>
|
||||
<t-textarea bind:change="onPrenatalCheckRemarkChange" t-class="external-class" wx:if="{{personInfo.prenatal_check_type == 1}}" placeholder="请输入异常描述" disableDefaultPadding="{{true}}" value="{{personInfo.prenatal_check_remark}}" />
|
||||
<view class="info-edit__tips" wx:if="{{errorStatus.prenatal_check_type}}">请选择产检是否有异常</view>
|
||||
@ -82,7 +82,7 @@
|
||||
</view>
|
||||
<view class="info-item">
|
||||
<t-cell title="分娩方式" required arrow bordered="{{false}}" bind:click="showSelect" data-mode="delivery_type" data-list="{{deliveryList}}" >
|
||||
<t-input align="right" always-embed="{{true}}" borderless placeholder="请选择" readonly slot="note" value="{{deliveryList[personInfo.delivery_type - 1].label}}" />
|
||||
<t-input align="right" always-embed="{{isIOS}}" borderless placeholder="请选择" readonly slot="note" value="{{deliveryList[personInfo.delivery_type - 1].label}}" />
|
||||
</t-cell>
|
||||
<view class="info-edit__tips" wx:if="{{errorStatus.delivery_type}}">请选择分娩方式</view>
|
||||
</view>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user