Authored by TaoHuang

Merge branch 'develop' of http://git.yoho.cn/fe/xianyu-ufo-app-web into develop

... ... @@ -28,7 +28,7 @@
v-for="(item, index) in itemSub.sub"
:key="index"
:data-id="item.id"
ref="index">
:ref="index">
<LayoutLink :href="item.url" >
<div class="item-imge-div" @click="goProductList(item,index, itemSub)">
<ImgSize
... ... @@ -76,13 +76,15 @@ export default {
}
};
},
mounted() {
},
async activated(){
await this.fetchCategoryParentList();
await this.fetchBrandList({});
Promise.all([this.fetchBrandList({}),this.fetchCategoryParentList()]).then(()=> {
this.reportYas(0);
})
},
// activated(){
// this.reportYas(0);
// },
methods: {
...mapActions(['fetchCategoryParentList', 'selectCategoryParent', 'fetchBrandList', 'fetchCategorySubList']),
onScrollEndHandler({y}) {
... ... @@ -95,8 +97,8 @@ export default {
this.categorySubList.forEach((item) => {
let subItemList = item.sub;
subItemList.forEach((val, index) => {
let eleTop = this.$refs.index[index].offsetTop;
let eleHeight = this.$refs.index[index].offsetHeight;
let eleTop = this.$refs[index][0].offsetTop;
let eleHeight = this.$refs[index][0].offsetHeight;
// console.log(eleHeight+'item'+scrollY)
let firstHeight = 0;
if(scrollY > eleHeight){
... ...
... ... @@ -15,22 +15,25 @@ export default function() {
},
mutations: {
addCategoryParentList(state, {data}) {
let categoryParent = [];
let brand = {
id:'-1',
id: '-1',
name: '品牌',
image: '',
linkType: '',
index: 0,
isSelect: true,
}
state.categoryParent.push(brand);
};
categoryParent.push(brand);
if (data && data.length) {
data.forEach((val, index) => {
val.isSelect = false;
val.index = index + 1;
state.categoryParent.push(val);
categoryParent.push(val);
});
}
state.categoryParent = categoryParent;
},
... ...