From b6b1a34a610795ed5ea8dd8658955ea4c9a0d401 Mon Sep 17 00:00:00 2001 From: peng <peng.com> Date: 星期五, 27 六月 2025 15:54:04 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/dev' into dev --- pages/tabbar/video/video.vue | 41 +++++++++++++++++++++++++++-------------- 1 files changed, 27 insertions(+), 14 deletions(-) diff --git a/pages/tabbar/video/video.vue b/pages/tabbar/video/video.vue index b852579..619c135 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"/> + <uni-number-box v-model="goods.goodsNum" :min="1"/> </view> </view> </view> @@ -205,13 +205,7 @@ </template> <script> -import UIcon from '@/uview-components/uview-ui/components/u-icon/u-icon.vue'; -import UButton from '@/uview-components/uview-ui/components/u-button/u-button.vue'; -import UForm from '@/uview-components/uview-ui/components/u-form/u-form.vue'; -import UFormItem from '@/uview-components/uview-ui/components/u-form-item/u-form-item.vue'; -import UInput from '@/uview-components/uview-ui/components/u-input/u-input.vue'; -import USearch from '@/uview-components/uview-ui/components/u-search/u-search.vue'; -import UPopup from '@/uview-components/uview-ui/components/u-popup/u-popup.vue'; +import '@/components/uview-components/uview-ui'; import MyTag from '@/components/my-tag.vue' import { getSTSToken, getFilePreviewUrl } from "@/api/common.js"; @@ -221,7 +215,7 @@ import { getVideoGoodsList } from "@/api/goods.js"; export default { - components: {MyTag,UIcon,UButton,UForm,UFormItem,UInput,USearch,UPopup}, + components: {MyTag}, data() { return { fileTypeShow: false, @@ -255,7 +249,6 @@ videoFileKey: '', videoDuration: 0, videoFit: 'cover', - goodsId: '', videoContentType: 'video', videoImgs: [], tags: [], @@ -457,7 +450,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 }, // 閫夋嫨瑙嗛鍥鹃泦 @@ -533,13 +541,19 @@ // 閫夋嫨鍟嗗搧 chooseGoods() { + if(this.selectedGoodsList.length > 0) { + const selectedGoodsSkuIds = new Set(this.selectedGoodsList.map(i => i.id)); + this.goodsList?.forEach(goods => { + this.$set(goods, 'selected', selectedGoodsSkuIds.has(goods.id)); + }); + } 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 { @@ -622,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.id, goodsNum: item.selectNum}}); + 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: '瑙嗛宸叉彁浜ゅ鏍竳', @@ -667,7 +681,6 @@ cover: '', videoFit: 'cover', videoDuration: 0, - goodsId: '', videoContentType: 'video', videoImgs: [], tags: [], -- Gitblit v1.8.0