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.246...

2 lines
12 KiB

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