Commit 824b5d99 by 李嘉林

删除商品列表console

parent 3907d08c
......@@ -77,7 +77,6 @@ const componentOptions = {
lifetimes: {
created() {},
ready() {
console.log(this.data.storageKey, "--goodsList-ready")
let _this = this;
let { clientHeight } = this.data;
wx.getSystemInfo({
......@@ -88,7 +87,6 @@ const componentOptions = {
});
app.getFilterGoodsData = (val) => {
if (val.randomNumber != _this.data.randomNumber) return;
console.log(val,'-------------------------77')
let selectScreen = val.submitFliterVal.minPrice!=""
|| val.submitFliterVal.maxPrice!=""
|| val.submitFliterVal.attribute.length>0
......@@ -102,10 +100,8 @@ const componentOptions = {
selectScreen,
loading: true
})
console.log(_this.data.submitFliterVal, '----------submitFliterVal')
_this.init();
}
console.log(this.data.datas.componentData.filterBrand,'---this.data.datas.componentData.filterBrand')
this.setData({
"submitFliterVal.brandIdList": this.data.datas.componentData.filterBrand && this.data.datas.componentData.filterBrand.length>0?JSON.parse(JSON.stringify(this.data.datas.componentData.filterBrand)) : [],
})
......@@ -120,7 +116,6 @@ const componentOptions = {
pageLifetimes: {
// 页面被展示
show() {
console.log("--goodsList-show")
const { isPageHidden } = this.data;
// show事件发生前,页面不是处于隐藏状态时
......@@ -199,9 +194,7 @@ const componentOptions = {
mainColor: app.themeColor["--main-color"],
randomNumber: random_string(6),
});
console.log(this.data.titleIcon, "----------------------------68");
let ids = this.getStorageSync(`ids`);
console.log(ids,'---ids--104'+this.data.storageKey)
log.info(ids,'---ids--105')
// 如果不是横向标签组件初始化缓存
if (!this.data.storageKey.includes('transverse-label')) {
......@@ -258,7 +251,6 @@ const componentOptions = {
this.setData({ finished: false });
goodsList = this.data.datas.componentData.goodsList;
}
console.log(goodsList,'--------------------------246')
let {
classificationLoadPage,
loading,
......@@ -366,12 +358,10 @@ const componentOptions = {
});
let storageIds = this.getStorageSync('ids')
console.log(this.data.goodsListIndex,storageIds,'--storageIds')
storageIds[this.data.goodsListIndex] = ids
this.setStorageSync('ids',storageIds)
let storageDatasList = this.getStorageSync('storageDatasList')
console.log(storageDatasList,'------228'+this.data.storageKey)
storageDatasList[this.data.goodsListIndex] = this.data.datas.componentData
this.setStorageSync('storageDatasList',storageDatasList)
......@@ -388,7 +378,6 @@ const componentOptions = {
})
let terminalProductIds = []
terminalProductIds = this.getStorageSync('ids')[this.data.goodsListIndex];
console.log(terminalProductIds, this.data.storageKey, 'page-----');
let {
vipPrice,
marketingTag,
......@@ -411,14 +400,12 @@ const componentOptions = {
if (res.data.code == 200) {
goodsList = res.data.data;
let pageGoodsList = this.data.pageGoodsList[this.data.goodsListIndex] || [];
console.log(goodsList, pageGoodsList, this.data.storageKey, '------------------------goodsList----433')
this.goodsListVal(goodsList, 1,flag);
}
});
},
goodsListVal(goodsList, type,flag) {
let { attributeValueList } = this.data.datas.componentData;
console.log(goodsList,this.data.storageKey, "------------goodsListVal");
goodsList.forEach((item, index) => {
item.marketingTag = item.defaultTags
? this.filtermark(
......@@ -459,8 +446,6 @@ const componentOptions = {
// 过滤商品属性
if (item.attributeList) {
let list = item.attributeList.filter(item1=>attributeValueList.includes(item1.attributeName)) || [];
console.log("list",list)
console.log(item.attributeValueList,'--item.attributeValueList')
item.attributeValueList = list ? list.map(item1 => item1.attributeValue) : [];
}
}
......@@ -475,7 +460,6 @@ const componentOptions = {
pageGoodsList[that.data.goodsListIndex] = list;
}else{
pageGoodsList[that.data.datasIndex] = list;
console.log(pageGoodsList[that.data.datasIndex],'--pageGoodsList[that.data.datasIndex]')
}
this.setStorageSync('pageGoodsList', pageGoodsList);
......@@ -484,7 +468,6 @@ const componentOptions = {
let loadingFlag = this.getStorageSync('loadingFlag')
loadingFlag[that.data.datasIndex] = false
this.setStorageSync('loadingFlag', loadingFlag);
console.log(this.data.storageKey, pageGoodsList,'-----pageGoodsList')
that.setData({
"datas.componentData.goodsList": list,
pageGoodsList,
......@@ -511,22 +494,18 @@ const componentOptions = {
let { purchased } = this.data.datas.componentData;
let list = goodsList.map(item=>item.productId);
if(purchased) {
console.log("getPurchased-list",list)
// if(!this.render) return;
goodsApi.query_goods_cart_info(list).then(res=>{
if (res.data.code == 200) {
let purchasedList = res.data.data || [];
let purchasedListIds = [...new Set(purchasedList.map(item=>item.productId))];
console.log(purchasedListIds,'---purchasedListIds')
goodsList.forEach(item=>{
item.purchased = false;
if(purchasedListIds.includes(item.productId)) {
item.purchased = true;
console.log("---------------1039")
}
})
callback(goodsList);
console.log(goodsList,'getPurchased---goodsList')
}
})
} else {
......@@ -538,22 +517,18 @@ const componentOptions = {
let { collectFlag } = this.data.datas.componentData;
let list = goodsList.map(item => item.productId);
if(collectFlag) {
console.log("getcollectFlag-list",list)
// if(!this.render) return;
goodsApi.batch_query_collect_count(list).then(res=>{
if (res.data.code == 200) {
let collectFlagList = res.data.data || [];
let collectFlagListIds = [...new Set(collectFlagList.map(item=>item.productId))];
console.log(collectFlagListIds,'---collectFlagListIds')
goodsList.forEach(item=>{
item.collectFlag = false;
if(collectFlagListIds.includes(item.productId)) {
item.collectFlag = true;
console.log("---------------1039")
}
})
callback(goodsList);
console.log(goodsList,'getcollectFlag---goodsList')
}
})
} else {
......@@ -563,8 +538,6 @@ const componentOptions = {
// 触发图片加载
lazyloading(){
var that = this
console.log(that.data.datasIndex,that.data.goodsListIndex,'datasIndex');
console.log(that.data.pageGoodsList[that.data.datasIndex]);
let storageDatasList = this.getStorageSync('storageDatasList') || []
let { style } = storageDatasList[that.data.datasIndex];
......@@ -572,18 +545,15 @@ const componentOptions = {
if(style == 'list' || style == 'rowList'){
type = 'goods-item'
}else{
console.log("不是goods-item");
return
}
let windowHeight = wx.getSystemInfoSync().windowHeight
let pageGoodsList = this.getStorageSync('pageGoodsList') || []
console.log(that.data.pageGoodsList,pageGoodsList,that.data.datasIndex,'pageGoodsList--loading');
let loadingFlag = this.getStorageSync('loadingFlag')
// 如果所有的商品都加载完成直接return
if (loadingFlag[that.data.datasIndex]) {
console.log("如果所有的商品都加载完成直接return");
return
}
......@@ -594,7 +564,6 @@ const componentOptions = {
return
}
wx.createSelectorQuery().selectAll(`.goodsListItemIndex${that.data.datasIndex}>>>.${type}`).boundingClientRect(function(rects){
console.log(rects.length,'------rectslength')
for (let index = 0; index < rects.length; index++) {
if (rects[index].top == 0 && rects[index].bottom == 0 && rects[index].left == 0 && rects[index].right == 0) {
break
......@@ -607,7 +576,6 @@ const componentOptions = {
pageGoodsList,
})
// that.pageGoodsList = pageGoodsList
console.log(rects,pageGoodsList[that.data.goodsListIndex], pageGoodsList[that.data.datasIndex],'fff');
that.setStorageSync('pageGoodsList',pageGoodsList)
......@@ -620,7 +588,6 @@ const componentOptions = {
})
that.setStorageSync('loadingFlag',loadingFlag)
console.log('load--ok');
}
}).exec();
......@@ -705,7 +672,6 @@ const componentOptions = {
if (this.data.datasIndex != this.data.goodsListIndex) return;
// 是指定分类且不显示查看更多的瀑布流组件滚动加载
let { goodsSource, moreShow, style } = this.data.datas.componentData;
console.log('goodsSource, moreShow, style',goodsSource, moreShow, style);
this.lazyloading()
if (
(goodsSource == "classify" || goodsSource == "specifyFilter") &&
......@@ -714,7 +680,6 @@ const componentOptions = {
if (style == "waterfall") {
this.selectComponent("#waterfallFlow").getScroll(el);
} else if (style == "rowList") {
console.log("rowList--滚动加载")
this.getScrollEl(el);
}
}
......@@ -730,7 +695,6 @@ const componentOptions = {
let scrollTop = parseInt(el.scrollTop);
let domHeight = parseInt(res.height);
// 窗口高度+滚动高度等于 = 元素整体高度 -(预留一段距离加载) 触发父组件查询接口
console.log(scrollTop,_this.data.clientHeight,domHeight - 150,domHeight,finished,'--------------finished1')
if (
scrollTop + _this.data.clientHeight >= domHeight - 150 &&
finished == false
......@@ -743,7 +707,6 @@ const componentOptions = {
},
// 分页加载
onLoad() {
console.log("---触发分页加载");
this.getProductList(1, 2);
},
viewMore(e) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment