Authored by Lynnic

ajax加载js

@@ -4,7 +4,8 @@ @@ -4,7 +4,8 @@
4 * @date: 2015/11/18 4 * @date: 2015/11/18
5 */ 5 */
6 var $ = require('jquery'), 6 var $ = require('jquery'),
7 - lazyLoad = require('yoho.lazyload'); 7 + lazyLoad = require('yoho.lazyload'),
  8 + Swiper = require('yoho.iswiper');
8 9
9 var loading = require('../../plugin/loading'), 10 var loading = require('../../plugin/loading'),
10 tip = require('../../plugin/tip'); 11 tip = require('../../plugin/tip');
@@ -15,6 +16,9 @@ var introUrl = $('#introUrl').val(), @@ -15,6 +16,9 @@ var introUrl = $('#introUrl').val(),
15 searching = false, 16 searching = false,
16 end = false; 17 end = false;
17 18
  19 +var sizeSwiper,
  20 + refSwiper;
  21 +
18 function search() { 22 function search() {
19 if (searching || end) { 23 if (searching || end) {
20 return; 24 return;
@@ -32,6 +36,16 @@ function search() { @@ -32,6 +36,16 @@ function search() {
32 36
33 lazyLoad($productDesc.find('img.lazy')); 37 lazyLoad($productDesc.find('img.lazy'));
34 38
  39 + //尺码信息左右滑动
  40 + sizeSwiper = new Swiper('#size-swiper-container',{
  41 + slidesPerView: 'auto'
  42 + });
  43 +
  44 + //模特试穿左右滑动
  45 + refSwiper = new Swiper('#reference-swiper-container',{
  46 + slidesPerView: 'auto'
  47 + });
  48 +
35 searching = false; 49 searching = false;
36 end = true; 50 end = true;
37 loading.hideLoadingMask(); 51 loading.hideLoadingMask();
@@ -7,15 +7,14 @@ @@ -7,15 +7,14 @@
7 Swiper = require('yoho.iswiper'), 7 Swiper = require('yoho.iswiper'),
8 lazyLoad = require('yoho.lazyload'); 8 lazyLoad = require('yoho.lazyload');
9 9
10 -var goodsSwiper,  
11 - sizeSwiper,  
12 - refSwiper; 10 +var goodsSwiper;
13 11
14 require('./desc'); 12 require('./desc');
15 require('./comments-consults'); 13 require('./comments-consults');
16 14
17 lazyLoad($('img.lazy')); 15 lazyLoad($('img.lazy'));
18 16
  17 +//顶部swiper
19 goodsSwiper = new Swiper('.banner-swiper', { 18 goodsSwiper = new Swiper('.banner-swiper', {
20 lazyLoading: true, 19 lazyLoading: true,
21 lazyLoadingInPrevNext: true, 20 lazyLoadingInPrevNext: true,
@@ -36,6 +35,7 @@ goodsSwiper = new Swiper('.banner-swiper', { @@ -36,6 +35,7 @@ goodsSwiper = new Swiper('.banner-swiper', {
36 } 35 }
37 })(); 36 })();
38 37
  38 +//goods-discount下拉按钮点击事件
39 $('.goodsDiscount .dropdown').on('click', function() { 39 $('.goodsDiscount .dropdown').on('click', function() {
40 if ($('.goodsDiscount .discount-folder').is(':hidden')) { 40 if ($('.goodsDiscount .discount-folder').is(':hidden')) {
41 $('.goodsDiscount .first-item span').removeClass('icon-down'); 41 $('.goodsDiscount .first-item span').removeClass('icon-down');
@@ -50,13 +50,4 @@ $('.goodsDiscount .dropdown').on('click', function() { @@ -50,13 +50,4 @@ $('.goodsDiscount .dropdown').on('click', function() {
50 } 50 }
51 }); 51 });
52 52
53 -sizeSwiper = new Swiper('#size-swiper-container',{  
54 - slidesPerView: 'auto'  
55 -});  
56 -  
57 -refSwiper = new Swiper('#reference-swiper-container',{  
58 - slidesPerView: 'auto'  
59 -});  
60 -  
61 -  
62 53
@@ -104,6 +104,8 @@ @@ -104,6 +104,8 @@
104 104
105 <div id="productDesc"></div> 105 <div id="productDesc"></div>
106 106
  107 + <!-- {{>product/product-description}} -->
  108 +
107 {{#cartInfo}} 109 {{#cartInfo}}
108 <div class="cart-bar"> 110 <div class="cart-bar">
109 {{#if numInCart}} 111 {{#if numInCart}}
@@ -6,14 +6,15 @@ @@ -6,14 +6,15 @@
6 <span class="en-title">{{enTitle}}</span> 6 <span class="en-title">{{enTitle}}</span>
7 </h1> 7 </h1>
8 {{#detail}} 8 {{#detail}}
9 - <ul class="detail table clearfix"> 9 + <div class="detail table clearfix">
10 {{#list}} 10 {{#list}}
11 <div class="column">{{param}}</div> 11 <div class="column">{{param}}</div>
12 {{/list}} 12 {{/list}}
13 - </ul> 13 + </div>
14 {{/detail}} 14 {{/detail}}
15 <div class="desc-text">{{desc}}</div> 15 <div class="desc-text">{{desc}}</div>
16 </div> 16 </div>
  17 +
17 {{/goodsDescription}} 18 {{/goodsDescription}}
18 19
19 {{#sizeInfo}} 20 {{#sizeInfo}}
@@ -53,8 +54,6 @@ @@ -53,8 +54,6 @@
53 </div> 54 </div>
54 {{/measurementMethod}} 55 {{/measurementMethod}}
55 56
56 -<!-- <div class="gap-block"></div> -->  
57 -  
58 {{#reference}} 57 {{#reference}}
59 <div class="size-info page-block"> 58 <div class="size-info page-block">
60 <h1 class="title"> 59 <h1 class="title">
@@ -86,8 +85,6 @@ @@ -86,8 +85,6 @@
86 </div> 85 </div>
87 {{/reference}} 86 {{/reference}}
88 87
89 -<!-- <div class="gap-block"></div> -->  
90 -  
91 {{#materials}} 88 {{#materials}}
92 <div class="materials page-block"> 89 <div class="materials page-block">
93 <h1 class="title"> 90 <h1 class="title">
@@ -119,7 +116,6 @@ @@ -119,7 +116,6 @@
119 </div> 116 </div>
120 </div> 117 </div>
121 {{/washTips}} 118 {{/washTips}}
122 -<!-- <div class="gap-block"></div> -->  
123 119
124 {{#productDetail}} 120 {{#productDetail}}
125 <div class="product-detail page-block"> 121 <div class="product-detail page-block">