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
Email Patches
Plain Diff
Browse Files
Authored by
zhangxiaoru
9 years ago
Commit
3f8d8629ddd65790fc86f4568e3c782222be756a
1 parent
21e90807
maylike
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
35 additions
and
29 deletions
apps/home/controllers/orderDetail.js
apps/home/models/orderDetail.js
apps/home/router.js
apps/product/controllers/recom.js
apps/product/models/recom.js
apps/product/router.js
apps/product/views/action/recom/goods.hbs
public/js/channel/maybe-like.js
apps/home/controllers/orderDetail.js
View file @
3f8d862
...
...
@@ -48,7 +48,6 @@ const readdData = (req, res, next) => {
let
uid
=
req
.
user
.
uid
;
orderDetailModel
.
readdData
(
orderCode
,
uid
).
then
((
result
)
=>
{
console
.
log
(
result
);
res
.
json
(
result
);
}).
catch
(
next
);
};
...
...
apps/home/models/orderDetail.js
View file @
3f8d862
...
...
@@ -14,12 +14,9 @@ const closeReasons = () => {
return
api
.
get
(
''
,
{
method
:
'app.SpaceOrders.closeReasons'
}).
then
((
result
)
=>
{
// console.log(result)
if
(
result
&&
result
.
code
===
200
)
{
// console.log(result)
return
result
.
data
;
}
else
{
// console.log('bushi 200');
return
{};
}
});
...
...
@@ -164,7 +161,7 @@ const orderDetailData = (uid, orderCode) => {
uid
:
uid
,
order_code
:
orderCode
}).
then
((
result
)
=>
{
// console.log(result)
if
(
result
&&
result
.
code
===
200
)
{
let
orderDetail
=
camelCase
(
result
.
data
);
let
goods
=
[];
...
...
@@ -197,7 +194,7 @@ const orderDetailData = (uid, orderCode) => {
}
_
.
forEach
(
orderDetail
.
orderGoods
,
function
(
data
)
{
// console.log(data);
let
obj
=
{};
let
count
=
+
data
.
buyNumber
;
...
...
@@ -289,7 +286,6 @@ const orderDetailData = (uid, orderCode) => {
cancelReason
:
resons
});
// console.log(orderDetail);
return
orderDetail
;
});
...
...
apps/home/router.js
View file @
3f8d862
...
...
@@ -56,7 +56,7 @@ router.get('/mydetails', auth, homeController.myDetails); // 个人基本资料
router
.
get
(
'/grade'
,
auth
,
homeController
.
grade
);
// 会员等级页
router
.
get
(
'/privilege'
,
homeController
.
preferential
);
// 会员特权列表页
router
.
get
(
'/mycurrency'
,
auth
,
currencyController
.
myCurrency
);
// yoho币总数
router
.
get
(
'/mycurrency'
,
currencyController
.
myCurrency
);
// yoho币总数
router
.
get
(
'/currencyDetail'
,
auth
,
currencyController
.
currencyDetail
);
// yoho币列表
router
.
post
(
'/ajaxCurrencyDetail'
,
auth
,
currencyController
.
ajaxCurrencyDetail
);
// yoho币列表
...
...
apps/product/controllers/recom.js
View file @
3f8d862
...
...
@@ -5,7 +5,7 @@ const headerModel = require('../../../doraemon/models/header'); // 头部model
const
mayLikeModel
=
require
(
'../models/recom'
);
/**
* 你可能喜欢的BOYS或GIRLS的商品列表
* 你可能喜欢的BOYS或GIRLS
或创意生活
的商品列表
*/
const
mayLike
=
(
req
,
res
,
next
)
=>
{
...
...
@@ -19,18 +19,23 @@ const mayLike = (req, res, next) => {
if
(
channel
===
1
||
channel
===
2
)
{
mayLikeModel
.
mayLike
(
uid
,
page
,
limit
,
gender
,
udid
,
recPos
,
channel
).
then
((
result
)
=>
{
res
.
render
(
'recom/goods'
,
Object
.
assign
({
layout
:
false
},
result
));
res
.
render
(
'recom/goods'
,
{
layout
:
false
,
list
:
result
});
}).
catch
(
next
);
}
else
if
(
channel
===
4
)
{
recPos
=
100001
;
gender
=
'1,3'
;
mayLikeModel
.
mayLike
(
uid
,
page
,
limit
,
gender
,
udid
,
recPos
,
channel
).
then
((
result
)
=>
{
res
.
render
(
'recom/goods'
,
Object
.
assign
({
layout
:
false
},
result
));
res
.
render
(
'recom/goods'
,
{
layout
:
false
,
list
:
result
});
}).
catch
(
next
);
}
};
...
...
@@ -45,9 +50,10 @@ const mayLikeKids = (req, res, next) => {
mayLikeModel
.
mayLikeKids
(
page
,
limit
,
channel
).
then
((
result
)
=>
{
res
.
render
(
'recom/goods'
,
Object
.
assign
({
layout
:
false
},
result
));
res
.
render
(
'recom/goods'
,
{
layout
:
false
,
list
:
result
});
}).
catch
(
next
);
};
...
...
apps/product/models/recom.js
View file @
3f8d862
...
...
@@ -58,15 +58,18 @@ const mayLike = (uid, page, limit, gender, udid, recPos, channel) => {
if
(
result
&&
result
.
code
===
200
)
{
if
(
page
>
result
.
data
.
page_total
)
{
return
;
}
if
(
result
.
data
.
page_total
&&
page
<=
result
.
data
.
page_total
)
{
if
(
result
.
data
.
product_list
)
{
if
(
result
.
data
.
product_list
)
{
return
formatProduct
(
result
.
data
.
product_list
);
return
formatProduct
(
result
.
data
.
product_list
);
}
else
{
return
false
;
}
}
else
{
return
false
;
}
}
else
{
logger
.
error
(
'mayLike cood 不是 200'
);
}
...
...
apps/product/router.js
View file @
3f8d862
...
...
@@ -41,7 +41,6 @@ router.get('/detail/comments', detail.comments); // 商品评价
router
.
post
(
'/detail/consultsubmit'
,
auth
,
detail
.
consultsubmit
);
// 商品咨询提交接口
router
.
get
(
'/recom/maylike'
,
recom
.
mayLike
);
// 你可能喜欢
router
.
get
(
'/recom/maylikekids'
,
recom
.
mayLikeKids
);
// 潮童你可能喜欢
// router.get('/recom/maylikelife', recom.mayLikeLifestyle); // 创意生活你可能喜欢
router
.
post
(
'/detail/consultupvote'
,
detail
.
consultUpvoteOrUseful
);
// 商品咨询提交接口
router
.
post
(
'/detail/consultuseful'
,
detail
.
consultUpvoteOrUseful
);
// 商品咨询提交接口
...
...
apps/product/views/action/recom/goods.hbs
View file @
3f8d862
{{#if
this
}}
{{!-- 剔除值为false的项 --}}
{{#
each
this
}}
{{#if
list
}}
{{!-- 剔除值为false的项 --}}
{{!-- {{log this}} --}}
{{#
list
}}
<div
class=
"good-info
{{#if
@root
.
saleViplogin
}}
sale-vip
{{/if}}
"
data-id=
"
{{
productSkn
}}
"
data-bp-id=
"guang_goodList_
{{
productName
}}
_false"
>
<div
class=
"tag-container clearfix"
>
{{#
each
tags
}}
...
...
@@ -61,5 +62,5 @@
{{/if}}
</div>
</div>
{{/
each
}}
{{/
list
}}
{{/if}}
...
...
public/js/channel/maybe-like.js
View file @
3f8d862
...
...
@@ -125,8 +125,10 @@ module.exports = function(specificGender) {
page
:
page
+
1
},
success
:
function
(
data
)
{
//console.log(data)
var
PRDID
=
[];
if
(
data
===
' '
)
{
console
.
log
(
data
)
searching
=
false
;
loading
.
hideLoadingMask
();
...
...
Please
register
or
login
to post a comment