|
|
|
@ -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} |
|
|
|
|