فهرست منبع

swkk热点详情页标题取值逻辑

任一存 3 سال پیش
والد
کامیت
58c3ea95d7
3فایلهای تغییر یافته به همراه7 افزوده شده و 39 حذف شده
  1. 7 3
      src/components/HotspotDetail.vue
  2. 0 2
      src/utils.js
  3. 0 34
      src/views/SwkkView.vue

+ 7 - 3
src/components/HotspotDetail.vue

@@ -265,7 +265,7 @@ export default {
         })
         for (const mediaItem of hotspot.media[hotspot.type]) {
           targetTypeItem.list.push({
-            title: mediaItem.name || hotspot.content,
+            title: hotspot.content || hotspot.title.split('&')[0],
             url: mediaItem.src,
           })
         }
@@ -306,10 +306,14 @@ export default {
             on: {
               afterInit: function (e) {
                 if (that.typesForShow[vNew].key === 'video') {
-                  that.$refs.video[0].play()
+                  that.$nextTick(() => {
+                    that.$refs.video[0].play()
+                  })
                 }
                 if (that.typesForShow[vNew].key === 'audio') {
-                  that.$refs['audio-comp'][0].play()
+                  that.$nextTick(() => {
+                    that.$refs['audio-comp'][0].play()
+                  })
                 }
               },
               slideChange: function(e) {

+ 0 - 2
src/utils.js

@@ -276,8 +276,6 @@ export class MessageCenter {
   }
 
   publish(message, param) {
-    console.log(this._recorder)
-
     if (Object.prototype.hasOwnProperty.call(this._recorder, message)) {
       this._recorder[message].forEach((callback) => {
         callback(param)

+ 0 - 34
src/views/SwkkView.vue

@@ -238,7 +238,6 @@ export default {
   beforeCreate() {
   },
   beforeMount() {
-    console.log('sdfsdfsdf', this.$route.query)
     if (this.$route.query.isMuted === 'false') {
       this.setIsMuted(false)
       let newHref = location.href.substring(0, location.href.length - 14)
@@ -338,39 +337,6 @@ export default {
     }).then((TagView) => {
       // 监听手动点击事件
       TagView.on("click", (e) => {
-        // // 点击热点的时候当前背景音乐的播放状态
-        // let dom = document.querySelector("#bacMusic")
-        // window.bacMusic = !dom.paused
-        // setTimeout(() => {
-        //   this.$refs.RbottomRef.opMusic(false)
-        // }, 200)
-        console.log(e.data)
-        const example1 = {
-          content: "<p>《胡乔木为他题词“浩气长存”》</p>",
-          icon: "http://4dkk.4dage.com/v4/sdk/4.2.0/images/tag_icon_default.svg",
-          media: {
-            image: [
-              { src: "q0AbKQ789922.jpeg" },
-              { src: "kfhFHmL789632.jpeg" },
-            ],
-          },
-          sid: "WfndN9Z789888",
-          title: "陈处泰",
-          type: "image",
-        }
-
-        const example2 = {
-          content: "<p>汪裕先烈士狱中致姐姐的信</p>",
-          media: {
-            image: [
-              { src: "q0AbKQ789922.jpeg" },
-              { src: "kfhFHmL789632.jpeg" },
-            ],
-          },
-          sid: "XQT0F8570262",
-          title: "汪裕先&27&show",
-          type: "image"
-        }
 
         this.relatedHotspotList = []
         if (e.data.title.split("&")[1]) { // 如果是多个热点合并