webpackJsonp([45],{eT4N:function(t,e){},ivFd:function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r={data:function(){return{loading:!1,finished:!1,refreshing:!1,page:1,isShow:!0,res:[]}},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.$router.push(t)},getWorks:function(){var t=this;this.res=[];var e={aid:this.$store.state.userInfo.userid,page:this.page};this.ajax.get(this.$store.state.api+"getWorkByUid",e).then(function(e){e.data[0].length>0?t.isShow=!1:t.isShow=!0,t.page++;e=e.data[0];for(var a=0;a<e.length;a++){var r=JSON.parse(e[a].chapters).homework;if(e[a].imgUrl=JSON.parse(e[a].content).photo.split(",")[0],e[a].rate){var i=JSON.parse(e[a].rate);e[a].rrate=Math.round((i.ca+i.sia+i.eta+i.pia+i.lra)/5)}else e[a].rrate=0;for(var s=0;s<r.length;s++)e[a].homeworkid!=r[s].hid||(e[a].workName=r[s].name)}t.res=e,t.finished=!1,t.loading=!1,t.refreshing=!1,console.log(e)}).catch(function(e){t.loading=!1,t.refreshing=!1,console.error(e)})},onRefresh:function(){this.page=1,this.getWorks()},onLoad:function(){var t=this,e={aid:this.$store.state.userInfo.userid,page:this.page};this.ajax.get(this.$store.state.api+"getWorkByUid",e).then(function(e){e=e.data[0];for(var a=0;a<e.length;a++){var r=JSON.parse(e[a].chapters).homework;if(e[a].imgUrl=JSON.parse(e[a].content).photo.split(",")[0],e[a].rate){var i=JSON.parse(e[a].rate);e[a].rrate=Math.round((i.ca+i.sia+i.eta+i.pia+i.lra)/5)}else e[a].rrate=0;for(var s=0;s<r.length;s++)e[a].homeworkid!=r[s].hid||(e[a].workName=r[s].name)}t.res=t.res.concat(e);var o=t.res.length?t.res[0].num:0;t.res.length<o?(t.page++,t.loading=!1):(t.finished=!0,t.loading=!0),t.loading=!1,t.refreshing=!1,console.log(e)}).catch(function(e){t.loading=!1,t.refreshing=!1,console.error(e)})}},created:function(){this.getWorks()}},i={render:function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{staticClass:"pb_content2"},[r("div",{staticClass:"pb_head"},[r("van-icon",{staticClass:"pb_back",attrs:{name:"arrow-left",color:"#fff",size:"1.2rem"},on:{click:t.goBack}}),t._v(" "),r("span",[t._v("我的作品")])],1),t._v(" "),r("div",{staticClass:"pb_content_body"},[r("div",{staticClass:"myw_work_body"},[r("van-pull-refresh",{staticStyle:{"padding-top":"0.5rem"},attrs:{"looing-text":"释放刷新","pulling-text":"下拉刷新"},on:{refresh:t.onRefresh},model:{value:t.refreshing,callback:function(e){t.refreshing=e},expression:"refreshing"}},[r("van-list",{attrs:{finished:t.finished,"finished-text":"没有更多啦",offset:"10","immediate-check":!1},on:{load:t.onLoad},model:{value:t.loading,callback:function(e){t.loading=e},expression:"loading"}},[t.isShow?r("van-empty",{staticClass:"custom-image",attrs:{image:a("0vHl"),description:"暂无作业"}}):t._e(),t._v(" "),t._l(t.res,function(e,a){return r("div",{key:a,staticClass:"myw_work_contentBox van-hairline--top"},[r("div",{staticClass:"myw_work_content"},[r("div",{staticClass:"myw_work_head"},[r("div",{staticClass:"myw_work_title"},[r("span",[t._v(t._s(e.workName))]),r("span",[t._v(t._s(e.time))])]),t._v(" "),r("div",{staticClass:"myw_work_rate"},[r("van-rate",{attrs:{value:e.rrate,"void-icon":"star","void-color":"#e6e6e6",color:"#ff6823",readonly:""}})],1)]),t._v(" "),r("div",{staticClass:"myw_work_button"},[r("button",{on:{click:function(a){return t.goTo("/my/myWorks/myWorkDetail?wid="+e.id)}}},[t._v("\n                  查看评分\n                ")])])]),t._v(" "),r("div",{staticClass:"myw_work_imgbox"},[r("div",{staticClass:"myw_work_img"},[r("van-image",{attrs:{width:"100%",height:"inherit",src:e.imgUrl,fit:"cover"}})],1)])])})],2)],1)],1)])])},staticRenderFns:[]};var s=a("VU/8")(r,i,!1,function(t){a("eT4N")},"data-v-108db834",null);e.default=s.exports}});
//# sourceMappingURL=45.2dba7d0b11490ea8de25.js.map