adv.html 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227
  1. <!doctype html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
  6. <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
  7. <title></title>
  8. <link rel="stylesheet" type="text/css" href="./css/api.css" />
  9. <link rel="stylesheet" type="text/css" href="./css/style.css?v=1.2" />
  10. <style>
  11. html,body{height:100%;padding:0px;margin: 0 auto;text-align: center;}
  12. .adv {
  13. height: 100vh;
  14. background-size: auto 100%;
  15. background-repeat: no-repeat;
  16. background-position: center;
  17. }
  18. .weui-btn {
  19. position: relative;
  20. display: block;
  21. width: 184px;
  22. margin-left: auto;
  23. margin-right: auto;
  24. padding: 8px 24px;
  25. box-sizing: border-box;
  26. font-weight: 700;
  27. font-size: 17px;
  28. text-align: center;
  29. text-decoration: none;
  30. color: #FFFFFF;
  31. line-height: 1.41176471;
  32. border-radius: 4px;
  33. -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
  34. overflow: hidden;
  35. }
  36. .weui-btn_mini {
  37. display: inline-block;
  38. width: auto;
  39. padding: 0 0.75em;
  40. line-height: 2;
  41. font-size: 0.32rem;
  42. background: #888;
  43. position: fixed;
  44. z-index: 1;
  45. top: 1.2rem;
  46. right: 0.3rem;
  47. }
  48. </style>
  49. <script>
  50. (function(w, d, m) {
  51. function r() {
  52. var t = 100,
  53. o = 750,
  54. e = d.documentElement.clientWidth || w.innerWidth,
  55. n = m.max(m.min(e, 480), 320),
  56. h = 50;
  57. 320 >= n && (h = m.floor(n / o * t * .99)),
  58. n > 320 && 362 >= n && (h = m.floor(n / o * t * 1)),
  59. n > 362 && 375 >= n && (h = m.floor(n / o * t * 1)),
  60. n > 375 && (h = m.floor(n / o * t * .97)),
  61. d.querySelector("html").style.fontSize = h + "px"
  62. };
  63. r();
  64. w.onresize = function() {
  65. r()
  66. }
  67. })(window, document, Math);
  68. </script>
  69. </head>
  70. <body>
  71. <div class="topbar"></div>
  72. <div class="adv"></div>
  73. <a href="javascript:redirectIndex();" class="weui-btn weui-btn_mini">跳 过</a>
  74. </body>
  75. <script type="text/javascript" src="./script/api.js"></script>
  76. <script type="text/javascript" src="./script/jquery.min.js"></script>
  77. <script type="text/javascript" src="./script/jquery.tap.js"></script>
  78. <script type="text/javascript">
  79. var _myalias = '';
  80. apiready = function() {
  81. redirectAdv();
  82. // setTimeCloseWin("adv");
  83. setTimeout(function(){
  84. redirectIndex();
  85. setTimeCloseWin("adv");
  86. }, 6000)
  87. };
  88. function redirectAdv() {
  89. $.ajax({
  90. url: siteurl + 'v2/entry/boot_adv',
  91. dataType: 'json',
  92. type: 'post',
  93. success: function(datas) {
  94. if (datas.result) {
  95. if (datas.data.enable == 1) {
  96. $('.adv').attr('style', 'background-image: url('+siteurl+'/uploads/home/adv/'+datas.data.images+')');
  97. $('.adv').attr('type', datas.data.target.type);
  98. $('.adv').attr('store_id', datas.data.target.store_id);
  99. $('.adv').attr('goods_id', datas.data.target.goods_id);
  100. $('.adv').attr('article_id', datas.data.target.article_id);
  101. return false;
  102. } else {
  103. redirectIndex();
  104. }
  105. } else {
  106. errcode(datas, datas.code);
  107. return false;
  108. }
  109. }
  110. });
  111. }
  112. $(".adv").on("tap", function() {
  113. var _type = $('.adv').attr('type');
  114. // redirectIndex();
  115. switch (_type) {
  116. case 'goods':
  117. var _goods_id = $('.adv').attr('goods_id');
  118. var _store_id = $('.adv').attr('store_id');
  119. console.log(_goods_id, _store_id)
  120. to_goods_id(_goods_id, _store_id);
  121. setTimeCloseWin("adv");
  122. break;
  123. case 'store':
  124. var _store_id = $('.adv').attr('store_id');
  125. console.log(_store_id);
  126. to_store_id(_store_id);
  127. setTimeCloseWin("adv");
  128. break;
  129. case 'article':
  130. var _article_id = $('.adv').attr('article_id');
  131. console.log(_article_id);
  132. to_article_id(_article_id);
  133. setTimeCloseWin("adv");
  134. break;
  135. }
  136. });
  137. function redirectSlide() {
  138. api.openWin({
  139. name: 'slide',
  140. url: 'slide.html',
  141. bounces: false
  142. });
  143. }
  144. function redirectLogin() {
  145. api.openWin({
  146. name: 'login',
  147. url: 'login.html',
  148. bounces: false
  149. });
  150. }
  151. function redirectIndex() {
  152. api.openWin({
  153. name: 'index',
  154. url: 'index.html',
  155. bounces: false
  156. });
  157. }
  158. function redirectHotIndex() {
  159. api.openWin({
  160. name: 'hotelindex',
  161. url: './html/hotel/index.html',
  162. bounces: false
  163. });
  164. }
  165. function redirectagent() {
  166. api.openWin({
  167. name: 'agentindex',
  168. url: './html/agent/index.html',
  169. bounces: false
  170. });
  171. }
  172. function to_article_id(_adv_article_id) {
  173. // body...
  174. api.openWin({
  175. name: 'finddetails',
  176. url: './html/find/finddetails.html',
  177. bounces: false,
  178. pageParam: {
  179. keyid: _adv_article_id
  180. }
  181. });
  182. $('.weui-gallery').hide();
  183. return false;
  184. }
  185. function to_goods_id(_adv_goods_id, _storeid) {
  186. // body...
  187. api.openWin({
  188. name: 'showgoods',
  189. url: './html/home/showgoods.html',
  190. bounces: false,
  191. pageParam: {
  192. keyid: _adv_goods_id,
  193. storeid: _storeid
  194. }
  195. });
  196. $('.weui-gallery').hide();
  197. return false;
  198. }
  199. function to_store_id(_adv_store_id) {
  200. // body...
  201. api.openWin({
  202. name: 'hoteldtl',
  203. url: './html/home/hoteldtl.html',
  204. bounces: false,
  205. pageParam: {
  206. keyid: _adv_store_id
  207. }
  208. });
  209. $('.weui-gallery').hide();
  210. return false;
  211. }
  212. </script>
  213. </html>