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 { globalEventBus } from '@/common/eventBus'
import { Push } from '@/common/push' 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) => { const openPush = (uid = 10) => {
if (isMainScreen) return
var connection = new Push({ var connection = new Push({
url: 'wss://chat.lihaink.cn/tts', // websocket url: 'wss://chat.lihaink.cn/tts', // websocket
app_key: 'aaea61749929eb53a4bd75a1474c1d27', app_key: 'aaea61749929eb53a4bd75a1474c1d27',
@ -64,20 +78,7 @@ const searchParams = new URLSearchParams(queryString);
// id // id
const id = searchParams.get('local') || ''; const id = searchParams.get('local') || '';
console.log(id); // id id ? openPush(id) : openPush()
if (!JSON.parse(localStorage.getItem("TRADE_TYPE"))) {
if (id) {
openPush(id);
}
else {
openPush();
}
}
</script> </script>
<template> <template>
<div class="main-box"> <div class="main-box">

View File

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

View File

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

View File

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

View File

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