/* empty css *//* empty css */import{_ as e}from"./index-f7886619.js";/* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import{_ as a}from"./index.vue_vue_type_script_setup_true_lang-c7f1c9e0.js";/* empty css *//* empty css */import"./el-tooltip-4ed993c7.js";/* empty css *//* empty css *//* empty css */import{d as l,p as s,C as t,V as r,m as o,x as i,ao as d,o as u,c as n,a as m,w as p,e as c,t as v,b as _,z as f,Z as h,f as g,l as y,G as b,F as x,y as j,a7 as w,D as V,Q as k,aa as C,W as q,ab as S,v as U,a5 as F,a6 as N,A as O,B as z,a0 as G,a2 as J,R as P,S as I,_ as L}from"./index-102e7ef6.js";import{u as Q}from"./useGetList-35849544.js";import{u as R}from"./useOpen-79c9855d.js";import{c as A}from"./index-ffc4206a.js";import{f as B}from"./index-cd78e4bb.js";/* empty css */import"./index-ae7ffb15.js";import"./http-b9fe482c.js";const D=e=>(P("data-v-06ea923b"),e=e(),I(),e),M=D((()=>c("div",{class:"card-header"},[c("span",null,"简介")],-1))),T={class:"flex"},W={class:"flex items-center"},X={class:"text-lg font-bold text-blue-400"},Y={class:"ml-3"},Z={class:"font-bold"},$={class:"flex items-center mt-2"},E=D((()=>c("span",null," 集数: ",-1))),H={class:"flex items-center font-bold"},K={key:0},ee={class:""},ae=D((()=>c("span",null,"/",-1))),le={class:""},se={class:"mt-2"},te={class:"font-bold note"},re={class:"flex flex-col justify-between w-full sm:flex-row",style:{width:"100%"}},oe={class:"table-default",style:{width:"100%"}},ie={id:"my-player",class:"video-js",controls:"",autoplay:"",preload:"auto",ref:"myVideo"},de=["src"],ue=D((()=>c("div",{class:"flex items-center"},[c("span",{class:"mr-1 text-red-600"},"*"),_("充值模板配置 ")],-1))),ne={class:"flex flex-col"},me={class:"flex justify-end"},pe=L(l({__name:"detail",props:{primary:String|Number},setup(l){var P,I;const L=l,D=s((()=>{var e,a,l;return(null==(a=null==(e=JSON.parse(t.get("nav_data")))?void 0:e.advertiser)?void 0:a.miniProgramIds)&&(null==(l=JSON.parse(t.get("nav_data")))?void 0:l.app)})),pe=r(),ce=o(),ve=o({}),_e=o({}),fe=o(!1),he=o(!1),{data:ge,query:ye,search:be,reset:xe,loading:je}=Q("videoStock/episode/list");R();const we=o([]),Ve=o([]);L.primary&&(ye.value.video_id=L.primary.id,ve.value.video_id=L.primary.id,ve.value.miniprogram_id=null==(I=null==(P=JSON.parse(t.get("nav_data")))?void 0:P.app)?void 0:I.id);const ke=s((()=>{var e;return null==(e=ge.value)?void 0:e.data})),Ce=(e,a)=>{switch(a){case"firstCharge":Se("firstCharge",{name:e});break;case"notFirstCharge":Se("notFirstCharge",{name:e})}},qe=()=>{pe.push({path:"/chargeManage/charge"})},Se=(e,a)=>{switch(e){case"firstCharge":B({limit:666,type:1,...a}).then((e=>{we.value=e.data}));break;case"notFirstCharge":B({limit:666,type:2,...a}).then((e=>{Ve.value=e.data}))}};return i((()=>{be(),Se("firstCharge"),Se("notFirstCharge")})),(l,s)=>{const t=V,r=k,o=C,i=q,P=S,I=a,Q=U,R=F,B=N,ge=O,ye=z,be=G,xe=e,Se=d("action"),Ue=J;return u(),n(x,null,[m(r,{class:"box-card"},{header:p((()=>[M])),default:p((()=>[c("div",T,[c("div",null,[m(t,{class:"mr-2 rounded-sm",src:L.primary.cover_image,style:{width:"128px",height:"160px"},fit:"cover",lazy:!0},null,8,["src"])]),c("div",null,[c("div",W,[c("span",X,v(L.primary.name),1),c("div",Y,[_(" 剧号: "),c("span",Z,v(L.primary.id),1)])]),c("div",$,[E,c("div",H,[1==L.primary.update_type?(u(),n("div",K,[c("span",ee,v(L.primary.updated_episode_num),1),ae])):f("",!0),c("div",null,[c("span",le,v(L.primary.total_episode_num),1)]),c("span",null," 【 "+v(L.primary.update_type_str)+" 】 ",1)])]),c("div",se,[_(" 简介: "),c("span",te,v(L.primary.note),1)])])])])),_:1}),c("div",re,[c("div",oe,[h((u(),y(P,{data:g(ke),class:"w-full mt-3",style:{width:"100%"}},{default:p((()=>[m(o,{prop:"series_name",label:"章节名称"}),m(o,{prop:"is_charge",label:"是否付费"},{default:p((e=>[c("span",{class:b(e.row.is_charge?"text-red-600":"text-green-300")},v(e.row.is_charge?"【付费】":"【免费】"),3)])),_:1}),m(o,{prop:"duration_str",label:"章节时长"}),m(o,{label:"操作",width:"200"},{default:p((e=>[m(i,{link:"",type:"primary",size:"small",onClick:a=>{return l=e.row,_e.value=l,void(fe.value=!0);var l}},{default:p((()=>[_("播放")])),_:2},1032,["onClick"]),g(D)?h((u(),y(i,{key:0,link:"",type:"primary",size:"small",onClick:a=>{return l=e.row,_e.value=l,ve.value.series_sequence=l.series_sequence,void(he.value=!0);var l}},{default:p((()=>[_("创建推广链接")])),_:2},1032,["onClick"])),[[Se,"tuiguang.Promotion.add"]]):f("",!0)])),_:1})])),_:1},8,["data"])),[[Ue,g(je)]]),m(I)])]),m(Q,{draggable:"",modelValue:fe.value,"onUpdate:modelValue":s[0]||(s[0]=e=>fe.value=e),"align-center":"","append-to-body":"",width:"500px",center:"","show-close":!1,style:{background:"none","box-shadow":"none"},"destroy-on-close":""},{default:p((()=>[c("video",ie,[c("source",{src:_e.value.public_video_url,type:"video/mp4"},null,8,de)],512)])),_:1},8,["modelValue"]),m(xe,{modelValue:he.value,"onUpdate:modelValue":s[6]||(s[6]=e=>he.value=e),title:"创建推广链接","destroy-on-close":""},{default:p((()=>[h((u(),y(be,{model:ve.value,"label-width":"120px",ref_key:"form",ref:ce,class:"pr-4"},{default:p((()=>[m(B,{label:"推广名称",prop:"name",rules:[{required:!0,message:"推广名称必须填写"}]},{default:p((()=>[m(R,{modelValue:ve.value.name,"onUpdate:modelValue":s[1]||(s[1]=e=>ve.value.name=e),name:"name",clearable:""},null,8,["modelValue"])])),_:1}),m(B,{label:"入口章节",prop:"series_sequence",rules:[{required:!1,message:"入口章节必须填写"}]},{default:p((()=>[m(R,{disabled:"",modelValue:_e.value.series_name,"onUpdate:modelValue":s[2]||(s[2]=e=>_e.value.series_name=e),name:"author",clearable:""},null,8,["modelValue"])])),_:1}),m(B,{label:"充值模板配置"},{label:p((()=>[ue])),default:p((()=>[c("div",{class:"items-center w-full withdraw-popup-warn"},[c("div",null,[_("如果没有目标充值模板,请前往"),c("span",{class:"text-lg font-bold text-blue-400 cursor-pointer",onClick:qe},"充值管理"),_("进行添加")])]),c("div",ne,[c("div",null,[m(ye,{modelValue:ve.value.first_charge_template_id,"onUpdate:modelValue":s[3]||(s[3]=e=>ve.value.first_charge_template_id=e),filterable:"",remote:"",clearable:"","remote-method":e=>{Ce(e,"firstCharge")},placeholder:"请选择首充模板"},{default:p((()=>[(u(!0),n(x,null,j(we.value,((e,a)=>(u(),y(ge,{key:a,label:e.name,value:e.id},null,8,["label","value"])))),128))])),_:1},8,["modelValue","remote-method"])]),c("div",null,[m(ye,{modelValue:ve.value.not_first_charge_template_id,"onUpdate:modelValue":s[4]||(s[4]=e=>ve.value.not_first_charge_template_id=e),filterable:"",remote:"",clearable:"","remote-method":e=>{Ce(e,"notFirstCharge")},placeholder:"请选择非首充模板"},{default:p((()=>[(u(!0),n(x,null,j(Ve.value,((e,a)=>(u(),y(ge,{key:a,label:e.name,value:e.id},null,8,["label","value"])))),128))])),_:1},8,["modelValue","remote-method"])])])])),_:1}),c("div",me,[m(i,{type:"primary",onClick:s[5]||(s[5]=e=>{return a=ce.value,ve.value.first_charge_template_id?ve.value.not_first_charge_template_id?void(a&&a.validate((e=>{e&&A(ve.value).then((e=>{w.success(e.message),he.value=!1,pe.push({path:"/promotion/promotionList",query:{tab:0}})}))})).then((()=>{}))):w.error("请选择非首充模板"):w.error("请选择首充模板");var a})},{default:p((()=>[_(v(l.$t("system.confirm")),1)])),_:1})])])),_:1},8,["model"])),[[Ue,g(je)]])])),_:1},8,["modelValue"])],64)}}}),[["__scopeId","data-v-06ea923b"]]);export{pe as default};