订单手机号,身份证去除空格

This commit is contained in:
老叶
2022-08-09 15:39:10 +08:00
parent f2d5e79464
commit fdaa89d42a
3 changed files with 45 additions and 0 deletions
+15
View File
@@ -354,6 +354,12 @@ Page({
nextstep(){
switch (this.data.step) {
case 1:
this.setData({
mobile:this.trimAll(this.data.mobile),
cardid:this.trimAll(this.data.cardid),
owner_mobile:this.trimAll(this.data.owner_mobile),
owner_cardid:this.trimAll(this.data.owner_cardid),
})
if (this.data.customerIndex == -1 ) {
wx.showToast({
title: '请选择客户',
@@ -1262,4 +1268,13 @@ Page({
this.getAppCusorderV2()
},
//去除空格
trimAll(ele){
if(typeof ele === 'string'){
return ele.split(' ').join('');
}else{
console.error(`${typeof ele} is not the expected type, but the string type is expected`)
}
},
})
+9
View File
@@ -287,4 +287,13 @@ Page({
}
},
//去除空格
trimAll(ele){
if(typeof ele === 'string'){
return ele.split(' ').join('');
}else{
console.error(`${typeof ele} is not the expected type, but the string type is expected`)
}
},
})
+21
View File
@@ -123,6 +123,12 @@ Page({
nextstep(){
switch (this.data.step) {
case 1:
this.setData({
mobile:this.trimAll(this.data.mobile),
cardid:this.trimAll(this.data.cardid),
owner_mobile:this.trimAll(this.data.owner_mobile),
owner_cardid:this.trimAll(this.data.owner_cardid),
})
if (this.data.name == '' ) {
wx.showToast({
title: '请输入客户姓名',
@@ -740,6 +746,12 @@ Page({
//点击收取意向金
createV2Inten() {
this.setData({
mobile:this.trimAll(this.data.mobile),
cardid:this.trimAll(this.data.cardid),
owner_mobile:this.trimAll(this.data.owner_mobile),
owner_cardid:this.trimAll(this.data.owner_cardid),
})
if (this.data.name == '' ) {
wx.showToast({
title: '请输入客户姓名',
@@ -1359,4 +1371,13 @@ Page({
})
},
//去除空格
trimAll(ele){
if(typeof ele === 'string'){
return ele.split(' ').join('');
}else{
console.error(`${typeof ele} is not the expected type, but the string type is expected`)
}
},
})