4
This commit is contained in:
@@ -1,6 +1,4 @@
|
||||
import {
|
||||
v4 as uuidv4
|
||||
} from "uuid";
|
||||
import {v4 as uuidv4} from "uuid";
|
||||
import IMSDK from "openim-uniapp-polyfill";
|
||||
|
||||
const state = {
|
||||
@@ -46,14 +44,9 @@ const mutations = {
|
||||
};
|
||||
|
||||
const actions = {
|
||||
async getConversationList({
|
||||
state,
|
||||
commit
|
||||
}, isFirstPage = true) {
|
||||
async getConversationList({state,commit}, isFirstPage = true) {
|
||||
try {
|
||||
const {
|
||||
data
|
||||
} = await IMSDK.asyncApi(
|
||||
const {data} = await IMSDK.asyncApi(
|
||||
IMSDK.IMMethods.GetConversationListSplit,
|
||||
uuidv4(), {
|
||||
offset: isFirstPage ? 0 : state.conversationList.length,
|
||||
@@ -71,9 +64,7 @@ const actions = {
|
||||
return [];
|
||||
}
|
||||
},
|
||||
getCurrentGroup({
|
||||
commit
|
||||
}, groupID) {
|
||||
getCurrentGroup({commit}, groupID) {
|
||||
IMSDK.asyncApi(IMSDK.IMMethods.GetSpecifiedGroupsInfo, uuidv4(), [
|
||||
groupID,
|
||||
]).then(({
|
||||
@@ -82,10 +73,7 @@ const actions = {
|
||||
commit("SET_CURRENT_GROUP", data[0] ?? {});
|
||||
});
|
||||
},
|
||||
getCurrentMemberInGroup({
|
||||
commit,
|
||||
rootState
|
||||
}, groupID) {
|
||||
getCurrentMemberInGroup({commit,rootState}, groupID) {
|
||||
IMSDK.asyncApi(IMSDK.IMMethods.GetSpecifiedGroupMembersInfo, uuidv4(), {
|
||||
groupID,
|
||||
userIDList: [rootState.user.selfInfo.userID],
|
||||
@@ -95,20 +83,15 @@ const actions = {
|
||||
commit("SET_CURRENT_MEMBER_IN_GROUP", data[0] ?? {});
|
||||
});
|
||||
},
|
||||
getUnReadCount({
|
||||
commit
|
||||
}) {
|
||||
getUnReadCount({commit}) {
|
||||
IMSDK.asyncApi(IMSDK.IMMethods.GetTotalUnreadMsgCount, uuidv4()).then(
|
||||
(res) => {
|
||||
console.log(res);
|
||||
//console.log(res);
|
||||
commit("SET_UNREAD_COUNT", res.data);
|
||||
},
|
||||
);
|
||||
},
|
||||
updateCurrentMemberInGroup({
|
||||
commit,
|
||||
state
|
||||
}, memberInfo) {
|
||||
updateCurrentMemberInGroup({commit,state}, memberInfo) {
|
||||
console.log(memberInfo);
|
||||
if (
|
||||
memberInfo.groupID === state.currentMemberInGroup.groupID &&
|
||||
|
||||
Reference in New Issue
Block a user