Commit e52f7622 authored by chenqikuai's avatar chenqikuai

fix: 修复距离展示

parent 85d5113b
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
> >
<div class="text-gray-400 text-xs">{{ location }}</div> <div class="text-gray-400 text-xs">{{ location }}</div>
<div class="text-gray-400 text-xs float-right ml-2"> <div class="text-gray-400 text-xs float-right ml-2">
{{ filter.filterDistance(distance) }} {{ distance }}
</div> </div>
</div> </div>
</div> </div>
......
...@@ -4,11 +4,5 @@ export default { ...@@ -4,11 +4,5 @@ export default {
return phone.slice(0, 3) + "*".repeat(5) + phone.slice(-3); return phone.slice(0, 3) + "*".repeat(5) + phone.slice(-3);
else return ""; else return "";
}, },
filterDistance(distance: string) {
if (!distance) return "";
const m = Number(distance);
const k = m.toFixed(2);
return `${k}km`;
},
// eslint-disable-next-line @typescript-eslint/no-explicit-any // eslint-disable-next-line @typescript-eslint/no-explicit-any
} as { [key: string]: (...args: any) => any }; } as { [key: string]: (...args: any) => any };
export interface iNearbyOutLet { export interface iNearbyOutLet {
distance: string distance: string;
is_normal_work: boolean is_normal_work: boolean;
latitude: string latitude: string;
location: string location: string;
longitude: string longitude: string;
name: string name: string;
opening_hours: string opening_hours: string;
weekend_status: number weekend_status: number;
outlet_id: number outlet_id: number;
pos_id: string;
} }
export interface errorInfo { export interface errorInfo {
note: string note: string;
} }
export interface iOutLetDetail { export interface iOutLetDetail {
id: number id: number;
city_name: string city_name: string;
is_normal_work: boolean is_normal_work: boolean;
latitude: string latitude: string;
location: string location: string;
longitude: string longitude: string;
opening_hours: string pos_id: string;
outlet_name: string opening_hours: string;
region_name: string outlet_name: string;
weekend_status: number region_name: string;
province_name: string weekend_status: number;
} province_name: string;
\ No newline at end of file }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment