From 7abf0c380854c2520ce8258fb029abd57c1e34d9 Mon Sep 17 00:00:00 2001 From: liyongle Date: Sat, 6 May 2023 09:26:13 +0800 Subject: [PATCH 1/9] =?UTF-8?q?feat:=20=F0=9F=9A=80=20=E6=A8=A1=E5=9D=97?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Menu/Menu.vue | 2 ++ src/components/Search/Hot.vue | 2 +- src/components/Search/Result.vue | 2 +- src/composables/useStatistics.ts | 37 ++++++++++++++++++++++++++++---- src/http/api/statistics/index.ts | 5 ++++- src/http/api/statistics/types.ts | 9 ++++++++ src/views/Index/Middle.vue | 18 +++++++++------- 7 files changed, 60 insertions(+), 15 deletions(-) diff --git a/src/components/Menu/Menu.vue b/src/components/Menu/Menu.vue index 442b40b..48f7639 100644 --- a/src/components/Menu/Menu.vue +++ b/src/components/Menu/Menu.vue @@ -13,6 +13,7 @@ From e12bc78fe423afc7cd1025fa57236c9c11a355a9 Mon Sep 17 00:00:00 2001 From: liyongle Date: Sat, 6 May 2023 10:26:02 +0800 Subject: [PATCH 2/9] =?UTF-8?q?feat:=20=F0=9F=9A=80=20=E7=BB=9F=E8=AE=A1?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Search/Hot.vue | 2 ++ src/components/Search/Result.vue | 2 ++ src/components/ShopDetail/ShopDetail.vue | 2 +- src/composables/useFacilityNav.ts | 4 ++-- src/composables/useHandleScreen.ts | 3 ++- src/views/Brand/Brand.vue | 3 ++- src/views/Nav/Nav.vue | 3 --- 7 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/components/Search/Hot.vue b/src/components/Search/Hot.vue index 4e6ecfc..72a03b6 100644 --- a/src/components/Search/Hot.vue +++ b/src/components/Search/Hot.vue @@ -24,6 +24,7 @@ import { ref } from 'vue' import { getIndexJson } from '@/http/api/base' import { useRootStore } from '@/store/root' +import { useStatistics } from '@/composables/useStatistics' import ScrollView from '@/base/ScrollView/ScrollView.vue' const list = ref() getIndexJson().then(({ data }) => { @@ -34,6 +35,7 @@ const store = useRootStore() function show(item: any) { store.SET_SHOP(item) store.SET_SHOW_DETAIL(true) + useStatistics({ tag: 'brandSearch', shopCode: item.shopCode }) } diff --git a/src/components/Search/Result.vue b/src/components/Search/Result.vue index 2256946..a4df32c 100644 --- a/src/components/Search/Result.vue +++ b/src/components/Search/Result.vue @@ -22,6 +22,7 @@ diff --git a/src/components/ShopDetail/ShopDetail.vue b/src/components/ShopDetail/ShopDetail.vue index 1359514..188a430 100644 --- a/src/components/ShopDetail/ShopDetail.vue +++ b/src/components/ShopDetail/ShopDetail.vue @@ -97,7 +97,6 @@ import 'swiper/css/effect-fade' import scrollView from '@/base/ScrollView/ScrollView.vue' import masker from '@/base/Masker/Masker.vue' import marquees from '@/base/Marquees/Marquees.vue' - import { ref } from 'vue' import { useRouter } from 'vue-router' import { useStatistics } from '@/composables/useStatistics' @@ -117,6 +116,7 @@ function close() { } //导航 function handleGo() { + useStatistics({ tag: 'navigation', shopCode: shop.value.shopCode }) store.SET_SHOW_DETAIL(false) store.SET_SHOW_SEARCH(false) router.push('/nav') diff --git a/src/composables/useFacilityNav.ts b/src/composables/useFacilityNav.ts index f068460..9be3858 100644 --- a/src/composables/useFacilityNav.ts +++ b/src/composables/useFacilityNav.ts @@ -6,11 +6,11 @@ export const useFacilityNav = () => { const store = useRootStore() const router = useRouter() - function handleFacility({ abbreviation, customFacilityName, filePath, code }: Facility) { + function handleFacility({ abbreviation, customFacilityName, filePath, code, name }: Facility) { const { floor, node } = window.Map_QM.pathIcon({ type: abbreviation }) const floorName = store.currentBuildingFloorsList.find(_floor => _floor.floorOrder === floor)?.floor const shop = new Brand({ - shopName: customFacilityName, + shopName: customFacilityName ? customFacilityName : name, floorOrder: floor, floor: floorName as string, logoUrl: filePath, diff --git a/src/composables/useHandleScreen.ts b/src/composables/useHandleScreen.ts index 5195b1e..16a9ab3 100644 --- a/src/composables/useHandleScreen.ts +++ b/src/composables/useHandleScreen.ts @@ -3,7 +3,7 @@ import { useRouter } from 'vue-router' import { getBackTime } from '@/http/api/base' import { useLogout } from '@/composables/useLogout' import { isAndroid } from '@/utils/utils' - +import { useStatistics } from '@/composables/useStatistics' export const useHandleScreen = (callback: () => void) => { const MIN_TIME = 0 const MAX_TIME = 5 @@ -54,6 +54,7 @@ export const useHandleScreen = (callback: () => void) => { } async function checkHandleScreen(e: TouchEvent) { + useStatistics({ tag: 'device' }) !_isAndroid && addTotalClick(e) toIndexTime.value = totalTime.value[0] toWallpaperTime.value = totalTime.value[1] diff --git a/src/views/Brand/Brand.vue b/src/views/Brand/Brand.vue index ed24c9b..1fce53c 100644 --- a/src/views/Brand/Brand.vue +++ b/src/views/Brand/Brand.vue @@ -48,7 +48,7 @@ import { ref, computed, shallowRef } from 'vue' import { storeToRefs } from 'pinia' import { useRootStore } from '@/store/root' - +import { useStatistics } from '@/composables/useStatistics' const store = useRootStore() const { shopList, device } = storeToRefs(store) @@ -164,6 +164,7 @@ function handleClickFormat(item: Industry, index: number) { } if (currentTypeId.value === 0) { copyShopList.value = shopList.value.filter(shop => shop.industryFatherCode === item.industryCode) + useStatistics({ tag: 'industry', industryCode: item.industryCode }) } else { copyShopList.value = shopList.value.filter(shop => shop.initials?.charAt(0) === item.industryName) } diff --git a/src/views/Nav/Nav.vue b/src/views/Nav/Nav.vue index 560cf57..930e0f6 100644 --- a/src/views/Nav/Nav.vue +++ b/src/views/Nav/Nav.vue @@ -162,7 +162,6 @@ import { useMapNavControl } from '@/composables/useMapNavControl' import { useChangeNavMethod } from '@/composables/useChangeNavMethod' import { useStartNavi } from '@/composables/useStartNavi' import { useSetCameraViews } from '@/composables/useSetCameraViews' -import { useStatistics } from '@/composables/useStatistics' import { hideMapDialog } from '@/composables/useInitMap' import { i18n } from '@/i18n' import { useRouter, useRoute } from 'vue-router' @@ -174,8 +173,6 @@ import ScrollView from '@/base/ScrollView/ScrollView.vue' const store = useRootStore() const { shop, device, language, config } = storeToRefs(store) -useStatistics({ tag: 'navigation', shopCode: shop.value.shopCode }) - const { replay, pause, speedUp, handleReplay, togglePause, handleSpeedUp, resetPause } = useMapNavControl() const { directionInfo, pathShopList, backPathArray, startNavi } = useStartNavi(shop, device, resetPause) const { methodIdx, methodsList, handleControl } = useChangeNavMethod(backPathArray) From 6626fab9044ecd418595765a272bdd56724dcbf7 Mon Sep 17 00:00:00 2001 From: liyongle Date: Sat, 6 May 2023 15:50:40 +0800 Subject: [PATCH 3/9] =?UTF-8?q?feat:=20=F0=9F=9A=80=20=E5=81=9C=E8=BD=A6?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/CarInfo/CarInfo.vue | 35 +++++++++--- src/components/PlateInput/PlateInput.vue | 17 +++++- src/composables/useFindCar.ts | 72 +++++++++++++++++------- src/composables/useParkingKeyboard.ts | 2 +- src/types/car.d.ts | 4 +- src/types/map.d.ts | 2 +- src/views/Parking/Parking.vue | 4 +- 7 files changed, 102 insertions(+), 34 deletions(-) diff --git a/src/components/CarInfo/CarInfo.vue b/src/components/CarInfo/CarInfo.vue index 177d69c..5f9f98e 100644 --- a/src/components/CarInfo/CarInfo.vue +++ b/src/components/CarInfo/CarInfo.vue @@ -2,19 +2,19 @@
- +
车牌号 - 辽A88888 + {{ carInfo.carCode }}
车位号 - E-666 + {{ carInfo.spaceNo }}
停车时长 - 1小时 + {{ carInfo.parkingTime }}
@@ -39,19 +39,40 @@ diff --git a/src/components/PlateInput/PlateInput.vue b/src/components/PlateInput/PlateInput.vue index 6d1e61f..13af4b6 100644 --- a/src/components/PlateInput/PlateInput.vue +++ b/src/components/PlateInput/PlateInput.vue @@ -17,7 +17,15 @@
-
+
查找车辆
@@ -51,7 +59,12 @@ function handleEnergy() { }) } function confirm() { - emits('confirm') + if ( + (props.searchMethod === '车牌' && ((isEnergy.value && props.list.length === 8) || (!isEnergy.value && props.list.length === 7))) || + (props.searchMethod === '车位' && props.list.length === 6) + ) { + emits('confirm') + } } onMounted(() => { diff --git a/src/composables/useFindCar.ts b/src/composables/useFindCar.ts index ee2a64a..db6ac1e 100644 --- a/src/composables/useFindCar.ts +++ b/src/composables/useFindCar.ts @@ -2,35 +2,69 @@ import { ref } from 'vue' import { getFindCar } from '@/http/api/parking' import { HTTP_CODE } from '@/enums' import { isLicensePlate } from '@/utils/utils' +import { useRootStore } from '@/store/root' +import { useRouter } from 'vue-router' import Message from '@/base/Message/Message' export const useFindCar = () => { const showCarDetail = ref(false) const loading = ref(false) const result = ref() - async function confirm(plate: string) { - if (!isLicensePlate(plate)) { - Message({ text: '车牌错误,请重新输入', type: 'success' }) - return - } - if (loading.value) { - return - } - try { - loading.value = true - const { code, msg, data } = await getFindCar(plate) - if (code === HTTP_CODE.ERR_OK) { - result.value = data - showCarDetail.value = true + const store = useRootStore() + const router = useRouter() + async function confirm(plate: string, type: number) { + if (!type) { + if (!isLicensePlate(plate)) { + Message({ text: '车牌错误,请重新输入', type: 'success' }) + return + } + if (loading.value) { + return + } + try { + loading.value = true + const { code, msg, data } = await getFindCar(plate) + if (code === HTTP_CODE.ERR_OK) { + result.value = { ...data, carCode: plate, parkingTime: toHoursAndMinutes(Number(data.parkingTime)) } + showCarDetail.value = true + } else { + Message({ text: msg, type: 'success' }) + } + } catch (error) { + Message({ text: error as string, type: 'success' }) + } finally { + loading.value = false + } + } else { + if (!plate.length) { + Message({ type: 'success', text: '请输入正确的车位号' }) + return + } + const info = window.Map_QM.pathPark({ shopNum: plate }) + + if (info?.node?.length) { + const floor: any = store.buildingList[0].floorList.find(item => item.floorOrder === info.floor)?.floor + const shop = { + shopCode: '', + shopName: plate, + floorOrder: info.floor, + floor, + logoUrl: '/static/img/tcjf.png', + yaxis: info.node + } + store.SET_SHOP(shop) + router.push('/nav') } else { - Message({ text: msg, type: 'success' }) + Message({ text: `暂未查到相关信息`, type: 'success' }) } - } catch (error) { - Message({ text: error as string, type: 'success' }) - } finally { - loading.value = false } } + // 格式化停车时间 + function toHoursAndMinutes(totalMinutes: number) { + const hours = Math.floor(totalMinutes / 60) + const minutes = totalMinutes % 60 + return `${hours > 0 ? `${hours}小时` : ''}${minutes > 0 ? ` ${minutes}分钟` : ''}` + } return { loading, result, showCarDetail, confirm } } diff --git a/src/composables/useParkingKeyboard.ts b/src/composables/useParkingKeyboard.ts index f583be8..da19900 100644 --- a/src/composables/useParkingKeyboard.ts +++ b/src/composables/useParkingKeyboard.ts @@ -7,7 +7,7 @@ export const useParkingKeyboard = () => { const NOT_ENERGY_PLATE = 7 //非能源车牌长度 const ENERGY_PLATE = 8 //能源车牌长度 const SPACE_MAX_LENGTH = 4 //车位最大允许长度 - const LICENSE = ['苏', 'A'] //默认车牌前缀 + const LICENSE = ['辽', 'A'] //默认车牌前缀 const plate = ref(LICENSE.slice()) const plateToString = computed(() => plate.value.join('')) diff --git a/src/types/car.d.ts b/src/types/car.d.ts index d975ce4..66e80e7 100644 --- a/src/types/car.d.ts +++ b/src/types/car.d.ts @@ -6,6 +6,6 @@ declare interface CarInfo { cost: number //费用 enterTime: string //入场时间 floor: string //楼层 - parkingTime: number // 停车时长 - placeCode: string //车位号 + parkingTime: string // 停车时长 + spaceNo: string //车位号 } diff --git a/src/types/map.d.ts b/src/types/map.d.ts index ab9a326..25fde41 100644 --- a/src/types/map.d.ts +++ b/src/types/map.d.ts @@ -288,7 +288,7 @@ export declare global { */ pathPark(obj: { shopNum: string }): { shopNum: string - node: string | number + node: string floor: number xaxis: number | string yaxis: number | string diff --git a/src/views/Parking/Parking.vue b/src/views/Parking/Parking.vue index 3640b4e..cc6d69c 100644 --- a/src/views/Parking/Parking.vue +++ b/src/views/Parking/Parking.vue @@ -31,7 +31,7 @@
- + diff --git a/src/views/Parking/Parking.vue b/src/views/Parking/Parking.vue index cc6d69c..b1ae682 100644 --- a/src/views/Parking/Parking.vue +++ b/src/views/Parking/Parking.vue @@ -24,7 +24,7 @@

{{ switchLanguage(parkingInfo, 'title') }}

- +
{{ switchLanguage(parkingInfo, 'content') }}
From 4ef2dee4b3727e192984e37c58c512a7eefab035 Mon Sep 17 00:00:00 2001 From: liyongle Date: Mon, 8 May 2023 14:54:01 +0800 Subject: [PATCH 8/9] =?UTF-8?q?feat:=20=F0=9F=9A=80=20=E4=BC=9A=E5=91=98?= =?UTF-8?q?=E3=80=81=E6=B4=BB=E5=8A=A8=E3=80=81=E5=AD=A6=E9=99=A2=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/static/offline/JSON/getArtList.json | 138 ++++++++++++++++++++ src/components/Carousel/Carousel.vue | 5 +- src/composables/useActivityNav.ts | 27 ---- src/composables/useInitConfigAndMallInfo.ts | 35 +++-- src/enums/index.ts | 12 ++ src/http/api/activity/index.ts | 10 -- src/http/api/base/index.ts | 4 + src/http/api/member/index.ts | 3 - src/store/root/actions.ts | 5 + src/store/root/state.ts | 5 +- src/types/activity.d.ts | 8 ++ src/views/Activity/Activity.vue | 16 ++- src/views/Member/Member.vue | 47 +++++-- src/views/School/School.vue | 16 ++- 14 files changed, 254 insertions(+), 77 deletions(-) create mode 100644 public/static/offline/JSON/getArtList.json delete mode 100644 src/composables/useActivityNav.ts delete mode 100644 src/http/api/activity/index.ts delete mode 100644 src/http/api/member/index.ts diff --git a/public/static/offline/JSON/getArtList.json b/public/static/offline/JSON/getArtList.json new file mode 100644 index 0000000..1344af9 --- /dev/null +++ b/public/static/offline/JSON/getArtList.json @@ -0,0 +1,138 @@ +{ + "code": 200, + "msg": "操作成功", + "data": [ + { + "fileCode": "U7L-31evFSZcHT-Cx_afU", + "fileUrl": "/iotFile/project-bffju2pfalsylhcfcuzgaa/20230505/U7L-31evFSZcHT-Cx_afU.jpg", + "flag": 2, + "artType": 2 + }, + { + "fileCode": "8eaU9Xr1gng_VA_J93wY4", + "fileUrl": "/iotFile/project-bffju2pfalsylhcfcuzgaa/20230505/8eaU9Xr1gng_VA_J93wY4.jpg", + "flag": 2, + "artType": 2 + }, + { + "fileCode": "waeW0L9rBMK2cgKfYq9p6", + "fileUrl": "/iotFile/project-bffju2pfalsylhcfcuzgaa/20230505/waeW0L9rBMK2cgKfYq9p6.jpg", + "flag": 2, + "artType": 2 + }, + { + "fileCode": "XWzK3bNnd4G7ZqvP3jKVC", + "fileUrl": "/iotFile/project-bffju2pfalsylhcfcuzgaa/20230505/XWzK3bNnd4G7ZqvP3jKVC.png", + "flag": 1, + "artType": 2 + }, + { + "fileCode": "wmDoGzz91VdkWXk21w3vc", + "fileUrl": "/iotFile/project-bffju2pfalsylhcfcuzgaa/20230505/wmDoGzz91VdkWXk21w3vc.png", + "flag": 1, + "artType": 2 + }, + { + "fileCode": "Tbbv6-r31zJ-nb_IwuCni", + "fileUrl": "/iotFile/project-bffju2pfalsylhcfcuzgaa/20230505/Tbbv6-r31zJ-nb_IwuCni.png", + "flag": 2, + "artType": 4 + }, + { + "fileCode": "rKqs6tfSx-YE9mVRs6jRH", + "fileUrl": "/iotFile/project-bffju2pfalsylhcfcuzgaa/20230505/rKqs6tfSx-YE9mVRs6jRH.png", + "flag": 1, + "artType": 4 + }, + { + "fileCode": "WeRFpcfjtc6se7VVlulv9", + "fileUrl": "/iotFile/project-bffju2pfalsylhcfcuzgaa/20230505/WeRFpcfjtc6se7VVlulv9.png", + "flag": 1, + "artType": 4 + }, + { + "fileCode": "9BB20uH7LsAUCs9G5bLn1", + "fileUrl": "/iotFile/project-bffju2pfalsylhcfcuzgaa/20230505/9BB20uH7LsAUCs9G5bLn1.jpeg", + "flag": 1, + "artType": 1 + }, + { + "fileCode": "xyU-DUq-t_RrrDIuzsVaA", + "fileUrl": "/iotFile/project-bffju2pfalsylhcfcuzgaa/20230505/xyU-DUq-t_RrrDIuzsVaA.png", + "flag": 2, + "artType": 1 + }, + { + "fileCode": "sp9psNqTdHdvB_Hrjkoi_", + "fileUrl": "/iotFile/project-bffju2pfalsylhcfcuzgaa/20230505/sp9psNqTdHdvB_Hrjkoi_.png", + "flag": 1, + "artType": 1 + }, + { + "fileCode": "PDUU-eWClnBaf75GvkLtl", + "fileUrl": "/iotFile/project-bffju2pfalsylhcfcuzgaa/20230505/PDUU-eWClnBaf75GvkLtl.png", + "flag": 1, + "artType": 3 + }, + { + "fileCode": "Gb1NiXqSAxQkdd2izaPJO", + "fileUrl": "/iotFile/project-bffju2pfalsylhcfcuzgaa/20230506/Gb1NiXqSAxQkdd2izaPJO.png", + "flag": 2, + "artType": 1 + }, + { + "fileCode": "Fmk6kcf07YcAJp7sw2ZQb", + "fileUrl": "/iotFile/project-bffju2pfalsylhcfcuzgaa/20230506/Fmk6kcf07YcAJp7sw2ZQb.png", + "flag": 2, + "artType": 1 + }, + { + "fileCode": "4oeWRq44Yib1ZLJv--7XX", + "fileUrl": "/iotFile/project-bffju2pfalsylhcfcuzgaa/20230506/4oeWRq44Yib1ZLJv--7XX.png", + "flag": 2, + "artType": 1 + }, + { + "fileCode": "WO3JKVPWJ_y82uNR-p2nA", + "fileUrl": "/iotFile/project-bffju2pfalsylhcfcuzgaa/20230506/WO3JKVPWJ_y82uNR-p2nA.png", + "flag": 2, + "artType": 1 + }, + { + "fileCode": "MRSnm9ILLTcU5R_ILNipY", + "fileUrl": "/iotFile/project-bffju2pfalsylhcfcuzgaa/20230506/MRSnm9ILLTcU5R_ILNipY.png", + "flag": 2, + "artType": 1 + }, + { + "fileCode": "KtAw80_3z8nCffxts0eGB", + "fileUrl": "/iotFile/project-bffju2pfalsylhcfcuzgaa/20230506/KtAw80_3z8nCffxts0eGB.png", + "flag": 2, + "artType": 1 + }, + { + "fileCode": "Z-KsfCiytrn3_5cj__5KY", + "fileUrl": "/iotFile/project-bffju2pfalsylhcfcuzgaa/20230506/Z-KsfCiytrn3_5cj__5KY.png", + "flag": 2, + "artType": 1 + }, + { + "fileCode": "Hve3AxoPDuLx42ObwtW76", + "fileUrl": "/iotFile/project-bffju2pfalsylhcfcuzgaa/20230506/Hve3AxoPDuLx42ObwtW76.png", + "flag": 2, + "artType": 2 + }, + { + "fileCode": "u-LrcbOriATjX4QeX2FJq", + "fileUrl": "/iotFile/project-bffju2pfalsylhcfcuzgaa/20230506/u-LrcbOriATjX4QeX2FJq.png", + "flag": 1, + "artType": 2 + }, + { + "fileCode": "PMUBs8-cvNM9FqzO1Ozyx", + "fileUrl": "/iotFile/project-bffju2pfalsylhcfcuzgaa/20230506/PMUBs8-cvNM9FqzO1Ozyx.png", + "flag": 1, + "artType": 2 + } + ] +} diff --git a/src/components/Carousel/Carousel.vue b/src/components/Carousel/Carousel.vue index f519c40..27dfa64 100644 --- a/src/components/Carousel/Carousel.vue +++ b/src/components/Carousel/Carousel.vue @@ -12,7 +12,7 @@ :dynamic-bullets="true" class="myswiper" > - + @@ -25,8 +25,9 @@ import { Swiper, SwiperSlide } from 'swiper/vue' import { Autoplay, Pagination } from 'swiper' import 'swiper/css' import 'swiper/css/pagination' +import type { Picture } from '@/types/activity' type AcType = { - acList: any + acList: Picture[] } defineProps() const modules = ref([Autoplay, Pagination]) diff --git a/src/composables/useActivityNav.ts b/src/composables/useActivityNav.ts deleted file mode 100644 index 2912b15..0000000 --- a/src/composables/useActivityNav.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { useRouter } from 'vue-router' -import { storeToRefs } from 'pinia' -import { useRootStore } from '@/store/root' -import Brand from '@/utils/Class/Brand' - -export const useActivityNav = () => { - const router = useRouter() - const store = useRootStore() - const { shopList } = storeToRefs(store) - - function nav(activity: Activity) { - let shop - if (activity.shopCode.length) { - shop = shopList.value.find(item => item.shopCode === activity?.shopCode) - } else if (activity.point > -1) { - const { activityName, floorOrder, floor, point, fileUrl, activityId } = activity - shop = new Brand({ shopName: activityName, floorOrder, floor, logoUrl: fileUrl, yaxis: point, shopCode: activityId }) - } - if (!shop) { - return - } - store.SET_SHOP(shop) - router.push('/nav') - } - - return { nav } -} diff --git a/src/composables/useInitConfigAndMallInfo.ts b/src/composables/useInitConfigAndMallInfo.ts index 112d8fe..4baa7c9 100644 --- a/src/composables/useInitConfigAndMallInfo.ts +++ b/src/composables/useInitConfigAndMallInfo.ts @@ -1,5 +1,5 @@ import { useRootStore } from '@/store/root' -import { getConfig, getFacilitiesList, getWeather } from '@/http/api/base' +import { getConfig, getFacilitiesList, getWeather, getArtList } from '@/http/api/base' import { getShopAndBuildingList } from '@/http/api/shop' import { getDeviceInfo } from '@/http/api/building' import { getShopListByFloor, getShopListByIndustry, getBrandInfo } from '@/http/api/brand' @@ -12,17 +12,27 @@ export const useInitConfigAndMallInfo = async () => { const store = useRootStore() store.SET_CONFIG(_config.data) - const [_DeviceInfo, _shopAndBuilding, _facilityList, _weather, _shopListByFloor, _shopListByIndustry, _brandInfo, _menuList] = - await Promise.all([ - getDeviceInfo(), - getShopAndBuildingList(), - getFacilitiesList(), - getWeather(), - getShopListByFloor(), - getShopListByIndustry(), - getBrandInfo(), - getModuleList() - ]) + const [ + _DeviceInfo, + _shopAndBuilding, + _facilityList, + _weather, + _shopListByFloor, + _shopListByIndustry, + _brandInfo, + _menuList, + _pictureList + ] = await Promise.all([ + getDeviceInfo(), + getShopAndBuildingList(), + getFacilitiesList(), + getWeather(), + getShopListByFloor(), + getShopListByIndustry(), + getBrandInfo(), + getModuleList(), + getArtList() + ]) const { shopList, buildingList } = _shopAndBuilding.data store.SET_DEVICE(_DeviceInfo.data) @@ -34,6 +44,7 @@ export const useInitConfigAndMallInfo = async () => { store.SET_FACILITY_LIST(_facilityList.data) store.SET_WEATHER(_weather.data) store.SET_MENU_LIST(_menuList.data) + store.SET_PICTURE_LIST(_pictureList.data) } catch (error) { Message({ text: '初始化数据失败', type: 'success' }) } diff --git a/src/enums/index.ts b/src/enums/index.ts index d31218f..f6773e9 100644 --- a/src/enums/index.ts +++ b/src/enums/index.ts @@ -25,3 +25,15 @@ export enum HTTP_CODE { ERR_NULL = 401, //未识别到语音 ERR_DISCERNING = 201 //语音识别中 } + +export enum PictureStatus { + SCHOOL = 1, // 文化学院 + GOLD = 2, // 金卡会员 + BLACK = 3, // 黑卡会员 + ACTIVITY = 4 // 活动 +} + +export enum PictureType { + H = 1, // 横版图片 + V = 2 // 竖版图片 +} diff --git a/src/http/api/activity/index.ts b/src/http/api/activity/index.ts deleted file mode 100644 index e711930..0000000 --- a/src/http/api/activity/index.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { request } from '@/http/http' - -type AcType = { - activityList: Activity[] -} - -//获取商场活动 -export const getMallActivity = () => request({ url: `/JSON/getActivityList1.json` }) -//获取店铺活动 -export const getShopActivity = () => request({ url: `/JSON/getActivityList2.json` }) diff --git a/src/http/api/base/index.ts b/src/http/api/base/index.ts index 12d5b80..a0e4b27 100644 --- a/src/http/api/base/index.ts +++ b/src/http/api/base/index.ts @@ -1,4 +1,5 @@ import { request } from '@/http/http' +import type { Picture } from '@/types/activity' import type { WrittenQuery } from './types' //获取配置项 @@ -21,3 +22,6 @@ export const getHandWriting = (data: WrittenQuery) => request({ url: ' // 获取首页数据 export const getIndexJson = () => request({ url: `/JSON/index.json` }) + +// 获取活动、会员卡等 +export const getArtList = () => request({ url: `/JSON/getArtList.json` }) diff --git a/src/http/api/member/index.ts b/src/http/api/member/index.ts deleted file mode 100644 index b4edd34..0000000 --- a/src/http/api/member/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { request } from '../../http' -// 获取会员信息 -export const getMemberInfo = () => request({ url: `/JSON/getMemberInterests.json` }) diff --git a/src/store/root/actions.ts b/src/store/root/actions.ts index 40dcefa..17faa74 100644 --- a/src/store/root/actions.ts +++ b/src/store/root/actions.ts @@ -3,6 +3,7 @@ import type { State } from './state' import type { Root } from '../key' import type { CreateActions } from '../types' import { BrandRes, GroupList } from '@/http/api/brand/types' +import { Picture } from '@/types/activity' export interface Actions { SET_SHOP_LIST_BY_INDUSTRY(list: GroupList): void @@ -20,6 +21,7 @@ export interface Actions { SET_SHOW_DETAIL(flag: boolean): void SET_SHOW_SEARCH(flag: boolean): void SET_MENU_LIST(list: MenuType[]): void + SET_PICTURE_LIST(list: Picture[]): void } export type GenActions = CreateActions @@ -72,5 +74,8 @@ export const actions: GenActions = { }, SET_MENU_LIST(list) { this.menuList = list + }, + SET_PICTURE_LIST(list) { + this.pictureList = list } } diff --git a/src/store/root/state.ts b/src/store/root/state.ts index 3b99096..4fa4875 100644 --- a/src/store/root/state.ts +++ b/src/store/root/state.ts @@ -1,4 +1,5 @@ import type { GroupList, BrandRes } from '@/http/api/brand/types' +import { Picture } from '@/types/activity' export interface State { shopList: Readonly //店铺列表 @@ -16,6 +17,7 @@ export interface State { device: Device //当前设备信息 shop: Shop //店铺信息 menuList: MenuType[] // 菜单信息 + pictureList: Picture[] // 图片列表 } export const state = (): State => ({ @@ -33,5 +35,6 @@ export const state = (): State => ({ mapStatus: false, device: {} as Device, shop: {} as Shop, - menuList: [] + menuList: [], + pictureList: [] }) diff --git a/src/types/activity.d.ts b/src/types/activity.d.ts index 5c67634..497282d 100644 --- a/src/types/activity.d.ts +++ b/src/types/activity.d.ts @@ -1,3 +1,4 @@ +import { PictureStatus, PictureType } from '@/enums' declare interface Activity { activityAddress: string //活动地址 activityAddressEn: string //活动地址英文 @@ -20,3 +21,10 @@ declare interface Activity { point: number // 导航点 shopCode: string //关联店铺code } + +declare interface Picture { + fileCode: string // 图片编码 + fileUrl: string // 图片地址 + flag: PictureType // 图片横竖 + artType: PictureStatus // 图片类型 +} diff --git a/src/views/Activity/Activity.vue b/src/views/Activity/Activity.vue index b6ae4d0..2792136 100644 --- a/src/views/Activity/Activity.vue +++ b/src/views/Activity/Activity.vue @@ -8,12 +8,18 @@ diff --git a/src/views/Member/Member.vue b/src/views/Member/Member.vue index 4f9517c..ee85281 100644 --- a/src/views/Member/Member.vue +++ b/src/views/Member/Member.vue @@ -1,15 +1,20 @@