This commit is contained in:
cansnow
2025-12-05 16:10:52 +08:00
parent 29be534f22
commit 69a61178e1
64 changed files with 2575 additions and 1141 deletions
+4 -3
View File
@@ -6,7 +6,7 @@ const state = {
};
const mutations = {
SET_LIST(state, info) {
SET_LIST(state, list) {
state.list = [...list];
},
SET_UNREAD_COUNT(state, count) {
@@ -35,7 +35,8 @@ const actions = {
uni.$u.http.get('/friendcircle/list',params).then(res=>{
commit("SET_LIST", res.data);
}).catch(e=>{
uni.$u.toast("获取个人信息失败");
console.log(e);
uni.$u.toast("获取信息失败");
})
},
async getFriendCircleInfo({ commit, state}) {
@@ -44,7 +45,7 @@ const actions = {
commit("SET_LAST_UNREAD", data.last_unread_item);
commit("SET_SETTINGS", data.settings);
}).catch(e=>{
uni.$u.toast("获取个人信息失败");
uni.$u.toast("获取信息失败");
})
},
async updateUnreadCount({commit,state},v) {
+7 -26
View File
@@ -24,22 +24,16 @@ const mutations = {
};
const actions = {
async getHistoryMesageList({
commit,
state
}, params) {
async getHistoryMesageList({commit,state}, params) {
let emptyFlag = true;
try {
console.log("getHistoryMesageList:::");
console.log(params);
const {
data
} = await IMSDK.asyncApi(
//console.log(params);
const {data} = await IMSDK.asyncApi(
IMSDK.IMMethods.GetAdvancedHistoryMessageList,
uuidv4(),
params,
);
console.log(data);
//console.log(data);
const isFistPage = !params.startClientMsgID
const messages = data.messageList ?? [];
emptyFlag = messages.length === 0;
@@ -55,21 +49,10 @@ const actions = {
emptyFlag,
};
},
pushNewMessage({
commit,
state
}, message) {
pushNewMessage({commit,state}, message) {
commit("SET_HISTORY_MESSAGE_LIST", [...state.historyMessageList, message]);
},
updateOneMessage({
commit,
state
}, {
message,
type = UpdateMessageTypes.Overall,
keyWords = [],
isSuccess = false,
}, ) {
updateOneMessage({commit,state}, {message,type = UpdateMessageTypes.Overall,keyWords = [],isSuccess = false,}, ) {
const tmpList = state.historyMessageList;
const idx = tmpList.findIndex(
(msg) => msg.clientMsgID === message.clientMsgID,
@@ -88,9 +71,7 @@ const actions = {
commit("SET_HISTORY_MESSAGE_LIST", tmpList);
}
},
resetMessageState({
commit
}) {
resetMessageState({commit}) {
commit("SET_HISTORY_MESSAGE_LIST", []);
commit("SET_HAS_MORE_MESSAGE", true);
},