add
This commit is contained in:
parent
164220a37f
commit
53217ec58e
29
src/App.vue
29
src/App.vue
|
@ -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">
|
||||
|
|
|
@ -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 => {
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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) => {
|
||||
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue