NavInfo.ts 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. import { sys } from "cc";
  2. import { MainScene } from "./MainScene";
  3. //192.168.1.15:7456
  4. //?bundle&pay&pre&pay&test&1
  5. //?bundle&guild&pre&createguild&test&1
  6. class NavInfo{
  7. public scene: MainScene = null;
  8. public bundle = "pay";
  9. public pre = "pay";
  10. public is_test = false;
  11. public init(){
  12. let index = location.href.indexOf("?");
  13. if (index > -1) {
  14. let str = location.href.slice(index + 1);
  15. let strs = str.split("&");
  16. for(let i = 0; i < strs.length; i += 2){
  17. if(!strs[i+1])return;
  18. switch(strs[i]){
  19. case "bundle":
  20. this.bundle = strs[i + 1];
  21. break;
  22. case "pre":
  23. this.pre = strs[i + 1];
  24. break;
  25. case "test":
  26. this.is_test = strs[i+1] == "1";
  27. break;
  28. }
  29. }
  30. }
  31. }
  32. }
  33. export const nav_info = new NavInfo();
  34. export class Config{
  35. public static copy_prefix = "cocobaloot:";
  36. //跳转
  37. public static scheme_id = "cocobaloot";
  38. public static scheme_prefix = "";
  39. //下载
  40. public static download_ios_url = "https://apps.apple.com/sa/app/%D8%A8%D9%84%D9%88%D8%AA-%D8%A7%D9%84%D9%85%D8%A7%D8%B1%D8%AF/id6451100112";
  41. public static downlaod_google_url = `https://play.google.com/store/apps/details?id=chior.mideast.thirdd&referrer=website`;
  42. //充值
  43. public static url_product = "https://baloot.almarid77.com:8089/livepay/getProducts?H5Extra=666888";
  44. public static url_pay = "https://baloot.almarid77.com:8089/livepay/payOrder";
  45. public static url_product_test = "http://139.224.253.42:8089/livepay/getProducts?H5Extra=666888";
  46. public static url_pay_test = "http://139.224.253.42:8089/livepay/payOrder";
  47. public static init(){
  48. let prefix = sys.platform == sys.Platform.IOS ? "://?" : "://splash?";
  49. Config.scheme_prefix = Config.scheme_id + prefix;
  50. }
  51. }