diff --git a/.DS_Store b/.DS_Store index 4c85036..efd6a62 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/package-lock.json b/package-lock.json index be7a7b7..2606c96 100644 --- a/package-lock.json +++ b/package-lock.json @@ -31,6 +31,7 @@ "less": "^3.11.1", "less-loader": "^5.0.0", "moment": "^2.24.0", + "qrcode": "^1.5.3", "react": "^16.13.1", "react-canvas-nest": "^1.0.10", "react-dom": "^16.13.1", @@ -8459,6 +8460,11 @@ "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" }, + "node_modules/dijkstrajs": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/dijkstrajs/-/dijkstrajs-1.0.3.tgz", + "integrity": "sha512-qiSlmBq9+BCdCA/L46dw8Uy93mloxsPSbwnm5yrKn2vMPiy8KyAskTF6zuV/j5BMsmOGZDPs7KjU+mjb670kfA==" + }, "node_modules/dir-glob": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", @@ -8717,6 +8723,11 @@ "node": ">= 4" } }, + "node_modules/encode-utf8": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/encode-utf8/-/encode-utf8-1.0.3.tgz", + "integrity": "sha512-ucAnuBEhUK4boH2HjVYG5Q2mQyPorvv0u/ocS+zhdw0S8AlHYY+GOFhP1Gio5z4icpP2ivFSvhtFjQi8+T9ppw==" + }, "node_modules/encodeurl": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", @@ -10322,7 +10333,6 @@ "version": "4.1.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", - "dev": true, "dependencies": { "locate-path": "^5.0.0", "path-exists": "^4.0.0" @@ -15813,7 +15823,6 @@ "version": "5.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", - "dev": true, "dependencies": { "p-locate": "^4.1.0" }, @@ -17236,7 +17245,6 @@ "version": "4.1.0", "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", - "dev": true, "dependencies": { "p-limit": "^2.2.0" }, @@ -17369,7 +17377,6 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", - "dev": true, "engines": { "node": ">=8" } @@ -17591,6 +17598,14 @@ "resolved": "https://registry.npmjs.org/pn/-/pn-1.1.0.tgz", "integrity": "sha512-2qHaIQr2VLRFoxe2nASzsV6ef4yOOH+Fi9FBOVH6cqeSgUnoyySPZkxzLuzd+RYOQTRpROA0ztTMqxROKSb/nA==" }, + "node_modules/pngjs": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/pngjs/-/pngjs-5.0.0.tgz", + "integrity": "sha512-40QW5YalBNfQo5yRYmiw7Yz6TKKVr3h6970B2YE+3fQpsWcrbj1PzJgxeJ19DRQjhMbKPIuMY8rFaXc8moolVw==", + "engines": { + "node": ">=10.13.0" + } + }, "node_modules/pnp-webpack-plugin": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/pnp-webpack-plugin/-/pnp-webpack-plugin-1.5.0.tgz", @@ -18879,6 +18894,90 @@ "teleport": ">=0.2.0" } }, + "node_modules/qrcode": { + "version": "1.5.3", + "resolved": "https://registry.npmjs.org/qrcode/-/qrcode-1.5.3.tgz", + "integrity": "sha512-puyri6ApkEHYiVl4CFzo1tDkAZ+ATcnbJrJ6RiBM1Fhctdn/ix9MTE3hRph33omisEbC/2fcfemsseiKgBPKZg==", + "dependencies": { + "dijkstrajs": "^1.0.1", + "encode-utf8": "^1.0.3", + "pngjs": "^5.0.0", + "yargs": "^15.3.1" + }, + "bin": { + "qrcode": "bin/qrcode" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/qrcode/node_modules/cliui": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", + "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^6.2.0" + } + }, + "node_modules/qrcode/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/qrcode/node_modules/wrap-ansi": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", + "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/qrcode/node_modules/yargs": { + "version": "15.4.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", + "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", + "dependencies": { + "cliui": "^6.0.0", + "decamelize": "^1.2.0", + "find-up": "^4.1.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^4.2.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^18.1.2" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/qrcode/node_modules/yargs-parser": { + "version": "18.1.3", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", + "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", + "dependencies": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + }, + "engines": { + "node": ">=6" + } + }, "node_modules/qs": { "version": "6.5.3", "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.3.tgz", @@ -33440,6 +33539,11 @@ } } }, + "dijkstrajs": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/dijkstrajs/-/dijkstrajs-1.0.3.tgz", + "integrity": "sha512-qiSlmBq9+BCdCA/L46dw8Uy93mloxsPSbwnm5yrKn2vMPiy8KyAskTF6zuV/j5BMsmOGZDPs7KjU+mjb670kfA==" + }, "dir-glob": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", @@ -33653,6 +33757,11 @@ "resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-3.0.0.tgz", "integrity": "sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q==" }, + "encode-utf8": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/encode-utf8/-/encode-utf8-1.0.3.tgz", + "integrity": "sha512-ucAnuBEhUK4boH2HjVYG5Q2mQyPorvv0u/ocS+zhdw0S8AlHYY+GOFhP1Gio5z4icpP2ivFSvhtFjQi8+T9ppw==" + }, "encodeurl": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", @@ -34912,7 +35021,6 @@ "version": "4.1.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", - "dev": true, "requires": { "locate-path": "^5.0.0", "path-exists": "^4.0.0" @@ -39170,7 +39278,6 @@ "version": "5.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", - "dev": true, "requires": { "p-locate": "^4.1.0" } @@ -40288,7 +40395,6 @@ "version": "4.1.0", "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", - "dev": true, "requires": { "p-limit": "^2.2.0" } @@ -40393,8 +40499,7 @@ "path-exists": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", - "dev": true + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==" }, "path-is-absolute": { "version": "1.0.1", @@ -40563,6 +40668,11 @@ "resolved": "https://registry.npmjs.org/pn/-/pn-1.1.0.tgz", "integrity": "sha512-2qHaIQr2VLRFoxe2nASzsV6ef4yOOH+Fi9FBOVH6cqeSgUnoyySPZkxzLuzd+RYOQTRpROA0ztTMqxROKSb/nA==" }, + "pngjs": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/pngjs/-/pngjs-5.0.0.tgz", + "integrity": "sha512-40QW5YalBNfQo5yRYmiw7Yz6TKKVr3h6970B2YE+3fQpsWcrbj1PzJgxeJ19DRQjhMbKPIuMY8rFaXc8moolVw==" + }, "pnp-webpack-plugin": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/pnp-webpack-plugin/-/pnp-webpack-plugin-1.5.0.tgz", @@ -41589,6 +41699,74 @@ "resolved": "https://registry.npmjs.org/q/-/q-1.5.1.tgz", "integrity": "sha512-kV/CThkXo6xyFEZUugw/+pIOywXcDbFYgSct5cT3gqlbkBE1SJdwy6UQoZvodiWF/ckQLZyDE/Bu1M6gVu5lVw==" }, + "qrcode": { + "version": "1.5.3", + "resolved": "https://registry.npmjs.org/qrcode/-/qrcode-1.5.3.tgz", + "integrity": "sha512-puyri6ApkEHYiVl4CFzo1tDkAZ+ATcnbJrJ6RiBM1Fhctdn/ix9MTE3hRph33omisEbC/2fcfemsseiKgBPKZg==", + "requires": { + "dijkstrajs": "^1.0.1", + "encode-utf8": "^1.0.3", + "pngjs": "^5.0.0", + "yargs": "^15.3.1" + }, + "dependencies": { + "cliui": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", + "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", + "requires": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^6.2.0" + } + }, + "strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "requires": { + "ansi-regex": "^5.0.1" + } + }, + "wrap-ansi": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", + "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "requires": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + } + }, + "yargs": { + "version": "15.4.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", + "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", + "requires": { + "cliui": "^6.0.0", + "decamelize": "^1.2.0", + "find-up": "^4.1.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^4.2.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^18.1.2" + } + }, + "yargs-parser": { + "version": "18.1.3", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", + "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", + "requires": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + } + } + } + }, "qs": { "version": "6.5.3", "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.3.tgz", diff --git a/package.json b/package.json index 0e4c7e7..d0ae962 100644 --- a/package.json +++ b/package.json @@ -26,6 +26,7 @@ "less": "^3.11.1", "less-loader": "^5.0.0", "moment": "^2.24.0", + "qrcode": "^1.5.3", "react": "^16.13.1", "react-canvas-nest": "^1.0.10", "react-dom": "^16.13.1", @@ -92,4 +93,4 @@ "pre-commit": "lint-staged" } } -} \ No newline at end of file +} diff --git a/src/api/index.ts b/src/api/index.ts index ea40a39..2ab7fed 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -88,7 +88,75 @@ export default { }, user_relation(data: object) { return $axios.post('/admin/inviti', data) - } - - + }, + assets_review(data: object) { + return $axios.post('/admin/assetsReview', data) + }, + profit_list(data: object) { + return $axios.post('/admin/profitList', data) + }, + review_submit(data: object) { + return $axios.post('/admin/dataReview', data) + }, + review_depositReview(data: object) { + return $axios.post('/admin/depositReview', data) + }, + review_withdrawReview(data: object) { + return $axios.post('/admin/withdrawReview', data) + }, + delete_nofity(data: object) { + return $axios.post('/admin/delMessageList', data) + }, + add_nofity(data: object) { + return $axios.post('/admin/addMessageList', data) + }, + update_nofity(data: object) { + return $axios.post('/admin/updMessageList', data) + }, + add_receiveManage(data: object) { + return $axios.post('/admin/addPlatformDeposit', data) + }, + delete_receiveManage(data: object) { + return $axios.post('/admin/delPlatformDeposit', data) + }, + update_receiveManage(data: object) { + return $axios.post('/admin/updPlatformDeposit', data) + }, + add_withdrawManage(data: object) { + return $axios.post('/admin/addWithdrawMethod', data) + }, + delete_withdrawManage(data: object) { + return $axios.post('/admin/delWithdrawMethod', data) + }, + update_withdrawManage(data: object) { + return $axios.post('/admin/updWithdrawMethod', data) + }, + get_emailList(data: object) { + return $axios.post('/admin/emailList', data) + }, + update_emailList(data: object) { + return $axios.post('/admin/updEmail', data) + }, + get_simulationList(data: object) { + return $axios.post('/admin/levelList', data) + }, + set_simulationList(data: object) { + return $axios.post('/admin/Updlevel', data) + }, + get_emailRecord(data: object) { + return $axios.post('/admin/emailRecords', data) + }, + get_operationRecord(data: object) { + return $axios.post('/admin/emailRecords', data) + }, + get_walletRecord(data: object) { + return $axios.post('/admin/walletDetails', data) + }, + get_googleBingCode(data: object) { + return $axios.post('/admin/authenticatorCode', data) + }, + bind_googleCode(data: object) { + return $axios.post('/admin/bindAuthenticator', data) + }, } + diff --git a/src/pages/account-review/index.tsx b/src/pages/account-review/index.tsx index 222b3da..72ff0d3 100644 --- a/src/pages/account-review/index.tsx +++ b/src/pages/account-review/index.tsx @@ -1,11 +1,31 @@ import api from "@/api" import MyTable from "@/components/MyTable" import { getTime } from "@/utils" -import React from "react" +import { EditOutlined } from "@ant-design/icons" +import { Button, Input, Modal, notification } from "antd" +import React, { useEffect, useRef, useState } from "react" const AccountReview = () => { + const [visible, setVisible] = useState(false) + const [currentItem, setCurrentItem] = useState({} as any) + const tableRef = useRef(null) + const columns = [ + { + title: '操作', + width: 100, + render: (row) => { + return row.status_code === 0 ? ( +
+ { + setCurrentItem(() => row) + setVisible(true) + }} /> +
+ ) : <> + } + }, { dataIndex: 'account', title: '帐号', width: 200 }, { dataIndex: 'password', title: '密码', width: 200 }, { @@ -17,12 +37,49 @@ const AccountReview = () => { { dataIndex: 'status', title: '状态' }, ] + const handleReview = async (type: number) => { + setVisible(false) + const res: any = await api.review_submit({ + status_code: type, + id: currentItem.id + }) + if (res.code === 0) { + notification.success({ + message: type === 1 ? '已拒绝' : '已同意' + }) + tableRef.current.update() + } + } + + useEffect(() => { + !visible && setCurrentItem({}) + }, [visible]) + return (
+ setVisible(false)} + title={`账号审核:${currentItem.account}`} + footer={() => null} + > +
账号:{currentItem.account}
+
+
密码:
+
{currentItem.password}
+
+ +
+ + + +
+
) } diff --git a/src/pages/assets-manage/assets-list.tsx b/src/pages/assets-manage/assets-list.tsx index 9dfc3c5..4db1443 100644 --- a/src/pages/assets-manage/assets-list.tsx +++ b/src/pages/assets-manage/assets-list.tsx @@ -1,11 +1,32 @@ import api from "@/api" import MyTable from "@/components/MyTable" import { getTime } from "@/utils" -import React from "react" +import { EditOutlined } from "@ant-design/icons" +import { Button, Form, Input, Modal, Switch, notification } from "antd" +import React, { useEffect, useRef, useState } from "react" const AssetsList = () => { + const [visible, setVisible] = useState(false) + const [currentItem, setCurrentItem] = useState({} as any) + const [form] = Form.useForm() + const currentType = useRef(1) + const tableRef = useRef(null) + const columns = [ + { + title: '操作', + render: (row) => { + return row.status_code === 0 ? ( +
+ { + setCurrentItem(() => row) + setVisible(true) + }} /> +
+ ) : <> + } + }, { title: '状态', dataIndex: 'status', @@ -49,15 +70,55 @@ const AssetsList = () => { dataIndex: 'review', width: 200 }, - ] + useEffect(() => { + !visible && setCurrentItem({}) + }, [visible]) + + const onFinish = async (values) => { + setVisible(false) + const res: any = await api.assets_review({ + ...values, + id: currentItem.id, + status_code: currentType.current + }) + if (res.code === 0) { + tableRef.current.update() + form.resetFields() + notification.success({ + message: currentType.current === 1 ? '已拒绝' : '已同意' + }) + } + } + return (
+ setVisible(false)} + footer={() => null} + title={`审核用户:${currentItem.email}`} + > +
+ + + + + + + + + + + +
+
) } diff --git a/src/pages/assets-manage/profit-list.tsx b/src/pages/assets-manage/profit-list.tsx new file mode 100644 index 0000000..5310428 --- /dev/null +++ b/src/pages/assets-manage/profit-list.tsx @@ -0,0 +1,45 @@ +import api from "@/api" +import MyTable from "@/components/MyTable" +import React from "react" + +const ProfitList = () => { + + const columns = [ + { + title: '金额', + dataIndex: 'amount', + width: 200 + }, + { + title: '订单号', + dataIndex: 'order', + width: 200 + }, + { + title: '来源', + dataIndex: 'source', + width: 200 + }, + { + title: '时间', + dataIndex: 'time', + render: (text) => new Date(text * 1000).toLocaleString(), // 将时间戳转换为人类可读的格式 + width: 200 + }, + { + title: '类型', + dataIndex: 'type', + }, + ] + + return ( +
+ +
+ ) +} + +export default ProfitList \ No newline at end of file diff --git a/src/pages/chart/data.ts b/src/pages/chart/data.ts deleted file mode 100644 index 12a4ff8..0000000 --- a/src/pages/chart/data.ts +++ /dev/null @@ -1,53 +0,0 @@ -import dagre from 'dagre'; -const edgeType = 'smoothstep'; - -export const flattenTree = (tree) => { - let stack = [tree]; - let nodes = []; - let edges = []; - while (stack.length > 0) { - let node = stack.pop(); - nodes.push({ id: node.id, data: { ...node, label: `${node.name}` }, position: node.position }); - if (node.children && node.children.length > 0) { - node.children.map(item => { - edges.push({ source: node.id, target: item.id, id: item.id, type: edgeType, animated: true }); - stack.unshift(item); - }); - }; - }; - return { nodes, edges }; -}; - -export const getLayoutedElements = (nodes, edges, direction = 'TB') => { - const dagreGraph = new dagre.graphlib.Graph(); - dagreGraph.setDefaultEdgeLabel(() => ({})); - - const nodeWidth = 172; - const nodeHeight = 36; - const isHorizontal = direction === 'LR'; - dagreGraph.setGraph({ rankdir: direction }); - - nodes.forEach((node: any) => { - dagreGraph.setNode(node.id, { width: nodeWidth, height: nodeHeight }); - }); - - edges.forEach((edge: any) => { - dagreGraph.setEdge(edge.source, edge.target); - }); - - dagre.layout(dagreGraph); - - nodes.forEach((node: any) => { - const nodeWithPosition = dagreGraph.node(node.id); - node.targetPosition = isHorizontal ? 'left' : 'top'; - node.sourcePosition = isHorizontal ? 'right' : 'bottom'; - node.position = { - x: nodeWithPosition.x - nodeWidth / 2, - y: nodeWithPosition.y - nodeHeight / 2, - }; - - return node; - }); - - return { nodes, edges }; -}; \ No newline at end of file diff --git a/src/pages/chart/index.tsx b/src/pages/chart/index.tsx index 9b3ab69..bd14199 100644 --- a/src/pages/chart/index.tsx +++ b/src/pages/chart/index.tsx @@ -6,7 +6,8 @@ import ReactFlow, { useEdgesState, Controls } from 'react-flow-renderer'; -import { getLayoutedElements, flattenTree } from './data'; + +import dagre from 'dagre'; import { Button, Form, Input, Modal, notification } from 'antd'; import api from '@/api'; @@ -54,7 +55,7 @@ const InviteChart: FC = () => { return (
- +
@@ -81,4 +82,73 @@ const InviteChart: FC = () => { ); }; -export default InviteChart; \ No newline at end of file +const edgeType = 'smoothstep'; + +const flattenTree = (tree) => { + let stack = [tree]; + let nodes = []; + let edges = []; + while (stack.length > 0) { + let node = stack.pop(); + nodes.push({ + id: node.id, data: { + ...node, label: ( +
+
名称:{node.name}
+
邮箱:{node.email}
+
邀请码:{node.invitiCode}
+
级别:{node.level}
+
+ ) + }, position: node.position, style: { + width: 260, + } + }); + if (node.children && node.children.length > 0) { + node.children.map(item => { + edges.push({ source: node.id, target: item.id, id: item.id, type: edgeType, animated: true }); + stack.unshift(item); + }); + }; + }; + return { nodes, edges }; +}; + +const getLayoutedElements = (nodes, edges, direction = 'TB') => { + const dagreGraph = new dagre.graphlib.Graph(); + dagreGraph.setDefaultEdgeLabel(() => ({})); + + const nodeWidth = 300; + const nodeHeight = 100; + const isHorizontal = direction === 'LR'; + dagreGraph.setGraph({ rankdir: direction }); + + nodes.forEach((node: any) => { + dagreGraph.setNode(node.id, { width: nodeWidth, height: nodeHeight }); + }); + + edges.forEach((edge: any) => { + dagreGraph.setEdge(edge.source, edge.target); + }); + + dagre.layout(dagreGraph); + + console.log(dagreGraph); + + nodes.forEach((node: any) => { + const nodeWithPosition = dagreGraph.node(node.id); + node.targetPosition = isHorizontal ? 'left' : 'top'; + node.sourcePosition = isHorizontal ? 'right' : 'bottom'; + node.position = { + x: nodeWithPosition.x - nodeWidth / 2, + y: nodeWithPosition.y - nodeHeight / 2, + }; + + return node; + }); + + return { nodes, edges }; +}; + +export default InviteChart; + diff --git a/src/pages/google/index.tsx b/src/pages/google/index.tsx new file mode 100644 index 0000000..71afe0f --- /dev/null +++ b/src/pages/google/index.tsx @@ -0,0 +1,78 @@ +import api from "@/api" +import { Button, Form, Input, notification } from "antd" +import React, { useRef, useState } from "react" +import QRcode from 'qrcode' + +const GoogleBind = () => { + + const password = useRef(null) + const codeRef = useRef(null) + + const [code, setCode] = useState('') + const [qrcode, setQrcode] = useState('') + + const getCode = async () => { + const pwd = password.current.input.value; + if (!pwd) return notification.error({ message: '请输入密码!' }) + const res: any = await api.get_googleBingCode({ + password: pwd + }) + if (res.code === 0) { + password.current.input.value = '' + setCode(res.data.url) + QRcode.toDataURL(res.data.url, (err, url) => { + setQrcode(url) + }) + } + } + + const bindCode = async () => { + const code = codeRef.current.input.value; + + const res: any = await api.bind_googleCode({ + code: Number(code) + }) + + if (res.code === 0) { + codeRef.current.input.value = ''; + setCode('') + setQrcode('') + notification.success({ + message: '绑定成功' + }) + } + } + + return ( +
+

第一步

+ + + + + + + + { + qrcode && ( +
+

第二步

+ + + + + + + + + + + +
+ ) + } +
+ ) +} + +export default GoogleBind \ No newline at end of file diff --git a/src/pages/review/deposit.tsx b/src/pages/review/deposit.tsx index 0f16edd..857b850 100644 --- a/src/pages/review/deposit.tsx +++ b/src/pages/review/deposit.tsx @@ -1,13 +1,34 @@ import api from "@/api" import MyTable from "@/components/MyTable" import { getTime } from "@/utils" -import { Tooltip } from "antd" +import { EditOutlined } from "@ant-design/icons" +import { Button, Form, Input, Modal, Switch, Tooltip, notification } from "antd" import { title } from "process" -import React from "react" +import React, { useRef, useState } from "react" const DepositReview = () => { + const [visible, setVisible] = useState(false) + const [currentItem, setCurrentItem] = useState({} as any) + const tableRef = useRef(null) + const currentType = useRef(1) + const [form] = Form.useForm() + const columns = [ + { + title: '操作', + width: 100, + render: (row) => { + return row.status_code === 0 ? ( +
+ { + setCurrentItem(() => row) + setVisible(true) + }} /> +
+ ) : <> + } + }, { title: '状态', dataIndex: 'status', @@ -53,13 +74,66 @@ const DepositReview = () => { dataIndex: 'order' }, ] + console.log(currentItem); + + const onFinish = async (values) => { + setVisible(false) + const res: any = await api.review_depositReview({ + ...values, + id: currentItem.id, + status_code: currentType.current + }) + if (res.code === 0) { + tableRef.current.update() + form.resetFields() + notification.success({ + message: currentType.current === 1 ? '已拒绝' : '已同意' + }) + } + } return (
+ + setVisible(false)} + footer={() => null} + title={`存款审核:${currentItem.email}`} + > + + +
{currentItem.email}
+
+ +
{currentItem.symbol}
+
+ +
{currentItem.deposit_method}
+
+ + }> + window.open(currentItem.url)} /> + + + + + + + + + + + + + + +
) } diff --git a/src/pages/review/withdraw.tsx b/src/pages/review/withdraw.tsx index bdd5467..9d01229 100644 --- a/src/pages/review/withdraw.tsx +++ b/src/pages/review/withdraw.tsx @@ -1,11 +1,33 @@ import api from "@/api" import MyTable from "@/components/MyTable" import { getTime } from "@/utils" -import React from "react" +import { EditOutlined } from "@ant-design/icons" +import { Button, Form, Input, Modal, Switch, notification } from "antd" +import React, { useRef, useState } from "react" const WithdrawReview = () => { + const [visible, setVisible] = useState(false) + const [currentItem, setCurrentItem] = useState({} as any) + const tableRef = useRef(null) + const currentType = useRef(1) + const [form] = Form.useForm() + const columns = [ + { + title: '操作', + width: 100, + render: (row) => { + return row.status_code === 0 ? ( +
+ { + setCurrentItem(() => row) + setVisible(true) + }} /> +
+ ) : <> + } + }, { "dataIndex": "Withdraw_method", "title": "取款方式" }, { "dataIndex": "withdraw_source", "title": "取款来自" }, { "dataIndex": "account", "title": "MT账户" }, @@ -21,12 +43,90 @@ const WithdrawReview = () => { { "dataIndex": "type", "title": "钱包类型" }, ] + + const onFinish = async (values) => { + setVisible(false) + const res: any = await api.review_withdrawReview({ + ...values, + id: currentItem.id, + status_code: currentType.current + }) + if (res.code === 0) { + tableRef.current.update() + form.resetFields() + notification.success({ + message: currentType.current === 1 ? '已拒绝' : '已同意' + }) + } + } + return (
+ + setVisible(false)} + footer={() => null} + title={`取款审核:${currentItem.email}`} + > +
+
+ +
{currentItem.email}
+
+
+ +
+ +
{currentItem.address}
+
+
+ +
+ +
{currentItem.Withdraw_method}
+
+ +
{currentItem.withdraw_source}
+
+
+ +
+ +
{currentItem.amount}
+
+ +
{currentItem.fee}
+
+
+ +
+ +
{currentItem.symbol}
+
+ +
{getTime(currentItem.time * 1000)}
+
+
+ + + + + + + + + + + + +
+
) } diff --git a/src/pages/system-log/emailLog.tsx b/src/pages/system-log/emailLog.tsx new file mode 100644 index 0000000..7a0ff17 --- /dev/null +++ b/src/pages/system-log/emailLog.tsx @@ -0,0 +1,56 @@ +import api from "@/api" +import MyTable from "@/components/MyTable" +import React from "react" + +const EmailLog = () => { + + const columns = [ + { + title: '接受帐号', + dataIndex: 'account', + width: 200, + }, + { + title: '详细', + dataIndex: 'detail', + width: 200, + }, + { + title: 'ID', + width: 200, + dataIndex: 'id', + }, + { + title: '状态', + width: 200, + dataIndex: 'status', + }, + { + title: '时间', + width: 200, + dataIndex: 'time', + render: (text) => new Date(text * 1000).toLocaleString(), // 将时间戳转换为人类可读的格式 + }, + { + title: '标题', + width: 200, + dataIndex: 'title', + }, + { + title: '类型', + dataIndex: 'type', + }, + ]; + + + return ( +
+ +
+ ) +} + +export default EmailLog \ No newline at end of file diff --git a/src/pages/system-log/operationLog.tsx b/src/pages/system-log/operationLog.tsx new file mode 100644 index 0000000..0b8f7e3 --- /dev/null +++ b/src/pages/system-log/operationLog.tsx @@ -0,0 +1,56 @@ +import api from "@/api" +import MyTable from "@/components/MyTable" +import React from "react" + +const OperationLog = () => { + + const columns = [ + { + title: '接受帐号', + dataIndex: 'account', + width: 260 + }, + { + title: '详细', + dataIndex: 'detail', + width: 200 + }, + { + title: 'ID', + dataIndex: 'id', + width: 200 + }, + { + title: '状态', + dataIndex: 'status', + width: 200 + }, + { + title: '时间', + dataIndex: 'time', + render: (text) => new Date(text * 1000).toLocaleString(), // 将时间戳转换为人类可读的格式 + width: 200 + }, + { + title: '标题', + dataIndex: 'title', + width: 200 + }, + { + title: '类型', + dataIndex: 'type', + }, + ]; + + + return ( +
+ +
+ ) +} + +export default OperationLog \ No newline at end of file diff --git a/src/pages/system-log/walletLog.tsx b/src/pages/system-log/walletLog.tsx new file mode 100644 index 0000000..838f8d1 --- /dev/null +++ b/src/pages/system-log/walletLog.tsx @@ -0,0 +1,57 @@ +import api from "@/api" +import MyTable from "@/components/MyTable" +import React, { useRef } from "react" + +const WalletLog = () => { + + const tableRef = useRef(null) + const columns = [ + { + title: '金额', + dataIndex: 'amount', + width: 200 + }, + { + title: '剩余金额', + dataIndex: 'balance', + width: 200 + }, + { + title: 'MT帐号', + dataIndex: 'count', + width: 200 + }, + { + title: 'ID', + dataIndex: 'id', + width: 200 + }, + { + title: '流水号', + dataIndex: 'order', + width: 200 + }, + { + title: '时间', + dataIndex: 'time', + render: (text) => new Date(text * 1000).toLocaleString(), // 将时间戳转换为人类可读的格式 + }, + { + title: '类型', + dataIndex: 'type', + }, + ]; + + + return ( +
+ +
+ ) +} + +export default WalletLog \ No newline at end of file diff --git a/src/pages/system/email-list.tsx b/src/pages/system/email-list.tsx new file mode 100644 index 0000000..631be7d --- /dev/null +++ b/src/pages/system/email-list.tsx @@ -0,0 +1,92 @@ +import api from "@/api" +import MyTable from "@/components/MyTable" +import { EditOutlined } from "@ant-design/icons" +import { Button, Form, Modal, notification } from "antd" +import TextArea from "antd/lib/input/TextArea" +import React, { useRef, useState } from "react" + +const EmailList = () => { + + const [visible, setVisible] = useState(false) + const currentItem = useRef({} as any) + const tableRef = useRef(null) + const [form] = Form.useForm() + + const columns = [ + { + title: '操作', + width: 100, + render: (row) => { + return ( +
+ updateNotify(row)} /> +
+ ); + } + }, + { + title: '标题', + dataIndex: 'title', + width: 200 + }, + { + title: '内容', + dataIndex: 'content', + render: (content) => ( +
{content}
+ ) + } + ] + + const updateNotify = (item) => { + currentItem.current = item; + form.setFieldsValue(item) + setVisible(true) + } + + const onFinish = async (values) => { + setVisible(false) + const res: any = await api.update_emailList({ + ...values, + id: currentItem.current.id + }) + if (res.code === 0) { + tableRef.current.update() + form.resetFields() + notification.success({ + message: "修改成功" + }) + } + } + + return ( +
+ + setVisible(false)} + title={`修改《${currentItem.current.title}》邮件模版`} + footer={() => null} + > +
+ +