zhangkang 1 mese fa
parent
commit
082283673d
1 ha cambiato i file con 11 aggiunte e 4 eliminazioni
  1. 11 4
      pages/map/model/adDetail.vue

+ 11 - 4
pages/map/model/adDetail.vue

@@ -3,13 +3,14 @@
     <view class="adTitle">{{ adDetail.adName }}</view>
     <view class="adTime">{{ adDetail.createTime }}</view>
     <rich-text :nodes="adDetail.description" class="adContent"></rich-text>
-    <view v-if="adDetail.jumpType==1&&adDetail.videoUrl" class="adVideo">
-      <video :src="adDetail.videoUrl" controls class="video-player"></video>
+    <view v-if="adDetail.jumpType == 1 && adDetail.videoUrl" class="adVideo">
+      <video :src="adVideoUrl" controls class="video-player"></video>
     </view>
   </view>
 </template>
 <script>
 import { getMapAdDetail_Api } from "@/api/map.js";
+import $Config from "@/config/index.js";
 export default {
   data() {
     return {
@@ -19,8 +20,14 @@ export default {
       },
     };
   },
+  computed: {
+    adVideoUrl() {
+      return `${$Config.baseURL}/dev/file/download?id=${this.adDetail.videoUrl}`
+    },
+  },
   watch: {
-    "adDetail.description": { //富文本图片预览
+    "adDetail.description": {
+      //富文本图片预览
       handler(newV, oldV) {
         this.$nextTick(() => {
           let imgArr = document.getElementsByTagName("img");
@@ -31,7 +38,7 @@ export default {
                 console.log(imgArr[i]);
                 uni.previewImage({
                   urls: [imgArr[i].src],
-                })
+                });
               });
             }
           }