guoxiaohuan 4 anni fa
parent
commit
68bc3231e4
1 ha cambiato i file con 24 aggiunte e 10 eliminazioni
  1. 24 10
      src/views/overview/index.vue

+ 24 - 10
src/views/overview/index.vue

@@ -266,22 +266,36 @@ export default {
             } else {
                 return ''
             }
+        },
+        init() {
+            //预览是否开启
+            // let previewUrl = location.href.split('?')[1]
+            // if (previewUrl) {
+            //     previewUrl = Boolean(previewUrl.split('=')[1])
+            //     this.$store.commit('SETISPREVIEW', previewUrl)
+            // }
+            let previewUrl = this.$route.query.previewUrl,
+                plazaId = this.$route.query.plazaId
+            if (previewUrl != '') {
+                console.log(previewUrl)
+                this.$store.commit('SETISPREVIEW', previewUrl)
+            }
+            if (plazaId) {
+                localStorage.setItem('PLAZAID', plazaId)
+                this.$store.commit('STOREPLAZAID', plazaId)
+            }
+            // let previewUrl = location.href.split('=')[1] ? location.href.split('=')[1].split('&')[0] : false,
+            // plazaId = location.href.split('=')[2] ? location.href.split('=')[2] : '1000423'
         }
     },
     mounted() {
-        //预览是否开启
-        // let previewUrl = location.href.split('?')[1]
-        // if (previewUrl) {
-        //     previewUrl = Boolean(previewUrl.split('=')[1])
-        //     this.$store.commit('SETISPREVIEW', previewUrl)
-        // }
-        let previewUrl = location.href.split('=')[1] ? location.href.split('=')[1].split('&')[0] : false,
-            plazaId = location.href.split('=')[2] ? location.href.split('=')[2] : '1000423'
-        this.$store.commit('SETISPREVIEW', previewUrl)
         this.query()
     },
+    created() {
+        this.init()
+    },
     computed: {
-        ...mapGetters(['isPreview', 'pic'])
+        ...mapGetters(['isPreview', 'pic', 'plazaId'])
     },
     components: {
         PicModal