9 changed files with 34 additions and 44 deletions
@ -1,26 +1,16 @@ |
|||||
import { useRouter } from 'vue-router' |
import { useRouter } from 'vue-router' |
||||
import { storeToRefs } from 'pinia' |
|
||||
import { useRootStore } from '@/store/root' |
import { useRootStore } from '@/store/root' |
||||
import Brand from '@/utils/Class/Brand' |
import Brand from '@/utils/Class/Brand' |
||||
import { useFacilityNav } from './useFacilityNav' |
|
||||
|
|
||||
export const useServeNav = () => { |
export const useServeNav = () => { |
||||
const router = useRouter() |
const router = useRouter() |
||||
const store = useRootStore() |
const store = useRootStore() |
||||
const { facilityList } = storeToRefs(store) |
|
||||
const { handleFacility } = useFacilityNav() |
|
||||
|
|
||||
function nav({ isPoint, floor, floorOrder, name, nameEn, facilityCode, point, logoUrl }: ServeItem) { |
|
||||
if (isPoint === 1) { |
|
||||
const facility = facilityList.value.find(item => item.code === facilityCode) |
|
||||
if (facility) { |
|
||||
handleFacility(facility) |
|
||||
} |
|
||||
} else if (isPoint === 2) { |
|
||||
const shop = new Brand({ shopName: name, shopNameEn: nameEn, floor, floorOrder, logoUrl, yaxis: point, shopCode: logoUrl }) |
|
||||
store.SET_SHOP(shop) |
|
||||
router.push('/nav') |
|
||||
} |
|
||||
|
function nav({ floor, floorOrder, name, nameEn, point, logoUrl }: ServeItem) { |
||||
|
const shop = new Brand({ shopName: name, shopNameEn: nameEn, floor, floorOrder, logoUrl, yaxis: point, shopCode: logoUrl }) |
||||
|
store.SET_SHOP(shop) |
||||
|
router.push('/nav') |
||||
} |
} |
||||
|
|
||||
return { nav } |
return { nav } |
||||
} |
} |
||||
|
|||||
@ -1,20 +1,21 @@ |
|||||
import { request } from '@/http/http' |
import { request } from '@/http/http' |
||||
import type { WrittenQuery } from './types' |
import type { WrittenQuery } from './types' |
||||
|
import { PREFIX } from '@/enums' |
||||
|
|
||||
//获取配置项
|
//获取配置项
|
||||
export const getConfig = () => request<Config>({ url: '/JSON/config.json' }) |
|
||||
|
export const getConfig = () => request<Config>({ url: `${PREFIX.STATIC_URL}/JSON/config.json` }) |
||||
|
|
||||
//获取天气
|
//获取天气
|
||||
export const getWeather = () => request<Weather>({ url: `/JSON/GetWeather.json` }) |
|
||||
|
export const getWeather = () => request<Weather>({ url: `${PREFIX.STATIC_URL}/JSON/GetWeather.json` }) |
||||
|
|
||||
//获取设施列表
|
//获取设施列表
|
||||
export const getFacilitiesList = () => request<Facility[]>({ url: `/JSON/getFacilityList.json` }) |
|
||||
|
export const getFacilitiesList = () => request<Facility[]>({ url: `${PREFIX.STATIC_URL}/JSON/getFacilityList.json` }) |
||||
|
|
||||
//地图模型数据
|
//地图模型数据
|
||||
export const getMapData = () => request({ url: `/JSON/getMap.json` }) |
|
||||
|
export const getMapData = () => request({ url: `${PREFIX.STATIC_URL}/JSON/getMap.json` }) |
||||
|
|
||||
// 指定时间返回
|
// 指定时间返回
|
||||
export const getBackTime = () => request<[number, number]>({ url: `/JSON/getBackTime.json` }) |
|
||||
|
export const getBackTime = () => request<[number, number]>({ url: `${PREFIX.STATIC_URL}/JSON/getBackTime.json` }) |
||||
|
|
||||
//手写地址
|
//手写地址
|
||||
export const getHandWriting = (data: WrittenQuery) => request<string[]>({ url: 'http://saas.1000my.com:8014/words', method: 'post', data }) |
export const getHandWriting = (data: WrittenQuery) => request<string[]>({ url: 'http://saas.1000my.com:8014/words', method: 'post', data }) |
||||
|
|||||
@ -1,8 +1,10 @@ |
|||||
import { request } from '@/http/http' |
import { request } from '@/http/http' |
||||
import type { GroupList, BrandRes } from './types' |
import type { GroupList, BrandRes } from './types' |
||||
|
import { PREFIX } from '@/enums' |
||||
|
|
||||
export const getBrandInfo = () => request<BrandRes>({ url: `/JSON/getBrandShopList.json` }) |
|
||||
|
export const getBrandInfo = () => request<BrandRes>({ url: `${PREFIX.STATIC_URL}/JSON/getBrandShopList.json` }) |
||||
|
|
||||
export const getShopListByFloor = () => request<{ list: GroupList }>({ url: `/JSON/getBrandShopListByFloor.json` }) |
|
||||
|
export const getShopListByFloor = () => request<{ list: GroupList }>({ url: `${PREFIX.STATIC_URL}/JSON/getBrandShopListByFloor.json` }) |
||||
|
|
||||
export const getShopListByIndustry = () => request<{ list: GroupList }>({ url: `/JSON/getBrandShopListByIndustryId.json` }) |
|
||||
|
export const getShopListByIndustry = () => |
||||
|
request<{ list: GroupList }>({ url: `${PREFIX.STATIC_URL}/JSON/getBrandShopListByIndustryId.json` }) |
||||
|
|||||
@ -1,4 +1,5 @@ |
|||||
import { request } from '../../http' |
import { request } from '../../http' |
||||
|
import { PREFIX } from '@/enums' |
||||
|
|
||||
//获取当前所处楼层
|
//获取当前所处楼层
|
||||
export const getDeviceInfo = () => request<Device>({ url: `/JSON/getDevCoordinateByIP.json` }) |
|
||||
|
export const getDeviceInfo = () => request<Device>({ url: `${PREFIX.STATIC_URL}/JSON/getDevCoordinateByIP.json` }) |
||||
|
|||||
@ -1,3 +1,5 @@ |
|||||
import { request } from '../../http' |
import { request } from '../../http' |
||||
|
import { getPrefixUrl } from '../../http' |
||||
//找车
|
//找车
|
||||
export const getFindCar = (license: string) => request<CarInfo>({ url: `/ThirdPark/GetPlaceInfo?carCode=${license}` }) |
|
||||
|
export const getFindCar = (license: string) => |
||||
|
request<CarInfo>({ url: `${getPrefixUrl().interfaceUrl}/ThirdPark/GetPlaceInfo?carCode=${license}` }) |
||||
|
|||||
@ -1,5 +1,6 @@ |
|||||
//获取店铺及楼栋列表
|
|
||||
import { request } from '@/http/http' |
import { request } from '@/http/http' |
||||
import type { ShopListAndBuildingList } from './types' |
import type { ShopListAndBuildingList } from './types' |
||||
|
import { PREFIX } from '@/enums' |
||||
|
|
||||
export const getShopAndBuildingList = () => request<ShopListAndBuildingList>({ url: `/JSON/getMapInfo.json` }) |
|
||||
|
//获取店铺及楼栋列表
|
||||
|
export const getShopAndBuildingList = () => request<ShopListAndBuildingList>({ url: `${PREFIX.STATIC_URL}/JSON/getMapInfo.json` }) |
||||
|
|||||
@ -1,4 +1,7 @@ |
|||||
import { request } from '../../http' |
import { request } from '../../http' |
||||
import type { Query } from './types' |
import type { Query } from './types' |
||||
|
import { getPrefixUrl } from '../../http' |
||||
|
|
||||
//数据统计
|
//数据统计
|
||||
export const getStatistics = (data: Query) => request({ url: `/analysis/v1/web/deviceUseClickDataUpload`, data, method: 'post' }) |
|
||||
|
export const getStatistics = (data: Query) => |
||||
|
request({ url: `${getPrefixUrl().interfaceUrl}/analysis/v1/web/deviceUseClickDataUpload`, data, method: 'post' }) |
||||
|
|||||
Loading…
Reference in new issue