VideoCreativity2.22eb231d.js 9.2 KB

1
  1. import{d as me,ay as ve,B as O,r as i,Z as U,w as R,ai as n,aq as ge,o as u,c as f,P as z,M as q,O as l,U as a,a as e,S as r,F as H,a8 as J,T as m,u as D,I as ye,a2 as he,aF as xe,aG as be}from"./vue.adf17aba.js";import{a as we,E as I}from"./elementPlus.4833989a.js";import{u as Ie,i as Ce,q as ke}from"./index.6717ff78.js";import{u as Ve}from"./index.b098562c.js";import{_ as Fe}from"./_plugin-vue_export-helper.c27b6911.js";import"./echarts.72dc8373.js";const d=g=>(xe("data-v-d6e58e2f"),g=g(),be(),g),Se={class:"customize-container"},Ae=d(()=>e("div",{style:{"font-weight":"700","padding-bottom":"18px"}},[e("span",{style:{color:"#306cd7","font-size":"26px"}},"|"),e("span",{style:{"font-size":"18px","padding-left":"5px"}},"创意")],-1)),Me={style:{display:"flex",border:"1px solid #dddfe6",padding:"0 0 0 5px","margin-bottom":"20px"}},Ue={style:{width:"50%","padding-left":"5px","border-right":"1px solid #dddfe6"}},ze=d(()=>e("span",{style:{color:"#e47470","margin-right":"4px"}},"*",-1)),De={style:{display:"flex","align-items":"center","justify-content":"space-between"}},Te=d(()=>e("span",{style:{color:"#1e2128","font-size":"15px","font-weight":"450"}},"选择视频",-1)),Ne=d(()=>e("div",{style:{color:"#666666","margin-bottom":"10px"}}," 保持视频简短并紧扣主题。视频会自动播放,因此请确保前 2 秒极具吸引力,并且不依靠声音来传递信息。如果您在视频中使用了文字,请确保文字清晰易辨。字幕或音频必须与将展示您广告的区域相匹配。 ",-1)),Be={class:"upload-button-group"},Ee={style:{display:"flex","align-items":"center","justify-content":"space-between",padding:"0 10px 0 5px"}},Le=d(()=>e("span",{style:{color:"#1e2128","font-size":"15px","font-weight":"450"}},"视频文件要求:",-1)),je=d(()=>e("div",{style:{padding:"0 10px 0 5px"}},[e("span",{style:{color:"#1e2128","font-size":"13px","font-weight":"450"}},"视频规格"),e("div",{class:"introduce-item"},"1.纵横比:16:9"),e("div",{class:"introduce-item"},"2.尺寸:1280 x 720 像素、1920 x 1080 像素或 3840 x 2160 像素"),e("div",{class:"introduce-item"},"3.文件大小:500MB 或更小"),e("div",{class:"introduce-item"},"4.文件格式:MP4 或 MOV"),e("div",{class:"introduce-item"},"5.长度:6-45 秒"),e("div",{class:"introduce-item"},"6.帧率:23.976、23.98、24、25、29.97 或 29.98 fps"),e("div",{class:"introduce-item"},"7.比特率:1 Mbps 或更高"),e("div",{class:"introduce-item"},"8.编解码器:H.264 或 H.265"),e("div",{class:"introduce-item"},"9.配置文件:主配置文件或基线配置文件"),e("div",{class:"introduce-item"},"10.视频流:仅为 1")],-1)),Pe=d(()=>e("div",{style:{padding:"0 10px 0 5px"}},[e("span",{style:{color:"#1e2128","font-size":"13px","font-weight":"450"}},"音频规格"),e("div",{class:"introduce-item"},"1.语言:必须与广告投放区域匹配"),e("div",{class:"introduce-item"},"2.采样率:44.1 kHz 或更高"),e("div",{class:"introduce-item"},"3.编解码器:PCM、AAC 或 MP3"),e("div",{class:"introduce-item"},"4.比特率:96 kbps 或更高"),e("div",{class:"introduce-item"},"5.格式:立体声或单声道"),e("div",{class:"introduce-item"},"6.音频流:仅为 1")],-1)),$e=d(()=>e("hr",{style:{color:"#eceef4",margin:"8px 10px 0 5px"}},null,-1)),Ge=d(()=>e("span",{style:{color:"#e47470","margin-right":"4px"}},"*",-1)),Oe={style:{padding:"10px",display:"flex","align-items":"center"}},Re={style:{"margin-right":"8px","line-height":"normal"}},qe={style:{position:"relative"}},He={class:"double-line"},Je=d(()=>e("span",{style:{color:"#6d7784"}},"ASIN: ",-1)),Ke={class:"data-color",style:{"margin-right":"8px"}},Ze={style:{width:"50%",padding:"0 10px",position:"relative"}},Qe={class:"grid-container"},We=["onClick","onMouseover"],Xe=["src"],Ye={style:{padding:"10px"}},et={class:"bottom"},tt={class:"bottom-item"},ot={class:"bottom-item"},st=d(()=>e("div",{class:"bottom-item"},"背景视频",-1)),lt={class:"dialog-footer"},at=me({__name:"VideoCreativity2",setup(g){const K=Ve(),{profile:C}=ve(K),Z=O("respAdGroupId"),y=O("addedTableDataForVc2"),T=i(),h=U({name:""}),Q=U({name:[{required:!0,message:"请输入名称",trigger:"blur"}]}),W=async o=>{o&&await o.validate((t,_)=>{t?(console.log("submit!"),se()):console.log("error submit!",_)})},N=i(["video"]),X=o=>{},x=i([]),Y=(o,t)=>{x.value.length=0};function ee(o){oe(o)}const k=i(!1);let B="",te="";async function oe(o){const t=new FormData;t.append("file",o.raw),t.append("profile_id",C.value.profile_id),t.append("brandEntityId",te),t.append("assetType","VIDEO"),t.append("assetSubTypeList",JSON.stringify([])),k.value=!0;try{const S=(await Ie(t)).data.file_name,p={profile_id:C.value.profile_id,file_name:S},w=await Ce(p);B=w.data.assetId,w.data.checkresult=="success"?I({message:"上传成功",type:"success"}):I.error("上传失败")}catch(_){console.error("上传失败:",_)}finally{k.value=!1}}const V=i(!1);async function se(){V.value=!0;try{const o={profile_id:C.value.profile_id,casins:v.value,name:h.name,state:"PAUSED",adGroupId:Z.value,videoAssetIds:B,consentToTranslate:!1};(await ke(o)).data.creative_state=="success"?I({message:"创建成功",type:"success"}):I.error("上传失败")}catch(o){console.error("error:",o)}finally{V.value=!1}}let v=i([]);R(y,o=>{v.value=[],Array.isArray(o)&&o.length>0&&o.forEach(t=>{t.asin&&!v.value.includes(t.asin)&&v.value.push(t.asin)}),console.log("Updated ASINs:",v.value)},{deep:!0});const E=i(null),F=i(null),c=i([]),le=i(""),b=i(!1),ae=U([]);function ie(){c.value=[],E.value=null}function L(o){return c.value.some(t=>t.id===o)}function ne(o){L(o.id)?c.value=c.value.filter(t=>t.id!==o.id):c.value.push({id:o.id,assetId:o.id,title:o.title,imageUrl:o.imageUrl}),E.value=o.id}function de(){if(c.value.length>0){c.value[0].assetId;const o={name:c.value[0].title,url:le.value};x.value.push(o),ie(),b.value=!1}}const re=i(!1),j=i([]);return R(y,o=>{j.value=o},{deep:!0}),(o,t)=>{const _=n("el-input"),S=n("el-form-item"),p=n("el-button"),w=n("el-upload"),P=n("el-collapse-item"),ce=n("el-image"),$=n("el-tooltip"),A=n("el-card"),pe=n("el-collapse"),ue=n("el-scrollbar"),_e=n("el-form"),fe=n("el-dialog"),M=ge("loading");return u(),f("div",Se,[z((u(),q(A,{"body-style":"padding: 20px 80px 0 80px;"},{default:l(()=>[Ae,a(_e,{ref_key:"ruleFormRef",ref:T,model:h,rules:Q,"label-width":"120px",class:"demo-ruleForm",size:"default","label-position":"top","status-icon":""},{default:l(()=>[a(S,{label:"广告名称",prop:"name"},{default:l(()=>[a(_,{modelValue:h.name,"onUpdate:modelValue":t[0]||(t[0]=s=>h.name=s),style:{width:"50%"}},null,8,["modelValue"])]),_:1}),z((u(),f("div",Me,[e("div",Ue,[a(ue,{height:"700px"},{default:l(()=>[a(pe,{modelValue:N.value,"onUpdate:modelValue":t[2]||(t[2]=s=>N.value=s),onChange:X,style:{"border-top":"none","border-bottom":"none"}},{default:l(()=>[a(P,{name:"video",style:{padding:"0 10px 0 5px"}},{title:l(()=>[ze,r("视频 ")]),default:l(()=>[e("div",null,[e("div",De,[Te,a(p,{type:"primary",link:""},{default:l(()=>[r("查看视频批准提示")]),_:1})]),Ne,e("div",Be,[z((u(),q(w,{"file-list":x.value,"onUpdate:fileList":t[1]||(t[1]=s=>x.value=s),"on-change":ee,accept:".mp4, .mov",action:"#",limit:1,"auto-upload":!1,"on-remove":Y,class:"upload-demo"},{default:l(()=>[a(p,{type:"primary"},{default:l(()=>[r("上传文件")]),_:1})]),_:1},8,["file-list"])),[[M,k.value]])])])]),_:1}),e("div",Ee,[Le,a(p,{type:"primary",link:""},{default:l(()=>[r("了解更多")]),_:1})]),je,Pe,$e,a(P,{name:"commodity",style:{padding:"0 10px 0 5px"}},{title:l(()=>[Ge,r("商品 ")]),default:l(()=>[(u(!0),f(H,null,J(D(y),s=>(u(),f("div",{key:s.asin},[a(A,{shadow:"hover","body-style":"padding: 10px"},{default:l(()=>[e("div",Oe,[e("div",Re,[a(ce,{class:"img-box",src:s.image_link},null,8,["src"])]),e("div",qe,[a($,{class:"box-item",effect:"dark",content:s.title,placement:"top"},{default:l(()=>[e("div",He,m(s.title),1)]),_:2},1032,["content"]),e("span",null,[Je,e("span",Ke,m(s.asin),1)])])])]),_:2},1024)]))),128))]),_:1})]),_:1},8,["modelValue"])]),_:1})]),e("div",Ze,[a(p,{type:"primary",plain:"",onClick:t[3]||(t[3]=s=>W(T.value)),disabled:!j.value.length&&D(y),style:{position:"absolute",top:"92%",left:"46%"}},{default:l(()=>[r("保存")]),_:1},8,["disabled"])])])),[[M,V.value]])]),_:1},8,["model","rules"])]),_:1})),[[M,re.value]]),a(fe,{modelValue:b.value,"onUpdate:modelValue":t[7]||(t[7]=s=>b.value=s),title:"从素材库中选择",width:"65%"},{footer:l(()=>[e("span",lt,[a(p,{onClick:t[6]||(t[6]=s=>b.value=!1)},{default:l(()=>[r("取消")]),_:1}),a(p,{type:"primary",onClick:de},{default:l(()=>[r("确定")]),_:1})])]),default:l(()=>[a(_,{"prefix-icon":D(we)},null,8,["prefix-icon"]),e("div",Qe,[(u(!0),f(H,null,J(ae,s=>(u(),f("div",{class:ye(["grid-item",{selected:L(s.id),hover:F.value===s.id}]),key:s.id,onClick:G=>ne(s),onMouseover:G=>F.value=s.id,onMouseleave:t[5]||(t[5]=G=>F.value=null)},[a(A,{"body-style":{padding:"0px"}},{default:l(()=>[e("video",{class:"image",src:s.imageUrl,controls:"",preload:"none",onClick:t[4]||(t[4]=he(()=>{},["stop"]))},null,8,Xe),e("div",Ye,[e("span",null,[a($,{placement:"top",content:s.title},{default:l(()=>[r(m(s.title),1)]),_:2},1032,["content"])]),e("div",et,[e("div",tt,m(s.size)+"KB",1),e("div",ot,m(s.width)+" * "+m(s.height),1),st])])]),_:2},1024)],42,We))),128))])]),_:1},8,["modelValue"])])}}});const ut=Fe(at,[["__scopeId","data-v-d6e58e2f"]]);export{ut as default};