Commit c52c7717 by 李嘉林

滚动加载

parent 51388ed6
......@@ -51,7 +51,7 @@
<template v-else>
<div
class="brand-item"
v-for="(item,index) in categoryList2"
v-for="(item,index) in categoryList1"
:key="index"
>
<div
......@@ -115,7 +115,7 @@
<div v-if="brandList.length <= 9">
<div
class="brand-item"
v-for="(item,index4) in useBrandList"
v-for="(item,index4) in brandList"
:key="index4"
>
<div
......@@ -134,7 +134,7 @@
<div v-else>
<div
class="brand-item"
v-for="(item,index5) in useBrandList"
v-for="(item,index5) in brandList1"
:key="index5"
>
<div
......@@ -374,12 +374,15 @@ export default {
GoodsSpecificationNameAndValuesListResponseDTO: [],
brandMore: false,
brandList: [],
brandList1: [],
brandList2: [],
brandListCopy: [],
terminalProductIds: [],
specifications: [],
randomNumber: "",
hideBrandSelectFlag: false, // 隐藏品牌筛选
categoryList: [], //暂时为一级分类列表
categoryList1: [], //查看更多分类
categoryList2: [], //查看更多分类
categoryMore: false, // 查看更多分类
sourceType: 0, // 来源类型 0商品搜索页打开 1商品列表组件打开
......@@ -388,12 +391,6 @@ export default {
},
components: {},
computed: {
useBrandList() {
if(this.brandList.length <= 9) {
return this.brandList
}
return this.brandList.slice(0, 8)
},
brandActiveNameListStr() {
return this.submitFliterVal.brandActiveNameList.join("、");
},
......@@ -533,7 +530,8 @@ export default {
}
})
this.brandList = list;
this.brandList2 = this.brandList.slice(8);
this.brandList1 = list.slice(0,8);
this.brandList2 = list.slice(8);
console.log(this.brandList,'---------brandList')
}
});
......@@ -555,7 +553,8 @@ export default {
}
})
this.categoryList = list;
this.categoryList2 = this.categoryList.slice(8);
this.categoryList1 = list.slice(0,8);
this.categoryList2 = list.slice(8);
console.log(this.categoryList,'--this.categoryList')
}
})
......
......@@ -235,7 +235,15 @@ const componentOptions = {
}
},
getProductList(code, type) {
let { goodsList, goodsSort } = this.data.datas.componentData;
let { goodsSort } = this.data.datas.componentData;
let goodsList = [];
if (type == 2) {
goodsList = this.data.pageGoodsList[this.data.datasIndex];
} else {
this.setData({ finished: false });
goodsList = this.data.datas.componentData.goodsList;
}
console.log(goodsList,'--------------------------246')
let {
classificationLoadPage,
loading,
......@@ -257,10 +265,10 @@ const componentOptions = {
}
this.setData({ classificationLoadPage, loading });
let query = {
categoryIncludeChild: true,
categoryId: this.data.datas.componentData.categoryId,
page: classificationLoadPage,
// rows: this.data.datas.componentData.classificationLoadNum,
rows: this.showRowNum() ? this.data.classificationLoadNum : this.getItemNum(),
// rows: this.showRowNum() ? this.data.classificationLoadNum : this.getItemNum(),
sortColumn: goodsSort,
sortType: goodsSort != 2 ? 1 : 0,
whetherShowSoldOutGoods: this.data.datas.componentData
......@@ -281,6 +289,11 @@ const componentOptions = {
brandIdList: this.data.submitFliterVal.brandIdList || [],
categoryIdList: this.data.submitFliterVal.categoryIdList || [],
}; // 当前页 // 一页多少条 //查询销售数量 //查询收藏数 //是否使用虚拟销售数量 //是否使用虚拟收藏人数 //是否查询商品佣金(0:不查询,1:展示,为空不查佣金) //是否查询会员价 1是 0否 //是否展示营销标签 1是 0否 //是否查询多商户 //商城使用
if(this.data.datas.componentData['goodsSource'] == 'classify') {
query.rows = this.data.datas.componentData.classificationLoadNum;
} else {
query.rows = this.getItemNum();
}
// 启用了筛选组件
if(this.data.datas.componentData.filterComponentsFlag == true){
query.searchWord = this.data.filterSearchName;
......
......@@ -124,25 +124,25 @@
<view
class="goods goods-rowList"
id="goods-rowList"
wx:elif="{{datas.componentData.style==='rowList'}}"
wx:if="{{datas.componentData.style==='rowList'}}"
style="margin-left:{{-datas.componentData.proGap*2}}rpx;"
>
<view
wx:for="{{datas.componentData.goodsList}}"
wx:for="{{pageGoodsList[datasIndex]}}"
wx:key="index"
class="goods-item"
style="width:{{100/datas.componentData.columnNum}}%;padding-left:{{datas.componentData.proGap*2}}rpx"
>
<goods-item
datas="{{datas}}"
items="{{datas.componentData.goodsList[index]}}"
items="{{pageGoodsList[datasIndex][index]}}"
indexs="{{index}}"
></goods-item>
</view>
<!-- 上拉加载底部展示 -->
<view class="loadBottom" wx:if="{{datas.componentData.moreShow == false && datas.componentData.style == 'rowList'}}">
<text wx:if="{{loading}}">加载中...</text>
<text wx:if="{{ finished}}">暂无更多</text>
<van-loading size="16px" wx:if="{{loading}}" color="#999"><text class="scrollLoadingText">加载中</text></van-loading>
<text wx:elif="{{ finished}}">暂无更多</text>
</view>
</view>
<!-- 堆叠卡片 -->
......
......@@ -205,6 +205,6 @@ image{
.loadBottom{
text-align: center;
color: #999;
font-size: 24rpx;
font-size: 28rpx;
margin-top: 10rpx;
}
\ No newline at end of file
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