| | |
| | | <text>{{ duration || '' }}</text> |
| | | </view> |
| | | </view> |
| | | <!-- <view class="" @click="awaken"><button type="default">跳转</button></view> --> |
| | | <view class="open-button" @click="awaken"><button type="default">跳转</button></view> |
| | | </view> |
| | | </template> |
| | | |
| | |
| | | }, |
| | | // 唤醒 |
| | | awaken() { |
| | | uni.getSystemInfo({ |
| | | success: function(res) { |
| | | if (res.platform == 'android') { |
| | | uni.navigateTo({ |
| | | url: `intent://map/routeplan?type=drive&fromcoord=&from=${_this.fromLocation}&tocoord=${_this.toLocation.latitude},${ |
| | | _this.toLocation.longitude |
| | | }&to=name&policy=0&referer=myapp#Intent;scheme=qqmap;package=com.tencent.map;end` |
| | | }); |
| | | } else if (res.platform == 'ios') { |
| | | uni.navigateTo({ |
| | | url: `qqmap://map/routeplan?type=drive&fromcoord=&from=${_this.fromLocation}&tocoord=${_this.toLocation.latitude},${ |
| | | _this.toLocation.longitude |
| | | }&to=name&policy=0&referer=myapp` |
| | | }); |
| | | } else { |
| | | uni.showToast({ |
| | | title: '当前设备不支持地图导航', |
| | | icon: 'none' |
| | | }); |
| | | } |
| | | } |
| | | uni.openLocation({ |
| | | latitude: this.markers[1].latitude, |
| | | longitude: this.markers[1].longitude, |
| | | name: '目的地位置', |
| | | address: '目的地位置' |
| | | }); |
| | | } |
| | | }, |
| | |
| | | } |
| | | } |
| | | } |
| | | .open-button { |
| | | width: 200rpx; |
| | | margin: 10rpx 0; |
| | | } |
| | | </style> |