adv.html 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228
  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. console.log(_goods_id, _store_id)
  121. to_goods_id(_goods_id, _store_id);
  122. setTimeCloseWin("adv");
  123. break;
  124. case 'store':
  125. var _store_id = $('.adv').attr('store_id');
  126. console.log(_store_id);
  127. to_store_id(_store_id);
  128. setTimeCloseWin("adv");
  129. break;
  130. case 'article':
  131. var _article_id = $('.adv').attr('article_id');
  132. console.log(_article_id);
  133. to_article_id(_article_id);
  134. setTimeCloseWin("adv");
  135. break;
  136. }
  137. });
  138. function redirectSlide() {
  139. api.openWin({
  140. name: 'slide',
  141. url: 'slide.html',
  142. bounces: false
  143. });
  144. }
  145. function redirectLogin() {
  146. api.openWin({
  147. name: 'login',
  148. url: 'login.html',
  149. bounces: false
  150. });
  151. }
  152. function redirectIndex() {
  153. api.openWin({
  154. name: 'index',
  155. url: 'index.html',
  156. bounces: false
  157. });
  158. }
  159. function redirectHotIndex() {
  160. api.openWin({
  161. name: 'hotelindex',
  162. url: './html/hotel/index.html',
  163. bounces: false
  164. });
  165. }
  166. function redirectagent() {
  167. api.openWin({
  168. name: 'agentindex',
  169. url: './html/agent/index.html',
  170. bounces: false
  171. });
  172. }
  173. function to_article_id(_adv_article_id) {
  174. // body...
  175. api.openWin({
  176. name: 'finddetails',
  177. url: './html/find/finddetails.html',
  178. bounces: false,
  179. pageParam: {
  180. keyid: _adv_article_id
  181. }
  182. });
  183. $('.weui-gallery').hide();
  184. return false;
  185. }
  186. function to_goods_id(_adv_goods_id, _storeid) {
  187. // body...
  188. api.openWin({
  189. name: 'showgoods',
  190. url: './html/home/showgoods.html',
  191. bounces: false,
  192. pageParam: {
  193. keyid: _adv_goods_id,
  194. storeid: _storeid
  195. }
  196. });
  197. $('.weui-gallery').hide();
  198. return false;
  199. }
  200. function to_store_id(_adv_store_id) {
  201. // body...
  202. api.openWin({
  203. name: 'hoteldtl',
  204. url: './html/home/hoteldtl.html',
  205. bounces: false,
  206. pageParam: {
  207. keyid: _adv_store_id
  208. }
  209. });
  210. $('.weui-gallery').hide();
  211. return false;
  212. }
  213. </script>
  214. </html>