Browse Source

feat: 🚀 新增切片插件

pull/1/head
jiangx 3 years ago
parent
commit
c4c535a0e8
  1. 11
      package-lock.json
  2. 1
      package.json
  3. 4
      public/static/offline/JSON/getBackTime.json
  4. 2
      public/static/offline/JSON/getBrandShopListByFloor.json
  5. 4
      src/assets/images/guide/brand.svg
  6. 4
      src/assets/images/guide/brand_active.svg
  7. 4
      src/assets/images/guide/direction.svg
  8. 4
      src/assets/images/guide/direction_active.svg
  9. 4
      src/assets/images/guide/reset.svg
  10. 4
      src/assets/images/guide/reset_active.svg
  11. 3
      src/base/Message/Message.vue
  12. 16
      src/base/ScrollView/ScrollView.vue
  13. 12
      src/components/Map/Map.vue
  14. 4
      src/components/PlateInput/PlateInput.vue
  15. 17
      src/components/PublicComponent/PublicComponent.vue
  16. 11
      src/composables/useHandleScreen.ts
  17. 10
      src/composables/useLogout.ts
  18. 21
      src/composables/useStatistics.ts
  19. 4
      src/http/api/brand/index.ts
  20. 10
      src/http/api/statistics/types.ts
  21. 12
      src/http/http.ts
  22. 4
      src/store/root/actions.ts
  23. 2
      src/store/root/state.ts
  24. 1
      src/types/current.d.ts
  25. 10
      src/types/task-slice.d.ts
  26. 9
      src/views/Guide/Guide.vue
  27. 8
      src/views/Guide/list.ts

11
package-lock.json

@ -19,6 +19,7 @@
"pinia": "^2.0.30", "pinia": "^2.0.30",
"qrcode": "^1.5.1", "qrcode": "^1.5.1",
"swiper": "^9.0.5", "swiper": "^9.0.5",
"task-slice": "^1.0.2",
"vue": "^3.2.13", "vue": "^3.2.13",
"vue-i18n": "^9.2.2", "vue-i18n": "^9.2.2",
"vue-router": "^4.0.3", "vue-router": "^4.0.3",
@ -17015,6 +17016,11 @@
"node": ">=6" "node": ">=6"
} }
}, },
"node_modules/task-slice": {
"version": "1.0.2",
"resolved": "https://registry.npmmirror.com/task-slice/-/task-slice-1.0.2.tgz",
"integrity": "sha512-dWffmwizI+bQ0oruU+HtHCjcdSb9ohJ81CFK+p55aRywPZXzOQuSkMxQ3jKJKFoiPY3XxV/L8cMuzdldMp/I3A=="
},
"node_modules/term-size": { "node_modules/term-size": {
"version": "2.2.1", "version": "2.2.1",
"resolved": "https://registry.npmjs.org/term-size/-/term-size-2.2.1.tgz", "resolved": "https://registry.npmjs.org/term-size/-/term-size-2.2.1.tgz",
@ -31956,6 +31962,11 @@
"integrity": "sha512-4WK/bYZmj8xLr+HUCODHGF1ZFzsYffasLUgEiMBY4fgtltdO6B4WJtlSbPaDTLpYTcGVwM2qLnFTICEcNxs3kA==", "integrity": "sha512-4WK/bYZmj8xLr+HUCODHGF1ZFzsYffasLUgEiMBY4fgtltdO6B4WJtlSbPaDTLpYTcGVwM2qLnFTICEcNxs3kA==",
"dev": true "dev": true
}, },
"task-slice": {
"version": "1.0.2",
"resolved": "https://registry.npmmirror.com/task-slice/-/task-slice-1.0.2.tgz",
"integrity": "sha512-dWffmwizI+bQ0oruU+HtHCjcdSb9ohJ81CFK+p55aRywPZXzOQuSkMxQ3jKJKFoiPY3XxV/L8cMuzdldMp/I3A=="
},
"term-size": { "term-size": {
"version": "2.2.1", "version": "2.2.1",
"resolved": "https://registry.npmjs.org/term-size/-/term-size-2.2.1.tgz", "resolved": "https://registry.npmjs.org/term-size/-/term-size-2.2.1.tgz",

1
package.json

@ -28,6 +28,7 @@
"pinia": "^2.0.30", "pinia": "^2.0.30",
"qrcode": "^1.5.1", "qrcode": "^1.5.1",
"swiper": "^9.0.5", "swiper": "^9.0.5",
"task-slice": "^1.0.2",
"vue": "^3.2.13", "vue": "^3.2.13",
"vue-i18n": "^9.2.2", "vue-i18n": "^9.2.2",
"vue-router": "^4.0.3", "vue-router": "^4.0.3",

4
public/static/offline/JSON/getBackTime.json

@ -2,7 +2,7 @@
"code": 200, "code": 200,
"msg": "操作成功", "msg": "操作成功",
"data": [ "data": [
15,
20
150000000000000,
150000000000000
] ]
} }

