zck 1 nedēļu atpakaļ
vecāks
revīzija
45ea41b669
1 mainītis faili ar 7 papildinājumiem un 5 dzēšanām
  1. 7 5
      src/view/Product/ProductTemplateReplace.vue

+ 7 - 5
src/view/Product/ProductTemplateReplace.vue

@@ -202,7 +202,7 @@
         <!-- 尺寸选择区域 -->
         <div style="margin-bottom: 15px;">
           <div style="display: flex; gap: 15px; flex-wrap: wrap; align-items: center;">
-            <div v-for="ratio in [ '1:1','4:3','3:2','2:3','16:9']" :key="ratio" style="display: flex; align-items: center; gap: 5px;">
+            <div v-for="ratio in [ '1:1','4:3','3:2','2:3','16:9','9:16']" :key="ratio" style="display: flex; align-items: center; gap: 5px;">
               <el-radio v-model="selectedSize" :label="ratio" @change="handleSizeChange" border style="border-radius: 2px;">
                 {{ ratio }}
               </el-radio>
@@ -1554,6 +1554,7 @@ const fetchTemplates = async () => {
         id: item.id,
         template_name: item.template_name || '',
         thumbnail_image: item.thumbnail_image,
+        template_image_url: item.template_image_url,
         chinese_description: item.chinese_description || '',
         english_description: item.english_description || ''
       }))
@@ -1572,6 +1573,7 @@ const fetchTemplates = async () => {
 const selectTemplate = (template) => {
   currentTemplateId.value = template.id
   editFormData.thumbnail_image = template.thumbnail_image
+  editFormData.template_image_url = template.template_image_url
   editFormData.template_id = template.id
   editFormData.chinese_description = template.chinese_description
 }
@@ -1750,9 +1752,11 @@ const generateImage = async () => {
     console.log(editFormData.template_id)
     // 第一步:调用生成接口触发生成任务
     const generateResponse = await GetTxtToTxt({ 
-      status_val: '生图',
+      status_val: '生图',
       prompt: editFormData.chinese_description,
       model: 'gemini-3-pro-image-preview',
+      product_img:editFormData.original_image_url,
+      template_img:editFormData.template_image_url,
       id: editFormData.id,
       size: selectedSize.value,
       template_id:editFormData.template_id,
@@ -1859,13 +1863,11 @@ const customWidth = ref('')
 const customHeight = ref('')
 const sizePresets = {
   '1:1': { width: 1024, height: 1024 },
-  '4:3': { width: 1024, height: 768 },
   '3:2': { width: 1024, height: 683 },
   '2:3': { width: 683, height: 1024 },
   '9:16': { width: 675, height: 1200 },
   '16:9': { width: 1200, height: 675 },
-  '21:9': { width: 1200, height: 514 },
-  '3:4': { width: 768, height: 1024 }
+  '9:16': { width: 675, height: 1200 },
 }
 
 // 获取尺寸信息