From 3e84a2c746727e91b25dca19e5c289fa594c2132 Mon Sep 17 00:00:00 2001 From: peng <peng.com> Date: 星期二, 22 七月 2025 18:12:46 +0800 Subject: [PATCH] 解决bug --- pages/commodity-square/commoditySquare.vue | 26 ++++++++++++++++---------- 1 files changed, 16 insertions(+), 10 deletions(-) diff --git a/pages/commodity-square/commoditySquare.vue b/pages/commodity-square/commoditySquare.vue index 84733d2..7001caf 100644 --- a/pages/commodity-square/commoditySquare.vue +++ b/pages/commodity-square/commoditySquare.vue @@ -16,25 +16,27 @@ </scroll-view> </view> - <view class="goodsInfos"> - <scroll-view :scroll-y="true" :show-scrollbar="false"> + <view class="goodsInfos" > + <scroll-view :scroll-y="true" :show-scrollbar="false" style="height: 100%;" @scrolltolower="loadMoreData()"> <view class="goodsItem" v-for="item in goodsList" :key="item.id" @click.prevent="goToGoodsInfo(item.id)" - style="display: flex;align-items: flex-start;justify-content: flex-start;margin: 10rpx 0;"> - <view class="pic"> + style="display: flex;align-items: flex-start;justify-content: flex-start;margin: 10rpx 0; + box-sizing: border-box; "> + <view class="pic" style="position: relative;"> <image :src="item.thumbnail" mode="aspectFill" style="height: 150rpx;width: 150rpx;border-radius: 24rpx;"> </image> + <text style="background-color: #f92e20;color: #fff; + font-weight: bold;border-radius: 12rpx;padding: 5rpx; + margin-right: 15rpx;position: absolute;top: 0;left: 0;" v-if="item.salesModel==='PRESALE'">棰勫敭</text> </view> <view class="goodsContent" style="display: flex;align-items: flex-start;justify-content: space-between; margin-left: 10rpx;flex-direction: column;width: 100%;"> <view class="goodsName"> - <text style="background-color: #f92e20;color: #fff; - font-weight: bold;border-radius: 12rpx;padding: 5rpx; - margin-right: 15rpx;">棰勫敭</text> <text>{{item.goodsName}}</text> </view> + <view style="display: flex; justify-content: space-between;align-items:center; 100%;margin-top: 32rpx;width: 100%;"> <view class="goodsPrice">锟{item.price}}</view> @@ -43,7 +45,7 @@ @click.stop="miousCardNum($event,item.id)"> <uni-icons type="minus" size="30" color="#96a6bc"></uni-icons> </view> - <input v-show="item.cardNum&&item.cardNum>0" :maxlength="2" type="number" + <input v-show="item.cardNum&&item.cardNum>0" @click.stop="" :maxlength="2" type="number" confirm-type="numeric" style="width: 50rpx;text-align: center;" v-model="item.cardNum" :disabled="true" /> <view style="padding: 20rpx 20rpx 20rpx 0;" @@ -106,7 +108,8 @@ pageSize: 12, pageNumber: 1, categoryId: null, - canFilter: true + canFilter: true, + needFilterPre:true }, } }, @@ -243,6 +246,7 @@ }, //瑙﹀簳鑾峰彇鏁版嵁 async loadMoreData() { + console.log("瑙﹀簳鍔犺浇------------銆�",this.maxPages) if (this.getGoodsParam.pageNumber < this.maxPages) { this.getGoodsParam.pageNumber++; await this.getgoodsData() @@ -282,7 +286,9 @@ item.cardNum = cardItem.num; } }) - this.goodsList = goodsList.data.result.records; + this.goodsList = [...this.goodsList,...goodsList.data.result.records]; + this.maxPages = goodsList.data.result.pages + console.log('this.goodsList----------------------->',JSON.stringify(goodsList.data.result)) }, async chooseCategory(id) { -- Gitblit v1.8.0