Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
hello_uni-id-pages
提交
15c6de13
H
hello_uni-id-pages
项目概览
DCloud
/
hello_uni-id-pages
通知
1054
Star
31
Fork
43
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
4
列表
看板
标记
里程碑
合并请求
2
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
H
hello_uni-id-pages
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
4
Issue
4
列表
看板
标记
里程碑
合并请求
2
合并请求
2
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
15c6de13
编写于
11月 23, 2022
作者:
C
chenruilong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
新增 设置密码页面
上级
78837301
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
177 addition
and
7 deletion
+177
-7
uni_modules/uni-id-pages/components/uni-id-pages-sms-form/uni-id-pages-sms-form.vue
...omponents/uni-id-pages-sms-form/uni-id-pages-sms-form.vue
+7
-7
uni_modules/uni-id-pages/pages/userinfo/set-pwd/set-pwd.vue
uni_modules/uni-id-pages/pages/userinfo/set-pwd/set-pwd.vue
+170
-0
未找到文件。
uni_modules/uni-id-pages/components/uni-id-pages-sms-form/uni-id-pages-sms-form.vue
浏览文件 @
15c6de13
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
<view>
<view>
<uni-captcha
:focus=
"focusCaptchaInput"
ref=
"captcha"
scene=
"send-sms-code"
v-model=
"captcha"
/>
<uni-captcha
:focus=
"focusCaptchaInput"
ref=
"captcha"
scene=
"send-sms-code"
v-model=
"captcha"
/>
<view
class=
"box"
>
<view
class=
"box"
>
<uni-easyinput
:focus=
"focusSmsCodeInput"
@
blur=
"focusSmsCodeInput = false"
type=
"number"
class=
"input-box"
:inputBorder=
"false"
v-model=
"modelValue"
maxlength=
"6"
<uni-easyinput
:focus=
"focusSmsCodeInput"
@
blur=
"focusSmsCodeInput = false"
type=
"number"
class=
"input-box"
:inputBorder=
"false"
v-model=
"modelValue"
maxlength=
"6"
:clearable=
"false"
placeholder=
"请输入短信验证码"
>
placeholder=
"请输入短信验证码"
>
</uni-easyinput>
</uni-easyinput>
<view
class=
"short-code-btn"
hover-class=
"hover"
@
click=
"start"
>
<view
class=
"short-code-btn"
hover-class=
"hover"
@
click=
"start"
>
...
...
uni_modules/uni-id-pages/pages/userinfo/set-pwd/set-pwd.vue
0 → 100644
浏览文件 @
15c6de13
<!-- 设置密码 -->
<
template
>
<view
class=
"uni-content"
>
<match-media
:min-width=
"690"
>
<view
class=
"login-logo"
>
<image
:src=
"logo"
></image>
</view>
<!-- 顶部文字 -->
<text
class=
"title title-box "
>
设置密码
</text>
</match-media>
<uni-forms
class=
"set-password-form"
ref=
"form"
:value=
"formData"
err-show-type=
"toast"
>
<text
class=
"tip"
>
输入密码
</text>
<uni-forms-item
name=
"newPassword"
>
<uni-easyinput
:focus=
"focusNewPassword"
@
blur=
"focusNewPassword = false"
class=
"input-box"
type=
"password"
:inputBorder=
"false"
v-model=
"formData.newPassword"
placeholder=
"请输入密码"
>
</uni-easyinput>
</uni-forms-item>
<text
class=
"tip"
>
再次输入密码
</text>
<uni-forms-item
name=
"newPassword2"
>
<uni-easyinput
:focus=
"focusNewPassword2"
@
blur=
"focusNewPassword2 = false"
class=
"input-box"
type=
"password"
:inputBorder=
"false"
v-model=
"formData.newPassword2"
placeholder=
"请再次输入新密码"
>
</uni-easyinput>
</uni-forms-item>
<uni-id-pages-sms-form
v-model=
"formData.code"
type=
"set-pwd-by-sms"
ref=
"smsCode"
:phone=
"userInfo.mobile"
>
</uni-id-pages-sms-form>
<view
class=
"link-box"
>
<button
class=
"uni-btn send-btn"
type=
"primary"
@
click=
"submit"
>
确认
</button>
<button
v-if=
"allowSkip"
class=
"uni-btn send-btn"
type=
"default"
@
click=
"skip"
>
跳过
</button>
</view>
</uni-forms>
<uni-popup-captcha
@
confirm=
"submit"
v-model=
"formData.captcha"
scene=
"set-pwd-by-sms"
ref=
"popup"
></uni-popup-captcha>
</view>
</
template
>
<
script
>
import
passwordMod
from
'
@/uni_modules/uni-id-pages/common/password.js
'
import
{
store
,
mutations
}
from
'
@/uni_modules/uni-id-pages/common/store.js
'
import
config
from
'
@/uni_modules/uni-id-pages/config.js
'
const
uniIdCo
=
uniCloud
.
importObject
(
"
uni-id-co
"
,
{
customUI
:
true
})
export
default
{
name
:
"
set-pwd.vue
"
,
data
()
{
return
{
uniIdRedirectUrl
:
''
,
loginType
:
''
,
logo
:
'
/static/logo.png
'
,
focusNewPassword
:
false
,
focusNewPassword2
:
false
,
allowSkip
:
false
,
formData
:
{
code
:
""
,
captcha
:
""
,
newPassword
:
""
,
newPassword2
:
""
},
rules
:
passwordMod
.
getPwdRules
(
'
newPassword
'
,
'
newPassword2
'
)
}
},
computed
:
{
userInfo
()
{
return
store
.
userInfo
}
},
onReady
()
{
this
.
$refs
.
form
.
setRules
(
this
.
rules
)
},
onLoad
(
e
)
{
this
.
uniIdRedirectUrl
=
e
.
uniIdRedirectUrl
this
.
loginType
=
e
.
loginType
if
(
config
.
setPasswordAfterLogin
&&
config
.
setPasswordAfterLogin
?.
allowSkip
)
{
this
.
allowSkip
=
true
}
},
methods
:
{
submit
()
{
if
(
!
/^
\d{6}
$/
.
test
(
this
.
formData
.
code
)){
this
.
$refs
.
smsCode
.
focusSmsCodeInput
=
true
return
uni
.
showToast
({
title
:
'
验证码格式不正确
'
,
icon
:
'
none
'
});
}
this
.
$refs
.
form
.
validate
()
.
then
(
res
=>
{
uniIdCo
.
setPwd
({
password
:
this
.
formData
.
newPassword
,
code
:
this
.
formData
.
code
,
captcha
:
this
.
formData
.
captcha
}).
then
(
e
=>
{
uni
.
showModal
({
content
:
'
密码设置成功
'
,
showCancel
:
false
,
success
:
()
=>
{
mutations
.
loginBack
({
uniIdRedirectUrl
:
this
.
uniIdRedirectUrl
,
loginType
:
this
.
loginType
})
}
});
}).
catch
(
e
=>
{
uni
.
showModal
({
content
:
e
.
message
,
showCancel
:
false
});
})
}).
catch
(
e
=>
{
if
(
e
.
errCode
==
'
uni-id-captcha-required
'
)
{
this
.
$refs
.
popup
.
open
()
}
else
{
console
.
log
(
e
.
errMsg
);
console
.
log
(
e
.
errCode
);
}
}).
finally
(
e
=>
{
this
.
formData
.
captcha
=
''
})
},
skip
()
{
mutations
.
loginBack
(
this
.
uniIdRedirectUrl
)
}
}
}
</
script
>
<
style
scoped
lang=
"scss"
>
@import
"@/uni_modules/uni-id-pages/common/login-page.scss"
;
.uni-btn
[
type
=
"default"
]
{
color
:
inherit
!
important
;
}
.
uni-content
:
:
v-deep
.
uni-forms-item
{
margin-bottom
:
10px
;
}
.popup-captcha
{
/* #ifndef APP-NVUE */
display
:
flex
;
/* #endif */
padding
:
20rpx
;
background-color
:
#FFF
;
border-radius
:
2px
;
flex-direction
:
column
;
position
:
relative
;
}
.popup-captcha
.title
{
font-weight
:
normal
;
padding
:
0
;
padding-bottom
:
15px
;
color
:
#666
;
}
.popup-captcha
.close
{
position
:
absolute
;
bottom
:
-40px
;
margin-left
:
-13px
;
left
:
50%
;
}
.popup-captcha
.uni-btn
{
margin
:
0
;
}
</
style
>
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录