From d6e3b7494c1d6a6d7e8d000258d0f38265cc5563 Mon Sep 17 00:00:00 2001 From: xiangpei <xiangpei@timesnew.cn> Date: 星期日, 29 六月 2025 11:13:10 +0800 Subject: [PATCH] 视频发布商品搜索从第0页开始 --- pages/tabbar/video/video.vue | 19 ++++++++----------- 1 files changed, 8 insertions(+), 11 deletions(-) diff --git a/pages/tabbar/video/video.vue b/pages/tabbar/video/video.vue index af7dfeb..0bdff1e 100644 --- a/pages/tabbar/video/video.vue +++ b/pages/tabbar/video/video.vue @@ -132,7 +132,7 @@ <view class="goods-price" style="flex: 1;">楼{{ goods.price }}</view> <view @click.stop="() => {}" style="flex: 1;display: flex;justify-content: center;align-items: center;"> <view style="width: 90rpx">鏁伴噺锛�</view> - <uni-number-box v-model="goods.goodsNum" :min="0"/> + <uni-number-box v-model="goods.goodsNum" :min="1"/> </view> </view> </view> @@ -239,7 +239,7 @@ goodsQuery: { keyword: '', searchFromSelfStore: false, // 鏄惁鏄煡璇㈣嚜瀹跺簵閾哄晢鍝� - pageNumber: 1, + pageNumber: 0, pageSize: 5 }, formData: { @@ -249,7 +249,6 @@ videoFileKey: '', videoDuration: 0, videoFit: 'cover', - goodsId: '', videoContentType: 'video', videoImgs: [], tags: [], @@ -289,7 +288,7 @@ // 鑾峰彇灞忓箷瀹藉害 const systemInfo = uni.getSystemInfoSync() this.screenWidth = systemInfo.windowWidth - this.goodsQuery.pageNumber = 1 + this.goodsQuery.pageNumber = 0 this.goodsQuery.pageSize = 10 this.getVideoGoodsByEs() }, @@ -310,7 +309,7 @@ }, // 澶勭悊鍟嗗搧鎼滅储鍊� handlerGoodsSearch() { - this.goodsQuery.pageNumber = 1 + this.goodsQuery.pageNumber = 0 this.goodsQuery.pageSize = 10 this.getVideoGoodsByEs() }, @@ -318,7 +317,7 @@ async getVideoGoodsByEs() { getVideoGoodsList(this.goodsQuery).then(res => { - if(this.goodsQuery.pageNumber === 1) { + if(this.goodsQuery.pageNumber === 0) { this.goodsList = res.data.data } else { this.goodsList = [ @@ -543,10 +542,9 @@ // 閫夋嫨鍟嗗搧 chooseGoods() { if(this.selectedGoodsList.length > 0) { - const selectedGoodsIds = new Set(this.selectedGoodsList.map(i => i.goodsId)); - console.log(selectedGoodsIds, "mimade"); + const selectedGoodsSkuIds = new Set(this.selectedGoodsList.map(i => i.id)); this.goodsList?.forEach(goods => { - this.$set(goods, 'selected', selectedGoodsIds.has(goods.goodsId)); + this.$set(goods, 'selected', selectedGoodsSkuIds.has(goods.id)); }); } this.showGoodsPicker = true; @@ -638,7 +636,7 @@ if (valid && this.canPublish) { this.loading = true; this.formData.fileInfo = this.videoInfo; - this.formData["goodsList"] = this.selectedGoodsList.map(item => {return {goodsId: item.goodsId, goodsNum: item.goodsNum}}); + this.formData["goodsList"] = this.selectedGoodsList.map(item => {return {goodsId: item.goodsId, goodsSkuId: item.id, goodsNum: item.goodsNum}}); publish(this.formData).then(res => { uni.showToast({ title: '瑙嗛宸叉彁浜ゅ鏍竳', @@ -683,7 +681,6 @@ cover: '', videoFit: 'cover', videoDuration: 0, - goodsId: '', videoContentType: 'video', videoImgs: [], tags: [], -- Gitblit v1.8.0