UI优化,红包领取后缺少头像,名称字段
This commit is contained in:
@@ -616,16 +616,35 @@
|
||||
const onClaim = (item: IMessageModel, index: number) => {
|
||||
const { conversationType, cloudCustomData, flow, payload } = item
|
||||
const data = JSON.parse(payload.data)
|
||||
// 群聊
|
||||
if (conversationType === TYPES.value.CONV_GROUP) {
|
||||
console.log(item)
|
||||
console.log(data)
|
||||
receiveRedEnvelope({
|
||||
redPacketId: data.id
|
||||
})
|
||||
} else {
|
||||
// 个人红包
|
||||
getRedEnvelopeDetail(data.id).then(async (res: any) => {
|
||||
|
||||
getRedEnvelopeDetail(data.id).then(async (res: any) => {
|
||||
// 群聊
|
||||
if (conversationType === TYPES.value.CONV_GROUP) {
|
||||
if (res.data.hasReceived) {
|
||||
// 直接去详情页
|
||||
navigateTo('/pages/red-packet/details', {
|
||||
id: data.id,
|
||||
type: conversationType
|
||||
})
|
||||
} else {
|
||||
const show = await showDialog('提示', '是否领取该红包?')
|
||||
if (show) {
|
||||
// newMessage.in = true
|
||||
// customRefMessage.value[index].updateClaimStatus(newMessage)
|
||||
// item.modifyMessage({
|
||||
// cloudCustomData: JSON.stringify(newMessage)
|
||||
// })
|
||||
await receiveRedEnvelope({
|
||||
redPacketId: data.id
|
||||
})
|
||||
navigateTo('/pages/red-packet/details', {
|
||||
id: data.id,
|
||||
type: conversationType
|
||||
})
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// 个人红包
|
||||
console.log(res)
|
||||
let newMessage = {
|
||||
// ...data,
|
||||
@@ -639,23 +658,37 @@
|
||||
if (flow === 'in') {
|
||||
if (res.data.hasReceived) {
|
||||
// 直接去详情页
|
||||
navigateTo('/pages/red-packet/details', {
|
||||
id: data.id,
|
||||
type: conversationType
|
||||
})
|
||||
} else {
|
||||
const show = await showDialog('提示', '是否领取该红包?')
|
||||
if (show) {
|
||||
newMessage.in = true
|
||||
customRefMessage.value[index].updateClaimStatus(newMessage)
|
||||
item.modifyMessage({
|
||||
cloudCustomData: JSON.stringify(newMessage)
|
||||
// newMessage.in = true
|
||||
// customRefMessage.value[index].updateClaimStatus(newMessage)
|
||||
// item.modifyMessage({
|
||||
// cloudCustomData: JSON.stringify(newMessage)
|
||||
// })
|
||||
await receiveRedEnvelope({
|
||||
redPacketId: data.id
|
||||
})
|
||||
navigateTo('/pages/red-packet/details', {
|
||||
id: data.id,
|
||||
type: conversationType
|
||||
})
|
||||
}
|
||||
}
|
||||
} 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
|
||||
})
|
||||
// newMessage.out = true
|
||||
// customRefMessage.value[index].updateClaimStatus(newMessage)
|
||||
// item.modifyMessage({
|
||||
// cloudCustomData: JSON.stringify(newMessage)
|
||||
// })
|
||||
// .then(() => {
|
||||
// navigateTo('/pages/red-packet/details', {
|
||||
// id: data.id,
|
||||
@@ -663,23 +696,8 @@
|
||||
// })
|
||||
// })
|
||||
}
|
||||
})
|
||||
|
||||
return
|
||||
if (flow === 'in') {
|
||||
// 修改后的消息
|
||||
const newMessage = {
|
||||
...data,
|
||||
isOpen: true
|
||||
}
|
||||
item.modifyMessage({
|
||||
cloudCustomData: JSON.stringify(newMessage)
|
||||
})
|
||||
receiveRedEnvelope({
|
||||
redPacketId: data.id
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const resendMessageConfirm = () => {
|
||||
|
||||
Reference in New Issue
Block a user