|
@@ -29,14 +29,14 @@
|
|
|
v-for="(item, index) of list"
|
|
|
:key="index"
|
|
|
class="shop-item border-bottom"
|
|
|
- @click="!item.can_appointment && selectShop(item)"
|
|
|
+ @click="item.can_appointment && selectShop(item)"
|
|
|
>
|
|
|
<div class="shop-name">
|
|
|
<span>{{ item.name }}</span>
|
|
|
- <span>3.5KM</span>
|
|
|
+ <!-- <span>3.5KM</span> -->
|
|
|
</div>
|
|
|
<div class="shop-address">
|
|
|
- {{ item.shop_detail }},{{ item.address }}
|
|
|
+ {{ item.centre_name }},{{ item.address }}
|
|
|
</div>
|
|
|
<div class="shop-mark" :class="{ danger: !item.can_appointment }">
|
|
|
<i class="icon"></i
|
|
@@ -66,7 +66,7 @@ const loading = ref(false)
|
|
|
const hasMore = ref(true)
|
|
|
const list = ref<any[]>()
|
|
|
let pageNo = 1
|
|
|
-let coords: any = null
|
|
|
+let coords: GeolocationCoordinates | undefined
|
|
|
|
|
|
async function fetchData() {
|
|
|
loading.value = true
|
|
@@ -76,7 +76,12 @@ async function fetchData() {
|
|
|
const res = await getLocation({ timeout: 2000 })
|
|
|
coords = res?.coords
|
|
|
}
|
|
|
- const { results, pageBean } = await getShopList({})
|
|
|
+ const { results, pageBean } = await getShopList({
|
|
|
+ page: pageNo,
|
|
|
+ size: 10,
|
|
|
+ lat: coords?.latitude,
|
|
|
+ lng: coords?.longitude,
|
|
|
+ })
|
|
|
list.value.push(...results)
|
|
|
pageNo++
|
|
|
hasMore.value = list.value.length === pageBean.totalCount
|