2
public/static/offline/JSON/getBrandShopListByFloor.json

File diff suppressed because one or more lines are too long

4
src/assets/images/guide/brand.svg

@ -0,0 +1,4 @@
<svg width="44" height="44" viewBox="0 0 44 44" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect width="44" height="44" rx="12" fill="white"/>
<path d="M14.4839 19.0941L15.62 28.7364H28.3799L29.5159 19.0941L25.9735 21.4511L21.9999 15.8986L18.0264 21.4511L14.4839 19.0941ZM13.8735 16.5678L17.5829 19.0368L21.2809 13.8696C21.3626 13.7553 21.4705 13.6621 21.5955 13.5978C21.7206 13.5335 21.8593 13.5 21.9999 13.5C22.1406 13.5 22.2793 13.5335 22.4044 13.5978C22.5294 13.6621 22.6373 13.7553 22.719 13.8696L26.417 19.0368L30.1273 16.5678C30.2677 16.4746 30.4319 16.4234 30.6005 16.4203C30.7692 16.4173 30.9352 16.4625 31.0789 16.5506C31.2226 16.6387 31.3381 16.766 31.4116 16.9175C31.4851 17.069 31.5137 17.2383 31.4939 17.4055L30.0425 29.7214C30.0171 29.9359 29.9138 30.1336 29.7521 30.2772C29.5904 30.4207 29.3816 30.5 29.1652 30.5H14.8347C14.6183 30.5 14.4094 30.4207 14.2477 30.2772C14.0861 30.1336 13.9827 29.9359 13.9574 29.7214L12.506 17.4047C12.4864 17.2375 12.5151 17.0683 12.5887 16.917C12.6623 16.7656 12.7778 16.6384 12.9215 16.5504C13.0652 16.4625 13.2311 16.4173 13.3996 16.4204C13.5681 16.4235 13.7323 16.4747 13.8726 16.5678H13.8735ZM21.9999 25.2093C21.5314 25.2093 21.082 25.0235 20.7506 24.6928C20.4193 24.362 20.2331 23.9135 20.2331 23.4457C20.2331 22.978 20.4193 22.5294 20.7506 22.1987C21.082 21.868 21.5314 21.6822 21.9999 21.6822C22.4685 21.6822 22.9179 21.868 23.2493 22.1987C23.5806 22.5294 23.7668 22.978 23.7668 23.4457C23.7668 23.9135 23.5806 24.362 23.2493 24.6928C22.9179 25.0235 22.4685 25.2093 21.9999 25.2093Z" fill="#535D75"/>
</svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

4
src/assets/images/guide/brand_active.svg

