From e4f4afbce6db262fe07c25af5e0b13601e170552 Mon Sep 17 00:00:00 2001
From: peng <peng.com>
Date: 星期五, 27 六月 2025 16:03:48 +0800
Subject: [PATCH] update 修改神厨和大健康视频发布时匹配填充模式

---
 manager/src/views/health/HealthVideoList.vue              |   13 +++++++++++++
 manager/src/views/goods/goods-info/goodsDetail.vue        |    2 ++
 manager/src/views/kitchen/kitchenVideo.vue                |   14 +++++++++++++-
 seller/src/views/goods/goods-seller/goodsOperationSec.vue |    2 +-
 4 files changed, 29 insertions(+), 2 deletions(-)

diff --git a/manager/src/views/goods/goods-info/goodsDetail.vue b/manager/src/views/goods/goods-info/goodsDetail.vue
index af66491..2b79c55 100644
--- a/manager/src/views/goods/goods-info/goodsDetail.vue
+++ b/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="鍟嗗搧瑙勬牸">
diff --git a/manager/src/views/health/HealthVideoList.vue b/manager/src/views/health/HealthVideoList.vue
index 43ef70c..1ec0739 100644
--- a/manager/src/views/health/HealthVideoList.vue
+++ b/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);
     },
     // 鎵撳紑缂栬緫寮圭獥
diff --git a/manager/src/views/kitchen/kitchenVideo.vue b/manager/src/views/kitchen/kitchenVideo.vue
index 40e7079..7af33c0 100644
--- a/manager/src/views/kitchen/kitchenVideo.vue
+++ b/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);
     },
     // 瑙嗛涓婃灦
diff --git a/seller/src/views/goods/goods-seller/goodsOperationSec.vue b/seller/src/views/goods/goods-seller/goodsOperationSec.vue
index dbbdb51..c78ec8b 100644
--- a/seller/src/views/goods/goods-seller/goodsOperationSec.vue
+++ b/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']"

--
Gitblit v1.8.0