BDY.js 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /** BDY 定义 */
  2. var BDY = window.BDY || {};
  3. BDY.params = [];
  4. BDY.timeout = [];
  5. BDY.interval = [];
  6. BDY.xhrs = [];
  7. BDY.xhrCount = 0;
  8. BDY.appId = 4;
  9. BDY.onResume = "onResume";
  10. if ('createTouch' in document) {
  11. BDY.click = 'touchclick';
  12. BDY.touchstart = "touchstart";
  13. BDY.touchmove = "touchmove";
  14. BDY.touchend = "touchend";
  15. BDY.longTap = 'longTap';
  16. } else {
  17. BDY.click = 'click';
  18. BDY.touchstart = "mousedown";
  19. BDY.touchmove = "mousemove";
  20. BDY.touchend = "mouseup";
  21. BDY.longTap = 'hover';
  22. }
  23. if (/test\.|webdev/.test(document.location.href)) {
  24. localStorage.setItem('env', 'test');
  25. BDY.debug = true;
  26. BDY.hiydUrl = "http://test.www.hiyd.com/";
  27. BDY.mHiydUrl = "http://test.m.hiyd.com/";
  28. BDY.url = "http://test.m.fit.hiyd.com/";
  29. } else if (/new\./.test(document.location.href)) {
  30. localStorage.setItem('env', 'new');
  31. BDY.debug = false;
  32. BDY.hiydUrl = "http://new.www.hiyd.com/";
  33. BDY.mHiydUrl = "http://test.m.hiyd.com/";
  34. BDY.url = "http://new.m.fit.hiyd.com/";
  35. } else {
  36. localStorage.setItem('env', 'product');
  37. BDY.debug = false;
  38. BDY.hiydUrl = "http://www.hiyd.com/";
  39. BDY.mHiydUrl = "http://m.hiyd.com/";
  40. BDY.url = "http://m.fit.hiyd.com/";
  41. }
  42. export default BDY;