Ver código fonte

切换页面关闭生成的海报

jwyu 2 anos atrás
pai
commit
1f3fe6a36c
2 arquivos alterados com 12 adições e 1 exclusões
  1. 5 1
      pages/activity/activity.vue
  2. 7 0
      pages/chart/chart.vue

+ 5 - 1
pages/activity/activity.vue

@@ -193,6 +193,7 @@
                 code_scene:'',
                 data:shareParams
             }"
+            v-if="showPoster"
         ></sharePoster>
     </view>
 </template>
@@ -309,6 +310,8 @@ export default {
                 audioTime:0,//当前音频时间
                 audioCurrentUrl:'',//当前音频地址
             },
+
+            showPoster:true
         }
     },
     onLoad() {
@@ -318,6 +321,7 @@ export default {
         this.addEventListenerRegister()
     },
     onShow() {
+        this.showPoster=true
         if(this.$store.state.activity.activityListPageRefresh){
             if(this.isInit) return
             this.allRefresh()
@@ -335,10 +339,10 @@ export default {
 		})
     },
     onHide(){
+        this.showPoster=false
         this.pupData.show=false
         this.currentAudioMsg.show=false
         // 存一次音频信息
-        
         uni.setStorageSync('audioMsg', JSON.stringify(this.currentAudioMsg))
     },
     onUnload(){

+ 7 - 0
pages/chart/chart.vue

@@ -102,6 +102,7 @@
         code_scene:'',
         data:shareParams
       }"
+      v-if="showPoster"
     ></sharePoster>
 </template>
 
@@ -159,6 +160,8 @@ export default {
 
           hasAuth:true,//是否有权限
           noAuthData:null,//没有权限时传给无权限组件的值
+
+          showPoster:true
         }
     },
     onLoad() {
@@ -166,11 +169,15 @@ export default {
       this.addEventListenerSelectClassify()
     },
     onShow() {
+      this.showPoster=true
       this.getClassifyList()
       // if(!this.hasAuth){
       //   this.getClassifyList()
       // }
     },
+    onHide() {
+      this.showPoster=false
+    },
     onUnload(){
       uni.$off('classifyPageSelect')
     },