@ -0,0 +1,4 @@
<svg width="44" height="44" viewBox="0 0 44 44" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect width="44" height="44" rx="12" fill="#F6987F"/>
<path d="M14.4839 19.0941L15.62 28.7364H28.3799L29.5159 19.0941L25.9735 21.4511L21.9999 15.8986L18.0264 21.4511L14.4839 19.0941ZM13.8735 16.5678L17.5829 19.0368L21.2809 13.8696C21.3626 13.7553 21.4705 13.6621 21.5955 13.5978C21.7206 13.5335 21.8593 13.5 21.9999 13.5C22.1406 13.5 22.2793 13.5335 22.4044 13.5978C22.5294 13.6621 22.6373 13.7553 22.719 13.8696L26.417 19.0368L30.1273 16.5678C30.2677 16.4746 30.4319 16.4234 30.6005 16.4203C30.7692 16.4173 30.9352 16.4625 31.0789 16.5506C31.2226 16.6387 31.3381 16.766 31.4116 16.9175C31.4851 17.069 31.5137 17.2383 31.4939 17.4055L30.0425 29.7214C30.0171 29.9359 29.9138 30.1336 29.7521 30.2772C29.5904 30.4207 29.3816 30.5 29.1652 30.5H14.8347C14.6183 30.5 14.4094 30.4207 14.2477 30.2772C14.0861 30.1336 13.9827 29.9359 13.9574 29.7214L12.506 17.4047C12.4864 17.2375 12.5151 17.0683 12.5887 16.917C12.6623 16.7656 12.7778 16.6384 12.9215 16.5504C13.0652 16.4625 13.2311 16.4173 13.3996 16.4204C13.5681 16.4235 13.7323 16.4747 13.8726 16.5678H13.8735ZM21.9999 25.2093C21.5314 25.2093 21.082 25.0235 20.7506 24.6928C20.4193 24.362 20.2331 23.9135 20.2331 23.4457C20.2331 22.978 20.4193 22.5294 20.7506 22.1987C21.082 21.868 21.5314 21.6822 21.9999 21.6822C22.4685 21.6822 22.9179 21.868 23.2493 22.1987C23.5806 22.5294 23.7668 22.978 23.7668 23.4457C23.7668 23.9135 23.5806 24.362 23.2493 24.6928C22.9179 25.0235 22.4685 25.2093 21.9999 25.2093Z" fill="white"/>
</svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

4
src/assets/images/guide/direction.svg

@ -0,0 +1,4 @@
<svg width="44" height="44" viewBox="0 0 44 44" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect width="44" height="44" rx="12" fill="white"/>
<path d="M29.3237 15.0959L25.7777 27.5059L22.7377 21.4259L17.1007 19.1709L29.3237 15.0959ZM31.3897 12.2999L12.5837 18.5679C12.4864 18.6002 12.4013 18.6616 12.3401 18.7438C12.2788 18.8261 12.2443 18.9251 12.2413 19.0276C12.2382 19.1301 12.2667 19.2311 12.323 19.3168C12.3792 19.4026 12.4605 19.4689 12.5557 19.5069L21.2887 22.9999L25.7137 31.8499C25.7587 31.94 25.8299 32.0145 25.918 32.0634C26.006 32.1124 26.1068 32.1336 26.2071 32.1243C26.3074 32.115 26.4026 32.0756 26.4802 32.0113C26.5577 31.947 26.614 31.8608 26.6417 31.7639L32.0287 12.9109C32.0537 12.8233 32.0542 12.7306 32.0303 12.6427C32.0064 12.5548 31.959 12.4752 31.8931 12.4123C31.8272 12.3494 31.7454 12.3057 31.6566 12.2859C31.5677 12.2661 31.4751 12.2709 31.3887 12.2999H31.3897Z" fill="#535D75"/>
</svg>

After

Width:  |  Height:  |  Size: 920 B

4
src/assets/images/guide/direction_active.svg

@ -0,0 +1,4 @@
<svg width="44" height="44" viewBox="0 0 44 44" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect width="44" height="44" rx="12" fill="#F6987F"/>
<path d="M29.0827 16.822L25.5367 29.232L22.4967 23.152L16.8597 20.897L29.0827 16.822ZM31.1487 14.026L12.3427 20.294C12.2454 20.3263 12.1603 20.3877 12.099 20.4699C12.0378 20.5521 12.0033 20.6512 12.0002 20.7537C11.9972 20.8562 12.0257 20.9572 12.0819 21.0429C12.1382 21.1286 12.2195 21.195 12.3147 21.233L21.0477 24.726L25.4727 33.576C25.5177 33.6661 25.5889 33.7405 25.677 33.7895C25.765 33.8385 25.8658 33.8597 25.9661 33.8504C26.0664 33.8411 26.1616 33.8017 26.2391 33.7374C26.3167 33.6731 26.373 33.5869 26.4007 33.49L31.7877 14.637C31.8126 14.5494 31.8132 14.4567 31.7893 14.3688C31.7654 14.2809 31.718 14.2012 31.6521 14.1383C31.5862 14.0755 31.5044 14.0318 31.4155 14.012C31.3266 13.9922 31.234 13.997 31.1477 14.026H31.1487Z" fill="white"/>
</svg>

