|
@@ -6,16 +6,17 @@ import {
|
|
|
} from '@/utils'
|
|
|
export default {
|
|
|
data() {
|
|
|
- return {
|
|
|
+ return {
|
|
|
isOk:false,
|
|
|
maxlength: 6,
|
|
|
- value: '',
|
|
|
+ value: '',
|
|
|
+ value2:'',
|
|
|
tel: "",
|
|
|
step: true,
|
|
|
isReady: false,
|
|
|
show: false,
|
|
|
error: "",
|
|
|
- sendMsgSecond: 60 * 5,
|
|
|
+ sendMsgSecond: 60 * 2,
|
|
|
isSendMsgIng: false,
|
|
|
showTel: "",
|
|
|
}
|
|
@@ -28,14 +29,14 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
send() {
|
|
|
-
|
|
|
+
|
|
|
var time = this.carhelp.get("getvcodetime");
|
|
|
|
|
|
if (time) {
|
|
|
var nowtime = new Date().getTime()
|
|
|
var differ = (nowtime - time) / 1000
|
|
|
- if (differ < 5 * 60) {
|
|
|
- this.sendMsgSecond = 5 * 60 - parseInt(differ)
|
|
|
+ if (differ < 2 * 60) {
|
|
|
+ this.sendMsgSecond = 2 * 60 - parseInt(differ)
|
|
|
this.tab = 4;
|
|
|
this.msgTimeInterval();
|
|
|
}
|
|
@@ -56,16 +57,17 @@ export default {
|
|
|
})
|
|
|
API.getVerifyCode(this.showTel).then((response) => {
|
|
|
|
|
|
-
|
|
|
+
|
|
|
uni.hideLoading();
|
|
|
- this.carhelp.set("getvcodetime", new Date().getTime());
|
|
|
-
|
|
|
- if (!"") { //response.message
|
|
|
- //倒计时
|
|
|
+
|
|
|
+ if (response.message) { //response.message
|
|
|
+ //倒计时
|
|
|
+ this.carhelp.set("getvcodetime", new Date().getTime());
|
|
|
+
|
|
|
this.msgTimeInterval();
|
|
|
} else {
|
|
|
uni.showToast({
|
|
|
- title: "您的验证码已经发送[5分钟有效],请勿重复点击"
|
|
|
+ title: "上一个验证码尚未过期,可继续使用"
|
|
|
})
|
|
|
}
|
|
|
}).catch(error => {
|
|
@@ -89,87 +91,97 @@ export default {
|
|
|
// change事件侦听
|
|
|
change(value) {
|
|
|
// console.log('change', value);
|
|
|
- },
|
|
|
+ },
|
|
|
submit(){
|
|
|
- var checkPhoneResult = checkPhone(this.tel);
|
|
|
-
|
|
|
- if (checkPhoneResult !== true) {
|
|
|
- uni.showToast({
|
|
|
- title: checkPhoneResult,
|
|
|
-
|
|
|
- })
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
- this.showTel=this.tel;
|
|
|
- this.step=true;
|
|
|
- this.send()
|
|
|
+
|
|
|
+ this.value="";
|
|
|
+ this.sendMsgSecond=60 * 2,
|
|
|
+
|
|
|
+ this.isSendMsgIng = false;
|
|
|
+ this.carhelp.set("getvcodetime",null)
|
|
|
+ var checkPhoneResult = checkPhone(this.tel);
|
|
|
+
|
|
|
+ if (checkPhoneResult !== true) {
|
|
|
+ uni.showToast({
|
|
|
+ title: checkPhoneResult,
|
|
|
+
|
|
|
+ })
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ this.showTel=this.tel;
|
|
|
+ this.step=true;
|
|
|
+ this.send()
|
|
|
},
|
|
|
// 输入完验证码最后一位执行
|
|
|
- finish(value) {
|
|
|
- uni.showLoading({
|
|
|
- title:"加载中"
|
|
|
- })
|
|
|
- API.validateCode({
|
|
|
- verifyCode: value,
|
|
|
- telephone:this.showTel,
|
|
|
- openId:this.carhelp.getOpenId(),
|
|
|
- }).then((response) => {
|
|
|
-
|
|
|
- if(this.tel){
|
|
|
- this.rebuildTel()
|
|
|
- }else{
|
|
|
- uni.hideLoading()
|
|
|
- this.step=false
|
|
|
- }
|
|
|
- }).catch(error => {
|
|
|
- uni.showToast({
|
|
|
- title:error,
|
|
|
- icon:"none"
|
|
|
- })
|
|
|
+ finish(value) {
|
|
|
+
|
|
|
+
|
|
|
+ uni.showLoading({
|
|
|
+ title:"加载中",mask:true,
|
|
|
+ })
|
|
|
+ API.validateCode({
|
|
|
+ verifyCode: value,
|
|
|
+ telephone:this.showTel,
|
|
|
+ openId:this.carhelp.getOpenId(),
|
|
|
+ }).then((response) => {
|
|
|
+
|
|
|
+ if(this.tel){
|
|
|
+ this.rebuildTel()
|
|
|
+ }else{
|
|
|
+ uni.hideLoading()
|
|
|
+ this.step=false
|
|
|
+ }
|
|
|
+ }).catch(error => {
|
|
|
+ uni.showToast({
|
|
|
+ title:error,
|
|
|
+ icon:"none"
|
|
|
+ })
|
|
|
})
|
|
|
- },
|
|
|
- rebuildTel(){
|
|
|
- uni.showLoading({
|
|
|
- title:"加载中"
|
|
|
- })
|
|
|
- API.rebuildTel({
|
|
|
- tel: this.tel,
|
|
|
-
|
|
|
- }).then((response) => {
|
|
|
- this.isOk=true;
|
|
|
-
|
|
|
- var obj= this.carhelp.getPersonInfo();
|
|
|
+ },
|
|
|
+ rebuildTel(){
|
|
|
+ uni.showLoading({
|
|
|
+ title:"加载中",mask:true,
|
|
|
+ })
|
|
|
+ API.rebuildTel({
|
|
|
+ tel: this.tel,
|
|
|
+
|
|
|
+ }).then((response) => {
|
|
|
+ this.isOk=true;
|
|
|
+ uni.hideLoading()
|
|
|
+ var obj= this.carhelp.getPersonInfo();
|
|
|
obj.tel=this.showTel;
|
|
|
- uni.showModal({
|
|
|
- content:response.data,
|
|
|
- showCancel:false,
|
|
|
- success() {
|
|
|
- uni.redirectTo({
|
|
|
- url: '/pages/job/personal/my/my'
|
|
|
- });
|
|
|
- }
|
|
|
- })
|
|
|
-
|
|
|
-
|
|
|
- }).catch(error => {
|
|
|
- uni.showToast({
|
|
|
- title:error,
|
|
|
- icon:"none"
|
|
|
- })
|
|
|
- })
|
|
|
+ this.carhelp.setPersonInfo(obj);
|
|
|
+ uni.showModal({
|
|
|
+ content:response.data,
|
|
|
+ showCancel:false,
|
|
|
+ success() {
|
|
|
+ uni.redirectTo({
|
|
|
+ url: '/pages/job/personal/my/my'
|
|
|
+ });
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+
|
|
|
+ }).catch(error => {
|
|
|
+ uni.showToast({
|
|
|
+ title:error,
|
|
|
+ icon:"none"
|
|
|
+ })
|
|
|
+ })
|
|
|
},
|
|
|
//倒计时
|
|
|
msgTimeInterval() {
|
|
|
this.isSendMsgIng = true;
|
|
|
var time = this.sendMsgSecond;
|
|
|
- var _this = this;
|
|
|
+ var _this = this;
|
|
|
+
|
|
|
this.timer = setInterval(() => {
|
|
|
- if (time > 0) {
|
|
|
+ if (time > 0&&_this.isSendMsgIng) {
|
|
|
_this.sendMsgSecond = time--;
|
|
|
} else {
|
|
|
_this.isSendMsgIng = false;
|
|
|
- _this.sendMsgSecond = 5 * 60;
|
|
|
+ _this.sendMsgSecond = 2 * 60;
|
|
|
clearInterval(_this.timer)
|
|
|
}
|
|
|
}, 1000)
|
|
@@ -179,8 +191,8 @@ export default {
|
|
|
onReady() {
|
|
|
this.showTel = this.carhelp.getPersonInfo().tel;
|
|
|
|
|
|
- this.isReady = true;
|
|
|
-
|
|
|
+ this.isReady = true;
|
|
|
+
|
|
|
|
|
|
},
|
|
|
onShow() {
|
|
@@ -198,4 +210,4 @@ export default {
|
|
|
return style;
|
|
|
}
|
|
|
},
|
|
|
-}
|
|
|
+}
|