| 1 |
- var v=Object.getOwnPropertySymbols;var B=Object.prototype.hasOwnProperty,S=Object.prototype.propertyIsEnumerable;var E=(t,l)=>{var u={};for(var a in t)B.call(t,a)&&l.indexOf(a)<0&&(u[a]=t[a]);if(t!=null&&v)for(var a of v(t))l.indexOf(a)<0&&S.call(t,a)&&(u[a]=t[a]);return u};import{C as I}from"./index.92a3d888.js";import{r as d}from"./index.b0469f01.js";import{r as L,d as p,c as e,F as b,m as x,n as r,k as i,f as m,a as o,O as F,P as T,T as A,q as k,t as h}from"./vendor.e6623967.js";import{C as w}from"./index.2625baa0.js";import{v as N}from"./toolsValidate.2c211d6c.js";const s=L({groupId:0,active:0,tabIndex:1,loadingStatus:!1,rate:0,subjectList:[],templateList:["https://daya.ks3-cn-beijing.ksyun.com/202204/T3unJdc.png","https://daya.ks3-cn-beijing.ksyun.com/202204/T3unJdl.png","https://daya.ks3-cn-beijing.ksyun.com/202204/T3unJdK.png","https://daya.ks3-cn-beijing.ksyun.com/202204/T3unJeA.png"],lessonGroup:{id:null,lessonName:"",lessonSubject:null,lessonDesc:"",lessonPrice:null,lessonCoverUrl:"",lessonCoverTemplateUrl:""},lessonList:[{videoTitle:"",videoContent:"",videoUrl:"",coverUrl:"",posterUrl:""}]});var G=p({name:"course-content",render(){return e(b,null,[e(x,{class:"px-[200px] pb-10 pt-7",size:"large",labelWidth:"90px",labelPosition:"left"},{default:()=>[e(r,{label:"\u8BFE\u7A0B\u540D\u79F0"},{default:()=>[e(i,{placeholder:"\u8BF7\u8F93\u5165\u8BFE\u7A0B\u540D\u79F0"},null)]})]}),e("div",{class:"border-t border-t-[#E5E5E5] text-center pt-6 pb-7"},[e(m,{class:"!w-40 !h-[38px]",onClick:()=>{s.active=1}},{default:()=>[o("\u4E0A\u4E00\u6B65")]}),e(m,{type:"primary",class:"!w-40 !h-[38px]",onClick:()=>{s.active=1}},{default:()=>[o("\u4E0B\u4E00\u6B65")]})])])}});function P(t){return typeof t=="function"||Object.prototype.toString.call(t)==="[object Object]"&&!A(t)}var V=p({name:"course-info",computed:{choiceSubjectIds(){let t=s.lessonGroup.lessonSubject?Number(s.lessonGroup.lessonSubject):null;return t?[t]:[]},subjectList(){return s.subjectList||[]},lessonSubjectName(){let t="";return this.subjectList.forEach(l=>{this.choiceSubjectIds.includes(l.id)&&(t=l.name)}),t},calcRatePrice(){let t=s.rate||0,l=s.lessonGroup.lessonPrice||0;return(l-t/100*l).toFixed(2)}},async mounted(){try{if(s.subjectList.length<=0){const t=await d.post("/api-website/teacher/querySubject");s.subjectList=t.data||[]}}catch{}},methods:{onFormatter(t){return N(t)},tabChange(t){this.$refs.form.resetValidation("lessonCoverTemplateUrl"),this.$refs.form.resetValidation("lessonCoverUrl"),s.tabIndex=t},selectImg(t){s.lessonGroup.lessonCoverUrl="",s.lessonGroup.lessonCoverTemplateUrl=t}},render(){let t;return e(b,null,[e(x,{class:"px-[200px] pb-10 pt-7",size:"large",labelWidth:"90px",labelPosition:"left"},{default:()=>[e(r,{label:"\u8BFE\u7A0B\u540D\u79F0"},{default:()=>[e(i,{placeholder:"\u8BF7\u8F93\u5165\u8BFE\u7A0B\u540D\u79F0"},null)]}),e(r,{label:"\u8BFE\u7A0B\u58F0\u90E8"},{default:()=>[e(F,{class:"w-full",placeholder:"\u8BF7\u9009\u62E9\u8BFE\u7A0B\u58F0\u90E8"},P(t=s.subjectList.map(l=>e(T,{value:l.id},{default:()=>[l.name]})))?t:{default:()=>[t]})]}),e(r,{label:"\u8BFE\u7A0B\u4ECB\u7ECD"},{default:()=>[e(i,{placeholder:"\u8BF7\u8F93\u5165\u8BFE\u7A0B\u4ECB\u7ECD",type:"textarea",maxlength:200,rows:4,showWordLimit:!0},null)]}),e(r,{label:"\u8BFE\u7A0B\u7EC4\u552E\u4EF7"},{default:()=>[e(i,{placeholder:"\u8BF7\u8F93\u5165\u8BFE\u7A0B\u7EC4\u552E\u4EF7",formatter:this.onFormatter},{append:()=>e("span",{class:"text-base text-[#333]"},[o("\u5143")])})]}),e("div",{class:"text-sm text-[#999] pl-[90px] leading-relaxed pb-2"},[e("p",null,[o("\u6263\u9664\u624B\u7EED\u8D39\u540E\u60A8\u7684\u8BFE\u7A0B\u9884\u8BA1\u6536\u5165\u4E3A\uFF1A ")]),e("p",null,[o("\u8BFE\u7A0B\u7EC4\u603B\u6536\u5165"),e("span",{class:"px-1 text-[#FF4E19]"},[this.calcRatePrice]),o("\u5143/\u4EBA")]),e("p",null,[o("\u60A8\u7684\u8BFE\u7A0B\u6536\u5165\u5C06\u5728\u8BFE\u7A0B\u7ED3\u675F\u540E\u7ED3\u7B97\u5230\u60A8\u7684\u8D26\u6237\u4E2D ")])]),e(r,{label:"\u8BFE\u7A0B\u5C01\u9762",class:"!mb-0"},{default:()=>[e(k,{modelValue:s.tabIndex,"onUpdate:modelValue":l=>s.tabIndex=l},{default:()=>[e(h,{label:"\u56FE\u7247\u6A21\u677F",name:1},null),e(h,{label:"\u81EA\u5B9A\u4E49\u6A21\u677F",name:2},null)]})]}),e(r,null,{default:()=>[e(w,null,null)]})]}),e("div",{class:"border-t border-t-[#E5E5E5] text-center pt-6 pb-7"},[e(m,{type:"primary",class:"!w-40 !h-[38px]",onClick:()=>{s.active=1}},{default:()=>[o("\u4E0B\u4E00\u6B65")]})])])}}),R=p({name:"video-operation",props:{type:{type:String,default:"create"}},async created(){const t=this.$route.query;if(s.groupId=Number(t.groupId)||0,!s.groupId)return!1;try{s.loadingStatus=!0;const a=(await d.get("/api-website/videoLessonGroup/selectVideoLesson",{params:{groupId:s.groupId}})).data,l=a.lessonGroup,{auditStatus:D,lessonCoverUrl:c,lessonPrice:g,lessonDesc:y,lessonSubject:C,lessonName:j,id:U}=l,q=E(l,["auditStatus","lessonCoverUrl","lessonPrice","lessonDesc","lessonSubject","lessonName","id"]);let f=!!s.templateList.includes(c);s.lessonGroup={id:U,lessonName:j,lessonSubject:C,lessonDesc:y,lessonPrice:g,lessonCoverTemplateUrl:f?c:"",lessonCoverUrl:f?"":c},s.lessonList=[],a.detailList&&a.detailList.forEach(n=>{s.lessonList.push({videoTitle:n.videoTitle,videoContent:n.videoContent,videoUrl:n.videoUrl,coverUrl:n.coverUrl,posterUrl:n.posterUrl})}),s.loadingStatus=!1}catch{}s.lessonGroup.lessonCoverUrl&&!s.templateList.includes(s.lessonGroup.lessonCoverUrl)?s.tabIndex=2:s.tabIndex=1},async mounted(){try{const t=await d.get("/api-website/sysConfig/queryByParamName",{params:{paramName:"video_lesson_service_fee"}});s.rate=t.data.paramValue}catch{}},render(){return e(b,null,[e("div",{class:"text-base text-[#333] leading-none px-6 py-5 border-b border-b-[#E5E5E5]"},[this.type==="create"?"\u65B0\u5EFA\u89C6\u9891\u8BFE":"\u7F16\u8F91\u89C6\u9891\u8BFE"]),e("div",{class:"pt-12"},[e(I,{class:"px-[200px]",type:"large",active:s.active},null),s.active===0&&e(V,null,null),s.active===1&&e(G,null,null)])])}});export{R as default};
|