39.4baa3097bcb98845cf29.js 8.0 KB

12
  1. webpackJsonp([39],{PxdQ:function(t,e){},kkw5:function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var s=a("OF5A"),i=a.n(s),n={data:function(){return{title:"",stitle:"",wid:this.$route.query.id,res:[],commentText:"",playerOptions:{playbackRates:[.7,1,1.5,2],autoplay:!1,muted:!1,loop:!1,preload:"auto",language:"zh-CN",aspectRatio:"16:9",fluid:!0,sources:[{type:"video/mp4",src:""}],notSupportedMessage:"此视频暂无法播放,请稍后再试",controlBar:{timeDivider:!0,durationDisplay:!0,remainingTimeDisplay:!1,fullscreenToggle:!0}},playerO:{},comment:[],Pcomment:[]}},computed:{playsinline:function(){var t=navigator.userAgent.toLocaleLowerCase();return null==t.match(/tencenttraveler/)&&null==t.match(/qqbrowse/)}},methods:{goBack:function(){if(this.$router.isBack=!0,window.history.length<=1)return this.$router.push({path:"/"}),!1;this.$router.go(-1)},goTo:function(t){this.$store.state.userInfo.parentname?this.$router.push(t):this.$toast.fail("您没有填写家长名字不能评分,请到个人资料添加!")},getWork:function(){var t=this,e={aid:this.wid};this.ajax.get(this.$store.state.api+"getWorkByWid",e).then(function(e){e=e.data[0];for(var a=0;a<e.length;a++){var s=JSON.parse(e[a].chapters).homework,i=e[a].rate?JSON.parse(e[a].rate).content:"";if(e[a].comment=i,e[a].imgUrl=JSON.parse(e[a].content).photo.split(","),e[a].rate){var n=JSON.parse(e[a].rate);e[a].rrate=Math.round((n.ca+n.sia+n.eta+n.pia+n.lra)/5)}else e[a].rrate=0;for(var r=0;r<s.length;r++)e[a].homeworkid!=s[r].hid||(e[a].workName=s[r].name)}e=e.filter(function(t){return t.media=JSON.parse(t.content).media,t}),t.res=e[0],t.title=t.res.workName,t.stitle=t.res.workName+"-"+t.res.name,t.playerOptions.poster=t.res.imgUrl[0],t.playerOptions.sources[0].src=t.res.media,t.playerO=t.playerOptions,console.log(t.res)}).catch(function(t){console.error(t)})},onPlayerPlay:function(t){},full:function(t){if(t.requestFullscreen)t.requestFullscreen();else if(t.mozRequestFullScreen)t.mozRequestFullScreen();else if(t.msRequestFullscreen)t.msRequestFullscreen();else if(t.oRequestFullscreen)t.oRequestFullscreen();else if(t.webkitRequestFullscreen)t.webkitRequestFullScreen();else{var e=document.getElementsByClassName("video-player");e.style.cssText="width:100%;height:100%;overflow:hidden;;margin:0px;padding:0px;",e.IsFullScreen=!0}},getScomment:function(t){var e=this,a={pid:this.wid};this.ajax.get(this.$store.state.api+"findSComment",a).then(function(a){a=a.data[0];e.comment=a,console.log(a),1==t&&console.log(t)}).catch(function(t){console.error(t)})},getPcomment:function(){var t=this,e={pid:this.wid};this.ajax.get(this.$store.state.api+"findPComment",e).then(function(e){e=e.data[0];t.Pcomment=e,console.log(e)}).catch(function(t){console.error(t)})},time:function(){if(this.now){var t=(new Date).getTime();return t-this.now>3e3&&(this.now=t,!0)}return this.now=(new Date).getTime(),!0},commentA:function(){var t=this;if(""!==this.commentText){if(this.time()){var e=[{pid:this.wid,uid:this.$store.state.userInfo.userid,c:this.commentText,rate:"",type:1}];this.ajax.post(this.$store.state.api+"comment",e).then(function(e){t.$toast.success("评论成功"),t.commentText="",t.getScomment(1)}).catch(function(e){t.$toast.success("评论失败"),console.error(e)})}}else this.$toast.fail("不能发送空白信息")},getScrollParent:function(t){function e(e){return t.apply(this,arguments)}return e.toString=function(){return t.toString()},e}(function(t){return null==t?null:t.scrollHeight>t.clientHeight?t:getScrollParent(t.parentNode)}),onPlayerCanplay:function(t){var e=navigator.userAgent.toLocaleLowerCase();null!=e.match(/tencenttraveler/)||null!=e.match(/qqbrowse/)?i()("body").find("video").attr("x-webkit-airplay",!0).attr("x5-playsinline",!0).attr("webkit-playsinline",!0).attr("playsinline",!0):i()("body").find("video").attr("webkit-playsinline","true").attr("playsinline","true")}},created:function(){this.getPcomment(),this.getScomment(),this.getWork()}},r={render:function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"pb_content2"},[s("div",{staticClass:"pb_head"},[s("van-icon",{staticClass:"pb_back",attrs:{name:"arrow-left",color:"#fff",size:"1.2rem"},on:{click:t.goBack}}),t._v(" "),s("span",[t._v(t._s(t.title))])],1),t._v(" "),s("div",{staticClass:"pb_content_body"},[s("div",{staticClass:"myw_work_body"},[s("div",{staticClass:"myw_work_contentBox"},[s("div",{staticClass:"myw_work_content"},[s("div",{staticClass:"myw_work_head"},[s("div",{staticClass:"myw_work_title"},[s("span",[t._v(t._s(t.stitle))]),s("span",[t._v(t._s(t.res.time))])]),t._v(" "),s("div",{staticClass:"myw_work_rate"},[s("span",[t._v("综合评分:")]),t._v(" "),s("van-rate",{attrs:{value:t.res.rrate,"void-icon":"star","void-color":"#e6e6e6",color:"#ff6823",size:".8rem",readonly:""}})],1)]),t._v(" "),s("div",{staticClass:"myw_work_button"},[s("button",{on:{click:function(e){return t.goTo("/my/myWorks/myWorkDetail/myParent?id="+t.wid)}}},[t._v("\n 家长评分\n ")])])]),t._v(" "),s("div",{staticClass:"myw_work_imgbox"},[s("div",{staticClass:"myw_work_img"},[s("video-player",{ref:"videoPlayer",staticClass:"video-player vjs-custom-skin",staticStyle:{width:"100%",height:"100%"},attrs:{playsinline:t.playsinline,options:t.playerO},on:{canplay:function(e){return t.onPlayerCanplay(e)},play:function(e){return t.onPlayerPlay(e)}}})],1)])])]),t._v(" "),s("div",{staticClass:"cw_comment_box"},[s("div",{staticClass:"mwd_parent_parent"},[s("div",{staticClass:"mywd_rate_comment van-hairline--top"},[s("div",{staticClass:"mywd_rate_head"},[t._m(0),t._v(" "),s("div",{staticClass:"mywd_rate_head_title"},[s("div",[t._v(t._s(t.res.teachername)+"老师评论")])])]),t._v(" "),s("div",{staticClass:"mywd_rate_comment_body teacherComment"},[s("span",[t._v(t._s(t.res.comment?t.res.comment:"暂无评论"))])])])]),t._v(" "),s("div",{staticClass:"mwd_parent_parent"},t._l(t.Pcomment,function(e){return s("div",{key:e.id,staticClass:"mywd_rate_comment van-hairline--top"},[s("div",{staticClass:"mywd_rate_head"},[t._m(1,!0),t._v(" "),s("div",{staticClass:"mywd_rate_head_title"},[s("div",[t._v("\n "+t._s(e.parentname)+"家长"),s("span",[t._v(t._s(e.time))])]),t._v(" "),s("div",[s("van-rate",{attrs:{value:parseInt(e.evaluate),"void-icon":"star","void-color":"#e6e6e6",color:"#ff6823",size:".8rem",readonly:""}})],1)])]),t._v(" "),s("div",{staticClass:"mywd_rate_comment_body"},[s("span",[t._v(t._s(e.content))])])])}),0),t._v(" "),s("div",{staticClass:"mwd_student_comment"},t._l(t.comment,function(e,i){return s("div",{key:i,staticClass:"mywd_rate_comment van-hairline--top"},[s("div",{staticClass:"mywd_rate_head"},[s("div",{staticClass:"mywd_rate_head_img mwd_img_box"},[s("img",{directives:[{name:"lazy",rawName:"v-lazy",value:e.smailheadportrait?e.smailheadportrait:a("eMeI"),expression:"\n item.smailheadportrait\n ? item.smailheadportrait\n : require('../../assets/icon/portal.png')\n "}],attrs:{alt:""}})]),t._v(" "),s("div",{staticClass:"mywd_rate_head_title cw_title"},[s("div",[t._v("\n "+t._s(e.name)+t._s("1"==e.person?"老师":"")),s("span",[t._v(t._s(e.time))])])])]),t._v(" "),s("div",{staticClass:"mywd_rate_comment_body"},[s("span",[t._v(t._s(e.content))])])])}),0)])]),t._v(" "),s("div",{staticClass:"cw_bottom"},[s("van-field",{attrs:{clearable:"",placeholder:"写评论..."},model:{value:t.commentText,callback:function(e){t.commentText=e},expression:"commentText"}}),t._v(" "),s("div",{staticClass:"myw_work_button cw_green"},[s("button",{on:{click:t.commentA}},[t._v("提交")])])],1)])},staticRenderFns:[function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"mywd_rate_head_img teacher"},[e("img",{attrs:{src:a("tUaV"),alt:""}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"mywd_rate_head_img"},[e("img",{attrs:{src:a("xRPt"),alt:""}})])}]};var o=a("VU/8")(n,r,!1,function(t){a("PxdQ")},"data-v-4de9692e",null);e.default=o.exports}});
  2. //# sourceMappingURL=39.4baa3097bcb98845cf29.js.map