jufubao-mall 2.0.72 → 2.0.73
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -97,7 +97,7 @@
|
|
|
97
97
|
:style="[{marginRight:(column_num ===1 && columnOneLayout ==='H' ? 0:(columnSpacing + 'rpx'))}]"
|
|
98
98
|
>
|
|
99
99
|
<view
|
|
100
|
-
v-for="(item,idx) in
|
|
100
|
+
v-for="(item,idx) in columnedProdList[index]"
|
|
101
101
|
:key="item.product_id"
|
|
102
102
|
:style="[item.is_poster ==='Y'?posterProductStyles:contProductStyles]"
|
|
103
103
|
>
|
|
@@ -185,7 +185,7 @@
|
|
|
185
185
|
closeMask: true,
|
|
186
186
|
isPreview: false,
|
|
187
187
|
prodList: null, //数据
|
|
188
|
-
|
|
188
|
+
_columnedCache: null,
|
|
189
189
|
allPagesData:{}, //所有页面数据
|
|
190
190
|
curCategoryId:0,//当前分类ID
|
|
191
191
|
delayDelCurOtherTimeer:null,
|
|
@@ -297,6 +297,20 @@
|
|
|
297
297
|
stateCity: state => state.cityLocation.city
|
|
298
298
|
}),
|
|
299
299
|
|
|
300
|
+
columnedProdList() {
|
|
301
|
+
const list = this.prodList;
|
|
302
|
+
const cols = this.column_num;
|
|
303
|
+
if (list === null) {
|
|
304
|
+
return this._columnedCache || [];
|
|
305
|
+
}
|
|
306
|
+
const result = [];
|
|
307
|
+
for (let i = 0; i < cols; i++) {
|
|
308
|
+
result[i] = list.filter((_, idx) => idx % cols === i);
|
|
309
|
+
}
|
|
310
|
+
this._columnedCache = result;
|
|
311
|
+
return result;
|
|
312
|
+
},
|
|
313
|
+
|
|
300
314
|
bodyStyleComp(){
|
|
301
315
|
return {
|
|
302
316
|
padding: this.getMarginAndPadding(this.bodyPadding,0),
|
|
@@ -640,19 +654,6 @@
|
|
|
640
654
|
})
|
|
641
655
|
},
|
|
642
656
|
|
|
643
|
-
delayDelCurOther(){
|
|
644
|
-
if(this.delayDelCurOtherTimeer) clearTimeout(this.delayDelCurOtherTimeer);
|
|
645
|
-
this.delayDelCurOtherTimeer = setTimeout(()=>{
|
|
646
|
-
console.log('allPagesData',this.$xdUniHelper.cloneDeep(this.allPagesData));
|
|
647
|
-
Object.keys(this.allPagesData).map(key=>{
|
|
648
|
-
if(this.curCategoryId + '' !== key) {
|
|
649
|
-
delete this.allPagesData[key];
|
|
650
|
-
}
|
|
651
|
-
})
|
|
652
|
-
console.warn(`删除当前分类以外的分类:curID=${this.curCategoryId}`);
|
|
653
|
-
console.log(this.allPagesData)
|
|
654
|
-
}, 10000);
|
|
655
|
-
},
|
|
656
657
|
|
|
657
658
|
getList(isTabLoading=false){
|
|
658
659
|
const { navList, navIndex, page_token = 1, page_size, sort } = this;
|
|
@@ -793,19 +794,6 @@
|
|
|
793
794
|
else this.prodList = (this.prodList||[]).concat(list);
|
|
794
795
|
}
|
|
795
796
|
|
|
796
|
-
//保存所以列表数据
|
|
797
|
-
this.allPagesData[category_id] = (this.allPagesData[category_id]||[]).concat(list);
|
|
798
|
-
|
|
799
|
-
//#ifdef H5
|
|
800
|
-
window['allPagesData'] = this.allPagesData;
|
|
801
|
-
//#endif
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
//延期删除当前组件意外的数据
|
|
805
|
-
console.log('allPagesData',this.$xdUniHelper.cloneDeep(this.allPagesData));
|
|
806
|
-
this.delayDelCurOther();
|
|
807
|
-
|
|
808
|
-
|
|
809
797
|
this.page_token = res.next_page_token;
|
|
810
798
|
this.hasNext = !!res.next_page_token;
|
|
811
799
|
|
|
@@ -834,22 +822,11 @@
|
|
|
834
822
|
})
|
|
835
823
|
|
|
836
824
|
}).catch(err => {
|
|
837
|
-
console.log("err", err);
|
|
838
825
|
this.$xdHideLoading();
|
|
839
826
|
this.$xdLog.catch(err);
|
|
840
827
|
})
|
|
841
828
|
},
|
|
842
829
|
|
|
843
|
-
getItemData(cellIndex,data){
|
|
844
|
-
let list = this.$xdUniHelper.cloneDeep(data);
|
|
845
|
-
if(list === null) return this.$xdUniHelper.cloneDeep(this.nextPagesData[cellIndex]);
|
|
846
|
-
let listData = list.filter((it,index) => {
|
|
847
|
-
return index % this.column_num === cellIndex;
|
|
848
|
-
});
|
|
849
|
-
this.nextPagesData[cellIndex] = this.$xdUniHelper.cloneDeep(listData);
|
|
850
|
-
return listData;
|
|
851
|
-
},
|
|
852
|
-
|
|
853
830
|
toProductInfo({isCart,...prod}){
|
|
854
831
|
if(this.$configProject['isPreview']) return;
|
|
855
832
|
toProductDetail(this, prod, this.productInfoPath,isCart ==='Y');
|
|
@@ -864,9 +841,9 @@
|
|
|
864
841
|
},
|
|
865
842
|
|
|
866
843
|
onJfbScroll({e, options}){
|
|
867
|
-
if(this.isPreview || this.
|
|
844
|
+
if(this.isPreview || this.isNextLoading === true) return;
|
|
868
845
|
//调用子组件方法
|
|
869
|
-
|
|
846
|
+
this.$refs.VT.topData(e.scrollTop);
|
|
870
847
|
this.scrollTop = e.scrollTop;
|
|
871
848
|
this.$xdUniHelper.getWindowHeight(['.jfb-mall-home-product-list__body'], this)
|
|
872
849
|
.then(res => {
|