/* 未能缩小。正在返回未缩小的内容。
(1,10): run-time error CSS1031: Expected selector, found '='
(1,10): run-time error CSS1025: Expected comma or open brace, found '='
(3,22): run-time error CSS1019: Unexpected token, found '$'
(3,24): run-time error CSS1030: Expected identifier, found '^'
(3,24): run-time error CSS1019: Unexpected token, found '^'
(3,28): run-time error CSS1031: Expected selector, found '('
(3,28): run-time error CSS1025: Expected comma or open brace, found '('
(3,71): run-time error CSS1002: Unterminated string: ']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/,
 */
var area = "",
    gourl = $.cookie("gourl") ? $.cookie("gourl") : "/Recycle/Login/UserCenter",
    reg = /^(1)\d{10}$|^\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/,
    veiPhone = /^(1)\d{10}$/,
    IDCard = /^\d{6}(18|19|20)?\d{2}(0[1-9]|1[12])(0[1-9]|[12]\d|3[01])\d{3}(\d|X)$/i,
    otcode = /^\d{6}$/,
    accountReg = /^[A-Za-z\d.@]+$/,
    sessionid = $.cookie("GUMA-SessionId") ? $.cookie("GUMA-SessionId") : "",
    isweixin = false,
    hostList = ['localhost,webapi.251.bolext.cn,unicomwap.251.bolext.cn', 'ltm.igooma.cn', 'b251.365xs.cn', 'wifi.365xs.cn','unicomwap2.251.bolext.cn'],
    urlList = ['http://webapi.251.bolext.cn/', 'https://webapi.igooma.cn/', 'https://a251.365xs.cn/', 'https://a251.365xs.cn/','http://webapi.251.bolext.cn/'],
    urlbase = urlList[hostList.findIndex(item => item.indexOf(location.hostname) > -1)];
var ua = navigator.userAgent.toLowerCase();
if (ua.match(/MicroMessenger/i) == "micromessenger") {
    isweixin = true;
} else {
    isweixin = false;
}
var date = new Date();
date.setTime(date.getTime() + (10 * 60 * 1000));

var fromtype = "";
function getUrlParam(name) {
    var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
    var r = window.location.search.substr(1).match(reg);
    if (r != null) return unescape(r[2]);
    return null;
}
var channelid = '1008';
var version = '1.0.0.0';

var guMenuOpen = false;
$(".guCon").click(function () {
    if (!guMenuOpen) {
        $("ul.guList").show();
        guMenuOpen = true;
    } else {
        $("ul.guList").hide();
        guMenuOpen = false;
    }
});

function getTrack(name, text) {
    $.ajax({
        type: "post",
        dataType: "json",
        url: urlbase + "public/buried/add",
        data: {
            sessionid: sessionid,
            channelid: channelid,
            version: version,
            platform: platform,
            name: name,
            text: text
        },
        success: function (data) {
        },
        error: function () {
        }
    })
}

//统一进入登录页
function GoToLogin(p,c, r) {//p渠道，r登录成功后返回地址
    if (p == 'yunji') {//云集需要进入自己的登录
        $.cookie("returnUrl", r, { expires: date, path: '/' });
        if (urlbase.indexOf("251") > -1) {//测试环境
            location.href = "https://t.yunjiglobal.com/yunjibuyer/goThirdPartyTransfer.json?landingPageId=1091";
        } else {//正式环境
            location.href = "https://m.yunjiglobal.com/yunjibuyer/goThirdPartyTransfer.json?landingPageId=12";
        }
    } else {
        location.href = "/Recycle/Login?returnUrl=" + r;
    }
}

//alert的方法
function alert(a) {
    layer.msg(a);
}
//检验为空
function empty(v) {
    if (v == "undefined")
        return true;

    switch (typeof v) {
        case 'undefined': return true;
        case 'string': if (v.length == 0) return true; break;
        case 'boolean': if (!v) return true; break;
        case 'number': if (0 === v) return true; break;
        case 'object':
            if (null === v) return true;
            if (undefined !== v.length && v.length == 0) return true;
            for (var k in v) { return false; } return true;
            break;
    }
    return false;
}
function hashCode(str) {
    var h = 0;
    var len = str.length;
    var t = 2147483648;
    for (var i = 0; i < len; i++) {
        h = 31 * h + str.charCodeAt(i);
        if (h > 2147483647) h %= t;
    }
    return h;
}
function getCoupon13864() {
    $.ajax({
        type: "post",
        dataType: "json",
        url: urlbase + "activity/receivecouponlist",
        data: {
            sessionid: sessionid,
            channelid: channelid,
            version: version,
            platform: platform,
            couponIds: '2364,2365,2366,2368,2369'
        }
    })
}
function getQiyu() {
    var timestamp = (new Date()).valueOf();
    var myRandom = ''
    var str = '',
        range = 6,
        arr = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'];
    // 随机产生
    for (var i = 0; i < range; i++) {
        pos = Math.round(Math.random() * (arr.length - 1));
        str += arr[pos];
    }
    var code = hashCode(str + timestamp.toString());

    var url = 'https://qiyukf.com/client?k=3d1c59b1c2e4cc4bd2d6b71cfb025620&gid=0&sid=0&qtype=0&dvctimer=0&robotShuntSwitch=0&hc=0&robotId=0&pageId=1574472167313vrLUcEI67d&t=%25E4%25BC%25B0%25E5%2590%2597%25E5%25AE%2598%25E7%25BD%2591-%257C%25E6%2589%258B%25E6%259C%25BA%25E7%25BD%25AE%25E6%258D%25A2%257C%25E4%25BA%258C%25E6%2589%258B%25E6%2589%258B%25E6%259C%25BA%25E5%259B%259E%25E6%2594%25B6%257C%25E6%2597%25A7%25E6%2589%258B%25E6%259C%25BA%25E5%259B%259E%25E6%2594%25B6%257C%25E6%2589%258B%25E6%259C%25BA%25E4%25BB%25A5%25E6%2597%25A7%25E6%258D%25A2%25E6%2596%25B0%257C%25E6%259D%25AD%25E5%25B7%259E%25E5%2590%2591%25E4%25B8%258A%25E8%25BD%25AF%25E4%25BB%25B6%25E6%259C%2589%25E9%2599%2590%25E5%2585%25AC%25E5%258F%25B8'
    var hash = localStorage.qiyucode
    if (!hash) {
        localStorage.qiyucode = code
        url = url + '&u=' + code + '&d=' + code + '&uuid=' + code
    }
    return url

}
//var backtopre = true;
//$('.arrow').click(function () {
//    if (backtopre) {
//        history.back(-1);
//    }
//});

var newType = 1;//0为以旧换新,1为团购新机
