Commit 796b7933 authored by 沈良进's avatar 沈良进

个人中心页面开发

parent 598ed582
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -127,4 +127,7 @@ ...@@ -127,4 +127,7 @@
} }
.primary { .primary {
color: $primary; color: $primary;
}
.white {
color: #fff;
} }
\ No newline at end of file
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
<img class="avatar" v-if="LoginUser.photo" :src="LoginUser.photo" /> <img class="avatar" v-if="LoginUser.photo" :src="LoginUser.photo" />
<img class="avatar" v-else src="../../../assets/img/avatar.png" /> <img class="avatar" v-else src="../../../assets/img/avatar.png" />
</div> </div>
<div class="text-primary text-center q-mt-sm">个人信息</div> <div class="text-primary text-center q-mt-sm cursor-pointer" @click="navigateTo('/setUserInfo')">个人信息</div>
<div class="q-mt-xl q-pb-lg"> <div class="q-mt-xl q-pb-lg">
<div <div
class="nav-item flex justify-between items-center cursor-pointer" class="nav-item flex justify-between items-center cursor-pointer"
...@@ -106,7 +106,7 @@ export default { ...@@ -106,7 +106,7 @@ export default {
}, },
{ {
icon: "", icon: "",
key: "/setUserInfo", key: "/setInfo",
label: "账户设置", label: "账户设置",
number: "", number: "",
}, },
......
...@@ -15,84 +15,97 @@ ...@@ -15,84 +15,97 @@
padding: 0 35px; padding: 0 35px;
line-height: 42px; line-height: 42px;
} }
::v-deep .q-field__control { .bg-blue {
height: 40px; background: #70b1fa;
border-radius: 8px 8px 0 0;
.use {
color: #67cac2;
}
}
.bg-red {
background: #ee727d;
border-radius: 8px 8px 0 0;
.use {
color: #6F242B;
}
}
.bg-yellow {
background: #f2c16b;
border-radius: 8px 8px 0 0;
.use {
color: #8A5D10;
}
}
.bg-green {
background: #67cac2;
border-radius: 8px 8px 0 0;
.use {
color: #195954 ;
}
}
.card {
margin: 10px;
width: 201px;
height: 310px;
background: #f9f9f9;
border-radius: 8px;
}
.nav-item {
width: 100px;
margin: 0 10px;
text-align: center;
}
.border-bottom {
width: 20px;
height: 4px;
border-radius: 2px;
background-color: $primary;
margin: -8px auto 0 auto;
} }
.title { .img {
margin-top: 20px; width: 201px;
margin-bottom: 10px; margin-bottom: -6px;
} }
</style> </style>
<template> <template>
<div class="content q-ma-lg bg-white"> <div class="content q-ma-lg bg-white">
<div class="q-ma-lg"> <div class="q-ma-lg">
<div class="tips">密碼管理</div> <div class="tips flex">
<div> <div
<div> @click="changeCouponType(item)"
<div class="q-mt-lg q-mb-sm"> class="nav-item cursor-pointer"
设置密码(8 - 20个字符,须至少包含1个数字、1个字母及1个特殊符号) v-for="item in ['可使用', '已使用', '已过期']"
</div> :key="item"
<div class="text-grey-6">高强度密码能提高账号安全性</div> >
<q-input {{ item }}
class="form-item" <div :class="selectedKey === item ? 'border-bottom' : ''"></div>
v-model="form.firstName"
outlined
placeholder="姓"
ref="firstName"
:rules="[(val) => val !== '' || '请输入姓氏']"
></q-input>
<q-input
class="form-item"
v-model="form.firstName"
outlined
placeholder="姓"
ref="firstName"
:rules="[(val) => val !== '' || '请输入姓氏']"
></q-input>
<div>
<q-btn color="primary" unelevated label="确认" @click="submit" />
</div>
</div> </div>
</div> </div>
</div> <div class="flex flex-wrap">
<div class="card" v-for="item in 10" :key="item">
<div class="q-ma-lg"> <div class="bg-blue">
<div class="tips">通知偏好設置</div> <div class="white text-center f16 q-pt-sm">CYN</div>
<div> <div class="white text-center f26">10</div>
<div> <div class="white text-center">
<div class="q-mt-lg q-mb-sm">優惠及更新信息</div> <span>限用品類:</span><span>滿2000可用</span>
<div class="text-grey-6"> </div>
抢先获取印象最新优惠活动、优惠码、折扣信息及最新动向 <div class="use text-center q-pb-sm">
<span>限用品類:</span><span>滿2000可用</span>
</div>
<img class="img" src="../../assets/img/coupon.png">
</div> </div>
<q-checkbox>电子邮件</q-checkbox> <div class="q-pa-sm">
<q-checkbox>短信</q-checkbox> <div class="q-my-sm">
</div> <span class="text-grey-6">限用品類:</span><span>滿2000可用</span>
<div> </div>
<div>消息提醒</div> <div class="q-my-sm">
<div class="text-grey-6"> <span class="text-grey-6">限用品類:</span><span>滿2000可用</span>
获取购物车内活动及支付状态、评价提醒、推荐好友获取优惠等信息 </div>
<div class="flex flex-center q-mt-xl">
<q-btn color="primary" unelevated outline label="立即使用"></q-btn>
</div>
</div> </div>
<q-checkbox>电子邮件</q-checkbox>
<q-checkbox>短信</q-checkbox>
</div> </div>
<div>
<div>賬戶通知</div>
<div class="text-grey-6">
接收重要通知,如订单摘要、凭证及活动取消
</div>
<q-checkbox>电子邮件</q-checkbox>
<q-checkbox>短信</q-checkbox>
</div>
<div>
<q-btn
color="primary"
unelevated
label="更改偏好設置"
@click="submit"
/>
</div>
<div class="tips q-mt-lg">註銷賬戶</div>
<div class="q-mt-sm">删除您的Klook客路帐户及个人数据</div>
</div> </div>
</div> </div>
</div> </div>
...@@ -101,6 +114,7 @@ ...@@ -101,6 +114,7 @@
export default { export default {
data() { data() {
return { return {
selectedKey: "可使用",
form: { form: {
lastName: "", lastName: "",
firstName: "", firstName: "",
...@@ -111,6 +125,9 @@ export default { ...@@ -111,6 +125,9 @@ export default {
}; };
}, },
methods: { methods: {
changeCouponType(item) {
this.selectedKey = item;
},
submit() { submit() {
const verifyArr = ["fastName", "lastName"]; const verifyArr = ["fastName", "lastName"];
verifyArr.forEach((item) => { verifyArr.forEach((item) => {
......
...@@ -7,8 +7,25 @@ ...@@ -7,8 +7,25 @@
.content { .content {
width: 900px; width: 900px;
} }
.title {
margin-top: 20px;
margin-bottom: 10px;
}
.card {
margin: 10px;
background: #FFFFFF;
border: 1px solid #EEEEEE;
border-radius: 8px;
}
.card-title {
height: 37px;
height: 37px;
padding: 0 20px;
line-height: 37px;
background: #f5f5f5;
border-radius: 8px 8px 0px 0px;
}
.tips { .tips {
width: 100%;
height: 42px; height: 42px;
background: #f5f5f5; background: #f5f5f5;
border-radius: 8px; border-radius: 8px;
...@@ -18,81 +35,115 @@ ...@@ -18,81 +35,115 @@
::v-deep .q-field__control { ::v-deep .q-field__control {
height: 40px; height: 40px;
} }
::v-deep .q-field--auto-height .q-field__control {
min-height: 40px;
}
::v-deep .q-field__marginal {
height: 40px;
}
.title { .title {
margin-top: 20px; margin-top: 20px;
margin-bottom: 10px; margin-bottom: 10px;
} }
.phone {
margin-left: 100px;
}
.name {
width: 300px;
}
.user-name {
width: 120px;
}
.pay-info {
width: 120px;
}
.order-info {
width: 120px;
}
.order-action {
width: 120px;
}
.nav-item {
width: 100px;
margin: 0 10px;
text-align: center;
}
.border-bottom {
width: 20px;
height: 4px;
border-radius: 2px;
background-color: $primary;
margin: -8px auto 0 auto;
}
</style> </style>
<template> <template>
<div class="content q-ma-lg bg-white"> <div class="content q-ma-lg bg-white">
<div class="q-ma-lg"> <div class="flex justify-between">
<div class="tips">密碼管理</div>
<div> <div>
<div> <q-input
<div class="q-mt-lg q-mb-sm"> ref="lastName"
设置密码(8 - 20个字符,须至少包含1个数字、1个字母及1个特殊符号) class="form-item"
</div> placeholder="名字(需與旅遊證件一致)"
<div class="text-grey-6">高强度密码能提高账号安全性</div> v-model="form.lastName"
<q-input outlined
class="form-item" :rules="[(val) => val !== '' || '请输入名字']"
v-model="form.firstName" ></q-input>
outlined
placeholder="姓"
ref="firstName"
:rules="[(val) => val !== '' || '请输入姓氏']"
></q-input>
<q-input
class="form-item"
v-model="form.firstName"
outlined
placeholder="姓"
ref="firstName"
:rules="[(val) => val !== '' || '请输入姓氏']"
></q-input>
<div>
<q-btn color="primary" unelevated label="确认" @click="submit" />
</div>
</div>
</div> </div>
</div>
<div class="q-ma-lg">
<div class="tips">通知偏好設置</div>
<div> <div>
<div> <q-select
<div class="q-mt-lg q-mb-sm">優惠及更新信息</div> square
<div class="text-grey-6"> outlined
抢先获取印象最新优惠活动、优惠码、折扣信息及最新动向 class="form-item"
</div> v-model="model"
<q-checkbox>电子邮件</q-checkbox> :options="options"
<q-checkbox>短信</q-checkbox> placeholder="Filled"
></q-select>
</div>
</div>
<div class="tips flex">
<div
@click="changeCouponType(item)"
class="nav-item cursor-pointer"
v-for="item in ['全部', '待付款', '待出行', '已完成', '已取消']"
:key="item"
>
{{ item }}
<div :class="selectedKey === item ? 'border-bottom' : ''"></div>
</div> </div>
<div> </div>
<div>消息提醒</div> <div>
<div class="text-grey-6"> <div class="card">
获取购物车内活动及支付状态、评价提醒、推荐好友获取优惠等信息 <div class="flex card-title justify-between">
<div class="flex">
<span>订单号</span>
<span class="phone">联系客服</span>
</div> </div>
<q-checkbox>电子邮件</q-checkbox> <span>2023-02-23 14:31:52</span>
<q-checkbox>短信</q-checkbox>
</div> </div>
<div> <div class="flex q-py-sm">
<div>賬戶通知</div> <img src="../../assets/img/avatar.png" />
<div class="text-grey-6"> <div class="name">
接收重要通知,如订单摘要、凭证及活动取消 <div>
【限量300张·售完即止】2023客路春季踏青
卡(春季特惠不约可退+广东省内周边9大路
</div>
<div>xl</div>
</div>
<div class="user-name">王然</div>
<div class="pay-info">
<div>CNY1188.00</div>
<div>在線支付</div>
</div>
<div class="order-info">
<div>等待收貨</div>
<div>订单详情</div>
</div>
<div class="order-action">
<div>确认收货</div>
<div>取消订单</div>
<div>查看發票</div>
</div> </div>
<q-checkbox>电子邮件</q-checkbox>
<q-checkbox>短信</q-checkbox>
</div>
<div>
<q-btn
color="primary"
unelevated
label="更改偏好設置"
@click="submit"
/>
</div> </div>
<div class="tips q-mt-lg">註銷賬戶</div>
<div class="q-mt-sm">删除您的Klook客路帐户及个人数据</div>
</div> </div>
</div> </div>
</div> </div>
...@@ -101,6 +152,7 @@ ...@@ -101,6 +152,7 @@
export default { export default {
data() { data() {
return { return {
selectedKey: "全部",
form: { form: {
lastName: "", lastName: "",
firstName: "", firstName: "",
...@@ -111,6 +163,9 @@ export default { ...@@ -111,6 +163,9 @@ export default {
}; };
}, },
methods: { methods: {
changeCouponType(item) {
this.selectedKey = item;
},
submit() { submit() {
const verifyArr = ["fastName", "lastName"]; const verifyArr = ["fastName", "lastName"];
verifyArr.forEach((item) => { verifyArr.forEach((item) => {
......
...@@ -17,6 +17,15 @@ ...@@ -17,6 +17,15 @@
::v-deep .q-field__control { ::v-deep .q-field__control {
height: 40px; height: 40px;
} }
::v-deep .q-field--auto-height .q-field__control {
min-height: 40px;
}
::v-deep .q-field__marginal {
height: 40px;
}
::v-deep .q-field--auto-height .q-field__native {
min-height: 40px;
}
.title { .title {
margin-top: 20px; margin-top: 20px;
margin-bottom: 10px; margin-bottom: 10px;
...@@ -30,28 +39,29 @@ ...@@ -30,28 +39,29 @@
> >
</div> </div>
<div> <div>
<form @submit.prevent.stop="submit" class="q-gutter-md">
<div> <div>
<div class="row"> <div class="row">
<div class="col"> <div class="col">
<div class="title"></div> <div class="title"></div>
<q-input <q-input
class="form-item" class="form-item"
v-model="form.firstName" v-model="form.Surname"
outlined outlined
placeholder="姓" placeholder="姓"
ref="firstName" ref="Surname"
:rules="[(val) => val !== '' || '请输入姓氏']" :rules="[(val) => !!val || '请输入姓氏']"
></q-input> ></q-input>
</div> </div>
<div class="col"> <div class="col">
<div class="title"></div> <div class="title"></div>
<q-input <q-input
ref="lastName" ref="Name"
class="form-item" class="form-item"
placeholder="名" placeholder="名"
v-model="form.lastName" v-model="form.Name"
outlined outlined
:rules="[(val) => val !== '' || '请输入名字']" :rules="[(val) => !!val || '请输入名字']"
></q-input> ></q-input>
</div> </div>
</div> </div>
...@@ -60,76 +70,130 @@ ...@@ -60,76 +70,130 @@
<div class="title">姓氏(需與旅遊證件一致)</div> <div class="title">姓氏(需與旅遊證件一致)</div>
<q-input <q-input
class="form-item" class="form-item"
v-model="form.firstName" v-model="form.EnName"
outlined outlined
placeholder="姓氏(需與旅遊證件一致)" placeholder="姓氏(需與旅遊證件一致)"
ref="firstName" ref="EnName"
:rules="[(val) => val !== '' || '请输入姓氏']" :rules="[(val) => !!val || '请输入姓氏(需與旅遊證件一致)']"
></q-input> ></q-input>
</div> </div>
<div class="col"> <div class="col">
<div class="title">名字(需與旅遊證件一致)</div> <div class="title">名字(需與旅遊證件一致)</div>
<q-input <q-input
ref="lastName" ref="EnSurname"
class="form-item" class="form-item"
placeholder="名字(需與旅遊證件一致)" placeholder="名字(需與旅遊證件一致)"
v-model="form.lastName" v-model="form.EnSurname"
outlined outlined
:rules="[(val) => val !== '' || '请输入名字']" :rules="[(val) => !!val || '请输入名字(需與旅遊證件一致)']"
></q-input> ></q-input>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col"> <div class="col">
<div class="title">居住國家/地區</div> <div class="title">居住國家/地區</div>
<q-select filled v-model="model" :options="options" label="Filled" /> <q-select
ref="Country"
square
outlined
option-value="ID"
option-label="Name"
class="form-item"
v-model="form.Country"
:options="countList"
placeholder="Filled"
:rules="[(val) => Boolean(val) || '请选择居住國家/地區']"
/>
</div> </div>
<div class="col"> <div class="col">
<div class="title">稱謂</div> <div class="title">稱謂</div>
<q-select filled v-model="model" :options="options" label="Filled" /> <q-select
ref="Appellation"
square
outlined
class="form-item"
option-value="ID"
option-label="Name"
v-model="form.Appellation"
:options="AppellationList"
placeholder="Filled"
:rules="[(val) => Boolean(val) || '请选择稱謂']"
/>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col"> <div class="col">
<div class="title">國家/地區代碼</div> <div class="title">國家/地區代碼</div>
<q-select filled v-model="model" :options="options" label="Filled" /> <q-select
ref="PhoneCountry"
square
outlined
option-value="ID"
option-label="PhoneCode"
class="form-item"
v-model="form.PhoneCountry"
:options="phoneCountList"
placeholder="Filled"
:rules="[(val) => Boolean(val) || '请选择國家/地區代碼']"
/>
</div> </div>
<div class="col"> <div class="col">
<div class="title">電話(首次需驗證)</div> <div class="title">電話(首次需驗證)</div>
<q-input <q-input
ref="lastName" ref="Moblie"
class="form-item" class="form-item"
placeholder="名字(需與旅遊證件一致)" placeholder="電話(首次需驗證)"
v-model="form.lastName" v-model="form.Moblie"
outlined outlined
:rules="[(val) => val !== '' || '请输入名字']" :rules="[(val) => !!val || '请输入電話(首次需驗證)']"
></q-input> ></q-input>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col"> <div class="col">
<div class="title">出生日期</div><q-date <div class="title">出生日期</div>
v-model="date" <q-input
minimal ref="BirthDate"
/> class="form-item"
placeholder="出生日期"
v-model="form.BirthDate"
outlined
mask="date"
:rules="[(val) => !!val || '请选择出生日期']"
>
<template v-slot:append>
<q-icon name="event" class="cursor-pointer">
<q-popup-proxy ref="qS1DateProxy">
<q-date
mask="YYYY-MM-DD"
:title="$t('search_date_begin')"
subtitle="選擇"
v-model="form.BirthDate"
@input="() => $refs.qS1DateProxy.hide()"
/>
</q-popup-proxy>
</q-icon>
</template>
</q-input>
</div> </div>
<div class="col"> <div class="col">
<div class="title">電子郵件(接收订单确认邮件)</div> <div class="title">電子郵件(接收订单确认邮件)</div>
<q-input <q-input
ref="lastName" ref="Mailbox"
class="form-item" class="form-item"
placeholder="名字(需與旅遊證件一致)" placeholder="電子郵件(接收订单确认邮件)"
v-model="form.lastName" v-model="form.Mailbox"
outlined outlined
:rules="[(val) => val !== '' || '请输入名字']" :rules="[(val) => !!val || '请输入電子郵件(接收订单确认邮件)']"
></q-input> ></q-input>
</div> </div>
</div> </div>
<div> <div>
<q-btn color="primary" unelevated label="保存" @click="submit" /> <q-btn color="primary" type="submit" unelevated label="保存" />
</div> </div>
</div> </div>
</form>
</div> </div>
</div> </div>
</template> </template>
...@@ -138,28 +202,145 @@ export default { ...@@ -138,28 +202,145 @@ export default {
data() { data() {
return { return {
form: { form: {
lastName: "", Surname: "",
firstName: "", Name: "",
BirthDate: "",
Appellation: "",
EnName: "",
EnSurname: "",
Country: "",
Moblie: "",
}, },
model: '', model: "",
date: '', date: "",
options: [] phoneCountList: [],
countList: [],
AppellationList: [],
}; };
}, },
mounted() {
this.userInfo = JSON.parse(window.localStorage.getItem("b2bUser"));
console.log("getUserInfo", this.userInfo);
this.getUserInfo();
this.getCountryInfo();
this.GetAppellationEnum();
},
methods: { methods: {
getCountryInfo() {
this.apipost(
"GetCountryInfo_post",
{},
(res) => {
if (res.data.resultCode == 1) {
const { phoneCountList, countList } = res.data.data;
this.countList = countList;
this.phoneCountList = phoneCountList;
} else {
// this.$notify(res.data.message);
this.$q.notify({
type: "negative",
message: res.data.message,
position: "top",
timeout: 2000, // 以毫秒为单位; 0意味着没有超时
});
}
},
null
);
},
GetAppellationEnum() {
this.apipost(
"GetAppellationEnum_post",
{},
(res) => {
if (res.data.resultCode == 1) {
this.AppellationList = res.data.data;
} else {
// this.$notify(res.data.message);
this.$q.notify({
type: "negative",
message: res.data.message,
position: "top",
timeout: 2000, // 以毫秒为单位; 0意味着没有超时
});
}
},
null
);
},
getUserInfo() {
this.apipost(
"GetCustomerInfo_post",
{
Id: this.userInfo?.id,
},
(res) => {
if (res.data.resultCode == 1) {
this.form = res.data.data;
} else {
// this.$notify(res.data.message);
this.$q.notify({
type: "negative",
message: res.data.message,
position: "top",
timeout: 2000, // 以毫秒为单位; 0意味着没有超时
});
}
},
null
);
},
submitUserInfo() {
let params = {...this.form}
params.Appellation = params.Appellation.ID
params.Country = params.Country.ID
params.PhoneCountry = params.PhoneCountry.ID
this.apipost(
"UpdateUserInfo_post",
params,
(res) => {
if (res.data.resultCode == 1) {
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 = ["Surname", "Name", "BirthDate", "Appellation", "EnName", "EnSurname", "Country", "Moblie"];
verifyArr.forEach((item) => { verifyArr.forEach((item) => {
console.log('this.$refs[item]', this, item, this.$refs[item])
this.$refs[item].validate(); this.$refs[item].validate();
}); });
// this.$refs.Surname.validate();
// this.$refs.Name.validate();
// this.$refs.BirthDate.validate();
verifyArr.forEach((item) => { verifyArr.forEach((item) => {
if (item.$refs[item].hasError) { console.log('item', item)
if (this.$refs[item].hasError) {
console.log('item', item)
this.formHasError = true; this.formHasError = true;
} }
}); });
if ((this.formHasError = true)) { console.log('this.formHasError', this.formHasError, this.form)
if (this.formHasError) {
return; return;
} }
this.submitUserInfo();
}, },
}, },
}; };
......
...@@ -25,8 +25,8 @@ ...@@ -25,8 +25,8 @@
<template> <template>
<div class="content q-ma-lg bg-white q-pa-lg"> <div class="content q-ma-lg bg-white q-pa-lg">
<div class="tips"> <div class="tips">
個人信息<span class="text-grey-6" 出行人<span class="text-grey-6"
>(以下信息仅用于帮助你在支付时自动填写你的个人资料,你的信息将会安全地被印象保存且不会公开)</span >共計 3人,最多新增20人(含本人)</span
> >
</div> </div>
<div> <div>
......
...@@ -133,6 +133,12 @@ const routes = [{ ...@@ -133,6 +133,12 @@ const routes = [{
component: () => component: () =>
import ('pages/usercenter/setUsersList.vue') import ('pages/usercenter/setUsersList.vue')
}, },
{
path: '/payInfo', //支付管理
meta: {isUserCenter: true},
component: () =>
import ('pages/usercenter/payInfo.vue')
},
{ {
path: '/customer/:id', //自定义页面 path: '/customer/:id', //自定义页面
component: () => component: () =>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment