/** BDY 定义 */
var BDY = window.BDY || {};
BDY.params = [];
BDY.timeout = [];
BDY.interval = [];
BDY.xhrs = [];
BDY.xhrCount = 0;
BDY.appId = 4;
BDY.onResume = "onResume";
BDY.pageChange = "pageChange";

if ('createTouch' in document) {
    BDY.click = 'touchclick';
    BDY.touchstart = "touchstart";
    BDY.touchmove = "touchmove";
    BDY.touchend = "touchend";
    BDY.longTap = 'longTap';
} else {
    BDY.click = 'click';
    BDY.touchstart = "mousedown";
    BDY.touchmove = "mousemove";
    BDY.touchend = "mouseup";
    BDY.longTap = 'hover';
}

if (/test\.|webdev/.test(document.location.href)) {
    localStorage.setItem('env', 'test');
    BDY.debug = true;
    BDY.hiydUrl = "http://test.www.hiyd.com/";
    BDY.mHiydUrl = "http://test.m.hiyd.com/";
    BDY.url = "http://test.m.fit.hiyd.com/";
} else if (/new\./.test(document.location.href)) {
    localStorage.setItem('env', 'new');
    BDY.debug = false;
    BDY.hiydUrl = "http://new.www.hiyd.com/";
    BDY.mHiydUrl = "http://test.m.hiyd.com/";
    BDY.url = "http://new.m.fit.hiyd.com/";
} else {
    localStorage.setItem('env', 'product');
    BDY.debug = false;
    BDY.hiydUrl = "http://www.hiyd.com/";
    BDY.mHiydUrl = "http://m.hiyd.com/";
    BDY.url = "http://m.fit.hiyd.com/";
}

export default BDY;