Authored by wenjiekong

添加假数据

... ... @@ -23,8 +23,9 @@ exports.index = (req, res, next) => {
studentsModel.getStudentsData(channel).then(result => {
let responseData = studentsModel.getTestData(channel);
// let responseData = {};
// let responseData = {};
console.info(responseData);
Object.assign(responseData, result);
res.render('students/index', responseData);
... ... @@ -56,4 +57,4 @@ exports.schoolList = (req, res, next) => {
studentsModel.getSchoolList(areaCode).then(result => {
res.json(result);
}).catch(next);
};
\ No newline at end of file
};
... ...
... ... @@ -14,7 +14,7 @@ const api = global.yoho.API;
exports.getVerifiedTotal = () => {
return api.get('', {method: 'app.student.verifiedStudentTotal'});
}
};
/**
* 获取学历层次列表
... ... @@ -23,7 +23,7 @@ exports.getVerifiedTotal = () => {
exports.getLevelList = () => {
return api.get('', {method: 'app.studentMarket.getEducationLevelList'});
}
};
/**
* 获取学校地区
... ... @@ -35,7 +35,7 @@ exports.getArea = () => {
};
return api.get('', finalParams);
}
};
/**
* 获取学校列表
... ... @@ -48,4 +48,4 @@ exports.getSchool = (areaCode) => {
};
return api.get('', finalParams);
}
};
... ...
... ... @@ -54,18 +54,19 @@ exports.getStudentsData = (channel) => {
* 测试数据
*/
exports.getTestData = () => {
return {
let respData = {
module: 'product',
page: 'students',
headerData: {
Header: true,
headerType: 'boys'
},
footerTop: true,
mainBanner: {
list: [{src: 'http://img11.static.yhbimg.com/yhb-img01/2016/06/01/20/'
footerTop: true
};
+
respData.realData = {
mainBanner: {
list: [{src: 'http://img11.static.yhbimg.com/yhb-img01/2016/06/01/20/' +
'01a88a4e626a954eb5ec0302a0470e0b3f.jpg?imageView2/2/w/1920/h/450/q/70',
url: 'http://www.yohobuy.com'},
{src: 'http://img11.static.yhbimg.com/yhb-img01/2016/06/01/20/' +
... ... @@ -76,25 +77,15 @@ exports.getTestData = () => {
url: 'http://www.yohobuy.com'}]
},
sortItem: [{title: '学生权益介绍', href: 'stu-rights'}, {title: '我要验证身份', href: 'stu-identity'},
{title: '学生热门单品', href: 'stu-good'}, {title: '更多活动推荐',
href: 'stu-activity'}],
stuRights: [{imgUrl: '//img12.static.yhbimg.com/goodsimg/2015/12/02/10/' +
'0256adbb54c5a9b657485b972cc94ceb99.jpg?imageView/1/w/235/h/314', info:
'1、原价商品享9折优惠'},
{title: '学生热门单品', href: 'stu-good'}, {title: '更多活动推荐', href: 'stu-activity'}],
rightsItem: [{imgUrl: '//img12.static.yhbimg.com/goodsimg/2015/12/02/10/' +
'0256adbb54c5a9b657485b972cc94ceb99.jpg?imageView/1/w/235/h/314', info: '1、原价商品享9折优惠'},
{imgUrl: '//img12.static.yhbimg.com/goodsimg/2015/12/02/10/' +
'0256adbb54c5a9b657485b972cc94ceb99.jpg?imageView/1/w/235/h/314', info:
'1、原价商品享9折优惠'},
'0256adbb54c5a9b657485b972cc94ceb99.jpg?imageView/1/w/235/h/314', info: '2、满100元返100个有货币'},
{imgUrl: '//img12.static.yhbimg.com/goodsimg/2015/12/02/10/' +
'0256adbb54c5a9b657485b972cc94ceb99.jpg?imageView/1/w/235/h/314', info:
'1、原价商品享9折优惠'},
'0256adbb54c5a9b657485b972cc94ceb99.jpg?imageView/1/w/235/h/314', info: '3、每月3个免单名额'},
{imgUrl: '//img12.static.yhbimg.com/goodsimg/2015/12/02/10/' +
'0256adbb54c5a9b657485b972cc94ceb99.jpg?imageView/1/w/235/h/314', info:
'1、原价商品享9折优惠'}],
'0256adbb54c5a9b657485b972cc94ceb99.jpg?imageView/1/w/235/h/314', info: '4、不定期学生专享活动'}],
proItem: [
{url: '',
productName: 'Dickies 炫色小脚裤',
... ... @@ -168,25 +159,27 @@ href: 'stu-activity'}],
}
]
};
return respData;
};
/**
* 获取学校地区数据
* @return Object 接口数据
*/
exports.getSchoolArea = () => {
exports.getSchoolArea = () => {
return studentsApi.getArea().then(result => {
return result;
});
}
};
/**
* 根据地区码查询学校列表
* @params areaCode int 地区码
* @return Object 接口数据
*/
exports.getSchoolList = (areaCode) => {
exports.getSchoolList = (areaCode) => {
return studentsApi.getSchool(areaCode).then(result => {
return result;
});
}
};
... ...
{{#realData}}
{{! 头部banner}}
<div class="stu-page">
{{> common/main-banner}}
<div class="center-content">
{{! 分类导航}}
<div class="sort-nav clearfix" urlLocation="">
{{#sortItem}}
<a class="sort-item {{#if @first}}first active{{/if}} {{#if @last}}last{{/if}}" href='#{{href}}'>{{title}}</a>
{{/sortItem}}
</div>
{{! 学生权益}}
<div class="stu-box">
<div class="floor-header clearfix">
... ... @@ -86,11 +84,6 @@
<a name="stu-activity">
<h2 class="floor-title">活动推荐</h2>
</a>
{{#if false}}
<span class="floor-more">
<a target="_blank" href="http://list.yohobuy.com/new?gender=1,3&amp;order=s_t_desc">更多细则</a>
</span>
{{/if}}
</div>
<div class="commodity-list clearfix">
{{#activityItem}}
... ... @@ -99,5 +92,5 @@
</div>
</div>
</div>
</div>
{{/realData}}
... ...
<div class="stu-rights clearfix">
{{#stuRights}}
{{#rightsItem}}
<div class="stu-rights-item">
<img class="" src="{{imgUrl}}">
</img>
<p>{{info}}</p>
</div>
{{/stuRights}}
{{/rightsItem}}
</div>
\ No newline at end of file
... ...