NavInfo.ts 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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&
  6. //?bundle&guild&pre&joinguild&match&111
  7. class NavInfo{
  8. public scene: MainScene = null;
  9. public bundle = "pay";
  10. public pre = "pay";
  11. public is_test = false;
  12. public match_id = "";
  13. public init(){
  14. let index = location.href.indexOf("?");
  15. if (index > -1) {
  16. let str = location.href.slice(index + 1);
  17. let strs = str.split("&");
  18. for(let i = 0; i < strs.length; i += 2){
  19. if(!strs[i+1])return;
  20. switch(strs[i]){
  21. case "bundle":
  22. this.bundle = strs[i + 1];
  23. break;
  24. case "pre":
  25. this.pre = strs[i + 1];
  26. break;
  27. case "test":
  28. this.is_test = strs[i+1] == "1";
  29. break;
  30. case "match":
  31. this.match_id = strs[i+1];
  32. break;
  33. }
  34. }
  35. }
  36. }
  37. }
  38. export const nav_info = new NavInfo();
  39. export class Config{
  40. public static copy_prefix = "cocobaloot:";
  41. //跳转
  42. public static scheme_id = "cocobaloot";
  43. public static scheme_prefix = "";
  44. //下载
  45. 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";
  46. public static downlaod_google_url = `https://play.google.com/store/apps/details?id=chior.mideast.thirdd&referrer=website`;
  47. //充值
  48. public static url_product = "https://baloot.almarid77.com:8089/livepay/getProducts?H5Extra=666888";
  49. public static url_pay = "https://baloot.almarid77.com:8089/livepay/payOrder";
  50. public static url_product_test = "http://139.224.253.42:8089/livepay/getProducts?H5Extra=666888";
  51. public static url_pay_test = "http://139.224.253.42:8089/livepay/payOrder";
  52. public static init(){
  53. let prefix = sys.platform == sys.Platform.IOS ? "://?" : "://splash?";
  54. Config.scheme_prefix = Config.scheme_id + prefix;
  55. }
  56. }