Commit f198d7ea authored by 沈良进's avatar 沈良进

页面修改

parent 3666a475
...@@ -9,8 +9,9 @@ ...@@ -9,8 +9,9 @@
</div> </div>
</div> </div>
</div> --> </div> -->
<div class="UpgradedVersion-box UpgradedVersion-homebj relative"
v-for="(item,index) in tripList">
<div class="UpgradedVersion-box UpgradedVersion-homebj relative" v-for="(item,index) in tripList">
<div class="absolute z-index1 column" style="left: 0;right: 0; top: 0;bottom: 0;"> <div class="absolute z-index1 column" style="left: 0;right: 0; top: 0;bottom: 0;">
<Header :TripColor="dataAll.tripColor" :orderMsg="orderMsg"></Header> <Header :TripColor="dataAll.tripColor" :orderMsg="orderMsg"></Header>
<div class="travelDaysTitlle row-aic"> <div class="travelDaysTitlle row-aic">
...@@ -34,25 +35,27 @@ ...@@ -34,25 +35,27 @@
<div :id="'travelDaysMasterMap_'+index" class="travelDaysMasterMap relative"> <div :id="'travelDaysMasterMap_'+index" class="travelDaysMasterMap relative">
<div class="travelDaysMasterMap-one" :style="{'color':'#fff'}"> <div class="travelDaysMasterMap-one" :style="{'color':'#fff'}">
<div class="travelDaysMasterMap-oneImg relative bjF6" :id="'travelDaysImg_one'+index"> <div class="travelDaysMasterMap-oneImg relative bjF6" :id="'travelDaysImg_one'+index">
<img class="absolute" :src="item.details[0].img?item.details[0].img:'https://imgfile.oytour.com/Static/NewTripFeature/acquiesce.jpg'"> <img class="absolute"
:src="item.details[0].img?item.details[0].img:'https://imgfile.oytour.com/Upload/DefalutImage/DMC/defaultairline.png'">
</div> </div>
<div class="travelDaysMasterMap-text absolute z-index2">{{item.details[0].title}}</div> <div class="travelDaysMasterMap-text absolute z-index2">{{item.details[0].title}}</div>
</div> </div>
<div class="travelDaysMasterMap-two absolute z-index2"> <div class="travelDaysMasterMap-two absolute z-index2">
<template v-if="item.imgMapId=='travelDaysMasterMap_'+index&&item.showImgOne"> <template v-if="item.imgMapId=='travelDaysMasterMap_'+index&&item.showImgOne">
<div class="travelDaysMasterMap-twoImg relative bjF6" <div class="travelDaysMasterMap-twoImg relative bjF6" :style="{'color':'#fff'}"
:style="{'color':'#fff'}"
:id="'travelDaysImg_two'+index" :id="'travelDaysImg_two'+index"
v-if="(item.details&&item.details.length>1&&item.details[1].img)||(item.jiu2&&item.jiu2.length>0&&item.jiu2[0].url)"> v-if="(item.details&&item.details.length>1&&item.details[1].img)||(item.jiu2&&item.jiu2.length>0&&item.jiu2[0].url)">
<template v-if="item.details.length>1&&item.details[1].img"> <template v-if="item.details.length>1&&item.details[1].img">
<img class="" :src="item.details[1].img?item.details[1].img:'https://imgfile.oytour.com/Static/NewTripFeature/acquiesce.jpg'"> <img class=""
:src="item.details[1].img?item.details[1].img:'https://imgfile.oytour.com/Static/NewTripFeature/acquiesce.jpg'">
<div class="travelDaysMasterMap-text textTwo absolute z-index2"> <div class="travelDaysMasterMap-text textTwo absolute z-index2">
{{item.details[1].title}}</div> {{item.details[1].title}}</div>
</template> </template>
<template v-else> <template v-else>
<template v-for="(jiudian,j) in item.jiu2"> <template v-for="(jiudian,j) in item.jiu2">
<template v-if="jiudian.url&&j==0"> <template v-if="jiudian.url&&j==0">
<img class="" v-if="jiudian.url" :src="jiudian.url?jiudian.url:'https://imgfile.oytour.com/Static/NewTripFeature/acquiesce.jpg'"> <img class="" v-if="jiudian.url"
:src="jiudian.url?jiudian.url:'https://imgfile.oytour.com/Static/NewTripFeature/acquiesce.jpg'">
<div class="travelDaysMasterMap-text textTwo absolute z-index2"> <div class="travelDaysMasterMap-text textTwo absolute z-index2">
{{jiudian.newTitle}}</div> {{jiudian.newTitle}}</div>
</template> </template>
...@@ -61,12 +64,12 @@ ...@@ -61,12 +64,12 @@
</div> </div>
</template> </template>
<template v-if="item.imgMapId=='travelDaysMasterMap_'+index&&item.showImgTwo"> <template v-if="item.imgMapId=='travelDaysMasterMap_'+index&&item.showImgTwo">
<div class="travelDaysMasterMap-twoImg relative bjF6" style="margin-top: 47px;" <div class="travelDaysMasterMap-twoImg relative bjF6" style="margin-top: 47px;" :style="{'color':'#fff'}"
:style="{'color':'#fff'}"
:id="'travelDaysImg_three'+index" :id="'travelDaysImg_three'+index"
v-if="(item.details&&item.details.length>2&&item.details[2].img)||(item.jiu2&&item.jiu2.length>1&&item.jiu2[0].url)"> v-if="(item.details&&item.details.length>2&&item.details[2].img)||(item.jiu2&&item.jiu2.length>1&&item.jiu2[0].url)">
<template v-if="item.details.length>2&&item.details[2].img"> <template v-if="item.details.length>2&&item.details[2].img">
<img class="" :src="item.details[2].img?item.details[2].img:'https://imgfile.oytour.com/Static/NewTripFeature/acquiesce.jpg'"> <img class=""
:src="item.details[2].img?item.details[2].img:'https://imgfile.oytour.com/Static/NewTripFeature/acquiesce.jpg'">
<div class="travelDaysMasterMap-text textTwo absolute z-index2"> <div class="travelDaysMasterMap-text textTwo absolute z-index2">
{{item.details[2].title}}</div> {{item.details[2].title}}</div>
</template> </template>
...@@ -74,7 +77,8 @@ ...@@ -74,7 +77,8 @@
<template v-else> <template v-else>
<template v-for="(jiudian,j) in item.jiu2"> <template v-for="(jiudian,j) in item.jiu2">
<template v-if="jiudian.url&&j==1"> <template v-if="jiudian.url&&j==1">
<img class="" v-if="jiudian.url" :src="jiudian.url?item.details[2].img:'https://imgfile.oytour.com/Static/NewTripFeature/acquiesce.jpg'"> <img class="" v-if="jiudian.url"
:src="jiudian.url?item.details[2].img:'https://imgfile.oytour.com/Static/NewTripFeature/acquiesce.jpg'">
<div class="travelDaysMasterMap-text textTwo absolute z-index2"> <div class="travelDaysMasterMap-text textTwo absolute z-index2">
{{jiudian.name}}</div> {{jiudian.name}}</div>
</template> </template>
...@@ -85,27 +89,43 @@ ...@@ -85,27 +89,43 @@
</div> </div>
</div> </div>
<template v-if="item.details&&item.details.length>0">
<div class="travelDaysContent column"> <div class="travelDaysContent column">
<div class="travelDaysContent-text" v-for="(jindian,j) in item.details"> <div class="travelDaysContent-text" v-for="(jindian,j) in item.details">
<span>{{jindian.title}}</span> <span>{{jindian.title}}</span>
{{jindian.content}} {{jindian.content}}
</div> </div>
</div> </div>
</template>
<template v-else>
<div class="travelDaysContent column">
<div class="travelDaysContent-text">
<span>{{jindian.title}}</span>
{{jindian.content}}
</div>
</div>
</template>
<div class="travelDaysdetails absolute"> <div class="travelDaysdetails absolute">
<div class="travelDaysdetailsBJ row" <div class="travelDaysdetailsBJ row" :style="{'background':backgroundColor}">
:style="{'background':backgroundColor}">
<div class="travelDaysdetails-text row"> <div class="travelDaysdetails-text row">
<span>早餐:</span> <span>早餐:</span>
<div><p>{{item.can.breakfirst}}</p></div> <div>
<p>{{item.can.breakfirst}}</p>
</div>
</div> </div>
<div class="travelDaysdetails-text row"> <div class="travelDaysdetails-text row">
<span>午餐:</span> <span>午餐:</span>
<div><p>{{item.can.lanuch}}</p></div> <div>
<p>{{item.can.lanuch}}</p>
</div>
</div> </div>
<div class="travelDaysdetails-text row"> <div class="travelDaysdetails-text row">
<span>晚餐:</span> <span>晚餐:</span>
<div><p>{{item.can.dinner}}</p></div> <div>
<p>{{item.can.dinner}}</p>
</div>
</div> </div>
<div class="travelDaysdetails-text row"> <div class="travelDaysdetails-text row">
<span>住宿:</span> <span>住宿:</span>
...@@ -117,8 +137,7 @@ ...@@ -117,8 +137,7 @@
</div> </div>
<!-- otherJourney-footer --> <!-- otherJourney-footer -->
<div> <div>
<div class="otherJourney-introduceFooter absolute z-index1 row-aic" <div class="otherJourney-introduceFooter absolute z-index1 row-aic" :style="{'background':''}">
:style="{'background':''}">
<div class="introduceFooterBJ introduceFooterOne" :style="{'background':dataAll.tripColor}">&nbsp;</div> <div class="introduceFooterBJ introduceFooterOne" :style="{'background':dataAll.tripColor}">&nbsp;</div>
<div class="introduceFooterBJ introduceFootertTwo" :style="{'background':dataAll.tripColor}">&nbsp;</div> <div class="introduceFooterBJ introduceFootertTwo" :style="{'background':dataAll.tripColor}">&nbsp;</div>
<div class="introduceFooter-text row-aic"> <div class="introduceFooter-text row-aic">
...@@ -142,7 +161,7 @@ ...@@ -142,7 +161,7 @@
components: { components: {
Header Header
}, },
props: ['dataAll','tripList','orderMsg','orderTripdiff','vshowD','vshowK'], props: ['dataAll', 'tripList', 'orderMsg', 'orderTripdiff', 'vshowD', 'vshowK'],
data() { data() {
return { return {
title: '北京-马德里-塞戈维亚-萨拉曼卡-贝尼多姆/小镇-瓦伦西亚-巴塞罗那(约 253km,约 3h)北京-马德里-塞戈维亚-萨拉曼卡-贝尼多姆/小镇-瓦伦西亚-巴塞罗那(约 253km,约 3h)', title: '北京-马德里-塞戈维亚-萨拉曼卡-贝尼多姆/小镇-瓦伦西亚-巴塞罗那(约 253km,约 3h)北京-马德里-塞戈维亚-萨拉曼卡-贝尼多姆/小镇-瓦伦西亚-巴塞罗那(约 253km,约 3h)',
...@@ -154,39 +173,39 @@ ...@@ -154,39 +173,39 @@
}, },
methods: { methods: {
getShow(Id,HeightNum,item){ getShow(Id, HeightNum, item) {
item.imgMapId = Id item.imgMapId = Id
if(HeightNum>=243){ if (HeightNum >= 243) {
item.showImgOne = true item.showImgOne = true
}else{ } else {
item.showImgOne = false item.showImgOne = false
} }
if(HeightNum>=478){ if (HeightNum >= 478) {
item.showImgTwo = true item.showImgTwo = true
}else{ } else {
item.showImgTwo = false item.showImgTwo = false
} }
this.$forceUpdate() this.$forceUpdate()
}, },
getHeigthNum(Id,item){ getHeigthNum(Id, item) {
let that = this let that = this
setTimeout(()=>{ setTimeout(() => {
var Height = document.getElementById(Id); var Height = document.getElementById(Id);
if(Height){ if (Height) {
let HeightNum = Height.offsetHeight let HeightNum = Height.offsetHeight
that.getShow(Id,HeightNum,item) that.getShow(Id, HeightNum, item)
} }
},300) }, 300)
}, },
getFontSize(title){ getFontSize(title) {
if(title.length>60){ if (title.length > 60) {
return 929/60 +'px' return 929 / 60 + 'px'
}else{ } else {
return '30px' return '30px'
} }
}, },
getImgColor(img,id){ getImgColor(img, id) {
return "#fff" return "#fff"
return return
// this.canvasImgColor(img,id, (callback) => { // this.canvasImgColor(img,id, (callback) => {
...@@ -202,7 +221,7 @@ ...@@ -202,7 +221,7 @@
// }) // })
}, },
// 获取图片颜色 // 获取图片颜色
canvasImgColor(imgs,ids, callback) { canvasImgColor(imgs, ids, callback) {
var imgSrc = imgs var imgSrc = imgs
var upload = document.getElementById(ids) var upload = document.getElementById(ids)
const imgEle = document.createElement('img') const imgEle = document.createElement('img')
...@@ -224,7 +243,8 @@ ...@@ -224,7 +243,8 @@
const oneLineImgDataLen = canvas.width * 4; const oneLineImgDataLen = canvas.width * 4;
imgData.data.forEach((colorVal, i) => { imgData.data.forEach((colorVal, i) => {
if (i % oneLineImgDataLen <= 0.5 * oneLineImgDataLen || i % oneLineImgDataLen >= 0.6 * oneLineImgDataLen) { if (i % oneLineImgDataLen <= 0.5 * oneLineImgDataLen || i % oneLineImgDataLen >= 0.6 *
oneLineImgDataLen) {
const inLeft = i % oneLineImgDataLen <= 0.5 * oneLineImgDataLen const inLeft = i % oneLineImgDataLen <= 0.5 * oneLineImgDataLen
if (i % 4 === 0) { if (i % 4 === 0) {
// 获取rgb均值 // 获取rgb均值
...@@ -232,7 +252,9 @@ ...@@ -232,7 +252,9 @@
let leftOrRightRef = inLeft ? leftSectionData : rightSectionData; let leftOrRightRef = inLeft ? leftSectionData : rightSectionData;
//每个数组里存四个值:本颜色值中的r、g、b的均值,以及r、g、b三个值。 //每个数组里存四个值:本颜色值中的r、g、b的均值,以及r、g、b三个值。
//均值一方面用于累加计算本区域的整体均值,然后再跟每个均值对比拿到与整体均值最接近的项的索引,再取该数组里的后三个值:rgb,对应着颜色 //均值一方面用于累加计算本区域的整体均值,然后再跟每个均值对比拿到与整体均值最接近的项的索引,再取该数组里的后三个值:rgb,对应着颜色
leftOrRightRef[leftOrRightRef.length] = [curAverageRGB, imgData.data[i], imgData.data[i + 1], imgData.data[i + 2]] leftOrRightRef[leftOrRightRef.length] = [curAverageRGB, imgData.data[i], imgData.data[i + 1],
imgData.data[i + 2]
]
} }
} }
}) })
...@@ -258,7 +280,8 @@ ...@@ -258,7 +280,8 @@
} }
const leftNearestColor = leftSectionData[findNearestIndex(averageOfLeft, leftSectionData)] const leftNearestColor = leftSectionData[findNearestIndex(averageOfLeft, leftSectionData)]
const rightNearestColor = rightSectionData[findNearestIndex(averageOfRight, rightSectionData)] const rightNearestColor = rightSectionData[findNearestIndex(averageOfRight, rightSectionData)]
upload.style.backgroundColor = `rgba(${leftNearestColor[1]},${leftNearestColor[2]},${leftNearestColor[3]},1) 0%,rgba(${rightNearestColor[1]},${rightNearestColor[2]},${rightNearestColor[3]},1)` upload.style.backgroundColor =
`rgba(${leftNearestColor[1]},${leftNearestColor[2]},${leftNearestColor[3]},1) 0%,rgba(${rightNearestColor[1]},${rightNearestColor[2]},${rightNearestColor[3]},1)`
callback(upload.style.backgroundColor) callback(upload.style.backgroundColor)
} }
} }
...@@ -267,15 +290,15 @@ ...@@ -267,15 +290,15 @@
watch: { watch: {
dataAll: { dataAll: {
handler(val, oldVal) { handler(val, oldVal) {
if(val&&val.tripColor){ if (val && val.tripColor) {
this.backgroundColor = this.hexToRgb(val.tripColor, 0.2) this.backgroundColor = this.hexToRgb(val.tripColor, 0.2)
let rgba = this.hexToRgb(val.tripColor, 1) let rgba = this.hexToRgb(val.tripColor, 1)
rgba = rgba.split(',') rgba = rgba.split(',')
let rgba0 = rgba[0].split('(') let rgba0 = rgba[0].split('(')
let arr = [rgba0[1],rgba[1],rgba[2]] let arr = [rgba0[1], rgba[1], rgba[2]]
if(this.getRgbLevel(arr)>50){ if (this.getRgbLevel(arr) > 50) {
this.textColor = "#fff" this.textColor = "#fff"
}else{ } else {
this.textColor = "#333" this.textColor = "#333"
} }
} }
...@@ -285,8 +308,8 @@ ...@@ -285,8 +308,8 @@
}, },
tripList: { tripList: {
handler(val, oldVal) { handler(val, oldVal) {
this.tripList.forEach((x,index)=>{ this.tripList.forEach((x, index) => {
this.getHeigthNum('travelDaysMasterMap_'+index,x) this.getHeigthNum('travelDaysMasterMap_' + index, x)
}) })
}, },
deep: true, deep: true,
......
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