Commit 2b60959d authored by 黄奎's avatar 黄奎

页面修改

parent ed8cfdad
...@@ -25,7 +25,7 @@ Vue.prototype.domainManager = function () { ...@@ -25,7 +25,7 @@ Vue.prototype.domainManager = function () {
if (domainNameUrl.indexOf('oytour') !== -1) { if (domainNameUrl.indexOf('oytour') !== -1) {
domainUrl = "http://reborn.oytour.com"; domainUrl = "http://reborn.oytour.com";
} }
//domainUrl = "http://192.168.5.46:8501"; //domainUrl = "http://192.168.5.46";
var obj = { var obj = {
//主地址 //主地址
DomainUrl: domainUrl, DomainUrl: domainUrl,
......
...@@ -55,14 +55,12 @@ export default { ...@@ -55,14 +55,12 @@ export default {
}, },
watch: { watch: {
value: function() { value: function() {
console.log('switch change', this.value)
this.inputSelect = this.value this.inputSelect = this.value
} }
}, },
methods: { methods: {
changeSelect() { changeSelect() {
this.inputSelect = !this.inputSelect this.inputSelect = !this.inputSelect
console.log('changeSelect', this.inputSelect, this.value)
this.$emit('input', this.inputSelect) this.$emit('input', this.inputSelect)
} }
} }
......
...@@ -896,8 +896,9 @@ export default { ...@@ -896,8 +896,9 @@ export default {
}, },
GotoDetails(item) { GotoDetails(item) {
console.log("item",item);
this.CommonJump( this.CommonJump(
"/detailsProduct/" + encodeURIComponent(item.id) + "/" + item.configId, "/detailsProduct/" + encodeURIComponent(item.id) + "/" + item.configId+"/"+item.teamType,
{}, {},
"blank" "blank"
); );
......
...@@ -8,64 +8,35 @@ ...@@ -8,64 +8,35 @@
{{ months[currentMonth].display }} {{ months[currentMonth].display }}
</div> </div>
<div> <div>
<q-btn <q-btn color="primary" round icon="iconfont iconpreviewleft" flat @click="changeShowMonthHandler(-1)"
color="primary" class="q-mr-sm" :disable="currentMonth == 0" />
round <q-btn color="primary" round icon="iconfont iconpreviewright" flat @click="changeShowMonthHandler(1)"
icon="iconfont iconpreviewleft" :disable="currentMonth == months.length - 1" />
flat
@click="changeShowMonthHandler(-1)"
class="q-mr-sm"
:disable="currentMonth == 0"
/>
<q-btn
color="primary"
round
icon="iconfont iconpreviewright"
flat
@click="changeShowMonthHandler(1)"
:disable="currentMonth == months.length - 1"
/>
</div> </div>
</div> </div>
<div class="q-pa-sm non-selectable" style="border-top: 1px solid #eee"> <div class="q-pa-sm non-selectable" style="border-top: 1px solid #eee">
<div class="row items-center"> <div class="row items-center">
<div <!--星期-->
class="col text-weight-bold text-center" <div class="col text-weight-bold text-center" style="padding: 10px 0 20px" v-for="(x, i) in chineseWeek"
style="padding: 10px 0 20px" :key="i">
v-for="(x, i) in chineseWeek"
:key="i"
>
{{ x }} {{ x }}
</div> </div>
</div> </div>
<div class="row wrap"> <div class="row wrap">
<div <div class="rounded-borders text-center text-weight-bold" :class="{
class="rounded-borders text-center text-weight-bold"
:class="{
'cursor-pointer hover-date': x.value != '' && x.price, 'cursor-pointer hover-date': x.value != '' && x.price,
'cursor-not-allowed': (!x.price || x.price.remainNum==0) && x.value != '', 'cursor-not-allowed': (!x.price || x.price.remainNum==0) && x.value != '',
'bg-primary': x.value != '' && x.value == currentDate, 'bg-primary': x.value != '' && x.value == currentDate,
}" }" style="padding: 8px 4px; width: 14.285%" v-for="(x, i) in dayList" :key="i"
style="padding: 8px 4px; width: 14.285%" @click="chosenDateHandler(x)">
v-for="(x, i) in col" <div class="text-dark" :class="{ 'text-white': x.value == currentDate }" v-if="x.price">
:key="i"
@click="chosenDateHandler(x)"
>
<div
class="text-dark"
:class="{ 'text-white': x.value == currentDate }"
v-if="x.price"
>
{{ x.display }} {{ x.display }}
</div> </div>
<div class="text-grey-6" v-else>{{ x.display }}</div> <div class="text-grey-6" v-else>{{ x.display }}</div>
<div <div class="q-mt-sm f12" :class="{
class="q-mt-sm f12"
:class="{
'text-grey-1': x.value == currentDate, 'text-grey-1': x.value == currentDate,
' text-grey-6': x.value != currentDate, ' text-grey-6': x.value != currentDate,
}" }">
>
{{ {{
x.price && x.price.remainNum>0 ? moneyFormat(x.price.originalB2CPrice, 0) :(x.price && x.price.remainNum==0?'售罄':'&nbsp;') x.price && x.price.remainNum>0 ? moneyFormat(x.price.originalB2CPrice, 0) :(x.price && x.price.remainNum==0?'售罄':'&nbsp;')
}} }}
...@@ -78,9 +49,11 @@ ...@@ -78,9 +49,11 @@
</template> </template>
<script> <script>
import { date } from "quasar"; import {
export default { date
props: ["priceList","tcid"], } from "quasar";
export default {
props: ["priceList", "tcid", "dataList"],
data() { data() {
return { return {
chineseWeek: ["日", "一", "二", "三", "四", "五", "六"], chineseWeek: ["日", "一", "二", "三", "四", "五", "六"],
...@@ -101,7 +74,7 @@ export default { ...@@ -101,7 +74,7 @@ export default {
data: [], data: [],
months: [], months: [],
currentMonth: 0, currentMonth: 0,
col: [], dayList: [],
prices: [], prices: [],
currentDate: "", currentDate: "",
}; };
...@@ -117,26 +90,32 @@ export default { ...@@ -117,26 +90,32 @@ export default {
}, },
created() { created() {
this.prices = this.priceList; this.prices = this.priceList;
console.log(this.prices)
this.init(); this.init();
}, },
methods: { methods: {
init() { init() {
this.createChosenDateHandler(); this.createChosenDateHandler();
let startDate = this.prices.length>0&&this.prices[0].startDate?this.prices[0].startDate:'' let startDate = this.prices.length > 0 && this.prices[0].startDate ? this.prices[0].startDate : ''
let firstMonth = date.formatDate( let firstMonth = date.formatDate(
new Date(startDate), new Date(startDate),
"YYYY/MM" "YYYY/MM"
); );
console.log(firstMonth) //当前团期所在的月份
if (this.dataList && this.dataList.currentPriceInfo && this.dataList.currentPriceInfo.startDate) {
firstMonth = date.formatDate(
new Date(this.dataList.currentPriceInfo.startDate),
"YYYY/MM"
);
}
let current = this.months.findIndex((x) => x.monthValue == firstMonth) let current = this.months.findIndex((x) => x.monthValue == firstMonth)
this.currentMonth = current>-1?current:0; this.currentMonth = current > -1 ? current : 0;
this.changeMonthHandler(); this.changeMonthHandler();
}, },
createChosenDateHandler() { createChosenDateHandler() {
let beginDate = new Date(); let beginDate = new Date();
let endDate = date.addToDate(beginDate, { years: 1 }); let endDate = date.addToDate(beginDate, {
years: 1
});
while (beginDate <= endDate) { while (beginDate <= endDate) {
let i = parseInt(date.formatDate(beginDate, "M")) - 1; let i = parseInt(date.formatDate(beginDate, "M")) - 1;
this.months.push({ this.months.push({
...@@ -146,58 +125,65 @@ export default { ...@@ -146,58 +125,65 @@ export default {
this.chineseMonth[i] this.chineseMonth[i]
}`, }`,
}); });
beginDate = date.addToDate(beginDate, { months: 1 }); beginDate = date.addToDate(beginDate, {
months: 1
});
} }
}, },
changeShowMonthHandler(i) { changeShowMonthHandler(i) {
this.currentMonth += i; this.currentMonth += i;
let value = this.months[this.currentMonth].value let value = this.months[this.currentMonth].value
this.$emit('getQuotationData',value) this.$emit('getQuotationData', value)
this.changeMonthHandler(); this.changeMonthHandler();
}, },
changeMonthHandler() { changeMonthHandler() {
try { try {
this.col = []; this.dayList = [];
let newDate = new Date(this.months[this.currentMonth].monthValue+'/01'); let newDate = new Date(this.months[this.currentMonth].monthValue + '/01');
let newBeginDate = date.startOfDate(newDate, "month"); let newBeginDate = date.startOfDate(newDate, "month");
let newEndDate = date.endOfDate(newDate, "month"); let newEndDate = date.endOfDate(newDate, "month");
for (let i = 0; i < date.formatDate(newBeginDate, "d"); i++) { for (let i = 0; i < date.formatDate(newBeginDate, "d"); i++) {
this.col.push({ this.dayList.push({
value: "", value: "",
}); });
} }
while (newBeginDate <= newEndDate) { while (newBeginDate <= newEndDate) {
let value = date.formatDate(newBeginDate, "YYYY-MM-DD"); let value = date.formatDate(newBeginDate, "YYYY-MM-DD");
let price = this.prices.find((x) => x.startDate == value); let price = this.prices.find((x) => x.startDate == value);
this.col.push({ let tempPriceList = this.prices.filter((x) => x.startDate == value);
if (tempPriceList && tempPriceList.length > 0) {
console.log("tempPriceList", tempPriceList);
}
this.dayList.push({
value, value,
display: date.formatDate(newBeginDate, "DD"), display: date.formatDate(newBeginDate, "DD"),
price, price,
}); });
newBeginDate = date.addToDate(newBeginDate, { days: 1 }); newBeginDate = date.addToDate(newBeginDate, {
days: 1
});
// 默认日期 价格 // 默认日期 价格
let InitialOption = false let InitialOption = false
for(let i=0;i<this.col.length;i++){ for (let i = 0; i < this.dayList.length; i++) {
if(this.tcid&&this.tcid.length>0){ if (this.tcid && this.tcid.length > 0) {
if (!InitialOption&&this.col[i].price && this.col[i].price.id===this.tcid) { if (!InitialOption && this.dayList[i].price && this.dayList[i].price.id === this.tcid) {
this.currentDate = this.col[i].value; this.currentDate = this.dayList[i].value;
this.$emit("change", this.col[i]); this.$emit("change", this.dayList[i]);
InitialOption = true InitialOption = true
} }
} } else {
else{ if (!InitialOption && this.dayList[i].price && this.dayList[i].price.remainNum > 0) {
if (!InitialOption&&this.col[i].price && this.col[i].price.remainNum>0) { this.currentDate = this.dayList[i].value;
this.currentDate = this.col[i].value; this.$emit("change", this.dayList[i]);
this.$emit("change", this.col[i]);
InitialOption = true InitialOption = true
} }
} }
} }
} }
let after = 6 - date.formatDate(newBeginDate, "d"); let after = 6 - date.formatDate(newBeginDate, "d");
for (let i = 0; i < after; i++) { for (let i = 0; i < after; i++) {
this.col.push({ this.dayList.push({
value: "", value: "",
}); });
} }
...@@ -206,16 +192,15 @@ export default { ...@@ -206,16 +192,15 @@ export default {
} }
}, },
chosenDateHandler(item) { chosenDateHandler(item) {
if (item.price && item.price.remainNum>0) { if (item.price && item.price.remainNum > 0) {
this.currentDate = item.value; this.currentDate = item.value;
this.$emit("change", item); this.$emit("change", item);
} }
}, },
changePriceHandler(dateStr,money){ changePriceHandler(dateStr, money) {
//this.currentDate.price.originalB2CPrice=money this.dayList.forEach(x => {
this.col.forEach(x=>{ if (x.value == dateStr) {
if(x.value==dateStr){ x.price.originalB2CPrice = money
x.price.originalB2CPrice=money
} }
}) })
}, },
...@@ -223,11 +208,13 @@ export default { ...@@ -223,11 +208,13 @@ export default {
this.currentDate = ""; this.currentDate = "";
}, },
}, },
}; };
</script> </script>
<style> <style>
.hover-date:hover { .hover-date:hover {
background: #eee; background: #eee;
} }
</style> </style>
...@@ -82,7 +82,7 @@ export default { ...@@ -82,7 +82,7 @@ export default {
price: { price: {
handler(n, o) { handler(n, o) {
this.m = n; this.m = n;
console.log(n) console.log("flight",n)
}, },
deep: true, deep: true,
immediate: true, immediate: true,
......
...@@ -2,43 +2,40 @@ ...@@ -2,43 +2,40 @@
<div class="q-mt-md" :class="{'q-px-md':$q.platform.is.mobile}"> <div class="q-mt-md" :class="{'q-px-md':$q.platform.is.mobile}">
<div class="text-subtitle2 text-weight-bold">產品概要</div> <div class="text-subtitle2 text-weight-bold">產品概要</div>
<div class="row q-pt-md q-col-gutter-md"> <div class="row q-pt-md q-col-gutter-md">
<div class="row items-center q-pt-mb" <div class="row items-center q-pt-mb" :class="{'col-6':$q.platform.is.desktop,'col-12':$q.platform.is.mobile}"
:class="{'col-6':$q.platform.is.desktop,'col-12':$q.platform.is.mobile}" v-if="traffic!=''"> v-if="traffic!=''">
<div class="q-mr-md col-3">往返交通:</div> <div class="q-mr-md col-3">往返交通:</div>
<div class="col text-grey-6">{{ traffic }}</div> <div class="col text-grey-6">{{ traffic }}</div>
</div> </div>
<div class="row items-center q-pt-mb" <div class="row items-center q-pt-mb" :class="{'col-6':$q.platform.is.desktop,'col-12':$q.platform.is.mobile}"
:class="{'col-6':$q.platform.is.desktop,'col-12':$q.platform.is.mobile}" v-if="hotel!=''"> v-if="hotel!=''">
<div class="q-mr-md col-3">酒店住宿:</div> <div class="q-mr-md col-3">酒店住宿:</div>
<div class="col text-grey-6">{{ hotel }}</div> <div class="col text-grey-6">{{ hotel }}</div>
</div> </div>
<div class="row items-center q-pt-mb" <div class="row items-center q-pt-mb" :class="{'col-6':$q.platform.is.desktop,'col-12':$q.platform.is.mobile}">
:class="{'col-6':$q.platform.is.desktop,'col-12':$q.platform.is.mobile}">
<div class="q-mr-md col-3">購物:</div> <div class="q-mr-md col-3">購物:</div>
<div class="col text-grey-6">{{ trip.shopList.length>0?`${trip.shopList.length}個購物點`:'無購物行程' }}</div> <div class="col text-grey-6">{{ trip.shopList.length>0?`${trip.shopList.length}個購物點`:'無購物行程' }}</div>
</div> </div>
<div class="row items-center q-pt-mb" <div class="row items-center q-pt-mb" :class="{'col-6':$q.platform.is.desktop,'col-12':$q.platform.is.mobile}"
:class="{'col-6':$q.platform.is.desktop,'col-12':$q.platform.is.mobile}" v-if="team!=''"> v-if="team!=''">
<div class="q-mr-md col-3">團隊人數:</div> <div class="q-mr-md col-3">團隊人數:</div>
<div class="col text-grey-6">{{ team }}</div> <div class="col text-grey-6">{{ team }}</div>
</div> </div>
<div class="row items-center q-pt-mb" <div class="row items-center q-pt-mb" :class="{'col-6':$q.platform.is.desktop,'col-12':$q.platform.is.mobile}">
:class="{'col-6':$q.platform.is.desktop,'col-12':$q.platform.is.mobile}" >
<div class="q-mr-md col-3">景點:</div> <div class="q-mr-md col-3">景點:</div>
<div class="col text-grey-6">{{ trip.scenicList.length }}個景點或場館</div> <div class="col text-grey-6">{{ trip.scenicList.length }}個景點或場館</div>
</div> </div>
<div class="row items-center q-pt-mb" <div class="row items-center q-pt-mb" :class="{'col-6':$q.platform.is.desktop,'col-12':$q.platform.is.mobile}">
:class="{'col-6':$q.platform.is.desktop,'col-12':$q.platform.is.mobile}" >
<div class="q-mr-md col-3">自費項目:</div> <div class="q-mr-md col-3">自費項目:</div>
<div class="col text-grey-6">{{ trip.selfpayingList.length>0?`${trip.selfpayingList.length}個自費項目`:'無自費項目' }}</div> <div class="col text-grey-6">{{ trip.selfpayingList.length>0?`${trip.selfpayingList.length}個自費項目`:'無自費項目' }}
</div> </div>
<div class="row items-center q-pt-mb" </div>
:class="{'col-6':$q.platform.is.desktop,'col-12':$q.platform.is.mobile}" v-if="trip.freedomList.length>0"> <div class="row items-center q-pt-mb" :class="{'col-6':$q.platform.is.desktop,'col-12':$q.platform.is.mobile}"
v-if="trip.freedomList.length>0">
<div class="q-mr-md col-3">自由活動:</div> <div class="q-mr-md col-3">自由活動:</div>
<div class="col text-grey-6">{{ trip.freedomList.length}} 次自由活動</div> <div class="col text-grey-6">{{ trip.freedomList.length}} 次自由活動</div>
</div> </div>
<div class="row items-center q-pt-mb" <div class="row items-center q-pt-mb" :class="{'col-6':$q.platform.is.desktop,'col-12':$q.platform.is.mobile}">
:class="{'col-6':$q.platform.is.desktop,'col-12':$q.platform.is.mobile}" >
<div class="q-mr-md col-3">餐食:</div> <div class="q-mr-md col-3">餐食:</div>
<div class="col text-grey-6">{{ dinner }}</div> <div class="col text-grey-6">{{ dinner }}</div>
</div> </div>
...@@ -52,13 +49,13 @@ ...@@ -52,13 +49,13 @@
</template> </template>
<script> <script>
export default { export default {
props: ["trip"], props: ["trip"],
data() { data() {
return { return {
traffic: "", traffic: "",
stars:['一星酒店','二星酒店','三星酒店','四星酒店','五星酒店','六星酒店','七星酒店','民宿','溫泉酒店'], stars: ['一星酒店', '二星酒店', '三星酒店', '四星酒店', '五星酒店', '六星酒店', '七星酒店', '民宿', '溫泉酒店'],
hotel:'', hotel: '',
team: '', team: '',
dinner: '' dinner: ''
}; };
...@@ -68,67 +65,82 @@ export default { ...@@ -68,67 +65,82 @@ export default {
this.formatHotel() this.formatHotel()
this.formatTeam() this.formatTeam()
this.formatDinner() this.formatDinner()
console.log("trip", this.trip);
}, },
methods: { methods: {
formatTeam(){ formatTeam() {
let p = this.trip.priceList[0] let p = this.trip.priceList[0]
if(!p) return if (!p) return
let t = p.priceTeamType??1 let t = 0;
t=t==0?1:t if (p && p.priceTeamType) {
if(t==1){ t = p.priceTeamType
}
t = t == 0 ? 1 : t
if (t == 1) {
this.team = `${p.seat}人團隊散拼` this.team = `${p.seat}人團隊散拼`
}else{ } else {
this.team = '一单一团' this.team = '一单一团'
} }
}, },
formatDinner(){ formatDinner() {
let d = [] let d = []
this.trip.dinnerList.forEach(x=>{ this.trip.dinnerList.forEach(x => {
if(x.dinnerName.indexOf('自理')==-1 && x.dinnerName.indexOf('请选择')==-1){ if (x.dinnerName.indexOf('自理') == -1 && x.dinnerName.indexOf('请选择') == -1 && x.dinnerId > 0) {
d.push(x) d.push(x)
} }
}) })
if(d && d.length>0){ if (d && d.length > 0) {
let g=this.groupBy(d,x=>{ return x.useDinnerType}) let g = this.groupBy(d, x => {
let t = ['早餐','午餐','晚餐'] return x.useDinnerType
g.forEach(x=>{ })
this.dinner+=`${x.data.length}次 ${t[parseInt(x.key)-1]};` let t = ['早餐', '午餐', '晚餐']
g.forEach(x => {
this.dinner += `${x.data.length}次 ${t[parseInt(x.key)-1]};`
}) })
}else{ } else {
this.dinner = '無餐食供應' this.dinner = '無餐食供應'
} }
}, },
formatTraffic() { formatTraffic() {
if(this.trip.trafficList && this.trip.trafficList.length>0 && this.trip.trafficList[0].subTraffic && this.trip.trafficList[0].subTraffic.length>0){ if (this.trip.trafficList && this.trip.trafficList.length > 0 && this.trip.trafficList[0].subTraffic && this
.trip.trafficList[0].subTraffic.length > 0) {
let z = this.trip.trafficList[0].subTraffic[0] let z = this.trip.trafficList[0].subTraffic[0]
if (z&&z.arrivalType&&z.arrivalType == 1) { if (z && z.arrivalType && z.arrivalType == 1) {
this.traffic = '飛機往返'; this.traffic = '飛機往返';
} else if (z&&z.arrivalType&&z.arrivalType == 2) { } else if (z && z.arrivalType && z.arrivalType == 2) {
this.traffic = '巴士往返'; this.traffic = '巴士往返';
} else if (z&&z.arrivalType&&z.arrivalType == 3) { } else if (z && z.arrivalType && z.arrivalType == 3) {
this.traffic = '郵輪往返'; this.traffic = '郵輪往返';
} else { } else {
this.traffic = '高鐵往返'; this.traffic = '高鐵往返';
} }
} }
}, },
formatHotel(){ formatHotel() {
let h = [] let h = []
this.trip.hotelList.forEach(x=>{ this.trip.hotelList.forEach(x => {
if(h.findIndex(y=>y.dayNum==x.dayNum)==-1){ if (h.findIndex(y => y.dayNum == x.dayNum) == -1) {
h.push(x) h.push(x)
} }
}) })
if(h && h.length>0){ console.log("h", h);
let g = this.groupBy(h,(x)=>{return x.star}) if (h && h.length > 0) {
g.forEach(x=>{ let g = this.groupBy(h, (x) => {
this.hotel+=`${x.data.length}晚${this.stars[parseInt(x.key)-1]?this.stars[parseInt(x.key)-1]:''};` return x.star
})
g.forEach(x => {
let tempStr = this.stars[parseInt(x.key) - 1];
console.log("", tempStr)
if (tempStr && tempStr != '') {
this.hotel += `${x.data.length}晚${ tempStr};`
}
}) })
} }
} }
}, },
}; };
</script> </script>
<style></style> <style></style>
...@@ -4,7 +4,6 @@ ...@@ -4,7 +4,6 @@
<div class="text-grey-6 f12 q-my-sm">此行程包含多個出發城市</div> <div class="text-grey-6 f12 q-my-sm">此行程包含多個出發城市</div>
<div class="row q-col-gutter-md"> <div class="row q-col-gutter-md">
<div v-for="(x,i) in m.unionCityList" :key="i"><q-chip size="14px" square>{{ x.cityName }}</q-chip></div> <div v-for="(x,i) in m.unionCityList" :key="i"><q-chip size="14px" square>{{ x.cityName }}</q-chip></div>
</div> </div>
</div> </div>
</template> </template>
...@@ -16,7 +15,7 @@ export default { ...@@ -16,7 +15,7 @@ export default {
price: { price: {
handler(n, o) { handler(n, o) {
this.m = n; this.m = n;
console.log(n) console.log("startCity",n)
}, },
deep: true, deep: true,
immediate: true, immediate: true,
......
This diff is collapsed.
...@@ -35,7 +35,7 @@ const routes = [{ ...@@ -35,7 +35,7 @@ const routes = [{
component: () => component: () =>
import ('pages/details.vue') import ('pages/details.vue')
}, { //行程2024 }, { //行程2024
path: '/detailsProduct/:id/:configId', path: '/detailsProduct/:id/:configId/:teamType',
meta: { title: '行程' }, meta: { title: '行程' },
component: () => component: () =>
import ('pages/detailsProduct.vue') import ('pages/detailsProduct.vue')
......
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