You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
NewEduCoderBuild/p__MoopCases__index.68c6a27...

2 lines
11 KiB

(window.webpackJsonp=window.webpackJsonp||[]).push([[143],{"+Ja/":function(Y,T,l){},"9Oz4":function(Y,T,l){"use strict";l.r(T),l.d(T,"Types",function(){return m});var ft=l("DjyN"),Q=l("NUBc"),ht=l("T2oS"),Z=l("W9HT"),q=l("9og8"),tt=l("tJVT"),P=l("k1fw"),Et=l("5NDa"),et=l("5rEg"),k=l("q1tI"),u=l.n(k),rt=l("ErOA"),nt=l("+Ja/"),mt=l.n(nt),at=l("rmrE"),pt=l.n(at),ot=l("55Ip"),it=l("9kvl"),z=l("m3rI"),ut=l("xKgJ");function V(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */V=function(){return i};var i={},d=Object.prototype,s=d.hasOwnProperty,L=typeof Symbol=="function"?Symbol:{},v=L.iterator||"@@iterator",A=L.asyncIterator||"@@asyncIterator",j=L.toStringTag||"@@toStringTag";function h(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{h({},"")}catch(e){h=function(r,n,a){return r[n]=a}}function b(e,t,r,n){var a=t&&t.prototype instanceof C?t:C,o=Object.create(a.prototype),c=new N(n||[]);return o._invoke=function(g,O,_){var f="suspendedStart";return function(R,x){if(f==="executing")throw new Error("Generator is already running");if(f==="completed"){if(R==="throw")throw x;return W()}for(_.method=R,_.arg=x;;){var X=_.delegate;if(X){var $=J(X,_);if($){if($===p)continue;return $}}if(_.method==="next")_.sent=_._sent=_.arg;else if(_.method==="throw"){if(f==="suspendedStart")throw f="completed",_.arg;_.dispatchException(_.arg)}else _.method==="return"&&_.abrupt("return",_.arg);f="executing";var H=U(g,O,_);if(H.type==="normal"){if(f=_.done?"completed":"suspendedYield",H.arg===p)continue;return{value:H.arg,done:_.done}}H.type==="throw"&&(f="completed",_.method="throw",_.arg=H.arg)}}}(e,r,c),o}function U(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(n){return{type:"throw",arg:n}}}i.wrap=b;var p={};function C(){}function M(){}function y(){}var w={};h(w,v,function(){return this});var S=Object.getPrototypeOf,I=S&&S(S(G([])));I&&I!==d&&s.call(I,v)&&(w=I);var D=y.prototype=C.prototype=Object.create(w);function F(e){["next","throw","return"].forEach(function(t){h(e,t,function(r){return this._invoke(t,r)})})}function E(e,t){function r(a,o,c,g){var O=U(e[a],e,o);if(O.type!=="throw"){var _=O.arg,f=_.value;return f&&typeof f=="object"&&s.call(f,"__await")?t.resolve(f.__await).then(function(R){r("next",R,c,g)},function(R){r("throw",R,c,g)}):t.resolve(f).then(function(R){_.value=R,c(_)},function(R){return r("throw",R,c,g)})}g(O.arg)}var n;this._invoke=function(a,o){function c(){return new t(function(g,O){r(a,o,g,O)})}return n=n?n.then(c,c):c()}}function J(e,t){var r=e.iterator[t.method];if(r===void 0){if(t.delegate=null,t.method==="throw"){if(e.iterator.return&&(t.method="return",t.arg=void 0,J(e,t),t.method==="throw"))return p;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return p}var n=U(r,e.iterator,t.arg);if(n.type==="throw")return t.method="throw",t.arg=n.arg,t.delegate=null,p;var a=n.arg;return a?a.done?(t[e.resultName]=a.value,t.next=e.nextLoc,t.method!=="return"&&(t.method="next",t.arg=void 0),t.delegate=null,p):a:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,p)}function B(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function K(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function N(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(B,this),this.reset(!0)}function G(e){if(e){var t=e[v];if(t)return t.call(e);if(typeof e.next=="function")return e;if(!isNaN(e.length)){var r=-1,n=function a(){for(;++r<e.length;)if(s.call(e,r))return a.value=e[r],a.done=!1,a;return a.value=void 0,a.done=!0,a};return n.next=n}}return{next:W}}function W(){return{value:void 0,done:!0}}return M.prototype=y,h(D,"constructor",y),h(y,"constructor",M),M.displayName=h(y,j,"GeneratorFunction"),i.isGeneratorFunction=function(e){var t=typeof e=="function"&&e.constructor;return!!t&&(t===M||(t.displayName||t.name)==="GeneratorFunction")},i.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,y):(e.__proto__=y,h(e,j,"GeneratorFunction")),e.prototype=Object.create(D),e},i.awrap=function(e){return{__await:e}},F(E.prototype),h(E.prototype,A,function(){return this}),i.AsyncIterator=E,i.async=function(e,t,r,n,a){a===void 0&&(a=Promise);var o=new E(b(e,t,r,n),a);return i.isGeneratorFunction(t)?o:o.next().then(function(c){return c.done?c.value:o.next()})},F(D),h(D,j,"Generator"),h(D,v,function(){return this}),h(D,"toString",function(){return"[object Generator]"}),i.keys=function(e){var t=[];for(var r in e)t.push(r);return t.reverse(),function n(){for(;t.length;){var a=t.pop();if(a in e)return n.value=a,n.done=!1,n}return n.done=!0,n}},i.values=G,N.prototype={constructor:N,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 r in this)r.charAt(0)==="t"&&s.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if(t.type==="throw")throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(_,f){return c.type="throw",c.arg=t,r.next=_,f&&(r.method="next",r.arg=void 0),!!f}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],c=o.completion;if(o.tryLoc==="root")return n("end");if(o.tryLoc<=this.prev){var g=s.call(o,"catchLoc"),O=s.call(o,"finallyLoc");if(g&&O){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(g){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!O)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(t,r){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&s.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&(t==="break"||t==="continue")&&o.tryLoc<=r&&r<=o.finallyLoc&&(o=null);var c=o?o.completion:{};return c.type=t,c.arg=r,o?(this.method="next",this.next=o.finallyLoc,p):this.complete(c)},complete:function(t,r){if(t.type==="throw")throw t.arg;return t.type==="break"||t.type==="continue"?this.next=t.arg:t.type==="return"?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):t.type==="normal"&&r&&(this.next=r),p},finish:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),K(n),p}},catch:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc===t){var a=n.completion;if(a.type==="throw"){var o=a.arg;K(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:G(t),resultName:r,nextLoc:n},this.method==="next"&&(this.arg=void 0),p}},i}var vt=l("YKXb"),lt=et.a.Search,_t={loading:!1,type:"all",page:1,count:0,list:[],keyword:""},m;(function(i){i[i.GET_LIST=0]="GET_LIST",i[i.CHANGE_KEYWORD=1]="CHANGE_KEYWORD",i[i.CHANGE_PAGE=2]="CHANGE_PAGE",i[i.CHANGE_TYPE=3]="CHANGE_TYPE",i[i.SET_LOADING=4]="SET_LOADING"})(m||(m={}));function st(i,d){switch(d.type){case m.GET_LIST:return Object(P.a)(Object(P.a)({},i),d.payload);case m.CHANGE_PAGE:return Object(P.a)(Object(P.a)({},i),{},{page:d.payload});case m.CHANGE_KEYWORD:return Object(P.a)(Object(P.a)({},i),d.payload);case m.CHANGE_TYPE:return Object(P.a)(Object(P.a)({},i),d.payload);case m.SET_LOADING:return Object(P.a)(Object(P.a)({},i),{},{loading:d.payload});default:throw new Error}}var ct=function(d){var s,L=d.user,v=d.globalSetting,A=d.dispatch,j=Object(k.useReducer)(st,_t),h=Object(tt.a)(j,2),b=h[0],U=h[1],p=b.loading,C=b.page,M=b.list,y=b.keyword,w=b.type,S=b.count;Object(k.useEffect)(function(){return A({type:"globalSetting/onlyShowBackTopToggle",payload:!1}),function(){A({type:"globalSetting/onlyShowBackTopToggle",payload:!0})}},[]),Object(k.useEffect)(function(){var E=!1;function J(){return B.apply(this,arguments)}function B(){return B=Object(q.a)(V().mark(function K(){var N,G,W;return V().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return U({type:m.SET_LOADING,payload:!0}),t.next=3,Object(rt.c)("libraries.json",{keyword:y,page:C,type:w});case 3:N=t.sent,G=N.libraries,W=N.count,E||U({type:m.GET_LIST,payload:{count:W,list:G,loading:!1}});case 6:case"end":return t.stop()}},K)})),B.apply(this,arguments)}return E||J(),function(){E=!0}},[C,y,w]);function I(E){U({type:m.CHANGE_KEYWORD,payload:{keyword:E,page:1}})}function D(E){U({type:m.CHANGE_TYPE,payload:{type:E.target.id,page:1}})}function F(E){document.body.scrollIntoView(),U({type:m.CHANGE_PAGE,payload:E})}return u.a.createElement("div",{className:"moop-case"},u.a.createElement("section",{className:"banner"},u.a.createElement("img",{src:z.a.IMG_SERVER+"/"+(v==null||((s=v.setting)===null||s===void 0)?void 0:s.moop_cases_banner_url),alt:"bg"})),u.a.createElement("section",{className:"moop-main"},u.a.createElement("div",{className:"moop-title"},u.a.createElement("span",null,"\u6559\u5B66\u6848\u4F8B"),u.a.createElement(ot.Link,{to:"/moop_cases/new",className:"btn-ghost"},"\u53D1\u5E03\u6848\u4F8B")),u.a.createElement("div",{className:"search-input-container"},u.a.createElement("div",{className:"flex-container"},u.a.createElement("a",{id:"all",onClick:D,className:w==="all"?"active":""},"\u5168\u90E8"),Object(ut.p)()?u.a.createElement("a",{id:"mine",onClick:D,className:w==="mine"?"active":""},"\u6211\u7684"):null),u.a.createElement(lt,{className:"moop-search",defaultValue:y,placeholder:"\u8F93\u5165\u6559\u5B66\u6848\u4F8B\u6807\u9898\u3001\u4F5C\u8005\u3001\u5355\u4F4D\u8FDB\u884C\u68C0\u7D22",onSearch:I}))),u.a.createElement(Z.a,{spinning:p,delay:500},u.a.createElement(dt,{data:M})),u.a.createElement("div",{className:"search-footer"},S>20?u.a.createElement(Q.a,{showQuickJumper:!0,current:C,onChange:F,pageSize:20,showSizeChanger:!1,total:S}):null))};function dt(i){var d=i.data;return u.a.createElement("ul",{className:"case-list"},d.map(function(s){var L;return u.a.createElement("li",{key:s.id},u.a.createElement("a",{href:"/moop_cases/".concat(s.id),target:"_blank"},u.a.createElement("img",{src:"".concat(z.a.IMG_SERVER).concat(s.cover_url),width:120,alt:s.title}),u.a.createElement("div",{className:"info"},u.a.createElement("h2",null,s.title,(L=s.tags)===null||L===void 0?void 0:L.map(function(v,A){return u.a.createElement("span",{className:"label-"+A,key:v.id},v.name)})),u.a.createElement("div",{className:"detail"},u.a.createElement("div",{className:"flex-container"},u.a.createElement("span",null,"".concat(s.author_name," ").concat(s.author_school_name))),u.a.createElement("div",{className:"sum"},u.a.createElement("span",null," ",u.a.createElement("i",{className:"fa fa-eye"})," ",s.visited_count," \u6D4F\u89C8 "),u.a.createElement("span",null," ",u.a.createElement("i",{className:"fa fa-thumbs-o-up"})," ",s.praise_count," \u8D5E "),u.a.createElement("span",null," ",u.a.createElement("i",{className:"fa fa-download"})," ",s.download_count," \u4E0B\u8F7D "))))))}))}T.default=Object(it.a)(function(i){var d=i.user,s=i.globalSetting;return{user:d,globalSetting:s}})(ct)},YKXb:function(Y,T,l){Y.exports=l.p+"static/teach-case-bg.dd8b5907.jpg"},rmrE:function(Y,T,l){}}]);