更新
Showing
3 changed files
with
12 additions
and
9 deletions
| ... | @@ -43,14 +43,10 @@ export default { | ... | @@ -43,14 +43,10 @@ export default { |
| 43 | currentConversation: state => state.conversation.currentConversation, | 43 | currentConversation: state => state.conversation.currentConversation, |
| 44 | currentMemberList: state => state.group.currentMemberList, | 44 | currentMemberList: state => state.group.currentMemberList, |
| 45 | currentUnMemberList: state => state.group.currentUnMemberList, | 45 | currentUnMemberList: state => state.group.currentUnMemberList, |
| 46 | currentUnMemberTotal: state => state.group.currentUnMemberMeta.total | 46 | currentUnMemberTotal: state => state.group.currentUnMemberMeta.total, |
| 47 | currentUnMemberMeta: state => state.group.currentUnMemberMeta, | ||
| 47 | }), | 48 | }), |
| 48 | }, | 49 | }, |
| 49 | data() { | ||
| 50 | return { | ||
| 51 | list: [] | ||
| 52 | } | ||
| 53 | }, | ||
| 54 | methods: { | 50 | methods: { |
| 55 | addGroupMember(user) { | 51 | addGroupMember(user) { |
| 56 | const groupID = this.currentConversation.conversationID.replace('GROUP', '') | 52 | const groupID = this.currentConversation.conversationID.replace('GROUP', '') |
| ... | @@ -60,6 +56,7 @@ export default { | ... | @@ -60,6 +56,7 @@ export default { |
| 60 | .then(({data: {memberList}}) => { | 56 | .then(({data: {memberList}}) => { |
| 61 | this.$store.commit('updateCurrentMemberList', memberList) | 57 | this.$store.commit('updateCurrentMemberList', memberList) |
| 62 | this.$store.commit('deleteGroupUnMember', user.esm_id) | 58 | this.$store.commit('deleteGroupUnMember', user.esm_id) |
| 59 | this.$store.commit('updateCurrentUnMemberMeta', Object.assign(this.currentUnMemberMeta, {total: this.currentUnMemberTotal + 1})) | ||
| 63 | }) | 60 | }) |
| 64 | }) | 61 | }) |
| 65 | // this.tim | 62 | // this.tim | ... | ... |
| ... | @@ -144,7 +144,11 @@ export default { | ... | @@ -144,7 +144,11 @@ export default { |
| 144 | Helper.groupMemberDelete(this.currentConversation.groupProfile.groupID, this.member.userID) | 144 | Helper.groupMemberDelete(this.currentConversation.groupProfile.groupID, this.member.userID) |
| 145 | .then(() => { | 145 | .then(() => { |
| 146 | this.$store.commit('deleteGroupMember', this.member.userID) | 146 | this.$store.commit('deleteGroupMember', this.member.userID) |
| 147 | this.$store.commit('updateCurrentUnMemberList', [this.member]) | 147 | this.$store.commit('updateCurrentUnMemberList', [{ |
| 148 | esm_id: this.member.userID, | ||
| 149 | name: this.member.nick, | ||
| 150 | avatar: this.member.avatar | ||
| 151 | }]) | ||
| 148 | }).catch(error => { | 152 | }).catch(error => { |
| 149 | this.$store.commit('showMessage', { | 153 | this.$store.commit('showMessage', { |
| 150 | type: 'error', | 154 | type: 'error', | ... | ... |
| ... | @@ -35,10 +35,12 @@ const groupModules = { | ... | @@ -35,10 +35,12 @@ const groupModules = { |
| 35 | state.currentMemberList = state.currentMemberList.filter((member) => !userIDList.includes(member.userID)) | 35 | state.currentMemberList = state.currentMemberList.filter((member) => !userIDList.includes(member.userID)) |
| 36 | }, | 36 | }, |
| 37 | deleteGroupUnMember(state, userID) { | 37 | deleteGroupUnMember(state, userID) { |
| 38 | state.currentUnMemberList = state.currentUnMemberList.filter((member) => member.userID !== userID) | 38 | console.log(userID) |
| 39 | console.log(state.currentUnMemberList.filter((member) => member.userID !== userID)) | ||
| 40 | state.currentUnMemberList = state.currentUnMemberList.filter((member) => member.esm_id !== userID) | ||
| 39 | }, | 41 | }, |
| 40 | deleteGroupUnMemberList(state, userIDList) { | 42 | deleteGroupUnMemberList(state, userIDList) { |
| 41 | state.currentUnMemberList = state.currentUnMemberList.filter((member) => !userIDList.includes(member.userID)) | 43 | state.currentUnMemberList = state.currentUnMemberList.filter((member) => !userIDList.includes(member.esm_id)) |
| 42 | }, | 44 | }, |
| 43 | resetCurrentMemberList(state) { | 45 | resetCurrentMemberList(state) { |
| 44 | state.currentMemberList = [] | 46 | state.currentMemberList = [] | ... | ... |
-
Please register or sign in to post a comment