123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151 |
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8">
- <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
- <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
- <title>title</title>
- <link rel="stylesheet" type="text/css" href="css/api.css" />
- <link rel="stylesheet" type="text/css" href="css/swiper.min.css" />
- <style>
- html, body{
- height:100%;box-sizing:border-box;background:#ffffff;
- }
- .swiper-container {
- width: 100%;
- height: 100%;
- transform:translate3d(0,0,0);
- overflow:hidden;
- }
- .swiper-slide {
- text-align: center;
- font-size: 18px;
- background: #ffffff;
- height:100%;
- position: relative;
- width: 100%;
- }
- .swiper-slide .img{
- width: 100%;
- height: 100%;
- background-repeat: no-repeat;
- background-size:cover;
- background-position: center;
- transform:translate3d(0,0,0)
- }
- .swiper-container-free-mode > .swiper-wrapper {
- -webkit-transition-timing-function: linear; /*之前是ease-out*/
- -moz-transition-timing-function: linear;
- -ms-transition-timing-function: linear;
- -o-transition-timing-function: linear;
- transition-timing-function: linear;
- margin: 0 auto;
- transform:translate3d(0,0,0)
- }
- .swiper-pagination-bullet {
- opacity: .8;
- }
- .swiper-pagination-bullet-active {
- background: #d9251c;
- }
- </style>
- <script>
- (function(w, d, m) {
- function r() {
- var t = 100,
- o = 750,
- e = d.documentElement.clientWidth || w.innerWidth,
- n = m.max(m.min(e, 480), 320),
- h = 50;
- 320 >= n && (h = m.floor(n / o * t * .99)),
- n > 320 && 362 >= n && (h = m.floor(n / o * t * 1)),
- n > 362 && 375 >= n && (h = m.floor(n / o * t * 1)),
- n > 375 && (h = m.floor(n / o * t * .97)),
- d.querySelector("html").style.fontSize = h + "px"
- };
- r();
- w.onresize = function() {
- r()
- }
- })(window, document, Math);
- </script>
- </head>
- <body>
- <div class="swiper-container">
- <div class="swiper-wrapper">
- </div>
- <div class="swiper-pagination" style="font-size: 0;bottom: 22px;"></div>
- </div>
- </body>
- <script type="text/javascript" src="script/api.js"></script>
- <script type="text/javascript" src="script/swiper.min.js"></script>
- <script type="text/javascript" src="script/jquery.min.js"></script>
- <script type="text/javascript" src="script/jquery.tap.js"></script>
- <script type="text/javascript">
- apiready = function() {
- getRouteData();
- api.addEventListener({
- name: 'keyback'
- }, function(ret, err) {
- api.toast({
- msg: '再按一次返回键退出' + api.appName,
- duration: 2000,
- location: 'bottom'
- });
- });
- };
- $(".swiper-wrapper").on("tap", "#go-to", function() {
- api.openWin({
- name: 'index',
- url: 'index.html',
- bounces: false
- })
- $api.setStorage("isSlide", "1");
- // setTimeout("api.closeWin();", 500);
- api.closeWin();
- return false;
- })
- function getRouteData() {
- $.ajax({
- url: siteurl + 'v2/entry/siteConfig',//'?do=getslide',
- data: {},
- headers: { "X-TOKEN": $api.getStorage("accesstoken") },
- dataType: 'json',
- type: 'post',
- success: function(datas) {
- if (datas.result) {
- $.each(datas.data.slide, function(index, item) {
- if (index == (datas.data.slide.length-1)) {
- $(".swiper-wrapper").append(`
- <div class="swiper-slide" id="go-to">
- <div class="img" style="background-image: url(${siteurl}uploads/home/adv/${item.adv_code})"></div>
- </div>`);
- } else {
- $(".swiper-wrapper").append(`
- <div class="swiper-slide">
- <div class="img" style="background-image: url(${siteurl}uploads/home/adv/${item.adv_code})"></div>
- </div>`);
- }
- });
- var swiper = new Swiper('.swiper-container', {
- allowSlidePrev: true,
- pagination: {
- el: '.swiper-pagination',
- },
- });
- } else {
- errcode(datas, datas.code);
- }
- },
- error:function(err){
- console.log(JSON.stringify(err));
- }
- });
- }
- </script>
- </html>
|