|
|
|
|
|
|
|
|
icon: 'success', |
|
|
icon: 'success', |
|
|
duration: 500 |
|
|
duration: 500 |
|
|
}) |
|
|
}) |
|
|
|
|
|
}else{ |
|
|
|
|
|
wx.showToast({ |
|
|
|
|
|
title: e.message, |
|
|
|
|
|
icon: 'none', |
|
|
|
|
|
duration: 500 |
|
|
|
|
|
}) |
|
|
} |
|
|
} |
|
|
}, this) |
|
|
}, this) |
|
|
}, |
|
|
}, |
|
|
sendTouch:function(){//发送验证码 |
|
|
sendTouch:function(){//发送验证码 |
|
|
if (!(/^1[3456789]\d{9}$/.test(this.data.phone))) { |
|
|
|
|
|
|
|
|
if (this.data.phone){ |
|
|
|
|
|
if (!(/^1[3456789]\d{9}$/.test(this.data.phone))) { |
|
|
wx.showToast({ |
|
|
wx.showToast({ |
|
|
title: '手机号错误', |
|
|
title: '手机号错误', |
|
|
icon: 'none', |
|
|
icon: 'none', |
|
|
duration: 500 |
|
|
duration: 500 |
|
|
}) |
|
|
}) |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
}else{ |
|
|
|
|
|
wx.showToast({ |
|
|
|
|
|
title: '请先输入手机号', |
|
|
|
|
|
icon: 'none', |
|
|
|
|
|
duration: 500 |
|
|
|
|
|
}) |
|
|
return; |
|
|
return; |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
this.setData({ |
|
|
this.setData({ |
|
|
yesSend: true, |
|
|
yesSend: true, |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
if (this.data.yesRegister){ |
|
|
if (this.data.yesRegister){ |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
this.data.yesRegister = true; |
|
|
|
|
|
|
|
|
if(this.data.phone){ |
|
|
|
|
|
if (!(/^1[3456789]\d{9}$/.test(this.data.phone))) { |
|
|
|
|
|
wx.showToast({ |
|
|
|
|
|
title: '手机号错误', |
|
|
|
|
|
icon: 'none', |
|
|
|
|
|
duration: 500 |
|
|
|
|
|
}) |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
}else{ |
|
|
|
|
|
wx.showToast({ |
|
|
|
|
|
title: '请先输入手机号', |
|
|
|
|
|
icon: 'none', |
|
|
|
|
|
duration: 500 |
|
|
|
|
|
}) |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
if (!this.data.phoneCode){ |
|
|
|
|
|
wx.showToast({ |
|
|
|
|
|
title: '请先输入验证码', |
|
|
|
|
|
icon: 'none', |
|
|
|
|
|
duration: 500 |
|
|
|
|
|
}) |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
app.wxRequest(app.globalData.httpUrl + 'register', { user_phone: this.data.phone, code_num: this.data.phoneCode }, e => { |
|
|
app.wxRequest(app.globalData.httpUrl + 'register', { user_phone: this.data.phone, code_num: this.data.phoneCode }, e => { |
|
|
console.log(e) |
|
|
console.log(e) |
|
|
|
|
|
this.data.yesRegister = true; |
|
|
if (e.code == 200) { |
|
|
if (e.code == 200) { |
|
|
clearInterval(time); |
|
|
clearInterval(time); |
|
|
app.globalData.userInfo = e.data.user_phone |
|
|
app.globalData.userInfo = e.data.user_phone |
|
|
this.data.yesRegister = false; |
|
|
|
|
|
this.setData({ |
|
|
this.setData({ |
|
|
minter: 60, |
|
|
minter: 60, |
|
|
num: 60 |
|
|
num: 60 |
|
|
|
|
|
|
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
}, 1000) |
|
|
}, 1000) |
|
|
}else{ |
|
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
this.data.yesRegister = false; |
|
|
wx.showToast({ |
|
|
wx.showToast({ |
|
|
title: e.message, |
|
|
title: e.message, |
|
|
|
|
|
icon:"none", |
|
|
duration:500 |
|
|
duration:500 |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |