mirror of
https://gitlab.com/little-lines/frontend.git
synced 2024-11-22 00:36:52 +00:00
fix: fixed minor bug
This commit is contained in:
parent
e2075b96d4
commit
82470ecf6b
1 changed files with 11 additions and 3 deletions
|
@ -189,7 +189,7 @@
|
|||
<v-card-actions class="stick-bottom btnlist-height justify-sa">
|
||||
<v-btn @click="viewPopup" rounded="xl" variant="tonal" width="45vw" height="44px">
|
||||
ย้อนกลับ</v-btn>
|
||||
<v-btn @click="viewRoute" rounded="xl" variant="flat" class="text-white" width="45vw" height="44px" color="#f16322">
|
||||
<v-btn @click="enterRoute" rounded="xl" variant="flat" class="text-white" width="45vw" height="44px" color="#f16322">
|
||||
เริ่มการนำทาง</v-btn>
|
||||
|
||||
</v-card-actions>
|
||||
|
@ -240,7 +240,9 @@ export default {
|
|||
return {
|
||||
showPopup: true,
|
||||
showRoute: false,
|
||||
userLocation: null
|
||||
userLocation: null,
|
||||
isLocationRequested: false,
|
||||
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
|
@ -248,7 +250,9 @@ export default {
|
|||
return this.showRoute ? '45vh' : '60vh';
|
||||
},
|
||||
formattedLocation() {
|
||||
if (this.userLocation) {
|
||||
if (this.isLocationRequested && !this.userLocation) {
|
||||
return 'Requesting location...';
|
||||
} else if (this.userLocation) {
|
||||
return `${this.userLocation.lat.toFixed(6)}, ${this.userLocation.lon.toFixed(6)}`;
|
||||
}
|
||||
return 'Location not available';
|
||||
|
@ -263,7 +267,11 @@ export default {
|
|||
this.getUserLocation();
|
||||
this.showRoute = true;
|
||||
},
|
||||
enterRoute() {
|
||||
console.log("Enter Route");
|
||||
},
|
||||
getUserLocation() {
|
||||
this.isLocationRequested = true;
|
||||
if (navigator.geolocation) {
|
||||
navigator.geolocation.getCurrentPosition(this.setLocation, this.handleLocationError);
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue