/**
 * [OElove] (C)2010-2099 oelove.com Webapp
 * Email: service@phpcoo.com ,phpcoo@qq.com
 * This is NOT a freeware, use is subject to license terms
 * $ Last update 2020/05/20 by CL $
*/
var _inst_oewxtips = null;
$(function () {
   
    function OEWxTips() {
        this._tips_dialog = null;
        this.slide_time = 200;
        
        this.initTips();
        
    }
    OEWxTips.prototype = {
        
        //初始化
        initTips:function() {
            var _this = this;
            var $has_tips = _getCookie('OE_WXQR_TIPS');
            if (typeof($has_tips) == 'undefined') {
                $has_tips = '';
            }
            _setCookie('OE_WXQR_TIPS', '1', 0.5); //半天后提示
            
            if ($has_tips != '1' && $("#wxqr_tips_tab").length > 0) {
                setTimeout(function(){
                    _this.clickTips();
                    _this.autoClose();
                }, 1100);
            }
        },
        
        //弹出提示
        clickTips:function() {
            var _this = this;
            $("#wxqr_tips_tab").show();
            
            //打开关注
            $(document).on("click", "[f='but_open_wxqr']", function(){
                $("#wxqr_tips_tab").hide();
                _this._tips_dialog = OEUI.Dialog({
                    el: '#wxqr_dialog',
                    animated: 'zoomIn',
                    time: _this.slide_time,
                    type: 2
                });
            });
            
            //关闭关注
            $(document).on("click", "[f='close_wxqr_dialog']", function(){
                $("#wxqr_tips_tab").hide();
                if (_this._tips_dialog) {
                    _this._tips_dialog.hide();
                }
            });
        },
        
        //自动关闭
        autoClose:function() {
            setTimeout(function(){
                $("#wxqr_tips_tab").hide();
            }, 10000);
        }
    }
    _inst_oewxtips = new OEWxTips();
});
