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
e65064fa6680efe33a2879cbd49469ee73d36369
1 parent
55ad519a
添加购物车清空实效商品
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
42 additions
and
3 deletions
apps/shopping/views/partial/cart/statement.hbs
config/common.js
package.json
public/js/shopping/cart.page.js
public/js/shopping/cart/cart.js
apps/shopping/views/partial/cart/statement.hbs
View file @
e65064f
...
...
@@ -15,6 +15,7 @@
</div>
<div
id=
"remove_selected"
class=
"action hoverable"
>
删除选中的商品
</div>
<div
id=
"send_favorite"
class=
"action hoverable"
>
移入收藏夹
</div>
<div
id=
"remove_invalid"
class=
"action hoverable"
>
清除失效商品
</div>
<div
class=
"selected-num"
>
已选
<span>
{{
selectedNum
}}
</span>
件
</div>
<div
class=
"checkout-total"
>
<div
class=
"total-title"
>
商品金额:
</div>
...
...
config/common.js
View file @
e65064f
...
...
@@ -23,8 +23,8 @@ module.exports = {
cookieDomain
:
'yohoblk.com'
,
domains
:
{
singleApi
:
'http://single.yoho.cn/'
,
api
:
'http://api.yoho.yohoops.org/'
,
service
:
'http://service.yoho.yohoops.org/'
,
api
:
'http://api.yoho.cn/'
,
service
:
'http://service.yoho.cn/'
,
search
:
'http://search.yohoops.org/yohosearch/'
},
useOneapm
:
false
,
...
...
package.json
View file @
e65064f
...
...
@@ -63,7 +63,7 @@
"winston"
:
"^2.2.0"
,
"winston-daily-rotate-file"
:
"^1.1.4"
,
"xss"
:
"^0.2.13"
,
"yoho-node-lib"
:
"0.
0.51
"
"yoho-node-lib"
:
"0.
2.0
"
},
"devDependencies"
:
{
"autoprefixer"
:
"^6.3.6"
,
...
...
public/js/shopping/cart.page.js
View file @
e65064f
...
...
@@ -140,6 +140,10 @@ $(function() {
});
});
$
(
'#remove_invalid'
).
off
().
on
(
'click'
,
function
()
{
Cart
.
removeInvalid
();
});
// 变动商品数量
Stepper
.
init
();
});
...
...
public/js/shopping/cart/cart.js
View file @
e65064f
...
...
@@ -575,6 +575,40 @@ Cart = {
}
}
});
},
/**
* 清除失效商品
*/
removeInvalid
:
function
()
{
var
invalidEles
;
var
products
=
[];
var
dialog
=
new
_confirm
({
content
:
'您确定要清除失效商品吗?'
,
cb
:
function
()
{
dialog
.
close
();
invalidEles
=
$
(
'.invalid-pros ul li.chk'
);
if
(
invalidEles
.
length
>
0
)
{
$
(
invalidEles
).
each
(
function
()
{
products
.
push
(
JSON
.
parse
(
$
(
this
).
attr
(
'data-product_info'
)));
});
Util
.
ajax
({
url
:
'/shopping/cart/product/remove'
,
data
:
{
skuList
:
JSON
.
stringify
(
products
)},
type
:
'DELETE'
,
success
:
function
(
res
)
{
Util
.
refreshCart
(
res
,
function
()
{
});
}
});
}
else
{
new
_alert
(
'购物袋中没有失效商品!'
).
show
();
}
}
}).
show
();
}
};
...
...
Please
register
or
login
to post a comment