第一次提交

This commit is contained in:
gxwebsoft
2023-08-04 13:14:48 +08:00
commit 1b923e5cff
1030 changed files with 128016 additions and 0 deletions

37
store/getters.js Executable file
View File

@@ -0,0 +1,37 @@
const getters = {
storeId: state => state.app.storeId,
platform: state => state.app.platform,
token: state => state.user.token,
userId: state => state.user.userId,
userInfo: state => state.user.userInfo,
refereeId: state => state.app.refereeId,
appTheme: state => state.theme.appTheme,
socket: state => state.chat.socket,
conversations: state => state.chat.conversations,
conversationArr: state => {
const keys = Object.keys(state.chat.conversations)
const arr = keys.map(item=>{
return state.chat.conversations[item]
})
arr.sort((a, b) => {
return new Date(b.updateTime) - new Date(a.updateTime)
})
return arr
},
friends: state=> state.chat.friends,
unReadMessageCount: state => {
let count = 0;
const friendIds = Object.keys(state.chat.conversations);
for (let i = 0; i < friendIds.length; i++) {
count += state.chat.conversations[friendIds[i]].unRead
}
return count
},
unReadCommentNumber: state => state.chat.unReadCommentNumber,
unReadLikeNumber: state => state.chat.unReadLikeNumber,
unReadLikeMeNumber: state => state.chat.unReadLikeMeNumber,
unReadLookNumber: state => state.chat.unReadLookNumber,
}
export default getters