diff --git a/apis/interfaces/im.js b/apis/interfaces/im.js
index 0b2cb7e..fa8ac9e 100644
--- a/apis/interfaces/im.js
+++ b/apis/interfaces/im.js
@@ -107,15 +107,15 @@ const getGroupInfo = (groupId) => {
url: 'im/groups/' + groupId
})
}
-
-/**
- * 群组基础信息
- */
+
+/**
+ * 群组基础信息
+ */
const getGroupBase = (groupId) => {
return request({
- url: 'im/groups/' + groupId+ '/base'
+ url: 'im/groups/' + groupId + '/base'
})
-}
+}
const getGroupUsers = (groupId) => {
return request({
@@ -127,24 +127,24 @@ const getGroupAnnouncements = (groupId) => {
return request({
url: 'im/groups/' + groupId + '/announcements'
})
-}
-
-const createGroupAnnouncement = (groupId, content) => {
- return request({
- method: 'POST',
- url: 'im/groups/' + groupId + '/announcements',
- data: {
- content: content
- }
- })
-}
-
-const deleteGroupAnnouncement = (groupId, announcementId) => {
- return request({
- method: 'DELETE',
- url: 'im/groups/' + groupId + '/announcements/' + announcementId
- })
-}
+}
+
+const createGroupAnnouncement = (groupId, content) => {
+ return request({
+ method: 'POST',
+ url: 'im/groups/' + groupId + '/announcements',
+ data: {
+ content: content
+ }
+ })
+}
+
+const deleteGroupAnnouncement = (groupId, announcementId) => {
+ return request({
+ method: 'DELETE',
+ url: 'im/groups/' + groupId + '/announcements/' + announcementId
+ })
+}
/**
* 创建群聊
@@ -155,14 +155,14 @@ const createGroup = (data) => {
url: 'im/groups',
data: data
})
-}
-
-const updateGroup = (groupId, data) => {
- return request({
- method: 'PUT',
- url: 'im/groups/' + groupId,
- data: data
- })
+}
+
+const updateGroup = (groupId, data) => {
+ return request({
+ method: 'PUT',
+ url: 'im/groups/' + groupId,
+ data: data
+ })
}
/**
@@ -179,14 +179,24 @@ const joinGroup = (groupId) => {
method: 'POST',
url: 'im/groups/' + groupId + '/join'
})
-}
-
+}
+
const quitGroup = (groupId) => {
return request({
method: 'POST',
url: 'im/groups/' + groupId + '/quit'
})
-}
+}
+
+/**
+ * 解散群聊
+ */
+const dismissGroup = (groupId) => {
+ return request({
+ method: 'DELETE',
+ url: 'im/groups/' + groupId
+ })
+}
export {
getImToken,
@@ -201,15 +211,16 @@ export {
searchFriend,
pedingFriend,
getMyGroups,
- createGroup,
+ createGroup,
updateGroup,
- getGroupInfo,
+ getGroupInfo,
getGroupBase,
- getGroupUsers,
- getGroupAnnouncements,
- createGroupAnnouncement,
+ getGroupUsers,
+ getGroupAnnouncements,
+ createGroupAnnouncement,
deleteGroupAnnouncement,
searchGroup,
- joinGroup,
- quitGroup
+ joinGroup,
+ quitGroup,
+ dismissGroup
}
diff --git a/pages/im/group/announceCreate.vue b/pages/im/group/announceCreate.vue
index 4a428f9..bf3a6c9 100644
--- a/pages/im/group/announceCreate.vue
+++ b/pages/im/group/announceCreate.vue
@@ -2,7 +2,7 @@
-
+
@@ -20,6 +20,11 @@
},
onLoad(e) {
this.targetId = e.targetId
+ },
+ computed: {
+ disabled() {
+ return this.content.length == 0 || this.content.length > 200
+ }
},
methods: {
onCreate() {
diff --git a/pages/im/group/announcement.vue b/pages/im/group/announcement.vue
index 18d3906..5edd2d7 100644
--- a/pages/im/group/announcement.vue
+++ b/pages/im/group/announcement.vue
@@ -1,7 +1,7 @@
-
+
@@ -50,7 +51,9 @@