This commit is contained in:
parent
4365d790cc
commit
b15e2eb7ba
|
@ -12,10 +12,10 @@ const openPush = (uid = 10) => {
|
|||
});
|
||||
// 浏览器监听user-2频道的消息,也就是用户uid为1的用户消息
|
||||
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-2频道有message事件的消息时
|
||||
user_channel.on('message', function (data) {
|
||||
console.log("收到事件",data)
|
||||
globalEventBus.emit(data.content.event, data.content.data)
|
||||
|
||||
});
|
||||
|
|
|
@ -1,9 +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=""> -->
|
||||
<span style="color: red;">{{ areaStore.area }}</span>
|
||||
<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">
|
||||
|
|
|
@ -68,7 +68,7 @@ const hdClick = (e) => {
|
|||
...areaStore.area
|
||||
}
|
||||
).then(res => {
|
||||
localStorage.setItem('TRAD_STORE_INFO',JSON.stringify(res.data) )
|
||||
localStorage.setItem('TRAD_STORE_INFO', JSON.stringify(res.data))
|
||||
areaStore.storeLogin(res.data)
|
||||
router.push('/storeLogin')
|
||||
})
|
||||
|
@ -155,10 +155,9 @@ globalEventBus.on('header3-3', data => {
|
|||
...areaStore.area
|
||||
}
|
||||
).then(res => {
|
||||
localStorage.setItem('TRAD_STORE_INFO', JSON.stringify(res.data))
|
||||
areaStore.storeLogin(res.data)
|
||||
router.push('/storeLogin')
|
||||
|
||||
|
||||
})
|
||||
})
|
||||
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
<img src="/static/town/TABBG.png" style="width: 100%;height: 100%;position: absolute;z-index: -10000;" alt="">
|
||||
<div class="content">
|
||||
<div class="btns">
|
||||
<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 = true">商品管理</div>
|
||||
<div class="btn" :class="!ShwostoreType ? 'act-btn' : ''" @click="ShwostoreType = false">商品分类</div>
|
||||
<!-- <img src="/static/index/actbg.png" alt=""> -->
|
||||
</div>
|
||||
<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>
|
||||
|
||||
</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%" />
|
||||
</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%" />
|
||||
<!-- <scrollTable :config="configs2" style="width:95vw;height:100%"></scrollTable> -->
|
||||
|
||||
|
@ -248,11 +247,11 @@ onMounted(() => {
|
|||
|
||||
})
|
||||
globalEventBus.on('header2-1', data => {
|
||||
ShwostoreType.value = true
|
||||
ShwostoreType.value = false
|
||||
|
||||
})
|
||||
globalEventBus.on('header2-2', data => {
|
||||
ShwostoreType.value = false
|
||||
ShwostoreType.value = true
|
||||
|
||||
})
|
||||
globalEventBus.on('header2-2-1', data => {
|
||||
|
|
|
@ -145,11 +145,13 @@
|
|||
import { ref, reactive, onMounted, watch } from "vue"
|
||||
import { merchant_count_mainApi, merchant_product_rankingApi, merchant_product_visitApi, merchant_product_cartApi, } from "@/api.js"
|
||||
import { areaObj } from "../store";
|
||||
import { globalEventBus } from '@/common/eventBus'
|
||||
import { merchantApi } from "@/api.js"
|
||||
|
||||
const areaStore = areaObj()
|
||||
let query;
|
||||
let userInfo = JSON.parse(localStorage.getItem('TRADE_USER'));
|
||||
let storeLogin=JSON.parse(localStorage.getItem('TRAD_STORE_INFO'))
|
||||
let storeLogin = JSON.parse(localStorage.getItem('TRAD_STORE_INFO'))
|
||||
|
||||
if (areaStore.userInfo.user?.merchant) {
|
||||
let { area_id, mer_id, street_id } = areaStore.userInfo.user?.merchant
|
||||
|
@ -169,8 +171,8 @@ if (userInfo.user?.merchant) {
|
|||
}
|
||||
}
|
||||
|
||||
if(storeLogin?.merchant){
|
||||
let { area_id, mer_id, street_id } =storeLogin.merchant
|
||||
if (storeLogin?.merchant) {
|
||||
let { area_id, mer_id, street_id } = storeLogin.merchant
|
||||
query = {
|
||||
areaCode: area_id,
|
||||
streetCode: street_id,
|
||||
|
@ -274,7 +276,7 @@ const init = () => {
|
|||
init()
|
||||
|
||||
const addData1 = (data) => {
|
||||
config1.data.splice(0,99999999)
|
||||
config1.data.splice(0, 99999999)
|
||||
data.forEach((item, i) => {
|
||||
config1.data.push(
|
||||
[
|
||||
|
@ -293,7 +295,7 @@ const addData1 = (data) => {
|
|||
|
||||
}
|
||||
const addData2 = (data) => {
|
||||
config2.data.splice(0,99999999)
|
||||
config2.data.splice(0, 99999999)
|
||||
|
||||
data.forEach((item, i) => {
|
||||
config2.data.push(
|
||||
|
@ -314,7 +316,7 @@ const addData2 = (data) => {
|
|||
}
|
||||
const addData3 = (data) => {
|
||||
|
||||
config3.data.splice(0,99999999)
|
||||
config3.data.splice(0, 99999999)
|
||||
data.forEach((item, i) => {
|
||||
config3.data.push(
|
||||
[
|
||||
|
@ -342,7 +344,7 @@ merchant_count_mainApi(
|
|||
watch(
|
||||
() => areaStore.time,
|
||||
(value, oldValue) => {
|
||||
init()
|
||||
init()
|
||||
|
||||
}, {
|
||||
deep: true,
|
||||
|
@ -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>
|
||||
|
||||
|
|
Loading…
Reference in New Issue