mirror of
https://gitee.com/beijing_hongye_huicheng/lilishop-ui.git
synced 2025-12-18 00:45:54 +08:00
pc发布商品不显示IM
This commit is contained in:
@@ -27,7 +27,7 @@ export default {
|
||||
},
|
||||
mutations: {
|
||||
// 更新对话
|
||||
UPDATE_DIALOGUE_MESSAGE(state, resource) {
|
||||
UPDATE_DIALOGUE_MESSAGE (state, resource) {
|
||||
state.records = [];
|
||||
state.talk_type = parseInt(resource.talk_type);
|
||||
state.receiver_id = parseInt(resource.receiver_id);
|
||||
@@ -41,26 +41,26 @@ export default {
|
||||
},
|
||||
|
||||
// 数组头部压入对话记录1494593861786271744 1494593778193793024
|
||||
UNSHIFT_DIALOGUE(state, records) {
|
||||
UNSHIFT_DIALOGUE (state, records) {
|
||||
// console.log("%c 数组头部压入对话记录", "color:green");
|
||||
// console.log("state", state);
|
||||
// console.log("records", records);
|
||||
if(state.records.length>0){
|
||||
if (state.records.length > 0) {
|
||||
state.records.unshift(...records);
|
||||
}else{
|
||||
} else {
|
||||
state.records.push(...records);
|
||||
}
|
||||
|
||||
console.log("最后的数据",state.records)
|
||||
|
||||
// console.log("最后的数据",state.records)
|
||||
},
|
||||
|
||||
// 推送对话记录
|
||||
PUSH_DIALOGUE(state, record) {
|
||||
PUSH_DIALOGUE (state, record) {
|
||||
state.records.push(record);
|
||||
},
|
||||
|
||||
// 更新对话记录
|
||||
UPDATE_DIALOGUE(state, resource) {
|
||||
UPDATE_DIALOGUE (state, resource) {
|
||||
for (let i in state.records) {
|
||||
if (state.records[i].id === resource.id) {
|
||||
Object.assign(state.records[i], resource);
|
||||
@@ -70,11 +70,11 @@ export default {
|
||||
},
|
||||
|
||||
// 删除对话记录
|
||||
DELETE_DIALOGUE(state, index) {
|
||||
DELETE_DIALOGUE (state, index) {
|
||||
state.records.splice(index, 1);
|
||||
},
|
||||
|
||||
BATCH_DELETE_DIALOGUE(state, ids) {
|
||||
BATCH_DELETE_DIALOGUE (state, ids) {
|
||||
ids.forEach((record_id) => {
|
||||
let index = state.records.findIndex((item) => item.id == record_id);
|
||||
if (index >= 0) state.records.splice(index, 1);
|
||||
@@ -82,7 +82,7 @@ export default {
|
||||
},
|
||||
|
||||
// 数组头部压入对话记录
|
||||
SET_DIALOGUE(state, records) {
|
||||
SET_DIALOGUE (state, records) {
|
||||
state.records = records;
|
||||
},
|
||||
},
|
||||
|
||||
@@ -21,6 +21,7 @@ const Talk = {
|
||||
getters: {
|
||||
// 过滤所有置顶对话列表
|
||||
topItems: (state) => {
|
||||
console.log(state.items, 'state.items');
|
||||
return state.items.filter((item) => item.is_top == 1);
|
||||
},
|
||||
talkItems: (state) => {
|
||||
@@ -38,18 +39,18 @@ const Talk = {
|
||||
},
|
||||
mutations: {
|
||||
// 设置对话列表
|
||||
SET_TALK_ITEMS(state, resource) {
|
||||
SET_TALK_ITEMS (state, resource) {
|
||||
console.log("设置对话列表", resource.items);
|
||||
Vue.set(state,'items',resource.items)
|
||||
Vue.set(state, 'items', resource.items)
|
||||
},
|
||||
|
||||
// 更新对话节点
|
||||
UPDATE_TALK_ITEM(state, resource) {
|
||||
console.log("%c 更新对话节点", "color:#32c");
|
||||
console.log("state", state);
|
||||
console.log("resource", resource);
|
||||
UPDATE_TALK_ITEM (state, resource) {
|
||||
// console.log("%c 更新对话节点", "color:#32c");
|
||||
// console.log("state", state);
|
||||
// console.log("resource", resource);
|
||||
|
||||
console.log("%c 更新对话节点结束", "color:#32c",state.items);
|
||||
// console.log("%c 更新对话节点结束", "color:#32c",state.items);
|
||||
let index = state.items.findIndex(
|
||||
(item) => item.userId === resource.index_name.split("_")[1]
|
||||
);
|
||||
@@ -59,13 +60,13 @@ const Talk = {
|
||||
},
|
||||
|
||||
// 新增对话节点
|
||||
PUSH_TALK_ITEM(state, resource) {
|
||||
console.log(state)
|
||||
PUSH_TALK_ITEM (state, resource) {
|
||||
// console.log(state)
|
||||
state.items.push(resource);
|
||||
},
|
||||
|
||||
// 移除对话节点
|
||||
REMOVE_TALK_ITEM(state, index_name) {
|
||||
REMOVE_TALK_ITEM (state, index_name) {
|
||||
for (let i in state.items) {
|
||||
if (state.items[i].index_name === index_name) {
|
||||
state.items.splice(i, 1);
|
||||
@@ -84,17 +85,15 @@ const Talk = {
|
||||
// },
|
||||
|
||||
// 更新对话消息
|
||||
UPDATE_TALK_MESSAGE(state, resource) {
|
||||
console.log("%c 更新对话消息", "color:green");
|
||||
|
||||
|
||||
console.log("state", state);
|
||||
console.log("resource", resource);
|
||||
console.log("%c 更新对话结束", "color:green",state.items);
|
||||
UPDATE_TALK_MESSAGE (state, resource) {
|
||||
// console.log("%c 更新对话消息", "color:green");
|
||||
// console.log("state", state);
|
||||
// console.log("resource", resource);
|
||||
// console.log("%c 更新对话结束", "color:green",state.items);
|
||||
|
||||
let enableGetTalkList = true
|
||||
state.items.forEach(item=>{
|
||||
if(item.userId == resource.index_name.split("_")[1]){
|
||||
state.items.forEach(item => {
|
||||
if (item.userId == resource.index_name.split("_")[1]) {
|
||||
item.unread++;
|
||||
item.msg_text = resource.msg_text;
|
||||
item.lastTalkTime = resource.updated_at;
|
||||
@@ -104,22 +103,22 @@ const Talk = {
|
||||
}
|
||||
})
|
||||
// 循环如果当前用户不在对话记录列表中 就重新请求对话列表接口
|
||||
enableGetTalkList ? this.commit('getTalkList'):''
|
||||
enableGetTalkList ? this.commit('getTalkList') : ''
|
||||
},
|
||||
|
||||
// 触发对话列表重新加载
|
||||
TRIGGER_TALK_ITEMS_LOAD(state, status = false) {
|
||||
TRIGGER_TALK_ITEMS_LOAD (state, status = false) {
|
||||
state.heavyLoad = status;
|
||||
},
|
||||
|
||||
SET_TLAK_UNREAD_MESSAGE(state, resource) {
|
||||
SET_TLAK_UNREAD_MESSAGE (state, resource) {
|
||||
state.unreadMessage.num++;
|
||||
state.unreadMessage.nickname = resource.nickname;
|
||||
state.unreadMessage.content = resource.content;
|
||||
},
|
||||
|
||||
// 清除最后一条未读消息
|
||||
CLEAR_TLAK_UNREAD_MESSAGE(state) {
|
||||
CLEAR_TLAK_UNREAD_MESSAGE (state) {
|
||||
state.unreadMessage = {
|
||||
num: 0,
|
||||
nickname: "未知",
|
||||
|
||||
Reference in New Issue
Block a user