Authored by 陈峰

Merge branch 'release/3.0' of http://git.yoho.cn/fe/yohoblk-wap into release/3.0

<template>
<div>
<header-box title="品牌" ref="header"></header-box>
<header-box title="BRANDS" ref="header"></header-box>
<resources :content-code="contentCode"></resources>
<brand-list :channel="channel"></brand-list>
</div>
... ...
... ... @@ -2,7 +2,7 @@
<div v-if="channel.length" class="channel-tab">
<div class="channel ellipsis" v-for="(item, index) in channel" :key="index" :class="{focus: index === currentChannel}"
@click="changeChannel(index, item.id)" :style="{width: (1 / channel.length) * 100 + '%'}">
<span class="name">{{item.name && item.name.toUpperCase()}}</span>
<span class="name">{{item.name | keepEn}}</span>
</div>
</div>
</template>
... ... @@ -89,6 +89,12 @@
}
}
},
filters: {
keepEn(name){
name = (name || '').toUpperCase();
return name.replace(/(男士|女士)$/g, '');
}
},
watch: {
current(val) {
this.currentChannel = val;
... ...
... ... @@ -175,7 +175,7 @@
}
.right-btn {
font-size: 38px;
font-size: 17PX;
margin-right: 30px;
}
}
... ...
... ... @@ -6,7 +6,7 @@
<div class="my-header" v-if="data.nickName">
<a class="user-info auth" id="user-info" href='/me/mydetails'>
<img class="user-avatar" :src="headIco" @error="setEmptyimg">
<span class="username" :class="{'username-top': !data.vipLevel}">{{ data.nickName }}</span>
<span class="username ellipsis" :class="{'username-top': !data.vipLevel}">{{ data.nickName }}</span>
<div class="account-mg">账号管理<span class="icon icon-right"></span></div>
</a>
<a :class="`vip-level level-${data.vipLevel}`" v-if="data.vipLevel" href='/me/grade'></a>
... ... @@ -15,7 +15,7 @@
<span class="username" @click="sign">登录/注册</span>
</div>
<div class="change-channel" @click="goChannel">
<span class="label">切换购物频道</span>
<span class="label">默认购物频道</span>
<span class="channel">{{curChannel}}<span class="icon icon-right"></span></span>
</div>
<div class="group-list">
... ...
<template>
<div class="product-new" :class="{'no-header': noheader}">
<header-box title="新品抢先看"></header-box>
<header-box title="NEW ARRIVAL"></header-box>
<filter-box :val="order" :filter="filterConfig" v-if="enableOrder"></filter-box>
<product-list :data="productList" :state="listState" class="list-items"></product-list>
<shopping-bag :cart-count="cartCount" v-if="isApp"></shopping-bag>
... ...
... ... @@ -5,6 +5,7 @@
<product-list :data="productList" :state="listState"></product-list>
</div>
<filter-box :val="order" :filter="filterConfig" v-if="enableOrder" ref="filter"></filter-box>
<shopping-bag :cart-count="cartCount" v-if="isApp"></shopping-bag>
</div>
</template>
<style>
... ... @@ -35,6 +36,8 @@
import shopTop from 'product/shop/shop-top.vue'; // 店铺头部信息
import ProductList from 'component/product/list.vue';
import FilterBox from 'component/product/filter/index.vue';
import ShoppingBag from 'component/product/shopping-bag.vue';
const $shop = $('#shop');
... ... @@ -44,6 +47,7 @@
export default {
data() {
return {
isApp: yoho.isApp,
noheader: false,
shareData: {}, // 分享相关数据
shopInfo: {}, // 店铺介绍相关数据
... ... @@ -64,6 +68,7 @@
inSearching: false,
enableOrder: false,
order: '',
cartCount: 0
};
},
computed: {
... ... @@ -178,13 +183,22 @@
this.page = 0;
this.productList = [];
this.search();
},
refreshCart: function() {
$.get('/product/cart-count.json').then(result=> {
if (result.code === 200) {
this.cartCount = result.data.cart_goods_count;
}
});
}
},
components: {
topBar,
shopTop,
ProductList,
FilterBox
FilterBox,
ShoppingBag
},
created() {
const self = this;
... ... @@ -219,6 +233,12 @@
self.filter = val;
self.$refs.filter.isVisible = false;
});
// 读取购物车数量
if (this.isApp) {
this.refreshCart();
bus.$on('app.shoppingcart.refresh', this.refreshCart);
}
}
};
... ...