brand-box.vue 1.27 KB
<template>
    <brand-top-cmpnt v-bind:share-Link="shareLink"></brand-top-cmpnt>
    <brand-shop-top-cmpnt v-bind:domain="'nike'"></brand-shop-top-cmpnt>
    <goods-list v-bind:data="productList"></goods-list>
</template>

<script>
    const $ = require('yoho-jquery');
    const tip = require('common/tip');
    const brandTopCmpnt = require('channel/brand-top.vue');
    const brandShopTopCmpnt = require('channel/brand-shop-top.vue');
    const goodsList = require('product/list.vue');

    // TODO 确定分享页面后需要添加拼接分享链接的公共方法
    let shareLink = 'http://www.yohobuy.com';

    module.exports = {
        data() {
            return {
                shareLink: shareLink,
                productList: []
            };
        },
        methods: {
            getProductList(){
                let data = {};

                $.ajax({
                    url: '/get-brand-shop-goods',
                    data: data
                }).done(result => {
                    this.productList = result.productList;
                }).fail(() => {
                    tip('网络错误');
                });
            }
        },
        components: {
            brandTopCmpnt,
            brandShopTopCmpnt,
            goodsList
        }
    };
</script>