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({ var connection = new Push({
url: 'wss://chat.lihaink.cn/tts', // websocket url: 'wss://chat.lihaink.cn/tts', // websocket
app_key: 'aaea61749929eb53a4bd75a1474c1d27', app_key: 'aaea61749929eb53a4bd75a1474c1d27',
}); });
// uid1 // user-2uid1
var uid = 10; var user_channel = connection.subscribe( uid==10?'user-' + uid:uid+'user-trad');
// user-2uid1 console.log(user_channel,"user_channnel")
var user_channel = connection.subscribe('user-' + uid);
// user-2message // user-2message
user_channel.on('message', function (data) { user_channel.on('message', function (data) {
console.log("收到消息",data)
globalEventBus.emit(data.content.event, data.content.data) globalEventBus.emit(data.content.event, data.content.data)
}); });
// 线 // 线
user_channel.on('close', function () { user_channel.on('close', function () {
}); });
} }
const areaStroe = areaObj() const areaStroe = areaObj()
@ -57,7 +55,28 @@ if (localStorage.getItem("TRADE_USER")) {
areaStroe.changeArea({ areaCode: area_code, streetCode: street_code }) 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> </script>
<template> <template>

View File

@ -42,15 +42,15 @@ const choseTownFn = (id, name) => {
} }
} }
// x //
const choseAreaFn = () => { const choseAreaFn = (name='泸县') => {
if(isMainScreen){ if(isMainScreen){
sendFn('header6', { name: "泸县", code: 0 }) sendFn('header6', { name: "泸县", code: 0 })
}else{ }else{
areaStore.changeArea({ areaStore.changeArea({
areaCode: areaStore.area.areaCode, areaCode: areaStore.area.areaCode,
streetCode: null, streetCode: null,
name:'泸县' name,
}) })
props.choseArea = false props.choseArea = false
emit('offAreaList',areaStore.area.name) 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> </script>

View File

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