Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
H
hls-xcmg-vue-app
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
xugong
hls-xcmg-vue-app
Commits
1881a25e
Commit
1881a25e
authored
Mar 27, 2020
by
Jennie Shi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
定位提示
parent
c8fe933c
Pipeline
#5401
canceled with stages
Changes
6
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
67 additions
and
68 deletions
+67
-68
prod.env.js
config/prod.env.js
+1
-1
uat.env.js
config/uat.env.js
+1
-1
home-page.vue
src/pages/home/home-page.vue
+35
-35
location.vue
src/pages/home/location.vue
+29
-29
www.zip
www.zip
+0
-0
index.html
www/index.html
+1
-2
No files found.
config/prod.env.js
View file @
1881a25e
...
...
@@ -11,5 +11,5 @@ module.exports = {
ocrPath
:
'"http://www.xcmgfs.com:8087/r/api"'
,
fileUploadSvcPath
:
'"http://www.xcmgfs.com:8087/r/api/app/fileUploadSvc?sysName=XCMG_PROD&apiName="'
,
appId
:
'"com.xcmg.app"'
,
currentVersion
:
'"0.1.
0
"'
currentVersion
:
'"0.1.
1
"'
}
config/uat.env.js
View file @
1881a25e
...
...
@@ -11,6 +11,6 @@ module.exports = {
ocrPath
:
'"http://180.104.121.66:8088/r/api"'
,
fileUploadSvcPath
:
'"http://180.104.121.66:8088/r/api/app/fileUploadSvc?sysName=XCMG_UAT&apiName="'
,
appId
:
'"com.xcmg.app.dev"'
,
currentVersion
:
'"2.1.
5
"'
currentVersion
:
'"2.1.
6
"'
}
src/pages/home/home-page.vue
View file @
1881a25e
...
...
@@ -100,41 +100,41 @@ export default {
// 定位
getLocation
()
{
let
vm
=
this
if
(
vum
.
Platform
.
isAndroid
())
{
// 安卓采用jsapi
var
geolocation
=
new
BMap
.
Geolocation
()
vm
.
hlsPopup
.
showLoading
(
'数据加载中'
)
geolocation
.
getCurrentPosition
(
function
(
res
)
{
vm
.
hlsPopup
.
hideLoading
()
if
(
this
.
getStatus
()
===
0
)
{
// 判断是否是手动选择过定位
if
(
window
.
localStorage
.
getItem
(
'province'
))
{
vm
.
city
=
window
.
localStorage
.
getItem
(
'city'
)
vm
.
province
=
window
.
localStorage
.
getItem
(
'province'
)
vm
.
guessingQuery
(
vm
.
city
)
}
else
{
// 没有就定位当前位置
console
.
log
(
res
)
vm
.
city
=
res
.
address
.
city
vm
.
province
=
res
.
address
.
province
vm
.
guessingQuery
(
res
.
address
.
city
)
}
}
},
{
enableHighAccuracy
:
true
})
}
else
{
// ios使用插件定位
console
.
log
(
'&&&&&&&&&&&&___ios'
)
baidumap_location
.
getCurrentPosition
(
function
(
result
)
{
if
(
window
.
localStorage
.
getItem
(
'province'
))
{
vm
.
city
=
window
.
localStorage
.
getItem
(
'city'
)
vm
.
province
=
window
.
localStorage
.
getItem
(
'province'
)
vm
.
guessingQuery
(
vm
.
city
)
}
else
{
vm
.
city
=
result
.
city
vm
.
province
=
result
.
province
vm
.
guessingQuery
(
result
.
city
)
}
},
function
(
error
)
{
})
}
//
if (vum.Platform.isAndroid()) { // 安卓采用jsapi
//
var geolocation = new BMap.Geolocation()
//
vm.hlsPopup.showLoading('数据加载中')
//
geolocation.getCurrentPosition(function (res) {
//
vm.hlsPopup.hideLoading()
//
if (this.getStatus() === 0) {
//
// 判断是否是手动选择过定位
//
if (window.localStorage.getItem('province')) {
//
vm.city = window.localStorage.getItem('city')
//
vm.province = window.localStorage.getItem('province')
//
vm.guessingQuery(vm.city)
//
} else {
//
// 没有就定位当前位置
//
console.log(res)
//
vm.city = res.address.city
//
vm.province = res.address.province
//
vm.guessingQuery(res.address.city)
//
}
//
}
//
}, {enableHighAccuracy: true})
//
} else { // ios使用插件定位
console
.
log
(
'&&&&&&&&&&&&___ios'
)
baidumap_location
.
getCurrentPosition
(
function
(
result
)
{
if
(
window
.
localStorage
.
getItem
(
'province'
))
{
vm
.
city
=
window
.
localStorage
.
getItem
(
'city'
)
vm
.
province
=
window
.
localStorage
.
getItem
(
'province'
)
vm
.
guessingQuery
(
vm
.
city
)
}
else
{
vm
.
city
=
result
.
city
vm
.
province
=
result
.
province
vm
.
guessingQuery
(
result
.
city
)
}
},
function
(
error
)
{
})
//
}
// setTimeout(vm.guessingQuery(), 0)
},
goFunctionHome
(
data
)
{
...
...
src/pages/home/location.vue
View file @
1881a25e
...
...
@@ -95,35 +95,35 @@ export default {
// 重新定位到当前位置
relocation
()
{
let
vm
=
this
if
(
vum
.
Platform
.
isAndroid
())
{
// 安卓采用jsapi
var
geolocation
=
new
BMap
.
Geolocation
()
geolocation
.
getCurrentPosition
(
function
(
res
)
{
if
(
this
.
getStatus
()
===
0
)
{
window
.
localStorage
.
setItem
(
'province'
,
res
.
address
.
province
)
window
.
localStorage
.
setItem
(
'city'
,
res
.
address
.
city
)
vm
.
places
=
window
.
localStorage
.
getItem
(
'province'
)
+
'-'
+
window
.
localStorage
.
getItem
(
'city'
)
vm
.
province
=
'请选择省'
vm
.
city
=
'请选择市'
vm
.
flag
=
false
vm
.
province_flag
=
true
}
},
function
(
error
)
{
console
.
log
(
error
)
},
{
enableHighAccuracy
:
true
})
}
else
{
// ios使用插件定位
baidumap_location
.
getCurrentPosition
(
function
(
result
)
{
console
.
log
(
'*********** '
+
JSON
.
stringify
(
result
))
window
.
localStorage
.
setItem
(
'province'
,
result
.
province
)
window
.
localStorage
.
setItem
(
'city'
,
result
.
city
)
vm
.
places
=
window
.
localStorage
.
getItem
(
'province'
)
+
'-'
+
window
.
localStorage
.
getItem
(
'city'
)
vm
.
province
=
'请选择省'
vm
.
city
=
'请选择市'
vm
.
flag
=
false
vm
.
province_flag
=
true
},
function
(
error
)
{
console
.
log
(
'errorerrorerrorerror '
+
error
)
})
}
//
if (vum.Platform.isAndroid()) { // 安卓采用jsapi
//
var geolocation = new BMap.Geolocation()
//
geolocation.getCurrentPosition(function (res) {
//
if (this.getStatus() === 0) {
//
window.localStorage.setItem('province', res.address.province)
//
window.localStorage.setItem('city', res.address.city)
//
vm.places = window.localStorage.getItem('province') + '-' + window.localStorage.getItem('city')
//
vm.province = '请选择省'
//
vm.city = '请选择市'
//
vm.flag = false
//
vm.province_flag = true
//
}
//
}, function (error) {
//
console.log(error)
//
}, {enableHighAccuracy: true})
//
} else { // ios使用插件定位
baidumap_location
.
getCurrentPosition
(
function
(
result
)
{
console
.
log
(
'*********** '
+
JSON
.
stringify
(
result
))
window
.
localStorage
.
setItem
(
'province'
,
result
.
province
)
window
.
localStorage
.
setItem
(
'city'
,
result
.
city
)
vm
.
places
=
window
.
localStorage
.
getItem
(
'province'
)
+
'-'
+
window
.
localStorage
.
getItem
(
'city'
)
vm
.
province
=
'请选择省'
vm
.
city
=
'请选择市'
vm
.
flag
=
false
vm
.
province_flag
=
true
},
function
(
error
)
{
console
.
log
(
'errorerrorerrorerror '
+
error
)
})
//
}
},
// 省份查询
...
...
www.zip
0 → 100644
View file @
1881a25e
File added
www/index.html
View file @
1881a25e
<!DOCTYPE html>
<html><head><meta
charset=
utf-8
><meta
name=
viewport
content=
"initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no,width=device-width,viewport-fit=cover"
><meta
name=
format-detection
content=
"telephone=no"
><meta
name=
format-detection
content=
"email=no"
><meta
name=
apple-mobile-web-app-capable
content=
yes
><meta
name=
apple-mobile-web-app-status-bar-style
content=
black
><script
type=
text/javascript
src=
./static/vuePlatform.js
></script><script
type=
text/javascript
src=
./static/prototype.js
></script><script
type=
text/javascript
src=
./cordova.js
></script><script
type=
text/javascript
src=
"http://api.map.baidu.com/api?v=2.0&ak=Eoo0EtfjYCdAy7r8D19gZ0vMojdZpHqU"
></script><title>
徐工金服
</title><link
href=
./static/css/app.4df5bfd4df456db4bc580b0772f120e7.css
rel=
stylesheet
></head><body><div
id=
app-box
></div><script
type=
text/javascript
src=
./static/js/manifest.6a178e8d77c32e3c385d.js
></script><script
type=
text/javascript
src=
./static/js/vendor.adf9b230a1046c0fc990.js
></script><script
type=
text/javascript
src=
./static/js/app.b1b90efe22b1d77d9c11.js
></script></body></html>
<!DOCTYPE html>
<html><head><meta
charset=
utf-8
><meta
name=
viewport
content=
"initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no,width=device-width,viewport-fit=cover"
><meta
name=
format-detection
content=
"telephone=no"
><meta
name=
format-detection
content=
"email=no"
><meta
name=
apple-mobile-web-app-capable
content=
yes
><meta
name=
apple-mobile-web-app-status-bar-style
content=
black
><script
type=
text/javascript
src=
./static/vuePlatform.js
></script><script
type=
text/javascript
src=
./static/prototype.js
></script><script
type=
text/javascript
src=
./cordova.js
></script><script
type=
text/javascript
src=
"http://api.map.baidu.com/api?v=2.0&ak=Eoo0EtfjYCdAy7r8D19gZ0vMojdZpHqU"
></script><title>
徐工金服
</title><link
href=
./static/css/app.d089c3d6affb6993374aa520f9b599cf.css
rel=
stylesheet
></head><body><div
id=
app-box
></div><script
type=
text/javascript
src=
./static/js/manifest.6a178e8d77c32e3c385d.js
></script><script
type=
text/javascript
src=
./static/js/vendor.adf9b230a1046c0fc990.js
></script><script
type=
text/javascript
src=
./static/js/app.8001ee304fb16957d18d.js
></script></body></html>
\ 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