message-call-group.vue 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <template>
  2. <div
  3. v-if="isCallMessage && conversationType === TYPES.CONV_GROUP"
  4. :class="{ 'blink-text': isBlink }"
  5. >
  6. {{ custom }}
  7. </div>
  8. </template>
  9. <script setup lang="ts">
  10. import { computed } from '../../../adapter-vue';
  11. import TUIChatEngine, { IMessageModel } from '@tencentcloud/chat-uikit-engine';
  12. interface IProps {
  13. message: IMessageModel;
  14. signalingInfo: any;
  15. customContent: any;
  16. blinkMessageIDList?: string[];
  17. }
  18. const props = withDefaults(defineProps<IProps>(), {
  19. message: () => ({}) as IMessageModel,
  20. signalingInfo: () => ({}),
  21. customContent: () => ({}),
  22. blinkMessageIDList: () => [],
  23. });
  24. const TYPES = TUIChatEngine.TYPES;
  25. const isCallMessage = computed(() => !!props.signalingInfo);
  26. const conversationType = computed(() => props.message?.conversationType);
  27. const custom = computed(() => props.customContent?.custom);
  28. const isBlink = computed(() => {
  29. if (props.message?.ID) {
  30. return props.blinkMessageIDList?.includes(props.message.ID);
  31. }
  32. return false;
  33. });
  34. </script>
  35. <style scoped lang="scss">
  36. @keyframes blink-text {
  37. 50% {
  38. color: #ff9c19;
  39. }
  40. }
  41. .blink-text {
  42. animation: blinkText 1s linear 3;
  43. }
  44. </style>