1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["CourseDetail"],{"04a4":function(t,e,a){"use strict";a("3761")},3761:function(t,e,a){},"3a58":function(t,e,a){"use strict";a("a4bb")},"6e6e":function(t,e,a){"use strict";var r=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"mheader",style:{height:"calc("+t.titleHeight+"px + "+t.navBarHeight+"px)"}},[a("header",{staticClass:"m-nav-header",class:[t.isFixed?"fixed":""],style:[t.headStyle]},[a("div",{directives:[{name:"show",rawName:"v-show",value:t.isBack,expression:"isBack"}],staticClass:"m-nav-bar__left",on:{click:t.goBack}},[a("van-icon",{staticClass:"arrow-left",attrs:{name:"arrow-left"}})],1),a("div",{staticClass:"m-nav-bar__title"},[t._t("default",(function(){return[t._v(t._s(t.name?t.name:this.$route.meta.descrition))]}))],2),a("div",{staticClass:"m-nav-bar__right"},[t._t("right")],2)])])},n=[],i=a("ddf4");function o(t){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}function s(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */s=function(){return t};var t={},e=Object.prototype,a=e.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",i=r.asyncIterator||"@@asyncIterator",c=r.toStringTag||"@@toStringTag";function l(t,e,a){return Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(H){l=function(t,e,a){return t[e]=a}}function u(t,e,a,r){var n=e&&e.prototype instanceof f?e:f,i=Object.create(n.prototype),o=new C(r||[]);return i._invoke=function(t,e,a){var r="suspendedStart";return function(n,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===n)throw i;return L()}for(a.method=n,a.arg=i;;){var o=a.delegate;if(o){var s=x(o,a);if(s){if(s===d)continue;return s}}if("next"===a.method)a.sent=a._sent=a.arg;else if("throw"===a.method){if("suspendedStart"===r)throw r="completed",a.arg;a.dispatchException(a.arg)}else"return"===a.method&&a.abrupt("return",a.arg);r="executing";var c=h(t,e,a);if("normal"===c.type){if(r=a.done?"completed":"suspendedYield",c.arg===d)continue;return{value:c.arg,done:a.done}}"throw"===c.type&&(r="completed",a.method="throw",a.arg=c.arg)}}}(t,a,o),i}function h(t,e,a){try{return{type:"normal",arg:t.call(e,a)}}catch(H){return{type:"throw",arg:H}}}t.wrap=u;var d={};function f(){}function v(){}function p(){}var g={};l(g,n,(function(){return this}));var m=Object.getPrototypeOf,y=m&&m(m(I([])));y&&y!==e&&a.call(y,n)&&(g=y);var b=p.prototype=f.prototype=Object.create(g);function w(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function S(t,e){function r(n,i,s,c){var l=h(t[n],t,i);if("throw"!==l.type){var u=l.arg,d=u.value;return d&&"object"==o(d)&&a.call(d,"__await")?e.resolve(d.__await).then((function(t){r("next",t,s,c)}),(function(t){r("throw",t,s,c)})):e.resolve(d).then((function(t){u.value=t,s(u)}),(function(t){return r("throw",t,s,c)}))}c(l.arg)}var n;this._invoke=function(t,a){function i(){return new e((function(e,n){r(t,a,e,n)}))}return n=n?n.then(i,i):i()}}function x(t,e){var a=t.iterator[e.method];if(void 0===a){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,x(t,e),"throw"===e.method))return d;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return d}var r=h(a,t.iterator,e.arg);if("throw"===r.type)return e.method="throw",e.arg=r.arg,e.delegate=null,d;var n=r.arg;return n?n.done?(e[t.resultName]=n.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,d):n:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,d)}function _(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function k(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function C(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(_,this),this.reset(!0)}function I(t){if(t){var e=t[n];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,i=function e(){for(;++r<t.length;)if(a.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:L}}function L(){return{value:void 0,done:!0}}return v.prototype=p,l(b,"constructor",p),l(p,"constructor",v),v.displayName=l(p,c,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===v||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,l(t,c,"GeneratorFunction")),t.prototype=Object.create(b),t},t.awrap=function(t){return{__await:t}},w(S.prototype),l(S.prototype,i,(function(){return this})),t.AsyncIterator=S,t.async=function(e,a,r,n,i){void 0===i&&(i=Promise);var o=new S(u(e,a,r,n),i);return t.isGeneratorFunction(a)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},w(b),l(b,c,"Generator"),l(b,n,(function(){return this})),l(b,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var a in t)e.push(a);return e.reverse(),function a(){for(;e.length;){var r=e.pop();if(r in t)return a.value=r,a.done=!1,a}return a.done=!0,a}},t.values=I,C.prototype={constructor:C,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(k),!t)for(var e in this)"t"===e.charAt(0)&&a.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(a,r){return o.type="throw",o.arg=t,e.next=a,r&&(e.method="next",e.arg=void 0),!!r}for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n],o=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var s=a.call(i,"catchLoc"),c=a.call(i,"finallyLoc");if(s&&c){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&a.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var i=n;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var o=i?i.completion:{};return o.type=t,o.arg=e,i?(this.method="next",this.next=i.finallyLoc,d):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),d},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var a=this.tryEntries[e];if(a.finallyLoc===t)return this.complete(a.completion,a.afterLoc),k(a),d}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var a=this.tryEntries[e];if(a.tryLoc===t){var r=a.completion;if("throw"===r.type){var n=r.arg;k(a)}return n}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,a){return this.delegate={iterator:I(t),resultName:e,nextLoc:a},"next"===this.method&&(this.arg=void 0),d}},t}function c(t,e,a,r,n,i,o){try{var s=t[i](o),c=s.value}catch(l){return void a(l)}s.done?e(c):Promise.resolve(c).then(r,n)}function l(t){return function(){var e=this,a=arguments;return new Promise((function(r,n){var i=t.apply(e,a);function o(t){c(i,r,n,o,s,"next",t)}function s(t){c(i,r,n,o,s,"throw",t)}o(void 0)}))}}var u={name:"mheader",props:{name:String,isNative:{type:Boolean,default:!0},isBack:{type:Boolean,default:!0},isFixed:{type:Boolean,default:!0},backUrl:{type:Object,default:function(){return{callBack:null,path:"",params:{}}}}},data:function(){return{navBarHeight:0,headStyle:{},titleHeight:44}},mounted:function(){this.isNative||(Object(i["b"])({api:"setBarStatus",content:{status:0}}),this.getNav(),this.isBack=!1)},methods:{getNav:function(){var t=l(s().mark((function t(){var e,a,r=this;return s().wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(e=sessionStorage.getItem("navHeight"),a=sessionStorage.getItem("titleHeight"),!e||!a){t.next=7;break}this.navBarHeight=e,this.headStyle={paddingTop:e+"px",height:a+"px",lineHeight:a+"px"},t.next=9;break;case 7:return t.next=9,Object(i["b"])({api:"getNavHeight"},(function(t){var e=t.content,a={},n=e.dpi||2;if(e.navHeight){var i=e.navHeight/n;sessionStorage.setItem("navHeight",i),r.navBarHeight=i,a={paddingTop:i+"px"}}if(e.titleHeight){var o=e.titleHeight/n;sessionStorage.setItem("titleHeight",o),r.titleHeight=o,a.height=o+"px",a.lineHeight=o+"px"}r.headStyle=a}));case 9:case"end":return t.stop()}}),t,this)})));function e(){return t.apply(this,arguments)}return e}(),goBack:function(){var t=this.backUrl;"function"==typeof t.callBack?t.callBack():t.path?this.$router.push({path:t.path,query:t.params}):history.go(-1)}},beforeDestroy:function(){this.isNative||(Object(i["b"])({api:"setBarStatus",content:{status:1}}),this.isBack=!0)}},h=u,d=(a("04a4"),a("2877")),f=Object(d["a"])(h,r,n,!1,null,"641fc55e",null);e["a"]=f.exports},7121:function(t,e,a){t.exports=a.p+"img/icon_student.2f375f47.png"},a4bb:function(t,e,a){},e373:function(t,e,a){"use strict";a.r(e);var r=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{staticClass:"courseEvaluation"},[t.headerStatus?r("MHeader"):t._e(),r("van-cell-group",[r("van-cell",{attrs:{title:"课程班名称",value:t.teacherClassHeadInfo.classGroupName}})],1),r("van-cell-group",[r("van-cell",{attrs:{title:"课程时间",value:t.teacherClassHeadInfo.classTime}})],1),r("van-cell-group",[r("van-cell",{attrs:{title:"乐器",value:t.teacherClassHeadInfo.subjectNames}})],1),r("van-cell-group",[r("van-cell",{attrs:{title:"班级学员",value:t.teacherClassHeadInfo.studentNames}})],1),r("van-cell-group",[r("van-field",{staticClass:"textarea",attrs:{maxlength:"255",autosize:"",label:"教学内容",type:"textarea",readonly:t.teachingMaterialStatus,placeholder:"请输入1-255字"},model:{value:t.teachingMaterial,callback:function(e){t.teachingMaterial=e},expression:"teachingMaterial"}})],1),t.courseScheduleComplaints.length>0?r("div",[r("div",{staticClass:"title"},[t._v("学员评价")]),t._l(t.courseScheduleComplaints,(function(e,n){return r("div",{key:n,staticClass:"evaluation-item"},[r("div",{staticClass:"header"},[e.avatar?r("img",{attrs:{src:e.avatar,alt:""}}):r("img",{attrs:{src:a("7121"),alt:""}}),t._v("\n "+t._s(e.username)+"\n ")]),r("div",{staticClass:"rate"},[t._v("评价"),r("van-rate",{attrs:{readonly:"",size:20},model:{value:e.score,callback:function(a){t.$set(e,"score",a)},expression:"item.score"}})],1),r("div",{staticClass:"content"},[t._v("\n "+t._s(e.reason)+"\n ")])])}))],2):t._e(),r("div",{staticClass:"title",class:[t.courseScheduleComplaints.length>0?"teacher":""]},[t._v("老师评价")]),t.courseScheduleReviewList.length>0?r("div",t._l(t.courseScheduleReviewList,(function(e,n){return r("van-panel",{key:n},[r("div",{staticClass:"van-hairline--bottom",staticStyle:{display:"flex"},attrs:{slot:"header"},slot:"header"},[r("div",{staticClass:"header"},[e.studentAvatar?r("img",{attrs:{src:e.studentAvatar,alt:""}}):r("img",{attrs:{src:a("7121"),alt:""}}),t._v(t._s(e.studentName)+"\n ")])]),r("div",{staticClass:"content",attrs:{slot:"default"},slot:"default"},[t._v(t._s(e.memo))])])})),1):r("div",[r("van-cell",{attrs:{center:"",title:"是否对所有学生评价"}},[r("van-switch",{attrs:{slot:"right-icon"},slot:"right-icon",model:{value:t.checked,callback:function(e){t.checked=e},expression:"checked"}})],1),t.checked?r("van-panel",{staticClass:"evaluation-panel",attrs:{title:"评论给所有学生"}},[r("div",{attrs:{slot:"default"},slot:"default"},[r("van-field",{attrs:{rows:"3",maxlength:"255",autosize:"",type:"textarea",placeholder:"请输入1-255字"},model:{value:t.contentall,callback:function(e){t.contentall=e},expression:"contentall"}})],1)]):r("div",t._l(t.students,(function(e,n){return r("van-panel",{key:n,staticClass:"evaluation-panel"},[r("div",{staticClass:"van-hairline--bottom",staticStyle:{display:"flex","padding-left":".16rem"},attrs:{slot:"header"},slot:"header"},[r("div",{staticClass:"header"},[e.avatar?r("img",{attrs:{src:e.avatar,alt:""}}):r("img",{attrs:{src:a("7121"),alt:""}}),t._v("\n "+t._s(e.username)+"\n ")])]),r("div",{attrs:{slot:"default"},slot:"default"},[r("van-field",{attrs:{rows:"3",autosize:"",type:"textarea",placeholder:"请输入1-255字"},model:{value:e.content,callback:function(a){t.$set(e,"content",a)},expression:"item.content"}})],1)])})),1)],1),t.courseScheduleReviewList.length<=0?r("div",{staticClass:"button-group"},[r("van-button",{attrs:{type:"primary",round:"",size:"large"},on:{click:t.onSubmit}},[t._v("确认")])],1):t._e()],1)},n=[],i=a("6e6e"),o=a("b562"),s=a("ff51"),c={name:"courseEvaluation",components:{MHeader:i["a"]},data:function(){var t=this.$route.query;return{headerStatus:!1,checked:!0,courseId:t.courseId,teachingMaterial:null,teachingMaterialStatus:!1,teacherClassHeadInfo:{},courseScheduleReview:[],courseScheduleComplaints:[],courseScheduleReviewList:[],review4StudentIds:{},students:[],contentall:null}},mounted:function(){var t=this.$route.query;t.Authorization&&(localStorage.setItem("Authorization",decodeURI(t.Authorization)),localStorage.setItem("userInfo",decodeURI(t.Authorization))),Object(s["b"])().android||Object(s["b"])().iPhone?document.title="课程评价":this.headerStatus=!0,this.__init()},methods:{__init:function(){var t=this;this.$toast.loading({duration:0,message:"加载中...",forbidClick:!0,loadingType:"spinner"}),Object(o["f"])({courseId:this.courseId}).then((function(e){var a=e.data;if(t.$toast.clear(),200==a.code){var r=a.data;r&&(t.teachingMaterial=r.teachingMaterial,t.teachingMaterialStatus=!!r.teachingMaterial,t.teacherClassHeadInfo=r.teacherClassHeadInfo?r.teacherClassHeadInfo:{},t.teacherClassHeadInfo.classDate&&(t.teacherClassHeadInfo.classTime=t.teacherClassHeadInfo.classDate+" "+t.teacherClassHeadInfo.startClassTime+"-"+t.teacherClassHeadInfo.endClassTime),t.courseScheduleReview=r.courseScheduleReview?r.courseScheduleReview:[],t.courseScheduleComplaints=r.courseScheduleComplaints?r.courseScheduleComplaints:[],t.courseScheduleReviewList=r.courseScheduleReviewList?r.courseScheduleReviewList:[],t.review4StudentIds=r.review4StudentIds?r.review4StudentIds:{},t.students=r.students?r.students:[],r.students.forEach((function(t){t.content=null})))}else t.$toast(a.msg)}))},onSubmit:function(){var t=this,e=this.students,a=[];if(this.teachingMaterial)if(this.contentall||!this.checked){var r=!1;e.forEach((function(e){t.checked||e.content?a.push({memo:t.checked?t.contentall:e.content,courseScheduleId:t.courseId,studentId:e.id,teachingMaterial:t.teachingMaterial}):r=!0})),r?this.$toast("请输入学生评价"):(this.$toast.loading({duration:0,message:"加载中...",forbidClick:!0,loadingType:"spinner"}),Object(o["a"])(a).then((function(e){t.$toast.clear();var a=e.data;200==a.code?(t.$toast("评价成功"),setTimeout((function(){t.onSubmitStatus=!0,Object(s["b"])().iPhone?window.webkit.messageHandlers.DAYA.postMessage(JSON.stringify({api:"back"})):Object(s["b"])().android?DAYA.postMessage(JSON.stringify({api:"back"})):t.$router.push("/business")}),500)):t.$toast(a.msg)})))}else this.$toast("请输入学生评价");else this.$toast("请输入教学内容")}},destroyed:function(){this.$toast.clear()}},l=c,u=(a("3a58"),a("2877")),h=Object(u["a"])(l,r,n,!1,null,"cd66fdd2",null);e["default"]=h.exports}}]);
|