Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
YOHO-ACTIVITY-PHP
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
梁志锋
9 years ago
Commit
23ad180a9c194e3507e400a37b61f8287f1339f9
1 parent
7bb68f4c
购物车功能开发
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
28 additions
and
28 deletions
static/js/product/detail/like.js
static/js/shopping-cart/gift-advance.js
static/js/shopping-cart/good.js
template/m.yohobuy.com/actions/index/shoppingCart/index.phtml
template/m.yohobuy.com/partials/shopping-cart/cart-content.phtml
static/js/product/detail/like.js
View file @
23ad180
...
...
@@ -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
);
}
});
}
...
...
static/js/shopping-cart/gift-advance.js
View file @
23ad180
...
...
@@ -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
...
...
static/js/shopping-cart/good.js
View file @
23ad180
...
...
@@ -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
;
...
...
template/m.yohobuy.com/actions/index/shoppingCart/index.phtml
View file @
23ad180
{
{>
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"
>
62
c</i>
<p>您的购物车暂无商品</p>
...
...
template/m.yohobuy.com/partials/shopping-cart/cart-content.phtml
View file @
23ad180
...
...
@@ -20,7 +20,7 @@
<li class="advance-buy">
<span class="iconfont"></span>
加价购
<a
href="/shoppingCart/getCartData"
>
<a>
<span class="count">{{count}}</span>
<span class="iconfont icon-right-arrow"></span>
</a>
...
...
Please
register
or
login
to post a comment