...
|
...
|
@@ -16,30 +16,35 @@ var yas = require('../common/data-yas'); |
|
|
var dataLazyLoad = require('../plugins/lazy-load')(document);
|
|
|
var setPager = require('./detail/pager');
|
|
|
var notify = require('./detail/notify');
|
|
|
var favorite = require('./detail/brand-fav');
|
|
|
|
|
|
var bindEvent = $.Callbacks(); // eslint-disable-line
|
|
|
var clickAcquireCouponEvent = $.Callbacks('unique'); // eslint-disable-line
|
|
|
|
|
|
var Dialog = require('../common/dialog').Dialog;
|
|
|
|
|
|
var $main = $('.main'),
|
|
|
id = $main.data('id'),
|
|
|
shopId = $main.data('shop'),
|
|
|
brandId = $('#brand-favour').data('id'),
|
|
|
md5 = $main.data('md5'),
|
|
|
skn = $main.data('skn'),
|
|
|
deposit = $main.data('deposit') === 'Y',
|
|
|
secKill = $main.data('seckill') === 'Y',
|
|
|
limitCode = $main.data('limitcode');
|
|
|
limitCode = $main.data('limitcode'),
|
|
|
isBundle = $main.data('type') === 2, // 量贩商品
|
|
|
goodsBaseNum = isBundle ? $main.data('count') : 1; // 每次购买最低件数
|
|
|
|
|
|
var maxStock = -1; // 记录当前选中的颜色-尺码的库存量,若为-1,代表未选择尺码
|
|
|
|
|
|
var SLIDETIME = 200;
|
|
|
|
|
|
var colTxt = {
|
|
|
def: '收藏商品',
|
|
|
normal: '收藏商品',
|
|
|
coled: '已收藏',
|
|
|
hover: '取消收藏'
|
|
|
};
|
|
|
|
|
|
var oldtatus = {
|
|
|
var oldStatus = {
|
|
|
txt: '已领取',
|
|
|
html: '<a class="coupon-btn">去使用</a>'
|
|
|
};
|
...
|
...
|
@@ -99,15 +104,61 @@ bindEvent.add(function() { |
|
|
|
|
|
var isTicket = $('input[name="isTicket"]').length > 0 && $('input[name="isTicket"]').val() === 'true';
|
|
|
|
|
|
|
|
|
|
|
|
var brandDomain = $('.home').attr('href');
|
|
|
|
|
|
var Alert = require('../common/dialog').Alert;
|
|
|
|
|
|
var $moreCoupon = $('.more-coupon');
|
|
|
/** 优惠券开始 **/
|
|
|
var $moreCoupon = $('.more-coupon'),
|
|
|
$couponItem = $('.coupon-item');
|
|
|
|
|
|
var $couponItem = $('.coupon-item');
|
|
|
function getCouponAsync(cid) {
|
|
|
var uid = getUid(); // eslint-disable-line
|
|
|
|
|
|
if (!uid) {
|
|
|
return $.Deferred().reject({data: {refer: window.signinUrl()}}).promise(); // eslint-disable-line
|
|
|
}
|
|
|
|
|
|
return $.getJSON('/product/detail/coupon', {
|
|
|
couponId: cid
|
|
|
}).then(function(result) {
|
|
|
var defer = $.Deferred(); //eslint-disable-line
|
|
|
|
|
|
if (result.code === 200) {
|
|
|
defer.resolve();
|
|
|
} else {
|
|
|
defer.reject(result);
|
|
|
}
|
|
|
|
|
|
return defer.promise();
|
|
|
});
|
|
|
}
|
|
|
|
|
|
function acquireCoupon($ele) {
|
|
|
var couponId = $ele.data('id');
|
|
|
var i = $ele.data('i');
|
|
|
var $item = $($couponItem.get(i));
|
|
|
var status = $item.data('status');
|
|
|
|
|
|
switch (status) {
|
|
|
case 1:
|
|
|
getCouponAsync(couponId).then(function() {
|
|
|
$ele.find('.coupon-status').text(oldStatus.txt);
|
|
|
$ele.find('.coupon-go').empty().append(oldStatus.html);
|
|
|
|
|
|
$item.data('status', 3);
|
|
|
}).fail(function(err) {
|
|
|
if (err.data && err.data.refer) {
|
|
|
return window.jumpUrl(err.data.refer);
|
|
|
}
|
|
|
|
|
|
alert(err.message);
|
|
|
});
|
|
|
break;
|
|
|
default:
|
|
|
window.jumpUrl(brandDomain);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
function openCouponDialog(e) {
|
|
|
var $coupons = $couponItem.map(function(i) {
|
...
|
...
|
@@ -144,14 +195,24 @@ bindEvent.add(function() { |
|
|
}
|
|
|
};
|
|
|
|
|
|
new Dialog({
|
|
|
var dialog = new Dialog({
|
|
|
content: dialogTpl({coupon: couponData}),
|
|
|
className: 'coupon-big'
|
|
|
}).show();
|
|
|
});
|
|
|
|
|
|
dialog.$el.on('click', '.status', function() {
|
|
|
acquireCoupon($(this));
|
|
|
});
|
|
|
|
|
|
dialog.show();
|
|
|
e.stopPropagation();
|
|
|
}
|
|
|
|
|
|
// 打开优惠券列表
|
|
|
$moreCoupon.on('click', openCouponDialog);
|
|
|
|
|
|
/** 优惠券结束 **/
|
|
|
|
|
|
function getSku() {
|
|
|
return $('.size:not(.hide) li.focus').data('sku');
|
|
|
}
|
...
|
...
|
@@ -226,6 +287,8 @@ bindEvent.add(function() { |
|
|
move(e);
|
|
|
});
|
|
|
|
|
|
// 细节图结束
|
|
|
|
|
|
// 促销弹出框
|
|
|
var icon = { // eslint-disable-line
|
|
|
unfold: '',
|
...
|
...
|
@@ -234,17 +297,8 @@ bindEvent.add(function() { |
|
|
|
|
|
$('.activity-title').click(function() {
|
|
|
$(this).toggleClass('active');
|
|
|
$('.activity-container').empty();
|
|
|
|
|
|
if ($(this).hasClass('active')) {
|
|
|
$(this).find('span').html(icon.fold);
|
|
|
|
|
|
if (!$('.activity-container').html()) {
|
|
|
$('.activity-container').append($('.activity').clone().find('li').each(function() {
|
|
|
$(this).removeClass('hide');
|
|
|
}).end());
|
|
|
}
|
|
|
|
|
|
$('.activity-container').slideDown(400);
|
|
|
} else {
|
|
|
$(this).find('span').html(icon.unfold);
|
...
|
...
|
@@ -252,43 +306,22 @@ bindEvent.add(function() { |
|
|
}
|
|
|
});
|
|
|
|
|
|
function getCouponAsync(cid) {
|
|
|
var uid = getUid(); // eslint-disable-line
|
|
|
|
|
|
if (!uid) {
|
|
|
return $.Deferred().reject({data: {refer: window.signinUrl()}}).promise(); // eslint-disable-line
|
|
|
}
|
|
|
|
|
|
return $.getJSON('/product/detail/coupon', {
|
|
|
couponId: cid
|
|
|
}).then(function(result) {
|
|
|
var defer = $.Deferred(); //eslint-disable-line
|
|
|
|
|
|
if (result.code === 200) {
|
|
|
defer.resolve();
|
|
|
} else {
|
|
|
defer.reject(result);
|
|
|
}
|
|
|
|
|
|
return defer.promise();
|
|
|
});
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 获取当前选择的商品数目
|
|
|
* @return [Number]
|
|
|
*/
|
|
|
|
|
|
// 获取当前选择的商品数目
|
|
|
function getNum() {
|
|
|
return +$num.text();
|
|
|
}
|
|
|
|
|
|
// 重置Num显示为1
|
|
|
// 是否能:量贩购买
|
|
|
function canBundleBuy() {
|
|
|
return goodsBaseNum < maxStock;
|
|
|
}
|
|
|
|
|
|
// 重置Num显示为最小购买数
|
|
|
function resetNum() {
|
|
|
$num.text('1');
|
|
|
$num.text(goodsBaseNum + '');
|
|
|
|
|
|
// +-按钮状态重置
|
|
|
if (maxStock === 1 || maxStock === 0) {
|
|
|
if (maxStock === 1 || maxStock === 0 || !canBundleBuy()) {
|
|
|
|
|
|
// 数目为1/0时
|
|
|
$plusNum.addClass('dis');
|
...
|
...
|
@@ -312,44 +345,13 @@ bindEvent.add(function() { |
|
|
}
|
|
|
|
|
|
// 选中的商品存量为0或者某个颜色的total为0
|
|
|
if (maxStock === 0 || ($color && ~~$color.data('total') === 0)) {
|
|
|
if (maxStock === 0 || ($color && ~~$color.data('total') === 0) || !canBundleBuy()) {
|
|
|
$itemBuy.addClass('hide'); // 隐藏加入购物车、即将开售、立即购买等相同位置的按钮
|
|
|
$soldOut.removeClass('hide');
|
|
|
|
|
|
$enableNotifyYou.removeClass('hide');
|
|
|
|
|
|
notify.status(getSku()).then(function(result) {
|
|
|
// 检查当前请求是否是选中的sku
|
|
|
if (result.data.sku !== getSku()) {
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
if (result.data.status === 'Y') {
|
|
|
$enableNotifyYou.addClass('dis');
|
|
|
$enableNotifyYou.find('span').text('已订阅到货通知');
|
|
|
} else {
|
|
|
$enableNotifyYou.removeClass('dis');
|
|
|
$enableNotifyYou.find('span').text('到货通知');
|
|
|
}
|
|
|
}).fail(function(err) {
|
|
|
if (err.code === 400) {
|
|
|
window.jumpUrl(err.data.refer);
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
// 检查当前请求是否是选中的sku
|
|
|
if (err.data.sku !== getSku()) {
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
$enableNotifyYou.removeClass('dis');
|
|
|
$enableNotifyYou.find('span').text('到货通知');
|
|
|
});
|
|
|
} else {
|
|
|
// 包括默认的-1情况下
|
|
|
$itemBuy.removeClass('hide');
|
|
|
$soldOut.addClass('hide');
|
|
|
$enableNotifyYou.addClass('hide');
|
|
|
}
|
|
|
}
|
|
|
|
...
|
...
|
@@ -477,24 +479,100 @@ bindEvent.add(function() { |
|
|
|
|
|
switchBtnStatus();
|
|
|
|
|
|
// / 到货通知:状态
|
|
|
if ($this.data('notify') === 'Y') {
|
|
|
$enableNotifyYou.removeClass('hide');
|
|
|
|
|
|
notify.statusAsync(getSku()).then(function(result) {
|
|
|
// 检查当前请求是否是选中的sku
|
|
|
if (result.data.sku !== getSku()) {
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
if (result.data.status === 'Y') {
|
|
|
$enableNotifyYou.addClass('dis');
|
|
|
$enableNotifyYou.find('span').text('已订阅到货通知');
|
|
|
} else {
|
|
|
$enableNotifyYou.removeClass('dis');
|
|
|
$enableNotifyYou.find('span').text('到货通知');
|
|
|
}
|
|
|
}).fail(function(err) {
|
|
|
// 检查当前请求是否是选中的sku
|
|
|
if (err.data.sku !== getSku()) {
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
$enableNotifyYou.removeClass('dis');
|
|
|
$enableNotifyYou.find('span').text('到货通知');
|
|
|
});
|
|
|
} else {
|
|
|
$enableNotifyYou.addClass('hide');
|
|
|
}
|
|
|
|
|
|
resetNum();
|
|
|
}).on('click', '.size-ruler', function() {
|
|
|
|
|
|
// 尺码帮助
|
|
|
|
|
|
$('body,html').animate({
|
|
|
scrollTop: $('.size-info').offset().top
|
|
|
}, 300);
|
|
|
});
|
|
|
|
|
|
// 增加到货通知
|
|
|
$enableNotifyYou.on('click', function() {
|
|
|
var opt = {
|
|
|
if ($enableNotifyYou.hasClass('dis')) {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
var opt = { //eslint-disable-line
|
|
|
className: 'notify-goods-wrapper',
|
|
|
closeIcon: true,
|
|
|
content: notifyTpl({msg: '测试信息!'})
|
|
|
content: notifyTpl({pid: id, sku: getSku()})
|
|
|
};
|
|
|
|
|
|
var dialog = new Dialog(opt); // eslint-disable-line
|
|
|
|
|
|
var FAV = { //eslint-disable-line
|
|
|
checked: '',
|
|
|
unchecked: ''
|
|
|
};
|
|
|
|
|
|
new Dialog(opt).show();
|
|
|
dialog.$el.on('click', '.ok', function() {
|
|
|
var $this = $(this),
|
|
|
sku = $this.data('sku'),
|
|
|
isFav = dialog.$el.find('.active').length === 1;
|
|
|
|
|
|
notify.addAsync(skn, sku).then(function() {
|
|
|
if (isFav) {
|
|
|
$('#collect-product').triggerHandler('click');
|
|
|
}
|
|
|
|
|
|
$enableNotifyYou.addClass('dis');
|
|
|
$enableNotifyYou.find('span').text('已订阅到货通知');
|
|
|
}).fail(function(err) {
|
|
|
if (err.code === 400) {
|
|
|
window.jumpUrl(err.data.refer);
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
alert(err.message);
|
|
|
}).always(function() {
|
|
|
dialog.close();
|
|
|
});
|
|
|
});
|
|
|
|
|
|
dialog.$el.on('click', '.checked', function() {
|
|
|
var $this = $(this);
|
|
|
|
|
|
$this.toggleClass('active');
|
|
|
|
|
|
if ($this.hasClass('active')) {
|
|
|
$this.html(FAV.checked);
|
|
|
} else {
|
|
|
$this.html(FAV.unchecked);
|
|
|
}
|
|
|
});
|
|
|
|
|
|
dialog.show();
|
|
|
});
|
|
|
|
|
|
// 增加购买数量
|
...
|
...
|
@@ -640,7 +718,7 @@ bindEvent.add(function() { |
|
|
$this.toggleClass('coled');
|
|
|
|
|
|
if (cancel) {
|
|
|
$this.find('em').text(colTxt.def);
|
|
|
$this.find('em').text(colTxt.normal);
|
|
|
} else {
|
|
|
$this.find('em').text(colTxt.coled);
|
|
|
}
|
...
|
...
|
@@ -776,39 +854,6 @@ bindEvent.add(function() { |
|
|
$sizes.eq($('.colors .focus').index()).find('li').click();
|
|
|
}
|
|
|
}());
|
|
|
|
|
|
// 打开优惠券列表
|
|
|
$moreCoupon.on('click', openCouponDialog);
|
|
|
|
|
|
function acquireCoupon($ele) {
|
|
|
var couponId = $ele.data('id');
|
|
|
var i = $ele.data('i');
|
|
|
var $item = $($couponItem.get(i));
|
|
|
var status = $item.data('status');
|
|
|
|
|
|
switch (status) {
|
|
|
case 1:
|
|
|
getCouponAsync(couponId).then(function() {
|
|
|
$ele.find('.coupon-status').text(oldtatus.txt);
|
|
|
$ele.find('.coupon-go').empty().append(oldtatus.html);
|
|
|
|
|
|
$item.data('status', 3);
|
|
|
}).fail(function(err) {
|
|
|
if (err.data && err.data.refer) {
|
|
|
return window.jumpUrl(err.data.refer);
|
|
|
}
|
|
|
|
|
|
alert(err.message);
|
|
|
});
|
|
|
break;
|
|
|
default:
|
|
|
window.jumpUrl(brandDomain);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
// 清除原来的事件,增加新的事件
|
|
|
clickAcquireCouponEvent.empty();
|
|
|
clickAcquireCouponEvent.add(acquireCoupon);
|
|
|
});
|
|
|
|
|
|
// yas
|
...
|
...
|
@@ -816,29 +861,22 @@ require('../common'); |
|
|
|
|
|
require('./detail/latest-walk'); // 最近浏览
|
|
|
|
|
|
// 优惠券的领取
|
|
|
$(document).on('click', '.status', function() {
|
|
|
clickAcquireCouponEvent.fire($(this));
|
|
|
});
|
|
|
|
|
|
// 品牌收藏
|
|
|
$('#brand-favour').click(function() {
|
|
|
var $this = $(this);
|
|
|
var type = $this.hasClass('coled') ? BRAND_FAV.cancel : BRAND_FAV.add;
|
|
|
|
|
|
$.ajax({
|
|
|
type: 'POST',
|
|
|
url: '/product/index/favoriteBrand',
|
|
|
data: {
|
|
|
brandId: $this.data('id'),
|
|
|
type: type
|
|
|
}
|
|
|
}).then(function(data) {
|
|
|
if (data.code === 200) {
|
|
|
$this.toggleClass('coled');
|
|
|
} else if (data.code === 403) {
|
|
|
location.href = data.data.url;
|
|
|
(function() {
|
|
|
switch (type) {
|
|
|
case BRAND_FAV.add:
|
|
|
return favorite.addFav(shopId, brandId);
|
|
|
case BRAND_FAV.cancel:
|
|
|
return favorite.cancelFav(shopId, brandId);
|
|
|
default:
|
|
|
return $.Deferred.reject().promise();
|
|
|
}
|
|
|
}()).then(function() {
|
|
|
$this.toggleClass('coled');
|
|
|
});
|
|
|
});
|
|
|
|
...
|
...
|
@@ -848,18 +886,16 @@ $('.after-service-switch').click(function() { |
|
|
$content = $this.next('.after-service-content');
|
|
|
|
|
|
var html = {
|
|
|
def: '',
|
|
|
spread: ''
|
|
|
down: '',
|
|
|
up: ''
|
|
|
};
|
|
|
|
|
|
if ($content.css('display') === 'none') {
|
|
|
$content.slideDown(SLIDETIME);
|
|
|
|
|
|
$this.find('.triangle').html(html.spread);
|
|
|
$this.find('.triangle').html(html.up);
|
|
|
} else {
|
|
|
$content.slideUp(SLIDETIME);
|
|
|
|
|
|
$this.find('.triangle').html(html.def);
|
|
|
$this.find('.triangle').html(html.down);
|
|
|
}
|
|
|
});
|
|
|
|
...
|
...
|
@@ -1011,7 +1047,7 @@ function fetchComment() { |
|
|
}
|
|
|
}).then(function(data) {
|
|
|
var res;
|
|
|
var totalnum;
|
|
|
var totalNum;
|
|
|
var baseUrl = '/product/detail/consult?productId=' + id + '&filterId=7';
|
|
|
|
|
|
if (data.code === 200) {
|
...
|
...
|
@@ -1024,7 +1060,7 @@ function fetchComment() { |
|
|
// 更新总数显示
|
|
|
$consultNum.text(res[0].total);
|
|
|
|
|
|
totalnum = Math.ceil(res[0].total / 10) * 20;
|
|
|
totalNum = Math.ceil(res[0].total / 10) * 20;
|
|
|
|
|
|
$consultsUl.empty().append(consultsTpl({
|
|
|
consults: res
|
...
|
...
|
@@ -1033,20 +1069,20 @@ function fetchComment() { |
|
|
|
|
|
$('#consults-ul .zan-content').on('click', '.cuslike', function() {
|
|
|
var $this = $(this);
|
|
|
var id = $this.data('id');
|
|
|
var cid = $this.data('id');
|
|
|
var like = $this.data('like');
|
|
|
|
|
|
$.ajax({
|
|
|
type: 'GET',
|
|
|
url: '/product/detail/consult/like/' + id
|
|
|
}).then(function(data) {
|
|
|
if (data && data.code === 400) {
|
|
|
return window.jumpUrl(data.data.refer);
|
|
|
url: '/product/detail/consult/like/' + cid
|
|
|
}).then(function(result) {
|
|
|
if (result && result.code === 400) {
|
|
|
return window.jumpUrl(result.data.refer);
|
|
|
}
|
|
|
|
|
|
if (data && data.code === 200) {
|
|
|
if (result && result.code === 200) {
|
|
|
$this.addClass('getzan');
|
|
|
$('.zan-content .icon-border[data-id=' + id + '] .likeNum')
|
|
|
$('.zan-content .icon-border[data-id=' + cid + '] .likeNum')
|
|
|
.replaceWith('<em class="likeNum">' + (like + 1) + '</em>');
|
|
|
}
|
|
|
|
...
|
...
|
@@ -1056,20 +1092,22 @@ function fetchComment() { |
|
|
|
|
|
$('#consults-ul .zan-content').on('click', '.cususeful', function() {
|
|
|
var $this = $(this);
|
|
|
var id = $this.data('id');
|
|
|
var cid = $this.data('id');
|
|
|
var useful = $this.data('useful');
|
|
|
|
|
|
$this.addClass('getzan');
|
|
|
|
|
|
$.ajax({
|
|
|
type: 'GET',
|
|
|
url: '/product/detail/consult/useful/' + id
|
|
|
}).then(function(data) {
|
|
|
if (data && data.code === 400) {
|
|
|
url: '/product/detail/consult/useful/' + cid
|
|
|
}).then(function(result) {
|
|
|
if (result && result.code === 400) {
|
|
|
return window.jumpUrl(data.data.refer);
|
|
|
}
|
|
|
|
|
|
if (data && data.code === 200) {
|
|
|
$('.zan-content .usefulData[data-id=' + id + '] .usefulNum')
|
|
|
.replaceWith('<em class="usefulNum">' + (useful + 1) + '</em>');
|
|
|
if (result && result.code === 200) {
|
|
|
$('.zan-content .usefulData[data-id=' + cid + '] .usefulNum')
|
|
|
.replaceWith('<em class="usefulNum">' + (useful + 1) + '</em>');
|
|
|
}
|
|
|
|
|
|
});
|
...
|
...
|
@@ -1077,10 +1115,9 @@ function fetchComment() { |
|
|
|
|
|
baseUrl = '/product/detail/consult?productId=' + id + '&filterId=7';
|
|
|
|
|
|
|
|
|
$('.consults-devide').empty().append(
|
|
|
setPager({baseUrl: baseUrl,
|
|
|
totalRecords: totalnum,
|
|
|
totalRecords: totalNum,
|
|
|
page: nowPage,
|
|
|
type: 'ellipsis',
|
|
|
theme: 'msg-pager'
|
...
|
...
|
@@ -1113,8 +1150,6 @@ function fetchComment() { |
|
|
}
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
// 我要咨询
|
|
|
$('#consults-btn').click(function() {
|
|
|
|
...
|
...
|
@@ -1461,6 +1496,7 @@ $('.package-box').on('click', '#buy-detail', function() { |
|
|
});
|
|
|
});
|
|
|
|
|
|
// 店铺推荐和最近浏览
|
|
|
$('.bottom-tab').on('click', '.bottom-title', function() {
|
|
|
var $this = $(this),
|
|
|
index = $this.index();
|
...
|
...
|
@@ -1483,12 +1519,14 @@ $('.bottom-tab').on('click', '.bottom-title', function() { |
|
|
// 店铺推荐
|
|
|
$recommendComment.slideDown(SLIDETIME);
|
|
|
$latestWalk.slideUp(SLIDETIME);
|
|
|
|
|
|
$('.change').css('display', 'inline-block');
|
|
|
} else {
|
|
|
// 最近游览
|
|
|
fetchLatestWalk(); // eslint-disable-line
|
|
|
$recommendComment.slideUp(SLIDETIME);
|
|
|
$latestWalk.slideDown(SLIDETIME);
|
|
|
|
|
|
$('.change').css('display', 'none');
|
|
|
}
|
|
|
|
...
|
...
|
@@ -1540,19 +1578,13 @@ bindEvent.fire(); |
|
|
}
|
|
|
});
|
|
|
|
|
|
// 品牌收藏
|
|
|
$.ajax({
|
|
|
type: 'GET',
|
|
|
url: '/product/index/isfav',
|
|
|
data: {
|
|
|
brandId: $('#brand-favour').data('id')
|
|
|
}
|
|
|
}).then(function(result) {
|
|
|
if (result.code === 200 && result.data) {
|
|
|
$('#brand-favour').addClass('coled');
|
|
|
}
|
|
|
favorite.getFavNum(shopId, brandId).then(function(result) {
|
|
|
$('#brand-favour').find('span').html(result.count);
|
|
|
});
|
|
|
|
|
|
favorite.statusFav(shopId, brandId).then(function() {
|
|
|
$('#brand-favour').addClass('coled');
|
|
|
});
|
|
|
}());
|
|
|
|
|
|
$(window).scroll(function() {
|
...
|
...
|
@@ -1601,6 +1633,7 @@ $('.shoppingCar').on('click', '.option', function(e) { |
|
|
$this.addClass('fixed');
|
|
|
});
|
|
|
|
|
|
|
|
|
$('.shoppingCar-btn').on('click', function() {
|
|
|
var $addToCart = $('#add-to-cart');
|
|
|
var sc = $(document);
|
...
|
...
|
|