Commit 03f3b4a6 authored by 罗超's avatar 罗超

Merge branch 'master' of http://gitlab.oytour.com/viitto/million

parents 15ca8469 cbe70c63
<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:#66D344;
}
.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
<template>
<div class="column full-height">
<div class="col">
<div class="text-right">
<div class="text-right" v-if="$q.platform.is.desktop">
<q-btn
color="primary"
icon="refresh"
......@@ -13,44 +13,32 @@
<template v-if="dataList.CarType!=3">
<div class="text-grey-6 f12 q-my-md">選擇機場</div>
<div class="row wrap">
<q-btn @click="handleSelect(item,1)"
:color="selectedAirportObj&&item.Id === selectedAirportObj.Id?'primary':'grey-5'"
unelevated
class="car-tag mr"
v-for="item in AirportList"
:key="item.Id"
>
{{ item.AirportName }}
</q-btn>
<div v-for="(x,i) in dataList.AirportList" :key="i">
<q-chip size="14px" clickable @click="handleSelect(x,1)"
:text-color="selectedAirportObj&&selectedAirportObj.Id==x.Id?'white':'dark'"
:color="selectedAirportObj&&selectedAirportObj.Id==x.Id?'primary':'grey-3'" square>{{ x.AirportName }}</q-chip>
</div>
</div>
</template>
<div class="row">
<div v-if="dataList.CarType!=1">
<div class="row no-wrap">
<div v-if="dataList.CarType!=1" :class="{'col':dataList.PlaceList.length>2}">
<div class="text-grey-6 f12 q-my-md">選擇上車範圍</div>
<div class="row wrap">
<q-btn @click="handleSelect(item,3)"
:color="onCarObj&&item.Id === onCarObj.Id?'primary':'grey-5'"
unelevated
class="car-tag mr"
v-for="item in PlaceList"
:key="item.Id"
>
{{ item.Name }}({{ item.Range }}m)
</q-btn>
<div v-for="(x,i) in dataList.PlaceList" :key="i">
<q-chip size="14px" clickable @click="handleSelect(x,3)"
:text-color="onCarObj&&onCarObj.Id==x.Id?'white':'dark'"
:color="onCarObj&&onCarObj.Id==x.Id?'primary':'grey-3'" square>{{ x.Name }}({{ x.Range }}m)</q-chip>
</div>
</div>
<div v-if="dataList.CarType!=2">
</div>
<div v-if="dataList.CarType!=2" :class="{'col':dataList.PlaceList.length>2,'q-ml-md':dataList.CarType!=1}">
<div class="text-grey-6 f12 q-my-md">選擇下車範圍</div>
<div class="row wrap">
<q-btn @click="handleSelect(item,4)"
:color="unCarObj&&item.Id === unCarObj.Id?'primary':'grey-5'"
unelevated
class="car-tag mr"
v-for="item in PlaceList"
:key="item.Id"
>
{{ item.Name }}({{ item.Range }}m)
</q-btn>
<div v-for="(x,i) in dataList.PlaceList" :key="i">
<q-chip size="14px" clickable @click="handleSelect(x,4)"
:text-color="unCarObj&&unCarObj.Id==x.Id?'white':'dark'"
:color="unCarObj&&unCarObj.Id==x.Id?'primary':'grey-3'" square>{{ x.Name }}({{ x.Range }}m)</q-chip>
</div>
</div>
</div>
</div>
......@@ -58,15 +46,11 @@
<div class="text-grey-6 f12 q-my-md">選擇車類型</div>
<div class="row wrap">
<q-btn @click="handleSelect(item,2)"
:color="selectedCarObj&&item.Id === selectedCarObj.Id?'primary':'grey-5'"
unelevated
class="car-tag mr"
v-for="item in CarTypeList"
:key="item.Id"
>
{{ item.CarName }}({{ item.PeopleNum }}人)
</q-btn>
<div v-for="(x,i) in dataList.CarTypeList" :key="i">
<q-chip size="14px" clickable @click="handleSelect(x,2)"
:text-color="selectedCarObj&&selectedCarObj.Id==x.Id?'white':'dark'"
:color="selectedCarObj&&selectedCarObj.Id==x.Id?'primary':'grey-3'" square>{{ x.CarName }}({{ x.PeopleNum }}人)</q-chip>
</div>
</div>
<div class="text-grey-6 f12 q-my-md">選擇數量</div>
<div class="row items-end">
......@@ -128,39 +112,46 @@
<span class="text-subtitle2 text-grey-6 col">總金額</span>
<span class="text-h6 text-primary product-price">CNY {{ moneyFormat(sumPrice,0) }}</span>
</div>
<div class="q-mt-md text-right">
<span class="q-mr-lg f12 text-negative" v-if="!p.startDate" >
<div class="q-mt-md text-right"
:class="{'row wrap justify-end items-start':$q.platform.is.mobile}">
<span :class="{'col-12 q-mb-sm':$q.platform.is.mobile}">
<span class="f12 text-negative" v-if="!p.startDate"
:class="{'q-mr-lg':$q.platform.is.desktop}">
{{$q.platform.is.mobile?'請選擇上面的出行日期':'請選擇左側的出行日期'}}
</span>
<span class="q-mr-lg f12 text-negative"
<span class="f12 text-negative"
:class="{'q-mr-lg':$q.platform.is.desktop}"
v-if="(p.startDate&&!selectedCarObj)
||(p.startDate&&dataList.CarType==1&&(!selectedAirportObj||!unCarObj))
||(p.startDate&&dataList.CarType==2&&(!selectedAirportObj||!onCarObj))
||(p.startDate&&dataList.CarType==3&&(!onCarObj||!unCarObj))" >
{{`請選擇上面的${dataList.CarType==3?'車類型、上車下車點':dataList.CarType==1?'機場、車類型、下車點':'機場、車類型、上車點'}`}}
</span>
</span>
<q-btn color="primary" label="立即訂購" unelevated class="q-px-lg"
:disable="sumPrice==0||!selectedCarObj
||(dataList.CarType!=3&&!selectedAirportObj)
||(dataList.CarType==1&&!unCarObj)||(dataList.CarType==2&&!onCarObj)
||(dataList.CarType==3&&(!onCarObj||!unCarObj))"
@click="goOrderHandler"/>
</div>
</div>
</div>
</template>
<script>
import { date } from "quasar";
export default {
props: ["dataList","PlaceList","price","CarTypeList","AirportList","configId","Month"],
props: ["dataList","price","configId","Month"],
watch: {
price: {
handler(n, o) {
this.p = n;
if(n&&n.startDate){
this.chosenObj.startDate = n.startDate;
// this.selectedCar = this.CarTypeList[0].Id
// this.selectedCarObj = this.CarTypeList[0]
// this.selectedCar = this.dataList.CarTypeList[0].Id
// this.selectedCarObj = this.dataList.CarTypeList[0]
}
this.calcMoney()
......@@ -168,9 +159,9 @@ export default {
deep: true,
immediate: false
},
CarTypeList: {
dataList: {
handler(n, o) {
this.CarTypeList = n;
this.dataList = n;
},
deep: true,
......@@ -191,6 +182,7 @@ export default {
},
created() {
this.initModel();
console.log(this.p,'=======')
if(this.p.startDate){
this.chosenObj.startDate = this.p.startDate;
this.calcMoney()
......@@ -208,8 +200,8 @@ export default {
orderInfo: this.chosenObj,
sumPrice: this.sumPrice,
Id: this.dataList.Id,
onCarId: this.onCarObj.Id,
unCarId: this.unCarObj.Id,
onCarId: this.onCarObj?this.onCarObj.Id:'',
unCarId: this.unCarObj?this.unCarObj.Id:'',
}
let key = this.$md5(JSON.stringify(order))
let pickuporderCars = localStorage.getItem('pickuporderCars')
......@@ -221,7 +213,7 @@ export default {
localStorage.setItem("pickuporderCars",JSON.stringify(pickuporderCars))
this.CommonJump('/PickuporderForm/'+key, {});
},
// 获取车的详情
// 获取车的详情
getCarPriceData2() {
this.priceList = []
this.apipost(
......@@ -248,8 +240,10 @@ export default {
isSupportChildren: 1,
safeMoney: 0,
}
if(date.formatDate(Date.now(), 'YYYY-MM-DD')!=x.Date){
arr.push(dataObj)
}
}
})
const temp= JSON.parse(JSON.stringify(r.data.data))
let PriceArr = temp.filter(x=>{ return x.Price>0 })
......
......@@ -266,7 +266,7 @@ color: #EE4454;
</q-btn>
<q-btn label="帮助中心" flat></q-btn>
<q-btn v-if="LoginUser.id <= 0" label="注册" flat></q-btn>
<template v-if="LoginUser.id > 0">
<template v-if="LoginUser.token">
<q-btn-dropdown
style="color: #444; font-weight: bold"
class="q-ml-lg"
......
......@@ -644,7 +644,7 @@ export default {
var companyId = -1;
if (localStorage.groupinfo) {
var groupinfo = JSON.parse(localStorage.groupinfo);
companyId = groupinfo.siteList[0].companyId;
companyId = groupinfo.siteList[0]&&groupinfo.siteList[0].companyId?groupinfo.siteList[0].companyId:-1;
}
if (localStorage.b2bUser) {
var b2bUser = JSON.parse(window.localStorage.getItem("b2bUser"));
......
......@@ -12,7 +12,8 @@
<p class="day"><span v-if='item.dayNum<10'>0</span>{{item.dayNum}}</p>
<!-- <p>{{item.dateTime}}</p> -->
</div>
<div class="desc" v-html="item.title"></div>
<div class="desc" v-html="item.title!='null'?item.title:''"></div>
</div>
<oneday v-if="item.details && item.details.length==1" :day='item' :isDirect="isDirect"></oneday>
<twoday v-if="item.details && item.details.length==2" :day='item' :isDirect="isDirect"></twoday>
......
......@@ -53,9 +53,8 @@
></q-img>
</template>
</div>
<div class="row items-end" style="border: 1px solid #ccc; left: 0">
<div class="q-pb-lg">
<div class="down q-pa-lg" :class="{ col: index == 0 }">
<div class="row items-end col" style="border: 1px solid #ccc; left: 0">
<div class="down q-pa-lg q-mb-lg" :class="{ col: index == 0 }">
<div
v-if="item.title != ''"
class="text-h6 text-bold q-pb-sm"
......@@ -92,7 +91,6 @@
</div>
</div>
</div>
</div>
</template>
<template v-for="(item, index) in day.details">
<div
......
<template>
<div class="column full-height">
<div class="column full-height" v-if="p">
<div class="col">
<div class="text-right" v-if="$q.platform.is.desktop">
<q-btn
......@@ -11,7 +11,7 @@
flat
/>
</div>
<div v-if="p && p.unionCityList">
<div v-if="p && p.unionCityList && p.unionCityList.length>0">
<div class="text-grey-6 f12 q-my-md">出發城市</div>
<div class="row q-col-gutter-sm">
<div v-for="(x,i) in p.unionCityList" :key="i">
......@@ -376,7 +376,6 @@ export default {
watch: {
price: {
handler(n, o) {
console.log(n)
this.p = n?n:{};
if (this.p.startDate) {
this.chosenObj.startDate = this.p.startDate;
......
......@@ -28,6 +28,9 @@
.margin {
margin: 10px;
}
.mr0 {
margin-right: 0 !important;
}
.mt {
margin-top: 10px;
}
......@@ -96,6 +99,9 @@
.f20 {
font-size: 20px;
}
.f22 {
font-size: 22px;
}
.f26 {
font-size: 26px;
}
......@@ -131,3 +137,8 @@
.white {
color: #fff;
}
.user-edit {
color: #2D90FF;
margin:0 20px;
cursor: pointer;
}
\ No newline at end of file
......@@ -39,13 +39,14 @@
}"
>
<div class="col">
<q-form ref="baseUserInfo">
<q-card flat class="q-pa-md">
<div class="text-subtitle1 text-weight-bolder" ref="baseUserInfoTitle">訂購人資訊</div>
<div class="text-subtitle1 text-weight-bolder">訂購人資訊</div>
<q-separator color="grey-2" class="q-my-md" />
<div class="row q-col-gutter-md">
<div :class="filedWidth">
<q-select
v-model="userInfo.country"
v-model="userInfo.Country"
@input="changeCountry"
:options="countrys"
emit-value
......@@ -59,7 +60,7 @@
<div :class="filedWidth">
<q-input
standout
v-model="userInfo.mail"
v-model="userInfo.Mailbox"
label="郵箱地址"
:rules="[(val) => /^[a-zA-Z0-9]+([-_.][A-Za-zd]+)*@([a-zA-Z0-9]+[-.])+[A-Za-zd]{2,5}$/.test(val) || '請輸入正確的郵箱地址']"
ref="mail"
......@@ -69,8 +70,7 @@
</q-card>
<q-card flat class="q-pa-md q-mt-lg" v-if="details">
<div class="text-subtitle1 text-weight-bolder q-mb-md" ref="passengerInformation">旅客資料</div>
<div class="text-subtitle1 text-weight-bolder q-mb-md">旅客資料</div>
<div class="row">
<vue-core-video-players
v-if="details.videoStr"
......@@ -118,6 +118,12 @@
<span class="q-mr-sm"
>({{CarObj.PeopleNum}}人/辆)</span
>
<template v-if="details.TravelHours>0">
<q-icon name="iconfont icontime" size="20px" class="q-mr-xs q-ml-sm" />
<span class="q-mr-sm">
{{`包車時長:${details.TravelHours} h`}}
</span>
</template>
</div>
</div>
<q-separator color="grey-2" class="q-mt-md" />
......@@ -293,6 +299,15 @@
</template>
<q-popup-proxy :offset="[0, 0]" ref="qDateProxy2">
<div class="row">
<!-- <q-date
mask="YYYY-MM-DD"
:title="$t('search_date_begin')"
subtitle="選擇"
v-model="getBusTimeDate"
:options="optionsFn"
@input="getTime(3)"
/>
<div class="q-px-sm"></div> -->
<q-time format24h v-model="getBusTime" mask="HH:mm"
@input="getTime(2)"/>
</div>
......@@ -407,7 +422,9 @@
<div class="text-subtitle1 q-my-md text-weight-bold">特殊需求備註:</div>
<q-input standout v-model="parameters.Remark" input-style="height:170px;" type="textarea" placeholder="此欄位僅限資料備註。不在商品規範內的個人需求,不保證提供" maxlength="200" counter />
</q-card>
</q-form>
</div>
<div class="relative-position" v-if="details"
:class="{
'q-ml-lg': !($q.screen.width < 1200 || $q.platform.is.mobile),
......@@ -466,6 +483,10 @@
<div style="width: 80px">{{details.CarType==1?'接':'送'}}機機場:</div>
<div class="q-ml-md ellipsis-2-lines">{{AirportObj.Name}}</div>
</div>
<div class="row q-pb-xs no-wrap" v-if="AirportObj&&AirportObj.Name">
<div style="width: 80px">{{details.CarType==1?'抵達':'起飛'}}時間:</div>
<div class="q-ml-md ellipsis-2-lines">{{parameters.FlightTime}}</div>
</div>
<div class="row q-pb-xs no-wrap" v-if="parameters.GetonAddress">
<div style="width: 80px">上車點:</div>
<div class="q-ml-md ellipsis-2-lines">{{parameters.GetonAddress}}</div>
......@@ -551,18 +572,12 @@ export default {
return {
order: null,//订单信息
orderKey: "",
isRangeClick: true,
isShowDialog: false,
AddressObj: null,
onCarObj: null,//上车范围
unCarObj: null,//下车范围
onCarId: null,//上车范围
unCarId: null,//下车范围
CarObj: null,//车型
AirportObj: null,//机场
CarId: null,//车型
AirportId: null,//机场
startDate: null,
details: null,//产品详情
options: {//音频控件
currentPage: 0,
......@@ -578,15 +593,11 @@ export default {
OrderDate: null,//接收产品相关信息
step: 1,
userInfo: {
lastName: "",
firstName: "",
country: 0,
phone: "",
Country: 0,
areaCode: "",
mail: "",
Mailbox: "",
},
chosenObj: {},
isUpdateUserInfo: false,
countrys: [],
areaCodes: [],
loading: false,
......@@ -617,13 +628,13 @@ export default {
Mobile:'',//电话
ProductId: '',
CarId: '',//产品类型ID
pType: 1,//类型 1来源B2C
OrderSource: 1,//类型 0 来源B2B 1 来源B2C
},
flightTime: null,//航班起飞抵达时间
getBusTime: null,//预约车时间
getBusTimeDate: null,//预约日期
TotalPeople: 0,//总人数
onoffbus: 1,//1 上车 2下车
ErpOrderId: 0,//erp订单Id
};
},
computed: {
......@@ -645,8 +656,9 @@ export default {
if(this.checkParamsHandler()){
this.getCarData()
}
this.initCountry();
this.initGuestHandler();
this.getUserInfoHandler()
},
methods: {
// 获取商品详情
......@@ -659,8 +671,8 @@ export default {
if (r.data.resultCode == 1) {
this.details = r.data.data;
this.CarObj = this.details.CarTypeList.find((x) => this.OrderDate.CarId == x.Id);
this.onCarObj = this.details.PlaceList.find((x) => this.onCarId == x.Id)//上车范围
this.unCarObj = this.details.PlaceList.find((x) => this.unCarId == x.Id)//下车范围
this.onCarObj = this.details.PlaceList.find((x) => this.OrderDate.onCarId == x.Id)//上车范围
this.unCarObj = this.details.PlaceList.find((x) => this.OrderDate.unCarId == x.Id)//下车范围
if(this.details.CarType!=3){
this.AirportObj = this.details.AirportList.find((x) => this.OrderDate.AirportId == x.Id);
this.parameters.AirportId = this.OrderDate.AirportId
......@@ -691,15 +703,14 @@ export default {
this.order = pickuporderCars.find((x) => x.key == key);
if (this.order) {
this.orderKey = key;
this.chosenObj = this.order.order.orderInfo;
this.OrderDate = this.order.order
this.chosenObj = this.OrderDate.orderInfo;
this.parameters.ProductId = this.order.order.Id
this.parameters.OrderDate = this.OrderDate.startDate
this.getBusTimeDate = this.OrderDate.startDate
this.parameters.Unit_Price = this.OrderDate.originalB2CPrice
this.parameters.Num = this.chosenObj.Count
this.parameters.Money = this.OrderDate.sumPrice
this.onCarId = this.OrderDate.onCarId//上车范围
this.unCarId = this.OrderDate.unCarId//下车范围
}
}
}
......@@ -713,10 +724,7 @@ export default {
}
return this.orderKey != "";
},
submit(){
let flag = false
async submit() {
this.$refs.mail.validate()
this.$refs.SurName.validate()
......@@ -733,32 +741,26 @@ export default {
this.$refs.FlightTime.validate()
if(this.details.CarType!=1){
this.$refs.GetonAddress.validate()
flag = !this.$refs.SurName.hasError&& !this.$refs.Name.hasError&& !this.$refs.ContactWay.hasError
&& !this.$refs.Mobile.hasError&& !this.$refs.OrderDate.hasError&& !this.$refs.ManNum.hasError
&& !this.$refs.AirportTerminal.hasError&& !this.$refs.AirLine.hasError&& !this.$refs.FlightNumber.hasError
&& !this.$refs.FlightTime.hasError&& !this.$refs.GetonAddress.hasError&& !this.$refs.mail.hasError
}else{
this.$refs.GetoffAddress.validate()
flag = !this.$refs.SurName.hasError&& !this.$refs.Name.hasError&& !this.$refs.ContactWay.hasError
&& !this.$refs.Mobile.hasError&& !this.$refs.OrderDate.hasError&& !this.$refs.ManNum.hasError
&& !this.$refs.AirportTerminal.hasError&& !this.$refs.AirLine.hasError&& !this.$refs.FlightNumber.hasError
&& !this.$refs.FlightTime.hasError&& !this.$refs.GetoffAddress.hasError&& !this.$refs.mail.hasError
}
}else{
this.$refs.GetonAddress.validate()
this.$refs.GetoffAddress.validate()
flag = !this.$refs.SurName.hasError&& !this.$refs.Name.hasError&& !this.$refs.ContactWay.hasError
&& !this.$refs.Mobile.hasError&& !this.$refs.OrderDate.hasError&& !this.$refs.ManNum.hasError
&& !this.$refs.GetonAddress.hasError&& !this.$refs.GetoffAddress.hasError&& !this.$refs.mail.hasError
}
if(!flag) return this.goScrollToForm('baseUserInfoTitle')
let flag = true
flag = await this.formValidateHandler('baseUserInfo')
if(!flag){
let errorObj = this.$refs.baseUserInfo.getValidationComponents().find(x=>x.innerError)
window.scrollTo(0,errorObj.$el.offsetTop)
}else{
this.SetCarOrder()
}
},
goScrollToForm(formName){
async formValidateHandler(formName){
let temp=this.$refs[formName]
let formObj = temp instanceof Array ? temp[0] : temp
window.scrollTo(0,formObj.offsetTop)
return formObj.validate()
},
SetCarOrder(){
this.loading = true
......@@ -772,12 +774,7 @@ export default {
let ErpOrderId = r.data.data.Id
this.AddOrderInfo(ErpOrderId)
}else{
this.$q.notify({
type: "negative",
message: r.data.message,
position: "top",
timeout: 2000,
});
this.$message.error(r.data.message)
this.loading = false
}
})
......@@ -798,7 +795,7 @@ export default {
SurName: this.parameters.SurName,
Name: this.parameters.Name,
ContactNumber: this.parameters.Mobile,// 联系电话
Mailbox: this.userInfo.mail,//邮箱
Mailbox: this.userInfo.Mailbox,//邮箱
GoodsId: this.parameters.ProductId,//商品id
GoodsName: this.details.Name,//商品名称
GoodsPic: this.details.ImageList[0],//商品图片
......@@ -807,31 +804,18 @@ export default {
TotalPrice: this.parameters.Money,//总价格
PreferentialPrice: 0,// 优惠总金额
ErpOrderId: ErpOrderId,//erp订单id
Country: this.userInfo.country,//国家id
Country: this.userInfo.Country,//国家id
PlatformTax: 0,//平台税金默认0
Income: 0,//已收默认0
Refund: 0,//退款金额默认0
OrderSource: this.parameters.pType
},
(r) => {
if (r.data.resultCode == 1) {
this.step = 3
this.$q.notify({
color: "green-4",
textColor: "white",
icon: "check",
message: "訂單提交成功",
position:'center',
});
return
this.$message.success("訂單創建成功")
this.goPayHandler(r.data.data)
}else{
this.$q.notify({
type: "negative",
message: r.data.message,
position: "top",
timeout: 2000,
});
this.$message.error(r.data.message)
}
this.loading = false
})
......@@ -864,6 +848,8 @@ export default {
}else if(type==2){
this.parameters.OrderDate = this.OrderDate.startDate+' '+this.getBusTime
this.$refs.qDateProxy2.hide()
}else if(type==3){
this.parameters.OrderDate = this.OrderDate.startDate+' '+this.getBusTime
}
},
......@@ -908,16 +894,33 @@ export default {
},
initGuestHandler() {
},
// 获取当前用户信息
getUserInfoHandler() {
let u = this.$user.userInfo;
if (u) {
this.apipost("GetCustomerInfo_post", { Id: u.id }, (r) => {
if (r.data.resultCode == 1) {
this.userInfo = r.data.data;
if(r.data.data.Moblie){
this.parameters.Mobile = r.data.data.Moblie
}
} else {
this.$user.userInfo = null;
}
this.initCountry();
});
}
},
// 初始化国家
initCountry() {
this.apipost("GetCountryInfo_post", {}, (r) => {
if (r.data.resultCode == 1) {
this.countrys = r.data.data.countList;
this.userInfo.country = this.countrys[0].ID;
this.userInfo.Country = this.countrys[0].ID;
this.areaCodes = r.data.data.phoneCountList;
this.changeCountry(this.userInfo.country);
this.changeCountry(this.userInfo.Country);
this.areaCodes.forEach((x) => {
let temp = this.countrys.find((y) => y.ID == x.ID);
x.EnName = `${temp.EnName}(${x.PhoneCode})`;
......
......@@ -12,6 +12,12 @@
z-index: 999;
"
class="bg-white"
v-if="
(currentHeight > navs[0].top + 100 && $q.platform.is.desktop) ||
(currentHeight > priceListHeight &&
currentHeight < navs[0].top &&
$q.platform.is.mobile)
"
:style="{ transform: stickyHeight }"
>
<div
......@@ -31,7 +37,7 @@
unelevated
class="q-px-xl"
label="選擇方案"
@click="goScrollHandler('#scheme')"
@click="goScrollHandler(priceListHeight)"
/>
</div>
</div>
......@@ -118,7 +124,7 @@
>
<div class="col q-mr-lg">
<div class="text-h6 ellipsis-2-lines">{{ dataList.Name }}</div>
<div class="text-grey-7 fz17 ellipsis-2-lines">{{ dataList.Description }}</div>
<!-- <div class="text-grey-7 fz17 ellipsis-2-lines">{{ dataList.Description }}</div> -->
<div class="q-mt-md f12 text-grey-6">
<q-icon
name="iconfont icondingweixiao"
......@@ -142,12 +148,10 @@
label=" 印象自組團"
/>
<q-chip
v-if="dataList.dayList"
class="transparent q-mr-xl no-padding"
v-if="dataList.TravelHours>0" class="transparent q-mr-xl no-padding"
square
icon="iconfont icontime"
:label="` 行程時間 ${dataList.dayList.length} 天`"
/>
:label="`包車時長:${dataList.TravelHours} h`" />
<q-chip
class="transparent q-mr-xl no-padding"
square
......@@ -182,7 +186,7 @@
label="選擇方案"
unelevated
:disable="priceList.length>0?false:true"
@click="goScrollHandler('#scheme')"
@click="goScrollHandler(priceListHeight)"
:class="{ 'q-mt-md full-width': $q.platform.is.desktop }"
/>
</div>
......@@ -229,7 +233,7 @@
<q-tab
v-for="(x, i) in navs"
:key="i"
@click="goScrollHandler(x.id)"
@click="goScrollHandler(x.top + 20)"
:name="x.display"
:label="x.display"
></q-tab>
......@@ -245,20 +249,12 @@
style="max-width: 1200px; margin-left: auto; margin-right: auto"
>
<div class="text-h6">選擇方案</div>
<div
style="
background: #fff;
padding: 20px;
border-radius: 10px;
margin-top: 20px;
"
>
<div
class="rounded-borders bg-white q-pa-md q-mt-md"
v-if="$q.platform.is.mobile"
>
<q-field
class="q-my-md"
class="q-mt-md"
stack-label
label="選擇日期、選項"
standout
......@@ -276,25 +272,20 @@
></calendar>
</q-popup-proxy>
</q-field>
<template v-if="currentPrice && currentPrice.startDate">
<order-preview
class="q-pa-md"
:dataList="dataList"
:configId="msg.configId"
:Month="currentYM.str"
:PlaceList="dataList.PlaceList"
:CarTypeList="dataList.CarTypeList"
:AirportList="dataList.AirportList"
:price="currentPrice"
@reset="resetHandler"
@getPriceList="getPriceList"
></order-preview>
</template>
</div>
<!--方案选择区 -->
<!-- <div class="text-h6 q-pt-lg" v-if="$q.platform.is.mobile">
<div class="text-h6 q-pt-lg" v-if="$q.platform.is.mobile">
所選方案詳情
</div> -->
</div>
<div
class="bg-white rounded-borders q-mt-md"
v-if="priceList && priceList.length > 0"
......@@ -316,13 +307,13 @@
:label="`${dataList.FreeCancelDay}天前可免费取消`"
/>
</div>
<!-- <div class="text-grey f12">
<div class="text-grey f12">
<ul class="q-pl-md no-margin">
<li v-for="(x, i) in warnBuy" class="q-mt-md" :key="i">
<li v-for="(x, i) in warnBuy" :class="{'q-mt-md':$q.platform.is.desktop|(i!=0&&$q.platform.is.mobile)}" :key="i">
{{ x }}
</li>
</ul>
</div> -->
</div>
</div>
<div class="" v-if="$q.platform.is.desktop">
<div class="row items-center">
......@@ -336,7 +327,7 @@
color="primary"
outline
:label="showOrderPreview ? '取消選擇' : '選擇'"
@click="showOrderPreview = !showOrderPreview"
@click="changeShowOrderPreviewHandler"
class="q-px-lg"
/>
</div>
......@@ -360,6 +351,12 @@
square
icon="iconfont iconcancel"
:label="`${dataList.FreeCancelDay}天前可免费取消`"
/>
<q-chip
class="transparent q-mr-xl no-padding"
square
icon="iconfont iconroundcheck"
label="6個工作日內(不含例休假)確認"
/>
</div>
<div class="q-mt-lg row" v-if="$q.platform.is.desktop">
......@@ -375,9 +372,6 @@
:dataList="dataList"
:configId="msg.configId"
:Month="currentYM.str"
:PlaceList="dataList.PlaceList"
:CarTypeList="dataList.CarTypeList"
:AirportList="dataList.AirportList"
:price="currentPrice"
@reset="resetHandler"
@getPriceList="getPriceList"
......@@ -386,7 +380,7 @@
</div>
</div>
</div>
</div>
</div>
</div>
......@@ -399,7 +393,7 @@
<div
:class="{ 'col-8': $q.platform.is.desktop, col: $q.platform.is.mobile }"
>
<div id="product" :class="{
<div ref="product" class="text-h5 text-weight-bold text-left q-mt-xl" :class="{
'q-px-md': $q.screen.width < 1220 && $q.platform.is.mobile,
}">產品介紹</div>
<div
......@@ -410,7 +404,6 @@
v-if="dataList.feature && dataList.feature.featureHtml != ''"
></div>
<div
id="price"
class="text-h5 text-weight-bold text-left q-mt-xl"
ref="price"
:class="{
......@@ -449,8 +442,29 @@
'q-px-md': $q.screen.width < 1220 && $q.platform.is.mobile,
}"
></div>
<div
class="text-h5 text-weight-bold text-left q-mt-xl"
ref="warning"
:class="{
'q-px-md': $q.screen.width < 1220 && $q.platform.is.mobile,
}"
>
購買須知
</div>
<div
class="q-mt-lg trip-text bg-orange-1 q-pa-md rounded-borders q-mb-xl"
style="border: 1px dashed var(--q-color-warning)"
v-html="
dataList.feature
? dataList.feature.importantTip || '暂无购买须知'
: '暂无购买须知'
"
:class="{
'q-mx-md': $q.screen.width < 1220 && $q.platform.is.mobile,
}"
></div>
<div
id="assemblypoint"
class="text-h5 text-weight-bold text-left q-mt-xl"
ref="assemblypoint"
:class="{
......@@ -477,7 +491,6 @@
</div>
</div>
<div
id="experiencelocation"
class="text-h5 text-weight-bold text-left q-mt-xl"
ref="experiencelocation"
:class="{
......@@ -504,29 +517,6 @@
</div>
</div>
<div
id="warning"
class="text-h5 text-weight-bold text-left q-mt-xl"
ref="warning"
:class="{
'q-px-md': $q.screen.width < 1220 && $q.platform.is.mobile,
}"
>
購買須知
</div>
<div
class="q-mt-lg trip-text bg-orange-1 q-pa-md rounded-borders q-mb-xl"
style="border: 1px dashed var(--q-color-warning)"
v-html="
dataList.feature
? dataList.feature.importantTip || '暂无购买须知'
: '暂无购买须知'
"
:class="{
'q-mx-md': $q.screen.width < 1220 && $q.platform.is.mobile,
}"
></div>
<div
id="tips"
class="text-h5 text-weight-bold text-left q-mt-xl"
ref="tips"
:class="{
......@@ -548,7 +538,6 @@
}"
></div>
<div
id="cancelTips"
class="text-h5 text-weight-bold text-left q-mt-xl"
ref="cancelTips"
:class="{
......@@ -583,6 +572,7 @@
</div>
<template v-if="$q.platform.is.desktop">
<div class="col-1"></div>
<div class="col q-ml-xl position-relative">
<div style="position: sticky; top: 100px">
......@@ -590,7 +580,12 @@
class="text-subtitle2 text-grey-6 cursor-pointer q-mb-md"
v-for="(x, i) in navs"
:key="i"
@click="goScrollHandler(x.id)"
@click="goScrollHandler(x.top + 20)"
:class="{
'active-trip-module':
currentHeight >= x.top &&
(i == navs.length - 1 || currentHeight < navs[i + 1].top),
}"
>
{{ x.display }}
</div>
......@@ -658,10 +653,10 @@ export default {
loop: true,
},
warnBuy: [
"未满 2 岁幼儿不占位可免费参加(不含座位,餐点,门票,床位),请先于下订时在「备注栏」告知。",
"如需要單人房,請購買單房",
"不占床2-11(包含)岁幼童可购买儿童价,如需占床請購買成人價",
"12歲以上皆視同成人售價",
"如一輛車位不夠使用,請購買多輛車",
"收費公路費、停車費、入園費等請另行繳納",
"由於交通擁堵,時長可能會略有變化",
"每增加 30 分鐘,將收取相應的延期費。 (現場支付)",
],
showOrderPreview: false,
videoPosition: 0,
......@@ -677,43 +672,43 @@ export default {
],
navs: [
{
id: "#product",
val: "product",
top: 0,
isActive: false,
display: "產品介紹",
},
{
id: "#price",
val: "price",
top: 0,
isActive: false,
display: "費用說明",
},
{
id: "#warning",
val: "warning",
top: 0,
isActive: false,
display: "購買須知",
},
{
id: "#assemblypoint",
val: "assemblypoint",
top: 0,
isActive: false,
display: "接送點範圍",
},
{
id: "#experiencelocation",
val: "experiencelocation",
top: 0,
isActive: false,
display: "機場地點",
},
{
id: "#tips",
val: "tips",
top: 0,
isActive: false,
display: "溫馨提示",
},
{
id: "#cancelTips",
val: "cancelTips",
top: 0,
isActive: false,
display: "取消政策",
......@@ -750,6 +745,13 @@ export default {
immediate: true,
deep: true,
},
currentPrice: {
handler: function (val, oldval) {
this.currentPrice = val;
},
immediate: false,
deep: true,
},
},
created() {
if (this.$route.params.id) {
......@@ -760,6 +762,7 @@ export default {
}
},
mounted() {
window.addEventListener("scroll", this.handleScroll);
const timeStamp = Date.now()
const formattedString = date.formatDate(timeStamp, 'YYYY-MM-DD')
this.currentYM = {
......@@ -770,12 +773,36 @@ export default {
if (localStorage.baseifo) {
this.TripConfig = JSON.parse(window.localStorage.getItem("baseifo"));
}
window.addEventListener("scroll", this.menu);
// this.getData();
window.addEventListener("scroll", this.menu);
this.getCarData();
// this.getCarPriceData();
},
methods: {
changeShowOrderPreviewHandler(){
this.showOrderPreview=!this.showOrderPreview
if(!this.showOrderPreview){
// // this.currentPrice=null
// if(this.currentPrice){
// this.currentPrice.isSupportChildren=null
// this.currentPrice.unionCityList=null
// this.currentPrice.singleRoomPrice=0
// this.currentPrice.originalB2CPrice=0
// }
this.changeTripShowHandler()
}
},
changeTripShowHandler() {
this.$nextTick(() => {
this.navs.forEach((x) => {
x.top =
this.$refs[x.val].getBoundingClientRect().top +
this.currentHeight -
60;
});
});
},
getPriceList(Arr,id){
this.priceList = JSON.parse(Arr)
if(this.selectedCar === id) {
......@@ -787,6 +814,38 @@ export default {
getTopNum(x) {
this.days = JSON.parse(x);
},
handleScroll(e) {
let temp = this.getScroll().top;
this.stickyHeight = document.querySelector(".q-header--hidden")
? "translateY(0px)"
: "translateY(45px)";
this.currentHeight = temp;
if (
this.videoPosition > 0 &&
this.videoPosition < this.currentHeight &&
this.options.currentPage == 0 &&
!this.isPictureInPicture
) {
this.isPictureInPicture = true;
let t = document.querySelectorAll("video")[0];
try {
t.requestPictureInPicture();
} catch (error) {}
} else if (
this.videoPosition > 0 &&
this.videoPosition > this.currentHeight &&
this.options.currentPage == 0 &&
this.isPictureInPicture
) {
this.isPictureInPicture = false;
document.exitPictureInPicture();
}
let h = document.location.hash;
if (h.indexOf("#/detailCar/") == -1) {
window.removeEventListener("scroll", this.handleScroll);
}
},
getScroll() {
return {
left:
......@@ -801,9 +860,9 @@ export default {
0,
};
},
goScrollHandler(id) {
console.log("scrollIntoView", id);
document.querySelector(id).scrollIntoView({ behavior: "smooth" });
goScrollHandler(top) {
window.scrollTo(0, top);
// document.querySelector(id).scrollIntoView({ behavior: "smooth" });
},
slideHandler(e) {
this.options.currentPage = e.currentPage;
......@@ -826,7 +885,9 @@ export default {
},
resetHandler() {
this.currentPrice.startDate = "";
if(!this.$q.platform.is.mobile){
this.$refs.calendar.reset();
}
},
changeChosenDateHandler(val) {
val.price.version = new Date().getTime();
......@@ -895,6 +956,17 @@ export default {
this.zoomDiyContext = tw > 1 ? 1 : tw.toFixed(2);
}
setTimeout(() => {
this.navs.forEach((x) => {
x.top =
this.$refs[x.val].getBoundingClientRect().top + this.currentHeight - 60;
});
this.priceListHeight =
this.$refs.pricelist.getBoundingClientRect().top +
this.currentHeight -
60;
}, 1000);
try {
document
.querySelector("#scrollId .q-page-container")
......@@ -942,8 +1014,11 @@ export default {
isSupportChildren: 1,
safeMoney: 0,
}
if(date.formatDate(Date.now(), 'YYYY-MM-DD')!=x.Date){
arr.push(dataObj)
}
}
})
this.priceList = JSON.parse(JSON.stringify(arr))
}
......@@ -1031,6 +1106,21 @@ export default {
</script>
<style>
.active-trip-module {
color: var(--q-color-primary);
font-weight: 800;
position: relative;
}
.active-trip-module::before {
position: absolute;
content: " ";
top: 0;
bottom: 0;
left: -25px;
width: 5px;
border-radius: 5px;
background: var(--q-color-primary);
}
.slider-item {
transform: scale(1);
transition-timing-function: ease;
......
......@@ -308,7 +308,7 @@
</div>
<div class="text-grey f12">
<ul class="q-pl-md no-margin">
<li v-for="(x, i) in warnBuy" class="q-mt-md" :key="i">
<li v-for="(x, i) in warnBuy" :class="{'q-mt-md':$q.platform.is.desktop|(i!=0&&$q.platform.is.mobile)}" :key="i">
{{ x }}
</li>
</ul>
......@@ -777,7 +777,13 @@ export default {
changeShowOrderPreviewHandler(){
this.showOrderPreview=!this.showOrderPreview
if(!this.showOrderPreview){
this.currentPrice=null
// this.currentPrice=null
if(this.currentPrice){
this.currentPrice.isSupportChildren=null
this.currentPrice.unionCityList=null
this.currentPrice.singleRoomPrice=0
this.currentPrice.originalB2CPrice=0
}
this.changeTripShowHandler()
}
},
......@@ -871,7 +877,13 @@ export default {
//console.log(e)
},
resetHandler() {
this.currentPrice=null;
// this.currentPrice=null;
if(this.currentPrice){
this.currentPrice.isSupportChildren=null
this.currentPrice.unionCityList=null
this.currentPrice.singleRoomPrice=0
this.currentPrice.originalB2CPrice=0
}
if(this.$q.platform.is.mobile)
this.$refs.calendarMobile.reset()
else
......@@ -882,7 +894,7 @@ export default {
this.currentPrice = JSON.parse(JSON.stringify(val.price));
this.currentPrice.RealPrice = this.currentPrice.RealPrice?this.currentPrice.RealPrice:this.currentPrice.originalB2CPrice
this.currentPrice.originalB2CPrice = this.currentPrice.RealPrice
if(this.currentPrice.unionCityList && this.currentPrice.unionCityList.length>0){
if(this.currentPrice.unionCityList && this.currentPrice.unionCityList.length>0 && this.dataList.startCityId!=0){
this.currentPrice.unionCityList.splice(0,0,{
cityId:this.dataList.startCityId,
cityName:this.dataList.startCityName
......
<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
<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>
<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>
......@@ -33,14 +33,15 @@
}
.img-box {
width: 50px;
height: 50px;
background: #F5F5F5;
border-radius: 25px;
}.img {
height: 50px;
background: #f5f5f5;
border-radius: 25px;
}
.img {
width: 50px;
height: 50px;
display: block;
padding: 11px;
height: 50px;
display: block;
padding: 11px;
}
</style>
<template>
......@@ -49,51 +50,136 @@ padding: 11px;
<div class="tips">登陸方式管理</div>
<div class="card">
<div class="flex justify-between">
<div>郵箱<span class="text-grey-6">(默認地址)</span></div>
<div><span>修改</span><span>删除</span></div>
<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 class="card flex justify-between">
<div class="flex justify-between">
<div class="img-box">
<img class="img" src="../../assets/img/wechat.png" />
</div>
<div class="flex justify-between">
<div>郵箱<span class="text-grey-6">(默認地址)</span></div>
<div><span>修改</span><span>删除</span></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>
<q-dialog content-style="width: 900px" v-model="showReset">
<resetEmail @change="resetEmailSuccess"></resetEmail>
</q-dialog>
</div>
</div>
</template>
<script>
import resetEmail from "./components/resetEmail.vue";
export default {
components: { resetEmail },
data() {
return {
form: {
lastName: "",
firstName: "",
},
model: "",
date: "",
options: [],
showReset: false,
form: {},
};
},
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: {
submit() {
const verifyArr = ["fastName", "lastName"];
verifyArr.forEach((item) => {
this.$refs[item].validate();
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意味着没有超时
});
verifyArr.forEach((item) => {
if (item.$refs[item].hasError) {
this.formHasError = true;
}
},
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意味着没有超时
});
if ((this.formHasError = true)) {
return;
}
},
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
);
},
},
};
</script>
\ No newline at end of file
......@@ -18,13 +18,19 @@
::v-deep .q-field__control {
height: 40px;
}
::v-deep .q-field--auto-height .q-field__control {
min-height: 40px;
}
::v-deep .q-field__marginal {
height: 40px;
}
.title {
margin-top: 20px;
margin-bottom: 10px;
}
.card {
margin-top: 20px;
width: 433px;
width: 413px;
height: 170px;
background: #ffffff;
border: 1px solid #eeeeee;
......@@ -62,86 +68,331 @@
<div class="content q-ma-lg bg-white">
<div class="q-ma-lg">
<div class="tips">
收貨地址 <span>您已创建 4个收货地址,最多可创建 10个</span>
收貨地址 <span>您已创建 {{count}}个收货地址,最多可创建 10个</span>
</div>
<div class="card">
<div class="flex flex-wrap justify-between">
<div class="card" v-for="item in pageData" :key="item.Id">
<div class="flex justify-between label">
<div>唐艷林<span class="text-grey-6">(默認地址)</span></div>
<div><span>修改</span><span>删除</span></div>
<div>
{{ item.Name
}}<span class="text-grey-6" v-if="item.IsDefault === 1"
>(默認地址)</span
>
</div>
<div>
<span class="user-edit" @click="editUser(item)">编辑</span>
<span class="text-grey-6 cursor-pointer" @click="deleteUser(item)"
>删除</span
>
</div>
</div>
<div class="address-item q-pt-sm">
所在地區:{{ item.CountryName }} {{ item.CityName }}
</div>
<div class="address-item">詳細地址:{{ item.Address }}</div>
<div class="address-item">手機:{{ item.Mobile }}</div>
</div>
<div class="address-item q-pt-sm">所在地區:四川成都市成華區跳蹬河街道</div>
<div class="address-item">詳細地址:建設南路163號3棟</div>
<div class="address-item">手機:180****1613</div>
<!-- <div class="card flex flex-center" @click="showDialog"><span></span>添加郵寄地址</div> -->
<q-btn v-if="count < 10"
class="card flex flex-center"
color="blue"
unelevated
outline
@click="addAddress"
><img class="q-mr-sm" style="width: 28px;" src="../../assets/img/address-add.png" />添加郵寄地址</q-btn>
</div>
<div class="card flex flex-center" @click="showDialog"><span></span>添加郵寄地址</div>
</div>
<q-dialog content-style="width: 900px" v-model="isShowDialog">
<div class="bg-white dialog-box">
<div>添加邮寄地址</div>
<div class="dialog-box">
<div class="bg-white dialog-box" style="width: 800px; padding: 20px">
<div class="f22 bold">{{form.Id ? '编辑': '添加'}}邮寄地址</div>
<form @submit.prevent.stop="submit" class="q-gutter-md">
<div>
<div class="row">
<div class="col">
<div class="title"></div>
<div class="title">全名</div>
<q-input
class="form-item"
v-model="form.firstName"
v-model="form.Name"
outlined
placeholder="姓"
ref="firstName"
:rules="[(val) => val !== '' || '请输入姓氏']"
placeholder="全名"
ref="Name"
:rules="[(val) => !!val || '请输入全名']"
></q-input>
</div>
</div>
<div class="row">
<div class="col">
<div class="title">選擇手機區號</div>
<q-select
ref="AreaCode"
emit-value
map-options
square
outlined
option-value="ID"
option-label="PhoneCode"
class="form-item"
v-model="form.AreaCode"
:options="phoneCountList"
placeholder="選擇手機區號"
:rules="[(val) => Boolean(val) || '请選擇手機區號']"
/>
</div>
<div class="col">
<div class="title"></div>
<div class="title">手機號碼</div>
<q-input
ref="lastName"
ref="Mobile"
class="form-item"
placeholder="名"
v-model="form.lastName"
placeholder="手機號碼"
v-model="form.Mobile"
outlined
:rules="[(val) => val !== '' || '请输入名字']"
:rules="[(val) => !!val || '请输入手機號碼']"
></q-input>
</div>
</div>
<div class="row">
<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 class="col">
<div class="title">城市</div>
<q-input
ref="CityName"
class="form-item"
placeholder="城市"
v-model="form.CityName"
outlined
:rules="[(val) => !!val || '请输入電話(首次需驗證)']"
></q-input>
</div>
</div>
<div class="row">
<div class="col">
<div class="title">詳細地址</div>
<q-input
ref="Address"
class="form-item"
placeholder="詳細地址"
v-model="form.Address"
outlined
:rules="[(val) => !!val || '请输入詳細地址)']"
></q-input>
</div>
<div class="col">
<div class="title">郵政編碼</div>
<q-input
ref="PostalCode"
class="form-item"
placeholder="郵政編碼"
v-model="form.PostalCode"
outlined
:rules="[(val) => !!val || '请输入郵政編碼']"
></q-input>
</div>
</div>
<div class="flex items-center q-my-sm">
<BaseSwitch v-model="form.IsDefault"></BaseSwitch
><span class="q-ml-sm">保存為默認地址</span></div>
<div>
<q-btn color="primary" unelevated label="保存" @click="submit" />
<q-btn color="primary" type="submit" unelevated label="保存" />
</div>
</div>
</form>
</div>
</q-dialog>
</div>
</template>
<script>
import BaseSwitch from "../../components/base-switch.vue";
export default {
components: {
BaseSwitch,
},
data() {
return {
isShowDialog: false,
selectedKey: "全部",
form: {
lastName: "",
firstName: "",
Name: "",
Mobile: "",
},
model: "",
date: "",
options: [],
countList: [],
phoneCountList: [],
count: 0,
pageData: [],
};
},
mounted() {
this.id = 0;
this.getUsersList();
this.getCountryInfo();
},
methods: {
showDialog() {
addAddress() {
this.isShowDialog = true
this.form = {
Name: "",
Mobile: "",}
},
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
);
},
changeCouponType(item) {
this.selectedKey = item;
},
submit() {
const verifyArr = ["fastName", "lastName"];
this.formHasError = false;
const verifyArr = [
"Name",
"AreaCode",
"Mobile",
"CountryId",
"CityName",
"Address",
"PostalCode",
];
verifyArr.forEach((item) => {
console.log("this.$refs[item]", this, item, this.$refs[item]);
this.$refs[item].validate();
});
verifyArr.forEach((item) => {
if (item.$refs[item].hasError) {
console.log("item", item);
if (this.$refs[item].hasError) {
console.log("item", item);
this.formHasError = true;
}
});
if ((this.formHasError = true)) {
console.log("this.formHasError", this.formHasError, this.form);
if (this.formHasError) {
return;
}
this.submitUserInfo();
},
getUsersList() {
this.apipost(
"b2c_post_GetMailingAddressPageListt",
{ pageIndex: 1, pageSize: 20 },
(res) => {
if (res.data.resultCode == 1) {
const { count, pageData } = res.data.data;
this.count = count;
this.pageData = pageData;
} else {
// this.$notify(res.data.message);
this.$q.notify({
type: "negative",
message: res.data.message,
position: "top",
timeout: 2000, // 以毫秒为单位; 0意味着没有超时
});
}
},
null
);
},
editUser(item) {
console.log("editUser", item);
this.form = {...item};
this.form.AreaCode = Number(this.form.AreaCode)
this.form.IsDefault = this.form.IsDefault === 1
this.isShowDialog = true;
},
deleteUser(item) {
this.apipost(
"b2c_post_DelMailingAddressInfo",
{
AddressId: item.Id,
},
(res) => {
if (res.data.resultCode == 1) {
this.$q.notify({
type: "positive",
message: res.data.message,
position: "top",
timeout: 2000, // 以毫秒为单位; 0意味着没有超时
});
this.getUsersList();
} 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.AreaCode = params.AreaCode.ID;
// params.CountryId = params.CountryId.ID;
params.IsDefault = params.IsDefault ? 1 : 2;
this.apipost(
"b2c_post_SetMailingAddressInfo",
params,
(res) => {
if (res.data.resultCode == 1) {
this.$q.notify({
type: "positive",
message: res.data.message,
position: "top",
timeout: 2000, // 以毫秒为单位; 0意味着没有超时
});
this.isShowDialog = false;
this.getUsersList();
} else {
// this.$notify(res.data.message);
this.$q.notify({
type: "negative",
message: res.data.message,
position: "top",
timeout: 2000, // 以毫秒为单位; 0意味着没有超时
});
}
},
null
);
},
},
};
......
......@@ -4,6 +4,26 @@
height: 40px;
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 {
width: 900px;
}
......@@ -33,25 +53,53 @@
设置密码(8 - 20个字符,须至少包含1个数字、1个字母及1个特殊符号)
</div>
<div class="text-grey-6">高强度密码能提高账号安全性</div>
<form @submit.prevent.stop="submit">
<div class="form-group">
<q-input
class="form-item"
v-model="form.firstName"
v-model="form.OldPassword"
outlined
placeholder="姓"
ref="firstName"
:rules="[(val) => val !== '' || '请输入姓氏']"
></q-input>
placeholder="旧密码"
ref="OldPassword"
:type="isPasswordOld === 2 ? 'PassWord' : 'text'"
:rules="[(val) => val !== '' || '请输入旧密码']"
></q-input
><i
class="iconfont iconyanjing_xianshi"
v-if="isPasswordOld == 1"
@click="isPasswordOld = 2"
></i>
<i
class="iconfont iconbiyan"
v-if="isPasswordOld == 2"
@click="isPasswordOld = 1"
></i>
</div>
<div class="form-group">
<q-input
class="form-item"
v-model="form.firstName"
v-model="form.NewPassword"
outlined
placeholder="姓"
ref="firstName"
:rules="[(val) => val !== '' || '请输入姓氏']"
></q-input>
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" unelevated label="确认" @click="submit" />
<q-btn color="primary" type="submit" unelevated label="确认" />
</div>
</form>
</div>
</div>
</div>
......@@ -64,66 +112,205 @@
<div class="text-grey-6">
抢先获取印象最新优惠活动、优惠码、折扣信息及最新动向
</div>
<q-checkbox>电子邮件</q-checkbox>
<q-checkbox>短信</q-checkbox>
<checkboxGroupVue
:checkboxList="emailType"
v-model="setInfoForm.DiscountsNoticeWay"
></checkboxGroupVue>
</div>
<div>
<div>消息提醒</div>
<div class="text-grey-6">
获取购物车内活动及支付状态、评价提醒、推荐好友获取优惠等信息
</div>
<q-checkbox>电子邮件</q-checkbox>
<q-checkbox>短信</q-checkbox>
<checkboxGroupVue
:checkboxList="emailType"
v-model="setInfoForm.MessageNoticeWay"
></checkboxGroupVue>
</div>
<div>
<div>賬戶通知</div>
<div class="text-grey-6">
接收重要通知,如订单摘要、凭证及活动取消
</div>
<q-checkbox>电子邮件</q-checkbox>
<q-checkbox>短信</q-checkbox>
<checkboxGroupVue
:checkboxList="emailType"
v-model="setInfoForm.AccountNoticeWay"
></checkboxGroupVue>
</div>
<div>
<q-btn
color="primary"
unelevated
label="更改偏好設置"
@click="submit"
@click="changeNoticeType"
/>
</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>
<q-dialog content-style="width: 900px" v-model="showRemove">
<removeAccount></removeAccount>
</q-dialog>
</div>
</template>
<script>
import checkboxGroupVue from "./components/checkboxGroup.vue";
import removeAccount from './components/removeAccount.vue'
export default {
components: { checkboxGroupVue, removeAccount },
data() {
return {
isPasswordOld: 2,
isPassword: 2,
emailType: [
{ label: "电子邮件", value: 1 },
{ label: "短信", value: 2 },
],
setInfoForm: {
DiscountsNoticeWay: 1,
MessageNoticeWay: 1,
AccountNoticeWay: 1,
},
form: {
lastName: "",
firstName: "",
OldPassword: "",
NewPassword: "",
},
model: "",
date: "",
options: [],
showRemove: false,
};
},
mounted() {
this.getUserInfo();
},
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() {
const verifyArr = ["fastName", "lastName"];
this.formHasError = false;
const verifyArr = ["OldPassword", "NewPassword"];
console.log("submit");
verifyArr.forEach((item) => {
console.log("submit", this.$refs[item]);
this.$refs[item].validate();
});
verifyArr.forEach((item) => {
if (item.$refs[item].hasError) {
if (this.$refs[item].hasError) {
this.formHasError = true;
}
});
if ((this.formHasError = true)) {
console.log("this.formHasError", this.formHasError);
if (this.formHasError) {
return;
}
this.resetPassword();
},
},
};
......
......@@ -93,6 +93,8 @@
<div class="col">
<div class="title">居住國家/地區</div>
<q-select
emit-value
map-options
ref="Country"
square
outlined
......@@ -108,6 +110,8 @@
<div class="col">
<div class="title">稱謂</div>
<q-select
emit-value
map-options
ref="Appellation"
square
outlined
......@@ -126,6 +130,8 @@
<div class="col">
<div class="title">國家/地區代碼</div>
<q-select
emit-value
map-options
ref="PhoneCountry"
square
outlined
......
......@@ -8,8 +8,7 @@
width: 900px;
}
.title {
margin-top: 20px;
margin-bottom: 10px;
margin: 20px 10px 10px 10px;
}
.card {
margin: 10px;
......@@ -75,6 +74,12 @@
background-color: $primary;
margin: -8px auto 0 auto;
}
.card-info {
height: 20px;
padding: 0 4px;
background: #DDDDDD;
border-radius: 8px;
}
</style>
<template>
<div class="content q-ma-lg bg-white">
......@@ -82,33 +87,48 @@
<div class="card" v-for="item in pageData" :key="item.id">
<div class="flex card-title justify-between">
<div class="flex">
<span>订单号</span>
<span class="phone">联系客服</span>
<span>{{item.Name}}</span>
<span class="phone">手機號:{{item.Mobile}}</span>
</div>
<span>
<span>编辑</span>
<span>删除</span>
<span class="user-edit" @click="editUser(item)">编辑</span>
<span class="text-grey-6 cursor-pointer" @click="deleteUser(item)">删除</span>
</span>
</div>
<div class="flex q-py-sm">
<div class="row">
<div class="col-12">中國內地身份證:510181********0920</div>
<div class="col-12">中國內地身份證:510181********0920</div>
<div class="row q-pa-lg" v-for="(item, index) in item.CardList" :key="index">
<div class="col">中國內地身份證:510181********0920</div>
<div class="col">中國內地身份證:510181********0920</div>
</div>
</div>
</div>
</div>
<q-btn
<div class="q-pa-sm full-width">
<q-btn class="full-width"
color="primary"
unelevated
outline
@click="isShowDialog = true"
label="添加出行人"
></q-btn>
@click="addUser"
><img class="q-mr-sm" style="width: 28px;" src="../../assets/img/add.png" />添加出行人</q-btn>
</div>
<div class="mt flex justify-end">
<q-pagination
v-model="current"
:max="pageCount"
direction-links
color="primary"
active-color="primary"
:max-pages="5"
@input="pageChange"
/>
</div>
<q-dialog content-style="width: 900px" v-model="isShowDialog">
<div class="bg-white dialog-box" style="width: 800px; padding: 20px">
<div>添加邮寄地址</div>
<div class="f22 bold">{{form.Id ? '编辑': '新增'}}出行人信息</div>
<form @submit.prevent.stop="submit" class="q-gutter-md">
<div>
<div class="row">
......@@ -116,10 +136,10 @@
<div class="title"></div>
<q-input
class="form-item"
v-model="form.Surname"
v-model="form.SurName"
outlined
placeholder="姓"
ref="Surname"
ref="SurName"
:rules="[(val) => !!val || '请输入姓氏']"
></q-input>
</div>
......@@ -150,10 +170,10 @@
<div class="col">
<div class="title">名字(需與旅遊證件一致)</div>
<q-input
ref="EnSurname"
ref="EnSurName"
class="form-item"
placeholder="名字(需與旅遊證件一致)"
v-model="form.EnSurname"
v-model="form.EnSurName"
outlined
:rules="[(val) => !!val || '请输入名字(需與旅遊證件一致)']"
></q-input>
......@@ -164,43 +184,53 @@
<div class="col">
<div class="title">國家/地區代碼</div>
<q-select
ref="PhoneCountry"
emit-value
map-options
ref="AreaCode"
square
outlined
option-value="ID"
option-label="PhoneCode"
class="form-item"
v-model="form.PhoneCountry"
v-model="form.AreaCode"
:options="phoneCountList"
placeholder="Filled"
placeholder="请选择國家/地區代碼"
:rules="[(val) => Boolean(val) || '请选择國家/地區代碼']"
/>
</div>
<div class="col">
<div class="title">電話(首次需驗證)</div>
<div class="title">手機號</div>
<q-input
ref="Moblie"
ref="Mobile"
class="form-item"
placeholder="電話(首次需驗證)"
v-model="form.Moblie"
placeholder="手機號"
v-model="form.Mobile"
outlined
:rules="[(val) => !!val || '请输入電話(首次需驗證)']"
:rules="[(val) => !!val || '请输入手機號']"
></q-input>
</div>
</div>
<div
<div
v-for="(item, index) in form.CardList"
:key="item.id"
:key="item.id">
<div class="flex justify-between ml mr q-mt-lg" style="margin-bottom: -10px"><span class="card-info">证件信息#{{index+ 1}}</span>
<div v-if="index > 0" @click="deleteCardItem(item)">
<i class="iconfont iconline"></i>
<i class="iconfont icondelete"></i>
</div>
</div>
<div
class="row"
>
<div class="col">
<div class="title">证件类型</div>
<q-select
emit-value
map-options
ref="card"
square
outlined
option-value="ID"
option-value="Id"
option-label="Name"
class="form-item"
v-model="item.Type"
......@@ -210,27 +240,25 @@
/>
</div>
<div class="col">
<div class="flex justify-between items-center">
<div class="title">证件号码</div>
<div v-if="index > 0" @click="deleteCardItem(item)">删除</div>
<div class="title flex justify-between items-center">
<div>证件号码</div>
</div>
<q-input
class="form-item"
placeholder="電話(首次需驗證)"
placeholder="证件号码"
v-model="item.CardNo"
outlined
:rules="[(val) => !!val || '请输入電話(首次需驗證)']"
:rules="[(val) => !!val || '请输入证件号码']"
></q-input>
</div>
</div>
<q-btn
</div></div>
<q-btn class="ml"
color="primary"
@click="addCard"
unelevated
outline
label="新增证件"
/>
<div>
><img class="q-mr-sm" style="width: 28px;" src="../../assets/img/add.png" />新增证件</q-btn>
<div class="mt flex flex-center">
<q-btn color="primary" type="submit" unelevated label="保存" />
</div>
</div>
......@@ -243,14 +271,16 @@
export default {
data() {
return {
current: 1,
pageCount: 0,
isShowDialog: false,
selectedKey: "全部",
form: {
Surname: "",
SurName: "",
Name: "",
EnName: "",
EnSurname: "",
Moblie: "",
EnSurName: "",
Mobile: "",
CardList: [],
},
model: "",
......@@ -270,6 +300,22 @@ export default {
this.getCardTypeList();
},
methods: {
pageChange(value) {
console.log('pageChange', value)
this.current = value
this.getUsersList()
},
addUser() {
this.isShowDialog = true
this.form = {
SurName: "",
Name: "",
EnName: "",
EnSurName: "",
Mobile: "",
CardList: [],}
this.addCard()
},
getCardTypeList() {
this.apipost(
"b2c_post_GetTripCardEnumList",
......@@ -277,6 +323,8 @@ export default {
(res) => {
if (res.data.resultCode == 1) {
this.cardList = res.data.data;
this.cardList.forEach(item => item.Id = Number(item.Id));
console.log('this.cardList', this.cardList)
} else {
// this.$notify(res.data.message);
this.$q.notify({
......@@ -298,7 +346,7 @@ export default {
if (res.data.resultCode == 1) {
const { phoneCountList, countList } = res.data.data;
this.countList = countList;
this.phoneCountList = phoneCountList;
this.phoneCountList = phoneCountList
} else {
// this.$notify(res.data.message);
this.$q.notify({
......@@ -319,6 +367,7 @@ export default {
this.id++;
this.form.CardList.push({
id: this.id,
Type: '',
});
},
deleteCardItem(card) {
......@@ -328,11 +377,12 @@ export default {
submit() {
this.formHasError = false;
const verifyArr = [
"Surname",
"SurName",
"Name",
"EnName",
"EnSurname",
"Moblie",
"EnSurName",
"Mobile",
"AreaCode",
];
verifyArr.forEach((item) => {
console.log("this.$refs[item]", this, item, this.$refs[item]);
......@@ -349,16 +399,31 @@ export default {
if (this.formHasError) {
return;
}
for(let i = 0; i < this.form.CardList.length; i++) {
let item = this.form.CardList[i]
if(!item.Type || !item.CardNo) {
// this.$notify(res.data.message);
this.$q.notify({
type: "negative",
message: '证件信息不完善,请补充',
position: "top",
timeout: 2000, // 以毫秒为单位; 0意味着没有超时
});
return
}
}
this.submitUserInfo();
},
getUsersList() {
this.apipost(
"b2c_post_GetTripGuestPageList",
{pageIndex: 1, pageSize: 20},
{pageIndex: this.current, pageSize: 10},
(res) => {
if (res.data.resultCode == 1) {
const { count, pageData } = res.data.data;
const { count, pageData, pageCount } = res.data.data;
this.count = count;
this.pageCount = pageCount
this.pageData = pageData;
} else {
// this.$notify(res.data.message);
......@@ -373,11 +438,17 @@ export default {
null
);
},
deleteUser() {
editUser(item) {
console.log('editUser', item)
this.form = {...item}
this.form.AreaCode = Number(this.form.AreaCode)
this.isShowDialog = true
},
deleteUser(item) {
this.apipost(
"b2c_post_DelTripGuestInfo",
{
Id: this.userInfo?.id,
TripGuestId: item.Id,
},
(res) => {
if (res.data.resultCode == 1) {
......@@ -387,6 +458,7 @@ export default {
position: "top",
timeout: 2000, // 以毫秒为单位; 0意味着没有超时
});
this.current = 1
this.getUsersList();
} else {
// this.$notify(res.data.message);
......@@ -403,10 +475,9 @@ export default {
},
submitUserInfo() {
let params = { ...this.form };
params.PhoneCountry = params.PhoneCountry.ID;
params.CardList.forEach(item => {
item.Type = item.Type.Id
})
// params.CardList.forEach(item => {
// item.Type = item.Type.Id
// })
this.apipost(
"b2c_post_SetTripGuestInfo",
params,
......@@ -418,6 +489,8 @@ export default {
position: "top",
timeout: 2000, // 以毫秒为单位; 0意味着没有超时
});
this.isShowDialog = false;
this.getUsersList()
} else {
// this.$notify(res.data.message);
this.$q.notify({
......
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