Browse Source

feat: 数据统计

潮流
姜鑫 4 years ago
parent
commit
7c39f78edf
  1. 5
      public/static/offline/JSON/GetDevCoordinateByIP.json
  2. 2
      public/static/offline/JSON/config.json
  3. 75
      public/static/qm/MainMap_QM.js
  4. 2
      src/assets/scss/variables.scss
  5. 16
      src/components/BrandDetail/BrandDetail.vue
  6. 5
      src/components/PlateInput/PlateInput.vue
  7. 5
      src/components/PublicComponent/PublicComponent.vue
  8. 92
      src/components/QRCode/QRCode.vue
  9. 8
      src/composables/useHandleScreen.js
  10. 8
      src/composables/useInitMap.js
  11. 18
      src/composables/useStatistics.js
  12. 32
      src/http/api.js
  13. 6
      src/http/brand/api.js
  14. 25
      src/http/http.js
  15. 3
      src/router/index.js
  16. 3
      src/store/root/actions.js
  17. 10
      src/store/root/state.js
  18. 4
      src/views/Brand/Brand.vue
  19. 11
      src/views/Guide/Guide.vue
  20. 3
      src/views/Nav/Nav.vue
  21. 1
      src/views/Nav/children/PassShop.vue

5
public/static/offline/JSON/GetDevCoordinateByIP.json

@ -7,11 +7,12 @@
"label": "windows", "label": "windows",
"screenAttribute": "命", "screenAttribute": "命",
"building": "A栋", "building": "A栋",
"buildingCode": 11101,
"deviceCode": "11101009",
"buildingCode": "11101",
"projectCode": "project-200", "projectCode": "project-200",
"floor": "L1层", "floor": "L1层",
"floorOrder": 2, "floorOrder": 2,
"floorCode": 11101003,
"floorCode": "11101003",
"ip": "192.168.1.134", "ip": "192.168.1.134",
"mac": "Excepteur", "mac": "Excepteur",
"location": "43", "location": "43",

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

@ -2,7 +2,7 @@
"code": "200", "code": "200",
"msg": "", "msg": "",
"data": { "data": {
"interfaceUrl": "https://test.iot.1000my.com/api/guide/v1/web",
"interfaceUrl": "https://test.iot.1000my.com/api",
"sourceUrl": "https://test-598d.obs.cn-east-2.myhuaweicloud.com", "sourceUrl": "https://test-598d.obs.cn-east-2.myhuaweicloud.com",
"backSocket": "ws://127.0.0.1:7181" "backSocket": "ws://127.0.0.1:7181"
} }

75
public/static/qm/MainMap_QM.js

