From 587acb1557cebb464aa0e250ff3dbfc436a860fd Mon Sep 17 00:00:00 2001 From: zxl <763096477@qq.com> Date: 星期三, 06 八月 2025 16:27:16 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/dev_fix_sub' into dev_fix_sub --- pages/commodity-square/commoditySquare.vue | 55 +++++++++++++++++++++++++++++++++++++++++++------------ 1 files changed, 43 insertions(+), 12 deletions(-) diff --git a/pages/commodity-square/commoditySquare.vue b/pages/commodity-square/commoditySquare.vue index 84733d2..f0623af 100644 --- a/pages/commodity-square/commoditySquare.vue +++ b/pages/commodity-square/commoditySquare.vue @@ -3,7 +3,7 @@ <input type="text" value="flushDom" v-if="false" /> <top-bar selectedTitleIndex="shop" textColor="black" @changeTab="topBarChange" class="topBar"></top-bar> <view class="search"> - <u-search class="nav-search" @blur='searchGoods' v-model="searchInfo" placeholder="鎼滅储鍟嗗搧" + <u-search class="nav-search" @change='searchGoods' v-model="searchInfo" placeholder="鎼滅储鍟嗗搧" :show-action="false"></u-search> </view> <view style="display: flex;padding: 32rpx;box-sizing: border-box;height: 100%;"> @@ -16,25 +16,27 @@ </scroll-view> </view> - <view class="goodsInfos"> - <scroll-view :scroll-y="true" :show-scrollbar="false"> + <view class="goodsInfos" style="position: relative;"> + <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;" @@ -56,6 +58,10 @@ </view> </view> </scroll-view> + </view> + <view @click="gotoCardList()" style="position: absolute;bottom: 120rpx; right: 32rpx;"> + <div class="settlement" >鍘昏喘鐗╄溅缁撶畻</div> + </view> </view> </view> @@ -85,6 +91,8 @@ }, data() { return { + canGoToCarList:false, + nums:10, searchInfo: '', //鍟嗗搧鍒楄〃 goodsList: [], @@ -106,11 +114,19 @@ pageSize: 12, pageNumber: 1, categoryId: null, - canFilter: true + canFilter: true, + needFilterPre:true, + order:'desc', + sort:'goodsSort' }, } }, methods: { + gotoCardList(){ + uni.navigateTo({ + url:'/pages/cusbar/cart/cartList' + }) + }, addCardNum(e, id) { this.goodsList.forEach(item => { if (item.id === id) { @@ -194,6 +210,7 @@ this.getGoodsParam.keyword = keyWard this.getGoodsParam.pageNumber = 1 this.getGoodsParam.categoryId = '' + this.goodsList = []; await this.getgoodsData(); }, confirm() {}, @@ -237,12 +254,14 @@ }, goToGoodsInfo(id) { const item = this.goodsList.find(item => id === item.id); + console.log(item) uni.navigateTo({ url: `/pages/product/goods?id=${item.id}&goodsId=${item.goodsId}` }); }, //瑙﹀簳鑾峰彇鏁版嵁 async loadMoreData() { + console.log("瑙﹀簳鍔犺浇------------銆�",this.maxPages) if (this.getGoodsParam.pageNumber < this.maxPages) { this.getGoodsParam.pageNumber++; await this.getgoodsData() @@ -264,6 +283,7 @@ const cardInfos = await getCarts(); // 澶勭悊璐墿杞︿俊鎭� let cardMap = new Map(); + this.canGoToCarList = cardInfos.data.result.cartList.length>0 cardInfos.data.result.cartList.forEach(item => { item.skuList.forEach(sku => { @@ -282,7 +302,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) { @@ -326,7 +348,16 @@ overflow: hidden; } - + .settlement { + width: 180rpx; + height: 70rpx; + line-height: 70rpx; + background: linear-gradient(91deg, $light-color 1%, $aider-light-color 99%); + border-radius: 900rpx; + text-align: center; + color: #fff; + margin-right: 10rpx; + } .navigatorMenue { margin-left: -32rpx; -- Gitblit v1.8.0