This commit is contained in:
zmj 2024-02-23 18:19:50 +08:00
parent ef54ea4ef4
commit 4365d790cc
4 changed files with 97 additions and 3728 deletions

3745
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -5,26 +5,24 @@ import { Push } from '@/common/push'
const openPush=()=>{
const openPush = (uid = 10) => {
var connection = new Push({
url: 'wss://chat.lihaink.cn/tts', // websocket
app_key: 'aaea61749929eb53a4bd75a1474c1d27',
});
// uid1
var uid = 10;
// user-2uid1
var user_channel = connection.subscribe('user-' + uid);
url: 'wss://chat.lihaink.cn/tts', // websocket
app_key: 'aaea61749929eb53a4bd75a1474c1d27',
});
// user-2uid1
var user_channel = connection.subscribe( uid==10?'user-' + uid:uid+'user-trad');
console.log(user_channel,"user_channnel")
// user-2message
user_channel.on('message', function (data) {
console.log("收到消息",data)
// user-2message
user_channel.on('message', function (data) {
globalEventBus.emit(data.content.event, data.content.data)
});
// 线
user_channel.on('close', function () {
});
// 线
user_channel.on('close', function () {
});
});
}
const areaStroe = areaObj()
@ -57,7 +55,28 @@ if (localStorage.getItem("TRADE_USER")) {
areaStroe.changeArea({ areaCode: area_code, streetCode: street_code })
}
if( !JSON.parse(localStorage.getItem("TRADE_TYPE")))openPush();
// URL
var queryString = window.location.hash.split("?")[1];
//
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();
}
}
</script>
<template>

View File

@ -42,15 +42,15 @@ const choseTownFn = (id, name) => {
}
}
// x
const choseAreaFn = () => {
//
const choseAreaFn = (name='泸县') => {
if(isMainScreen){
sendFn('header6', { name: "泸县", code: 0 })
}else{
areaStore.changeArea({
areaCode: areaStore.area.areaCode,
streetCode: null,
name:'泸县'
name,
})
props.choseArea = false
emit('offAreaList',areaStore.area.name)
@ -77,6 +77,24 @@ globalEventBus.on('header7', data => {
})
globalEventBus.on('choserArea', data => {
areaStore.changeArea({
areaCode: data.code,
streetCode: null,
name:data.name
})
})
globalEventBus.on('choseTown', data => {
areaStore.changeArea({
areaCode: areaStore.area.areaCode,
streetCode: data.code,
name:data.name
})
router.replace('/townDetail?code=' + data.code)
})
</script>

View File

@ -1,8 +1,9 @@
<template>
<div class="headers">
<div class="logo" >
<img style="width: 33px;height:33px;margin-left: 50px;margin-top: 5px;"
src="/logo.png" alt="">
<!-- <img style="width: 33px;height:33px;margin-left: 50px;margin-top: 5px;"
src="/logo.png" alt=""> -->
<span style="color: red;">{{ areaStore.area }}</span>
</div>
<div class="tab" v-if="role != 1">
<div class="tab-li">