向浏览器写入缓存信息:【key : value】形式

    function initReviewTipShow() {
        // 如果是第一次打开,关闭后不再显示
        if (reviewTip && reviewTip > 0) {
            var cookies_name = 'ZEROBOOK_ENDED_COURSE_TIP';
            var endedCourseCookie = $.cookie(cookies_name);
            var show = true;
            if (endedCourseCookie && endedCourseCookie != '') {
                endedCourseCookie = endedCourseCookie.split('_');
                if (endedCourseCookie && endedCourseCookie.length == 2) {
                    var oldUserId = endedCourseCookie[0];
                    var hasShow = endedCourseCookie[1];
                    if (parseInt(oldUserId) == reviewTip && hasShow == 'true') {
                        show = false;
                    }
                }
            }
            if (show && validBackPlayTime) {
                $(".mui-navigate-right").after(
                        '<div class="mui-review-tips" id="reviewTip" >' + validBackPlayTime
                                + '天内结束课程可回看哦~<i class="icon"></i></div>');
                $.cookie(cookies_name, reviewTip + '_true');
            }
        }
    }

猜你喜欢

转载自blog.csdn.net/weixin_42178492/article/details/81871055
今日推荐