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

Feature/zjx

上级 3b1bc723
...@@ -14,7 +14,8 @@ module.exports = { ...@@ -14,7 +14,8 @@ module.exports = {
globals: { globals: {
'gdp': true, 'gdp': true,
'uni': true, 'uni': true,
'wx':true 'wx': true,
'qq':true
}, },
// add your custom rules here // add your custom rules here
//it is base on https://github.com/vuejs/eslint-config-vue //it is base on https://github.com/vuejs/eslint-config-vue
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
<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>
...@@ -28,22 +29,21 @@ ...@@ -28,22 +29,21 @@
<script src="<%= VUE_APP_OSS_URL %>static/js/crypto.min-4.0.0.js"></script> <script src="<%= VUE_APP_OSS_URL %>static/js/crypto.min-4.0.0.js"></script>
<script src="<%= VUE_APP_OSS_URL %>static/js/vconsole-3.3.4.js"></script> <script src="<%= VUE_APP_OSS_URL %>static/js/vconsole-3.3.4.js"></script>
<script src="<%= VUE_APP_OSS_URL %>static/js/lodash-4.17.15.js"></script> <script src="<%= VUE_APP_OSS_URL %>static/js/lodash-4.17.15.js"></script>
<script> <script>
// !(function(c,b,d,a){c[a]||(c[a]={});c[a].config= !(function(c,b,d,a){c[a]||(c[a]={});c[a].config=
// { {
// pid:"bj53rb58f5@29641a9002f6545", pid:"bj53rb58f5@29641a9002f6545",
// appType:"web", appType:"web",
// imgUrl:"https://arms-retcode.aliyuncs.com/r.png?", imgUrl:"https://arms-retcode.aliyuncs.com/r.png?",
// sendResource:true, sendResource:true,
// enableLinkTrace:true, enableLinkTrace:true,
// behavior:true, behavior:true,
// useFmp:true, useFmp:true,
// enableSPA:true, enableSPA:true,
// enableConsole:true enableConsole:true
// }; };
// with(b)with(body)with(insertBefore(createElement("script"),firstChild))setAttribute("crossorigin","",src=d) with(b)with(body)with(insertBefore(createElement("script"),firstChild))setAttribute("crossorigin","",src=d)
// })(window,document,"https://retcode.alicdn.com/retcode/bl.js","__bl"); })(window,document,"https://retcode.alicdn.com/retcode/bl.js","__bl");
</script> </script>
</body> </body>
</html> </html>
...@@ -61,5 +61,7 @@ window.Vue.use(Loading); ...@@ -61,5 +61,7 @@ window.Vue.use(Loading);
window._AMapSecurityConfig = { window._AMapSecurityConfig = {
securityJsCode: '5dfc1ae6a14ad5c005ffb2ad6d718ae4' securityJsCode: '5dfc1ae6a14ad5c005ffb2ad6d718ae4'
}; };
// 获取位置信息 腾讯地图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'; // import AMapLoader from '@amap/amap-jsapi-loader';
export default { export default {
components: { components: {
SelectHospital, SelectHospital,
...@@ -300,69 +300,25 @@ export default { ...@@ -300,69 +300,25 @@ export default {
this.getOrderInfo(yunOrderNo); this.getOrderInfo(yunOrderNo);
this.initMap(); this.initMap();
// document.addEventListener('UniAppJSBridgeReady', function() {
// console.log('UniAppJSBridgeReady', uni);
// });
// if (uni) {
// this.uni = uni;
// }
}, },
methods: { methods: {
choose() {}, choose() {},
submit() { // submit() {
console.log('1122334', this.$rocNative.WXInstance.miniProgram.navigateTo); // this.$rocNative.WXInstance.miniProgram.navigateTo({
// url:'/pagesInsurance/appoint-details/index?yunOrderNo=' + this.yunOrderNo
this.$rocNative.WXInstance.miniProgram.navigateTo({ // });
url:'/pagesInsurance/appoint-details/index?yunOrderNo=' + this.yunOrderNo // },
});
},
// 高德地图导航只有在线上环境才能使用 // 高德地图导航只有在线上环境才能使用
initMap() { initMap() {
var that = this; const result = store.get('geolocation');
// latitude: 70 this.position.latitude = result.lat || '';
// longitude: 50.2 this.position.longitude = result.lng || '';
const data = { const data = {
projectEquityNo: that.projectEquityNo, projectEquityNo: this.projectEquityNo,
latitude: 70, latitude: this.position.latitude,
longitude: 50.2, longitude:this.position.longitude,
}; };
that.getHospitalList(data); this.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 (geolocation.result) {
store.set('geolocation', geolocation.result.position);
}
that.position.latitude = result.position.lat || '';
that.position.longitude = result.position.lng || '';
const data = {
projectEquityNo: that.projectEquityNo,
latitude: that.position.latitude,
longitude:that.position.longitude,
};
that.getHospitalList(data);
});
});
});
}, },
// 根据坐标获取最近的机构id // 根据坐标获取最近的机构id
getHospitalList(data) { getHospitalList(data) {
......
...@@ -232,18 +232,18 @@ export default { ...@@ -232,18 +232,18 @@ export default {
// https://uri.amap.com/navigation // https://uri.amap.com/navigation
switch (item.value) { switch (item.value) {
case 1: case 1:
// navigation?from=116.478346,39.997361,startpoint&to=116.3246,39.966577,endpoint&via=116.402796,39.936915,midwaypoint&mode=car&policy=1&src=mypage&coordinate=gaode&callnative=0
// https://lbs.amap.com/api/uri-api/guide/mobile-web/point api地址 // https://lbs.amap.com/api/uri-api/guide/mobile-web/point api地址
url = 'https://uri.amap.com/marker?&name=' + hospitalName + '&position=' + longitude + ',' + latitude + '&callnative=1'; url = `https://uri.amap.com/navigation?from=${geolocation.lng},${geolocation.lat},${geolocation.addr}&to=${longitude},${latitude},${hospitalName}&mode=car&policy=1&src=mypage&coordinate=gaode&callnative=0`;
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'; // https://apis.map.qq.com/uri/v1/routeplan?type=bus&from=我的家&fromcoord=39.980683,116.302&to=中关村&tocoord=39.9836,116.3164&policy=1&referer=OB4BZ-D4W3U-B7VVO-4PJWW-6TKDJ-WPB77
url = `https://apis.map.qq.com/uri/v1/routeplan?type=drive&from=${geolocation.addr}&fromcoord=${geolocation.lat},${geolocation.lng}&to=${hospitalName}&tocoord=${latitude},${longitude}&policy=0&referer=GCUBZ-6O6K3-VVB3E-3PNKF-HY77K-G6BTN`;
break; break;
case 3: case 3:
// http://api.map.baidu.com/direction?origin=latlng:34.264642646862,108.95108518068|name:我家&destination=大雁塔&mode=driving&region=西安&output=html&src=webapp.baidu.openAPIdemo // 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';
// https://lbsyun.baidu.com/index.php?title=uri/api/web api地址
url = 'http://api.map.baidu.com/direction?origin=latlng:' + latitude + ',' + longitude + '&destination=' + geolocation.lat + ',' + geolocation.lng + + '&output=html&src=webapp.baidu.openAPIdemo&coord_type=bd09ll';
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';
......
...@@ -4,7 +4,8 @@ ...@@ -4,7 +4,8 @@
<script> <script>
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';
export default { export default {
data() { data() {
return { return {
...@@ -44,7 +45,16 @@ export default { ...@@ -44,7 +45,16 @@ export default {
this.query = this.$route.query; this.query = this.$route.query;
this.projectEquityNo = projectEquityNo; this.projectEquityNo = projectEquityNo;
this.externalOrderNo = externalOrderNo; this.externalOrderNo = externalOrderNo;
this.getJumpPageStatus(); var geolocation = new qq.maps.Geolocation();
geolocation.getLocation(function (result) {
console.log('result', result);
storejs.set('geolocation', result);
this.getJumpPageStatus();
}, function (result) {
console.log('err', result);
this.getJumpPageStatus();
});
}, },
methods: { methods: {
// 目前是配置一个检测信息,可能会拓展,所以返回的是一个list // 目前是配置一个检测信息,可能会拓展,所以返回的是一个list
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册