Browse Source

优惠券相关修改调试

yuwenjun1997 3 năm trước cách đây
mục cha
commit
485c916a36

+ 5 - 5
App.vue

@@ -1,14 +1,14 @@
 <script>
 export default {
-	onLaunch: function() {
-		this.$store.dispatch('app/initDevice')
-	}
+    onLaunch: function() {
+        this.$store.dispatch('app/initDevice')
+    }
 }
 </script>
 
 <style lang="scss">
 page {
-	min-height: 100%;
-	background: #f7f7f7;
+    min-height: 100%;
+    background: #f7f7f7;
 }
 </style>

+ 31 - 31
common/storage.js

@@ -7,48 +7,48 @@ const encryptFlag = process.env.NODE_ENV === 'production'
 const prefix = 'HEHE_'
 
 // 缓存有效期 默认有效期为15天
-const expiredTime = '15 * 24 * 60 * 60 * 1000'
+const expiredTime = 15 * 24 * 60 * 60 * 1000
 
 
 // 从缓存中读取数据(期限)
 export function setStorage(key, value, options = {}) {
-	if (!options.expiredTime) {
-		options.expiredTime = expiredTime
-	}
-	const nowTime = Date.now()
-	// 加密
-	if (encryptFlag) {
-		value = encrypt(value)
-	}
-	const payload = {
-		expiredTime: nowTime + options.expiredTime,
-		data: value
-	}
-	key = prefix + key
-	uni.setStorageSync(key, payload)
+    if (!options.expiredTime) {
+        options.expiredTime = expiredTime
+    }
+    const nowTime = Date.now()
+    // 加密
+    if (encryptFlag) {
+        value = encrypt(value)
+    }
+    const payload = {
+        expiredTime: nowTime + options.expiredTime,
+        data: value
+    }
+    key = prefix + key
+    uni.setStorageSync(key, payload)
 }
 
 // 将数据添加到缓存中(期限)
 export function getStorage(key) {
-	key = prefix + key
-	const nowTime = Date.now()
-	const payload = uni.getStorageSync(key)
-	if (nowTime > payload.expiredTime) {
-		uni.removeStorageSync(key)
-		return null
-	}
-
-	// 解密
-	if (encryptFlag) {
-		payload.data = decrypt(payload.data)
-	}
-
-	return payload.data
+    key = prefix + key
+    const nowTime = Date.now()
+    const payload = uni.getStorageSync(key)
+    if (nowTime > payload.expiredTime) {
+        uni.removeStorageSync(key)
+        return null
+    }
+
+    // 解密
+    if (encryptFlag) {
+        payload.data = decrypt(payload.data)
+    }
+
+    return payload.data
 }
 
 const install = Vue => {
-	Vue.prototype.$setStorage = setStorage
-	Vue.prototype.$getStorage = getStorage
+    Vue.prototype.$setStorage = setStorage
+    Vue.prototype.$getStorage = getStorage
 }
 
 export default install

+ 115 - 0
components/views/cm-active-alert/cm-active-alert.vue

