From 618d28cd62e2fa0bd39357f0dd7a2bfecda2894c Mon Sep 17 00:00:00 2001 From: king <2229249788@qq.com> Date: Tue, 18 Jul 2023 14:32:29 +0800 Subject: [PATCH] =?UTF-8?q?=E9=83=A8=E9=97=A8=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/popPut/popPut.tsx | 6 +- src/pages/manage/addStudent/addStudent.tsx | 16 ---- src/pages/manage/depAdmin/depAdmin.scss | 12 +++ src/pages/manage/depAdmin/depAdmin.tsx | 90 ++++++++++++--------- src/static/css/module.scss | 4 +- src/static/img/folder.png | Bin 0 -> 802 bytes 6 files changed, 71 insertions(+), 57 deletions(-) create mode 100644 src/pages/manage/depAdmin/depAdmin.scss create mode 100644 src/static/img/folder.png diff --git a/src/components/popPut/popPut.tsx b/src/components/popPut/popPut.tsx index bc4713e..0548cab 100644 --- a/src/components/popPut/popPut.tsx +++ b/src/components/popPut/popPut.tsx @@ -14,6 +14,7 @@ interface Props { show?: boolean onClick?: () => void no_border?: boolean + leftImage?: string } const PopPut: FC = ({title, chevron, content, image, isProp, children, show, ...opt}: Props) => { @@ -44,7 +45,10 @@ const PopPut: FC = ({title, chevron, content, image, isProp, children, sh return ( <> - {title} + + {opt.leftImage && } + {title} + {content} {!chevron && } diff --git a/src/pages/manage/addStudent/addStudent.tsx b/src/pages/manage/addStudent/addStudent.tsx index 443d4a9..4ce312f 100644 --- a/src/pages/manage/addStudent/addStudent.tsx +++ b/src/pages/manage/addStudent/addStudent.tsx @@ -107,17 +107,6 @@ const AddStudent = () => { onInput={(event) => setUerInfo({...userInfo, phone_number: event.detail.value} as Student)}/> - - 登录邮箱 - setUerInfo({...userInfo, email: event.detail.value} as Student)}/> - - - - 登录密码 - setUerInfo({...userInfo, password: event.detail.value} as Student)}/> - 所属部门 @@ -131,11 +120,6 @@ const AddStudent = () => { - - 身份证号 - setUerInfo({...userInfo, id_card: event.detail.value} as Student)}/> - diff --git a/src/pages/manage/depAdmin/depAdmin.scss b/src/pages/manage/depAdmin/depAdmin.scss new file mode 100644 index 0000000..143c6af --- /dev/null +++ b/src/pages/manage/depAdmin/depAdmin.scss @@ -0,0 +1,12 @@ +.operation { + display: flex; + width: 100%; + justify-content: space-around; + background: #F5F8F7; + position: fixed; + bottom: 0; + padding-bottom: env(safe-area-inset-bottom); + padding-top: 30px; + color: #45D4A8; + left: 0; +} diff --git a/src/pages/manage/depAdmin/depAdmin.tsx b/src/pages/manage/depAdmin/depAdmin.tsx index 6a37063..af4dbfb 100644 --- a/src/pages/manage/depAdmin/depAdmin.tsx +++ b/src/pages/manage/depAdmin/depAdmin.tsx @@ -1,9 +1,11 @@ import {FC, useEffect, useState} from "react"; import {AddDepProps, ManageApi} from "@/api/manage"; -import '../studentAdmin/student.scss' -import {Button, Text, View, PageContainer, Input, Form, CustomWrapper} from "@tarojs/components"; +import {Button, View, PageContainer, Input, Form} from "@tarojs/components"; import Taro from "@tarojs/taro"; import {Profile} from '@/store' +import './depAdmin.scss' +import PopPut from "@/components/popPut/popPut"; +import folder from '@/static/img/folder.png' interface ChangeDataProps { putCompany: Manage | null @@ -75,7 +77,7 @@ const ChangeData: FC = ({putCompany, getDeps}: ChangeDataProps) } const DepAdmin: FC = () => { - const [data, setData] = useState([]) + const [manages, setManages] = useState([]) const [show, setShow] = useState(false) const [putCompany, setPutCompany] = useState(null) @@ -87,7 +89,7 @@ const DepAdmin: FC = () => { Object.values(res)?.forEach(d => { formatData.push(...d) }) - setData(formatData) + setManages(formatData) } } @@ -114,44 +116,56 @@ const DepAdmin: FC = () => { }) } - function jumpCur(id: number) { - Taro.navigateTo({url: `/pages/manage/depCur/depCur?id=${id}`}) + function managesSheet(item: Manage) { + Taro.showActionSheet({ + itemList: ['查看部门课程', '修改', '删除'], + success({tapIndex}) { + switch (tapIndex) { + case 0: + Taro.navigateTo({url: `/pages/manage/depCur/depCur?id=${item.id}`}) + break + case 1: + showPop(item) + break + case 2: + del(item.name, item.id) + break + } + } + }) } - useEffect(() => { - getData() - }, []) + function jumpAddStudent() { + Taro.navigateTo({url: '/pages/manage/addStudent/addStudent'}) + } + + Taro.useDidShow(getData) return ( - - - {data.map(d => ( - - - - {d.id}: - {d.name} - - - - showPop(d)}>修改 - jumpCur(d.id)}>课程 - del(d.name, d.id)}>删除 - - - ))} - - - 暂无更多数据 - - - - - setShow(false)}> - - {show && } - - - - + + + { + manages.map(d => managesSheet(d)} + leftImage={folder} + />) + } + + + 添加学员 + showPop(null)}>添加部门 + + + + setShow(false)}> + + {show && } + + + ) } diff --git a/src/static/css/module.scss b/src/static/css/module.scss index b3e5cda..e483432 100644 --- a/src/static/css/module.scss +++ b/src/static/css/module.scss @@ -48,7 +48,7 @@ page { } Image { - width: 80px; - height: 80px; + width: 68px; + height: 68px; } } diff --git a/src/static/img/folder.png b/src/static/img/folder.png new file mode 100644 index 0000000000000000000000000000000000000000..3361682ee6937a08bd664887b8b02deacf3dc4e2 GIT binary patch literal 802 zcmV+-1Ks?IP)Px%+(|@1RCr$PoX=|$K@`W|n`|}|E7&OUS935F#YhR%o;--sBKQvoiu5Y}1qxE= zQ9XF@=Cx9lfFdY@g5VGEq(~c5FCvIRFg3LhL7MEoC%ZOwjWlK^F-@{>ZyVn1%=^su zyR%GqgHU&+^E38t+CRjg2AQf>L`7A7OfTQNR3%hV#~QH9h1G?X#X~cdU_KbUIWj++ zu+fTJsQ&o9mjN^yyTim4c9vgdri!(=--#d1-A>wogZ-L(Lono&pJmP#yci$IiTAS! z`eAPmBaB+kYM@ejGBQ=fbUte*TqhM4n`|`co_&fD>jO^YZtX-+@i42SmOBG2X67>Z@Y zGGdv|ScVzK5a9|U?A7X#*=58z7wKw*6lt~XK(P5c1oZafEF&Q8dWV<{xT!XX&zbmqQ?c#%Fza?83{VAzi~tD` zV1~2+5g;3DKonBPMt}&A#;;6Kh$uu9qV-uJmJ!Q{WyCUC1jI6887;xcDkGK=%ZO#P z2#96GGFpO>RYok+MV9f0g76ptl3F_MP%s031jdsl-5LFJ=XFHD;|k$20`4*C_`kJb zF0g_NK={_A4`U!Eo%KQ+0a7Ey@Q!^_>b_R$?(sR6&+f8_hP2kFJ`48B+@Fq~`BFPB11Iy@ zBoJ-svpkzhrvm)_#pvlzzqWY-R~QdeaUHAla_rPn4Z~k2$sB%tBf2fNH6Df|cS