Browse Source

更改定位逻辑

master
parent
commit
c5be17fb1a
  1. 7
      main.js
  2. 11
      sub/task/locate.vue

7
main.js

@ -9,18 +9,21 @@ import * as roles from '@/utils/permission.js'
// 引入uView
import uView from '@/uni_modules/uview-ui'
import mpShare from '@/uni_modules/uview-ui/libs/mixin/mpShare.js'
import TencentMap from '@/static/js/qqmap-wx-jssdk.min.js'
Vue.mixin(mpShare)
// 挂载全局对象
Vue.use(plugins).use(uView)
Vue.config.productionTip = false
const map = new TencentMap({
key: 'PQ5BZ-GZ5C7-RTMXB-HSAPB-3TOAV-5CBLZ'
})
// 挂载vuex
Vue.prototype.$store = store
Vue.prototype.$dict = dict
Vue.prototype.$util = util
Vue.prototype.$roles = roles
Vue.prototype.$map = map
App.mpType = 'app'
const app = new Vue({

11
sub/task/locate.vue

@ -142,7 +142,6 @@
</template>
<script>
import TencentMap from '@/static/js/qqmap-wx-jssdk.min.js'
import { getMiniCode } from '@/utils/getCode.js'
import { InspectionsApi } from '@/api/inspections/index.js'
import { getEnterPrise } from '@/api/enterprise/index.js'
@ -191,7 +190,6 @@ export default {
imageUrl:
'http://82.156.141.150:9001/api/v1/download-shared-object/aHR0cDovL2xvY2FsaG9zdDo5MDAwL2h1YW5iYW8vbWluaWFwcC9pbnZhdGUucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUQxODY1RVA2NEczMEdEUUhDVTglMkYyMDI1MDIxOCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMThUMDcyMDI0WiZYLUFtei1FeHBpcmVzPTQzMTk5JlgtQW16LVNlY3VyaXR5LVRva2VuPWV5SmhiR2NpT2lKSVV6VXhNaUlzSW5SNWNDSTZJa3BYVkNKOS5leUpoWTJObGMzTkxaWGtpT2lKQlJERTROalZGVURZMFJ6TXdSMFJSU0VOVk9DSXNJbVY0Y0NJNk1UY3pPVGt3TmpJME55d2ljR0Z5Wlc1MElqb2lZV1J0YVc0aWZRLmp6djBhdEY5QVBYXzVjYWg4c18yeXhVV3oxek9BekFzSVdzemVrUmZwcXlHd0RPWkptazlUSGJRUnBDdVNmLVMyU0otWTI1cldUd2hpNUlrY0xBSThRJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZ2ZXJzaW9uSWQ9bnVsbCZYLUFtei1TaWduYXR1cmU9MjcxZTkzOTE1MDkwYzUzYmRjYTg0MjQ1MTJhYjk3ZWQxZWMyN2QzM2MwM2U3NGUwYmRhNTBmYjQyNWI0N2MyOQ'
}
this.useAuth()
this.init()
},
onShareAppMessage() {
@ -201,12 +199,16 @@ export default {
return this.share
},
onShow() {
this.useAuth()
// this.refresh()
// this.echoQueset()
},
onHide() {
this.timer && clearInterval(this.timer)
},
onUnload() {
this.timer && clearInterval(this.timer)
},
onBackPress() {
this.timer && clearInterval(this.timer)
return false
@ -322,10 +324,7 @@ export default {
},
getDistance() {
const that = this
const map = new TencentMap({
key: 'PQ5BZ-GZ5C7-RTMXB-HSAPB-3TOAV-5CBLZ'
})
map.calculateDistance({
this.$map.calculateDistance({
mode: 'straight',
form: this.location,
to: this.enterpriseGps,

Loading…
Cancel
Save