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

测试高德uri拉起app

上级 c752108b
......@@ -187,6 +187,7 @@
</template>
<script>
import store from 'storejs';
import {getDetectionName, getOrderInfo, appointment, getHospitalList} from '@/api/appoint';
import SelectHospital from '@/components/selectHospital/index.vue';
import SelectTime from '@/components/selectTime/index.vue';
......@@ -322,6 +323,9 @@ export default {
});
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 = {
......
......@@ -138,6 +138,7 @@
<script>
import {getDetailByYunOrderNo} from '@/api/appoint';
import { mapActions, mapGetters } from 'vuex';
import store from 'storejs';
export default {
data() {
return {
......@@ -193,10 +194,20 @@ export default {
},
selectItem(item) {
console.log(item);
const address = '上海市浦东新区兰花路333';
const url = 'https://uri.amap.com/marker?&name=' + address + '&callnative=1';
const geolocation = store.get('geolocation');
const hospitalName = '上海市浦东新区兰花路333';
let url = '';
if (geolocation && geolocation.lat && geolocation.lng) {
// https://uri.amap.com/navigation
} else {
console.log(item);
const latitude = '121.287689';
const longitude = '31.234527';
url = 'https://uri.amap.com/marker?&name=' + hospitalName + '&position=' + latitude + ',' + longitude;
}
window.open(url);
},
bindingCode() {
this.$router.push({
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册