diff --git a/uni_modules/uni-id-pages-x/components/uni-id-pages-x-loginBySmsCode/uni-id-pages-x-loginBySmsCode.uvue b/uni_modules/uni-id-pages-x/components/uni-id-pages-x-loginBySmsCode/uni-id-pages-x-loginBySmsCode.uvue
index 981f8bd0dcdde420f361f0dcda602c83c878f24f..0a5ca6a86443c005f39b404f08541ff14cb438c5 100644
--- a/uni_modules/uni-id-pages-x/components/uni-id-pages-x-loginBySmsCode/uni-id-pages-x-loginBySmsCode.uvue
+++ b/uni_modules/uni-id-pages-x/components/uni-id-pages-x-loginBySmsCode/uni-id-pages-x-loginBySmsCode.uvue
@@ -34,7 +34,7 @@
},
methods: {
sendSmsCode() {
- this.smsCodeRef!.$callMethod('sendSmsCode');
+ this.smsCodeRef!.$callMethod('sendSmsCode',true);
},
smsCodeInput(param : UTSJSONObject) {
// console.log('smsCodeInput param', param);
diff --git a/uni_modules/uni-id-pages-x/components/uni-id-pages-x-smsCode/fab-sms-code-input.uvue b/uni_modules/uni-id-pages-x/components/uni-id-pages-x-smsCode/fab-sms-code-input.uvue
index 786e509398976c79117461d0e30f4ee30aee63be..62e611400a71149c8843cc7a54f08805f7bf8ebd 100644
--- a/uni_modules/uni-id-pages-x/components/uni-id-pages-x-smsCode/fab-sms-code-input.uvue
+++ b/uni_modules/uni-id-pages-x/components/uni-id-pages-x-smsCode/fab-sms-code-input.uvue
@@ -6,7 +6,7 @@
短信验证码已发送至{{mobile}}
-
+
@@ -71,7 +71,6 @@
hide() {
(this.$refs['popup'] as UniPopupComponentPublicInstance).close();
this.isOpen = false
- // console.log('hide success');
},
clear() {
this.smsCodeList = ["\u200b", "\u200b", "\u200b", "\u200b", "\u200b", "\u200b"];
@@ -83,14 +82,12 @@
}
},
setSmsCode(i : number, e : InputEvent) {
- // console.log('setSmsCode--',e);
const { value } = e.detail
- console.log('~~',value,value.length);
+ // console.log('~~',value,value.length);
// 已满6位数就直接调登录
let $value = value.replace(/\u200b/g, '')
if ($value.length == 6) {
// (this.$refs["code-input"] as Element[])[0].focus();
- // console.log('~~~~~', $value, $value.split(''));
$value.split('').forEach((item : string, index : number) => {
this.smsCodeList[index] = "\u200b" + item
})
@@ -100,7 +97,6 @@
if (value.length > 2) {
this.$nextTick(() => {
let newValue = value.slice(value.length - 1)
- // console.log('newValue', newValue);
this.smsCodeList[i] = newValue
})
}
@@ -124,7 +120,6 @@
}
},
onFocus(i : number) {
- // console.log("onFocus",i);
if (this.smsCodeList[i].length == 0) {
this.smsCodeList[i] = '\u200b'
}
diff --git a/uni_modules/uni-id-pages-x/components/uni-id-pages-x-smsCode/uni-id-pages-x-smsCode.uvue b/uni_modules/uni-id-pages-x/components/uni-id-pages-x-smsCode/uni-id-pages-x-smsCode.uvue
index 24d20c58062e8fe557262e67363dccc4245f1add..58a7ce9e9351e2712c89e6ec45cc08ed862bdfeb 100644
--- a/uni_modules/uni-id-pages-x/components/uni-id-pages-x-smsCode/uni-id-pages-x-smsCode.uvue
+++ b/uni_modules/uni-id-pages-x/components/uni-id-pages-x-smsCode/uni-id-pages-x-smsCode.uvue
@@ -61,7 +61,7 @@
sendSmsCaptcha() {
this.emitInput()
if (this.autoSend && this.sendSmsCaptcha.length == 4 && this.mobile.length == 11) {
- this.sendSmsCode()
+ this.sendSmsCode(true)
}
},
smsCode() {
@@ -71,7 +71,6 @@
mounted() {
this.fabSmsCodeInputEl = this.$refs["fab-sms-code-input"] as ComponentPublicInstance;
this.sendSmsCaptchaCP = this.$refs["sendSmsCaptcha"] as UniCaptchaComponentPublicInstance;
-
// 加载好,手机号码输入框就自动获取焦点
// TO 临时方案解决 this.$nextTick 无效,由setTimeout 300 代替
setTimeout(() => {
@@ -130,14 +129,13 @@
this.sendSmsCaptcha = ""
this.clearCodeInput()
this.hideCodeInput()
- // console.log('reset');
},
- sendSmsCode() {
- console.log("state.pendingAgreements", state.pendingAgreements);
- if (state.pendingAgreements) {
+ sendSmsCode(needAgreements:boolean) {
+ // console.log("state.pendingAgreements", state.pendingAgreements,needAgreements);
+ if (needAgreements && state.pendingAgreements) {
// uni.hideKeyboard();
this.sendSmsCaptchaCP!.setFocus(false);
- // web端有问题
+ // TODO web端有问题
// (this.$parent as ComponentPublicInstance).$callMethod("showPopupCaptcha", () => {
// if (!state.pendingAgreements) {
// this.sendSmsCode()
@@ -146,7 +144,7 @@
// 临时方案
uni.$emit('uni-id-pages-x-loginBySmsCode-showPopupCaptcha',()=>{
if (!state.pendingAgreements) {
- this.sendSmsCode()
+ this.sendSmsCode(false)
}
})
uni.showToast({
@@ -155,12 +153,10 @@
});
return
}
- // console.log('sendSmsCode');
// 如果还在倒计时就显示出来输入框,阻止发送
if (this.reverseNumber != 0) {
return this.showCodeInput()
}
-
let reg_mobile = /^1\d{10}$/;
if (!reg_mobile.test(this.mobile)) {
(this.$refs['mobileInput'] as UniIdPagesXInputComponentPublicInstance).setFocus(true)
@@ -171,7 +167,6 @@
})
return
}
-
if (this.sendSmsCaptcha.length != 4) {
this.sendSmsCaptchaCP!.setFocus(true)
uni.showToast({
@@ -181,14 +176,12 @@
});
return
}
-
// const param : UTSJSONObject
// console.log('sendSmsCode',{
// "mobile": this.mobile,
// "scene": "login-by-sms",
// "captcha": this.sendSmsCaptcha
// });
-
uni.showLoading({ "title": "发送中" })
const uniIdCo = uniCloud.importObject("uni-id-co", { "customUI": true })
uniIdCo.sendSmsCode({
@@ -205,14 +198,12 @@
icon: 'none',
duration: 3000
});
- // console.log('result', result);
this.showCodeInput()
})
.catch((err : any | null) : void => {
const error = err as UniCloudError
// console.error(error.message)
// console.error(error.code)
-
switch (error.code) {
case "uni-captcha-verify-fail":
uni.showToast({
diff --git a/uni_modules/uni-id-pages-x/pages/retrieve/retrieve.uvue b/uni_modules/uni-id-pages-x/pages/retrieve/retrieve.uvue
index 32ed41a2790fc7c4a9a76a97feeed0afed8f32e4..b4e1b84ae7a4db3601aa4ca6409899bd01251e84 100644
--- a/uni_modules/uni-id-pages-x/pages/retrieve/retrieve.uvue
+++ b/uni_modules/uni-id-pages-x/pages/retrieve/retrieve.uvue
@@ -84,7 +84,7 @@
}
});
}
- this.smsCodeRef!.sendSmsCode();
+ this.smsCodeRef!.sendSmsCode(false);
},
resetPwdBySms(param : UTSJSONObject) {
uni.showLoading({ "title": "请求中" })
@@ -95,8 +95,6 @@
uni.hideLoading()
})
.then((_ : UTSJSONObject) : void => {
- // console.log('then');
- // console.log(e);
this.smsCodeRef!.hideCodeInput();
uni.showToast({
title: '重置成功',
diff --git a/uni_modules/uni-id-pages-x/pages/userinfo/bindMobile/bindMobile.uvue b/uni_modules/uni-id-pages-x/pages/userinfo/bindMobile/bindMobile.uvue
index 96d3058f4584ee75bf294812368c7c06ec96435f..f82f6c2514fefa1033ca2c43d980baa73ea0faea 100644
--- a/uni_modules/uni-id-pages-x/pages/userinfo/bindMobile/bindMobile.uvue
+++ b/uni_modules/uni-id-pages-x/pages/userinfo/bindMobile/bindMobile.uvue
@@ -23,16 +23,12 @@
captcha: ""
}
},
- computed: {
- },
- watch: {
- },
mounted() {
this.smsCodeEl = (this.$refs["smsCode"] as UniIdPagesXSmsCodeComponentPublicInstance)
},
methods: {
sendSmsCode() {
- this.smsCodeEl!.sendSmsCode();
+ this.smsCodeEl!.sendSmsCode(false);
},
smsCodeInput(param : UTSJSONObject) {
// console.log('smsCodeInput param', param);
@@ -70,7 +66,7 @@
uni.hideLoading()
})
.then((e : UTSJSONObject) : void => {
- console.log(e,"-----------");
+ // console.log(e);
uni.showToast({
title: '绑定成功',
icon: 'none',