...
|
...
|
@@ -3,12 +3,14 @@ |
|
|
* @author: Lynnic
|
|
|
* @date: 2015/11/24
|
|
|
*/
|
|
|
|
|
|
|
|
|
var $ = require('jquery'),
|
|
|
Hammer = require('yoho.hammer'),
|
|
|
tip = require('../../plugin/tip');
|
|
|
|
|
|
var likeHammer = new Hammer(document.getElementById('likeBtn')),
|
|
|
addToCartHammer = new Hammer(document.getElementById('addtoCart'));
|
|
|
var likeHammer = new Hammer(document.getElementById('likeBtn'));
|
|
|
var addToCartHammer = new Hammer(document.getElementById('addtoCart'));
|
|
|
|
|
|
var productId = $('#productId').val();
|
|
|
|
...
|
...
|
@@ -16,8 +18,7 @@ likeHammer.on('tap', function(e) { |
|
|
var opt,
|
|
|
favorite;
|
|
|
|
|
|
|
|
|
var $this = $(this);
|
|
|
var $this = $(e.target);
|
|
|
|
|
|
if ($this.hasClass('liked')) {
|
|
|
opt = 'cancel';
|
...
|
...
|
@@ -26,7 +27,6 @@ likeHammer.on('tap', function(e) { |
|
|
opt = 'ok';
|
|
|
favorite = 1;
|
|
|
}
|
|
|
|
|
|
$.ajax({
|
|
|
type: 'POST',
|
|
|
url: '/product/opt/favoriteProduct',
|
...
|
...
|
|