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
biao
9 years ago
Commit
c27b4a28220f506e3a0f15681f2963a68474ed93
1 parent
12e555f3
update for banner in the me page
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
7 deletions
apps/channel/models/channel-api.js
apps/me/controllers/order.js
apps/me/models/menu-crumb-handler.js
apps/channel/models/channel-api.js
View file @
c27b4a2
...
...
@@ -3,9 +3,9 @@
* @author: 赵彪<bill.zhao@yoho.cn>
* @date: 2016/7/26
*/
'use strict'
;
// const api = global.yoho.API;
const
api
=
global
.
yoho
.
ServiceAPI
;
const
channelMap
=
require
(
'../../../config/channel-type'
).
channelMap
;
...
...
apps/me/controllers/order.js
View file @
c27b4a2
...
...
@@ -17,15 +17,18 @@ const index = (req, res) => {
const
page
=
req
.
query
.
page
;
const
uid
=
req
.
user
.
uid
;
orderModel
.
getOrderData
(
uid
,
type
,
page
).
then
(
result
=>
{
Promise
.
all
([
orderModel
.
getOrderData
(
uid
,
type
,
page
),
mcHandler
.
getMeThumb
()]).
then
(
result
=>
{
const
pageData
=
result
[
0
];
const
thumb
=
result
[
1
];
res
.
display
(
'index'
,
{
page
:
'order'
,
isMe
:
true
,
content
:
Object
.
assign
({
nav
:
mcHandler
.
getMeCrumb
(),
navigation
:
mcHandler
.
getSideMenu
(
'我的订单'
),
banner
:
'http://placehold.it/{width}x{height}'
},
result
)
banner
:
thumb
},
pageData
)
});
});
};
...
...
@@ -34,15 +37,19 @@ const detail = (req, res) => {
const
code
=
req
.
query
.
code
;
const
uid
=
req
.
user
.
uid
;
orderModel
.
getOrderDetail
(
uid
,
code
).
then
(
result
=>
{
Promise
.
all
([
orderModel
.
getOrderDetail
(
uid
,
code
),
mcHandler
.
getMeThumb
()]).
then
(
result
=>
{
const
pageData
=
result
[
0
];
const
thumb
=
result
[
1
];
res
.
display
(
'index'
,
{
isMe
:
true
,
page
:
'order-detail'
,
content
:
Object
.
assign
({
nav
:
mcHandler
.
getMeCrumb
(),
navigation
:
mcHandler
.
getSideMenu
(
'订单详情'
),
banner
:
'http://placehold.it/{width}x{height}'
},
result
)
banner
:
thumb
},
pageData
)
});
});
};
...
...
apps/me/models/menu-crumb-handler.js
View file @
c27b4a2
...
...
@@ -12,6 +12,24 @@ const blk = global.yoho;
const
url
=
blk
.
helpers
.
urlFormat
;
const
meCode
=
require
(
'../../../config/channel-type'
).
meCode
;
const
api
=
global
.
yoho
.
ServiceAPI
;
// 获取个人中心资源位
const
getMeThumb
=
()
=>
{
const
data
=
{
client_type
:
'web'
,
content_code
:
meCode
};
return
api
.
get
(
'operations/api/v5/resource/home'
,
data
,
{
cache
:
true
,
code
:
200
}).
then
(
result
=>
{
return
result
.
data
.
list
[
0
].
data
[
0
].
src
;
});
};
// 左侧菜单
const
navigation
=
[
{
...
...
@@ -76,5 +94,6 @@ const getSideMenu = focus => {
module
.
exports
=
{
getMeCrumb
,
getMeThumb
,
getSideMenu
};
...
...
Please
register
or
login
to post a comment