diff --git a/src/App.css b/src/App.css index 9a9fd16..57efb25 100644 --- a/src/App.css +++ b/src/App.css @@ -1,14 +1,20 @@ a.btn { text-decoration: none; +} +.btn { color: white !important; border-radius: .5rem; padding: .375rem 1.75rem; font-size: 1.1rem; } -a.btn:active { +.btn:active { color: white !important; } +button.btn { + border: none; +} + .btn-primary { background-color: #318ffb; } \ No newline at end of file diff --git a/src/components/UploadUnit/UploadUnit.js b/src/components/UploadUnit/UploadUnit.js index 791159f..ca3cb2d 100644 --- a/src/components/UploadUnit/UploadUnit.js +++ b/src/components/UploadUnit/UploadUnit.js @@ -1,5 +1,8 @@ +import './upload.css'; + import { Component } from "react"; -import { apis } from '../resources.json'; +import { apis } from '../../resources.json'; + export default class UploadUnit extends Component { toBlobPromise = null; diff --git a/src/resources.json b/src/resources.json new file mode 100644 index 0000000..3f7e743 --- /dev/null +++ b/src/resources.json @@ -0,0 +1,5 @@ +{ + "apis": { + "uploadImage": "https://image.kieng.cn/upload.html?type=jd" + } +} \ No newline at end of file diff --git a/src/upload/upload.css b/src/upload/upload.css index e69de29..08a151c 100644 --- a/src/upload/upload.css +++ b/src/upload/upload.css @@ -0,0 +1,53 @@ +.banner { + height: 60px; + width: 100%; + display: flex; + justify-content: space-between; +} + +.sdu, +.user { + height: 100%; + display: flex; +} +.sdu-logo, +.user-logo { + height: 100%; +} +.sdu-name, +.user-name { + height: 100%; + line-height: 60px; + font-size: 24px; +} + +.content { + width: 800px; + margin: 0 auto; +} +.message-box { + width: 100%; + height: 200px; +} +.message-box-textarea { + width: 100%; + resize: none; + height: 100%; + box-sizing: border-box; +} + +.upload-box { + width: 100%; + height: 200px; +} +.upload-area { + width: 100%; + height: 100%; + border: 2px dashed blue; + border-radius: 8px; +} + +.btn-upload { + float: right; + margin-top: 10px; +} \ No newline at end of file diff --git a/src/upload/upload.js b/src/upload/upload.js index 1bbdeff..82bba48 100644 --- a/src/upload/upload.js +++ b/src/upload/upload.js @@ -1,29 +1,62 @@ import { Component } from 'react'; +import Dropzone from 'react-dropzone'; import './upload.css'; -// copilot抄来的模板,可恶怎么有这么明显的bug啊 export class UploadContainer extends Component { constructor(props) { super(props); this.state = { - files: [] + files: [], + msg: "" }; } - handleChange = (e) => { - const files = e.target.files; + handleChange = files => { + console.log(files); this.setState({ files }); - }; + } render() { return (
- - {Array.prototype.map.call(this.state.files, (file, i) => ( -
-

{file.name}

+
+
+ logo +
山东大学
- ))} +
+ avatar +
+
+
+
+
+