Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yohobuy-node
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
1
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Plain Diff
Browse Files
Authored by
htoooth
8 years ago
Commit
d45303592d8399321f07691e6cfcf6c7e4fc48be
2 parents
8b2b4a0b
13703f86
Merge remote-tracking branch 'origin/release/5.2' into release/5.2
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
71 additions
and
32 deletions
apps/cart/models/easypay-api.js
apps/cart/models/easypay.js
apps/channel/controllers/index.js
apps/channel/models/index.js
apps/channel/router.js
public/js/cart/order/invoice.js
public/js/channel/channel.page.js
public/js/product/index/top-coupon.js
public/scss/product/_top-coupon.css
apps/cart/models/easypay-api.js
View file @
d453035
...
...
@@ -113,9 +113,9 @@ const easypayOrderSubmitAsync = (uid, cartType, addressId, deliveryTime, deliver
if
(
other
.
invoicesType
)
{
Object
.
assign
(
param
,
{
invoices_type
:
other
.
invoicesType
,
invoices_itle
:
other
.
invoicesTitle
,
invoices_
t
itle
:
other
.
invoicesTitle
,
invoice_content
:
other
.
invoicesContent
,
receiverMobile
:
other
.
receiver
Mobile
receiverMobile
:
other
.
receiver
});
}
...
...
apps/cart/models/easypay.js
View file @
d453035
...
...
@@ -127,16 +127,15 @@ const _handelPaymentInfo = (d) => {
const
_getLimitProductData
=
(
params
)
=>
{
let
info
=
{
type
:
'limitcode'
,
buy_number
:
1
},
limitCode
=
crypto
.
decrypt
(
''
,
decodeURIComponent
(
params
.
limitcode
));
type
:
'limitcode'
,
buy_number
:
1
};
if
(
params
.
sku
&&
params
.
skn
&&
params
.
limitcode
)
{
Object
.
assign
(
info
,
{
sku
:
params
.
sku
,
skn
:
params
.
skn
,
limitproductcode
:
par
seInt
(
limitCode
,
10
)
limitproductcode
:
par
ams
.
limitcode
});
return
JSON
.
stringify
([
info
]);
...
...
apps/channel/controllers/index.js
View file @
d453035
...
...
@@ -15,7 +15,7 @@ exports.index = (req, res, next) => {
// 将woman转换为girls,以便model层进行处理
channelType
===
'woman'
?
channelType
=
'girls'
:
null
;
channelModel
.
getContent
(
channelType
,
req
).
then
(
data
=>
{
channelModel
.
getContent
(
channelType
).
then
(
data
=>
{
// channel为空不缓存
if
(
_
.
isEmpty
(
data
.
channel
))
{
...
...
@@ -28,7 +28,7 @@ exports.index = (req, res, next) => {
exports
.
getbrandFloorDataAjax
=
(
req
,
res
,
next
)
=>
{
const
channelType
=
req
.
query
.
channelType
||
'boys'
;
channelModel
.
getbrandFloorDataAjax
(
channelType
,
req
).
then
(
data
=>
{
channelModel
.
getbrandFloorDataAjax
(
channelType
).
then
(
data
=>
{
res
.
json
(
data
);
}).
catch
(
next
);
};
...
...
@@ -77,3 +77,10 @@ exports.getIndexGuide = (req, res, next) => {
res
.
render
(
'guide'
,
result
);
}).
catch
(
next
);
};
exports
.
hasNewUserFloor
=
(
req
,
res
,
next
)
=>
{
channelModel
.
hasNewUserFloor
(
req
.
yoho
.
channel
,
req
.
user
.
uid
).
then
(
data
=>
{
res
.
send
(
data
);
}).
catch
(
next
);
};
...
...
apps/channel/models/index.js
View file @
d453035
...
...
@@ -576,7 +576,6 @@ const _requestContent = (type, params) => {
};
Object
.
assign
(
data
,
params
);
return
serviceApi
.
get
(
'operations/api/v5/resource/home'
,
data
,
{
cache
:
true
,
code
:
200
...
...
@@ -894,14 +893,9 @@ const getNewArrival = channel => {
* @param {String} type 传入频道页类型,值可以是: boys, girls, kids, lifestyle
* @return {Object}
*/
const
getContent
=
(
type
,
req
)
=>
{
let
params
=
{};
const
getContent
=
(
type
)
=>
{
let
params
=
{
new_device
:
'Y'
};
if
(
!
req
.
user
.
uid
)
{
params
.
new_device
=
'Y'
;
}
else
{
params
.
uid
=
req
.
user
.
uid
;
}
return
Promise
.
all
([
headerModel
.
requestHeaderData
(
type
),
_requestContent
(
type
,
params
)]).
then
(
res
=>
{
let
headerData
=
res
[
0
].
data
||
res
[
0
],
...
...
@@ -956,14 +950,9 @@ const getContent = (type, req) => {
// 优选品牌楼层floorData-ajax
const
getbrandFloorDataAjax
=
(
type
,
req
)
=>
{
let
params
=
{};
const
getbrandFloorDataAjax
=
(
type
)
=>
{
let
params
=
{
new_device
:
'Y'
};
if
(
!
req
.
user
.
uid
)
{
params
.
new_device
=
'Y'
;
}
else
{
params
.
uid
=
req
.
user
.
uid
;
}
return
_requestContent
(
type
,
params
).
then
(
res
=>
{
let
contentData
=
res
.
data
?
res
.
data
.
list
:
[];
...
...
@@ -1026,12 +1015,34 @@ const getIndexGuideData = () => {
return
serviceApi
.
get
(
'operations/api/v6/category/getCategory'
,
params
,
config
.
apiCache
);
};
const
hasNewUserFloor
=
(
channelType
,
uid
)
=>
{
let
params
=
{
uid
:
uid
};
return
_requestContent
(
channelType
,
params
).
then
(
res
=>
{
let
isNewUser
=
false
,
contentData
=
res
.
data
?
res
.
data
.
list
:
res
;
_
.
forEach
(
contentData
,
(
data
)
=>
{
if
(
data
.
template_name
===
'new_user_floor'
||
data
.
template_intro
===
'新人专享'
)
{
isNewUser
=
true
;
return
false
;
}
});
return
{
isNewUser
:
isNewUser
};
});
};
module
.
exports
=
{
getNewArrival
:
getNewArrival
,
getContent
:
getContent
,
getbrandFloorDataAjax
:
getbrandFloorDataAjax
,
getIndexGuideData
:
getIndexGuideData
,
formatIndexGuideData
:
formatIndexGuideData
,
getResourceData
:
getResourceData
getResourceData
:
getResourceData
,
hasNewUserFloor
:
hasNewUserFloor
};
...
...
apps/channel/router.js
View file @
d453035
...
...
@@ -6,7 +6,7 @@
'use strict'
;
const
router
=
require
(
'express'
).
Router
();
// eslint-disable-line
const
router
=
require
(
'express'
).
Router
();
// eslint-disable-line
const
cRoot
=
'./controllers'
;
// Your controller here
...
...
@@ -17,6 +17,7 @@ router.get('/', channelController.index);
router
.
get
(
'/woman'
,
channelController
.
index
);
router
.
get
(
'/kids'
,
channelController
.
index
);
router
.
get
(
'/lifestyle'
,
channelController
.
index
);
router
.
get
(
'/channel/isNewUserAjax'
,
channelController
.
hasNewUserFloor
);
// ajax
router
.
get
(
'/getbrandFloorDataAjax'
,
channelController
.
getbrandFloorDataAjax
);
...
...
public/js/cart/order/invoice.js
View file @
d453035
...
...
@@ -49,7 +49,7 @@ function validateInvoice($el) {
function
pkgInvoice
()
{
var
$contentChecked
=
$
(
'input[name="invoice-content"]:checked'
);
var
pkg
=
{
invocesType
:
$
(
'.el-invoice'
).
hasClass
(
'focus'
)
?
'
1'
:
'2
'
,
invocesType
:
$
(
'.el-invoice'
).
hasClass
(
'focus'
)
?
'
2'
:
'1
'
,
invoicesTitle
:
$
(
'input[name="invoice-title"]'
).
prop
(
'checked'
)
?
'个人'
:
$
(
'#company-name'
).
val
(),
invoicesContent
:
$contentChecked
.
val
(),
invoicesContentName
:
$contentChecked
.
data
(
'name'
)
...
...
public/js/channel/channel.page.js
View file @
d453035
...
...
@@ -43,8 +43,6 @@ if ($.inArray(homePage, ['boys', 'girls', 'kids', 'lifestyle']) > -1) {
});
}
lazyLoad
(
$
(
'img.lazy'
));
if
(
homePage
===
'boys'
)
{
$
(
'.slide-container'
).
slider
({
...
...
@@ -73,3 +71,18 @@ $('.new-user-proList').slider2({
shownum
:
5
,
isCircle
:
false
});
if
(
window
.
cookie
(
'_UID'
))
{
// 判断是否有新人专享
$
.
ajax
({
type
:
'GET'
,
url
:
'/channel/isNewUserAjax'
,
data
:
{},
success
:
function
(
res
)
{
if
(
!
res
.
isNewUser
)
{
$
(
'.new-user'
).
addClass
(
'hide'
);
}
}
});
}
...
...
public/js/product/index/top-coupon.js
View file @
d453035
...
...
@@ -115,7 +115,7 @@ function getCouponInfo() {
// 设置优惠券领取状态
function
setPicked
(
info
)
{
if
(
info
)
{
info
.
dom
.
text
(
'已领取'
);
info
.
dom
.
addClass
(
'picked'
).
text
(
'已领取'
);
info
.
status
=
3
;
}
}
...
...
public/scss/product/_top-coupon.css
View file @
d453035
...
...
@@ -95,6 +95,12 @@
padding
:
10px
20px
;
}
.picked
{
width
:
60px
;
padding
:
10px
;
line-height
:
40px
;
}
&
.num1
{
.coupon-title
{
width
:
230px
;
...
...
@@ -136,9 +142,11 @@
}
}
.picked
,
.pick-btn
{
width
:
100px
;
line-height
:
40px
;
padding
:
10px
20px
;
white-space
:
nowrap
;
}
}
...
...
@@ -165,9 +173,11 @@
}
}
.picked
,
.pick-btn
{
width
:
80px
;
line-height
:
40px
;
padding
:
10px
20px
;
white-space
:
nowrap
;
}
}
...
...
@@ -202,7 +212,6 @@
.btn-end
{
background
:
#b5b5b5
;
}
}
}
...
...
@@ -275,7 +284,6 @@
width
:
94px
;
}
}
}
.top-coupon-dialog
{
...
...
Please
register
or
login
to post a comment