|
@@ -21,7 +21,7 @@
|
|
|
<span class="cell-value">{{ state.detail.shop_name }}</span>
|
|
|
</div>
|
|
|
<div class="cell">
|
|
|
- <strong class="primary">Navigation></strong>
|
|
|
+ <strong class="primary" @click="navigate">Navigation></strong>
|
|
|
</div>
|
|
|
<div class="cell">
|
|
|
<span class="cell-label">Phone Brand:</span>
|
|
@@ -66,6 +66,7 @@ import { state } from '../store'
|
|
|
import { cancelRepair } from '@/service/repair'
|
|
|
import Toast from '@/components/toast'
|
|
|
import dayjs from 'dayjs'
|
|
|
+import getLocation from '@/utils/getLocation'
|
|
|
|
|
|
const router = useRouter()
|
|
|
|
|
@@ -88,4 +89,13 @@ async function applyCancel() {
|
|
|
Toast(message)
|
|
|
setTimeout(() => router.push('/repair/history'), 500)
|
|
|
}
|
|
|
+
|
|
|
+async function navigate() {
|
|
|
+ const { coords } = (await getLocation({ timeout: 800 })) || {}
|
|
|
+ window.open(
|
|
|
+ `https://maps.google.com/maps?${
|
|
|
+ coords ? `saddr=${coords.latitude},${coords.longitude}&` : ''
|
|
|
+ }daddr=${state.shop.coordinates || ''}`
|
|
|
+ )
|
|
|
+}
|
|
|
</script>
|