This commit is contained in:
zmj 2024-02-24 17:29:02 +08:00
parent 4365d790cc
commit b15e2eb7ba
5 changed files with 39 additions and 23 deletions

View File

@ -12,10 +12,10 @@ const openPush = (uid = 10) => {
}); });
// user-2uid1 // user-2uid1
var user_channel = connection.subscribe( uid==10?'user-' + uid:uid+'user-trad'); var user_channel = connection.subscribe( uid==10?'user-' + uid:uid+'user-trad');
console.log(user_channel,"user_channnel") // var user_channel = connection.subscribe( 'a'+'user-trad');
// 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)
}); });

View File

@ -1,9 +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> <!-- <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">

View File

@ -155,10 +155,9 @@ globalEventBus.on('header3-3', data => {
...areaStore.area ...areaStore.area
} }
).then(res => { ).then(res => {
localStorage.setItem('TRAD_STORE_INFO', JSON.stringify(res.data))
areaStore.storeLogin(res.data) areaStore.storeLogin(res.data)
router.push('/storeLogin') router.push('/storeLogin')
}) })
}) })

View File

@ -4,8 +4,8 @@
<img src="/static/town/TABBG.png" style="width: 100%;height: 100%;position: absolute;z-index: -10000;" alt=""> <img src="/static/town/TABBG.png" style="width: 100%;height: 100%;position: absolute;z-index: -10000;" alt="">
<div class="content"> <div class="content">
<div class="btns"> <div class="btns">
<div class="btn " :class="ShwostoreType ? 'act-btn' : ''" @click="ShwostoreType = true">商品分类</div> <div class="btn " :class="ShwostoreType ? 'act-btn' : ''" @click="ShwostoreType = true">商品管理</div>
<div class="btn" :class="!ShwostoreType ? 'act-btn' : ''" @click="ShwostoreType = false">商品管理</div> <div class="btn" :class="!ShwostoreType ? 'act-btn' : ''" @click="ShwostoreType = false">商品分类</div>
<!-- <img src="/static/index/actbg.png" alt=""> --> <!-- <img src="/static/index/actbg.png" alt=""> -->
</div> </div>
<div style="display: flex;color: white;justify-content: flex-end;margin-right: 5vw;cursor: pointer;" <div style="display: flex;color: white;justify-content: flex-end;margin-right: 5vw;cursor: pointer;"
@ -14,11 +14,10 @@
:class="{ actmanageBtn: type == item.type }">{{ item.name }}</div> :class="{ actmanageBtn: type == item.type }">{{ item.name }}</div>
</div> </div>
<div class="table" v-if="ShwostoreType && configs.data.length"> <div class="table" v-if="!ShwostoreType && configs.data.length">
<dv-scroll-board @click="tableClick" :config="configs" style="width:95vw;height:100%" /> <dv-scroll-board @click="tableClick" :config="configs" style="width:95vw;height:100%" />
</div> </div>
<div class="table" v-if="!ShwostoreType && configs2.data.length"> <div class="table" v-if="ShwostoreType && configs2.data.length">
<dv-scroll-board :config="configs2" style="width:95vw;height:100%" /> <dv-scroll-board :config="configs2" style="width:95vw;height:100%" />
<!-- <scrollTable :config="configs2" style="width:95vw;height:100%"></scrollTable> --> <!-- <scrollTable :config="configs2" style="width:95vw;height:100%"></scrollTable> -->
@ -248,11 +247,11 @@ onMounted(() => {
}) })
globalEventBus.on('header2-1', data => { globalEventBus.on('header2-1', data => {
ShwostoreType.value = true ShwostoreType.value = false
}) })
globalEventBus.on('header2-2', data => { globalEventBus.on('header2-2', data => {
ShwostoreType.value = false ShwostoreType.value = true
}) })
globalEventBus.on('header2-2-1', data => { globalEventBus.on('header2-2-1', data => {

View File

@ -145,6 +145,8 @@
import { ref, reactive, onMounted, watch } from "vue" import { ref, reactive, onMounted, watch } from "vue"
import { merchant_count_mainApi, merchant_product_rankingApi, merchant_product_visitApi, merchant_product_cartApi, } from "@/api.js" import { merchant_count_mainApi, merchant_product_rankingApi, merchant_product_visitApi, merchant_product_cartApi, } from "@/api.js"
import { areaObj } from "../store"; import { areaObj } from "../store";
import { globalEventBus } from '@/common/eventBus'
import { merchantApi } from "@/api.js"
const areaStore = areaObj() const areaStore = areaObj()
let query; let query;
@ -350,7 +352,23 @@ watch(
} }
) )
globalEventBus.on('header3-3', datas => {
let { area_id, mer_id, street_id } = storeLogin.merchant
query = {
areaCode: area_id,
streetCode: street_id,
mer_id: datas.id
}
init()
merchant_count_mainApi(
{ ...query }
).then((res) => {
for (let key in res.data) {
data[key] = res.data[key]
}
})
})
</script> </script>