修复已知问题
This commit is contained in:
@@ -30,11 +30,12 @@
|
||||
import backSVG from '../../../assets/icon/back.svg'
|
||||
import { useUI } from '../../../../utils/use-ui'
|
||||
import { endUserService } from '../../../../api/my-index'
|
||||
import { navigateBack, reLaunch } from '../../../../utils/router'
|
||||
|
||||
const { showDialog, showToast } = useUI()
|
||||
|
||||
const emits = defineEmits(['openGroupManagement'])
|
||||
const props = defineProps(['isGroup', 'serviceID'])
|
||||
const props = defineProps(['isGroup', 'serviceID', 'type'])
|
||||
|
||||
const currentConversation = ref<IConversationModel>()
|
||||
const typingStatus = ref(false)
|
||||
@@ -91,15 +92,19 @@
|
||||
}
|
||||
|
||||
const back = async () => {
|
||||
if (props.type === 'GROUP') {
|
||||
reLaunch('/')
|
||||
return
|
||||
}
|
||||
if (props.serviceID) {
|
||||
const show = await showDialog('提示', '确定要退出当前会话吗?')
|
||||
if (show) {
|
||||
await endUserService(props.serviceID)
|
||||
await showToast('结束服务成功')
|
||||
uni.navigateBack()
|
||||
navigateBack()
|
||||
}
|
||||
} else {
|
||||
uni.navigateBack()
|
||||
navigateBack()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<template>
|
||||
<div class="chat" :style="{ marginBottom: keywordHight + 'px' }">
|
||||
<TUICallKit></TUICallKit>
|
||||
<div :class="['tui-chat', !isPC && 'tui-chat-h5']">
|
||||
<div
|
||||
v-if="!currentConversationID"
|
||||
@@ -15,6 +16,7 @@
|
||||
:isGroup="!isNotInGroup ? isGroup : null"
|
||||
:headerExtensionList="headerExtensionList"
|
||||
:serviceID="serviceID"
|
||||
:type="backStatusName"
|
||||
@closeChat="closeChat"
|
||||
@openGroupManagement="handleGroup"
|
||||
/>
|
||||
@@ -101,6 +103,7 @@
|
||||
TUIConstants,
|
||||
ExtensionInfo
|
||||
} from '@tencentcloud/tui-core-lite'
|
||||
import { TUICallKit } from '@trtc/calls-uikit-vue'
|
||||
import ChatHeader from './chat-header/index.vue'
|
||||
import MessageList from './message-list/index.vue'
|
||||
import MessageInput from './message-input/index.vue'
|
||||
@@ -121,7 +124,11 @@
|
||||
import { onLoad, onUnload } from '@dcloudio/uni-app'
|
||||
import { initChat, logout } from './entry-chat-only.ts'
|
||||
|
||||
// 返回状态
|
||||
const backStatusName = ref('')
|
||||
|
||||
onLoad(options => {
|
||||
backStatusName.value = options?.type || ''
|
||||
serviceID.value = options?.id || ''
|
||||
initChat(options)
|
||||
})
|
||||
|
||||
@@ -142,7 +142,7 @@
|
||||
v-else-if="item.type === TYPES.MSG_LOCATION"
|
||||
:content="item.getMessageContent()"
|
||||
/>
|
||||
<!-- 自定义消息,目前只支持【红包】 -->
|
||||
<!-- 自定义消息,目前只支持:红包,商品详情 -->
|
||||
<MessageCustom
|
||||
v-else-if="item.type === TYPES.MSG_CUSTOM"
|
||||
ref="customRefMessage"
|
||||
|
||||
@@ -20,6 +20,8 @@
|
||||
>
|
||||
<Avatar
|
||||
useSkeletonAnimation
|
||||
:type="message.conversationType"
|
||||
:id="message.from"
|
||||
:url="message.avatar || ''"
|
||||
:style="{ flex: '0 0 auto' }"
|
||||
/>
|
||||
|
||||
@@ -100,6 +100,22 @@
|
||||
</text> -->
|
||||
</view>
|
||||
</template>
|
||||
<!-- 商品详情 -->
|
||||
<template
|
||||
v-else-if="customData.businessID === CHAT_MSG_CUSTOM_TYPE.GOODS"
|
||||
>
|
||||
<view class="goods-box" @click="onGoods">
|
||||
<image
|
||||
mode="heightFix"
|
||||
:src="goodsData.cover"
|
||||
class="img-box"
|
||||
></image>
|
||||
<view class="right-box">
|
||||
<text class="name">{{ goodsData.title }}</text>
|
||||
<text class="price">¥ {{ goodsData.price }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<template v-else>
|
||||
<span v-html="content.custom" />
|
||||
</template>
|
||||
@@ -125,6 +141,7 @@
|
||||
import star from '../../../../assets/icon/star-light.png'
|
||||
import unopenedEnvelope from '../../../../assets/icon/unopened-envelope.svg'
|
||||
import kaiEnvelope from '../../../../assets/icon/kai-unopened-envelope.svg'
|
||||
import { navigateTo } from '../../../../../utils/router'
|
||||
|
||||
interface Props {
|
||||
messageItem: IMessageModel
|
||||
@@ -173,6 +190,16 @@
|
||||
}
|
||||
})
|
||||
|
||||
/** 商品详情显示数据 */
|
||||
const goodsData = computed(() => {
|
||||
return JSON.parse(props.messageItem.payload.data)
|
||||
})
|
||||
|
||||
/** 点击商品详情 */
|
||||
const onGoods = () => {
|
||||
navigateTo('/pages/mall/detail', { productId: goodsData.value.id })
|
||||
}
|
||||
|
||||
watchEffect(() => {
|
||||
custom.value = props.content
|
||||
message.value = props.messageItem
|
||||
@@ -298,4 +325,38 @@
|
||||
color: #ffffff;
|
||||
}
|
||||
}
|
||||
|
||||
.goods-box {
|
||||
display: flex;
|
||||
.img-box {
|
||||
flex-shrink: 0;
|
||||
width: 180rpx;
|
||||
height: 240rpx;
|
||||
border-radius: 12rpx;
|
||||
overflow: hidden;
|
||||
background: rgb(182, 182, 182);
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
.right-box {
|
||||
width: 50vw;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
.name {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 3;
|
||||
-webkit-box-orient: vertical;
|
||||
font-size: 28rpx;
|
||||
font-weight: 400;
|
||||
color: #333333;
|
||||
}
|
||||
.price {
|
||||
font-size: 28rpx;
|
||||
font-weight: 500;
|
||||
color: #ff7201;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -171,7 +171,7 @@ const isHoverFingerPointer = computed<boolean>(() => {
|
||||
|
||||
function openReadUserPanel() {
|
||||
if (isHoverFingerPointer.value) {
|
||||
emits('openReadUserPanel');
|
||||
// emits('openReadUserPanel');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user