Commit cb6e7cbe authored by 沈良进's avatar 沈良进

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

parents 7594cf47 5191c9fa
......@@ -13,32 +13,42 @@
<div class="text-grey-6 f12 q-my-md">選擇門票類型</div>
<div class="row wrap">
<div v-for="(x,i) in dataList.TicketList" :key="i">
<q-chip size="14px" clickable @click="handleSelect(x)"
:text-color="selectedObj&&selectedObj.Id==x.Id?'white':'dark'"
:color="selectedObj&&selectedObj.Id==x.Id?'primary':'grey-3'" square>{{ x.TicketName }}</q-chip>
<q-chip size="14px" clickable @click="handleSelect(x,1)"
:text-color="x.checked?'white':'dark'"
:color="x.checked?'primary':'grey-3'" square>{{ x.TicketName }}</q-chip>
</div>
</div>
<div class="text-grey-6 f12 q-my-md">選擇數量</div>
<div class="row items-end">
<div class="col" :class="{'column':$q.platform.is.mobile}">
<div v-if="selectedObj">
<span class="text-subtitle2 text-weight-bold">{{selectedObj.TicketName}}</span>
<span class="text-grey-6 f12 q-ml-sm"></span>(1人/票)</span>
<div class="text-grey-6 f12 q-my-md">選擇取票方式</div>
<div class="row no-wrap">
<div v-for="(x,i) in takeList" :key="i">
<q-chip size="14px" clickable @click="handleSelect(x,2)"
:text-color="MailingStateObj&&MailingStateObj.Id==x.Id?'white':'dark'"
:color="MailingStateObj&&MailingStateObj.Id==x.Id?'primary':'grey-3'" square>{{ x.Name }}</q-chip>
</div>
</div>
<div v-if="dataList.TicketList.map(x=>x.checked).indexOf(true)!=-1" class="text-grey-6 f12 q-my-md">選擇數量</div>
<template v-for="(x,i) in dataList.TicketList">
<div class="row items-end q-mb-md">
<div v-if="x.checked" :key="i" class="col" :class="{'column':$q.platform.is.mobile}"
>
<div>
<span class="text-subtitle2 text-weight-bold">{{x.TicketName}}</span>
<span class="text-grey-6 f12 q-ml-sm"></span></span>
</div>
<div v-if="$q.platform.is.mobile">
<span class="text-grey-7 product-price" style="font-size: 13px">
CNY {{ moneyFormat(p.originalB2CPrice, 0) }} /每票
CNY {{ moneyFormat(x.originalB2CPrice, 0) }} /每票
</span>
</div>
</div>
<div class="row items-end">
<div class="row items-end" v-if="x.checked">
<span v-if="$q.platform.is.desktop" class="text-grey-7 product-price" style="font-size: 13px">
CNY {{ moneyFormat(p.originalB2CPrice, 0) }} /每票
CNY {{ moneyFormat(x.originalB2CPrice, 0) }} /每票
</span>
<q-input
style="width: 150px"
@input="changePeople"
v-model="chosenObj.Count"
v-model="x.Count"
class="col"
:class="{
'q-ml-sm q-px-none q-pl-none': $q.platform.is.desktop,
......@@ -56,7 +66,7 @@
class="q-px-none"
flat
icon="remove"
@click="addPeople('Count', -1)"
@click="addPeople(x,'Count', -1)"
/>
</template>
<template v-slot:append>
......@@ -66,14 +76,24 @@
class="q-px-none"
flat
icon="add"
@click="addPeople('Count', 1)"
@click="addPeople(x,'Count', 1)"
/>
</template>
</q-input>
</div>
</div>
</template>
<div v-if="MailingStateObj&&MailingStateObj.Id==1"
class="row items-end fz14 text-grey-6 f12 q-my-md q-pt-lg">
<span>取票地址</span>
<span class="text-primary q-ml-lg">{{dataList.SelffetchAddress}}</span>
</div>
</div>
<div class="q-mt-md q-pt-md" style="border-top: 1px dashed #eee">
<div class="row items-center fz12" v-if="MailingStateObj&&MailingStateObj.Id==2&&p&&p.MailingMoney>0">
<span class="text-subtitle2 text-grey-8 col">邮寄费</span>
<span class="text-primary q-ml-lg">{{p.MailingMoney}}</span>
</div>
<div class="row items-center">
<span class="text-subtitle2 text-grey-6 col">總金額</span>
<span class="text-h6 text-primary product-price">CNY {{ moneyFormat(sumPrice,0) }}</span>
......@@ -87,12 +107,12 @@
</span>
<span class="f12 text-negative"
:class="{'q-mr-lg':$q.platform.is.desktop}"
v-if="p.startDate&&!selectedObj">
{{`請選擇上面的門票類型`}}
v-if="p.startDate&&(!selectedObj||!MailingStateObj)">
{{`請選擇上面的門票類型、取票方式`}}
</span>
</span>
<q-btn color="primary" label="立即訂購" unelevated class="q-px-lg"
:disable="sumPrice==0||!selectedObj"
:disable="!p.startDate||sumPrice==0||!selectedObj||!MailingStateObj"
@click="goOrderHandler"/>
</div>
......@@ -108,9 +128,14 @@ export default {
price: {
handler(n, o) {
this.p = n;
if(n&&n.startDate){
this.chosenObj.startDate = n.startDate;
this.dataList.TicketList.forEach(x=>{
x.originalB2CPrice = 0
this.p.PriceList.forEach(y=>{
if(x.Id==y.TicketId){
x.originalB2CPrice=y.Price
}
})
})
this.calcMoney()
},
......@@ -120,7 +145,6 @@ export default {
dataList: {
handler(n, o) {
this.dataList = n;
},
deep: true,
immediate: true
......@@ -133,26 +157,30 @@ export default {
sumPrice:0,
selectedObj: null,
priceList: [],
takeList:[
{Name:'自行取票',Id:1},
{Name:'邮寄票券',Id:2},
],
MailingStateObj: null,
};
},
created() {
this.initModel();
if(this.p.startDate){
this.chosenObj.startDate = this.p.startDate;
this.calcMoney()
this.getCarPriceData2()
}
},
methods: {
goOrderHandler(){
let order = {
CouponsId: this.configId,
TicketId: this.selectedObj.Id,
MailingState: this.MailingStateObj.Id,
Month: this.Month,
startDate: this.p.startDate,
MailingMoney: this.p.MailingMoney,
originalB2CPrice: this.p.originalB2CPrice,
orderInfo: this.chosenObj,
sumPrice: this.sumPrice,
TicketList: this.dataList.TicketList
}
let key = this.$md5(JSON.stringify(order))
let pickuporderScenTickets = localStorage.getItem('pickuporderScenTickets')
......@@ -162,81 +190,28 @@ export default {
order
})
localStorage.setItem("pickuporderScenTickets",JSON.stringify(pickuporderScenTickets))
this.CommonJump('/PickuporderForm/'+key, {});
},
// 获取报价的详情
getCarPriceData2() {
this.priceList = []
this.apipost(
"b2c_get_GetTicketCouponsMonthPrice",
{
CouponsId: this.configId,
TicketId: this.selectedObj.Id,
Month: this.Month,
this.CommonJump('/ScenicSpotTicketOrderForm/'+key, {});
},
(r) => {
if (r.data.resultCode == 1) {
let arr = []
r.data.data.forEach(x=>{
if(x.Price){
if(this.chosenObj.startDate==x.Date){
this.p.originalB2CPrice = x.Price
}
let dataObj = {
startDate: x.Date,
originalB2CPrice: x.Price,
remainNum: 1,
Count: 1,
isSupportChildren: 1,
safeMoney: 0,
}
if(date.formatDate(Date.now(), 'YYYY-MM-DD')!=x.Date&&x.Date>date.formatDate(Date.now(), 'YYYY-MM-DD')){
arr.push(dataObj)
}
}
})
const temp= JSON.parse(JSON.stringify(r.data.data))
let PriceArr = temp.filter(x=>{ return x.Price>0 })
if(PriceArr.length>0){
this.$emit('getPriceList',JSON.stringify(arr),this.selectedObj.Id)
handleSelect(item,type){
if(type==2){
this.MailingStateObj = item
}else{
let dataObj = {
startDate: '',
originalB2CPrice: '',
remainNum: 0,
Count: 0,
safeMoney: 0,
PeopleNum: 1
}
this.priceList.push(dataObj)
this.$emit('getPriceList',JSON.stringify(this.priceList),this.selectedObj.Id)
this.p.originalB2CPrice = 0
this.resetHandler()
}
}
},null)
},
handleSelect(item){
item.checked = !item.checked
this.selectedObj = item
}
setTimeout(()=>{
this.getCarPriceData2()
this.calcMoney()
},100)
},
initModel() {
this.sumPrice=0
this.chosenObj = {
startDate: "",
Count: 1,
remark: "",
};
},
resetHandler(type) {
if(type){
resetHandler() {
this.selectedObj = null
}
this.MailingStateObj = null
this.dataList.TicketList.forEach(x=>{
x.checked = false
})
setTimeout(()=>{
this.p = {};
this.initModel()
......@@ -244,18 +219,28 @@ export default {
this.$emit("reset");
},
changePeople(val) {},
addPeople(m, i, isDf = false) {
this.chosenObj[m] = parseInt(this.chosenObj[m]) + i;
addPeople(item, m, i, isDf = false) {
let chosenObj = item
chosenObj[m] = parseInt(chosenObj[m]) + i;
if(m!='Count'){
this.chosenObj[m] = this.chosenObj[m] < 0 ? 0 : this.chosenObj[m]++;
chosenObj[m] = chosenObj[m] < 0 ? 0 : chosenObj[m]++;
}else{
this.chosenObj[m] = this.chosenObj[m] < 1 ? 1 : this.chosenObj[m]++;
chosenObj[m] = chosenObj[m] < 1 ? 1 :chosenObj[m]++;
}
this.calcMoney()
},
calcMoney() {
if (!this.p) return;
let money = this.p.originalB2CPrice * this.chosenObj.Count;
let money = 0
this.dataList.TicketList.forEach(x=>{
if(x.checked){
money+=x.originalB2CPrice*x.Count
}
})
if(this.MailingStateObj&&this.MailingStateObj.Id==2){
this.sumPrice = Number(money)+Number(this.p.MailingMoney)
return
}
this.sumPrice = money;
},
},
......
......@@ -29,7 +29,7 @@
class="col product-price text-subtitle1 text-weight-bold"
style="text-align: left"
>
<span v-if="priceList2&&priceList2.length">{{dataList.CurrencyCode}} {{ moneyFormat(priceList2[0].originalB2CPrice, 0) }}</span>
<span v-if="priceList&&priceList.length">{{dataList.CurrencyCode}} {{ moneyFormat(priceList[0].originalB2CPrice, 0) }}</span>
<span class="q-ml-sm f12 text-grey-7"></span>
</span>
<q-btn
......@@ -174,9 +174,9 @@
$q.platform.is.mobile,
}"
>
<div class="product-price text-h6" v-if="priceList2&&priceList2.length>0">
<div class="product-price text-h6" v-if="priceList&&priceList.length>0">
<!-- CNY:{{ dataList. }} -->
{{dataList.CurrencyCode?dataList.CurrencyCode:'CNY'}}{{ moneyFormat(priceList2[0].originalB2CPrice, 0) }}
{{dataList.CurrencyCode?dataList.CurrencyCode:'CNY'}}{{ moneyFormat(priceList[0].originalB2CPrice, 0) }}
<span class="f12 text-grey-6"></span>
</div>
<div v-else class="text-subtitle1 text-grey-6">暫無報價</div>
......@@ -318,7 +318,7 @@
<span class="product-price text-h6 q-mr-md"
>{{dataList.CurrencyCode?dataList.CurrencyCode:'CNY'}}
{{
moneyFormat(priceList2[0].originalB2CPrice, 0)
moneyFormat(priceList[0].originalB2CPrice, 0)
}}</span
>
<q-btn
......@@ -330,7 +330,7 @@
/>
</div>
<div class="text-info q-mt-md text-right">
最早可預訂日期:{{ priceList2[0].startDate }}
最早可預訂日期:{{ priceList[0].startDate }}
</div>
</div>
</div>
......@@ -562,7 +562,6 @@ export default {
data() {
return {
AddressObj: null,
priceList2: [],
priceList: [],
selectedId: '',
currentYM: { year: 2023, month: 2, str: "2023-02" }, // 当前年月
......@@ -713,7 +712,6 @@ export default {
this.TripConfig = JSON.parse(window.localStorage.getItem("baseifo"));
}
window.addEventListener("scroll", this.menu);
window.addEventListener("scroll", this.menu);
this.getData();
},
methods: {
......@@ -722,6 +720,9 @@ export default {
if(!this.showOrderPreview){
this.changeTripShowHandler()
}
this.dataList.TicketList.forEach(x=>{
x.checked = false
})
},
changeTripShowHandler() {
this.$nextTick(() => {
......@@ -815,6 +816,7 @@ export default {
},
resetHandler() {
this.currentPrice.startDate = "";
if(!this.$q.platform.is.mobile){
this.$refs.calendar.reset();
}
......@@ -841,14 +843,18 @@ export default {
{ CouponsId: this.msg.configId },
(r) => {
if (r.data.resultCode == 1) {
let addList = function (arr) {
arr.forEach(item => {
item.checked = false
item.Count = 1
});
};
addList(r.data.data.TicketList);
this.dataList = r.data.data;
this.selectedId = this.dataList.TicketList.find(x=>x.Id)
this.dataList.imgCover = this.dataList.PicPathList;
this.AddressObj = this.dataList
this.AddressObj.Address = `${this.dataList.CountryName}-${this.dataList.CityName}-${this.dataList.ProvinceName}-${this.dataList.Address}`
// {
// Address:`${this.dataList.CountryName}-${this.dataList.CityName}-${this.dataList.Address}`
// }
this.isShow = true;
if (this.dataList.videoStr && this.dataList.videoStr != "") {
this.options.loop = false;
......@@ -864,7 +870,7 @@ export default {
});
}
this.$nextTick(() => {
this.getCarPriceData2()
this.getCarPriceData()
setTimeout(() => {
this.navs.forEach((x) => {
x.top =
......@@ -900,36 +906,34 @@ export default {
);
},
// 获取报价的详情
getCarPriceData2() {
getCarPriceData() {
this.priceList = []
this.apipost(
"b2c_get_GetTicketCouponsMonthPrice",
"b2c_get_GetTicketCouponsMonthPriceAll",
{
CouponsId: this.msg.configId,
TicketId: this.dataList.TicketList[1].Id,
// TicketId: this.dataList.TicketList[0].Id,
Month: this.currentYM.str,
},
(r) => {
if (r.data.resultCode == 1) {
let arr = []
r.data.data.forEach(x=>{
if(x.Price){
x.PriceList = x.PriceList.sort((a,b)=>{return a.Price-b.Price})
let dataObj = {
startDate: x.Date,
originalB2CPrice: x.Price,
originalB2CPrice: x.PriceList[0].Price,
remainNum: 1,
Count: 1,
safeMoney: 0,
PeopleNum: 1
MailingMoney: x.PriceList[0].MailingMoney,
PriceList: x.PriceList,
}
if(date.formatDate(Date.now(), 'YYYY-MM-DD')!=x.Date&&x.Date>date.formatDate(Date.now(), 'YYYY-MM-DD')){
arr.push(dataObj)
}
}
})
this.priceList = JSON.parse(JSON.stringify(arr))
this.priceList2 = JSON.parse(JSON.stringify(arr))
}
},null)
......
......@@ -91,7 +91,7 @@
/>
<q-img
v-else
:src="details?details.ImageList[0]:'https://image.kkday.com/v2/image/get/s1.kkday.com/product_138437/20230217083232_t5rcO/jpg'"
:src="details?details.PicPathList[0]:'https://image.kkday.com/v2/image/get/s1.kkday.com/product_138437/20230217083232_t5rcO/jpg'"
class="rounded-borders"
spinner-color="grey-3"
style="width: 80px"
......@@ -101,7 +101,7 @@
{{details.Name}}
</div>
<div class="text-caption text-grey-6 ellipsis q-mt-sm">
{{details.Description}}
{{details.Feature}}
</div>
</div>
</div>
......@@ -110,23 +110,25 @@
<q-icon name="iconfont iconrili" size="20px" class="q-mr-sm" />
<span>{{OrderDate.startDate}}</span>
</div>
<div class="text-grey-9 q-ml-md" v-if="chosenObj.Count > 0&&CarObj">
<q-icon name="iconfont iconjiaotong" size="20px" class="q-mr-sm" />
<span class="q-mr-sm"
>{{CarObj.CarName}} x {{ chosenObj.Count }} </span
<div class="text-grey-9 q-ml-md" v-if="optionObj">
<q-icon name="iconfont iconpeople" size="20px" class="q-mr-sm" />
<span class="q-mr-sm" v-for="(x,i) in optionObj" :key="i"
>{{x.TicketName}} x {{ x.Count }} </span
>
<span class="q-mr-sm"
>({{CarObj.PeopleNum}}人/辆)</span
></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`}}
行程時間 1 天
</span>
</template>
</div>
</div>
<div v-if="parameters.MailingState==1" class="rounded-borders bg-blue-1 q-px-lg q-py-sm q-mt-sm">
自取地址:{{parameters.SelffetchAddress}}
</div>
<q-separator color="grey-2" class="q-mt-md" />
<div
class="bg-grey-1 rounded-borders q-pa-md q-mt-md guest-item"
>
......@@ -135,35 +137,24 @@
<div :class="filedGuestWidth">
<q-input
standout
v-model="parameters.SurName"
label="本國姓"
placeholder="例:張"
:rules="[(val) => !!val || '請輸本國姓']"
v-model="parameters.Name"
label="本國姓"
placeholder="例:張"
:rules="[(val) => !!val || '請輸本國姓']"
ref="SurName"
/>
</div>
<div :class="filedGuestWidth">
<q-input
standout
v-model="parameters.Name"
label="本國"
placeholder="例:"
:rules="[(val) => !!val || '請輸本國']"
v-model="parameters.EName"
label="本國姓名(英文)"
placeholder="例:zhangsan"
:rules="[(val) => !!val || '請輸本國姓名(英文)']"
ref="Name"
/>
</div>
<div :class="filedGuestWidth">
<q-input
standout
v-model="parameters.ContactWay"
label="联络方式"
placeholder="例:WeChat"
:rules="[(val) => !!val || '請輸联络方式']"
ref="ContactWay"
mask="X"
reverse-fill-mask
>
</q-input>
/>
</div>
<div :class="filedGuestWidth">
<q-input
......@@ -195,230 +186,6 @@
</div>
</div>
</div>
<template v-if="details.CarType!=3">
<div class="text-subtitle1 text-weight-bolder q-my-md">{{details.CarType==1?'抵達':'起飛'}} 班机資料</div>
<q-separator color="grey-2" class="q-mt-md" />
<div
class="bg-grey-1 rounded-borders q-pa-md q-mt-md guest-item"
>
<div class="text-subtitle1 q-pb-md text-weight-bold"></div>
<div class="row q-col-gutter-md">
<div :class="filedGuestWidth">
<q-input
standout
v-model="parameters.AirportTerminal"
label="航廈"
placeholder="例:航廈"
:rules="[(val) => !!val || '請輸航廈']"
ref="AirportTerminal"
readonly>
<q-popup-proxy :offset="[0, 10]" ref="qDateProxy7">
<q-input type="textarea" dense standout autofocus
v-model="parameters.AirportTerminal" placeholder="請輸航廈" />
</q-popup-proxy>
</q-input>
</div>
<div :class="filedGuestWidth">
<q-input
standout
v-model="parameters.AirLine"
label="航空公司"
placeholder=""
:rules="[(val) => !!val || '請輸航空公司名稱']"
ref="AirLine"
readonly>
<q-popup-proxy :offset="[0, 10]" ref="qDateProxy8">
<q-input type="textarea" dense standout autofocus
v-model="parameters.AirLine" placeholder="請輸航空公司名稱" />
</q-popup-proxy>
</q-input>
</div>
<div :class="filedGuestWidth">
<q-input
standout
v-model="parameters.FlightNumber"
label="航班編號"
placeholder="例:CA123"
:rules="[(val) => !!val || '請輸航班編號']"
ref="FlightNumber"
mask="X"
reverse-fill-mask
/>
</div>
<div :class="filedGuestWidth">
<q-input
class="q-pb-md"
standout
:value="!flightTime?'':parameters.FlightTime"
:label="`航班${details.CarType==1?'抵達':'起飛'}時間`"
:rules="[(val) => !!val || `請选航班${details.CarType==1?'抵達':'起飛'}時間`]"
ref="FlightTime"
>
<template v-slot:append>
<q-icon name="event" class="cursor-pointer"></q-icon>
</template>
<q-popup-proxy :offset="[0, 0]" ref="qDateProxy1">
<div class="row">
<!-- <q-date
mask="YYYY-MM-DD HH:mm"
:title="$t('search_date_begin')"
subtitle="選擇"
v-model="parameters.FlightTime"
:options="optionsFn"
/>
<div class="q-px-sm"></div> -->
<q-time format24h v-model="flightTime" mask="HH:mm"
@input="getTime(1)"/>
</div>
</q-popup-proxy>
</q-input>
</div>
</div>
</div>
</template>
<div class="text-subtitle1 text-weight-bolder q-my-md">
{{details.CarType==1?'接机':details.CarType==2?'送机':'包车'}}資料
</div>
<q-separator color="grey-2" class="q-mt-md" />
<div
class="bg-grey-1 rounded-borders q-pa-md q-mt-md guest-item"
>
<div class="text-subtitle1 q-pb-md text-weight-bold"></div>
<div class="row q-col-gutter-md">
<div :class="filedGuestWidth">
<q-input
standout
v-model="!getBusTime?'':parameters.OrderDate"
label="接駁日期"
:rules="[(val) => !!val || '請选接駁日期']"
ref="OrderDate"
>
<template v-slot:append>
<q-icon name="event" class="cursor-pointer"></q-icon>
</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>
</q-popup-proxy>
</q-input>
</div>
<div :class="filedGuestWidth" v-if="details.CarType!=1">
<q-input
standout
v-model="parameters.GetonAddress"
label="上車地點"
placeholder=""
:rules="[(val) => !!val || '請輸上車地點供司機參考']"
ref="GetonAddress"
readonly>
<template v-slot:append>
<!-- <q-icon name="iconfont iconaddress" size="20px" class="q-mr-sm" @click="getAddress(1)"/> -->
</template>
<q-popup-proxy :offset="[0, 10]" ref="qDateProxy5">
<q-input type="textarea" dense standout autofocus
v-model="parameters.GetonAddress" placeholder="請輸上車地點供司機參考" />
</q-popup-proxy>
</q-input>
</div>
<div :class="filedGuestWidth" v-if="details.CarType!=2">
<q-input
standout
v-model="parameters.GetoffAddress"
label="下車地點"
placeholder=""
:rules="[(val) => !!val || '請輸下車地點供司機參考']"
ref="GetoffAddress"
readonly>
<template v-slot:append>
<!-- <q-icon name="iconfont iconaddress" size="20px" class="q-mr-sm" @click="getAddress(2)"/> -->
</template>
<q-popup-proxy :offset="[0, 10]" ref="qDateProxy6">
<q-input type="textarea" dense standout autofocus
v-model="parameters.GetoffAddress" placeholder="請輸下車地點供司機參考" />
</q-popup-proxy>
</q-input>
</div>
</div>
</div>
<div class="text-subtitle1 text-weight-bolder q-my-md">乘客資料</div>
<q-separator color="grey-2" class="q-mt-md" />
<div
class="bg-grey-1 rounded-borders q-pa-md q-mt-md guest-item"
>
<div class="text-subtitle1 q-pb-md text-weight-bold">乘客数量</div>
<div class="row q-col-gutter-md">
<div :class="filedGuestWidth">
<q-input
standout
v-model="parameters.ManNum"
label="成人數(18-99岁)"
@input="getNum"
:rules="[(val) => !!val || '請輸成人數']"
ref="ManNum"
mask="#"
reverse-fill-mask
/>
</div>
<div :class="filedGuestWidth">
<q-input
standout
v-model="parameters.ChildNum"
label="兒童數(3-17岁)"
@input="getNum"
mask="#"
reverse-fill-mask
/>
</div>
<div :class="filedGuestWidth">
<q-input
standout
v-model="parameters.BabyNum"
label="嬰幼兒數(0-2岁)"
@input="getNum"
mask="#"
reverse-fill-mask
/>
</div>
</div>
<template v-if="details.CarType!=3">
<div class="text-subtitle1 q-py-md text-weight-bold">行李数量</div>
<div class="row q-col-gutter-md">
<div :class="filedGuestWidth">
<q-input
standout
v-model="parameters.HandLuggageNum"
label="手提行李"
mask="#"
reverse-fill-mask
/>
</div>
<div :class="filedGuestWidth">
<q-input
standout
v-model="parameters.RegisteredLuggageNum"
label="托运行李"
mask="#"
reverse-fill-mask
/>
</div>
</div>
</template>
</div>
<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>
......@@ -464,7 +231,7 @@
/>
<q-img
v-else
:src="details?details.ImageList[0]:'https://image.kkday.com/v2/image/get/s1.kkday.com/product_138437/20230217083232_t5rcO/jpg'"
:src="details?details.PicPathList[0]:'https://image.kkday.com/v2/image/get/s1.kkday.com/product_138437/20230217083232_t5rcO/jpg'"
class="rounded-borders"
spinner-color="grey-3"
style="width: 80px"
......@@ -474,7 +241,7 @@
{{details.Name}}
</div>
<div class="text-caption text-grey-6 ellipsis q-mt-sm">
{{details.Description}}
{{details.Feature}}
</div>
</div>
</div>
......@@ -497,26 +264,28 @@
</div>
<div class="row">
<div style="width: 80px">
<!-- 出發日期: -->
接駁日期:</div>
门票日期:</div>
<div class="q-ml-md">
{{parameters.OrderDate}}
{{parameters.UseDate}}
</div>
</div>
</div>
<q-separator color="grey-2" class="q-my-md"/>
<div class="text-grey-9">
<div class="row q-mb-sm" v-if="chosenObj.Count>0&&CarObj">
<div class="col">{{CarObj.CarName}} x {{ chosenObj.Count }}</div>
<div>{{details.CurrencyCode}} {{ moneyFormat(OrderDate.originalB2CPrice,2) }}</div>
</div>
<!-- <hr style="border:none;border-top:1px dashed #EEE !important;" class="bg-transparent q-mb-sm" />
<div class="row q-mb-sm items-center" v-if="(chosenObj.Count)>0">
<div class="col">總金額</div>
<div class="text-subtitle2 text-weight-bolder text-primary">{{details.CurrencyCode}} {{ moneyFormat(OrderDate.sumPrice,2) }}</div>
</div> -->
<template v-if="optionObj">
<div class="row q-mb-sm" v-for="(x,i) in optionObj" :key="i">
<template v-if="x.checked">
<div class="col">{{x.TicketName}} x {{ x.Count }}</div>
<div>{{ moneyFormat(x.originalB2CPrice,2) }}</div>
</template>
</div>
</template>
<div class="row q-mb-sm" v-if="parameters.MailingState==2&&parameters.MailingMoney>0">
<div class="col text-grey-6">邮寄费</div>
<div class="text-red">{{ moneyFormat(parameters.MailingMoney,2) }}</div>
</div>
<hr style="border:none;border-top:1px dashed #EEE !important;" class="bg-transparent q-mb-sm" />
<div class="row q-mb-sm items-center" v-if="chosenObj.Count>0">
<div class="row q-mb-sm items-center">
<div class="col">支付金額</div>
<div class="text-h6 text-weight-bolder text-primary product-price">{{details.CurrencyCode}} {{ moneyFormat(OrderDate.sumPrice,2) }}</div>
</div>
......@@ -539,7 +308,7 @@
</div>
<q-separator />
<div style="max-height: 600px;padding:20px 0" class="scroll">
<componentsMap :AddressObj="onCarObj"/>
<componentsMap :AddressObj="onoptionObj"/>
</div>
</q-card>
</q-dialog>
......@@ -574,9 +343,9 @@
orderKey: "",
isShowDialog: false,
AddressObj: null,
onCarObj: null,//上车范围
unCarObj: null,//下车范围
CarObj: null,//车型
onoptionObj: null,//上车范围
unoptionObj: null,//下车范围
optionObj: null,//车型
AirportObj: null,//机场
details: null,//产品详情
options: {//音频控件
......@@ -603,31 +372,20 @@
loading: false,
parameters: {
OrderId: 0,
OrderType: 0,
OrderDate:'',//预定日期
Unit_Price: '',//单价
Num: '',//数量
Money: 0.0,
Sex: 1,//1男2女
SurName: '',//姓
Name: '',//名
Remark: '',
AirportId: '',
AirportTerminal: '',//航厦
AirLine: '',//航空公司名称
FlightNumber: '',//航班号
FlightTime: '',//航班时间
GetonAddress: '',//上车点
GetoffAddress: '',//下车点
ManNum: null,//成人数
ChildNum: null,//儿童数
BabyNum: null,//婴儿数
HandLuggageNum: null,//手提行李数量
RegisteredLuggageNum: null,//托运行李数量
ContactWay: '',//联络方式 WeChat
Mobile:'',//电话
ProductId: '',
CarId: '',//产品类型ID
MailingState: '',//邮寄状态 1自取 2邮寄
MailingAddress: '',//MailingState =2 填写邮寄
MailingMoney: null,
SelffetchAddress: '',//自取地址
UseDate:'',//门票日期
Name:'',
EName:'',
Sex: 1,//1男2女
Birthday: '',
Mobile:'',
CouponsId:'',//景点id
DetailList:[],
OrderSource: 1,//类型 0 来源B2B 1 来源B2C
},
flightTime: null,//航班起飞抵达时间
......@@ -654,7 +412,7 @@
created() {},
mounted() {
if(this.checkParamsHandler()){
this.getCarData()
this.getData()
}
this.initGuestHandler();
......@@ -662,24 +420,21 @@
},
methods: {
// 获取商品详情
getCarData() {
getData() {
this.$q.loading.show();
this.apipost(
"b2c_get_GetCarSingleProductDetail",
{ ProductId: this.parameters.ProductId },
"b2c_get_GetTicketCouponsDetail",
{ CouponsId: this.parameters.CouponsId },
(r) => {
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.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
this.parameters.FlightTime = this.OrderDate.startDate
if(this.parameters.MailingState==1){
this.parameters.SelffetchAddress = this.details.SelffetchAddress
this.parameters.MailingMoney = null
}else{
this.parameters.MailingMoney = this.OrderDate.MailingMoney
this.parameters.SelffetchAddress = ''
}
this.parameters.CarId = this.OrderDate.CarId
this.parameters.OrderType = this.details.CarType
} else {
this.$q.notify({
type: "negative",
......@@ -704,13 +459,25 @@
if (this.order) {
this.orderKey = key;
this.OrderDate = this.order.order
this.chosenObj = this.OrderDate.orderInfo;
this.parameters.ProductId = this.order.order.Id
this.parameters.OrderDate = this.OrderDate.startDate
this.parameters.CouponsId = this.order.order.CouponsId
this.parameters.MailingState = this.OrderDate.MailingState
this.parameters.UseDate = 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.optionObj = this.OrderDate.TicketList
this.parameters.DetailList = []
this.optionObj.forEach(x=>{
if(x.checked){
let y = {
TicketName: x.TicketName,
Unit_Price: x.originalB2CPrice,
Num: x.Count,
Money: x.originalB2CPrice*x.Count,
TicketId: x.Id
}
this.parameters.DetailList.push(y)
}
})
}
}
}
......@@ -729,25 +496,8 @@
this.$refs.SurName.validate()
this.$refs.Name.validate()
this.$refs.ContactWay.validate()
this.$refs.Mobile.validate()
this.$refs.OrderDate.validate()
this.$refs.ManNum.validate()
if(this.details.CarType!=3){
this.$refs.AirportTerminal.validate()
this.$refs.AirLine.validate()
this.$refs.FlightNumber.validate()
this.$refs.FlightTime.validate()
if(this.details.CarType!=1){
this.$refs.GetonAddress.validate()
}else{
this.$refs.GetoffAddress.validate()
}
}else{
this.$refs.GetonAddress.validate()
this.$refs.GetoffAddress.validate()
}
console.log(this.parameters,'----')
let flag = true
flag = await this.formValidateHandler('baseUserInfo')
if(!flag){
......@@ -765,7 +515,7 @@
SetCarOrder(){
this.loading = true
this.apipost(
"CarSingle_post_SetTYCarOrder",
"ticket_post_SetTicketOrder",
this.parameters,
(r) => {
// this.$refs.myform.resetValidation()
......@@ -792,15 +542,15 @@
this.apipost(
"AddOrderInfo_post",
{
SurName: this.parameters.SurName,
Name: this.parameters.Name,
SurName: this.parameters.Name,
Name: '',
ContactNumber: this.parameters.Mobile,// 联系电话
Mailbox: this.userInfo.Mailbox,//邮箱
GoodsId: this.parameters.ProductId,//商品id
GoodsId: this.parameters.CouponsId,//商品id
GoodsName: this.details.Name,//商品名称
GoodsPic: this.details.ImageList[0],//商品图片
GoodsType: GoodsType,//商品类型(见枚举) 12包车 13 接机 14送机
OrderMake: this.parameters.OrderDate,//订单摘要(例如出行时间)
GoodsPic: this.details.PicPathList[0],//商品图片
GoodsType: 4,
OrderMake: this.parameters.UseDate,//订单摘要(例如出行时间)
TotalPrice: this.parameters.Money,//总价格
PreferentialPrice: 0,// 优惠总金额
ErpOrderId: ErpOrderId,//erp订单id
......@@ -846,10 +596,10 @@
this.parameters.FlightTime = this.OrderDate.startDate+' '+this.flightTime
this.$refs.qDateProxy1.hide()
}else if(type==2){
this.parameters.OrderDate = this.OrderDate.startDate+' '+this.getBusTime
this.parameters.UseDate = this.OrderDate.startDate+' '+this.getBusTime
this.$refs.qDateProxy2.hide()
}else if(type==3){
this.parameters.OrderDate = this.OrderDate.startDate+' '+this.getBusTime
this.parameters.UseDate = this.OrderDate.startDate+' '+this.getBusTime
}
},
......@@ -862,9 +612,9 @@
// 地图上选址
getAddress(type){
if(type==1){
this.AddressObj = this.onCarObj
this.AddressObj = this.onoptionObj
}else{
this.AddressObj = this.unCarObj
this.AddressObj = this.unoptionObj
}
this.isShowDialog = true
},
......
......@@ -773,10 +773,7 @@ export default {
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(){
......
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