After

Width:  |  Height:  |  Size: 906 B

4
src/assets/images/guide/reset.svg

@ -0,0 +1,4 @@
<svg width="44" height="44" viewBox="0 0 44 44" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect width="44" height="44" rx="12" fill="white"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M22 10C22.5523 10 23 10.4477 23 11V12.0494C27.7244 12.5184 31.4816 16.2756 31.9506 21L33 21C33.5523 21 34 21.4477 34 22C34 22.5523 33.5523 23 33 23L31.9506 23C31.4816 27.7244 27.7244 31.4816 23 31.9506V33C23 33.5523 22.5523 34 22 34C21.4477 34 21 33.5523 21 33V31.9506C16.2756 31.4816 12.5184 27.7244 12.0494 23H11C10.4477 23 10 22.5523 10 22C10 21.4477 10.4477 21 11 21H12.0494C12.5184 16.2756 16.2756 12.5184 21 12.0494V11C21 10.4477 21.4477 10 22 10ZM22 14C17.5817 14 14 17.5817 14 22C14 26.4183 17.5817 30 22 30C26.4183 30 30 26.4183 30 22C30 17.5817 26.4183 14 22 14ZM22 19C20.3431 19 19 20.3431 19 22C19 23.6569 20.3431 25 22 25C23.6569 25 25 23.6569 25 22C25 20.3431 23.6569 19 22 19ZM17 22C17 19.2386 19.2386 17 22 17C24.7614 17 27 19.2386 27 22C27 24.7614 24.7614 27 22 27C19.2386 27 17 24.7614 17 22Z" fill="#535D75"/>
</svg>

After

Width:  |  Height:  |  Size: 1.0 KiB

4
src/assets/images/guide/reset_active.svg

@ -0,0 +1,4 @@
<svg width="44" height="44" viewBox="0 0 44 44" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect width="44" height="44" rx="12" fill="#F6987F"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M22 10C22.5523 10 23 10.4477 23 11V12.0494C27.7244 12.5184 31.4816 16.2756 31.9506 21L33 21C33.5523 21 34 21.4477 34 22C34 22.5523 33.5523 23 33 23L31.9506 23C31.4816 27.7244 27.7244 31.4816 23 31.9506V33C23 33.5523 22.5523 34 22 34C21.4477 34 21 33.5523 21 33V31.9506C16.2756 31.4816 12.5184 27.7244 12.0494 23H11C10.4477 23 10 22.5523 10 22C10 21.4477 10.4477 21 11 21H12.0494C12.5184 16.2756 16.2756 12.5184 21 12.0494V11C21 10.4477 21.4477 10 22 10ZM22 14C17.5817 14 14 17.5817 14 22C14 26.4183 17.5817 30 22 30C26.4183 30 30 26.4183 30 22C30 17.5817 26.4183 14 22 14ZM22 19C20.3431 19 19 20.3431 19 22C19 23.6569 20.3431 25 22 25C23.6569 25 25 23.6569 25 22C25 20.3431 23.6569 19 22 19ZM17 22C17 19.2386 19.2386 17 22 17C24.7614 17 27 19.2386 27 22C27 24.7614 24.7614 27 22 27C19.2386 27 17 24.7614 17 22Z" fill="white"/>
</svg>

After

Width:  |  Height:  |  Size: 1.0 KiB

3
src/base/Message/Message.vue

@ -38,8 +38,7 @@ const style = {
borderColor: 'transparent' borderColor: 'transparent'
} }
} // } //
const isShowRef = ref(false) //
const isShowRef = ref(false)
onMounted(() => { onMounted(() => {
isShowRef.value = true isShowRef.value = true
}) })

16
src/base/ScrollView/ScrollView.vue

