Commit 072db068 authored by 沈良进's avatar 沈良进

个人中心页面适配移动端

parent cb6e7cbe
...@@ -24,6 +24,9 @@ ...@@ -24,6 +24,9 @@
.flex-wrap { .flex-wrap {
flex-wrap: wrap; flex-wrap: wrap;
} }
.flex-noShark {
flex-shrink: 0;
}
.margin { .margin {
margin: 10px; margin: 10px;
...@@ -114,6 +117,9 @@ ...@@ -114,6 +117,9 @@
.f36 { .f36 {
font-size: 36px; font-size: 36px;
} }
.f42 {
font-size: 42px;
}
.text-center { .text-center {
text-align: center; text-align: center;
} }
......
<style lang="scss" scoped> <style lang="scss" scoped>
.avatar { .avatar {
width: 94px; width: 60px;
height: 94px; height: 60px;
background: #ffffff; background: #ffffff;
border: 2px solid #f0efef; border: 2px solid #f0efef;
border-radius: 50%; border-radius: 50%;
...@@ -9,52 +9,129 @@ ...@@ -9,52 +9,129 @@
display: block; display: block;
} }
.nav-item { .nav-item {
margin: 10px 28px; margin:0 10px;
padding: 10px; padding: 10px;
border-bottom: 1px solid #eee;
}
.nav-item:last-child {
border-bottom: none;
} }
.select { .select {
height: 41px; height: 41px;
border-radius: 8px; border-radius: 8px;
color: #ffffff; color: #ffffff;
}
.action-item {
width: 18px;
height: 18px;
display: inline-block;
margin-left: 10px;
}
.edit-info {
width: 12px;
height: 12px;
}
.padding-20 {
padding: 20px;
}
.card {
margin: 25px 15px;
border-radius: 15px;
padding: 10px;
}
.order-item {
width: 25%;
display: inline-block;
}
.order-img {
width: 26px;
height: 26px;
}
.go-play {
width: 36px;
height: 36px;
}
.play-box {
padding: 8px;
background: #FAF9F9;
border-radius: 9px;
margin: 10px 13px 0 13px;
} }
</style> </style>
<template> <template>
<div class="user-nav-box"> <div class="user-nav-box">
<div class="flex justify-between"> <div class="padding-20">
<span class="f42">个人中心</span> <div class="flex justify-between items-center">
<span class="f20">个人中心</span>
<div>
<img class="action-item" src="../../assets/img/userCenter/help.png" />
<img @click="CommonJump('/setInfo')" class="action-item" src="../../assets/img/userCenter/set.png" />
</div>
</div>
<div class="flex items-center q-mt-md">
<div> <div>
<img /> <img class="avatar" v-if="LoginUser.photo" :src="LoginUser.photo" />
<img /></div> <img class="avatar" v-else src="../../assets/img/avatar.png" />
</div>
<div class="q-ml-md">
<div class="f18">hello,开起你的旅程吧~</div>
<div @click="CommonJump('/setUserInfo')">
<img class="edit-info" src="../../assets/img/userCenter/edit.png" />
個人信息管理
</div>
</div>
</div>
</div>
<div class="bg-white card">
<div
class="order-item cursor-pointer"
@click="navigateTo(item.key)"
v-for="item in orderList"
:key="item.key"
:class="{ 'select bg-primary': selectKey === item.key }"
>
<div class="column flex-center">
<img class="order-img" :src="require(`../../assets/img/userCenter/${item.icon}.png`)" />
<div>{{ item.label }}</div>
</div>
<!-- <span class="text-primary">{{ item.label }}</span> -->
</div>
<div class="flex play-box q-mt-md">
<img class="go-play q-mr-md" src="../../assets/img/userCenter/set.png" />
<div class="f12">
<div>即將出行</div>
<div class="text-grey-6">[2023年3月6日]日本富士山尊享一日遊</div>
</div> </div>
<div class="q-mt-lg"> </div>
<div class="bg-white q-mt-xl q-pb-lg"> </div>
<div class="bg-white card">
<div <div
class="nav-item flex justify-between items-center cursor-pointer" class="nav-item flex justify-between items-center cursor-pointer"
@click="navigateTo(item.key)" @click="navigateTo(item.key)"
v-for="item in menuList" v-for="item in menuList"
:key="item.key" :key="item.key"
:class="{'select bg-primary': selectKey === item.key}"
> >
<div class="flex items-center"> <div class="flex items-center">
<i class="iconfont" :class="item.icon"></i> <i class="iconfont" :class="item.icon"></i>
<span class="q-ml-lg">{{ item.label }}</span> <span class="q-ml-lg">{{ item.label }}</span>
</div> </div>
<i class="iconfont iconpreviewright"></i>
<!-- <span class="text-primary">{{ item.label }}</span> --> <!-- <span class="text-primary">{{ item.label }}</span> -->
</div> </div>
</div> </div>
</div> <div class="bg-white card">
<div class="bg-white q-mt-lg q-py-lg">
<div <div
class="nav-item flex justify-between items-center cursor-pointer" class="nav-item flex justify-between items-center cursor-pointer"
@click="navigateTo(item.key)" @click="navigateTo(item.key)"
v-for="item in menuList2" v-for="item in menuList2"
:key="item.key" :key="item.key"
:class="{'select bg-primary': selectKey === item.key}"
> >
<div class="flex items-center"> <div class="flex items-center">
<i class="iconfont" :class="item.icon"></i> <i class="iconfont" :class="item.icon"></i>
<span class="q-ml-lg">{{ item.label }}</span> <span class="q-ml-lg">{{ item.label }}</span>
</div> </div>
<i class="iconfont iconpreviewright"></i>
<!-- <span class="text-primary">{{item.label}}</span> --> <!-- <span class="text-primary">{{item.label}}</span> -->
</div> </div>
</div> </div>
...@@ -64,8 +141,34 @@ color: #ffffff; ...@@ -64,8 +141,34 @@ color: #ffffff;
export default { export default {
data() { data() {
return { return {
selectKey: '', selectKey: "",
LoginUser: {}, LoginUser: {},
orderList: [
{
icon: "order-pay",
key: "/order?type=1",
label: "待付款",
number: "",
},
{
icon: "order-use",
key: "/order?type=2",
label: "待出行",
number: "",
},
{
icon: "order-finish",
key: "/order?type=3",
label: "已完成",
number: "",
},
{
icon: "order-all",
key: "/order?type=0",
label: "全部订单",
number: "",
},
],
menuList: [ menuList: [
{ {
icon: "iconqianbao", icon: "iconqianbao",
...@@ -73,12 +176,6 @@ export default { ...@@ -73,12 +176,6 @@ export default {
label: "可用優惠券", label: "可用優惠券",
number: "", number: "",
}, },
{
icon: "iconorder",
key: "/order",
label: "訂單",
number: "",
},
// { // {
// icon: "iconmessage", // icon: "iconmessage",
// key: "", // key: "",
...@@ -111,24 +208,24 @@ export default { ...@@ -111,24 +208,24 @@ export default {
label: "登录方式管理", label: "登录方式管理",
number: "", number: "",
}, },
{ // {
icon: "iconset", // icon: "iconset",
key: "/setInfo", // key: "/setInfo",
label: "账户设置", // label: "账户设置",
number: "", // number: "",
}, // },
], ],
}; };
}, },
mounted() { mounted() {
this.selectKey = this.$route.path this.selectKey = this.$route.path;
if (localStorage.b2bUser) { if (localStorage.b2bUser) {
this.LoginUser = JSON.parse(window.localStorage.getItem("b2bUser")); this.LoginUser = JSON.parse(window.localStorage.getItem("b2bUser"));
} }
}, },
methods: { methods: {
navigateTo(route) { navigateTo(route) {
this.selectKey= route this.selectKey = route;
this.CommonJump(route, {}); this.CommonJump(route, {});
}, },
}, },
......
<style lang="scss" scoped> <style lang="scss" scoped>
.form-item { .form-item {
max-width: 320px; max-width: 320px;
margin: 10px;
} }
.content { .content {
width: 900px; width: 900px;
...@@ -72,8 +71,8 @@ ...@@ -72,8 +71,8 @@
width: 120px; width: 120px;
} }
.nav-item { .nav-item {
width: 100px; width: 25%;
margin: 0 10px; max-width: 100px;
text-align: center; text-align: center;
} }
.border-bottom { .border-bottom {
...@@ -89,11 +88,10 @@ ...@@ -89,11 +88,10 @@
} }
</style> </style>
<template> <template>
<div class="content q-ma-lg bg-white"> <div class="bg-white" :class="$q.platform.is.desktop ? 'q-ma-lg content': 'full-width'">
<div class="flex justify-between"> <div class="flex justify-between margin">
<div> <div :class="$q.platform.is.desktop ? 'form-item': 'full-width'">
<q-input <q-input
class="form-item"
placeholder="輸入商品名稱/訂單號" placeholder="輸入商品名稱/訂單號"
v-model="GoodsName" v-model="GoodsName"
clearable clearable
...@@ -112,7 +110,8 @@ ...@@ -112,7 +110,8 @@
<div :class="orderStatus === item.ID ? 'border-bottom' : ''"></div> <div :class="orderStatus === item.ID ? 'border-bottom' : ''"></div>
</div> </div>
</div> </div>
<div> <!-- pc -->
<div v-if="$q.platform.is.desktop">
<div class="card" v-for="item in orderList" :key="item.id"> <div class="card" v-for="item in orderList" :key="item.id">
<div class="flex card-title justify-between"> <div class="flex card-title justify-between">
<div class="flex"> <div class="flex">
...@@ -159,9 +158,53 @@ ...@@ -159,9 +158,53 @@
</div> </div>
</div> </div>
</div> </div>
<noneData v-show="!orderList.length"></noneData> </div>
<!-- mobile -->
<div v-else>
<div class="card" v-for="item in orderList" :key="item.id">
<div class="flex card-title justify-between">
<div class="flex">
<span><span class="text-grey-6">订单号:</span>{{ item.orderNo }}</span>
</div>
<span class="text-grey-6">{{ item.orderStatusStr }}</span>
</div>
<div class="q-pa-md">
<div class="flex no-wrap full-width">
<img class="product-img mr flex-noShark" :src="item.goodsPic" />
<div>
<div class="ellipsis-2">{{ item.goodsName }}</div>
<div>x1</div>
</div>
</div>
<div>
<!-- <div>
<i class="iconfont iconpeople1"></i>{{ item.surName
}} {{ item.name }}
</div> -->
<div>
<div class="f18 text-right">CNY{{ item.totalPrice }}</div>
<!-- <div>{{ item.payTypeStr }}</div> -->
</div>
<!-- <div>
<div class="primary">{{item.orderStatusStr}}</div>
<div class="q-mt-sm cursor-pointer">订单详情</div>
</div> -->
<div class="flex justify-end q-mt-sm">
<q-btn
color="primary"
@click="cancalOrder(item)"
unelevated
outline
size="sm"
label="取消订单">
</q-btn>
</div>
</div>
</div> </div>
</div> </div>
</div>
<noneData v-show="!orderList.length"></noneData>
</div>
</template> </template>
<script> <script>
...@@ -181,6 +224,10 @@ export default { ...@@ -181,6 +224,10 @@ export default {
}; };
}, },
mounted() { mounted() {
this.type = this.$route.query.type
if(this.type) {
this.orderStatus = Number(this.type)
}
this.getOrderEnums(); this.getOrderEnums();
this.getOrderList(); this.getOrderList();
}, },
......
...@@ -125,9 +125,27 @@ ...@@ -125,9 +125,27 @@
:rules="[(val) => !!val || '请输入全名']" :rules="[(val) => !!val || '请输入全名']"
></q-input> ></q-input>
</div> </div>
<div class="col">
<div class="title">國家/地區</div>
<q-select
@input="changeCountry"
emit-value
map-options
ref="CountryId"
square
outlined
option-value="ID"
option-label="Name"
class="form-item"
v-model="form.CountryId"
:options="countList"
placeholder="Filled"
:rules="[(val) => Boolean(val) || '请选择國家/地區']"
/>
</div>
</div> </div>
<div :class="$q.platform.is.desktop ? 'row': 'culmuns'"> <div :class="$q.platform.is.desktop ? 'row': 'culmuns'">
<div class="col"> <!-- <div class="col">
<div class="title">選擇手機區號</div> <div class="title">選擇手機區號</div>
<q-select <q-select
ref="AreaCode" ref="AreaCode"
...@@ -143,7 +161,7 @@ ...@@ -143,7 +161,7 @@
placeholder="選擇手機區號" placeholder="選擇手機區號"
:rules="[(val) => Boolean(val) || '请選擇手機區號']" :rules="[(val) => Boolean(val) || '请選擇手機區號']"
/> />
</div> </div> -->
<div class="col"> <div class="col">
<div class="title">手機號碼</div> <div class="title">手機號碼</div>
<q-input <q-input
...@@ -153,27 +171,12 @@ ...@@ -153,27 +171,12 @@
v-model="form.Mobile" v-model="form.Mobile"
outlined outlined
:rules="[(val) => !!val || '请输入手機號碼']" :rules="[(val) => !!val || '请输入手機號碼']"
></q-input> >
</div> <template v-slot:prepend>
<div class="text-subtitle2">
{{ form.PhoneCountryStr }}
</div> </div>
</template></q-input>
<div :class="$q.platform.is.desktop ? 'row': 'culmuns'">
<div class="col">
<div class="title">國家/地區</div>
<q-select
emit-value
map-options
ref="CountryId"
square
outlined
option-value="ID"
option-label="Name"
class="form-item"
v-model="form.CountryId"
:options="countList"
placeholder="Filled"
:rules="[(val) => Boolean(val) || '请选择國家/地區']"
/>
</div> </div>
<div class="col"> <div class="col">
<div class="title">城市</div> <div class="title">城市</div>
...@@ -253,12 +256,6 @@ export default { ...@@ -253,12 +256,6 @@ export default {
this.getCountryInfo(); this.getCountryInfo();
}, },
methods: { methods: {
addAddress() {
this.isShowDialog = true
this.form = {
Name: "",
Mobile: "",}
},
getCountryInfo() { getCountryInfo() {
this.apipost( this.apipost(
"GetCountryInfo_post", "GetCountryInfo_post",
...@@ -268,6 +265,17 @@ export default { ...@@ -268,6 +265,17 @@ export default {
const { phoneCountList, countList } = res.data.data; const { phoneCountList, countList } = res.data.data;
this.countList = countList; this.countList = countList;
this.phoneCountList = phoneCountList; this.phoneCountList = phoneCountList;
this.form.CountryId = this.countList[0].ID;
this.changeCountry(this.form.CountryId);
this.phoneCountList.forEach((x) => {
let temp = this.countList.find((y) => y.ID == x.ID);
x.EnName = `${temp.EnName}(${x.PhoneCode})`;
});
this.form.CountryId =
this.form.CountryId == 0
? this.countList[0].ID
: this.form.CountryId;
this.changeCountry(this.form.CountryId);
} else { } else {
// this.$notify(res.data.message); // this.$notify(res.data.message);
this.$q.notify({ this.$q.notify({
...@@ -281,6 +289,18 @@ export default { ...@@ -281,6 +289,18 @@ export default {
null null
); );
}, },
changeCountry(id) {
this.form.AreaCode = this.phoneCountList.find(
(x) => x.ID == id
).PhoneCode;
this.form.PhoneCountryStr = "+" + this.form.AreaCode;
},
addAddress() {
this.isShowDialog = true
this.form = {
Name: "",
Mobile: "",}
},
changeCouponType(item) { changeCouponType(item) {
this.selectedKey = item; this.selectedKey = item;
}, },
...@@ -288,7 +308,6 @@ export default { ...@@ -288,7 +308,6 @@ export default {
this.formHasError = false; this.formHasError = false;
const verifyArr = [ const verifyArr = [
"Name", "Name",
"AreaCode",
"Mobile", "Mobile",
"CountryId", "CountryId",
"CityName", "CityName",
...@@ -296,17 +315,13 @@ export default { ...@@ -296,17 +315,13 @@ export default {
"PostalCode", "PostalCode",
]; ];
verifyArr.forEach((item) => { verifyArr.forEach((item) => {
console.log("this.$refs[item]", this, item, this.$refs[item]);
this.$refs[item].validate(); this.$refs[item].validate();
}); });
verifyArr.forEach((item) => { verifyArr.forEach((item) => {
console.log("item", item);
if (this.$refs[item].hasError) { if (this.$refs[item].hasError) {
console.log("item", item);
this.formHasError = true; this.formHasError = true;
} }
}); });
console.log("this.formHasError", this.formHasError, this.form);
if (this.formHasError) { if (this.formHasError) {
return; return;
} }
...@@ -335,7 +350,6 @@ export default { ...@@ -335,7 +350,6 @@ export default {
); );
}, },
editUser(item) { editUser(item) {
console.log("editUser", item);
this.form = {...item}; this.form = {...item};
this.form.AreaCode = Number(this.form.AreaCode) this.form.AreaCode = Number(this.form.AreaCode)
this.form.IsDefault = this.form.IsDefault === 1 this.form.IsDefault = this.form.IsDefault === 1
......
...@@ -7,11 +7,10 @@ ...@@ -7,11 +7,10 @@
max-width: 940px; max-width: 940px;
} }
.tips { .tips {
height: 42px;
background: #f5f5f5; background: #f5f5f5;
border-radius: 8px; border-radius: 8px;
padding: 0 35px; padding: 10px 35px;
line-height: 42px; line-height: 22px;
} }
::v-deep .q-field__control { ::v-deep .q-field__control {
height: 40px; height: 40px;
...@@ -28,11 +27,16 @@ ...@@ -28,11 +27,16 @@
.title { .title {
margin-top: 20px; margin-top: 20px;
margin-bottom: 10px; margin-bottom: 10px;
margin-left: 10px;
} }
</style> </style>
<template> <template>
<div class="content q-ma-lg bg-white q-pa-lg"> <div
<div class="tips"> class="bg-white"
:class="$q.platform.is.desktop ? 'content q-ma-lg' : 'full-width'"
>
<div class="q-ma-lg">
<div class="tips q-mb-lg">
個人信息<span class="text-grey-6" 個人信息<span class="text-grey-6"
>(以下信息仅用于帮助你在支付时自动填写你的个人资料,你的信息将会安全地被印象保存且不会公开)</span >(以下信息仅用于帮助你在支付时自动填写你的个人资料,你的信息将会安全地被印象保存且不会公开)</span
> >
...@@ -40,7 +44,7 @@ ...@@ -40,7 +44,7 @@
<div> <div>
<form @submit.prevent.stop="submit" class="q-gutter-md"> <form @submit.prevent.stop="submit" class="q-gutter-md">
<div> <div>
<div class="row"> <div :class="$q.platform.is.desktop ? 'row' : 'culmuns'">
<div class="col"> <div class="col">
<div class="title"></div> <div class="title"></div>
<q-input <q-input
...@@ -62,7 +66,7 @@ ...@@ -62,7 +66,7 @@
></q-input> ></q-input>
</div> </div>
</div> </div>
<div class="row"> <div :class="$q.platform.is.desktop ? 'row' : 'culmuns'">
<div class="col"> <div class="col">
<div class="title">姓氏(需與旅遊證件一致)</div> <div class="title">姓氏(需與旅遊證件一致)</div>
<q-input <q-input
...@@ -84,10 +88,11 @@ ...@@ -84,10 +88,11 @@
></q-input> ></q-input>
</div> </div>
</div> </div>
<div class="row"> <div :class="$q.platform.is.desktop ? 'row' : 'culmuns'">
<div class="col"> <div class="col">
<div class="title">居住國家/地區</div> <div class="title">居住國家/地區</div>
<q-select <q-select
@input="changeCountry"
emit-value emit-value
map-options map-options
ref="Country" ref="Country"
...@@ -119,8 +124,8 @@ ...@@ -119,8 +124,8 @@
</div> </div>
</div> </div>
<div class="row"> <div :class="$q.platform.is.desktop ? 'row' : 'culmuns'">
<div class="col"> <!-- <div class="col">
<div class="title">國家/地區代碼</div> <div class="title">國家/地區代碼</div>
<q-select <q-select
emit-value emit-value
...@@ -135,7 +140,7 @@ ...@@ -135,7 +140,7 @@
:options="phoneCountList" :options="phoneCountList"
:rules="[(val) => Boolean(val) || '请选择國家/地區代碼']" :rules="[(val) => Boolean(val) || '请选择國家/地區代碼']"
/> />
</div> </div> -->
<div class="col"> <div class="col">
<div class="title">電話(首次需驗證)</div> <div class="title">電話(首次需驗證)</div>
<q-input <q-input
...@@ -144,10 +149,14 @@ ...@@ -144,10 +149,14 @@
v-model="form.Moblie" v-model="form.Moblie"
outlined outlined
:rules="[(val) => !!val || '请输入電話(首次需驗證)']" :rules="[(val) => !!val || '请输入電話(首次需驗證)']"
></q-input> >
<template v-slot:prepend>
<div class="text-subtitle2">
{{ form.PhoneCountryStr }}
</div> </div>
</template></q-input
>
</div> </div>
<div class="row">
<div class="col"> <div class="col">
<div class="title">出生日期</div> <div class="title">出生日期</div>
<q-input <q-input
...@@ -173,6 +182,8 @@ ...@@ -173,6 +182,8 @@
</template> </template>
</q-input> </q-input>
</div> </div>
</div>
<div :class="$q.platform.is.desktop ? 'row' : 'culmuns'">
<div class="col"> <div class="col">
<div class="title">電子郵件(接收订单确认邮件)</div> <div class="title">電子郵件(接收订单确认邮件)</div>
<q-input <q-input
...@@ -180,7 +191,9 @@ ...@@ -180,7 +191,9 @@
class="form-item" class="form-item"
v-model="form.Mailbox" v-model="form.Mailbox"
outlined outlined
:rules="[(val) => !!val || '请输入電子郵件(接收订单确认邮件)']" :rules="[
(val) => !!val || '请输入電子郵件(接收订单确认邮件)',
]"
></q-input> ></q-input>
</div> </div>
</div> </div>
...@@ -191,6 +204,7 @@ ...@@ -191,6 +204,7 @@
</form> </form>
</div> </div>
</div> </div>
</div>
</template> </template>
<script> <script>
export default { export default {
...@@ -215,7 +229,6 @@ export default { ...@@ -215,7 +229,6 @@ export default {
}, },
mounted() { mounted() {
this.userInfo = JSON.parse(window.localStorage.getItem("b2bUser")); this.userInfo = JSON.parse(window.localStorage.getItem("b2bUser"));
console.log("getUserInfo", this.userInfo);
this.getUserInfo(); this.getUserInfo();
this.getCountryInfo(); this.getCountryInfo();
this.GetAppellationEnum(); this.GetAppellationEnum();
...@@ -230,8 +243,14 @@ export default { ...@@ -230,8 +243,14 @@ export default {
const { phoneCountList, countList } = res.data.data; const { phoneCountList, countList } = res.data.data;
this.countList = countList; this.countList = countList;
this.phoneCountList = phoneCountList; this.phoneCountList = phoneCountList;
this.phoneCountList.forEach((x) => {
let temp = this.countList.find((y) => y.ID == x.ID);
x.EnName = `${temp.EnName}(${x.PhoneCode})`;
});
if (this.form.Country) {
this.changeCountry(this.form.Country);
}
} else { } else {
// this.$notify(res.data.message);
this.$q.notify({ this.$q.notify({
type: "negative", type: "negative",
message: res.data.message, message: res.data.message,
...@@ -243,6 +262,12 @@ export default { ...@@ -243,6 +262,12 @@ export default {
null null
); );
}, },
changeCountry(id) {
this.form.PhoneCountry = this.phoneCountList.find(
(x) => x.ID == id
).PhoneCode;
this.form.PhoneCountryStr = "+" + this.form.PhoneCountry;
},
GetAppellationEnum() { GetAppellationEnum() {
this.apipost( this.apipost(
"GetAppellationEnum_post", "GetAppellationEnum_post",
...@@ -272,6 +297,9 @@ export default { ...@@ -272,6 +297,9 @@ export default {
(res) => { (res) => {
if (res.data.resultCode == 1) { if (res.data.resultCode == 1) {
this.form = res.data.data; this.form = res.data.data;
if (this.phoneCountList.length) {
this.changeCountry(this.form.Country);
}
} else { } else {
// this.$notify(res.data.message); // this.$notify(res.data.message);
this.$q.notify({ this.$q.notify({
...@@ -286,7 +314,7 @@ export default { ...@@ -286,7 +314,7 @@ export default {
); );
}, },
submitUserInfo() { submitUserInfo() {
let params = {...this.form} let params = { ...this.form };
// params.Appellation = params.Appellation.ID // params.Appellation = params.Appellation.ID
// params.Country = params.Country.ID // params.Country = params.Country.ID
// params.PhoneCountry = params.PhoneCountry.ID // params.PhoneCountry = params.PhoneCountry.ID
...@@ -312,23 +340,28 @@ export default { ...@@ -312,23 +340,28 @@ export default {
} }
}, },
null null
) ; );
}, },
submit() { submit() {
this.formHasError = false; this.formHasError = false;
const verifyArr = ["Surname", "Name", "BirthDate", "Appellation", "EnName", "EnSurname", "Country", "Moblie"]; 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();
}); });
verifyArr.forEach((item) => { verifyArr.forEach((item) => {
console.log('item', item)
if (this.$refs[item].hasError) { if (this.$refs[item].hasError) {
console.log('item', item)
this.formHasError = true; this.formHasError = true;
} }
}); });
console.log('this.formHasError', this.formHasError, this.form)
if (this.formHasError) { if (this.formHasError) {
return; return;
} }
......
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