Authored by Lynnic

ajax加载js

... ... @@ -4,7 +4,8 @@
* @date: 2015/11/18
*/
var $ = require('jquery'),
lazyLoad = require('yoho.lazyload');
lazyLoad = require('yoho.lazyload'),
Swiper = require('yoho.iswiper');
var loading = require('../../plugin/loading'),
tip = require('../../plugin/tip');
... ... @@ -15,6 +16,9 @@ var introUrl = $('#introUrl').val(),
searching = false,
end = false;
var sizeSwiper,
refSwiper;
function search() {
if (searching || end) {
return;
... ... @@ -32,6 +36,16 @@ function search() {
lazyLoad($productDesc.find('img.lazy'));
//尺码信息左右滑动
sizeSwiper = new Swiper('#size-swiper-container',{
slidesPerView: 'auto'
});
//模特试穿左右滑动
refSwiper = new Swiper('#reference-swiper-container',{
slidesPerView: 'auto'
});
searching = false;
end = true;
loading.hideLoadingMask();
... ...
... ... @@ -7,15 +7,14 @@
Swiper = require('yoho.iswiper'),
lazyLoad = require('yoho.lazyload');
var goodsSwiper,
sizeSwiper,
refSwiper;
var goodsSwiper;
require('./desc');
require('./comments-consults');
lazyLoad($('img.lazy'));
//顶部swiper
goodsSwiper = new Swiper('.banner-swiper', {
lazyLoading: true,
lazyLoadingInPrevNext: true,
... ... @@ -36,6 +35,7 @@ goodsSwiper = new Swiper('.banner-swiper', {
}
})();
//goods-discount下拉按钮点击事件
$('.goodsDiscount .dropdown').on('click', function() {
if ($('.goodsDiscount .discount-folder').is(':hidden')) {
$('.goodsDiscount .first-item span').removeClass('icon-down');
... ... @@ -50,13 +50,4 @@ $('.goodsDiscount .dropdown').on('click', function() {
}
});
sizeSwiper = new Swiper('#size-swiper-container',{
slidesPerView: 'auto'
});
refSwiper = new Swiper('#reference-swiper-container',{
slidesPerView: 'auto'
});
... ...
... ... @@ -104,6 +104,8 @@
<div id="productDesc"></div>
<!-- {{>product/product-description}} -->
{{#cartInfo}}
<div class="cart-bar">
{{#if numInCart}}
... ...
... ... @@ -6,14 +6,15 @@
<span class="en-title">{{enTitle}}</span>
</h1>
{{#detail}}
<ul class="detail table clearfix">
<div class="detail table clearfix">
{{#list}}
<div class="column">{{param}}</div>
{{/list}}
</ul>
</div>
{{/detail}}
<div class="desc-text">{{desc}}</div>
</div>
{{/goodsDescription}}
{{#sizeInfo}}
... ... @@ -53,8 +54,6 @@
</div>
{{/measurementMethod}}
<!-- <div class="gap-block"></div> -->
{{#reference}}
<div class="size-info page-block">
<h1 class="title">
... ... @@ -86,8 +85,6 @@
</div>
{{/reference}}
<!-- <div class="gap-block"></div> -->
{{#materials}}
<div class="materials page-block">
<h1 class="title">
... ... @@ -119,7 +116,6 @@
</div>
</div>
{{/washTips}}
<!-- <div class="gap-block"></div> -->
{{#productDetail}}
<div class="product-detail page-block">
... ...