绿满眶商城微信小程序-uniapp
peng
2025-06-25 cad6ad80c86eba4663d84fd78042c1173361f600
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="1"/>
               </view>
            </view>
              </view>
@@ -249,7 +249,6 @@
      videoFileKey: '',
      videoDuration: 0,
      videoFit: 'cover',
        goodsId: '',
        videoContentType: 'video',
        videoImgs: [],
        tags: [],
@@ -451,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
    },
    // 选择视频图集
@@ -527,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 {
@@ -616,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.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: '视频已提交审核~',
@@ -661,7 +681,6 @@
        cover: '',
        videoFit: 'cover',
        videoDuration: 0,
        goodsId: '',
        videoContentType: 'video',
        videoImgs: [],
        tags: [],