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

add

上级 430eaf59
...@@ -12,7 +12,6 @@ ...@@ -12,7 +12,6 @@
<link rel="dns-prefetch" href="<%= process.env.VUE_APP_SERVICE_URL %>"> <link rel="dns-prefetch" href="<%= process.env.VUE_APP_SERVICE_URL %>">
<link rel="icon" type="image/x-icon" href="<%= VUE_APP_OSS_URL %>static/img/logo.png"> <link rel="icon" type="image/x-icon" href="<%= VUE_APP_OSS_URL %>static/img/logo.png">
<title>云鹊医</title> <title>云鹊医</title>
<script type="text/javascript" src="https://apis.map.qq.com/tools/geolocation/min?key=GCUBZ-6O6K3-VVB3E-3PNKF-HY77K-G6BTN&referer=myapp"></script>
</head> </head>
<body> <body>
<noscript> <noscript>
......
...@@ -59,9 +59,8 @@ sessionStorage.setItem('headerHeight', 0); ...@@ -59,9 +59,8 @@ sessionStorage.setItem('headerHeight', 0);
window.Vue.use(Loading); window.Vue.use(Loading);
// 设置安全密钥 // 设置安全密钥
window._AMapSecurityConfig = { window._AMapSecurityConfig = {
securityJsCode: '5dfc1ae6a14ad5c005ffb2ad6d718ae4' securityJsCode: 'f5093bfce95bd0393749259bcc44ede8'
}; };
// 获取位置信息 腾讯地图api
console.log('router, store, vueApp: ', router, store, vueApp); console.log('router, store, vueApp: ', router, store, vueApp);
console.log('window :>> ', window); console.log('window :>> ', window);
...@@ -201,7 +201,7 @@ import {getDetectionName, getOrderInfo, appointment, getHospitalList} from '@/ap ...@@ -201,7 +201,7 @@ import {getDetectionName, getOrderInfo, appointment, getHospitalList} from '@/ap
import SelectHospital from '@/components/selectHospital/index.vue'; import SelectHospital from '@/components/selectHospital/index.vue';
import SelectTime from '@/components/selectTime/index.vue'; import SelectTime from '@/components/selectTime/index.vue';
import PickArea from '@/components/pickArea/index.vue'; import PickArea from '@/components/pickArea/index.vue';
// import AMapLoader from '@amap/amap-jsapi-loader';
export default { export default {
components: { components: {
SelectHospital, SelectHospital,
......
...@@ -243,7 +243,7 @@ export default { ...@@ -243,7 +243,7 @@ export default {
break; break;
case 3: case 3:
// https://lbsyun.baidu.com/index.php?title=uri/api/web // https://lbsyun.baidu.com/index.php?title=uri/api/web
url = 'http://api.map.baidu.com/direction?origin=latlng:' + geolocation.lat + ',' + geolocation.lng + '|name:' + geolocation.addr + '&destination=latlng:' + latitude + ',' + longitude + '|name:' + hospitalName + '&region=' + geolocation.city + '&mode=driving&output=html&src=webapp.baidu.openAPIdemo&coord_type=bd09ll'; url = 'http://api.map.baidu.com/direction?origin=latlng:' + geolocation.lat + ',' + geolocation.lng + '|name:' + geolocation.addr + '&destination=latlng:' + latitude + ',' + longitude + '|name:' + hospitalName + '&region=' + geolocation.city + '&mode=driving&output=html&src=webapp.baidu.openAPIdemo&coord_type=gcj02';
break; break;
default: default:
url = 'https://uri.amap.com/marker?&name=' + hospitalName + '&position=' + longitude + ',' + latitude + '&callnative=1'; url = 'https://uri.amap.com/marker?&name=' + hospitalName + '&position=' + longitude + ',' + latitude + '&callnative=1';
...@@ -258,11 +258,11 @@ export default { ...@@ -258,11 +258,11 @@ export default {
break; break;
case 2: case 2:
// https://lbs.qq.com/webApi/uriV1/uriGuide/uriWebMarker api地址 // https://lbs.qq.com/webApi/uriV1/uriGuide/uriWebMarker api地址
url = 'https://apis.map.qq.com/uri/v1/geocoder?coord=' + latitude + ',' + longitude + '&referer=PICA'; url = 'https://apis.map.qq.com/uri/v1/geocoder?coord=' + latitude + ',' + longitude + '&referer=GCUBZ-6O6K3-VVB3E-3PNKF-HY77K-G6BTN';
break; break;
case 3: case 3:
// https://lbsyun.baidu.com/index.php?title=uri/api/web api地址 // https://lbsyun.baidu.com/index.php?title=uri/api/web api地址
url = 'http://api.map.baidu.com/marker?location=' + latitude + ',' + longitude + '&title=' + hospitalName + '&output=html&src=webapp.baidu.openAPIdemo'; url = 'http://api.map.baidu.com/marker?location=' + latitude + ',' + longitude + '&title=' + hospitalName + '&coord_type=gcj02&output=html&src=webapp.baidu.openAPIdemo';
break; break;
default: default:
url = 'https://uri.amap.com/marker?&name=' + hospitalName + '&position=' + longitude + ',' + latitude + '&callnative=1'; url = 'https://uri.amap.com/marker?&name=' + hospitalName + '&position=' + longitude + ',' + latitude + '&callnative=1';
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
import { getJumpPageStatus, createOrder } from '@/api/question'; import { getJumpPageStatus, createOrder } from '@/api/question';
import { getDetectionName } from '@/api/appoint'; import { getDetectionName } from '@/api/appoint';
import storejs from 'storejs'; import storejs from 'storejs';
import AMapLoader from '@amap/amap-jsapi-loader';
export default { export default {
data() { data() {
return { return {
...@@ -46,18 +47,59 @@ export default { ...@@ -46,18 +47,59 @@ export default {
this.projectEquityNo = projectEquityNo; this.projectEquityNo = projectEquityNo;
this.externalOrderNo = externalOrderNo; this.externalOrderNo = externalOrderNo;
// get geolocation // get geolocation
var that = this; // var that = this;
var geolocation = new qq.maps.Geolocation(); // var geolocation = new qq.maps.Geolocation();
geolocation.getLocation(function (result) { // geolocation.getLocation(function (result) {
console.log('result', result); // console.log('result', result);
storejs.set('geolocation', result); // storejs.set('geolocation', result);
that.getJumpPageStatus(); // that.getJumpPageStatus();
}, function (result) { // }, function (result) {
console.log('err', result); // console.log('err', result);
that.getJumpPageStatus(); // that.getJumpPageStatus();
}); // });
this.initMap();
}, },
methods: { methods: {
// 高德地图导航只有在线上环境才能使用
initMap() {
this.getJumpPageStatus();
// latitude: 70
// longitude: 50.2
// const data = {
// projectEquityNo: that.projectEquityNo,
// latitude: 70,
// longitude: 50.2,
// };
// that.getHospitalList(data);
AMapLoader.load({
key:'009dd02e4fe0a1b5f895cd7b86b9e216', // 申请好的Web端开发者Key,首次调用 load 时必填
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 (geolocation.result) {
storejs.set('geolocation', geolocation.result);
}
});
});
});
},
// 目前是配置一个检测信息,可能会拓展,所以返回的是一个list // 目前是配置一个检测信息,可能会拓展,所以返回的是一个list
getDetectionName(yunOrderNo) { getDetectionName(yunOrderNo) {
getDetectionName(yunOrderNo).then(res => { getDetectionName(yunOrderNo).then(res => {
...@@ -92,7 +134,7 @@ export default { ...@@ -92,7 +134,7 @@ export default {
this.yunOrderNo = res.data.yunOrderNo; this.yunOrderNo = res.data.yunOrderNo;
this.query.yunOrderNo = res.data.yunOrderNo; this.query.yunOrderNo = res.data.yunOrderNo;
this.status = res.data.status; this.status = res.data.status;
this.status = '0102';
this.getDetectionName(this.yunOrderNo); this.getDetectionName(this.yunOrderNo);
switch (this.status) { switch (this.status) {
case '0101': case '0101':
......
...@@ -105,7 +105,7 @@ export default { ...@@ -105,7 +105,7 @@ export default {
padding: 0 16px; padding: 0 16px;
color: #676869; color: #676869;
text-align: center; text-align: center;
overflow: auto; overflow: hidden;
.icon-item { .icon-item {
width: 57px; width: 57px;
height: 65px; height: 65px;
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册