@@ -0,0 +1,115 @@
+<template>
+    <view>
+        <view class="notice-model" v-if="couponNoticeFlag" @click="toDetail('notice')">
+            <image :src="staticUrl + 'logo.png'" class="cover"></image>
+            <view class="content">
+                <text class="title">颜选美学</text>
+                <text class="subTitle">您已获得优惠券奖励,赶紧去领取吧!</text>
+            </view>
+        </view>
+        <uni-popup ref="activeAlertPopup" type="center" :is-mask-click="false">
+            <view class="popup-content">
+                <view class="close-btn iconfont icon-iconfontguanbi" @click="onClose"></view>
+                <image class="image" :src="image" @click="toDetail('active')" mode="widthFix"></image>
+            </view>
+        </uni-popup>
+    </view>
+</template>
+
+<script>
+import { mapGetters, mapActions } from 'vuex'
+export default {
+    computed: {
+        ...mapGetters(['couponAlertType', 'couponNoticeFlag', 'userId']),
+        image() {
+            let iconName = 'get'
+            if (this.couponAlertType === 1) iconName = 'get'
+            if (this.couponAlertType === 2) iconName = 'news'
+            return `${this.staticUrl}icon-coupons-${iconName}.png`
+        }
+    },
+    watch: {
+        couponAlertType(nval) {
+            const activeFlag = this.$getStorage('ACTIVE_FLAG')
+            if (nval > 0 && !activeFlag) {
+                this.$refs.activeAlertPopup.open()
+            }
+        }
+    },
+    methods: {
+        onClose() {
+            this.$store.commit('coupon/SET_COUPON_ALERT_TYPE', this.couponAlertType - 1)
+            if (this.couponAlertType === 0) {
+                this.$refs.activeAlertPopup.close()
+            }
+        },
+        toDetail(type) {
+            if (type === 'notice') {
+                this.$store.commit('coupon/SET_COUPON_NITICE_FLAG', false)
+            } else {
+                if (this.userId) {
+                    this.$setStorage('ACTIVE_FLAG', true)
+                }
+                this.onClose()
+            }
+            this.$router.navigateTo('coupon/coupon-receive')
+        }
+    }
+}
+</script>
+
+<style lang="scss" scoped>
+.notice-model {
+    @extend .cm-flex-between;
+    @extend .fixed-top;
+    padding: 16rpx 40rpx;
+    background: rgba(0, 0, 0, 0.7);
+    width: 750rpx;
+    box-sizing: border-box;
+
+    .cover {
+        width: 78rpx;
+        height: 78rpx;
+        border-radius: 50%;
+    }
+
+    .content {
+        display: flex;
+        flex: 1;
+        flex-direction: column;
+        align-items: flex-start;
+        justify-content: center;
+        margin-left: 24rpx;
+        .title {
+            font-size: 26rpx;
+            color: #fff;
+        }
+        .subTitle {
+            font-size: 26rpx;
+            color: #fff;
+            margin-top: 10rpx;
+        }
+    }
+}
+.popup-content {
+    @extend .cm-flex-center;
+    flex-direction: column;
+    align-items: flex-end;
+    .image {
+        display: block;
+        max-width: 600rpx;
+    }
+    .close-btn {
+        text-align: center;
+        line-height: 38rpx;
+        margin-bottom: 16rpx;
+        margin-right: 36rpx;
+        width: 36rpx;
+        height: 36rpx;
+        border-radius: 50%;
+        border: 2rpx solid #fff;
+        color: #fff;
+        font-size: 28rpx;
+    }
+}
+</style>

+ 6 - 1
components/views/cm-coupon-area/cm-coupon-area.vue

@@ -12,7 +12,9 @@
             :autoplay="false"
         >
             <template v-slot:slide="{ row }">
-                <view class="swiper-slide"><cm-coupon :couponData="row" controlType="receive"></cm-coupon></view>
+                <view class="swiper-slide">
+                    <cm-coupon :couponData="row" :controlType="row.controlType" @click="onCouponClick"></cm-coupon>
+                </view>
             </template>
         </cm-simple-swiper>
     </view>
@@ -45,6 +47,9 @@ export default {
     methods: {
         onChange(e) {
             this.current = e.current
+        },
+        onCouponClick(coupon) {
+            this.$emit('click', coupon)
         }
     }
 }

+ 12 - 0
components/views/cm-coupon/cm-coupon.vue

@@ -179,11 +179,23 @@ export default {
         },
         // 跳转商品列表
         clickToList() {
+            this.useCoupon()
             this.$emit('click', this.couponData)
         },
         // 选择/勾选
         clickChoose() {
             this.$emit('click', this.couponData)
+        },
+        // 使用优惠券
+        useCoupon() {
+            const productType = this.couponData.productType
+            if (productType === 1) {
+                console.log('全部商品可用')
+                this.$router.switchTab('home')
+            } else {
+                console.log('部分商品可用')
+                this.$router.navigateTo(`goods/goods-coupon-list?couponId=${this.couponData.couponId}`)
+            }
         }
     }
 }

+ 5 - 1
components/views/cm-simple-swiper/cm-simple-swiper.vue

