修改部门课程 & 添加课程样式

main
king 1 year ago
parent 467dbccdd9
commit c39dbc6847
  1. 6
      src/pages/manage/addCur/addCur.tsx
  2. 19
      src/pages/manage/depCur/depCur.module.scss
  3. 3
      src/pages/manage/depCur/depCur.tsx

@ -43,7 +43,7 @@ const AddCur = () => {
try {
const is_required = confirm ? 1 : 0
Taro.showLoading()
await ManageApi.addCur({course_id: [cur_id], dep_id: [Number(id)], is_required})
await ManageApi.addCur({course_id: [cur_id], dep_id: [Number(id)], is_required:[is_required]})
const oldData: Curriculum[] = JSON.parse(JSON.stringify(data))
oldData.splice(index, 1)
setData(oldData)
@ -53,6 +53,8 @@ const AddCur = () => {
Taro.hideLoading()
}
})
event?.stopImmediatePropagation()
}
return (
@ -64,7 +66,7 @@ const AddCur = () => {
<>
{
data.length ?
<View className='bg-white mt-2 py-2 flex flex-wrap'>
<View className='flex flex-wrap'>
{data?.map((d, index) => (
<VideoCover
key={d.id}

@ -3,17 +3,30 @@
}
.curBox {
background: #fff;
display: flex;
justify-content: space-between;
border-bottom: 1px solid #F5F8F7;
padding: 20rpx 0 20rpx 20rpx;
font-size: 28rpx;
box-sizing: border-box;
}
.imageBox {
position: relative;
background: #fff;
display: flex;
flex: 1;
border-radius: 10px;
margin-right: 10px;
}
.required{
position: absolute;
left: 0;
top: 0;
background: rgba(#000,.7);
color: #fff;
padding: 0 10rpx;
border-radius: 0 0 10rpx 0;
}
.image {
@ -22,6 +35,7 @@
margin-right: 10rpx;
width: 280rpx;
height: 180rpx;
background: #eee;
}
.del {
@ -31,6 +45,7 @@
background: red;
color: #fff;
width: 100rpx;
border-radius: 10rpx 0 0 10rpx;
}
.flexdButton {

@ -81,11 +81,12 @@ const DepCur: FC = () => {
return (
<View className={styles.page}>
{
data.length ?
data.length > 0 ?
data.map(d => <View key={d.id} className={styles.curBox}>
<View className={styles.imageBox}>
<Image src={d.thumb} className={styles.image} mode='aspectFill'/>
<View>{d.title}</View>
<View className={styles.required}>{d.is_required ? '必修' : '选修'}</View>
</View>
<View
className={styles.del}

Loading…
Cancel
Save