Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
B
bigwood
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
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
罗超
bigwood
Commits
2f2de9c4
Commit
2f2de9c4
authored
Mar 07, 2024
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增酒店详情判断
parent
908c379f
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
285 additions
and
135 deletions
+285
-135
hotelDetails.vue
src/components/hotel/list/hotelDetails.vue
+285
-135
No files found.
src/components/hotel/list/hotelDetails.vue
View file @
2f2de9c4
<
template
>
<
template
>
<q-card
class=
"bg-white q-py-lg column"
style=
"max-width: 1366px; min-width: 375px; width: 70%; height: 80vh"
>
<q-card
<div
class=
"q-px-lg q-mb-lg"
:class=
"
{ 'row justify-between': $q.platform.is.desktop }">
class=
"bg-white q-py-lg column"
<div
:class=
"
{ 'row items-center': $q.platform.is.desktop, '': $q.platform.is.mobile }">
style=
"max-width: 1366px; min-width: 375px; width: 70%; height: 80vh"
>
<div
class=
"q-px-lg q-mb-lg"
:class=
"
{ 'row justify-between': $q.platform.is.desktop }"
>
<div
:class=
"
{ 'row items-center': $q.platform.is.desktop, '': $q.platform.is.mobile }"
>
<div
class=
"mobile-only row items-center"
>
<div
class=
"mobile-only row items-center"
>
<div
class=
"text-weight-bold fz20 ellipsis"
style=
"width: 280px"
>
{{
h
.
Name
}}{{
h
.
Name
}}{{
h
.
Name
}}
</div>
<div
class=
"text-weight-bold fz20 ellipsis"
style=
"width: 280px"
>
<q-icon
class=
"text-grey-13 cursor-pointer text-right q-ml-sm"
name=
"close"
size=
"md"
v-close-popup
></q-icon>
{{
h
.
Name
}}{{
h
.
Name
}}{{
h
.
Name
}}
</div>
<q-icon
class=
"text-grey-13 cursor-pointer text-right q-ml-sm"
name=
"close"
size=
"md"
v-close-popup
></q-icon>
</div>
</div>
<div
class=
"text-weight-bold fz20 ellipsis desktop-only"
>
{{
h
.
Name
}}
</div>
<div
class=
"text-weight-bold fz20 ellipsis desktop-only"
>
{{
h
.
Name
}}
</div>
<div
:class=
"
{ 'q-ml-md': $q.platform.is.desktop }">
<div
:class=
"
{ 'q-ml-md': $q.platform.is.desktop }">
<q-rating
v-model=
"h.Star"
size=
"1.5em"
color=
"orange"
:max=
"h.Star"
readonly
/>
<q-rating
v-model=
"h.Star"
size=
"1.5em"
color=
"orange"
:max=
"h.Star"
readonly
/>
</div>
</div>
</div>
</div>
<q-icon
class=
"text-grey-13 cursor-pointer desktop-only"
name=
"close"
size=
"md"
v-close-popup
></q-icon>
<q-icon
class=
"text-grey-13 cursor-pointer desktop-only"
name=
"close"
size=
"md"
v-close-popup
></q-icon>
</div>
</div>
<q-scroll-area
:thumb-style=
"scrollStyle.thumbStyle"
:bar-style=
"scrollStyle.barStyle"
class=
"col q-px-lg"
>
<q-scroll-area
<!--
<div
class=
"q-py-md text-blue"
>
:thumb-style=
"scrollStyle.thumbStyle"
<span
class=
"fz14 text-weight-bold q-pr-sm"
>
{{
$t
(
'hotel.col.four'
)
}}
</span>
:bar-style=
"scrollStyle.barStyle"
<span
class=
"text-h5 text-weight-bold"
>
500-700
</span>
class=
"col q-px-lg"
<span
class=
"fz14 text-weight-bold"
>
{{
$t
(
'unit.jp'
)
}}
</span>
>
</div>
-->
<div
class=
"row nowrap"
>
<div
class=
"row nowrap"
>
<q-icon
class=
"text-grey-13 q-mr-xs"
name=
"place"
size=
"xs"
></q-icon>
<q-icon
class=
"text-grey-13 q-mr-xs"
name=
"place"
size=
"xs"
></q-icon>
<span
class=
"col fz14 text-weight-bold text-blick"
>
{{
h
.
Address
}}
</span>
<span
class=
"col fz14 text-weight-bold text-blick"
>
{{
h
.
Address
}}
</span>
</div>
</div>
<div
class=
"q-pt-sm"
:class=
"
{ row: $q.platform.is.desktop, column: $q.platform.is.mobile }">
<div
class=
"q-pt-sm"
:class=
"
{ row: $q.platform.is.desktop, column: $q.platform.is.mobile }"
>
<div>
<div>
<q-icon
class=
"text-grey-13 q-mr-xs"
name=
"phone"
size=
"xs"
></q-icon>
<q-icon
class=
"text-grey-13 q-mr-xs"
name=
"phone"
size=
"xs"
></q-icon>
<span
class=
"fz14 text-weight-bold text-blick"
>
{{
$t
(
'hotel.details.zuoji'
)
}}
:
</span>
<span
class=
"fz14 text-weight-bold text-blick"
>
{{
$t
(
"hotel.details.zuoji"
)
}}
:
</span
>
<span
class=
"fz14 text-weight-bold text-blue q-ml-sm q-mr-md"
>
{{
h
.
Tel
}}
</span>
<span
class=
"fz14 text-weight-bold text-blue q-ml-sm q-mr-md"
>
{{
h
.
Tel
}}
</span>
</div>
</div>
<div
:class=
"
{ 'q-mr-lg': $q.platform.is.desktop, 'q-mt-sm': $q.platform.is.mobile }">
<div
<span
class=
"fz14 text-weight-bold text-blick"
>
{{
$t
(
'hotel.details.chuanzhen'
)
}}
:
</span>
:class=
"
{ 'q-mr-lg': $q.platform.is.desktop, 'q-mt-sm': $q.platform.is.mobile }"
<span
class=
"fz14 text-weight-bold text-blue q-ml-sm"
>
{{
h
.
Fax
==
''
?
$t
(
'noneFax'
)
:
h
.
Fax
}}
</span>
>
</div>
<span
class=
"fz14 text-weight-bold text-blick"
<div
:class=
"
{ 'q-mr-lg': $q.platform.is.desktop, 'q-mt-sm': $q.platform.is.mobile }">
>
{{
$t
(
"hotel.details.chuanzhen"
)
}}
:
</span
<span
class=
"fz14 text-weight-bold text-blick"
>
{{
$t
(
'hotel.details.guanwang'
)
}}
:
</span>
>
<a
class=
"fz14 text-weight-bold text-blue q-ml-sm"
:href=
"h.URL"
target=
"_blank"
>
{{
h
.
URL
}}
</a>
<span
class=
"fz14 text-weight-bold text-blue q-ml-sm"
>
{{
</div>
h
.
Fax
==
""
?
$t
(
"noneFax"
)
:
h
.
Fax
}}
</span>
</div>
</div>
<div
class=
"q-py-lg no-wrap col"
:class=
"
{ row: $q.platform.is.desktop, column: $q.platform.is.mobile }">
<div
<div
class=
"row rounded-borders relative-position"
:class=
"
{ 'q-mr-lg': $q.platform.is.desktop, 'q-mt-sm': $q.platform.is.mobile }"
:class=
"
{ 'col-6': $q.platform.is.desktop, 'height-320': $q.platform.is.mobile }" style="overflow: hidden"
>
v-if="h.List">
<span
class=
"fz14 text-weight-bold text-blick"
<div
v-if=
"h.ChainBrand"
class=
"f12 absolute-left bg-white"
>
{{
$t
(
"hotel.details.guanwang"
)
}}
:
</span
style=
"padding: 5px; bottom: unset; z-index: 1; border-bottom-right-radius: 4px"
>
>
<a
class=
"fz14 text-weight-bold text-blue q-ml-sm"
:href=
"h.URL"
target=
"_blank"
>
{{
h
.
URL
}}
</a
>
</div>
</div>
<div
class=
"q-py-lg no-wrap col"
:class=
"
{ row: $q.platform.is.desktop, column: $q.platform.is.mobile }"
>
<div
class=
"row rounded-borders relative-position"
:class=
"
{
'col-6': $q.platform.is.desktop,
'height-320': $q.platform.is.mobile,
}"
style="overflow: hidden"
v-if="h.List"
>
<div
v-if=
"h.ChainBrand"
class=
"f12 absolute-left bg-white"
style=
"
padding: 5px;
bottom: unset;
z-index: 1;
border-bottom-right-radius: 4px;
"
>
<div
class=
"row items-center rounded-borders"
style=
"overflow: hidden"
>
<div
class=
"row items-center rounded-borders"
style=
"overflow: hidden"
>
<div
class=
"bg-dark text-white"
style=
"padding: 0 4px; font-size: 12px"
>
品牌
</div>
<div
class=
"bg-dark text-white"
style=
"padding: 0 4px; font-size: 12px"
>
<div
class=
"text-dark"
style=
"padding: 0 4px; font-size: 12px; background: #f0bd86"
>
{{
h
.
ChainBrand
}}
品牌
</div>
</div>
</div>
<div
</div>
class=
"text-dark"
<div
class=
"col-7"
style=
"padding: 0 4px; font-size: 12px; background: #f0bd86"
:class=
"
{ 'col-7': h.List.length >= 3, 'col-6': h.List.length == 2, 'col-12': h.List.length == 1 }">
>
<q-img
@
click=
"showImageHandler(`http://imgfile.oytour.com$
{h.List[0].Path}`)"
{{
h
.
ChainBrand
}}
:src="`http://imgfile.oytour.com${h.List[0].Path}`" spinner-color="drk" spinner-size="20px" height="100%"
</div>
mode="cover" />
</div>
</div>
<div
class=
"col-7"
:class=
"
{
'col-7': h.List.length >= 3,
'col-6': h.List.length == 2,
'col-12': h.List.length == 1,
}"
>
<q-img
@
click=
"showImageHandler(`http://imgfile.oytour.com$
{h.List[0].Path}`)"
:src="`http://imgfile.oytour.com${h.List[0].Path}`"
spinner-color="drk"
spinner-size="20px"
height="100%"
mode="cover"
/>
</div>
</div>
<div
class=
"col q-pl-sm"
v-if=
"h.List.length > 1"
>
<div
class=
"col q-pl-sm"
v-if=
"h.List.length > 1"
>
<div
:style=
"
{ height: h.List.length > 2 ? '50%' : '100%' }">
<div
:style=
"
{ height: h.List.length > 2 ? '50%' : '100%' }">
<q-img
@
click=
"showImageHandler(`http://imgfile.oytour.com$
{h.List[1].Path}`)"
<q-img
:src="`http://imgfile.oytour.com${h.List[1].Path}`" spinner-color="drk" spinner-size="20px"
@
click=
"showImageHandler(`http://imgfile.oytour.com$
{h.List[1].Path}`)"
height="100%" mode="cover" />
:src="`http://imgfile.oytour.com${h.List[1].Path}`"
</div>
spinner-color="drk"
<div
class=
"row items-end q-pt-sm"
style=
"height: 50%"
v-if=
"h.List.length > 2"
>
spinner-size="20px"
<q-img
@
click=
"showImageHandler(`http://imgfile.oytour.com$
{h.List[2].Path}`)"
height="100%"
:src="`http://imgfile.oytour.com${h.List[2].Path}`" spinner-color="drk" spinner-size="20px"
mode="cover"
height="100%" mode="cover">
/>
<div
class=
"absolute-full text-subtitle2 flex flex-center"
v-if=
"h.List.length > 3"
>
</div>
<div
class=
"row items-end q-pt-sm"
style=
"height: 50%"
v-if=
"h.List.length > 2"
>
<q-img
@
click=
"showImageHandler(`http://imgfile.oytour.com$
{h.List[2].Path}`)"
:src="`http://imgfile.oytour.com${h.List[2].Path}`"
spinner-color="drk"
spinner-size="20px"
height="100%"
mode="cover"
>
<div
class=
"absolute-full text-subtitle2 flex flex-center"
v-if=
"h.List.length > 3"
>
<span
class=
"fz20 text-weight-bold"
>
+
</span>
<span
class=
"fz20 text-weight-bold"
>
+
</span>
<span
class=
"text-h5 text-weight-bold"
>
{{
h
.
List
.
length
-
3
}}
</span>
<span
class=
"text-h5 text-weight-bold"
>
{{
h
.
List
.
length
-
3
}}
</span>
</div>
</div>
...
@@ -74,122 +164,170 @@
...
@@ -74,122 +164,170 @@
</div>
</div>
</div>
</div>
</div>
</div>
<div
class=
"rounded-borders"
<div
:class=
"
{ 'q-ml-sm col': $q.platform.is.desktop, 'q-mt-sm height-320': $q.platform.is.mobile }"
class=
"rounded-borders"
style="overflow: hidden" id="baiduMap">
:class=
"
{
<GoogleMap
api-key=
"AIzaSyCvRZN9lGl3y3EsM0A0sWPf1pZ2olGsyNg"
style=
"width: 100%; height: 100%"
'q-ml-sm col': $q.platform.is.desktop,
:center=
"center"
:zoom=
"15"
v-if=
"center"
>
'q-mt-sm height-320': $q.platform.is.mobile,
}"
style="overflow: hidden"
id="baiduMap"
>
<GoogleMap
api-key=
"AIzaSyCvRZN9lGl3y3EsM0A0sWPf1pZ2olGsyNg"
style=
"width: 100%; height: 100%"
:center=
"center"
:zoom=
"15"
v-if=
"center"
>
<Marker
:options=
"
{ position: center }" />
<Marker
:options=
"
{ position: center }" />
</GoogleMap>
</GoogleMap>
</div>
</div>
</div>
</div>
<div
class=
"bg-light-blue-1 q-pa-md fz14 rounded-borders"
>
<div
class=
"bg-light-blue-1 q-pa-md fz14 rounded-borders"
>
<div
class=
"text-weight-bold"
>
{{
$t
(
'hotel.details.xiangqing'
)
}}
</div>
<div
class=
"text-weight-bold"
>
{{
$t
(
"hotel.details.xiangqing"
)
}}
</div>
<div
class=
"text-grey-8 q-mt-sm"
>
{{
h
.
Descriptions
}}
</div>
<div
class=
"text-grey-8 q-mt-sm"
>
{{
h
.
Descriptions
}}
</div>
</div>
</div>
<div
:class=
"
{ 'q-px-lg': $q.platform.is.desktop }">
<div
:class=
"
{ 'q-px-lg': $q.platform.is.desktop }">
<div
class=
"q-mt-lg row"
>
<div
class=
"q-mt-lg row"
>
<div
class=
"col-3 f12 text-grey-500"
>
{{
$t
(
'hd.item.a'
)
}}
</div>
<div
class=
"col-3 f12 text-grey-500"
>
{{
$t
(
"hd.item.a"
)
}}
</div>
<div
class=
"col text-subtitle2 text-weight-bolder"
>
{{
moneyFormat
(
h
.
InTangTax
)
}}
</div>
<div
class=
"col text-subtitle2 text-weight-bolder"
>
{{
moneyFormat
(
h
.
InTangTax
)
}}
</div>
</div>
</div>
</div>
</div>
<div
:class=
"
{ 'q-px-lg': $q.platform.is.desktop }">
<div
:class=
"
{ 'q-px-lg': $q.platform.is.desktop }">
<div
class=
"q-mt-lg row"
>
<div
class=
"q-mt-lg row"
>
<div
class=
"col-3 f12 text-grey-500"
>
{{
$t
(
'hd.item.b'
)
}}
</div>
<div
class=
"col-3 f12 text-grey-500"
>
{{
$t
(
"hd.item.b"
)
}}
</div>
<div
class=
"col text-subtitle2 text-weight-bolder"
>
{{
moneyFormat
(
h
.
CityTax
)
}}
</div>
<div
class=
"col text-subtitle2 text-weight-bolder"
>
{{
moneyFormat
(
h
.
CityTax
)
}}
</div>
</div>
</div>
</div>
</div>
<div
:class=
"
{ 'q-px-lg': $q.platform.is.desktop }">
<div
:class=
"
{ 'q-px-lg': $q.platform.is.desktop }">
<div
class=
"q-mt-lg row"
>
<div
class=
"q-mt-lg row"
>
<div
class=
"col-3 f12 text-grey-500"
>
{{
$t
(
'hd.item.c'
)
}}
</div>
<div
class=
"col-3 f12 text-grey-500"
>
{{
$t
(
"hd.item.c"
)
}}
</div>
<div
class=
"col text-subtitle2 text-weight-bolder"
>
<div
class=
"col text-subtitle2 text-weight-bolder"
>
{{
h
.
IsHavearking
==
0
?
$t
(
'none'
)
:
$t
(
'have'
)
}}
{{
h
.
IsHavearking
==
0
?
$t
(
"none"
)
:
$t
(
"have"
)
}}
<span
class=
"q-ml-md hotel-info-item"
v-if=
"h.IsHavearking == 1"
>
{{
<span
class=
"q-ml-md hotel-info-item"
v-if=
"h.IsHavearking == 1"
>
{{
h
.
ParkFee
==
0
?
$t
(
'free'
)
:
h
.
ParkFee
==
0
?
$t
(
"free"
)
:
moneyFormat
(
h
.
ParkFee
)
+
$t
(
"unit.jp"
)
moneyFormat
(
h
.
ParkFee
)
+
$t
(
'unit.jp'
)
}}
</span>
}}
</span>
</div>
</div>
</div>
</div>
</div>
</div>
<div
:class=
"
{ 'q-px-lg': $q.platform.is.desktop }">
<div
:class=
"
{ 'q-px-lg': $q.platform.is.desktop }">
<div
class=
"q-mt-lg row"
>
<div
class=
"q-mt-lg row"
>
<div
class=
"col-3 f12 text-grey-500"
>
{{
$t
(
'hd.item.d'
)
}}
</div>
<div
class=
"col-3 f12 text-grey-500"
>
{{
$t
(
"hd.item.d"
)
}}
</div>
<div
class=
"col text-subtitle2 text-weight-bolder"
>
{{
$t
(
'before'
)
+
h
.
DieLine
+
$t
(
'unit.day'
)
}}
</div>
<div
class=
"col text-subtitle2 text-weight-bolder"
>
{{
$t
(
"before"
)
+
h
.
DieLine
+
$t
(
"unit.day"
)
}}
</div>
</div>
</div>
</div>
</div>
<div
:class=
"
{ 'q-px-lg': $q.platform.is.desktop }">
<div
:class=
"
{ 'q-px-lg': $q.platform.is.desktop }">
<div
class=
"q-mt-lg row"
>
<div
class=
"q-mt-lg row"
>
<div
class=
"col-3 f12 text-grey-500"
>
{{
$t
(
'hd.item.e'
)
}}
</div>
<div
class=
"col-3 f12 text-grey-500"
>
{{
$t
(
"hd.item.e"
)
}}
</div>
<div
class=
"col text-subtitle2 text-weight-bolder"
>
<div
class=
"col text-subtitle2 text-weight-bolder"
>
{{
!
h
.
isDinner
?
$t
(
'none'
)
:
$t
(
'have'
)
}}
{{
!
h
.
isDinner
?
$t
(
"none"
)
:
$t
(
"have"
)
}}
<span
v-if=
"h.isDinner"
class=
"q-ml-md hotel-info-item"
v-for=
"x in h.Dinners"
>
{{
x
.
Name
}}
</span>
<span
v-if=
"h.isDinner"
class=
"q-ml-md hotel-info-item"
v-for=
"x in h.Dinners"
>
{{
x
.
Name
}}
</span
>
</div>
</div>
</div>
</div>
</div>
</div>
<div
:class=
"
{ 'q-px-lg': $q.platform.is.desktop }">
<div
:class=
"
{ 'q-px-lg': $q.platform.is.desktop }">
<div
class=
"q-mt-lg row"
>
<div
class=
"q-mt-lg row"
>
<div
class=
"col-3 f12 text-grey-500"
>
{{
$t
(
'hd.item.f'
)
}}
</div>
<div
class=
"col-3 f12 text-grey-500"
>
{{
$t
(
"hd.item.f"
)
}}
</div>
<div
class=
"col text-subtitle2 text-weight-bolder"
>
{{
h
.
HotelTypeInfo
?.
Name
}}
</div>
<div
class=
"col text-subtitle2 text-weight-bolder"
>
{{
h
.
HotelTypeInfo
?.
Name
}}
</div>
</div>
</div>
</div>
</div>
<div
:class=
"
{ 'q-px-lg': $q.platform.is.desktop }">
<div
:class=
"
{ 'q-px-lg': $q.platform.is.desktop }">
<div
class=
"q-mt-lg row"
>
<div
class=
"q-mt-lg row"
>
<div
class=
"col-3 f12 text-grey-500"
>
{{
$t
(
'hd.item.g'
)
}}
</div>
<div
class=
"col-3 f12 text-grey-500"
>
{{
$t
(
"hd.item.g"
)
}}
</div>
<div
class=
"col text-subtitle2 text-weight-bolder row items-center q-gutter-sm"
v-if=
"h.CheckHotelService"
>
<div
<span
class=
"hotel-info-item"
v-for=
"(x, i) in h.CheckHotelService"
>
{{
x
.
Content
}}
</span>
class=
"col text-subtitle2 text-weight-bolder row items-center q-gutter-sm"
v-if=
"h.CheckHotelService"
>
<span
class=
"hotel-info-item"
v-for=
"(x, i) in h.CheckHotelService"
>
{{
x
.
Content
}}
</span>
</div>
</div>
</div>
</div>
</div>
</div>
<div
class=
"q-mt-lg"
>
<div
class=
"q-mt-lg"
>
<div
class=
"bg-orange-1 q-pa-md rounded-borders fz14"
style=
"border: 1px dashed orange"
>
<div
<div
class=
"text-weight-bold"
>
{{
$t
(
'hd.item.h'
)
}}
</div>
class=
"bg-orange-1 q-pa-md rounded-borders fz14"
style=
"border: 1px dashed orange"
>
<div
class=
"text-weight-bold"
>
{{
$t
(
"hd.item.h"
)
}}
</div>
<div
class=
"text-grey-700 q-mt-sm"
>
{{
h
.
WarmTip
}}
</div>
<div
class=
"text-grey-700 q-mt-sm"
>
{{
h
.
WarmTip
}}
</div>
</div>
</div>
</div>
</div>
</q-scroll-area>
</q-scroll-area>
</q-card>
</q-card>
<q-inner-loading
:showing=
"loading"
:label=
"$t('loading')"
label-class=
"text-grey-6 f12"
/>
<q-inner-loading
<q-dialog
class=
"no-padding"
v-model=
"showImagePriview"
persistent
v-if=
"images && images.length > 0"
>
:showing=
"loading"
:label=
"$t('loading')"
label-class=
"text-grey-6 f12"
/>
<q-dialog
class=
"no-padding"
v-model=
"showImagePriview"
persistent
v-if=
"images && images.length > 0"
>
<image-preview
:current=
"currentImage"
:images=
"images"
></image-preview>
<image-preview
:current=
"currentImage"
:images=
"images"
></image-preview>
</q-dialog>
</q-dialog>
</
template
>
</
template
>
<
script
lang=
"ts"
>
<
script
lang=
"ts"
>
import
{
defineComponent
,
ref
,
reactive
,
toRefs
,
provide
,
onMounted
,
inject
,
watch
,
onBeforeUnmount
,
computed
}
from
'vue'
import
{
import
{
useI18n
}
from
'vue-i18n'
defineComponent
,
import
{
useQuasar
}
from
'quasar'
ref
,
import
useScrollModule
from
'src/module/scrollbar/scrollModule'
reactive
,
import
HotelService
from
'src/api/hotel'
toRefs
,
import
message
from
'src/utils/message'
provide
,
import
{
ApiResult
}
from
'src/@types/enumHelper'
onMounted
,
import
{
getDinners
,
getHotelType
,
moneyFormat
}
from
'src/utils/tools'
inject
,
import
{
DinnerType
,
HotelType
}
from
'src/@types'
watch
,
import
ImagePreview
from
'src/components/common/ImagePreview.vue'
onBeforeUnmount
,
import
{
GoogleMap
,
Marker
}
from
'vue3-google-map'
computed
,
import
{
DirtionmaryHelper
}
from
'src/config/dictionary'
}
from
"vue"
;
import
{
useI18n
}
from
"vue-i18n"
;
import
{
useQuasar
}
from
"quasar"
;
import
useScrollModule
from
"src/module/scrollbar/scrollModule"
;
import
HotelService
from
"src/api/hotel"
;
import
message
from
"src/utils/message"
;
import
{
ApiResult
}
from
"src/@types/enumHelper"
;
import
{
getDinners
,
getHotelType
,
moneyFormat
}
from
"src/utils/tools"
;
import
{
DinnerType
,
HotelType
}
from
"src/@types"
;
import
ImagePreview
from
"src/components/common/ImagePreview.vue"
;
import
{
GoogleMap
,
Marker
}
from
"vue3-google-map"
;
import
{
DirtionmaryHelper
}
from
"src/config/dictionary"
;
export
default
defineComponent
({
export
default
defineComponent
({
components
:
{
ImagePreview
,
GoogleMap
,
Marker
},
components
:
{
ImagePreview
,
GoogleMap
,
Marker
},
props
:
{
props
:
{
hotelId
:
{
hotelId
:
{
type
:
Number
,
type
:
Number
,
required
:
true
required
:
true
,
}
}
,
},
},
setup
(
props
,
context
)
{
setup
(
props
,
context
)
{
const
{
t
}
=
useI18n
()
const
{
t
}
=
useI18n
()
;
watch
(
watch
(
()
=>
props
.
hotelId
,
()
=>
props
.
hotelId
,
(
n
,
o
)
=>
{
(
n
,
o
)
=>
{
data
.
hotelId
=
n
data
.
hotelId
=
n
;
methods
.
initHotel
()
methods
.
initHotel
()
;
}
}
)
)
;
const
$q
=
useQuasar
()
const
$q
=
useQuasar
()
;
const
data
=
reactive
({
const
data
=
reactive
({
scrollStyle
:
{}
as
any
,
scrollStyle
:
{}
as
any
,
loading
:
true
,
loading
:
true
,
...
@@ -198,70 +336,82 @@ export default defineComponent({
...
@@ -198,70 +336,82 @@ export default defineComponent({
dinners
:
getDinners
(),
dinners
:
getDinners
(),
hotelTyps
:
getHotelType
(),
hotelTyps
:
getHotelType
(),
images
:
[]
as
Array
<
string
>
,
images
:
[]
as
Array
<
string
>
,
currentImage
:
''
,
currentImage
:
""
,
showImagePriview
:
false
,
showImagePriview
:
false
,
center
:
null
as
any
center
:
null
as
any
,
})
})
;
data
.
scrollStyle
=
useScrollModule
().
scrollStyle
data
.
scrollStyle
=
useScrollModule
().
scrollStyle
;
const
methods
=
{
const
methods
=
{
initMap
(
lat
:
any
,
lng
:
any
)
{
initMap
(
lat
:
any
,
lng
:
any
)
{
let
country
=
localStorage
.
getItem
(
DirtionmaryHelper
.
USER_IN_COUNTRY
)
??
'GW'
let
country
=
localStorage
.
getItem
(
DirtionmaryHelper
.
USER_IN_COUNTRY
)
??
"GW"
;
if
(
country
!=
'CN'
)
{
if
(
country
!=
"CN"
)
{
data
.
center
=
{
lat
:
parseFloat
(
lng
),
lng
:
parseFloat
(
lat
)
}
data
.
center
=
{
lat
:
parseFloat
(
lng
),
lng
:
parseFloat
(
lat
)
}
;
}
else
{
}
else
{
let
Bmap
=
window
.
BMapGL
// 注意要带window,不然会报错(注意官方api,会有改动,之前是Bmap,后面3.0版本改为了BMap,最好查文档或者打印一下window)
let
Bmap
=
window
.
BMapGL
;
// 注意要带window,不然会报错(注意官方api,会有改动,之前是Bmap,后面3.0版本改为了BMap,最好查文档或者打印一下window)
var
b
=
new
Bmap
.
Map
(
'baiduMap'
)
var
b
=
new
Bmap
.
Map
(
"baiduMap"
);
b
.
centerAndZoom
(
new
Bmap
.
Point
(
lat
,
lng
),
15
)
b
.
centerAndZoom
(
new
Bmap
.
Point
(
lat
,
lng
),
15
)
;
b
.
enableScrollWheelZoom
(
true
)
b
.
enableScrollWheelZoom
(
true
)
;
b
.
addOverlay
(
new
Bmap
.
Marker
(
new
Bmap
.
Point
(
lat
,
lng
)))
b
.
addOverlay
(
new
Bmap
.
Marker
(
new
Bmap
.
Point
(
lat
,
lng
)))
;
}
}
},
},
initHotel
()
{
initHotel
()
{
data
.
loading
=
true
data
.
loading
=
true
;
HotelService
.
GetHotelDetail
(
data
.
hotelId
)
HotelService
.
GetHotelDetail
(
data
.
hotelId
)
.
then
(
r
=>
{
.
then
(
(
r
)
=>
{
if
(
r
.
data
.
resultCode
==
ApiResult
.
SUCCESS
)
{
if
(
r
.
data
.
resultCode
==
ApiResult
.
SUCCESS
)
{
let
temp
=
r
.
data
.
data
let
temp
=
r
.
data
.
data
;
temp
.
isDinner
=
temp
.
UseDinnerType
&&
temp
.
UseDinnerType
!=
''
temp
.
isDinner
=
temp
.
UseDinnerType
&&
temp
.
UseDinnerType
!=
""
;
if
(
temp
.
isDinner
)
{
if
(
temp
.
isDinner
)
{
if
(
data
.
dinners
&&
data
.
dinners
.
length
>
0
)
{
temp
.
Dinners
=
data
.
dinners
.
filter
((
x
:
DinnerType
)
=>
{
temp
.
Dinners
=
data
.
dinners
.
filter
((
x
:
DinnerType
)
=>
{
return
temp
.
UseDinnerType
.
split
(
','
).
indexOf
(
x
.
Id
.
toString
())
!=
-
1
return
temp
.
UseDinnerType
.
split
(
","
).
indexOf
(
x
.
Id
.
toString
())
!=
-
1
;
})
});
}
}
temp
.
HotelTypeInfo
=
data
.
hotelTyps
.
find
((
x
:
HotelType
)
=>
x
.
Id
==
temp
.
HotelType
)
}
let
tempService
=
JSON
.
parse
(
temp
.
FacilityServices
)[
0
]
??
{}
temp
.
HotelTypeInfo
=
data
.
hotelTyps
.
find
(
temp
.
CheckHotelService
=
tempService
.
list
.
filter
((
x
:
any
)
=>
tempService
.
checked
.
indexOf
(
x
.
ID
)
!=
-
1
)
(
x
:
HotelType
)
=>
x
.
Id
==
temp
.
HotelType
data
.
h
=
temp
);
//http://imgfile.oytour.com${h.List[2].Path}
let
tempService
=
JSON
.
parse
(
temp
.
FacilityServices
)[
0
]
??
{};
if
(
tempService
&&
tempService
.
list
&&
tempService
.
list
.
length
>
0
)
{
temp
.
CheckHotelService
=
tempService
.
list
.
filter
(
(
x
:
any
)
=>
tempService
.
checked
.
indexOf
(
x
.
ID
)
!=
-
1
);
}
data
.
h
=
temp
;
if
(
data
.
h
&&
data
.
h
.
List
&&
data
.
h
.
List
.
length
>
0
)
{
data
.
h
.
List
.
forEach
((
x
:
any
)
=>
{
data
.
h
.
List
.
forEach
((
x
:
any
)
=>
{
data
.
images
.
push
(
`http://imgfile.oytour.com
${
x
.
Path
}
`
)
data
.
images
.
push
(
`http://imgfile.oytour.com
${
x
.
Path
}
`
);
})
});
methods
.
initMap
(
data
.
h
.
Lng
,
data
.
h
.
Lat
)
}
if
(
data
.
h
&&
data
.
h
.
Lng
&&
data
.
h
.
Lat
)
{
methods
.
initMap
(
data
.
h
.
Lng
,
data
.
h
.
Lat
);
}
}
else
{
}
else
{
message
.
errorMsg
(
r
.
data
.
message
)
message
.
errorMsg
(
r
.
data
.
message
)
;
}
}
data
.
loading
=
false
data
.
loading
=
false
;
})
.
catch
(
e
=>
{
data
.
loading
=
false
message
.
errorMsg
(
e
.
message
)
})
})
.
catch
((
e
)
=>
{
data
.
loading
=
false
;
message
.
errorMsg
(
e
.
message
);
});
},
},
showImageHandler
(
url
:
string
)
{
showImageHandler
(
url
:
string
)
{
data
.
currentImage
=
url
data
.
currentImage
=
url
;
data
.
showImagePriview
=
true
data
.
showImagePriview
=
true
;
}
}
,
}
}
;
onMounted
(()
=>
{
onMounted
(()
=>
{
methods
.
initHotel
()
methods
.
initHotel
()
;
})
})
;
return
{
...
toRefs
(
data
),
...
methods
,
moneyFormat
}
return
{
...
toRefs
(
data
),
...
methods
,
moneyFormat
}
;
}
}
,
})
})
;
</
script
>
</
script
>
<
style
>
<
style
>
...
@@ -280,7 +430,7 @@ export default defineComponent({
...
@@ -280,7 +430,7 @@ export default defineComponent({
.hotel-info-item
::before
{
.hotel-info-item
::before
{
display
:
inline
;
display
:
inline
;
content
:
'·'
;
content
:
"·"
;
font-weight
:
bolder
;
font-weight
:
bolder
;
margin-right
:
4px
;
margin-right
:
4px
;
}
}
...
...
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