Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
E
ec-report-refactor
Project
Project
Details
Activity
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
lihuizhen
ec-report-refactor
Commits
9b466372
Commit
9b466372
authored
Apr 06, 2023
by
leon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: change password
parent
65ae887c
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
281 additions
and
273 deletions
+281
-273
index.vue
pages/center/index.vue
+190
-173
password.vue
pages/center/password.vue
+91
-100
No files found.
pages/center/index.vue
View file @
9b466372
...
@@ -13,13 +13,8 @@
...
@@ -13,13 +13,8 @@
订阅消息
订阅消息
</view>
</view>
<u-button
<u-button
class=
"my-u-block u-m-t-80"
type=
"warning"
shape=
"square"
:ripple=
"true"
@
click=
"logout()"
>
退出
class=
"my-u-block u-m-t-80"
</u-button>
type=
"warning"
shape=
"square"
:ripple=
"true"
@
click=
"logout()"
>
退出
</u-button>
</view>
</view>
</
template
>
</
template
>
...
@@ -48,12 +43,28 @@
...
@@ -48,12 +43,28 @@
id
:
userId
,
id
:
userId
,
authorized
:
false
authorized
:
false
}
}
var
itemList
=
[{
'text'
:
'修改密码'
,
'show'
:
false
,
'count'
:
'0'
},
var
itemList
=
[{
{
'text'
:
'待授权'
,
'show'
:
true
,
'count'
:
'0'
},
'text'
:
'修改密码'
,
{
'text'
:
'已授权'
,
'show'
:
true
,
'count'
:
'0'
}];
'show'
:
false
,
'count'
:
'0'
},
{
'text'
:
'待授权'
,
'show'
:
true
,
'count'
:
'0'
},
{
'text'
:
'已授权'
,
'show'
:
true
,
'count'
:
'0'
}
];
this
.
$u
.
api
.
getUserListCount
(
param
).
then
(
res
=>
{
this
.
$u
.
api
.
getUserListCount
(
param
).
then
(
res
=>
{
const
{
Status
,
Result
}
=
res
.
data
const
{
Status
,
Result
}
=
res
.
data
if
(
Status
===
'true'
)
{
if
(
Status
===
'true'
)
{
itemList
[
1
].
count
=
Result
.
no_authorized
;
itemList
[
1
].
count
=
Result
.
no_authorized
;
itemList
[
2
].
count
=
Result
.
authorized
;
itemList
[
2
].
count
=
Result
.
authorized
;
...
@@ -64,7 +75,7 @@
...
@@ -64,7 +75,7 @@
},
},
// item 点击
// item 点击
selectCell
(
index
)
{
selectCell
(
index
)
{
switch
(
index
)
{
switch
(
index
)
{
case
0
:
case
0
:
uni
.
navigateTo
({
uni
.
navigateTo
({
url
:
'./password'
url
:
'./password'
...
@@ -101,17 +112,19 @@
...
@@ -101,17 +112,19 @@
code
:
code
,
code
:
code
,
id
:
uni
.
getStorageSync
(
'userId'
)
id
:
uni
.
getStorageSync
(
'userId'
)
}
}
that
.
$u
.
api
.
getOpenId
(
param
).
then
(
res
=>
{
that
.
$u
.
api
.
getOpenId
(
param
).
then
(
res
=>
{
const
{
Status
,
Result
}
=
res
.
data
const
{
if
(
Status
===
'true'
)
{
Status
,
}
Result
}
=
res
.
data
if
(
Status
===
'true'
)
{}
})
})
}
}
})
})
uni
.
requestSubscribeMessage
({
uni
.
requestSubscribeMessage
({
tmplIds
:
[
'GSPZ_GSbsgfRSu8wugGPe2zqmReDbY8yeIEqd8pPPM8'
],
tmplIds
:
[
'GSPZ_GSbsgfRSu8wugGPe2zqmReDbY8yeIEqd8pPPM8'
],
success
(
res
)
{
success
(
res
)
{
console
.
log
(
'授权结果'
+
res
[
'GSPZ_GSbsgfRSu8wugGPe2zqmReDbY8yeIEqd8pPPM8'
])
console
.
log
(
'授权结果'
+
res
[
'GSPZ_GSbsgfRSu8wugGPe2zqmReDbY8yeIEqd8pPPM8'
])
}
}
})
})
...
@@ -141,6 +154,7 @@
...
@@ -141,6 +154,7 @@
flex-direction
:
column
;
flex-direction
:
column
;
}
}
.item-cell
{
.item-cell
{
display
:
flex
;
display
:
flex
;
position
:
relative
;
position
:
relative
;
...
@@ -150,14 +164,17 @@
...
@@ -150,14 +164,17 @@
border-bottom
:
0
.1rpx
solid
#cccccc
;
border-bottom
:
0
.1rpx
solid
#cccccc
;
}
}
.item-cell-text
{
.item-cell-text
{
margin-left
:
20rpx
;
margin-left
:
20rpx
;
font-size
:
28rpx
;
font-size
:
28rpx
;
}
}
.item-cell-list-count
{
.item-cell-list-count
{
margin-left
:
300rpx
;
margin-left
:
300rpx
;
font-size
:
28rpx
;
font-size
:
28rpx
;
}
}
.subscribe
{
.subscribe
{
width
:
30%
;
width
:
30%
;
text-align
:
center
;
text-align
:
center
;
...
...
pages/center/password.vue
View file @
9b466372
<
template
>
<
template
>
<view
class=
"wrap"
>
<view
class=
"wrap"
>
<view
class=
"content"
>
<view
class=
"content"
>
<u-form
<u-form
ref=
"uForm"
:model=
"params"
:error-type=
"['toast']"
:label-width=
"120"
>
ref=
"uForm"
:model=
"params"
:error-type=
"['toast']"
:label-width=
"120"
>
<u-form-item
label=
"新密码"
prop=
"password1"
>
<u-form-item
label=
"新密码"
prop=
"password1"
>
<u-input
<u-input
v-model=
"params.password1"
placeholder=
"请输入新密码"
type=
"password"
:password-icon=
"true"
/>
v-model=
"params.password1"
placeholder=
"请输入新密码"
type=
"password"
:password-icon=
"true"
/>
</u-form-item>
</u-form-item>
<u-form-item
label=
"确认密码"
prop=
"password2"
>
<u-form-item
label=
"确认密码"
prop=
"password2"
>
<u-input
<u-input
v-model=
"params.password2"
placeholder=
"请确认新密码"
type=
"password"
:password-icon=
"true"
/>
v-model=
"params.password2"
placeholder=
"请确认新密码"
type=
"password"
:password-icon=
"true"
/>
</u-form-item>
</u-form-item>
</u-form>
</u-form>
<u-button
<u-button
class=
"my-u-block u-m-t-80"
type=
"warning"
shape=
"square"
:ripple=
"true"
@
click=
"submit()"
class=
"my-u-block u-m-t-80"
:disabled=
"!submitDisabled"
>
确认
</u-button>
type=
"warning"
shape=
"square"
:ripple=
"true"
@
click=
"submit()"
:disabled=
"!submitDisabled"
>
确认
</u-button>
</view>
</view>
</view>
</view>
</
template
>
</
template
>
...
@@ -46,12 +25,16 @@
...
@@ -46,12 +25,16 @@
password2
:
''
password2
:
''
},
},
rules
:
{
rules
:
{
password1
:
[
password1
:
[{
{
required
:
true
,
message
:
'请输入新密码'
,
trigger
:
'blur'
}
required
:
true
,
],
message
:
'请输入新密码'
,
password2
:
[
trigger
:
'blur'
{
required
:
true
,
message
:
'请确认新密码'
,
trigger
:
'blur'
}
}],
]
password2
:
[{
required
:
true
,
message
:
'请确认新密码'
,
trigger
:
'blur'
}]
}
}
}
}
},
},
...
@@ -69,8 +52,16 @@
...
@@ -69,8 +52,16 @@
}
}
this
.
$refs
.
uForm
.
validate
(
async
valid
=>
{
this
.
$refs
.
uForm
.
validate
(
async
valid
=>
{
if
(
valid
)
{
if
(
valid
)
{
let
res
=
await
this
.
$u
.
api
.
changePassword
(
this
.
params
)
const
params
=
{
const
{
Status
,
Result
}
=
res
.
data
appId
:
wx
.
getAccountInfoSync
().
miniProgram
.
appId
,
password
:
this
.
params
.
password1
,
id
:
uni
.
getStorageSync
(
'userId'
)
}
let
res
=
await
this
.
$u
.
api
.
changePassword
(
params
)
const
{
Status
,
Result
}
=
res
.
data
if
(
Status
===
'true'
)
{
if
(
Status
===
'true'
)
{
this
.
$u
.
vuex
(
'vuex_token'
,
`
${
res
.
token_type
}
${
res
.
access_token
}
`
)
this
.
$u
.
vuex
(
'vuex_token'
,
`
${
res
.
token_type
}
${
res
.
access_token
}
`
)
this
.
$u
.
toast
(
'密码修改成功'
)
this
.
$u
.
toast
(
'密码修改成功'
)
...
...
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