mirror of
https://gitlab.com/little-lines/frontend.git
synced 2024-11-25 08:46:51 +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-card-actions class="stick-bottom btnlist-height justify-sa">
|
||||||
<v-btn @click="viewPopup" rounded="xl" variant="tonal" width="45vw" height="44px">
|
<v-btn @click="viewPopup" rounded="xl" variant="tonal" width="45vw" height="44px">
|
||||||
ย้อนกลับ</v-btn>
|
ย้อนกลับ</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-btn>
|
||||||
|
|
||||||
</v-card-actions>
|
</v-card-actions>
|
||||||
|
@ -240,7 +240,9 @@ export default {
|
||||||
return {
|
return {
|
||||||
showPopup: true,
|
showPopup: true,
|
||||||
showRoute: false,
|
showRoute: false,
|
||||||
userLocation: null
|
userLocation: null,
|
||||||
|
isLocationRequested: false,
|
||||||
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
@ -248,7 +250,9 @@ export default {
|
||||||
return this.showRoute ? '45vh' : '60vh';
|
return this.showRoute ? '45vh' : '60vh';
|
||||||
},
|
},
|
||||||
formattedLocation() {
|
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 `${this.userLocation.lat.toFixed(6)}, ${this.userLocation.lon.toFixed(6)}`;
|
||||||
}
|
}
|
||||||
return 'Location not available';
|
return 'Location not available';
|
||||||
|
@ -263,7 +267,11 @@ export default {
|
||||||
this.getUserLocation();
|
this.getUserLocation();
|
||||||
this.showRoute = true;
|
this.showRoute = true;
|
||||||
},
|
},
|
||||||
|
enterRoute() {
|
||||||
|
console.log("Enter Route");
|
||||||
|
},
|
||||||
getUserLocation() {
|
getUserLocation() {
|
||||||
|
this.isLocationRequested = true;
|
||||||
if (navigator.geolocation) {
|
if (navigator.geolocation) {
|
||||||
navigator.geolocation.getCurrentPosition(this.setLocation, this.handleLocationError);
|
navigator.geolocation.getCurrentPosition(this.setLocation, this.handleLocationError);
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue