Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yohoblk-wap
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
陈峰
7 years ago
Commit
136b9d1e53039bdf23e8a53d46a596f24f0799d4
1 parent
3e0a8591
home css
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
44 additions
and
21 deletions
config/common.js
doc/blk.md
public/vue/component/product/filter/filter-item.vue
public/vue/component/product/filter/index.vue
src/pages/channel/home/components/home-slider.vue
src/pages/channel/home/home.vue
config/common.js
View file @
136b9d1
...
...
@@ -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'
,
...
...
doc/blk.md
0 → 100644
View file @
136b9d1
# YOHO!BLK Vue v1.0到v2.0再到ssr的升级之路
背景:YOHO!BLK是有货旗下优选品牌,主打高街潮品。
...
...
public/vue/component/product/filter/filter-item.vue
View file @
136b9d1
...
...
@@ -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);
},
...
...
public/vue/component/product/filter/index.vue
View file @
136b9d1
...
...
@@ -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 => {
...
...
src/pages/channel/home/components/home-slider.vue
View file @
136b9d1
...
...
@@ -69,7 +69,7 @@ export default {
<style lang="scss">
.home-slider {
position: absolute;
lef
t: 0;
righ
t: 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);
...
...
src/pages/channel/home/home.vue
View file @
136b9d1
...
...
@@ -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">
...
...
Please
register
or
login
to post a comment