home.html 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229
  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: rgba(0, 0, 0, 0.4);
  43. position: fixed;
  44. z-index: 1;
  45. top: 1.2rem;
  46. right: 0.3rem;
  47. border: 1px solid rgba(255, 255, 255, 0.6);
  48. font-weight: normal;
  49. color: rgba(255, 255, 255);
  50. }
  51. </style>
  52. <script>
  53. (function(w, d, m) {
  54. function r() {
  55. var t = 100,
  56. o = 750,
  57. e = d.documentElement.clientWidth || w.innerWidth,
  58. n = m.max(m.min(e, 480), 320),
  59. h = 50;
  60. 320 >= n && (h = m.floor(n / o * t * .99)),
  61. n > 320 && 362 >= n && (h = m.floor(n / o * t * 1)),
  62. n > 362 && 375 >= n && (h = m.floor(n / o * t * 1)),
  63. n > 375 && (h = m.floor(n / o * t * .97)),
  64. d.querySelector("html").style.fontSize = h + "px"
  65. };
  66. r();
  67. w.onresize = function() {
  68. r()
  69. }
  70. })(window, document, Math);
  71. </script>
  72. </head>
  73. <body>
  74. <div class="topbar"></div>
  75. <div class="adv" style=""></div>
  76. <a href="javascript:redirectIndex();" class="weui-btn weui-btn_mini">跳 过</a>
  77. </body>
  78. <script type="text/javascript" src="./script/api.js"></script>
  79. <script type="text/javascript" src="./script/jquery.min.js"></script>
  80. <script type="text/javascript" src="./script/jquery.tap.js"></script>
  81. <script type="text/javascript">
  82. var _myalias = '';
  83. var myVar;
  84. apiready = function() {
  85. var memberLogin = $api.getStorage("memberid");
  86. var storeLogin = $api.getStorage("storeid");
  87. var agentLogin = $api.getStorage("agent_id");
  88. var isSlide = $api.getStorage("isSlide");
  89. api.removeLaunchView({
  90. animation: {
  91. type: 'fade',
  92. duration: 2000
  93. }
  94. });
  95. if (isSlide == 1) {
  96. if ( storeLogin > 0 ) {
  97. redirectHotIndex();
  98. } else if (memberLogin > 0) {
  99. redirectAdv();
  100. } else if (agentLogin > 0 ) {
  101. redirectagent();
  102. } else {
  103. redirectAdv();
  104. }
  105. } else {
  106. redirectSlide();
  107. }
  108. setTimeCloseWin("home");
  109. };
  110. function redirectAdv() {
  111. $.ajax({
  112. url: siteurl + 'v2/entry/boot_adv',
  113. dataType: 'json',
  114. type: 'post',
  115. success: function(datas) {
  116. if (datas.result) {
  117. if (datas.data.enable == 1) {
  118. $('.adv').attr('style', 'background-image: url('+siteurl+'/uploads/home/adv/'+datas.data.images+')');
  119. $('.adv').attr('type', datas.data.target.type);
  120. $('.adv').attr('store_id', datas.data.target.store_id);
  121. $('.adv').attr('goods_id', datas.data.target.goods_id);
  122. $('.adv').attr('article_id', datas.data.target.article_id);
  123. return false;
  124. } else {
  125. redirectIndex();
  126. }
  127. } else {
  128. errcode(datas, datas.code);
  129. return false;
  130. }
  131. }
  132. });
  133. myVar = setTimeout(function(){
  134. redirectIndex();
  135. setTimeCloseWin("home");
  136. }, 4000);
  137. }
  138. $(".adv").on("tap", function() {
  139. var _type = $('.adv').attr('type');
  140. // redirectIndex();
  141. clearTimeout(myVar);
  142. switch (_type) {
  143. case 'goods':
  144. var _goods_id = $('.adv').attr('goods_id');
  145. var _store_id = $('.adv').attr('store_id');
  146. api.openWin({
  147. name: 'index',
  148. url: 'index.html',
  149. bounces: false,
  150. pageParam: {
  151. advtype: 'goods',
  152. advgoodsid: _goods_id,
  153. advstoreid: _store_id
  154. }
  155. });
  156. break;
  157. case 'store':
  158. var _store_id = $('.adv').attr('store_id');
  159. api.openWin({
  160. name: 'index',
  161. url: 'index.html',
  162. bounces: false,
  163. pageParam: {
  164. advtype: 'store',
  165. advstoreid: _store_id
  166. }
  167. });
  168. break;
  169. case 'article':
  170. var _article_id = $('.adv').attr('article_id');
  171. api.openWin({
  172. name: 'index',
  173. url: 'index.html',
  174. bounces: false,
  175. pageParam: {
  176. advtype: 'article',
  177. advarticleid: _article_id
  178. }
  179. });
  180. break;
  181. }
  182. });
  183. function redirectSlide() {
  184. api.openWin({
  185. name: 'slide',
  186. url: 'slide.html',
  187. bounces: false
  188. });
  189. }
  190. function redirectLogin() {
  191. api.openWin({
  192. name: 'login',
  193. url: 'login.html',
  194. bounces: false
  195. });
  196. }
  197. function redirectIndex() {
  198. api.openWin({
  199. name: 'index',
  200. url: 'index.html',
  201. bounces: false
  202. });
  203. }
  204. function redirectHotIndex() {
  205. api.openWin({
  206. name: 'hotelindex',
  207. url: './html/hotel/index.html',
  208. bounces: false
  209. });
  210. }
  211. function redirectagent() {
  212. api.openWin({
  213. name: 'agentindex',
  214. url: './html/agent/index.html',
  215. bounces: false
  216. });
  217. }
  218. </script>
  219. </html>