Commit 8cb47d5d authored by sixiaofeng's avatar sixiaofeng

邮箱短号输入长度限制/邮箱验证

parent 721415f4
NODE_ENV=production
VUE_APP_QRCODE_URL=http://121.40.18.70:8889
VUE_APP_ENV=people
\ No newline at end of file
......@@ -155,13 +155,29 @@ export default Vue.extend({
const value = (e.target as HTMLInputElement).value
this.length = value.length
if (this.limit > 0 && this.length >= this.limit) {
(e.target as HTMLInputElement).value = this.value
this.$emit('input', value.slice(0, this.limit))
this.length = this.limit;
(e.target as HTMLInputElement).value = this.value
} else {
this.$emit('input', value)
}
},
checkVal(val: string) {
if (this.required && !this.checkIfEmpty(val)) {
this.isError = true
this.errorMessage = this.errorMsg || '值不能为空'
this.$emit('input', '')
return
}
if (typeof this.validator === 'function' && this.checkIfEmpty(val)) {
this.validator(val, (x: Error) => {
if (typeof x !== 'undefined') {
this.isError = true
this.errorMessage = x.message
}
})
}
},
handleBlur(e: InputEvent) {
const value = (e.target as HTMLInputElement).value
if (this.required && !this.checkIfEmpty(value)) {
......
......@@ -65,7 +65,7 @@
title="邮箱"
placeholder="请输入邮箱"
type="input"
:limit="30"
:limit="23"
:validator="checkMail"
/>
<c-cell
......@@ -204,7 +204,10 @@ export default Vue.extend({
},
methods: {
validateParmas(): boolean {
const {phone, name} = this.acceptJoin
const {phone, name, email} = this.acceptJoin
if (typeof email !== 'undefined' && email !== '') {
return !validateMail(email)
}
return !validatePhone(phone) || name === ''
},
getStaff(id: string) {
......
......@@ -60,7 +60,7 @@
<c-cell
v-model="detail.email"
title="邮箱"
:limit="30"
:limit="23"
placeholder="请输入邮箱"
type="input"
:validator="checkMail"
......@@ -304,6 +304,14 @@ export default Vue.extend({
},
confirm() {
const {fromName, position, phone, shortPhone, email} = this.detail
let check = true
if (typeof email !== 'undefined' && email !== '') {
check = validateMail(email)
}
if (!check) {
this.$toast('请检查输入内容')
return
}
const data = {
fromName, position, phone, shortPhone, email,
joinTime: this.joinTime,
......
......@@ -61,7 +61,7 @@
title="邮箱"
placeholder="请输入邮箱"
type="input"
:limit="30"
:limit="23"
:validator="checkMail"
/>
<input-cell
......@@ -196,6 +196,10 @@ export default Vue.extend({
this.$toast('请检查输入内容')
return
}
if (typeof email !== 'undefined' && email !== '' && !validateMail(email)) {
this.$toast('请检查输入内容')
return
}
const data = {
entId, phone, reason, userName, shortPhone, email, types: 1
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment