初始化
This commit is contained in:
61
pages/joinFlow/person/index.js
Normal file
61
pages/joinFlow/person/index.js
Normal file
@@ -0,0 +1,61 @@
|
||||
Page({
|
||||
data: {
|
||||
showPicker: false,
|
||||
date: new Date().getTime(),
|
||||
//手术
|
||||
showSurgery: false,
|
||||
surgeryList: [],
|
||||
selectSurgery: [],
|
||||
age: "",
|
||||
allergy: "",
|
||||
comorbidity: "",
|
||||
},
|
||||
onInputChange(e) {
|
||||
const { field } = e.currentTarget.dataset;
|
||||
this.setData({
|
||||
[`${field}`]: e.detail.value,
|
||||
});
|
||||
},
|
||||
//选择时间
|
||||
chaneTimeShow() {
|
||||
this.setData({
|
||||
showTime: !this.data.showTime
|
||||
})
|
||||
},
|
||||
onTimeConfirm(e) {
|
||||
let { value } = e.detail
|
||||
this.setData({
|
||||
date: value
|
||||
})
|
||||
},
|
||||
|
||||
//选择手术
|
||||
changeSurgeryShow() {
|
||||
this.setData({
|
||||
showSurgery: !this.data.showSurgery
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
//提交
|
||||
onSubmit() {
|
||||
let { date, age, allergy, comorbidity } = this.data
|
||||
let errorText = ""
|
||||
if (!date) {
|
||||
errorText = "请选择时间"
|
||||
}
|
||||
if (!age.trim()) {
|
||||
errorText = "请填写年龄"
|
||||
}
|
||||
if (errorText) {
|
||||
wx.showToast({
|
||||
title: errorText,
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
}
|
||||
wx.switchTab({
|
||||
url: '/pages/home/index',
|
||||
})
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user