Authored by 陈轩

fix

... ... @@ -25,23 +25,11 @@ module.exports = {
},
data: function() {
return {
// mock data
params: {
color: [{
colorId: 11,
colorName: '红色',
colorCode: 'ee0000'
}],
gender: [{
genderName: 'BOYS',
genderId: '1,3'
}],
size: [{
sizeName: '100',
sizeId: 255
}]
// 选择的值
params: {},
}
// 确定的值
selected: {}
};
},
watch: {},
... ... @@ -66,7 +54,6 @@ module.exports = {
});
},
entrySub: function(key) {
console.log(this.config[key]);
bus.$emit('filter.sub.show', {
val: key,
ref: this._uid
... ...
module.exports = {
A: [{
id: 5,
type: '0',
hotKeyword: 'AAAA 葛民辉',
isShowNew: 'N',
domain: 'aaaa',
alif: 'A',
isHot: 'N',
ico: 'http://img10.static.yhbimg.com/logo/2012/04/12/13/013c4f832d97df25ce9f79a294d5e05d6b.jpg?imageMogr2/thumbnail/{width}x{height}/extent/{width}x{height}/background/d2hpdGU=/position/center/quality/80',
name: 'AAAA',
keyword: '街头,嘻哈,创意,潮流,AAAA,TEE,扭蛋',
nameEn: 'AAAA',
nameCn: 'AAAA'
}, {
id: 862,
type: '0',
hotKeyword: '',
isShowNew: 'N',
domain: 'aape',
alif: 'A',
isHot: 'N',
ico: 'http://img13.static.yhbimg.com/logo/2015/12/03/15/02a0c256f3a75784fbcaa7d37715fcfa00.jpg?imageMogr2/thumbnail/{width}x{height}/extent/{width}x{height}/background/d2hpdGU=/position/center/quality/80',
name: 'Aape',
keyword: '',
nameEn: 'Aape',
nameCn: 'Aape'
}, {
type: '0',
id: 1209,
alif: 'A',
ico: 'http://img13.static.yhbimg.com/logo/2016/01/04/10/02c340899abe71a7ee1cfeb7591b6b96c0.jpg?imageMogr2/thumbnail/{width}x{height}/extent/{width}x{height}/background/d2hpdGU=/position/center/quality/80',
name: 'AAVA Lifestyle',
keyword: '香薰,首饰,手表,围巾',
nameEn: 'AAVA Lifestyle',
nameCn: '爱瓦生活',
hotKeyword: '创意 品质 居家',
shelvestime: 1451877790,
isShowNew: 'N',
domain: 'aavalifestyle',
isHot: 'N'
}, {
id: 536,
type: '0',
hotKeyword: '',
isShowNew: 'N',
domain: 'ablejeans',
alif: 'A',
isHot: 'Y',
ico: 'http://img13.static.yhbimg.com/logo/2014/05/08/12/0241b56aa9407b25d60b8d6c03ad6396c6.jpg?imageMogr2/thumbnail/{width}x{height}/extent/{width}x{height}/background/d2hpdGU=/position/center/quality/80',
name: 'ABLE JEANS',
keyword: 'ABLE JEANS',
nameEn: 'ABLE JEANS',
nameCn: '欧帛牛仔'
}, {
id: 262,
type: '0',
hotKeyword: '',
isShowNew: 'N',
domain: 'absurdlogic',
alif: 'A',
isHot: 'Y',
ico: 'http://img12.static.yhbimg.com/logo/2015/11/02/16/026f093fae4c9e3c7788508be9d109fc39.jpg?imageMogr2/thumbnail/{width}x{height}/extent/{width}x{height}/background/d2hpdGU=/position/center/quality/80',
name: 'ABSURD LOGIC',
keyword: '',
nameEn: 'ABSURD LOGIC',
nameCn: '荒诞逻辑'
}],
B: [{
id: 373,
type: '0',
hotKeyword: '',
isShowNew: 'N',
domain: 'babyghost',
alif: 'B',
isHot: 'Y',
ico: 'http://img12.static.yhbimg.com/logo/2015/12/09/14/020b4cfa2aa3fb66642259f2be63780cc3.jpg?imageMogr2/thumbnail/{width}x{height}/extent/{width}x{height}/background/d2hpdGU=/position/center/quality/80',
name: 'BABYGHOST',
keyword: '',
nameEn: 'BABYGHOST',
nameCn: '北北高斯'
}, {
id: 1039,
type: '0',
hotKeyword: '',
isShowNew: 'N',
domain: 'backbone',
alif: 'B',
isHot: 'N',
ico: 'http://img11.static.yhbimg.com/logo/2015/12/03/16/01c06f7a1524a2a9052350a8c03c2475d7.jpg?imageMogr2/thumbnail/{width}x{height}/extent/{width}x{height}/background/d2hpdGU=/position/center/quality/80',
name: 'BACK BONE',
keyword: '',
nameEn: 'backbone',
nameCn: 'BACK BONE'
}, {
type: '0',
id: 980,
alif: 'B',
ico: 'http://img10.static.yhbimg.com/logo/2015/09/29/17/0173fd258619dc31c9a659b5be0507eeb1.jpg?imageMogr2/thumbnail/{width}x{height}/extent/{width}x{height}/background/d2hpdGU=/position/center/quality/80',
name: 'B+ by Beautyberry',
keyword: '原创,设计',
nameEn: 'B+ by Beautyberry',
nameCn: 'B+ by Beautyberry',
hotKeyword: '原创,设计',
shelvestime: 1448608361,
isShowNew: 'N',
domain: 'beautyberry',
isHot: 'N'
}]
};
... ... @@ -12,19 +12,40 @@
</div>
</template>
<script>
/**
/**
* 数据结构:
* {
* index: [brandObj, brandObj],
* index: [{}....]
* }
*/
module.exports = {
props: ['data', 'val'],
const $ = require('yoho-jquery');
module.exports = {
props: {
val: Number,
data: {
coerce: (data) => {
// 以brand.alif 分组
const res = {};
$.each(data, brand => {
let groupName = brand.alif;
if (!res.hasOwnProperty(groupName)) {
res[groupName] = [];
}
res[groupName].push(brand);
});
}
}
},
methods: {
select: function(val) {
this.val = val;
}
}
};
};
</script>
... ...
<template>
<div>
<filter-sub :data="brand" :value="3" type="brand"></filter-sub>
<!--<filter-sub :data="brand" :value="3" type="brand"></filter-sub>-->
<Sort :config="sortConfig" :val="sort">
</Sort>
<List :data="productList"></List>
... ... @@ -44,9 +44,7 @@
productList: [],
// state
inSearching: false, // 请求中
brand: require('product/filter/brand-group-mock')
inSearching: false // 请求中
};
},
components: {
... ... @@ -90,8 +88,8 @@
});
},
openFilterSub: function() {
console.log('TODO: open filter sub');
openFilterSub: function(classify) {
console.log('TODO: open filter sub', classify);
},
/**
... ... @@ -147,9 +145,7 @@
* 1. 打开view
* 2. 监听 router.back ,重新设置 筛选值
*/
bus.$on('filter.sub.show', function({
val
}) {
bus.$on('filter.sub.show', function({val}) {
self.openFilterSub(val);
});
... ... @@ -159,6 +155,4 @@
</script>
<style>
</style>
... ...