1 |
- import{d as me,al as ve,q as H,r as i,Q as M,w as P,a9 as n,af as ge,o as u,c as f,H as U,E as R,G as l,M as a,a as e,K as r,F as O,a0 as K,L as m,u as D,z as ye,W as he,aq as xe,ar as be}from"./vue.6daa721c.js";import{s as we,j as I}from"./elementPlus.346c766a.js";import{u as Ie,i as Ce,q as ke}from"./index.ea6c2f6d.js";import{u as Ve}from"./index.ce5db57b.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"},ze=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)),Ae={style:{display:"flex",border:"1px solid #dddfe6",padding:"0 0 0 5px","margin-bottom":"20px"}},Me={style:{width:"50%","padding-left":"5px","border-right":"1px solid #dddfe6"}},Ue=d(()=>e("span",{style:{color:"#e47470","margin-right":"4px"}},"*",-1)),De={style:{display:"flex","align-items":"center","justify-content":"space-between"}},Ne=d(()=>e("span",{style:{color:"#1e2128","font-size":"15px","font-weight":"450"}},"选择视频",-1)),Te=d(()=>e("div",{style:{color:"#666666","margin-bottom":"10px"}}," 保持视频简短并紧扣主题。视频会自动播放,因此请确保前 2 秒极具吸引力,并且不依靠声音来传递信息。如果您在视频中使用了文字,请确保文字清晰易辨。字幕或音频必须与将展示您广告的区域相匹配。 ",-1)),Ee={class:"upload-button-group"},Le={style:{display:"flex","align-items":"center","justify-content":"space-between",padding:"0 10px 0 5px"}},je=d(()=>e("span",{style:{color:"#1e2128","font-size":"15px","font-weight":"450"}},"视频文件要求:",-1)),Be=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)),$e=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)),qe=d(()=>e("hr",{style:{color:"#eceef4",margin:"8px 10px 0 5px"}},null,-1)),Ge=d(()=>e("span",{style:{color:"#e47470","margin-right":"4px"}},"*",-1)),He={style:{padding:"10px",display:"flex","align-items":"center"}},Pe={style:{"margin-right":"8px","line-height":"normal"}},Re={style:{position:"relative"}},Oe={class:"double-line"},Ke=d(()=>e("span",{style:{color:"#6d7784"}},"ASIN: ",-1)),Je={class:"data-color",style:{"margin-right":"8px"}},Qe={style:{width:"50%",padding:"0 10px",position:"relative"}},We={class:"grid-container"},Xe=["onClick","onMouseover"],Ye=["src"],Ze={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 J=Ve(),{profile:C}=ve(J),Q=H("respAdGroupId"),y=H("addedTableDataForVc2"),N=i(),h=M({name:""}),W=M({name:[{required:!0,message:"请输入名称",trigger:"blur"}]}),X=async o=>{o&&await o.validate((t,_)=>{t?(console.log("submit!"),se()):console.log("error submit!",_)})},T=i(["video"]),Y=o=>{},x=i([]),Z=(o,t)=>{x.value.length=0};function ee(o){oe(o)}const k=i(!1);let E="",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);E=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:Q.value,videoAssetIds:E,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([]);P(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 L=i(null),F=i(null),c=i([]),le=i(""),b=i(!1),ae=M([]);function ie(){c.value=[],L.value=null}function j(o){return c.value.some(t=>t.id===o)}function ne(o){j(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}),L.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),B=i([]);return P(y,o=>{B.value=o},{deep:!0}),(o,t)=>{const _=n("el-input"),S=n("el-form-item"),p=n("el-button"),w=n("el-upload"),$=n("el-collapse-item"),ce=n("el-image"),q=n("el-tooltip"),z=n("el-card"),pe=n("el-collapse"),ue=n("el-scrollbar"),_e=n("el-form"),fe=n("el-dialog"),A=ge("loading");return u(),f("div",Se,[U((u(),R(z,{"body-style":"padding: 20px 80px 0 80px;"},{default:l(()=>[ze,a(_e,{ref_key:"ruleFormRef",ref:N,model:h,rules:W,"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}),U((u(),f("div",Ae,[e("div",Me,[a(ue,{height:"700px"},{default:l(()=>[a(pe,{modelValue:T.value,"onUpdate:modelValue":t[2]||(t[2]=s=>T.value=s),onChange:Y,style:{"border-top":"none","border-bottom":"none"}},{default:l(()=>[a($,{name:"video",style:{padding:"0 10px 0 5px"}},{title:l(()=>[Ue,r("视频 ")]),default:l(()=>[e("div",null,[e("div",De,[Ne,a(p,{type:"primary",link:""},{default:l(()=>[r("查看视频批准提示")]),_:1})]),Te,e("div",Ee,[U((u(),R(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":Z,class:"upload-demo"},{default:l(()=>[a(p,{type:"primary"},{default:l(()=>[r("上传文件")]),_:1})]),_:1},8,["file-list"])),[[A,k.value]])])])]),_:1}),e("div",Le,[je,a(p,{type:"primary",link:""},{default:l(()=>[r("了解更多")]),_:1})]),Be,$e,qe,a($,{name:"commodity",style:{padding:"0 10px 0 5px"}},{title:l(()=>[Ge,r("商品 ")]),default:l(()=>[(u(!0),f(O,null,K(D(y),s=>(u(),f("div",{key:s.asin},[a(z,{shadow:"hover","body-style":"padding: 10px"},{default:l(()=>[e("div",He,[e("div",Pe,[a(ce,{class:"img-box",src:s.image_link},null,8,["src"])]),e("div",Re,[a(q,{class:"box-item",effect:"dark",content:s.title,placement:"top"},{default:l(()=>[e("div",Oe,m(s.title),1)]),_:2},1032,["content"]),e("span",null,[Ke,e("span",Je,m(s.asin),1)])])])]),_:2},1024)]))),128))]),_:1})]),_:1},8,["modelValue"])]),_:1})]),e("div",Qe,[a(p,{type:"primary",plain:"",onClick:t[3]||(t[3]=s=>X(N.value)),disabled:!B.value.length&&D(y),style:{position:"absolute",top:"92%",left:"46%"}},{default:l(()=>[r("保存")]),_:1},8,["disabled"])])])),[[A,V.value]])]),_:1},8,["model","rules"])]),_:1})),[[A,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",We,[(u(!0),f(O,null,K(ae,s=>(u(),f("div",{class:ye(["grid-item",{selected:j(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(z,{"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,Ye),e("div",Ze,[e("span",null,[a(q,{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,Xe))),128))])]),_:1},8,["modelValue"])])}}});const ut=Fe(at,[["__scopeId","data-v-d6e58e2f"]]);export{ut as default};
|