/* empty css             *//* empty css                   *//* empty css                     *//* empty css                 */import{_ as e}from"./index-ec277c8c.js";import{_ as a}from"./index.vue_vue_type_script_setup_true_lang-e601cfd0.js";/* empty css                        *//* empty css                    *//* empty css               */import"./el-tooltip-4ed993c7.js";/* empty css                     *//* empty css                  */import{d as l,n as s,C as r,W as t,q as o,z as i,ao as u,o as d,c as m,e as n,a as p,w as v,H as c,t as _,b as f,f as y,Z as j,l as g,A as b,F as h,a7 as x,aa as w,X as V,ab as k,a5 as q,a6 as C,a0 as O,a2 as S,_ as z}from"./index-545c1a76.js";import{u as I}from"./useGetList-33a80877.js";import{u as N}from"./useOpen-ae3f1df9.js";import{c as U}from"./index-bf237e57.js";/* empty css                   *//* empty css                  *//* empty css                   */import"./index-b347df0b.js";/* empty css                  */import"./http-795fd5dc.js";const J={class:"flex flex-col justify-between w-full sm:flex-row",style:{width:"100%"}},P={class:"table-default",style:{width:"100%"}},A={id:"my-player",class:"video-js",controls:"",autoplay:"",preload:"auto",ref:"myVideo"},H=["src"],L={class:"flex justify-end"},F=z(l({__name:"detail",props:{primary:String|Number},setup(l){var z,F;const G=l,Q=s((()=>{var e,a,l;return(null==(a=null==(e=JSON.parse(r.get("nav_data")))?void 0:e.advertiser)?void 0:a.miniProgramIds)&&(null==(l=JSON.parse(r.get("nav_data")))?void 0:l.app)})),W=t(),X=o(),Z=o({}),$=o({}),B=o(!1),D=o(!1),{data:E,query:K,search:M,reset:R,loading:T}=I("videoStock/episode/list");N(),G.primary&&(K.value.video_id=G.primary.id,Z.value.video_id=G.primary.id,Z.value.miniprogram_id=null==(F=null==(z=JSON.parse(r.get("nav_data")))?void 0:z.advertiser)?void 0:F.miniProgramIds);const Y=s((()=>{var e;return null==(e=E.value)?void 0:e.data}));return i((()=>{M()})),(l,s)=>{const r=w,t=V,o=k,i=a,z=e,I=q,N=C,F=O,G=u("action"),E=S;return d(),m(h,null,[n("div",J,[n("div",P,[p(o,{data:y(Y),class:"w-full mt-3",style:{width:"100%"}},{default:v((()=>[p(r,{prop:"series_name",label:"章节名称"}),p(r,{prop:"is_charge",label:"是否付费"},{default:v((e=>[n("span",{class:c(e.row.is_charge?"text-red-600":"text-green-300")},_(e.row.is_charge?"【付费】":"【免费】"),3)])),_:1}),p(r,{prop:"duration_str",label:"章节时长"}),p(r,{label:"操作",width:"200"},{default:v((e=>[p(t,{link:"",type:"primary",size:"small",onClick:a=>{return l=e.row,$.value=l,void(B.value=!0);var l}},{default:v((()=>[f("播放")])),_:2},1032,["onClick"]),y(Q)?j((d(),g(t,{key:0,link:"",type:"primary",size:"small",onClick:a=>{return l=e.row,$.value=l,Z.value.series_sequence=l.series_sequence,void(D.value=!0);var l}},{default:v((()=>[f("创建推广链接")])),_:2},1032,["onClick"])),[[G,"tuiguang.Promotion.add"]]):b("",!0)])),_:1})])),_:1},8,["data"]),p(i)])]),p(z,{modelValue:B.value,"onUpdate:modelValue":s[0]||(s[0]=e=>B.value=e),title:"视频","destroy-on-close":"",height:"100%"},{default:v((()=>[n("video",A,[n("source",{src:$.value.public_video_url,type:"video/mp4"},null,8,H)],512)])),_:1},8,["modelValue"]),p(z,{modelValue:D.value,"onUpdate:modelValue":s[4]||(s[4]=e=>D.value=e),title:"创建推广链接","destroy-on-close":""},{default:v((()=>[j((d(),g(F,{model:Z.value,"label-width":"120px",ref_key:"form",ref:X,class:"pr-4"},{default:v((()=>[p(N,{label:"推广名称",prop:"name",rules:[{required:!0,message:"推广名称必须填写"}]},{default:v((()=>[p(I,{modelValue:Z.value.name,"onUpdate:modelValue":s[1]||(s[1]=e=>Z.value.name=e),name:"name",clearable:""},null,8,["modelValue"])])),_:1}),p(N,{label:"入口章节",prop:"series_sequence",rules:[{required:!1,message:"入口章节必须填写"}]},{default:v((()=>[p(I,{disabled:"",modelValue:$.value.series_name,"onUpdate:modelValue":s[2]||(s[2]=e=>$.value.series_name=e),name:"author",clearable:""},null,8,["modelValue"])])),_:1}),n("div",L,[p(t,{type:"primary",onClick:s[3]||(s[3]=e=>{return a=X.value,T.value=!0,void(a&&a.validate((e=>{e?U(Z.value).then((e=>{x.success(e.message),T.value=!1,D.value=!1,W.push({path:"/promotion/promotionList",query:{tab:0}})})):T.value=!1})).then((()=>{})));var a})},{default:v((()=>[f(_(l.$t("system.confirm")),1)])),_:1})])])),_:1},8,["model"])),[[E,y(T)]])])),_:1},8,["modelValue"])],64)}}}),[["__scopeId","data-v-31b8fb30"]]);export{F as default};
