Commit 5efedba0 authored by baixian's avatar baixian

bug修改

parent 5c9cbe98
......@@ -114,6 +114,28 @@ export default {
}
// yield put
},
* deleteCourse({ payload }, { call, put, select }) {
const { id } = payload;
const data = yield call(onlineAjax.deleteCourse, {
id,
});
if (data.code == 200) {
message.success('删除成功', 0.5);
yield put({
type: 'getGatherList',
payload: {
params: {},
},
});
} else {
yield put({
type: 'webapp/errorrequestresolve',
payload: {
data,
},
});
}
},
* selectCourseList({ payload }, { call, put, select }) {
const { sid } = yield select(state => state.webapp);
const data = yield call(onlineAjax.courseList, {
......
......@@ -6,15 +6,17 @@ const MediaCard = (props) => {
const {
info,
method,
course,
} = props;
return (
<Col xs={24} sm={24} md={12} lg={12} xl={6}>
<div className={pageStyle.box} {...props} onClick={() => method.gogatherdetail(info.id)} title={info.title}>
<div className={pageStyle.box} {...props} title={info.title}>
{
info.cover ? <img className={pageStyle.image} src={imagify(info.cover)} alt="" /> :
<img className={pageStyle.image} src={`${__IMGCDN__}course/courseDefaultImg.png`} alt="" />
info.cover ? <img onClick={() => method.gogatherdetail(info.id)} className={pageStyle.image} src={imagify(info.cover)} alt="" /> :
<img onClick={() => method.gogatherdetail(info.id)} className={pageStyle.image} src={`${__IMGCDN__}course/courseDefaultImg.png`} alt="" />
}
<div className={pageStyle.infobox}>
<div className={pageStyle.deleteIcon} onClick={() => course.deleteCourse(info)}><Icon type="delete" /></div>
<div className={pageStyle.topbox}>
<div className={pageStyle.title}>{info.title}</div>
<div className={pageStyle.time}>{info.created_at}</div>
......
......@@ -34,18 +34,26 @@
justify-content: space-between;
.topbox {
.title {
color: #575757;
font-size: 16px;
overflow: hidden;
line-height: 1.2;
max-height: 33px;
min-height: 33px;
text-overflow: ellipsis;
word-break: break-all;
white-space: normal;
word-wrap: break-word;
width: 90%;
font-size: 14px;
overflow: hidden;
display: -webkit-box;
align-items: center;
-webkit-line-clamp: 2;
line-clamp: 2;
-webkit-box-orient: vertical;
color: #575757;
}
.time {
color: #7C7C7C;
font-size: 14px;
font-size: 12px;
font-weight:400;
}
}
.bottombox {
......@@ -65,4 +73,15 @@
}
}
}
.deleteIcon {
position: absolute;
right: 12px;
color: #c2c2c2;
top: 13px;
cursor: pointer;
font-size: 16px;
}
.deleteIcon:hover {
color: #fa4f53;
}
}
......@@ -92,6 +92,32 @@ class StaticCenter extends React.Component {
},
});
}
deleteCourse = (info) => {
const { dispatch } = this.props;
Modal.confirm({
title: `确定删除“${info.title}”?`,
content: '删除后不可恢复,请谨慎操作!',
okText: '确定',
cancelText: '取消',
icon: <Icon type="close-circle" style={{ color: 'red' }} />,
onOk() {
dispatch({
type: 'coursegatherindex/deleteCourse',
payload: {
id: info.id,
},
});
},
okButtonProps: {
type: 'danger',
style: {
color: '#fff',
backgroundColor: '#ff4d4f',
borderColor: '#ff4d4f',
},
},
});
}
render() {
const {
courseVisible,
......@@ -114,6 +140,7 @@ class StaticCenter extends React.Component {
{gatherListTotal > 0 &&
<div>
<div className={pageStyle.mediaCardBox}>
<div className={pageStyle.courseTip}><span>专栏列表</span>(共{gatherListTotal}个)</div>
<Row gutter={16}>
{gatherList.map(ele => (
<Card
......@@ -122,6 +149,11 @@ class StaticCenter extends React.Component {
this.gogatherdetail(id);
},
}}
course={{
deleteCourse: (info) => {
this.deleteCourse(info);
},
}}
type={1}
key={ele.id}
info={ele}
......
......@@ -34,3 +34,15 @@
justify-content: center;
align-items: center;
}
.courseTip {
font-size:14px;
font-family:PingFang SC;
font-weight:400;
color:rgba(25,25,25,1);
margin-bottom: 20px;
span {
font-size:16px;
display: inline-block;
margin-right: 11px;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment