Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
Athena
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
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
华国豪
Athena
Commits
90f41e6f
Commit
90f41e6f
authored
Jan 06, 2020
by
zhengke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改
parent
c4123d03
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
171 additions
and
50 deletions
+171
-50
newTrip.vue
src/components/mall/newTrip.vue
+171
-50
No files found.
src/components/mall/newTrip.vue
View file @
90f41e6f
...
...
@@ -25,6 +25,7 @@
.pageViewTrip
.sideBarBtns
.btnPage
{
cursor
:
pointer
;
height
:
27px
;
margin-bottom
:
5px
;
}
...
...
@@ -531,8 +532,7 @@
height
:
150px
;
color
:
#fff
;
position
:
relative
;
background-size
:
cover
;
background-position
:
center
!important
;
background-size
:
cover
!important
;
}
.tripViewAgendaList
.agendaBox
.txtCont
{
...
...
@@ -659,7 +659,7 @@
}
.tripViewAgendaList
.agendaPoi
{
margin
-top
:
10px
;
margin
:
10px
0
20px
0
;
}
.tripViewAgendaList
.agendaBox
.food
{
...
...
@@ -818,6 +818,26 @@
.slideHeader
.cities
i
:last-child
{
display
:
none
;
}
.tripViewAgendaList
.agendaBox
.showMore
{
color
:
#00B2B4
;
margin
:
10px
auto
;
padding
:
4px
2px
;
border-radius
:
2px
;
border
:
1px
solid
#00B2B4
;
width
:
100px
;
text-align
:
center
;
font-size
:
12px
;
cursor
:
pointer
;
}
.tripViewAgendaList
.agendaBox
.hideAgendaDetails
{
overflow
:
hidden
;
text-overflow
:
ellipsis
;
display
:
-webkit-box
;
-webkit-line-clamp
:
3
;
padding
:
20px
0
0
0
;
margin-bottom
:
20px
;
-webkit-box-orient
:
vertical
;
}
</
style
>
<
template
>
<div
class=
"pageViewTrip"
v-if=
"isShow"
>
...
...
@@ -1034,7 +1054,7 @@
<div
class=
"agendaBox"
>
<div
class=
"indexNum numberList"
>
{{
index
+
1
}}
</div>
<div
class=
"coverWrap"
:style=
"`background: url($
{subItem.childItem.imaArray[0].url})
no-repeat 100% 100%
`"
:style=
"`background: url($
{subItem.childItem.imaArray[0].url})
center
`"
@click="bigImgShow(subItem.childItem.imaArray[0].url)">
</div>
<div
class=
"txtCont icon-triangle"
>
...
...
@@ -1070,7 +1090,7 @@
</div>
<div
class=
"coverWrap"
v-if=
"subItem.childItem.imaArray.length>0"
@
click=
"bigImgShow(subItem.childItem.imaArray[0].url)"
:style=
"`background: url($
{subItem.childItem.imaArray[0].url})
no-repeat 100% 100%
`">
:style=
"`background: url($
{subItem.childItem.imaArray[0].url})
center
`">
</div>
<div
class=
"txtCont icon-triangle"
>
<div
class=
"agendaPoi"
>
...
...
@@ -1083,7 +1103,7 @@
</span>
</div>
<div
class=
"detailBox"
>
<div
class=
"detailSection"
>
<div
class=
"detailSection"
v-if=
"subItem.childItem.isShow"
>
<div
class=
"item"
>
<span
class=
"label"
>
酒店星级
</span>
<span
class=
"text"
>
...
...
@@ -1097,11 +1117,11 @@
class=
"text"
>
{{getService(subItem.childItem.facilityServices)}}
</span>
</div>
</div>
<div
class=
"subSection"
<div
class=
"subSection"
:class=
"{'hideAgendaDetails':!subItem.childItem.isShow}"
v-if=
"subItem.childItem.hotelNewDescriptionText"
v-html=
"subItem.childItem.hotelNewDescriptionText"
>
</div>
<div
class=
"detailSection"
style=
"margin-top:0;"
>
<div
class=
"detailSection"
style=
"margin-top:0;"
v-if=
"subItem.childItem.isShow"
>
<div
class=
"item"
v-if=
"subItem.childItem.hotelAddress!=''"
>
<span
class=
"label"
>
地址
</span>
...
...
@@ -1113,6 +1133,7 @@
<span
class=
"text"
>
{{subItem.childItem.url}}
</span>
</div>
</div>
<div
class=
"showMore"
@
click=
"getShowMore(subItem.childItem)"
>
{{subItem.childItem.isShow==true?'点我收起':'点我展开详情'}}
</div>
</div>
<div
class=
"Divtriangle"
>
<span></span>
...
...
@@ -1161,7 +1182,8 @@
navbar
:
false
,
title
:
false
},
FlightList
:
[],
StartData
:
""
}
},
mounted
()
{
...
...
@@ -1203,6 +1225,9 @@
this
.
apipost
(
'b2b_get_GetB2BTravelInfoV1'
,
this
.
msg
,
res
=>
{
if
(
res
.
data
.
resultCode
==
1
)
{
this
.
dataList
=
res
.
data
.
data
;
this
.
FlightList
=
res
.
data
.
data
.
currentPriceInfo
.
priceFlight
;
this
.
StartData
=
res
.
data
.
data
.
currentPriceInfo
.
startDate
;
console
.
log
(
"this.dataList"
,
this
.
dataList
);
this
.
isShow
=
true
;
this
.
getAllPoint
();
//装载景点酒店图片以供预览
...
...
@@ -1213,6 +1238,7 @@
if
(
y
.
childItem
.
imaArray
.
length
>
0
)
{
this
.
images
.
push
(
y
.
childItem
.
imaArray
[
0
].
url
);
}
y
.
childItem
.
isShow
=
true
}
})
})
...
...
@@ -1225,14 +1251,14 @@
getService
(
item
)
{
let
Obj
=
JSON
.
parse
(
item
);
let
str
=
''
Obj
[
0
].
checked
.
forEach
(
ckItem
=>
{
Obj
[
0
].
checked
.
forEach
(
ckItem
=>
{
Obj
[
0
].
list
.
forEach
(
x
=>
{
if
(
ckItem
==
x
.
ID
)
{
str
+=
x
.
Content
+
' '
if
(
ckItem
==
x
.
ID
)
{
str
+=
x
.
Content
+
' '
}
});
})
return
str
;
return
str
;
},
//滚动定位
goScroll
(
id
,
dayNum
)
{
...
...
@@ -1246,6 +1272,27 @@
this
.
crtnav
=
id
;
this
.
scrollobj
.
scrollTop
=
document
.
getElementById
(
id
).
offsetTop
;
},
addDate
(
date
,
days
)
{
if
(
days
==
0
)
{
return
date
;
}
var
date
=
new
Date
(
date
);
date
.
setDate
(
date
.
getDate
()
+
days
);
var
month
=
date
.
getMonth
()
+
1
;
var
day
=
date
.
getDate
();
return
date
.
getFullYear
()
+
'-'
+
this
.
getFormatDate
(
month
)
+
'-'
+
this
.
getFormatDate
(
day
);
},
// 日期月份/天的显示,如果是1位数,则在前面加上'0'
getFormatDate
(
arg
)
{
if
(
arg
==
undefined
||
arg
==
''
)
{
return
''
;
}
var
re
=
arg
+
''
;
if
(
re
.
length
<
2
)
{
re
=
'0'
+
re
;
}
return
re
;
},
//加载所有坐标点
getAllPoint
()
{
let
Arr
=
[];
...
...
@@ -1283,7 +1330,9 @@
var
arrivalTrafficArray
=
[];
var
hotelArray
=
[];
var
scenicArray
=
[];
this
.
dataList
.
dayList
.
forEach
(
item
=>
{
var
YesterdayObj
=
{};
//前一天
var
YesterdayHotelArray
=
[];
this
.
dataList
.
dayList
.
forEach
((
item
,
index
)
=>
{
if
(
item
.
dayNum
==
dayNum
)
{
item
.
dayArray
.
forEach
(
x
=>
{
if
(
x
.
type
==
1
)
{
...
...
@@ -1305,53 +1354,85 @@
})
}
//放入景点
if
(
x
.
type
==
2
)
{
if
(
x
.
childItem
.
pointArray
&&
x
.
childItem
.
pointArray
.
length
>
0
&&
x
.
childItem
.
pointArray
[
1
]
!=
''
&&
x
.
childItem
.
pointArray
[
0
]
!=
""
)
{
let
obj3
=
{
lat
:
x
.
childItem
.
pointArray
[
1
],
lng
:
x
.
childItem
.
pointArray
[
0
],
name
:
x
.
childItem
.
couponsName
,
type
:
2
}
scenicArray
.
push
(
obj3
);
}
var
tempScenicArray
=
this
.
getItemArray
(
item
,
2
);
if
(
tempScenicArray
&&
tempScenicArray
.
length
>
0
)
{
scenicArray
.
push
(...
tempScenicArray
);
}
//放入住宿
if
(
x
.
type
==
3
)
{
let
obj4
=
{
lat
:
x
.
childItem
.
pointArray
[
1
],
lng
:
x
.
childItem
.
pointArray
[
0
],
name
:
''
,
type
:
3
}
if
(
x
.
childItem
.
newHotelName
&&
x
.
childItem
.
newHotelName
!=
''
)
{
obj4
.
name
=
x
.
childItem
.
newHotelName
;
}
else
{
obj4
.
name
=
x
.
childItem
.
hotelName
;
}
hotelArray
.
push
(
obj4
);
var
tempHotelArray
=
this
.
getItemArray
(
item
,
3
);
if
(
tempHotelArray
&&
tempHotelArray
.
length
>
0
)
{
hotelArray
.
push
(...
tempHotelArray
);
}
})
});
if
(
item
.
dayNum
>
1
)
{
YesterdayObj
=
this
.
dataList
.
dayList
[
index
-
1
];
//放入住宿
var
tempHotelArray
=
this
.
getItemArray
(
YesterdayObj
,
3
);
if
(
tempHotelArray
&&
tempHotelArray
.
length
>
0
)
{
YesterdayHotelArray
.
push
(...
tempHotelArray
);
}
}
}
})
if
(
dayNum
==
1
||
dayNum
==
this
.
dataList
.
dayList
[
this
.
dataList
.
dayList
.
length
-
1
].
dayNum
)
{
if
(
startTrafficArray
&&
startTrafficArray
.
length
>
0
)
{
Arr
.
push
(...
startTrafficArray
)
console
.
log
(
"dayNum"
,
dayNum
);
var
newDayNum
=
dayNum
-
1
;
var
newDate
=
this
.
addDate
(
this
.
StartData
,
newDayNum
);
//第一天国内出发
if
(
dayNum
==
1
)
{
if
(
this
.
FlightList
&&
this
.
FlightList
.
length
>
0
)
{
this
.
FlightList
.
forEach
(
subItem
=>
{
if
(
subItem
.
startDate
==
newDate
)
{
Arr
.
push
({
lat
:
subItem
.
dLat
,
lng
:
subItem
.
dLng
,
name
:
subItem
.
departureAirPortName
,
type
:
1
});
Arr
.
push
({
lat
:
subItem
.
aLat
,
lng
:
subItem
.
aLng
,
name
:
subItem
.
arrivalAirPortName
,
type
:
1
})
}
});
}
}
else
{
if
(
startTrafficArray
&&
startTrafficArray
.
length
>
0
)
{
Arr
.
push
(
startTrafficArray
[
0
])
else
{
}
}
//从酒店出发
else
{
//最后一天
if
(
dayNum
==
this
.
dataList
.
dayList
[
this
.
dataList
.
dayList
.
length
-
1
].
dayNum
)
{
if
(
this
.
FlightList
&&
this
.
FlightList
.
length
>
0
)
{
this
.
FlightList
.
forEach
(
subItem
=>
{
if
(
subItem
.
startDate
==
newDate
)
{
Arr
.
push
({
lat
:
subItem
.
dLat
,
lng
:
subItem
.
dLng
,
name
:
subItem
.
departureAirPortName
,
type
:
1
});
Arr
.
push
({
lat
:
subItem
.
aLat
,
lng
:
subItem
.
aLng
,
name
:
subItem
.
arrivalAirPortName
,
type
:
1
})
}
});
}
}
else
{
if
(
dayNum
==
1
||
dayNum
==
this
.
dataList
.
dayList
[
this
.
dataList
.
dayList
.
length
-
1
].
dayNum
)
{
if
(
arrivalTrafficArray
&&
arrivalTrafficArray
.
length
>
0
)
{
Arr
.
push
(...
arrivalTrafficArray
)
}
}
if
(
scenicArray
&&
scenicArray
.
length
>
0
)
{
Arr
.
push
(...
scenicArray
)
}
...
...
@@ -1363,6 +1444,41 @@
this
.
travelLngLat
=
Arr
;
}
},
getItemArray
(
item
,
type
)
{
var
newArray
=
[];
item
.
dayArray
.
forEach
(
x
=>
{
//放入景点
if
(
x
.
type
==
type
&&
type
==
2
)
{
if
(
x
.
childItem
.
pointArray
&&
x
.
childItem
.
pointArray
.
length
>
0
&&
x
.
childItem
.
pointArray
[
1
]
!=
''
&&
x
.
childItem
.
pointArray
[
0
]
!=
""
)
{
let
obj3
=
{
lat
:
x
.
childItem
.
pointArray
[
1
],
lng
:
x
.
childItem
.
pointArray
[
0
],
name
:
x
.
childItem
.
couponsName
,
type
:
2
}
newArray
.
push
(
obj3
);
}
}
//放入住宿
if
(
x
.
type
==
type
&&
type
==
3
)
{
let
obj4
=
{
lat
:
x
.
childItem
.
pointArray
[
1
],
lng
:
x
.
childItem
.
pointArray
[
0
],
name
:
''
,
type
:
3
}
if
(
x
.
childItem
.
newHotelName
&&
x
.
childItem
.
newHotelName
!=
''
)
{
obj4
.
name
=
x
.
childItem
.
newHotelName
;
}
else
{
obj4
.
name
=
x
.
childItem
.
hotelName
;
}
newArray
.
push
(
obj4
);
}
})
return
newArray
;
},
getHotelArray
(
hotelArray
)
{
var
newArray
=
[];
if
(
hotelArray
!=
null
&&
hotelArray
.
length
>
0
)
{
...
...
@@ -1395,6 +1511,11 @@
}
}
catch
(
error
)
{}
},
//隐藏显示
getShowMore
(
item
){
item
.
isShow
=!
item
.
isShow
;
this
.
$forceUpdate
();
}
}
}
</
script
>
\ No newline at end of file
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