qingyiay
2023-05-16 72935b2a35765bcc3622561bb06f2eccd64caf83
pages/public-page/mapRoute/mapRoute.vue
@@ -15,7 +15,7 @@
            <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>
@@ -213,27 +213,11 @@
      },
      // 唤醒
      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: '目的地位置'
         });
      }
   },
@@ -268,4 +252,8 @@
      }
   }
}
.open-button {
   width: 200rpx;
   margin: 10rpx 0;
}
</style>