1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-04c22730"],{"0afc":function(t,o,e){t.exports=e.p+"img/noneData.919a3c84.png"},"13f6":function(t,o,e){"use strict";e("8a3f")},"276d":function(t,o,e){"use strict";e("7cd2")},"3c4a":function(t,o,e){"use strict";e.r(o);var n,i=function(){var t=this,o=t.$createElement,e=t._self._c||o;return e("div",{staticClass:"assess"},[e("div",{staticClass:"assesstitbox fontfpr font32 lh88 center"},[e("div",{staticClass:"pull-left width25",class:{nowtitle:0==t.type},on:{click:function(o){return t.setypetap("0")}}},[t._v("全部")]),e("div",{staticClass:"pull-left width25",class:{nowtitle:1==t.type},on:{click:function(o){return t.setypetap("1")}}},[t._v("已参加")]),e("div",{staticClass:"pull-left width25",class:{nowtitle:3==t.type},on:{click:function(o){return t.setypetap("3")}}},[t._v("考试中")]),e("div",{staticClass:"pull-left width25",class:{nowtitle:2==t.type},on:{click:function(o){return t.setypetap("2")}}},[t._v("未参加")])]),e("mescroll-vue",{ref:"wordListBox",staticClass:"customerBoxmescroll",attrs:{down:t.mescrollDown,up:t.mescrollUp},on:{init:t.mescrollInit}},[e("div",{staticClass:"padding-xs"},t._l(t.testlist,(function(t){return e("assess-item",{key:t.id,attrs:{item:t}})})),1),e("nonedata",{attrs:{len:t.testlist.length,datashow:t.datashow}})],1),e("wzhload",{directives:[{name:"show",rawName:"v-show",value:t.loadFlag,expression:"loadFlag"}]})],1)},s=[],r=e("fc11"),a=(e("5246"),e("6b41")),l=(e("b0c0"),e("99af"),e("8d6b")),c=e("a92e"),p=e("9df2"),u=function(){var t=this,o=t.$createElement,e=t._self._c||o;return e("div",{staticClass:"assess-item lh44 font24",on:{click:function(o){return t.toAssess(t.item.id,t.item.daynum,t.item.done)}}},[e("div",{staticClass:"bold font28 fontfpr color333"},[t._v(t._s(t.item.name))]),e("div",{staticClass:"color666"},[t._v("开始时间:"+t._s(t.item.starttime))]),e("div",{staticClass:"color666"},[t._v("结束时间:"+t._s(t.item.endtime))]),e("div",{staticClass:"color666"},[t._v("考试时长:"+t._s(t.item.duringtime?t.item.duringtime:0)+"分钟")]),e("div",{staticClass:"font20",class:"0"!=t.item.done&&2!=t.item.done||0==t.item.daynum?"tips over-bg":"tips"},[e("span",[t._v(t._s("0"!=t.item.done&&2!=t.item.done||0==t.item.daynum?"考试结束":"进入考场"))])]),0==t.item.daynum&&0==t.item.done?e("div",{staticClass:"noJOin font18 colorfff lh34 center"},[t._v("未参加")]):t._e(),0!=t.item.daynum&&2==t.item.done?e("div",{staticClass:"examing font18 colorfff lh34 center"},[t._v("考试中")]):t._e()])},d=[],h={props:["item"],data:function(){return{}},methods:{toAssess:function(t,o,e){if(0==o&&0==e)return this.$toast("考试时间已过,不能继续考试!"),!1;var n=new Date(this.item.starttime).getTime(),i=(new Date).getTime();i<n?this.$toast("未到考试时间,不能参加考试!"):this.$router.push({name:"assessMsg",query:{pid:t}})}}},m=h,f=(e("13f6"),e("2877")),w=Object(f["a"])(m,u,d,!1,null,"925eeb9a",null),v=w.exports,g={components:(n={},Object(r["a"])(n,a["a"].name,a["a"]),Object(r["a"])(n,"assessItem",v),Object(r["a"])(n,"MescrollVue",l["a"]),Object(r["a"])(n,"nonedata",c["a"]),n),data:function(){return{loadFlag:!0,datashow:!1,type:0,active:0,activeVal:"1",testlist:[],mescroll:null,mescrollDown:{},mescrollUp:{callback:this.testfun,page:{num:0,size:10},htmlLoading:"",htmlNodata:"",noMoreSize:0},scrollTop:0}},methods:{setypetap:function(t){this.type=t,this.mescroll.resetUpScroll()},onScroll:function(t,o,e){this.scrollTop=o},mescrollInit:function(t){this.mescroll=t},testfun:function(t,o){var e=this,n={page:t.num,limit:10,type:this.type,employee_id:e.$store.state.empid};Object(p["x"])(n).then((function(n){e.datashow=!0,e.loadFlag=!1,0==n.data.code&&(1===t.num&&(e.testlist=[]),e.testlist=e.testlist.concat(n.data.data),e.$nextTick((function(){o.endSuccess(n.data.data.length)})))}))}},deactivated:function(){this.scrollTop=this.mescroll.preScrollY},beforeRouteEnter:function(t,o,e){"content"==o.name||"school"==o.name?t.meta.isBack=!0:t.meta.isBack=!1,e()},activated:function(){var t=this;this.$route.meta.isBack?t.mescroll.resetUpScroll():this.mescroll.scrollTo(this.scrollTop,2)}},y=g,D=(e("276d"),Object(f["a"])(y,i,s,!1,null,"dfeceb34",null));o["default"]=D.exports},5246:function(t,o,e){"use strict";e("68ef"),e("9d70"),e("3743"),e("8a0b")},"6b41":function(t,o,e){"use strict";var n=e("d282"),i=e("b1d2"),s=e("ad06"),r=Object(n["a"])("nav-bar"),a=r[0],l=r[1];o["a"]=a({props:{title:String,fixed:Boolean,zIndex:[Number,String],leftText:String,rightText:String,leftArrow:Boolean,placeholder:Boolean,safeAreaInsetTop:Boolean,border:{type:Boolean,default:!0}},data:function(){return{height:null}},mounted:function(){this.placeholder&&this.fixed&&(this.height=this.$refs.navBar.getBoundingClientRect().height)},methods:{genLeft:function(){var t=this.$createElement,o=this.slots("left");return o||[this.leftArrow&&t(s["a"],{class:l("arrow"),attrs:{name:"arrow-left"}}),this.leftText&&t("span",{class:l("text")},[this.leftText])]},genRight:function(){var t=this.$createElement,o=this.slots("right");return o||(this.rightText?t("span",{class:l("text")},[this.rightText]):void 0)},genNavBar:function(){var t,o=this.$createElement;return o("div",{ref:"navBar",style:{zIndex:this.zIndex},class:[l({fixed:this.fixed,"safe-area-inset-top":this.safeAreaInsetTop}),(t={},t[i["b"]]=this.border,t)]},[o("div",{class:l("content")},[this.hasLeft()&&o("div",{class:l("left"),on:{click:this.onClickLeft}},[this.genLeft()]),o("div",{class:[l("title"),"van-ellipsis"]},[this.slots("title")||this.title]),this.hasRight()&&o("div",{class:l("right"),on:{click:this.onClickRight}},[this.genRight()])])])},hasLeft:function(){return this.leftArrow||this.leftText||this.slots("left")},hasRight:function(){return this.rightText||this.slots("right")},onClickLeft:function(t){this.$emit("click-left",t)},onClickRight:function(t){this.$emit("click-right",t)}},render:function(){var t=arguments[0];return this.placeholder&&this.fixed?t("div",{class:l("placeholder"),style:{height:this.height+"px"}},[this.genNavBar()]):this.genNavBar()}})},"7cd2":function(t,o,e){},"8a0b":function(t,o,e){},"8a3f":function(t,o,e){},"8d6b":function(t,o,e){"use strict";var n=function(){var t=this,o=t.$createElement,e=t._self._c||o;return e("div",{ref:"mescroll",staticClass:"mescroll"},[e("div",[t._t("default")],2)])},i=[],s=e("f868"),r=e.n(s),a=(e("f2fd"),{name:"MeScrollVue",data:function(){return{mescroll:null,lastScrollTop:0,lastBounce:null}},props:{up:Object,down:Object},mounted:function(){this.mescroll=new r.a(this.$refs.mescroll,{up:this.up,down:this.down}),this.$emit("init",this.mescroll)},methods:{beforeRouteEnter:function(){var t=this;this.mescroll&&(this.lastScrollTop&&(this.mescroll.setScrollTop(this.lastScrollTop),setTimeout((function(){t.mescroll.setTopBtnFadeDuration(0)}),16)),null!=this.lastBounce&&this.mescroll.setBounce(this.lastBounce))},beforeRouteLeave:function(){this.mescroll&&(this.lastScrollTop=this.mescroll.getScrollTop(),this.mescroll.hideTopBtn(0),this.lastBounce=this.mescroll.optUp.isBounce,this.mescroll.setBounce(!0))}}}),l=a,c=e("2877"),p=Object(c["a"])(l,n,i,!1,null,null,null);o["a"]=p.exports},"99af":function(t,o,e){"use strict";var n=e("23e7"),i=e("da84"),s=e("d039"),r=e("e8b5"),a=e("861d"),l=e("7b0b"),c=e("07fa"),p=e("8418"),u=e("65f0"),d=e("1dde"),h=e("b622"),m=e("2d00"),f=h("isConcatSpreadable"),w=9007199254740991,v="Maximum allowed index exceeded",g=i.TypeError,y=m>=51||!s((function(){var t=[];return t[f]=!1,t.concat()[0]!==t})),D=d("concat"),b=function(t){if(!a(t))return!1;var o=t[f];return void 0!==o?!!o:r(t)},T=!y||!D;n({target:"Array",proto:!0,forced:T},{concat:function(t){var o,e,n,i,s,r=l(this),a=u(r,0),d=0;for(o=-1,n=arguments.length;o<n;o++)if(s=-1===o?r:arguments[o],b(s)){if(i=c(s),d+i>w)throw g(v);for(e=0;e<i;e++,d++)e in s&&p(a,d,s[e])}else{if(d>=w)throw g(v);p(a,d++,s)}return a.length=d,a}})},"9df2":function(t,o,e){"use strict";e.d(o,"v",(function(){return i})),e.d(o,"G",(function(){return s})),e.d(o,"c",(function(){return r})),e.d(o,"H",(function(){return a})),e.d(o,"M",(function(){return l})),e.d(o,"A",(function(){return c})),e.d(o,"e",(function(){return p})),e.d(o,"u",(function(){return u})),e.d(o,"t",(function(){return d})),e.d(o,"n",(function(){return h})),e.d(o,"j",(function(){return m})),e.d(o,"m",(function(){return f})),e.d(o,"i",(function(){return w})),e.d(o,"w",(function(){return v})),e.d(o,"x",(function(){return g})),e.d(o,"K",(function(){return y})),e.d(o,"s",(function(){return D})),e.d(o,"f",(function(){return b})),e.d(o,"a",(function(){return T})),e.d(o,"g",(function(){return S})),e.d(o,"J",(function(){return U})),e.d(o,"I",(function(){return L})),e.d(o,"E",(function(){return B})),e.d(o,"D",(function(){return C})),e.d(o,"C",(function(){return x})),e.d(o,"B",(function(){return E})),e.d(o,"l",(function(){return O})),e.d(o,"z",(function(){return k})),e.d(o,"L",(function(){return _})),e.d(o,"b",(function(){return j})),e.d(o,"h",(function(){return I})),e.d(o,"o",(function(){return H})),e.d(o,"p",(function(){return z})),e.d(o,"d",(function(){return M})),e.d(o,"y",(function(){return P})),e.d(o,"F",(function(){return N})),e.d(o,"q",(function(){return A})),e.d(o,"r",(function(){return $})),e.d(o,"k",(function(){return Y}));var n=e("b775");function i(t){return Object(n["a"])({url:"/api/train/new",method:"post",data:t})}function s(t){return Object(n["a"])({url:"/api/train/trainClassList",method:"post",data:t})}function r(t){return Object(n["a"])({url:"/api/train/classDetail",method:"post",data:t})}function a(t){return Object(n["a"])({url:"/api/train/trainCourseList",method:"post",data:t})}function l(t){return Object(n["a"])({url:"/api/train/watch_feel",method:"post",data:t})}function c(t){return Object(n["a"])({url:"/api/train/thumbing",method:"post",data:t})}function p(t){return Object(n["a"])({url:"/api/train/commentAdd",method:"post",data:t})}function u(t){return Object(n["a"])({url:"/api/exam/submitPaper",method:"post",data:t})}function d(t){return Object(n["a"])({url:"/api/exam/get_questions",method:"post",data:t})}function h(t){return Object(n["a"])({url:"/api/exam/ranking",method:"post",data:t})}function m(t){return Object(n["a"])({url:"/api/train/courseDetail",method:"post",data:t})}function f(t){return Object(n["a"])({url:"/api/train/doneLogging",method:"post",data:t})}function w(t){return Object(n["a"])({url:"/client/train/courseDetail",method:"post",data:t})}function v(t){return Object(n["a"])({url:"/api/exam/paperdetail",method:"post",data:t})}function g(t){return Object(n["a"])({url:"/api/exam/paperlist",method:"post",data:t})}function y(t){return Object(n["a"])({url:"/api/exam/treat_correct_paper",method:"post",data:t})}function D(t){return Object(n["a"])({url:"/api/exam/get_papers",method:"post",data:t})}function b(t){return Object(n["a"])({url:"/api/exam/correct_papers_log",method:"post",data:t})}function T(t){return Object(n["a"])({url:"/api/exam/all_correct_papers",method:"post",data:t})}function S(t){return Object(n["a"])({url:"/api/exam/correct_papers_question_list",method:"post",data:t})}function U(t){return Object(n["a"])({url:"/api/train/all_complete",method:"post",data:t})}function L(t){return Object(n["a"])({url:"/api/train/all_org",method:"post",data:t})}function B(t){return Object(n["a"])({url:"/api/camp/read",method:"post",data:t})}function C(t){return Object(n["a"])({url:"/api/camp/plan",method:"post",data:t})}function x(t){return Object(n["a"])({url:"/api/camp/list",method:"post",data:t})}function E(t){return Object(n["a"])({url:"/api/camp/approve",method:"post",data:t})}function O(t){return Object(n["a"])({url:"/api/day_study/study",method:"post",data:t})}function k(t){return Object(n["a"])({url:"/api/day_study/setting",method:"post",data:t})}function _(t){return Object(n["a"])({url:"/api/day_study/update_study",method:"post",data:t})}function j(t){return Object(n["a"])({url:"/api/day_study/change_study_long",method:"post",data:t})}function I(t){return Object(n["a"])({url:"/api/train/coureseView",method:"post",data:t})}function H(t){return Object(n["a"])({url:"/api/train/get_train_class_cate",method:"post",data:t})}function z(t){return Object(n["a"])({url:"/api/train/get_train_class_label",method:"post",data:t})}function M(t){return Object(n["a"])({url:"/api/train/classView",method:"post",data:t})}function P(t){return Object(n["a"])({url:"/api/exam/answer",method:"post",data:t})}function N(t){return Object(n["a"])({url:"/client/train/trainClassList",method:"post",data:t})}function A(t){return Object(n["a"])({url:"/client/train/get_train_class_cate",method:"post",data:t})}function $(t){return Object(n["a"])({url:"/client/train/get_train_class_label",method:"post",data:t})}function Y(t){return Object(n["a"])({url:"/client/index/signUp",method:"post",data:t})}},a92e:function(t,o,e){"use strict";var n=function(){var t=this,o=t.$createElement,n=t._self._c||o;return n("div",{staticClass:"nonedata",staticStyle:{margin:"auto"}},[n("div",{directives:[{name:"show",rawName:"v-show",value:"0"==t.len&&t.datashow,expression:"len == '0' && datashow"}],staticClass:"noneDataBox"},[n("img",{attrs:{src:e("0afc")}}),n("div",[t._v(t._s(t.text))])])])},i=[],s=(e("a9e3"),{name:"nonedata",props:{len:{type:Number,default:0},datashow:{type:Boolean,default:!1},text:{type:String,default:"暂无数据展示"}},data:function(){return{}},created:function(){},methods:{},mounted:function(){}}),r=s,a=(e("bf10"),e("2877")),l=Object(a["a"])(r,n,i,!1,null,"e6e9b0c4",null);o["a"]=l.exports},bf10:function(t,o,e){"use strict";e("c93c")},c93c:function(t,o,e){},f2fd:function(t,o,e){},f868:function(t,o,e){var n,i;(function(s,r){n=r,i="function"===typeof n?n.call(o,e,o,t):n,void 0===i||(t.exports=i)})(0,(function(){var t=function(t,o){var e=this;if(e.version="1.4.0",e.isScrollBody=!t||"body"===t,e.scrollDom=e.isScrollBody?document.body:e.getDomById(t),e.scrollDom){e.options=o||{};var n=navigator.userAgent,i=!!n.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),s="undefined"===typeof window.orientation,r=n.indexOf("Android")>-1||n.indexOf("Adr")>-1;e.os={ios:i,pc:s,android:r},e.isDownScrolling=!1,e.isUpScrolling=!1;var a=e.options.down&&e.options.down.callback;e.initDownScroll(),e.initUpScroll(),setTimeout((function(){e.optDown.use&&e.optDown.auto&&a&&(e.optDown.autoShowLoading?e.triggerDownScroll():e.optDown.callback&&e.optDown.callback(e)),e.optUp.use&&e.optUp.auto&&!e.isUpAutoLoad&&e.triggerUpScroll()}),30)}};return t.prototype.extendDownScroll=function(o){t.extend(o,{use:!0,auto:!0,autoShowLoading:!1,isLock:!1,isBoth:!1,offset:80,inOffsetRate:1,outOffsetRate:.2,bottomOffset:20,minAngle:45,hardwareClass:"mescroll-hardware",mustToTop:!1,warpId:null,warpClass:"mescroll-downwarp",resetClass:"mescroll-downwarp-reset",textInOffset:"下拉刷新",textOutOffset:"释放更新",textLoading:"加载中 ...",htmlContent:'<p class="downwarp-progress"></p><p class="downwarp-tip"></p>',inited:function(t,o){t.downTipDom=o.getElementsByClassName("downwarp-tip")[0],t.downProgressDom=o.getElementsByClassName("downwarp-progress")[0]},inOffset:function(t){t.downTipDom&&(t.downTipDom.innerHTML=t.optDown.textInOffset),t.downProgressDom&&t.downProgressDom.classList.remove("mescroll-rotate")},outOffset:function(t){t.downTipDom&&(t.downTipDom.innerHTML=t.optDown.textOutOffset)},onMoving:function(t,o,e){if(t.downProgressDom){var n=360*o;t.downProgressDom.style.webkitTransform="rotate("+n+"deg)",t.downProgressDom.style.transform="rotate("+n+"deg)"}},beforeLoading:function(t,o){return!1},showLoading:function(t){t.downTipDom&&(t.downTipDom.innerHTML=t.optDown.textLoading),t.downProgressDom&&t.downProgressDom.classList.add("mescroll-rotate")},afterLoading:function(t){return 0},callback:function(t){t.resetUpScroll()}})},t.prototype.extendUpScroll=function(o){var e=this.os.pc;t.extend(o,{use:!0,auto:!0,isLock:!1,isBoth:!1,isBounce:!0,callback:null,page:{num:0,size:10,time:null},noMoreSize:5,offset:100,toTop:{warpId:null,src:null,html:null,offset:1e3,warpClass:"mescroll-totop",showClass:"mescroll-fade-in",hideClass:"mescroll-fade-out",fadeDuration:.5,duration:300,supportTap:!1,btnClick:null},loadFull:{use:!1,delay:500},empty:{warpId:null,icon:null,tip:"暂无相关数据~",btntext:"",btnClick:null,supportTap:!1},clearId:null,clearEmptyId:null,hardwareClass:"mescroll-hardware",warpId:null,warpClass:"mescroll-upwarp",htmlLoading:'<p class="upwarp-progress mescroll-rotate"></p><p class="upwarp-tip">加载中..</p>',htmlNodata:'<p class="upwarp-nodata">-- END --</p>',inited:function(t,o){},showLoading:function(t,o){o.innerHTML=t.optUp.htmlLoading},showNoMore:function(t,o){o.innerHTML=t.optUp.htmlNodata},onScroll:null,scrollbar:{use:e,barClass:"mescroll-bar"},lazyLoad:{use:!1,attr:"imgurl",showClass:"mescroll-lazy-in",delay:500,offset:200}})},t.extend=function(o,e){if(!o)return e;for(var n in e)null==o[n]?o[n]=e[n]:"object"===typeof o[n]&&t.extend(o[n],e[n]);return o},t.prototype.initDownScroll=function(){var t=this;if(t.optDown=t.options.down||{},t.extendDownScroll(t.optDown),t.touchstartEvent=function(o){t.isScrollTo&&t.preventDefault(o),t.startPoint=t.getPoint(o),t.lastPoint=t.startPoint,t.maxTouchmoveY=t.getBodyHeight()-t.optDown.bottomOffset,t.inTouchend=!1;var e=t.getScrollTop();t.isKeepTop=0===e,t.os.pc&&e<=0&&(t.scrollDom.addEventListener("mousemove",t.touchmoveEvent,{passive:!1}),document.ondragstart=function(){return!1})},t.scrollDom.addEventListener("mousedown",t.touchstartEvent),t.scrollDom.addEventListener("touchstart",t.touchstartEvent),t.touchmoveEvent=function(o){if(t.startPoint){var e=t.getScrollTop();e>0&&(t.isKeepTop=!1);var n=t.getPoint(o),i=n.y-t.startPoint.y;if(i>0){if(e<=0&&(t.preventDefault(o),t.optDown.use&&!t.inTouchend&&!t.isDownScrolling&&!t.optDown.isLock&&(!t.isUpScrolling||t.isUpScrolling&&t.optUp.isBoth))){if(t.optDown.mustToTop&&!t.isKeepTop)return;var s=Math.abs(t.lastPoint.x-n.x),r=Math.abs(t.lastPoint.y-n.y),a=Math.sqrt(s*s+r*r);if(0!==a){var l=Math.asin(r/a)/Math.PI*180;if(l<t.optDown.minAngle)return}if(t.maxTouchmoveY>0&&n.y>=t.maxTouchmoveY)return t.inTouchend=!0,void t.touchendEvent();var c=n.y-t.lastPoint.y;t.downHight||(t.downHight=0),t.downHight<t.optDown.offset?(1!==t.movetype&&(t.movetype=1,t.optDown.inOffset(t),t.downwarp.classList.remove(t.optDown.resetClass),t.isMoveDown=!0,t.os.ios&&!t.isKeepTop&&(t.scrollDom.classList.add(t.optDown.hardwareClass),t.scrollDom.style.webkitOverflowScrolling="auto",t.isSetScrollAuto=!0)),t.downHight+=c*t.optDown.inOffsetRate):(2!==t.movetype&&(t.movetype=2,t.optDown.outOffset(t),t.downwarp.classList.remove(t.optDown.resetClass),t.isMoveDown=!0,t.os.ios&&!t.isKeepTop&&(t.scrollDom.classList.add(t.optDown.hardwareClass),t.scrollDom.style.webkitOverflowScrolling="auto",t.isSetScrollAuto=!0)),t.downHight+=c>0?c*t.optDown.outOffsetRate:c),t.downwarp.style.height=t.downHight+"px";var p=t.downHight/t.optDown.offset;t.optDown.onMoving(t,p,t.downHight)}}else if(i<0){var u=t.getScrollHeight(),d=t.getClientHeight(),h=u-d-e;!t.optUp.isBounce&&h<=0&&t.preventDefault(o),t.optUp.use&&!t.optUp.isLock&&t.optUp.hasNext&&!t.isUpScrolling&&(!t.isDownScrolling||t.isDownScrolling&&t.optDown.isBoth)&&(d+t.optUp.offset>=u||h<=0)&&t.triggerUpScroll()}t.lastPoint=n}},t.scrollDom.addEventListener("touchmove",t.touchmoveEvent,{passive:!1}),t.touchendEvent=function(){t.optDown.use&&t.isMoveDown&&(t.downHight>=t.optDown.offset?t.triggerDownScroll():(t.downwarp.classList.add(t.optDown.resetClass),t.downHight=0,t.downwarp.style.height=0),t.isSetScrollAuto&&(t.scrollDom.style.webkitOverflowScrolling="touch",t.scrollDom.classList.remove(t.optDown.hardwareClass),t.isSetScrollAuto=!1),t.movetype=0,t.isMoveDown=!1),t.os.pc&&(t.scrollDom.removeEventListener("mousemove",t.touchmoveEvent),document.ondragstart=function(){return!0})},t.scrollDom.addEventListener("mouseup",t.touchendEvent),t.scrollDom.addEventListener("mouseleave",t.touchendEvent),t.scrollDom.addEventListener("touchend",t.touchendEvent),t.scrollDom.addEventListener("touchcancel",t.touchendEvent),t.optDown.use){t.downwarp=document.createElement("div"),t.downwarp.className=t.optDown.warpClass,t.downwarp.innerHTML='<div class="downwarp-content">'+t.optDown.htmlContent+"</div>";var o=t.optDown.warpId?t.getDomById(t.optDown.warpId):t.scrollDom;t.optDown.warpId&&o?o.appendChild(t.downwarp):(o||(o=t.scrollDom),o.insertBefore(t.downwarp,t.scrollDom.firstChild)),setTimeout((function(){t.optDown.inited(t,t.downwarp)}),0)}},t.prototype.preventDefault=function(t){t&&t.cancelable&&!t.defaultPrevented&&t.preventDefault()},t.prototype.getPoint=function(t){return{x:t.touches?t.touches[0].pageX:t.clientX,y:t.touches?t.touches[0].pageY:t.clientY}},t.prototype.triggerDownScroll=function(){this.optDown.beforeLoading(this,this.downwarp)||(this.showDownScroll(),this.optDown.callback&&this.optDown.callback(this))},t.prototype.showDownScroll=function(){this.isDownScrolling=!0,this.optDown.showLoading(this),this.downHight=this.optDown.offset,this.downwarp.classList.add(this.optDown.resetClass),this.downwarp.style.height=this.optDown.offset+"px"},t.prototype.endDownScroll=function(){var t=this,o=function(){t.downHight=0,t.downwarp.style.height=0,t.isDownScrolling=!1,t.downProgressDom&&t.downProgressDom.classList.remove("mescroll-rotate")},e=t.optDown.afterLoading(t);"number"===typeof e&&e>0?setTimeout(o,e):o()},t.prototype.lockDownScroll=function(t){null==t&&(t=!0),this.optDown.isLock=t},t.prototype.initUpScroll=function(){var t,o=this;(o.optUp=o.options.up||{use:!1},o.extendUpScroll(o.optUp),o.optUp.scrollbar.use&&o.scrollDom.classList.add(o.optUp.scrollbar.barClass),o.optUp.isBounce||o.setBounce(!1),!1!==o.optUp.use)&&(o.optUp.hasNext=!0,o.upwarp=document.createElement("div"),o.upwarp.className=o.optUp.warpClass,o.optUp.warpId&&(t=o.getDomById(o.optUp.warpId)),t||(t=o.scrollDom),t.appendChild(o.upwarp),o.preScrollY=0,o.lazyStartTime=(new Date).getTime(),o.lazyTag="mescroll-lazying",o.scrollEvent=function(){var t=o.getScrollTop(),e=t-o.preScrollY>0;if(o.preScrollY=t,!o.isUpScrolling&&(!o.isDownScrolling||o.isDownScrolling&&o.optDown.isBoth)&&!o.optUp.isLock&&o.optUp.hasNext){var n=o.getScrollHeight()-o.getClientHeight()-t;n<=o.optUp.offset&&e&&o.triggerUpScroll()}var i=o.optUp.toTop;if((i.src||i.html)&&(t>=i.offset?o.showTopBtn():o.hideTopBtn()),o.optUp.lazyLoad.use){var s=(new Date).getTime();o.lazyTimer&&clearTimeout(o.lazyTimer),s-o.lazyStartTime>=o.optUp.lazyLoad.delay?(o.lazyStartTime=s,o.lazyLoad(0)):o.lazyTimer=o.lazyLoad()}o.optUp.onScroll&&o.optUp.onScroll(o,t,e)},o.isScrollBody?window.addEventListener("scroll",o.scrollEvent):o.scrollDom.addEventListener("scroll",o.scrollEvent),setTimeout((function(){o.optUp.inited(o,o.upwarp)}),0))},t.prototype.setBounce=function(t){!this.isScrollBody&&this.os.ios&&(!1===t?(this.optUp.isBounce=!1,window.addEventListener("touchmove",this.bounceTouchmove,{passive:!1})):(this.optUp.isBounce=!0,window.removeEventListener("touchmove",this.bounceTouchmove)))},t.prototype.bounceTouchmove=function(t){var o=this,e=t.target,n=!0;while(e!==document.body&&e!==document){var i=e.classList;if(i){if(i.contains("mescroll")||i.contains("mescroll-touch")){n=!1;break}if(i.contains("mescroll-touch-x")||i.contains("mescroll-touch-y")){var s=t.touches?t.touches[0].pageX:t.clientX,r=t.touches?t.touches[0].pageY:t.clientY;o.preWinX||(o.preWinX=s),o.preWinY||(o.preWinY=r);var a=Math.abs(o.preWinX-s),l=Math.abs(o.preWinY-r),c=Math.sqrt(a*a+l*l);if(o.preWinX=s,o.preWinY=r,0!==c){var p=Math.asin(l/c)/Math.PI*180;if(p<=45&&i.contains("mescroll-touch-x")||p>45&&i.contains("mescroll-touch-y")){n=!1;break}}}}e=e.parentNode}n&&t.cancelable&&!t.defaultPrevented&&"function"===typeof t.preventDefault&&t.preventDefault()},t.prototype.triggerUpScroll=function(){this.optUp.callback&&!this.isUpScrolling&&(this.showUpScroll(),this.optUp.page.num++,this.isUpAutoLoad=!0,this.optUp.callback(this.optUp.page,this))},t.prototype.showUpScroll=function(){this.isUpScrolling=!0,this.upwarp.classList.add(this.optUp.hardwareClass),this.upwarp.style.visibility="visible",this.upwarp.style.display="block",this.optUp.showLoading(this,this.upwarp)},t.prototype.showNoMore=function(){this.upwarp.style.visibility="visible",this.upwarp.style.display="block",this.optUp.hasNext=!1,this.optUp.showNoMore(this,this.upwarp)},t.prototype.hideUpScroll=function(t){t?this.upwarp.style.display="none":this.upwarp.style.visibility="hidden",this.upwarp.classList.remove(this.optUp.hardwareClass);var o=this.upwarp.getElementsByClassName("upwarp-progress")[0];o&&o.classList.remove("mescroll-rotate")},t.prototype.endUpScroll=function(t,o){null!=t&&(t?this.showNoMore():this.hideUpScroll(o)),this.isUpScrolling=!1},t.prototype.resetUpScroll=function(t){if(this.optUp&&this.optUp.use){var o=this.optUp.page;this.prePageNum=o.num,this.prePageTime=o.time,o.num=1,o.time=null,this.isDownScrolling||!1===t||(null==t?(this.removeEmpty(),this.clearDataList(),this.showUpScroll()):this.showDownScroll()),this.isUpAutoLoad=!0,this.optUp.callback&&this.optUp.callback(o,this)}},t.prototype.setPageNum=function(t){this.optUp.page.num=t-1},t.prototype.setPageSize=function(t){this.optUp.page.size=t},t.prototype.clearDataList=function(){var t=this.optUp.clearId||this.optUp.clearEmptyId;if(t){var o=this.getDomById(t);o&&(o.innerHTML="")}},t.prototype.endByPage=function(t,o,e){var n;this.optUp.use&&null!=o&&(n=this.optUp.page.num<o),this.endSuccess(t,n,e)},t.prototype.endBySize=function(t,o,e){var n;if(this.optUp.use&&null!=o){var i=(this.optUp.page.num-1)*this.optUp.page.size+t;n=i<o}this.endSuccess(t,n,e)},t.prototype.endSuccess=function(t,o,e){var n=this;if(n.isDownScrolling&&n.endDownScroll(),n.optUp.use){var i;if(null!=t){var s=n.optUp.page.num,r=n.optUp.page.size;if(1===s&&(n.clearDataList(),e&&(n.optUp.page.time=e)),t<r||!1===o)if(n.optUp.hasNext=!1,0===t&&1===s)i=!1,n.showEmpty();else{var a=(s-1)*r+t;i=!(a<n.optUp.noMoreSize),n.removeEmpty()}else i=!1,n.optUp.hasNext=!0,n.removeEmpty()}var l=!n.optUp.hasNext;n.endUpScroll(i,l),n.loadFull(),n.optUp.lazyLoad.use&&n.lazyLoad(16)}},t.prototype.endErr=function(){if(this.isDownScrolling){var t=this.optUp.page;t&&this.prePageNum&&(t.num=this.prePageNum,t.time=this.prePageTime),this.endDownScroll()}this.isUpScrolling&&(this.optUp.page.num--,this.endUpScroll(!1))},t.prototype.loadFull=function(){var t=this;t.optUp.loadFull.use&&!t.optUp.isLock&&t.optUp.hasNext&&t.optUp.callback&&t.getScrollHeight()<=t.getClientHeight()&&setTimeout((function(){t.getScrollHeight()<=t.getClientHeight()&&t.triggerUpScroll()}),t.optUp.loadFull.delay)},t.prototype.lockUpScroll=function(t){null==t&&(t=!0),this.optUp.isLock=t},t.prototype.showEmpty=function(){var t=this,o=t.optUp.empty,e=o.warpId||t.optUp.clearEmptyId;if(null!=e){var n=t.getDomById(e);if(n){t.removeEmpty();var i="";if(o.icon&&(i+='<img class="empty-icon" src="'+o.icon+'"/>'),o.tip&&(i+='<p class="empty-tip">'+o.tip+"</p>"),o.btntext&&(i+='<p class="empty-btn">'+o.btntext+"</p>"),t.emptyDom=document.createElement("div"),t.emptyDom.className="mescroll-empty",t.emptyDom.innerHTML=i,n.appendChild(t.emptyDom),o.btnClick){var s=t.emptyDom.getElementsByClassName("empty-btn")[0];o.supportTap?s.addEventListener("tap",(function(e){e.stopPropagation(),t.preventDefault(e),o.btnClick()})):s.onclick=function(){o.btnClick()}}}}},t.prototype.removeEmpty=function(){this.removeChild(this.emptyDom)},t.prototype.showTopBtn=function(t){if(!this.topBtnShow){this.topBtnShow=!0;var o,e=this,n=e.optUp.toTop;if(null==e.toTopBtn)n.html?(e.toTopBtn=document.createElement("div"),e.toTopBtn.innerHTML=n.html):(e.toTopBtn=document.createElement("img"),e.toTopBtn.src=n.src),e.toTopBtn.className=n.warpClass,n.supportTap?e.toTopBtn.addEventListener("tap",(function(t){t.stopPropagation(),e.preventDefault(t);var o=n.btnClick&&n.btnClick();!0!==o&&e.scrollTo(0,e.optUp.toTop.duration)})):e.toTopBtn.onclick=function(){var t=n.btnClick&&n.btnClick();!0!==t&&e.scrollTo(0,e.optUp.toTop.duration)},n.warpId&&(o=e.getDomById(n.warpId)),o||(o=document.body),o.appendChild(e.toTopBtn);e.toTopBtn.classList.remove(n.hideClass),e.toTopBtn.classList.add(n.showClass),e.setTopBtnFadeDuration(t)}},t.prototype.hideTopBtn=function(t){this.topBtnShow&&this.toTopBtn&&(this.topBtnShow=!1,this.toTopBtn.classList.remove(this.optUp.toTop.showClass),this.toTopBtn.classList.add(this.optUp.toTop.hideClass),this.setTopBtnFadeDuration(t))},t.prototype.setTopBtnFadeDuration=function(t){if(this.toTopBtn){var o=(null!=t?t:this.optUp.toTop.fadeDuration)+"s";this.toTopBtn.style.animationDuration=o,this.toTopBtn.style.webkitAnimationDuration=o}},t.prototype.scrollTo=function(t,o){var e=this,n=e.getScrollTop(),i=t;if(i>0){var s=e.getScrollHeight()-e.getClientHeight();i>s&&(i=s)}else i=0;e.isScrollTo=!0,e.scrollDom.style.webkitOverflowScrolling="auto",e.getStep(n,i,(function(t){e.setScrollTop(t),t===i&&(e.scrollDom.style.webkitOverflowScrolling="touch",e.isScrollTo=!1)}),o)},t.prototype.getStep=function(t,o,e,n,i){var s=o-t;if(0!==n&&0!==s){n=n||300,i=i||30;var r=n/i,a=s/r,l=0,c=window.setInterval((function(){l<r-1?(t+=a,e&&e(t,c),l++):(e&&e(o,c),window.clearInterval(c))}),i)}else e&&e(o)},t.prototype.lazyLoad=function(t){var o=this,e=null!=t?t:o.optUp.lazyLoad.delay,n=setTimeout((function(){for(var t=o.scrollDom.querySelectorAll("["+o.optUp.lazyLoad.attr+"]"),e=t.length,n=0;n<e;n++){var i=t[n];if("true"!==i.getAttribute(o.lazyTag)&&o.isInSee(i,o.optUp.lazyLoad.offset)){var s=i.getAttribute(o.optUp.lazyLoad.attr),r=new Image;r.onload=function(){var t=this.src,e=this.dom,n=o.optUp.lazyLoad.showClass;n&&e.classList.add(n),"IMG"===e.tagName?e.src=t:e.style.backgroundImage="url("+t+")",e.removeAttribute(o.optUp.lazyLoad.attr),e.removeAttribute(o.lazyTag)},r.onerror=function(){this.dom.removeAttribute(o.lazyTag)},r.onabort=function(){this.dom.removeAttribute(o.lazyTag)},r.src=s,i.setAttribute(o.lazyTag,"true"),r.dom=i}}}),e);return n},t.prototype.isInSee=function(t,o){o=o||0;var e=this.getOffsetTop(t),n=this.getScrollTop()-o,i=e+t.offsetHeight,s=n+o+this.getClientHeight()+o;return e<s&&e>=n||i<=s&&i>n},t.prototype.getOffsetTop=function(t){var o=t.offsetTop,e=t.offsetParent;while(null!=e&&e!==this.scrollDom)o+=e.offsetTop+e.clientTop,e=e.offsetParent;return o},t.prototype.getScrollHeight=function(){return this.scrollDom.scrollHeight},t.prototype.getClientHeight=function(){return this.isScrollBody&&"CSS1Compat"===document.compatMode?document.documentElement.clientHeight:this.scrollDom.clientHeight},t.prototype.getBodyHeight=function(){return document.body.clientHeight||document.documentElement.clientHeight},t.prototype.getScrollTop=function(){return this.isScrollBody?document.documentElement.scrollTop||document.body.scrollTop:this.scrollDom.scrollTop},t.prototype.getToBottom=function(){return this.getScrollHeight()-this.getClientHeight()-this.getScrollTop()},t.prototype.setScrollTop=function(t){"number"===typeof t&&(this.isScrollBody?(document.documentElement.scrollTop=t,document.body.scrollTop=t):this.scrollDom.scrollTop=t)},t.prototype.getDomById=function(t){var o;return t&&("string"===typeof t?o=document.getElementById(t):t.nodeType&&(o=t)),o||console.error('the element with id as "'+t+'" can not be found: document.getElementById("'+t+'")==null'),o},t.prototype.removeChild=function(t){if(t){var o=t.parentNode;o&&o.removeChild(t),t=null}},t.prototype.destroy=function(){var t=this;t.scrollDom.removeEventListener("touchstart",t.touchstartEvent),t.scrollDom.removeEventListener("touchmove",t.touchmoveEvent),t.scrollDom.removeEventListener("touchend",t.touchendEvent),t.scrollDom.removeEventListener("touchcancel",t.touchendEvent),t.scrollDom.removeEventListener("mousedown",t.touchstartEvent),t.scrollDom.removeEventListener("mousemove",t.touchmoveEvent),t.scrollDom.removeEventListener("mouseup",t.touchendEvent),t.scrollDom.removeEventListener("mouseleave",t.touchendEvent),t.removeChild(t.downwarp),t.isScrollBody?window.removeEventListener("scroll",t.scrollEvent):t.scrollDom.removeEventListener("scroll",t.scrollEvent),t.removeChild(t.upwarp),t.removeChild(t.toTopBtn),t.setBounce(!0)},t}))}}]);
|