解决聊天全部放开后出现的问题
Some checks are pending
Check / lint (push) Waiting to run
Check / typecheck (push) Waiting to run
Check / build (build, 18.x, ubuntu-latest) (push) Waiting to run
Check / build (build, 18.x, windows-latest) (push) Waiting to run
Check / build (build:app, 18.x, ubuntu-latest) (push) Waiting to run
Check / build (build:app, 18.x, windows-latest) (push) Waiting to run
Check / build (build:mp-weixin, 18.x, ubuntu-latest) (push) Waiting to run
Check / build (build:mp-weixin, 18.x, windows-latest) (push) Waiting to run

This commit is contained in:
wangyifeng 2025-04-03 15:45:12 +08:00
parent 3183ff5049
commit f6038e95a0
6 changed files with 58 additions and 13 deletions

View File

@ -89,6 +89,7 @@ const text_avatar = computed(() => {
img { img {
width: 100%; width: 100%;
height: 100%; height: 100%;
object-fit: cover;
} }
} }
</style> </style>

View File

@ -19,6 +19,7 @@
:disabled="props?.disabled" :disabled="props?.disabled"
:class="[props?.disabled ? 'custom-btn-class-disabled' : '']" :class="[props?.disabled ? 'custom-btn-class-disabled' : '']"
:plain="props?.plain" :plain="props?.plain"
:loading="props?.isLoading"
> >
{{ props.btnText }} {{ props.btnText }}
</wd-button> </wd-button>
@ -35,6 +36,7 @@ const props = defineProps({
subBtnText: '', // subBtnText: '', //
disabled: false, // disabled: false, //
plain: false, // plain: false, //
isLoading: false, //
}) })
// //

View File

@ -17,8 +17,9 @@ defineProps({
<!-- {{ data.nickname }} --> <!-- {{ data.nickname }} -->
管理员 管理员
</a> </a>
<span>修改群名为</span> <!-- <span>修改群名为</span>
<span>"{{ extra.group_name }}"</span> <span>"{{ extra.group_name }}"</span> -->
<span>修改了群信息</span>
</div> </div>
</div> </div>
</template> </template>

View File

@ -22,6 +22,7 @@
<customBtn <customBtn
:btnText="$t('button.text.edit')" :btnText="$t('button.text.edit')"
@click="editAvatar" @click="editAvatar"
:isLoading="state.isLoading"
></customBtn> ></customBtn>
</ZPaging> </ZPaging>
</div> </div>
@ -49,6 +50,10 @@ const dialogueParams = reactive({
receiver_id: computed(() => dialogueStore.talk.receiver_id), receiver_id: computed(() => dialogueStore.talk.receiver_id),
}) })
const state = reactive({
isLoading: false, //
})
const onProgressFn = (progress, id) => { const onProgressFn = (progress, id) => {
console.log((progress.loaded / progress.total) * 100, 'progress') console.log((progress.loaded / progress.total) * 100, 'progress')
@ -69,6 +74,7 @@ const editAvatar = () => {
count: 1, count: 1,
success: async (res) => { success: async (res) => {
console.log(res, 'res') console.log(res, 'res')
state.isLoading = true
res.tempFiles.forEach(async (file) => { res.tempFiles.forEach(async (file) => {
console.log(file) console.log(file)
let image = new Image() let image = new Image()
@ -93,6 +99,7 @@ const editAvatar = () => {
const resp = ServeEditGroup(params) const resp = ServeEditGroup(params)
resp.then(({ code }) => { resp.then(({ code }) => {
if (code == 200) { if (code == 200) {
state.isLoading = false
groupStore.updateGroupInfo({ groupStore.updateGroupInfo({
avatar: data.ori_url, avatar: data.ori_url,
}) })
@ -100,13 +107,18 @@ const editAvatar = () => {
// delta: 1, // delta: 1,
// }) // })
} else { } else {
state.isLoading = false
} }
}) })
resp.catch(() => {}) resp.catch(() => {
state.isLoading = false})
} else { } else {
state.isLoading = false
} }
}, },
) ).catch(() => {
state.isLoading = false
})
} }
}) })
}, },

View File

@ -133,13 +133,26 @@
@touchstart="() => handleAvatarTouchStart(item)" @touchstart="() => handleAvatarTouchStart(item)"
@touchend="handleAvatarTouchEnd" @touchend="handleAvatarTouchEnd"
> >
<im-avatar <!-- <im-avatar
class="pointer" class="pointer"
:src="item.avatar" :src="item.avatar"
:size="80" :size="80"
:username="item.nickname" :username="item.nickname"
@click="showUserInfoModal(item.user_id)" @click="showUserInfoModal(item.user_id)"
/> /> -->
<avatarModule
:mode="1"
:avatar="item.avatar"
:groupType="0"
:userName="item.nickname"
:customStyle="{ width: '80rpx', height: '80rpx' }"
:customTextStyle="{
fontSize: '32rpx',
fontWeight: 'bold',
color: '#fff',
lineHeight: '44rpx',
}"
></avatarModule>
</aside> </aside>
<!-- 主体信息 --> <!-- 主体信息 -->
@ -952,7 +965,7 @@ const editorOption = {
const handleSelectImg = (data, file_num) => { const handleSelectImg = (data, file_num) => {
if (Array.isArray(data)) { if (Array.isArray(data)) {
// //
data.forEach(item => { data.forEach((item) => {
onSendMessage({ ...item, file_num: item.file_num }) onSendMessage({ ...item, file_num: item.file_num })
}) })
} else { } else {

View File

@ -31,12 +31,25 @@
> >
<template v-slot:left> <template v-slot:left>
<div class="flex items-center ml-[48rpx]"> <div class="flex items-center ml-[48rpx]">
<image <!-- <image
class="w-[72rpx] h-[72rpx]" class="w-[72rpx] h-[72rpx]"
style="border-radius: 50%;" style="border-radius: 50%;"
:src="userStore.avatar" :src="userStore.avatar"
mode="scaleToFill" mode="scaleToFill"
/> /> -->
<avatarModule
:mode="1"
:avatar="userStore.avatar"
:groupType="0"
:userName="userStore.nickname"
:customStyle="{ width: '72rpx', height: '72rpx' }"
:customTextStyle="{
fontSize: '32rpx',
fontWeight: 'bold',
color: '#fff',
lineHeight: '44rpx',
}"
></avatarModule>
<div class="ml-[24rpx] text-[36rpx] font-bold"> <div class="ml-[24rpx] text-[36rpx] font-bold">
{{ userStore.nickname }} {{ userStore.nickname }}
</div> </div>
@ -244,10 +257,13 @@ onLoad((options) => {
setTimeout(() => { setTimeout(() => {
dialogueStore.setDialogue(openSession) dialogueStore.setDialogue(openSession)
if (openSession.unread_num > 0) { if (openSession.unread_num > 0) {
ServeClearTalkUnreadNum({ ServeClearTalkUnreadNum(
talk_type: openSession.talk_type, {
receiver_id: openSession.receiver_id, talk_type: openSession.talk_type,
},dialogueParams.unReadNum).then(() => { receiver_id: openSession.receiver_id,
},
dialogueParams.unReadNum,
).then(() => {
talkStore.updateItem({ talkStore.updateItem({
index_name: openSession.index_name, index_name: openSession.index_name,
unread_num: 0, unread_num: 0,