Commit 8e19687c authored by lvxiaowu's avatar lvxiaowu

build

parent 96619cbc
GENERATE_SOURCEMAP=false
PUBLIC_URL=//r.51gjj.com/webpublic/51data
\ No newline at end of file
{
"files": {
"main.css": "//r.51gjj.com/webpublic/51data/static/css/main.f28907b4.chunk.css",
"main.js": "//r.51gjj.com/webpublic/51data/static/js/main.62bac694.chunk.js",
"runtime-main.js": "//r.51gjj.com/webpublic/51data/static/js/runtime-main.957298b0.js",
"static/css/2.42c51de4.chunk.css": "//r.51gjj.com/webpublic/51data/static/css/2.42c51de4.chunk.css",
"static/js/2.36c05a7c.chunk.js": "//r.51gjj.com/webpublic/51data/static/js/2.36c05a7c.chunk.js",
"index.html": "//r.51gjj.com/webpublic/51data/index.html",
"precache-manifest.4e61846d9980528690f2768c1d2c9491.js": "//r.51gjj.com/webpublic/51data/precache-manifest.4e61846d9980528690f2768c1d2c9491.js",
"service-worker.js": "//r.51gjj.com/webpublic/51data/service-worker.js",
"static/js/2.36c05a7c.chunk.js.LICENSE.txt": "//r.51gjj.com/webpublic/51data/static/js/2.36c05a7c.chunk.js.LICENSE.txt"
},
"entrypoints": [
"static/js/runtime-main.957298b0.js",
"static/css/2.42c51de4.chunk.css",
"static/js/2.36c05a7c.chunk.js",
"static/css/main.f28907b4.chunk.css",
"static/js/main.62bac694.chunk.js"
]
}
\ No newline at end of file
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="//r.51gjj.com/webpublic/images/2020523/oyed3Mkrvrpdg.png"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="趣选课合作后台"/><title>趣选课合作后台</title><link href="//r.51gjj.com/webpublic/51data/static/css/2.42c51de4.chunk.css" rel="stylesheet"><link href="//r.51gjj.com/webpublic/51data/static/css/main.f28907b4.chunk.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><script>!function(e){function t(t){for(var n,a,l=t[0],i=t[1],f=t[2],c=0,s=[];c<l.length;c++)a=l[c],Object.prototype.hasOwnProperty.call(o,a)&&o[a]&&s.push(o[a][0]),o[a]=0;for(n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n]);for(p&&p(t);s.length;)s.shift()();return u.push.apply(u,f||[]),r()}function r(){for(var e,t=0;t<u.length;t++){for(var r=u[t],n=!0,l=1;l<r.length;l++){var i=r[l];0!==o[i]&&(n=!1)}n&&(u.splice(t--,1),e=a(a.s=r[0]))}return e}var n={},o={1:0},u=[];function a(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,a),r.l=!0,r.exports}a.m=e,a.c=n,a.d=function(e,t,r){a.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(e,t){if(1&t&&(e=a(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(a.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)a.d(r,n,function(t){return e[t]}.bind(null,n));return r},a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,"a",t),t},a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a.p="//r.51gjj.com/webpublic/51data/";var l=this["webpackJsonpantd-demo-ts"]=this["webpackJsonpantd-demo-ts"]||[],i=l.push.bind(l);l.push=t,l=l.slice();for(var f=0;f<l.length;f++)t(l[f]);var p=i;r()}([])</script><script src="//r.51gjj.com/webpublic/51data/static/js/2.36c05a7c.chunk.js"></script><script src="//r.51gjj.com/webpublic/51data/static/js/main.62bac694.chunk.js"></script></body></html>
\ No newline at end of file
{
"short_name": "React App",
"name": "Create React App Sample",
"icons": [
{
"src": "favicon.ico",
"sizes": "64x64 32x32 24x24 16x16",
"type": "image/x-icon"
},
{
"src": "logo192.png",
"type": "image/png",
"sizes": "192x192"
},
{
"src": "logo512.png",
"type": "image/png",
"sizes": "512x512"
}
],
"start_url": ".",
"display": "standalone",
"theme_color": "#000000",
"background_color": "#ffffff"
}
self.__precacheManifest = (self.__precacheManifest || []).concat([
{
"revision": "e436c9120501de191b769c44d9b20685",
"url": "//r.51gjj.com/webpublic/51data/index.html"
},
{
"revision": "625409d56b084fed300a",
"url": "//r.51gjj.com/webpublic/51data/static/css/2.42c51de4.chunk.css"
},
{
"revision": "1716b73f3baeddbc6d28",
"url": "//r.51gjj.com/webpublic/51data/static/css/main.f28907b4.chunk.css"
},
{
"revision": "625409d56b084fed300a",
"url": "//r.51gjj.com/webpublic/51data/static/js/2.36c05a7c.chunk.js"
},
{
"revision": "3453b8997016469371284a28c0e873e2",
"url": "//r.51gjj.com/webpublic/51data/static/js/2.36c05a7c.chunk.js.LICENSE.txt"
},
{
"revision": "1716b73f3baeddbc6d28",
"url": "//r.51gjj.com/webpublic/51data/static/js/main.62bac694.chunk.js"
},
{
"revision": "dfdbbf4c5951bf627667",
"url": "//r.51gjj.com/webpublic/51data/static/js/runtime-main.957298b0.js"
}
]);
\ No newline at end of file
# https://www.robotstxt.org/robotstxt.html
User-agent: *
Disallow:
/**
* Welcome to your Workbox-powered service worker!
*
* You'll need to register this file in your web app and you should
* disable HTTP caching for this file too.
* See https://goo.gl/nhQhGp
*
* The rest of the code is auto-generated. Please don't update this file
* directly; instead, make changes to your Workbox build configuration
* and re-run your build process.
* See https://goo.gl/2aRDsh
*/
importScripts("https://storage.googleapis.com/workbox-cdn/releases/4.3.1/workbox-sw.js");
importScripts(
"//r.51gjj.com/webpublic/51data/precache-manifest.4e61846d9980528690f2768c1d2c9491.js"
);
self.addEventListener('message', (event) => {
if (event.data && event.data.type === 'SKIP_WAITING') {
self.skipWaiting();
}
});
workbox.core.clientsClaim();
/**
* The workboxSW.precacheAndRoute() method efficiently caches and responds to
* requests for URLs in the manifest.
* See https://goo.gl/S9QRab
*/
self.__precacheManifest = [].concat(self.__precacheManifest || []);
workbox.precaching.precacheAndRoute(self.__precacheManifest, {});
workbox.routing.registerNavigationRoute(workbox.precaching.getCacheKeyForURL("//r.51gjj.com/webpublic/51data/index.html"), {
blacklist: [/^\/_/,/\/[^\/?]+\.[^\/]+$/],
});
This source diff could not be displayed because it is too large. You can view the blob instead.
body{margin:0;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Roboto","Oxygen","Ubuntu","Cantarell","Fira Sans","Droid Sans","Helvetica Neue",sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}code{font-family:source-code-pro,Menlo,Monaco,Consolas,"Courier New",monospace}.sider-menu .menu-header{color:#fff;height:64px;position:relative;line-height:64px;transition:all .3s;background:#002140}.sider-menu .menu-header .home{display:flex;align-items:center;justify-content:center}.sider-menu .menu-header .logo{height:32px;width:32px;display:inline-block;margin-right:10px}.sider-menu .menu-header .title{color:#fff;font-size:16px;font-weight:700}.site-layout-background{padding:0;background:#fff;display:flex;align-items:center;justify-content:space-between}.site-layout-background .trigger{font-size:18px;line-height:64px;padding:0 24px;cursor:pointer;transition:color .3s}.site-layout-background .trigger:hover{color:#1890ff}.loginPane{position:relative;width:70vw;min-width:960px;display:block;margin:0 auto;padding-top:20vh}.login-inline{display:inline-block;vertical-align:middle}.loginItem{margin:15px 0}.btn{width:100%;border-radius:5px;outline:none;border:none;height:40px;font-size:16px}.btn_act{background-color:#008b8b;color:#fff}
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
/*
object-assign
(c) Sindre Sorhus
@license MIT
*/
/*!
Copyright (c) 2017 Jed Watson.
Licensed under the MIT License (MIT), see
http://jedwatson.github.io/classnames
*/
/** @license React v0.19.1
* scheduler.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
/** @license React v16.13.1
* react-dom.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
/** @license React v16.13.1
* react-is.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
/** @license React v16.13.1
* react.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
(this["webpackJsonpantd-demo-ts"]=this["webpackJsonpantd-demo-ts"]||[]).push([[0],{217:function(e,t,a){e.exports=a(420)},222:function(e,t,a){},409:function(e,t,a){},410:function(e,t,a){},418:function(e,t,a){},419:function(e,t,a){},420:function(e,t,a){"use strict";a.r(t);var n=a(0),r=a.n(n),c=a(4),o=a.n(c),l=(a(222),a(42)),i=a(13),s=(a(40),a(7)),u=(a(160),a(82)),m=(a(161),a(48)),d=(a(84),a(22)),p=a(5),f=(a(421),a(213)),g=(a(134),a(26)),h=a(214),E=a(36),b=a.n(E),y=(a(229),a(191),a(83)),w=y.a.Column,O=[{title:"\u8ba2\u5355\u53f7",dataIndex:"order_no",key:"order_no"},{title:"\u5df2\u8d2d\u8bfe\u7a0b\u540d\u79f0",dataIndex:"class_name",key:"class_name"},{title:"\u7528\u6237\u59d3\u540d",dataIndex:"address",key:"address",render:function(e){return r.a.createElement("span",null,e.name)}},{title:"\u6536\u8d27\u5730\u5740",dataIndex:"address",key:"address",render:function(e){return r.a.createElement("span",null,e.province,e.city,e.area,e.address)}},{title:"\u8054\u7cfb\u7535\u8bdd",dataIndex:"address",key:"address",render:function(e){return r.a.createElement("span",null,e.phone)}},{title:"\u4ed8\u6b3e\u91d1\u989d\uff08\u5143\uff09",dataIndex:"pay",key:"pay"},{title:"\u4e0b\u5355\u65f6\u95f4",dataIndex:"pay_time",key:"pay_time"}],j=function(e){return r.a.createElement("div",{style:{padding:"30px"}},r.a.createElement(y.a,{rowKey:function(e){return e.id||"key"},dataSource:e.dataSource,onChange:e.handleTableChange,pagination:{pageSize:e.pageSize,current:e.current,total:e.totalCount,showSizeChanger:!0,showTotal:function(e,t){return"".concat(t[1]-t[0]+1," of ").concat(e," items")}}},O.map((function(e){return r.a.createElement(w,Object.assign({},e,{key:e.key}))}))))},v=(a(188),a(59)),S=(a(189),a(96)),k=(a(163),a(78)),x=(a(109),a(35)),C=(a(190),a(25)),_=a(423),I=a(122),N=a(203),T=a.n(N),z=function(e,t){if("get"===e){var a="";for(var n in t)a+="".concat(n,"=").concat(t[n],"&");return a.substr(0,a.length-1)}return JSON.stringify(t)};function A(e,t){var a=window.location.host,n=t.type||"POST",r=a.match(/(127.0.0.1|localhost)/)?"https://uat-nginx.jianbing.com".concat(e):e;return r="GET"===n?"".concat(r,"?").concat(z("get",t.data)):r,T()(r,{method:n,headers:Object(I.a)({"Content-Type":"application/json;charset=utf-8",Authorization:window.localStorage.getItem("token")},t.header),body:"GET"===n?"":z("post",t.data)}).then((function(e){if(200===e.status)return t.responseType?e[t.responseType]():e.json();e.status.toString().match(/40./)&&e.json().then((function(e){var t=e.error||e.msg||"error";x.a.error(t)}))})).catch((function(e){return new Error(e)}))}var K=function(){var e=Object(n.useState)(!1),t=Object(p.a)(e,2),a=t[0],c=t[1],o=Object(n.useState)(!1),l=Object(p.a)(o,2),i=l[0],u=l[1],m=Object(n.useState)(""),f=Object(p.a)(m,2),g=f[0],h=f[1],E=Object(n.useState)(""),b=Object(p.a)(E,2),y=b[0],w=b[1],O=Object(n.useState)(""),j=Object(p.a)(O,2),v=j[0],I=j[1],N=Object(n.useState)(""),T=Object(p.a)(N,2),z=T[0],K=T[1];Object(n.useEffect)((function(){K(window.localStorage.getItem("user"))}),[]);var F=C.a.Item,P=r.a.createElement(C.a,null,r.a.createElement(F,{onClick:function(){return c(!0)}},"\u9000\u51fa\u767b\u5f55")),R=function(){window.localStorage.removeItem("user"),window.localStorage.removeItem("token"),c(!1),window.localStorage.removeItem("routerConf"),window.location.href="/inclass/login"},B=function(){A("/yizhi_server/api/user/password",{type:"PUT",data:{password:y,confirm_password:g}}).then((function(e){e.msg&&(e.msg.match(/\u6210\u529f/)?(x.a.info("".concat(e.msg,"\uff0c\u8bf7\u91cd\u65b0\u767b\u5f55")),c(!1),setTimeout((function(){R()}),1e3)):x.a.info(e.msg))}))},Y=function(e,t){var a=e.target.value;({o_pwd:function(){return I(a)},password:function(){return w(a)},confirm_password:function(){return h(a)}})[t]()};return r.a.createElement(r.a.Fragment,null,r.a.createElement(k.a,{overlay:P},r.a.createElement(s.a,{type:"link"},z," ",r.a.createElement(_.a,null))),r.a.createElement(S.a,{title:"",width:"300px",visible:a,onOk:R,onCancel:function(){return c(!1)}},r.a.createElement("p",{style:{fontSize:"18px"}},"\u662f\u5426\u9000\u51fa\u767b\u5f55\uff1f")),r.a.createElement(S.a,{title:"\u4fee\u6539\u5bc6\u7801",width:"400px",visible:i,onOk:function(){v&&y&&g?g===y?B():x.a.error("\u5bc6\u7801\u4e0d\u4e00\u81f4"):x.a.info("\u8f93\u5165\u6846\u4e0d\u80fd\u4e3a\u7a7a")},onCancel:function(){return u(!1)}},r.a.createElement("div",null,r.a.createElement(d.a,{size:"large",placeholder:"\u8bf7\u8f93\u5165\u4f60\u7684\u539f\u5bc6\u7801",addonBefore:"\u539f\u5bc6\u7801",defaultValue:"",autoComplete:"off",onChange:function(e){return Y(e,"o_pwd")}}),r.a.createElement("div",{style:{height:"20px"}}),r.a.createElement(d.a.Password,{size:"large",placeholder:"\u8bf7\u8f93\u5165\u4f60\u7684\u65b0\u5bc6\u7801",addonBefore:"\u65b0\u5bc6\u7801",defaultValue:"",autoComplete:"new-password",onChange:function(e){return Y(e,"password")}}),r.a.createElement("div",{style:{height:"20px"}}),r.a.createElement(d.a.Password,{size:"large",defaultValue:"",autoComplete:"new-password",placeholder:"\u8bf7\u518d\u6b21\u8f93\u5165\u4f60\u7684\u65b0\u5bc6\u7801",addonBefore:"\u786e\u8ba4\u65b0\u5bc6\u7801",onChange:function(e){return Y(e,"confirm_password")}}))))},F=a(422),P=Object(F.a)({scriptUrl:"//at.alicdn.com/t/font_n8ucanheuka6pqfr.js"}),R=v.a.Sider,B=C.a.SubMenu,Y=function(e){var t=Object(n.useState)(window.localStorage.getItem("menu_defKey")||"1"),a=Object(p.a)(t,2),c=a[0],o=a[1],i=Object(n.useState)(window.localStorage.getItem("menu_openKey")||"1"),s=Object(p.a)(i,2),u=s[0],m=s[1],d=window.localStorage.getItem("routerConf")||"";d||(window.location.href="/inclass/login");var f=JSON.parse(d);Object(n.useEffect)((function(){g(f)}),[]);var g=function(t){var a=e.pathName,n=function(e,t,n){e.path===a&&(o(t),m(n),window.localStorage.setItem("menu_defKey",t),window.localStorage.setItem("menu_openKey",n))};t.map((function(e){0===e.subs.length&&n(e,String(e.id),String(e.id)),e.subs.length&&e.subs.map((function(t){n(t,String(t.id),String(e.id))}))}))},h=function(e){return r.a.createElement(P,{type:e})},E=function(e){return r.a.createElement(C.a.Item,{key:e.id,icon:h(e.icon)},r.a.createElement(l.b,{to:e.path},e.title))};return r.a.createElement(r.a.Fragment,null,r.a.createElement(R,{trigger:null,collapsible:!0,collapsed:e.collapsed,className:"sider-menu",style:e.style},e.collapsed?null:r.a.createElement("div",{className:"menu-header"},r.a.createElement(l.b,{to:"/orderList",className:"home"},r.a.createElement("img",{className:"logo",src:"//r.51gjj.com/webpublic/images/2020523/oyed3Mkrvrpdg.png",alt:""}),r.a.createElement("div",{className:"title"},"\u8da3\u9009\u8bfe\u5408\u4f5c\u540e\u53f0"))),r.a.createElement(C.a,{theme:"dark",defaultSelectedKeys:[c],defaultOpenKeys:[u],selectedKeys:[c],mode:"inline",onClick:function(e){o(e.key);var t=e.keyPath[e.keyPath.length-1];m(t),window.localStorage.setItem("menu_defKey",e.key),window.localStorage.setItem("menu_openKey",t)}},f.map((function(e){return e.subs&&e.subs.length>0?r.a.createElement(B,{key:e.id,icon:h(e.icon),title:e.title},e.subs.map((function(e){return E(e)}))):E(e)})))))},G=(a(409),a(424)),J=a(425),L=v.a.Header,M=v.a.Footer,D=v.a.Content,W=function(){return Object(n.useEffect)((function(){window.location.href="/inclass/login"}),[]),null},q=Object(i.f)((function(e){var t=Object(n.useState)(!1),a=Object(p.a)(t,2),c=a[0],o=a[1],l=Object(n.useState)(200),i=Object(p.a)(l,2),s=i[0],u=i[1];return sessionStorage.getItem("token")||888?r.a.createElement(v.a,{style:{minHeight:"100vh"}},r.a.createElement(Y,{collapsed:c,pathName:e.match.path,style:{overflow:"auto",height:"100vh",position:"fixed",left:0,width:s}}),r.a.createElement(v.a,{className:"site-layout",style:{paddingLeft:s}},r.a.createElement(L,{className:"site-layout-background"},r.a.createElement(c?G.a:J.a,{className:"trigger",onClick:function(){u(c?200:80),o(!c)}}),r.a.createElement(K,null)),r.a.createElement(D,{style:{padding:"50px 20px",marginTop:20,background:"#fff"}},e.children),r.a.createElement(M,null,r.a.createElement("div",{style:{textAlign:"center"}},r.a.createElement("p",null,"\xa92020 - \u8da3\u9009\u8bfe"),r.a.createElement("p",null,"\u5982\u6709\u95ee\u9898\uff0c\u8bf7\u8054\u7cfb\u6280\u672f"))))):r.a.createElement(W,null)})),U=function(e,t){var a=new Blob([e],{type:"application/vnd.ms-excel"}),n=URL.createObjectURL(a),r=document.createElement("a");r.download="".concat(t,".xlsx"),r.href=n,r.click()},Q=(a(410),g.a.Item),V=f.a.RangePicker;b.a.locale("zh-cn");var H=function(){var e=Object(n.useState)(""),t=Object(p.a)(e,2),a=t[0],c=t[1],o=Object(n.useState)(""),l=Object(p.a)(o,2),i=l[0],f=l[1],E=Object(n.useState)(""),y=Object(p.a)(E,2),w=y[0],O=y[1],v=Object(n.useState)(""),S=Object(p.a)(v,2),k=S[0],x=S[1],C=Object(n.useState)([]),_=Object(p.a)(C,2),I=_[0],N=_[1],T=Object(n.useState)(0),z=Object(p.a)(T,2),K=z[0],F=z[1],P=Object(n.useState)(1),R=Object(p.a)(P,2),B=R[0],Y=R[1],G=Object(n.useState)(2),J=Object(p.a)(G,2),L=J[0],M=J[1],D=g.a.useForm(),W=Object(p.a)(D,1)[0];Object(n.useEffect)((function(){H({class_name:a,user_name:i,start_date:w,end_date:k,current:B,limit:L})}),[]);var H=function(e){e.class_name,e.user_name,e.start_date,e.end_date;var t=e.current,a=void 0===t?1:t,n=e.limit;A("/51business/api/course/back/order",{type:"GET",data:{page:a,limit:void 0===n?2:n}}).then((function(e){console.log(e),N(e.list),F(e.total_count)}))},$=function(e,t){var a={class_name:function(){return c(t)},user_name:function(){return f(t)},dates:function(){var e=t&&b()(t[0]).format("YYYY-MM-DD")||"",a=t&&b()(t[1]).format("YYYY-MM-DD")||"";O(e),x(a)}};a[e]&&a[e]()};return r.a.createElement(q,null,r.a.createElement("div",{className:"analy-content"},r.a.createElement(g.a,Object.assign({},{labelCol:{xs:{span:24},sm:{span:10},md:{span:10}},wrapperCol:{xs:{span:24},sm:{span:18},md:{span:18}}},{form:W,onFinish:function(){Y(1),M(2),H({class_name:a,user_name:i,start_date:w,end_date:k,current:1,limit:2})}}),r.a.createElement(u.a,{gutter:{xs:8,sm:16,md:24}},r.a.createElement(m.a,{span:"6"},r.a.createElement(Q,{label:"\u5df2\u8d2d\u8bfe\u7a0b\u540d\u79f0\uff1a",name:"class_name"},r.a.createElement(d.a,{placeholder:"\u8bf7\u8f93\u5165",onChange:function(e){$("class_name",e.target.value)}}))),r.a.createElement(m.a,{span:"6"},r.a.createElement(Q,{label:"\u7528\u6237\u59d3\u540d\uff1a",name:"userName"},r.a.createElement(d.a,{placeholder:"\u8bf7\u8f93\u5165",onChange:function(e){$("userName",e.target.value)}}))),r.a.createElement(m.a,{span:"6"},r.a.createElement(Q,{label:"\u4e0b\u5355\u65f6\u95f4\uff1a",name:"dates"},r.a.createElement(V,{locale:h.a,onCalendarChange:function(e){$("dates",e)}})))),r.a.createElement(u.a,Object.assign({style:{padding:"12px 0"}},{gutter:{xs:8,sm:16,md:24}}),r.a.createElement(m.a,{md:12,sm:24},r.a.createElement(s.a,{type:"primary",style:{marginRight:"12px"},onClick:function(){A("/yizhi_server/api/account/analyse/download",{type:"GET",data:{class_name:a,user_name:i,start_date:w,end_date:k,product:"JSON.stringify(info.product)"},responseType:"arrayBuffer"}).then((function(e){U(e,"\u5206\u6790\u660e\u7ec6".concat(w,"_").concat(k))}))}},"\u5bfc\u51fa\u8ba2\u5355\u4fe1\u606f\u8868")),r.a.createElement(m.a,{md:12,sm:24,style:{textAlign:"right"}},r.a.createElement(g.a.Item,null,r.a.createElement(s.a,{type:"primary",htmlType:"submit",style:{marginRight:"12px"}},"\u67e5\u8be2"),r.a.createElement(s.a,{htmlType:"button",onClick:function(){W.resetFields(),$("class_name",""),$("user_name",""),Y(1),M(2),H({})}},"\u91cd\u7f6e")))))),r.a.createElement(j,{dataSource:I,pageSize:L,current:B,totalCount:K,handleTableChange:function(e){Y(e.current),M(e.pageSize),H({class_name:a,user_name:i,start_date:w,end_date:k,current:e.current,limit:e.pageSize})}}))},$=y.a.Column,X=[{title:"\u8bfe\u7a0bID",dataIndex:"id",key:"id"},{title:"\u8bfe\u7a0b\u540d\u79f0",dataIndex:"courseName",key:"courseName"},{title:"\u5151\u6362\u7801",dataIndex:"code",key:"code"},{title:"\u5151\u6362\u60c5\u51b5",dataIndex:"status",key:"status"},{title:"\u5151\u6362\u65f6\u95f4",dataIndex:"date",key:"date"}],Z=function(e){return r.a.createElement("div",{style:{padding:"30px"}},r.a.createElement(y.a,{dataSource:e.dataSource,rowKey:function(e){return e.id||"key"},onChange:e.handleTableChange,pagination:{pageSize:e.pageSize,current:e.current,showSizeChanger:!0,showTotal:function(e,t){return"".concat(t[1]-t[0]+1," of ").concat(e," items")}}},X.map((function(e){return r.a.createElement($,Object.assign({},e,{key:e.key}))}))))},ee=(a(418),g.a.Item),te=function(){var e=Object(n.useState)(""),t=Object(p.a)(e,2),a=t[0],c=t[1],o=Object(n.useState)(0),i=Object(p.a)(o,2),f=i[0],g=(i[1],Object(n.useState)(1)),h=Object(p.a)(g,2),E=h[0],b=(h[1],Object(n.useState)(10)),y=Object(p.a)(b,2),w=y[0];y[1];Object(n.useEffect)((function(){O(a,E,w)}),[]);for(var O=function(e,t,a){A("/51business/api/course/back/redeem",{type:"GET",data:{courseName:e,limit:a,page:t}}).then((function(e){console.log(e)}))},j=[],v=0;v<25;v++)j.push({id:v,courseName:"\u6211\u90fd\u5514",code:"woeopwr",status:1,date:"2020-05-20"});return r.a.createElement(q,null,r.a.createElement("div",{className:"content"},r.a.createElement(u.a,{gutter:{xs:8,sm:16,md:24}},r.a.createElement(m.a,{md:6,sm:12},r.a.createElement(ee,{label:"\u5df2\u8d2d\u8bfe\u7a0b\u540d\u79f0\uff1a"},r.a.createElement(d.a,{value:a,placeholder:"\u8bf7\u8f93\u5165",onChange:function(e){c(e.target.value)}}))),r.a.createElement(m.a,{md:6,sm:12},r.a.createElement(s.a,{type:"primary",onClick:function(){O(a,1,w)},style:{marginRight:"12px"}},"\u67e5\u8be2"),r.a.createElement(s.a,{htmlType:"button",onClick:function(){O("",1,w)}},"\u91cd\u7f6e"))),r.a.createElement(u.a,Object.assign({style:{padding:"12px 0"}},{gutter:{xs:8,sm:16,md:24}}),r.a.createElement(m.a,{md:12,sm:24},r.a.createElement(s.a,{type:"primary",style:{marginRight:"12px"}},r.a.createElement(l.b,{to:"/generateCode"},"\u5151\u6362\u7801\u751f\u6210\u5668")),r.a.createElement(s.a,{type:"primary",style:{marginRight:"12px"},onClick:function(){A("/yizhi_server/api/account/analyse/download",{type:"GET",data:{product:"JSON.stringify(info.product)"},responseType:"arrayBuffer"}).then((function(e){U(e,"\u5206\u6790\u660e\u7ec6")}))}},"\u5bfc\u51fa\u5151\u6362\u7801\u6570\u636e\u8868")))),r.a.createElement(Z,{dataSource:j,handleTableChange:function(e){O(a,e.current,e.pageSize)},pageSize:w,totalCount:f,current:E}))},ae=(a(164),a(58)),ne=ae.a.Option,re={labelCol:{span:4},wrapperCol:{span:6}},ce={wrapperCol:{offset:4,span:6}},oe=function(){var e=g.a.useForm(),t=Object(p.a)(e,1)[0];return r.a.createElement(q,null,r.a.createElement(g.a,Object.assign({},re,{form:t,name:"control-hooks",onFinish:function(e){A("/51business/api/course/back/redeem",{type:"POST",data:Object(I.a)({},e)}).then((function(e){x.a.success("\u751f\u6210\u6210\u529f"),t.resetFields()}))}}),r.a.createElement(g.a.Item,{name:"class_id",label:"\u8bfe\u7a0b\u540d\u79f0\uff1a",rules:[{required:!0,message:"\u8bf7\u9009\u62e9\u8bfe\u7a0b"}]},r.a.createElement(ae.a,{placeholder:"\u8bf7\u9009\u62e9\u8bfe\u7a0b\u540d\u79f0",allowClear:!0},[{name:"\u8da3\u9009\u8bfe",id:1},{name:"\u6211\u8fde\u7f51",id:2}].map((function(e){return r.a.createElement(ne,{value:e.id,key:e.id},e.name)})))),r.a.createElement(g.a.Item,{name:"channel",label:"\u6e20\u9053\u540d\u79f0\uff1a",rules:[{required:!0,message:"\u8bf7\u8f93\u5165\u6e20\u9053"},{whitespace:!0,message:"\u4e0d\u80fd\u4e3a\u7a7a\u683c\u5b57\u7b26"}]},r.a.createElement(d.a,{placeholder:"\u8bf7\u8f93\u5165"})),r.a.createElement(g.a.Item,{name:"num",label:"\u5151\u6362\u7801\u6570\u91cf\uff1a",rules:[{required:!0,message:"\u8bf7\u8f93\u5165\u5151\u6362\u7801\u6570\u91cf"},{whitespace:!0,message:"\u4e0d\u80fd\u4e3a\u7a7a\u683c\u5b57\u7b26"},{pattern:/^[0-9]+$/,message:"\u4ec5\u652f\u6301\u8f93\u5165\u6570\u5b57"}]},r.a.createElement(d.a,{placeholder:"\u8bf7\u8f93\u5165"})),r.a.createElement(g.a.Item,ce,r.a.createElement(s.a,{type:"primary",htmlType:"submit"},"\u751f\u6210\u5151\u6362\u7801"),r.a.createElement(s.a,{htmlType:"button",onClick:function(){t.resetFields()},style:{marginLeft:"20px"}},"\u91cd\u7f6e"))))},le=a(47),ie=a.n(le),se=a(81),ue=a(426),me=a(427),de=(a(419),function(){var e=Object(n.useState)(""),t=Object(p.a)(e,2),a=t[0],c=t[1],o=Object(n.useState)(""),l=Object(p.a)(o,2),u=l[0],m=l[1],f=Object(n.useState)(!1),g=Object(p.a)(f,2),h=g[0],E=g[1],b=Object(n.useState)(!1),y=Object(p.a)(b,2),w=y[0],O=y[1],j=function(e,t){({passport:function(e){c(e)},password:function(e){m(e)}})[t](e.target.value)};Object(n.useMemo)((function(){E(!(!u||!a))}),[a,u]),x.a.config({duration:2,maxCount:3});var v=Object(i.f)((function(e){var t=h?["btn","loginItem","btn_act"]:["btn","loginItem"];return r.a.createElement("button",{className:t.join(" "),onClick:function(){if(h){var t=e.history;A("/51business/api/course/back/login",{data:{account:a,password:u},error:function(){m("")}}).then(function(){var e=Object(se.a)(ie.a.mark((function e(n){var r;return ie.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!n){e.next=8;break}return window.localStorage.setItem("token",n.auth_token),window.localStorage.setItem("user",a),e.next=5,A("/51business/api/course/back/menu",{type:"GET"});case 5:r=e.sent,window.localStorage.setItem("routerConf",JSON.stringify(r.list)),t.push("/orderList");case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()).catch((function(e){console.log(e)}))}else n="\u7528\u6237\u540d\u6216\u5bc6\u7801\u4e0d\u6b63\u786e",x.a.info(n);var n}},e.title)}));return r.a.createElement("div",null,r.a.createElement("div",{className:"loginPane"},r.a.createElement("div",{className:"login-inline"},r.a.createElement("img",{style:{width:"80%"},src:"https://gw.alipayobjects.com/mdn/rms_ae7ad9/afts/img/A*-wAhRYnWQscAAAAAAAAAAABkARQnAQ",alt:""})),r.a.createElement("div",{className:"login-inline"},r.a.createElement("div",null,r.a.createElement("h3",{style:{textAlign:"center",fontSize:"24px",fontWeight:"bold"}},"\u8da3\u9009\u8bfe\u4f9b\u9500\u540e\u53f0")),r.a.createElement("div",{className:"loginItem"},r.a.createElement(d.a,{size:"large",placeholder:"\u8bf7\u8f93\u5165\u4f60\u7684\u8d26\u53f7",value:a,onChange:function(e){return j(e,"passport")},prefix:r.a.createElement(ue.a,{className:"site-form-item-icon"})})),r.a.createElement("div",{className:"loginItem"},r.a.createElement(d.a.Password,{size:"large",placeholder:"\u8bf7\u8f93\u5165\u4f60\u7684\u5bc6\u7801",value:u,autoComplete:"new-password",onChange:function(e){return j(e,"password")},prefix:r.a.createElement(me.a,null)})),r.a.createElement(v,{title:"\u767b\u5f55"}),r.a.createElement(s.a,{type:"link",onClick:function(){return O(!0)}},"\u5fd8\u8bb0\u5bc6\u7801"),r.a.createElement(S.a,{title:"\u5fd8\u8bb0\u5bc6\u7801",width:"300px",visible:w,footer:r.a.createElement(s.a,{type:"primary",size:"large",block:!0,onClick:function(){return O(!1)}},"\u767b\u5f55"),onCancel:function(){return O(!1)}},r.a.createElement("p",{style:{fontSize:"16px"}},"\u8bf7\u8054\u7cfb51\u516c\u79ef\u91d1\u540c\u4e8b\u8fdb\u884c\u5bc6\u7801\u91cd\u7f6e")))))}),pe=Object(i.f)((function(){return r.a.createElement(i.c,null,r.a.createElement(i.a,{path:"/login",exact:!0,component:de}),r.a.createElement(i.a,{path:"/orderList",exact:!0,component:H}),r.a.createElement(i.a,{path:"/exchangeCode",exact:!0,component:te}),r.a.createElement(i.a,{path:"/generateCode",exact:!0,component:oe}),r.a.createElement(i.a,{path:"/",component:H}))})),fe=function(){return r.a.createElement(pe,null)},ge=function(){return r.a.createElement("div",{className:"appWrap"},r.a.createElement(l.a,{basename:"/inclass"},r.a.createElement(fe,null)))};Boolean("localhost"===window.location.hostname||"[::1]"===window.location.hostname||window.location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/));o.a.render(r.a.createElement(ge,null),document.getElementById("root")),"serviceWorker"in navigator&&navigator.serviceWorker.ready.then((function(e){e.unregister()})).catch((function(e){console.error(e.message)}))}},[[217,1,2]]]);
\ No newline at end of file
!function(e){function t(t){for(var n,a,l=t[0],i=t[1],f=t[2],c=0,s=[];c<l.length;c++)a=l[c],Object.prototype.hasOwnProperty.call(o,a)&&o[a]&&s.push(o[a][0]),o[a]=0;for(n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n]);for(p&&p(t);s.length;)s.shift()();return u.push.apply(u,f||[]),r()}function r(){for(var e,t=0;t<u.length;t++){for(var r=u[t],n=!0,l=1;l<r.length;l++){var i=r[l];0!==o[i]&&(n=!1)}n&&(u.splice(t--,1),e=a(a.s=r[0]))}return e}var n={},o={1:0},u=[];function a(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,a),r.l=!0,r.exports}a.m=e,a.c=n,a.d=function(e,t,r){a.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},a.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(e,t){if(1&t&&(e=a(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(a.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)a.d(r,n,function(t){return e[t]}.bind(null,n));return r},a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,"a",t),t},a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a.p="//r.51gjj.com/webpublic/51data/";var l=this["webpackJsonpantd-demo-ts"]=this["webpackJsonpantd-demo-ts"]||[],i=l.push.bind(l);l.push=t,l=l.slice();for(var f=0;f<l.length;f++)t(l[f]);var p=i;r()}([]);
\ No newline at end of file
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
"babel-plugin-import": "^1.13.0", "babel-plugin-import": "^1.13.0",
"customize-cra": "^0.9.1", "customize-cra": "^0.9.1",
"echarts": "^4.7.0", "echarts": "^4.7.0",
"needle": "^2.4.1", "needle": "^2.5.0",
"react": "^16.13.1", "react": "^16.13.1",
"react-app-rewired": "^2.1.5", "react-app-rewired": "^2.1.5",
"react-dom": "^16.13.1", "react-dom": "^16.13.1",
......
...@@ -2,42 +2,18 @@ ...@@ -2,42 +2,18 @@
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" /> <link
rel="icon"
href="//r.51gjj.com/webpublic/images/2020523/oyed3Mkrvrpdg.png"
/>
<meta name="viewport" content="width=device-width, initial-scale=1" /> <meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" /> <meta name="theme-color" content="#000000" />
<meta <meta name="description" content="趣选课合作后台" />
name="description" <title>趣选课合作后台</title>
content="Web site created using create-react-app"
/>
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<!--
manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
-->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Only files inside the `public` folder can be referenced from the HTML.
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>React App</title>
</head> </head>
<body> <body>
<noscript>You need to enable JavaScript to run this app.</noscript> <noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div> <div id="root"></div>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
You can add webfonts, meta tags, or analytics to this file.
The build step will place the bundled scripts into the <body> tag.
To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
</body> </body>
</html> </html>
...@@ -14,23 +14,25 @@ const PAGE_SIZE = 10; ...@@ -14,23 +14,25 @@ const PAGE_SIZE = 10;
const ExchangeCode: React.FC = () => { const ExchangeCode: React.FC = () => {
const [courseName, set_courseName] = useState(''); const [courseName, set_courseName] = useState('');
const [totalCount, set_totalCount] = useState(0);
const [current, set_current] = useState(1); const [current, set_current] = useState(1);
const [pageSize, set_pageSize] = useState(PAGE_SIZE); const [limit, set_limit] = useState(PAGE_SIZE);
useEffect(() => { useEffect(() => {
getList(courseName, current, pageSize); getList(courseName, current, limit);
}, []); }, []);
const getList = (courseName: string, current: number, pageSize: number) => { const getList = (courseName: string, current: number, limit: number) => {
api(`/yizhi_server/api/account/analyse`, { api(`/51business/api/course/back/redeem`, {
type: 'GET', type: 'GET',
data: { data: {
courseName: courseName, courseName: courseName,
pageSize: pageSize, limit: limit,
page: current page: current
} }
}).then(r => { }).then(r => {
console.log(r); console.log(r);
// set_totalCount(r.total_count);
}); });
}; };
...@@ -47,14 +49,14 @@ const ExchangeCode: React.FC = () => { ...@@ -47,14 +49,14 @@ const ExchangeCode: React.FC = () => {
}; };
const submitData = () => { const submitData = () => {
getList(courseName, 1, pageSize); getList(courseName, 1, limit);
}; };
const resetData = () => { const resetData = () => {
// set_current(1); // set_current(1);
// set_pageSize(pageSize); // set_pageSize(pageSize);
// set_courseName(''); // set_courseName('');
getList('', 1, pageSize); getList('', 1, limit);
}; };
const handleTableChange = (args: any) => { const handleTableChange = (args: any) => {
...@@ -123,7 +125,8 @@ const ExchangeCode: React.FC = () => { ...@@ -123,7 +125,8 @@ const ExchangeCode: React.FC = () => {
<List <List
dataSource={dataSource} dataSource={dataSource}
handleTableChange={handleTableChange} handleTableChange={handleTableChange}
pageSize={pageSize} pageSize={limit}
totalCount={totalCount}
current={current} current={current}
/> />
</BasicPage> </BasicPage>
......
...@@ -20,6 +20,7 @@ interface DataSourceI { ...@@ -20,6 +20,7 @@ interface DataSourceI {
dataSource: DeatilI[]; dataSource: DeatilI[];
pageSize: number; pageSize: number;
current: number; current: number;
totalCount: number;
handleTableChange: any; handleTableChange: any;
} }
......
import React from 'react'; import React from 'react';
import { Form, Input, Button, Select } from 'antd'; import { Form, Input, Button, Select, message } from 'antd';
import BasicPage from '../../layout/basicPage'; import BasicPage from '../../layout/basicPage';
import { api } from '../../common/fetch';
const { Option } = Select; const { Option } = Select;
...@@ -16,7 +17,15 @@ const GenerateCode: React.FC = () => { ...@@ -16,7 +17,15 @@ const GenerateCode: React.FC = () => {
const [form] = Form.useForm(); const [form] = Form.useForm();
const onFinish = (values: any) => { const onFinish = (values: any) => {
console.log(values); api(`/51business/api/course/back/redeem`, {
type: 'POST',
data: {
...values
}
}).then((r: any) => {
message.success('生成成功');
form.resetFields();
});
}; };
const onReset = () => { const onReset = () => {
...@@ -37,7 +46,7 @@ const GenerateCode: React.FC = () => { ...@@ -37,7 +46,7 @@ const GenerateCode: React.FC = () => {
return ( return (
<BasicPage> <BasicPage>
<Form {...layout} form={form} name="control-hooks" onFinish={onFinish}> <Form {...layout} form={form} name="control-hooks" onFinish={onFinish}>
<Form.Item {/* <Form.Item
name="institution" name="institution"
label="机构名称:" label="机构名称:"
rules={[{ required: true, message: '请选择机构' }]} rules={[{ required: true, message: '请选择机构' }]}
...@@ -51,9 +60,9 @@ const GenerateCode: React.FC = () => { ...@@ -51,9 +60,9 @@ const GenerateCode: React.FC = () => {
); );
})} })}
</Select> </Select>
</Form.Item> </Form.Item> */}
<Form.Item <Form.Item
name="courseName" name="class_id"
label="课程名称:" label="课程名称:"
rules={[{ required: true, message: '请选择课程' }]} rules={[{ required: true, message: '请选择课程' }]}
> >
...@@ -81,7 +90,7 @@ const GenerateCode: React.FC = () => { ...@@ -81,7 +90,7 @@ const GenerateCode: React.FC = () => {
<Input placeholder="请输入" /> <Input placeholder="请输入" />
</Form.Item> </Form.Item>
<Form.Item <Form.Item
name="amount" name="num"
label="兑换码数量:" label="兑换码数量:"
rules={[ rules={[
{ required: true, message: '请输入兑换码数量' }, { required: true, message: '请输入兑换码数量' },
......
...@@ -44,49 +44,6 @@ const Login: React.FC<RouteComponentProps> = () => { ...@@ -44,49 +44,6 @@ const Login: React.FC<RouteComponentProps> = () => {
const info = (msg: string) => { const info = (msg: string) => {
message.info(msg); message.info(msg);
}; };
const setMenuData = () => {
return new Promise((resolve, reject) => {
const routerConf = [
{
key: '1',
title: '订单列表',
path: '/orderList',
icon: 'icon-gongdan',
subs: []
},
{
key: '2',
title: '兑换码',
path: '',
icon: 'icon-set',
subs: [
{
key: '3',
title: '兑换码列表',
path: '/exchangeCode',
icon: 'icon-jixiao'
},
{
key: '4',
title: '兑换码生成',
path: '/generateCode',
icon: 'icon-people'
}
]
}
];
api('/51business/api/course/back/menu', {
type: 'GET',
data: {},
error: () => {}
}).then(res => {
console.log('res', res);
window.localStorage.setItem('routerConf', JSON.stringify(routerConf));
resolve();
});
});
};
// 登录按钮 // 登录按钮
const LoginBtn: React.FC<Btn & RouteComponentProps> = props => { const LoginBtn: React.FC<Btn & RouteComponentProps> = props => {
const submit = () => { const submit = () => {
......
import React, { useState, useEffect, useRef } from 'react'; import React, { useState, useEffect } from 'react';
import locale from 'antd/es/date-picker/locale/zh_CN'; import locale from 'antd/es/date-picker/locale/zh_CN';
import moment from 'moment'; import moment from 'moment';
import { Input, Button, Form, DatePicker, Row, Col } from 'antd'; import { Input, Button, Form, DatePicker, Row, Col } from 'antd';
import 'moment/locale/zh-cn'; import 'moment/locale/zh-cn';
import List from './list'; import List from './list';
import BasicPage from '../../layout/basicPage'; import BasicPage from '../../layout/basicPage';
import excelFn from '../../common/excel'; import excelFn from '../../common/excel';
...@@ -16,27 +15,27 @@ const FormItem = Form.Item; ...@@ -16,27 +15,27 @@ const FormItem = Form.Item;
const { RangePicker } = DatePicker; const { RangePicker } = DatePicker;
moment.locale('zh-cn'); moment.locale('zh-cn');
const PAGE_SIZE = 10; const PAGE_SIZE = 2;
interface FilterData { interface FilterData {
courseName?: string; class_name?: string;
userName?: string; user_name?: string;
start_date?: string; start_date?: string;
end_date?: string; end_date?: string;
current?: number; current?: number;
pageSize?: number; limit?: number;
} }
const OrderList: React.FC = () => { const OrderList: React.FC = () => {
const [courseName, set_courseName] = useState(''); const [class_name, set_className] = useState('');
const [userName, set_userName] = useState(''); const [user_name, set_userName] = useState('');
const [start_date, set_startDate] = useState(''); const [start_date, set_startDate] = useState('');
const [end_date, set_endDate] = useState(''); const [end_date, set_endDate] = useState('');
const [dataSource, set_dataSource] = useState([]);
const [totalCount, set_totalCount] = useState(0);
const [current, set_current] = useState(1); const [current, set_current] = useState(1);
const [pageSize, set_pageSize] = useState(PAGE_SIZE); const [limit, set_limit] = useState(PAGE_SIZE);
const [form] = Form.useForm(); const [form] = Form.useForm();
const formItemLayout = { const formItemLayout = {
...@@ -53,29 +52,38 @@ const OrderList: React.FC = () => { ...@@ -53,29 +52,38 @@ const OrderList: React.FC = () => {
}; };
useEffect(() => { useEffect(() => {
getList({ courseName, userName, start_date, end_date, current, pageSize }); getList({
class_name,
user_name,
start_date,
end_date,
current,
limit
});
}, []); }, []);
const getList = ({ const getList = ({
courseName = '', class_name = '',
userName = '', user_name = '',
start_date = '', start_date = '',
end_date = '', end_date = '',
current = 1, current = 1,
pageSize = PAGE_SIZE limit = PAGE_SIZE
}: FilterData) => { }: FilterData) => {
api(`/yizhi_server/api/account/analyse`, { api(`/51business/api/course/back/order`, {
type: 'GET', type: 'GET',
data: { data: {
courseName, // class_name,
userName, // user_name,
start_date, // start_date,
end_date, // end_date,
page: current, page: current,
pageSize: pageSize limit: limit
} }
}).then(r => { }).then(r => {
console.log(r); console.log(r);
set_dataSource(r.list);
set_totalCount(r.total_count);
}); });
}; };
...@@ -83,8 +91,8 @@ const OrderList: React.FC = () => { ...@@ -83,8 +91,8 @@ const OrderList: React.FC = () => {
api('/yizhi_server/api/account/analyse/download', { api('/yizhi_server/api/account/analyse/download', {
type: 'GET', type: 'GET',
data: { data: {
courseName, class_name,
userName, user_name,
start_date, start_date,
end_date, end_date,
product: 'JSON.stringify(info.product)' product: 'JSON.stringify(info.product)'
...@@ -97,8 +105,8 @@ const OrderList: React.FC = () => { ...@@ -97,8 +105,8 @@ const OrderList: React.FC = () => {
const changeValue = (type: string, val: any) => { const changeValue = (type: string, val: any) => {
let obj: any = { let obj: any = {
courseName: () => set_courseName(val), class_name: () => set_className(val),
userName: () => set_userName(val), user_name: () => set_userName(val),
dates: () => { dates: () => {
let start_date = (val && moment(val[0]).format('YYYY-MM-DD')) || ''; let start_date = (val && moment(val[0]).format('YYYY-MM-DD')) || '';
let end_date = (val && moment(val[1]).format('YYYY-MM-DD')) || ''; let end_date = (val && moment(val[1]).format('YYYY-MM-DD')) || '';
...@@ -111,64 +119,50 @@ const OrderList: React.FC = () => { ...@@ -111,64 +119,50 @@ const OrderList: React.FC = () => {
const resetData = () => { const resetData = () => {
form.resetFields(); form.resetFields();
changeValue('courseName', ''); changeValue('class_name', '');
changeValue('userName', ''); changeValue('user_name', '');
set_current(1); set_current(1);
set_pageSize(PAGE_SIZE); set_limit(PAGE_SIZE);
getList({}); getList({});
}; };
const handleTableChange = (args: any) => { const handleTableChange = (args: any) => {
set_current(args.current); set_current(args.current);
set_pageSize(args.pageSize); set_limit(args.pageSize);
getList({ getList({
courseName, class_name,
userName, user_name,
start_date, start_date,
end_date, end_date,
current: args.current, current: args.current,
pageSize: args.pageSize limit: args.pageSize
}); });
}; };
const onFinish = () => { const onFinish = () => {
set_current(1); set_current(1);
set_pageSize(PAGE_SIZE); set_limit(PAGE_SIZE);
getList({ getList({
courseName, class_name,
userName, user_name,
start_date, start_date,
end_date, end_date,
current: 1, current: 1,
pageSize: PAGE_SIZE limit: PAGE_SIZE
}); });
}; };
let dataSource = [];
for (let i = 0; i < 25; i++) {
dataSource.push({
id: i,
orderNumber: 7878,
courseName: '我都唔',
userName: 'woeopwr',
address: '前五位哦',
phone: 15180356828,
money: 85,
date: '2020-05-20'
});
}
return ( return (
<BasicPage> <BasicPage>
<div className="analy-content"> <div className="analy-content">
<Form {...formItemLayout} form={form} onFinish={onFinish}> <Form {...formItemLayout} form={form} onFinish={onFinish}>
<Row {...{ gutter: { xs: 8, sm: 16, md: 24 } }}> <Row {...{ gutter: { xs: 8, sm: 16, md: 24 } }}>
<Col span="6"> <Col span="6">
<FormItem label="已购课程名称:" name="courseName"> <FormItem label="已购课程名称:" name="class_name">
<Input <Input
placeholder="请输入" placeholder="请输入"
onChange={e => { onChange={e => {
changeValue('courseName', e.target.value); changeValue('class_name', e.target.value);
}} }}
/> />
</FormItem> </FormItem>
...@@ -226,8 +220,9 @@ const OrderList: React.FC = () => { ...@@ -226,8 +220,9 @@ const OrderList: React.FC = () => {
</div> </div>
<List <List
dataSource={dataSource} dataSource={dataSource}
pageSize={pageSize} pageSize={limit}
current={current} current={current}
totalCount={totalCount}
handleTableChange={handleTableChange} handleTableChange={handleTableChange}
/> />
</BasicPage> </BasicPage>
......
...@@ -4,13 +4,11 @@ const { Column } = Table; ...@@ -4,13 +4,11 @@ const { Column } = Table;
interface DeatilI { interface DeatilI {
id: string | number; id: string | number;
orderNumber: string | number; order_no: string | number;
courseName: string | number; class_name: string | number;
userName: string | number; address: () => {};
address: string; pay: string | number;
phone: string | number; pay_time: string;
money: string | number;
date: string;
} }
interface ColsI { interface ColsI {
...@@ -23,44 +21,61 @@ interface DataSourceI { ...@@ -23,44 +21,61 @@ interface DataSourceI {
dataSource: DeatilI[]; dataSource: DeatilI[];
pageSize: number; pageSize: number;
current: number; current: number;
totalCount: number;
handleTableChange: any; handleTableChange: any;
} }
const columns = [ const columns = [
{ {
title: '订单号', title: '订单号',
dataIndex: 'orderNumber', dataIndex: 'order_no',
key: 'orderNumber' key: 'order_no'
}, },
{ {
title: '已购课程名称', title: '已购课程名称',
dataIndex: 'courseName', dataIndex: 'class_name',
key: 'courseName' key: 'class_name'
}, },
{ {
title: '用户姓名', title: '用户姓名',
dataIndex: 'userName', dataIndex: 'address',
key: 'userName' key: 'address',
render: (row: any) => {
return <span>{row.name}</span>;
}
}, },
{ {
title: '收货地址', title: '收货地址',
dataIndex: 'address', dataIndex: 'address',
key: 'address' key: 'address',
render: (row: any) => {
return (
<span>
{row.province}
{row.city}
{row.area}
{row.address}
</span>
);
}
}, },
{ {
title: '联系电话', title: '联系电话',
dataIndex: 'phone', dataIndex: 'address',
key: 'phone' key: 'address',
render: (row: any) => {
return <span>{row.phone}</span>;
}
}, },
{ {
title: '付款金额(元)', title: '付款金额(元)',
dataIndex: 'money', dataIndex: 'pay',
key: 'money' key: 'pay'
}, },
{ {
title: '下单时间', title: '下单时间',
dataIndex: 'date', dataIndex: 'pay_time',
key: 'date' key: 'pay_time'
} }
]; ];
...@@ -80,6 +95,7 @@ const List: React.FC<DataSourceI> = props => { ...@@ -80,6 +95,7 @@ const List: React.FC<DataSourceI> = props => {
pagination={{ pagination={{
pageSize: props.pageSize, pageSize: props.pageSize,
current: props.current, current: props.current,
total: props.totalCount,
showSizeChanger: true, showSizeChanger: true,
showTotal: (total, range) => showTotal: (total, range) =>
`${range[1] - range[0] + 1} of ${total} items` `${range[1] - range[0] + 1} of ${total} items`
......
const uploadToOss = require('@zooey1184/upload_to_oss');
const path = require('path');
const needle = require('needle');
needle.post(
'https://kaifa.jianbing.com/business/home/demo/post.php',
{},
{
multipart: false
},
(err, resp, body) => {
const res = JSON.parse(body);
if (res.code == 200) {
// 获取配置、设置上传本地路径、上传核心代码
let config = res.data.config;
const osspath = 'webpublic/51data';
const local = path.resolve(__dirname, './dist');
uploadToOss({
config,
local,
osspath
});
} else {
throw new Error('配置获取失败\n验签失败');
}
}
);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment