|
@@ -28,7 +28,7 @@ |
|
@@ -28,7 +28,7 @@ |
28
|
v-for="(item, index) in itemSub.sub"
|
28
|
v-for="(item, index) in itemSub.sub"
|
29
|
:key="index"
|
29
|
:key="index"
|
30
|
:data-id="item.id"
|
30
|
:data-id="item.id"
|
31
|
- ref="index">
|
31
|
+ :ref="index">
|
32
|
<LayoutLink :href="item.url" >
|
32
|
<LayoutLink :href="item.url" >
|
33
|
<div class="item-imge-div" @click="goProductList(item,index, itemSub)">
|
33
|
<div class="item-imge-div" @click="goProductList(item,index, itemSub)">
|
34
|
<ImgSize
|
34
|
<ImgSize
|
|
@@ -76,13 +76,15 @@ export default { |
|
@@ -76,13 +76,15 @@ export default { |
76
|
}
|
76
|
}
|
77
|
};
|
77
|
};
|
78
|
},
|
78
|
},
|
|
|
79
|
+
|
79
|
mounted() {
|
80
|
mounted() {
|
|
|
81
|
+ Promise.all([this.fetchBrandList({}),this.fetchCategoryParentList()]).then(()=> {
|
|
|
82
|
+ this.reportYas(0);
|
|
|
83
|
+ })
|
80
|
},
|
84
|
},
|
81
|
- async activated(){
|
|
|
82
|
- await this.fetchCategoryParentList();
|
|
|
83
|
- await this.fetchBrandList({});
|
|
|
84
|
- this.reportYas(0);
|
|
|
85
|
- },
|
85
|
+ // activated(){
|
|
|
86
|
+ // this.reportYas(0);
|
|
|
87
|
+ // },
|
86
|
methods: {
|
88
|
methods: {
|
87
|
...mapActions(['fetchCategoryParentList', 'selectCategoryParent', 'fetchBrandList', 'fetchCategorySubList']),
|
89
|
...mapActions(['fetchCategoryParentList', 'selectCategoryParent', 'fetchBrandList', 'fetchCategorySubList']),
|
88
|
onScrollEndHandler({y}) {
|
90
|
onScrollEndHandler({y}) {
|
|
@@ -95,8 +97,8 @@ export default { |
|
@@ -95,8 +97,8 @@ export default { |
95
|
this.categorySubList.forEach((item) => {
|
97
|
this.categorySubList.forEach((item) => {
|
96
|
let subItemList = item.sub;
|
98
|
let subItemList = item.sub;
|
97
|
subItemList.forEach((val, index) => {
|
99
|
subItemList.forEach((val, index) => {
|
98
|
- let eleTop = this.$refs.index[index].offsetTop;
|
|
|
99
|
- let eleHeight = this.$refs.index[index].offsetHeight;
|
100
|
+ let eleTop = this.$refs[index][0].offsetTop;
|
|
|
101
|
+ let eleHeight = this.$refs[index][0].offsetHeight;
|
100
|
// console.log(eleHeight+'item'+scrollY)
|
102
|
// console.log(eleHeight+'item'+scrollY)
|
101
|
let firstHeight = 0;
|
103
|
let firstHeight = 0;
|
102
|
if(scrollY > eleHeight){
|
104
|
if(scrollY > eleHeight){
|