...
|
...
|
@@ -10,19 +10,21 @@ var Swiper = require('yoho.iswiper'), |
|
|
|
|
|
var recommendSwiper,
|
|
|
$recommendForYou = $('.recommend-for-you'),
|
|
|
productSkn = $('#productSkn').val();
|
|
|
preferenceUrl = $('#preferenceUrl').val();
|
|
|
|
|
|
$.get('/product/detail/preference', {productSkn: productSkn}).then(function(html) {
|
|
|
$recommendForYou.html(html).show();
|
|
|
if ($('#swiper-recommend').length) {
|
|
|
recommendSwiper = new Swiper('#swiper-recommend', {
|
|
|
slidesPerView: 'auto',
|
|
|
grabCursor: true,
|
|
|
slideElement: 'a',
|
|
|
lazyLoading: true,
|
|
|
watchSlidesVisibility: true
|
|
|
});
|
|
|
}
|
|
|
}).fail(function() {
|
|
|
$recommendForYou.hide();
|
|
|
}); |
|
|
\ No newline at end of file |
|
|
if (preferenceUrl) {
|
|
|
$.get(preferenceUrl).then(function(html) {
|
|
|
$recommendForYou.html(html).show();
|
|
|
if ($('#swiper-recommend').length) {
|
|
|
recommendSwiper = new Swiper('#swiper-recommend', {
|
|
|
slidesPerView: 'auto',
|
|
|
grabCursor: true,
|
|
|
slideElement: 'a',
|
|
|
lazyLoading: true,
|
|
|
watchSlidesVisibility: true
|
|
|
});
|
|
|
}
|
|
|
}).fail(function() {
|
|
|
$recommendForYou.hide();
|
|
|
});
|
|
|
} |
...
|
...
|
|