BDY.js 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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. BDY.pageChange = "pageChange";
  11. if ('createTouch' in document) {
  12. BDY.click = 'touchclick';
  13. BDY.touchstart = "touchstart";
  14. BDY.touchmove = "touchmove";
  15. BDY.touchend = "touchend";
  16. BDY.longTap = 'longTap';
  17. } else {
  18. BDY.click = 'click';
  19. BDY.touchstart = "mousedown";
  20. BDY.touchmove = "mousemove";
  21. BDY.touchend = "mouseup";
  22. BDY.longTap = 'hover';
  23. }
  24. if (/test\.|webdev/.test(document.location.href)) {
  25. localStorage.setItem('env', 'test');
  26. BDY.debug = true;
  27. BDY.hiydUrl = "http://test.www.hiyd.com/";
  28. BDY.mHiydUrl = "http://test.m.hiyd.com/";
  29. BDY.url = "http://test.m.fit.hiyd.com/";
  30. } else if (/new\./.test(document.location.href)) {
  31. localStorage.setItem('env', 'new');
  32. BDY.debug = false;
  33. BDY.hiydUrl = "http://new.www.hiyd.com/";
  34. BDY.mHiydUrl = "http://test.m.hiyd.com/";
  35. BDY.url = "http://new.m.fit.hiyd.com/";
  36. } else {
  37. localStorage.setItem('env', 'product');
  38. BDY.debug = false;
  39. BDY.hiydUrl = "http://www.hiyd.com/";
  40. BDY.mHiydUrl = "http://m.hiyd.com/";
  41. BDY.url = "http://m.fit.hiyd.com/";
  42. }
  43. export default BDY;