+
{{ $t('button.text.done') }}
@@ -27,6 +30,7 @@
{
//输入群公告
const inputGroupNotice = (e) => {
state.groupNotice = e
+ if (e.trim()) {
+ state.canDoComplete = true
+ } else {
+ state.canDoComplete = false
+ }
}
diff --git a/src/pages/chatSettings/index.vue b/src/pages/chatSettings/index.vue
index f6fa3fa..b36bf13 100644
--- a/src/pages/chatSettings/index.vue
+++ b/src/pages/chatSettings/index.vue
@@ -13,7 +13,7 @@
-
-
@@ -53,39 +53,14 @@
v-for="(item, index) in state.chatGroupMembers"
:key="index"
>
-
-
-
-
-
-
![]()
-
- {{
- memberItem.nickname.length >= 2
- ? memberItem.nickname.slice(-2)
- : memberItem.nickname
- }}
-
-
-
-
- {{ $t('group.identify.admin') }}
-
-
-
-
- {{ memberItem.nickname }}
-
-
-
-
-
+
+
@@ -127,7 +102,12 @@
v-for="(item, index) in state.chatSettings"
:key="index"
>
-
+
@@ -136,7 +116,10 @@
v-for="(item, index) in state.chatManagement"
:key="index"
>
-
+
@@ -173,25 +156,34 @@ import recordSearchTypeIcon_files from '@/static/image/chatSettings/recordSearch
import recordSearchTypeIcon_link from '@/static/image/chatSettings/recordSearchTypeLink.png'
import ZPaging from '@/uni_modules/z-paging/components/z-paging/z-paging.vue'
import settingFormItem from './components/settingFormItem.vue'
+import groupMemberList from './components/groupMembersList.vue'
import { computed, onMounted, reactive } from 'vue'
+import { useUserStore, useTalkStore, useDialogueStore } from '@/store'
import { onLoad } from '@dcloudio/uni-app'
import {
ServeQueryGroupInfo,
ServeQueryGroupMembers,
ServeQueryGroupNotice,
+ ServeTopTalk,
+ ServeDisturbTalk,
} from '@/api/chatSettings/index'
import { useI18n } from 'vue-i18n'
const { t } = useI18n()
-
-onLoad((options) => {
- if (options.groupId) {
- console.log(options.groupId)
- state.groupId = Number(options.groupId)
- getGroupInfo()
- getGroupMembers()
- getGroupNotice()
- }
+const userStore = useUserStore()
+const talkStore = useTalkStore()
+const dialogueStore = useDialogueStore()
+const talkParams = reactive({
+ uid: computed(() => userStore.uid),
+ index_name: computed(() => dialogueStore.index_name),
+ type: computed(() => dialogueStore.talk.talk_type),
+ receiver_id: computed(() => dialogueStore.talk.receiver_id),
+ username: computed(() => dialogueStore.talk.username),
+ online: computed(() => dialogueStore.online),
+ keyboard: computed(() => dialogueStore.keyboard),
+ num: computed(() => dialogueStore.members.length),
})
+const topItems = computed(() => talkStore.topItems)
+const disturbItems = computed(() => talkStore.disturbItems)
const state = reactive({
chatGroupMembers: [], //群成员form-item
@@ -203,6 +195,35 @@ const state = reactive({
groupInfo: null, //群信息
memberList: [], //群成员列表
groupNotice: [], //群公告
+ sessionId: '', //会话id
+})
+
+onLoad((options) => {
+ console.log(talkParams)
+ if (options.groupId) {
+ console.log(options.groupId)
+ state.groupId = Number(options.groupId)
+ getGroupInfo()
+ getGroupMembers()
+ getGroupNotice()
+ }
+ if (options.sessionId) {
+ state.sessionId = Number(options.sessionId)
+ if (topItems.value.length > 0) {
+ topItems.value.forEach((item) => {
+ if (item.id == options.sessionId) {
+ state.sessionInfo = item
+ }
+ })
+ }
+ if (disturbItems.value.length > 0) {
+ disturbItems.value.forEach((item) => {
+ if (item.id == options.sessionId) {
+ state.sessionInfo = item
+ }
+ })
+ }
+ }
})
onMounted(() => {
@@ -403,13 +424,49 @@ const updateGroupInfos = () => {
]
}
+//点击跳转到修改群信息页面
+const toEditGroupInfoPage = () => {
+ uni.navigateTo({
+ url:
+ '/pages/chatSettings/groupManage/editGroupName?groupAvatar=' +
+ groupAvatar.value,
+ })
+}
+
+//点击跳转到修改头像页面
+const toEditAvatarPage = () => {
+ uni.navigateTo({
+ url:
+ '/pages/chatSettings/groupManage/editAvatar?groupAvatar=' +
+ groupAvatar.value,
+ })
+}
+
//点击跳转到管理页面
const toManagePage = (label) => {
console.log(label)
- if (label && label === t('chat.settings.groupNotice')) {
- uni.navigateTo({
- url: '/pages/chatSettings/groupManage/manageNotice',
- })
+ if (label) {
+ if (label === t('chat.settings.groupName')) {
+ uni.navigateTo({
+ url:
+ '/pages/chatSettings/groupManage/editGroupName?groupAvatar=' +
+ groupAvatar.value,
+ })
+ } else if (label === t('chat.settings.groupNotice')) {
+ uni.navigateTo({
+ url: '/pages/chatSettings/groupManage/manageNotice',
+ })
+ } else if (label === t('chat.settings.groupMember')) {
+ uni.navigateTo({
+ url:
+ '/pages/chatSettings/groupManage/manageGroupMembers?groupId=' +
+ state.groupId,
+ })
+ } else if (label === t('chat.settings.groupGag')) {
+ uni.navigateTo({
+ url: '/pages/chatSettings/groupManage/manageGroupSilence',
+ })
+ }
}
}
@@ -427,6 +484,46 @@ const toSearchByConditionPage = (flag) => {
state.groupId,
})
}
+
+//切换开关选择
+const changeSwitch = (switchStatus, label) => {
+ let params
+ let resp
+ if (label == t('chat.settings.topSession')) {
+ params = {
+ list_id: state.sessionId, //聊天会话的id
+ type: switchStatus ? 1 : 2,
+ }
+ resp = ServeTopTalk(params)
+ } else if (label == t('chat.settings.messageNoDisturb')) {
+ params = {
+ talk_type: talkParams.type, //1私聊;2群聊
+ receiver_id: talkParams.receiver_id, //接收人id或群id
+ is_disturb: switchStatus ? 1 : 0, //是否开启免打扰,0不免打扰,1免打扰
+ }
+ resp = ServeDisturbTalk(params)
+ }
+ console.log(resp)
+ resp.then(({ code, data }) => {
+ console.log(data)
+ if (code == 200) {
+ if (label == t('chat.settings.topSession')) {
+ talkStore.updateItem({
+ index_name: talkParams.index_name,
+ is_top: switchStatus ? 1 : 2,
+ })
+ } else if (label == t('chat.settings.messageNoDisturb')) {
+ talkStore.updateItem({
+ index_name: talkParams.index_name,
+ is_disturb: switchStatus ? 1 : 0,
+ })
+ }
+ } else {
+ }
+ })
+
+ resp.catch(() => {})
+}