Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yoho-blk
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
1
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
郝肖肖
8 years ago
Commit
637338a78ea3e043b9f6e6805a265d92f9d60cca
1 parent
1621d046
清除失效商品
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
52 additions
and
4 deletions
apps/shopping/views/partial/cart/cart-list-body.hbs
apps/shopping/views/partial/cart/statement.hbs
public/js/shopping/cart.page.js
public/js/shopping/cart/cart.js
public/scss/shopping/_cart-products.css
public/scss/shopping/_statement.css
public/tpl/shopping/cart-content.hbs
apps/shopping/views/partial/cart/cart-list-body.hbs
View file @
637338a
...
...
@@ -108,10 +108,13 @@
{{#
if
invalidPros
}}
<div
class=
"cart-pro-list invalid-pros"
>
<div
class=
"title"
>
<span
class=
"main"
>
失效商品
</span>
</div>
<div
class=
"pro-list"
>
{{#
each
invalidPros
}}
<ul>
<li
class=
"chk"
data-product_info=
'{"goods_type": "invalid", "buy_number":
{{
buy_number
}}
, "selected": "
{{
selected
}}
", "product_sku": "
{{
product_sku
}}
", "promotion_id": 0}'
>
<li
class=
"chk"
data-product_info=
'{"goods_type": "invalid", "buy_number":
{{
buy_number
}}
, "selected": "
{{
selected
}}
", "product_sku": "
{{
product_sku
}}
", "promotion_id": 0}'
title=
"失效"
>
<span
class=
"iconfont warning"
>

</span>
</li>
<li>
...
...
apps/shopping/views/partial/cart/statement.hbs
View file @
637338a
...
...
@@ -15,6 +15,7 @@
</div>
<div
id=
"remove_selected"
class=
"action hoverable"
>
删除选中的商品
</div>
<div
id=
"send_favorite"
class=
"action hoverable"
>
移入收藏夹
</div>
<div
id=
"clear_invalid_all"
class=
"action hoverable"
>
清除失效商品
</div>
<div
class=
"selected-num"
>
已选
<span>
{{
selectedNum
}}
</span>
件
</div>
<div
class=
"checkout-total"
>
<div
class=
"total-title"
>
商品金额:
</div>
...
...
public/js/shopping/cart.page.js
View file @
637338a
...
...
@@ -104,6 +104,18 @@ $(function() {
});
}
return
false
;
}).
delegate
(
'#clear_invalid_all'
,
'click'
,
function
(
e
)
{
//清除失效商品
var
selectedProducts
=
[],
product
;
e
.
preventDefault
();
$
(
'.invalid-pros'
).
find
(
'li.chk'
).
each
(
function
()
{
product
=
$
(
this
);
selectedProducts
.
push
(
$
.
parseJSON
(
product
.
attr
(
'data-product_info'
)));
});
Cart
.
removeInvalid
(
selectedProducts
);
});
// 商品删除模块
...
...
public/js/shopping/cart/cart.js
View file @
637338a
...
...
@@ -230,6 +230,39 @@ Cart = {
new
_alert
(
'请至少选中一件商品!'
).
show
();
}
},
/*
* 删除失效商品
* @function [removePro]
* @params { Array } products 商品列表
* @params { Array } extraInfos 删除商品额外信息
*/
removeInvalid
:
function
(
products
,
extraInfos
)
{
var
dialog
;
if
(
products
.
length
)
{
dialog
=
new
_confirm
({
content
:
'<p style="font-size:25px;margin-bottom:20px;">清除失效商品</p><p>确定要清除失效商品吗?</p>'
,
cb
:
function
()
{
dialog
.
close
();
Util
.
ajax
({
url
:
'/shopping/cart/product/remove'
,
data
:
{
skuList
:
JSON
.
stringify
(
products
)},
type
:
'DELETE'
,
success
:
function
(
res
)
{
Util
.
refreshCart
(
res
,
function
()
{
Stepper
.
init
();
// 显示或者更新删除商品模块
Cart
.
showRemovedProducts
(
products
,
extraInfos
);
});
}
});
}
}).
show
();
}
else
{
new
_alert
(
'购物袋中没有失效商品!'
).
show
();
}
},
/*
* 显示或者更新删除商品模块
...
...
public/scss/shopping/_cart-products.css
View file @
637338a
...
...
@@ -256,8 +256,6 @@ $hoverColor: #379ed6;
}
.invalid-pros
{
margin-top
:
80px
;
border-top
:
1px
solid
#eee
;
color
:
#999
;
input
{
...
...
public/scss/shopping/_statement.css
View file @
637338a
...
...
@@ -73,7 +73,7 @@
font-size
:
14px
;
color
:
#1b1b1b
;
font-weight
:
bold
;
margin
:
0
60px
0
224
px
;
margin
-left
:
85
px
;
}
.checkout-total
{
...
...
public/tpl/shopping/cart-content.hbs
View file @
637338a
...
...
@@ -221,6 +221,7 @@
</div>
<div
id=
"remove_selected"
class=
"action hoverable"
>
删除选中的商品
</div>
<div
id=
"send_favorite"
class=
"action hoverable"
>
移入收藏夹
</div>
<div
id=
"clear_invalid_all"
class=
"action hoverable"
>
清除失效商品
</div>
<div
class=
"selected-num"
>
已选
<span>
{{
selectedNum
}}
</span>
件
</div>
<div
class=
"checkout-total"
>
<div
class=
"total-title"
>
商品金额:
</div>
...
...
Please
register
or
login
to post a comment