|
@@ -1,6 +1,7 @@
|
|
|
import React, { useState } from "react";
|
|
|
import { Modal, Flex, Input, Typography, Checkbox, Button, Collapse } from "antd";
|
|
|
import "../asstes/css/Sidebar.css"
|
|
|
+import axios from "axios";
|
|
|
|
|
|
import Img1 from '../asstes/img/goUpper.png'
|
|
|
import Img2 from '../asstes/img/任务卡片.png'
|
|
@@ -17,7 +18,9 @@ function Sidebar() {
|
|
|
const [isModalOpen2, setIsModalOpen2] = useState(false);
|
|
|
const [isModalOpen3, setIsModalOpen3] = useState(false);
|
|
|
const [isModalOpen4, setIsModalOpen4] = useState(false);
|
|
|
-
|
|
|
+ const [name, setName] = useState('');
|
|
|
+ const [phone, setPhone] = useState('');
|
|
|
+ const [school, setSchool] = useState('');
|
|
|
|
|
|
const handleOk1 = () => {
|
|
|
setIsModalOpen1(false);
|
|
@@ -42,6 +45,23 @@ function Sidebar() {
|
|
|
const onChangeCollapse = (key) => {
|
|
|
console.log(key);
|
|
|
}
|
|
|
+ const submit = () => {
|
|
|
+ // https://traininguser-api.cocorobo.cn/sendEmail
|
|
|
+ console.log(name, school, phone)
|
|
|
+ let params = {
|
|
|
+ content: "",
|
|
|
+ content_type: "",
|
|
|
+ email: "jidechao@cocorobo.cc,1025103647@qq.com,xujiawei@cocorobo.cc",
|
|
|
+ subject: "训练平台"
|
|
|
+ }
|
|
|
+ axios.post('https://traininguser-api.cocorobo.cn/sendEmail', {
|
|
|
+ name: name,
|
|
|
+ school: school,
|
|
|
+ phone: phone
|
|
|
+ }).then(res => {
|
|
|
+ console.log(res)
|
|
|
+ })
|
|
|
+ }
|
|
|
return (
|
|
|
<div className="Sidebar">
|
|
|
<div>
|
|
@@ -72,19 +92,19 @@ function Sidebar() {
|
|
|
footer={[]}>
|
|
|
<h3 className="Model_h3_title">CocoClass賬號申請</h3>
|
|
|
|
|
|
- <img src={codeImg} alt="反饋" style={{margin: '0 auto',display:'block',padding:15}} />
|
|
|
- {/* <Flex vertical gap={16}>
|
|
|
+ {/* <img src={codeImg} alt="反饋" style={{margin: '0 auto',display:'block',padding:15}} /> */}
|
|
|
+ <Flex vertical gap={16}>
|
|
|
<div>
|
|
|
<Typography.Title level={5}>學校名稱</Typography.Title>
|
|
|
- <Input placeholder="請輸入" />
|
|
|
+ <Input placeholder="請輸入" value={school} onChange={(e) => setSchool(e.target.value)} />
|
|
|
</div>
|
|
|
<div>
|
|
|
<Typography.Title level={5}>賬戶(請輸入電郵)</Typography.Title>
|
|
|
- <Input placeholder="請輸入" />
|
|
|
+ <Input placeholder="請輸入" value={phone} onChange={(e) => setPhone(e.target.value)} />
|
|
|
</div>
|
|
|
<div>
|
|
|
<Typography.Title level={5}>姓名</Typography.Title>
|
|
|
- <Input placeholder="請輸入" />
|
|
|
+ <Input placeholder="請輸入" value={name} onChange={(e) => setName(e.target.value)} />
|
|
|
</div>
|
|
|
</Flex>
|
|
|
<p className="model_p_text">*請填寫以上申請信息,我們將在工作日24小時内回復您。您的信息將被嚴格保密,不會被用於其他用途。</p>
|
|
@@ -92,8 +112,8 @@ function Sidebar() {
|
|
|
<i className="model_checkbox_i" onClick={() => setIsModalOpen3(true)}>服務條款</i>和
|
|
|
<i className="model_checkbox_i" onClick={() => setIsModalOpen4(true)}>隱私政策</i>,並確認您已年滿18歲。</span>
|
|
|
<div style={{ textAlign: 'center', marginTop: 20 }}>
|
|
|
- <Button type="primary" onClick={() => setIsModalOpen1(false)}>提交</Button>
|
|
|
- </div> */}
|
|
|
+ <Button type="primary" onClick={() => submit()}>提交</Button>
|
|
|
+ </div>
|
|
|
</Modal>
|
|
|
|
|
|
<Modal open={isModalOpen2} onOk={handleOk2} onCancel={() => setIsModalOpen2(false)}
|