Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
beyond-clouds-front
Overview
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
beyond-clouds-front
Commits
0ce069e0
Commit
0ce069e0
authored
Feb 13, 2020
by
yanju
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'yoona' into 'master'
完善绑定邮箱和手机号 修改密码 个人中心资料页 See merge request pigbigbig/beyond-clouds-front!55
parents
16f4c3e6
528cdfd0
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
111 additions
and
38 deletions
+111
-38
action/config.js
+1
-0
pages/personal-center/account/setting.vue
+101
-29
pages/personal-center/home/info.vue
+9
-9
No files found.
action/config.js
View file @
0ce069e0
...
@@ -43,6 +43,7 @@ export default {
...
@@ -43,6 +43,7 @@ export default {
Authentication
:{
Authentication
:{
qqAuth
:
'/api/auth/qq'
,
//qq认证
qqAuth
:
'/api/auth/qq'
,
//qq认证
authsList
:
'/api/auth/auths'
,
//获取我的认证列表
},
},
Sms
:{
Sms
:{
...
...
pages/personal-center/account/setting.vue
View file @
0ce069e0
...
@@ -9,11 +9,11 @@
...
@@ -9,11 +9,11 @@
</div>
</div>
<div
class=
"info"
>
<div
class=
"info"
>
<p>
手机号
</p>
<p>
手机号
</p>
<h6>
{{
mobile
||
'未绑定'
}}
</h6>
<h6>
{{
this
.
hasOwnProperty
(
'mobile'
)
?
mobile
:
'未绑定'
}}
</h6>
</div>
</div>
</div>
</div>
<div
class=
"item__right"
@
click=
"handleChange('手机号')"
>
<div
class=
"item__right"
@
click=
"handleChange('手机号')"
v-if=
"!this.hasOwnProperty('mobile')"
>
更换
更换
</div>
</div>
...
@@ -26,18 +26,18 @@
...
@@ -26,18 +26,18 @@
</div>
</div>
<div
class=
"info"
>
<div
class=
"info"
>
<p>
邮箱
</p>
<p>
邮箱
</p>
<h6>
{{
email
||
'未绑定'
}}
</h6>
<h6>
{{
this
.
hasOwnProperty
(
'email'
)
?
email
:
'未绑定'
}}
</h6>
</div>
</div>
</div>
</div>
<div
class=
"item__right"
@
click=
"handleChange('邮箱')"
>
<div
class=
"item__right"
@
click=
"handleChange('邮箱')"
v-if=
"!this.hasOwnProperty('email')"
>
更换
绑定
</div>
</div>
</div>
</div>
</div>
</div>
<div
class=
"bind-account-item__wrap"
>
<div
class=
"bind-account-item__wrap"
v-if=
"false"
>
<div
class=
"bind-account-item"
>
<div
class=
"bind-account-item"
>
<div
class=
"item__left"
>
<div
class=
"item__left"
>
<div
class=
"avatar"
>
<div
class=
"avatar"
>
...
@@ -57,7 +57,7 @@
...
@@ -57,7 +57,7 @@
</div>
</div>
<div
class=
"bind-account-item"
>
<div
class=
"bind-account-item"
v-if=
"false"
>
<div
class=
"item__left"
>
<div
class=
"item__left"
>
<div
class=
"avatar"
>
<div
class=
"avatar"
>
<embed
src=
"../../../assets/svg/qq.svg"
width=
"18"
height=
"21"
<embed
src=
"../../../assets/svg/qq.svg"
width=
"18"
height=
"21"
...
@@ -78,7 +78,7 @@
...
@@ -78,7 +78,7 @@
</div>
</div>
</div>
</div>
<div
class=
"bind-account-item__wrap"
>
<div
class=
"bind-account-item__wrap"
v-if=
"false"
>
<div
class=
"bind-account-item"
>
<div
class=
"bind-account-item"
>
<div
class=
"item__left"
>
<div
class=
"item__left"
>
<div
class=
"avatar"
>
<div
class=
"avatar"
>
...
@@ -109,13 +109,34 @@
...
@@ -109,13 +109,34 @@
<p
class=
"submit-button"
>
保存
</p>
<p
class=
"submit-button"
>
保存
</p>
</card-container>
</card-container>
<card-container
style=
"margin-top: 16px;padding-bottom: 32px"
title=
"修改登录密码"
label=
"忘记密码"
v-if=
"fal
se"
>
<card-container
style=
"margin-top: 16px;padding-bottom: 32px"
title=
"修改登录密码"
:label=
"disabled === 'auto' ? '返回':'修改'"
@
listenCardConLabel=
"handleRevi
se"
>
<div
class=
"bind-account-item__wrap"
>
<div
class=
"bind-account-item__wrap"
>
<input
type=
"text"
placeholder=
"请输入旧密码"
>
<login-input
<input
type=
"text"
placeholder=
"请输入新密码"
>
:style=
"
{pointerEvents: disabled, width: '334px'}"
:error-message="newPasswordMsg"
placeholder="请输入新的密码"
input-type="2"
type="password"
v-model="newPassword"
@handleCheck="handleCheckPassword"
@cancelCheck="newPasswordMsg = ''"
@keyup.enter.native="savePassword"
>
</login-input>
<login-input
:style=
"
{pointerEvents: disabled, width: '334px'}"
v-model="verifyCode"
input-type="3"
placeholder="请输入验证码"
:error-message="verifyErrMsg"
:is-count="isCount"
@handleCheck="handleCheckVerifyCode"
@cancelCheck="verifyErrMsg = ''"
@sendSms="sendVerifyCode"
@keyup.enter.native="savePassword"
>
</login-input>
</div>
</div>
<p
class=
"submit-button"
>
保存
</p>
<p
class=
"submit-button"
@
click=
"savePassword"
v-if=
"disabled === 'auto'"
>
保存
</p>
</card-container>
</card-container>
<div
class=
"popup-box__wrap"
v-if=
"isShow"
>
<div
class=
"popup-box__wrap"
v-if=
"isShow"
>
...
@@ -143,7 +164,10 @@
...
@@ -143,7 +164,10 @@
></login-input>
></login-input>
<div
class=
"popup-box-button"
>
<div
class=
"popup-box-button"
>
<button
style=
"margin-right: 20px"
@
click=
"handleChangeAccount"
>
确定
</button>
<button
style=
"margin-right: 20px"
@
click=
"handleChangeAccount"
>
确定
</button>
<button
@
click=
"() => this.isShow = false"
>
取消
</button>
<button
@
click=
"() =>
{
Object.assign(this.$data, this.$options.data());
this.isShow = false
}">取消
</button>
</div>
</div>
</div>
</div>
</div>
</div>
...
@@ -156,7 +180,7 @@
...
@@ -156,7 +180,7 @@
import
CardContainer
from
'../../../components/pc/cardContainer'
;
import
CardContainer
from
'../../../components/pc/cardContainer'
;
import
LoginInput
from
"../../../components/pc/loginCard/loginInput"
;
import
LoginInput
from
"../../../components/pc/loginCard/loginInput"
;
import
config
from
'../../../action/config'
;
import
config
from
'../../../action/config'
;
import
{
checkPhone
,
checkVerification
,
checkEmail
}
from
'../../users/checkfrom'
import
{
checkPhone
,
check
Password
,
check
Verification
,
checkEmail
}
from
'../../users/checkfrom'
export
default
{
export
default
{
name
:
'setting'
,
name
:
'setting'
,
...
@@ -165,9 +189,16 @@
...
@@ -165,9 +189,16 @@
CardContainer
CardContainer
},
},
async
asyncData
({
$axios
})
{
async
asyncData
({
$axios
})
{
let
infoResponse
=
await
$axios
.
$get
(
config
.
api
.
get
.
User
.
myInfo
);
let
infoResponse
=
await
$axios
.
$get
(
config
.
api
.
get
.
Authentication
.
authsList
);
console
.
log
(
infoResponse
);
console
.
log
(
infoResponse
);
return
{
...
infoResponse
.
data
}
let
local
=
infoResponse
.
data
.
local
;
let
auths
=
{};
for
(
let
[
key
,
item
]
of
Object
.
entries
(
local
))
{
console
.
log
(
key
);
auths
[
key
]
=
item
.
account
}
console
.
log
(
auths
);
return
{
...
auths
}
},
},
data
()
{
data
()
{
return
{
return
{
...
@@ -178,7 +209,10 @@
...
@@ -178,7 +209,10 @@
placeholder
:
''
,
placeholder
:
''
,
accountErrMsg
:
''
,
accountErrMsg
:
''
,
verifyErrMsg
:
''
,
verifyErrMsg
:
''
,
isCount
:
false
isCount
:
false
,
newPassword
:
''
,
newPasswordMsg
:
''
,
disabled
:
'none'
}
}
},
},
methods
:
{
methods
:
{
...
@@ -195,6 +229,9 @@
...
@@ -195,6 +229,9 @@
this
.
accountErrMsg
=
checkEmail
(
this
.
account
);
this
.
accountErrMsg
=
checkEmail
(
this
.
account
);
}
}
},
},
handleCheckPassword
()
{
this
.
newPasswordMsg
=
checkPassword
(
this
.
newPassword
);
},
handleCheckVerifyCode
()
{
handleCheckVerifyCode
()
{
this
.
verifyErrMsg
=
checkVerification
(
this
.
verifyCode
);
this
.
verifyErrMsg
=
checkVerification
(
this
.
verifyCode
);
},
},
...
@@ -202,7 +239,8 @@
...
@@ -202,7 +239,8 @@
sendVerifyCode
()
{
sendVerifyCode
()
{
if
(
this
.
title
===
'绑定手机号'
)
{
if
(
this
.
title
===
'绑定手机号'
)
{
this
.
isCount
=
false
;
this
.
isCount
=
false
;
this
.
accountErrMsg
=
checkPhone
(
this
.
account
);
let
account
=
this
.
account
!==
''
?
this
.
account
:
this
.
mobile
;
this
.
accountErrMsg
=
checkPhone
(
account
);
if
(
this
.
accountErrMsg
===
''
)
{
if
(
this
.
accountErrMsg
===
''
)
{
this
.
getSms
();
this
.
getSms
();
this
.
verifyErrMsg
=
''
;
this
.
verifyErrMsg
=
''
;
...
@@ -225,9 +263,10 @@
...
@@ -225,9 +263,10 @@
}
}
},
},
async
getSms
()
{
async
getSms
()
{
let
account
=
this
.
account
!==
''
?
this
.
account
:
this
.
mobile
;
let
smsResponse
=
await
this
.
$axios
.
$get
(
config
.
api
.
get
.
Sms
.
send
,
{
let
smsResponse
=
await
this
.
$axios
.
$get
(
config
.
api
.
get
.
Sms
.
send
,
{
params
:
{
params
:
{
mobile
:
this
.
account
mobile
:
account
}
}
});
});
if
(
smsResponse
.
code
===
0
)
{
if
(
smsResponse
.
code
===
0
)
{
...
@@ -252,7 +291,7 @@
...
@@ -252,7 +291,7 @@
if
(
emailResponse
.
code
===
0
)
{
if
(
emailResponse
.
code
===
0
)
{
this
.
$message
({
this
.
$message
({
type
:
'success'
,
type
:
'success'
,
message
:
'
短信
发送成功!'
message
:
'
邮件
发送成功!'
});
});
}
else
{
}
else
{
this
.
verifyErrMsg
=
emailResponse
.
msg
;
this
.
verifyErrMsg
=
emailResponse
.
msg
;
...
@@ -282,6 +321,7 @@
...
@@ -282,6 +321,7 @@
});
});
this
.
mobile
=
this
.
account
;
this
.
mobile
=
this
.
account
;
this
.
isShow
=
false
;
this
.
isShow
=
false
;
Object
.
assign
(
this
.
$data
,
this
.
$options
.
data
());
}
else
{
}
else
{
this
.
$message
({
this
.
$message
({
type
:
'info'
,
type
:
'info'
,
...
@@ -303,6 +343,7 @@
...
@@ -303,6 +343,7 @@
});
});
this
.
email
=
this
.
account
;
this
.
email
=
this
.
account
;
this
.
isShow
=
false
;
this
.
isShow
=
false
;
Object
.
assign
(
this
.
$data
,
this
.
$options
.
data
());
}
else
{
}
else
{
this
.
$message
({
this
.
$message
({
type
:
'info'
,
type
:
'info'
,
...
@@ -310,8 +351,47 @@
...
@@ -310,8 +351,47 @@
});
});
}
}
}
}
},
handleRevise
()
{
this
.
disabled
=
this
.
disabled
===
'auto'
?
'none'
:
'auto'
;
if
(
this
.
disabled
===
'none'
)
{
Object
.
assign
(
this
.
$data
,
this
.
$options
.
data
());
}
},
async
savePassword
()
{
this
.
handleCheckPassword
();
this
.
handleCheckVerifyCode
();
if
(
!
this
.
hasOwnProperty
(
'mobile'
))
{
this
.
$message
({
type
:
'warning'
,
message
:
'请先绑定手机号'
});
return
false
}
if
(
this
.
newPasswordMsg
!==
''
&&
this
.
verifyErrMsg
!==
''
)
return
false
;
let
resetResponse
;
resetResponse
=
await
this
.
$axios
.
$put
(
config
.
api
.
put
.
User
.
revisePassword
,
{
mobile
:
this
.
mobile
,
password
:
this
.
newPassword
,
verifyCode
:
this
.
verifyCode
});
console
.
log
(
resetResponse
);
if
(
resetResponse
.
code
===
0
)
{
this
.
$message
({
type
:
'success'
,
message
:
'修改密码成功!'
});
Object
.
assign
(
this
.
$data
,
this
.
$options
.
data
());
}
else
{
this
.
$message
({
type
:
'info'
,
message
:
resetResponse
.
msg
});
}
}
}
}
}
,
}
}
</
script
>
</
script
>
...
@@ -324,14 +404,6 @@
...
@@ -324,14 +404,6 @@
margin
:
32
*$
length
auto
0
;
margin
:
32
*$
length
auto
0
;
@extend
%flex-row-spb;
@extend
%flex-row-spb;
&
input{
width
:
334
*$
length
;
height
:
48
*$
length
;
border-radius
:
4
*$
length
;
padding
:
14
*$
length
16
*$
length
;
@include
fontStyle(14,48,500,#999,left);
background-color
:
#F4F8FA
;
}
.bind-account-item{
.bind-account-item{
width
:
334
*$
length
;
width
:
334
*$
length
;
...
...
pages/personal-center/home/info.vue
View file @
0ce069e0
...
@@ -9,25 +9,25 @@
...
@@ -9,25 +9,25 @@
</div>
</div>
</div>
</div>
<div>
<div>
<p><span>
昵称:
</span>
{{
nickName
||
'
'
}}
</p>
<p><span>
昵称:
</span>
{{
nickName
?
nickName
:
'暂无
'
}}
</p>
</div>
</div>
<div>
<div>
<p><span>
性别:
</span>
{{
genderInfo
}}
</p>
<p><span>
性别:
</span>
{{
genderInfo
}}
</p>
</div>
</div>
<div>
<div>
<p><span>
生日:
</span>
{{
birthday
||
''
}}
</p>
<p><span>
生日:
</span>
暂无
</p>
</div>
</div>
<div>
<div>
<p><span>
签名:
</span>
{{
signature
||
'
'
}}
</p>
<p><span>
签名:
</span>
{{
signature
?
signature
:
'暂无
'
}}
</p>
</div>
</div>
<div>
<div>
<p><span>
微信:
</span>
{{
wxNumber
||
'
'
}}
</p>
<p><span>
微信:
</span>
{{
wxNumber
?
wxNumber
:
'暂无
'
}}
</p>
</div>
</div>
<div>
<div>
<p><span>
QQ号:
</span>
{{
qqNumber
||
'
'
}}
</p>
<p><span>
QQ号:
</span>
{{
qqNumber
?
qqNumber
:
'暂无
'
}}
</p>
</div>
</div>
<div>
<div>
<p><span>
手机号:
</span>
{{
mobile
||
'
'
}}
</p>
<p><span>
手机号:
</span>
{{
mobile
?
mobile
:
'暂无
'
}}
</p>
</div>
</div>
</div>
</div>
</card-container>
</card-container>
...
@@ -55,11 +55,11 @@
...
@@ -55,11 +55,11 @@
computed
:
{
computed
:
{
genderInfo
:
function
()
{
genderInfo
:
function
()
{
if
(
this
.
gender
===
0
)
{
if
(
this
.
gender
===
0
)
{
return
'
男
'
return
'
保密
'
}
else
if
(
this
.
gender
===
1
)
{
}
else
if
(
this
.
gender
===
1
)
{
return
'
女
'
return
'
男
'
}
else
{
}
else
{
return
'
保密
'
return
'
女
'
}
}
}
}
...
...
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