CourseDetail.24dfbaaa.js 7.6 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["CourseDetail"],{"3a58":function(e,t,a){"use strict";a("a4bb")},"6e6e":function(e,t,a){"use strict";var s=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"mheader"},[a("header",{staticClass:"m-nav-header",class:[e.isFixed?"fixed":""]},[a("div",{directives:[{name:"show",rawName:"v-show",value:e.isBack,expression:"isBack"}],staticClass:"m-nav-bar__left",on:{click:e.goBack}},[a("van-icon",{staticClass:"arrow-left",attrs:{name:"arrow-left"}})],1),a("div",{staticClass:"m-nav-bar__title"},[e._t("default",(function(){return[e._v(e._s(e.name?e.name:e.$route.meta.descrition))]}))],2),a("div",{staticClass:"m-nav-bar__right"},[e._t("right")],2)])])},n=[],i={name:"mheader",props:{name:String,isBack:{type:Boolean,default:!0},isFixed:{type:Boolean,default:!0},backUrl:{type:Object,default:function(){return{callBack:null,path:"",params:{}}}}},methods:{goBack:function(){var e=this.backUrl;"function"==typeof e.callBack?e.callBack():e.path?this.$router.push({path:e.path,query:e.params}):history.go(-1)}}},l=i,c=(a("70bb"),a("2877")),r=Object(c["a"])(l,s,n,!1,null,"10a70108",null);t["a"]=r.exports},"70bb":function(e,t,a){"use strict";a("c905")},7121:function(e,t,a){e.exports=a.p+"img/icon_student.2f375f47.png"},a4bb:function(e,t,a){},c905:function(e,t,a){},e373:function(e,t,a){"use strict";a.r(t);var s=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"courseEvaluation"},[e.headerStatus?s("MHeader"):e._e(),s("van-cell-group",[s("van-cell",{attrs:{title:"课程班名称",value:e.teacherClassHeadInfo.classGroupName}})],1),s("van-cell-group",[s("van-cell",{attrs:{title:"课程时间",value:e.teacherClassHeadInfo.classTime}})],1),s("van-cell-group",[s("van-cell",{attrs:{title:"乐器",value:e.teacherClassHeadInfo.subjectNames}})],1),s("van-cell-group",[s("van-cell",{attrs:{title:"班级学员",value:e.teacherClassHeadInfo.studentNames}})],1),s("van-cell-group",[s("van-field",{staticClass:"textarea",attrs:{maxlength:"255",autosize:"",label:"教学内容",type:"textarea",readonly:e.teachingMaterialStatus,placeholder:"请输入1-255字"},model:{value:e.teachingMaterial,callback:function(t){e.teachingMaterial=t},expression:"teachingMaterial"}})],1),e.courseScheduleComplaints.length>0?s("div",[s("div",{staticClass:"title"},[e._v("学员评价")]),e._l(e.courseScheduleComplaints,(function(t,n){return s("div",{key:n,staticClass:"evaluation-item"},[s("div",{staticClass:"header"},[t.avatar?s("img",{attrs:{src:t.avatar,alt:""}}):s("img",{attrs:{src:a("7121"),alt:""}}),e._v("\n "+e._s(t.username)+"\n ")]),s("div",{staticClass:"rate"},[e._v("评价"),s("van-rate",{attrs:{readonly:"",size:20},model:{value:t.score,callback:function(a){e.$set(t,"score",a)},expression:"item.score"}})],1),s("div",{staticClass:"content"},[e._v("\n "+e._s(t.reason)+"\n ")])])}))],2):e._e(),s("div",{staticClass:"title",class:[e.courseScheduleComplaints.length>0?"teacher":""]},[e._v("老师评价")]),e.courseScheduleReviewList.length>0?s("div",e._l(e.courseScheduleReviewList,(function(t,n){return s("van-panel",{key:n},[s("div",{staticClass:"van-hairline--bottom",staticStyle:{display:"flex"},attrs:{slot:"header"},slot:"header"},[s("div",{staticClass:"header"},[t.studentAvatar?s("img",{attrs:{src:t.studentAvatar,alt:""}}):s("img",{attrs:{src:a("7121"),alt:""}}),e._v(e._s(t.studentName)+"\n ")])]),s("div",{staticClass:"content",attrs:{slot:"default"},slot:"default"},[e._v(e._s(t.memo))])])})),1):s("div",[s("van-cell",{attrs:{center:"",title:"是否对所有学生评价"}},[s("van-switch",{attrs:{slot:"right-icon"},slot:"right-icon",model:{value:e.checked,callback:function(t){e.checked=t},expression:"checked"}})],1),e.checked?s("van-panel",{staticClass:"evaluation-panel",attrs:{title:"评论给所有学生"}},[s("div",{attrs:{slot:"default"},slot:"default"},[s("van-field",{attrs:{rows:"3",maxlength:"255",autosize:"",type:"textarea",placeholder:"请输入1-255字"},model:{value:e.contentall,callback:function(t){e.contentall=t},expression:"contentall"}})],1)]):s("div",e._l(e.students,(function(t,n){return s("van-panel",{key:n,staticClass:"evaluation-panel"},[s("div",{staticClass:"van-hairline--bottom",staticStyle:{display:"flex","padding-left":".16rem"},attrs:{slot:"header"},slot:"header"},[s("div",{staticClass:"header"},[t.avatar?s("img",{attrs:{src:t.avatar,alt:""}}):s("img",{attrs:{src:a("7121"),alt:""}}),e._v("\n "+e._s(t.username)+"\n ")])]),s("div",{attrs:{slot:"default"},slot:"default"},[s("van-field",{attrs:{rows:"3",autosize:"",type:"textarea",placeholder:"请输入1-255字"},model:{value:t.content,callback:function(a){e.$set(t,"content",a)},expression:"item.content"}})],1)])})),1)],1),e.courseScheduleReviewList.length<=0?s("div",{staticClass:"button-group"},[s("van-button",{attrs:{type:"primary",round:"",size:"large"},on:{click:e.onSubmit}},[e._v("确认")])],1):e._e()],1)},n=[],i=a("6e6e"),l=a("b562"),c=a("ff51"),r={name:"courseEvaluation",components:{MHeader:i["a"]},data:function(){var e=this.$route.query;return{headerStatus:!1,checked:!0,courseId:e.courseId,teachingMaterial:null,teachingMaterialStatus:!1,teacherClassHeadInfo:{},courseScheduleReview:[],courseScheduleComplaints:[],courseScheduleReviewList:[],review4StudentIds:{},students:[],contentall:null}},mounted:function(){var e=this.$route.query;e.Authorization&&(localStorage.setItem("Authorization",decodeURI(e.Authorization)),localStorage.setItem("userInfo",decodeURI(e.Authorization))),Object(c["b"])().android||Object(c["b"])().iPhone?document.title="课程评价":this.headerStatus=!0,this.__init()},methods:{__init:function(){var e=this;this.$toast.loading({duration:0,message:"加载中...",forbidClick:!0,loadingType:"spinner"}),Object(l["f"])({courseId:this.courseId}).then((function(t){var a=t.data;if(e.$toast.clear(),200==a.code){var s=a.data;s&&(e.teachingMaterial=s.teachingMaterial,e.teachingMaterialStatus=!!s.teachingMaterial,e.teacherClassHeadInfo=s.teacherClassHeadInfo?s.teacherClassHeadInfo:{},e.teacherClassHeadInfo.classDate&&(e.teacherClassHeadInfo.classTime=e.teacherClassHeadInfo.classDate+" "+e.teacherClassHeadInfo.startClassTime+"-"+e.teacherClassHeadInfo.endClassTime),e.courseScheduleReview=s.courseScheduleReview?s.courseScheduleReview:[],e.courseScheduleComplaints=s.courseScheduleComplaints?s.courseScheduleComplaints:[],e.courseScheduleReviewList=s.courseScheduleReviewList?s.courseScheduleReviewList:[],e.review4StudentIds=s.review4StudentIds?s.review4StudentIds:{},e.students=s.students?s.students:[],s.students.forEach((function(e){e.content=null})))}else e.$toast(a.msg)}))},onSubmit:function(){var e=this,t=this.students,a=[];if(this.teachingMaterial)if(this.contentall||!this.checked){var s=!1;t.forEach((function(t){e.checked||t.content?a.push({memo:e.checked?e.contentall:t.content,courseScheduleId:e.courseId,studentId:t.id,teachingMaterial:e.teachingMaterial}):s=!0})),s?this.$toast("请输入学生评价"):(this.$toast.loading({duration:0,message:"加载中...",forbidClick:!0,loadingType:"spinner"}),Object(l["a"])(a).then((function(t){e.$toast.clear();var a=t.data;200==a.code?(e.$toast("评价成功"),setTimeout((function(){e.onSubmitStatus=!0,Object(c["b"])().iPhone?window.webkit.messageHandlers.DAYA.postMessage(JSON.stringify({api:"back"})):Object(c["b"])().android?DAYA.postMessage(JSON.stringify({api:"back"})):e.$router.push("/business")}),500)):e.$toast(a.msg)})))}else this.$toast("请输入学生评价");else this.$toast("请输入教学内容")}},destroyed:function(){this.$toast.clear()}},o=r,u=(a("3a58"),a("2877")),d=Object(u["a"])(o,s,n,!1,null,"cd66fdd2",null);t["default"]=d.exports}}]);