36 lines
834 B
JavaScript
36 lines
834 B
JavaScript
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"
|
|
})
|
|
}
|
|
}) |