This commit is contained in:
zmj 2024-02-29 09:24:40 +08:00
parent 164220a37f
commit 53217ec58e
5 changed files with 19 additions and 21 deletions

View File

@ -3,9 +3,23 @@ import { areaObj } from "@/store/index.js"
import { globalEventBus } from '@/common/eventBus'
import { Push } from '@/common/push'
// URL
var queryString = window.location.hash.split("?")[1];
//
const searchParamsType = new URLSearchParams(queryString);
// id
const type = searchParamsType.get('type') || '';
if (type) { localStorage.setItem("TRADE_TYPE", true) }
else {
localStorage.setItem("TRADE_TYPE", false)
}
const isMainScreen = Boolean(type)
console.log(isMainScreen, 'isMainScreen')
const openPush = (uid = 10) => {
if (isMainScreen) return
var connection = new Push({
url: 'wss://chat.lihaink.cn/tts', // websocket
app_key: 'aaea61749929eb53a4bd75a1474c1d27',
@ -64,20 +78,7 @@ const searchParams = new URLSearchParams(queryString);
// id
const id = searchParams.get('local') || '';
console.log(id); // id
if (!JSON.parse(localStorage.getItem("TRADE_TYPE"))) {
if (id) {
openPush(id);
}
else {
openPush();
}
}
id ? openPush(id) : openPush()
</script>
<template>
<div class="main-box">

View File

@ -160,7 +160,6 @@ onMounted(() => {
getProductCountApi(props.areaCodes).then(res => {
data = reactive(res.data)
clone(res.data, data)
console.log(data, 'data')
})
getViewCountApi(props.areaCodes).then(res => {

View File

@ -268,7 +268,6 @@ const initStoreOption = (pageData, total) => {
storeData.splice(0, storeData.length);
pageData.forEach((item,index) => {
let range = ((item.merchant_count / total) * 100).toFixed(2)
console.log(range,'rean=g')
storeData.push({
name: item.street_name,
num: item.merchant_count,

View File

@ -230,7 +230,6 @@ getSalesRankApi(props.areaCodes).then(res => {
config.data = addFn(merchantRankingList)
pageNum.value = Math.ceil(townProductCountList.length / 8)
initStoreOption(townProductCountList.slice(0, 8), townProductCount.value)
console.log(townProductCount.value,'townProductCount')
})
const pageFN = (Num) => {

View File

@ -50,10 +50,10 @@ setTimeout(() => {
showLoading.value = false
}, 500);
if (route.query?.type) { localStorage.setItem("TRADE_TYPE", true) }
else {
localStorage.setItem("TRADE_TYPE", false)
}
// if (route.query?.type) { localStorage.setItem("TRADE_TYPE", true) }
// else {
// localStorage.setItem("TRADE_TYPE", false)
// }
</script>
<style lang="scss">
@keyframes jump {