红包功能简单化
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
>
|
||||
<!-- <JoinGroupCard /> -->
|
||||
<div class="tui-chat-main">
|
||||
<div v-if="isOfficial" class="tui-chat-safe-tips">
|
||||
<!-- <div v-if="isOfficial" class="tui-chat-safe-tips">
|
||||
<span>
|
||||
{{
|
||||
TUITranslateService.t(
|
||||
@@ -19,7 +19,7 @@
|
||||
<a @click="openComplaintLink(Link.complaint)">
|
||||
{{ TUITranslateService.t('TUIChat.点此投诉') }}
|
||||
</a>
|
||||
</div>
|
||||
</div> -->
|
||||
<MessageGroupApplication
|
||||
v-if="isGroup"
|
||||
:key="props.groupID"
|
||||
@@ -145,9 +145,10 @@
|
||||
<!-- 自定义消息,目前只支持【红包】 -->
|
||||
<MessageCustom
|
||||
v-else-if="item.type === TYPES.MSG_CUSTOM"
|
||||
ref="customRefMessage"
|
||||
:content="item.getMessageContent()"
|
||||
:messageItem="item"
|
||||
@claim="onClaim(item)"
|
||||
@claim="onClaim(item, index)"
|
||||
/>
|
||||
</MessageBubble>
|
||||
</div>
|
||||
@@ -610,8 +611,9 @@
|
||||
}
|
||||
|
||||
const { showDialog } = useUI()
|
||||
const customRefMessage = ref(null)
|
||||
/** 领取红包 */
|
||||
const onClaim = (item: IMessageModel) => {
|
||||
const onClaim = (item: IMessageModel, index: number) => {
|
||||
const { conversationType, cloudCustomData, flow, payload } = item
|
||||
const data = JSON.parse(payload.data)
|
||||
// 群聊
|
||||
@@ -641,21 +643,25 @@
|
||||
const show = await showDialog('提示', '是否领取该红包?')
|
||||
if (show) {
|
||||
newMessage.in = true
|
||||
|
||||
customRefMessage.value[index].updateClaimStatus(newMessage)
|
||||
item.modifyMessage({
|
||||
cloudCustomData: JSON.stringify(newMessage)
|
||||
})
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
newMessage.out = true
|
||||
customRefMessage.value[index].updateClaimStatus(newMessage)
|
||||
item.modifyMessage({
|
||||
cloudCustomData: JSON.stringify(newMessage)
|
||||
})
|
||||
navigateTo('/pages/red-packet/details', {
|
||||
id: data.id,
|
||||
type: conversationType
|
||||
})
|
||||
// .then(() => {
|
||||
// navigateTo('/pages/red-packet/details', {
|
||||
// id: data.id,
|
||||
// type: conversationType
|
||||
// })
|
||||
// })
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user