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
e81904b6
Commit
e81904b6
authored
Jun 24, 2019
by
华国豪
🙄
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复定位不得行
parent
57b48df1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
214 additions
and
150 deletions
+214
-150
index.html
public/index.html
+1
-1
newHead.vue
src/components/global/newHead.vue
+209
-148
vue.config.js
vue.config.js
+4
-1
No files found.
public/index.html
View file @
e81904b6
...
...
@@ -811,7 +811,7 @@
google
.
maps
.
MarkerWithLabel
=
MarkerWithLabel
;
</script>
<!-- <script src="http://pv.sohu.com/cityjson?ie=utf-8"></script> -->
<script
type=
"text/javascript"
src=
"https://webapi.amap.com/maps?v=1.3&key=
d4332e5adb8b584442266763d20b978c
"
></script>
<script
type=
"text/javascript"
src=
"https://webapi.amap.com/maps?v=1.3&key=
86f2f611126f36b93cf2ef280300524f&plugin=AMap.CitySearch
"
></script>
<link
rel=
"icon"
href=
"<%= BASE_URL %>favicon.ico"
>
<title>
athena
</title>
</head>
...
...
src/components/global/newHead.vue
View file @
e81904b6
<
style
>
@import
"../../assets/mall/newHead.css"
;
.new_header
.el-menu--horizontal
>
.el-submenu.is-active
.el-submenu__title
{
color
:
#fff
!important
;
border-bottom
:
2px
solid
#DF3343
!important
;
.new_header
.el-menu--horizontal
>
.el-submenu.is-active
.el-submenu__title
{
color
:
#fff
!important
;
border-bottom
:
2px
solid
#df3343
!important
;
}
.CityChange
{
width
:
100px
;
background
:
rgba
(
242
,
242
,
242
,
1
);
border
:
1px
solid
rgba
(
230
,
230
,
230
,
1
);
border-radius
:
6px
;
padding-left
:
6px
;
.CityChange
{
width
:
100px
;
background
:
rgba
(
242
,
242
,
242
,
1
);
border
:
1px
solid
rgba
(
230
,
230
,
230
,
1
);
border-radius
:
6px
;
padding-left
:
6px
;
box-sizing
:
border-box
;
}
.CityChange
i
{
color
:
#EE4454
;
.CityChange
i
{
color
:
#ee4454
;
}
.CityChange
.el-select
{
.CityChange
.el-select
{
display
:
inline-block
;
width
:
75px
;
border
:
none
;
width
:
75px
;
border
:
none
;
}
.CityChange
.el-select
.el-input__inner
{
background
:
rgba
(
242
,
242
,
242
,
1
);
border
:
none
;
.CityChange
.el-select
.el-input__inner
{
background
:
rgba
(
242
,
242
,
242
,
1
);
border
:
none
;
outline
:
none
;
padding
:
0
4px
;
padding
:
0
4px
;
}
.CityChange
.el-select
.el-input__inner
:focus
{
border
:
none
;
.CityChange
.el-select
.el-input__inner
:focus
{
border
:
none
;
}
</
style
>
<
template
>
...
...
@@ -43,7 +42,11 @@
<!-- 语言下拉 -->
<el-dropdown
trigger=
"click"
>
<span
class=
"el-dropdown-link"
>
<i
class=
"iconfont icon-duoyuyan"
></i><span
v-if=
"language===1"
>
简体中文
<i
class=
"iconfont icon-xia"
></i></span>
<i
class=
"iconfont icon-duoyuyan"
></i>
<span
v-if=
"language===1"
>
简体中文
<i
class=
"iconfont icon-xia"
></i>
</span>
</span>
<el-dropdown-menu
class=
"changelanguage"
slot=
"dropdown"
>
<el-dropdown-item
@
click
.
native=
"language = 1"
>
简体中文
</el-dropdown-item>
...
...
@@ -55,22 +58,28 @@
<ul
class=
"clearfix"
>
<!-- 登录 -->
<li>
<template
v-if=
'!user.account'
>
<span
class=
"nav_right_login __cp"
@
click=
"goLoginUrl('login',1)"
>
您好,请登录
</span>
<template
v-if=
"!user.account"
>
<span
class=
"nav_right_login __cp"
@
click=
"goLoginUrl('login',1)"
>
您好,请登录
</span>
<span
class=
"nav_right_register"
v-if=
"register"
>
免费注册
</span>
<span
class=
"__splice"
>
|
</span>
</
template
>
<
template
v-else
>
欢迎您
<span
class=
"nav_right_login"
>
<span
class=
"_name"
>
{{
user
.
name
}}
</span>
<span
@
click=
"goLoginUrl('login',1)"
class=
"__cp"
>
退出
</span>
</span>
<span
class=
"nav_right_login"
>
<span
class=
"_name"
>
{{
user
.
name
}}
</span>
<span
@
click=
"goLoginUrl('login',1)"
class=
"__cp"
>
退出
</span>
</span>
<span
class=
"__splice"
>
|
</span>
</
template
>
</li>
<!-- 个人中心 -->
<li
v-if=
'user.account'
>
<li
v-if=
"user.account"
>
<el-dropdown
trigger=
"click"
placement=
"bottom-start"
>
<span
class=
"el-dropdown-link"
>
<span
class=
"__cp"
>
个人中心
<i
class=
"iconfont icon-xia"
></i></span>
<span
class=
"__cp"
>
个人中心
<i
class=
"iconfont icon-xia"
></i>
</span>
</span>
<el-dropdown-menu
class=
"changelanguage"
slot=
"dropdown"
>
<el-dropdown-item
@
click
.
native=
"goUrl('newPersonalCenter', '1')"
>
个人中心
</el-dropdown-item>
...
...
@@ -81,7 +90,7 @@
<!-- <el-dropdown-item @click.native="goUrl('integral')">我的积分</el-dropdown-item> -->
<el-dropdown-item
@
click
.
native=
"goUrl('newPersonalCenter', '5')"
>
我的优惠券
</el-dropdown-item>
<!-- <el-dropdown-item @click.native="">我的奖品</el-dropdown-item>
<el-dropdown-item @click.native="">活动中心</el-dropdown-item>
-->
<el-dropdown-item @click.native="">活动中心</el-dropdown-item>-->
</el-dropdown-menu>
</el-dropdown>
<span
class=
"__splice"
>
|
</span>
...
...
@@ -100,7 +109,7 @@
</el-dropdown-menu>
</el-dropdown>
<span class="__splice">|</span>
</li>
-->
</li>-->
<li>
<span
class=
"__cp"
>
客服中心
</span>
<span
class=
"__splice"
>
|
</span>
...
...
@@ -118,17 +127,21 @@
<el-row
class=
"_flex_center"
>
<!-- 左 logo -->
<el-col
:span=
"5"
>
<img
class=
"logo"
src=
"../../assets/img/logo_t.png"
alt
=
""
>
<img
class=
"logo"
src=
"../../assets/img/logo_t.png"
alt
>
</el-col>
<!-- 中 搜索框 -->
<el-col
:span=
"2"
>
<div
class=
"CityChange"
>
<i
class=
"iconfont icon-ditu"
></i>
<el-select
v-model=
"city"
placeholder=
"请选择"
@
change=
"changeSite"
>
<el-option
v-for=
"item in sites"
:key=
"item.companyId"
:label=
"item.siteName"
:value=
"item.companyId"
></el-option>
<el-option
v-for=
"item in sites"
:key=
"item.companyId"
:label=
"item.siteName"
:value=
"item.companyId"
></el-option>
</el-select>
</div>
</el-col>
<el-col
:span=
"10"
:offset=
"1"
>
<div
class=
"_search_box _flex_center"
>
...
...
@@ -140,8 +153,16 @@
<el-option
label=
"机票"
value=
"3"
></el-option>
</el-select>
<span
class=
"_splice"
></span>
<el-input
class=
"wb60"
placeholder=
"搜索旅行地/酒店/旅游/门票/签证"
size=
"mini"
@
keyup
.
enter=
'goSearch'
v-model=
"searchText"
></el-input>
<span
class=
"_search_btn __cp"
@
click=
"goSearch"
>
<i
class=
"iconfont icon-search"
></i></span>
<el-input
class=
"wb60"
placeholder=
"搜索旅行地/酒店/旅游/门票/签证"
size=
"mini"
@
keyup
.
enter=
"goSearch"
v-model=
"searchText"
></el-input>
<span
class=
"_search_btn __cp"
@
click=
"goSearch"
>
<i
class=
"iconfont icon-search"
></i>
</span>
</div>
</el-col>
<!-- 右 电话 -->
...
...
@@ -152,7 +173,9 @@
</div>
<div>
<!-- <i class="iconfont icon-xia"></i> -->
<p
class=
"_phone_text"
><span
class=
"__cp"
>
客服服务电话
</span></p>
<p
class=
"_phone_text"
>
<span
class=
"__cp"
>
客服服务电话
</span>
</p>
<p
class=
"_phone_num"
>
028-62051755
</p>
</div>
</div>
...
...
@@ -223,7 +246,7 @@
</el-submenu>
</el-menu>
<span class="__splice">|</span>
</li>
-->
</li>-->
<!-- 自由行 -->
<li
:class=
"{_active: navActive === 2}"
>
<div
@
click=
"handleSelect('/IndependentTravel', 2), navActive = 2"
>
...
...
@@ -241,10 +264,9 @@
</el-dropdown-menu>
</el-dropdown>
<span class="__splice">|</span>
</div>
-->
</div>-->
</li>
<!-- 当地游 -->
<li
class=
"localLi"
:class=
"{_active: navActive === 3}"
>
<div
@
click=
"handleSelect('/Localtourhome', 3), navActive = 3"
>
...
...
@@ -253,7 +275,7 @@
</div>
<div
class=
"localtour"
>
<span
@
click=
"GoLocalTour('outoneday')"
>
一日游
</span>
<span
@
click=
"GoLocalTour('PlayTicket')"
>
游玩门票
</span>
<span
@
click=
"GoLocalTour('PlayTicket')"
>
游玩门票
</span>
<span
@
click=
"GoLocalTour('LocalFood')"
>
当地美食
</span>
</div>
</li>
...
...
@@ -262,14 +284,14 @@
<span>当地游</span>
<span class="__splice">|</span>
</div>
</li>
-->
</li>-->
<!-- 酒店 -->
<!-- <li :class="{_active: navActive === 4}">
<div @click="handleSelect('/', 4), navActive = 4">
<span>酒店</span>
<span class="__splice">|</span>
</div>
</li>
-->
</li>-->
<!-- 签证 -->
<li
:class=
"{_active: navActive === 5}"
>
<div
@
click=
"handleSelect('/VisaHomePage', 5), navActive = 5"
>
...
...
@@ -290,159 +312,198 @@
<span>景点门票</span>
<span class="__splice">|</span>
</div>
</li>
-->
</li>-->
<!-- 积分商城 -->
<!-- <li :class="{_active: navActive === 8}">
<div @click="handleSelect('/IntegralMall', 8), navActive = 8">
<span>积分商城</span>
<span class="__splice">|</span>
</div>
</li>
-->
</li>-->
<!-- 活动中心 -->
<!-- <li :class="{_active: navActive === 9}" style="width: auto;">
<div @click="handleSelect('/IceCreamTask', 9), navActive = 9">
<img style="z-index: -1;position: absolute;top: -27px;" src="../../assets/img/task/nav_bg.png" alt="">
<li src="../../assets/img/task/nav_text.png" alt="">
</div>
</li>
-->
</li>-->
</ul>
</div>
<!-- <div id="map-container" class="map-container">
</div>
<div id="info">
</div>-->
</el-row>
</el-row>
</template>
<
script
>
const
map
=
new
AMap
.
Map
(
"map-container"
,
{
resizeEnable
:
true
,
center
:
[
116.397428
,
39.90923
],
zoom
:
13
});
import
{
location
}
from
"../../assets/utils/getLocation"
;
import
bus
from
'../../plugins/event-bus'
import
bus
from
"../../plugins/event-bus"
;
export
default
{
data
(){
data
()
{
return
{
language
:
1
,
register
:
false
,
searchText
:
''
,
select
:
'1'
,
groupInfo
:{},
navActive
:
''
,
searchText
:
""
,
select
:
"1"
,
groupInfo
:
{},
navActive
:
""
,
sites
:
[],
city
:
0
,
cityText
:
''
,
}
},
methods
:{
GoLocalTour
(
str
){
this
.
$router
.
push
({
name
:
"Localtourhome"
});
bus
.
$emit
(
'Headmsg'
,
str
);
cityText
:
""
}
;
},
methods
:
{
GoLocalTour
(
str
)
{
this
.
$router
.
push
({
name
:
"Localtourhome"
});
bus
.
$emit
(
"Headmsg"
,
str
);
// let routeData =this.$router.resolve({name: "Localtourhome", query:{str: str}});
// // let routeData = this.$router.resolve({ path:path});
// window.open(routeData.href, '_blank');
},
changeSite
(){
window
.
localStorage
.
site
=
this
.
city
;
changeSite
()
{
window
.
localStorage
.
site
=
this
.
city
;
console
.
log
(
this
.
city
);
this
.
sites
.
forEach
(
item
=>
{
if
(
this
.
city
==
item
.
companyId
)
{
window
.
localStorage
.
cityId
=
item
.
cityId
;
this
.
sites
.
forEach
(
item
=>
{
if
(
this
.
city
==
item
.
companyId
)
{
window
.
localStorage
.
cityId
=
item
.
cityId
;
}
window
.
localStorage
.
site
=
this
.
city
;
})
this
.
$emit
(
'siteCity'
,
this
.
city
==
0
?
-
1
:
this
.
city
)
window
.
localStorage
.
site
=
this
.
city
;
})
;
this
.
$emit
(
"siteCity"
,
this
.
city
==
0
?
-
1
:
this
.
city
);
},
loadSites
(){
let
msg
=
{}
let
cmd
=
'b2b_get_site'
this
.
apipost
(
cmd
,
msg
,
r
=>
{
if
(
r
.
data
.
resultCode
==
1
){
this
.
sites
=
r
.
data
.
data
let
cityname
=
this
.
cityText
.
slice
(
0
,
this
.
cityText
.
length
-
1
);
if
(
this
.
sites
.
length
>
0
){
this
.
sites
.
forEach
(
item
=>
{
if
(
item
.
siteName
.
indexOf
(
cityname
)
!=-
1
){
//出现改字段
this
.
city
=
item
.
companyId
;
window
.
localStorage
.
site
=
this
.
city
;
window
.
localStorage
.
cityId
=
item
.
cityId
;
console
.
log
(
window
.
localStorage
.
cityId
)
}
else
{
loadSites
()
{
let
msg
=
{};
let
cmd
=
"b2b_get_site"
;
this
.
apipost
(
cmd
,
msg
,
r
=>
{
if
(
r
.
data
.
resultCode
==
1
)
{
this
.
sites
=
r
.
data
.
data
;
let
cityname
=
this
.
cityText
.
slice
(
0
,
this
.
cityText
.
length
-
1
);
if
(
this
.
sites
.
length
>
0
)
{
this
.
sites
.
forEach
(
item
=>
{
if
(
item
.
siteName
.
indexOf
(
cityname
)
!=
-
1
)
{
//出现改字段
this
.
city
=
item
.
companyId
;
window
.
localStorage
.
site
=
this
.
city
;
window
.
localStorage
.
cityId
=
item
.
cityId
;
console
.
log
(
window
.
localStorage
.
cityId
);
}
else
{
}
})
});
}
this
.
city
=
this
.
sites
.
length
>
0
?
this
.
city
:
null
this
.
city
=
this
.
sites
.
length
>
0
?
this
.
city
:
null
;
}
else
{
this
.
sites
=
[]
this
.
sites
=
[];
}
this
.
$emit
(
'GetCityId'
,
true
)
},
null
)
this
.
$emit
(
"GetCityId"
,
true
);
},
null
);
},
goSearch
()
{
if
(
this
.
searchText
!=
''
)
{
if
(
this
.
select
===
'1'
)
{
// 旅游
let
query
=
{
keywords
:
encodeURIComponent
(
this
.
searchText
)}
if
(
this
.
searchText
!=
""
)
{
if
(
this
.
select
===
"1"
)
{
// 旅游
let
query
=
{
keywords
:
encodeURIComponent
(
this
.
searchText
)
};
this
.
$router
.
push
({
path
:
'search'
,
path
:
"search"
,
query
});
}
else
if
(
this
.
select
===
'2'
)
{
// 酒店
let
query
=
{
keywords
:
encodeURIComponent
(
this
.
searchText
)}
}
else
if
(
this
.
select
===
"2"
)
{
// 酒店
let
query
=
{
keywords
:
encodeURIComponent
(
this
.
searchText
)
};
this
.
$router
.
push
({
path
:
'search'
,
path
:
"search"
,
query
});
}
else
if
(
this
.
select
===
'3'
)
{
// 机票
let
query
=
{
keywords
:
encodeURIComponent
(
this
.
searchText
)}
}
else
if
(
this
.
select
===
"3"
)
{
// 机票
let
query
=
{
keywords
:
encodeURIComponent
(
this
.
searchText
)
};
this
.
$router
.
push
({
path
:
'TicketList'
,
path
:
"TicketList"
,
query
});
}
}
else
{
this
.
Error
(
'请输入搜索关键词'
)
}
else
{
this
.
Error
(
"请输入搜索关键词"
);
}
},
goUrl
(
path
,
key
){
// 个人中心、订单跳转方法
localStorage
.
removeItem
(
'navActive'
)
this
.
$router
.
push
({
name
:
path
,
query
:{
key
:
key
}});
this
.
MsgBus
.
$emit
(
'newPersonalCenter'
,
key
)
goUrl
(
path
,
key
)
{
// 个人中心、订单跳转方法
localStorage
.
removeItem
(
"navActive"
);
this
.
$router
.
push
({
name
:
path
,
query
:
{
key
:
key
}
});
this
.
MsgBus
.
$emit
(
"newPersonalCenter"
,
key
);
},
goLoginUrl
(
path
,
t
){
// 登录退出
this
.
$store
.
commit
(
'changeLogin'
,
0
);
this
.
$store
.
commit
(
'updateUser'
,{});
this
.
$store
.
commit
(
'HomePage'
,
'true'
)
goLoginUrl
(
path
,
t
)
{
// 登录退出
this
.
$store
.
commit
(
"changeLogin"
,
0
);
this
.
$store
.
commit
(
"updateUser"
,
{});
this
.
$store
.
commit
(
"HomePage"
,
"true"
);
localStorage
.
removeItem
(
"userInfo"
);
sessionStorage
.
setItem
(
"Homepage"
,
'true'
);
this
.
$router
.
push
({
name
:
path
,
query
:{
'type'
:
t
}})
sessionStorage
.
setItem
(
"Homepage"
,
"true"
);
this
.
$router
.
push
({
name
:
path
,
query
:
{
type
:
t
}
});
},
handleSelect
(
path
,
key
)
{
//导航跳转方法
if
(
path
!==
''
)
{
this
.
$router
.
push
({
path
:
path
})
localStorage
.
setItem
(
'navActive'
,
key
)
this
.
navActive
=
key
handleSelect
(
path
,
key
)
{
//导航跳转方法
if
(
path
!==
""
)
{
this
.
$router
.
push
({
path
:
path
});
localStorage
.
setItem
(
"navActive"
,
key
);
this
.
navActive
=
key
;
}
}
},
},
mounted
(){
},
mounted
()
{},
computed
:
{
user
(){
return
this
.
$store
.
state
.
user
user
()
{
return
this
.
$store
.
state
.
user
;
}
},
},
created
(){
let
geolocation
=
location
.
initMap
(
"map-container"
);
//定位
AMap
.
event
.
addListener
(
geolocation
,
"complete"
,
result
=>
{
if
(
result
.
addressComponent
.
city
){
this
.
cityText
=
result
.
addressComponent
.
city
;
created
()
{
let
_this
=
this
;
//获取用户所在城市信息
//实例化城市查询类
var
citysearch
=
new
AMap
.
CitySearch
();
//自动获取用户IP,返回当前城市
citysearch
.
getLocalCity
(
function
(
status
,
result
)
{
if
(
status
===
"complete"
&&
result
.
info
===
"OK"
)
{
if
(
result
&&
result
.
city
&&
result
.
bounds
)
{
var
citybounds
=
result
.
bounds
;
_this
.
cityText
=
result
.
city
;
// document.getElementById('info').innerHTML = '您当前所在城市:'+cityinfo;
// //地图显示当前城市
// map.setBounds(citybounds);
}
}
else
{
}
this
.
loadSites
();
});
if
(
localStorage
.
g
&&
localStorage
.
g
!=
'undefined'
){
this
.
groupInfo
=
JSON
.
parse
(
localStorage
.
g
)
// let geolocation = location.initMap("map-container"); //定位
// AMap.event.addListener(geolocation, "complete", result => {
// console.log(result)
// if(result.addressComponent.city){
// this.cityText=result.addressComponent.city;
// }
this
.
loadSites
();
// });
if
(
localStorage
.
g
&&
localStorage
.
g
!=
"undefined"
)
{
this
.
groupInfo
=
JSON
.
parse
(
localStorage
.
g
);
}
if
(
localStorage
.
navActive
)
{
this
.
navActive
=
localStorage
.
navActive
if
(
localStorage
.
navActive
)
{
this
.
navActive
=
localStorage
.
navActive
;
}
}
}
}
;
</
script
>
vue.config.js
View file @
e81904b6
...
...
@@ -6,6 +6,9 @@ module.exports = {
'components'
:
'@/components'
,
'views'
:
'@/views'
,
}
},
devServer
:
{
// host: 'www.B2B.com',
},
externals
:
{
BMap
:
'BMap'
...
...
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