fix: 图文显示有误,articles为数组

Signed-off-by: dhb52 <dhb52@126.com>
(cherry picked from commit a422ad4177)
This commit is contained in:
dhb52 2023-04-07 16:23:02 +00:00 committed by shizhong
parent 789ac414e9
commit 1285b362d1

View File

@ -37,7 +37,7 @@
<div class="select-item" v-if="objDataRef.url"> <div class="select-item" v-if="objDataRef.url">
<img class="material-img" :src="objDataRef.url" /> <img class="material-img" :src="objDataRef.url" />
<p class="item-name" v-if="objDataRef.name">{{ objDataRef.name }}</p> <p class="item-name" v-if="objDataRef.name">{{ objDataRef.name }}</p>
<el-row class="ope-row"> <el-row class="ope-row" justify="center">
<el-button type="danger" circle @click="deleteObj"> <el-button type="danger" circle @click="deleteObj">
<icon icon="ep:delete" /> <icon icon="ep:delete" />
</el-button> </el-button>
@ -52,7 +52,7 @@
<icon icon="ep:circle-check" /> <icon icon="ep:circle-check" />
</el-button> </el-button>
<el-dialog title="选择图片" v-model="dialogImageVisible" width="90%" append-to-body> <el-dialog title="选择图片" v-model="dialogImageVisible" width="90%" append-to-body>
<wx-material-select :obj-data="objDataRef" @selectMaterial="selectMaterial" /> <WxMaterialSelect :obj-data="objDataRef" @select-material="selectMaterial" />
</el-dialog> </el-dialog>
</el-col> </el-col>
<!-- 文件上传 --> <!-- 文件上传 -->
@ -91,20 +91,20 @@
<div class="select-item2" v-if="objDataRef.url"> <div class="select-item2" v-if="objDataRef.url">
<p class="item-name">{{ objDataRef.name }}</p> <p class="item-name">{{ objDataRef.name }}</p>
<div class="item-infos"> <div class="item-infos">
<wx-voice-player :url="objDataRef.url" /> <WxVoicePlayer :url="objDataRef.url" />
</div> </div>
<el-row class="ope-row"> <el-row class="ope-row" justify="center">
<el-button type="danger" icon="el-icon-delete" circle @click="deleteObj" /> <el-button type="danger" circle @click="deleteObj"><Icon icon="ep:delete" /></el-button>
</el-row> </el-row>
</div> </div>
<el-row v-else style="text-align: center"> <el-row v-else style="text-align: center">
<!-- 选择素材 --> <!-- 选择素材 -->
<el-col :span="12" class="col-select"> <el-col :span="12" class="col-select">
<el-button type="success" @click="openMaterial"> <el-button type="success" @click="openMaterial">
素材库选择<i class="el-icon-circle-check el-icon--right"></i> 素材库选择<Icon icon="ep:circle-check" />
</el-button> </el-button>
<el-dialog title="选择语音" v-model="dialogVoiceVisible" width="90%" append-to-body> <el-dialog title="选择语音" v-model="dialogVoiceVisible" width="90%" append-to-body>
<WxMaterialSelect :objData="objData" @selectMaterial="selectMaterial" /> <WxMaterialSelect :objData="objData" @select-material="selectMaterial" />
</el-dialog> </el-dialog>
</el-col> </el-col>
<!-- 文件上传 --> <!-- 文件上传 -->
@ -151,7 +151,7 @@
@input="inputContent" @input="inputContent"
/> />
<div style="text-align: center"> <div style="text-align: center">
<wx-video-player v-if="objDataRef.url" :url="objDataRef.url" /> <WxVideoPlayer v-if="objDataRef.url" :url="objDataRef.url" />
</div> </div>
<el-col> <el-col>
<el-row style="text-align: center" align="middle"> <el-row style="text-align: center" align="middle">
@ -162,7 +162,7 @@
<icon icon="ep:circle-check" /> <icon icon="ep:circle-check" />
</el-button> </el-button>
<el-dialog title="选择视频" v-model="dialogVideoVisible" width="90%" append-to-body> <el-dialog title="选择视频" v-model="dialogVideoVisible" width="90%" append-to-body>
<wx-material-select :objData="objDataRef" @selectMaterial="selectMaterial" /> <WxMaterialSelect :objData="objDataRef" @select-material="selectMaterial" />
</el-dialog> </el-dialog>
</el-col> </el-col>
<!-- 文件上传 --> <!-- 文件上传 -->
@ -196,8 +196,8 @@
</el-row> </el-row>
</template> </template>
<el-row> <el-row>
<div class="select-item" v-if="objDataRef.articles.size > 0"> <div class="select-item" v-if="objDataRef.articles?.length > 0">
<wx-news :articles="objDataRef.articles" /> <WxNews :articles="objDataRef.articles" />
<el-col class="ope-row"> <el-col class="ope-row">
<el-button type="danger" circle @click="deleteObj"> <el-button type="danger" circle @click="deleteObj">
<icon icon="ep:delete" /> <icon icon="ep:delete" />
@ -216,9 +216,9 @@
</el-row> </el-row>
</el-col> </el-col>
<el-dialog title="选择图文" v-model="dialogNewsVisible" width="90%" append-to-body> <el-dialog title="选择图文" v-model="dialogNewsVisible" width="90%" append-to-body>
<wx-material-select <WxMaterialSelect
:objData="objDataRef" :objData="objDataRef"
@selectMaterial="selectMaterial" @select-material="selectMaterial"
:newsType="newsType" :newsType="newsType"
/> />
</el-dialog> </el-dialog>
@ -268,9 +268,9 @@
</el-col> </el-col>
</el-row> </el-row>
<el-dialog title="选择图片" v-model="dialogThumbVisible" width="80%" append-to-body> <el-dialog title="选择图片" v-model="dialogThumbVisible" width="80%" append-to-body>
<wx-material-select <WxMaterialSelect
:objData="{ type: 'image', accountId: objDataRef.accountId }" :objData="{ type: 'image', accountId: objDataRef.accountId }"
@selectMaterial="selectMaterial" @select-material="selectMaterial"
/> />
</el-dialog> </el-dialog>
</el-col> </el-col>
@ -482,7 +482,7 @@ export default defineComponent({
// tempObjItem // tempObjItem
let tempObjItem = { let tempObjItem = {
type: '', type: '',
articles: '', articles: [],
thumbMediaId: '', thumbMediaId: '',
thumbMediaUrl: '', thumbMediaUrl: '',
introduction: '', introduction: '',
@ -560,7 +560,7 @@ export default defineComponent({
} }
const deleteObj = () => { const deleteObj = () => {
if (objDataRef.type === 'news') { if (objDataRef.type === 'news') {
objDataRef.articles = '' objDataRef.articles = []
} else if (objDataRef.type === 'image') { } else if (objDataRef.type === 'image') {
objDataRef.mediaId = null objDataRef.mediaId = null
objDataRef.url = null objDataRef.url = null