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

页面修改

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