Authored by 郝肖肖

品类资源位

... ... @@ -87,5 +87,14 @@ module.exports = {
.then(result => {
res.json(result);
});
},
// 品类资源位
cateResource: (req, res) => {
res.render('brand/cate-resource', {
module: 'channel',
page: 'cate-resource'
});
}
};
... ...
... ... @@ -55,7 +55,7 @@ module.exports = {
getShopsDecoratorList(params) {
return api.get('', {
method: 'app.shopsdecorator.getList',
});
},
... ... @@ -89,5 +89,16 @@ module.exports = {
method: 'app.sort.get'
})
);
},
/**
* 从接口获取品类资源位数据
* @returns {*}
*/
getCateResource(params) {
return api.get('', Object.assign(params, {
method: 'app.sort.get'
})
);
}
};
... ...
... ... @@ -211,9 +211,23 @@ const getCateListData = params => {
});
};
/**
* 获取品类资源位数据
* @param params
* @returns {*|Promise.<TResult>}
*/
const getCateResource = params => {
let finalResult = {};
return brandApi.getCateResource(params).then(result => {
return finalResult;
});
};
module.exports = {
getBrandData,
getBrandShopGoodsData,
getBrandListData,
getCateListData
getCateListData,
getCateResource
};
... ...
... ... @@ -21,6 +21,7 @@ router.get('/get-brand-shop-goods', brand.getBrandShopGoods); // 店铺介绍
router.get('/brand-list', brand.brandList); // 品牌列表页
router.get('/get-brand-list', brand.getBrandList); // 获取品牌列表数据
router.get('/brand-share', brand.brandShare); // 获取品牌列表数据
router.get('/cate-resource', brand.cateResource); // 品类资源位页面
router.get('/cate', brand.cate); // 全部分类
router.get('/get-cate-list', brand.getCateList); // 全部分类数据列表
... ...
<div id="cate-resource">
<cate-res></cate-res>
</div>
\ No newline at end of file
... ...

2.66 KB | W: | H:

1.24 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin
const Vue = require('yoho-vue');
const lazyload = require('yoho-vue-lazyload');
const cateRes = require('channel/cate-resource-box.vue');
require('common/vue-filter');
Vue.use(lazyload);
new Vue({
el: '#cate-resource',
components: {
'cate-res': cateRes
}
});
... ...
... ... @@ -4,6 +4,6 @@ const brandCate = require('channel/brand-cate.vue');
new Vue({
el: '#brand-cate',
components: {
brandCate
'brand-cate': brandCate
}
});
... ...
<template>
<tab v-bind:page="page"></tab>
<resources v-bind:content-code.sync="contentCode"></resources>
<cate-resources></cate-resources>
</template>
<script>
const contentCode = require('content-code');
const qs = require('yoho-qs');
const tab = require('channel/tab.vue');
const resources = require('component/resources/index.vue');
const cateResources = require('channel/cate-resources.vue');
module.exports = {
data() {
return {
page: 'brand',
contentCode: contentCode.brand[qs.brand || 'men'],
channel: qs.channel
};
},
components: {
tab,
resources,
cateResources
}
};
</script>
\ No newline at end of file
... ...
<template>
<div class='cate-resource'>
<ul>
<li class='width50' style='
background:url(http://img11.static.yhbimg.com/brandLogo/2015/08/04/18/01a6f1a7600ab044d1577dd6c357298fb3.png?imageMogr2/thumbnail/150x150/extent/150x150/background/d2hpdGU=/position/center/quality/80);background-size:100% 100%;background-repeat:no-repeat;'>
<div>上衣</div>
</li>
<li class='width50' style='
background:url(http://img11.static.yhbimg.com/brandLogo/2015/08/04/18/01a6f1a7600ab044d1577dd6c357298fb3.png?imageMogr2/thumbnail/150x150/extent/150x150/background/d2hpdGU=/position/center/quality/80);background-size:100% 100%;background-repeat:no-repeat;'>
<div>上衣</div>
</li>
<li class='width100' style='
background:url(http://img10.static.yhbimg.com/yhb-img01/2016/07/22/15/014c3887f1320bf024a8bbc01fef5d2a1a.png?imageView2/2/w/750/h/365);background-size:100% 100%;background-repeat:no-repeat;'>
<div>全部分类</div>
</li>
</ul>
</div>
</template>
<style>
.cate-resource {
width: 100%;
ul, li {
margin: 0;
padding: 0;
}
li {
float: left;
text-align: center;
color: #fff;
font-size: 60px;
cursor: pointer;
img {
width: 100%;
}
div {
margin-top: 50px;
}
}
.width25,
.width50,
.width100 {
width: 25%;
height: 200px;
overflow: hidden;
img {
height: 200px;
}
}
.width50 {
width: 50%;
}
.width100 {
width: 100%;
height: 360px;
img {
height: 360px;
}
div {
margin-top: 120px;
}
}
}
</style>
<script>
</script>
\ No newline at end of file
... ...