eight
2025-04-15 589bcdb26f8e9d3e0d5ef46d27acc901c96d50ea
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<template>
  <div>
    <MsgEvent v-if="item.type === MsgType.Event" :item="item" />
 
    <div v-else-if="item.type === MsgType.Text">{{ item.content }}</div>
 
    <div v-else-if="item.type === MsgType.Voice">
      <WxVoicePlayer :url="item.mediaUrl" :content="item.recognition" />
    </div>
 
    <div v-else-if="item.type === MsgType.Image">
      <a target="_blank" :href="item.mediaUrl">
        <img :src="item.mediaUrl" style="width: 100px" />
      </a>
    </div>
 
    <div
      v-else-if="item.type === MsgType.Video || item.type === 'shortvideo'"
      style="text-align: center"
    >
      <WxVideoPlayer :url="item.mediaUrl" />
    </div>
 
    <div v-else-if="item.type === MsgType.Link" class="avue-card__detail">
      <el-link type="success" :underline="false" target="_blank" :href="item.url">
        <div class="avue-card__title"><i class="el-icon-link"></i>{{ item.title }}</div>
      </el-link>
      <div class="avue-card__info" style="height: unset">{{ item.description }}</div>
    </div>
 
    <div v-else-if="item.type === MsgType.Location">
      <WxLocation :label="item.label" :location-y="item.locationY" :location-x="item.locationX" />
    </div>
 
    <div v-else-if="item.type === MsgType.News" style="width: 300px">
      <WxNews :articles="item.articles" />
    </div>
 
    <div v-else-if="item.type === MsgType.Music">
      <WxMusic
        :title="item.title"
        :description="item.description"
        :thumb-media-url="item.thumbMediaUrl"
        :music-url="item.musicUrl"
        :hq-music-url="item.hqMusicUrl"
      />
    </div>
  </div>
</template>
 
<script lang="ts" setup>
import WxVideoPlayer from '@/views/mp/components/wx-video-play'
import WxVoicePlayer from '@/views/mp/components/wx-voice-play'
import WxNews from '@/views/mp/components/wx-news'
import WxLocation from '@/views/mp/components/wx-location'
import WxMusic from '@/views/mp/components/wx-music'
import MsgEvent from './MsgEvent.vue'
import { MsgType } from '../types'
 
defineOptions({ name: 'Msg' })
 
const props = defineProps<{
  item: any
}>()
 
const item = ref<any>(props.item)
</script>
 
<style scoped></style>