Authored by 梁志锋

购物车功能开发

... ... @@ -73,14 +73,13 @@ if (addToCartHammer) {
addToCartHammer.on('tap', function(e) {
chosePanel.show();
// 统计代码:用于统计用户加入购物车的动作
// if (window._yas) {
// window._yas.sendCustomInfo({
// pd: productId,
// by: 1
// }, false);
// }
//统计代码:用于统计用户加入购物车的动作
if (window._yas) {
window._yas.sendCustomInfo({
pd: productId,
by: 1
}, true);
}
});
}
... ...
... ... @@ -11,19 +11,19 @@ var chosePanel = require('./chose-panel');
lazyLoad($('.lazy'));
$('.gift-advance-page').on('touchstart', '.chose', function() {
var id = $(this).closest('.gift-advance-good').data('id');
$.ajax({
type: 'GET',
url: '/shoppingCart/goodinfo',
data: {
id: id
},
success: function(data) {
if (data.code === 200) {
chosePanel.show(data.data);
}
}
});
});
\ No newline at end of file
//$('.gift-advance-page').on('touchstart', '.chose', function() {
// var id = $(this).closest('.gift-advance-good').data('id');
//
// $.ajax({
// type: 'GET',
// url: '/shoppingCart/goodinfo',
// data: {
// id: id
// },
// success: function(data) {
// if (data.code === 200) {
// chosePanel.show(data.data);
// }
// }
// });
//});
\ No newline at end of file
... ...
... ... @@ -9,7 +9,8 @@ var $ = require('jquery'),
lazyLoad = require('yoho.lazyload');
var dialog = require('../me/dialog'),
tip = require('../plugin/tip');
tip = require('../plugin/tip'),
chosePanel = require('./chose-panel');
var $names;
... ...
{{> layout/header}}
<div id="mainCart" class="shopping-cart-page yoho-page" style="display: none;">
<div id="mainCart" class="shopping-cart-page yoho-page">
{{# shoppingCart}}
{{#if cartNav}}
... ... @@ -61,7 +61,7 @@
{{/ shoppingCart}}
</div>
<div class="shopping-cart-zero yoho-page">
<div class="shopping-cart-zero yoho-page hide">
<div class="cart-zero">
<i class="iconfont">&#xe62c</i>
<p>您的购物车暂无商品</p>
... ...
... ... @@ -20,7 +20,7 @@
<li class="advance-buy">
<span class="iconfont">&#xe61b;</span>
加价购
<a href="/shoppingCart/getCartData">
<a>
<span class="count">{{count}}</span>
<span class="iconfont icon-right-arrow">&#xe614;</span>
</a>
... ...