Commit 99f950f4 authored by baixian's avatar baixian

作业日历打卡完成

parent 6cbcb2c2
...@@ -54,7 +54,7 @@ export default { ...@@ -54,7 +54,7 @@ export default {
activeurl: `${__IMGCDN__}menu/classactive.png`, activeurl: `${__IMGCDN__}menu/classactive.png`,
notactiveurl: `${__IMGCDN__}menu/class.png?v=2`, notactiveurl: `${__IMGCDN__}menu/class.png?v=2`,
path: '/sjd/classmgt', path: '/sjd/classmgt',
relativePath: ['/sjd/classmgt', '/sjd/classdetail/:classid', '/sjd/newtheme/jobclock/:id', '/sjd/newtheme/calendarclock/:id', '/sjd/newtheme/jobclock/:id/:isCopy', '/sjd/newtheme/calendarclock/:id/:isCopy', '/sjd/thememgt/:classid', '/sjd/clockmgt/:themetype/:classid/:themeid', '/sjd/classdetail/studentinfo/:id', '/sjd/customsDetail/:id', '/sjd/addCustomsContent/:id', '/sjd/editCustoms/:id', '/sjd/editCustomsContent/:id'], relativePath: ['/sjd/classmgt', '/sjd/classdetail/:classid', '/sjd/newtheme/jobclock/:id', '/sjd/newtheme/calendarclock/:id', '/sjd/newtheme/jobclock/:id/:isCopy', '/sjd/newtheme/calendarclock/:id/:isCopy', '/sjd/thememgt/:classid', '/sjd/clockmgt/:themetype/:themeid', '/sjd/classdetail/studentinfo/:id', '/sjd/customsDetail/:id', '/sjd/addCustomsContent/:id', '/sjd/editCustoms/:id', '/sjd/editCustomsContent/:id'],
}, },
{ {
id: '4', id: '4',
......
...@@ -266,9 +266,9 @@ export default { ...@@ -266,9 +266,9 @@ export default {
}); });
}, },
* getsubjectReviewTemplate({ payload }, { call, put, select }) { * getsubjectReviewTemplate({ payload }, { call, put, select }) {
const { classId } = yield select(state => state.clockmgt); const { themeId } = yield select(state => state.clockmgt);
const tempData = yield call(clockmgtajax.getsubjectReviewTemplate, { const tempData = yield call(clockmgtajax.getsubjectReviewTemplate, {
class_id: classId, subject_id: themeId,
}); });
if (tempData.code == 200) { if (tempData.code == 200) {
yield put({ yield put({
......
...@@ -196,6 +196,11 @@ export default { ...@@ -196,6 +196,11 @@ export default {
id: item.id, id: item.id,
}); });
if (data.code == 200) { if (data.code == 200) {
// eslint-disable-next-line no-nested-ternary
const _content = data.data.content ? JSON.parse(data.data.content) : [];
// eslint-disable-next-line no-nested-ternary
data.data.content = _content && _content[0] ? (_content[0].content || _content[0].title ? _content : [{ title: '', content: _content }]) : [{ title: '', content: [{ type: 'text', value: '' }] }];
console.log(_content, 'data.content');
yield put({ yield put({
type: 'updateState', type: 'updateState',
payload: { payload: {
...@@ -207,7 +212,7 @@ export default { ...@@ -207,7 +212,7 @@ export default {
mobile: data.data.mobile, mobile: data.data.mobile,
img: data.data.img, img: data.data.img,
cover: data.data.cover, cover: data.data.cover,
content: JSON.parse(data.data.content), content: data.data.content,
}, },
addMarkeVisible: true, addMarkeVisible: true,
}, },
......
...@@ -450,7 +450,7 @@ export default { ...@@ -450,7 +450,7 @@ export default {
// eslint-disable-next-line prefer-spread // eslint-disable-next-line prefer-spread
rest_dates: rest_dates && rest_dates.length > 0 ? new_rest_dates.join(',') : '', rest_dates: rest_dates && rest_dates.length > 0 ? new_rest_dates.join(',') : '',
content_id: themeAdInfo.id, content_id: themeAdInfo.id,
class_ids: classes.join(','), class_ids: (newParams.join_rule_type == 2 || newParams.join_rule_type == 4) ? classes.join(',') : '',
join_secret, join_secret,
})); }));
yield put({ yield put({
...@@ -540,7 +540,7 @@ export default { ...@@ -540,7 +540,7 @@ export default {
} }
if ((newParams.id != undefined) && newParams.id !== 0) { if ((newParams.id != undefined) && newParams.id !== 0) {
// yield delay(500); // yield delay(500);
// yield put(routerRedux.goBack()); yield put(routerRedux.goBack());
// yield put({ // yield put({
// type: 'thememgt/getCode', // type: 'thememgt/getCode',
// payload: { // payload: {
...@@ -554,9 +554,14 @@ export default { ...@@ -554,9 +554,14 @@ export default {
// }); // });
} else { } else {
yield delay(500); yield delay(500);
// yield put(routerRedux.push({ yield put(routerRedux.push({
// pathname: `/sjd/thememgt/${class_id}`, pathname: '/sjd/clockList',
// })); }));
yield put({
type: 'updateState',
payload: {
},
});
// yield put({ // yield put({
// type: 'thememgt/getCode', // type: 'thememgt/getCode',
// payload: { // payload: {
...@@ -584,6 +589,7 @@ export default { ...@@ -584,6 +589,7 @@ export default {
const emigratedDate = yield call(themeAjax.findEmigrated, { const emigratedDate = yield call(themeAjax.findEmigrated, {
id: store_id, id: store_id,
school_id: sid, school_id: sid,
extra: 'land_content,class,subject_teacher',
}); });
if (emigratedDate.code == 200) { if (emigratedDate.code == 200) {
yield put({ yield put({
...@@ -617,6 +623,12 @@ export default { ...@@ -617,6 +623,12 @@ export default {
}, },
radioname: emigratedDate.data.sign_up_content ? JSON.parse(emigratedDate.data.sign_up_content).radioname : '', radioname: emigratedDate.data.sign_up_content ? JSON.parse(emigratedDate.data.sign_up_content).radioname : '',
radioList: emigratedDate.data.sign_up_content ? JSON.parse(emigratedDate.data.sign_up_content).radioList : [], radioList: emigratedDate.data.sign_up_content ? JSON.parse(emigratedDate.data.sign_up_content).radioList : [],
themeAdInfo: {
id: (emigratedDate.data.land_content && emigratedDate.data.land_content.id) || 0,
title: (emigratedDate.data.land_content && emigratedDate.data.land_content.title) || '',
},
chooseClasses: emigratedDate.data.classes.map(ele => ({ title: ele.title, id: ele.id })),
classes: emigratedDate.data.classes.map(ele => (ele.id)),
}, },
}); });
} else { } else {
...@@ -1524,6 +1536,8 @@ export default { ...@@ -1524,6 +1536,8 @@ export default {
radioList, radioList,
radioname, radioname,
customsParams, customsParams,
themeAdInfo,
classes,
} = yield select(state => state.createtheme); } = yield select(state => state.createtheme);
const { const {
title, title,
...@@ -1531,15 +1545,21 @@ export default { ...@@ -1531,15 +1545,21 @@ export default {
push_time, push_time,
class_id, class_id,
unlock_rule_type, unlock_rule_type,
password,
join_rule_type,
max_clock_count, max_clock_count,
subject_count, subject_count,
unlock_limit, unlock_limit,
callBack, callBack,
sign_up_status, sign_up_status,
jump_type, join_secret,
} = payload; } = payload;
if (themeAdInfo.id == 0) {
message.error('请选择营销页!', 1);
return;
}
if (customsParams.join_rule_type == 4 && classes.length == 0) {
message.error('请选择班级!', 1);
return;
}
if (sign_up_status == 1) { if (sign_up_status == 1) {
if (radioList.length > 0) { if (radioList.length > 0) {
let flag = false; let flag = false;
...@@ -1585,20 +1605,22 @@ export default { ...@@ -1585,20 +1605,22 @@ export default {
}); });
const postFunction = (newParams.id != undefined) && newParams.id !== 0 ? themeAjax.editEmigrated : themeAjax.addEmigrated; const postFunction = (newParams.id != undefined) && newParams.id !== 0 ? themeAjax.editEmigrated : themeAjax.addEmigrated;
const data = yield call(postFunction, Object.assign(newParams, { const data = yield call(postFunction, Object.assign(newParams, {
school_id: sid,
title, title,
push_status, push_status,
push_time, push_time,
class_id, class_id,
unlock_rule_type, unlock_rule_type,
password,
join_rule_type,
max_clock_count, max_clock_count,
subject_count, subject_count,
unlock_limit, unlock_limit,
sign_up_status, sign_up_status,
introduce: newParams.introduce ? JSON.stringify(newParams.introduce) : '', introduce: newParams.introduce ? JSON.stringify(newParams.introduce) : '',
sign_up_content: newParams.sign_up_content ? JSON.stringify(newParams.sign_up_content) : '', sign_up_content: newParams.sign_up_content ? JSON.stringify(newParams.sign_up_content) : '',
jump_type, content_id: themeAdInfo.id,
class_ids: (newParams.join_rule_type == 2 || newParams.join_rule_type == 4) ? classes.join(',') : '',
join_secret,
status: 1,
})); }));
yield put({ yield put({
type: 'updateState', type: 'updateState',
...@@ -1968,7 +1990,7 @@ export default { ...@@ -1968,7 +1990,7 @@ export default {
* goThemeList({ payload }, { call, put, select }) { * goThemeList({ payload }, { call, put, select }) {
const { themeListId } = yield select(state => state.createtheme); const { themeListId } = yield select(state => state.createtheme);
yield put(routerRedux.push({ yield put(routerRedux.push({
pathname: `/sjd/thememgt/${themeListId}`, pathname: '/sjd/clockList',
})); }));
yield put({ yield put({
type: 'updateState', type: 'updateState',
......
...@@ -11,7 +11,9 @@ import { ...@@ -11,7 +11,9 @@ import {
} from '../utils/index'; } from '../utils/index';
import errorcode from '../common/errorcode'; import errorcode from '../common/errorcode';
import * as uploader from '../services/uploader'; import * as uploader from '../services/uploader';
import * as themeAjax from '../services/newthemelist'; import * as themeListAjax from '../services/newthemelist';
import * as themeAjax from '../services/createtheme';
import * as commonAjax from '../services/common';
export default { export default {
namespace: 'newthemelist', namespace: 'newthemelist',
state: { state: {
...@@ -48,7 +50,7 @@ export default { ...@@ -48,7 +50,7 @@ export default {
school_id: sid, school_id: sid,
}); });
let newTotal = clockListTotal; let newTotal = clockListTotal;
const data = yield call(themeAjax.clockList, { const data = yield call(themeListAjax.clockList, {
...newParams, ...newParams,
}); });
setTimeout(loading); setTimeout(loading);
...@@ -73,27 +75,20 @@ export default { ...@@ -73,27 +75,20 @@ export default {
}); });
} }
}, },
* queryDetail({ payload }, { call, put, select }) { * savePublish({ payload }, { call, put, select }) {
const { id } = payload; const { record } = payload;
const data = yield call(themeAjax.liveDetail, { const { sid } = yield select(state => state.webapp);
id, const data = yield call(themeAjax.saveRelease, {
status: 2,
school_id: sid,
id: record.id,
}); });
if (data.code == 200) { if (data.code === 200) {
message.success('发布成功', 0.5);
yield put({ yield put({
type: 'updateState', type: 'queryList',
payload: { payload: {
addLiveObj: { params: {
title: data.data.title,
remark: data.data.remark,
secret: data.data.secret,
cover: data.data.cover,
live_start_time: data.data.live_start_time,
need_replay: data.data.need_replay,
pay_switch: data.data.pay_switch,
status: data.data.status,
content: JSON.parse(data.data.content),
id: data.data.id,
live_status: data.data.live_status,
}, },
}, },
}); });
...@@ -106,6 +101,93 @@ export default { ...@@ -106,6 +101,93 @@ export default {
}); });
} }
}, },
* deleteTheme({ payload }, { call, put, select }) {
const { id, record } = payload;
const { sid } = yield select(state => state.webapp);
const { clockListParams, clockList } = yield select(state => state.newthemelist);
const postFunction = record.subject_type == 3 ? themeAjax.deleteSubject : themeAjax.deleteTheme;
const goodsdelete = yield call(postFunction, {
id,
school_id: sid,
});
if (goodsdelete.code == 200) {
yield put({
type: 'webapp/updateState',
});
yield put({
type: 'queryList',
payload: {
params: {
page: clockList.length == 1 && clockListParams.page > 1 ? clockListParams.page - 1 : clockListParams.page,
},
},
});
message.success('删除成功', 1);
} else {
yield put({
type: 'webapp/errorrequestresolve',
payload: {
data: goodsdelete,
},
});
}
},
* goclockmgt({ payload }, { call, put, select }) {
const { classId } = yield select(state => state.newthemelist);
if (!payload.subject_id) {
message.error('数据异常', 1);
return;
}
yield put(routerRedux.push({
pathname: `/sjd/clockmgt/${payload.subject_type}/${payload.subject_id}`,
}));
},
* getCode({ payload }, { call, put, select }) {
const { record } = payload;
const loading = message.loading('小程序码生成中,请稍等...', 0);
let params;
switch (record.subject_type) {
case 1:
params = {
scene: `i=${record.class_id}&t=${record.id}&w=${record.school_id}`,
page: 'src/pages/themeindex/index',
width: 430,
};
break;
case 2:
params = {
scene: `i=${record.class_id}&t=${record.id}&w=${record.school_id}`,
page: 'src/pages/calendarthemeindex/index',
width: 430,
};
break;
case 3:
params = {
scene: `i=${record.class_id}&t=${record.id}`,
page: 'src/pages/sharemoretheme/index',
width: 430,
};
break;
default:
params = {};
break;
}
const data = yield call(commonAjax.generateQrcode, params);
setTimeout(loading);
if (data.code === 200) {
message.success('小程序码生成成功', 1);
yield put({
type: 'updateState',
payload: {
previewQrcode: data.data.url,
previewQrcodeShow: true,
downloadTitle: record.title,
},
});
} else {
message.error('小程序码生成失败', 1);
}
},
* goBack({ payload }, { call, put, select }) { * goBack({ payload }, { call, put, select }) {
yield put(routerRedux.goBack()); yield put(routerRedux.goBack());
}, },
......
...@@ -105,11 +105,6 @@ export default { ...@@ -105,11 +105,6 @@ export default {
name: '添加班级', name: '添加班级',
fid: 300, fid: 300,
ffid: 3, ffid: 3,
}, {
key: 30002,
name: '主题管理(发布作业,点评作业)',
fid: 300,
ffid: 3,
}, { }, {
key: 30003, key: 30003,
name: '微信推送设置', name: '微信推送设置',
......
...@@ -612,12 +612,6 @@ export default { ...@@ -612,12 +612,6 @@ export default {
id: jobClockActive[1], id: jobClockActive[1],
}, },
}); });
dispatch({
type: 'createtheme/queryLandingList',
payload: {
params: {},
},
});
dispatch({ dispatch({
type: 'updateState', type: 'updateState',
payload: { payload: {
...@@ -652,12 +646,6 @@ export default { ...@@ -652,12 +646,6 @@ export default {
isCopy: jobClockCopyActive[2], isCopy: jobClockCopyActive[2],
}, },
}); });
dispatch({
type: 'createtheme/queryLandingList',
payload: {
params: {},
},
});
dispatch({ dispatch({
type: 'createtheme/queryClassList', type: 'createtheme/queryClassList',
payload: { payload: {
...@@ -694,12 +682,6 @@ export default { ...@@ -694,12 +682,6 @@ export default {
payload: { payload: {
}, },
}); });
dispatch({
type: 'createtheme/queryLandingList',
payload: {
params: {},
},
});
dispatch({ dispatch({
type: 'updateState', type: 'updateState',
payload: { payload: {
...@@ -722,12 +704,6 @@ export default { ...@@ -722,12 +704,6 @@ export default {
payload: { payload: {
}, },
}); });
dispatch({
type: 'createtheme/queryLandingList',
payload: {
params: {},
},
});
dispatch({ dispatch({
type: 'createtheme/createThemeModalFind', type: 'createtheme/createThemeModalFind',
payload: { payload: {
...@@ -778,12 +754,6 @@ export default { ...@@ -778,12 +754,6 @@ export default {
payload: { payload: {
}, },
}); });
dispatch({
type: 'createtheme/queryLandingList',
payload: {
params: {},
},
});
dispatch({ dispatch({
type: 'createtheme/createThemeModalFind', type: 'createtheme/createThemeModalFind',
payload: { payload: {
...@@ -823,7 +793,7 @@ export default { ...@@ -823,7 +793,7 @@ export default {
}, },
}); });
} }
const clockmgtactive = pathToRegexp('/sjd/clockmgt/:themetype/:classid/:themeid').exec(pathname); const clockmgtactive = pathToRegexp('/sjd/clockmgt/:themetype/:themeid').exec(pathname);
if (clockmgtactive) { if (clockmgtactive) {
dispatch({ dispatch({
type: 'updateState', type: 'updateState',
...@@ -848,10 +818,9 @@ export default { ...@@ -848,10 +818,9 @@ export default {
type: 'clockmgt/enterclockmgt', type: 'clockmgt/enterclockmgt',
payload: { payload: {
themetype: clockmgtactive[1], themetype: clockmgtactive[1],
classId: clockmgtactive[2], themeId: clockmgtactive[2],
themeId: clockmgtactive[3],
params: { params: {
class_id: clockmgtactive[1], subject_id: clockmgtactive[2],
}, },
}, },
}); });
...@@ -863,12 +832,12 @@ export default { ...@@ -863,12 +832,12 @@ export default {
}, },
}); });
dispatch({ dispatch({
type: 'createtheme/queryClassList', type: 'createtheme/queryInfo',
payload: { payload: {
}, },
}); });
dispatch({ dispatch({
type: 'headquarters/headquarterModelDetail', type: 'createtheme/queryClassList',
payload: { payload: {
}, },
}); });
...@@ -877,7 +846,7 @@ export default { ...@@ -877,7 +846,7 @@ export default {
payload: { payload: {
breadcrumbList: [{ breadcrumbList: [{
path: pathname, path: pathname,
name: '发布主题', name: '新建闯关打卡',
}], }],
}, },
}); });
...@@ -1012,6 +981,11 @@ export default { ...@@ -1012,6 +981,11 @@ export default {
payload: { payload: {
}, },
}); });
dispatch({
type: 'createtheme/queryInfo',
payload: {
},
});
dispatch({ dispatch({
type: 'createtheme/createThemeModalfindEmigrated', type: 'createtheme/createThemeModalfindEmigrated',
payload: { payload: {
...@@ -1481,6 +1455,9 @@ export default { ...@@ -1481,6 +1455,9 @@ export default {
}); });
} }
if (pathname === '/sjd/clockList') { if (pathname === '/sjd/clockList') {
dispatch({
type: 'newthemelist/pageInit',
});
dispatch({ dispatch({
type: 'newthemelist/queryinfo', type: 'newthemelist/queryinfo',
}); });
...@@ -1675,7 +1652,7 @@ export default { ...@@ -1675,7 +1652,7 @@ export default {
yield put({ yield put({
type: 'thememgt/pageInit', type: 'thememgt/pageInit',
}); });
} else if (pathToRegexp('/sjd/clockmgt/:themetype/:classid/:themeid').exec(locationPathname)) { } else if (pathToRegexp('/sjd/clockmgt/:themetype/:themeid').exec(locationPathname)) {
yield put({ yield put({
type: 'clockmgt/pageInit', type: 'clockmgt/pageInit',
}); });
...@@ -1747,6 +1724,10 @@ export default { ...@@ -1747,6 +1724,10 @@ export default {
yield put({ yield put({
type: 'createtheme/pageInit', type: 'createtheme/pageInit',
}); });
} else if (pathToRegexp('/sjd/clockList').exec(locationPathname)) {
yield put({
type: 'newthemelist/pageInit',
});
} }
// yield put({ // yield put({
// type: 'joinschooladd/pageInit', // type: 'joinschooladd/pageInit',
......
...@@ -671,12 +671,12 @@ class ClassMgtForm extends React.Component { ...@@ -671,12 +671,12 @@ class ClassMgtForm extends React.Component {
} }
<span className="hreflink" onClick={() => this.goClassDetail(record, 2)}>学员管理</span> <span className="hreflink" onClick={() => this.goClassDetail(record, 2)}>学员管理</span>
<span className={pageStyle.divideline}>|</span> <span className={pageStyle.divideline}>|</span>
{hasBtnPower('sjd/classmgt', 'thememgt') && {/* {hasBtnPower('sjd/classmgt', 'thememgt') && */}
<BtnPermission btnId="30002"> {/* <BtnPermission btnId="30002"> */}
<span className="hreflink" onClick={() => this.goThemeMgt(record)}>打卡管理</span> {/* <span className="hreflink" onClick={() => this.goThemeMgt(record)}>打卡管理</span> */}
<span className={pageStyle.divideline}>|</span> {/* <span className={pageStyle.divideline}>|</span> */}
</BtnPermission> {/* </BtnPermission> */}
} {/* } */}
{ hasBtnPower('sjd/classmgt', 'callStudent') && { hasBtnPower('sjd/classmgt', 'callStudent') &&
<span> <span>
<span className="hreflink" onClick={() => this.goClassDetail(record, 3)}>点名</span> <span className="hreflink" onClick={() => this.goClassDetail(record, 3)}>点名</span>
......
...@@ -111,10 +111,6 @@ class StaticCenter extends React.Component { ...@@ -111,10 +111,6 @@ class StaticCenter extends React.Component {
} }
createTheme = () => { createTheme = () => {
const { dispatch, userPermission } = this.props; const { dispatch, userPermission } = this.props;
if (!btnPermission(userPermission, 30002)) {
message.warn('暂无权限,请联系管理员开通【主题管理权限】', 1);
return;
}
dispatch({ dispatch({
type: 'createtheme/goTheme', type: 'createtheme/goTheme',
payload: { payload: {
...@@ -124,10 +120,6 @@ class StaticCenter extends React.Component { ...@@ -124,10 +120,6 @@ class StaticCenter extends React.Component {
} }
createCalendarTheme = () => { createCalendarTheme = () => {
const { dispatch, userPermission } = this.props; const { dispatch, userPermission } = this.props;
if (!btnPermission(userPermission, 30002)) {
message.warn('暂无权限,请联系管理员开通【主题管理权限】', 1);
return;
}
dispatch({ dispatch({
type: 'createtheme/goTheme', type: 'createtheme/goTheme',
payload: { payload: {
...@@ -137,10 +129,6 @@ class StaticCenter extends React.Component { ...@@ -137,10 +129,6 @@ class StaticCenter extends React.Component {
} }
createUnlockTheme = () => { createUnlockTheme = () => {
const { dispatch, userPermission } = this.props; const { dispatch, userPermission } = this.props;
if (!btnPermission(userPermission, 30002)) {
message.warn('暂无权限,请联系管理员开通【主题管理权限】', 1);
return;
}
dispatch(routerRedux.push('/sjd/addCustoms')); dispatch(routerRedux.push('/sjd/addCustoms'));
} }
disabledDate=(current) => { disabledDate=(current) => {
...@@ -1169,8 +1157,16 @@ class StaticCenter extends React.Component { ...@@ -1169,8 +1157,16 @@ class StaticCenter extends React.Component {
</Col> </Col>
</Row> </Row>
<Row gutter={24}> <Row gutter={24}>
{btnPermission(userPermission, 2) &&
<Col xs={{ span: 8, offset: 0 }} sm={{ span: 8, offset: 0 }} md={{ span: 8, offset: 0 }} lg={{ span: 4, offset: 0 }} xl={{ span: 4, offset: 0 }} xxl={{ span: 4, offset: 0 }}> <Col xs={{ span: 8, offset: 0 }} sm={{ span: 8, offset: 0 }} md={{ span: 8, offset: 0 }} lg={{ span: 4, offset: 0 }} xl={{ span: 4, offset: 0 }} xxl={{ span: 4, offset: 0 }}>
<div className={pageStyle.fasterItem} onClick={this.goClockList}>
<div className={pageStyle.fasterLeft}>
<img className={pageStyle.fasterImg} src={`${__IMGCDN__}index/index_icon11.png?v=1`} alt="" />
</div>
<span>打卡列表</span>
</div>
</Col>
{btnPermission(userPermission, 2) &&
<Col xs={{ span: 8, offset: 0 }} sm={{ span: 8, offset: 0 }} md={{ span: 8, offset: 0 }} lg={{ span: 4, offset: 1 }} xl={{ span: 4, offset: 1 }} xxl={{ span: 4, offset: 1 }}>
<div className={pageStyle.fasterItem} onClick={this.goDeadlineStudent}> <div className={pageStyle.fasterItem} onClick={this.goDeadlineStudent}>
<div className={pageStyle.fasterLeft}> <div className={pageStyle.fasterLeft}>
{ {
...@@ -1183,14 +1179,6 @@ class StaticCenter extends React.Component { ...@@ -1183,14 +1179,6 @@ class StaticCenter extends React.Component {
</div> </div>
</Col> </Col>
} }
<Col xs={{ span: 8, offset: 0 }} sm={{ span: 8, offset: 0 }} md={{ span: 8, offset: 0 }} lg={{ span: 4, offset: 1 }} xl={{ span: 4, offset: 1 }} xxl={{ span: 4, offset: 1 }}>
<div className={pageStyle.fasterItem} onClick={this.goClockList}>
<div className={pageStyle.fasterLeft}>
<img className={pageStyle.fasterImg} src={`${__IMGCDN__}index/index_icon11.png?v=1`} alt="" />
</div>
<span>打卡列表</span>
</div>
</Col>
</Row> </Row>
</div> </div>
} }
......
...@@ -422,6 +422,9 @@ class CalendarClockForm extends React.Component { ...@@ -422,6 +422,9 @@ class CalendarClockForm extends React.Component {
classes, classes,
chooseClasses, chooseClasses,
addMarkeVisible, addMarkeVisible,
collapsed,
screenIsBig,
schoolUserInfo,
} = this.props; } = this.props;
let new_rest_dates = []; let new_rest_dates = [];
new_rest_dates = [...new Set(new_rest_dates.concat(...rest_dates))]; new_rest_dates = [...new Set(new_rest_dates.concat(...rest_dates))];
...@@ -697,6 +700,7 @@ class CalendarClockForm extends React.Component { ...@@ -697,6 +700,7 @@ class CalendarClockForm extends React.Component {
chooseClasses={chooseClasses} chooseClasses={chooseClasses}
choose={this.handleChooseClass} choose={this.handleChooseClass}
saveClasses={this.saveClasses} saveClasses={this.saveClasses}
schoolUserInfo={schoolUserInfo}
/> />
: null : null
} }
...@@ -867,11 +871,17 @@ class CalendarClockForm extends React.Component { ...@@ -867,11 +871,17 @@ class CalendarClockForm extends React.Component {
<AddMarkeModal <AddMarkeModal
visible={addMarkeVisible} visible={addMarkeVisible}
/> />
<FormItem {...submitFormLayout} style={{ marginTop: 32 }}> <div
className={pageStyle.footerBox}
style={{
left: screenIsBig ? (!collapsed ? '193px' : '102px') : 0, // eslint-disable-line
width: screenIsBig ? (`calc(100% - ${!collapsed ? '214px' : '122px'})`) : '100%', // eslint-disable-line
}}
>
<Button type="primary" htmlType="submit" loading={themeAddLoading}> <Button type="primary" htmlType="submit" loading={themeAddLoading}>
发布主题 发布主题
</Button> </Button>
</FormItem> </div>
</Form> </Form>
</div> </div>
); );
...@@ -908,6 +918,7 @@ function mapStateToProps(state) { ...@@ -908,6 +918,7 @@ function mapStateToProps(state) {
const { const {
addMarkeVisible, addMarkeVisible,
} = state.createmarke; } = state.createmarke;
const { collapsed, screenIsBig, schoolUserInfo } = state.webapp;
return { return {
themeAddLoading, themeAddLoading,
classList, classList,
...@@ -930,6 +941,10 @@ function mapStateToProps(state) { ...@@ -930,6 +941,10 @@ function mapStateToProps(state) {
clockClassParams, clockClassParams,
classes, classes,
chooseClasses, chooseClasses,
collapsed,
screenIsBig,
schoolUserInfo,
addMarkeVisible,
}; };
} }
export default connect(mapStateToProps)(CalendarClock); export default connect(mapStateToProps)(CalendarClock);
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
background-color: #fff; background-color: #fff;
padding: 20px; padding: 20px;
position: relative; position: relative;
padding-bottom: 80px;
} }
.title { .title {
font-size:16px; font-size:16px;
...@@ -345,3 +346,15 @@ ...@@ -345,3 +346,15 @@
} }
} }
} }
.footerBox {
position: fixed;
bottom: 0;
background-color: #fff;
padding: 20px 20px 14px 20px;
width: 100%;
box-shadow:1px -6px 6px 0px rgba(0, 0, 0, 0.04);
transition: 0.2s left;
transition: 0.1s width;
z-index: 20;
text-align: center;
}
...@@ -61,6 +61,7 @@ class ChooseClassModal extends React.Component { ...@@ -61,6 +61,7 @@ class ChooseClassModal extends React.Component {
clockClassParams, clockClassParams,
classes, classes,
chooseClasses, chooseClasses,
schoolUserInfo,
} = this.props; } = this.props;
return ( return (
<Modal <Modal
...@@ -99,7 +100,7 @@ class ChooseClassModal extends React.Component { ...@@ -99,7 +100,7 @@ class ChooseClassModal extends React.Component {
{ {
ele.school_teachers.map((ll, i) => { ele.school_teachers.map((ll, i) => {
return ( return (
<span className={pageStyle.teacherName}>{ll.nickname}</span> <span className={ll.id == schoolUserInfo.id ? pageStyle.teacherNameActive : pageStyle.teacherName}>{ll.nickname}</span>
); );
}) })
} }
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
max-height: 400px; max-height: 400px;
min-height: 350px; min-height: 350px;
overflow-y: scroll; overflow-y: scroll;
padding-right: 10px;
.classItem { .classItem {
margin-bottom: 20px; margin-bottom: 20px;
.classTitle { .classTitle {
...@@ -51,8 +52,14 @@ ...@@ -51,8 +52,14 @@
content: '、'; content: '、';
} }
} }
.teacherName:nth-child(1){ .teacherNameActive{
color: #FEA915; color: #FEA915;
font-size: 12px;
}
.teacherNameActive:not(:last-child) {
&:after{
content: '、';
}
} }
} }
.check { .check {
......
...@@ -62,6 +62,7 @@ class ThemeEditor extends React.Component { ...@@ -62,6 +62,7 @@ class ThemeEditor extends React.Component {
<div className={pageStyle.editorwrap}> <div className={pageStyle.editorwrap}>
{ {
commentParams.content && commentParams.content.length > 0 && commentParams.content.map((ele, sort) => { commentParams.content && commentParams.content.length > 0 && commentParams.content.map((ele, sort) => {
console.log(ele.content, 'ele');
return ( return (
<div className={pageStyle.plateWrap}> <div className={pageStyle.plateWrap}>
{/* <div className={pageStyle.plateDelete} onClick={() => editorDeletePlate(sort)}><Icon type="close-circle" theme="filled" /></div> */} {/* <div className={pageStyle.plateDelete} onClick={() => editorDeletePlate(sort)}><Icon type="close-circle" theme="filled" /></div> */}
......
...@@ -50,12 +50,12 @@ class SuccessStoreForm extends React.Component { ...@@ -50,12 +50,12 @@ class SuccessStoreForm extends React.Component {
<div className={pageStyle.container}> <div className={pageStyle.container}>
<div className={pageStyle.head}> <div className={pageStyle.head}>
<Icon type="check-circle" theme="filled" style={{ color: '#52c41a', fontSize: 50 }} /> <Icon type="check-circle" theme="filled" style={{ color: '#52c41a', fontSize: 50 }} />
<p className={pageStyle.successInfo}>闯关活动成功创建</p> <p className={pageStyle.successInfo}>闯关打卡成功创建</p>
<img className={pageStyle.img} src={imagify(storeImg)} alt="" /> <img className={pageStyle.img} src={imagify(storeImg)} alt="" />
{storeImg && <p>活动创建成功,打开微信扫一扫,查看活动或转发给学员</p>} {storeImg && <p>打卡创建成功,打开微信扫一扫,查看活动或转发给学员</p>}
</div> </div>
<div style={{ textAlign: 'center' }}> <div style={{ textAlign: 'center' }}>
<Button type="primary" onClick={this.goThemeList}>返回主题列表</Button> <Button type="primary" onClick={this.goThemeList}>返回打卡列表</Button>
</div> </div>
</div> </div>
); );
......
This diff is collapsed.
...@@ -250,4 +250,41 @@ ...@@ -250,4 +250,41 @@
font-weight:400; font-weight:400;
color:rgba(173,173,173,1); color:rgba(173,173,173,1);
line-height:18px; line-height:18px;
} }
\ No newline at end of file .radioList {
width: 300px;
.radioItem {
border-bottom: 1px solid #e8e8e8;
.radioName {
font-size: 12px;
color: #000;
line-height: 20px;
}
.radioTop {
display: flex;
align-items: center;
cursor: pointer;
.radioText {
display: flex;
align-items: center;
font-size:13px;
font-family:PingFangSC-Regular,PingFang SC;
font-weight:400;
color:rgba(34,34,34,1);
width: 300px;
&>span {
font-size:13px;
font-family:PingFangSC-Regular,PingFang SC;
font-weight:400;
color:#999999;
}
}
.radioRight {
.check {
width: 19px;
height: 19px;
}
}
}
}
}
...@@ -304,7 +304,7 @@ class SuccessStoreForm extends React.Component { ...@@ -304,7 +304,7 @@ class SuccessStoreForm extends React.Component {
<div className={pageStyle.container}> <div className={pageStyle.container}>
<div className={pageStyle.head}> <div className={pageStyle.head}>
<div className={pageStyle.top}> <div className={pageStyle.top}>
<img className={pageStyle.banner} src={imagify(emigratedObj.banner)} alt="" /> <img className={pageStyle.banner} src={imagify(emigratedObj.land_content && emigratedObj.land_content.cover)} alt="" />
<div> <div>
<div className={pageStyle.activityTitle}>{emigratedObj.title}</div> <div className={pageStyle.activityTitle}>{emigratedObj.title}</div>
<div className={pageStyle.activityNum}>已创建关卡数/关卡总数:{subjectList.length} / {emigratedObj.subject_count}</div> <div className={pageStyle.activityNum}>已创建关卡数/关卡总数:{subjectList.length} / {emigratedObj.subject_count}</div>
......
...@@ -372,9 +372,10 @@ class JobClockForm extends React.Component { ...@@ -372,9 +372,10 @@ class JobClockForm extends React.Component {
clockClassParams, clockClassParams,
classes, classes,
chooseClasses, chooseClasses,
collapsed,
screenIsBig,
schoolUserInfo,
} = this.props; } = this.props;
console.log(classes, 'classes');
console.log(chooseClasses, 'chooseClasses');
const formItemModalLineLayout = { const formItemModalLineLayout = {
labelCol: { labelCol: {
xs: { span: 2 }, xs: { span: 2 },
...@@ -599,6 +600,7 @@ class JobClockForm extends React.Component { ...@@ -599,6 +600,7 @@ class JobClockForm extends React.Component {
chooseClasses={chooseClasses} chooseClasses={chooseClasses}
choose={this.handleChooseClass} choose={this.handleChooseClass}
saveClasses={this.saveClasses} saveClasses={this.saveClasses}
schoolUserInfo={schoolUserInfo}
/> />
: null : null
} }
...@@ -750,11 +752,17 @@ class JobClockForm extends React.Component { ...@@ -750,11 +752,17 @@ class JobClockForm extends React.Component {
<AddMarkeModal <AddMarkeModal
visible={addMarkeVisible} visible={addMarkeVisible}
/> />
<FormItem {...submitFormLayout} style={{ marginTop: 32 }}> <div
className={pageStyle.footerBox}
style={{
left: screenIsBig ? (!collapsed ? '193px' : '102px') : 0, // eslint-disable-line
width: screenIsBig ? (`calc(100% - ${!collapsed ? '214px' : '122px'})`) : '100%', // eslint-disable-line
}}
>
<Button type="primary" htmlType="submit" loading={themeAddLoading}> <Button type="primary" htmlType="submit" loading={themeAddLoading}>
发布打卡 发布打卡
</Button> </Button>
</FormItem> </div>
</Form> </Form>
</div> </div>
); );
...@@ -786,6 +794,7 @@ function mapStateToProps(state) { ...@@ -786,6 +794,7 @@ function mapStateToProps(state) {
const { const {
addMarkeVisible, addMarkeVisible,
} = state.createmarke; } = state.createmarke;
const { collapsed, screenIsBig, schoolUserInfo } = state.webapp;
return { return {
themeAddLoading, themeAddLoading,
classList, classList,
...@@ -804,6 +813,9 @@ function mapStateToProps(state) { ...@@ -804,6 +813,9 @@ function mapStateToProps(state) {
clockClassParams, clockClassParams,
classes, classes,
chooseClasses, chooseClasses,
schoolUserInfo,
collapsed,
screenIsBig,
}; };
} }
export default connect(mapStateToProps)(JobClock); export default connect(mapStateToProps)(JobClock);
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
background-color: #fff; background-color: #fff;
padding: 20px; padding: 20px;
position: relative; position: relative;
padding-bottom: 80px;
} }
.title { .title {
font-size:16px; font-size:16px;
...@@ -122,3 +123,15 @@ ...@@ -122,3 +123,15 @@
} }
} }
} }
.footerBox {
position: fixed;
bottom: 0;
background-color: #fff;
padding: 20px 20px 14px 20px;
width: 100%;
box-shadow:1px -6px 6px 0px rgba(0, 0, 0, 0.04);
transition: 0.2s left;
transition: 0.1s width;
z-index: 20;
text-align: center;
}
...@@ -92,47 +92,44 @@ class LiveClass extends React.Component { ...@@ -92,47 +92,44 @@ class LiveClass extends React.Component {
type: 'newthemelist/reset', type: 'newthemelist/reset',
}); });
} }
goClockMgt = (record) => { judgeTimeStatuc = (endTime, startTime) => {
const { dispatch } = this.props; const endStamp = Date.parse(endTime.replace(/\-/g, '/'));
if (record.status == 1) { const startStamp = Date.parse(startTime.replace(/\-/g, '/'));
message.warning('该活动还暂未发布噢,请先发布', 0.5); const nowStamp = (new Date()).getTime();
return; let status = '';
if (startStamp <= nowStamp) {
status = 'notstart';
} }
dispatch({ if (endStamp < nowStamp) {
type: 'newthemelist/goclockmgt', status = 'end';
payload: { }
subject_id: record.id, if (endStamp > nowStamp && startStamp < nowStamp) {
subject_type: record.subject_type, status = 'doing';
}, }
}); return status;
} }
subjectTypeChange = (subjectType) => { tabShift = (type) => {
const { dispatch } = this.props; const { dispatch } = this.props;
dispatch({ dispatch({
type: 'thememgt/subjecttypechange', type: 'newthemelist/queryList',
payload: { payload: {
subjectType, params: {
subject_type: type,
},
}, },
}); });
} }
search = () => { goClockMgt = (record) => {
const { dispatch } = this.props;
dispatch({
type: 'thememgt/search',
});
}
resetsearch = () => {
const { dispatch } = this.props;
dispatch({
type: 'thememgt/resetsearch',
});
}
editTheme = (record) => {
const { dispatch } = this.props; const { dispatch } = this.props;
if (record.status == 1) {
message.warning('该活动还暂未发布噢,请先发布', 0.5);
return;
}
dispatch({ dispatch({
type: 'createtheme/editGoTheme', type: 'newthemelist/goclockmgt',
payload: { payload: {
record, subject_id: record.id,
subject_type: record.subject_type,
}, },
}); });
} }
...@@ -161,7 +158,7 @@ class LiveClass extends React.Component { ...@@ -161,7 +158,7 @@ class LiveClass extends React.Component {
icon: <Icon type="close-circle" style={{ color: 'red' }} />, icon: <Icon type="close-circle" style={{ color: 'red' }} />,
onOk() { onOk() {
dispatch({ dispatch({
type: 'thememgt/deleteTheme', type: 'newthemelist/deleteTheme',
payload: { payload: {
record, record,
id: record.id, id: record.id,
...@@ -181,7 +178,7 @@ class LiveClass extends React.Component { ...@@ -181,7 +178,7 @@ class LiveClass extends React.Component {
lookClockMgt = (record) => { lookClockMgt = (record) => {
const { dispatch } = this.props; const { dispatch } = this.props;
dispatch({ dispatch({
type: 'thememgt/getCode', type: 'newthemelist/getCode',
payload: { payload: {
record, record,
}, },
...@@ -190,7 +187,7 @@ class LiveClass extends React.Component { ...@@ -190,7 +187,7 @@ class LiveClass extends React.Component {
closeQrcodeShow = () => { closeQrcodeShow = () => {
const { dispatch } = this.props; const { dispatch } = this.props;
dispatch({ dispatch({
type: 'thememgt/updateState', type: 'newthemelist/updateState',
payload: { payload: {
previewQrcodeShow: false, previewQrcodeShow: false,
}, },
...@@ -203,36 +200,42 @@ class LiveClass extends React.Component { ...@@ -203,36 +200,42 @@ class LiveClass extends React.Component {
return; return;
} }
dispatch({ dispatch({
type: 'thememgt/savePublish', type: 'newthemelist/savePublish',
payload: { payload: {
record, record,
}, },
}); });
} }
judgeTimeStatuc = (endTime, startTime) => { createClock = () => {
const endStamp = Date.parse(endTime.replace(/\-/g, '/')); const { dispatch, clockListParams } = this.props;
const startStamp = Date.parse(startTime.replace(/\-/g, '/')); if (clockListParams.subject_type == 1) {
const nowStamp = (new Date()).getTime(); dispatch({
let status = ''; type: 'createtheme/goTheme',
if (startStamp <= nowStamp) { payload: {
status = 'notstart'; index: 1,
} },
if (endStamp < nowStamp) { });
status = 'end'; } else if (clockListParams.subject_type == 2) {
} dispatch({
if (endStamp > nowStamp && startStamp < nowStamp) { type: 'createtheme/goTheme',
status = 'doing'; payload: {
index: 2,
},
});
} else {
dispatch(routerRedux.push('/sjd/addCustoms'));
} }
return status;
} }
tabShift = (type) => { editTheme = (record) => {
const { dispatch } = this.props; const { dispatch } = this.props;
// if (record.subject_type == 3) {
// message.warning('功能即将开放,敬请期待', 1);
// return;
// }
dispatch({ dispatch({
type: 'newthemelist/queryList', type: 'createtheme/editGoTheme',
payload: { payload: {
params: { record,
subject_type: type,
},
}, },
}); });
} }
...@@ -356,7 +359,7 @@ class LiveClass extends React.Component { ...@@ -356,7 +359,7 @@ class LiveClass extends React.Component {
className={pageStyle.formList} className={pageStyle.formList}
> >
<Col xs={{ span: 8 }} sm={{ span: 8 }} md={{ span: 4 }} lg={{ span: 4 }} xl={{ span: 4 }}> <Col xs={{ span: 8 }} sm={{ span: 8 }} md={{ span: 4 }} lg={{ span: 4 }} xl={{ span: 4 }}>
<Button size="small" style={{ marginRight: 20 }} type="primary" onClick={this.createLive}>新建打卡</Button> <Button size="small" style={{ marginRight: 20 }} type="primary" onClick={this.createClock}>新建打卡</Button>
</Col> </Col>
<Col xs={{ span: 16 }} sm={{ span: 16 }} md={{ span: 20 }} lg={{ span: 20 }} xl={{ span: 20 }}> <Col xs={{ span: 16 }} sm={{ span: 16 }} md={{ span: 20 }} lg={{ span: 20 }} xl={{ span: 20 }}>
<Row <Row
......
...@@ -316,7 +316,7 @@ function RouterConfig({ history }) { ...@@ -316,7 +316,7 @@ function RouterConfig({ history }) {
<Route path="/sjd/classmgt" exact component={ClassMgt} /> <Route path="/sjd/classmgt" exact component={ClassMgt} />
<Route path="/sjd/classdetail/:classid" exact component={ClassDetail} /> <Route path="/sjd/classdetail/:classid" exact component={ClassDetail} />
<Route path="/sjd/thememgt/:classid" exact component={ThemeMgt} /> <Route path="/sjd/thememgt/:classid" exact component={ThemeMgt} />
<Route path="/sjd/clockmgt/:themetype/:classid/:themeid" exact component={ClockMgt} /> <Route path="/sjd/clockmgt/:themetype/:themeid" exact component={ClockMgt} />
<Route path="/sjd/student" exact component={Student} /> <Route path="/sjd/student" exact component={Student} />
<Route path="/sjd/studentinfo/:id" exact component={Studentinfo} /> <Route path="/sjd/studentinfo/:id" exact component={Studentinfo} />
<Route path="/sjd/classdetail/studentinfo/:id" exact component={Studentinfo} /> <Route path="/sjd/classdetail/studentinfo/:id" exact component={Studentinfo} />
......
...@@ -72,7 +72,7 @@ export function destoryShortWords(params) { ...@@ -72,7 +72,7 @@ export function destoryShortWords(params) {
} }
export function getsubjectReviewTemplate(params) { export function getsubjectReviewTemplate(params) {
return request({ return request({
url: `${api.clockmgt.subjectReviewTemplate}?class_id=${params.class_id}`, url: `${api.clockmgt.subjectReviewTemplate}?subject_id=${params.subject_id}`,
method: 'GET', method: 'GET',
}); });
} }
......
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