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