Commit 3795bd5b by 前端

Merge branch 'chenwq_dev_v2.6.0' into 'v2.6.0'

手机号验证

See merge request !246
2 parents b249837c 71ddd0e5
...@@ -180,7 +180,7 @@ export default { ...@@ -180,7 +180,7 @@ export default {
name: 'editActivity', name: 'editActivity',
data() { data() {
var validatorPhone = function (rule, value, callback) { var validatorPhone = function (rule, value, callback) {
if (!/^(0|86|17951)?(13[0-9]|15[0123456789]|17[678]|18[0-9]|14[57])[0-9]{8}$/.test(value)) { if (value && !/^(0|86|17951)?(13[0-9]|15[0123456789]|17[678]|18[0-9]|14[57])[0-9]{8}$/.test(value)) {
callback(new Error('手机号格式错误')) callback(new Error('手机号格式错误'))
} else { } else {
callback() callback()
...@@ -276,7 +276,6 @@ export default { ...@@ -276,7 +276,6 @@ export default {
// selectedAllProList: [], // selectedAllProList: [],
// selectedProList: [], // selectedProList: [],
editRule: { editRule: {
customerServicePhone: { required: false, validator: validatorPhone, trigger: 'blur' },
activityName: [{ required: true, message: '请输入活动名称', trigger: 'change' }], activityName: [{ required: true, message: '请输入活动名称', trigger: 'change' }],
activityImg: [{ required: true, message: '请选择活动宣传图', trigger: 'change' }], activityImg: [{ required: true, message: '请选择活动宣传图', trigger: 'change' }],
promotion: [{ required: true, message: '请输入活动宣传语', trigger: 'change' }], promotion: [{ required: true, message: '请输入活动宣传语', trigger: 'change' }],
...@@ -314,6 +313,7 @@ export default { ...@@ -314,6 +313,7 @@ export default {
} }
], ],
// 活动配置 // 活动配置
customerServicePhone: { required: false, validator: validatorPhone, trigger: 'change' },
fictitiousViewQuantity: [ fictitiousViewQuantity: [
{ {
validator: (rule, value, callback) => { validator: (rule, value, callback) => {
...@@ -1125,7 +1125,16 @@ export default { ...@@ -1125,7 +1125,16 @@ export default {
this.$refs.configEditFormRef.$refs[this.editChildRef].validate((configValid, configErrorObj) => { this.$refs.configEditFormRef.$refs[this.editChildRef].validate((configValid, configErrorObj) => {
validList.push({ valid: !configValid, errorObj: configErrorObj }) validList.push({ valid: !configValid, errorObj: configErrorObj })
if (this.checkValid(validList)) { if (this.checkValid(validList)) {
this.addOrUpdate() if (this.$refs.serviceEditFormRef) {
this.$refs.serviceEditFormRef.$refs[this.editChildRef].validate((serviceValid, serviceErrorObj) => {
validList.splice(2, 0, { valid: !serviceValid, errorObj: serviceErrorObj })
if (this.checkValid(validList)) {
this.addOrUpdate()
}
})
} else {
this.addOrUpdate()
}
} }
}) })
}) })
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!