初始化
This commit is contained in:
36
pages/joinFlow/manual/index.js
Normal file
36
pages/joinFlow/manual/index.js
Normal file
@@ -0,0 +1,36 @@
|
||||
Page({
|
||||
data: {
|
||||
formData: {
|
||||
hospital: "",
|
||||
department: ""
|
||||
}
|
||||
},
|
||||
onInputChange(e) {
|
||||
console.log("dsds");
|
||||
const {field} = e.currentTarget.dataset;
|
||||
this.setData({
|
||||
[`formData.${field}`]: e.detail.value,
|
||||
});
|
||||
},
|
||||
|
||||
onSubmit() {
|
||||
let {formData} = this.data
|
||||
let errorText = ""
|
||||
if (!formData.hospital.trim()) {
|
||||
errorText = "请填写医院名称"
|
||||
}
|
||||
if (!formData.department.trim()) {
|
||||
errorText = "请填写科室名称"
|
||||
}
|
||||
if (errorText) {
|
||||
wx.showToast({
|
||||
title: errorText,
|
||||
icon: "none"
|
||||
})
|
||||
return;
|
||||
}
|
||||
wx.navigateTo({
|
||||
url: "/pages/joinFlow/person/index"
|
||||
})
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user