mirror of
https://github.com/v2board/v2board.git
synced 2024-11-14 07:29:13 +08:00
1 line
19 KiB
JavaScript
Vendored
1 line
19 KiB
JavaScript
Vendored
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([[7],{Bl7J:function(e,t,a){"use strict";var n=a("q1tI"),i=a.n(n),s=a("3a4m"),r=a.n(s),l=a("/MKj"),c=a("20nU"),o=a("yWgo");class m extends i.a.Component{constructor(){super(...arguments),this.state={nav:[]}}componentDidMount(){var e=[{title:"\u4eea\u8868\u76d8",type:"item",href:"/dashboard",icon:i.a.createElement("i",{className:"nav-main-link-icon si si-speedometer"})},{title:"\u8ba2\u9605",type:"heading"},{title:"\u6211\u7684\u8ba2\u9605",type:"item",href:"/subscribe",icon:i.a.createElement("i",{className:"nav-main-link-icon si si-badge"})},{title:"\u8d2d\u4e70\u8ba2\u9605",type:"item",href:"/plan",icon:i.a.createElement("i",{className:"nav-main-link-icon si si-bag"})},{title:"\u8d22\u52a1",type:"heading"},{title:"\u6211\u7684\u8ba2\u5355",type:"item",href:"/order",icon:i.a.createElement("i",{className:"nav-main-link-icon si si-list"})},{title:"\u6211\u7684\u9080\u8bf7",type:"item",href:"/invite",icon:i.a.createElement("i",{className:"nav-main-link-icon si si-users"})},{title:"\u7528\u6237",type:"heading"},{title:"\u4e2a\u4eba\u4e2d\u5fc3",type:"item",href:"/profile",icon:i.a.createElement("i",{className:"nav-main-link-icon si si-user"})},{title:"\u6211\u7684\u5de5\u5355",type:"item",href:"/ticket",icon:i.a.createElement("i",{className:"nav-main-link-icon si si-support"})},{title:"\u6d41\u91cf\u660e\u7ec6",type:"item",href:"/traffic",icon:i.a.createElement("i",{className:"nav-main-link-icon si si-bar-chart"})},{title:"\u4f7f\u7528\u6559\u7a0b",type:"item",href:"/tutorial",icon:i.a.createElement("i",{className:"nav-main-link-icon si si-book-open"})}],t=[{title:"\u8fd4\u56de\u7528\u6237\u4e2d\u5fc3",type:"item",href:"/dashboard",icon:i.a.createElement("i",{className:"nav-main-link-icon si si-action-undo"})},{title:"\u4eea\u8868\u76d8",type:"item",href:"/admin/dashboard",icon:i.a.createElement("i",{className:"nav-main-link-icon si si-speedometer"})},{title:"\u8bbe\u7f6e",type:"heading"},{title:"\u7cfb\u7edf\u914d\u7f6e",type:"item",href:"/admin/config/system",icon:i.a.createElement("i",{className:"nav-main-link-icon si si-equalizer"})},{title:"\u652f\u4ed8\u914d\u7f6e",type:"item",href:"/admin/config/payment",icon:i.a.createElement("i",{className:"nav-main-link-icon si si-credit-card"})},{title:"\u670d\u52a1\u5668",type:"heading"},{title:"\u8282\u70b9\u7ba1\u7406",type:"item",href:"/admin/server",icon:i.a.createElement("i",{className:"nav-main-link-icon si si-vector"})},{title:"\u6743\u9650\u7ec4\u7ba1\u7406",type:"item",href:"/admin/server/group",icon:i.a.createElement("i",{className:"nav-main-link-icon si si-wrench"})},{title:"\u8d22\u52a1",type:"heading"},{title:"\u8ba2\u9605\u7ba1\u7406",type:"item",href:"/admin/plan",icon:i.a.createElement("i",{className:"nav-main-link-icon si si-bag"})},{title:"\u8ba2\u5355\u7ba1\u7406",type:"item",href:"/admin/order",icon:i.a.createElement("i",{className:"nav-main-link-icon si si-list"})},{title:"\u4f63\u91d1\u7ba1\u7406",type:"item",href:"/admin/commission",icon:i.a.createElement("i",{className:"nav-main-link-icon si si-user-following"})},{title:"\u4f18\u60e0\u5238\u7ba1\u7406",type:"item",href:"/admin/coupon",icon:i.a.createElement("i",{className:"nav-main-link-icon si si-present"})},{title:"\u7528\u6237",type:"heading"},{title:"\u7528\u6237\u7ba1\u7406",type:"item",href:"/admin/user",icon:i.a.createElement("i",{className:"nav-main-link-icon si si-users"})},{title:"\u516c\u544a\u7ba1\u7406",type:"item",href:"/admin/notice",icon:i.a.createElement("i",{className:"nav-main-link-icon si si-speech"})},{title:"\u5de5\u5355\u7ba1\u7406",type:"item",href:"/admin/ticket",icon:i.a.createElement("i",{className:"nav-main-link-icon si si-support"})},{title:"\u6559\u7a0b\u7ba1\u7406",type:"item",href:"/admin/tutorial",icon:i.a.createElement("i",{className:"nav-main-link-icon si si-bulb"})}];Object(o["c"])("is_admin")&&e.unshift({title:"\u8fd4\u56de\u7ba1\u7406\u4e2d\u5fc3",type:"item",href:"/admin/dashboard",icon:i.a.createElement("i",{className:"nav-main-link-icon si si-action-undo"})}),this.isAdmin()?this.setState({nav:t}):this.setState({nav:e})}renderMenu(e,t,a,n){switch(e){case"heading":return i.a.createElement("li",{className:"nav-main-heading"},t);case"item":return i.a.createElement("li",{className:"nav-main-item"},i.a.createElement("a",{className:"nav-main-link ".concat(this.props.location.pathname===a&&"active"),onClick:()=>{r.a.push(a),this.props.dispatch({type:"header/showNav"})}},n&&n,i.a.createElement("span",{className:"nav-main-link-name"},t)))}}isAdmin(){return-1!==this.props.location.pathname.indexOf("admin")}render(){return i.a.createElement("nav",{id:"sidebar","aria-label":"Main Navigation"},i.a.createElement("div",{className:"smini-visible-block"},i.a.createElement("div",{className:"content-header bg-black-10"},i.a.createElement("a",{className:"link-fx font-size-lg text-white",href:"index.html"},i.a.createElement("span",{className:"text-white-75"},"X"),i.a.createElement("span",{className:"text-white"},"H")))),i.a.createElement("div",{className:"smini-hidden ".concat(1===c["a"].theme?"":"bg-header-dark")},i.a.createElement("div",{className:"content-header justify-content-lg-center bg-black-10"},i.a.createElement("a",{className:"link-fx font-size-lg text-white",href:"index.html"},i.a.createElement("span",{className:"text-white-75"},window.v2board.title?window.v2board.title:"V2Board")),i.a.createElement("div",{className:"d-lg-none"},i.a.createElement("a",{className:"text-white ml-2","data-toggle":"layout","data-action":"sidebar_close",href:"javascript:void(0)",onClick:()=>this.props.dispatch({type:"header/showNav"})},i.a.createElement("i",{className:"fa fa-times-circle"}))))),i.a.createElement("div",{className:"content-side content-side-full"},i.a.createElement("ul",{className:"nav-main"},this.state.nav.map(e=>{return this.renderMenu(e.type,e.title,e.href,e.icon)}))))}}var d=Object(l["c"])(e=>{var t=e.header;return{header:t}})(m),h=a("t3Un");class p extends i.a.Component{constructor(){super(...arguments),this.state={showAvatarMenu:!1,loading:!1,showSearchBar:!1}}componentDidMount(){var e=this;this.props.header.userInfo.email||this.setState({loading:!0},()=>{this.props.dispatch({type:"header/getUserInfo",complete:()=>e.setState({loading:!1})})})}showAvatarMenu(){var e=this;this.setState({showAvatarMenu:!this.state.showAvatarMenu},()=>{document.onclick=function(t){e.state.showAvatarMenu&&e.setState({showAvatarMenu:!1}),document.onclick=void 0}})}logout(){Object(h["a"])("/user/logout").then(e=>{r.a.push("/login")})}render(){return i.a.createElement("header",{id:"page-header"},i.a.createElement("div",{className:"content-header"},i.a.createElement("div",{className:"sidebar-toggle",style:{display:this.props.search?"block":"none"}},i.a.createElement("button",{type:"button",className:"btn btn-dual mr-1 d-lg-none","data-toggle":"layout","data-action":"sidebar_toggle",onClick:()=>this.props.dispatch({type:"header/showNav"})},i.a.createElement("i",{className:"fa fa-fw fa-bars"})),this.props.search&&i.a.createElement("button",{type:"button",className:"btn btn-dual",onClick:()=>{this.setState({showSearchBar:!0})}},i.a.createElement("i",{className:"fa fa-fw fa-search"})," ",i.a.createElement("span",{className:"ml-1 d-none d-sm-inline-block"},"\u641c\u7d22"))),i.a.createElement("div",null),i.a.createElement("div",null,this.state.loading?i.a.createElement("div",{className:"spinner-grow text-primary"}):i.a.createElement("div",{className:"dropdown d-inline-block"},i.a.createElement("button",{type:"button",className:"btn btn-dual",id:"page-header-user-dropdown","data-toggle":"dropdown","aria-haspopup":"true","aria-expanded":"false",onClick:()=>this.showAvatarMenu()},i.a.createElement("img",{className:"img-avatar img-avatar32 img-avatar-thumb",src:this.props.header.userInfo.avatar_url,alt:""}),i.a.createElement("span",{className:"d-none d-lg-inline ml-1"},this.props.header.userInfo.email),i.a.createElement("i",{className:"fa fa-fw fa-angle-down ml-1"})),i.a.createElement("div",{className:"dropdown-menu dropdown-menu-right dropdown-menu-lg p-0 ".concat(this.state.showAvatarMenu&&"show"),"aria-labelledby":"page-header-user-dropdown"},i.a.createElement("div",{className:"p-2"},i.a.createElement("a",{className:"dropdown-item d-flex justify-content-between align-items-center",href:"javascript:void(0)",onClick:()=>this.logout()},"\u9000\u51fa\u767b\u5f55",i.a.createElement("i",{className:"fa fa-fw fa-sign-out-alt text-danger ml-1"}))))))),this.props.search&&i.a.createElement("div",{className:"overlay-header bg-dark ".concat(this.state.showSearchBar?"show":"")},i.a.createElement("div",{className:"content-header bg-dark"},i.a.createElement("div",{className:"w-100"},i.a.createElement("div",{className:"input-group"},i.a.createElement("div",{className:"input-group-prepend"},i.a.createElement("button",{type:"button",className:"btn btn-dark",onClick:()=>{this.setState({showSearchBar:!1})}},i.a.createElement("i",{className:"fa fa-fw fa-times-circle"}))),i.a.createElement("input",{type:"text",className:"form-control border-0",placeholder:this.props.search.placeholder,onChange:e=>this.props.search.onChange(e.target.value),defaultValue:this.props.search.defaultValue}))))))}}var u=Object(l["c"])(e=>{var t=e.header;return{header:t}})(p);class E extends i.a.Component{render(){return i.a.createElement("footer",{id:"page-footer",className:"bg-body-light"},i.a.createElement("div",{className:"content py-0"},i.a.createElement("div",{className:"row font-size-sm"},i.a.createElement("div",{className:"col-sm-6 order-sm-2 mb-1 mb-sm-0 text-center text-sm-right"},i.a.createElement("i",{className:"fa fa-heart text-danger"})," ",window.v2board.title?window.v2board.title:"V2Board"),i.a.createElement("div",{className:"col-sm-6 order-sm-1 text-center text-sm-left"},i.a.createElement("a",{className:"font-w600",href:"javascript:void(0)"},window.v2board.title?window.v2board.title:"V2Board"," v1.0.2"),i.a.createElement("span",{"data-toggle":"year-copy"})))))}}class v extends i.a.Component{render(){return i.a.createElement("div",{id:"page-container",className:"sidebar-o ".concat(1===c["a"].theme?"sidebar-dark":"page-header-dark"," side-scroll page-header-fixed main-content-boxed side-trans-enabled ").concat(this.props.header.showNav&&"sidebar-o-xs")},i.a.createElement(d,this.props),i.a.createElement(u,{search:this.props.search}),this.props.loading?i.a.createElement("main",{id:"main-container"},i.a.createElement("div",{className:"content content-full"},i.a.createElement("div",{className:"spinner-grow text-primary",role:"status"},i.a.createElement("span",{className:"sr-only"},"Loading...")))):this.props.children,i.a.createElement(E,null))}}t["a"]=Object(l["c"])(e=>{var t=e.header;return{header:t}})(v)},GSUD:function(e,t,a){"use strict";a.r(t),a.d(t,"default",function(){return w});var n=a("jehZ"),i=a.n(n),s=(a("g9YV"),a("wCAj")),r=(a("qVdP"),a("jsC+")),l=(a("Awhp"),a("KrTs")),c=(a("lUTK"),a("BvKs")),o=(a("5Dmo"),a("3S7+")),m=(a("Pwec"),a("CtXQ")),d=(a("+BJd"),a("mr32")),h=(a("miYZ"),a("tsqr")),p=a("p0pE"),u=a.n(p),E=a("q1tI"),v=a.n(E),g=a("Bl7J"),f=a("t3Un"),y=a("LbTH"),b=a("wd/R"),N=a.n(b),k=a("p8mO");class w extends v.a.Component{constructor(){super(...arguments),this.state={orders:[],pagination:{current:1,pageSize:10,total:0},trade_no:void 0,loading:!0,selectOrder:void 0}}componentDidMount(){this.fetchData()}paginationOnChange(e){this.setState({pagination:e},()=>this.fetchData())}fetchData(){var e;e=u()({},this.state.pagination),this.state.trade_no&&Object.assign(e,{trade_no:this.state.trade_no}),Object(f["a"])("/admin/order/fetch",e).then(e=>{200===e.code&&this.setState({orders:e.data,pagination:u()({},this.state.pagination,{total:e.total}),loading:!1})})}searchOnChange(e){this.inputDelayTimer&&clearTimeout(this.inputDelayTimer),this.inputDelayTimer=setTimeout(function(){this.inputDelayTimer=null,this.setState({trade_no:e,pagination:u()({},this.state.pagination,{current:1})},()=>{this.fetchData()})}.bind(this),400)}update(e,t){Object(f["b"])("/admin/order/update",{trade_no:e,status:t}).then(e=>{200===e.code&&e.data&&(h["a"].success("\u64cd\u4f5c\u6210\u529f"),this.fetchData())})}render(){var e=[{title:"# \u8ba2\u5355\u53f7",dataIndex:"trade_no",key:"trade_no",render:(e,t)=>{return v.a.createElement("a",{href:"javascript:void(0)",onClick:()=>this.setState({selectOrder:t})},e)}},{title:"\u8ba2\u9605\u8ba1\u5212",dataIndex:"plan_name",key:"plan_name"},{title:"\u5468\u671f",dataIndex:"cycle",key:"cycle",align:"center",render:(e,t)=>{return v.a.createElement(d["a"],{color:"#415A94"},y["a"].cycleText[t.cycle])}},{title:"\u8ba2\u5355\u91d1\u989d",dataIndex:"total_amount",key:"total_amount",align:"right",render:e=>{return(e/100).toFixed(2)}},{title:v.a.createElement("span",null,v.a.createElement(o["a"],{placement:"top",title:"\u6807\u8bb0\u4e3a[\u5df2\u652f\u4ed8]\u540e\u5c06\u4f1a\u7531\u7cfb\u7edf\u8fdb\u884c\u5f00\u901a\u540e\u5e76\u5b8c\u6210"},"\u8ba2\u5355\u72b6\u6001 ",v.a.createElement(m["a"],{type:"question-circle"}))),dataIndex:"status",key:"status",render:(e,t)=>{var a=["error","processing","default","success"];return v.a.createElement("div",null,v.a.createElement(r["a"],{trigger:["click"],overlay:v.a.createElement(c["a"],null,v.a.createElement(c["a"].Item,{key:"0",disabled:0===e,onClick:e=>{this.update(t.trade_no,e.key)}},"\u672a\u652f\u4ed8"),v.a.createElement(c["a"].Item,{key:"1",disabled:1===e,onClick:e=>{this.update(t.trade_no,e.key)}},"\u5df2\u652f\u4ed8"),v.a.createElement(c["a"].Item,{key:"2",disabled:2===e,onClick:e=>{this.update(t.trade_no,e.key)}},"\u5df2\u53d6\u6d88"),v.a.createElement(c["a"].Item,{key:"3",disabled:3===e,onClick:e=>{this.update(t.trade_no,e.key)}},"\u5df2\u5b8c\u6210"))},v.a.createElement("div",null,v.a.createElement(l["a"],{status:a[e]}),v.a.createElement("span",null,y["a"].orderStatusText[e]," "),v.a.createElement("a",{href:"javascript:void(0)"},"\u6807\u8bb0\u4e3a ",v.a.createElement(m["a"],{type:"caret-down"})))))}},{title:"\u521b\u5efa\u65f6\u95f4",dataIndex:"created_at",key:"created_at",align:"right",render:e=>{return N()(1e3*e).format("YYYY/MM/DD HH:mm")}}];return v.a.createElement(g["a"],i()({},this.props,{loading:this.state.loading,search:{placeholder:"\u901a\u8fc7\u8ba2\u5355\u53f7\u641c\u7d22",onChange:e=>this.searchOnChange(e)}}),v.a.createElement("main",{id:"main-container"},v.a.createElement("div",{className:"content content-full"},v.a.createElement("div",{className:"d-flex justify-content-between align-items-center"},v.a.createElement("h2",{className:"font-w300 mt-4 mb-3"},"\u8ba2\u5355\u7ba1\u7406")),v.a.createElement("div",{className:"bg-white"},v.a.createElement(s["a"],{dataSource:this.state.orders,pagination:u()({},this.state.pagination,{size:"small"}),columns:e,scroll:{x:1050},onChange:e=>this.paginationOnChange(e)})))),v.a.createElement(k["a"],{order:this.state.selectOrder,onClose:()=>this.setState({selectOrder:void 0})}))}}},LbTH:function(e,t,a){"use strict";t["a"]={cycleText:{month_price:"\u6708\u4ed8",quarter_price:"\u5b63\u4ed8",half_year_price:"\u534a\u5e74\u4ed8",year_price:"\u5e74\u4ed8"},orderStatusText:["\u5f85\u652f\u4ed8","\u5f00\u901a\u4e2d","\u5df2\u53d6\u6d88","\u5df2\u5b8c\u6210"],commissionStatusText:["\u786e\u8ba4\u4e2d","\u5df2\u786e\u8ba4","\u5df2\u5b8c\u6210"],ticketStatusText:["\u5f00\u542f","\u5f85\u56de\u590d","\u5f85\u7b54\u590d","\u5173\u95ed"]}},p8mO:function(e,t,a){"use strict";a.d(t,"a",function(){return v});a("2qtc");var n=a("kLXV"),i=(a("Pwec"),a("CtXQ")),s=(a("/zsF"),a("PArb")),r=(a("14J3"),a("BMrR")),l=(a("jCWc"),a("kPKH")),c=a("q1tI"),o=a.n(c),m=a("t3Un"),d=a("LbTH"),h=a("wd/R"),p=a.n(h),u=a("3a4m"),E=a.n(u);class v extends o.a.Component{constructor(){super(...arguments),this.state={order:{},user:{},invite_user:{}}}componentDidUpdate(){this.getUserInfo()}getUserInfo(){this.state.user.email||this.props.order&&(Object(m["a"])("/admin/user/id2UserInfo/"+this.props.order.user_id).then(e=>{200===e.code&&this.setState({user:e.data,order:this.props.order})}),this.props.order.invite_user_id&&Object(m["a"])("/admin/user/id2UserInfo/"+this.props.order.invite_user_id).then(e=>{this.setState({invite_user:e.data})}))}render(){var e={marginBottom:10};return console.log(this.props,this.state),o.a.createElement(n["a"],{visible:this.props.order,title:"\u8ba2\u5355\u4fe1\u606f",onCancel:()=>{this.setState({order:{},user:{}}),this.props.onClose()},footer:!1},this.state.user.email?o.a.createElement("div",null,o.a.createElement(r["a"],{gutter:[16,16],style:e},o.a.createElement(l["a"],{span:6},"\u90ae\u7bb1"),o.a.createElement(l["a"],{span:18},o.a.createElement("a",{onClick:()=>E.a.push("/admin/user?email="+this.state.user.email),href:"javascript:void(0)"},this.state.user.email))),o.a.createElement(r["a"],{gutter:[16,16],style:e},o.a.createElement(l["a"],{span:6},"\u8ba2\u5355\u53f7"),o.a.createElement(l["a"],{span:18},this.state.order.trade_no)),o.a.createElement(r["a"],{gutter:[16,16],style:e},o.a.createElement(l["a"],{span:6},"\u8ba2\u5355\u91d1\u989d"),o.a.createElement(l["a"],{span:18},(this.state.order.total_amount/100).toFixed(2))),o.a.createElement(r["a"],{gutter:[16,16],style:e},o.a.createElement(l["a"],{span:6},"\u8ba2\u5355\u5468\u671f"),o.a.createElement(l["a"],{span:18},d["a"].cycleText[this.state.order.cycle])),o.a.createElement(r["a"],{gutter:[16,16],style:e},o.a.createElement(l["a"],{span:6},"\u8ba2\u5355\u72b6\u6001"),o.a.createElement(l["a"],{span:18},d["a"].orderStatusText[this.state.order.status])),o.a.createElement(r["a"],{gutter:[16,16],style:e},o.a.createElement(l["a"],{span:6},"\u8ba2\u9605\u8ba1\u5212"),o.a.createElement(l["a"],{span:18},this.state.order.plan_name)),o.a.createElement(r["a"],{gutter:[16,16],style:e},o.a.createElement(l["a"],{span:6},"\u7f51\u5173\u5355\u53f7"),o.a.createElement(l["a"],{span:18},this.state.order.callback_no?this.state.order.callback_no:"-")),o.a.createElement(s["a"],null),o.a.createElement(r["a"],{gutter:[16,16],style:e},o.a.createElement(l["a"],{span:6},"\u521b\u5efa\u65f6\u95f4"),o.a.createElement(l["a"],{span:18},p()(1e3*this.state.order.created_at).format("YYYY/MM/DD HH:mm:ss"))),o.a.createElement(r["a"],{gutter:[16,16],style:e},o.a.createElement(l["a"],{span:6},"\u66f4\u65b0\u65f6\u95f4"),o.a.createElement(l["a"],{span:18},p()(1e3*this.state.order.updated_at).format("YYYY/MM/DD HH:mm:ss"))),this.state.order.invite_user_id&&o.a.createElement("div",null,o.a.createElement(s["a"],null),o.a.createElement(r["a"],{gutter:[16,16],style:e},o.a.createElement(l["a"],{span:6},"\u9080\u8bf7\u4eba"),o.a.createElement(l["a"],{span:18},o.a.createElement("a",{onClick:()=>E.a.push("/admin/user?email="+this.state.invite_user.email),href:"javascript:void(0)"},this.state.invite_user.email))),o.a.createElement(r["a"],{gutter:[16,16],style:e},o.a.createElement(l["a"],{span:6},"\u4f63\u91d1\u91d1\u989d"),o.a.createElement(l["a"],{span:18},(this.state.order.commission_balance/100).toFixed(2))),o.a.createElement(r["a"],{gutter:[16,16],style:e},o.a.createElement(l["a"],{span:6},"\u4f63\u91d1\u72b6\u6001"),o.a.createElement(l["a"],{span:18},d["a"].commissionStatusText[this.state.order.commission_status])))):o.a.createElement(i["a"],{type:"loading",style:{fontSize:24,color:"#415A94"}}))}}}}]); |