@ -18,14 +18,14 @@ BScroll.use(ObserveImage)
type Props = { type Props = {
list: any[] | string list: any[] | string
scrollbar: boolean
scrollX: boolean
observeImage: boolean
useTransition: boolean
deceleration: number
refreshDelay: number
scrollTop: boolean
stopPropagation: boolean
scrollbar?: boolean
scrollX?: boolean
observeImage?: boolean
useTransition?: boolean
deceleration?: number
refreshDelay?: number
scrollTop?: boolean
stopPropagation?: boolean
} }
const props = withDefaults(defineProps<Props>(), { const props = withDefaults(defineProps<Props>(), {

12
src/components/Map/Map.vue

@ -4,7 +4,7 @@
<div id="mapContainer" /> <div id="mapContainer" />
<!-- 地图弹框 --> <!-- 地图弹框 -->
<div id="shopInfo" class="boxShop boxShop2" :style="{ backgroundImage: `url(${require('@/assets/images/map/map-dialog.png')})` }">
<div id="shopInfo" class="boxShop boxShop2">
<div id="shopNum">{{ switchLanguage(shop, 'shopName') }}</div> <div id="shopNum">{{ switchLanguage(shop, 'shopName') }}</div>
<div class="map-flex"> <div class="map-flex">
<div class="pop-bottom__detail" @click="handleDetail">{{ $t('detail') }}</div> <div class="pop-bottom__detail" @click="handleDetail">{{ $t('detail') }}</div>
@ -13,17 +13,17 @@
</div> </div>
<div id="moveFloorBG"> <div id="moveFloorBG">
<span id="moveFloor"></span> <span id="moveFloor"></span>
<div id="floorBox" style="position: absolute; z-index: 128"></div>
<div id="floorBox"></div>
</div> </div>
</div> </div>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { toRefs } from 'vue'
import { useStore } from '@/store/root' import { useStore } from '@/store/root'
import { storeToRefs } from 'pinia'
const store = useStore() const store = useStore()
const { shop } = toRefs(store)
const { shop } = storeToRefs(store)
const emits = defineEmits(['handle-go', 'handle-Detail']) const emits = defineEmits(['handle-go', 'handle-Detail'])
@ -53,6 +53,7 @@ function handleDetail() {
position: absolute; position: absolute;
width: 254px; width: 254px;
height: 128px; height: 128px;
background-image: url('@/assets/images/map/map-dialog.png');
background-position: center center; background-position: center center;
background-repeat: no-repeat; background-repeat: no-repeat;
background-size: contain; background-size: contain;
@ -115,7 +116,8 @@ function handleDetail() {
} }
/* stylelint-disable-next-line selector-class-pattern */ /* stylelint-disable-next-line selector-class-pattern */
.floorBox { .floorBox {
position: relative;
position: absolute;
z-index: 128;
} }
.other-pop { .other-pop {
position: fixed; position: fixed;

4
src/components/PlateInput/PlateInput.vue

@ -12,7 +12,7 @@
<transition enter-active-class="animate__animated animate__zoomIn" leave-active-class="animate__animated animate__zoomOut"> <transition enter-active-class="animate__animated animate__zoomIn" leave-active-class="animate__animated animate__zoomOut">
<div v-if="!isEnergy && index === PLATE_LENGTH - 1" class="text energy"> <div v-if="!isEnergy && index === PLATE_LENGTH - 1" class="text energy">
<i>+</i> <i>+</i>
<b>新能源</b>
<b>{{ $t('energy') }}</b>
</div> </div>
</transition> </transition>
</div> </div>
@ -29,8 +29,8 @@ import { computed, ref, nextTick, onMounted } from 'vue'
type Props = { type Props = {
searchMethod: '车牌' | '车位' searchMethod: '车牌' | '车位'
spaceLength?: number
list: string[] list: string[]
spaceLength?: number
} }
const props = withDefaults(defineProps<Props>(), { const props = withDefaults(defineProps<Props>(), {
list: () => [], list: () => [],

17
src/components/PublicComponent/PublicComponent.vue

@ -4,7 +4,7 @@
<!-- <Map @handle-go="handleGO" @handle-detail="handleDetail" /> --> <!-- <Map @handle-go="handleGO" @handle-detail="handleDetail" /> -->
<!-- 退出弹框 --> <!-- 退出弹框 -->
<Logout v-model="logoutRef" />
<Logout v-model="logout" />
<!-- 倒计时返回首页提示 --> <!-- 倒计时返回首页提示 -->
<Transition enter-active-class="animate__animated animate__zoomIn" leave-active-class="animate__animated animate__zoomOut"> <Transition enter-active-class="animate__animated animate__zoomIn" leave-active-class="animate__animated animate__zoomOut">
@ -27,21 +27,12 @@ const router = useRouter()
const route = useRoute() const route = useRoute()
const store = useStore() const store = useStore()
const { language } = storeToRefs(store) const { language } = storeToRefs(store)
const {
checkHandleScreen,
showCountDownDialog,
title,
toIndexTime,
toWallpaperTime,
isWallpaper,
setLogoutRef,
resetClickNumber,
logoutRef
} = useHandleScreen(handleScreen)
const { checkHandleScreen, showCountDownDialog, title, toIndexTime, toWallpaperTime, isWallpaper, setLogout, resetClickNumber, logout } =
useHandleScreen(handleScreen)
// //
function handleScreen() { function handleScreen() {
setLogoutRef(false)
setLogout(false)
resetClickNumber() resetClickNumber()
language.value !== 'zh' && store.SET_LANGUAGE('zh') language.value !== 'zh' && store.SET_LANGUAGE('zh')
router.push('/transfer') router.push('/transfer')

11
src/composables/useHandleScreen.ts

@ -12,9 +12,9 @@ export const useHandleScreen = (callback: () => void) => {
const _isAndroid = isAndroid() const _isAndroid = isAndroid()
const router = useRouter() const router = useRouter()
const { logoutRef, resetClickNumber, setLogoutRef, addTotalClick } = useLogout()
const { logout, resetClickNumber, setLogout, addTotalClick } = useLogout()
const totalTime = ref<number[]>([60, 60]) //总时间
const totalTime = ref<[number, number]>([60, 60]) //总时间
const toIndexTime = ref(60) //回首页的时间 const toIndexTime = ref(60) //回首页的时间
const toWallpaperTime = ref(60) //回屏保的时间 const toWallpaperTime = ref(60) //回屏保的时间
const isWallpaper = ref(false) //回首页是否已经跑完 const isWallpaper = ref(false) //回首页是否已经跑完
@ -33,7 +33,6 @@ export const useHandleScreen = (callback: () => void) => {
if (toIndexTime.value <= MIN_TIME) { if (toIndexTime.value <= MIN_TIME) {
clearInterval(toIndexInterval.value) clearInterval(toIndexInterval.value)
toIndexTime.value = totalTime.value[0] toIndexTime.value = totalTime.value[0]
isWallpaper.value = false
resolve() resolve()
} }
}, CHECK_TIME) }, CHECK_TIME)
@ -94,12 +93,12 @@ export const useHandleScreen = (callback: () => void) => {
isWallpaper, isWallpaper,
showCountDownDialog, showCountDownDialog,
title, title,
checkHandleScreen,
totalTime, totalTime,
toIndexTime, toIndexTime,
toWallpaperTime, toWallpaperTime,
logoutRef,
logout,
checkHandleScreen,
resetClickNumber, resetClickNumber,
setLogoutRef
setLogout
} }
} }

10
src/composables/useLogout.ts

@ -1,7 +1,7 @@
import { ref, nextTick } from 'vue' import { ref, nextTick } from 'vue'
export const useLogout = () => { export const useLogout = () => {
const logoutRef = ref(false)
const logout = ref(false)
const clickedNumberTotal = ref(0) const clickedNumberTotal = ref(0)
const MAX_NUMBER = 10 const MAX_NUMBER = 10
@ -11,8 +11,8 @@ export const useLogout = () => {
clickedNumberTotal.value = 0 clickedNumberTotal.value = 0
} }
function setLogoutRef(flag: boolean) {
logoutRef.value = flag
function setLogout(flag: boolean) {
logout.value = flag
} }
//点击商场logo 达到最大次数显示退出框 //点击商场logo 达到最大次数显示退出框
@ -26,7 +26,7 @@ export const useLogout = () => {
} }
nextTick(() => { nextTick(() => {
if (clickedNumberTotal.value >= MAX_NUMBER) { if (clickedNumberTotal.value >= MAX_NUMBER) {
logoutRef.value = true
logout.value = true
resetClickNumber() resetClickNumber()
} }
}) })
@ -35,5 +35,5 @@ export const useLogout = () => {
} }
} }
return { resetClickNumber, addTotalClick, setLogoutRef, logoutRef }
return { resetClickNumber, addTotalClick, setLogout, logout }
} }

21
src/composables/useStatistics.ts

@ -1,6 +1,21 @@
import { useStore } from '@/store/root'
import { storeToRefs } from 'pinia'
import { getStatistics } from '@/http/api/statistics' import { getStatistics } from '@/http/api/statistics'
import type { Query } from '@/http/api/statistics/types'
import type { Query, TagType } from '@/http/api/statistics/types'
export const useStatistics = (data: Query) => {
getStatistics(data)
//店铺编码: tag=navigation或shop或brandSearch或时必传
//industryCode : tag=industry时必传
export const useStatistics = ({ tag, shopCode, industryCode }: { tag: TagType; shopCode: string; industryCode: string }) => {
const store = useStore()
const { currentFloor } = storeToRefs(store)
const params: Query = {
deviceCode: currentFloor.value.deviceCode,
projectCode: currentFloor.value.projectCode,
tag,
shopCode,
industryCode
}
getStatistics(params)
} }

4
src/http/api/brand/index.ts

@ -0,0 +1,4 @@
import { request } from '@/http/http'
export const getListByFloor = () =>
request<{ list: Array<{ name: string; shopList: Shop[] }> }>({ url: `/JSON/getBrandShopListByFloor.json` })

10
src/http/api/statistics/types.ts

@ -1,10 +1,10 @@
//类型,设备点击量:device,导航使用次数:navigation,节目播放次数:program,店铺点击次数:shop,业态点击次数:industry,品牌店铺搜索:brandSearch
export type TagType = 'navigation' | 'shop' | 'brandSearch' | 'device' | 'program' | 'industry'
export type Query = { export type Query = {
deviceCode: string //设备编码 deviceCode: string //设备编码
projectCode: string //项目编码 projectCode: string //项目编码
//类型,设备点击量:device,导航使用次数:navigation,节目播放次数:program,店铺点击次数:shop,业态点击次数:industry,品牌店铺搜索:brandSearch
tag: 'navigation' | 'shop' | 'brandSearch' | 'device' | 'program' | 'industry'
shopCode?: string //店铺编码,tag=navigation或shop或brandSearch或时必传
programId?: number // 节目id,tag=program时必传
proType?: number //1节目,2插播,信发用
tag: TagType
shopCode?: string
industryCode?: string //tag=industry时必传 industryCode?: string //tag=industry时必传
} }

12
src/http/http.ts

@ -83,12 +83,6 @@ class Request {
} }
} }
export type Response<T> = {
msg: string
data: T
code: number
}
const _request = new Request({ const _request = new Request({
timeout: 10000, timeout: 10000,
interceptors: { interceptors: {
@ -114,6 +108,12 @@ const _request = new Request({
} }
}) })
export type Response<T> = {
msg: string
data: T
code: number
}
export const request = <T = any>(config: RequestConfig<Response<T>>) => _request.request(config) export const request = <T = any>(config: RequestConfig<Response<T>>) => _request.request(config)
export const cancelRequest = (url: string | string[]) => _request.cancelRequest(url) export const cancelRequest = (url: string | string[]) => _request.cancelRequest(url)
export const cancelAllRequest = () => _request.cancelAllRequest() export const cancelAllRequest = () => _request.cancelAllRequest()

4
src/store/root/actions.ts

@ -6,6 +6,7 @@ import type { CreateActions } from '../types'
export interface Actions { export interface Actions {
SET_SHOP_LIST(list: Shop[]): void SET_SHOP_LIST(list: Shop[]): void
SET_BUILDING_LIST(list: Building[]): void SET_BUILDING_LIST(list: Building[]): void
SET_COLUMN_LIST(list: Featured[]): void
SET_LANGUAGE(language: Language): void SET_LANGUAGE(language: Language): void
SET_CURRENT_FLOOR(currentFloor: CurrentFloor): void SET_CURRENT_FLOOR(currentFloor: CurrentFloor): void
SET_SHOP(shop: Shop): void SET_SHOP(shop: Shop): void
@ -20,6 +21,9 @@ export const actions: DataActions = {
SET_BUILDING_LIST(list) { SET_BUILDING_LIST(list) {
this.buildingList = list this.buildingList = list
}, },
SET_COLUMN_LIST(list) {
this.columnList = list
},
SET_LANGUAGE(language) { SET_LANGUAGE(language) {
i18n.global.locale = language i18n.global.locale = language
this.language = language this.language = language

2
src/store/root/state.ts

@ -2,7 +2,7 @@ export type Language = 'zh' | 'en' | 'tw' //语言 zh: 简体中文 en: 英文 t
export interface State { export interface State {
shopList: Readonly<Shop[]> //店铺列表 shopList: Readonly<Shop[]> //店铺列表
buildingList: Building[] //楼栋列表 buildingList: Building[] //楼栋列表
columnList: any[] //推荐页的卡片
columnList: Featured[] //推荐页的卡片
facilityList: Facility[] //设施列表 facilityList: Facility[] //设施列表
language: Language //语言 zh: 简体中文 en: 英文 tw: 繁体中文 language: Language //语言 zh: 简体中文 en: 英文 tw: 繁体中文
config: Config //配置文件 config: Config //配置文件

1
src/types/current.d.ts

@ -13,6 +13,7 @@ declare interface CurrentFloor {
machineCode: string //设备code machineCode: string //设备code
machineName: string //设备名称 machineName: string //设备名称
machineTypeName: string //设备类型 machineTypeName: string //设备类型
deviceCode: string
projectCode: string //项目code projectCode: string //项目code
screenAttribute: string //屏幕属性 screenAttribute: string //屏幕属性
} }

10
src/types/task-slice.d.ts

@ -0,0 +1,10 @@
interface Options {
init({ sliceList, callback }: { sliceList: number; callback: (i: number) => void }): void
next(): void
sliceQueue({ sliceList, callback }: { sliceList: number; callback: (i: number) => void }): void
}
declare module 'task-slice' {
const TaskSlice: Options
export default TaskSlice
}

9
src/views/Guide/Guide.vue

@ -1,5 +1,5 @@
<template> <template>
<div class="guide-container">Guide Page</div>
<div class="guide-container"></div>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
@ -7,10 +7,11 @@ import { useStore } from '@/store/root'
import { useGuideMapOperation } from '@/composables/useGuideMapOperation' import { useGuideMapOperation } from '@/composables/useGuideMapOperation'
import { useFacilityNav } from '@/composables/useFacilityNav' import { useFacilityNav } from '@/composables/useFacilityNav'
import { useGuideFilterShop } from '@/composables/useGuideFilterShop' import { useGuideFilterShop } from '@/composables/useGuideFilterShop'
import ScrollView from '@/base/ScrollView/ScrollView.vue'
const store = useStore() const store = useStore()
const { floorIdx, selectedShopList, filterShopByFloorName, filterAboutCurrentInfo } = useGuideFilterShop() //
const { switchFloor, handleMapIcon, list, mapIdx } = useGuideMapOperation() //
const { handleFacility } = useFacilityNav() //
// const { floorIdx, selectedShopList, filterShopByFloorName, filterAboutCurrentInfo } = useGuideFilterShop() //
// const { switchFloor, handleMapIcon, list, mapIdx } = useGuideMapOperation() //
// const { handleFacility } = useFacilityNav() //
</script> </script>

8
src/views/Guide/list.ts

@ -15,14 +15,14 @@ export const list: Item[] = [
{ {
name: MapControl.RESET, name: MapControl.RESET,
nameEn: 'reset', nameEn: 'reset',
icon: require('@/assets/images/guide/reset.png'),
iconActive: require('@/assets/images/guide/reset_active.png')
icon: require('@/assets/images/guide/reset.svg'),
iconActive: require('@/assets/images/guide/reset_active.svg')
}, },
{ {
name: MapControl.DIRECTION, name: MapControl.DIRECTION,
nameEn: 'direction', nameEn: 'direction',
icon: require('@/assets/images/guide/direction.png'),
iconActive: require('@/assets/images/guide/direction_active.png')
icon: require('@/assets/images/guide/direction.svg'),
iconActive: require('@/assets/images/guide/direction_active.svg')
}, },
{ {
name: MapControl.ACTIVITY_BRAND, name: MapControl.ACTIVITY_BRAND,

Loading…
Cancel
Save