修改课程布局和搜索

v2
king 1 year ago
parent 68d99f86b1
commit 3e4a30cf1f
  1. 13
      src/pages/manage/courseAdmin/components/search.tsx
  2. 8
      src/pages/manage/courseAdmin/courseAdmin.module.scss
  3. 10
      src/pages/manage/courseAdmin/courseAdmin.tsx

@ -17,6 +17,7 @@ export const Search: FC<Props> = ({param, setParam}) => {
const [show, setShow] = useState(false) const [show, setShow] = useState(false)
const [deps, setDeps] = useState<Manage[]>([]) const [deps, setDeps] = useState<Manage[]>([])
const [depId, setDepId] = useState<number>(param.dep_id) const [depId, setDepId] = useState<number>(param.dep_id)
const [title, setTitle] = useState(param.title)
async function getDepList() { async function getDepList() {
try { try {
@ -53,19 +54,21 @@ export const Search: FC<Props> = ({param, setParam}) => {
<> <>
<View className={styles.searchBox}> <View className={styles.searchBox}>
<View className={styles.searchInput}> <View className={styles.searchInput}>
<Icon name='search' size={18}/> <Icon name='search' size={18} color='#909795'/>
<Input <Input
adjustPosition={false} adjustPosition={false}
type='text' type='text'
confirmType='search' confirmType='search'
placeholder='搜索名称' placeholder='搜索课程名称'
className='ml-1 flex-1' className='ml-1 flex-1'
value={param.title} value={title}
onInput={(e) => setTitle(e.detail.value)}
onConfirm={(e) => setParam({ onConfirm={(e) => setParam({
...param, ...param,
title: e.detail.value, title: e.detail.value,
page: 1 page: 1
})}/> })}
/>
</View> </View>
<View onClick={() => setShow(true)}> <View onClick={() => setShow(true)}>
<Text></Text> <Text></Text>
@ -99,7 +102,7 @@ export const Search: FC<Props> = ({param, setParam}) => {
</View>) </View>)
} }
<View className='flex justify-around mt-2'> <View className='flex justify-around mt-2 align-center'>
<View onClick={() => setShow(false)}> <View onClick={() => setShow(false)}>
<MyButton type='default' fillet width={150}></MyButton> <MyButton type='default' fillet width={150}></MyButton>
</View> </View>

@ -3,6 +3,9 @@
padding: 24rpx 30rpx; padding: 24rpx 30rpx;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
position: sticky;
top: 0;
border-bottom: 1px solid #F5F8F7;
} }
.searchInput { .searchInput {
@ -13,7 +16,6 @@
padding-left: 24rpx; padding-left: 24rpx;
background: #F5F8F7; background: #F5F8F7;
border-radius: 32rpx; border-radius: 32rpx;
color: #909795;
overflow: hidden; overflow: hidden;
} }
@ -65,7 +67,7 @@
} }
.curList { .curList {
padding-bottom: 100px; padding-bottom: calc(env(safe-area-inset-bottom) + 63rpx);
} }
.add { .add {
@ -83,4 +85,6 @@
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
padding: 30rpx; padding: 30rpx;
align-items: center;
box-sizing: border-box;
} }

@ -151,15 +151,15 @@ const CourseAdmin: FC = () => {
return ( return (
<View> <>
<Spin enable={enable} overlay/>
<Search param={param} setParam={setParam}/> <Search param={param} setParam={setParam}/>
<Spin enable={enable} overlay/>
<View className={styles.curList}> <View className={styles.curList}>
{ {
data?.map((d, index) => <View key={d.id} className={styles.curBox}> data?.map((d, index) => <View key={d.id} className={styles.curBox}>
<View className={styles.curTitle} onClick={() => addCurs(d.id)}> <View className={styles.curTitle} onClick={() => addCurs(d.id)}>
{batch && <Radio {batch && <Radio
color='#45D4A8'
checked={curs.includes(d.id)} checked={curs.includes(d.id)}
style={{marginTop: '30px'}} style={{marginTop: '30px'}}
onClick={() => addCurs(d.id)}/>} onClick={() => addCurs(d.id)}/>}
@ -182,13 +182,13 @@ const CourseAdmin: FC = () => {
} }
{ {
batch && <View className={styles.addBatch}> batch && <View className={styles.addBatch}>
<Radio onClick={all} checked={data.length === curs.length}> </Radio> <Radio onClick={all} checked={data.length === curs.length} color='#45D4A8'> </Radio>
<Text onClick={() => setBatch(false)}></Text> <Text onClick={() => setBatch(false)}></Text>
<MyButton size='mini' onClick={() => batchChangDep(curs)}>{curs.length}</MyButton> <MyButton size='mini' onClick={() => batchChangDep(curs)}>{curs.length}</MyButton>
</View> </View>
} }
</View> </View>
</View> </>
) )
} }

Loading…
Cancel
Save