Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
萌新之路
uni-starter
提交
0436220a
U
uni-starter
项目概览
萌新之路
/
uni-starter
与 Fork 源项目一致
Fork自
DCloud / uni-starter
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
uni-starter
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
0436220a
编写于
4月 22, 2021
作者:
芊
芊里
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
登陆界面表单校验
上级
5b57105f
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
69 addition
and
27 deletion
+69
-27
uni_modules/uni-forms/components/uni-forms/uni-forms.vue
uni_modules/uni-forms/components/uni-forms/uni-forms.vue
+2
-1
uni_modules/uni-login-page/common/loginPage.mixin.js
uni_modules/uni-login-page/common/loginPage.mixin.js
+22
-1
uni_modules/uni-login-page/pages/pwd-login/pwd-login.vue
uni_modules/uni-login-page/pages/pwd-login/pwd-login.vue
+18
-9
uni_modules/uni-login-page/pages/pwd-retrieve/pwd-retrieve.vue
...odules/uni-login-page/pages/pwd-retrieve/pwd-retrieve.vue
+27
-16
未找到文件。
uni_modules/uni-forms/components/uni-forms/uni-forms.vue
浏览文件 @
0436220a
...
...
@@ -353,7 +353,8 @@
this
.
formData
[
i
]
=
this
.
_getValue
(
i
,
this
.
value
[
i
])
}
}
}
}
console
.
log
(
this
.
formData
,
this
.
formRules
);
return
this
.
validateAll
(
this
.
formData
,
'
submit
'
,
callback
)
},
...
...
uni_modules/uni-login-page/common/loginPage.mixin.js
浏览文件 @
0436220a
...
...
@@ -21,7 +21,8 @@ let mixin = {
formData
:{
phone
:
''
,
code
:
''
,
pwd
:
''
pwd
:
''
,
pwd2
:
''
},
rules
:
{
phone
:{
...
...
@@ -56,6 +57,26 @@ let mixin = {
errorMessage
:
'
密码应为6到20位
'
,
}
]
},
pwd2
:{
rules
:[{
required
:
true
,
errorMessage
:
'
请确认密码
'
,
},
{
pattern
:
/^.
{6,20}
$/
,
errorMessage
:
'
密码应为6到20位
'
,
},
{
validateFunction
:
function
(
rule
,
value
,
data
,
callback
){
console
.
log
(
value
);
if
(
value
!=
data
.
pwd
){
callback
(
'
两次输入密码不一致
'
)
};
return
true
}
}
]
}
}
}
...
...
uni_modules/uni-login-page/pages/pwd-login/pwd-login.vue
浏览文件 @
0436220a
...
...
@@ -16,19 +16,23 @@
<text
class=
"phone-area"
@
click=
"selectPhoneArea"
>
{{
currenPhoneArea
}}
</text>
<!--
</picker>
-->
</
template
>
</uni-easyinput>
</uni-easyinput>
</uni-forms-item>
<uni-forms-item
name=
"pwd"
>
<uni-easyinput
type=
"password"
class=
"phone-input-box"
:inputBorder=
"false"
v-model=
"formData.pwd"
placeholder=
"请输入密码"
></uni-easyinput>
</uni-forms-item>
<button
class=
"send-btn-box"
:disabled=
"!canLogin"
:type=
"canLogin?'primary':'default'"
@
click=
"pwdLogin"
>
登录
</button>
</uni-forms>
<!-- 忘记密码 -->
<view
class=
"auth-box"
>
<text
class=
"login-text login-text-sub"
>
忘记了?
</text>
<text
class=
"login-text"
@
click=
"toRetrievePwd"
>
找回密码
</text>
</view>
<button
type=
"primary"
class=
"toRegister"
@
click=
"toRegister"
>
注册账号
</button>
<!-- 忘记密码/注册账号 -->
<view
class=
"auth-box"
>
<view
class=
"auth-box-left"
>
<text
class=
"login-text login-text-sub"
>
忘记了?
</text>
<text
class=
"login-text"
@
click=
"toRetrievePwd"
>
找回密码
</text>
</view>
<text
@
click=
"toRegister"
class=
"login-text"
>
注册账号
</text>
</view>
</view>
</view>
<uni-quick-login
ref=
"uniQuickLogin"
></uni-quick-login>
...
...
@@ -131,9 +135,14 @@
.phone-input-box
{
margin-top
:
20
rpx
;
}
.auth-box
{
justify-content
:
flex-start
;
.auth-box
{
flex-direction
:
row
;
justify-content
:
space-between
;
align-items
:
center
;
margin-top
:
20
rpx
;
}
.auth-box-left
{
flex-direction
:
row
;
}
.login-text-sub
{
color
:
#8a8f8b
;
...
...
uni_modules/uni-login-page/pages/pwd-retrieve/pwd-retrieve.vue
浏览文件 @
0436220a
...
...
@@ -3,22 +3,30 @@
<view
class=
"wrap-content"
>
<view
class=
"content"
>
<!-- 顶部文字 -->
<text
class=
"content-top-title"
>
重置密码
</text>
<login-ikonw
v-show=
"
formData.p
hone"
class=
"login-iknow"
:text=
"tipText"
></login-ikonw>
<text
class=
"content-top-title"
>
重置密码
</text>
<login-ikonw
v-show=
"
isP
hone"
class=
"login-iknow"
:text=
"tipText"
></login-ikonw>
<!-- 登录框 (选择手机号所属国家和地区需要另行实现) -->
<uni-forms
ref=
"form"
:value=
"formData"
:rules=
"rules"
>
<uni-forms-item
name=
"phone"
>
<uni-easyinput
type=
"number"
class=
"phone-input-box"
:inputBorder=
"false"
v-model=
"formData.phone"
maxlength=
"11"
placeholder=
"请输入手机号"
></uni-easyinput>
</uni-forms-item>
<uni-forms-item
name=
"code"
>
<uni-easyinput
type=
"number"
class=
"phone-input-box"
:inputBorder=
"false"
v-model=
"formData.code"
maxlength=
"6"
placeholder=
"请输入验证码"
>
<template
slot=
"right"
>
<login-short-code
ref=
"shortCode"
:phone=
"formData.phone"
></login-short-code>
</
template
>
</uni-easyinput>
</uni-forms-item>
<uni-forms-item
name=
"pwd"
>
<uni-easyinput
type=
"password"
class=
"phone-input-box"
:inputBorder=
"false"
v-model=
"formData.pwd"
placeholder=
"请输入新密码"
></uni-easyinput>
</uni-forms-item>
<uni-forms-item
name=
"pwd2"
>
<uni-easyinput
type=
"password"
class=
"phone-input-box"
:inputBorder=
"false"
v-model=
"formData.pwd2"
placeholder=
"请确认新密码"
></uni-easyinput>
</uni-forms-item>
<button
class=
"send-btn-box"
:disabled=
"!canSubmit"
:type=
"canSubmit?'primary':'default'"
@
click=
"submit"
>
完成
</button>
</uni-forms>
...
...
@@ -52,7 +60,7 @@ import mixin from '../../common/loginPage.mixin.js';
},
onReady
()
{
if
(
this
.
formData
.
phone
){
this
.
$refs
.
shortCode
.
start
();
//
this.$refs.shortCode.start();
}
},
methods
:
{
...
...
@@ -60,19 +68,22 @@ import mixin from '../../common/loginPage.mixin.js';
* 完成并提交
*/
submit
(){
this
.
request
(
'
user-center/resetPwdBySmsCode
'
,{
"
mobile
"
:
this
.
formData
.
phone
,
"
code
"
:
this
.
formData
.
code
,
"
password
"
:
this
.
formData
.
pwd
},(
data
,
result
)
=>
{
console
.
log
(
result
);
uni
.
showToast
({
title
:
result
.
msg
,
icon
:
'
none
'
});
if
(
result
.
code
===
0
){
uni
.
navigateBack
()
}
this
.
$refs
.
form
.
submit
()
.
then
(
res
=>
{
this
.
request
(
'
user-center/resetPwdBySmsCode
'
,{
"
mobile
"
:
this
.
formData
.
phone
,
"
code
"
:
this
.
formData
.
code
,
"
password
"
:
this
.
formData
.
pwd
},(
data
,
result
)
=>
{
console
.
log
(
result
);
uni
.
showToast
({
title
:
result
.
msg
,
icon
:
'
none
'
});
if
(
result
.
code
===
0
){
uni
.
navigateBack
()
}
})
})
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录