Commit 4ef770e2 by chenwq

技师手机号

1 parent 73e7732a
const phoneRex = /^[1]([3-9])[0-9]{9}$/
const editFormRule = {
technicianName: [{ required: true, message: '技师名称不能为空' }]
}
const formRule = {
technicianName: [{ required: true, message: '技师名称不能为空' }],
technicianPhone: [{ required: true, message: '手机号不能为空' },
......@@ -25,6 +28,7 @@ const formItems = [{
}]
export default {
editFormRule,
formRule,
formItems
}
\ No newline at end of file
......@@ -29,7 +29,7 @@ Page({
let { attr } = e.currentTarget.dataset
let { value } = e.detail
this.setData({
['formData.' + attr]: value.replace(/(^\s*)|(\s*$)/g,"")
['formData.' + attr]: value.replace(/(^\s*)|(\s*$)/g, "")
})
},
......@@ -75,7 +75,7 @@ Page({
merchantId: customerInfo.serviceCenterMerchantId,
merchantName: customerInfo.serviceCenterMerchantName
}
let validObj = wx.$util.checkRule(formData, constantData.formRule)
let validObj = wx.$util.checkRule(formData, addOrEdit == 'add' ? constantData.formRule : constantData.editFormRule)
if (validObj) {
wx.$api.showToast(validObj.message)
return
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!