modifyPhone: function(e) {
//正则表达式,验证手机号格式
//\d:表示[0-9]
//^: 开头
//$: 结尾
var phoneReg = /^1[3456789]\d{9}$/
//如果验证失败,返回false
if(!phoneReg.test(e.detail.value)){
wx.showToast({
title: '手机号格式不正确',
icon: 'none',
duration: 2000
})
this.data.addressData.phone = ''
}else{
this.data.addressData.phone = e.detail.value;
}
this.setData({
addressData: this.data.addressData,
});
},