Commit b51051ed authored by 李晓兵's avatar 李晓兵

'百度地图插件'

parent 6c7ce965
...@@ -10,5 +10,5 @@ module.exports = { ...@@ -10,5 +10,5 @@ module.exports = {
filePath: '"http://180.104.121.66:8088/r/api/app/fileViewSvc?sysName=XCMG_DEV&apiName=file_view&"', filePath: '"http://180.104.121.66:8088/r/api/app/fileViewSvc?sysName=XCMG_DEV&apiName=file_view&"',
ocrPath:'"http://180.104.121.66:8088/r/api"', ocrPath:'"http://180.104.121.66:8088/r/api"',
appId: '"com.xcmg.app"', appId: '"com.xcmg.app"',
currentVersion: '"1.1.6"' currentVersion: '"1.1.8"'
} }
...@@ -16,8 +16,7 @@ ...@@ -16,8 +16,7 @@
<script type="text/javascript" src="./static/prototype.js"></script> <script type="text/javascript" src="./static/prototype.js"></script>
<script type="text/javascript" src="cordova.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=o7fTnpVAGzXKN7SirV8xGU2xzWQS2NrI"></script> <script type="text/javascript" src="https://api.map.baidu.com/api?v=2.0&ak=o7fTnpVAGzXKN7SirV8xGU2xzWQS2NrI"></script>
<script type="text/javascript" src="http://developer.baidu.com/map/jsdemo/demo/convertor.js"></script>
<title>徐工融租</title> <title>徐工融租</title>
</head> </head>
<body> <body>
......
...@@ -107,7 +107,7 @@ ...@@ -107,7 +107,7 @@
"is_top_level": true, "is_top_level": true,
"variables": { "variables": {
"ANDROID_KEY": "YCDrAzwghWe3Ghps2QkIPBWANkDsgkOP", "ANDROID_KEY": "YCDrAzwghWe3Ghps2QkIPBWANkDsgkOP",
"IOS_KEY": "HTTVa66Fmu7xLbanhWGIMxK5MEPZeuDN" "IOS_KEY": "q0niXfvEg9ToZSD1DvTvGTfeN2b6AbKT"
} }
}, },
"cordova-plugin-camera": { "cordova-plugin-camera": {
......
...@@ -59,8 +59,8 @@ import Jpush from './scripts/jpushService' ...@@ -59,8 +59,8 @@ import Jpush from './scripts/jpushService'
import Jmessage from './scripts/jmessageService' import Jmessage from './scripts/jmessageService'
// if (process.env.CONFIG_ENV === 'uat') { // if (process.env.CONFIG_ENV === 'uat') {
const VConsole = require('vconsole') // const VConsole = require('vconsole')
new VConsole() // eslint-disable-line // new VConsole() // eslint-disable-line
// } // }
Vue.use(componentInstall) Vue.use(componentInstall)
......
...@@ -96,8 +96,8 @@ export default { ...@@ -96,8 +96,8 @@ export default {
{ {
// 定位 // 定位
getLocation () { getLocation () {
console.log('getLocation')
let vm = this let vm = this
if (vum.Platform.isAndroid()) { // 安卓采用jsapi
var geolocation = new BMap.Geolocation() var geolocation = new BMap.Geolocation()
geolocation.getCurrentPosition(function (res) { geolocation.getCurrentPosition(function (res) {
if (this.getStatus() === 0) { if (this.getStatus() === 0) {
...@@ -114,6 +114,19 @@ export default { ...@@ -114,6 +114,19 @@ export default {
vm.guessingQuery() // 猜你喜欢查询 vm.guessingQuery() // 猜你喜欢查询
} }
}, {enableHighAccuracy: true}) }, {enableHighAccuracy: true})
} else { // ios使用插件定位
baidumap_location.getCurrentPosition(function (result) {
if (window.localStorage.getItem('province')) {
vm.city = window.localStorage.getItem('city')
vm.province = window.localStorage.getItem('province')
} else {
vm.city = result.city
vm.province = result.addr
}
vm.guessingQuery() // 猜你喜欢查询
}, function (error) {
})
}
}, },
goFunctionHome (data) { goFunctionHome (data) {
this.$router.push({ this.$router.push({
......
...@@ -95,10 +95,9 @@ export default { ...@@ -95,10 +95,9 @@ export default {
// 重新定位到当前位置 // 重新定位到当前位置
relocation () { relocation () {
let vm = this let vm = this
if (vum.Platform.isAndroid()) { // 安卓采用jsapi
var geolocation = new BMap.Geolocation() var geolocation = new BMap.Geolocation()
console.log('geolocationgeolocation' + JSON.stringify(geolocation))
geolocation.getCurrentPosition(function (res) { geolocation.getCurrentPosition(function (res) {
console.log('^^^^^^^^^^^^^^^^' + JSON.stringify(res))
if (this.getStatus() === 0) { if (this.getStatus() === 0) {
window.localStorage.setItem('province', res.address.province) window.localStorage.setItem('province', res.address.province)
window.localStorage.setItem('city', res.address.city) window.localStorage.setItem('city', res.address.city)
...@@ -111,6 +110,19 @@ export default { ...@@ -111,6 +110,19 @@ export default {
}, function (error) { }, function (error) {
console.log(error) console.log(error)
}, {enableHighAccuracy: true}) }, {enableHighAccuracy: true})
} else { // ios使用插件定位
baidumap_location.getCurrentPosition(function (result) {
window.localStorage.setItem('province', result.addr)
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) {
})
}
}, },
// 省份查询 // 省份查询
......
...@@ -229,7 +229,7 @@ export default { ...@@ -229,7 +229,7 @@ export default {
background-color: #fff; background-color: #fff;
border-radius: 8px; border-radius: 8px;
// margin-top: 15%; // margin-top: 15%;
margin-top: 10%; margin-top: 6%;
padding: 32px 24px; padding: 32px 24px;
.title { .title {
width: 227px; width: 227px;
......
<!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=o7fTnpVAGzXKN7SirV8xGU2xzWQS2NrI"></script><script type=text/javascript src=http://developer.baidu.com/map/jsdemo/demo/convertor.js></script><title>徐工融租</title><link href=./static/css/app.6be6f6b891fa9101bc818fb8402fa845.css rel=stylesheet></head><body><div id=app-box></div><script type=text/javascript src=./static/js/manifest.3ad1d5771e9b13dbdad2.js></script><script type=text/javascript src=./static/js/vendor.efd596b798e6119ce4a4.js></script><script type=text/javascript src=./static/js/app.682be009731f8616f0d9.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="https://api.map.baidu.com/api?v=3.0&ak=o7fTnpVAGzXKN7SirV8xGU2xzWQS2NrI"></script><title>徐工融租</title><link href=./static/css/app.79f91c642f9f223cd008e2be175d7203.css rel=stylesheet></head><body><div id=app-box></div><script type=text/javascript src=./static/js/manifest.3ad1d5771e9b13dbdad2.js></script><script type=text/javascript src=./static/js/vendor.e547499500fbe65e7169.js></script><script type=text/javascript src=./static/js/app.8b23c313c3ff7e3b9bba.js></script></body></html>
\ No newline at end of file \ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment