Authored by 王水玲

星潮教室优化

1 <div class="star-page yoho-page"> 1 <div class="star-page yoho-page">
2 {{> star/head-tab}} 2 {{> star/head-tab}}
3 - <div class="swiper-num swiper-num1"></div>  
4 - <div class="swiper-num swiper-num2"></div>  
5 - <div class="swiper-num swiper-num3"></div>  
6 <div class="loading-tip">下拉刷新</div> 3 <div class="loading-tip">下拉刷新</div>
7 <div class="star-main"> 4 <div class="star-main">
8 <div class="main-content"> 5 <div class="main-content">
@@ -18,7 +18,9 @@ var $window = $(window), @@ -18,7 +18,9 @@ var $window = $(window),
18 $headTab = $('.head-tab'), 18 $headTab = $('.head-tab'),
19 headTabH = $headTab.height(), 19 headTabH = $headTab.height(),
20 scrollH = $(window).height() - headTabH, 20 scrollH = $(window).height() - headTabH,
21 - $loadingTip = $('.loading-tip'); 21 + $loadingTip = $('.loading-tip'),
  22 + u = navigator.userAgent,
  23 + isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);
22 24
23 /* 25 /*
24 $swiperView = $('.swiper-view'), 26 $swiperView = $('.swiper-view'),
@@ -33,8 +35,11 @@ var mySwiper; @@ -33,8 +35,11 @@ var mySwiper;
33 var avatarKey, bannerLen, res, avatarSwiper, avatarSwiperClone, getIndexHtml, 35 var avatarKey, bannerLen, res, avatarSwiper, avatarSwiperClone, getIndexHtml,
34 $avatarClone, $starArticle, $avatarWrap, starIScroll; 36 $avatarClone, $starArticle, $avatarWrap, starIScroll;
35 37
36 -var swiperNum = ($('.swiper-num2').width() - $('.swiper-num1').width()) +  
37 - ($('.swiper-num3').width() - $('.swiper-num1').width()) / 2; 38 +var swiperNum = $('.avatar-wrap .swiper-slide').width() / 2;
  39 +
  40 +if ($window.width() === 375 && isiOS) {
  41 + swiperNum = 32;
  42 +}
38 43
39 require('../common'); 44 require('../common');
40 45
@@ -101,6 +106,7 @@ function setIndexAction() { @@ -101,6 +106,7 @@ function setIndexAction() {
101 if (bannerLen > 1) { 106 if (bannerLen > 1) {
102 avatarSwiper = new Swiper('.avatar-1', { 107 avatarSwiper = new Swiper('.avatar-1', {
103 loop: true, 108 loop: true,
  109 + initialSlide: 0,
104 centeredSlides: true, 110 centeredSlides: true,
105 slidesPerView: 'auto', 111 slidesPerView: 'auto',
106 loopedSlides: bannerLen, 112 loopedSlides: bannerLen,
@@ -147,10 +147,8 @@ @@ -147,10 +147,8 @@
147 margin-top: 36px; 147 margin-top: 36px;
148 background: #000; 148 background: #000;
149 149
150 - span {  
151 - display: block;  
152 - width: 100%;  
153 - height: 100%; 150 + a {
  151 + border-radius: 5px;
154 } 152 }
155 } 153 }
156 154
@@ -416,18 +414,6 @@ @@ -416,18 +414,6 @@
416 top: 0; 414 top: 0;
417 z-index: -1; 415 z-index: -1;
418 } 416 }
419 -  
420 - .swiper-num1 {  
421 - width: 110px;  
422 - }  
423 -  
424 - .swiper-num2 {  
425 - width: 130px;  
426 - }  
427 -  
428 - .swiper-num3 {  
429 - width: 180px;  
430 - }  
431 } 417 }
432 418
433 .star-index-bg { 419 .star-index-bg {
@@ -438,3 +424,31 @@ @@ -438,3 +424,31 @@
438 background: #000; 424 background: #000;
439 } 425 }
440 } 426 }
  427 +
  428 +@media screen and (max-width: 375px) and (min-width: 375px) {
  429 + .star-page {
  430 + .avatar-wrap {
  431 + height: 105PX;
  432 + }
  433 +
  434 + .avatar-swiper {
  435 + li {
  436 + width: 64PX;
  437 + height: 64PX;
  438 + margin-top: 20.5PX;
  439 + }
  440 +
  441 + .swiper-slide-active {
  442 + width: 105PX;
  443 + height: 105PX;
  444 + }
  445 +
  446 + .swiper-slide-prev,
  447 + .swiper-slide-next {
  448 + width: 76PX;
  449 + height: 76PX;
  450 + margin-top: 14.5PX;
  451 + }
  452 + }
  453 + }
  454 +}