NavInfo.ts 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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 user_id = "";
  14. public init(){
  15. let index = location.href.indexOf("?");
  16. if (index > -1) {
  17. let str = location.href.slice(index + 1);
  18. let strs = str.split("&");
  19. for(let i = 0; i < strs.length; i += 2){
  20. if(!strs[i+1])return;
  21. switch(strs[i]){
  22. case "bundle":
  23. this.bundle = strs[i + 1];
  24. break;
  25. case "pre":
  26. this.pre = strs[i + 1];
  27. break;
  28. case "test":
  29. this.is_test = strs[i+1] == "1";
  30. break;
  31. case "match":
  32. this.match_id = strs[i+1];
  33. break;
  34. case "user":
  35. this.user_id = strs[i+1];
  36. break;
  37. }
  38. }
  39. }
  40. }
  41. }
  42. //todo: index.html title 修改 <title>الشحن من الموقع الرسمي</title>
  43. export const nav_info = new NavInfo();
  44. export class Config{
  45. public static copy_prefix = "cocobaloot:";
  46. //跳转
  47. public static scheme_id = "cocobaloot";
  48. public static scheme_prefix = "";
  49. //下载
  50. 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";
  51. public static downlaod_google_url = `https://play.google.com/store/apps/details?id=chior.mideast.thirdd&referrer=website`;
  52. //充值
  53. public static url_product = "https://arabgames.com:8088/livepay/getProducts?H5Extra=666888";
  54. public static url_pay = "https://arabgames.com:8088/topay/h5PayOrder";
  55. public static url_product_test = "http://139.224.253.42:8089/livepay/getProducts?H5Extra=666888";
  56. public static url_pay_test = "";
  57. public static init(){
  58. let prefix = sys.os == sys.OS.IOS ? "://?" : "://splash?";
  59. Config.scheme_prefix = Config.scheme_id + prefix;
  60. }
  61. }