From f6038e95a085c42fb28be5822e51fb96bf24f913 Mon Sep 17 00:00:00 2001 From: wangyifeng <812766448@qq.com> Date: Thu, 3 Apr 2025 15:45:12 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E8=81=8A=E5=A4=A9=E5=85=A8?= =?UTF-8?q?=E9=83=A8=E6=94=BE=E5=BC=80=E5=90=8E=E5=87=BA=E7=8E=B0=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/avatar-module/index.vue | 1 + src/components/custom-btn/custom-btn.vue | 2 ++ .../system/SysGroupInfoChangeMessage.vue | 5 ++-- .../chatSettings/groupManage/editAvatar.vue | 16 +++++++++-- src/pages/dialog/index.vue | 19 +++++++++++-- src/pages/index/index.vue | 28 +++++++++++++++---- 6 files changed, 58 insertions(+), 13 deletions(-) diff --git a/src/components/avatar-module/index.vue b/src/components/avatar-module/index.vue index aa5901b..47895f0 100644 --- a/src/components/avatar-module/index.vue +++ b/src/components/avatar-module/index.vue @@ -89,6 +89,7 @@ const text_avatar = computed(() => { img { width: 100%; height: 100%; + object-fit: cover; } } diff --git a/src/components/custom-btn/custom-btn.vue b/src/components/custom-btn/custom-btn.vue index 8110d8a..ace7895 100644 --- a/src/components/custom-btn/custom-btn.vue +++ b/src/components/custom-btn/custom-btn.vue @@ -19,6 +19,7 @@ :disabled="props?.disabled" :class="[props?.disabled ? 'custom-btn-class-disabled' : '']" :plain="props?.plain" + :loading="props?.isLoading" > {{ props.btnText }} @@ -35,6 +36,7 @@ const props = defineProps({ subBtnText: '', //次要按钮文字 disabled: false, //是否禁用 plain: false, //是否镂空 + isLoading: false, //是否正在加载中 }) //点击副按钮 diff --git a/src/components/talk/message/system/SysGroupInfoChangeMessage.vue b/src/components/talk/message/system/SysGroupInfoChangeMessage.vue index d0cfa0b..6fdada9 100644 --- a/src/components/talk/message/system/SysGroupInfoChangeMessage.vue +++ b/src/components/talk/message/system/SysGroupInfoChangeMessage.vue @@ -17,8 +17,9 @@ defineProps({ 管理员 - 修改群名为 - "{{ extra.group_name }}" + + 修改了群信息 diff --git a/src/pages/chatSettings/groupManage/editAvatar.vue b/src/pages/chatSettings/groupManage/editAvatar.vue index 1a5be5a..1f1f8a0 100644 --- a/src/pages/chatSettings/groupManage/editAvatar.vue +++ b/src/pages/chatSettings/groupManage/editAvatar.vue @@ -22,6 +22,7 @@ @@ -49,6 +50,10 @@ const dialogueParams = reactive({ receiver_id: computed(() => dialogueStore.talk.receiver_id), }) +const state = reactive({ + isLoading: false, //是否正在加载中 +}) + const onProgressFn = (progress, id) => { console.log((progress.loaded / progress.total) * 100, 'progress') @@ -69,6 +74,7 @@ const editAvatar = () => { count: 1, success: async (res) => { console.log(res, 'res') + state.isLoading = true res.tempFiles.forEach(async (file) => { console.log(file) let image = new Image() @@ -93,6 +99,7 @@ const editAvatar = () => { const resp = ServeEditGroup(params) resp.then(({ code }) => { if (code == 200) { + state.isLoading = false groupStore.updateGroupInfo({ avatar: data.ori_url, }) @@ -100,13 +107,18 @@ const editAvatar = () => { // delta: 1, // }) } else { + state.isLoading = false } }) - resp.catch(() => {}) + resp.catch(() => { + state.isLoading = false}) } else { + state.isLoading = false } }, - ) + ).catch(() => { + state.isLoading = false + }) } }) }, diff --git a/src/pages/dialog/index.vue b/src/pages/dialog/index.vue index 4d325c5..c1a8dc3 100644 --- a/src/pages/dialog/index.vue +++ b/src/pages/dialog/index.vue @@ -133,13 +133,26 @@ @touchstart="() => handleAvatarTouchStart(item)" @touchend="handleAvatarTouchEnd" > - + /> --> + @@ -952,7 +965,7 @@ const editorOption = { const handleSelectImg = (data, file_num) => { if (Array.isArray(data)) { // 批量发送图片 - data.forEach(item => { + data.forEach((item) => { onSendMessage({ ...item, file_num: item.file_num }) }) } else { diff --git a/src/pages/index/index.vue b/src/pages/index/index.vue index 5e2859a..e7ac3d5 100644 --- a/src/pages/index/index.vue +++ b/src/pages/index/index.vue @@ -31,12 +31,25 @@ >