<script setup>
import Upload from './Upload.vue'
const form = inject('form')

const handleCopy = () => {
  form.picture_34_addreses = form.picture_addreses
}
</script>

<template>
  <div>
    <el-form-item label="主图" prop="picture_addreses" :rules="[{ required: true, message: '该项为必填项' }]">
      <div class="form-tips">影响商品曝光引流效果</div>
      <div>
        <Upload
          v-model="form.picture_addreses"
          :limit="5"
          accept="image/*"
          first-title="商品正面图"
          first-tips="上传主图"
          tips="上传辅助图"></Upload>
        <div class="upload-tips">
          <p>1、仅支持png/jpg/jpeg格式，宽高至少600*600px，大小2M内</p>
          <p>2、低质图无法获得平台免费推荐机会，更多图片上传规范要求可点击</p>
        </div>
      </div>
    </el-form-item>
    <el-form-item label="">
      <template #label>
        <span>主图3:4</span>
        <el-button type="primary" plain size="small" style="margin-left: 430px" @click="handleCopy"
          >从主图一键填入</el-button
        >
      </template>
      <div class="form-tips">有机会在搜索、推荐等场景展示，提升转化</div>
      <div>
        <Upload
          v-model="form.picture_34_addreses"
          :limit="5"
          accept="image/*"
          itemHeight="134px"
          first-title="商品正面图"
          first-tips="上传主图"
          tips="上传辅助图"></Upload>
        <div class="upload-tips">
          <p>1、仅支持png/jpg/jpeg格式，图片宽高不低于375*500（750*1000最佳），大小2M内</p>
          <p>
            2、可优先上传3:4或1:1图，系统将有概率生成对应比例图填充至上传入口（如1:1图满足智能生成条件，系统可自动生成3:4图）
            点击发布后方可生效
          </p>
        </div>
      </div>
    </el-form-item>
    <el-form-item label="主图视频" v-if="false">
      <div class="form-tips">有机会在搜索、推荐等场景展示，提升转化</div>
      <Upload v-model="form.video_url" accept="video/*" tips="主图视频" isVideo></Upload>
      <div class="upload-tips" style="margin-left: 20px">
        <p>1、仅支持mp4格式上传，大小50M内，比例支持1:1、3:4 (分辨率不低于720P)</p>
        <p>2、5s&lt;=时长&lt;=60s（30秒内最佳），画面整洁声音流畅，出镜商品与实际商品为同款且主体突出</p>
      </div>
    </el-form-item>
  </div>
</template>

<style lang="scss">
.upload-tips {
  padding: 10px 0;
  color: #999;
  line-height: 24px;
}
</style>
