Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
thinkApp
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
游洁
thinkApp
Commits
2a168bcb
Commit
2a168bcb
authored
Jul 04, 2022
by
youjie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
f6ba13a2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
256 additions
and
0 deletions
+256
-0
changePassword.vue
src/pages/login/changePassword.vue
+256
-0
No files found.
src/pages/login/changePassword.vue
0 → 100644
View file @
2a168bcb
<
template
>
<view
class=
"changePassword-box"
>
<navbar
class=
"navbarSticky"
bg=
"#F6F6F6"
>
<view
class=
"changePassword-header-box flex"
>
<van-icon
class=
"changePassword-header-left"
name=
"arrow-left"
@
click=
"back"
/>
<text
class=
"changePassword-header-title"
>
修改密码
</text>
</view>
</navbar>
<view
class=
"changePassword-background"
></view>
<view
class=
"changePassword-content"
>
<view
class=
"changePassword-title"
>
旧密码
</view>
<view
class=
"main"
>
<van-cell-group>
<van-field
:value=
"OldPassword"
password
placeholder=
"请输入当前密码"
clearable
input-align=
"center"
@
input=
"passwordInput"
>
</van-field>
</van-cell-group>
</view>
<view
class=
"changePassword-title"
style=
"margin-top: 20rpx;"
>
新密码
<text
class=
"text"
v-show=
"show"
>
(密码至少6位数字)
</text>
</view>
<view
class=
"main"
>
<van-cell-group>
<van-field
:value=
"NewPassword1"
password
placeholder=
"请输入新密码"
clearable
input-align=
"center"
@
input=
"passwordInput1"
>
</van-field>
<van-field
:value=
"NewPassword2"
password
placeholder=
"请再次输入新密码"
clearable
input-align=
"center"
@
input=
"passwordInput2"
>
</van-field>
</van-cell-group>
</view>
<view
class=
"btnBox"
@
click=
"EditNow"
>
<van-loading
color=
"#f5f5f5"
v-if=
"loading"
/>
<text
v-else
>
立即修改
</text>
</view>
</view>
</view>
</
template
>
<
script
>
import
navbar
from
'@/components/navbar.vue'
import
{
ref
,
reactive
,
toRefs
,
toRef
,
getCurrentInstance
,
watch
,
computed
,
onMounted
,
inject
,
}
from
"vue"
;
export
default
{
components
:{
navbar
},
setup
(
props
,
context
)
{
let
{
proxy
}
=
getCurrentInstance
();
let
Toast
=
inject
(
"$toast"
);
let
msg
=
reactive
({
Account
:
""
,
OldPassword
:
""
,
NewPassword1
:
""
,
NewPassword2
:
""
});
let
data
=
reactive
({
userData
:{},
show
:
false
,
loading
:
false
});
let
methods
=
{
back
()
{
uni
.
navigateBack
({
delta
:
1
});
},
passwordInput
(
val
){
msg
.
OldPassword
=
val
.
detail
;
},
// 验证密码长度
passwordInput1
(
val
)
{
console
.
log
(
val
.
detail
)
if
(
val
.
detail
.
length
<
6
){
data
.
show
=
true
return
}
else
{
data
.
show
=
false
msg
.
NewPassword1
=
val
.
detail
;
}
},
passwordInput2
(
val
)
{
if
(
val
.
detail
.
length
<
6
){
data
.
show
=
true
return
}
else
{
data
.
show
=
false
msg
.
NewPassword2
=
val
.
detail
;
}
},
// 确定修改
EditNow
()
{
if
(
!
msg
.
OldPassword
)
{
uni
.
showToast
({
title
:
'请输入旧密码'
,
icon
:
'none'
,
duration
:
500
})
return
;
}
if
(
!
msg
.
NewPassword1
)
{
uni
.
showToast
({
title
:
'请输入新密码'
,
icon
:
'none'
,
duration
:
500
})
return
;
}
if
(
!
msg
.
NewPassword2
)
{
uni
.
showToast
({
title
:
'请再次输入新密码'
,
icon
:
'none'
,
duration
:
500
})
return
;
}
if
(
data
.
show
){
uni
.
showToast
({
title
:
'密码至少6位数字'
,
icon
:
'none'
,
duration
:
500
})
return
}
if
(
msg
.
NewPassword1
!==
msg
.
NewPassword2
){
uni
.
showToast
({
title
:
'两次密码不一致,请重新输入'
,
icon
:
'none'
,
duration
:
500
})
return
;
}
data
.
loading
=
true
proxy
.
$request
(
"/Login/UpdatePwd"
,
msg
).
then
(
res
=>
{
if
(
res
.
Code
==
1
){
that
.
back
()
}
data
.
loading
=
false
}).
catch
(
e
=>
{
data
.
loading
=
false
})
},
};
onMounted
(()
=>
{
data
.
userData
=
uni
.
getStorageSync
(
'userInfo'
)
msg
.
Account
=
data
.
userData
.
Account
});
let
that
=
methods
;
return
{
...
toRefs
(
msg
),
...
toRefs
(
data
),
...
methods
,
};
},
onLoad
()
{
}
};
</
script
>
<
style
scoped
>
.changePassword-header-title
{
font-size
:
32
rpx
;
font-weight
:
500
;
color
:
#282828
;
flex
:
1
;
text-align
:
center
;
padding-right
:
40
rpx
;
}
.changePassword-header
{
margin
:
50
rpx
50
rpx
0
50
rpx
;
align-items
:
center
;
}
.changePassword-header-left
{
font-size
:
40
rpx
;
position
:
relative
;
z-index
:
3
;
}
.changePassword-header-box
{
padding
:
20
rpx
42
rpx
;
flex-direction
:
row
;
align-items
:
center
;
}
.changePassword-title
{
font-size
:
40
rpx
;
font-family
:
PingFang-SC
;
font-weight
:
bold
;
margin-bottom
:
43
rpx
;
color
:
#282828
;
}
.changePassword-title
.text
{
font-size
:
26
rpx
;
font-weight
:
100
;
color
:
#A5A5A5
;
}
.changePassword-content
{
position
:
relative
;
padding
:
40
rpx
66
rpx
66
rpx
66
rpx
;
}
.changePassword-background
{
position
:
fixed
;
width
:
100%
;
height
:
100%
;
top
:
0
;
bottom
:
0
;
background
:
#F6F6F6
;
}
.main
{
box-sizing
:
border-box
;
vertical-align
:
middle
;
padding
:
0
0
;
display
:
flex
;
flex-direction
:
column
;
justify-content
:
center
;
}
/
deep
/
.van-cell
{
height
:
88
rpx
;
border-radius
:
44
rpx
;
margin-bottom
:
45
rpx
;
}
.btnBox
{
width
:
280
rpx
;
height
:
88
rpx
;
border-radius
:
44
rpx
;
overflow
:
hidden
;
margin
:
0
auto
;
margin-top
:
46
rpx
;
margin-bottom
:
30
rpx
;
background-color
:
#C91727
;
font-size
:
30
rpx
;
font-weight
:
500
;
color
:
#FFFFFF
;
text-align
:
center
;
/* line-height: 88rpx; */
display
:
flex
;
flex-direction
:
column
;
justify-content
:
center
;
}
</
style
>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment