修复无法分页与商品列表返回错误的bug

This commit is contained in:
weipengfei 2023-10-09 18:19:42 +08:00
parent 83d548fd58
commit 2429f37789
2 changed files with 1163 additions and 1363 deletions

File diff suppressed because it is too large Load Diff

View File

@ -217,11 +217,11 @@
</view>
</view>
<view class="good_price_r">
<view :class="{x_tra:trnList[index].bottom }"
:style="`transform:translateY(${trnList[index].bottom}px);transition:${trnList[index].bottom?1:0}s cubic-bezier(0.4, -0.9, 0.75, 1);`"
<view :class="{x_tra:trnList[index]?trnList[index].bottom:0 }"
:style="`transform:translateY(${trnList[index]?trnList[index].bottom:0}px);transition:${trnList[index]?trnList[index].bottom:0?1:0}s cubic-bezier(0.4, -0.9, 0.75, 1);`"
@click.stop="addcart(item,index)">
<u--image :class="'act_class'+index"
:style="`transform:translateX(${trnList[index].left}px);transition:${trnList[index].bottom?1:0}s `"
:style="`transform:translateX(${trnList[index]?trnList[index].left:0}px);transition:${trnList[index]?trnList[index].bottom:0?1:0}s `"
src="/static/images/LHYC/J.png" width="49.07rpx"
height="49.07rpx"></u--image>
</view>
@ -232,7 +232,7 @@
</view>
</view>
</view>
<view style="height: 100rpx;">
<view style="height: 180rpx;">
<!-- <u-loadmore :status="status" /> -->
</view>
</view>
@ -531,8 +531,6 @@
this.Area()
let that = this
setTimeout(() => {
uni.createSelectorQuery()
.in(this)
.select('.flags1')
@ -556,10 +554,10 @@
},
//
onReachBottom() {
if (this.flag || !this.goodsList.length) return
if (this.flag || !this.goodsList.length) return;
this.status = "loading"
this.page_num += 1
this.flag = true
// this.flag = true
cloudWarehouse({
street_code: this.street_code,
category_id: this.cloudList[this.current]?.category_id || "",
@ -568,15 +566,16 @@
page_num: this.page_num
}).then(res => {
if (res.data.list.length == 0) {
this.status = "nomore"
this.flag = true
return
}
if (res.data.list[0].product_id == this.goodsList[0].product_id) {
this.status = "nomore"
this.flag = false
this.flag = true
} else {
if (res.data.list.length == 0) {
this.status = "nomore"
return
}
this.goodsList = this.goodsList.concat(res.data.list)
this.goodsList = this.goodsList.concat(res.data.list);
}
})
@ -589,7 +588,7 @@
.select('.flags')
.boundingClientRect(rect => {
this.headtop = rect.top
console.log(rect.top)
// console.log(rect.top)
})
.exec();
uni.createSelectorQuery()