!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?re:null]},[c("课程信息")])])}}),u(S,null,{default:function(){return u(o,null,[u(s,{name:ee.active>=2?ae("icon_plan_active.png"):ae("icon_plan_default.png"),size:24},null),u("span",{class:[ne,ee.active>=2?re:null]},[c("教学计划")])])}}),u(S,null,{default:function(){return u(o,null,[u(s,{name:ee.active>=3?ae("icon_arrange_active.png"):ae("icon_arrange_default.png"),size:24},null),u("span",{class:[ne,ee.active>=3?re:null]},[c("课程安排")])])}}),u(S,null,{default:function(){return u(o,null,[u(s,{name:ee.active>=4?ae("icon_start_active.png"):ae("icon_start_default.png"),size:24},null),u("span",{class:[ne,ee.active>=4?re:null]},[c("开课条件")])])}})]}})}}),ue="_classInfo_o3lf6_1",oe="_class-info-tip_o3lf6_1",se=function(e){return console.log(e),!(Number(e)<=0)||"课程组售价必须大于0"},ce=a({name:"course",data:function(){return{subjectStatus:!1,classTimeStatus:!1,checked:!1}},computed:{choiceSubjectIds:function(){var e=ee.live.subjectId?Number(ee.live.subjectId):null;return e?[e]:[]},subjectList:function(){return ee.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=ee.rate||0,t=ee.live.courseNum,n=ee.live.coursePrice||0;return t?(n/t*(1-e/100)).toFixed(2):0},calcRatePrice:function(){var e=ee.rate||0,t=ee.live.coursePrice||0;return(t-e/100*t).toFixed(2)},disabled:function(){return!!ee.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&&(ee.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){ee.live.subjectId=e,this.subjectStatus=!1},onFormatter:function(e){return L(e)},onFormatterInt:function(e){return e&&e>=1?x(e):""},onSelect:function(e){ee.live.singleCourseMinutes=Number(e.name||0)+Number(e.freeMinutes||0),ee.live.singleMins=Number(e.name||0),ee.live.freeMinutes=Number(e.freeMinutes||0)}},render:function(){var e=this;return u(N,{class:ue,onSubmit:function(){return ee.active=2},scrollToError:!0},{default:function(){return[u(P,null,{default:function(){return[u(T,{title:"课程名称",required:!0},{default:function(){return[u(C,{modelValue:ee.live.name,"onUpdate:modelValue":function(e){return ee.live.name=e},name:"name",maxlength:20,placeholder:"请输入您的课程名称",rules:[{required:!0,message:"请输入您的课程名称"}],disabled:e.disabled},null)]}}),u(T,{title:"课程声部",required:!0},{default:function(){return[u(C,{modelValue:e.lessonSubjectName,name:"subjectId",readonly:!0,isLink:!0,disabled:e.disabled,onClick:function(){ee.live.courseGroupId||(e.subjectStatus=!0)},rules:[{required:!0,message:"请选择课程声部"}],placeholder:"请选择课程声部"},null)]}}),u(T,{title:"课程介绍",required:!0,border:!1},{default:function(){return[u(C,{modelValue:ee.live.courseIntroduce,"onUpdate:modelValue":function(e){return ee.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(T,{title:"课时数",required:!0},{default:function(){return[u(C,{modelValue:ee.live.courseNum,"onUpdate:modelValue":function(e){return ee.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(T,{title:"单课时时长",required:!0},{default:function(){return[u(C,{modelValue:ee.live.singleMins,name:"singleMins",readonly:!0,disabled:e.disabled,isLink:!0,onClick:function(){ee.live.courseGroupId||(e.classTimeStatus=!0)},rules:[{required:!0,message:"请选择单课时时长"}],placeholder:"请选择单课时时长"},null)]}}),!e.checked&&u(T,{title:"课程组售价",required:!0},{default:function(){return[u(C,{modelValue:ee.live.coursePrice,"onUpdate:modelValue":function(e){return ee.live.coursePrice=e},name:"coursePrice",placeholder:"请输入您的课程组售价",formatter:e.onFormatter,type:"number",maxlength:8,disabled:e.disabled,rules:[{required:!0,validator:se,message:"请输入您的课程组售价"}]},{button:function(){return u("span",null,[c("元")])}})]}})]}}),u("div",{class:oe},[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(k,{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(_,{modelValue:e.subjectStatus,"onUpdate:modelValue":function(t){return e.subjectStatus=t}},{default:function(){return[u(w,{title:"选择声部"},null),u(D,{selectType:"Radio",single:!0,subjectList:ee.subjectList,choiceSubjectIds:e.choiceSubjectIds,onChoice:e.onChoice},null)]}}),u(j,{show:e.classTimeStatus,"onUpdate:show":function(t){return e.classTimeStatus=t},actions:ee.minutes,cancelText:"取消",closeOnClickAction:!0,onSelect:e.onSelect},null)]}})}}),le="_coursePlan_fxipm_1",de=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=ee.live.coursePlanList,r=n.length||0,console.log(n),!(ee.live.courseNum>r)){t.next=13;break}a=0;case 5:if(!(a=1?x(e):""},onConfirm:function(e){"start"===this.typeDateTime?(ee.live.salesStartDate=m(e).format("YYYY-MM-DD"),ee.live.salesEndDate&&m(ee.live.salesStartDate).isAfter(m(ee.live.salesEndDate))&&(ee.live.salesEndDate="")):"end"===this.typeDateTime&&(ee.live.salesEndDate=m(e).format("YYYY-MM-DD")),this.dateStatus=!1}},render:function(){var e=this;return u(N,{class:fe,onSubmit:function(){return ee.active=5},scrollToError:!0},{default:function(){return[u(P,null,{default:function(){return[u(T,{title:"开售日期",required:!0},{default:function(){return[u(C,{modelValue:ee.live.salesStartDate,"onUpdate:modelValue":function(e){return ee.live.salesStartDate=e},name:"salesStartDate",readonly:!0,isLink:!0,placeholder:"请选择开售日期",disabled:e.disabled,onClick:function(){ee.live.courseGroupId||(e.minDate=m().toDate(),e.currentDate=m(ee.live.salesStartDate).toDate(),e.typeDateTime="start",e.dateStatus=!0)},rules:[{required:!0,message:"请选择开售日期"}]},null)]}}),u(T,{title:"停售日期",required:!0},{default:function(){return[u(C,{modelValue:ee.live.salesEndDate,"onUpdate:modelValue":function(e){return ee.live.salesEndDate=e},name:"salesEndDate",readonly:!0,isLink:!0,disabled:e.disabled,onClick:function(){ee.live.courseGroupId||(e.minDate=m(ee.live.salesStartDate).toDate(),e.currentDate=m(ee.live.salesEndDate).toDate(),e.typeDateTime="end",e.dateStatus=!0)},rules:[{required:!0,message:"请选择停售日期"}],placeholder:"请选择停售日期"},null)]}})]}}),u(P,null,{default:function(){return[u(T,{title:"最低开课人数",required:!0,style:{marginBottom:"10px"}},{default:function(){return[u(C,{modelValue:ee.live.mixStudentNum,"onUpdate:modelValue":function(e){return ee.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:ge},[c("课程停售时付费学员达到该人数可开课,若未达到该人数课程将会失效,已付费学员将自动退款")])]}}),u(P,null,{default:function(){return[u(T,{required:!0,border:!1},{default:function(){return[u("p",{class:ve},[c("模板图片将作为该课程封面为学员展示")]),u(C,{name:"backgroundPic",border:!1,rules:[{required:!0,message:"请上传自定义模板"}]},{input:function(){return u(I,{justify:"space-between",style:{width:"100%"}},{default:function(){return[u(R,{span:12,class:pe},{default:function(){return[u(U,{cropper:!0,bucket:"live-rewind",options:{fixedNumber:[1.77,1],autoCropWidth:750,autoCropHeight:424},onUploadChange:function(e){e&&(ee.live.backgroundPicTemplate="")},modelValue:ee.live.backgroundPic,"onUpdate:modelValue":function(e){return ee.live.backgroundPic=e},class:pe},null)]}}),u(R,{span:24},{default:function(){return[u("p",{class:ve,style:{color:"#ff4e19",padding:"0"}},[c("图片尺寸为750*424能达到最佳显示效果")])]}})]}})}})]},title:function(){return u(B,{active:ee.tabIndex,"onUpdate:active":function(e){return ee.tabIndex=e},class:me,onChange:e.tabChange,shrink:!0,color:"var(--van-primary)",lineWidth:20},{default:function(){return[u(z,{title:"自定义模板",name:2},null)]}})}})]}}),u(k,{offsetBottom:0,position:"bottom"},{default:function(){return[u("div",{class:["btnGroup","btnMore"]},[u(f,{block:!0,round:!0,type:"primary",plain:!0,onClick:function(){ee.active=3,ee.live.courseGroupId||(ee.live.salesStartDate="",ee.live.salesEndDate="",ee.live.backgroundPic="",ee.live.backgroundPicTemplate="",ee.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(M,{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)]}})]}})}}),Ae={},ye=a({name:"detail",computed:{userInfo:function(){var e,t,n,r=ee.live.coursePlanList[0].startTime,a=ee.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:ee.live.coursePrice,lessonNum:ee.live.courseNum,lessonDesc:ee.live.courseIntroduce,lessonCoverUrl:ee.live.backgroundPic||ee.live.backgroundPicTemplate,lessonName:ee.live.name,auditVersion:0}},courseInfo:function(){var e=[];return(ee.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({},ee.live),{},{startTime:ee.live.coursePlanList[0].startTime,backgroundPic:ee.live.backgroundPic||ee.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(){ee.active=3,ee.selectCourseList=[],ee.live.salesStartDate="",ee.live.salesEndDate="",ee.live.mixStudentNum=null,ee.live.backgroundPic="",ee.live.backgroundPicTemplate="",ee.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:ee.live.courseGroupId},ee.live),{},{startTime:ee.live.coursePlanList[0].startTime,backgroundPic:ee.live.backgroundPic||ee.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:[Ae.detail]},[u(F,{userInfo:this.userInfo},null),u(Q,null,{default:function(){return[u("p",{class:Ae.introduction},[e.userInfo.lessonDesc])]}}),u(Q,{title:"课程安排",icon:"courseList",titleShow:!1,class:"mb12",contentStyle:{paddingTop:"0"}},{default:function(){return[u(E,{courseInfo:e.courseInfo},null)]}}),u(k,{offsetBottom:0,position:"bottom"},{default:function(){return[u("div",{class:["btnGroup","btnMore"]},[u(f,{block:!0,round:!0,type:"primary",plain:!0,onClick:function(){ee.active=4}},{default:function(){return[c("返回编辑")]}}),ee.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("创建成功")]}})])]}})])}}),he="_arrange_ci227_1",Se="_arrangeCell_ci227_4",Pe="_rTitle_ci227_10",Te="_rTag_ci227_26",_e="_tag_ci227_29",De="_selectPopup_ci227_33",je="_selectContainer_ci227_38",Oe="_selectPopupContent_ci227_44",Ce="_desc_ci227_47",ke="_times_ci227_48",Le="_selectBtn_ci227_59",xe="_btn_ci227_64",we=a({name:"arrange",data:function(){return{selectStatus:!1,calendarList:{},calendarDate:new Date}},computed:{showSelectList:function(){var t=e(ee.selectCourseList);return t.forEach((function(e){e.title=m(e.startTime).format("YYYY-MM-DD")+" "+y(m(e.startTime).day())+" "+e.start+"~"+e.end})),t},selectType:function(){return ee.selectCourseList.lengtht.startTime?1:e.startTime0)){t.next=7;break}return e.selectStatus=!1,ee.active=4,t.abrupt("return");case 7:return r=ee.coursePlanStatus,t.next=10,e._lookCourse((function(){r&&(e.selectStatus=!1,ee.active=4)}));case 10:case"end":return t.stop()}}),t)})))()}},render:function(){var e=this,t=this.$route.query.groupId;return u("div",{class:he},[u(o,null,t?[u(O,{class:[Se,"mb12"]},{title:function(){return u("div",{class:Pe},[u("span",null,[c("已选择课程时间")])])}}),ee.live.coursePlanList.map((function(e){return u(O,{title:"".concat(e.startTime," ~ ").concat(e.endTime)},null)})),u("div",{class:["mb12"]},null)]:[u(q,{selectList:ee.selectCourseList,list:this.calendarList,maxDays:ee.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(O,{class:[Se,"mb12"]},{title:function(){return u("div",{class:Pe},[u("span",null,[c("已选择课程时间")])])},label:function(){return u("div",{class:Te},[e.showSelectList.map((function(t){return u(o,null,[u(G,{plain:!0,round:!0,closeable:!0,size:"large",type:"primary",class:_e,onClose:function(){return e.onCloseTag(t)}},{default:function(){return[t.title]}}),u("br",null,null)])}))])}})]),u(k,{offsetBottom:0,position:"bottom"},{default:function(){return[u("div",{class:["btnGroup","btnMore"]},[u(f,{block:!0,round:!0,type:"primary",plain:!0,onClick:function(){ee.active=2,ee.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:De},{default:function(){return[u("div",{class:je},[u("div",{class:Pe},[u("span",null,[c("提示")])]),u("div",{class:Oe},[u("p",{class:Ce},["noEnough"!==e.selectType||ee.coursePlanStatus?"您已选择以下上课时间段,时间段会暂时锁定,锁定期间学员不可购买该时间段课程。":"您所选择的上课时间未达到您输入的课时数,系统根据已选时间将自动按周顺延排课。"]),ee.live.coursePlanList&&ee.live.coursePlanList.length>0&&ee.coursePlanStatus&&u("p",{class:ke},[ee.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:Le},[u(f,{class:xe,type:"primary",round:!0,block:!0,plain:!0,onClick:e.onReset},{default:function(){return["noEnough"===e.selectType?"继续选择":"重新选择"]}}),u(f,{class:xe,type:"primary",round:!0,block:!0,onClick:e.onSure},{default:function(){return[c("确认")]}})])])]}})])}}),Ne={};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}))})),ee.minutes=[].concat(n)}"live_service_rate"===e.paramName&&(ee.rate=e.paramValue)})),t.next=8,l.post("/api-teacher/teacher/querySubject");case 8:r=t.sent,ee.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,ee),200==r.code&&(i=r.data,ee.live.courseGroupId=i.courseGroupId,ee.live.teacherId=i.teacherId,ee.live.name=i.courseGroupName,ee.live.subjectId=(null===(a=ee.subjectList.find((function(e){return e.name===i.subjectName})))||void 0===a?void 0:a.id)||"",ee.live.courseIntroduce=i.courseIntroduce,ee.live.courseNum=i.courseNum,ee.live.singleMins=i.singleCourseMinutes,ee.live.coursePrice=i.coursePrice,ee.live.coursePlanList=i.planList,ee.live.salesStartDate=i.salesStartDate,ee.live.salesEndDate=i.salesEndDate,ee.live.mixStudentNum=i.mixStudentNum,ee.live.backgroundPic=i.backgroundPic);case 8:case"end":return t.stop()}}),t)})))()}},render:function(){return u("div",{class:Ne["live-create"]},[u(K,{position:"top"},{default:function(){return[u(w,{border:!1},null),5!==ee.active&&u(ie,{style:{backgroundColor:"#f6f8f9",paddingBottom:"12px"}},null)]}}),1===ee.active&&u(ce,null,null),2==ee.active&&u(de,null,null),3==ee.active&&u(we,null,null),4==ee.active&&u(be,null,null),5==ee.active&&u(ye,null,null)])}}))}}}))}();