Commit d9875797 authored by youjie's avatar youjie

优化车产品详情

parent f6cbbaa5
......@@ -14,8 +14,8 @@
<div class="text-grey-6 f12 q-my-md">選擇機場</div>
<div class="row wrap">
<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'"
<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>
......@@ -25,8 +25,8 @@
<div class="text-grey-6 f12 q-my-md">選擇上車範圍</div>
<div class="row wrap">
<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'"
<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>
......@@ -35,20 +35,20 @@
<div class="text-grey-6 f12 q-my-md">選擇下車範圍</div>
<div class="row wrap">
<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'"
<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> -->
<template v-if="TicketIds&&TicketIds.length>0">
<div class="text-grey-6 f12 q-my-md">選擇車類型</div>
<div class="row wrap">
<div v-for="(x,i) in dataList.CarTypeList" :key="i">
<q-chip v-if="TicketIds.indexOf(x.Id)!=-1" size="14px" clickable @click="handleSelect(x,2)"
:text-color="selectedCarObj&&selectedCarObj.Id==x.Id?'white':'dark'"
<q-chip v-if="TicketIds.indexOf(x.Id)!=-1" 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>
......@@ -116,23 +116,23 @@
<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"
<span class="f12 text-negative" v-if="!p.startDate"
:class="{'q-mr-lg':$q.platform.is.desktop}">
{{$q.platform.is.mobile?'請選擇上面的出行日期':'請選擇左側的出行日期'}}
{{$q.platform.is.mobile?'請選擇上面的出行日期':'請選擇左側的出行日期'}}
</span>
<span class="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)
||(p.startDate&&dataList.CarType==2&&!selectedAirportObj)" >
{{`請選擇上面的${dataList.CarType==3?'車類型':dataList.CarType==1?'機場、車類型':'機場、車類型'}`}}
{{`請選擇上面的${dataList.CarType==3?'車類型':dataList.CarType==1?'機場、車類型':'機場、車類型'}`}}
</span>
</span>
<q-btn color="primary" label="立即訂購" unelevated class="q-px-lg"
<q-btn color="primary" label="立即訂購" unelevated class="q-px-lg"
:disable="sumPrice==0||!selectedCarObj
||(dataList.CarType!=3&&!selectedAirportObj)"
@click="goOrderHandler"/>
</div>
</div>
</div>
......@@ -154,7 +154,7 @@ export default {
}
}
this.calcMoney()
},
deep: true,
immediate: false
......@@ -162,7 +162,7 @@ export default {
dataList: {
handler(n, o) {
this.dataList = n;
this.handleSelect(n.AirportList[0],1)
},
deep: true,
immediate: true
......@@ -226,8 +226,8 @@ export default {
this.priceList = []
this.apipost(
"b2c_get_GetCarSingleProductMonthPrice",
{
ProductId: this.configId,
{
ProductId: this.configId,
Month: this.Month,
AirportId: '',
CarTypeId: this.selectedCarObj.Id
......@@ -272,16 +272,16 @@ export default {
this.resetHandler()
}
}
},null)
},
getCarPriceData() {
this.priceList = []
this.apipost(
"b2c_get_GetCarSingleProductMonthPriceAll",
{
ProductId: this.configId,
{
ProductId: this.configId,
Month: this.Month,
// AirportId: '',
// CarTypeId: this.selectedCarObj.Id
......@@ -290,7 +290,7 @@ export default {
if (r.data.resultCode == 1) {
this.dataAll = r.data.data
}
},null)
},
handleSelectAirport(item){
......@@ -307,7 +307,7 @@ export default {
}else if(type==4){
this.unCarObj = item
}
},
initModel() {
this.sumPrice=0
......
......@@ -132,6 +132,7 @@ export default {
let current = this.months.findIndex((x) => x.monthValue == firstMonth)
this.currentMonth = current>-1?current:0;
this.changeMonthHandler();
},
createChosenDateHandler() {
let beginDate = new Date();
......@@ -174,6 +175,15 @@ export default {
price,
});
newBeginDate = date.addToDate(newBeginDate, { days: 1 });
// 默认日期 价格
let InitialOption = false
for(let i=0;i<this.col.length;i++){
if (!InitialOption&&this.col[i].price && this.col[i].price.remainNum>0) {
this.currentDate = this.col[i].value;
this.$emit("change", this.col[i]);
InitialOption = true
}
}
}
let after = 6 - date.formatDate(newBeginDate, "d");
for (let i = 0; i < after; i++) {
......
<template>
<div style="min-height: 80vh">
<div
style="
position: fixed;
......@@ -139,10 +139,10 @@
icon="iconfont iconOwner-1"
label=" 直營產品"
/>
<q-chip
v-if="dataList.TravelHours>0" class="transparent q-mr-xl no-padding"
<q-chip
v-if="dataList.TravelHours>0" class="transparent q-mr-xl no-padding"
square
icon="iconfont icontime"
icon="iconfont icontime"
:label="`包車時長:${dataList.TravelHours} h`" />
<q-chip
class="transparent q-mr-xl no-padding"
......@@ -171,7 +171,7 @@
color="primary"
label="選擇方案"
unelevated
@click="goScrollHandler(priceListHeight)"
:class="{ 'q-mt-md full-width': $q.platform.is.desktop }"
/>
......@@ -253,7 +253,7 @@
@getPriceList="getPriceList"
ref="orderPreview"
></order-preview>
</div>
<!--方案选择区 -->
<div class="text-h6 q-pt-lg" v-if="$q.platform.is.mobile">
......@@ -356,7 +356,7 @@
</div>
</div>
</div>
</div>
</div>
......@@ -418,7 +418,7 @@
'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"
......@@ -432,8 +432,8 @@
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 || '暂无购买须知'
dataList.BuyNotes
? dataList.BuyNotes || '暂无购买须知'
: '暂无购买须知'
"
:class="{
......@@ -548,7 +548,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">
......@@ -645,7 +645,7 @@ export default {
"由於交通擁堵,時長可能會略有變化",
"每增加 30 分鐘,將收取相應的延期費。 (現場支付)",
],
showOrderPreview: false,
showOrderPreview: true,
videoPosition: 0,
currentHeight: 0,
isPictureInPicture: false,
......@@ -818,7 +818,7 @@ export default {
window.removeEventListener("scroll", this.handleScroll);
}
},
getScroll() {
return {
left:
......@@ -949,7 +949,7 @@ export default {
// console.log('异常信息', error)
}
});
} else {
this.$message.error(r.data.message)
}
......@@ -965,11 +965,11 @@ export default {
this.currentYM.str = time
this.$refs.orderPreview.resetHandler()
}
this.apipost(
"b2c_get_GetCarSingleProductMonthPrice",
{
ProductId: this.msg.configId,
{
ProductId: this.msg.configId,
Month: this.currentYM.str,
AirportId: '',
CarTypeId: this.selectedCar
......@@ -1006,9 +1006,9 @@ export default {
this.priceList = []
this.priceList = JSON.parse(JSON.stringify(arr))
}
}
},null)
},
menu() {
......@@ -1191,4 +1191,4 @@ export default {
margin: 20px 0;
border-radius: 10px;
}
</style>
\ No newline at end of file
</style>
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