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

测试高德uri拉起app

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