Commit 61ee8d43 authored by 罗超's avatar 罗超

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

# Conflicts:
#	src/pages/city/cityDetail.vue
#	src/pages/detailsNew.vue
parents 4ec7134c 57a1e419
<template>
<div class="column full-height">
<div class="col">
<div class="text-right">
<q-btn
color="primary"
icon="refresh"
label="全部重選"
@click="resetHandler"
flat
/>
</div>
<div class="text-grey-6 f12 q-my-md">選擇類型</div>
<div class="row wrap">
<q-btn @click="handleSelect(item)"
:color="item.Id === selectedCar?'primary':'grey-5'"
unelevated
class="car-tag mr"
v-for="item in CarTypeList"
:key="item.Id"
>
{{ item.CarName }}({{ item.PeopleNum }}人)
</q-btn>
</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.CarName}}</span>
<span class="text-grey-6 f12 q-ml-sm"></span>({{ selectedObj.PeopleNum }}人)</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) }} /每辆
</span>
</div>
</div>
<div class="row items-end">
<span v-if="$q.platform.is.desktop" class="text-grey-7 product-price" style="font-size: 13px">
CNY {{ moneyFormat(p.originalB2CPrice, 0) }} /每辆
</span>
<q-input
style="width: 150px"
@input="changePeople"
v-model="chosenObj.Count"
class="col"
:class="{
'q-ml-sm q-px-none q-pl-none': $q.platform.is.desktop,
}"
mask="#"
reverse-fill-mask
dense
standout
readonly
>
<template v-slot:prepend>
<q-btn
color="primary"
size="sm"
class="q-px-none"
flat
icon="remove"
@click="addPeople('Count', -1)"
/>
</template>
<template v-slot:append>
<q-btn
color="primary"
size="sm"
class="q-px-none"
flat
icon="add"
@click="addPeople('Count', 1)"
/>
</template>
</q-input>
</div>
</div>
<div class="text-grey-6 f12 q-mt-mb" v-if="p.isSupportChildren == 2">
本團只支持成人出遊
</div>
<div
v-if="p.safeMoney > 0"
class="q-pt-md q-mt-md row items-center"
style="border-top: 1px dashed #eee"
>
<div class="text-grey-6 f12 col">保險服務費</div>
<div class="product-money f12">CNY {{ p.safeMoney }}/每人</div>
</div>
</div>
<div class="q-mt-md q-pt-md" style="border-top: 1px dashed #eee">
<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>
</div>
<div class="q-mt-md text-right">
<span class="q-mr-lg f12 text-negative" v-if="!p.startDate" >{{$q.platform.is.mobile?'請選擇上面的出行日期':'請選擇左側的出行日期'}} </span>
<q-btn color="primary" label="立即訂購" unelevated class="q-px-lg" :disable="sumPrice==0"/>
</div>
</div>
</div>
</template>
<script>
export default {
props: ["price","CarTypeList","configId","Month"],
watch: {
price: {
handler(n, o) {
this.p = n;
console.log(n,'-----')
this.chosenObj.startDate = n.startDate;
this.calcMoney()
},
deep: true,
immediate: true
},
CarTypeList: {
handler(n, o) {
this.CarTypeList = n;
this.selectedCar = this.CarTypeList[0].Id
},
deep: true,
immediate: true
},
},
data() {
return {
p: {},
chosenObj: null,
sumPrice:0,
selectedObj: null,
priceList: [],
selectedCar: 0
};
},
created() {
this.initModel();
if(this.p.startDate){
this.chosenObj.startDate = this.p.startDate;
this.calcMoney()
this.getCarPriceData2()
this.selectedCar = this.CarTypeList[0].Id
}
},
methods: {
// 获取车的详情
getCarPriceData2() {
this.priceList = []
this.apipost(
"b2c_get_GetCarSingleProductMonthPrice",
{
ProductId: this.configId,
Month: this.Month,
AirportId: '',
CarTypeId: this.selectedCar
},
(r) => {
if (r.data.resultCode == 1) {
r.data.data.forEach(x=>{
x.startDate = x.Date
x.originalB2CPrice = x.Price
x.remainNum =1
x.Count = 1
x.isSupportChildren = 1
x.safeMoney = 0
this.p.originalB2CPrice = x.Price
})
this.$emit('getPriceList',JSON.stringify(r.data.data),this.selectedCar)
}
},null)
},
handleSelect(item){
this.selectedObj = item
this.selectedCar = item.Id
this.getCarPriceData2()
},
initModel() {
this.sumPrice=0
this.chosenObj = {
startDate: "",
Count: 1,
remark: "",
};
},
resetHandler() {
this.p = {};
this.initModel()
this.$emit("reset");
},
changePeople(val) {},
addPeople(m, i, isDf = false) {
this.chosenObj[m] = parseInt(this.chosenObj[m]) + i;
if(m!='Count'){
this.chosenObj[m] = this.chosenObj[m] < 0 ? 0 : this.chosenObj[m]++;
}else{
this.chosenObj[m] = this.chosenObj[m] < 1 ? 1 : this.chosenObj[m]++;
}
this.calcMoney()
},
calcMoney() {
if (!this.p) return;
let money = this.p.originalB2CPrice * this.chosenObj.Count;
this.sumPrice = money;
},
},
};
</script>
<style></style>
<style scoped>
.icon-size {
font-size: 20px;
}
.number {
width: 60px;
text-align: center;
}
</style>
<template>
<div>
<q-input
style="width: 150px"
@input="changePeople"
v-model="value"
class="col"
:class="{
'q-ml-sm q-px-none q-pl-none': $q.platform.is.desktop,
}"
mask="#"
reverse-fill-mask
dense
standout
readonly
>
<template v-slot:prepend>
<q-btn
color="primary"
size="sm"
class="q-px-none"
flat
icon="remove"
@click="minusClick"
/>
</template>
<template v-slot:append>
<q-btn
color="primary"
size="sm"
class="q-px-none"
flat
icon="add"
@click="plusClick"
/>
</template>
</q-input>
</div>
</template>
<script>
export default {
props: {
min: {
default: undefined,
},
max: {
default: undefined,
},
defaultValue: {
require: true,
default: 0,
},
step: {
default: 1,
},
},
data() {
return {
value: this.defaultValue
}
},
methods: {
minusClick() {
if(this.min === undefined || this.value > this.min) {
this.value-= this.step
this.$emit('input', this.value)
}
},
plusClick() {
if(this.max === undefined || this.value < this.max) {
this.value+= this.step
this.$emit('input', this.value)
}
},
changePeople(val) {
this.value+= val
this.$emit('input', this.value)
},
},
}
</script>
\ No newline at end of file
...@@ -108,7 +108,7 @@ export default { ...@@ -108,7 +108,7 @@ export default {
}, },
watch: { watch: {
priceList: { priceList: {
handler(oldValue, newVal) { handler(newVal, oldValue) {
this.prices = newVal; this.prices = newVal;
this.init(); this.init();
}, },
...@@ -126,8 +126,8 @@ export default { ...@@ -126,8 +126,8 @@ export default {
new Date(this.prices[0].startDate), new Date(this.prices[0].startDate),
"YYYY/MM" "YYYY/MM"
); );
this.currentMonth = let current = this.months.findIndex((x) => x.monthValue == firstMonth)
this.months.findIndex((x) => x.monthValue == firstMonth) ?? 0; this.currentMonth = current>-1?current:0;
this.changeMonthHandler(); this.changeMonthHandler();
}, },
createChosenDateHandler() { createChosenDateHandler() {
......
...@@ -330,6 +330,7 @@ export default { ...@@ -330,6 +330,7 @@ export default {
this.calcMoney() this.calcMoney()
}, },
deep: true, deep: true,
immediate: true,
}, },
}, },
data() { data() {
......
...@@ -72,7 +72,7 @@ export default { ...@@ -72,7 +72,7 @@ export default {
x.title = y.childItem.title; x.title = y.childItem.title;
} else if (y.type == 1) { } else if (y.type == 1) {
y.subtitle = y.subtitle =
y.childItem.subTraffic[0].startTime + y.childItem.subTraffic.length>0&&y.childItem.subTraffic[0].startTime +
" - " + " - " +
y.childItem.subTraffic[y.childItem.subTraffic.length - 1] y.childItem.subTraffic[y.childItem.subTraffic.length - 1]
.endTime; .endTime;
...@@ -109,7 +109,7 @@ export default { ...@@ -109,7 +109,7 @@ export default {
} }
}, },
formatTraffice(tras) { formatTraffice(tras) {
let txt = "從" + tras[0].startCityName; let txt = "從" + tras.length>0&&tras[0].startCityName;
tras.forEach((z, i) => { tras.forEach((z, i) => {
if (i > 0) { if (i > 0) {
txt = ";再"; txt = ";再";
......
...@@ -336,7 +336,7 @@ export default { ...@@ -336,7 +336,7 @@ export default {
x.title = y.childItem.title; x.title = y.childItem.title;
} else if (y.type == 1) { } else if (y.type == 1) {
y.subtitle = y.subtitle =
y.childItem.subTraffic[0].startTime + y.childItem.subTraffic.length>0&&y.childItem.subTraffic[0].startTime +
" - " + " - " +
y.childItem.subTraffic[y.childItem.subTraffic.length - 1] y.childItem.subTraffic[y.childItem.subTraffic.length - 1]
.endTime; .endTime;
...@@ -352,7 +352,7 @@ export default { ...@@ -352,7 +352,7 @@ export default {
} }
}, },
formatTraffice(tras) { formatTraffice(tras) {
let txt = "從" + tras[0].startCityName; let txt = "從" + tras.length>0&&tras[0].startCityName;
tras.forEach((z, i) => { tras.forEach((z, i) => {
if (i > 0) { if (i > 0) {
txt = ";再"; txt = ";再";
......
...@@ -82,12 +82,22 @@ ...@@ -82,12 +82,22 @@
</style> </style>
<template> <template>
<div class="back"> <div class="back">
<div v-if="detail" class="wapper q-pt-md"> <div v-if="detail" class="wapper">
<q-breadcrumbs gutter="none" class=" q-mb-md"> <div class="row items-center q-pt-md q-mb-lg">
<q-breadcrumbs-el label="Home" /> <q-breadcrumbs
<q-breadcrumbs-el label="Components" /> class="col f12 no-wrap q-mr-md"
<q-breadcrumbs-el label="Breadcrumbs" /> style="font-size: 13px"
>
<q-breadcrumbs-el
icon="home"
label="首頁"
class="cursor-pointer"
@click="CommonJump('/index', {})"
/>
<q-breadcrumbs-el :label="detail.AreaName" class="cursor-pointer" />
</q-breadcrumbs> </q-breadcrumbs>
<!-- <div class="text-grey-6 f12">Product No. # {{ dataList.id }}</div> -->
</div>
<div class="flex relative"> <div class="flex relative">
<div class="absolute name">{{detail.AreaName}}</div> <div class="absolute name">{{detail.AreaName}}</div>
......
This diff is collapsed.
This diff is collapsed.
...@@ -760,7 +760,7 @@ export default { ...@@ -760,7 +760,7 @@ export default {
} }
this.getData(); this.getData();
window.addEventListener("scroll", this.menu); window.addEventListener("scroll", this.menu);
//this.getCarData(); // this.getCarData();
}, },
methods: { methods: {
getTopNum(x) { getTopNum(x) {
...@@ -786,7 +786,7 @@ export default { ...@@ -786,7 +786,7 @@ export default {
// } // }
this.stickyHeight = document.querySelector(".q-header--hidden") this.stickyHeight = document.querySelector(".q-header--hidden")
? "translateY(0px)" ? "translateY(0px)"
: "translateY(50px)"; : "translateY(45px)";
this.currentHeight = temp; this.currentHeight = temp;
if ( if (
this.videoPosition > 0 && this.videoPosition > 0 &&
...@@ -860,7 +860,9 @@ export default { ...@@ -860,7 +860,9 @@ export default {
changeChosenDateHandler(val) { changeChosenDateHandler(val) {
val.price.version = new Date().getTime(); val.price.version = new Date().getTime();
this.currentPrice = JSON.parse(JSON.stringify(val.price)); this.currentPrice = JSON.parse(JSON.stringify(val.price));
if(this.$q.platform.is.mobile){
this.$refs.qDateProxy.hide(); this.$refs.qDateProxy.hide();
}
}, },
showDialog() { showDialog() {
this.isShowDialog = true; this.isShowDialog = true;
......
This diff is collapsed.
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