Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yohobuywap-node
·
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
Plain Diff
Browse Files
Authored by
zhangxiaoru
8 years ago
Commit
e1f91fb5b65c94508e5434ab10777e01fe69cd2a
2 parents
f623b763
3ecb0484
merging
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
85 additions
and
26 deletions
apps/cart/controllers/order.js
apps/product/controllers/new-detail.js
apps/serverAPI/order/shopping.js
public/hbs/cart/index/index.hbs
public/js/cart/index.page.js
public/js/cart/index/cart.js
public/scss/cart/_index-new.css
utils/cart-process.js
apps/cart/controllers/order.js
View file @
e1f91fb
...
...
@@ -223,7 +223,7 @@ exports.orderSub = (req, res, next) => {
unionKey
=
testQyhUnion
.
client_id
?
encryData
:
''
;
}
}
else
{
unionKey
=
'{"client_id":'
+
req
.
cookies
.
mkt_code
+
'}'
;
unionKey
=
'{"client_id":'
+
req
.
cookies
.
mkt_code
+
(
req
.
cookies
.
union_data
?
',"union_data":'
+
req
.
cookies
.
union_data
:
''
)
+
'}'
;
}
/* 检查联盟参数是否有效 */
...
...
apps/product/controllers/new-detail.js
View file @
e1f91fb
...
...
@@ -136,7 +136,7 @@ const newDetail = {
return
res
.
json
({
code
:
400
,
data
:
helpers
.
urlFormat
(
'/signin.html'
,
{
refer
:
req
.
originalUrl
refer
:
req
.
headers
.
referer
})});
}
...
...
apps/serverAPI/order/shopping.js
View file @
e1f91fb
...
...
@@ -226,7 +226,7 @@ exports.orderSub = (uid, addressId, cartType, deliveryTime,
params
.
qhy_union
=
qhyUnion
;
}
return
api
.
ge
t
(
''
,
params
,
{
return
api
.
pos
t
(
''
,
params
,
{
headers
:
{
'X-Forwarded-For'
:
ip
||
''
,
'User-Agent'
:
userAgent
...
...
public/hbs/cart/index/index.hbs
View file @
e1f91fb
...
...
@@ -5,20 +5,24 @@
<a
href=
"/product/new"
>
随便逛逛
</a>
</div>
{{^}}
{{#if
cartNav
}}
<ul
class=
"cart-nav clearfix"
>
<li
class=
"
{{#if
ordinaryCart
}}
active
{{/if}}
"
id=
"common-cart-nav"
data-type=
"ordinary"
>
<div
class=
"cart-nav clearfix
{{#if
cartNav
}}
more
{{/if}}
"
>
{{#if
commonGoodsCount
}}
<div
class=
"nav-item
{{#if
ordinaryCart
}}
active
{{/if}}
"
id=
"common-cart-nav"
data-type=
"ordinary"
>
<span>
普通商品(
{{
commonGoodsCount
}}
)
</span>
</li>
<li
class=
"
{{#if
advanceCart
}}
active
{{/if}}
"
id=
"presell-cart-nav"
data-type=
"advance"
>
</div>
{{/if}}
{{#if
presellGoodsCount
}}
<div
class=
"nav-item
{{#if
advanceCart
}}
active
{{/if}}
"
id=
"presell-cart-nav"
data-type=
"advance"
>
<span
>
预售商品(
{{
presellGoodsCount
}}
)
</span>
<div
id=
"presell-tip"
class=
"presell-tip hide"
>
<div
class=
"triangle"
></div>
<p
class=
"pt-content"
>
预售商品点这里结算哦~
</p>
</div>
</li>
</ul>
{{/if}}
</div>
{{/if}}
<button
class=
"btn-edit"
></button>
</div>
{{#if
ordinaryCart
}}
<div
class=
"cart-content normal-good active"
>
{{#
commonCart
}}
...
...
public/js/cart/index.page.js
View file @
e1f91fb
...
...
@@ -61,7 +61,11 @@ let indexObj = {
if
(
referrer
&&
referrer
!==
window
.
location
.
href
)
{
cookie
.
remove
(
'_cartReferrer'
);
window
.
location
.
href
=
referrer
;
if
(
referrer
===
document
.
referrer
||
referrer
===
window
.
queryString
.
referrer
)
{
window
.
history
.
go
(
-
1
);
}
else
{
window
.
location
.
href
=
referrer
;
}
}
else
{
window
.
location
.
href
=
'/?go=1'
;
}
...
...
@@ -89,8 +93,7 @@ let indexObj = {
let
self
=
this
;
if
((
!
data
||
(
!
data
.
commonCart
&&
!
data
.
preSellCart
))
&&
no_try
!==
true
)
{
self
.
refreshPage
();
return
;
return
self
.
refreshPage
();
}
let
cartType
=
cookie
.
get
(
'_cartType'
)
||
'ordinary'
;
...
...
@@ -120,6 +123,9 @@ let indexObj = {
$
(
'.cart-box'
).
html
(
hbsTemplate
(
data
));
require
(
'./index/cart'
).
init
(
self
);
require
(
'./index/good'
).
init
(
self
);
$
(
'.btn-edit'
).
on
(
'click'
,
()
=>
{
self
.
navBtnClick
();
});
lazyLoad
(
$
(
'img.lazy'
));
return
Promise
.
resolve
();
}
...
...
public/js/cart/index/cart.js
View file @
e1f91fb
...
...
@@ -17,7 +17,7 @@ let cartObj = {
self
.
handle
=
handle
;
$
(
'.cart-nav'
).
on
(
'click'
,
'
li
'
,
function
(
e
)
{
$
(
'.cart-nav'
).
on
(
'click'
,
'
.nav-item
'
,
function
(
e
)
{
self
.
cartNavClick
(
e
);
});
$
(
'.more-box>.down-arrow'
).
on
(
'click'
,
function
(
e
)
{
...
...
public/scss/cart/_index-new.css
View file @
e1f91fb
...
...
@@ -45,22 +45,56 @@
}
.cart-nav
{
position
:
relative
;
color
:
#c6c6c6
;
border-bottom
:
1
PX
solid
#e0e0e0
;
background
:
#fff
;
display
:
none
;
&.more
{
display
:
flex
;
}
li
{
float
:
left
;
width
:
50%
;
.nav-item
{
padding
:
35px
0
;
height
:
35px
;
box-sizing
:
content-box
;
flex
:
1
;
position
:
relative
;
}
li
.active
{
.nav-item
.active
{
color
:
#000
;
}
&
.more
{
.btn-edit
{
position
:
relative
;
margin-top
:
24px
;
margin-right
:
30px
;
top
:
initial
;
right
:
initial
;
}
}
.btn-edit
{
&:before
{
content
:
"编辑"
;
}
display
:
none
;
width
:
100px
;
height
:
60px
;
border-radius
:
5PX
;
background-color
:
#efefef
;
color
:
#808080
;
position
:
absolute
;
top
:
24px
;
right
:
30px
;
font-size
:
30px
;
padding
:
0
;
}
span
{
display
:
block
;
box-sizing
:
border-box
;
...
...
@@ -69,13 +103,14 @@
line-height
:
35px
;
font-size
:
35px
;
text-align
:
center
;
border-left
:
1
PX
solid
#e0e0e0
;
}
li
:first-child
span
{
border-right
:
1
PX
solid
#e0e0e0
;
.nav-item
:first-child
span
{
border
:
none
;
}
li
:last-child
{
.nav-item
:last-child
{
position
:
relative
;
}
...
...
@@ -130,6 +165,16 @@
}
}
.wechat-body
{
.cart-nav
{
display
:
flex
;
.btn-edit
{
display
:
block
;
}
}
}
.more-box
{
transition
:
all
0.2s
;
}
...
...
@@ -294,10 +339,12 @@
}
.main-wrap.edit
{
.nav-btn
{
&:before
{
content
:
"完成"
;
}
.
nav-btn
:
before
{
content
:
"完成"
;
}
.btn-edit
:before
{
content
:
"完成"
;
}
.all-gift-box
{
...
...
@@ -481,6 +528,7 @@
color
:
#444
;
font-size
:
29px
;
border-radius
:
4px
;
padding
:
0px
;
}
}
}
...
...
utils/cart-process.js
View file @
e1f91fb
...
...
@@ -28,6 +28,7 @@ const formatPromotionTitle = (promo) => {
let
match
=
regPromoTitle
.
exec
(
promo
.
promotion_title
);
let
promotionTitle
=
match
!==
null
&&
match
.
length
>
1
?
match
[
1
]
:
promo
.
promotion_title
;
promotionTitle
=
promotionTitle
.
replace
(
'¥'
,
'¥'
);
return
`
$
{
title
}
【
$
{
promotionTitle
}
】`
;
};
const
formatPromotionOpt
=
(
promo
)
=>
{
...
...
Please
register
or
login
to post a comment