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__Competitions__Update.509...

2 lines
12 KiB

(window.webpackJsonp=window.webpackJsonp||[]).push([[123],{CpkQ:function(tt,$,c){tt.exports={flex_box_center:"flex_box_center___1TLor",flex_space_between:"flex_space_between___2oHSZ",flex_box_vertical_center:"flex_box_vertical_center___1GsMX",flex_box_center_end:"flex_box_center_end___dUr0S",flex_box_column:"flex_box_column___15YZP",Selecttext:"Selecttext___1ucPb",Updatecount:"Updatecount___t5g1H",Spanradius:"Spanradius___F7XLb"}},jmm4:function(tt,$,c){"use strict";c.r($);var pt=c("+L6B"),et=c("2/Rp"),ft=c("5NDa"),at=c("5rEg"),dt=c("sPJy"),I=c("bE4q"),ht=c("miYZ"),q=c("tsqr"),rt=c("9og8"),S=c("tJVT"),ot=c("PpiC"),g=c("q1tI"),l=c.n(g),nt=c("Ty5D"),H=c("55Ip"),it=c("9kvl"),lt=c("CpkQ"),A=c.n(lt),ut=c("wyMu"),ct=c.n(ut),st=c("YQfW"),Et=c.n(st),_t=c("m3rI");function j(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */j=function(){return s};var m,s={},F=Object.prototype,v=F.hasOwnProperty,P=Object.defineProperty||function(r,t,e){r[t]=e.value},Y=typeof Symbol=="function"?Symbol:{},M=Y.iterator||"@@iterator",J=Y.asyncIterator||"@@asyncIterator",y=Y.toStringTag||"@@toStringTag";function d(r,t,e){return Object.defineProperty(r,t,{value:e,enumerable:!0,configurable:!0,writable:!0}),r[t]}try{d({},"")}catch(r){d=function(e,a,n){return e[a]=n}}function Q(r,t,e,a){var n=t&&t.prototype instanceof B?t:B,o=Object.create(n.prototype),i=new G(a||[]);return P(o,"_invoke",{value:X(r,e,i)}),o}function C(r,t,e){try{return{type:"normal",arg:r.call(t,e)}}catch(a){return{type:"throw",arg:a}}}s.wrap=Q;var p="suspendedStart",Z="suspendedYield",z="executing",x="completed",f={};function B(){}function T(){}function E(){}var W={};d(W,M,function(){return this});var V=Object.getPrototypeOf,b=V&&V(V(k([])));b&&b!==F&&v.call(b,M)&&(W=b);var O=E.prototype=B.prototype=Object.create(W);function K(r){["next","throw","return"].forEach(function(t){d(r,t,function(e){return this._invoke(t,e)})})}function R(r,t){function e(n,o,i,_){var u=C(r[n],r,o);if(u.type!=="throw"){var U=u.arg,L=U.value;return L&&typeof L=="object"&&v.call(L,"__await")?t.resolve(L.__await).then(function(D){e("next",D,i,_)},function(D){e("throw",D,i,_)}):t.resolve(L).then(function(D){U.value=D,i(U)},function(D){return e("throw",D,i,_)})}_(u.arg)}var a;P(this,"_invoke",{value:function(o,i){function _(){return new t(function(u,U){e(o,i,u,U)})}return a=a?a.then(_,_):_()}})}function X(r,t,e){var a=p;return function(n,o){if(a===z)throw new Error("Generator is already running");if(a===x){if(n==="throw")throw o;return{value:m,done:!0}}for(e.method=n,e.arg=o;;){var i=e.delegate;if(i){var _=N(i,e);if(_){if(_===f)continue;return _}}if(e.method==="next")e.sent=e._sent=e.arg;else if(e.method==="throw"){if(a===p)throw a=x,e.arg;e.dispatchException(e.arg)}else e.method==="return"&&e.abrupt("return",e.arg);a=z;var u=C(r,t,e);if(u.type==="normal"){if(a=e.done?x:Z,u.arg===f)continue;return{value:u.arg,done:e.done}}u.type==="throw"&&(a=x,e.method="throw",e.arg=u.arg)}}}function N(r,t){var e=t.method,a=r.iterator[e];if(a===m)return t.delegate=null,e==="throw"&&r.iterator.return&&(t.method="return",t.arg=m,N(r,t),t.method==="throw")||e!=="return"&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+e+"' method")),f;var n=C(a,r.iterator,t.arg);if(n.type==="throw")return t.method="throw",t.arg=n.arg,t.delegate=null,f;var o=n.arg;return o?o.done?(t[r.resultName]=o.value,t.next=r.nextLoc,t.method!=="return"&&(t.method="next",t.arg=m),t.delegate=null,f):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,f)}function h(r){var t={tryLoc:r[0]};1 in r&&(t.catchLoc=r[1]),2 in r&&(t.finallyLoc=r[2],t.afterLoc=r[3]),this.tryEntries.push(t)}function w(r){var t=r.completion||{};t.type="normal",delete t.arg,r.completion=t}function G(r){this.tryEntries=[{tryLoc:"root"}],r.forEach(h,this),this.reset(!0)}function k(r){if(r||r===""){var t=r[M];if(t)return t.call(r);if(typeof r.next=="function")return r;if(!isNaN(r.length)){var e=-1,a=function n(){for(;++e<r.length;)if(v.call(r,e))return n.value=r[e],n.done=!1,n;return n.value=m,n.done=!0,n};return a.next=a}}throw new TypeError(typeof r+" is not iterable")}return T.prototype=E,P(O,"constructor",{value:E,configurable:!0}),P(E,"constructor",{value:T,configurable:!0}),T.displayName=d(E,y,"GeneratorFunction"),s.isGeneratorFunction=function(r){var t=typeof r=="function"&&r.constructor;return!!t&&(t===T||(t.displayName||t.name)==="GeneratorFunction")},s.mark=function(r){return Object.setPrototypeOf?Object.setPrototypeOf(r,E):(r.__proto__=E,d(r,y,"GeneratorFunction")),r.prototype=Object.create(O),r},s.awrap=function(r){return{__await:r}},K(R.prototype),d(R.prototype,J,function(){return this}),s.AsyncIterator=R,s.async=function(r,t,e,a,n){n===void 0&&(n=Promise);var o=new R(Q(r,t,e,a),n);return s.isGeneratorFunction(t)?o:o.next().then(function(i){return i.done?i.value:o.next()})},K(O),d(O,y,"Generator"),d(O,M,function(){return this}),d(O,"toString",function(){return"[object Generator]"}),s.keys=function(r){var t=Object(r),e=[];for(var a in t)e.push(a);return e.reverse(),function n(){for(;e.length;){var o=e.pop();if(o in t)return n.value=o,n.done=!1,n}return n.done=!0,n}},s.values=k,G.prototype={constructor:G,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=m,this.done=!1,this.delegate=null,this.method="next",this.arg=m,this.tryEntries.forEach(w),!t)for(var e in this)e.charAt(0)==="t"&&v.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=m)},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 e=this;function a(U,L){return i.type="throw",i.arg=t,e.next=U,L&&(e.method="next",e.arg=m),!!L}for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n],i=o.completion;if(o.tryLoc==="root")return a("end");if(o.tryLoc<=this.prev){var _=v.call(o,"catchLoc"),u=v.call(o,"finallyLoc");if(_&&u){if(this.prev<o.catchLoc)return a(o.catchLoc,!0);if(this.prev<o.finallyLoc)return a(o.finallyLoc)}else if(_){if(this.prev<o.catchLoc)return a(o.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return a(o.finallyLoc)}}}},abrupt:function(t,e){for(var a=this.tryEntries.length-1;a>=0;--a){var n=this.tryEntries[a];if(n.tryLoc<=this.prev&&v.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&(t==="break"||t==="continue")&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o.finallyLoc,f):this.complete(i)},complete:function(t,e){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"&&e&&(this.next=e),f},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),w(a),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var a=this.tryEntries[e];if(a.tryLoc===t){var n=a.completion;if(n.type==="throw"){var o=n.arg;w(a)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,a){return this.delegate={iterator:k(t),resultName:e,nextLoc:a},this.method==="next"&&(this.arg=m),f}},s}var mt=function(s){var F=s.globalSetting,v=s.loading,P=s.dispatch,Y=Object(ot.a)(s,["globalSetting","loading","dispatch"]),M=Object(g.useState)(),J=Object(S.a)(M,2),y=J[0],d=J[1],Q=Object(g.useState)(),C=Object(S.a)(Q,2),p=C[0],Z=C[1],z=Object(g.useState)(),x=Object(S.a)(z,2),f=x[0],B=x[1],T=Object(g.useState)(""),E=Object(S.a)(T,2),W=E[0],V=E[1],b=Object(g.useRef)(null),O=Object(g.useState)(""),K=Object(S.a)(O,2),R=K[0],X=K[1],N=Object(nt.m)(),h=N.identifier,w=N.Teannameid,G=Object(nt.k)();Object(g.useEffect)(function(){function a(){return n.apply(this,arguments)}function n(){return n=Object(rt.a)(j().mark(function o(){var i;return j().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return u.t0=d,u.next=3,P({type:"competitions/getHeader",payload:{identifier:h}});case 3:return u.t1=u.sent,(0,u.t0)(u.t1),u.next=7,P({type:"competitions/getTeamDetail",payload:{identifier:h,Teannameid:w}});case 7:i=u.sent,i&&(Z(i.data.name),X("".concat(_t.a.IMG_SERVER,"/").concat(i.data.team_log)));case 9:case"end":return u.stop()}},o)})),n.apply(this,arguments)}h&&a()},[h]);function k(){B(b.current.getCroppedCanvas().toDataURL())}function r(){return t.apply(this,arguments)}function t(){return t=Object(rt.a)(j().mark(function a(){var n;return j().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:if(p){i.next=3;break}return q.b.info("\u961F\u4F0D\u540D\u4E0D\u80FD\u4E3A\u7A7A"),i.abrupt("return");case 3:return i.next=5,P({type:"competitions/UpTeam",payload:{identifier:h,Teannameid:w,name:p,image:R?b.current.getCroppedCanvas().toDataURL("image/jpeg"):void 0}});case 5:n=i.sent,(n==null?void 0:n.status)===0&&(q.b.info("\u4FEE\u6539\u6210\u529F"),G.push("/competitions/index/".concat(h,"/enroll")));case 7:case"end":return i.stop()}},a)})),t.apply(this,arguments)}function e(a){var n=a.target.files[0];if(n&&n.size>2*1024*1024){q.b.info("\u4EC5\u652F\u6301\u6587\u4EF6\u5927\u5C0F\u5C0F\u4E8E2M\u7684\u6587\u4EF6");return}var o=new FileReader;o.readAsBinaryString(n),o.onload=function(){var i=btoa(o.result);X("data:".concat(n.type,";base64,").concat(i))},o.onerror=function(){}}return l.a.createElement("div",{className:"edu-container minH500"},l.a.createElement(I.a,{className:"mt10",separator:">"},l.a.createElement(I.a.Item,null,l.a.createElement(H.Link,{to:"/competitions/index"},"\u5728\u7EBF\u7ADE\u8D5B")),l.a.createElement(I.a.Item,null,l.a.createElement(H.Link,{to:"/competitions/index/".concat(h)},y&&y.name,y&&y.sub_title?y.sub_title:null)),l.a.createElement(I.a.Item,null,l.a.createElement(H.Link,{to:"/competitions/index/".concat(h,"/enroll")},"\u62A5\u540D")),l.a.createElement(I.a.Item,null,"\u7F16\u8F91\u6218\u961F\u4FE1\u606F")),l.a.createElement("div",{className:A.a.Selecttext},"\u7F16\u8F91\u6218\u961F"),l.a.createElement("div",{className:A.a.Updatecount},l.a.createElement("span",{style:{fontSize:"14px",color:"#F73737"}},"*"),"\u961F\u540D\uFF1A",l.a.createElement("p",{style:{marginTop:"15px",marginLeft:"8px",width:"544px"}},l.a.createElement(at.a,{placeholder:"\u8BF7\u8F93\u5165\u961F\u540D",value:p,maxLength:60,addonAfter:String(p&&p.length)+"/60",onChange:function(n){return Z(n.target.value)}})),l.a.createElement("p",{style:{marginTop:"15px",marginLeft:"8px",width:"544px"}},l.a.createElement("span",null,"LOGO\uFF1A"),l.a.createElement("label",{id:"uploadBtn",style:{color:"#4DACFF",cursor:"pointer"}},l.a.createElement("input",{type:"file",className:"sr-only",id:"inputImage",name:"file",accept:"image/*",onChange:e,style:{display:"none"}}),"\u4E0A\u4F20LOGO"),"\xA0",l.a.createElement("span",null,"(\u652F\u6301jpg\u3001gif\u3001png\u683C\u5F0F\u7684\u56FE\u7247\uFF0C\u5EFA\u8BAE\u6587\u4EF6\u5C0F\u4E8E2M)")),l.a.createElement("div",{style:{marginTop:"15px",marginLeft:"8px",display:"flex"}},f?l.a.createElement("img",{className:A.a.Spanradius,src:f}):W?l.a.createElement("img",{className:A.a.Spanradius}):l.a.createElement("div",{className:A.a.Spanradius},p&&p.length>2?p&&p.substring(0,2):p),l.a.createElement(ct.a,{style:{width:"320px",height:"320px",marginLeft:"30px",background:"#EEEEEE"},src:R,guides:!1,ref:b,crop:k}))),l.a.createElement("div",{style:{marginTop:"15px",marginBottom:"15px"}},l.a.createElement(et.a,{type:"primary",onClick:function(){return r()}},"\u786E\u5B9A"),l.a.createElement(et.a,{style:{marginLeft:"15px"}},l.a.createElement(H.Link,{to:"/competitions/index/".concat(h,"/enroll")},"\u53D6\u6D88"))))};$.default=Object(it.a)(function(m){var s=m.loading,F=m.globalSetting;return{globalSetting:F,loading:s.models.competitions}})(mt)}}]);