xuqiaoying преди 3 години
родител
ревизия
2c02e64216
променени са 2 файла, в които са добавени 11 реда и са изтрити 9 реда
  1. 0 1
      App.vue
  2. 11 8
      pages/index/index.vue

+ 0 - 1
App.vue

@@ -15,7 +15,6 @@ export default {
   },
   methods: {},
   onShow: function (option) {
-    console.log('onShow监听小程序显示', option, option.scene)
     this.$store.commit('setScene', option.scene || 0)
   },
   onHide: function () {

+ 11 - 8
pages/index/index.vue

@@ -179,7 +179,7 @@
 			<text>asdsufd</text>
 			<official-account></official-account>
 		</view> -->
-		<view :style="{'opacity':opacity}" class="officials">
+		<view :style="{'opacity':opacitys}" class="officials">
 			<view class="weixin_official_account">
 				<image class="off_logo" src="/static/index/official.png"></image>
 				<view>
@@ -260,7 +260,7 @@ export default {
 			current: 0,
             // tabbarlist: this.$store.state.tabLists,
 			showOfficial: false,
-			opacity: 1,
+			// opacity: 1,
 			isFollow: null, //是否关注过,不是1就是没关注
 			curClose: true, // 当天时是否关闭过
 		};
@@ -327,12 +327,19 @@ export default {
 		}
 	},
 	onShareAppMessage(res) {
-		var self = this;
 		return {
 			title: '中正',
 			path: `/pages/index/index?inviteCode=` + userInfo == null ? '' : userInfo.userAccount
 		};
 	},
+	computed: { 
+		...mapGetters(['dictObj','userInfo']),
+		opacitys() {
+			const value = [1011,1017,1025,1047,1124].includes(this.$store.state.scene) && this.isLogin && (this.isFollow != 1) && this.curClose ? 1 : 0
+			console.log('this.opacity::', value)
+			return value
+		},
+	},
 	methods: {
 		...mapActions(['getUserInfo','appCommonConfig']),
 		getInfo() {
@@ -342,8 +349,6 @@ export default {
 					this.$store.state.userInfo = res.data.data
 					this.isFollow = res.data.data.userFollowWx // 不是1就是没关注
 					console.log('有没有关注', this.isFollow, this.isFollow != 1)
-					this.opacity = [1011,1017,1025,1047,1124].includes(this.$store.state.scene) && this.isLogin && (this.isFollow != 1) && this.curClose ? 1 : 0
-					console.log('this.opacity', this.opacity)
 				}
 			})
 		},
@@ -363,8 +368,6 @@ export default {
 			}else{
 				uni.setStorageSync("endTime", end) //存入当天晚上23:59:59秒的毫秒数
 			}
-			this.opacity = [1011,1017,1025,1047,1124].includes(this.$store.state.scene) && this.isLogin && (this.isFollow != 1) && this.curClose ? 1 : 0
-			console.log('this.opacity-', this.opacity)
 		},
 		closeOff() {
 			this.curClose = false
@@ -705,7 +708,7 @@ export default {
 		}
 	},
 	onReachBottom() {},
-	computed: { ...mapGetters(['dictObj','userInfo']) },
+	
 };
 </script>