<template>
    <view>
        <rule-pop ref="appNotice" notice-check></rule-pop>
    </view>
</template>

<script>

export default {
    name: 'home-page-tanchuang',
    data() {
        return {

        }
    },
    methods: {
        checkNotice() {
            let is_shou_tan = this.$config.getBaseConfigKey("is_shou_tan");
            if (is_shou_tan != 1) {
                return;
            }
            /* 上次勾选(今日不再提醒)的日期 */
            const _last_notice_date = uni.getStorageSync("_last_notice_date");
            /* 本次打开app是否已经弹过公告弹窗 */
            const _is_this_show = uni.getStorageSync("_is_this_show");
            const nowDate = this.$c.getDateTime();
            if (_last_notice_date != nowDate && !_is_this_show) {
                this.$refs.appNotice.getRule(19, "公告");
                uni.setStorageSync("_is_this_show", true);
            }
        }
    },
    mounted() {
        this.checkNotice();
    }
}
</script>

<style lang="scss" scoped></style>