Commit 380e314a authored by 黄奎's avatar 黄奎

页面修改

parent ed8a1558
......@@ -65,7 +65,9 @@
:isSelectImg="true" :isDeleteImg="false" @toUploadImg="toUploadImg(0)" @toSelectImg="toSelectImg(0)"
@toAddImg="toAddImg" @toDeleteImg="toDeleteImg(0)" />
</div>
<img v-if="FeatureData.dataObj&&FeatureData.dataObj.SubList" :src="FeatureData.dataObj.SubList[0].url" />
<template v-if="FeatureData.dataObj&&FeatureData.dataObj.SubList &&FeatureData.dataObj.SubList.length>0">
<img :src="FeatureData.dataObj.SubList[0].url" />
</template>
</div>
</div>
</div>
......@@ -79,7 +81,9 @@
:isSelectImg="true" :isDeleteImg="false" @toUploadImg="toUploadImg(1)" @toSelectImg="toSelectImg(1)"
@toAddImg="toAddImg" @toDeleteImg="toDeleteImg(1)" />
</div>
<img v-if="FeatureData.dataObj&&FeatureData.dataObj.SubList" :src="FeatureData.dataObj.SubList[1].url" />
<template v-if="FeatureData.dataObj&&FeatureData.dataObj.SubList &&FeatureData.dataObj.SubList.length>1 ">
<img :src="FeatureData.dataObj.SubList[1].url" />
</template>
</div>
</div>
</div>
......@@ -166,7 +170,7 @@
top: 827px;
width: 154px;
height: 155px;
}
.UpgradedVersion-subIdeBj1 {
......@@ -178,7 +182,7 @@
border-radius: 100%;
}
.UpgradedVersion-subIdeBj-h {
width: 109px;
height: 71px;
......
......@@ -106,7 +106,14 @@
pageTemplate: 3,
dataObj: {},
}
]
],
homeBg3: "https://imgfile.oytour.com/Static/NewTripFeature/homeBg3.jpg",
homeBg1: "https://imgfile.oytour.com/Static/NewTripFeature/homeBg1.jpg",
homeBg2: "http://imgfile.oytour.com/Static/NewTripFeature/homeBg2.jpg",
dinner1: "http://imgfile.oytour.com/Static/NewTripFeature/dinner1.jpg",
dinner2: "http://imgfile.oytour.com/Static/NewTripFeature/dinner2.jpg",
dinner3: "http://imgfile.oytour.com/Static/NewTripFeature/dinner3.jpg",
dinner4: "https://imgfile.oytour.com/Static/NewTripFeature/dinner4.jpg",
};
},
methods: {
......@@ -125,6 +132,7 @@
var pageData = this.getPageObj();
pageData.isDeletePage = true;
pageData.pageType = featureDataObj.pageType;
var tripObj = this.getTripData();
var newObj = this.getDetailsObj();
newObj.LineName = this.FeatureData.LineName;
......@@ -133,36 +141,39 @@
newObj.LineShortName = this.FeatureData.LineShortName;
//首页
if (pageData.pageType == 1) {
if (tripObj.cityStr && tripObj.cityStr != '') {
newObj.MainName = tripObj.cityStr; //地区1
} else {
newObj.MainName = "大阪";
}
if (tripObj.cityStr2 && tripObj.cityStr2 != '') {
newObj.SubName = tripObj.cityStr2; //地区2
} else {
newObj.SubName = "东京";
}
newObj.ShadowName = "遇见最美好的自己";
newObj.SubShadowName = "在古老的日本樱花街道";
if (tripObj.scenicArray && tripObj.scenicArray.length > 0) {
newObj.DetailsName = tripObj.scenicArray[0].MainName;
newObj.ImgList = tripObj.scenicArray[0].ImgList;
newObj.MainDesc = tripObj.scenicArray[0].MainDesc;
} else {
newObj.DetailsName = "景点介绍";
newObj.ImgList = [{
url: "http://imgfile.oytour.com//Static/NewTripFeature/homeBg2.jpg"
}];
newObj.MainDesc = "景点描述";
}
pageData.pageTitle = "首页";
this.getHomeData(tripObj, newObj);
}
//介绍页
else if (pageData.pageType == 2) {
pageData.pageTitle = "介绍";
this.getIntroduceData(tripObj, newObj);
} //食详情
else if (pageData.pageType == 3) {
pageData.pageTitle = "食详情";
this.getDetailsData(tripObj, newObj);
} //宿
else if (pageData.pageType == 4) {
pageData.pageTitle = "宿";
this.getHotelData(tripObj, newObj);
} //食
else if (pageData.pageType == 5) {
pageData.pageTitle = "食";
this.getDinnerData(tripObj, newObj);
}
//景
else if (pageData.pageType == 6) {
pageData.pageTitle = "景";
this.getScenicData(tripObj, newObj);
}
pageData.dataObj = newObj;
this.pageList.splice(index, 0, pageData);
},
//删除页面
DeletePages(index) {
this.pageList.splice(1, index);
this.pageList.splice(index, 1);
},
getDetailsObj() {
var detailsObj = {
......@@ -183,13 +194,10 @@
var oldJson = this.FeatureData.FeatureHtmlJson ?
JSON.parse(JSON.stringify(this.FeatureData.FeatureHtmlJson)) :
"";
if (oldJson && oldJson.length > 0) {
console.log("oldJson", oldJson);
this.pageList = oldJson;
} else {
var tripObj = this.getTripData();
console.log("tropObj", tripObj);
this.pageList.forEach(pItem => {
var newObj = this.getDetailsObj();
newObj.LineName = this.FeatureData.LineName;
......@@ -198,173 +206,281 @@
newObj.LineShortName = this.FeatureData.LineShortName;
//首页
if (pItem.pageType == 1) {
if (tripObj.cityStr && tripObj.cityStr != '') {
newObj.MainName = tripObj.cityStr; //地区1
} else {
newObj.MainName = "大阪";
}
if (tripObj.cityStr2 && tripObj.cityStr2 != '') {
newObj.SubName = tripObj.cityStr2; //地区2
} else {
newObj.SubName = "东京";
}
newObj.ShadowName = "遇见最美好的自己";
newObj.SubShadowName = "在古老的日本樱花街道";
if (tripObj.scenicArray && tripObj.scenicArray.length > 0) {
newObj.DetailsName = tripObj.scenicArray[0].MainName;
newObj.ImgList = tripObj.scenicArray[0].ImgList;
newObj.MainDesc = tripObj.scenicArray[0].MainDesc;
} else {
newObj.DetailsName = "景点介绍";
newObj.ImgList = [{
url: "http://imgfile.oytour.com/Static/NewTripFeature/homeBg2.jpg"
}];
newObj.MainDesc = "景点描述";
}
this.getHomeData(tripObj, newObj);
}
//介绍页面
else if (pItem.pageType == 2) {
newObj.MainName = "日本旅行专家";
newObj.SubName = "『印象日本』日本豪华游代名词";
newObj.ImgList = [{
url: "http://imgfile.oytour.com/Static/NewTripFeature/homeBg1.jpg"
}];
newObj.MainDesc = "描述信息";
this.getIntroduceData(tripObj, newObj);
}
//详情页面
else if (pItem.pageType == 3) {
var dinnerObj = {
MainName: "行程特色餐1",
ImgList: [{
url: "http://imgfile.oytour.com/Static/NewTripFeature/dinner1.jpg"
}],
MainDesc: "行程特色餐1描述"
};
var dinnerObj2 = JSON.parse(JSON.stringify(dinnerObj));
dinnerObj2.MainName = "行程特色餐2";
dinnerObj2.ImgList[0].url = "http://imgfile.oytour.com/Static/NewTripFeature/dinner2.jpg"
dinnerObj2.MainDesc = "行程特色餐2描述";
var dinnerObj3 = JSON.parse(JSON.stringify(dinnerObj));
dinnerObj3.MainName = "行程特色餐3";
dinnerObj3.ImgList[0].url = "http://imgfile.oytour.com/Static/NewTripFeature/dinner3.jpg"
dinnerObj3.MainDesc = "行程特色餐3描述";
if (tripObj.dinnerArray && tripObj.dinnerArray.length > 0) {
if (tripObj.dinnerArray.length > 2) {
tripObj.dinnerArray.forEach((dItem, dIndex) => {
if (dIndex <= 2) {
newObj.SubList.push({
MainName: dItem.MainName,
ImgList: [{
url: "http://imgfile.oytour.com/Upload/DMC/a2Fn2zajwMsxNHaWPdD5idKJD8RyCG5H.jpg"
}],
MainDesc: dItem.MainDesc
});
}
})
} else if (tripObj.dinnerArray.length > 1) {
tripObj.dinnerArray.forEach(dItem => {
newObj.SubList.push({
MainName: dItem.MainName,
ImgList: [{
url: "http://imgfile.oytour.com/Upload/DMC/a2Fn2zajwMsxNHaWPdD5idKJD8RyCG5H.jpg"
}],
MainDesc: dItem.MainDesc
});
})
newObj.SubList.push(dinnerObj2);
} else if (tripObj.dinnerArray.length > 0) {
tripObj.dinnerArray.forEach(dItem => {
var tempImaList = dItem.ImgList;
newObj.SubList.push({
MainName: dItem.MainName,
ImgList: [{
url: "http://imgfile.oytour.com/Upload/DMC/a2Fn2zajwMsxNHaWPdD5idKJD8RyCG5H.jpg"
}],
MainDesc: dItem.MainDesc
});
})
newObj.SubList.push(dinnerObj2);
newObj.SubList.push(dinnerObj3);
}
} else {
newObj.SubList.push(dinnerObj);
newObj.SubList.push(dinnerObj2);
newObj.SubList.push(dinnerObj3);
}
this.getDetailsData(tripObj, newObj);
}
//酒店
else if (pItem.pageType == 4) {
newObj.SubName = "特色酒店";
if (tripObj.hotelArray && tripObj.hotelArray.length > 0) {
newObj.MainName = tripObj.hotelArray[0].MainName;
newObj.ImgList = tripObj.hotelArray[0].ImgList;
newObj.MainDesc = tripObj.hotelArray[0].MainDesc;
} else {
newObj.MainName = "行程酒店";
newObj.ImgList = [{
url: "https://imgfile.oytour.com/Static/NewTripFeature/homeBg1.jpg"
}];
newObj.MainDesc = "行程酒店描述信息";
newObj.SubList = [{
url: "https://imgfile.oytour.com/Static/NewTripFeature/homeBg3.jpg"
}, {
url: "https://imgfile.oytour.com/Static/NewTripFeature/homeBg3.jpg"
}];
}
this.getHotelData(tripObj, newObj);
} //餐
else if (pItem.pageType == 5) {
newObj.SubName = "特色餐食";
if (tripObj.dinnerArray && tripObj.dinnerArray.length > 0) {
newObj.MainName = tripObj.dinnerArray[0].MainName;
newObj.ImgList = tripObj.dinnerArray[0].ImgList;
newObj.MainDesc = tripObj.dinnerArray[0].MainDesc;
} else {
newObj.MainName = "行程餐食";
newObj.ImgList = [{
url: "https://imgfile.oytour.com/Static/NewTripFeature/dinner4.jpg"
}];
newObj.MainDesc = "行程餐食描述";
newObj.SubList = [{
url: "https://imgfile.oytour.com/Static/NewTripFeature/homeBg3.jpg"
}, {
url: "https://imgfile.oytour.com/Static/NewTripFeature/homeBg3.jpg"
}];
}
this.getDinnerData(tripObj, newObj);
}
//景点
else if (pItem.pageType == 6) {
newObj.SubName = "特色景点";
if (tripObj.scenicArray && tripObj.scenicArray.length > 0) {
newObj.MainName = tripObj.scenicArray[0].MainName;
if (tripObj.scenicArray[0])
newObj.ImgList =
newObj.MainDesc = tripObj.scenicArray[0].MainDesc;
} else {
newObj.MainName = "行程景点";
newObj.ImgList = [{
url: "https://imgfile.oytour.com/Static/NewTripFeature/homeBg1.jpg"
}];
newObj.MainDesc = "行程景点描述信息";
newObj.SubList = [{
url: "https://imgfile.oytour.com/Static/NewTripFeature/homeBg3.jpg"
}, {
url: "https://imgfile.oytour.com/Static/NewTripFeature/homeBg3.jpg"
}];
}
this.getScenicData(tripObj, newObj);
}
pItem.dataObj = newObj;
});
}
},
//首页数据渲染
getHomeData(tripObj, newObj) {
if (tripObj.cityStr && tripObj.cityStr != '') {
newObj.MainName = tripObj.cityStr; //地区1
} else {
newObj.MainName = "大阪";
}
if (tripObj.cityStr2 && tripObj.cityStr2 != '') {
newObj.SubName = tripObj.cityStr2; //地区2
} else {
newObj.SubName = "东京";
}
newObj.ShadowName = "遇见最美好的自己";
newObj.SubShadowName = "在古老的日本樱花街道";
if (tripObj.scenicArray && tripObj.scenicArray.length > 0) {
newObj.DetailsName = tripObj.scenicArray[0].MainName;
var tempImgUrl = this.homeBg2;
if (tripObj.scenicArray[0].ImgList && tripObj.scenicArray[0].ImgList.length > 0) {
tempImgUrl = tripObj.scenicArray[0].ImgList[0].url;
}
newObj.ImgList = [{
url: tempImgUrl
}];;
newObj.MainDesc = tripObj.scenicArray[0].MainDesc;
} else {
newObj.DetailsName = "景点介绍";
newObj.ImgList = [{
url: this.homeBg2
}];
newObj.MainDesc = "景点描述";
}
},
//介绍页数据
getIntroduceData(tripObj, newObj) {
newObj.MainName = "日本旅行专家";
newObj.SubName = "『印象日本』日本豪华游代名词";
newObj.ImgList = [{
url: this.homeBg1
}];
newObj.MainDesc = "描述信息";
},
//详情页数据
getDetailsData(tripObj, newObj) {
var dinnerObj = {
MainName: "行程特色餐1",
ImgList: [{
url: this.dinner1
}],
MainDesc: "行程特色餐1描述"
};
var dinnerObj2 = JSON.parse(JSON.stringify(dinnerObj));
dinnerObj2.MainName = "行程特色餐2";
dinnerObj2.ImgList[0].url = this.dinner2;
dinnerObj2.MainDesc = "行程特色餐2描述";
var dinnerObj3 = JSON.parse(JSON.stringify(dinnerObj));
dinnerObj3.MainName = "行程特色餐3";
dinnerObj3.ImgList[0].url = this.dinner3;
dinnerObj3.MainDesc = "行程特色餐3描述";
if (tripObj.dinnerArray && tripObj.dinnerArray.length > 0) {
if (tripObj.dinnerArray.length > 2) {
tripObj.dinnerArray.forEach((dItem, dIndex) => {
if (dIndex <= 2) {
var tempUrl = this.dinner1;
if (dIndex == 1) {
tempUrl = this.dinner2;
} else if (dIndex == 2) {
tempUrl = this.dinner3;
}
if (dItem.ImgList && dItem.ImgList.length > 0) {
tempUrl = dItem.ImgList[0].url;
}
newObj.SubList.push({
MainName: dItem.MainName,
ImgList: [{
url: tempUrl
}],
MainDesc: dItem.MainDesc
});
}
})
} else if (tripObj.dinnerArray.length > 1) {
tripObj.dinnerArray.forEach((dItem, dIndex) => {
var tempUrl2 = this.dinner1;
if (dIndex == 1) {
tempUrl2 = this.dinner2;
}
newObj.SubList.push({
MainName: dItem.MainName,
ImgList: [{
url: tempUrl2
}],
MainDesc: dItem.MainDesc
});
})
newObj.SubList.push(dinnerObj3);
} else if (tripObj.dinnerArray.length > 0) {
tripObj.dinnerArray.forEach((dItem, dIndex) => {
var tempUrl3 = this.dinner1;
newObj.SubList.push({
MainName: dItem.MainName,
ImgList: [{
url: tempUrl3
}],
MainDesc: dItem.MainDesc
});
})
newObj.SubList.push(dinnerObj2);
newObj.SubList.push(dinnerObj3);
}
} else {
newObj.SubList.push(dinnerObj);
newObj.SubList.push(dinnerObj2);
newObj.SubList.push(dinnerObj3);
}
},
//获取酒店数据
getHotelData(tripObj, newObj) {
newObj.SubName = "特色酒店";
newObj.MainName = "行程酒店";
newObj.ImgList = [{
url: this.homeBg1
}];
newObj.MainDesc = "行程酒店描述信息";
newObj.SubList = [{
url: this.homeBg3
}, {
url: this.homeBg3
}];
if (tripObj.hotelArray && tripObj.hotelArray.length > 0) {
newObj.MainName = tripObj.hotelArray[0].MainName;
var tempHotelImg = this.homeBg1;
if (tripObj.hotelArray[0].ImgList && tripObj.hotelArray[0].ImgList.length > 0) {
tempHotelImg = tripObj.hotelArray[0].ImgList[0].url;
}
if (tripObj.hotelArray[0].ImgList && tripObj.hotelArray[0].ImgList.length > 2) {
newObj.SubList = [];
newObj.SubList.push({
url: tripObj.hotelArray[0].ImgList[1].url
});
newObj.SubList.push({
url: tripObj.hotelArray[0].ImgList[2].url
});
} else if (tripObj.hotelArray[0].ImgList && tripObj.hotelArray[0].ImgList.length > 1) {
newObj.SubList = [];
newObj.SubList.push({
url: tripObj.hotelArray[0].ImgList[1].url
});
newObj.SubList.push({
url: this.homeBg3
});
}
newObj.ImgList = [{
url: tempHotelImg
}];
newObj.MainDesc = tripObj.hotelArray[0].MainDesc;
}
},
//获取餐数据
getDinnerData(tripObj, newObj) {
newObj.SubName = "特色餐食";
newObj.SubList = [{
url: this.homeBg3
}, {
url: this.homeBg3
}];
newObj.MainName = "行程餐食";
newObj.ImgList = [{
url: this.dinner4,
}];
newObj.MainDesc = "行程餐食描述";
if (tripObj.dinnerArray && tripObj.dinnerArray.length > 0) {
newObj.MainName = tripObj.dinnerArray[0].MainName;
var tempDinnerImg = this.dinner4;
if (tripObj.dinnerArray[0].ImgList && tripObj.dinnerArray[0].ImgList.length > 0) {
tempDinnerImg = tripObj.dinnerArray[0].ImgList[0].url;
}
if (tripObj.dinnerArray[0].ImgList && tripObj.dinnerArray[0].ImgList.length > 2) {
newObj.SubList = [];
newObj.SubList.push({
url: tripObj.dinnerArray[0].ImgList[1].url
});
newObj.SubList.push({
url: tripObj.dinnerArray[0].ImgList[2].url
});
}
if (tripObj.dinnerArray[0].ImgList && tripObj.dinnerArray[0].ImgList.length > 1) {
newObj.SubList = [];
newObj.SubList.push({
url: tripObj.dinnerArray[0].ImgList[1].url
});
newObj.SubList.push({
url: this.homeBg3
});
}
newObj.ImgList = [{
url: tempDinnerImg
}];
newObj.MainDesc = tripObj.dinnerArray[0].MainDesc;
}
},
//获取景点数据
getScenicData(tripObj, newObj) {
newObj.SubName = "特色景点";
newObj.SubList = [{
url: this.homeBg3
}, {
url: this.homeBg3
}];
newObj.MainName = "行程景点";
newObj.ImgList = [{
url: this.homeBg1
}];
newObj.MainDesc = "行程景点描述信息";
if (tripObj.scenicArray && tripObj.scenicArray.length > 0) {
newObj.MainName = tripObj.scenicArray[0].MainName;
var tempScenicImg = this.homeBg1;
if (tripObj.scenicArray[0].ImgList && tripObj.scenicArray[0].ImgList.length > 0) {
tempScenicImg = tripObj.scenicArray[0].ImgList[0].url;
}
if (tripObj.scenicArray[0].ImgList && tripObj.scenicArray[0].ImgList.length > 2) {
newObj.SubList = [];
newObj.SubList.push({
url: tripObj.scenicArray[0].ImgList[1].url
});
newObj.SubList.push({
url: tripObj.scenicArray[0].ImgList[2].url
});
} else if (tripObj.scenicArray[0].ImgList && tripObj.scenicArray[0].ImgList.length > 1) {
newObj.SubList = [];
newObj.SubList.push({
url: tripObj.scenicArray[0].ImgList[1].url
});
newObj.SubList.push({
url: this.homeBg3
});
}
newObj.ImgList = [{
url: tempScenicImg
}];
newObj.MainDesc = tripObj.scenicArray[0].MainDesc;
}
},
//获取行程信息
getTripData() {
var cityArray = [];
var scenicArray = [];
var hotelArray = [];
var dinnerArray = [];
console.log("this.FeatureData.DayList", this.FeatureData.DayList);
if (this.FeatureData && this.FeatureData.DayList && this.FeatureData.DayList.length > 0) {
this.FeatureData.DayList.forEach(dItem => {
//城市
......
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