content报错问题

This commit is contained in:
shijingjing
2022-07-28 15:18:49 +08:00
parent 72af082d3b
commit 8f68ef6465

View File

@@ -45,7 +45,7 @@
<p>群发内容</p> <p>群发内容</p>
<div> <div>
<!-- 文本 --> <!-- 文本 -->
<div class="textarea" v-show="content && content.length>0">{{ content[0].content }}</div> <div class="textarea" v-show="content.length">{{ content }}</div>
<!-- 图片 --> <!-- 图片 -->
<div class="pictures" v-show="picList.length"> <div class="pictures" v-show="picList.length">
<image v-for="(item, index) in picList" :key="index" :src="item.imgPicUrl" @click.stop="previewImages(picList, item.imgPicUrl)"/> <image v-for="(item, index) in picList" :key="index" :src="item.imgPicUrl" @click.stop="previewImages(picList, item.imgPicUrl)"/>
@@ -91,7 +91,7 @@ export default {
return { return {
id: "", id: "",
data: {}, data: {},
content: [], content: '',
picList: [], picList: [],
videoList: [], videoList: [],
fileList: [], fileList: [],
@@ -113,7 +113,7 @@ export default {
this.$http.post(`/app/appmasssendingtask/queryDetailById?id=${this.id}`).then(res=> { this.$http.post(`/app/appmasssendingtask/queryDetailById?id=${this.id}`).then(res=> {
if (res?.data) { if (res?.data) {
this.data = res.data this.data = res.data
this.content = res.data.contents.filter(v=> v.msgType == 0) this.content = res.data.contents.filter(v=> v.msgType == 0)?.[0].content
this.picList = res.data.contents.filter(v=> v.msgType == 1) this.picList = res.data.contents.filter(v=> v.msgType == 1)
this.videoList = res.data.contents.filter(v=> v.msgType == 2) this.videoList = res.data.contents.filter(v=> v.msgType == 2)
this.fileList = res.data.contents.filter(v=> v.msgType == 3) this.fileList = res.data.contents.filter(v=> v.msgType == 3)