diff --git a/src/app.wpy b/src/app.wpy
index 9932905..21bf44b 100644
--- a/src/app.wpy
+++ b/src/app.wpy
@@ -35,7 +35,7 @@ wepy.app({
}
},
globalData: {
- versions: 'v5.5.74', // 版本号
+ versions: 'v5.5.75', // 版本号
navBarHeight: 0, // 导航栏高度
navRight: 0, // 胶囊距右方间距(方保持左、右间距一致)
navTop: 0, // 胶囊距顶部间距
@@ -180,6 +180,7 @@ subPackages: [
'root': 'pages/news',
'pages': [
'chitchat',
+'editGroupMembers',
'friendRequest',
'groupChitchat',
'groupChitchatDetail',
diff --git a/src/pages/news/editGroupMembers.wpy b/src/pages/news/editGroupMembers.wpy
new file mode 100644
index 0000000..a5ae0dc
--- /dev/null
+++ b/src/pages/news/editGroupMembers.wpy
@@ -0,0 +1,293 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{item.nickname}}
+
+
+
+
+
+
+ 暂无用户信息
+
+ {{type == 'add' ? '确认添加' :'确认删除'}}
+
+
+
+
+
+{
+navigationBarTitleText: '',
+backgroundColorTop: '#ffffff',
+backgroundColorBottom: '#ffffff',
+}
+
diff --git a/src/pages/news/groupChitchat.wpy b/src/pages/news/groupChitchat.wpy
index 246b757..9077cf8 100644
--- a/src/pages/news/groupChitchat.wpy
+++ b/src/pages/news/groupChitchat.wpy
@@ -1000,6 +1000,7 @@ wepy.page({
if (e.to != vm.otherUserId) {
return
}
+ console.log(e, '777')
// 标记IM消息已读
vm.sendMsgReceipt()
if (e.type == 'text' && /\[[^\]]+\]/.test(e.body)) {
@@ -1326,12 +1327,62 @@ wepy.page({
// 群通知消息判断
groupNotification (e) {
let text = ``
- if (e.type == '7' && e.attach.type == 'addTeamMembers') {
- text = `${e.attach.users[1].nick}邀请${e.attach.users[0].nick}加入群`
+ // 内部接口判断邀请加入群
+ if (e.type == '7' && e.body_arr.id == 0) {
+ if (e.body_arr.data.uinfos.length > 2) {
+ text = `${e.body_arr.data.uinfos[e.body_arr.data.uinfos.length - 1][3]}邀请${e.body_arr.data.uinfos[0][3]}等${e.body_arr.data.uinfos.length - 1}人加入群`
+ } else {
+ text = `${e.body_arr.data.uinfos[1][3]}邀请${e.body_arr.data.uinfos[0][3]}加入群`
+ }
}
- if (e.type == '7' && e.attach.type == 'leaveTeam') {
+ // 内部接口判断踢出群
+ if (e.type == '7' && e.body_arr.id == 1) {
+ if (e.body_arr.data.uinfos.length > 2) {
+ text = `${e.body_arr.data.uinfos[e.body_arr.data.uinfos.length - 1][3]}将${e.body_arr.data.uinfos[0][3]}等${e.body_arr.data.uinfos.length - 1}人踢出群`
+ } else {
+ text = `${e.body_arr.data.uinfos[1][3]}将${e.body_arr.data.uinfos[0][3]}踢出群`
+ }
+ }
+ // 内部接口判断退出群聊
+ if (e.type == '7' && e.body_arr.id == 2) {
+ text = `${e.body_arr.data.uinfos[0][3]}退出群`
+ }
+ // 内部接口判断将谁设为管理员
+ if (e.type == '7' && e.body_arr.id == 7) {
+ text = `${e.body_arr.data.uinfos[1][3]}将${e.body_arr.data.uinfos[0][3]}设为管理员`
+ }
+ // 内部接口判断将谁取消管理员
+ if (e.type == '7' && e.body_arr.id == 8) {
+ text = `${e.body_arr.data.uinfos[1][3]}取消${e.body_arr.data.uinfos[0][3]}的管理员身份`
+ }
+ // 网易云信回调邀请进群
+ if (e.type == 'notification' && e.attach.type == 'addTeamMembers') {
+ if (e.attach.users.length > 2) {
+ text = `${e.attach.users[e.attach.users.length - 1].nick}邀请${e.attach.users[0].nick}等${e.attach.users.length - 1}人加入群`
+ } else {
+ text = `${e.attach.users[1].nick}邀请${e.attach.users[0].nick}加入群`
+ }
+ }
+ // 网易云信回调添加管理员身份
+ if (e.type == 'notification' && e.attach.type == 'addTeamManagers') {
+ text = `${e.attach.users[1].nick}将${e.attach.users[0].nick}设为管理员`
+ }
+ // 网易云信回调删除管理员身份
+ if (e.type == 'notification' && e.attach.type == 'removeTeamManagers') {
+ text = `${e.attach.users[1].nick}取消${e.attach.users[0].nick}的管理员身份`
+ }
+ // 网易云信回调离开群
+ if (e.type == 'notification' && e.attach.type == 'leaveTeam') {
text = `${e.attach.users[0].nick}离开群`
}
+ // 网易云信回调踢出群
+ if (e.type == 'notification' && e.attach.type == 'removeTeamMembers') {
+ if (e.attach.users.length > 2) {
+ text = `${e.attach.users[e.attach.users.length - 1].nick}将${e.attach.users[0].nick}等${e.attach.users.length - 1}人踢出群`
+ } else {
+ text = `${e.attach.users[1].nick}将${e.attach.users[0].nick}踢出群`
+ }
+ }
return text
},
// 图片大小计算
diff --git a/src/pages/news/groupChitchatDetail.wpy b/src/pages/news/groupChitchatDetail.wpy
index 547d480..3b8b0fe 100644
--- a/src/pages/news/groupChitchatDetail.wpy
+++ b/src/pages/news/groupChitchatDetail.wpy
@@ -137,14 +137,24 @@ page {
-
+
-
-
-
- {{item.nickname}}
-
-
+
+
+ {{item.nickname}}
+
+
+
+
+
+ --
+
+
+
+
+
+ --
+
@@ -378,7 +388,7 @@ wepy.page({
vm.hidden = !vm.hidden
},
jumpPath(e) {
- wx.navigateTo({url: `/pages/home/information?id=${e.id}`})
+ wx.navigateTo({url: e})
}
},
onLoad(e) {
@@ -404,6 +414,10 @@ wepy.page({
vm.getDetail()
},
onShow() {
+ let vm = this
+ if (vm.id) {
+ vm.getDetail()
+ }
},
created() {
}
diff --git a/src/utils/im.js b/src/utils/im.js
index 609b468..139b07d 100644
--- a/src/utils/im.js
+++ b/src/utils/im.js
@@ -100,8 +100,20 @@ const IM = (account, token) => {
}
// 群消息未读数增加逻辑
let teamCount = wx.getStorageSync('teamsSessionsCount') || []
+ if (e.attach && e.attach.type == 'removeTeamMembers') {
+ teamCount.map((item, index) => {
+ if (item.id == e.to) {
+ teamCount.splice(index, 1)
+ wx.setStorageSync('teamsSessionsCount', teamCount)
+ }
+ })
+ }
+ if (e.attach && e.attach.type == 'addTeamMembers') {
+ teamCount.push({id: e.to, unread: 1})
+ wx.setStorageSync('teamsSessionsCount', teamCount)
+ }
let newTeamCount = teamCount.filter(item => { return item.id == e.to })
- if (e.attach && (e.attach.type === 'leaveTeam' || e.attach.type === 'dismissTeam' || e.attach.type === 'removeTeamMembers' || e.attach.type === 'addTeamMembers')) {
+ if (e.attach && (e.attach.type === 'dismissTeam' || e.attach.type === 'addTeamMembers')) {
} else {
if (newTeamCount.length > 0) {
teamCount = teamCount.map(item => {
@@ -116,39 +128,36 @@ const IM = (account, token) => {
wx.setStorageSync('teamsSessionsCount', teamCount)
}
}
- if (currentPage.route == 'pages/tabBar/home') {
- wx.request({
- url: `${service.host}/notice/count`,
- header: {
- 'Authorization': 'Bearer ' + wx.getStorageSync('token'),
- 'X-Requested-With': 'XMLHttpRequest'
- },
- method: 'get',
- success: ({data}) => {
- let { notice_count } = data.data
- console.log(notice_count, '新的未读数')
- let groupCountList = wx.getStorageSync('teamsSessionsCount') || []
- let groupCount = 0
- if (groupCountList.length > 0) {
- for (let i = 0; i < groupCountList.length; i++) {
- groupCount += groupCountList[i].unread
- }
- }
- if ((notice_count + groupCount) > 0) {
- wx.setTabBarBadge({
- index: 2,
- text: `${notice_count + groupCount}`
- })
- } else {
- wx.removeTabBarBadge({
- index: 2
- })
+ wx.request({
+ url: `${service.host}/notice/count`,
+ header: {
+ 'Authorization': 'Bearer ' + wx.getStorageSync('token'),
+ 'X-Requested-With': 'XMLHttpRequest'
+ },
+ method: 'get',
+ success: ({data}) => {
+ let { notice_count } = data.data
+ console.log(notice_count, '新的未读数')
+ let groupCountList = wx.getStorageSync('teamsSessionsCount') || []
+ let groupCount = 0
+ if (groupCountList.length > 0) {
+ for (let i = 0; i < groupCountList.length; i++) {
+ groupCount += groupCountList[i].unread
}
}
- })
- }
+ if ((notice_count + groupCount) > 0) {
+ wx.setTabBarBadge({
+ index: 2,
+ text: `${notice_count + groupCount}`
+ })
+ } else {
+ wx.removeTabBarBadge({
+ index: 2
+ })
+ }
+ }
+ })
setTimeout(() => {
- console.log(currentPage, '7777777')
if (currentPage.route == 'pages/tabBar/news') {
currentPage.onShow()
}