This commit is contained in:
2020-09-09 09:33:08 +08:00
parent 52caeef425
commit 89ddba5321
3 changed files with 9 additions and 7 deletions

View File

@@ -19,7 +19,7 @@
<view class="personal" v-show="type==1">
<view class="info-item">
<view class="title">手机号</view>
<input type="number" placeholder="请输入您的手机号" maxlength="11" v-model="personalPhone" />
<input type="text" placeholder="请输入您的手机号" maxlength="11" v-model="personalPhone" />
</view>
<view class="info-item">
<view class="title">身份证号</view>
@@ -37,7 +37,7 @@
</view>
<view class="info-item">
<view class="title">电话号码</view>
<input type="number" placeholder="请输入公司电话" maxlength="11" v-model="companyPhone" />
<input type="text" placeholder="请输入公司电话" maxlength="11" v-model="companyPhone" />
</view>
<view class="info-item">
<view class="title">开户银行</view>
@@ -91,6 +91,7 @@ export default {
this.action == 1 ? this.invoiceAdd() : this.invoiceEdit();
},
verificationParams() {
const phone = /^0\d{2,3}-?\d{7,8}$/;
if(this.type == 1) {
if(this.$u.test.isEmpty(this.title)) {
this.$u.toast('发票抬头不可为空');
@@ -100,7 +101,8 @@ export default {
this.$u.toast('手机号不可为空');
return false;
}
if(!this.$u.test.mobile(this.personalPhone)) {
console.log(phone.test(this.personalPhone));
if(!this.$u.test.mobile(this.personalPhone) && !phone.test(this.personalPhone)) {
this.$u.toast('请正确填写手机号');
return false;
}
@@ -129,7 +131,7 @@ export default {
this.$u.toast('电话号码不可为空');
return false;
}
if(!this.$u.test.mobile(this.companyPhone)) {
if(!this.$u.test.mobile(this.companyPhone) && !phone.test(this.companyPhone)) {
this.$u.toast('请正确填写电话号码');
return false;
}