修改课程布局和搜索

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

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

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

Loading…
Cancel
Save