@@ -72,6 +72,10 @@ export default {
         padding: {
             type: String,
             default: '0'
+        },
+        autoFill: {
+            type: Boolean,
+            default: false
         }
     },
     computed: {
@@ -113,7 +117,7 @@ export default {
             const result = []
             const count = this.rows * this.columns
             // 一屏仅有一个时
-            if (count === 1) {
+            if (count === 1 || !this.autoFill) {
                 return list
             }
             let start = 0

+ 6 - 0
pages.json

@@ -127,6 +127,12 @@
                     "navigationBarTitleText": "商品列表",
                     "enablePullDownRefresh": false
                 }
+            }, {
+                "path": "goods-coupon-list",
+                "style": {
+                    "navigationBarTitleText": "商品列表",
+                    "enablePullDownRefresh": false
+                }
             }, {
                 "path": "goods-floor",
                 "style": {

+ 1 - 0
pages/index/index.vue

@@ -29,6 +29,7 @@ export default {
         },
         // 初始化用户信息
         async initUserInfo() {
+            this.$setStorage('ENTRY_MARK_TYPE', 'YES')
             const user = this.$getStorage('USER_INFO')
             if (user) {
                 // 用户已登录

+ 21 - 2
pages/tabBar/category/category.vue

@@ -21,13 +21,15 @@
             @scroll="onScroll"
         >
             <view class="cate" v-for="cate in categories" :key="cate.id">
-                <image class="cate-icon" :src="cate.image"></image> <view class="cate-name" v-text="cate.name"></view>
+                <image class="cate-icon" :src="cate.image"></image>
+                <view class="cate-name" v-text="cate.name"></view>
             </view>
         </scroll-view>
     </view>
 </template>
 
 <script>
+import { fetchProductTypeFirst, fetchProductTypeSecond } from '@/services/api/goods.js'
 export default {
     data() {
         return {
@@ -183,6 +185,9 @@ export default {
             scrollTop: 100
         }
     },
+    onShow() {
+        this.fetchProductTypeFirst()
+    },
     methods: {
         onClick(item, index) {
             this.current = index
@@ -191,9 +196,23 @@ export default {
                 this.scrollTop = 0
             })
         },
+
         onScroll(e) {
             this.oldScrollTop = e.detail.scrollTop
-        }
+        },
+
+        // 获取一级商品分了列表
+        async fetchProductTypeFirst() {
+            try {
+                const { data } = await fetchProductTypeFirst()
+                console.log(data)
+            } catch (e) {
+                console.log(e)
+            }
+        },
+
+        // 获取二级商品分了列表
+        fetchProductTypeSecond() {}
     }
 }
 </script>

+ 30 - 7
pages/tabBar/home/home.vue

@@ -29,7 +29,7 @@
         <!-- 优惠券专区 -->
         <view class="coupon-area" v-if="couponList.length > 0">
             <cm-floor-title title="优惠券专区" @click="onMoreCoupon"></cm-floor-title>
-            <cm-coupon-area :couponList="couponList"></cm-coupon-area>
+            <cm-coupon-area :couponList="couponList" @click="onCouponClick"></cm-coupon-area>
         </view>
 
         <!-- 楼层区域 -->
@@ -40,6 +40,9 @@
                 @more="onMoreProduct"
             ></cm-floor-template>
         </view>
+
+        <!-- 优惠券活动弹窗 -->
+        <cm-active-alert></cm-active-alert>
     </view>
 </template>
 
@@ -65,23 +68,27 @@ export default {
         ...mapGetters(['userId'])
     },
     onPullDownRefresh() {
-        setTimeout(() => uni.stopPullDownRefresh(), 2000)
+        this.initHomeInfo()
     },
     onShareAppMessage() {
         const shareData = { type: 0, inviteUserId: this.userId }
         return shareDataResult(shareData)
     },
     onShow() {
-        this.fetchCartKindCount()
+        this.fetchCartKindCount() // 购物车商品数量
+        this.checkCouponAlert() // 优惠券弹窗
     },
     onLoad() {
         this.initHomeInfo()
     },
     methods: {
         ...mapActions('cart', ['fetchCartKindCount']),
+        ...mapActions('coupon', ['checkCouponAlert']),
 
         // 搜索
-        handleToSearch() {},
+        handleToSearch() {
+            this.$router.navigateTo('goods/goods-search')
+        },
 
         // 金刚区菜单导航
         onNavbarClick(navbar) {
@@ -97,6 +104,17 @@ export default {
             this.$router.navigateTo('coupon/coupon-receive')
         },
 
+        // 优惠券点击(领取)
+        onCouponClick(coupon) {
+            coupon = { ...coupon }
+            if (coupon.controlType === 'receive') {
+                const index = this.couponList.findIndex(item => item.couponId === coupon.couponId)
+                this.couponList.splice(index, 1)
+                coupon.controlType = 'use'
+                this.$set(this.couponList, index, coupon)
+            }
+        },
+
         // 商品楼层轮播图点击事件
         onBannerClick(banner) {
             console.log(banner)
@@ -117,12 +135,11 @@ export default {
         },
 
         // 初始化首页信息
-        async initHomeInfo() {
+        initHomeInfo() {
             this.fetchCarousel()
             this.fetchNavbar()
             this.fetchFloorData()
             this.fetchCouponList()
-            this.isRequest = false
         },
 
         // 获取轮播图列表
@@ -151,6 +168,9 @@ export default {
                 const resultFloorData = await fetchHomeFloorData({ userId: this.userId }) // 商品楼层信息
                 this.floorInfo = resultFloorData.data.page
                 this.floorList = resultFloorData.data.floorList
+                // 楼层信息加载成功
+                this.isRequest = false
+                uni.stopPullDownRefresh()
             } catch (e) {
                 console.log('获取楼层信息失败')
             }
@@ -160,7 +180,10 @@ export default {
         async fetchCouponList() {
             try {
                 const resultCouponData = await fetchHomeCouponList({ userId: this.userId })
-                this.couponList = resultCouponData.data
+                this.couponList = resultCouponData.data.map(item => {
+                    item.controlType = 'receive'
+                    return item
+                })
             } catch (e) {
                 console.log('获取优惠券列表失败')
             }

+ 2 - 2
pages/views/goods/config/config.js

@@ -30,10 +30,10 @@ export function makeQuery() {
         userId: '',
         homeFloorId: '',
         homeTypeId: '',
-        listType: '',
+        listType: 1,
         productIds: '',
         smallTypeId: '',
-        sortType: '',
+        sortType: 1,
         name: '',
         pageNum: 1,
         pageSize: 12

+ 8 - 0
pages/views/goods/goods-coupon-list.vue

@@ -0,0 +1,8 @@
+<template>
+</template>
+
+<script>
+</script>
+
+<style>
+</style>

+ 49 - 19
pages/views/goods/goods-list.vue

@@ -3,7 +3,7 @@
         <tui-skeleton v-if="isRequest" :loadingType="3" :isLoading="true"></tui-skeleton>
         <view class="sticky-top">
             <!-- 搜索框 -->
-            <cm-simple-search @search="onSearch" @cancel="onCancel" v-model="keyword"></cm-simple-search>
+            <cm-simple-search @search="onSearch" @cancel="onCancel" v-model="listQuery.name"></cm-simple-search>
             <!-- 筛选 -->
             <goods-filter @filter="onFilter"></goods-filter>
         </view>
@@ -14,9 +14,11 @@
             </view>
         </view>
         <!-- 加载更多 -->
-        <cm-loadmore :hasNextPage="hasNextPage" :isLoading="isLoading" :visiable="!isRequest"></cm-loadmore>
+        <cm-loadmore :hasNextPage="hasNextPage" :isLoading="isLoading" :visiable="!hideLoadmore"></cm-loadmore>
         <!-- 回到顶部 -->
         <tui-scroll-top :scrollTop="scrollTop" :bottom="30" :duration="600"></tui-scroll-top>
+        <!-- 安全区域 -->
+        <cm-safe-area-bottom v-if="hideLoadmore"></cm-safe-area-bottom>
     </view>
 </template>
 
@@ -30,7 +32,6 @@ export default {
         return {
             isRequest: true,
             scrollTop: 0,
-            keyword: '',
             listQuery: makeQuery(),
             navInfo: {},
             productList: [],
@@ -40,7 +41,10 @@ export default {
         }
     },
     computed: {
-        ...mapGetters(['userId'])
+        ...mapGetters(['userId']),
+        hideLoadmore() {
+            return this.isRequest || this.productList.length <= this.listQuery.pageSize
+        }
     },
     onPageScroll(e) {
         this.scrollTop = e.scrollTop
@@ -52,10 +56,31 @@ export default {
         this.initQueryList()
     },
     methods: {
-        onSearch() {},
-        onCancel() {},
+        // 搜索商品
+        onSearch() {
+            this.filterProductList()
+        },
+
+        // 取消搜索
+        onCancel() {
+            this.listQuery.name = ''
+            this.filterProductList()
+        },
+
+        // 筛选商品
         onFilter(e) {
-            console.log(e)
+            const { current, sort } = e
+            if (current === 0) {
+                // 综合排序
+                this.listQuery.sortType = 1
+            } else if (current === 1) {
+                // 价格高低
+                this.listQuery.sortType = sort === 'desc' ? 3 : 2
+            } else {
+                // 最新上架
+                this.listQuery.sortType = 4
+            }
+            this.filterProductList()
         },
 
         // 初始化查询参数
@@ -65,14 +90,15 @@ export default {
             if (this.navInfo.type === 'navbar') {
                 // 从金刚区菜单进入
                 this.listQuery.homeTypeId = this.navInfo.id
-                this.listType = 2
+                this.listQuery.listType = 2
             } else if (this.navInfo.type === 'floor') {
                 // 从楼层进入
-                this.homeFloorId = this.navInfo.id
-                this.listType = 3
+                this.listQuery.homeFloorId = this.navInfo.id
+                this.listQuery.listType = 3
             } else if (this.navInfo.type === 'second') {
                 // 从二级菜单进入
-                this.smallTypeId = this.navInfo.id
+                this.listQuery.smallTypeId = this.navInfo.id
+                this.listQuery.listType = 4
             }
             this.fetchProductList()
         },
@@ -80,6 +106,14 @@ export default {
         // 加载更多
         loadMore() {
             if (!this.hasNextPage) return
+            this.isLoading = true
+            this.fetchProductList()
+        },
+
+        // 搜索商品
+        filterProductList() {
+            this.productList = []
+            this.listQuery.pageNum = 1
             this.fetchProductList()
         },
 
@@ -92,6 +126,7 @@ export default {
                 this.total = resultProductData.data.totalRecord
                 this.listQuery.pageNum++
                 this.isRequest = false
+                this.isLoading = false
             } catch (e) {
                 console.log('获取商品列表失败')
             }
@@ -105,16 +140,11 @@ export default {
     box-sizing: border-box;
     min-height: 100vh;
     .product-list {
-        // @extend .cm-flex-between;
-        // flex-wrap: wrap;
         display: grid;
         grid-template-columns: repeat(3, 1fr);
-        // grid-template-rows: repeat(2, 1fr);
-        grid-row-gap: 12rpx;
-        padding: 0 24rpx;
-        .product-item {
-            width: 224rpx;
-        }
+        grid-row-gap: 16rpx;
+        grid-column-gap: 16rpx;
+        padding: 16rpx 24rpx;
     }
 }
 </style>

+ 4 - 6
pages/views/goods/goods-search.vue

@@ -60,11 +60,14 @@
         </view>
         <!-- 操作弹窗 -->
         <tui-modal :show="removeKeywordModal" content="确认清空搜索历史记录?" @click="clearAllHistory"></tui-modal>
+        <!-- 安全区域 -->
+        <cm-safe-area-bottom v-if="!visiable"></cm-safe-area-bottom>
     </view>
 </template>
 
 <script>
 import { fetchProductList, fetchProductSearchHistory, clearProductSearchHistory } from '@/services/api/goods.js'
+import { makeQuery } from '@/pages/views/goods/config/config.js'
 import { debounce } from '@/common/utils.js'
 import { mapGetters } from 'vuex'
 
@@ -76,12 +79,7 @@ export default {
             keywordVisible: true,
             removeKeywordModal: false,
             keywordList: [],
-            listQuery: {
-                name: '',
-                userId: '',
-                pageNum: 1,
-                pageSize: 10
-            },
+            listQuery: makeQuery(),
             list: [],
             total: 0,
             hasNextPage: true

+ 18 - 0
services/api/goods.js

@@ -80,3 +80,21 @@ export function fetchProductActivityDetail(params) {
         params
     })
 }
+
+/* 获取一级商品分类列表 */
+export function fetchProductTypeFirst(params) {
+    return request({
+        url: '/product/type/first',
+        method: 'GET',
+        params
+    })
+}
+
+/* 获取二级商品分类列表 */
+export function fetchProductTypeSecond(params) {
+    return request({
+        url: '/product/type/second',
+        method: 'GET',
+        params
+    })
+}

+ 2 - 0
store/getters.js

@@ -9,6 +9,8 @@ const getters = {
     unusedNum: state => state.coupon.unusedNum,
     expiredNum: state => state.coupon.expiredNum,
     usedNum: state => state.coupon.usedNum,
+    couponAlertType: state => state.coupon.couponAlertType,
+    couponNoticeFlag: state => state.coupon.couponNoticeFlag,
     kindCount: state => state.cart.kindCount
 }
 

+ 76 - 38
store/modules/coupon.js

@@ -1,50 +1,88 @@
-import { fetchReceivedCouponCount, receiveCoupon } from '@/services/api/coupon.js'
+import { fetchReceivedCouponCount, receiveCoupon, checkCouponAlert } from '@/services/api/coupon.js'
 
 const state = {
-	expiredNum: 0, // 已过期
-	unusedNum: 0, // 未使用
-	usedNum: 0 // 已使用
+    expiredNum: 0, // 已过期
+    unusedNum: 0, // 未使用
+    usedNum: 0, // 已使用
+    couponAlertType: 0, // 优惠券弹窗类型 0: 不弹出  1: 全部用户 2: 新人用户
+    couponNoticeFlag: false // 新优惠券领取通知
 }
 
 const mutations = {
-	//设置优惠券数量
-	SET_COUPON_COUNT: (state, data) => {
-		state.expiredNum = data.expiredNum
-		state.unusedNum = data.unusedNum
-		state.usedNum = data.usedNum
-	}
+    //设置优惠券数量
+    SET_COUPON_COUNT: (state, data) => {
+        state.expiredNum = data.expiredNum
+        state.unusedNum = data.unusedNum
+        state.usedNum = data.usedNum
+    },
+
+    // 设置优惠券弹窗类型
+    SET_COUPON_ALERT_TYPE: (state, data) => {
+        typeof data === 'number' ? state.couponAlertType = data : state.couponAlertType++
+    },
+
+    // 设置新优惠券通知
+    SET_COUPON_NITICE_FLAG: (state, data) => {
+        state.couponNoticeFlag = data
+    }
 }
 
 const actions = {
-	// 领取优惠券
-	async receiveCoupon({ rootGetters, dispatch }, { couponId, couponShareId }) {
-		try {
-			const res = await receiveCoupon({ couponId, couponShareId, userId: rootGetters.userId })
-			uni.showToast({
-				icon: 'success',
-				title: '领取成功'
-			})
-			await dispatch('initCouponCount')
-			return res
-		} catch (e) {
-			console.log(e)
-		}
-	},
-	// 初始化已领取优惠券数量
-	async initCouponCount({ commit, rootGetters }) {
-		try {
-			const res = await fetchReceivedCouponCount({ userId: rootGetters.userId })
-			commit('SET_COUPON_COUNT', res.data)
-			return res
-		} catch (e) {
-			console.log(e)
-		}
-	}
+    // 领取优惠券
+    async receiveCoupon({ rootGetters, dispatch }, { couponId, couponShareId }) {
+        try {
+            const res = await receiveCoupon({ couponId, couponShareId, userId: rootGetters.userId })
+            uni.showToast({
+                icon: 'success',
+                title: '领取成功'
+            })
+            await dispatch('initCouponCount')
+            return res
+        } catch (e) {
+            console.log('领取优惠券失败')
+        }
+    },
+
+    // 初始化已领取优惠券数量
+    async initCouponCount({ commit, rootGetters }) {
+        try {
+            const res = await fetchReceivedCouponCount({ userId: rootGetters.userId })
+            commit('SET_COUPON_COUNT', res.data)
+            return res
+        } catch (e) {
+            console.log('初始化已领取优惠券数量失败')
+        }
+    },
+
+    // 优惠券弹窗验证
+    async checkCouponAlert({ commit, rootGetters }) {
+        try {
+            const result = await checkCouponAlert({ userId: rootGetters.userId })
+            const { newUserCouponFlag, actCouponFlag, otherCouponFlag } = result.data
+            // 活动优惠券弹窗(全部用户)
+            if (actCouponFlag !== 0) {
+                commit('SET_COUPON_ALERT_TYPE')
+            }
+            // 新用户优惠券弹窗(新用户)
+            if (newUserCouponFlag !== 0) {
+                commit('SET_COUPON_ALERT_TYPE')
+            }
+            // 其它优惠券弹窗(可领取优惠券弹窗)
+            if (otherCouponFlag !== 0) {
+                commit('SET_COUPON_NITICE_FLAG', true)
+                setTimeout(() => {
+                    commit('SET_COUPON_NITICE_FLAG', false)
+                }, 5000)
+            }
+        } catch (e) {
+            console.log('优惠券弹窗校验失败');
+        }
+    }
 }
 
 export default {
-	namespaced: true,
-	state,
-	mutations,
-	actions
+    namespaced: true,
+    state,
+    mutations,
+    actions
 }