!function(){function e(e){return function(e){if(Array.isArray(e))return t(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,n){if(!e)return;if("string"==typeof e)return t(e,n);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return t(e,n)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function t(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=1?te:null]},[c("课程信息")])])}}),u(S,null,{default:function(){return u(o,null,[u(s,{name:W.active>=2?ne("icon_plan_active.png"):ne("icon_plan_default.png"),size:24},null),u("span",{class:[ee,W.active>=2?te:null]},[c("教学计划")])])}}),u(S,null,{default:function(){return u(o,null,[u(s,{name:W.active>=3?ne("icon_arrange_active.png"):ne("icon_arrange_default.png"),size:24},null),u("span",{class:[ee,W.active>=3?te:null]},[c("课程安排")])])}}),u(S,null,{default:function(){return u(o,null,[u(s,{name:W.active>=4?ne("icon_start_active.png"):ne("icon_start_default.png"),size:24},null),u("span",{class:[ee,W.active>=4?te:null]},[c("开课条件")])])}})]}})}}),ae="_classInfo_o3lf6_1",ie="_class-info-tip_o3lf6_1",ue=function(e){return console.log(e),!(Number(e)<=0)||"课程组售价必须大于0"},oe=a({name:"course",data:function(){return{subjectStatus:!1,classTimeStatus:!1,checked:!1}},computed:{choiceSubjectIds:function(){var e=W.live.subjectId?Number(W.live.subjectId):null;return e?[e]:[]},subjectList:function(){return W.subjectList||[]},lessonSubjectName:function(){var e=this,t="";return this.subjectList.forEach((function(n){e.choiceSubjectIds.includes(n.id)&&(t=n.name)})),t},calcSingleRatePrice:function(){var e=W.rate||0,t=W.live.courseNum,n=W.live.coursePrice||0;return t?(n/t*(1-e/100)).toFixed(2):0},calcRatePrice:function(){var e=W.rate||0,t=W.live.coursePrice||0;return(t-e/100*t).toFixed(2)},disabled:function(){return!!W.live.courseGroupId}},mounted:function(){var e=this;return r(regeneratorRuntime.mark((function t(){var n;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,l.post("/api-teacher/open/appVersion",{data:{platform:"STUDENT"===d.platformType?"ios-student":"ios-teacher",version:d.version}});case 3:n=t.sent,e.checked=!!n.data.check,e.checked&&(W.live.coursePrice=0),t.next=10;break;case 8:t.prev=8,t.t0=t.catch(0);case 10:case"end":return t.stop()}}),t,null,[[0,8]])})))()},methods:{onChoice:function(e){W.live.subjectId=e,this.subjectStatus=!1},onFormatter:function(e){return L(e)},onFormatterInt:function(e){return e&&e>=1?x(e):""},onSelect:function(e){W.live.singleCourseMinutes=Number(e.name||0)+Number(e.freeMinutes||0),W.live.singleMins=Number(e.name||0),W.live.freeMinutes=Number(e.freeMinutes||0)}},render:function(){var e=this;return u(w,{class:ae,onSubmit:function(){return W.active=2},scrollToError:!0},{default:function(){return[u(P,null,{default:function(){return[u(_,{title:"课程名称",required:!0},{default:function(){return[u(O,{modelValue:W.live.name,"onUpdate:modelValue":function(e){return W.live.name=e},name:"name",maxlength:20,placeholder:"请输入您的课程名称",rules:[{required:!0,message:"请输入您的课程名称"}],disabled:e.disabled},null)]}}),u(_,{title:"课程声部",required:!0},{default:function(){return[u(O,{modelValue:e.lessonSubjectName,name:"subjectId",readonly:!0,isLink:!0,disabled:e.disabled,onClick:function(){W.live.courseGroupId||(e.subjectStatus=!0)},rules:[{required:!0,message:"请选择课程声部"}],placeholder:"请选择课程声部"},null)]}}),u(_,{title:"课程介绍",required:!0,border:!1},{default:function(){return[u(O,{modelValue:W.live.courseIntroduce,"onUpdate:modelValue":function(e){return W.live.courseIntroduce=e},name:"courseIntroduce",placeholder:"请输入课程介绍",rows:"3",maxlength:200,showWordLimit:!0,autosize:!0,rules:[{required:!0,message:"请输入课程介绍"}],type:"textarea"},null)]}})]}}),u(P,null,{default:function(){return[u(_,{title:"课时数",required:!0},{default:function(){return[u(O,{modelValue:W.live.courseNum,"onUpdate:modelValue":function(e){return W.live.courseNum=e},name:"courseNum",placeholder:"请输入您的课时数",formatter:e.onFormatterInt,type:"number",maxlength:2,disabled:e.disabled,rules:[{required:!0,message:"请输入您的课时数"}]},{button:function(){return u("span",null,[c("课时")])}})]}}),u(_,{title:"单课时时长",required:!0},{default:function(){return[u(O,{modelValue:W.live.singleMins,name:"singleMins",readonly:!0,disabled:e.disabled,isLink:!0,onClick:function(){W.live.courseGroupId||(e.classTimeStatus=!0)},rules:[{required:!0,message:"请选择单课时时长"}],placeholder:"请选择单课时时长"},null)]}}),!e.checked&&u(_,{title:"课程组售价",required:!0},{default:function(){return[u(O,{modelValue:W.live.coursePrice,"onUpdate:modelValue":function(e){return W.live.coursePrice=e},name:"coursePrice",placeholder:"请输入您的课程组售价",formatter:e.onFormatter,type:"number",maxlength:8,disabled:e.disabled,rules:[{required:!0,validator:ue,message:"请输入您的课程组售价"}]},{button:function(){return u("span",null,[c("元")])}})]}})]}}),u("div",{class:ie},[u("p",null,[c("扣除手续费后您的课程预计收入为:")]),u("p",null,[c("单课时"),u("span",null,[e.calcSingleRatePrice]),c("元/人")]),u("p",null,[c("课程组总收入"),u("span",null,[e.calcRatePrice]),c("元/人")]),u("p",null,[c("您的课程收入将在课程结束后结算到您的账户中")])]),u(C,{offsetBottom:0,position:"bottom"},{default:function(){return[u("div",{class:"btnGroup"},[u(f,{block:!0,round:!0,type:"primary","native-type":"submit"},{default:function(){return[c("下一步")]}})])]}}),u(T,{modelValue:e.subjectStatus,"onUpdate:modelValue":function(t){return e.subjectStatus=t}},{default:function(){return[u(D,{selectType:"Radio",single:!0,subjectList:W.subjectList,choiceSubjectIds:e.choiceSubjectIds,onChoice:e.onChoice},null)]}}),u(k,{show:e.classTimeStatus,"onUpdate:show":function(t){return e.classTimeStatus=t},actions:W.minutes,cancelText:"取消",closeOnClickAction:!0,onSelect:e.onSelect},null)]}})}}),se="_coursePlan_fxipm_1",ce=a({name:"course-plan",data:function(){return{}},mounted:function(){var e=this;return r(regeneratorRuntime.mark((function t(){var n,r,a,i;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=W.live.coursePlanList,r=n.length||0,console.log(n),!(W.live.courseNum>r)){t.next=13;break}a=0;case 5:if(!(a=1?x(e):""},onConfirm:function(e){"start"===this.typeDateTime?(W.live.salesStartDate=m(e).format("YYYY-MM-DD"),W.live.salesEndDate&&m(W.live.salesStartDate).isAfter(m(W.live.salesEndDate))&&(W.live.salesEndDate="")):"end"===this.typeDateTime&&(W.live.salesEndDate=m(e).format("YYYY-MM-DD")),this.dateStatus=!1}},render:function(){var e=this;return u(w,{class:le,onSubmit:function(){return W.active=5},scrollToError:!0},{default:function(){return[u(P,null,{default:function(){return[u(_,{title:"开售日期",required:!0},{default:function(){return[u(O,{modelValue:W.live.salesStartDate,"onUpdate:modelValue":function(e){return W.live.salesStartDate=e},name:"salesStartDate",readonly:!0,isLink:!0,placeholder:"请选择开售日期",disabled:e.disabled,onClick:function(){W.live.courseGroupId||(e.minDate=m().toDate(),e.currentDate=m(W.live.salesStartDate).toDate(),e.typeDateTime="start",e.dateStatus=!0)},rules:[{required:!0,message:"请选择开售日期"}]},null)]}}),u(_,{title:"停售日期",required:!0},{default:function(){return[u(O,{modelValue:W.live.salesEndDate,"onUpdate:modelValue":function(e){return W.live.salesEndDate=e},name:"salesEndDate",readonly:!0,isLink:!0,disabled:e.disabled,onClick:function(){W.live.courseGroupId||(e.minDate=m(W.live.salesStartDate).toDate(),e.currentDate=m(W.live.salesEndDate).toDate(),e.typeDateTime="end",e.dateStatus=!0)},rules:[{required:!0,message:"请选择停售日期"}],placeholder:"请选择停售日期"},null)]}})]}}),u(P,null,{default:function(){return[u(_,{title:"最低开课人数",required:!0,style:{marginBottom:"10px"}},{default:function(){return[u(O,{modelValue:W.live.mixStudentNum,"onUpdate:modelValue":function(e){return W.live.mixStudentNum=e},name:"mixStudentNum",placeholder:"请输入最低开课人数",type:"number",maxlength:8,disabled:e.disabled,formatter:e.onFormatterInt,rules:[{required:!0,message:"请输入最低开课人数"}]},{button:function(){return u("span",null,[c("人")])}})]}}),u("div",{class:ve},[c("课程停售时付费学员达到该人数可开课,若未达到该人数课程将会失效,已付费学员将自动退款")])]}}),u(P,null,{default:function(){return[u(_,{required:!0,border:!1},{default:function(){return[u("p",{class:fe},[c("模板图片将作为该课程封面为学员展示")]),u(O,{name:"backgroundPic",border:!1,rules:[{required:!0,message:"请上传自定义模板"}]},{input:function(){return u(N,{justify:"space-between",style:{width:"100%"}},{default:function(){return[u(I,{span:12,class:me},{default:function(){return[u(z,{cropper:!0,bucket:"live-rewind",options:{fixedNumber:[1.77,1],autoCropWidth:750,autoCropHeight:424},onUploadChange:function(e){e&&(W.live.backgroundPicTemplate="")},modelValue:W.live.backgroundPic,"onUpdate:modelValue":function(e){return W.live.backgroundPic=e},class:me},null)]}}),u(I,{span:24},{default:function(){return[u("p",{class:fe,style:{color:"#ff4e19",padding:"0"}},[c("图片尺寸为750*424能达到最佳显示效果")])]}})]}})}})]},title:function(){return u(R,{active:W.tabIndex,"onUpdate:active":function(e){return W.tabIndex=e},class:de,onChange:e.tabChange,shrink:!0,color:"var(--van-primary)",lineWidth:20},{default:function(){return[u(B,{title:"自定义模板",name:2},null)]}})}})]}}),u(C,{offsetBottom:0,position:"bottom"},{default:function(){return[u("div",{class:["btnGroup","btnMore"]},[u(f,{block:!0,round:!0,type:"primary",plain:!0,onClick:function(){W.active=3,W.live.courseGroupId||(W.live.salesStartDate="",W.live.salesEndDate="",W.live.backgroundPic="",W.live.backgroundPicTemplate="",W.live.mixStudentNum=null)}},{default:function(){return[c("上一步")]}}),u(f,{block:!0,round:!0,type:"primary","native-type":"submit"},{default:function(){return[c("下一步")]}})])]}}),u(v,{show:e.dateStatus,position:"bottom",round:!0},{default:function(){return[u(U,{type:"date",modelValue:e.currentDate,"onUpdate:modelValue":function(t){return e.currentDate=t},minDate:e.minDate,maxDate:e.maxDate,formatter:p,onCancel:function(){e.dateStatus=!1},onConfirm:e.onConfirm},null)]}})]}})}}),ge={},be=a({name:"detail",computed:{userInfo:function(){var e,t,n,r=W.live.coursePlanList[0].startTime,a=W.live.coursePlanList[0].endTime;return{headUrl:null===(e=d.user.data)||void 0===e?void 0:e.heardUrl,username:(null===(t=d.user.data)||void 0===t?void 0:t.username)||"游客".concat((null===(n=d.user.data)||void 0===n?void 0:n.userId)||""),startTime:"".concat(m(r).format("YYYY-MM-DD")," ").concat(m(r).format("HH:mm"),"~").concat(m(a).format("HH:mm"))||"",buyNum:0,lessonPrice:W.live.coursePrice,lessonNum:W.live.courseNum,lessonDesc:W.live.courseIntroduce,lessonCoverUrl:W.live.backgroundPic||W.live.backgroundPicTemplate,lessonName:W.live.name,auditVersion:0}},courseInfo:function(){var e=[];return(W.live.coursePlanList||[]).forEach((function(t){e.push({courseTime:"".concat(m(t.startTime).format("YYYY-MM-DD")," ").concat(m(t.startTime).format("HH:mm"),"~").concat(m(t.endTime).format("HH:mm")),roomUid:t.roomUid,liveState:t.liveState,coursePlan:t.plan,id:t.courseId})})),e||[]}},methods:{onSubmit:function(){return r(regeneratorRuntime.mark((function e(){var t,n,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,n=i(i({},W.live),{},{startTime:W.live.coursePlanList[0].startTime,backgroundPic:W.live.backgroundPic||W.live.backgroundPicTemplate,teacherId:null===(t=d.user.data)||void 0===t?void 0:t.userId}),e.next=4,l.post("/api-teacher/courseGroup/addLiveCourse",{data:n});case 4:g.success("创建成功"),setTimeout((function(){b({api:"back"})}),1e3),e.next=12;break;case 8:e.prev=8,e.t0=e.catch(0),r=e.t0.message,A.alert({title:"提示",confirmButtonColor:"var(--van-primary)",message:r}).then((function(){W.active=3,W.selectCourseList=[],W.live.salesStartDate="",W.live.salesEndDate="",W.live.mixStudentNum=null,W.live.backgroundPic="",W.live.backgroundPicTemplate="",W.coursePlanStatus=!1}));case 12:case"end":return e.stop()}}),e,null,[[0,8]])})))()},onUpdate:function(){return r(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=i(i({id:W.live.courseGroupId},W.live),{},{startTime:W.live.coursePlanList[0].startTime,backgroundPic:W.live.backgroundPic||W.live.backgroundPicTemplate}),console.log(i({},t)),e.next=4,l.post("/api-teacher/courseGroup/updateLiveCourse",{data:t});case 4:g({type:"success",message:"编辑成功",duration:1e3,onClose:function(){b({api:"back"})}});case 5:case"end":return e.stop()}}),e)})))()}},render:function(){var e=this;return u("div",{class:[ge.detail]},[u(Q,{userInfo:this.userInfo},null),u(E,null,{default:function(){return[u("p",{class:ge.introduction},[e.userInfo.lessonDesc])]}}),u(E,{title:"课程安排",icon:"courseList",titleShow:!1,class:"mb12",contentStyle:{paddingTop:"0"}},{default:function(){return[u(M,{courseInfo:e.courseInfo},null)]}}),u(C,{offsetBottom:0,position:"bottom"},{default:function(){return[u("div",{class:["btnGroup","btnMore"]},[u(f,{block:!0,round:!0,type:"primary",plain:!0,onClick:function(){W.active=4}},{default:function(){return[c("返回编辑")]}}),W.live.courseGroupId?u(f,{block:!0,round:!0,type:"primary",onClick:e.onUpdate},{default:function(){return[c("确认修改")]}}):u(f,{block:!0,round:!0,type:"primary",onClick:e.onSubmit},{default:function(){return[c("创建成功")]}})])]}})])}}),Ae="_arrange_ci227_1",he="_arrangeCell_ci227_4",ye="_rTitle_ci227_10",Se="_rTag_ci227_26",Pe="_tag_ci227_29",_e="_selectPopup_ci227_33",Te="_selectContainer_ci227_38",De="_selectPopupContent_ci227_44",ke="_desc_ci227_47",je="_times_ci227_48",Oe="_selectBtn_ci227_59",Ce="_btn_ci227_64",Le=a({name:"arrange",data:function(){return{selectStatus:!1,calendarList:{},calendarDate:new Date}},computed:{showSelectList:function(){var t=e(W.selectCourseList);return t.forEach((function(e){e.title=m(e.startTime).format("YYYY-MM-DD")+" "+h(m(e.startTime).day())+" "+e.start+"~"+e.end})),t},selectType:function(){return W.selectCourseList.lengtht.startTime?1:e.startTime0)){t.next=7;break}return e.selectStatus=!1,W.active=4,t.abrupt("return");case 7:return r=W.coursePlanStatus,t.next=10,e._lookCourse((function(){r&&(e.selectStatus=!1,W.active=4)}));case 10:case"end":return t.stop()}}),t)})))()}},render:function(){var e=this,t=this.$route.query.groupId;return u("div",{class:Ae},[u(o,null,t?[u(j,{class:[he,"mb12"]},{title:function(){return u("div",{class:ye},[u("span",null,[c("已选择课程时间")])])}}),W.live.coursePlanList.map((function(e){return u(j,{title:"".concat(e.startTime," ~ ").concat(e.endTime)},null)})),u("div",{class:["mb12"]},null)]:[u(F,{selectList:W.selectCourseList,list:this.calendarList,maxDays:W.live.courseNum||0,nextMonth:function(t){return e.getList(t)},prevMonth:function(t){return e.getList(t)},selectDay:this.onSelectDay,calendarDate:this.calendarDate,"onUpdate:calendarDate":function(t){return e.calendarDate=t}},null),u(j,{class:[he,"mb12"]},{title:function(){return u("div",{class:ye},[u("span",null,[c("已选择课程时间")])])},label:function(){return u("div",{class:Se},[e.showSelectList.map((function(t){return u(o,null,[u(q,{plain:!0,round:!0,closeable:!0,size:"large",type:"primary",class:Pe,onClose:function(){return e.onCloseTag(t)}},{default:function(){return[t.title]}}),u("br",null,null)])}))])}})]),u(C,{offsetBottom:0,position:"bottom"},{default:function(){return[u("div",{class:["btnGroup","btnMore"]},[u(f,{block:!0,round:!0,type:"primary",plain:!0,onClick:function(){W.active=2,W.selectCourseList=[]}},{default:function(){return[c("上一步")]}}),u(f,{block:!0,round:!0,type:"primary",onClick:e.onSubmit},{default:function(){return[c("下一步")]}})])]}}),u(v,{show:this.selectStatus,class:_e},{default:function(){return[u("div",{class:Te},[u("div",{class:ye},[u("span",null,[c("提示")])]),u("div",{class:De},[u("p",{class:ke},["noEnough"!==e.selectType||W.coursePlanStatus?"您已选择以下上课时间段,时间段会暂时锁定,锁定期间学员不可购买该时间段课程。":"您所选择的上课时间未达到您输入的课时数,系统根据已选时间将自动按周顺延排课。"]),W.live.coursePlanList&&W.live.coursePlanList.length>0&&W.coursePlanStatus&&u("p",{class:je},[W.live.coursePlanList.map((function(e){return u("span",null,[m(e.startTime||new Date).format("YYYY-MM-DD")," ",m(e.startTime||new Date).format("HH:mm"),c("~"),m(e.endTime||new Date).format("HH:mm")])}))])]),u("div",{class:Oe},[u(f,{class:Ce,type:"primary",round:!0,block:!0,plain:!0,onClick:e.onReset},{default:function(){return["noEnough"===e.selectType?"继续选择":"重新选择"]}}),u(f,{class:Ce,type:"primary",round:!0,block:!0,onClick:e.onSure},{default:function(){return[c("确认")]}})])])]}})])}}),xe="_live-create_1ip6h_1";t("default",a({name:"LiveCreate",mounted:function(){var e=this;return r(regeneratorRuntime.mark((function t(){var n,r;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,l.get("/api-teacher/sysConfig/queryByParamNameList",{params:{paramNames:"live_service_rate,live_time_setting"}});case 3:return n=t.sent,(n.data||[]).forEach((function(e){if("live_time_setting"===e.paramName){var t=e.paramValue?JSON.parse(e.paramValue):[],n=[];t.forEach((function(e){n.push(i(i({},e),{},{name:e.courseMinutes}))})),W.minutes=[].concat(n)}"live_service_rate"===e.paramName&&(W.rate=e.paramValue)})),t.next=8,l.post("/api-teacher/teacher/querySubject");case 8:r=t.sent,W.subjectList=r.data||[],t.next=15;break;case 12:t.prev=12,t.t0=t.catch(0),console.log(t.t0);case 15:e.getLiveClassDetail();case 16:case"end":return t.stop()}}),t,null,[[0,12]])})))()},methods:{getLiveClassDetail:function(){var e=this;return r(regeneratorRuntime.mark((function t(){var n,r,a,i;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=e.$route.query.groupId){t.next=3;break}return t.abrupt("return");case 3:return t.next=5,l.get("/api-teacher/courseGroup/queryLiveCourseInfo?groupId=".concat(n));case 5:r=t.sent,console.log(r,W),200==r.code&&(i=r.data,W.live.courseGroupId=i.courseGroupId,W.live.teacherId=i.teacherId,W.live.name=i.courseGroupName,W.live.subjectId=(null===(a=W.subjectList.find((function(e){return e.name===i.subjectName})))||void 0===a?void 0:a.id)||"",W.live.courseIntroduce=i.courseIntroduce,W.live.courseNum=i.courseNum,W.live.singleMins=i.singleCourseMinutes,W.live.coursePrice=i.coursePrice,W.live.coursePlanList=i.planList,W.live.salesStartDate=i.salesStartDate,W.live.salesEndDate=i.salesEndDate,W.live.mixStudentNum=i.mixStudentNum,W.live.backgroundPic=i.backgroundPic);case 8:case"end":return t.stop()}}),t)})))()}},render:function(){return u("div",{class:xe},[5!==W.active&&u(C,{position:"top",offsetTop:0},{default:function(){return[u(re,{style:{backgroundColor:"#f6f8f9",paddingBottom:"12px"}},null)]}}),1===W.active&&u(oe,null,null),2==W.active&&u(ce,null,null),3==W.active&&u(Le,null,null),4==W.active&&u(pe,null,null),5==W.active&&u(be,null,null)])}}))}}}))}();