welcome.blade.php 8.2 KB

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