welcome.blade.php 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353
  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 class="error-tips" onclick="location.reload();">点我重新唤醒哟!</div>
  190. </div>
  191. </main>
  192. <div class="hw-guide">
  193. <img src="https://cdn-novel.iycdm.com/quickapp/static/guide.jpg " />
  194. <div class="btn-know">知道了</div>
  195. </div>
  196. <div class="open-gif">
  197. <div class="open-conetent">
  198. <img src="https://cdn-novel.iycdm.com/quickapp/static/gidf.gif" />
  199. <p>正在打开快应用...</p>
  200. </div>
  201. </div>
  202. </div>
  203. <script type="text/javascript" src="https://statres.quickapp.cn/quickapp/js/routerinline.min.js"></script>
  204. <script type="text/javascript">
  205. //获取url参数
  206. function getQueryString(name) {
  207. var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
  208. var r = decodeURIComponent(window.location.search)
  209. .substr(1)
  210. .match(reg);
  211. if (r != null) return unescape(r[2]);
  212. return null;
  213. }
  214. //全局变量
  215. var glob = {
  216. ua: window.navigator.userAgent.toLocaleLowerCase(),
  217. isHuaWei: /huawei|honor/.test(window.navigator.userAgent.toLowerCase()),
  218. isOpenApp: false,
  219. obAvailable: false //机型是否支持快应用
  220. };
  221. //快应用配置
  222. var QYY = {
  223. isWx: /micromessenger/.test(glob.ua), //是否微信环境
  224. isIos: /iphone|ipod|ipad/.test(glob.ua), //是否是ios
  225. entry: "views/Reader", //拉起快应用阅读器页面
  226. packName: "{{ $package }}", //快应用包名
  227. bid: "{{$hash_bid}}", //书籍id
  228. cid: "{{$cid}}", //章节id
  229. send_order_id: "{{$send_order_id}}",//派单ID
  230. };
  231. //判断机型是否支持快应用
  232. try {
  233. channelReady(function (bAvailable) {
  234. glob.obAvailable = bAvailable;
  235. });
  236. } catch (e) {
  237. glob.obAvailable = false;
  238. }
  239. //显示公众号落地页
  240. function showH5Page() {
  241. var time = QYY.isIos ? 0 : 5000;
  242. setTimeout(function () {
  243. $(".content-wrap").show();
  244. showPop(false);
  245. }, time);
  246. }
  247. //是否显示拉起快应用弹窗
  248. function showPop(show) {
  249. if (show) {
  250. $(".open-gif").show();
  251. } else {
  252. $(".open-gif").hide();
  253. }
  254. }
  255. //打开快应用逻辑
  256. function openQyy() {
  257. var parmas = {
  258. bid: QYY.bid,
  259. chapter_id: QYY.cid,
  260. send_order_id: QYY.send_order_id
  261. };
  262. try {
  263. //尝试直接拉起
  264. appRouter(QYY.packName, "/" + QYY.entry, parmas);
  265. } catch (e) {
  266. //唤醒失败 尝试url sheme唤醒
  267. try {
  268. appRouter(QYY.packName, "/" + QYY.entry, parmas);
  269. } catch (er) {
  270. try {
  271. appRouter(QYY.packName, "/" + QYY.entry, parmas);
  272. } catch (err) {
  273. routerAHap(parmas);
  274. }
  275. }
  276. }
  277. }
  278. //URL唤醒快应用
  279. function routerAHap(data) {
  280. var parmas = $.param(data);
  281. var ohapa = document.createElement("a");
  282. ohapa.href = "hap://app/" + QYY.packName + "/" + QYY.entry + "?" + parmas;
  283. ohapa.setAttribute(
  284. "style",
  285. "position: absolute;left: -1000rem;height: 1rem;width: 1rem;overflow: hidden"
  286. );
  287. document.body.appendChild(ohapa);
  288. ohapa.click();
  289. }
  290. //初始化
  291. function startDeep() {
  292. showH5Page();
  293. !QYY.isIos && openQyy();
  294. }
  295. //华为h5流程
  296. var hwPage = {
  297. init: function () {
  298. this.lisen();
  299. $(".hw-guide").css("height", $(".hw-guide").width() * 1.778);
  300. $(".hw-guide").show();
  301. },
  302. lisen: function () {
  303. $(".btn-know").on("click", function () {
  304. $(".hw-guide").hide();
  305. showPop(true);
  306. startDeep();
  307. });
  308. }
  309. };
  310. $(function () {
  311. //页面流程开始
  312. //处理弹出框的高度
  313. $(".open-conetent").height($(".open-conetent").width() * 0.75);
  314. //华为手机显示提示页
  315. if (glob.isHuaWei) {
  316. setTimeout(function () {
  317. hwPage.init();
  318. showPop(false);
  319. }, 3000);
  320. } else {
  321. setTimeout(function(){
  322. startDeep();
  323. },400)
  324. }
  325. });
  326. </script>
  327. </body>
  328. </html>