...
|
...
|
@@ -6,23 +6,16 @@ |
|
|
|
|
|
|
|
|
var $ = require('jquery'),
|
|
|
Hammer = require('yoho.hammer'),
|
|
|
tip = require('../../plugin/tip'),
|
|
|
chosePanel = require('../../cart/chose-panel');
|
|
|
|
|
|
var likeEle = document.getElementById('likeBtn'),
|
|
|
likeHammer = likeEle && new Hammer(likeEle);
|
|
|
var productId = $('#productId').val();
|
|
|
|
|
|
var addToCartEle = document.getElementById('addtoCart'),
|
|
|
addToCartHammer = addToCartEle && new Hammer(addToCartEle),
|
|
|
productId = $('#productId').val();
|
|
|
|
|
|
if (likeHammer) {
|
|
|
likeHammer.on('tap', function(e) {
|
|
|
$('#likeBtn').on('click', function() {
|
|
|
var opt,
|
|
|
favorite;
|
|
|
|
|
|
var $this = $(e.target);
|
|
|
var $this = $(this);
|
|
|
|
|
|
if ($this.hasClass('liked')) {
|
|
|
opt = 'cancel';
|
...
|
...
|
@@ -66,11 +59,11 @@ if (likeHammer) { |
|
|
fa: favorite
|
|
|
}, true);
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
|
|
|
if (addToCartHammer) {
|
|
|
addToCartHammer.on('tap', function(e) {
|
|
|
return false;
|
|
|
});
|
|
|
|
|
|
$('#addtoCart').on('click', function() {
|
|
|
chosePanel.show();
|
|
|
|
|
|
//统计代码:用于统计用户加入购物车的动作
|
...
|
...
|
@@ -81,5 +74,5 @@ if (addToCartHammer) { |
|
|
}, true);
|
|
|
}
|
|
|
|
|
|
});
|
|
|
} |
|
|
return false;
|
|
|
}); |
|
|
\ No newline at end of file |
...
|
...
|
|