peng
2025-06-27 e4f4afbce6db262fe07c25af5e0b13601e170552
update 修改神厨和大健康视频发布时匹配填充模式
4个文件已修改
31 ■■■■■ 已修改文件
manager/src/views/goods/goods-info/goodsDetail.vue 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
manager/src/views/health/HealthVideoList.vue 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
manager/src/views/kitchen/kitchenVideo.vue 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
seller/src/views/goods/goods-seller/goodsOperationSec.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
manager/src/views/goods/goods-info/goodsDetail.vue
@@ -78,6 +78,8 @@
                controls
                class="player"
                :src="goods.goodsVideo"
                width="200"
                height="180"
              />
            </FormItem>
            <FormItem label="商品规格">
manager/src/views/health/HealthVideoList.vue
@@ -662,6 +662,12 @@
      this.detail = {}
      this.auditingShow = false
    },
    calculateVideoFit(width, height) {
      const videoRatio = width / height;
      // 规则2:竖屏视频(如9:16)
      if (videoRatio < 0.8) return 'cover';
      return 'contain';
    },
    // 打开审核弹窗
    openAuditing(row) {
      this.auditingShow = true
@@ -674,6 +680,13 @@
    },
    getVideoDuration(e){
      const duration = this.$refs.healthVideoInfo.duration;
      const videoWidth = this.$refs.healthVideoInfo.videoWidth;
      const videoHeight = this.$refs.healthVideoInfo.videoHeight;
      // 根据宽高比选择视频填充模式
     const fitType = this.calculateVideoFit(videoWidth, videoHeight)
      this.uploadVideoForm.videoFit = fitType
      console.log('------视频信息3------------>', videoWidth,videoHeight,fitType)
      this.uploadVideoForm.videoDuration = Math.floor(duration);
    },
    // 打开编辑弹窗
manager/src/views/kitchen/kitchenVideo.vue
@@ -394,7 +394,7 @@
        checkKitchenType: [
          {
            required: true,
            message: '请选择厨神标签',
            message: '请选择厨神标签且不能超过5个',
            trigger: 'blur',
            validator: (rule, value, callback) => {
              console.log('验证值:-------------->', value, '类型:', typeof value);
@@ -581,6 +581,12 @@
      this.$set(this.uploadVideoForm, 'showCoverUrl', '');
      this.$set(this.uploadVideoForm, 'temp', new Date().getTime());
    },
    calculateVideoFit(width, height) {
      const videoRatio = width / height;
      // 规则2:竖屏视频(如9:16)
      if (videoRatio < 0.8) return 'cover';
      return 'contain';
    },
    //重新上传视频
    clearVideo() {
      this.clearCoverImage();
@@ -591,6 +597,12 @@
    },
    getVideoDuration(e){
      const duration = this.$refs.healthVideoInfo.duration;
      const videoWidth = this.$refs.healthVideoInfo.videoWidth;
      const videoHeight = this.$refs.healthVideoInfo.videoHeight;
      // 根据宽高比选择视频填充模式
      const fitType = this.calculateVideoFit(videoWidth, videoHeight)
      this.uploadVideoForm.videoFit = fitType
      console.log('------视频信息3------------>', videoWidth,videoHeight,fitType)
      this.uploadVideoForm.videoDuration = Math.floor(duration);
    },
    // 视频上架
seller/src/views/goods/goods-seller/goodsOperationSec.vue
@@ -155,7 +155,7 @@
              <div class="goods-video">
                <div v-if="baseInfoForm.goodsVideo">
                  <div>
                    <video :src="baseInfoForm.showGoodsVideo" class="video" controls style="max-width: 300px;"/>
                    <video :src="baseInfoForm.showGoodsVideo" class="video" controls style="max-width: 300px;max-height: 400px"/>
                  </div>
                </div>
                <Upload ref="upload" action="-" :format="['avi', 'wmv', 'mpeg', 'mp4', 'mov']"