提交 85eb2485 编写于 作者: 张敬贤's avatar 张敬贤

add

上级 3296f95d
......@@ -5,6 +5,7 @@ console.log('router, store, vueApp: ', router, store, vueApp);
import '@/assets/js/flexible';
import {isWeixin } from './utils/index';
import Loading from '@/components/loading/loading.js';
import storejs from 'storejs';
// 禁用双指放大
var lastTouchEnd = 0;
......@@ -61,13 +62,14 @@ window.Vue.use(Loading);
window._AMapSecurityConfig = {
securityJsCode: '5dfc1ae6a14ad5c005ffb2ad6d718ae4'
};
// 获取位置信息
var geolocation = new qq.maps.Geolocation();
console.log('geolocation', geolocation.getLocation);
geolocation.getLocation(function (result) {
console.log('result', result);
storejs.set('geolocation', result);
}, function (result) {
console.log(result);
console.log('err', result);
});
console.log('router, store, vueApp: ', router, store, vueApp);
console.log('window :>> ', window);
......@@ -201,7 +201,7 @@ import {getDetectionName, getOrderInfo, appointment, getHospitalList} from '@/ap
import SelectHospital from '@/components/selectHospital/index.vue';
import SelectTime from '@/components/selectTime/index.vue';
import PickArea from '@/components/pickArea/index.vue';
import AMapLoader from '@amap/amap-jsapi-loader';
// import AMapLoader from '@amap/amap-jsapi-loader';
export default {
components: {
SelectHospital,
......@@ -298,71 +298,27 @@ export default {
console.log('yunOrderNo', yunOrderNo);
this.getDetectionName(yunOrderNo);
this.getOrderInfo(yunOrderNo);
// this.initMap();
this.initMap();
// document.addEventListener('UniAppJSBridgeReady', function() {
// console.log('UniAppJSBridgeReady', uni);
// });
// if (uni) {
// this.uni = uni;
// }
},
methods: {
choose() {},
submit() {
console.log('1122334', this.$rocNative.WXInstance.miniProgram.navigateTo);
this.$rocNative.WXInstance.miniProgram.navigateTo({
url:'/pagesInsurance/appoint-details/index?yunOrderNo=' + this.yunOrderNo
});
},
// submit() {
// this.$rocNative.WXInstance.miniProgram.navigateTo({
// url:'/pagesInsurance/appoint-details/index?yunOrderNo=' + this.yunOrderNo
// });
// },
// 高德地图导航只有在线上环境才能使用
initMap() {
var that = this;
// latitude: 70
// longitude: 50.2
// const data = {
// projectEquityNo: that.projectEquityNo,
// latitude: 70,
// longitude: 50.2,
// };
// that.getHospitalList(data);
AMapLoader.load({
key:'d22c1f112c97cb93b8d343b18420b98d', // 申请好的Web端开发者Key,首次调用 load 时必填
version:'2.0', // 指定要加载的 JSAPI 的版本,缺省时默认为 1.4.15
plugins:[''], // 需要使用的的插件列表,如比例尺'AMap.Scale'等
}).then((AMap) => {
AMap.plugin('AMap.Geolocation', function() {
var geolocation = new AMap.Geolocation({
// 是否使用高精度定位,默认:true
enableHighAccuracy: true,
// 设置定位超时时间,默认:无穷大
timeout: 10000,
// 定位按钮的停靠位置的偏移量,默认:Pixel(10, 20)
buttonOffset: new AMap.Pixel(10, 20),
// 定位成功后调整地图视野范围使定位位置及精度范围视野内可见,默认:false
zoomToAccuracy: true,
// 定位按钮的排放位置, RB表示右下
buttonPosition: 'RB'
});
geolocation.getCurrentPosition((status, result) => {
console.log('geolocation,', status, result);
if (result) {
store.set('geolocation', result.position);
}
that.position.latitude = result.position.lat || '';
that.position.longitude = result.position.lng || '';
const result = store.get('geolocation');
this.position.latitude = result.lat || '';
this.position.longitude = result.lng || '';
const data = {
projectEquityNo: that.projectEquityNo,
latitude: that.position.latitude,
longitude:that.position.longitude,
projectEquityNo: this.projectEquityNo,
latitude: this.position.latitude,
longitude:this.position.longitude,
};
that.getHospitalList(data);
});
});
});
this.getHospitalList(data);
},
// 根据坐标获取最近的机构id
getHospitalList(data) {
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册