|
|
@@ -1,5 +1,5 @@
|
|
|
<template>
|
|
|
- <ay-container :cusStyle="{ padding: 0 }">
|
|
|
+ <ay-container :cusStyle="{ padding: 0 }" :showSpac="false">
|
|
|
<swiper
|
|
|
class="swiper nmb-spac"
|
|
|
circular
|
|
|
@@ -19,14 +19,14 @@
|
|
|
<div class="flex-1">
|
|
|
<div class="center justify-start mb-spacd2">
|
|
|
<uni-icons type="location-filled" size="16" class="mr-spacd4" />
|
|
|
- {{ func.convert.nullView(stationInfo.distance) }}km |
|
|
|
+ {{ func.convert.nullView(data.detail.distance) }}km |
|
|
|
{{ func.convert.nullView(data.detail.address) }}
|
|
|
</div>
|
|
|
<ayb-phone :phone="data.detail.mobile" :center="false"></ayb-phone>
|
|
|
</div>
|
|
|
<div
|
|
|
class="text-center p-color"
|
|
|
- :class="{ 'gray-color': !stationInfo.longitude }"
|
|
|
+ :class="{ 'gray-color': !data.detail.longitude }"
|
|
|
@click="methods.openLocation"
|
|
|
>
|
|
|
<uni-icons type="paperplane-filled" color="" size="24" />
|
|
|
@@ -42,7 +42,7 @@
|
|
|
<div class="lng bs-fz">LNG</div>
|
|
|
<div>
|
|
|
<span class="font-bold mr-spacd2 price-color bs-fz">
|
|
|
- {{ stationInfo.actualPrice }}
|
|
|
+ {{ data.detail.actualPrice }}
|
|
|
</span>
|
|
|
<span class="s-fz price">元/公斤</span>
|
|
|
</div>
|
|
|
@@ -68,27 +68,24 @@
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
import defstation from '@img/defstation.png'
|
|
|
-const data = reactive({
|
|
|
- detail: {} as DerIStationDetail,
|
|
|
- stationInfo: null as GasstationVO对象,
|
|
|
+const data = ay.initData({
|
|
|
+ detail: {} as GasstationVO对象,
|
|
|
})
|
|
|
|
|
|
const methods = {
|
|
|
openLocation() {
|
|
|
func.native.openLocation({
|
|
|
- latitude: Number(stationInfo.value.latitude),
|
|
|
- longitude: Number(stationInfo.value.longitude),
|
|
|
- name: stationInfo.value.nickName,
|
|
|
- address: stationInfo.value.address,
|
|
|
+ latitude: Number(data.detail.latitude),
|
|
|
+ longitude: Number(data.detail.longitude),
|
|
|
+ name: data.detail.nickName,
|
|
|
+ address: data.detail.address,
|
|
|
})
|
|
|
},
|
|
|
}
|
|
|
const params = computed(() => {
|
|
|
return store.curPage.pageConfig.params as GasstationVO对象
|
|
|
})
|
|
|
-const stationInfo = computed(() => {
|
|
|
- return data.stationInfo || params.value
|
|
|
-})
|
|
|
+
|
|
|
const pics = computed(() => {
|
|
|
let rv = []
|
|
|
if (data.detail.orgPics?.length > 0) {
|
|
|
@@ -104,17 +101,12 @@ const pics = computed(() => {
|
|
|
})
|
|
|
|
|
|
ay.entrance(async (args) => {
|
|
|
- webapi.user.find_3({ gasstationId: params.value.gasstationId }).then((res) => {
|
|
|
- data.detail = res
|
|
|
+ const location = await func.native.getLocation()
|
|
|
+ data.detail = await webapi.strategy.find_for_mini({
|
|
|
+ gasstationId: params.value.gasstationId,
|
|
|
+ longitude: location.longitude.toString(),
|
|
|
+ latitude: location.latitude.toString(),
|
|
|
})
|
|
|
- if (!Object.hasOwn(params.value, 'distance')) {
|
|
|
- const location = await func.native.getLocation()
|
|
|
- data.stationInfo = await webapi.strategy.find_for_mini({
|
|
|
- gasstationId: params.value.gasstationId,
|
|
|
- longitude: location.longitude.toString(),
|
|
|
- latitude: location.latitude.toString(),
|
|
|
- })
|
|
|
- }
|
|
|
})
|
|
|
</script>
|
|
|
|