Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
zchazc
uni-starter
提交
ec6e4ac2
U
uni-starter
项目概览
zchazc
/
uni-starter
与 Fork 源项目一致
Fork自
DCloud / uni-starter
通知
3
Star
0
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,发现更多精彩内容 >>
提交
ec6e4ac2
编写于
4月 10, 2021
作者:
芊
芊里
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
整体调整
上级
156e5979
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
37 addition
and
20 deletion
+37
-20
pages/ucenter/settings/settings.vue
pages/ucenter/settings/settings.vue
+7
-2
uni_modules/uni-login-page/pages/index/index.vue
uni_modules/uni-login-page/pages/index/index.vue
+1
-1
uni_modules/uni-login-page/pages/index/phone-code.vue
uni_modules/uni-login-page/pages/index/phone-code.vue
+1
-1
uni_modules/uni-login-page/pages/index/pwd-login.vue
uni_modules/uni-login-page/pages/index/pwd-login.vue
+3
-5
uni_modules/uni-login-page/pages/index/pwd-retrieve.vue
uni_modules/uni-login-page/pages/index/pwd-retrieve.vue
+25
-11
未找到文件。
pages/ucenter/settings/settings.vue
浏览文件 @
ec6e4ac2
...
...
@@ -25,7 +25,7 @@
return
{
agreeList
:
[{
title
:
'
个人资料
'
,
to
:
'
../edit/e
dit
'
event
:
'
toE
dit
'
},
{
title
:
'
修改密码
'
,
...
...
@@ -67,8 +67,13 @@
...
mapMutations
({
logout
:
'
user/logout
'
}),
toEdit
(){
uni
.
navigateTo
({
url
:
'
../edit/edit
'
});
},
changePwd
(){
if
(
this
.
userInfo
&&
this
.
userInfo
.
phone
){
if
(
this
.
userInfo
){
uni
.
navigateTo
({
url
:
'
/uni_modules/uni-login-page/pages/index/pwd-retrieve?phoneNumber=
'
+
this
.
userInfo
.
phone
+
'
&phoneArea=+86
'
});
...
...
uni_modules/uni-login-page/pages/index/index.vue
浏览文件 @
ec6e4ac2
...
...
@@ -56,7 +56,7 @@
currenPhoneArea
:
'
+86
'
,
formData
:
{
phone
:
'
17769516081
'
phone
:
''
},
rules
:
{
// 对phone字段进行必填验证
...
...
uni_modules/uni-login-page/pages/index/phone-code.vue
浏览文件 @
ec6e4ac2
...
...
@@ -43,7 +43,7 @@
errorMessage
:
'
请输入验证码
'
,
},
{
leg
n
:
/^.
{6}
$/
,
patter
n
:
/^.
{6}
$/
,
errorMessage
:
'
请输入6位验证码
'
,
}
]
...
...
uni_modules/uni-login-page/pages/index/pwd-login.vue
浏览文件 @
ec6e4ac2
...
...
@@ -51,8 +51,8 @@
currenPhoneArea
:
'
+86
'
,
formData
:
{
phone
:
'
17769516081
'
,
pwd
:
'
123456
'
phone
:
''
,
pwd
:
''
},
rules
:
{
phone
:
{
...
...
@@ -135,9 +135,7 @@
title
:
'
登陆成功
'
,
icon
:
'
none
'
});
uni
.
switchTab
({
url
:
"
/pages/list/list
"
})
uni
.
navigateBack
()
}
else
{
uni
.
showModal
({
title
:
'
错误
'
,
...
...
uni_modules/uni-login-page/pages/index/pwd-retrieve.vue
浏览文件 @
ec6e4ac2
...
...
@@ -8,13 +8,15 @@
<!-- 登录框 (选择手机号所属国家和地区需要另行实现) -->
<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"
placeholder=
"请输入手机号"
></uni-easyinput>
<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"
@
getCode=
"getCode"
></login-short-code>
</
template
>
</uni-easyinput>
<uni-easyinput
type=
"
number
"
class=
"phone-input-box"
:inputBorder=
"false"
<uni-easyinput
type=
"
text
"
class=
"phone-input-box"
:inputBorder=
"false"
v-model=
"formData.pwd"
placeholder=
"请输入新密码"
></uni-easyinput>
</uni-forms-item>
<button
class=
"send-btn-box"
:disabled=
"!canSubmit"
:type=
"canSubmit?'primary':'default'"
...
...
@@ -31,23 +33,33 @@ import mixin from '../../common/loginPage.mixin.js';
mixins
:[
mixin
],
data
()
{
return
{
phoneNumber
:
''
,
phoneCode
:
''
,
password
:
''
,
currenPhoneArea
:
''
,
formData
:{
phone
:
''
,
code
:
''
,
pwd
:
''
},
rules
:
{
phone
:{
rules
:[{
required
:
true
,
errorMessage
:
'
请输入手机号
'
,
},
{
pattern
:
/^1
\d{10}
$/
,
errorMessage
:
'
手机号格式不正确
'
,
}
]
},
code
:
{
rules
:
[{
required
:
true
,
errorMessage
:
'
请输入验证码
'
,
},
{
leg
n
:
/^.
{6}
$/
,
patter
n
:
/^.
{6}
$/
,
errorMessage
:
'
请输入6位验证码
'
,
}
]
...
...
@@ -68,13 +80,13 @@ import mixin from '../../common/loginPage.mixin.js';
},
computed
:
{
tipText
()
{
return
`验证码已通过短信发送至
${
this
.
currenPhoneArea
}
${
this
.
phoneNumber
}
。密码为6 - 20位`
return
`验证码已通过短信发送至
${
this
.
currenPhoneArea
}
${
this
.
formData
.
phone
}
。密码为6 - 20位`
},
canSubmit
()
{
let
reg_phone
=
/^1
\d{10}
$/
;
let
reg_pwd
=
/^.
{6,20}
$/
;
let
reg_code
=
/^
\d{6}
$/
;
let
isPhone
=
reg_phone
.
test
(
this
.
phoneNumber
);
let
isPhone
=
reg_phone
.
test
(
this
.
formData
.
phone
);
let
isPwd
=
reg_pwd
.
test
(
this
.
formData
.
pwd
);
let
isCode
=
reg_code
.
test
(
this
.
formData
.
code
);
return
isPhone
&&
isPwd
&&
isCode
;
...
...
@@ -82,12 +94,14 @@ import mixin from '../../common/loginPage.mixin.js';
},
onLoad
(
event
)
{
if
(
event
&&
event
.
phoneNumber
)
{
this
.
phoneNumber
=
event
.
phoneNumber
;
this
.
formData
.
phone
=
event
.
phoneNumber
;
this
.
currenPhoneArea
=
'
+
'
+
Number
(
event
.
phoneArea
);
}
},
onReady
()
{
this
.
$refs
.
shortCode
.
start
();
if
(
this
.
formData
.
phone
){
this
.
$refs
.
shortCode
.
start
();
}
},
methods
:
{
/**
...
...
@@ -95,7 +109,7 @@ import mixin from '../../common/loginPage.mixin.js';
* 倒计时期间不会触发该方法
*/
getCode
(
done
)
{
if
(
this
.
phoneNumber
==
''
)
return
uni
.
showToast
({
if
(
this
.
formData
.
phone
==
''
)
return
uni
.
showToast
({
title
:
'
请填写手机号
'
,
icon
:
'
none
'
});
...
...
@@ -104,7 +118,7 @@ import mixin from '../../common/loginPage.mixin.js';
"
data
"
:
{
"
action
"
:
"
sendSmsCode
"
,
"
params
"
:
{
"
mobile
"
:
this
.
phoneNumber
,
"
mobile
"
:
this
.
formData
.
phone
,
"
type
"
:
"
login
"
}
},
...
...
@@ -136,7 +150,7 @@ import mixin from '../../common/loginPage.mixin.js';
"
data
"
:
{
"
action
"
:
"
loginBySms
"
,
"
params
"
:{
"
mobile
"
:
this
.
phoneNumber
,
"
mobile
"
:
this
.
formData
.
phone
,
"
code
"
:
this
.
formData
.
code
}
},
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录