Commit ed8a1558 authored by 黄奎's avatar 黄奎

页面修改

parent bff9a50c
...@@ -23,17 +23,21 @@ ...@@ -23,17 +23,21 @@
changeText: function () { changeText: function () {
let sel = window.getSelection(); let sel = window.getSelection();
let offset = sel.anchorOffset; let offset = sel.anchorOffset;
if (this.textLength&&this.$el.innerText.length > this.textLength) { if (this.textLength && this.$el.innerText.length > this.textLength) {
this.$el.innerText = this.$el.innerText.slice(0, this.textLength); this.$el.innerText = this.$el.innerText.slice(0, this.textLength);
} }
this.$emit("input", this.$el.innerText); this.$emit("input", this.$el.innerText);
setTimeout(() => { setTimeout(() => {
try {
var range = sel.getRangeAt(0); var range = sel.getRangeAt(0);
var textNode = range.startContainer; var textNode = range.startContainer;
console.log("textNode",textNode.nodeName); console.log("textNode", textNode.nodeName);
range.setStart(textNode, offset); range.setStart(textNode, offset);
sel.removeAllRanges(); sel.removeAllRanges();
sel.addRange(range); sel.addRange(range);
} catch (err) {
console.log(err);
}
}, 0); }, 0);
} }
} }
......
...@@ -122,7 +122,6 @@ ...@@ -122,7 +122,6 @@
}, },
//添加页面 //添加页面
AddPages(index, featureDataObj) { AddPages(index, featureDataObj) {
var pageData = this.getPageObj(); var pageData = this.getPageObj();
pageData.isDeletePage = true; pageData.isDeletePage = true;
pageData.pageType = featureDataObj.pageType; pageData.pageType = featureDataObj.pageType;
...@@ -153,7 +152,7 @@ ...@@ -153,7 +152,7 @@
} else { } else {
newObj.DetailsName = "景点介绍"; newObj.DetailsName = "景点介绍";
newObj.ImgList = [{ newObj.ImgList = [{
url: "http://imgfile.oytour.com//Static/NewTripFeature/homeBg1.jpg" url: "http://imgfile.oytour.com//Static/NewTripFeature/homeBg2.jpg"
}]; }];
newObj.MainDesc = "景点描述"; newObj.MainDesc = "景点描述";
} }
...@@ -184,10 +183,13 @@ ...@@ -184,10 +183,13 @@
var oldJson = this.FeatureData.FeatureHtmlJson ? var oldJson = this.FeatureData.FeatureHtmlJson ?
JSON.parse(JSON.stringify(this.FeatureData.FeatureHtmlJson)) : JSON.parse(JSON.stringify(this.FeatureData.FeatureHtmlJson)) :
""; "";
console.log("oldJson", oldJson);
if (oldJson && oldJson.length > 0) { if (oldJson && oldJson.length > 0) {
console.log("oldJson", oldJson);
this.pageList = oldJson; this.pageList = oldJson;
} else { } else {
var tripObj = this.getTripData();
console.log("tropObj", tripObj);
this.pageList.forEach(pItem => { this.pageList.forEach(pItem => {
var newObj = this.getDetailsObj(); var newObj = this.getDetailsObj();
newObj.LineName = this.FeatureData.LineName; newObj.LineName = this.FeatureData.LineName;
...@@ -215,7 +217,7 @@ ...@@ -215,7 +217,7 @@
} else { } else {
newObj.DetailsName = "景点介绍"; newObj.DetailsName = "景点介绍";
newObj.ImgList = [{ newObj.ImgList = [{
url: "http://imgfile.oytour.com//Static/NewTripFeature/homeBg1.jpg" url: "http://imgfile.oytour.com/Static/NewTripFeature/homeBg2.jpg"
}]; }];
newObj.MainDesc = "景点描述"; newObj.MainDesc = "景点描述";
} }
...@@ -225,19 +227,28 @@ ...@@ -225,19 +227,28 @@
newObj.MainName = "日本旅行专家"; newObj.MainName = "日本旅行专家";
newObj.SubName = "『印象日本』日本豪华游代名词"; newObj.SubName = "『印象日本』日本豪华游代名词";
newObj.ImgList = [{ newObj.ImgList = [{
url: "http://imgfile.oytour.com/Upload/DMC/a2Fn2zajwMsxNHaWPdD5idKJD8RyCG5H.jpg" url: "http://imgfile.oytour.com/Static/NewTripFeature/homeBg1.jpg"
}]; }];
newObj.MainDesc = "描述信息"; newObj.MainDesc = "描述信息";
} }
//详情页面 //详情页面
else if (pItem.pageType == 3) { else if (pItem.pageType == 3) {
var dinnerObj = { var dinnerObj = {
MainName: "特色餐1", MainName: "行程特色餐1",
ImgList: [{ ImgList: [{
url: "http://imgfile.oytour.com/Upload/DMC/a2Fn2zajwMsxNHaWPdD5idKJD8RyCG5H.jpg" url: "http://imgfile.oytour.com/Static/NewTripFeature/dinner1.jpg"
}], }],
MainDesc: "特色餐描述" 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 && tripObj.dinnerArray.length > 0) {
if (tripObj.dinnerArray.length > 2) { if (tripObj.dinnerArray.length > 2) {
tripObj.dinnerArray.forEach((dItem, dIndex) => { tripObj.dinnerArray.forEach((dItem, dIndex) => {
...@@ -261,8 +272,7 @@ ...@@ -261,8 +272,7 @@
MainDesc: dItem.MainDesc MainDesc: dItem.MainDesc
}); });
}) })
newObj.SubList.push(dinnerObj); newObj.SubList.push(dinnerObj2);
} else if (tripObj.dinnerArray.length > 0) { } else if (tripObj.dinnerArray.length > 0) {
tripObj.dinnerArray.forEach(dItem => { tripObj.dinnerArray.forEach(dItem => {
var tempImaList = dItem.ImgList; var tempImaList = dItem.ImgList;
...@@ -274,9 +284,13 @@ ...@@ -274,9 +284,13 @@
MainDesc: dItem.MainDesc MainDesc: dItem.MainDesc
}); });
}) })
newObj.SubList.push(dinnerObj); newObj.SubList.push(dinnerObj2);
newObj.SubList.push(dinnerObj); newObj.SubList.push(dinnerObj3);
} }
} else {
newObj.SubList.push(dinnerObj);
newObj.SubList.push(dinnerObj2);
newObj.SubList.push(dinnerObj3);
} }
} }
//酒店 //酒店
...@@ -289,9 +303,14 @@ ...@@ -289,9 +303,14 @@
} else { } else {
newObj.MainName = "行程酒店"; newObj.MainName = "行程酒店";
newObj.ImgList = [{ newObj.ImgList = [{
url: "https://imgfile.oytour.com/Upload/DMC/202305290204327370000000012.jpg" url: "https://imgfile.oytour.com/Static/NewTripFeature/homeBg1.jpg"
}]; }];
newObj.MainDesc = "行程酒店描述信息"; newObj.MainDesc = "行程酒店描述信息";
newObj.SubList = [{
url: "https://imgfile.oytour.com/Static/NewTripFeature/homeBg3.jpg"
}, {
url: "https://imgfile.oytour.com/Static/NewTripFeature/homeBg3.jpg"
}];
} }
} //餐 } //餐
else if (pItem.pageType == 5) { else if (pItem.pageType == 5) {
...@@ -303,9 +322,14 @@ ...@@ -303,9 +322,14 @@
} else { } else {
newObj.MainName = "行程餐食"; newObj.MainName = "行程餐食";
newObj.ImgList = [{ newObj.ImgList = [{
url: "http://imgfile.oytour.com/Upload/DMC/Z4DbAPRPmBPkaJQyxwesEWAz3sbZadNj.jpg" url: "https://imgfile.oytour.com/Static/NewTripFeature/dinner4.jpg"
}]; }];
newObj.MainDesc = "行程餐食描述"; newObj.MainDesc = "行程餐食描述";
newObj.SubList = [{
url: "https://imgfile.oytour.com/Static/NewTripFeature/homeBg3.jpg"
}, {
url: "https://imgfile.oytour.com/Static/NewTripFeature/homeBg3.jpg"
}];
} }
} }
//景点 //景点
...@@ -313,27 +337,26 @@ ...@@ -313,27 +337,26 @@
newObj.SubName = "特色景点"; newObj.SubName = "特色景点";
if (tripObj.scenicArray && tripObj.scenicArray.length > 0) { if (tripObj.scenicArray && tripObj.scenicArray.length > 0) {
newObj.MainName = tripObj.scenicArray[0].MainName; newObj.MainName = tripObj.scenicArray[0].MainName;
newObj.ImgList = tripObj.scenicArray[0].ImgList; if (tripObj.scenicArray[0])
newObj.ImgList =
newObj.MainDesc = tripObj.scenicArray[0].MainDesc; newObj.MainDesc = tripObj.scenicArray[0].MainDesc;
} else { } else {
newObj.MainName = "行程景点"; newObj.MainName = "行程景点";
newObj.ImgList = [{ newObj.ImgList = [{
url: "http://imgfile.oytour.com/Upload/DMC/20200201061804955.jpg" url: "https://imgfile.oytour.com/Static/NewTripFeature/homeBg1.jpg"
}]; }];
newObj.MainDesc = "行程景点描述信息"; newObj.MainDesc = "行程景点描述信息";
}
}
if (pItem.pageType == 4 || pItem.pageType == 5 || pItem.pageType == 6) {
newObj.SubList = [{ newObj.SubList = [{
url: '' url: "https://imgfile.oytour.com/Static/NewTripFeature/homeBg3.jpg"
}, { }, {
url: '' url: "https://imgfile.oytour.com/Static/NewTripFeature/homeBg3.jpg"
}] }];
}
} }
pItem.dataObj = newObj; pItem.dataObj = newObj;
}); });
} }
}, },
//获取行程信息 //获取行程信息
getTripData() { getTripData() {
...@@ -341,6 +364,7 @@ ...@@ -341,6 +364,7 @@
var scenicArray = []; var scenicArray = [];
var hotelArray = []; var hotelArray = [];
var dinnerArray = []; var dinnerArray = [];
console.log("this.FeatureData.DayList", this.FeatureData.DayList);
if (this.FeatureData && this.FeatureData.DayList && this.FeatureData.DayList.length > 0) { if (this.FeatureData && this.FeatureData.DayList && this.FeatureData.DayList.length > 0) {
this.FeatureData.DayList.forEach(dItem => { this.FeatureData.DayList.forEach(dItem => {
//城市 //城市
...@@ -379,10 +403,11 @@ ...@@ -379,10 +403,11 @@
} }
}); });
} }
if (dItem.HotelArray && dItem.HotelArray.length > 0) { if (dItem.HotelArray && dItem.HotelArray.length > 0) {
dItem.HotelArray.forEach(sItem => { dItem.HotelArray.forEach(sItem => {
//排除“温馨的家”和“机场附近酒店” //排除“温馨的家”和“机场附近酒店”
if (sItem.HotelId != 1568 && sItem.HotelId != 2353) { if (sItem.HotelId && sItem.HotelId > 0 && sItem.HotelId != 1568 && sItem.HotelId != 2353) {
var tempImgList = []; var tempImgList = [];
if (sItem.ImaArray && sItem.ImaArray.length > 0) { if (sItem.ImaArray && sItem.ImaArray.length > 0) {
sItem.ImaArray.forEach(iItem => { sItem.ImaArray.forEach(iItem => {
......
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