Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
million
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
viitto
million
Commits
8f964182
Commit
8f964182
authored
Mar 07, 2023
by
沈良进
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
个人中心功能开发
parent
73aa2f84
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
1264 additions
and
139 deletions
+1264
-139
base-switch.vue
src/components/base-switch.vue
+69
-0
app.scss
src/css/app.scss
+8
-0
checkboxGroup.vue
src/pages/usercenter/components/checkboxGroup.vue
+64
-0
removeAccount.vue
src/pages/usercenter/components/removeAccount.vue
+228
-0
resetEmail.vue
src/pages/usercenter/components/resetEmail.vue
+235
-0
loginInfo.vue
src/pages/usercenter/loginInfo.vue
+121
-35
setAddress.vue
src/pages/usercenter/setAddress.vue
+289
-48
setInfo.vue
src/pages/usercenter/setInfo.vue
+220
-33
setUsersList.vue
src/pages/usercenter/setUsersList.vue
+30
-23
No files found.
src/components/base-switch.vue
0 → 100644
View file @
8f964182
<
template
>
<div
class=
'wrapper'
>
<input
type=
"checkbox"
:checked=
"inputSelect"
@
change=
"changeSelect"
id=
'checkLabel'
>
<label
for=
"checkLabel"
></label>
</div>
</
template
>
<
style
scoped
>
.wrapper
{
display
:
inline-block
;
}
.wrapper
input
{
display
:
none
;
}
.wrapper
label
{
position
:
relative
;
background
:
grey
;
cursor
:
pointer
;
width
:
50px
;
height
:
30px
;
border-radius
:
100px
;
display
:
block
;
}
.wrapper
label
::before
{
content
:
''
;
position
:
absolute
;
/* display:block; */
width
:
30px
;
height
:
30px
;
border-radius
:
30px
;
background
:
white
;
transition
:
all
0.36s
;
top
:
0px
;
left
:
0px
;
}
.wrapper
input
:checked
+
label
{
background
:
green
;
}
.wrapper
input
:checked
+
label
::before
{
left
:
calc
(
100%
);
transform
:
translateX
(
-100%
);
transition
:
all
.36s
cubic-bezier
(
.78
,
.14
,
.15
,
.86
);
}
</
style
>
<
script
>
export
default
{
props
:
{
value
:
{
default
:
false
}
},
data
()
{
return
{
inputSelect
:
false
}
},
watch
:
{
value
:
function
()
{
this
.
inputSelect
=
this
.
value
}
},
methods
:
{
changeSelect
()
{
this
.
inputSelect
=
!
this
.
inputSelect
console
.
log
(
'changeSelect'
,
this
.
inputSelect
,
this
.
value
)
this
.
$emit
(
'input'
,
this
.
inputSelect
)
}
}
}
</
script
>
\ No newline at end of file
src/css/app.scss
View file @
8f964182
...
@@ -28,6 +28,9 @@
...
@@ -28,6 +28,9 @@
.margin
{
.margin
{
margin
:
10px
;
margin
:
10px
;
}
}
.mr0
{
margin-right
:
0
!
important
;
}
.mt
{
.mt
{
margin-top
:
10px
;
margin-top
:
10px
;
}
}
...
@@ -130,4 +133,9 @@
...
@@ -130,4 +133,9 @@
}
}
.white
{
.white
{
color
:
#fff
;
color
:
#fff
;
}
.user-edit
{
color
:
#2D90FF
;
margin
:
0
20px
;
cursor
:
pointer
;
}
}
\ No newline at end of file
src/pages/usercenter/components/checkboxGroup.vue
0 → 100644
View file @
8f964182
<
style
lang=
"scss"
scoped
>
</
style
>
<
template
>
<div>
<q-checkbox
v-for=
"item in checkboxList"
:key=
"item.label"
v-model=
"checkedValue"
:val=
"item.value"
@
input=
"changeValue(item)"
>
{{
item
.
label
}}
</q-checkbox
>
</div>
</
template
>
<
script
>
export
default
{
props
:
{
checkboxList
:
{
type
:
Array
,
default
:
()
=>
[],
},
radio
:
{
type
:
Boolean
,
default
:
true
,
},
value
:
{
default
:
""
,
},
},
data
()
{
return
{
checkedValue
:
[],
};
},
mounted
()
{
this
.
prevVal
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
checkedValue
));
},
watch
:
{
value
:
function
()
{
if
(
this
.
value
)
{
this
.
checkedValue
=
[
this
.
value
];
}
},
},
methods
:
{
changeValue
(
item
)
{
console
.
log
(
"changeValue"
,
item
,
this
.
checkedValue
,
this
.
prevVal
);
const
index
=
this
.
prevVal
.
findIndex
((
el
)
=>
item
.
value
===
el
);
if
(
this
.
radio
)
{
if
(
index
>
-
1
)
{
this
.
checkedValue
=
[];
}
else
{
this
.
checkedValue
=
[
item
.
value
];
}
}
this
.
$emit
(
"input"
,
this
.
radio
?
this
.
checkedValue
[
0
]
:
this
.
checkedValue
);
this
.
prevVal
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
checkedValue
));
},
},
};
</
script
>
\ No newline at end of file
src/pages/usercenter/components/removeAccount.vue
0 → 100644
View file @
8f964182
<
style
>
.login-box
{
width
:
436px
;
padding
:
30px
40px
;
background-clip
:
padding-box
;
background
:
#ffffff
;
border-radius
:
18px
;
}
.login-box
.tw_logo
{
margin
:
0
auto
20px
;
display
:
block
;
height
:
45px
;
width
:
auto
;
}
.login-box
.tip-text
{
font-size
:
16px
;
margin-bottom
:
15px
;
color
:
#999
;
text-align
:
center
;
}
.login-box
.tip-text
a
{
color
:
#00afff
;
}
.login_row
{
width
:
100%
;
}
.form-group
{
position
:
relative
;
margin-bottom
:
15px
;
}
.login_labelName
{
margin-top
:
34px
;
font-size
:
16px
;
margin-bottom
:
16px
;
}
.form-group
i
{
position
:
absolute
;
right
:
6px
;
bottom
:
0
;
z-index
:
2
;
width
:
46px
;
height
:
46px
;
text-align
:
center
;
line-height
:
46px
;
color
:
#999
;
font-size
:
28px
;
cursor
:
pointer
;
}
.login-box
.q-field__control
{
height
:
46px
;
}
.type-item
{
width
:
50px
;
height
:
50px
;
background
:
#f5f5f5
;
border-radius
:
25px
;
}
.type-item
img
{
width
:
28px
;
height
:
28px
;
}
</
style
>
<
template
>
<div
class=
"login"
>
<div
class=
"login-box"
>
<div
class=
"f34 bold"
>
注销账户
</div>
<div
class=
"login_row"
>
<div
class=
"form-group"
>
<div
class=
"login_labelName"
>
輸入郵箱
</div>
<q-input
outlined
v-model=
"loginMsg.EMail"
/>
<div
class=
"primary q-mt-sm"
v-show=
"tips"
>
邮箱格式有误,请核实
</div>
</div>
<div>
<q-btn
v-if=
"!isSend"
class=
"q-mb-lg"
unelevated
color=
"grey-3"
style=
"width: 100%; color: #8B8B8B !important; height: 50px; margin-top: 20px"
filled
label=
"发送验证码"
@
click=
"sendVerify"
/>
<div
v-else
class=
"mt q-mb-sm"
>
<q-input
outlined
v-model=
"loginMsg.Code"
type=
"text"
/>
<div
class=
"q-mt-sm"
:class=
"cutDown ? 'text-grey-6' : ''"
>
{{
cutDown
?
cutDown
+
"秒后可重新发送"
:
"重新發送驗證碼"
}}
</div>
</div>
</div>
<div
class=
"q-mb-xl"
>
<q-btn
color=
"primary"
unelevated
style=
"width: 100%; height: 50px; margin-top: 20px"
filled
:label=
"mylabel"
@
click=
"login"
/>
</div>
</div>
</div>
</div>
</
template
>
<
script
>
import
QrcodeVue
from
"qrcode.vue"
;
export
default
{
name
:
"Login"
,
components
:
{
QrcodeVue
,
},
data
()
{
return
{
isSend
:
false
,
tips
:
false
,
cutDown
:
0
,
isAgree
:
false
,
isLogin
:
true
,
loginMsg
:
{
EMail
:
""
,
Code
:
""
,
},
// , 'google', 'facebook', 'apple'
typeList
:
[
"wechat"
],
logo
:
""
,
flag
:
2
,
mylabel
:
"注销账户"
,
};
},
created
()
{},
mounted
()
{
},
methods
:
{
sendVerify
()
{
if
(
this
.
inSending
)
return
this
.
inSending
=
true
if
(
this
.
verifyEmail
())
{
this
.
apipost
(
'directCustomer_post_SendMail'
,
{
Mailbox
:
this
.
loginMsg
.
EMail
,
SendType
:
4
},
(
res
)
=>
{
this
.
inSending
=
false
if
(
res
.
data
.
resultCode
==
1
)
{
this
.
isSend
=
true
;
this
.
cutDown
=
60
;
this
.
startCutDown
();
}
else
{
this
.
$q
.
notify
({
type
:
"negative"
,
message
:
res
.
data
.
message
,
position
:
"top"
,
timeout
:
2000
,
// 以毫秒为单位; 0意味着没有超时
});
}
},
null
)
}
else
{
this
.
inSending
=
false
}
},
startCutDown
()
{
this
.
timer
=
setTimeout
(()
=>
{
this
.
cutDown
--
;
if
(
this
.
cutDown
)
{
this
.
startCutDown
();
}
},
1000
);
},
verifyEmail
()
{
if
(
/^
[^
@
\s]
+@
[^
@
\s]
+
\.[^
@
\s]
+$/
.
test
(
this
.
loginMsg
.
EMail
))
{
this
.
tips
=
false
;
return
true
;
}
else
{
// 提示用户邮箱格式有误
this
.
tips
=
true
;
return
false
;
}
},
login
()
{
if
(
this
.
mylabel
===
"提交中..."
)
{
return
}
if
(
this
.
loginMsg
.
EMail
==
""
)
{
this
.
$q
.
notify
({
type
:
"negative"
,
message
:
"请输入账号"
,
position
:
"top"
,
timeout
:
2000
,
// 以毫秒为单位; 0意味着没有超时
});
return
;
}
if
(
this
.
loginMsg
.
Code
==
""
)
{
this
.
$q
.
notify
({
type
:
"negative"
,
message
:
"请输入邮箱验证码"
,
position
:
"top"
,
timeout
:
2000
,
// 以毫秒为单位; 0意味着没有超时
});
return
;
}
this
.
mylabel
=
"提交中..."
;
this
.
apipost
(
'b2c_post_SetAccountCancel'
,
this
.
loginMsg
,
(
res
)
=>
{
this
.
mylabel
=
"注销账户"
;
if
(
res
.
data
.
resultCode
==
1
)
{
this
.
CommonJump
(
"/login"
,
{});
}
else
{
this
.
$q
.
notify
({
type
:
"negative"
,
message
:
res
.
data
.
message
,
position
:
"top"
,
timeout
:
2000
,
// 以毫秒为单位; 0意味着没有超时
});
}
},
(
err
)
=>
{}
);
},
},
};
</
script
>
src/pages/usercenter/components/resetEmail.vue
0 → 100644
View file @
8f964182
<
style
>
.login-box
{
width
:
436px
;
padding
:
30px
40px
;
background-clip
:
padding-box
;
background
:
#ffffff
;
border-radius
:
18px
;
}
.login-box
.tw_logo
{
margin
:
0
auto
20px
;
display
:
block
;
height
:
45px
;
width
:
auto
;
}
.login-box
.tip-text
{
font-size
:
16px
;
margin-bottom
:
15px
;
color
:
#999
;
text-align
:
center
;
}
.login-box
.tip-text
a
{
color
:
#00afff
;
}
.login_row
{
width
:
100%
;
}
.form-group
{
position
:
relative
;
margin-bottom
:
15px
;
}
.login_labelName
{
margin-top
:
34px
;
font-size
:
16px
;
margin-bottom
:
16px
;
}
.form-group
i
{
position
:
absolute
;
right
:
6px
;
bottom
:
0
;
z-index
:
2
;
width
:
46px
;
height
:
46px
;
text-align
:
center
;
line-height
:
46px
;
color
:
#999
;
font-size
:
28px
;
cursor
:
pointer
;
}
.login-box
.q-field__control
{
height
:
46px
;
}
.type-item
{
width
:
50px
;
height
:
50px
;
background
:
#f5f5f5
;
border-radius
:
25px
;
}
.type-item
img
{
width
:
28px
;
height
:
28px
;
}
</
style
>
<
template
>
<div
class=
"login"
>
<div
class=
"login-box"
>
<div
class=
"f34 bold"
>
修改邮箱
</div>
<div
class=
"login_row"
>
<div
class=
"form-group"
>
<div
class=
"login_labelName"
>
輸入郵箱
</div>
<q-input
outlined
v-model=
"loginMsg.EMail"
/>
<div
class=
"primary q-mt-sm"
v-show=
"tips"
>
邮箱格式有误,请核实
</div>
</div>
<div>
<q-btn
v-if=
"!isSend"
class=
"q-mb-lg"
unelevated
color=
"grey-3"
style=
"width: 100%; color: #8B8B8B !important; height: 50px; margin-top: 20px"
filled
label=
"发送验证码"
@
click=
"sendVerify"
/>
<div
v-else
class=
"mt q-mb-sm"
>
<q-input
outlined
v-model=
"loginMsg.Code"
type=
"text"
/>
<div
class=
"q-mt-sm"
:class=
"cutDown ? 'text-grey-6' : ''"
>
{{
cutDown
?
cutDown
+
"秒后可重新发送"
:
"重新發送驗證碼"
}}
</div>
</div>
</div>
<div
class=
"q-mb-xl"
>
<q-btn
color=
"primary"
unelevated
style=
"width: 100%; height: 50px; margin-top: 20px"
filled
:label=
"mylabel"
@
click=
"login"
/>
</div>
</div>
</div>
</div>
</
template
>
<
script
>
import
QrcodeVue
from
"qrcode.vue"
;
export
default
{
name
:
"Login"
,
components
:
{
QrcodeVue
,
},
data
()
{
return
{
isSend
:
false
,
tips
:
false
,
cutDown
:
0
,
isAgree
:
false
,
isLogin
:
true
,
loginMsg
:
{
EMail
:
""
,
Code
:
""
,
},
// , 'google', 'facebook', 'apple'
typeList
:
[
"wechat"
],
logo
:
""
,
flag
:
2
,
mylabel
:
"修改邮箱"
,
};
},
created
()
{},
mounted
()
{
},
methods
:
{
sendVerify
()
{
if
(
this
.
inSending
)
return
this
.
inSending
=
true
if
(
this
.
verifyEmail
())
{
this
.
apipost
(
'directCustomer_post_SendMail'
,
{
Mailbox
:
this
.
loginMsg
.
EMail
,
SendType
:
5
},
(
res
)
=>
{
this
.
inSending
=
false
if
(
res
.
data
.
resultCode
==
1
)
{
this
.
isSend
=
true
;
this
.
cutDown
=
60
;
this
.
startCutDown
();
}
else
{
this
.
$q
.
notify
({
type
:
"negative"
,
message
:
res
.
data
.
message
,
position
:
"top"
,
timeout
:
2000
,
// 以毫秒为单位; 0意味着没有超时
});
}
},
null
)
}
else
{
this
.
inSending
=
false
}
},
startCutDown
()
{
this
.
timer
=
setTimeout
(()
=>
{
this
.
cutDown
--
;
if
(
this
.
cutDown
)
{
this
.
startCutDown
();
}
},
1000
);
},
verifyEmail
()
{
if
(
/^
[^
@
\s]
+@
[^
@
\s]
+
\.[^
@
\s]
+$/
.
test
(
this
.
loginMsg
.
EMail
))
{
this
.
tips
=
false
;
return
true
;
}
else
{
// 提示用户邮箱格式有误
this
.
tips
=
true
;
return
false
;
}
},
login
()
{
if
(
this
.
mylabel
===
"提交中..."
)
{
return
}
if
(
this
.
loginMsg
.
EMail
==
""
)
{
this
.
$q
.
notify
({
type
:
"negative"
,
message
:
"请输入账号"
,
position
:
"top"
,
timeout
:
2000
,
// 以毫秒为单位; 0意味着没有超时
});
return
;
}
if
(
this
.
loginMsg
.
Code
==
""
)
{
this
.
$q
.
notify
({
type
:
"negative"
,
message
:
"请输入邮箱验证码"
,
position
:
"top"
,
timeout
:
2000
,
// 以毫秒为单位; 0意味着没有超时
});
return
;
}
this
.
mylabel
=
"提交中..."
;
this
.
apipost
(
'b2c_post_UpdateCustomerEMail'
,
this
.
loginMsg
,
(
res
)
=>
{
this
.
mylabel
=
"修改邮箱"
;
if
(
res
.
data
.
resultCode
==
1
)
{
// this.CommonJump("/login", {});
this
.
$emit
(
'change'
)
this
.
$q
.
notify
({
type
:
"positive"
,
message
:
res
.
data
.
message
,
position
:
"top"
,
timeout
:
2000
,
// 以毫秒为单位; 0意味着没有超时
});
}
else
{
this
.
$q
.
notify
({
type
:
"negative"
,
message
:
res
.
data
.
message
,
position
:
"top"
,
timeout
:
2000
,
// 以毫秒为单位; 0意味着没有超时
});
}
},
(
err
)
=>
{}
);
},
},
};
</
script
>
src/pages/usercenter/loginInfo.vue
View file @
8f964182
...
@@ -33,14 +33,15 @@
...
@@ -33,14 +33,15 @@
}
}
.img-box
{
.img-box
{
width
:
50px
;
width
:
50px
;
height
:
50px
;
height
:
50px
;
background
:
#F5F5F5
;
background
:
#f5f5f5
;
border-radius
:
25px
;
border-radius
:
25px
;
}
.img
{
}
.img
{
width
:
50px
;
width
:
50px
;
height
:
50px
;
height
:
50px
;
display
:
block
;
display
:
block
;
padding
:
11px
;
padding
:
11px
;
}
}
</
style
>
</
style
>
<
template
>
<
template
>
...
@@ -49,50 +50,135 @@ padding: 11px;
...
@@ -49,50 +50,135 @@ padding: 11px;
<div
class=
"tips"
>
登陸方式管理
</div>
<div
class=
"tips"
>
登陸方式管理
</div>
<div
class=
"card"
>
<div
class=
"card"
>
<div
class=
"flex justify-between"
>
<div
class=
"flex justify-between"
>
<div>
郵箱
<span
class=
"text-grey-6"
>
(默認地址)
</span></div>
<div>
<div><span>
修改
</span><span>
删除
</span></div>
<span
class=
"f18 bold"
>
郵箱
</span
><span
class=
"text-grey-6"
>
(默認地址)
</span>
<div
class=
"text-grey-7"
>
{{
form
.
Mailbox
}}
</div>
</div>
<div>
<span
class=
"user-edit mr0"
@
click=
"changeEmail"
>
修改
</span>
<!--
<span
class=
"text-grey-6 cursor-pointer"
@
click=
"deleteUser(item)"
>
删除
</span>
-->
</div>
</div>
</div>
</div>
</div>
<div
class=
"card flex justify-between"
>
<div
class=
"card flex justify-between"
>
<div
class=
"img-box"
>
<img
class=
"img"
src=
"../../assets/img/wechat.png"
/>
</div>
<div
class=
"flex justify-between"
>
<div
class=
"flex justify-between"
>
<div>
郵箱
<span
class=
"text-grey-6"
>
(默認地址)
</span></div>
<div
class=
"img-box"
>
<div><span>
修改
</span><span>
删除
</span></div>
<img
class=
"img"
src=
"../../assets/img/wechat.png"
/>
</div>
<div
class=
"q-ml-sm"
>
<div
class=
"f18 bold"
>
微信
</div>
<div
class=
"text-grey-7"
>
{{
form
.
WXNickName
}}
</div></div>
</div>
<div>
<span
class=
"user-edit mr0"
@
click=
"changeWechat"
>
修改
</span>
<!--
<span
class=
"text-grey-6 cursor-pointer"
@
click=
"deleteUser(item)"
>
删除
</span>
-->
</div>
</div>
</div>
</div>
<div></div>
<q-dialog
content-style=
"width: 900px"
v-model=
"showReset"
>
<resetEmail
@
change=
"resetEmailSuccess"
></resetEmail>
</q-dialog>
</div>
</div>
</div>
</div>
</
template
>
</
template
>
<
script
>
<
script
>
import
resetEmail
from
"./components/resetEmail.vue"
;
export
default
{
export
default
{
components
:
{
resetEmail
},
data
()
{
data
()
{
return
{
return
{
form
:
{
showReset
:
false
,
lastName
:
""
,
form
:
{},
firstName
:
""
,
},
model
:
""
,
date
:
""
,
options
:
[],
};
};
},
},
mounted
()
{
const
{
code
,
state
}
=
this
.
$route
.
query
;
if
(
code
)
{
this
.
reSetWechat
(
code
,
state
);
}
this
.
getUserInfo
();
this
.
getOpenInfo
();
this
.
userInfo
=
this
.
$user
.
userInfo
;
console
.
log
(
"let u = this.$user.userInfo;"
,
this
.
userInfo
);
},
methods
:
{
methods
:
{
submit
()
{
getUserInfo
()
{
const
verifyArr
=
[
"fastName"
,
"lastName"
];
this
.
apipost
(
verifyArr
.
forEach
((
item
)
=>
{
"GetCustomerInfo_post"
,
this
.
$refs
[
item
].
validate
();
{
});
Id
:
this
.
userInfo
?.
id
,
verifyArr
.
forEach
((
item
)
=>
{
},
if
(
item
.
$refs
[
item
].
hasError
)
{
(
res
)
=>
{
this
.
formHasError
=
true
;
if
(
res
.
data
.
resultCode
==
1
)
{
}
this
.
form
=
res
.
data
.
data
;
});
}
else
{
if
((
this
.
formHasError
=
true
))
{
// this.$notify(res.data.message);
return
;
this
.
$q
.
notify
({
}
type
:
"negative"
,
message
:
res
.
data
.
message
,
position
:
"top"
,
timeout
:
2000
,
// 以毫秒为单位; 0意味着没有超时
});
}
},
null
);
},
getOpenInfo
()
{
this
.
apipost
(
"GetOpenInfo_post"
,
{},
(
r
)
=>
{
if
(
r
.
data
.
resultCode
==
1
)
{
this
.
openInfo
=
r
.
data
.
data
;
}
else
{
this
.
$q
.
notify
({
type
:
"negative"
,
message
:
r
.
data
.
message
,
position
:
"top"
,
timeout
:
2000
,
// 以毫秒为单位; 0意味着没有超时
});
}
},
null
);
},
changeWechat
()
{
const
{
AppID
,
State
,
OpenRedirectUri
}
=
this
.
openInfo
;
let
redirect_uri
=
OpenRedirectUri
;
const
url
=
`https://open.weixin.qq.com/connect/qrconnect?appid=
${
AppID
}
&redirect_uri=
${
redirect_uri
}
/loginInfo&response_type=code&scope=snsapi_login&state=
${
State
}
&wechat_redirect=
${
redirect_uri
}
`
;
window
.
location
.
href
=
url
;
},
changeEmail
()
{
this
.
showReset
=
true
;
},
resetEmailSuccess
()
{
this
.
showReset
=
false
;
this
.
getUserInfo
();
},
reSetWechat
(
code
,
state
)
{
this
.
apipost
(
"GetOpenInfo_post"
,
{
code
,
state
},
(
r
)
=>
{
if
(
r
.
data
.
resultCode
==
1
)
{
this
.
$q
.
notify
({
type
:
"positive"
,
message
:
r
.
data
.
message
,
position
:
"top"
,
timeout
:
2000
,
// 以毫秒为单位; 0意味着没有超时
});
}
else
{
this
.
$q
.
notify
({
type
:
"negative"
,
message
:
r
.
data
.
message
,
position
:
"top"
,
timeout
:
2000
,
// 以毫秒为单位; 0意味着没有超时
});
}
},
null
);
},
},
},
},
};
};
...
...
src/pages/usercenter/setAddress.vue
View file @
8f964182
This diff is collapsed.
Click to expand it.
src/pages/usercenter/setInfo.vue
View file @
8f964182
...
@@ -4,6 +4,26 @@
...
@@ -4,6 +4,26 @@
height
:
40px
;
height
:
40px
;
margin
:
10px
;
margin
:
10px
;
}
}
.form-group
{
width
:
320px
;
}
.form-group
{
position
:
relative
;
margin-bottom
:
15px
;
}
.form-group
i
{
position
:
absolute
;
right
:
12px
;
bottom
:
0
;
z-index
:
2
;
width
:
40px
;
height
:
40px
;
text-align
:
center
;
line-height
:
40px
;
color
:
#999
;
font-size
:
28px
;
cursor
:
pointer
;
}
.content
{
.content
{
width
:
900px
;
width
:
900px
;
}
}
...
@@ -33,25 +53,53 @@
...
@@ -33,25 +53,53 @@
设置密码(8 - 20个字符,须至少包含1个数字、1个字母及1个特殊符号)
设置密码(8 - 20个字符,须至少包含1个数字、1个字母及1个特殊符号)
</div>
</div>
<div
class=
"text-grey-6"
>
高强度密码能提高账号安全性
</div>
<div
class=
"text-grey-6"
>
高强度密码能提高账号安全性
</div>
<q-input
<form
@
submit
.
prevent
.
stop=
"submit"
>
class=
"form-item"
<div
class=
"form-group"
>
v-model=
"form.firstName"
<q-input
outlined
class=
"form-item"
placeholder=
"姓"
v-model=
"form.OldPassword"
ref=
"firstName"
outlined
:rules=
"[(val) => val !== '' || '请输入姓氏']"
placeholder=
"旧密码"
></q-input>
ref=
"OldPassword"
<q-input
:type=
"isPasswordOld === 2 ? 'PassWord' : 'text'"
class=
"form-item"
:rules=
"[(val) => val !== '' || '请输入旧密码']"
v-model=
"form.firstName"
></q-input
outlined
><i
placeholder=
"姓"
class=
"iconfont iconyanjing_xianshi"
ref=
"firstName"
v-if=
"isPasswordOld == 1"
:rules=
"[(val) => val !== '' || '请输入姓氏']"
@
click=
"isPasswordOld = 2"
></q-input>
></i>
<div>
<i
<q-btn
color=
"primary"
unelevated
label=
"确认"
@
click=
"submit"
/>
class=
"iconfont iconbiyan"
</div>
v-if=
"isPasswordOld == 2"
@
click=
"isPasswordOld = 1"
></i>
</div>
<div
class=
"form-group"
>
<q-input
class=
"form-item"
v-model=
"form.NewPassword"
outlined
placeholder=
"新密码"
ref=
"NewPassword"
:type=
"isPassword === 2 ? 'PassWord' : 'text'"
:rules=
"[(val) => val !== '' || '请输入新密码']"
></q-input
><i
class=
"iconfont iconyanjing_xianshi"
v-if=
"isPassword == 1"
@
click=
"isPassword = 2"
></i>
<i
class=
"iconfont iconbiyan"
v-if=
"isPassword == 2"
@
click=
"isPassword = 1"
></i>
</div>
<div>
<q-btn
color=
"primary"
type=
"submit"
unelevated
label=
"确认"
/>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
...
@@ -64,66 +112,205 @@
...
@@ -64,66 +112,205 @@
<div
class=
"text-grey-6"
>
<div
class=
"text-grey-6"
>
抢先获取印象最新优惠活动、优惠码、折扣信息及最新动向
抢先获取印象最新优惠活动、优惠码、折扣信息及最新动向
</div>
</div>
<q-checkbox>
电子邮件
</q-checkbox>
<checkboxGroupVue
<q-checkbox>
短信
</q-checkbox>
:checkboxList=
"emailType"
v-model=
"setInfoForm.DiscountsNoticeWay"
></checkboxGroupVue>
</div>
</div>
<div>
<div>
<div>
消息提醒
</div>
<div>
消息提醒
</div>
<div
class=
"text-grey-6"
>
<div
class=
"text-grey-6"
>
获取购物车内活动及支付状态、评价提醒、推荐好友获取优惠等信息
获取购物车内活动及支付状态、评价提醒、推荐好友获取优惠等信息
</div>
</div>
<q-checkbox>
电子邮件
</q-checkbox>
<checkboxGroupVue
<q-checkbox>
短信
</q-checkbox>
:checkboxList=
"emailType"
v-model=
"setInfoForm.MessageNoticeWay"
></checkboxGroupVue>
</div>
</div>
<div>
<div>
<div>
賬戶通知
</div>
<div>
賬戶通知
</div>
<div
class=
"text-grey-6"
>
<div
class=
"text-grey-6"
>
接收重要通知,如订单摘要、凭证及活动取消
接收重要通知,如订单摘要、凭证及活动取消
</div>
</div>
<q-checkbox>
电子邮件
</q-checkbox>
<checkboxGroupVue
<q-checkbox>
短信
</q-checkbox>
:checkboxList=
"emailType"
v-model=
"setInfoForm.AccountNoticeWay"
></checkboxGroupVue>
</div>
</div>
<div>
<div>
<q-btn
<q-btn
color=
"primary"
color=
"primary"
unelevated
unelevated
label=
"更改偏好設置"
label=
"更改偏好設置"
@
click=
"
submit
"
@
click=
"
changeNoticeType
"
/>
/>
</div>
</div>
<div
class=
"tips q-mt-lg"
>
註銷賬戶
</div>
<div
class=
"tips q-mt-lg"
>
註銷賬戶
</div>
<div
class=
"q-mt-sm"
>
删除您的Klook客路帐户及个人数据
</div
>
<q-btn
color=
"primary"
class=
"q-mt-sm"
@
click=
"removeAccount"
>
删除您的帐户及个人数据
</q-btn
>
</div>
</div>
</div>
</div>
<q-dialog
content-style=
"width: 900px"
v-model=
"showRemove"
>
<removeAccount></removeAccount>
</q-dialog>
</div>
</div>
</
template
>
</
template
>
<
script
>
<
script
>
import
checkboxGroupVue
from
"./components/checkboxGroup.vue"
;
import
removeAccount
from
'./components/removeAccount.vue'
export
default
{
export
default
{
components
:
{
checkboxGroupVue
,
removeAccount
},
data
()
{
data
()
{
return
{
return
{
isPasswordOld
:
2
,
isPassword
:
2
,
emailType
:
[
{
label
:
"电子邮件"
,
value
:
1
},
{
label
:
"短信"
,
value
:
2
},
],
setInfoForm
:
{
DiscountsNoticeWay
:
1
,
MessageNoticeWay
:
1
,
AccountNoticeWay
:
1
,
},
form
:
{
form
:
{
lastName
:
""
,
OldPassword
:
""
,
firstName
:
""
,
NewPassword
:
""
,
},
},
model
:
""
,
model
:
""
,
date
:
""
,
date
:
""
,
options
:
[],
options
:
[],
showRemove
:
false
,
};
};
},
},
mounted
()
{
this
.
getUserInfo
();
},
methods
:
{
methods
:
{
removeAccount
()
{
this
.
showRemove
=
true
},
getUserInfo
()
{
this
.
apipost
(
"GetCustomerInfo_post"
,
{
Id
:
this
.
userInfo
?.
id
,
},
(
res
)
=>
{
if
(
res
.
data
.
resultCode
==
1
)
{
const
{
DiscountsNoticeWay
,
MessageNoticeWay
,
AccountNoticeWay
}
=
res
.
data
.
data
;
this
.
setInfoForm
=
{
DiscountsNoticeWay
,
MessageNoticeWay
,
AccountNoticeWay
,
};
}
else
{
// this.$notify(res.data.message);
this
.
$q
.
notify
({
type
:
"negative"
,
message
:
res
.
data
.
message
,
position
:
"top"
,
timeout
:
2000
,
// 以毫秒为单位; 0意味着没有超时
});
}
},
null
);
},
changeNoticeType
()
{
let
arr
=
[
"DiscountsNoticeWay"
,
"MessageNoticeWay"
,
"AccountNoticeWay"
];
let
notify
=
{
DiscountsNoticeWay
:
"请选择優惠及更新信息偏好"
,
MessageNoticeWay
:
"请选择消息提醒偏好"
,
AccountNoticeWay
:
"请选择賬戶通知偏好"
,
};
let
item
=
""
;
for
(
let
i
=
0
;
i
<
arr
.
length
;
i
++
)
{
item
=
arr
[
i
];
if
(
!
this
.
setInfoForm
[
item
])
{
// this.$notify(res.data.message);
this
.
$q
.
notify
({
type
:
"negative"
,
message
:
notify
[
item
],
position
:
"top"
,
timeout
:
2000
,
// 以毫秒为单位; 0意味着没有超时
});
return
;
}
}
this
.
submitChangeNotice
();
},
submitChangeNotice
()
{
this
.
apipost
(
"b2c_post_SetCustomerNotice"
,
this
.
setInfoForm
,
(
res
)
=>
{
if
(
res
.
data
.
resultCode
==
1
)
{
// this.$notify(res.data.message);
this
.
$q
.
notify
({
type
:
"positive"
,
message
:
res
.
data
.
message
,
position
:
"top"
,
timeout
:
2000
,
// 以毫秒为单位; 0意味着没有超时
});
}
else
{
// this.$notify(res.data.message);
this
.
$q
.
notify
({
type
:
"negative"
,
message
:
res
.
data
.
message
,
position
:
"top"
,
timeout
:
2000
,
// 以毫秒为单位; 0意味着没有超时
});
}
},
null
);
},
resetPassword
()
{
console
.
log
(
"resetPassword"
);
this
.
apipost
(
"b2c_post_UpdateCustomerPassWord"
,
this
.
form
,
(
res
)
=>
{
if
(
res
.
data
.
resultCode
==
1
)
{
// this.$notify(res.data.message);
this
.
$q
.
notify
({
type
:
"positive"
,
message
:
res
.
data
.
message
,
position
:
"top"
,
timeout
:
2000
,
// 以毫秒为单位; 0意味着没有超时
});
}
else
{
// this.$notify(res.data.message);
this
.
$q
.
notify
({
type
:
"negative"
,
message
:
res
.
data
.
message
,
position
:
"top"
,
timeout
:
2000
,
// 以毫秒为单位; 0意味着没有超时
});
}
},
null
);
},
submit
()
{
submit
()
{
const
verifyArr
=
[
"fastName"
,
"lastName"
];
this
.
formHasError
=
false
;
const
verifyArr
=
[
"OldPassword"
,
"NewPassword"
];
console
.
log
(
"submit"
);
verifyArr
.
forEach
((
item
)
=>
{
verifyArr
.
forEach
((
item
)
=>
{
console
.
log
(
"submit"
,
this
.
$refs
[
item
]);
this
.
$refs
[
item
].
validate
();
this
.
$refs
[
item
].
validate
();
});
});
verifyArr
.
forEach
((
item
)
=>
{
verifyArr
.
forEach
((
item
)
=>
{
if
(
item
.
$refs
[
item
].
hasError
)
{
if
(
this
.
$refs
[
item
].
hasError
)
{
this
.
formHasError
=
true
;
this
.
formHasError
=
true
;
}
}
});
});
if
((
this
.
formHasError
=
true
))
{
console
.
log
(
"this.formHasError"
,
this
.
formHasError
);
if
(
this
.
formHasError
)
{
return
;
return
;
}
}
this
.
resetPassword
();
},
},
},
},
};
};
...
...
src/pages/usercenter/setUsersList.vue
View file @
8f964182
...
@@ -82,18 +82,18 @@
...
@@ -82,18 +82,18 @@
<div
class=
"card"
v-for=
"item in pageData"
:key=
"item.id"
>
<div
class=
"card"
v-for=
"item in pageData"
:key=
"item.id"
>
<div
class=
"flex card-title justify-between"
>
<div
class=
"flex card-title justify-between"
>
<div
class=
"flex"
>
<div
class=
"flex"
>
<span>
订单号
</span>
<span>
{{
item
.
Name
}}
</span>
<span
class=
"phone"
>
联系客服
</span>
<span
class=
"phone"
>
手機號:
{{
item
.
Mobile
}}
</span>
</div>
</div>
<span>
<span>
<span>
编辑
</span>
<span
class=
"user-edit"
@
click=
"editUser(item)"
>
编辑
</span>
<span>
删除
</span>
<span
class=
"text-grey-6 cursor-pointer"
@
click=
"deleteUser(item)"
>
删除
</span>
</span>
</span>
</div>
</div>
<div
class=
"flex q-py-sm"
>
<div
class=
"flex q-py-sm"
>
<div
class=
"row"
>
<div
class=
"row
q-pa-lg"
v-for=
"(item, index) in item.CardList"
:key=
"index
"
>
<div
class=
"col
-12
"
>
中國內地身份證:510181********0920
</div>
<div
class=
"col"
>
中國內地身份證:510181********0920
</div>
<div
class=
"col
-12
"
>
中國內地身份證:510181********0920
</div>
<div
class=
"col"
>
中國內地身份證:510181********0920
</div>
</div>
</div>
</div>
</div>
</div>
</div>
...
@@ -116,10 +116,10 @@
...
@@ -116,10 +116,10 @@
<div
class=
"title"
>
姓
</div>
<div
class=
"title"
>
姓
</div>
<q-input
<q-input
class=
"form-item"
class=
"form-item"
v-model=
"form.Sur
n
ame"
v-model=
"form.Sur
N
ame"
outlined
outlined
placeholder=
"姓"
placeholder=
"姓"
ref=
"Sur
n
ame"
ref=
"Sur
N
ame"
:rules=
"[(val) => !!val || '请输入姓氏']"
:rules=
"[(val) => !!val || '请输入姓氏']"
></q-input>
></q-input>
</div>
</div>
...
@@ -150,10 +150,10 @@
...
@@ -150,10 +150,10 @@
<div
class=
"col"
>
<div
class=
"col"
>
<div
class=
"title"
>
名字(需與旅遊證件一致)
</div>
<div
class=
"title"
>
名字(需與旅遊證件一致)
</div>
<q-input
<q-input
ref=
"EnSur
n
ame"
ref=
"EnSur
N
ame"
class=
"form-item"
class=
"form-item"
placeholder=
"名字(需與旅遊證件一致)"
placeholder=
"名字(需與旅遊證件一致)"
v-model=
"form.EnSur
n
ame"
v-model=
"form.EnSur
N
ame"
outlined
outlined
:rules=
"[(val) => !!val || '请输入名字(需與旅遊證件一致)']"
:rules=
"[(val) => !!val || '请输入名字(需與旅遊證件一致)']"
></q-input>
></q-input>
...
@@ -179,10 +179,10 @@
...
@@ -179,10 +179,10 @@
<div
class=
"col"
>
<div
class=
"col"
>
<div
class=
"title"
>
電話(首次需驗證)
</div>
<div
class=
"title"
>
電話(首次需驗證)
</div>
<q-input
<q-input
ref=
"Mob
li
e"
ref=
"Mob
il
e"
class=
"form-item"
class=
"form-item"
placeholder=
"電話(首次需驗證)"
placeholder=
"電話(首次需驗證)"
v-model=
"form.Mob
li
e"
v-model=
"form.Mob
il
e"
outlined
outlined
:rules=
"[(val) => !!val || '请输入電話(首次需驗證)']"
:rules=
"[(val) => !!val || '请输入電話(首次需驗證)']"
></q-input>
></q-input>
...
@@ -210,8 +210,8 @@
...
@@ -210,8 +210,8 @@
/>
/>
</div>
</div>
<div
class=
"col"
>
<div
class=
"col"
>
<div
class=
"flex justify-between items-center"
>
<div
class=
"
title
flex justify-between items-center"
>
<div
class=
"title"
>
证件号码
</div>
<div>
证件号码
</div>
<div
v-if=
"index > 0"
@
click=
"deleteCardItem(item)"
>
删除
</div>
<div
v-if=
"index > 0"
@
click=
"deleteCardItem(item)"
>
删除
</div>
</div>
</div>
<q-input
<q-input
...
@@ -246,11 +246,11 @@ export default {
...
@@ -246,11 +246,11 @@ export default {
isShowDialog
:
false
,
isShowDialog
:
false
,
selectedKey
:
"全部"
,
selectedKey
:
"全部"
,
form
:
{
form
:
{
Sur
n
ame
:
""
,
Sur
N
ame
:
""
,
Name
:
""
,
Name
:
""
,
EnName
:
""
,
EnName
:
""
,
EnSur
n
ame
:
""
,
EnSur
N
ame
:
""
,
Mob
li
e
:
""
,
Mob
il
e
:
""
,
CardList
:
[],
CardList
:
[],
},
},
model
:
""
,
model
:
""
,
...
@@ -328,11 +328,11 @@ export default {
...
@@ -328,11 +328,11 @@ export default {
submit
()
{
submit
()
{
this
.
formHasError
=
false
;
this
.
formHasError
=
false
;
const
verifyArr
=
[
const
verifyArr
=
[
"Sur
n
ame"
,
"Sur
N
ame"
,
"Name"
,
"Name"
,
"EnName"
,
"EnName"
,
"EnSur
n
ame"
,
"EnSur
N
ame"
,
"Mob
li
e"
,
"Mob
il
e"
,
];
];
verifyArr
.
forEach
((
item
)
=>
{
verifyArr
.
forEach
((
item
)
=>
{
console
.
log
(
"this.$refs[item]"
,
this
,
item
,
this
.
$refs
[
item
]);
console
.
log
(
"this.$refs[item]"
,
this
,
item
,
this
.
$refs
[
item
]);
...
@@ -373,11 +373,16 @@ export default {
...
@@ -373,11 +373,16 @@ export default {
null
null
);
);
},
},
deleteUser
()
{
editUser
(
item
)
{
console
.
log
(
'editUser'
,
item
)
this
.
form
=
item
this
.
isShowDialog
=
true
},
deleteUser
(
item
)
{
this
.
apipost
(
this
.
apipost
(
"b2c_post_DelTripGuestInfo"
,
"b2c_post_DelTripGuestInfo"
,
{
{
Id
:
this
.
userInfo
?.
i
d
,
TripGuestId
:
item
.
I
d
,
},
},
(
res
)
=>
{
(
res
)
=>
{
if
(
res
.
data
.
resultCode
==
1
)
{
if
(
res
.
data
.
resultCode
==
1
)
{
...
@@ -418,6 +423,8 @@ export default {
...
@@ -418,6 +423,8 @@ export default {
position
:
"top"
,
position
:
"top"
,
timeout
:
2000
,
// 以毫秒为单位; 0意味着没有超时
timeout
:
2000
,
// 以毫秒为单位; 0意味着没有超时
});
});
this
.
isShowDialog
=
false
;
this
.
getUsersList
()
}
else
{
}
else
{
// this.$notify(res.data.message);
// this.$notify(res.data.message);
this
.
$q
.
notify
({
this
.
$q
.
notify
({
...
...
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