|
18 | 18 | class="avue-comment__body"
|
19 | 19 | :style="item.sendFrom === SendFrom.MpBot ? 'background: #6BED72;' : ''"
|
20 | 20 | >
|
21 |
| - <!-- 【事件】区域 TODO 芋艿:是不是把拆个 Message 出来,里面包括 MsgEvent + 各种其它消息,分开有点不够整体 --> |
22 |
| - <MsgEvent v-if="item.type === MsgType.Event" :item="item" /> |
23 |
| - <!-- 【消息】区域 --> |
24 |
| - <div v-else-if="item.type === MsgType.Text">{{ item.content }}</div> |
25 |
| - <div v-else-if="item.type === MsgType.Voice"> |
26 |
| - <WxVoicePlayer :url="item.mediaUrl" :content="item.recognition" /> |
27 |
| - </div> |
28 |
| - <div v-else-if="item.type === MsgType.Image"> |
29 |
| - <a target="_blank" :href="item.mediaUrl"> |
30 |
| - <img :src="item.mediaUrl" style="width: 100px" /> |
31 |
| - </a> |
32 |
| - </div> |
33 |
| - <div |
34 |
| - v-else-if="item.type === MsgType.Video || item.type === 'shortvideo'" |
35 |
| - style="text-align: center" |
36 |
| - > |
37 |
| - <WxVideoPlayer :url="item.mediaUrl" /> |
38 |
| - </div> |
39 |
| - <div v-else-if="item.type === MsgType.Link" class="avue-card__detail"> |
40 |
| - <el-link type="success" :underline="false" target="_blank" :href="item.url"> |
41 |
| - <div class="avue-card__title"><i class="el-icon-link"></i>{{ item.title }}</div> |
42 |
| - </el-link> |
43 |
| - <div class="avue-card__info" style="height: unset">{{ item.description }}</div> |
44 |
| - </div> |
45 |
| - <!-- TODO 芋艿:待完善 --> |
46 |
| - <div v-else-if="item.type === MsgType.Location"> |
47 |
| - <WxLocation |
48 |
| - :label="item.label" |
49 |
| - :location-y="item.locationY" |
50 |
| - :location-x="item.locationX" |
51 |
| - /> |
52 |
| - </div> |
53 |
| - <div v-else-if="item.type === MsgType.News" style="width: 300px"> |
54 |
| - <!-- TODO 芋艿:待测试;详情页也存在类似的情况 --> |
55 |
| - <WxNews :articles="item.articles" /> |
56 |
| - </div> |
57 |
| - <div v-else-if="item.type === MsgType.Music"> |
58 |
| - <WxMusic |
59 |
| - :title="item.title" |
60 |
| - :description="item.description" |
61 |
| - :thumb-media-url="item.thumbMediaUrl" |
62 |
| - :music-url="item.musicUrl" |
63 |
| - :hq-music-url="item.hqMusicUrl" |
64 |
| - /> |
65 |
| - </div> |
| 21 | + <Msg :item="item" /> |
66 | 22 | </div>
|
67 | 23 | </div>
|
68 | 24 | </div>
|
69 | 25 | </div>
|
70 | 26 | </template>
|
71 | 27 | <script setup lang="ts" name="MsgList">
|
72 |
| -import WxVideoPlayer from '@/views/mp/components/wx-video-play' |
73 |
| -import WxVoicePlayer from '@/views/mp/components/wx-voice-play' |
74 |
| -import WxNews from '@/views/mp/components/wx-news' |
75 |
| -import WxLocation from '@/views/mp/components/wx-location' |
76 |
| -import WxMusic from '@/views/mp/components/wx-music' |
77 |
| -import MsgEvent from './MsgEvent.vue' |
| 28 | +import Msg from './Msg.vue' |
78 | 29 | import { formatDate } from '@/utils/formatTime'
|
79 |
| -import { MsgType, User } from '../types' |
| 30 | +import { User } from '../types' |
80 | 31 | import avatarWechat from '@/assets/imgs/wechat.png'
|
81 | 32 |
|
82 | 33 | const props = defineProps<{
|
|
0 commit comments