Authored by 郭成尧

'路由优化'

... ... @@ -6,7 +6,7 @@ Name | Path | Note
品类 | /cate |
全部分类 | /cate-all |
品牌店铺 | /product/shop?domain=sctest1 |
品牌店铺分享页面 | /product/brand-share?domain=colormad |
品牌店铺分享页面 | /product/shop-share?domain=colormad |
商品详情 | /product/{productId} |
资讯列表 | /news |
... ...
... ... @@ -17,12 +17,13 @@ router.get('/', channel.index); // 首页
router.get('/channel/channel.json', channel.channel); // 查询所有频道
router.get('/channel/resources.json', channel.resources); // 资源位接口
router.get('/channel/goods.json', channel.goods); // 首页查询商品列表
router.get('/brands', brand.brandList); // 品牌列表页
router.get('/get-brand-list', brand.getBrandList); // 获取品牌列表数据
router.get('/brand/list.json', brand.getBrandList); // 获取品牌列表数据
router.get('/cate', brand.cateResource); // 品类资源位页面
router.get('/cate-all', brand.cate); // 全部分类
router.get('/get-cate-list', brand.getCateList); // 全部分类数据列表
router.get('/cate/list.json', brand.getCateList); // 全部分类数据列表
router.get('/sidebar', channel.sidebar); // 资源位接口
... ...
... ... @@ -19,6 +19,6 @@ router.get(/news_(\d+)\.json/, detail.news);
const news = require(`${cRoot}/index`);
router.get('', news.index); // 首页
router.post('/get-news-list', news.getNewsList); // 获取资讯数据
router.post('/list.json', news.getNewsList); // 获取资讯数据
module.exports = router;
... ...
... ... @@ -36,10 +36,10 @@ router.get('/sub-filter', subFilter.page);
const shop = require(`${cRoot}/shop`);
router.get('/shop', shop.index); // 店铺首页
router.get('/get-shop-info', shop.getShopInfo); // 店铺介绍
router.post('/get-brand-shop-goods', shop.getBrandShopGoods); // 店铺商品列表
router.post('/collect-shop', shop.collectShop); // 收藏品牌店铺
router.get('/shop-share', shop.shopShare); // 品牌店铺分享页面
router.get('/shop/info.json', shop.getShopInfo); // 店铺介绍
router.post('/shop/goods.json', shop.getBrandShopGoods); // 店铺商品列表
router.post('/shop/collect.json', shop.collectShop); // 收藏品牌店铺
router.get('/shop/share', shop.shopShare); // 品牌店铺分享页面
// 商品详情controller
const detail = require(`${cRoot}/detail`);
... ...
... ... @@ -75,7 +75,7 @@
box-sizing: border-box;
float: left;
height: 100%;
padding: 20px 0px;
padding: 20px 0;
width: 25%;
text-align: center;
color: #999;
... ... @@ -198,7 +198,6 @@
<script>
const $ = require('yoho-jquery');
const tip = require('common/tip');
const qs = require('yoho-qs');
module.exports = {
props: [],
... ... @@ -219,13 +218,12 @@
};
$.ajax({
url: '/get-cate-list',
url: '/cate/list.json',
data: data
}).then(result => {
let len = result.length;
if (len > 0) {
if (result.length > 0) {
this.brandCate = result;
this.widthli = 100 / len;
this.widthli = 100 / result.length;
this.cateNavLeftData = this.brandCate[0].ca;
this.cateNavRightData = this.cateNavLeftData[0].sub;
}
... ...
... ... @@ -80,7 +80,7 @@
};
$.ajax({
url: '/get-brand-list',
url: '/brand/list.json',
data: data
}).then(result => {
this.brandList = result.brandList;
... ...
... ... @@ -94,7 +94,7 @@
/* 获取资讯列表数据 */
getNewsList() {
$.post({
url: '/news/get-news-list',
url: '/news/list.json',
data: {
sortId: this.crntCateId,
page: this.page++,
... ...
... ... @@ -69,7 +69,7 @@
/* 获取店铺简介相关数据 */
getShopInfo() {
$.get({
url: '/product/get-shop-info',
url: '/product/shop/info.json',
data: { domain: qs.domain }
}).done(result => {
this.shopInfo = result;
... ...
... ... @@ -31,7 +31,7 @@
filterConfig: {},
// query
url: '/product/get-brand-shop-goods',
url: '/product/shop/goods.json',
sort: '',
filter: {
domain: qs.domain
... ... @@ -61,7 +61,7 @@
/* 获取店铺简介相关数据 */
getShopInfo() {
$.get({
url: '/product/get-shop-info',
url: '/product/shop/info.json',
data: { domain: this.domain }
}).done(result => {
if (result) {
... ...
... ... @@ -78,7 +78,7 @@
};
$.post({
url: '/product/collect-shop',
url: '/product/shop/collect.json',
data: data
}).done(result => {
tip(result.message);
... ...