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