Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
杨炀
/
ztx_wx_gzt
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
28052d8d
authored
2026-04-30 16:40:05 +0800
by
张猛
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
账号信息
1 parent
56a2bb4d
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
148 additions
and
96 deletions
myCenter/index.vue
myCenter/safe.vue
myCenter/index.vue
View file @
28052d8
...
...
@@ -6,23 +6,30 @@
<image
v-if=
"state.user.avatar"
:src=
"state.user.avatar"
/>
<image
v-else
:src=
"config.baseUrl_api + '/fs/static/nodata.png'"
/>
</view>
<text
class=
"name"
>
{{
state
.
user
.
userName
}}
</text>
<view
class=
"name"
>
<view>
{{
state
.
user
?.
dept
?.
deptName
}}
</view>
<view>
{{
state
.
user
?.
userName
}}
</view>
</view>
</view>
</view>
<view
class=
"rMainBox"
>
<uni-list
:border=
"false"
class=
"myList"
>
<uni-list-item
thumb=
"/static/user_icon01.png"
title=
"单位信息"
showArrow
clickable
@
click=
"goPath('/myCenter/teamInfo')"
>
<uni-list-item
clickable
showArrow
thumb=
"/static/user_icon01.png"
title=
"单位信息"
@
click=
"goPath('/myCenter/teamInfo')"
>
</uni-list-item>
<uni-list-item
thumb=
"/static/user_icon02.png"
title=
"会员认证"
showArrow
clickable
@
click=
"goPath('/myCenter/auth')"
>
<uni-list-item
clickable
showArrow
thumb=
"/static/user_icon02.png"
title=
"会员认证"
@
click=
"goPath('/myCenter/auth')"
>
</uni-list-item>
<!--
<uni-list-item
thumb=
"/static/user_icon03.png"
v-show=
"userType==2"
title=
"账户信息"
showArrow
clickable
>
<!--
<uni-list-item
thumb=
"/static/user_icon03.png"
v-show=
"userType==2"
title=
"账户信息"
showArrow
clickable
>
</uni-list-item>
-->
<uni-list-item
thumb=
"/static/user_icon03.png"
title=
"账号安全"
showArrow
clickable
@
click=
"goPath('/myCenter/safe')"
>
<uni-list-item
clickable
showArrow
thumb=
"/static/user_icon03.png"
title=
"账号安全"
@
click=
"goPath('/myCenter/safe')"
>
</uni-list-item>
<uni-list-item
thumb=
"/static/user_icon04.png"
v-if=
"userType==2 || userType==6"
title=
"我的订单"
showArrow
clickable
@
click=
"goPath('/myCenter/order')"
>
<uni-list-item
v-if=
"userType==2 || userType==6"
clickable
showArrow
thumb=
"/static/user_icon04.png"
title=
"我的订单"
@
click=
"goPath('/myCenter/order')"
>
</uni-list-item>
</uni-list>
...
...
@@ -30,7 +37,7 @@
</view>
<view
class=
"fixedBottom"
style=
"background: transparent;box-shadow: none;"
>
<button
@
click=
"loginOut"
class=
"btn btn-red"
style=
"border-radius: 50px;
"
>
退出登录
</button>
<button
class=
"btn btn-red"
style=
"border-radius: 50px;"
@
click=
"loginOut
"
>
退出登录
</button>
</view>
</view>
</
template
>
...
...
@@ -46,7 +53,7 @@ import {
onPullDownRefresh
}
from
'@dcloudio/uni-app'
;
import
{
ref
,
reactive
,
ref
,
reactive
,
getCurrentInstance
}
from
'vue'
;
...
...
@@ -83,7 +90,7 @@ onLoad(option => {
}
else
{
proId
=
option
.
proId
;
}
if
(
uni
.
showShareMenu
)
{
if
(
uni
.
showShareMenu
)
{
uni
.
showShareMenu
({
withShareTicket
:
true
,
menus
:
[
'shareAppMessage'
,
'shareTimeline'
]
...
...
@@ -94,7 +101,7 @@ onLoad(option => {
function
loginOut
()
{
uni
.
showModal
({
content
:
`确认退出吗?`
,
success
:
function
(
res
)
{
success
:
function
(
res
)
{
if
(
res
.
confirm
)
{
loginServer
.
logout
().
finally
(()
=>
{
let
path
=
'/login/login'
;
...
...
@@ -106,17 +113,19 @@ function loginOut() {
}
})
}
function
getUser
()
{
api
.
getUserProfile
().
then
((
response
)
=>
{
state
.
user
=
response
.
data
.
user
if
(
state
.
user
.
avatar
&&
state
.
user
.
avatar
.
indexOf
(
'http'
)
==-
1
)
{
state
.
user
.
avatar
=
config
.
baseUrl_api
+
state
.
user
.
avatar
if
(
state
.
user
.
avatar
&&
state
.
user
.
avatar
.
indexOf
(
'http'
)
==
-
1
)
{
state
.
user
.
avatar
=
config
.
baseUrl_api
+
state
.
user
.
avatar
}
state
.
roleGroup
=
response
.
data
.
roleGroup
state
.
postGroup
=
response
.
data
.
postGroup
uni
.
hideLoading
();
})
}
function
init
()
{
uni
.
showLoading
({
title
:
'加载中'
...
...
@@ -129,33 +138,54 @@ function init() {
uni
.
hideLoading
();
})
}
function
goPath
(
url
){
function
goPath
(
url
)
{
uni
.
navigateTo
({
url
:
url
url
:
url
})
}
</
script
>
<
style
scope
lang=
"scss"
>
.uni-list
:after
{
display
:
none
;}
.page
{
<
style
lang=
"scss"
scope
>
.uni-list
:after
{
display
:
none
;
}
.page
{
width
:
100vw
;
overflow
:
hidden
;
}
.bgbg
{
.flex
{
align-items
:
center
;
}
height
:
280rpx
;
padding
:
30rpx
;
.name
{
margin-left
:
20
rpx
;
font-size
:
36
rpx
;
}
.bgbg
{
.flex{
align-items
:
center
;}
height
:
280rpx
;
padding
:30rpx
;
.name
{
margin-left
:
20
rpx
;
font-size
:
36
rpx
;}
.imgbox
{
width
:
120
rpx
;
height
:
120
rpx
;
overflow
:
hidden
;
.imgbox
{
width
:
120
rpx
;
height
:
120
rpx
;
overflow
:
hidden
;
//
background
:
#C7C7CD
;
//
border
:
4
rpx
solid
#FFFFFF
;
border-radius
:
50%
;
image{
height
:
120
rpx
;
width
:
120
rpx
;
object-fit
:
cover
;}
image
{
height
:
120
rpx
;
width
:
120
rpx
;
object-fit
:
cover
;
}
}
}
.loginOutIcon
{
.loginOutIcon
{
position
:
relative
;
left
:
60
rpx
;
//
top
:
180
rpx
;
...
...
@@ -164,9 +194,9 @@ function goPath(url){
width
:
50
rpx
;
height
:
50
rpx
;
}
}
}
.flexbox
{
.flexbox
{
display
:
flex
;
justify-content
:
space-around
;
text-align
:
center
;
...
...
@@ -177,34 +207,34 @@ function goPath(url){
display
:
block
;
margin
:
auto
;
}
}
}
.image
{
.image
{
width
:
25px
;
height
:
25px
;
}
}
:deep
(
.uni-section
)
{
:deep
(
.uni-section
)
{
background-color
:
transparent
;
}
}
:deep
(
.uni-section
.uni-section-header__content
)
{
:deep
(
.uni-section
.uni-section-header__content
)
{
font-size
:
44
rpx
;
font-weight
:
bold
;
color
:
#29343C
;
}
}
:deep
(
.uni-section
.uni-section-header
)
{
:deep
(
.uni-section
.uni-section-header
)
{
padding
:
0
30
rpx
;
}
}
.potag
{
.potag
{
position
:
absolute
;
right
:
60
rpx
;
top
:
0
;
}
}
.girdFather
{
.girdFather
{
background
:
#fff
;
position
:
relative
;
top
:
-15
rpx
;
...
...
@@ -222,11 +252,16 @@ function goPath(url){
margin
:
30
rpx
0
20
rpx
;
padding
:
0
20
rpx
0
;
}
}
.rMainBox
{
position
:
relative
;
top
:
-120
rpx
;
box-sizing
:
border-box
;
padding
:
20
rpx
20
rpx
;
}
.rMainBox
{
position
:
relative
;
top
:
-120
rpx
;
box-sizing
:
border-box
;
padding
:
20
rpx
20
rpx
;
background-color
:
#fff
;
border-radius
:
15
rpx
;
margin
:
25
rpx
;
overflow
:
hidden
;
}
margin
:
25
rpx
;
overflow
:
hidden
;
}
</
style
>
...
...
myCenter/safe.vue
View file @
28052d8
<
template
>
<view>
<uni-segmented-control
:current=
"current"
@
clickItem=
"changeNav"
activeColor=
"#AD181F"
styleType=
"text"
:values=
"items"
></uni-segmented-control>
<uni-segmented-control
:current=
"current"
:values=
"items"
activeColor=
"#AD181F"
styleType=
"text"
@
clickItem=
"changeNav"
/>
<view
v-if=
"current==0"
class=
"mainbox"
>
<uni-forms
label-width=
"80"
>
<uni-forms-item
label=
"用户
昵称"
required
>
<uni-easyinput
v-model=
"user.nickName"
:disabled=
"!edit"
/>
<uni-forms-item
label=
"
昵称"
required
>
<uni-easyinput
v-model=
"user.nickName"
:disabled=
"!edit"
/>
</uni-forms-item>
<uni-forms-item
label=
"手机号码"
required
>
<uni-easyinput
v-model=
"user.phonenumber"
:disabled=
"!edit"
/>
<uni-easyinput
v-model=
"user.phonenumber"
:disabled=
"!edit"
/>
</uni-forms-item>
<uni-forms-item
label=
"邮箱"
required
>
<uni-easyinput
v-model=
"user.email"
:disabled=
"!edit"
/>
<uni-easyinput
v-model=
"user.email"
:disabled=
"!edit"
/>
</uni-forms-item>
<uni-forms-item
label=
"性别"
required
>
<uni-data-checkbox
:disabled=
"!edit"
v-model=
"user.sex"
@
change=
"changeSex"
:localdata=
"sexs"
/>
<uni-data-checkbox
v-model=
"user.sex"
:disabled=
"!edit"
:localdata=
"sexs"
@
change=
"changeSex"
/>
</uni-forms-item>
</uni-forms>
<view
class=
"fixedBottom"
v-if=
"edit
"
>
<view
v-if=
"edit"
class=
"fixedBottom
"
>
<button
class=
"btn-red-kx"
@
click=
"cancel"
>
取消
</button>
<button
class=
"btn-red"
style=
"width: 50%;"
@
click=
"submit"
>
保存
</button>
</view>
<view
class=
"fixedBottom"
v-else
>
<view
v-else
class=
"fixedBottom"
>
<button
class=
"btn-red"
@
click=
"editForm"
>
编辑
</button>
</view>
</view>
<view
v-if=
"current==1"
class=
"mainbox"
>
<uni-forms
label-width=
"80"
>
<uni-forms-item
label=
"旧密码"
name=
"oldPassword"
required
>
<uni-easyinput
type=
"password"
v-model=
"form.oldPassword"
placeholder=
"请输入旧密码"
/>
<uni-easyinput
v-model=
"form.oldPassword"
placeholder=
"请输入旧密码"
type=
"password"
/>
</uni-forms-item>
<uni-forms-item
label=
"新密码"
name=
"newPassword"
required
>
<uni-easyinput
type=
"password"
v-model=
"form.newPassword"
placeholder=
"请输入新密码"
/>
<view
class=
"text-danger"
v-show=
"form.newPassword?.length
<8
"
>
不足8位
</view>
<uni-easyinput
v-model=
"form.newPassword"
placeholder=
"请输入新密码"
type=
"password"
/>
<view
v-show=
"form.newPassword?.length
<8
"
class=
"text-danger
"
>
不足8位
</view>
<text
class=
"text-warning"
>
*注: 8~18位大小写字母加数字加特殊符号组合(!@#$%^
&
*()_+)
</text>
</uni-forms-item>
<uni-forms-item
label=
"确认密码"
name=
"confirmPassword"
required
>
<uni-easyinput
type=
"password"
v-model=
"form.confirmPassword"
placeholder=
"请确认新密码"
/>
<text
class=
"text-danger"
v-show=
"form.newPassword!==form.confirmPassword
"
>
与新密码不一致
</text>
<uni-easyinput
v-model=
"form.confirmPassword"
placeholder=
"请确认新密码"
type=
"password"
/>
<text
v-show=
"form.newPassword!==form.confirmPassword"
class=
"text-danger
"
>
与新密码不一致
</text>
</uni-forms-item>
</uni-forms>
...
...
@@ -52,81 +57,89 @@
</
template
>
<
script
setup
>
import
{
ref
}
from
'vue'
import
{
onLoad
}
from
'@dcloudio/uni-app'
import
{
ref
}
from
'vue'
import
{
onLoad
}
from
'@dcloudio/uni-app'
import
*
as
api
from
'@/common/api.js'
;
const
items
=
ref
([
'基本资料'
,
'修改密码'
])
const
items
=
ref
([
'账号信息'
,
'修改密码'
])
const
user
=
ref
({
sex
:
'0'
sex
:
'0'
})
const
current
=
ref
(
0
)
const
form
=
ref
({})
const
edit
=
ref
(
false
)
const
sexs
=
ref
([
{
text
:
'男'
,
value
:
'0'
},{
text
:
'女'
,
value
:
'1'
}
{
text
:
'男'
,
value
:
'0'
},
{
text
:
'女'
,
value
:
'1'
}
])
onLoad
((
option
)
=>
{
if
(
option
.
current
)
{
onLoad
((
option
)
=>
{
if
(
option
.
current
)
{
current
.
value
=
1
}
getUser
()
})
function
changeNav
(
e
){
function
changeNav
(
e
)
{
if
(
current
.
value
!=
e
.
currentIndex
)
{
current
.
value
=
e
.
currentIndex
}
}
function
getUser
()
{
api
.
getUserProfile
().
then
((
response
)
=>
{
user
.
value
=
response
.
data
.
user
if
(
!
user
.
value
.
sex
)
{
if
(
!
user
.
value
.
sex
)
{
user
.
value
.
sex
=
'0'
}
})
}
function
editForm
(){
function
editForm
()
{
edit
.
value
=
true
}
function
submit
(){
if
(
!
user
.
value
.
email
){
function
submit
()
{
if
(
!
user
.
value
.
email
)
{
uni
.
showToast
({
icon
:
'none'
,
title
:
`请输入邮箱`
icon
:
'none'
,
title
:
`请输入邮箱`
})
return
}
if
(
!
user
.
value
.
nickName
)
{
if
(
!
user
.
value
.
nickName
)
{
uni
.
showToast
({
icon
:
'none'
,
title
:
`请输入昵称`
icon
:
'none'
,
title
:
`请输入昵称`
})
return
}
if
(
!
user
.
value
.
phonenumber
)
{
if
(
!
user
.
value
.
phonenumber
)
{
uni
.
showToast
({
icon
:
'none'
,
title
:
`请输入手机号码`
icon
:
'none'
,
title
:
`请输入手机号码`
})
return
}
if
(
!
user
.
value
.
sex
)
{
if
(
!
user
.
value
.
sex
)
{
uni
.
showToast
({
icon
:
'none'
,
title
:
`请选择性别`
icon
:
'none'
,
title
:
`请选择性别`
})
return
}
api
.
updateUserProfile
(
user
.
value
).
then
(
res
=>
{
api
.
updateUserProfile
(
user
.
value
).
then
(
res
=>
{
uni
.
showToast
({
icon
:
'none'
,
title
:
`修改成功`
icon
:
'none'
,
title
:
`修改成功`
})
edit
.
value
=
false
})
}
function
changeSex
(
e
){
function
changeSex
(
e
)
{
console
.
log
(
e
)
}
function
cancel
(){
function
cancel
()
{
edit
.
value
=
false
getUser
()
}
function
validPassword
(
pwd
)
{
if
(
!
pwd
||
pwd
.
length
<
8
||
pwd
.
length
>
18
)
{
return
false
...
...
@@ -140,39 +153,39 @@ function validPassword(pwd) {
}
function
handleClick
()
{
if
(
!
form
.
value
.
oldPassword
)
{
if
(
!
form
.
value
.
oldPassword
)
{
uni
.
showToast
({
icon
:
'none'
,
title
:
`请输入旧密码`
icon
:
'none'
,
title
:
`请输入旧密码`
})
return
}
if
(
!
form
.
value
.
newPassword
)
{
if
(
!
form
.
value
.
newPassword
)
{
uni
.
showToast
({
icon
:
'none'
,
title
:
`请输入新密码`
icon
:
'none'
,
title
:
`请输入新密码`
})
return
}
if
(
form
.
value
.
newPassword
!==
form
.
value
.
confirmPassword
)
{
if
(
form
.
value
.
newPassword
!==
form
.
value
.
confirmPassword
)
{
uni
.
showToast
({
icon
:
'none'
,
title
:
`新密码需与确认密码一致`
icon
:
'none'
,
title
:
`新密码需与确认密码一致`
})
return
}
if
(
!
validPassword
(
form
.
value
.
newPassword
))
{
uni
.
showModal
({
content
:
`密码需满足8~18位大小写字母加数字加特殊符号组合(!@#$%^&*()_+)`
,
success
:
function
(
res
)
{
content
:
`密码需满足8~18位大小写字母加数字加特殊符号组合(!@#$%^&*()_+)`
,
success
:
function
(
res
)
{
}
})
return
}
api
.
updateUserPwd
({
oldPassword
:
form
.
value
.
oldPassword
,
newPassword
:
form
.
value
.
newPassword
}).
then
(
res
=>
{
api
.
updateUserPwd
({
oldPassword
:
form
.
value
.
oldPassword
,
newPassword
:
form
.
value
.
newPassword
}).
then
(
res
=>
{
uni
.
showModal
({
title
:
"提示"
,
content
:
`修改成功,重新登录生效`
,
success
:
function
(
res
)
{
title
:
"提示"
,
content
:
`修改成功,重新登录生效`
,
success
:
function
(
res
)
{
if
(
res
.
confirm
)
{
//确定
}
...
...
@@ -182,6 +195,10 @@ function handleClick() {
}
</
script
>
<
style
scoped
lang=
"scss"
>
.mainbox
{
background
:
#fff
;
padding
:
30
rpx
;
margin
:
30
rpx
;}
<
style
lang=
"scss"
scoped
>
.mainbox
{
background
:
#fff
;
padding
:
30
rpx
;
margin
:
30
rpx
;
}
</
style
>
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
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 post a comment