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 { 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">
|
||||||
|
|
|
@ -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 => {
|
||||||
|
|
|
@ -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,
|
||||||
|
|
|
@ -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) => {
|
||||||
|
|
||||||
|
|
|
@ -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 {
|
||||||
|
|
Loading…
Reference in New Issue