|
|
<template>
|
|
|
<brand-top v-bind:share-data="shareData"></brand-top>
|
|
|
<brand-shop-top></brand-shop-top>
|
|
|
<brand-top-bar v-bind:share-data="shareData"></brand-top-bar>
|
|
|
<brand-shop-top v-bind:shop-info="shopInfo"></brand-shop-top>
|
|
|
<goods-list v-bind:data="productList"></goods-list>
|
|
|
<drawer v-ref:drawer>
|
|
|
<filter :config.once="filterConfig"></filter>
|
...
|
...
|
@@ -9,10 +9,11 @@ |
|
|
|
|
|
<script>
|
|
|
const $ = require('yoho-jquery');
|
|
|
const qs = require('yoho-qs');
|
|
|
const bus = require('common/vue-bus');
|
|
|
const tip = require('common/tip');
|
|
|
const brandTop = require('channel/brand-top.vue');
|
|
|
const brandShopTop = require('channel/brand-shop-top.vue');
|
|
|
const brandTopBar = require('channel/brand-top-bar.vue'); // 顶部栏,包括返回、收藏店铺、分享,打开筛选页面
|
|
|
const brandShopTop = require('channel/brand-shop-top.vue'); // 店铺头部信息
|
|
|
const goodsList = require('product/list.vue');
|
|
|
const drawer = require('product/drawer.vue');
|
|
|
const filter = require('product/filter.vue');
|
...
|
...
|
@@ -22,11 +23,10 @@ |
|
|
module.exports = {
|
|
|
data() {
|
|
|
return {
|
|
|
shareData: {
|
|
|
title: 'BLK',
|
|
|
link: 'm.blk.com',
|
|
|
img: 'https://img11.static.yhbimg.com/brandLogo/2016/04/13/15/010eb8606c1072fd2e769c62567d3bbe93.png?imageView2/2/w/140/h/140'
|
|
|
},
|
|
|
domain: qs.domain,
|
|
|
shareData: {}, // 分享相关数据
|
|
|
shopInfo: {}, // 店铺介绍相关数据
|
|
|
|
|
|
sortConfig: global.sortConfig,
|
|
|
filterConfig: global.filterConfig,
|
|
|
|
...
|
...
|
@@ -45,6 +45,10 @@ |
|
|
};
|
|
|
},
|
|
|
watch: {
|
|
|
domain: function() {
|
|
|
this.getShopInfo();
|
|
|
},
|
|
|
|
|
|
/* sort 和 filter 改变 都会触发 重新搜索 (想象成清空所有分页) */
|
|
|
sort: function() {
|
|
|
this.research();
|
...
|
...
|
@@ -54,6 +58,28 @@ |
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
|
|
|
/* 获取店铺简介相关数据 */
|
|
|
getShopInfo() {
|
|
|
$.get({
|
|
|
url: '/get-shop-info',
|
|
|
data: { domain: this.domain }
|
|
|
}).done(result => {
|
|
|
if (result) {
|
|
|
this.shopInfo = result;
|
|
|
this.shopInfo.showBrandInfo = true;
|
|
|
this.shareData = {
|
|
|
title: result.brandName,
|
|
|
link: '/brand-share?domain=' + this.domain,
|
|
|
img: result.brandBg
|
|
|
};
|
|
|
} else {
|
|
|
this.shopInfo.showBrandInfo = false;
|
|
|
}
|
|
|
}).fail(() => {
|
|
|
tip('网络错误');
|
|
|
});
|
|
|
},
|
|
|
getProductList() {
|
|
|
let data = {};
|
|
|
|
...
|
...
|
@@ -106,14 +132,16 @@ |
|
|
}
|
|
|
},
|
|
|
components: {
|
|
|
brandTop,
|
|
|
brandTopBar,
|
|
|
brandShopTop,
|
|
|
goodsList,
|
|
|
drawer,
|
|
|
filter
|
|
|
},
|
|
|
created() {
|
|
|
this.search();
|
|
|
this.getShopInfo();
|
|
|
|
|
|
// this.search();
|
|
|
bus.$on('list.paging', function() {
|
|
|
this.search();
|
|
|
});
|
...
|
...
|
|