Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
YOHOBUYPC
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
2
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
xuqi
9 years ago
Commit
c951d44a4bf616b888c2e1efcfd93593e6ec8def
1 parent
0175898e
balance alert
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
13 deletions
static/js/cart/cart.js
static/js/cart/cart.js
View file @
c951d44
...
...
@@ -16,14 +16,21 @@ var $cartContent = $('.cart-content'),
cartType
=
$
(
'#cartType'
).
val
(),
hasShowCartPresellTip
=
false
;
var
$cartContentShow
=
$cartContent
.
not
(
'.hide'
);
var
navHammer
,
advanceBuyHammer
,
freebieHammer
;
freebieHammer
,
switchChose
=
false
;
require
(
'../product/recommend-for-you'
);
var
hasChecked
=
$
(
'.cart-content:not(.hide) .icon-cb-checked'
).
length
>
0
?
true
:
false
;
//是否有选中商品
function
hasChecked
()
{
return
$cartContentShow
.
find
(
'.icon-cb-checked'
).
length
>
0
?
true
:
false
;
}
function
shouldSelectGift
()
{
var
$freebie
=
$
(
'.freebie'
);
var
$freebie
=
$
cartContentShow
.
find
(
'.freebie'
);
if
(
$freebie
.
length
<=
0
)
{
return
false
;
...
...
@@ -58,7 +65,7 @@ function showChooseGifDialog() {
rightBtnText
:
'去选择'
}
},
function
()
{
window
.
location
.
href
=
$
(
'.freebie'
).
find
(
'
a'
).
attr
(
'href'
);
window
.
location
.
href
=
$
cartContentShow
.
find
(
'.freebie >
a'
).
attr
(
'href'
);
},
function
()
{
window
.
location
.
href
=
'/cart/index/orderEnsure?cartType='
+
cartType
;
});
...
...
@@ -93,9 +100,11 @@ if ($('.cart-nav').length > 0) {
return
;
}
$
(
'.shopping-cart-good .name'
).
each
(
function
()
{
this
.
mlellipsis
(
2
);
});
if
(
switchChose
===
false
)
{
$
(
'.shopping-cart-good .name'
).
each
(
function
()
{
this
.
mlellipsis
(
2
);
});
}
if
(
cartType
===
'ordinary'
)
{
cartType
=
'advance'
;
...
...
@@ -111,7 +120,7 @@ if ($('.cart-nav').length > 0) {
//切换普通商品和预售商品购物车显示
$cartContent
.
toggleClass
(
'hide'
);
hasChecked
=
$
(
'.cart-content:not(.hide) .icon-cb-checked'
).
length
>
0
?
true
:
false
;
$cartContentShow
=
$cartContent
.
not
(
'.hide'
)
;
//trigger lazyload
$
(
window
).
trigger
(
'scroll'
);
...
...
@@ -150,7 +159,7 @@ $('.btn-balance').on('touchend', function() {
return
false
;
}
if
(
hasChecked
)
{
if
(
hasChecked
()
)
{
window
.
location
.
href
=
'/cart/index/orderEnsure?cartType='
+
cartType
;
}
else
{
tip
.
show
(
'请先勾选商品'
);
...
...
@@ -161,10 +170,6 @@ $('.chose').on('touchend', function() {
chosePanel
.
show
();
});
if
(
$
(
'.shopping-cart-good'
).
length
<=
0
)
{
require
(
'../product/recommend-for-you'
);
}
function
notAllowScroll
()
{
var
docH
=
$
(
document
).
height
(),
winH
=
$
(
window
).
height
();
...
...
Please
register
or
login
to post a comment