Authored by 郭成尧

brandListBegin

... ... @@ -27,5 +27,19 @@ module.exports = {
result: result
});
});
},
/* 品牌列表页 */
brandList: (req, res) => {
let params = req.query;
brandModel.getBrandListData().then(result => {
res.render('brand/brand-list',{
module: 'channel',
page: 'brand',
result: result
});
});
}
};
... ...
... ... @@ -7,8 +7,25 @@
'use strict';
const api = global.yoho.API;
exports.getBrandData = () => {
module.exports = {
/**
* 从接口获取品牌店铺数据
* @returns {*}
*/
getBrandOriginData() {
return api.get('', {
method: ''
});
},
/**
* 从接口获取品牌列表页数据
* @returns {*}
*/
getBrandListOriginData() {
return api.get('', {
method: ''
});
}
};
... ...
... ... @@ -8,36 +8,63 @@
const api = global.yoho.API;
const brandApi = require('./brand-api');
/**
* 获取品牌店铺数据
* @param params
* @returns {*|Promise.<TResult>}
*/
const getBrandData = params => {
let finalResult = {};
return api.all([brandApi.getBrandData]).then(result => {
return api.all([brandApi.getBrandOriginData()]).then(result => {
// 待处理,拼接输出模拟数据
Object.assign(finalResult, {
brandBg: 'http://7xwj52.com1.z0.glb.clouddn.com/brandbg.jpg',
brandLogo: '',
brandName: ' A.Dorad',
brandName: 'A.Dorad',
brandIntro: 'Dora毕业于中国美术学院的珠宝设计专业。毕业之后,Dora便开始游走于各国,吸收各地首饰设计的精髓,之后又在首尔修学了3年,A.Dorad饰品系列诞生于首尔, 设计师Dora将首尔设为起点并逐步推向国际。2013年,A.Dorad将旗下主力设计师带领进军广州,并以此为基地,以国际化的标准,设计出全新概念饰品。A.Dorad给人们提供高品质的服务,并且拥有独有的工艺。多样的珠宝首饰产品造型更衬托出其前卫、高雅的设计理念。珍贵的矿石搭配流行的创意理念,启迪了人类艺术。A.Dorad饰品符合现代年轻人对珠宝的追求与热爱,充满个性与时尚.它可以满足不同人的需求独家定制专属于自己的水晶饰品。A.Dorad将继续发挥无与伦比的创造力并开启通往浪漫梦幻的大门。',
showMore: false,
letters: [
showMore: false
});
return finalResult;
});
};
/**
* 获取品牌列表页数据
* @param params
*/
const getBrandListData = params => {
let finalResult = {};
return api.all([brandApi.getBrandListOriginData()]).then(result => {
Object.assign(finalResult, {
brandList:[
{
id: 'A',
name: 'A'
name:'Yohji Yamamoto(eyes wear)',
href:'#',
logo:'https://img11.static.yhbimg.com/brandLogo/2016/04/13/15/010eb8606c1072fd2e769c62567d3bbe93.png?imageView2/2/w/140/h/140'
},
{
id: 'B',
name: 'B'
name:'TEEN TEAM',
href:'#',
logo:'https://img12.static.yhbimg.com/brandLogo/2015/12/03/14/02d4dba71951e8e971dc85d2eab5fe7a7f.jpg?imageView2/2/w/140/h/140'
},
{
id: 'C',
name: 'C'
name:'MYGESMART',
href:'#',
logo:'https://img11.static.yhbimg.com/brandLogo/2014/01/27/11/01d9dbee4c83e9122bd1fc363ceb85e484.jpg?imageView2/2/w/140/h/140'
},
{
id: 'D',
name: 'D'
name:'MYGESMART',
href:'#',
logo:'https://img11.static.yhbimg.com/brandLogo/2014/01/27/11/01d9dbee4c83e9122bd1fc363ceb85e484.jpg?imageView2/2/w/140/h/140'
},
{
id: 'E',
name: 'E'
name:'MYGESMART',
href:'#',
logo:'https://img11.static.yhbimg.com/brandLogo/2014/01/27/11/01d9dbee4c83e9122bd1fc363ceb85e484.jpg?imageView2/2/w/140/h/140'
}
]
});
... ... @@ -47,5 +74,6 @@ const getBrandData = params => {
};
module.exports = {
getBrandData
getBrandData,
getBrandListData
};
... ...
... ... @@ -19,5 +19,6 @@ router.get('/women', channel.index); // 首页
router.get('/lifestyle', channel.index); // 首页
router.get('/resources', channel.resources); // 资源位接口
router.get('/brand', brand.index); // 店铺首页
router.get('/brandList', brand.brandList); // 店铺首页
module.exports = router;
... ...
<div id="brand">
<letter-list></letter-list>
</div>
\ No newline at end of file
... ...
... ... @@ -12,8 +12,4 @@
<div class="expand"></div>
<div class="collapse"></div>
</div>
<div id="letter-list">
<letter-list></letter-list>
</div>
{{/ result}}
\ No newline at end of file
... ...
... ... @@ -4,4 +4,16 @@
* Date: 2016/7/19
* Time: 16:05
*/
const Vue = require('yoho-vue');
const letterList = require('channel/letter-list.vue');
new Vue({
el: '#brand',
components: {
letterList: letterList
}
});
require('./brand/index');
require('./brand/brand-list');
\ No newline at end of file
... ...
/**
* Created by PhpStorm.
* User: Targaryen
* Date: 2016/7/20
* Time: 13:23
*/
\ No newline at end of file
... ...
... ... @@ -4,23 +4,13 @@
* Date: 2016/7/19
* Time: 10:16
*/
var $ = require('yoho-jquery'),
Vue = require('yoho-vue');
var letterList = require('channel/letter-list.vue');
var $ = require('yoho-jquery');
var $expand = $('.expand'),
$collapse = $('.collapse'),
$brandIntro = $('.brand-intro'),
exCoTm = 6; // 展开隐藏的倍数
new Vue({
el: '#letter-list',
components: {
letterList: letterList
}
});
$expand.on('click', function() {
$brandIntro.removeClass('line-clamp').animate({height: $brandIntro.height() * exCoTm});
$expand.hide();
... ...