Commit 240fd202 authored by youjie's avatar youjie

道旅 酒店列表

parent 4fc8111a
...@@ -20,7 +20,7 @@ const product = { ...@@ -20,7 +20,7 @@ const product = {
} else if (t === 5) { } else if (t === 5) {
url = "/detailHotal/" + configId + '/' + productInfo.b2CPrice url = "/detailHotal/" + configId + '/' + productInfo.b2CPrice
} else if (t === 6) { } else if (t === 6) {
url = "/detailHotalDida/" + configId + '/' + productInfo.lowrateBySetCurrency url = `/detailHotalDida/${configId}/${productInfo.lowrateBySetCurrency}/${encodeURIComponent(productInfo.CheckInDate)}/${encodeURIComponent(productInfo.CheckOutDate)}`
} }
} else { } else {
throw new Error("參數不合法"); throw new Error("參數不合法");
......
...@@ -323,3 +323,14 @@ Vue.prototype.GetHtml = function (str) { ...@@ -323,3 +323,14 @@ Vue.prototype.GetHtml = function (str) {
} }
return str; return str;
} }
// 检查图片是否存在
Vue.prototype.checkImageExists = function (imageUrl, callback) {
const img = new Image();
img.onload = function() {
callback(true);
};
img.onerror = function() {
callback(false);
};
img.src = imageUrl;
}
This diff is collapsed.
This diff is collapsed.
...@@ -420,14 +420,18 @@ export default { ...@@ -420,14 +420,18 @@ export default {
// this.historys=Array.from(new Set([this.searchKey].concat(this.historys))) // this.historys=Array.from(new Set([this.searchKey].concat(this.historys)))
// localStorage['recent_search'] = JSON.stringify(this.historys) // localStorage['recent_search'] = JSON.stringify(this.historys)
var currentUrl = window.location.href; var currentUrl = window.location.href;
let urlName="/search"; let urlName="";
if(currentUrl.includes('/#/searchProduct')){
urlName="/searchProduct"; let currentUrlArr = currentUrl.split('/')
}else if(currentUrl.includes('/#/planeticket')){ let urlType = currentUrlArr[4].split('?')[0]
urlName="/planeticket"; if(urlType){
}else if(currentUrl.includes('/#/searchVisa')){ urlName = `/${urlType}`
urlName="/searchVisa"; if(urlType=='SearchDida'||urlType=='searchDida'){
qsearchDate = date.formatDate(date.addToDate(new Date(), { days: 8 }), "YYYY/MM/DD")
qsearchEndDate = date.formatDate(date.addToDate(new Date(), { days: 9 }), "YYYY/MM/DD")
} }
}
if(urlName=='/searchVisa'||urlName=='/planeticket'){ if(urlName=='/searchVisa'||urlName=='/planeticket'){
this.CommonJump(urlName, { this.CommonJump(urlName, {
Name: this.searchKey, Name: this.searchKey,
...@@ -438,7 +442,8 @@ export default { ...@@ -438,7 +442,8 @@ export default {
qsearchKey: this.searchKey, qsearchKey: this.searchKey,
qsearchDate: this.searchDate, qsearchDate: this.searchDate,
qsearchEndDate: this.searchEndDate, qsearchEndDate: this.searchEndDate,
areaId: item.Id areaId: item.Id,
areaName: item.Name
}); });
} }
if(this.isSearch) { if(this.isSearch) {
...@@ -518,6 +523,7 @@ export default { ...@@ -518,6 +523,7 @@ export default {
let currentUrlArr = currentUrl.split('/') let currentUrlArr = currentUrl.split('/')
let urlType = currentUrlArr[4].split('?')[0] let urlType = currentUrlArr[4].split('?')[0]
console.log(urlType,'-----')
if(urlType){ if(urlType){
urlName = `/${urlType}` urlName = `/${urlType}`
if(urlType=='SearchDida'||urlType=='searchDida'){ if(urlType=='SearchDida'||urlType=='searchDida'){
......
<template>
<!-- 豆腐块 -->
<div class="Search_center">
<ul class="pd-list">
<li class="pd-box" v-for="(item,index) in DataList" :key="index">
<a class="pd-link">
<div class="pd-img"
:style="{backgroundImage:`url('${item.newCoverImg}')`}">
<div class="pd-price">
<div class="price">
{{item.dayNum}}
<small class="unit"></small> {{item.b2BPrice}}
<small class="unit">元起</small>
</div>
</div>
</div>
<div class="pd-content">
<h3 class="pd-title">{{item.title}}</h3>
<div class="pd-departure">
出發日期:{{item.startDate}}
<span class="more" @click="GotoDetails(item)" style="cursor:pointer">...更多</span>
</div>
</div>
</a>
</li>
</ul>
</div>
</template>
<script>
export default {
props: ["DataList", "PageCount"],
data() {
return {
};
},
methods: {
GotoDetails(item) {
this.CommonJump('/details/' + encodeURIComponent(item.id) + "/" + item.tcid, {});
}
}
}
</script>
...@@ -233,14 +233,20 @@ ...@@ -233,14 +233,20 @@
:key="i" :key="i"
> >
<q-img <q-img
:src="x.ImgList[0].ImageUrl" :src="x.images[0]"
:ratio="1" :ratio="1"
spinner-color="grey" spinner-color="grey"
spinner-size="20px" spinner-size="20px"
:width="$q.platform.is.desktop ? '272px' : ''" :width="$q.platform.is.desktop ? '272px' : ''"
:height="$q.platform.is.desktop ? '' : '200px'" :height="$q.platform.is.desktop ? '' : '200px'"
class="bg-grey-3" class="bg-grey-3"
/> >
<template v-slot:error>
<div class="absolute-full flex flex-center bg-grey-3 text-dark">
<img src="../../assets/img/errImg.png" alt="" style="width: 60%;">
</div>
</template>
</q-img>
<div class="q-pa-md col column"> <div class="q-pa-md col column">
<div class="text-subtitle1 text-weight-bold text-grey-9"> <div class="text-subtitle1 text-weight-bold text-grey-9">
{{ x.hotelName }} {{ x.hotelName }}
...@@ -287,7 +293,7 @@ ...@@ -287,7 +293,7 @@
</div> </div>
<div class="text-h6 product-price"> <div class="text-h6 product-price">
CNY{{ x.lowrateBySetCurrency }}<span class="price-stuff"></span> CNY{{ x.lowrateBySetCurrency }}<span class="price-stuff"></span>
</div> </div>
</div> </div>
</div> </div>
...@@ -443,10 +449,10 @@ export default { ...@@ -443,10 +449,10 @@ export default {
provTicked: [], provTicked: [],
}; };
}, },
created() { watch: {
qMsg: {
handler(newVal, oldVal) {
this.msg = this.qMsg; this.msg = this.qMsg;
this.initAreaList();
this.initGoods();
this.msg.priceRange = { this.msg.priceRange = {
min: 1, min: 1,
max: 100000, max: 100000,
...@@ -456,10 +462,24 @@ export default { ...@@ -456,10 +462,24 @@ export default {
this.dayArray.forEach((x) => { this.dayArray.forEach((x) => {
x.checked = false; x.checked = false;
}); });
if(!newVal.StartDate||!newVal.EndDate){
this.msg.StartDate = date.formatDate(new Date(this.qMsg.StartDate), "YYYY/MM/DD") this.msg.StartDate = date.formatDate(new Date(this.qMsg.StartDate), "YYYY/MM/DD")
this.msg.EndDate = date.formatDate(new Date(this.qMsg.EndDate), "YYYY/MM/DD") this.msg.EndDate = date.formatDate(new Date(this.qMsg.EndDate), "YYYY/MM/DD")
}
this.dateRange = { from: this.msg.StartDate, to: this.msg.EndDate }; this.dateRange = { from: this.msg.StartDate, to: this.msg.EndDate };
if(newVal!=oldVal){
this.goSearchHandler(); this.goSearchHandler();
}
},
deep: true,
immediate: true,
},
},
created() {
this.initAreaList();
this.initGoods();
}, },
mounted() { mounted() {
this.areaTicked = this.msg.Country ? [this.msg.Country] : (this.msg.Countrys ? this.msg.Countrys : []); this.areaTicked = this.msg.Country ? [this.msg.Country] : (this.msg.Countrys ? this.msg.Countrys : []);
...@@ -848,6 +868,14 @@ export default { ...@@ -848,6 +868,14 @@ export default {
tempArray.forEach(item => { tempArray.forEach(item => {
item.productType = 6; item.productType = 6;
item.configId = item.hotelId; item.configId = item.hotelId;
item.images = []
item.ImgList.forEach(img => {
this.checkImageExists(img.ImageUrl, (exists) => {
if(exists){
item.images.push(img.ImageUrl)
}
});
})
}); });
this.DataList = tempArray; this.DataList = tempArray;
...@@ -941,6 +969,8 @@ export default { ...@@ -941,6 +969,8 @@ export default {
// this.msg.dayNumList = arr; // this.msg.dayNumList = arr;
}, },
GotoDetails(item) { GotoDetails(item) {
item.CheckInDate = this.msg.StartDate
item.CheckOutDate = this.msg.EndDate
this.CommonJump(item, {}, "blank"); this.CommonJump(item, {}, "blank");
}, },
}, },
......
...@@ -1443,8 +1443,6 @@ export default { ...@@ -1443,8 +1443,6 @@ export default {
qMsg: { qMsg: {
pageIndex: 1, pageIndex: 1,
pageSize: 20, pageSize: 20,
companyId: 0,
orderBy: 0, // 排序 0默认 1价格升序 2价格降序
//只查询日本 //只查询日本
Country: "JP", Country: "JP",
...@@ -1466,6 +1464,39 @@ export default { ...@@ -1466,6 +1464,39 @@ export default {
DataList: [], DataList: [],
}; };
}, },
watch:{
'$route': {
handler(newVal, oldVal) {
var qsearchKey = this.getUrlKey("qsearchKey", window.location.href);
var qsearchDate = this.getUrlKey("qsearchDate", window.location.href);
var qsearchEndDate = this.getUrlKey("qsearchEndDate", window.location.href);
var areaId = this.getUrlKey("areaId", window.location.href);
var areaName = this.getUrlKey("areaName", window.location.href);
if (qsearchKey) {
this.qMsg.HotelName = qsearchKey;
}else if (areaName) {
this.qMsg.HotelName = areaName;
}else this.qMsg.HotelName = ''
if (qsearchDate) {
this.qMsg.StartDate = qsearchDate;
}else {
this.qMsg.StartDate = date.formatDate(date.addToDate(new Date(), { days: 8 }), "YYYY/MM/DD")
}
if (qsearchEndDate) {
this.qMsg.EndDate = qsearchEndDate;
}else {
this.qMsg.EndDate = date.formatDate(date.addToDate(new Date(), { days: 9 }), "YYYY/MM/DD")
}
if ((qsearchKey || qsearchDate || qsearchEndDate) && this.ShowType != 2) {
this.goSearchHandler();
}
},
deep: true,
immediate: true,
}
},
created() {}, created() {},
mounted() { mounted() {
// 支付宝退款 测试使用 // 支付宝退款 测试使用
...@@ -1487,38 +1518,7 @@ export default { ...@@ -1487,38 +1518,7 @@ export default {
this.getAera(); this.getAera();
} }
document.addEventListener("click", this.clickHandler); document.addEventListener("click", this.clickHandler);
var qsearchKey = this.getUrlKey("qsearchKey", window.location.href);
var qsearchDate = this.getUrlKey("qsearchDate", window.location.href);
var qsearchEndDate = this.getUrlKey("qsearchEndDate", window.location.href);
var areaId = this.getUrlKey("areaId", window.location.href);
var areaIds = this.getUrlKey("areaIds", window.location.href);
var categoryId = this.getUrlKey("categoryId", window.location.href);
if (qsearchKey) {
this.qMsg.HotelName = qsearchKey;
}
if (qsearchDate) {
this.qMsg.StartDate = qsearchDate;
}else {
this.qMsg.StartDate = date.formatDate(date.addToDate(new Date(), { days: 8 }), "YYYY/MM/DD")
}
if (qsearchEndDate) {
this.qMsg.EndDate = qsearchEndDate;
}else {
this.qMsg.EndDate = date.formatDate(date.addToDate(new Date(), { days: 9 }), "YYYY/MM/DD")
}
if (areaId) {
this.qMsg.areaId = Number(areaId);
}
if (areaIds) {
this.qMsg.areaIds = areaIds.split(",").map((item) => Number(item));
}
if (categoryId) {
this.qMsg.categoryId = Number(categoryId);
}
if ((qsearchKey || qsearchDate || qsearchEndDate) && this.ShowType != 2) {
this.goSearchHandler();
}
}, },
methods: { methods: {
handlerSearchChange(value) { handlerSearchChange(value) {
...@@ -1640,11 +1640,7 @@ export default { ...@@ -1640,11 +1640,7 @@ export default {
return false; return false;
} }
} }
var companyId = -1;
if (localStorage.groupinfo) {
var groupinfo = JSON.parse(localStorage.groupinfo);
companyId = groupinfo.siteList[0].companyId;
}
this.SearchResult = this.SearchResult =
this.qMsg.StartDate + "-" + this.qMsg.EndDate + " " + this.qMsg.HotelName; this.qMsg.StartDate + "-" + this.qMsg.EndDate + " " + this.qMsg.HotelName;
let msg = this.qMsg let msg = this.qMsg
......
This diff is collapsed.
This diff is collapsed.
...@@ -106,11 +106,17 @@ const routes = [{ ...@@ -106,11 +106,17 @@ const routes = [{
import ('pages/SearchDida.vue') import ('pages/SearchDida.vue')
}, },
{ // 道旅酒店 { // 道旅酒店
path: '/detailHotalDida/:id/:b2CPrice', path: '/detailHotalDida/:id/:b2CPrice/:CheckInDate/:CheckOutDate',
meta: { title: '酒店' }, meta: { title: '道旅酒店' },
component: () => component: () =>
import ('pages/detailHotalDida.vue') import ('pages/detailHotalDida.vue')
}, },
{ // 道旅酒店
path: '/HotalDidaForm/:id',
meta: { title: '道旅酒店' },
component: () =>
import ('pages/didaHotel/orderForm.vue')
},
{ {
path: '/account', //用户信息 path: '/account', //用户信息
meta: { isUserCenter: true, needLogin: true, title: '用户信息' }, meta: { isUserCenter: true, needLogin: true, title: '用户信息' },
......
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