From 5027240f2bbc9a7f74b8cc661c265eb9d52eb43a Mon Sep 17 00:00:00 2001 From: peng <peng.com> Date: 星期四, 19 六月 2025 09:16:57 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/dev' into dev --- pages/tabbar/video/video.vue | 30 ++++++++++++++++++++++++++---- 1 files changed, 26 insertions(+), 4 deletions(-) diff --git a/pages/tabbar/video/video.vue b/pages/tabbar/video/video.vue index be52e74..af7dfeb 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.selectNum" :min="0"/> + <uni-number-box v-model="goods.goodsNum" :min="0"/> </view> </view> </view> @@ -451,7 +451,22 @@ }, // 閲嶆柊涓婁紶 reUpload() { - this.resetData() + this.videoInfo = { + url: '', + fileKey: '', + fileType: '', + fileSize: 0, + originalFileName: '', + cover: '' + }; + this.formData.videoFileKey = '' + this.formData.cover = '' + this.formData.videoFit = 'cover' + this.formData.videoDuration = 0 + this.formData.videoImgs = [] + this.formData.fileInfo = {} + this.formData.videoContentType = 'video' + this.videoPreviewImgs = [] this.fileTypeShow = true }, // 閫夋嫨瑙嗛鍥鹃泦 @@ -527,13 +542,20 @@ // 閫夋嫨鍟嗗搧 chooseGoods() { + if(this.selectedGoodsList.length > 0) { + const selectedGoodsIds = new Set(this.selectedGoodsList.map(i => i.goodsId)); + console.log(selectedGoodsIds, "mimade"); + this.goodsList?.forEach(goods => { + this.$set(goods, 'selected', selectedGoodsIds.has(goods.goodsId)); + }); + } this.showGoodsPicker = true; }, // 閫夋嫨鍏蜂綋鍟嗗搧 selectGoods(goods, index) { if(! this.selectedGoodsList.some(item => item.id === goods.id)) { - goods["selectNum"] = 1 + goods["goodsNum"] = 1 this.selectedGoodsList.push(goods) this.goodsList[index].selected = true } else { @@ -616,7 +638,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.selectNum}}); + this.formData["goodsList"] = this.selectedGoodsList.map(item => {return {goodsId: item.goodsId, goodsNum: item.goodsNum}}); publish(this.formData).then(res => { uni.showToast({ title: '瑙嗛宸叉彁浜ゅ鏍竳', -- Gitblit v1.8.0