@ -313,30 +313,39 @@ ConfigFun = function () {
* "data": [] * "data": []
* } * }
*/ */
this.getInstance = function (callBack, build = 0, floor = 0, navPoint = 1, angle = 0, mallCode = '', _url = 'http://saas.1000my.com:8013') {
this.getInstance = function (callBack, build = 0, floor = 0, navPoint = 1, angle = 0, mallCode = 'project-200', _url = 'https://test.iot.1000my.com') {
Config.startObj.build = Config.deviceObj.build = parseInt(build) || 0 Config.startObj.build = Config.deviceObj.build = parseInt(build) || 0
Config.startObj.floor = Config.deviceObj.floor = parseInt(floor) || 0 Config.startObj.floor = Config.deviceObj.floor = parseInt(floor) || 0
Config.startObj.node = Config.deviceObj.node = parseInt(navPoint) || 1 Config.startObj.node = Config.deviceObj.node = parseInt(navPoint) || 1
Config.deviceObj.angle = parseInt(angle) || 0 Config.deviceObj.angle = parseInt(angle) || 0
Config.selectFloor = Config.deviceObj.floor Config.selectFloor = Config.deviceObj.floor
Config.selectBuild = Config.deviceObj.build Config.selectBuild = Config.deviceObj.build
Config.mallCode = mallCode
Config.cloudUrl = _url
let tim = Config.timeStamp();
let backObj = { code: 200, msg: '加载成功', data: [] } let backObj = { code: 200, msg: '加载成功', data: [] }
this.readTextFile(Config.mapServerInfo, function (res) {
try {
if (res.data.mallKey != 'Zeditor') {
Config.allMap = JSON.parse(res.data.mapData)
} else {
Config.allMap = JSON.parse(LZString.decompressFromBase64(res.data.mapData))
Config.requestNoJM({
method: "GET",
url: Config.cloudUrl + '/api/guide/v1/web/getMallMapData/'+Config.mallCode +'/Aeditor?time=' + tim,
success: (res) => {
try {
if (res.data.mallKey != 'Zeditor') {
Config.allMap = JSON.parse(res.data.mapData)
} else {
Config.allMap = JSON.parse(LZString.decompressFromBase64(res.data.mapData))
}
} catch (e) {
backObj.code = 404
backObj.msg = '地图数据JSON格式错误'
callBack(backObj)
callBack = null
} }
} catch (e) {
backObj.code = 404
backObj.msg = '地图数据JSON格式错误'
callBack(backObj)
callBack = null
}
//console.log(Config.allMap);
Config.getShopData(callBack)
})
//console.log(Config.allMap);
Config.getShopData(callBack)
},
fail: () => {}
});
} }
/*** ----------------------------------------------- 参数 API END ----------------------------------------------- **** */ /*** ----------------------------------------------- 参数 API END ----------------------------------------------- **** */
this.Point = function (x = 0, y = 0) { this.Point = function (x = 0, y = 0) {
@ -398,9 +407,7 @@ ConfigFun = function () {
params.fail() params.fail()
} }
xmlhttp.open(params.method, params.url, true) xmlhttp.open(params.method, params.url, true)
//xmlhttp.setRequestHeader("Access-Control-Allow-Origin", "*");
xmlhttp.setRequestHeader('Content-type', 'application/json') xmlhttp.setRequestHeader('Content-type', 'application/json')
//xmlhttp.setRequestHeader("Access-Control-Allow-Method", "POST,GET");
xmlhttp.send(params.data) xmlhttp.send(params.data)
} }
this.requestNoJM = function (params) { this.requestNoJM = function (params) {
@ -425,9 +432,7 @@ ConfigFun = function () {
params.fail() params.fail()
} }
xmlhttp.open(params.method, params.url, true) xmlhttp.open(params.method, params.url, true)
//xmlhttp.setRequestHeader("Access-Control-Allow-Origin", "*");
// xmlhttp.setRequestHeader('Content-Type', 'application/json')
//xmlhttp.setRequestHeader("Access-Control-Allow-Method", "POST,GET");
xmlhttp.setRequestHeader('projectCode', Config.mallCode);
xmlhttp.send(params.data) xmlhttp.send(params.data)
} }
@ -1496,7 +1501,7 @@ ConfigFun = function () {
let backObj = { code: 200, msg: '加载成功', data: [] } let backObj = { code: 200, msg: '加载成功', data: [] }
Config.requestNoJM({ Config.requestNoJM({
method: 'GET', method: 'GET',
url: 'https://test.iot.1000my.com/api/guide/v1/web/getMapInfo?projectCode=' + 'project-200',
url: Config.cloudUrl + '/api/guide/v1/web/getMapInfo?projectCode=' + Config.mallCode,
success: res => { success: res => {
if (res.code == '200') { if (res.code == '200') {
Config.shopData = res.data.shopList Config.shopData = res.data.shopList
@ -4631,19 +4636,19 @@ MainMap_QM.prototype = {
* Map_QM.changeWindowResize(1280,1080); * Map_QM.changeWindowResize(1280,1080);
*/ */
changeWindowResize: function (width = -1, height = -1) { changeWindowResize: function (width = -1, height = -1) {
aspect = width / height
cameraPerspective.aspect = aspect
cameraPerspective.updateProjectionMatrix()
cameraOrtho.left = (340 * aspect) / -2
cameraOrtho.right = (340 * aspect) / 2
cameraOrtho.top = 340 / 2
cameraOrtho.bottom = 340 / -2
cameraOrtho.updateProjectionMatrix()
Map_QM.renderer.setSize(width, height)
Map_QM.labelRenderer.setSize(width, height)
Map_QM.w = width
Map_QM.h = height
aspect = width/height;
cameraPerspective.aspect = aspect;
cameraPerspective.updateProjectionMatrix();
cameraOrtho.left = 340 * aspect / -2;
cameraOrtho.right = 340 * aspect / 2;
cameraOrtho.top = 340/2;
cameraOrtho.bottom = 340/-2;
cameraOrtho.updateProjectionMatrix();
Map_QM.renderer.setSize(width, height);
Map_QM.labelRenderer.setSize(width, height);
Map_QM.w = width;
Map_QM.h = height;
} }
} }
Object.assign(MainMap_QM.prototype, THREE.EventDispatcher.prototype) Object.assign(MainMap_QM.prototype, THREE.EventDispatcher.prototype)

2
src/assets/scss/variables.scss

@ -26,7 +26,7 @@
--color-linear-lightgoldenyellow: linear-gradient(90deg, #ffbd35 0%, #ffd260 100%); --color-linear-lightgoldenyellow: linear-gradient(90deg, #ffbd35 0%, #ffd260 100%);
--color-linear-goldenyellow: linear-gradient(90deg, #f6a62c 0%, #ffbc3f 100%); --color-linear-goldenyellow: linear-gradient(90deg, #f6a62c 0%, #ffbc3f 100%);
--color-linear-golden: linear-gradient(117deg, #c99e6b 0%, #e2c894 100%); --color-linear-golden: linear-gradient(117deg, #c99e6b 0%, #e2c894 100%);
--color-linear-pink: linear-gradielinear-gradient(96.8deg, #e2acbc 3%, #ffece8 100%);
--color-linear-pink: linear-gradient(96.8deg, #e2acbc 3%, #ffece8 100%);
--color-linear-lightyellow: linear-gradient(96deg, #dcc7a7 3%, #f1ddc5 100%); --color-linear-lightyellow: linear-gradient(96deg, #dcc7a7 3%, #f1ddc5 100%);
--color-linear-blue: linear-gradient(96.8deg, #acc2e2 2.93%, #ddf0fe 100%); --color-linear-blue: linear-gradient(96.8deg, #acc2e2 2.93%, #ddf0fe 100%);

16
src/components/BrandDetail/BrandDetail.vue

@ -83,7 +83,7 @@
<p class="abs-money">147<i>/</i></p> <p class="abs-money">147<i>/</i></p>
</div> </div>
</div> </div>
<div class="lineup-btn">{{ $t('join') }}</div>
<div class="lineup-btn" @click="handleLineupBtn">{{ $t('join') }}</div>
</div> </div>
</div> </div>
<div class="right" v-if="shop.activityList.length || shop.thirdKouCode"> <div class="right" v-if="shop.activityList.length || shop.thirdKouCode">
@ -91,12 +91,15 @@
</div> </div>
<Button class="btn" @click="back" /> <Button class="btn" @click="back" />
<ThumbQRCode class="thumbs" :title="$t('yuyue')" /> <ThumbQRCode class="thumbs" :title="$t('yuyue')" />
<Transition enter-active-class="animate__animated animate__zoomIn" leave-active-class="animate__animated animate__zoomOut">
<QRCode v-if="showLineupQr" @close="showLineupQr = false" />
</Transition>
</div> </div>
</Dialog> </Dialog>
</template> </template>
<script setup> <script setup>
import { ref } from 'vue'
import { ref, defineAsyncComponent } from 'vue'
import { storeToRefs } from 'pinia' import { storeToRefs } from 'pinia'
import { useRouter } from 'vue-router' import { useRouter } from 'vue-router'
import { useStore } from '@/store/root' import { useStore } from '@/store/root'
@ -108,11 +111,15 @@ import ScrollView from '@/base/ScrollView/ScrollView.vue'
import Go from '@/base/Go/Go.vue' import Go from '@/base/Go/Go.vue'
import ThumbQRCode from '@/base/ThumbQRCode/ThumbQRCode.vue' import ThumbQRCode from '@/base/ThumbQRCode/ThumbQRCode.vue'
import Tabs from './children/tabs.vue' import Tabs from './children/tabs.vue'
import { useStatistics } from '@/composables/useStatistics'
const QRCode = defineAsyncComponent(() => import('@/components/QRCode/QRCode.vue'))
const router = useRouter() const router = useRouter()
const store = useStore() const store = useStore()
const { shop, config, showDetail, showSearch, showVoice } = storeToRefs(store) const { shop, config, showDetail, showSearch, showVoice } = storeToRefs(store)
useStatistics('shop')
const showLikeHeart = ref(false) const showLikeHeart = ref(false)
const likeNumber = ref(0) const likeNumber = ref(0)
getBrandLikesNumber(shop.value.shopId).then(({ data }) => { getBrandLikesNumber(shop.value.shopId).then(({ data }) => {
@ -126,6 +133,11 @@ function setLike() {
}) })
} }
const showLineupQr = ref(false)
function handleLineupBtn() {
showLineupQr.value = true
}
async function go() { async function go() {
await router.push('/nav') await router.push('/nav')
showDetail.value && store.SET_SHOW_DETAIL(false) showDetail.value && store.SET_SHOW_DETAIL(false)

5
src/components/PlateInput/PlateInput.vue

@ -120,7 +120,7 @@ function handleEnergy() {
content: ''; content: '';
position: absolute; position: absolute;
background: #ffffff; background: #ffffff;
box-shadow: 0px 10px 20px rgba(0, 0, 0, 0.03);
box-shadow: 0 10px 20px rgba(0, 0, 0, 0.03);
border-radius: 8px; border-radius: 8px;
z-index: 2; z-index: 2;
} }
@ -128,6 +128,9 @@ function handleEnergy() {
&:nth-child(2) { &:nth-child(2) {
margin-right: 12px; margin-right: 12px;
} }
&::after {
width: 132px;
}
} }
&.active { &.active {
&::before { &::before {

5
src/components/PublicComponent/PublicComponent.vue

@ -41,7 +41,7 @@ const Search = defineAsyncComponent(() => import('@/components/Search/Search.vue
const router = useRouter() const router = useRouter()
const route = useRoute() const route = useRoute()
const store = useStore() const store = useStore()
const { shop, showDetail, showSearch } = storeToRefs(store)
const { shop, showDetail, showSearch, sidebarList, language } = storeToRefs(store)
const { logoutRef, resetClickNumber, setLogoutRef } = useLogout() const { logoutRef, resetClickNumber, setLogoutRef } = useLogout()
const { title, countDownGif, isWall, countDownToWall, countDownNum, send, checkHandleScreen } = useHandleScreen(handleScreen) const { title, countDownGif, isWall, countDownToWall, countDownNum, send, checkHandleScreen } = useHandleScreen(handleScreen)
@ -55,7 +55,8 @@ async function handleScreen() {
window.Map_QM.changeMapIPState(shop.value?.houseNum, shop.value?.formatColor) window.Map_QM.changeMapIPState(shop.value?.houseNum, shop.value?.formatColor)
setLogoutRef(false) setLogoutRef(false)
resetClickNumber() resetClickNumber()
store.language !== 'zh' && store.SET_LANGUAGE('zh')
store.SET_SELECTED_MODULE(sidebarList.value[0].title)
language.value !== 'zh' && store.SET_LANGUAGE('zh')
await router.push('/') await router.push('/')
} }

92
src/components/QRCode/QRCode.vue

@ -0,0 +1,92 @@
<template>
<div class="full-code">
<div class="code-wrapper">
<img :src="icon" class="img" alt="" v-if="icon.length" />
<img src="../../assets/images/nodata.svg" class="img nodata" alt="" v-else />
<p class="youhui" v-if="icon.length">{{ title }}</p>
<slot />
<div class="close" @click="handleClose">
<img src="../../assets/images/detail/yellow_close.png" alt="" />
</div>
</div>
</div>
</template>
<script setup>
defineProps({
title: {
type: String,
default: '扫码排队'
},
icon: {
type: String,
default: ''
}
})
const emits = defineEmits(['close'])
function handleClose() {
emits('close')
}
</script>
<style lang="scss" scoped>
.full-code {
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: 10;
animation-duration: 0.2s;
}
.code-wrapper {
position: absolute;
top: 50%;
left: 50%;
width: 480px;
min-height: 366px;
transform: translate3d(-50%, -50%, 0);
background: #ffffff;
box-shadow: 0 40px 60px rgba(0, 0, 0, 0.08);
border-radius: 12px;
padding-top: 80px;
z-index: 10;
.img {
display: block;
margin: 0 auto 49px;
width: 150px;
height: 150px;
&.nodata {
width: 300px;
height: 300px;
}
}
.youhui {
font-weight: 700;
font-family: 'font_bold';
font-size: 20px;
line-height: 23px;
text-align: center;
color: rgba(0, 0, 0, 0.8);
}
.close {
display: flex;
justify-content: center;
align-items: center;
position: absolute;
top: 12px;
right: 12px;
width: 56px;
height: 56px;
background: rgba(0, 0, 0, 0.02);
border-radius: 12px;
img {
width: 56px;
height: 56px;
}
}
}
</style>

8
src/composables/useHandleScreen.js

@ -2,6 +2,7 @@ import { reactive, onMounted, toRefs, computed } from 'vue'
import { getBackTime } from '@/http/api' import { getBackTime } from '@/http/api'
import { useStore } from '@/store/root' import { useStore } from '@/store/root'
import { useRouter } from 'vue-router' import { useRouter } from 'vue-router'
import { useStatistics } from '@/composables/useStatistics'
export const useHandleScreen = callback => { export const useHandleScreen = callback => {
const router = useRouter() const router = useRouter()
@ -122,6 +123,7 @@ export const useHandleScreen = callback => {
//超过一分钟未操作回到首页 //超过一分钟未操作回到首页
const checkHandleScreen = () => { const checkHandleScreen = () => {
useStatistics('device')
clearInterval(state.timer) clearInterval(state.timer)
clearInterval(state.wallTimer) clearInterval(state.wallTimer)
clearTimeout(state.autoTimer) clearTimeout(state.autoTimer)
@ -132,11 +134,11 @@ export const useHandleScreen = callback => {
state.isWall = false state.isWall = false
state.autoTimer = setTimeout(async () => { state.autoTimer = setTimeout(async () => {
if (state.times[0] !== 0) { if (state.times[0] !== 0) {
if (router.currentRoute.value.fullPath !== '/') {
if (router.currentRoute.value.fullPath !== '/index') {
await indexPromise() await indexPromise()
} }
if ((state.times[1] === 0 && router.currentRoute.value.fullPath === '/') || (state.times[0] === 0 && state.times[1] === 0)) {
if ((state.times[1] === 0 && router.currentRoute.value.fullPath === '/index') || (state.times[0] === 0 && state.times[1] === 0)) {
await rootPromise() await rootPromise()
callback && callback() callback && callback()
} }
@ -154,7 +156,7 @@ export const useHandleScreen = callback => {
initWebSocket() initWebSocket()
} }
// onMounted(initMessage)
onMounted(initMessage)
return { ...toRefs(state), checkHandleScreen, send } return { ...toRefs(state), checkHandleScreen, send }
} }

8
src/composables/useInitMap.js

@ -8,16 +8,16 @@ export const useInitMap = function () {
//初始化地图 //初始化地图
// onReady(store.currentFloor, () => { // onReady(store.currentFloor, () => {
// const facilityList = window.Map_QM.getAllIcon().flat(Infinity) // const facilityList = window.Map_QM.getAllIcon().flat(Infinity)
//
// const list = facilityList.map(item => { // const list = facilityList.map(item => {
// item.imgUrl.replace('./', '/') // item.imgUrl.replace('./', '/')
// return item // return item
// }) // })
//
// window.Map_QM.addEventListener('shop', onClickShop, false) // window.Map_QM.addEventListener('shop', onClickShop, false)
//
// store.SET_FACILITY_LIST(uniqBy(list, 'type')) // store.SET_FACILITY_LIST(uniqBy(list, 'type'))
//
// window.Map_QM.renderer.domElement.addEventListener('webglcontextlost', onContextLost) // window.Map_QM.renderer.domElement.addEventListener('webglcontextlost', onContextLost)
// }) // })
} }

18
src/composables/useStatistics.js

@ -0,0 +1,18 @@
import { storeToRefs } from 'pinia'
import { useStore } from '@/store/root'
import { getStatistics } from '@/http/api'
/**
* @param {string} tag 设备点击量:device,导航使用次数:navigation,店铺点击次数:shop,业态点击次数:industry
*/
export const useStatistics = tag => {
const store = useStore()
const { currentFloor } = storeToRefs(store)
const { projectCode, deviceCode } = currentFloor.value
const params = {
projectCode,
deviceCode,
tag
}
getStatistics(params)
}

32
src/http/api.js

@ -2,43 +2,46 @@ import { post, get } from './http'
import { url } from '@/http/config' import { url } from '@/http/config'
//首页热搜及卡片 //首页热搜及卡片
export const getIndexList = () => get(`${url().interfaceUrl}/index`)
export const getIndexList = () => get(`${url().interfaceUrl}/guide/v1/web/index`)
//获取活动 1商场活动;2品牌活动;3会员活动 //获取活动 1商场活动;2品牌活动;3会员活动
export const getActivityList = type => get(`${url().interfaceUrl}/getActivityList/${type}`)
export const getActivityList = type => get(`${url().interfaceUrl}/guide/v1/web/getActivityList/${type}`)
//获取会员权益 //获取会员权益
export const getMemberBenefits = () => get(`${url().interfaceUrl}/getMemberInterests`)
export const getMemberBenefits = () => get(`${url().interfaceUrl}/guide/v1/web/getMemberInterests`)
//获取停车场数据 //获取停车场数据
export const getParkingList = () => get(`${url().interfaceUrl}/getParkingInfo`)
export const getParkingList = () => get(`${url().interfaceUrl}/guide/v1/web/getParkingInfo`)
//瀑布流 //瀑布流
export const getWaterfallList = type => get(`${url().interfaceUrl}/getColumnList/${type}`)
export const getWaterfallList = type => get(`${url().interfaceUrl}/guide/v1/web/getColumnList/${type}`)
//获取服务信息 //获取服务信息
export const getServeList = () => get(`${url().interfaceUrl}/getServeList`)
export const getServeList = () => get(`${url().interfaceUrl}/guide/v1/web/getServeList`)
//获取 周边交通图片 //获取 周边交通图片
export const getTrafficList = () => get(`${url().interfaceUrl}/getMallTraffic`)
export const getTrafficList = () => get(`${url().interfaceUrl}/guide/v1/web/getMallTraffic`)
//获取品牌喜欢数量 //获取品牌喜欢数量
export const getBrandLikesNumber = shopId => get(`${url().interfaceUrl}/getBrandStar?shopId=${shopId}`)
export const getBrandLikesNumber = shopId => get(`${url().interfaceUrl}/guide/v1/web/getBrandStar?shopId=${shopId}`)
//设置品牌喜欢数量 //设置品牌喜欢数量
export const setBrandLikesNumber = shopId => get(`${url().interfaceUrl}/setBrandStar?shopId=${shopId}`)
export const setBrandLikesNumber = shopId => get(`${url().interfaceUrl}/guide/v1/web/setBrandStar?shopId=${shopId}`)
//获取 影院信息 //获取 影院信息
export const getCinemaInfo = () => get(`${url().interfaceUrl}/getCinemaInfo`)
export const getCinemaInfo = () => get(`${url().interfaceUrl}/guide/v1/web/getCinemaInfo`)
//获取商场介绍 //获取商场介绍
export const getMallInfoList = () => get(`${url().interfaceUrl}/getMallInfo`)
export const getMallInfoList = () => get(`${url().interfaceUrl}/guide/v1/web/getMallInfo`)
//是否显示语音 //是否显示语音
export const getIsShowVoiceBtn = () => get(`${url().interfaceUrl}/getMallVoice`)
export const getIsShowVoiceBtn = () => get(`${url().interfaceUrl}/guide/v1/web/getMallVoice`)
//获取跳转时间
export const getBackTime = () => get(`${url().interfaceUrl}/guide/v1/web/getHomeJump`)
//获取地图导览数据 //获取地图导览数据
export const getGuideList = () => get(`${url().interfaceUrl}/getMapInfo`)
export const getGuideList = () => get(`${url().interfaceUrl}/guide/v1/web/getMapInfo`)
//获取配置项 //获取配置项
export const getConfig = () => get('/static/offline/JSON/config.json') export const getConfig = () => get('/static/offline/JSON/config.json')
@ -48,3 +51,6 @@ export const getCurrentFloor = () => get(`/static/offline/JSON/GetDevCoordinateB
//手写地址 //手写地址
export const getHandWriting = params => post('http://saas.1000my.com:8014/words', params) export const getHandWriting = params => post('http://saas.1000my.com:8014/words', params)
//数据统计
export const getStatistics = params => post(`${url().interfaceUrl}/analysis/v1/web/deviceUseClickDataUpload`, params)

6
src/http/brand/api.js

@ -2,10 +2,10 @@ import { get } from '@/http/http'
import { url } from '@/http/config' import { url } from '@/http/config'
//获取品牌数据 //获取品牌数据
export const getBrandList = () => get(`${url().interfaceUrl}/getBrandShopList`)
export const getBrandList = () => get(`${url().interfaceUrl}/guide/v1/web/getBrandShopList`)
// //获取品牌模块通过业态排序的品牌列表 // //获取品牌模块通过业态排序的品牌列表
export const getBrandListByFormat = () => get(`${url().interfaceUrl}/getBrandShopListByIndustryId`)
export const getBrandListByFormat = () => get(`${url().interfaceUrl}/guide/v1/web/getBrandShopListByIndustryId`)
// //获取品牌模块通过楼层排序的品牌列表QueryRecommendShopList // //获取品牌模块通过楼层排序的品牌列表QueryRecommendShopList
export const getBrandListByFloor = () => get(`${url().interfaceUrl}/getBrandShopListByFloor`)
export const getBrandListByFloor = () => get(`${url().interfaceUrl}/guide/v1/web/getBrandShopListByFloor`)

25
src/http/http.js

@ -5,26 +5,13 @@ axios.defaults.timeout = 10000
axios.interceptors.request.use( axios.interceptors.request.use(
config => { config => {
try {
//添加时间戳 防止访问json文件出现缓存
if (/get/i.test(config.method) && /\.json$/i.test(config.url)) {
config.params = config.params || {}
config.params.t = Date.parse(new Date()) / 1000
}
//请求类型不是json文件
if (!/\.json$/i.test(config.url)) {
const store = useStore()
const hasCode = store.currentFloor?.projectCode
//处理拼接符号 一开始有 '?' 说明已有query params 需要把符号改成'&'
const code = `${config.url.includes('?') ? '&' : '?'}projectCode=${store.currentFloor.projectCode}`
Object.assign(config, {
url: hasCode ? `${config.url}${code}` : config.url
})
}
} catch (error) {
console.log('error: ', error)
//添加时间戳 防止访问json文件出现缓存
if (/get/i.test(config.method) && /\.json$/i.test(config.url)) {
config.params = config.params || {}
config.params.t = Date.parse(new Date()) / 1000
} }
const store = useStore()
config.headers['projectCode'] = store.currentFloor.projectCode
return config return config
}, },

3
src/router/index.js

@ -35,7 +35,8 @@ router.beforeEach(async to => {
if (!router.hasRoute('home')) { if (!router.hasRoute('home')) {
//推荐卡片列表长度为0时说明不需要推荐页面 直接从导航栏列表删除 //推荐卡片列表长度为0时说明不需要推荐页面 直接从导航栏列表删除
if (!data.columnList.length) { if (!data.columnList.length) {
store.sidebarList.splice(0, 1)
const list = store.sidebarList.slice()
store.SET_SIDEBAR_LIST(list.splice(0, 1))
} }
//store存储的首页卡片数据长度不等于请求的卡片数据长度时才能去重新提交到store中 防止重复提交 //store存储的首页卡片数据长度不等于请求的卡片数据长度时才能去重新提交到store中 防止重复提交
if (store.indexList?.columnList?.length !== data.columnList.length) { if (store.indexList?.columnList?.length !== data.columnList.length) {

3
src/store/root/actions.js

@ -10,6 +10,9 @@ export const actions = {
SET_INDEX_LIST(list) { SET_INDEX_LIST(list) {
this.indexList = list this.indexList = list
}, },
SET_SIDEBAR_LIST(list) {
this.sidebarList = list
},
SET_BUILDING_LIST(list) { SET_BUILDING_LIST(list) {
this.buildingList = list this.buildingList = list
}, },

10
src/store/root/state.js

@ -2,6 +2,7 @@ import { sidebarList } from '@/components/Sidebar/list'
export const state = () => ({ export const state = () => ({
sidebarList, sidebarList,
is4k: is4k(),
shopList: [], //店铺列表 shopList: [], //店铺列表
buildingList: [], //楼栋列表 buildingList: [], //楼栋列表
indexList: {}, indexList: {},
@ -15,5 +16,12 @@ export const state = () => ({
showDetail: false, //是否显示详情 showDetail: false, //是否显示详情
currentFloor: {}, //设备所属的当前楼栋的当前楼层信息 currentFloor: {}, //设备所属的当前楼栋的当前楼层信息
isUseFace: 0, //是否使用人脸 0:不使用 1: 使用 isUseFace: 0, //是否使用人脸 0:不使用 1: 使用
isUseSpeech: 0 //是否使用语音 0:不使用 1: 使用
isUseSpeech: 1 //是否使用语音 0:不使用 1: 使用
}) })
export const is4k = () => {
const retinaList = [2160 * 3840, 3840 * 2160]
const width = window.screen.width
const height = window.screen.height
return retinaList.includes(width * height)
}

4
src/views/Brand/Brand.vue

@ -35,6 +35,7 @@
</div> </div>
</div> </div>
</div> </div>
</View> </View>
</template> </template>
@ -49,12 +50,15 @@ import Industry from '@/components/Industry/Industry.vue'
import Tabs from '@/components/Tabs/Tabs.vue' import Tabs from '@/components/Tabs/Tabs.vue'
import BrandRecommend from '@/components/BrandRecommend/BrandRecommend.vue' import BrandRecommend from '@/components/BrandRecommend/BrandRecommend.vue'
import BrandScroll from '@/components/BrandScroll/BrandScroll.vue' import BrandScroll from '@/components/BrandScroll/BrandScroll.vue'
import { useStatistics } from '@/composables/useStatistics'
const ALL_BRAND = '全部品牌' const ALL_BRAND = '全部品牌'
const store = useStore() const store = useStore()
const { config, currentFloor, shopList } = storeToRefs(store) const { config, currentFloor, shopList } = storeToRefs(store)
useStatistics('industry')
const selectedList = ref([]) const selectedList = ref([])
const formatList = ref([]) const formatList = ref([])
const recommendList = ref([]) const recommendList = ref([])

11
src/views/Guide/Guide.vue

@ -288,16 +288,7 @@ watch(
right: 24px; right: 24px;
top: 854px; top: 854px;
z-index: 51; z-index: 51;
&::before {
content: '';
position: absolute;
width: 1px;
height: 24px;
top: 40px;
left: 256px;
background: var(--color-black-opacity-1);
border-radius: 2px;
}
.hands { .hands {
position: fixed; position: fixed;
top: 37px; top: 37px;

3
src/views/Nav/Nav.vue

@ -50,6 +50,7 @@ import { Refresh } from '@/base/Svg'
import PassShop from './children/PassShop.vue' import PassShop from './children/PassShop.vue'
import Temperature from '@/base/Temperature/Temperature.vue' import Temperature from '@/base/Temperature/Temperature.vue'
import Time from '@/base/Time/Time.vue' import Time from '@/base/Time/Time.vue'
import { useStatistics } from '@/composables/useStatistics'
const store = useStore() const store = useStore()
const { shop, currentFloor, config } = storeToRefs(store) const { shop, currentFloor, config } = storeToRefs(store)
@ -59,6 +60,8 @@ const { directionInfo, pathShopList, backPathArray } = useStartNavi(shop, curren
const { methodIdx, handleControl } = useChangeNavMethod(backPathArray) const { methodIdx, handleControl } = useChangeNavMethod(backPathArray)
const { cameraViewsImage, setCameraViews } = useSetCameraViews(pause) const { cameraViewsImage, setCameraViews } = useSetCameraViews(pause)
useStatistics('navigation')
window.Map_QM.changeWindowResize(1366, 1080) window.Map_QM.changeWindowResize(1366, 1080)
onBeforeUnmount(() => { onBeforeUnmount(() => {

1
src/views/Nav/children/PassShop.vue

@ -277,6 +277,7 @@ defineProps({
position: relative; position: relative;
flex: 1; flex: 1;
overflow: hidden; overflow: hidden;
height: 640px;
:deep(.bscroll-vertical-scrollbar) { :deep(.bscroll-vertical-scrollbar) {
right: 50px !important; right: 50px !important;
top: 16px !important; top: 16px !important;

Loading…
Cancel
Save