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
Email Patches
Plain Diff
Browse Files
Authored by
郭成尧
9 years ago
Commit
86f498f911cf14860d3c1de3e09d0a05aa65de60
1 parent
a4733e3c
模拟数据分离,数据调佣测试
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
232 additions
and
236 deletions
apps/product/controllers/outlets.js
apps/product/models/outlets.js
apps/product/models/simu-outlets.js
apps/product/views/action/outlets/index.hbs
config/common.js
apps/product/controllers/outlets.js
View file @
86f498f
...
...
@@ -5,12 +5,16 @@
*/
'use strict'
;
const
mRoot
=
'../models'
;
// const simuOutlets = require(`${mRoot}/simu-outlets`);
const
headerModel
=
require
(
'../../../doraemon/models/header'
);
// 开发用模拟数据
const
outletsSimulation
=
require
(
'../models/simulation'
);
// sale 页 model
const
outlets
=
require
(
`
$
{
mRoot
}
/outlets`
)
;
/**
* outlets 首页
* @param {[type]} req [description]
...
...
@@ -18,225 +22,22 @@ const outletsSimulation = require('../models/simulation');
* @return {[type]} [description]
*/
exports
.
index
=
(
req
,
res
)
=>
{
let
data
=
{};
data
.
module
=
'product'
;
data
.
page
=
'outlets'
;
data
.
footerTop
=
true
;
data
.
devEnv
=
true
;
data
.
banner
=
[
{
href
:
'#'
,
img
:
'http://img10.static.yhbimg.com/yhb-img01/2016/05/25/09/01ee927cf2bec307e50dbc437141665090.jpg?imageView2/1/w/{width}/h/{height}'
},
{
href
:
'#'
,
img
:
'http://img10.static.yhbimg.com/yhb-img01/2016/05/25/09/01ee927cf2bec307e50dbc437141665090.jpg?imageView2/1/w/{width}/h/{height}'
},
{
href
:
'#'
,
img
:
'http://img10.static.yhbimg.com/yhb-img01/2016/05/25/09/01ee927cf2bec307e50dbc437141665090.jpg?imageView2/1/w/{width}/h/{height}'
}
];
let
responseData
=
{};
data
.
column
=
[
{
href
:
'#'
,
img
:
'http://img10.static.yhbimg.com/yhb-img01/2016/05/25/09/01ee927cf2bec307e50dbc437141665090.jpg?imageView2/1/w/{width}/h/{height}'
},
{
href
:
'#'
,
img
:
'http://img10.static.yhbimg.com/yhb-img01/2016/05/25/09/01ee927cf2bec307e50dbc437141665090.jpg?imageView2/1/w/{width}/h/{height}'
},
{
href
:
'#'
,
img
:
'http://img10.static.yhbimg.com/yhb-img01/2016/05/25/09/01ee927cf2bec307e50dbc437141665090.jpg?imageView2/1/w/{width}/h/{height}'
}
];
responseData
.
module
=
'product'
;
responseData
.
page
=
'outlets'
;
responseData
.
footerTop
=
true
;
responseData
.
devEnv
=
true
;
data
.
limitedBuy
=
{
name
:
'限时嗨购'
,
topic
:
[
{
href
:
'#'
,
img
:
'http://img11.static.yhbimg.com/yhb-img01/2016/05/25/11/01d71a4867ac110b1894504da65b5cf596.jpg?imageView2/1/w/{width}/h/{height}'
,
logo
:
'http://img10.static.yhbimg.com/brandLogo/2012/08/02/15/0119ad6a2407f5505268688a470d6f6c13.jpg'
,
discount
:
'7.5'
,
title
:
'多元化潮流风格'
,
limit
:
'1500'
},
{
href
:
'#'
,
img
:
'http://img11.static.yhbimg.com/yhb-img01/2016/05/25/11/01d71a4867ac110b1894504da65b5cf596.jpg?imageView2/1/w/{width}/h/{height}'
,
logo
:
'http://img10.static.yhbimg.com/brandLogo/2012/08/02/15/0119ad6a2407f5505268688a470d6f6c13.jpg'
,
discount
:
'7.5'
,
title
:
'多元化潮流风格'
,
limit
:
'1500'
},
{
href
:
'#'
,
img
:
'http://img11.static.yhbimg.com/yhb-img01/2016/05/25/11/01d71a4867ac110b1894504da65b5cf596.jpg?imageView2/1/w/{width}/h/{height}'
,
logo
:
'http://img10.static.yhbimg.com/brandLogo/2012/08/02/15/0119ad6a2407f5505268688a470d6f6c13.jpg'
,
discount
:
'7.5'
,
title
:
'多元化潮流风格'
,
limit
:
'1500'
}
],
extra
:
{
sourceImg
:
{
href
:
'#'
,
img
:
'http://img12.static.yhbimg.com/yhb-img01/2016/04/13/01/023d062b8384103df7a8dfada98afaf204.jpg?imageView2/1/w/{width}/h/{height}'
},
hotType
:
{
title
:
'热销推荐'
,
classify
:
[
{
href
:
'#'
,
name
:
'上衣'
},
{
href
:
'#'
,
name
:
'T恤'
},
{
href
:
'#'
,
name
:
'裤子'
}
]
},
trendGood
:
{
title
:
'潮品推荐'
,
goods
:
[
{
href
:
'#'
,
img
:
'http://img13.static.yhbimg.com/goodsimg/2015/08/04/10/02129fcc058455de1615ce770d3a4555a6.jpg?imageView/1/w/{width}/h/{height}'
,
name
:
'Life·After Life 像素风sneaker印花长袖衬衫'
,
market
:
'¥260'
,
sale
:
'¥203'
,
discount
:
'2'
},
{
href
:
'#'
,
img
:
'http://img13.static.yhbimg.com/goodsimg/2015/08/04/10/02129fcc058455de1615ce770d3a4555a6.jpg?imageView/1/w/{width}/h/{height}'
,
name
:
'Life·After Life 像素风sneaker印花长袖衬衫'
,
market
:
'¥260'
,
sale
:
'¥203'
,
discount
:
'2'
},
{
href
:
'#'
,
img
:
'http://img13.static.yhbimg.com/goodsimg/2015/08/04/10/02129fcc058455de1615ce770d3a4555a6.jpg?imageView/1/w/{width}/h/{height}'
,
name
:
'Life·After Life 像素风sneaker印花长袖衬衫'
,
market
:
'¥260'
,
sale
:
'¥203'
,
discount
:
'2'
},
{
href
:
'#'
,
img
:
'http://img13.static.yhbimg.com/goodsimg/2015/08/04/10/02129fcc058455de1615ce770d3a4555a6.jpg?imageView/1/w/{width}/h/{height}'
,
name
:
'Life·After Life 像素风sneaker印花长袖衬衫'
,
market
:
'¥260'
,
sale
:
'¥203'
,
discount
:
'2'
}
]
}
}
};
// 首页模拟数据
// responseData.result = simuOutlets.index();
data
.
nearOver
=
{
name
:
'即将结束'
,
topic
:
[
{
href
:
'#'
,
img
:
'http://img12.static.yhbimg.com/yhb-img01/2016/02/05/08/02bb2c8efb12319cf50f247bae13d60dde.jpg?imageView/1/w/{width}/h/{height}'
,
logo
:
'http://img10.static.yhbimg.com/brandLogo/2012/08/02/15/0119ad6a2407f5505268688a470d6f6c13.jpg'
,
discount
:
'7.5'
,
title
:
'多元化潮流风格'
,
limit
:
'1500'
},
{
href
:
'#'
,
img
:
'http://img12.static.yhbimg.com/yhb-img01/2016/02/05/08/02bb2c8efb12319cf50f247bae13d60dde.jpg?imageView/1/w/{width}/h/{height}'
,
logo
:
'http://img10.static.yhbimg.com/brandLogo/2012/08/02/15/0119ad6a2407f5505268688a470d6f6c13.jpg'
,
discount
:
'7.5'
,
title
:
'多元化潮流风格'
,
limit
:
'1500'
},
{
href
:
'#'
,
img
:
'http://img12.static.yhbimg.com/yhb-img01/2016/02/05/08/02bb2c8efb12319cf50f247bae13d60dde.jpg?imageView/1/w/{width}/h/{height}'
,
logo
:
'http://img10.static.yhbimg.com/brandLogo/2012/08/02/15/0119ad6a2407f5505268688a470d6f6c13.jpg'
,
discount
:
'7.5'
,
title
:
'多元化潮流风格'
,
limit
:
'1500'
},
{
href
:
'#'
,
img
:
'http://img12.static.yhbimg.com/yhb-img01/2016/02/05/08/02bb2c8efb12319cf50f247bae13d60dde.jpg?imageView/1/w/{width}/h/{height}'
,
logo
:
'http://img10.static.yhbimg.com/brandLogo/2012/08/02/15/0119ad6a2407f5505268688a470d6f6c13.jpg'
,
discount
:
'7.5'
,
title
:
'多元化潮流风格'
,
limit
:
'1500'
}
]
};
outlets
.
getOutletsIndexData
(
req
.
query
).
then
(
result
=>
{
responseData
.
result
=
result
;
responseData
.
resultShow
=
JSON
.
stringify
(
result
,
null
,
4
);
});
data
.
goodsBoard
=
{
goodsMenu
:
{
title
:
'最新折扣'
,
menuList
:
[
{
name
:
'T恤'
,
href
:
'#'
,
cur
:
true
},
{
name
:
'衬衫'
,
href
:
'#'
},
{
name
:
'休闲裤'
,
href
:
'#'
},
{
name
:
'连衣裙'
,
href
:
'#'
}
],
more
:
'#'
},
sort
:
{
sortType
:
[
{
name
:
'最新'
,
active
:
true
,
href
:
''
,
hasSortOrient
:
true
}
]
},
list
:
[
{
href
:
'#'
,
img
:
'http://img12.static.yhbimg.com/yhb-img01/2016/02/05/08/02bb2c8efb12319cf50f247bae13d60dde.jpg?imageView/1/w/{width}/h/{height}'
,
logo
:
'http://img10.static.yhbimg.com/brandLogo/2012/08/02/15/0119ad6a2407f5505268688a470d6f6c13.jpg'
,
price
:
'¥340'
,
discount
:
'7.5'
,
title
:
'多元化潮流风格'
},
{
href
:
'#'
,
img
:
'http://img12.static.yhbimg.com/yhb-img01/2016/02/05/08/02bb2c8efb12319cf50f247bae13d60dde.jpg?imageView/1/w/{width}/h/{height}'
,
logo
:
'http://img10.static.yhbimg.com/brandLogo/2012/08/02/15/0119ad6a2407f5505268688a470d6f6c13.jpg'
,
price
:
'¥340'
,
discount
:
'7.5'
,
title
:
'多元化潮流风格'
}
]
};
res
.
render
(
'outlets/index'
,
data
);
res
.
render
(
'outlets/index'
,
responseData
);
};
/**
...
...
@@ -285,20 +86,16 @@ exports.special = (req, res) => {
};
resData
.
mainBanner
=
{
list
:
[
{
href
:
'#'
,
img
:
'http://img10.static.yhbimg.com/brandBanner/2014/11/24/07/01ff74fb2a33764c2fd18b3c8a60f5beef.jpg'
},
{
href
:
'#'
,
img
:
'http://img10.static.yhbimg.com/brandBanner/2014/11/24/07/01ff74fb2a33764c2fd18b3c8a60f5beef.jpg'
},
{
href
:
'#'
,
img
:
'http://img10.static.yhbimg.com/brandBanner/2014/11/24/07/01ff74fb2a33764c2fd18b3c8a60f5beef.jpg'
}
],
list
:
[{
href
:
'#'
,
img
:
'http://img10.static.yhbimg.com/brandBanner/2014/11/24/07/01ff74fb2a33764c2fd18b3c8a60f5beef.jpg'
},
{
href
:
'#'
,
img
:
'http://img10.static.yhbimg.com/brandBanner/2014/11/24/07/01ff74fb2a33764c2fd18b3c8a60f5beef.jpg'
},
{
href
:
'#'
,
img
:
'http://img10.static.yhbimg.com/brandBanner/2014/11/24/07/01ff74fb2a33764c2fd18b3c8a60f5beef.jpg'
}],
href
:
'#'
,
img
:
'http://img10.static.yhbimg.com/brandBanner/2014/11/24/07/01ff74fb2a33764c2fd18b3c8a60f5beef.jpg'
};
...
...
apps/product/models/outlets.js
View file @
86f498f
...
...
@@ -2,7 +2,7 @@
* @Author: Targaryen
* @Date: 2016-05-30 16:20:03
* @Last Modified by: Targaryen
* @Last Modified time: 2016-0
5-30 18:21:08
* @Last Modified time: 2016-0
6-01 10:12:25
*/
'use strict'
;
...
...
@@ -31,11 +31,13 @@ const handleOutletsActivityData = (origin) => {
*/
const
getOutletsActivityOrigin
=
(
params
)
=>
{
return
api
.
get
(
''
,
sign
.
apiSign
({
id
:
params
.
id
||
null
,
platform
:
1
,
size
:
params
.
size
||
null
,
method
:
'app.outlets.activityGet'
,
// id: params.id || null,
platform
:
2
,
// 1 没有数据,暂时用 2,待处理
size
:
params
.
size
||
0
,
yh_channel
:
1
,
type
:
params
.
type
||
0
type
:
params
.
type
||
3
// 0 没有数据,暂时用 3
}));
};
...
...
apps/product/models/simu-outlets.js
0 → 100644
View file @
86f498f
/*
* @Author: Targaryen
* @Date: 2016-06-01 09:37:28
* @Last Modified by: Targaryen
* @Last Modified time: 2016-06-01 10:14:17
*/
'use strict'
;
/**
* 奥莱首页模拟数据
* @return {[type]} [description]
*/
exports
.
index
=
()
=>
{
let
result
=
{};
result
.
banner
=
[{
href
:
'#'
,
img
:
'http://img10.static.yhbimg.com/yhb-img01/2016/05/25/09/01ee927cf2bec307e50dbc437141665090.jpg?imageView2/1/w/{width}/h/{height}'
},
{
href
:
'#'
,
img
:
'http://img10.static.yhbimg.com/yhb-img01/2016/05/25/09/01ee927cf2bec307e50dbc437141665090.jpg?imageView2/1/w/{width}/h/{height}'
},
{
href
:
'#'
,
img
:
'http://img10.static.yhbimg.com/yhb-img01/2016/05/25/09/01ee927cf2bec307e50dbc437141665090.jpg?imageView2/1/w/{width}/h/{height}'
}];
result
.
column
=
[{
href
:
'#'
,
img
:
'http://img10.static.yhbimg.com/yhb-img01/2016/05/25/09/01ee927cf2bec307e50dbc437141665090.jpg?imageView2/1/w/{width}/h/{height}'
},
{
href
:
'#'
,
img
:
'http://img10.static.yhbimg.com/yhb-img01/2016/05/25/09/01ee927cf2bec307e50dbc437141665090.jpg?imageView2/1/w/{width}/h/{height}'
},
{
href
:
'#'
,
img
:
'http://img10.static.yhbimg.com/yhb-img01/2016/05/25/09/01ee927cf2bec307e50dbc437141665090.jpg?imageView2/1/w/{width}/h/{height}'
}];
result
.
limitedBuy
=
{
name
:
'限时嗨购'
,
topic
:
[{
href
:
'#'
,
img
:
'http://img11.static.yhbimg.com/yhb-img01/2016/05/25/11/01d71a4867ac110b1894504da65b5cf596.jpg?imageView2/1/w/{width}/h/{height}'
,
logo
:
'http://img10.static.yhbimg.com/brandLogo/2012/08/02/15/0119ad6a2407f5505268688a470d6f6c13.jpg'
,
discount
:
'7.5'
,
title
:
'多元化潮流风格'
,
limit
:
'1500'
},
{
href
:
'#'
,
img
:
'http://img11.static.yhbimg.com/yhb-img01/2016/05/25/11/01d71a4867ac110b1894504da65b5cf596.jpg?imageView2/1/w/{width}/h/{height}'
,
logo
:
'http://img10.static.yhbimg.com/brandLogo/2012/08/02/15/0119ad6a2407f5505268688a470d6f6c13.jpg'
,
discount
:
'7.5'
,
title
:
'多元化潮流风格'
,
limit
:
'1500'
},
{
href
:
'#'
,
img
:
'http://img11.static.yhbimg.com/yhb-img01/2016/05/25/11/01d71a4867ac110b1894504da65b5cf596.jpg?imageView2/1/w/{width}/h/{height}'
,
logo
:
'http://img10.static.yhbimg.com/brandLogo/2012/08/02/15/0119ad6a2407f5505268688a470d6f6c13.jpg'
,
discount
:
'7.5'
,
title
:
'多元化潮流风格'
,
limit
:
'1500'
}],
extra
:
{
sourceImg
:
{
href
:
'#'
,
img
:
'http://img12.static.yhbimg.com/yhb-img01/2016/04/13/01/023d062b8384103df7a8dfada98afaf204.jpg?imageView2/1/w/{width}/h/{height}'
},
hotType
:
{
title
:
'热销推荐'
,
classify
:
[{
href
:
'#'
,
name
:
'上衣'
},
{
href
:
'#'
,
name
:
'T恤'
},
{
href
:
'#'
,
name
:
'裤子'
}]
},
trendGood
:
{
title
:
'潮品推荐'
,
goods
:
[{
href
:
'#'
,
img
:
'http://img13.static.yhbimg.com/goodsimg/2015/08/04/10/02129fcc058455de1615ce770d3a4555a6.jpg?imageView/1/w/{width}/h/{height}'
,
name
:
'Life·After Life 像素风sneaker印花长袖衬衫'
,
market
:
'¥260'
,
sale
:
'¥203'
,
discount
:
'2'
},
{
href
:
'#'
,
img
:
'http://img13.static.yhbimg.com/goodsimg/2015/08/04/10/02129fcc058455de1615ce770d3a4555a6.jpg?imageView/1/w/{width}/h/{height}'
,
name
:
'Life·After Life 像素风sneaker印花长袖衬衫'
,
market
:
'¥260'
,
sale
:
'¥203'
,
discount
:
'2'
},
{
href
:
'#'
,
img
:
'http://img13.static.yhbimg.com/goodsimg/2015/08/04/10/02129fcc058455de1615ce770d3a4555a6.jpg?imageView/1/w/{width}/h/{height}'
,
name
:
'Life·After Life 像素风sneaker印花长袖衬衫'
,
market
:
'¥260'
,
sale
:
'¥203'
,
discount
:
'2'
},
{
href
:
'#'
,
img
:
'http://img13.static.yhbimg.com/goodsimg/2015/08/04/10/02129fcc058455de1615ce770d3a4555a6.jpg?imageView/1/w/{width}/h/{height}'
,
name
:
'Life·After Life 像素风sneaker印花长袖衬衫'
,
market
:
'¥260'
,
sale
:
'¥203'
,
discount
:
'2'
}]
}
}
};
result
.
nearOver
=
{
name
:
'即将结束'
,
topic
:
[{
href
:
'#'
,
img
:
'http://img12.static.yhbimg.com/yhb-img01/2016/02/05/08/02bb2c8efb12319cf50f247bae13d60dde.jpg?imageView/1/w/{width}/h/{height}'
,
logo
:
'http://img10.static.yhbimg.com/brandLogo/2012/08/02/15/0119ad6a2407f5505268688a470d6f6c13.jpg'
,
discount
:
'7.5'
,
title
:
'多元化潮流风格'
,
limit
:
'1500'
},
{
href
:
'#'
,
img
:
'http://img12.static.yhbimg.com/yhb-img01/2016/02/05/08/02bb2c8efb12319cf50f247bae13d60dde.jpg?imageView/1/w/{width}/h/{height}'
,
logo
:
'http://img10.static.yhbimg.com/brandLogo/2012/08/02/15/0119ad6a2407f5505268688a470d6f6c13.jpg'
,
discount
:
'7.5'
,
title
:
'多元化潮流风格'
,
limit
:
'1500'
},
{
href
:
'#'
,
img
:
'http://img12.static.yhbimg.com/yhb-img01/2016/02/05/08/02bb2c8efb12319cf50f247bae13d60dde.jpg?imageView/1/w/{width}/h/{height}'
,
logo
:
'http://img10.static.yhbimg.com/brandLogo/2012/08/02/15/0119ad6a2407f5505268688a470d6f6c13.jpg'
,
discount
:
'7.5'
,
title
:
'多元化潮流风格'
,
limit
:
'1500'
},
{
href
:
'#'
,
img
:
'http://img12.static.yhbimg.com/yhb-img01/2016/02/05/08/02bb2c8efb12319cf50f247bae13d60dde.jpg?imageView/1/w/{width}/h/{height}'
,
logo
:
'http://img10.static.yhbimg.com/brandLogo/2012/08/02/15/0119ad6a2407f5505268688a470d6f6c13.jpg'
,
discount
:
'7.5'
,
title
:
'多元化潮流风格'
,
limit
:
'1500'
}]
};
result
.
goodsBoard
=
{
goodsMenu
:
{
title
:
'最新折扣'
,
menuList
:
[{
name
:
'T恤'
,
href
:
'#'
,
cur
:
true
},
{
name
:
'衬衫'
,
href
:
'#'
},
{
name
:
'休闲裤'
,
href
:
'#'
},
{
name
:
'连衣裙'
,
href
:
'#'
}],
more
:
'#'
},
sort
:
{
sortType
:
[{
name
:
'最新'
,
active
:
true
,
href
:
''
,
hasSortOrient
:
true
}]
},
list
:
[{
href
:
'#'
,
img
:
'http://img12.static.yhbimg.com/yhb-img01/2016/02/05/08/02bb2c8efb12319cf50f247bae13d60dde.jpg?imageView/1/w/{width}/h/{height}'
,
logo
:
'http://img10.static.yhbimg.com/brandLogo/2012/08/02/15/0119ad6a2407f5505268688a470d6f6c13.jpg'
,
price
:
'¥340'
,
discount
:
'7.5'
,
title
:
'多元化潮流风格'
},
{
href
:
'#'
,
img
:
'http://img12.static.yhbimg.com/yhb-img01/2016/02/05/08/02bb2c8efb12319cf50f247bae13d60dde.jpg?imageView/1/w/{width}/h/{height}'
,
logo
:
'http://img10.static.yhbimg.com/brandLogo/2012/08/02/15/0119ad6a2407f5505268688a470d6f6c13.jpg'
,
price
:
'¥340'
,
discount
:
'7.5'
,
title
:
'多元化潮流风格'
}]
};
return
result
;
};
...
...
apps/product/views/action/outlets/index.hbs
View file @
86f498f
<pre>
{{
resultShow
}}
</pre>
{{#
result
}}
<div
class=
"outlets-page yoho-page"
>
<div
class=
"center-content"
>
<ul
class=
"column-img-tab"
>
...
...
@@ -15,3 +17,4 @@
</div>
</div>
{{/
result
}}
\ No newline at end of file
...
...
config/common.js
View file @
86f498f
...
...
@@ -13,7 +13,7 @@ module.exports = {
port
:
6002
,
siteUrl
:
'http://localhost:6002/'
,
domains
:
{
api
:
'http://
testapi.yoho.cn:28078/'
,
api
:
'http://
devapi.yoho.cn:58078/'
,
// testapi.yoho.cn:28078
service
:
'http://testservice.yoho.cn:28077/'
,
search
:
'http://192.168.10.64:8080/yohosearch/'
},
...
...
Please
register
or
login
to post a comment