Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
YOHOBUYWAP
·
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
34616bc6f90016d33c6261e12bab14134f81a277
1 parent
076e74b4
购物车商品选择bug修改
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletions
static/js/cart/good.js
static/js/cart/good.js
View file @
34616bc
...
...
@@ -36,13 +36,15 @@ function GoodInfo(properties) {
this
.
buy_number
=
properties
.
buy_number
;
this
.
product_sku
=
properties
.
product_sku
;
this
.
selected
=
properties
.
selected
;
this
.
hasPromotion
=
properties
.
hasPromotion
;
}
//TIP:事件委托在.cart-goods,商品列表的容器统一需要有.cart-goods
$
(
'.cart-goods'
).
on
(
'touchstart'
,
'.checkbox'
,
function
()
{
var
$this
=
$
(
this
),
$good
=
$this
.
closest
(
'.shopping-cart-good'
),
id
=
$good
.
data
(
'id'
);
id
=
$good
.
data
(
'id'
),
promotion
=
$good
.
data
(
'promotion'
);
var
goodsList
=
[],
goodInfo
=
{};
...
...
@@ -55,6 +57,7 @@ $('.cart-goods').on('touchstart', '.checkbox', function() {
goodInfo
.
goods_type
=
$
(
'#cartType'
).
val
();
goodInfo
.
selected
=
$this
.
hasClass
(
'icon-cb-checked'
)
?
'N'
:
'Y'
;
goodInfo
.
product_sku
=
id
;
goodInfo
.
hasPromotion
=
promotion
;
goodInfo
.
buy_number
=
$good
.
find
(
'.count'
).
eq
(
0
).
text
().
trim
().
replace
(
'×'
,
''
);
goodsList
.
push
(
new
GoodInfo
(
goodInfo
));
...
...
Please
register
or
login
to post a comment