zhengjinyi пре 2 година
родитељ
комит
2d85369499
3 измењених фајлова са 10 додато и 4 уклоњено
  1. 2 2
      mixins/appMixins.js
  2. 2 1
      pages/tabBar/home/index.js
  3. 6 1
      store/index.js

+ 2 - 2
mixins/appMixins.js

@@ -3,7 +3,7 @@ import { mapState,mapMutations} from 'vuex'
 import authorize from '@/common/config/authorize.js'
 const appMixins = {
     computed: {
-        ...mapState(['hasLogin','isWxAuthorize'])
+        ...mapState(['hasLogin','isWxAuthorize','couponEntry'])
     },
     methods: {
         ...mapMutations(['login','logout','updateNoticeNum','updateRossShow']),
@@ -27,7 +27,7 @@ const appMixins = {
                     this.$store.commit('updateStatus',error.data)
                     this.updateRossShow()
                     uni.setStorageSync('unionId',error.data.unionId)
-                    if(!this.hasLogin){
+                    if(!this.hasLogin && this.couponEntry === 1){
                         if(uni.getStorageSync('isActivitySwitch')){
                             const  lockTime = uni.getStorageSync('lockTime')
                             const  eTime = this.diffTime(lockTime)

+ 2 - 1
pages/tabBar/home/index.js

@@ -100,7 +100,8 @@ const homeMiXins = {
         			this.couponEntry = data.couponEntry
         			this.newsList = data.annlist
                     this.quickOpreaList = data.shortcutList || [] // 快捷运营
-        			if (!this.hasLogin && this.couponEntry == 1) {
+        			if (!this.hasLogin && this.couponEntry === 1) {
+                        this.$store.commit('updateCouponEntry', data.couponEntry)
         				if (uni.getStorageSync('isActivitySwitch')) {
         					this.$store.commit('setActivity', false)
         				} else {

+ 6 - 1
store/index.js

@@ -14,11 +14,12 @@ const store = new Vuex.Store({
         userInfo: {},
         identity: 0,
         noticeNum:0,
+        couponEntry:0, // 活动状态
         clubType: 0, // 1: 医美机构  2:生美机构 (医美、生美机构类型)
         wechatUserInfo: {},
         cartNumber: 0,
         isIphoneX: false,
-        isActivity: false,
+        isActivity: false, // 首页活动弹窗
         isLoginType: 0,
         isLoginProductId: 0,
         isManage: false,// 是否是管理员或者小组长
@@ -135,7 +136,11 @@ const store = new Vuex.Store({
                 })
             }
         },
+        updateCouponEntry(state, couponEntry){// 记录是否有优惠券
+            state.couponEntry = couponEntry
+        },
         setActivity(state, variable) { // 记录活动弹窗状态
+           
             state.isActivity = variable
         },
         setChangeVar(state, variable) {