This commit is contained in:
cansnow
2026-01-15 22:50:35 +08:00
parent dd16348558
commit db99bebcb4
26 changed files with 433 additions and 284 deletions
+11 -10
View File
@@ -11,16 +11,6 @@ const mutations = {
},
SET_UNREAD_COUNT(state, count) {
state.unread_count = count;
if(count<1){
uni.removeTabBarBadge({
index:2
})
}else{
uni.setTabBarBadge({
index:2,
text:count
})
}
},
SET_TOP_UNREAD_ITEMS(state, data) {
state.top_unread_items = [...data];
@@ -102,6 +92,17 @@ const actions = {
async updateUnreadCount({commit,state},v) {
commit("SET_UNREAD_COUNT", state.unread_count+v);
},
async deleteFriendCircleList({commit,state},params){
uni.$u.http.post('/friendcircle/delete',params).then(res=>{
var list = state.list.filter(item=>{
return item.id!=params.id;
})
commit("SET_LIST", list);
}).catch(e=>{
console.log(e);
uni.$u.toast(typeof e == Object ? e?.msg : e);
})
}
};
export default {
+8 -11
View File
@@ -29,22 +29,14 @@ const mutations = {
state.recvFriendApplications = [...list];
const count = list.filter((item) => item.handleResult === 0);
state.unHandleFriendApplicationNum = count.length;
if(state.unHandleFriendApplicationNum>0){
uni.setTabBarBadge({
index:1,
text:(state.unHandleFriendApplicationNum<100?state.unHandleFriendApplicationNum:'···')+'',
});
}else{
uni.hideTabBarRedDot({
index:1
})
}
},
SET_SENT_FRIEND_APPLICATIONS(state, list) {
state.sentFriendApplications = [...list];
},
SET_RECV_GROUP_APPLICATIONS(state, list) {
state.recvGroupApplications = [...list];
const count = list.filter((item) => item.handleResult === 0);
state.unHandleGroupApplicationNum = count.length;
},
SET_SENT_GROUP_APPLICATIONS(state, list) {
state.sentGroupApplications = [...list];
@@ -135,7 +127,7 @@ const actions = {
commit("SET_SENT_FRIEND_APPLICATIONS", data);
});
},
getRecvGroupApplications({ commit }) {
getRecvGroupApplications({ commit,state}) {
//#ifndef APP
return [];
//#endif
@@ -244,6 +236,7 @@ const actions = {
commit("SET_RECV_FRIEND_APPLICATIONS", [...tmpList, application]);
},
updateRecvFriendApplition({commit,state,rootState}, {application,isRemove = false}, ) {
console.log(application);
const tmpList = [...state.recvFriendApplications];
const idx = tmpList.findIndex(
(item) => item.fromUserID === application.fromUserID,
@@ -294,6 +287,10 @@ const actions = {
tmpList.splice(idx, 1);
}
commit("SET_RECV_GROUP_APPLICATIONS", [...tmpList, application]);
// const newList = state.recvGroupApplications.filter((item)=>{
// item.userID !== application.userID
// });
// commit("SET_RECV_GROUP_APPLICATIONS", [...newList, application]);
},
updateRecvGroupApplition({commit,state,rootState}, {application,isRemove = false}, ) {
const tmpList = [...state.recvGroupApplications];
-10
View File
@@ -19,16 +19,6 @@ const mutations = {
};
},
SET_UNREAD_COUNT(state, count) {
if (count>0) {
uni.setTabBarBadge({
index: 0,
text: count < 99 ? count + "" : "99+",
});
} else {
uni.removeTabBarBadge({
index: 0,
});
}
state.unReadCount = count;
},
SET_CURRENT_GROUP(state, group) {