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.
2 lines
13 KiB
2 lines
13 KiB
(window.webpackJsonp=window.webpackJsonp||[]).push([[203],{oZN2:function(tt,z,c){tt.exports={flex_box_center:"flex_box_center___iifE0",flex_space_between:"flex_space_between___2bP5p",flex_box_vertical_center:"flex_box_vertical_center___HHUnR",flex_box_center_end:"flex_box_center_end___3kyW5",flex_box_column:"flex_box_column___2Avqu",order:"order___PMR3i",title:"title___23Jud",content:"content___3_4TY",w1:"w1___l1A6n",w2:"w2___w6GOy",w3:"w3___3YBZ5",w4:"w4___wB0OK",w5:"w5___11U0P",listTitle:"listTitle___36Ydh",listContent:"listContent___2k1Tx",info:"info___2bu_9",d1:"d1___3Z3hW",d2:"d2___3Kwdm",d3:"d3___1FS2q",unitPrice:"unitPrice___ORbLO",p:"p___1hSP1",l:"l___1ClOb",price:"price___DhmjZ",status:"status___3v3iw",action:"action___2kUr_"}},udqy:function(tt,z,c){"use strict";c.r(z);var ft=c("DjyN"),ot=c("NUBc"),ht=c("cWXX"),it=c("/ezw"),pt=c("R9oj"),_t=c("ECub"),mt=c("+L6B"),J=c("2/Rp"),Et=c("2qtc"),et=c("kLXV"),rt=c("k1fw"),H=c("9og8"),K=c("tJVT"),ut=c("PpiC"),vt=c("Znn+"),nt=c("ZTPi"),M=c("q1tI"),_=c.n(M),Q=c("9kvl"),q=c("ErOA"),st=c("oZN2"),d=c.n(st);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 h};var h={},w=Object.prototype,U=w.hasOwnProperty,B=typeof Symbol=="function"?Symbol:{},W=B.iterator||"@@iterator",at=B.asyncIterator||"@@asyncIterator",$=B.toStringTag||"@@toStringTag";function p(r,t,n){return Object.defineProperty(r,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),r[t]}try{p({},"")}catch(r){p=function(n,a,o){return n[a]=o}}function x(r,t,n,a){var o=t&&t.prototype instanceof k?t:k,i=Object.create(o.prototype),l=new Y(a||[]);return i._invoke=function(E,g,s){var u="suspendedStart";return function(e,O){if(u==="executing")throw new Error("Generator is already running");if(u==="completed"){if(e==="throw")throw O;return X()}for(s.method=e,s.arg=O;;){var v=s.delegate;if(v){var f=Z(v,s);if(f){if(f===m)continue;return f}}if(s.method==="next")s.sent=s._sent=s.arg;else if(s.method==="throw"){if(u==="suspendedStart")throw u="completed",s.arg;s.dispatchException(s.arg)}else s.method==="return"&&s.abrupt("return",s.arg);u="executing";var b=L(E,g,s);if(b.type==="normal"){if(u=s.done?"completed":"suspendedYield",b.arg===m)continue;return{value:b.arg,done:s.done}}b.type==="throw"&&(u="completed",s.method="throw",s.arg=b.arg)}}}(r,n,l),i}function L(r,t,n){try{return{type:"normal",arg:r.call(t,n)}}catch(a){return{type:"throw",arg:a}}}h.wrap=x;var m={};function k(){}function A(){}function P(){}var G={};p(G,W,function(){return this});var F=Object.getPrototypeOf,S=F&&F(F(I([])));S&&S!==w&&U.call(S,W)&&(G=S);var C=P.prototype=k.prototype=Object.create(G);function V(r){["next","throw","return"].forEach(function(t){p(r,t,function(n){return this._invoke(t,n)})})}function N(r,t){function n(o,i,l,E){var g=L(r[o],r,i);if(g.type!=="throw"){var s=g.arg,u=s.value;return u&&typeof u=="object"&&U.call(u,"__await")?t.resolve(u.__await).then(function(e){n("next",e,l,E)},function(e){n("throw",e,l,E)}):t.resolve(u).then(function(e){s.value=e,l(s)},function(e){return n("throw",e,l,E)})}E(g.arg)}var a;this._invoke=function(o,i){function l(){return new t(function(E,g){n(o,i,E,g)})}return a=a?a.then(l,l):l()}}function Z(r,t){var n=r.iterator[t.method];if(n===void 0){if(t.delegate=null,t.method==="throw"){if(r.iterator.return&&(t.method="return",t.arg=void 0,Z(r,t),t.method==="throw"))return m;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return m}var a=L(n,r.iterator,t.arg);if(a.type==="throw")return t.method="throw",t.arg=a.arg,t.delegate=null,m;var o=a.arg;return o?o.done?(t[r.resultName]=o.value,t.next=r.nextLoc,t.method!=="return"&&(t.method="next",t.arg=void 0),t.delegate=null,m):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,m)}function R(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 T(r){var t=r.completion||{};t.type="normal",delete t.arg,r.completion=t}function Y(r){this.tryEntries=[{tryLoc:"root"}],r.forEach(R,this),this.reset(!0)}function I(r){if(r){var t=r[W];if(t)return t.call(r);if(typeof r.next=="function")return r;if(!isNaN(r.length)){var n=-1,a=function o(){for(;++n<r.length;)if(U.call(r,n))return o.value=r[n],o.done=!1,o;return o.value=void 0,o.done=!0,o};return a.next=a}}return{next:X}}function X(){return{value:void 0,done:!0}}return A.prototype=P,p(C,"constructor",P),p(P,"constructor",A),A.displayName=p(P,$,"GeneratorFunction"),h.isGeneratorFunction=function(r){var t=typeof r=="function"&&r.constructor;return!!t&&(t===A||(t.displayName||t.name)==="GeneratorFunction")},h.mark=function(r){return Object.setPrototypeOf?Object.setPrototypeOf(r,P):(r.__proto__=P,p(r,$,"GeneratorFunction")),r.prototype=Object.create(C),r},h.awrap=function(r){return{__await:r}},V(N.prototype),p(N.prototype,at,function(){return this}),h.AsyncIterator=N,h.async=function(r,t,n,a,o){o===void 0&&(o=Promise);var i=new N(x(r,t,n,a),o);return h.isGeneratorFunction(t)?i:i.next().then(function(l){return l.done?l.value:i.next()})},V(C),p(C,$,"Generator"),p(C,W,function(){return this}),p(C,"toString",function(){return"[object Generator]"}),h.keys=function(r){var t=[];for(var n in r)t.push(n);return t.reverse(),function a(){for(;t.length;){var o=t.pop();if(o in r)return a.value=o,a.done=!1,a}return a.done=!0,a}},h.values=I,Y.prototype={constructor:Y,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(T),!t)for(var n in this)n.charAt(0)==="t"&&U.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=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 n=this;function a(s,u){return l.type="throw",l.arg=t,n.next=s,u&&(n.method="next",n.arg=void 0),!!u}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],l=i.completion;if(i.tryLoc==="root")return a("end");if(i.tryLoc<=this.prev){var E=U.call(i,"catchLoc"),g=U.call(i,"finallyLoc");if(E&&g){if(this.prev<i.catchLoc)return a(i.catchLoc,!0);if(this.prev<i.finallyLoc)return a(i.finallyLoc)}else if(E){if(this.prev<i.catchLoc)return a(i.catchLoc,!0)}else{if(!g)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return a(i.finallyLoc)}}}},abrupt:function(t,n){for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a];if(o.tryLoc<=this.prev&&U.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&(t==="break"||t==="continue")&&i.tryLoc<=n&&n<=i.finallyLoc&&(i=null);var l=i?i.completion:{};return l.type=t,l.arg=n,i?(this.method="next",this.next=i.finallyLoc,m):this.complete(l)},complete:function(t,n){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"&&n&&(this.next=n),m},finish:function(t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.finallyLoc===t)return this.complete(a.completion,a.afterLoc),T(a),m}},catch:function(t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc===t){var o=a.completion;if(o.type==="throw"){var i=o.arg;T(a)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,a){return this.delegate={iterator:I(t),resultName:n,nextLoc:a},this.method==="next"&&(this.arg=void 0),m}},h}var ct=nt.a.TabPane,lt=function(w){var U=w.user,B=w.userDetail,W=w.globalSetting,at=w.dispatch,$=Object(ut.a)(w,["user","userDetail","globalSetting","dispatch"]),p=Object(M.useState)(""),x=Object(K.a)(p,2),L=x[0],m=x[1],k=Object(M.useState)([]),A=Object(K.a)(k,2),P=A[0],G=A[1],F=Object(M.useState)(0),S=Object(K.a)(F,2),C=S[0],V=S[1],N=Object(M.useState)(1),Z=Object(K.a)(N,2),R=Z[0],T=Z[1],Y=Object(M.useState)(!0),I=Object(K.a)(Y,2),X=I[0],r=I[1];Object(M.useEffect)(function(){document.title="\u6211\u7684\u8BA2\u5355",t()},[]);var t=function(){var u=Object(H.a)(j().mark(function e(O){var v,f;return j().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return v={state:"",page:1,per_page:10},r(!0),y.next=4,Object(q.a)("/api/payments.json",{method:"get",params:Object(rt.a)(Object(rt.a)({},v),O)});case 4:f=y.sent,(f==null?void 0:f.orders)&&(G(f==null?void 0:f.orders),V(f==null?void 0:f.count),r(!1));case 6:case"end":return y.stop()}},e)}));return function(O){return u.apply(this,arguments)}}(),n=function(e){if(e===L)return;t({state:e,page:1}),T(1),m(e)},a=[{name:"\u5168\u90E8\u8BA2\u5355",activeKey:""},{name:"\u5F85\u4ED8\u6B3E",activeKey:"unpaid"},{name:"\u5DF2\u5B8C\u6210",activeKey:"payed"},{name:"\u5DF2\u5931\u6548",activeKey:"expired"}],o=function(e){et.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u53D6\u6D88\u8BA2\u5355",content:"\u786E\u5B9A\u53D6\u6D88\u8BE5\u8BA2\u5355\u5417\uFF1F",onOk:function(){var O=Object(H.a)(j().mark(function f(){var b,y;return j().wrap(function(D){for(;;)switch(D.prev=D.next){case 0:return D.next=2,Object(q.a)("/api/payments/".concat(e,"/cancel"),{method:"POST"});case 2:b=D.sent,b.status===0&&(y=P.length===1&&R>1?R-1:R,t({page:y,state:L}),T(y));case 4:case"end":return D.stop()}},f)}));function v(){return O.apply(this,arguments)}return v}()})},i=function(e){et.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u5220\u9664\u8BA2\u5355",content:"\u786E\u5B9A\u5220\u9664\u8BE5\u8BA2\u5355\u5417\uFF1F",onOk:function(){var O=Object(H.a)(j().mark(function f(){var b,y;return j().wrap(function(D){for(;;)switch(D.prev=D.next){case 0:return D.next=2,Object(q.a)("/api/payments/".concat(e,".json"),{method:"DELETE"});case 2:b=D.sent,b.status===0&&(y=P.length===1&&R>1?R-1:R,t({page:y,state:L}),T(y));case 4:case"end":return D.stop()}},f)}));function v(){return O.apply(this,arguments)}return v}()})},l=function(e){Q.c.push("/order/".concat(e==null?void 0:e.subject_id,"/pay?order_num=").concat(e==null?void 0:e.num))},E=function(e){Q.c.push("/order/".concat(e,"/information"))},g=function(e){document.body.scrollIntoView(),t({page:e}),T(e)},s=function(){return _.a.createElement("div",{className:d.a.content},_.a.createElement("div",{className:d.a.listTitle},_.a.createElement("div",{className:d.a.w1},"\u8BA2\u5355\u4FE1\u606F"),_.a.createElement("div",{className:d.a.w2},"\u5355\u4EF7(\u5143)"),_.a.createElement("div",{className:d.a.w3},"\u5B9E\u4ED8\u91D1\u989D(\u5143)"),_.a.createElement("div",{className:d.a.w4},"\u4EA4\u6613\u72B6\u6001"),_.a.createElement("div",{className:d.a.w5},"\u64CD\u4F5C")),P.map(function(e,O){return _.a.createElement("div",{key:O,style:{borderTopWidth:O?1:0},className:d.a.listContent},_.a.createElement("div",{className:d.a.info},_.a.createElement("a",{href:"/paths/".concat(e.subject_id),className:d.a.d1},e.name),_.a.createElement("div",{className:d.a.d2},_.a.createElement("span",null,"\u8BA2\u5355\u7F16\u53F7\uFF1A",e.num),_.a.createElement("span",{style:{marginLeft:22}},e.created_at)),_.a.createElement("div",{className:d.a.d3},"\u8BFE\u7A0B\u6709\u6548\u671F\uFF1A",(e==null?void 0:e.expiration)==="1"&&"\u6C38\u4E45\u6709\u6548",(e==null?void 0:e.expiration)==="2"&&"\u8D2D\u4E70\u540E".concat(e==null?void 0:e.days,"\u5929\u6709\u6548"),(e==null?void 0:e.expiration)==="3"&&"".concat(e==null?void 0:e.start_at,"\u5230").concat(e==null?void 0:e.end_at))),_.a.createElement("div",{className:d.a.unitPrice},_.a.createElement("div",{className:d.a.p},e.price),_.a.createElement("div",{className:d.a.l},e.origin_price)),_.a.createElement("div",{className:d.a.price},e.price),_.a.createElement("div",{className:d.a.status},e.state==="unpaid"?"\u5F85\u652F\u4ED8":e.state==="expired"?"\u5DF2\u5931\u6548":"\u4EA4\u6613\u5B8C\u6210"),_.a.createElement("div",{className:d.a.action},e.state==="unpaid"&&_.a.createElement(J.a,{onClick:function(){return o(e.num)},type:"primary",ghost:!0},"\u53D6\u6D88\u8BA2\u5355"),e.state==="expired"&&_.a.createElement(J.a,{onClick:function(){return i(e.num)},type:"primary",danger:!0,ghost:!0},"\u5220\u9664\u8BA2\u5355"),e.state==="unpaid"&&_.a.createElement(J.a,{onClick:function(){return l(e)},type:"primary"},"\u7EE7\u7EED\u652F\u4ED8"),e.state==="expired"&&_.a.createElement(J.a,{onClick:function(){return E(e.subject_id)},type:"primary"},"\u91CD\u65B0\u8D2D\u4E70")))}))};return _.a.createElement("div",{className:d.a.order},_.a.createElement("div",{className:d.a.title},"\u6211\u7684\u8BA2\u5355"),_.a.createElement(nt.a,{activeKey:L,onChange:n},a.map(function(u){return _.a.createElement(ct,{tab:u.name,key:u.activeKey},_.a.createElement(it.a,{loading:X,active:!0,paragraph:{rows:5}},P.length?s():_.a.createElement(_t.a,null)))})),_.a.createElement(ot.a,{hideOnSinglePage:!0,onChange:function(e){return g(e)},current:R,pageSize:10,total:C}))};z.default=Object(Q.a)(function(h){var w=h.user,U=h.userDetail,B=h.globalSetting;return{user:w,userDetail:U,globalSetting:B}})(lt)}}]);
|