From 68ef892d62a8c6b4b1f4a048b8b7b354759f69bf Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Tue, 7 Nov 2023 16:35:39 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B8=9B=E0=B8=A3=E0=B8=B1=E0=B8=9A=20ui=20for?= =?UTF-8?q?m?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/FormTime.vue | 182 ++++++++++++++++---------------- src/components/MapCheckin.vue | 31 +++--- src/components/PopUp.vue | 9 +- src/components/TableHistory.vue | 66 ++++++++++-- src/stores/chekin.ts | 21 ++++ src/stores/mixin.ts | 13 +++ src/views/HistoryView.vue | 82 +------------- src/views/HomeView.vue | 72 ++++++------- 8 files changed, 230 insertions(+), 246 deletions(-) diff --git a/src/components/FormTime.vue b/src/components/FormTime.vue index defb283..7bbde35 100644 --- a/src/components/FormTime.vue +++ b/src/components/FormTime.vue @@ -4,7 +4,7 @@ import { useCounterMixin } from "@/stores/mixin"; import moment, { Moment } from "moment"; const mixin = useCounterMixin(); -const { date2Thai } = mixin; +const { date2Thai, covertDateObject } = mixin; const props = defineProps({ dataById: { @@ -42,105 +42,103 @@ function onCkickSave() { } diff --git a/src/components/MapCheckin.vue b/src/components/MapCheckin.vue index 4b08f97..1cad73c 100644 --- a/src/components/MapCheckin.vue +++ b/src/components/MapCheckin.vue @@ -21,8 +21,7 @@ function findNearestPlace() { lng: position.coords.longitude, }; - // ส่ง userLocation ไปยัง API เพื่อหาสถานที่ที่ใกล้ที่สุด - + // ส่ง Location ไปยัง API เพื่อหาสถานที่ที่ใกล้ที่สุด findNearestPlaceFromAPI(userLocation); center.value = userLocation; }, @@ -42,22 +41,14 @@ function findNearestPlaceFromAPI(userLocation: any) { const request = { location: userLocation, - radius: 500, // รัศมีในเมตร - types: [ - "hospital", - "school", - "stadium", - "cafe", - "gym", - "store", - "accounting", - "amusement_park", - ], // ประเภทของสถานที่ที่คุณต้องการค้นหา + radius: 1000, // รัศมีในเมตร + types: ["point_of_interest"], // ประเภทของสถานที่ที่คุณต้องการค้นหา }; placesService.nearbySearch(request, (results: any, status: any) => { if (status === google.maps.places.PlacesServiceStatus.OK) { - console.log("Nearby places:", results); + console.log("Nearby places:", results[0].name); + location.value = results[0].name; } else { console.error("Error fetching nearby places:", status); } @@ -70,20 +61,26 @@ function findNearestPlaceFromAPI(userLocation: any) { bordered flat class="col-12 bg-grey-2 shadow-0" - :style="$q.screen.gt.xs ? 'height: 350px;' : 'height: 220px;'" + :style="$q.screen.gt.xs ? 'height: 350px;' : 'height: 360px;'" >
-
+
พื้นที่ใกล้เคียง : {{ location }} diff --git a/src/components/PopUp.vue b/src/components/PopUp.vue index ff12dd6..af11707 100644 --- a/src/components/PopUp.vue +++ b/src/components/PopUp.vue @@ -34,15 +34,8 @@ watch(props, () => { });