webview_base.php 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. <?php
  2. namespace app\index;
  3. class webview_base extends BaseUser
  4. {
  5. public $configData = [];
  6. function initialize()
  7. {
  8. parent::initialize();
  9. $this->configData = $this->__config();
  10. }
  11. function __config()
  12. {
  13. $this->configData["name"] = "";
  14. $this->configData["url"] = "";
  15. $this->configData["appVersion"] = "1.0.0";
  16. $this->configData["packageName"] = "";
  17. $this->configData["isLoadRealAddressByUrl"] = false;
  18. $this->configData["supportActionBar"] = false;
  19. $this->configData["actionBarColor"] = "#3289c7";
  20. $this->configData["titleColor"] = "#ffffff";
  21. $this->configData["clearCookie"] = false;
  22. $this->configData["supportSplash"] = false;
  23. $this->configData["supportNavigator"] = false;
  24. $this->configData["hideNavigatorWhenLandscape"] = false;
  25. $this->configData["supportRightSlideGoBack"] = false;
  26. $this->configData["supportPullToRefresh"] = false;
  27. $this->configData["supportForwardBackGesture"] = false;
  28. $this->configData["supportLongPressSavePicture"] = false;
  29. $this->configData["supportFullScreen"] = false;
  30. $this->configData["supportQRCodeScan"] = false;
  31. $this->configData["screenOrientation"] = 0;
  32. $this->configData["supportScheme"] = false;
  33. $this->configData["exitMode"] = 0;
  34. $this->configData["guide"] = 0;
  35. $this->configData["isSupportZoom"] = false;
  36. $this->configData["webViewType"] = 0;
  37. $this->configData["isSupportShare"] = false;
  38. $this->configData["isSupportLongPressCopy"] = false;
  39. $this->configData["isSupportConfigureStatueBarColor"] = 1;
  40. $this->configData["statusBarColor"] = "#d9d9d9";
  41. $this->configData["statusBarTextColorMode"] = 0;
  42. $this->configData["appId"] = 2100 + 3.21718071637047E+17;
  43. $this->configData["secureId"] = 2100 + 3.21718071637047E+17;
  44. $this->configData["secureUrl"] = "http://kltdo.888/valid/pack/321718071637049344.json";
  45. $this->configData["secureMsg"] = "error";
  46. $this->configData["isSupportSplashTime"] = boolval(SafeRequest("isSupportSplashTime"));
  47. $this->configData["qqAppId"] = SafeRequest("qqAppId") ?: "";
  48. $this->configData["isSupportShowSplashSkipButton"] = boolval(SafeRequest("isSupportShowSplashSkipButton"));
  49. $this->configData["supportDownloadFile"] = boolval(SafeRequest("supportDownloadFile"));
  50. $this->configData["supportUpgradeTip"] = boolval(SafeRequest("supportUpgradeTip"));
  51. $this->configData["supportWebPageZoom"] = boolval(SafeRequest("supportWebPageZoom"));
  52. $this->configData["supportPhoneBook"] = boolval(SafeRequest("supportPhoneBook"));
  53. $this->configData["supportAdBlock"] = boolval(SafeRequest("supportAdBlock"));
  54. $this->configData["supportGuideEnterMainPageButton"] = boolval(SafeRequest("supportGuideEnterMainPageButton"));
  55. $this->configData["guideEnterMainPageButtonColor"] = SafeRequest("guideEnterMainPageButtonColor") ?: "#ffffff";
  56. return $this->configData;
  57. }
  58. function createAction($arr = [], $type = '')
  59. {
  60. $_var_0 = [];
  61. if ($type == "menu") {
  62. foreach ($arr as $_var_1) {
  63. if ($_var_1["action"] == "link_app") {
  64. $_var_2 = $_var_1["url"];
  65. } elseif ($_var_1["action"] == "link_url") {
  66. $_var_2 = "@systemBrowser|" . $_var_1["url"];
  67. } else {
  68. $_var_2 = "@" . $_var_1["action"];
  69. }
  70. $_var_0[] = ["icon" => "menu" . $_var_1["icon"], "text" => $_var_1["text"], "action" => $_var_2];
  71. }
  72. } else {
  73. $_var_3 = ["back" => [4, "返回", "back"], "scan" => [61, "扫一扫", "scan"], "refresh" => [15, "刷新", "refresh"], "exit" => [68, "退出", "exit"], "share" => [58, "分享", "share|system"], "sideBar" => [71, "侧边", "sideBar"]];
  74. foreach ($arr as $_var_1) {
  75. $_var_0[] = ["icon" => "menu" . $_var_3[$_var_1][0], "text" => $_var_3[$_var_1][1], "action" => "@" . $_var_3[$_var_1][2]];
  76. }
  77. }
  78. return $_var_0;
  79. }
  80. }