home.html 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231
  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. redirectSlide();
  97. return;
  98. if ( storeLogin > 0 ) {
  99. redirectHotIndex();
  100. } else if (memberLogin > 0) {
  101. redirectAdv();
  102. } else if (agentLogin > 0 ) {
  103. redirectagent();
  104. } else {
  105. redirectAdv();
  106. }
  107. } else {
  108. redirectSlide();
  109. }
  110. setTimeCloseWin("home");
  111. };
  112. function redirectAdv() {
  113. $.ajax({
  114. url: siteurl + 'v2/entry/boot_adv',
  115. dataType: 'json',
  116. type: 'post',
  117. success: function(datas) {
  118. if (datas.result) {
  119. if (datas.data.enable == 1) {
  120. $('.adv').attr('style', 'background-image: url('+siteurl+'/uploads/home/adv/'+datas.data.images+')');
  121. $('.adv').attr('type', datas.data.target.type);
  122. $('.adv').attr('store_id', datas.data.target.store_id);
  123. $('.adv').attr('goods_id', datas.data.target.goods_id);
  124. $('.adv').attr('article_id', datas.data.target.article_id);
  125. return false;
  126. } else {
  127. redirectIndex();
  128. }
  129. } else {
  130. errcode(datas, datas.code);
  131. return false;
  132. }
  133. }
  134. });
  135. myVar = setTimeout(function(){
  136. redirectIndex();
  137. setTimeCloseWin("home");
  138. }, 4000);
  139. }
  140. $(".adv").on("tap", function() {
  141. var _type = $('.adv').attr('type');
  142. // redirectIndex();
  143. clearTimeout(myVar);
  144. switch (_type) {
  145. case 'goods':
  146. var _goods_id = $('.adv').attr('goods_id');
  147. var _store_id = $('.adv').attr('store_id');
  148. api.openWin({
  149. name: 'index',
  150. url: 'index.html',
  151. bounces: false,
  152. pageParam: {
  153. advtype: 'goods',
  154. advgoodsid: _goods_id,
  155. advstoreid: _store_id
  156. }
  157. });
  158. break;
  159. case 'store':
  160. var _store_id = $('.adv').attr('store_id');
  161. api.openWin({
  162. name: 'index',
  163. url: 'index.html',
  164. bounces: false,
  165. pageParam: {
  166. advtype: 'store',
  167. advstoreid: _store_id
  168. }
  169. });
  170. break;
  171. case 'article':
  172. var _article_id = $('.adv').attr('article_id');
  173. api.openWin({
  174. name: 'index',
  175. url: 'index.html',
  176. bounces: false,
  177. pageParam: {
  178. advtype: 'article',
  179. advarticleid: _article_id
  180. }
  181. });
  182. break;
  183. }
  184. });
  185. function redirectSlide() {
  186. api.openWin({
  187. name: 'slide',
  188. url: 'slide.html',
  189. bounces: false
  190. });
  191. }
  192. function redirectLogin() {
  193. api.openWin({
  194. name: 'login',
  195. url: 'login.html',
  196. bounces: false
  197. });
  198. }
  199. function redirectIndex() {
  200. api.openWin({
  201. name: 'index',
  202. url: 'index.html',
  203. bounces: false
  204. });
  205. }
  206. function redirectHotIndex() {
  207. api.openWin({
  208. name: 'hotelindex',
  209. url: './html/hotel/index.html',
  210. bounces: false
  211. });
  212. }
  213. function redirectagent() {
  214. api.openWin({
  215. name: 'agentindex',
  216. url: './html/agent/index.html',
  217. bounces: false
  218. });
  219. }
  220. </script>
  221. </html>