Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
SuperMan
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
罗超
SuperMan
Commits
a932e4cc
Commit
a932e4cc
authored
Sep 06, 2023
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
ad9ee333
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
130 additions
and
151 deletions
+130
-151
travelDays.vue
src/components/LeaveGroupDownload/travelDays.vue
+130
-151
No files found.
src/components/LeaveGroupDownload/travelDays.vue
View file @
a932e4cc
...
...
@@ -9,8 +9,7 @@
</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;"
>
<Header
:TripColor=
"dataAll.tripColor"
:orderMsg=
"orderMsg"
></Header>
<div
class=
"travelDaysTitlle row-aic"
>
...
...
@@ -39,8 +38,7 @@
<div
class=
"travelDaysMasterMap-text absolute z-index2"
>
{{
item
.
details
[
0
].
title
}}
</div>
</div>
<div
class=
"travelDaysMasterMap-two absolute z-index2"
>
<div
class=
"travelDaysMasterMap-twoImg relative bjF6"
:style=
"
{'color':'#fff'}"
<div
class=
"travelDaysMasterMap-twoImg relative bjF6"
:style=
"
{'color':'#fff'}"
: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)">
<template
v-if=
"item.details.length>1&&item.details[1].img"
>
...
...
@@ -58,8 +56,7 @@
</template>
</template>
</div>
<div
class=
"travelDaysMasterMap-twoImg relative bjF6"
style=
"margin-top: 47px;"
:style=
"{'color':'#fff'}"
<div
class=
"travelDaysMasterMap-twoImg relative bjF6"
style=
"margin-top: 47px;"
:style=
"{'color':'#fff'}"
: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)"
>
<
template
v-if=
"item.details.length>2&&item.details[2].img"
>
...
...
@@ -82,20 +79,17 @@
</div>
<div
class=
"travelDaysContent column"
>
<div
class=
"travelDaysContent-text"
v-for=
"(jindian,j) in item.details"
v-if=
"item.details.length>0"
>
<div
class=
"travelDaysContent-text"
v-for=
"(jindian,j) in item.details"
v-if=
"item.details.length>0"
>
<span>
{{jindian.title?'【'+jindian.title+'】':''}}
</span>
{{jindian.content}}
</div>
<div
class=
"travelDaysContent-text"
v-else
>
<div
class=
"travelDaysContent-text"
v-else
>
<span>
暂无描述
</span>
</div>
</div>
<div
class=
"travelDaysdetails"
>
<div
class=
"travelDaysdetailsBJ row"
:style=
"{'background':backgroundColor}"
>
<div
class=
"travelDaysdetailsBJ row"
:style=
"{'background':backgroundColor}"
>
<div
class=
"travelDaysdetails-textBox column"
>
<div
class=
"travelDaysdetails-text"
>
<span
class=
"travelDaysdetails-text0"
>
早餐:
</span>
...
...
@@ -117,7 +111,8 @@
</div>
</div>
<
template
v-for=
"(t,i) in item.tips"
>
<div
class=
"travelDaysdetails-textBox"
:style=
"
{'flex-grow':t.content
&&
getHtmlPlainText(t.content).length>20?'2':''}">
<div
class=
"travelDaysdetails-textBox"
:style=
"
{'flex-grow':t.content
&&
getHtmlPlainText(t.content).length>20?'2':''}">
<div
class=
"travelDaysdetails-text"
style=
"margin-right: 0;"
>
<span
class=
"travelDaysdetails-text0"
>
温馨提示:
</span>
<template
v-if=
"getHtmlPlainText(t.content).length>0"
>
...
...
@@ -132,8 +127,7 @@
</div>
<!-- otherJourney-footer -->
<div>
<div
class=
"otherJourney-introduceFooter z-index1 row-aic"
:style=
"{'background':''}"
>
<div
class=
"otherJourney-introduceFooter z-index1 row-aic"
:style=
"{'background':''}"
>
<div
class=
"introduceFooterBJ introduceFooterOne"
:style=
"{'background':dataAll.tripColor}"
>
</div>
<div
class=
"introduceFooterBJ introduceFootertTwo"
:style=
"{'background':dataAll.tripColor}"
>
</div>
<div
class=
"introduceFooter-text row-aic"
>
...
...
@@ -157,7 +151,7 @@
components
:
{
Header
},
props
:
[
'dataAll'
,
'tripList'
,
'orderMsg'
,
'orderTripdiff'
,
'vshowD'
,
'vshowK'
],
props
:
[
'dataAll'
,
'tripList'
,
'orderMsg'
,
'orderTripdiff'
,
'vshowD'
,
'vshowK'
],
data
()
{
return
{
title
:
'北京-马德里-塞戈维亚-萨拉曼卡-贝尼多姆/小镇-瓦伦西亚-巴塞罗那(约 253km,约 3h)北京-马德里-塞戈维亚-萨拉曼卡-贝尼多姆/小镇-瓦伦西亚-巴塞罗那(约 253km,约 3h)'
,
...
...
@@ -172,46 +166,27 @@
getHtmlPlainText
(
html_str
)
{
//提取字符串中的文字
let
re
=
new
RegExp
(
'<[^<>]+>'
,
'g'
)
if
(
html_str
)
{
if
(
html_str
)
{
let
text
=
html_str
.
replace
(
re
,
''
)
//或
//var text = html_str.replace(/
<
[
^<>
]
+>
/g, ""
)
;
return
text
}
else
{
}
else
{
return
''
}
},
getFontSize
(
title
){
getFontSize
(
title
)
{
let
size
=
30
;
if
(
title
.
length
>
80
)
{
var
tempSize
=
Convert
.
ToDouble
(
80
)
/
Convert
.
ToDouble
(
title
.
length
);
if
(
title
.
length
>
80
)
{
var
tempSize
=
Number
(
80
)
/
Number
(
title
.
length
);
tempSize
=
tempSize
*
30
;
size
=
Math
.
Round
(
tempSize
,
1
);
size
=
tempSize
.
toFixed
(
1
);
}
return
size
+
"px"
;
// if(title.length>60){
// return 929/60 +'px'
// }else{
// return '30px'
// }
},
getImgColor
(
img
,
id
)
{
getImgColor
(
img
,
id
)
{
return
"#fff"
// this.canvasImgColor(img,id, (callback) => {
// let rgb = callback
// rgb = rgb.split(',')
// let rgb0 = rgb[0].split('(')
// let arrRgb = [rgb0[1],rgba[1],rgb[2]]
// if(this.getRgbLevel(arrRgb)>50){
// return "#333"
// }else{
// return "#fff"
// }
// })
},
// 获取图片颜色
canvasImgColor
(
imgs
,
ids
,
callback
)
{
canvasImgColor
(
imgs
,
ids
,
callback
)
{
var
imgSrc
=
imgs
var
upload
=
document
.
getElementById
(
ids
)
const
imgEle
=
document
.
createElement
(
'img'
)
...
...
@@ -233,7 +208,8 @@
const
oneLineImgDataLen
=
canvas
.
width
*
4
;
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
if
(
i
%
4
===
0
)
{
// 获取rgb均值
...
...
@@ -241,7 +217,9 @@
let
leftOrRightRef
=
inLeft
?
leftSectionData
:
rightSectionData
;
//每个数组里存四个值:本颜色值中的r、g、b的均值,以及r、g、b三个值。
//均值一方面用于累加计算本区域的整体均值,然后再跟每个均值对比拿到与整体均值最接近的项的索引,再取该数组里的后三个值: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
]
]
}
}
})
...
...
@@ -267,7 +245,8 @@
}
const
leftNearestColor
=
leftSectionData
[
findNearestIndex
(
averageOfLeft
,
leftSectionData
)]
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
)
}
}
...
...
@@ -277,15 +256,15 @@
dataAll
:
{
handler
(
val
,
oldVal
)
{
if
(
val
&&
val
.
tripColor
)
{
if
(
val
&&
val
.
tripColor
)
{
this
.
backgroundColor
=
this
.
hexToRgb
(
val
.
tripColor
,
0.2
)
let
rgba
=
this
.
hexToRgb
(
val
.
tripColor
,
1
)
rgba
=
rgba
.
split
(
','
)
let
rgba0
=
rgba
[
0
].
split
(
'('
)
let
arr
=
[
rgba0
[
1
],
rgba
[
1
],
rgba
[
2
]]
if
(
this
.
getRgbLevel
(
arr
)
>
50
)
{
let
arr
=
[
rgba0
[
1
],
rgba
[
1
],
rgba
[
2
]]
if
(
this
.
getRgbLevel
(
arr
)
>
50
)
{
this
.
textColor
=
"#fff"
}
else
{
}
else
{
this
.
textColor
=
"#333"
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment