adv.html 6.2 KB

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