Authored by 陈峰

home css

... ... @@ -18,17 +18,17 @@ module.exports = {
app_type: 1
},
domains: {
api: 'http://api-test3.yohops.com:9999/',
service: 'http://service-test3.yohops.com:9999/',
singleApi: 'http://api-test3.yohops.com:9999/'
// api: 'http://api-test3.yohops.com:9999/',
// service: 'http://service-test3.yohops.com:9999/',
// singleApi: 'http://api-test3.yohops.com:9999/'
// api: 'http://dev-api.yohops.com:9999/',
// service: 'http://dev-service.yohops.com:9999/',
// singleApi: 'http://192.168.102.27:8092/'
// //
// api: 'http://api.yoho.cn/',
// service: 'http://service.yoho.cn/',
// singleApi: 'http://single.yoho.cn/'
api: 'http://api.yoho.cn/',
service: 'http://service.yoho.cn/',
singleApi: 'http://single.yoho.cn/'
},
subDomains: {
host: '.m.yohoblk.com',
... ...
# YOHO!BLK Vue v1.0到v2.0再到ssr的升级之路
背景:YOHO!BLK是有货旗下优选品牌,主打高街潮品。
... ...
... ... @@ -22,6 +22,7 @@ import _ from 'lodash';
import bus from 'common/vue-bus';
const typeMap = {
性别: 'gender',
品牌: 'brand',
品类: 'group_sort',
颜色: 'color',
... ... @@ -33,7 +34,8 @@ const typeMap = {
export default {
props: {
name: String,
choices: Array
choices: Array,
single: Boolean
},
data(){
return {
... ... @@ -87,6 +89,15 @@ export default {
}
this.allChoices.splice(index, 1, change);
if (this.single) {
this.chosen = [];
_.each(this.allChoices, c => {
if (c !== change) {
c.isChosen = false;
}
});
}
if (!change.isChosen) {
let id1, id2;
... ... @@ -102,7 +113,6 @@ export default {
} else {
this.chosen.push(change);
}
this.calcChosenStr();
bus.$emit('subChosen.change', typeMap[this.name], this.chosen);
},
... ...
... ... @@ -18,8 +18,13 @@
</div>
<div class="filter-detail" v-show="!filterDown">
<div class="filter-items">
<filter-item v-for="item in filterItems" :key="item.name" :name="item.name" :choices="item.choices"
v-if="item.choices.length"></filter-item>
<filter-item
v-for="item in filterItems"
:key="item.name"
:name="item.name"
:single="item.single"
:choices="item.choices"
v-if="item.choices.length"></filter-item>
</div>
<div class="action">
<p class="tip">您可以选择一个或多个筛选项进行筛选</p>
... ... @@ -43,6 +48,7 @@ import FilterSub from './filter-sub.vue';
let locationQuery = qs(decodeURIComponent(location.search.replace(/^\?/, '')));
const convertMap = {
gender: 'gender',
brand: 'brand',
group_sort: 'sort',
color: 'color',
... ... @@ -90,6 +96,10 @@ export default {
],
filterItems: [
{
name: '性别',
single: true,
choices: []
}, {
name: '品牌',
choices: []
}, {
... ... @@ -326,12 +336,13 @@ export default {
_.each(this.filter.group_sort, item => {
temp = temp.concat(item.sub);
});
this.filterItems[1].choices = temp;
this.filterItems[0].choices = this.filter.brand || [];
this.filterItems[2].choices = this.filter.color || [];
this.filterItems[3].choices = this.filter.size || [];
this.filterItems[4].choices = this.filter.priceRange || [];
this.filterItems[5].choices = this.filter.discount || [];
this.filterItems[0].choices = [{id: 1, name: '男'}, {id: 2, name: '女'}];
this.filterItems[1].choices = this.filter.brand || [];
this.filterItems[2].choices = temp;
this.filterItems[3].choices = this.filter.color || [];
this.filterItems[4].choices = this.filter.size || [];
this.filterItems[5].choices = this.filter.priceRange || [];
this.filterItems[6].choices = this.filter.discount || [];
bus.$on('subChosen.change', this.subChosenChange);
bus.$on('expand.choice.only', name => {
... ...
... ... @@ -69,7 +69,7 @@ export default {
<style lang="scss">
.home-slider {
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
z-index: 999;
... ... @@ -144,7 +144,7 @@ export default {
transition-timing-function: cubic-bezier(0.4, 0, 0.6, 1);
}
.home-slider-enter, .home-slider-leave-to {
transform: translateX(-500px);
transform: translateX(500px);
}
.home-slider-enter-to, .home-slider-leave {
transform: translateX(0px);
... ...
... ... @@ -4,14 +4,12 @@
<search-slider v-model="searchSlider" v-if="loadComponent"></search-slider>
<layout-body>
<header-box slot="header" class="home-header">
<span slot="left">
<i class="icon icon-nav-new" @click="homeSliderSwitch"></i>
</span>
<span slot="title" class="logo">
</span>
<span slot="right">
<i class="icon icon-search-new" @click="searchSliderSwitch"></i>
<i class="icon icon-nav-new" @click="homeSliderSwitch"></i>
</span>
</header-box>
<scroller ref="scroller" @loading="loading">
... ...