Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
H
HotelProject
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
zhengke
HotelProject
Commits
e81cf67e
Commit
e81cf67e
authored
Mar 04, 2020
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增文件
parent
f4cfc746
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
433 additions
and
8 deletions
+433
-8
index.html
index.html
+19
-0
googleMap.js
src/assets/utils/googleMap.js
+241
-0
HotelInfo.vue
src/components/assetsman/HotelInfo.vue
+40
-5
googleMap.vue
src/components/commonPage/googleMap.vue
+127
-0
main.js
src/main.js
+2
-1
index.js
src/plugins/index.js
+4
-2
No files found.
index.html
View file @
e81cf67e
...
...
@@ -7,6 +7,25 @@
<meta
http-equiv=
"Pragma"
content=
"no-cache"
>
<meta
http-equiv=
"Cache-Control"
content=
"no-cache, must-revalidate, no-store"
>
<meta
http-equiv=
"Expires"
content=
"0"
>
<script
type=
"text/javascript"
>
window
.
google
=
{
maps
:
{}
};
var
_load
=
void
0
,
loadScriptTime
=
(
new
Date
).
getTime
();
Object
.
defineProperty
(
google
.
maps
,
'Load'
,
{
configurable
:
false
,
get
:
function
()
{
return
_load
},
set
:
function
set
(
v
)
{
//console.log(v.toString()),
eval
(
"_load = "
+
v
.
toString
().
replace
(
"maps.google.cn"
,
"www.google.cn"
))
}
});
</script>
<script
type=
"text/javascript"
src=
"http://www.google.cn/maps/api/js?key=AIzaSyAZ5MIfzicStzKbIkbI3RcBBeZBjQFKsp0&libraries=geometry&language=zh_CN"
></script>
<title>
四川和平国际旅行社SCM管理系统
</title>
</head>
<body>
...
...
src/assets/utils/googleMap.js
0 → 100644
View file @
e81cf67e
/**
* Created by Administrator on 2018/7/17.
*/
var
googleMap
=
{
search_id
:
null
,
map_id
:
null
,
listData
:
[],
map
:
{},
marker
:
null
,
markerList
:
[],
infoWindow
:
null
,
geocoder
:
null
,
callback
:
null
,
defaultAddress
:
""
,
imageDomain
:
""
,
init
:
function
(
callback
,
queryAddress
,
imageUrl
)
{
googleMap
.
search_id
=
document
.
getElementById
(
"address_all"
);
googleMap
.
map_id
=
document
.
getElementById
(
"MapContent"
);
googleMap
.
listData
=
[];
googleMap
.
markerList
=
[];
googleMap
.
defaultAddress
=
queryAddress
;
googleMap
.
imageDomain
=
imageUrl
;
googleMap
.
deleteLink
();
var
items
=
[];
var
item
=
{};
item
[
'lat'
]
=
parseFloat
(
"30.6574389"
);
item
[
'lng'
]
=
parseFloat
(
"104.06592380000006"
);
items
[
0
]
=
item
;
googleMap
.
listData
=
items
;
googleMap
.
listData
=
items
;
googleMap
.
initMap
();
if
(
googleMap
.
defaultAddress
==
""
)
{
googleMap
.
initMapFirst
();
}
else
{
googleMap
.
searchAddress
();
}
googleMap
.
callback
=
callback
;
},
deleteLink
:
function
()
{
//删除google的字体
var
e
=
document
;
var
t
=
e
.
getElementsByTagName
(
"head"
)[
0
],
a
=
t
.
insertBefore
;
t
.
insertBefore
=
function
(
e
,
i
)
{
e
.
href
&&
e
.
href
.
indexOf
(
"fonts.googleapis.com"
)
>
-
1
||
a
.
call
(
t
,
e
,
i
)
}
},
initMap
:
function
()
{
var
data
=
[];
if
((
'undefined'
!=
googleMap
.
listData
)
&&
googleMap
.
listData
.
length
>
0
)
{
data
[
0
]
=
googleMap
.
listData
[
0
];
var
LatLng
=
new
google
.
maps
.
LatLng
(
data
[
0
].
lat
,
data
[
0
].
lng
);
if
(
data
.
length
>
0
)
{
googleMap
.
map
=
new
google
.
maps
.
Map
(
googleMap
.
map_id
,
{
zoom
:
14
,
center
:
LatLng
});
}
}
googleMap
.
geocoder
=
new
google
.
maps
.
Geocoder
();
//添加监听点击地图事件
google
.
maps
.
event
.
addListener
(
googleMap
.
map
,
'click'
,
function
(
event
)
{
googleMap
.
placeMarker
(
event
.
latLng
);
});
//搜索文本框的回车事件
googleMap
.
search_id
.
onkeydown
=
function
()
{
if
(
event
.
keyCode
==
13
)
{
googleMap
.
searchAddress
();
}
}
},
initMapFirst
:
function
()
{
if
((
'undefined'
!=
googleMap
.
listData
)
&&
(
googleMap
.
listData
.
length
>
0
))
{
googleMap
.
GetAddress
(
googleMap
.
listData
[
0
].
lat
,
googleMap
.
listData
[
0
].
lng
);
}
},
addInfowindow
:
function
(
lat
,
lng
,
address
,
newArray
,
isCallBack
)
{
var
message
=
"<div style='text-align:left;'>"
;
message
+=
"<br />"
;
message
+=
"纬度:<span style='color:#06c;'>"
+
lat
+
"</span> 经度:<span style='color: #FD7917;'>"
+
lng
+
"</span>"
;
message
+=
"<br />"
;
message
+=
"地址:"
+
address
;
message
+=
"</div>"
;
if
(
googleMap
.
marker
)
{
googleMap
.
marker
.
setMap
(
null
);
}
var
imageUrl
=
{};
if
(
isCallBack
==
1
)
{
imageUrl
=
{
url
:
googleMap
.
imageDomain
+
"/static/location_01.png"
,
// image is 512 x 512
scaledSize
:
new
google
.
maps
.
Size
(
30
,
40
),
}
}
else
{
imageUrl
=
{
url
:
googleMap
.
imageDomain
+
"/static/location_01.png"
,
// image is 512 x 512
scaledSize
:
new
google
.
maps
.
Size
(
30
,
40
),
}
}
googleMap
.
marker
=
new
google
.
maps
.
Marker
({
title
:
address
,
map
:
googleMap
.
map
,
position
:
new
google
.
maps
.
LatLng
(
lat
,
lng
),
icon
:
imageUrl
});
if
(
googleMap
.
infowindow
)
{
googleMap
.
infowindow
.
close
();
}
googleMap
.
infowindow
=
new
google
.
maps
.
InfoWindow
({
content
:
message
,
size
:
new
google
.
maps
.
Size
(
50
,
50
)
});
googleMap
.
infowindow
.
open
(
googleMap
.
map
,
googleMap
.
marker
);
//设置居中
googleMap
.
map
.
setCenter
(
new
google
.
maps
.
LatLng
(
lat
,
lng
));
if
(
googleMap
.
callback
!=
null
&&
isCallBack
==
1
)
{
googleMap
.
callback
({
"lat"
:
lat
,
"lng"
:
lng
,
"address"
:
address
,
"areaArray"
:
newArray
,
})
}
},
GetAddress
:
function
(
lat
,
lng
)
{
var
address
=
"四川成都天府广场"
;
googleMap
.
addInfowindow
(
lat
,
lng
,
address
);
return
address
;
},
searchAddress
:
function
()
{
var
address
=
googleMap
.
search_id
.
value
;
googleMap
.
geocoder
.
geocode
({
'address'
:
address
},
function
(
results
,
status
)
{
if
(
status
==
google
.
maps
.
GeocoderStatus
.
OK
)
{
googleMap
.
getAddress
(
results
,
1
);
}
});
},
placeMarker
:
function
(
location
)
{
//地图的点击事件,根据点击的点获取经度,纬度和地址信息
if
(
googleMap
.
geocoder
)
{
googleMap
.
geocoder
.
geocode
({
'location'
:
location
},
function
(
results
,
status
)
{
if
(
status
==
google
.
maps
.
GeocoderStatus
.
OK
)
{
googleMap
.
getAddress
(
results
,
1
);
}
});
}
},
getAddress
:
function
(
results
,
isCallBack
)
{
var
re
=
/^
[\u
4E00-
\u
9FA5
]
+$/
;
if
(
results
[
0
])
{
var
Address
=
results
[
0
].
formatted_address
;
var
newArray
=
[];
results
.
forEach
(
item
=>
{
if
(
re
.
test
(
item
.
formatted_address
))
{
item
.
address_components
.
forEach
(
arrItem
=>
{
var
name
=
arrItem
.
long_name
.
replace
(
'省'
,
''
).
replace
(
'市'
,
''
);
if
(
!
googleMap
.
isExists
(
newArray
,
name
))
{
newArray
.
push
(
name
);
}
})
}
});
googleMap
.
addInfowindow
(
results
[
0
].
geometry
.
location
.
lat
(),
results
[
0
].
geometry
.
location
.
lng
(),
Address
,
newArray
,
isCallBack
);
}
},
//判断数组是否存在 值
isExists
:
function
(
arr
,
item
)
{
var
flag
=
false
;
for
(
var
i
=
0
;
i
<
arr
.
length
;
i
++
)
{
if
(
arr
[
i
]
==
item
)
{
flag
=
true
;
break
;
}
}
return
flag
;
},
initLine
:
function
(
dataList
,
_this
)
{
let
_dataList
=
JSON
.
parse
(
JSON
.
stringify
(
dataList
));
let
lat
=
parseFloat
(
_dataList
[
0
].
lat
);
let
lng
=
parseFloat
(
_dataList
[
0
].
lng
);
let
center
=
{
lng
:
lng
,
lat
:
lat
}
//创建地图实例,zoom是缩放比例
_this
.
map
=
new
google
.
maps
.
Map
(
document
.
getElementById
(
'map_canvas'
),
{
zoom
:
7
,
center
:
center
,
mapTypeId
:
google
.
maps
.
MapTypeId
.
ROADMAP
});
_this
.
directionsDisplay
.
setMap
(
_this
.
map
);
googleMap
.
calcRoute
(
_dataList
,
_this
)
},
calcRoute
:
function
(
_dataList
,
_this
)
{
// 创建路径规划
// 分解数据 获得起 止 以及中间数据
let
lat
=
parseFloat
(
_dataList
[
0
].
lat
);
let
lng
=
parseFloat
(
_dataList
[
0
].
lng
);
let
elat
=
parseFloat
(
_dataList
[
_dataList
.
length
-
1
].
lat
);
let
elng
=
parseFloat
(
_dataList
[
_dataList
.
length
-
1
].
lng
);
let
start
=
lat
+
','
+
lng
;
let
end
=
elat
+
','
+
elng
;
let
waypoints
=
[];
if
(
_dataList
.
length
>
2
)
{
_dataList
.
forEach
((
x
,
index
)
=>
{
if
(
index
>=
1
&&
index
!==
(
_dataList
.
length
-
1
))
{
let
obj
=
{
location
:
x
.
lat
+
','
+
x
.
lng
};
waypoints
.
push
(
obj
)
}
});
}
let
request
=
{
// 组装连线数据
origin
:
start
,
// 起
destination
:
end
,
// 止
travelMode
:
google
.
maps
.
TravelMode
.
DRIVING
,
// waypoints: [{location:"30.5226477,104.05806469999993"},{location:"30.67416759999999,104.04721970000003"}] // 中间点数据
};
if
(
waypoints
.
length
>
0
)
{
request
.
waypoints
=
waypoints
}
_this
.
directionsService
.
route
(
request
,
function
(
result
,
status
)
{
if
(
status
==
google
.
maps
.
DirectionsStatus
.
OK
)
{
_this
.
directionsDisplay
.
setDirections
(
result
);
}
});
},
};
export
default
googleMap
;
src/components/assetsman/HotelInfo.vue
View file @
e81cf67e
...
...
@@ -142,7 +142,9 @@
</el-select>
</el-form-item>
<el-form-item
label=
"ホテルの住所"
prop=
"SHotelAddress"
title=
"酒店地址"
>
<el-input
type=
"text"
v-model=
"addMsg.SHotelAddress"
maxlength=
"100"
class=
"w300"
></el-input>
<el-input
maxlength=
"100"
class=
"w300 "
v-model=
"addMsg.SHotelAddress"
>
<el-button
slot=
"append"
@
click=
"selectAddress = true"
icon=
"iconfont icon-img_dw"
></el-button>
</el-input>
</el-form-item>
<el-form-item
label=
"評価"
title=
"酒店星级"
>
<el-select
class=
"w300"
placeholder=
"决断"
v-model=
"addMsg.SHotelStar"
>
...
...
@@ -200,16 +202,24 @@
</el-form-item>
<el-form-item
label=
"言葉対応"
title=
"前台语言"
>
<el-select
multiple
placeholder=
"言葉対応"
class=
'multiple_input w300'
v-model=
"deskLanguageArray"
>
<el-option
v-for=
"item in DeskLanguage"
:key=
"item.HConfigId"
:label=
"item.JapanName"
:value=
"item.HConfigId"
>
<el-option
v-for=
"item in DeskLanguage"
:key=
"item.HConfigId"
:label=
"item.JapanName"
:value=
"item.HConfigId"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item
label=
"支払い方式"
title=
"支付方式"
>
<el-select
multiple
placeholder=
"支払い方式"
class=
'multiple_input w300'
v-model=
"payTypeChooseArray"
>
<el-option
v-for=
"item in PayTypeArray"
:key=
"item.HConfigId"
:label=
"item.JapanName"
:value=
"item.HConfigId"
>
<el-option
v-for=
"item in PayTypeArray"
:key=
"item.HConfigId"
:label=
"item.JapanName"
:value=
"item.HConfigId"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item
label=
"ホテル連絡先"
title=
"酒店联系方式"
>
<el-input
type=
"text"
v-model=
"addMsg.HotelContract"
maxlength=
"100"
class=
"w300"
></el-input>
</el-form-item>
<el-form-item
label=
"払い戻しの原則"
title=
"退订原则"
>
<el-input
type=
"text"
v-model=
"addMsg.BackRule"
maxlength=
"100"
class=
"w300"
></el-input>
</el-form-item>
</div>
</div>
<div
style=
"position:relative;margin-bottom:15px;"
>
...
...
@@ -246,9 +256,15 @@
style=
"margin-right:20px;"
class=
"chaxunSpan"
:class=
"
{'disClick':!isSubmit}"
@click="submitForm('addMsg')">を選択します
</button><button
class=
"chaxunSpan"
@
click=
"goUrl('HotelList')"
>
キャンセル
</button></div>
<el-dialog
custom-class=
"mapList"
title=
"住所を選択する"
center
:visible
.
sync=
"selectAddress"
>
<googleMap
@
refList=
"googleMap"
v-bind:address=
"addMsg.SHotelAddress"
@
headCallBack=
"headCall"
></googleMap>
</el-dialog>
</div>
</
template
>
<
script
>
import
googleMap
from
"../commonPage/googleMap.vue"
;
export
default
{
data
()
{
...
...
@@ -283,6 +299,8 @@
}
},
arr
:
[],
//地图选中地址
selectAddress
:
false
,
addMsg
:
{
SID
:
0
,
//酒店编号
SHotelName
:
''
,
//酒店名称
...
...
@@ -304,6 +322,10 @@
SPayType
:
""
,
//支付方式
DeskLanguage
:
""
,
//前台语言
SHotelImgCoverArray
:
[],
//图片数组
Lng
:
""
,
//经度
Lat
:
""
,
//纬度
HotelContract
:
""
,
//酒店联系方式
BackRule
:
""
,
//退订原则
},
PublicFacilities
:
[],
//公共设施
RoomFacilities
:
[],
//客房设施
...
...
@@ -342,8 +364,17 @@
}
};
},
components
:
{
googleMap
:
googleMap
,
},
methods
:
{
googleMap
()
{
this
.
selectAddress
=
false
;
},
headCall
(
msg
)
{
this
.
addMsg
.
Lng
=
msg
.
lng
;
this
.
addMsg
.
Lat
=
msg
.
lat
;
},
//上传酒店图片
UploadImage
(
file
)
{
let
newArr
=
[];
...
...
@@ -469,6 +500,10 @@
this
.
addMsg
.
SCityId
=
tempData
.
SCityId
;
this
.
addMsg
.
SPayType
=
tempData
.
SPayType
;
this
.
addMsg
.
DeskLanguage
=
tempData
.
DeskLanguage
;
this
.
addMsg
.
HotelContract
=
tempData
.
HotelContract
;
this
.
addMsg
.
BackRule
=
tempData
.
BackRule
;
this
.
addMsg
.
Lng
=
tempData
.
Lng
;
this
.
addMsg
.
Lat
=
tempData
.
Lat
;
this
.
addMsg
.
SHotelImgCoverArray
=
tempData
.
SHotelImgCoverArray
;
if
(
this
.
addMsg
.
SCountryId
>
0
)
{
this
.
getProvinceList
(
this
.
addMsg
.
SCountryId
,
1
,
2
)
...
...
@@ -539,7 +574,7 @@
if
(
response
.
data
.
resultCode
==
1
)
{
var
array
=
response
.
data
.
data
;
if
(
array
&&
array
.
length
>
0
)
{
array
.
forEach
((
item
,
index
)
=>
{
array
.
forEach
((
item
,
index
)
=>
{
if
(
index
<
5
)
{
this
.
starslevel
.
push
(
item
);
}
...
...
src/components/commonPage/googleMap.vue
0 → 100644
View file @
e81cf67e
<
style
>
.mapContent
.googleMap
{
width
:
800px
;
height
:
350px
;
margin-top
:
10px
;
}
.mapContent
.searchInput
{
border-radius
:
17px
;
height
:
34px
;
width
:
250px
;
border
:
1px
solid
#dcdfe6
;
outline
:
none
;
padding-left
:
20px
;
margin
:
3px
0
0
200px
;
}
.mapContent
.btnList
{
margin
:
25px
0
0
auto
;
text-align
:
center
;
}
.mapContent
.sureBtn
{
margin-left
:
20px
;
}
.mapContent
.mainContent
{
position
:
relative
;
}
.mapContent
.searchList
{
position
:
absolute
;
top
:
10px
;
left
:
0
;
z-index
:
999
;
}
</
style
>
<
template
>
<div
class=
"mapContent"
>
<div
class=
"mainContent"
>
<div
class=
"searchList"
>
<input
type=
"text"
class=
"searchInput"
id=
"address_all"
v-model=
"QAddress"
placeholder=
"输入地址按回车键查询"
/>
</div>
<div
class=
"googleMap"
id=
"MapContent"
>
</div>
</div>
<div
class=
"btnList"
>
<input
type=
"button"
class=
"normalBtn sureBtn"
value=
"确定"
@
click=
"sendMsg"
/>
<input
type=
"button"
class=
"hollowFixedBtn"
value=
"取消"
@
click=
"closeDialog"
/>
</div>
</div>
</
template
>
<
script
>
export
default
{
props
:
[
"address"
],
data
()
{
return
{
dataList
:
{
lat
:
""
,
lng
:
""
,
address
:
""
,
country
:
"0"
,
province
:
"0"
,
city
:
"0"
},
isdisable
:
false
,
QAddress
:
this
.
address
};
},
methods
:
{
getList
(
obj
)
{
this
.
isdisable
=
true
;
this
.
dataList
.
lat
=
obj
.
lat
;
this
.
dataList
.
lng
=
obj
.
lng
;
this
.
dataList
.
address
=
obj
.
address
;
var
that
=
this
;
if
(
obj
.
areaArray
!=
null
&&
obj
.
areaArray
.
length
>
0
)
{
var
q_msg
=
{
area
:
JSON
.
stringify
(
obj
.
areaArray
)
};
that
.
apipost
(
"dict_get_Destination_GetListByNames"
,
q_msg
,
res
=>
{
if
(
res
.
data
.
resultCode
==
1
)
{
res
.
data
.
data
.
forEach
(
areaItem
=>
{
switch
(
areaItem
.
CodeLevel
)
{
case
1
:
this
.
dataList
.
country
=
areaItem
.
ID
;
break
;
case
2
:
this
.
dataList
.
province
=
areaItem
.
ID
;
break
;
case
3
:
this
.
dataList
.
city
=
areaItem
.
ID
;
break
;
}
});
}
},
null
);
}
this
.
$emit
(
"headCallBack"
,
this
.
dataList
);
},
closeDialog
()
{
this
.
$emit
(
"refList"
);
},
sendMsg
()
{
if
(
!
this
.
isdisable
)
{
this
.
tips
(
"请点击选择地址"
,
"info"
);
}
else
{
this
.
$emit
(
"headCallBack"
,
this
.
dataList
);
this
.
$emit
(
"refList"
);
}
},
tips
(
msg
,
type
)
{
this
.
$message
({
message
:
msg
,
duration
:
2000
,
type
:
type
});
}
},
created
()
{},
mounted
()
{
this
.
$googleMap
.
init
(
this
.
getList
,
this
.
QAddress
,
this
.
domainManager
().
GoogleMapImageUrl
);
}
};
</
script
>
\ No newline at end of file
src/main.js
View file @
e81cf67e
...
...
@@ -23,6 +23,7 @@ import VXETable from 'vxe-table'
import
'vxe-table/lib/index.css'
import
commonUtils
from
'./assets/utils/commonUtils'
import
calendarUtils
from
'./assets/utils/calendarUtils'
//日历帮助类
import
googleMap
from
'./assets/utils/googleMap'
//引入谷歌地图
Vue
.
calendarUtils
=
Vue
.
prototype
.
$calendarUtils
=
calendarUtils
Vue
.
use
(
VXETable
)
...
...
@@ -42,7 +43,7 @@ Vue.use(Viewer,{
}
})
Vue
.
commonUtils
=
Vue
.
prototype
.
$commonUtils
=
commonUtils
Vue
.
googleMap
=
Vue
.
prototype
.
$googleMap
=
googleMap
Vue
.
filter
(
"YMD"
,
function
(
date
)
{
...
...
src/plugins/index.js
View file @
e81cf67e
...
...
@@ -36,6 +36,8 @@ export default {
UploadUrl
:
locationName
.
indexOf
(
'zcyx'
)
!==
-
1
||
locationName
.
indexOf
(
'zcyx.oytour.com'
)
!==
-
1
?
"http://uploadfile.oytour.com"
:
"http://upload.oytour.com"
,
LocalFileStreamDownLoadUrl
:
domainUrl
+
"/api/file/GetFileFromWebApi"
,
JavaLocalFileStreamDownLoadUrl
:
javaUrldo
,
//google地图图片地址
GoogleMapImageUrl
:
"http://imgfile.oytour.com"
,
};
return
obj
;
},
...
...
@@ -134,7 +136,7 @@ export default {
"timestamp"
:
timestamp
,
"token"
:
token
,
"sign"
:
md5Str
,
"uid"
:
uid
"uid"
:
uid
}
if
(
localStorage
.
g
&&
localStorage
.
g
!=
'undefined'
)
{
// postData.groupId = parseInt(JSON.parse(localStorage.g).i)
...
...
@@ -235,4 +237,4 @@ export default {
item
[
filed
]
=
value
;
}
}
}
\ 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