Commit c52c7717 by 李嘉林

滚动加载

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