浏览代码

修改bug

chenrui 2 年之前
父节点
当前提交
3997ec198e
共有 1 个文件被更改,包括 8 次插入4 次删除
  1. 8 4
      src/views/promotionManagement/promotionInfo/promotionShowModal.vue

+ 8 - 4
src/views/promotionManagement/promotionInfo/promotionShowModal.vue

@@ -10,8 +10,8 @@
     :width="500">
     <div class="promotionDesc-con">
       <img src="@/assets/iphone.png" alt="图片走丢了" srcset="">
-      <div class="promotionDescCon" v-show="showType=='IMAGE_CONTENT'" v-html="mainContent"></div>
-      <div class="promotionDescCon" v-show="showType=='VIDEO'" >
+      <div class="promotionDescCon" v-if="showType=='IMAGE_CONTENT'" v-html="mainContent"></div>
+      <div class="promotionDescCon" v-if="showType=='VIDEO'&&mainContent" >
         <video width="100%" height="auto" controls loop controlsList="nodownload">
           <source :src="mainContent" type="video/mp4"></source>
         </video>
@@ -49,10 +49,12 @@ export default {
       const ajaxData = {
         id: con.id
       }
-      this.showType = con.showType
       promoTerminalDetail(ajaxData).then(res => {
         if (res.status == 200) {
-          this.mainContent = res.data.content
+          this.$nextTick(() => {
+            this.showType = res.data.contentType
+            this.mainContent = res.data.content
+          })
         }
       })
     }
@@ -66,6 +68,8 @@ export default {
     isShow (newValue, oldValue) {
       if (!newValue) {
         this.$emit('close')
+        this.mainContent = ''
+        this.showType = undefined
       }
     }
   }