var express = require('express');
var router = express.Router();
/* GET home page. */
router.get('/', function(req, res, next) {
res.render('index', {
title: 'Express'
});
});
// 首页第一次触底的数据
router.get('/api/index_list/1/data/2', function(req, res, next) {
res.send({
code: 0,
data: [{
type: 'commodityList',
commodityList: [{
id: 1,
img: '../../static/img/commondity.png',
name: '爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试',
pprice: '299',
oprice: '699',
discount: '999.5'
},
{
id: 2,
img: '../../static/img/commondity.png',
name: '爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试',
pprice: '269',
oprice: '699',
discount: '5.5'
},
{
id: 3,
img: '../../static/img/commondity.png',
name: '爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试',
pprice: '289',
oprice: '688',
discount: '5.5'
}
]
}]
});
});
// 运动户外第二次触底的数据
router.get('/api/index_list/2/data/3', function(req, res, next) {
res.send({
code: 0,
data: [{
type: 'commodityList',
commodityList: [{
id: 1,
img: '../../static/img/commondity.png',
name: '爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试',
pprice: '299',
oprice: '699',
discount: '5.5'
},
{
id: 2,
img: '../../static/img/commondity.png',
name: '爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试',
pprice: '269',
oprice: '699',
discount: '5.5'
},
{
id: 3,
img: '../../static/img/commondity.png',
name: '爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试',
pprice: '289',
oprice: '688',
discount: '5.5'
}
]
}]
});
});
// 运动户外第一次触底的数据
router.get('/api/index_list/2/data/2', function(req, res, next) {
res.send({
code: "0",
data: [{
type: 'commodityList',
commodityList: [{
id: 1,
img: '../../static/img/commondity.png',
name: '爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试',
pprice: '299',
oprice: '699',
discount: '5.5'
},
{
id: 2,
img: '../../static/img/commondity.png',
name: '爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试',
pprice: '269',
oprice: '699',
discount: '5.5'
},
{
id: 3,
img: '../../static/img/commondity.png',
name: '爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试',
pprice: '289',
oprice: '688',
discount: '5.5'
}
]
}]
});
});
// 户外运动
router.get('/api/index_list/2/data/1', function(req, res, next) {
res.send({
code: "0",
data: [{
type: 'banner',
imgUrl: '../../static/img/run-banner.png'
},
{
type: 'icons',
iconsList: [{
imgUrl: '../../static/img/run.png',
name: '运动户外'
},
{
imgUrl: '../../static/img/run.png',
name: '运动户外'
},
{
imgUrl: '../../static/img/run.png',
name: '运动户外'
},
{
imgUrl: '../../static/img/run.png',
name: '运动户外'
},
{
imgUrl: '../../static/img/run.png',
name: '运动户外'
},
{
imgUrl: '../../static/img/run.png',
name: '运动户外'
},
{
imgUrl: '../../static/img/run.png',
name: '运动户外'
},
{
imgUrl: '../../static/img/run.png',
name: '运动户外'
}
]
},
{
type: 'hot',
hotList: [{
id: 1,
img: '../../static/img/hot.png',
name: '爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试',
pprice: '299',
oprice: '699',
discount: '5.5'
},
{
id: 2,
img: '../../static/img/hot.png',
name: '爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试',
pprice: '269',
oprice: '699',
discount: '5.5'
},
{
id: 3,
img: '../../static/img/hot.png',
name: '爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试',
pprice: '289',
oprice: '688',
discount: '5.5'
}
]
},
{
type: 'shop',
shopList: [{
bigUrl: '../../static/img/shop.png',
data: [{
id: 1,
img: '../../static/img/shop-scroll.png',
name: '爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试',
pprice: '299',
oprice: '699',
discount: '5.5'
},
{
id: 2,
img: '../../static/img/shop-scroll.png',
name: '爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试',
pprice: '269',
oprice: '699',
discount: '5.5'
},
{
id: 3,
img: '../../static/img/shop-scroll.png',
name: '爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试',
pprice: '289',
oprice: '688',
discount: '5.5'
},
{
id: 4,
img: '../../static/img/shop-scroll.png',
name: '爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试',
pprice: '289',
oprice: '688',
discount: '5.5'
},
{
id: 5,
img: '../../static/img/shop-scroll.png',
name: '爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试',
pprice: '289',
oprice: '688',
discount: '5.5'
},
{
id: 6,
img: '../../static/img/shop-scroll.png',
name: '爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试',
pprice: '289',
oprice: '688',
discount: '5.5'
}
]
},
{
bigUrl: '../../static/img/shop.png',
data: [{
id: 1,
img: '../../static/img/shop-scroll.png',
name: '爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试',
pprice: '299',
oprice: '699',
discount: '5.5'
},
{
id: 2,
img: '../../static/img/shop-scroll.png',
name: '爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试',
pprice: '269',
oprice: '699',
discount: '5.5'
},
{
id: 3,
img: '../../static/img/shop-scroll.png',
name: '爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试',
pprice: '289',
oprice: '688',
discount: '5.5'
},
{
id: 4,
img: '../../static/img/shop-scroll.png',
name: '爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试',
pprice: '289',
oprice: '688',
discount: '5.5'
},
{
id: 5,
img: '../../static/img/shop-scroll.png',
name: '爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试',
pprice: '289',
oprice: '688',
discount: '5.5'
},
{
id: 6,
img: '../../static/img/shop-scroll.png',
name: '爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试',
pprice: '289',
oprice: '688',
discount: '5.5'
}
]
}
]
},
{
type: 'commodityList',
commodityList: [{
id: 1,
img: '../../static/img/commondity.png',
name: '爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试',
pprice: '299',
oprice: '699',
discount: '5.5'
},
{
id: 2,
img: '../../static/img/commondity.png',
name: '爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试',
pprice: '269',
oprice: '699',
discount: '5.5'
},
{
id: 3,
img: '../../static/img/commondity.png',
name: '爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试',
pprice: '289',
oprice: '688',
discount: '5.5'
}
]
},
]
});
});
// 服饰内衣
router.get('/api/index_list/3/data/1', function(req, res, next) {
res.send({
code: "0",
data: [{
type: 'banner',
imgUrl: '../../static/img/run-banner.png'
},
{
type: 'icons',
iconsList: [{
imgUrl: '../../static/img/run.png',
name: '服饰内衣'
},
{
imgUrl: '../../static/img/run.png',
name: '服饰内衣'
},
{
imgUrl: '../../static/img/run.png',
name: '服饰内衣'
},
{
imgUrl: '../../static/img/run.png',
name: '服饰内衣'
},
{
imgUrl: '../../static/img/run.png',
name: '服饰内衣'
},
{
imgUrl: '../../static/img/run.png',
name: '服饰内衣'
},
{
imgUrl: '../../static/img/run.png',
name: '服饰内衣'
},
{
imgUrl: '../../static/img/run.png',
name: '服饰内衣'
}
]
},
{
type: 'hot',
hotList: [{
id: 1,
img: '../../static/img/hot.png',
name: '爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试',
pprice: '299',
oprice: '699',
discount: '5.5'
},
{
id: 2,
img: '../../static/img/hot.png',
name: '爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试',
pprice: '269',
oprice: '699',
discount: '5.5'
},
{
id: 3,
img: '../../static/img/hot.png',
name: '爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试',
pprice: '289',
oprice: '688',
discount: '5.5'
}
]
},
{
type: 'shop',
shopList: [{
bigUrl: '../../static/img/shop.png',
data: [{
id: 1,
img: '../../static/img/shop-scroll.png',
name: '爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试',
pprice: '299',
oprice: '699',
discount: '5.5'
},
{
id: 2,
img: '../../static/img/shop-scroll.png',
name: '爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试',
pprice: '269',
oprice: '699',
discount: '5.5'
},
{
id: 3,
img: '../../static/img/shop-scroll.png',
name: '爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试',
pprice: '289',
oprice: '688',
discount: '5.5'
},
{
id: 4,
img: '../../static/img/shop-scroll.png',
name: '爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试',
pprice: '289',
oprice: '688',
discount: '5.5'
},
{
id: 5,
img: '../../static/img/shop-scroll.png',
name: '爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试',
pprice: '289',
oprice: '688',
discount: '5.5'
},
{
id: 6,
img: '../../static/img/shop-scroll.png',
name: '爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试',
pprice: '289',
oprice: '688',
discount: '5.5'
},
{
id: 1,
img: '../../static/img/shop-scroll.png',
name: '爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试',
pprice: '299',
oprice: '699',
discount: '5.5'
},
{
id: 2,
img: '../../static/img/shop-scroll.png',
name: '爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试',
pprice: '269',
oprice: '699',
discount: '5.5'
},
{
id: 3,
img: '../../static/img/shop-scroll.png',
name: '爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试',
pprice: '289',
oprice: '688',
discount: '5.5'
},
{
id: 4,
img: '../../static/img/shop-scroll.png',
name: '爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试',
pprice: '289',
oprice: '688',
discount: '5.5'
},
{
id: 5,
img: '../../static/img/shop-scroll.png',
name: '爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试',
pprice: '289',
oprice: '688',
discount: '5.5'
},
{
id: 6,
img: '../../static/img/shop-scroll.png',
name: '爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试',
pprice: '289',
oprice: '688',
discount: '5.5'
}
]
}]
},
{
type: 'commodityList',
commodityList: [{
id: 1,
img: '../../static/img/commondity.png',
name: '爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试',
pprice: '299',
oprice: '699',
discount: '5.5'
},
{
id: 2,
img: '../../static/img/commondity.png',
name: '爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试',
pprice: '269',
oprice: '699',
discount: '5.5'
},
{
id: 3,
img: '../../static/img/commondity.png',
name: '爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试',
pprice: '289',
oprice: '688',
discount: '5.5'
}
]
},
]
});
});
// 首页数据
router.get('/api/index_list/data', function(req, res, next) {
res.send({
"code": 0,
"data": {
topBar: [{
id: '1',
name: '推荐'
},
{
id: '2',
name: '户外运动'
},
{
id: '3',
name: '服饰内衣'
},
{
id: '4',
name: '鞋子箱包'
},
{
id: '5',
name: '美妆护肤'
},
{
id: '6',
name: '家具数码'
},
{
id: '7',
name: '食品母婴'
},
],
data: [{
type: 'swiperList',
swiperList: [{
imgUrl: '../../static/img/swiper-1.png'
},
{
imgUrl: '../../static/img/swiper-2.png'
},
{
imgUrl: '../../static/img/swiper-3.png'
},
],
},
{
type: 'recommendedList',
recommendedList: [{
bigUrl: '../../static/img/recommended-big.png',
data: [{
imgUrl: '../../static/img/recommended-1.png'
},
{
imgUrl: '../../static/img/recommended-2.png'
},
{
imgUrl: '../../static/img/recommended-3.png'
}
]
}]
},
{
type: 'commodityList',
commodityList: [{
id: 1,
img: '../../static/img/commondity.png',
name: '爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试',
pprice: '299',
oprice: '699',
discount: '5.5'
},
{
id: 2,
img: '../../static/img/commondity.png',
name: '爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试',
pprice: '269',
oprice: '699',
discount: '5.5'
},
{
id: 3,
img: '../../static/img/commondity.png',
name: '爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试爆款商品测试',
pprice: '289',
oprice: '688',
discount: '5.5'
}
]
},
]
}
});
});
module.exports = router;