...
|
...
|
@@ -2,30 +2,15 @@ |
|
|
* @Author: Targaryen
|
|
|
* @Date: 2017-03-23 11:31:51
|
|
|
* @Last Modified by: Targaryen
|
|
|
* @Last Modified time: 2017-03-28 17:14:11
|
|
|
* @Last Modified time: 2017-03-30 14:51:41
|
|
|
*/
|
|
|
/* 红人店铺首页 */
|
|
|
const Swiper2 = require('yoho-swiper2');
|
|
|
|
|
|
let $shopIntroFolder = $('.shop-intro-folder');
|
|
|
let $shortIntro = $('#shortIntro');
|
|
|
let $shopIntro = $('#shopIntro');
|
|
|
let $shopIntrArrw = $('#shopIntrArrw');
|
|
|
let tip = require('../../plugin/tip');
|
|
|
let $goodsContainer = $('.index-goods-container');
|
|
|
let $collect = $('#collect');
|
|
|
|
|
|
/**
|
|
|
* 店铺介绍展开收起
|
|
|
*/
|
|
|
$shopIntroFolder.on('click', function() {
|
|
|
$shortIntro.toggleClass('hide');
|
|
|
$shopIntro.toggleClass('active');
|
|
|
|
|
|
if ($shopIntro.hasClass('active')) {
|
|
|
$shopIntrArrw.html('');
|
|
|
} else {
|
|
|
$shopIntrArrw.html('');
|
|
|
}
|
|
|
});
|
|
|
const shopId = $('#shopId').val();
|
|
|
|
|
|
/**
|
|
|
* 异步加载人气单品
|
...
|
...
|
@@ -64,3 +49,44 @@ if ($('.shop-swiper')) { |
|
|
});
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 店铺收藏取消收藏操作
|
|
|
*/
|
|
|
$collect.on('click', function() {
|
|
|
let options = {
|
|
|
id: shopId,
|
|
|
opt: 'ok'
|
|
|
};
|
|
|
|
|
|
if ($collect.hasClass('already-collect')) {
|
|
|
options.opt = 'cancel';
|
|
|
}
|
|
|
|
|
|
$.ajax({
|
|
|
method: 'get',
|
|
|
url: location.protocol + '//m.yohobuy.com/product/opt/favoriteBrand',
|
|
|
xhrFields: {
|
|
|
withCredentials: true
|
|
|
},
|
|
|
data: options,
|
|
|
success: function(result) {
|
|
|
if (result.code === 200) {
|
|
|
if ($collect.hasClass('already-collect')) {
|
|
|
$collect.attr('class', 'not-collect pull-left');
|
|
|
tip.show('店铺取消收藏成功');
|
|
|
} else {
|
|
|
$collect.attr('class', 'already-collect pull-left');
|
|
|
tip.show('店铺收藏成功');
|
|
|
}
|
|
|
}
|
|
|
|
|
|
if (result.code === 400) {
|
|
|
if ($('#jump-login').length <= 0) {
|
|
|
$('body').append('<a href=\'' + result.data + '\'><span id="jump-login"><span></a>');
|
|
|
}
|
|
|
$('#jump-login').click();
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
}); |
...
|
...
|
|