下班
This commit is contained in:
parent
4365d790cc
commit
b15e2eb7ba
@ -12,10 +12,10 @@ const openPush = (uid = 10) => {
|
|||||||
});
|
});
|
||||||
// 浏览器监听user-2频道的消息,也就是用户uid为1的用户消息
|
// 浏览器监听user-2频道的消息,也就是用户uid为1的用户消息
|
||||||
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-2频道有message事件的消息时
|
// 当user-2频道有message事件的消息时
|
||||||
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)
|
||||||
|
|
||||||
});
|
});
|
||||||
|
@ -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">
|
||||||
|
@ -68,7 +68,7 @@ const hdClick = (e) => {
|
|||||||
...areaStore.area
|
...areaStore.area
|
||||||
}
|
}
|
||||||
).then(res => {
|
).then(res => {
|
||||||
localStorage.setItem('TRAD_STORE_INFO',JSON.stringify(res.data) )
|
localStorage.setItem('TRAD_STORE_INFO', JSON.stringify(res.data))
|
||||||
areaStore.storeLogin(res.data)
|
areaStore.storeLogin(res.data)
|
||||||
router.push('/storeLogin')
|
router.push('/storeLogin')
|
||||||
})
|
})
|
||||||
@ -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')
|
||||||
|
|
||||||
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -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 => {
|
||||||
|
@ -145,11 +145,13 @@
|
|||||||
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;
|
||||||
let userInfo = JSON.parse(localStorage.getItem('TRADE_USER'));
|
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) {
|
if (areaStore.userInfo.user?.merchant) {
|
||||||
let { area_id, mer_id, street_id } = 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){
|
if (storeLogin?.merchant) {
|
||||||
let { area_id, mer_id, street_id } =storeLogin.merchant
|
let { area_id, mer_id, street_id } = storeLogin.merchant
|
||||||
query = {
|
query = {
|
||||||
areaCode: area_id,
|
areaCode: area_id,
|
||||||
streetCode: street_id,
|
streetCode: street_id,
|
||||||
@ -274,7 +276,7 @@ const init = () => {
|
|||||||
init()
|
init()
|
||||||
|
|
||||||
const addData1 = (data) => {
|
const addData1 = (data) => {
|
||||||
config1.data.splice(0,99999999)
|
config1.data.splice(0, 99999999)
|
||||||
data.forEach((item, i) => {
|
data.forEach((item, i) => {
|
||||||
config1.data.push(
|
config1.data.push(
|
||||||
[
|
[
|
||||||
@ -293,7 +295,7 @@ const addData1 = (data) => {
|
|||||||
|
|
||||||
}
|
}
|
||||||
const addData2 = (data) => {
|
const addData2 = (data) => {
|
||||||
config2.data.splice(0,99999999)
|
config2.data.splice(0, 99999999)
|
||||||
|
|
||||||
data.forEach((item, i) => {
|
data.forEach((item, i) => {
|
||||||
config2.data.push(
|
config2.data.push(
|
||||||
@ -313,8 +315,8 @@ const addData2 = (data) => {
|
|||||||
|
|
||||||
}
|
}
|
||||||
const addData3 = (data) => {
|
const addData3 = (data) => {
|
||||||
|
|
||||||
config3.data.splice(0,99999999)
|
config3.data.splice(0, 99999999)
|
||||||
data.forEach((item, i) => {
|
data.forEach((item, i) => {
|
||||||
config3.data.push(
|
config3.data.push(
|
||||||
[
|
[
|
||||||
@ -342,7 +344,7 @@ merchant_count_mainApi(
|
|||||||
watch(
|
watch(
|
||||||
() => areaStore.time,
|
() => areaStore.time,
|
||||||
(value, oldValue) => {
|
(value, oldValue) => {
|
||||||
init()
|
init()
|
||||||
|
|
||||||
}, {
|
}, {
|
||||||
deep: true,
|
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>
|
</script>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user