...
|
...
|
@@ -14,6 +14,7 @@ var $ = require('yoho-jquery'); |
|
|
var lazyLoad = require('yoho-jquery-lazyload');
|
|
|
var yas = require('../common/data-yas');
|
|
|
var dataLazyLoad = require('../plugins/lazy-load')(document);
|
|
|
var handlebars = require('yoho-handlebars');
|
|
|
|
|
|
var bindEvent = $.Callbacks(); // eslint-disable-line
|
|
|
var clickAcquireCouponEvent = $.Callbacks('unique'); // eslint-disable-line
|
...
|
...
|
@@ -48,7 +49,8 @@ var $saleReturn = $('#saleReturn'); |
|
|
|
|
|
var dialogTpl = require('hbs/product/coupon-dialog.hbs');
|
|
|
|
|
|
var $goodsIdArr = [];
|
|
|
var $goodsIdArr = [],
|
|
|
pkgFn = '';
|
|
|
|
|
|
function limitedProductUrl(s) {
|
|
|
return window.location.href + '?openby:yohobuy={"action":"go.limitpurchase","params":{"lp":"' + s + '"}}';
|
...
|
...
|
@@ -61,6 +63,9 @@ function isEmpty(el) { |
|
|
require('../plugins/slider');
|
|
|
require('../common/center-slider');
|
|
|
|
|
|
// handlebars模板
|
|
|
pkgFn = handlebars.compile($('#packageDialog').html() || '');
|
|
|
|
|
|
bindEvent.add(function() {
|
|
|
var $imgShow = $('#img-show'),
|
|
|
$thumbs = $('#thumbs > .thumb-wrap');
|
...
|
...
|
@@ -80,7 +85,7 @@ bindEvent.add(function() { |
|
|
var $lcContainer = $('.lc-container'),
|
|
|
$itemBuy = $('.item-buy');
|
|
|
|
|
|
var $enableNofifyGoods = $('#enable-notify');
|
|
|
var $enableNotifyYou = $('#enable-notify');
|
|
|
|
|
|
var $qrcode = $('.qr-code');
|
|
|
|
...
|
...
|
@@ -216,12 +221,12 @@ bindEvent.add(function() { |
|
|
if (maxStock === 0 || ($color && ~~$color.data('total') === 0)) {
|
|
|
$itemBuy.addClass('hide'); // 隐藏加入购物车、即将开售、立即购买等相同位置的按钮
|
|
|
$soldOut.removeClass('hide');
|
|
|
$enableNofifyGoods.removeClass('hide');
|
|
|
$enableNotifyYou.removeClass('hide');
|
|
|
} else {
|
|
|
// 包括默认的-1情况下
|
|
|
$itemBuy.removeClass('hide');
|
|
|
$soldOut.addClass('hide');
|
|
|
$enableNofifyGoods.addClass('hide');
|
|
|
$enableNotifyYou.addClass('hide');
|
|
|
}
|
|
|
}
|
|
|
|
...
|
...
|
@@ -351,6 +356,10 @@ bindEvent.add(function() { |
|
|
}, 300);
|
|
|
});
|
|
|
|
|
|
$enableNotifyYou.on('click', function() {
|
|
|
new Alert("fjdsl").show();
|
|
|
});
|
|
|
|
|
|
// 增加购买数量
|
|
|
$plusNum.click(function() {
|
|
|
var num = getNum();
|
...
|
...
|
@@ -432,7 +441,7 @@ bindEvent.add(function() { |
|
|
}
|
|
|
|
|
|
// 加入购物车埋点
|
|
|
yas.givePoint('YB_GDS_DT_ADD_TO_SC', {PRD_ID: getSku(), PRD_NUM: getNum() });
|
|
|
yas.givePoint('YB_GDS_DT_ADD_TO_SC', {PRD_ID: getSku(), PRD_NUM: getNum()});
|
|
|
|
|
|
$.ajax({
|
|
|
type: 'POST',
|
...
|
...
|
@@ -477,7 +486,7 @@ bindEvent.add(function() { |
|
|
coltyp = cancel ? 2 : 1;
|
|
|
|
|
|
// 收藏埋点
|
|
|
yas.givePoint('YB_COLLECTION_C', {PRD_ID: id, COL_TYP: coltyp });
|
|
|
yas.givePoint('YB_COLLECTION_C', {PRD_ID: id, COL_TYP: coltyp});
|
|
|
|
|
|
$.ajax({
|
|
|
type: 'POST',
|
...
|
...
|
@@ -516,6 +525,16 @@ bindEvent.add(function() { |
|
|
}
|
|
|
});
|
|
|
|
|
|
//套餐
|
|
|
$('#buy-detail').click(function () {
|
|
|
var opt = {
|
|
|
className: 'pkg-dialog',
|
|
|
closeIcon: false,
|
|
|
content: pkgFn({msg: '测试信息!'})
|
|
|
};
|
|
|
|
|
|
new Dialog(opt).show();
|
|
|
});
|
|
|
// 继续购物
|
|
|
$('#keep-shopping').click(function() {
|
|
|
$('#type-chose').slideDown(SLIDETIME);
|
...
|
...
|
@@ -1183,7 +1202,6 @@ $('.bottom-tab').on('click', '.bottom-title', function() { |
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
$('.recommend-content').find('.iconfont').mouseenter(function() {
|
|
|
$(this).addClass('focus');
|
|
|
}).mouseleave(function() {
|
...
|
...
|
|