Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
hello uni-id-pages-x
提交
0982a2b5
H
hello uni-id-pages-x
项目概览
DCloud
/
hello uni-id-pages-x
通知
43
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
H
hello uni-id-pages-x
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
0982a2b5
编写于
1月 29, 2024
作者:
A
Anne_LXM
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Element-->UniElement
上级
ebe962ca
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
19 addition
and
20 deletion
+19
-20
uni_modules/uni-id-pages-x/components/uni-id-pages-x-input/uni-id-pages-x-input.uvue
...components/uni-id-pages-x-input/uni-id-pages-x-input.uvue
+1
-1
uni_modules/uni-id-pages-x/components/uni-id-pages-x-popup-dialog/uni-id-pages-x-popup-dialog.uvue
...-id-pages-x-popup-dialog/uni-id-pages-x-popup-dialog.uvue
+1
-1
uni_modules/uni-id-pages-x/components/uni-id-pages-x-smsCode/fab-sms-code-input.uvue
...components/uni-id-pages-x-smsCode/fab-sms-code-input.uvue
+11
-12
uni_modules/uni-id-pages-x/components/uni-id-pages-x-smsCode/uni-id-pages-x-smsCode.uvue
...onents/uni-id-pages-x-smsCode/uni-id-pages-x-smsCode.uvue
+6
-6
未找到文件。
uni_modules/uni-id-pages-x/components/uni-id-pages-x-input/uni-id-pages-x-input.uvue
浏览文件 @
0982a2b5
...
...
@@ -103,7 +103,7 @@
// this.$emit('update:focus', true);
},
setFocus(state : boolean) {
const inputEl = this.$refs['input'] as Element
const inputEl = this.$refs['input'] as
Uni
Element
if (state) {
inputEl.focus();
} else {
...
...
uni_modules/uni-id-pages-x/components/uni-id-pages-x-popup-dialog/uni-id-pages-x-popup-dialog.uvue
浏览文件 @
0982a2b5
...
...
@@ -32,7 +32,7 @@
confirmCallBack = callback;
(this.$refs['popup'] as UniPopupComponentPublicInstance).open();
this.$nextTick(() => {
(this.$refs['input'] as Element).focus()
(this.$refs['input'] as
Uni
Element).focus()
})
},
cancel() {
...
...
uni_modules/uni-id-pages-x/components/uni-id-pages-x-smsCode/fab-sms-code-input.uvue
浏览文件 @
0982a2b5
...
...
@@ -5,8 +5,9 @@
<text class="sms-code-title">{{title}}</text>
<text class="sms-code-tip">短信验证码已发送至{{mobile}}</text>
<view class="code-input-list">
<template v-for="(item,i) in smsCodeList" :key="i">
<input @input="setSmsCode(i,$event as InputEvent)" :value="item" type="number" ref="code-input"
<template v-for="(_,i) in smsCodeList" :key="i">
<!-- TODO APP :value="item" -->
<input @input="setSmsCode(i,$event as InputEvent)" type="number" ref="code-input"
class="code-input" maxlength="7" @focus="onFocus(i)" />
</template>
</view>
...
...
@@ -23,7 +24,7 @@
emits: ["update:modelValue","reGetSmsCode","blur", "focus" ],
data() {
return {
smsCodeList: ["\u200b", "\u200b", "\u200b", "\u200b", "\u200b", "\u200b"],
smsCodeList: ["\u200b", "\u200b", "\u200b", "\u200b", "\u200b", "\u200b"],
isOpen: false
}
},
...
...
@@ -63,7 +64,7 @@
show() {
(this.$refs['popup'] as UniPopupComponentPublicInstance).open();
this.$nextTick(() => {
(this.$refs["code-input"] as Element[])[0].focus();
(this.$refs["code-input"] as
Uni
Element[])[0].focus();
})
this.isOpen = true
},
...
...
@@ -75,28 +76,26 @@
clear() {
this.smsCodeList = ["\u200b", "\u200b", "\u200b", "\u200b", "\u200b", "\u200b"];
if (this.isOpen) {
(this.$refs["code-input"] as Element[])[0].focus();
(this.$refs["code-input"] as
Uni
Element[])[0].focus();
// console.log('clear success');
} else {
// console.log('已经关了,不能清空');
}
},
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) => {
// console.log('index', index, item);
this.smsCodeList[index] = "\u200b" + item
})
return
}
// 限制每个空格内的文字不超过2位
if (value.length > 2) {
this.$nextTick(() => {
...
...
@@ -105,7 +104,6 @@
this.smsCodeList[i] = newValue
})
}
// 被删除完就直接后退一格
if (value.length == 0) {
this.smsCodeList[i] = ""
...
...
@@ -113,19 +111,20 @@
this.smsCodeList[i] = '\u200b'
})
if (i != 0) {
(this.$refs["code-input"] as Element[])[i - 1].focus();
(this.$refs["code-input"] as
Uni
Element[])[i - 1].focus();
this.smsCodeList[i - 1] = ""
}
} else if (value != "\u200b") {
this.smsCodeList[i] = value;
if (i != (this.smsCodeList.length - 1)) {
(this.$refs["code-input"] as Element[])[i + 1].focus();
(this.$refs["code-input"] as
Uni
Element[])[i + 1].focus();
} else {
// console.log(i, (this.smsCodeList.length - 1));
}
}
},
onFocus(i : number) {
// console.log("onFocus",i);
if (this.smsCodeList[i].length == 0) {
this.smsCodeList[i] = '\u200b'
}
...
...
uni_modules/uni-id-pages-x/components/uni-id-pages-x-smsCode/uni-id-pages-x-smsCode.uvue
浏览文件 @
0982a2b5
...
...
@@ -137,12 +137,12 @@
if (state.pendingAgreements) {
// uni.hideKeyboard();
this.sendSmsCaptchaCP!.setFocus(false);
// web端
尚未完全支持
// (this.$parent as ComponentPublicInstance).$callMethod("showPopupCaptcha", () => {
// if (!state.pendingAgreements) {
// this.sendSmsCode()
// }
// });
// web端
有问题
// (this.$parent as ComponentPublicInstance).$callMethod("showPopupCaptcha", () => {
// if (!state.pendingAgreements) {
// this.sendSmsCode()
// }
// });
// 临时方案
uni.$emit('uni-id-pages-x-loginBySmsCode-showPopupCaptcha',()=>{
if (!state.pendingAgreements) {
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录