welcome.blade.php 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8" />
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  6. <meta name="viewport" content="user-scalable=no" />
  7. <meta name="viewport"
  8. content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0,viewport-fit=cover" />
  9. <script src="//cdn-novel.iycdm.com/static/jquery-3.4.1.min.js" type="text/javascript"></script>
  10. </head>
  11. <body>
  12. <style>
  13. html,
  14. body,
  15. p,
  16. div,
  17. section {
  18. margin: 0;
  19. padding: 0;
  20. }
  21. img {
  22. width: 100%;
  23. -webkit-tap-highlight-color: transparent;
  24. }
  25. a {
  26. color: currentColor;
  27. -webkit-tap-highlight-color: transparent;
  28. }
  29. .application-content {
  30. padding: 12px;
  31. max-width: 100%;
  32. transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  33. }
  34. .application-content .content-wrap {
  35. width: 100%;
  36. margin-right: auto;
  37. margin-left: auto;
  38. }
  39. .content-card {
  40. border-radius: 5px;
  41. max-width: 100%;
  42. outline: none;
  43. text-decoration: none;
  44. transition-property: box-shadow, opacity;
  45. box-shadow: 0 3px 1px -2px rgba(0, 0, 0, 0.2),
  46. 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12);
  47. padding: 16px;
  48. font-size: 14px;
  49. line-height: 20px;
  50. }
  51. .card-text {
  52. text-align: center;
  53. }
  54. .card-text .wechat-title {
  55. color: red;
  56. font-weight: 700;
  57. margin-bottom: 16px;
  58. font-size: 18px;
  59. }
  60. .card-text .wechat-name {
  61. color: teal;
  62. font-weight: 700;
  63. font-size: 24px;
  64. line-height: 40px;
  65. margin-bottom: 16px;
  66. }
  67. .card-text .wechat-step {
  68. color: #000;
  69. font-weight: 900;
  70. font-size: 18px;
  71. line-height: 24px;
  72. margin-bottom: 16px;
  73. }
  74. .card-text .copy-text {
  75. height: 28px;
  76. min-width: 50px;
  77. padding: 0 12px;
  78. color: #009688;
  79. caret-color: #009688;
  80. border: 1px solid #009688;
  81. background-color: #fff;
  82. border-radius: 5px;
  83. font-size: 20px;
  84. margin: 0 auto 16px;
  85. display: block;
  86. }
  87. .card-text .copy-button {
  88. height: 36px;
  89. min-width: 64px;
  90. padding: 0 16px;
  91. background-color: #ff5252;
  92. border-radius: 5px;
  93. border: 1px solid #ff5252;
  94. color: #fff;
  95. font-size: 20px;
  96. line-height: 36px;
  97. display: block;
  98. margin: 0 auto 16px;
  99. box-shadow: 0 3px 1px -2px rgba(0, 0, 0, 0.2),
  100. 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12);
  101. }
  102. .toast-wrap {
  103. position: fixed;
  104. top: 50%;
  105. left: 50%;
  106. -webkit-transform: translate(-50%, -50%);
  107. transform: translate(-50%, -50%);
  108. padding: 5px 10px;
  109. color: #fff;
  110. font-size: 14px;
  111. text-align: center;
  112. background: rgba(0, 0, 0, 0.8);
  113. border-radius: 4px;
  114. }
  115. .hw-guide {
  116. width: 100%;
  117. height: 100%;
  118. position: absolute;
  119. top: 0;
  120. left: 0;
  121. display: none;
  122. }
  123. .hw-guide img {
  124. width: 100%;
  125. }
  126. .hw-guide .btn-know {
  127. width: 180px;
  128. height: 40px;
  129. line-height: 40px;
  130. text-align: center;
  131. border: none;
  132. outline: none;
  133. background: linear-gradient(0deg,
  134. rgba(255, 210, 0, 1),
  135. rgba(255, 239, 75, 1));
  136. border-radius: 10px;
  137. text-align: center;
  138. font-size: 14px;
  139. font-family: PingFang-SC-Bold;
  140. font-weight: bold;
  141. color: rgba(255, 93, 123, 1);
  142. position: absolute;
  143. top: 62%;
  144. left: 50%;
  145. margin-left: -90px;
  146. }
  147. .open-gif {
  148. position: absolute;
  149. background: rgba(0, 0, 0, 0.5);
  150. top: 0;
  151. left: 0;
  152. width: 100%;
  153. height: 100%;
  154. }
  155. .open-gif .open-conetent {
  156. width: 53vw;
  157. position: absolute;
  158. height: 0;
  159. top: 0;
  160. bottom: 0;
  161. left: 0;
  162. right: 0;
  163. margin: auto;
  164. background-color: #f7f5eb;
  165. border-radius: 10px;
  166. overflow: hidden;
  167. text-align: center;
  168. }
  169. .open-gif .open-conetent img {
  170. width: 36%;
  171. display: inline-block;
  172. margin-top: 12%;
  173. }
  174. .open-gif .open-conetent p {
  175. margin-top: 8%;
  176. font-size: 14px;
  177. }
  178. .error-tips{
  179. font-size:16px;
  180. color:#fd555d;
  181. margin-top:40px;
  182. text-align:center;
  183. }
  184. </style>
  185. <div class="application-wrap">
  186. <main class="application-content">
  187. <div class="content-wrap" style="display: none;">
  188. <div class="error-tips">对不起,暂时无法唤醒快应用!</div>
  189. </div>
  190. </main>
  191. <div class="hw-guide">
  192. <img src="https://cdn-novel.iycdm.com/quickapp/static/guide.jpg " />
  193. <div class="btn-know">知道了</div>
  194. </div>
  195. <div class="open-gif">
  196. <div class="open-conetent">
  197. <img src="https://cdn-novel.iycdm.com/quickapp/static/gidf.gif" />
  198. <p>正在打开快应用...</p>
  199. </div>
  200. </div>
  201. </div>
  202. <script type="text/javascript" src="https://statres.quickapp.cn/quickapp/js/routerinline.min.js"></script>
  203. <script type="text/javascript">
  204. //获取url参数
  205. function getQueryString(name) {
  206. var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
  207. var r = decodeURIComponent(window.location.search)
  208. .substr(1)
  209. .match(reg);
  210. if (r != null) return unescape(r[2]);
  211. return null;
  212. }
  213. //全局变量
  214. var glob = {
  215. ua: window.navigator.userAgent.toLocaleLowerCase(),
  216. isHuaWei: /huawei|honor/.test(window.navigator.userAgent.toLowerCase()),
  217. isOpenApp: false,
  218. obAvailable: false //机型是否支持快应用
  219. };
  220. //快应用配置
  221. var QYY = {
  222. isWx: /micromessenger/.test(glob.ua), //是否微信环境
  223. isIos: /iphone|ipod|ipad/.test(glob.ua), //是否是ios
  224. entry: "views/Reader", //拉起快应用阅读器页面
  225. packName: "{{ $package }}", //快应用包名
  226. bid: "{{$hash_bid}}", //书籍id
  227. cid: "{{$cid}}", //章节id
  228. send_order_id: "{{$send_order_id}}",//派单ID
  229. };
  230. //判断机型是否支持快应用
  231. try {
  232. channelReady(function (bAvailable) {
  233. glob.obAvailable = bAvailable;
  234. });
  235. } catch (e) {
  236. glob.obAvailable = false;
  237. }
  238. //显示公众号落地页
  239. function showH5Page() {
  240. var time = QYY.isIos ? 0 : 5000;
  241. setTimeout(function () {
  242. $(".content-wrap").show();
  243. showPop(false);
  244. }, time);
  245. }
  246. //是否显示拉起快应用弹窗
  247. function showPop(show) {
  248. if (show) {
  249. $(".open-gif").show();
  250. } else {
  251. $(".open-gif").hide();
  252. }
  253. }
  254. //打开快应用逻辑
  255. function openQyy() {
  256. var parmas = {
  257. bid: QYY.bid,
  258. chapter_id: QYY.cid,
  259. send_order_id: QYY.send_order_id
  260. };
  261. try {
  262. //尝试直接拉起
  263. appRouter(QYY.packName, "/" + QYY.entry, parmas);
  264. } catch (e) {
  265. //唤醒失败 尝试url sheme唤醒
  266. routerAHap(parmas);
  267. }
  268. }
  269. //URL唤醒快应用
  270. function routerAHap(data) {
  271. var parmas = $.param(data);
  272. var ohapa = document.createElement("a");
  273. ohapa.href = "hap://app/" + QYY.packName + "/" + QYY.entry + "?" + parmas;
  274. ohapa.setAttribute(
  275. "style",
  276. "position: absolute;left: -1000rem;height: 1rem;width: 1rem;overflow: hidden"
  277. );
  278. document.body.appendChild(ohapa);
  279. ohapa.click();
  280. }
  281. //初始化
  282. function startDeep() {
  283. showH5Page();
  284. !QYY.isIos && openQyy();
  285. }
  286. //华为h5流程
  287. var hwPage = {
  288. init: function () {
  289. this.lisen();
  290. $(".hw-guide").css("height", $(".hw-guide").width() * 1.778);
  291. $(".hw-guide").show();
  292. },
  293. lisen: function () {
  294. $(".btn-know").on("click", function () {
  295. $(".hw-guide").hide();
  296. showPop(true);
  297. startDeep();
  298. });
  299. }
  300. };
  301. $(function () {
  302. //页面流程开始
  303. //处理弹出框的高度
  304. $(".open-conetent").height($(".open-conetent").width() * 0.75);
  305. //华为手机显示提示页
  306. if (glob.isHuaWei) {
  307. setTimeout(function () {
  308. hwPage.init();
  309. showPop(false);
  310. }, 3000);
  311. } else {
  312. startDeep();
  313. }
  314. });
  315. </script>
  316. </body>
  317. </html>