|
@@ -189,9 +189,15 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+ import * as WxJsApi from '@/utils/wxJsApi.js'
|
|
|
+ import MapLoader from '@/utils/AMap'
|
|
|
+
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
+ longitude: '',
|
|
|
+ latitude: '',
|
|
|
+ message: '',
|
|
|
tabbarList: [{
|
|
|
iconPath: "home-3-line",
|
|
|
selectedIconPath: "home-3-fill",
|
|
@@ -219,6 +225,32 @@
|
|
|
],
|
|
|
current: 0
|
|
|
}
|
|
|
+ },
|
|
|
+ onReady() {
|
|
|
+ WxJsApi.getWxConfig(['getLocation','addEventListener']).then((res)=>{
|
|
|
+ // console.log(res)
|
|
|
+ }).catch(error => {
|
|
|
+ console.log(res)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ getPoint() {
|
|
|
+ WxJsApi.getLocation().then((res) => {
|
|
|
+ this.latitude = parseFloat(res.latitude);
|
|
|
+ this.longitude = parseFloat(res.longitude);
|
|
|
+ this.message = res.errMsg;
|
|
|
+
|
|
|
+ if(res.errMsg != 'getLocation:ok') {
|
|
|
+ uni.showToast({
|
|
|
+ title:JSON.stringify(res)
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }).catch(error => {
|
|
|
+ uni.showToast({
|
|
|
+ title:JSON.stringify(error)
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
}
|
|
|
}
|
|
|
</script>
|