Commit e842c26c authored by baixian's avatar baixian

打卡完成

parent afea53ae
......@@ -18,5 +18,5 @@
</head>
<body>
<div id="root"></div>
<script type="text/javascript" src="/dist/main.88d533.js"></script></body>
<script type="text/javascript" src="/dist/main.8c8aaa.js"></script></body>
</html>
\ No newline at end of file
......@@ -295,7 +295,6 @@ export default {
themetype,
} = yield select(state => state.clockmgt);
const { type, callBack } = payload;
console.log(singleClock, 'singleClock');
const emptyIndex = copyTempArr.findIndex(ele => ele.title.trim() == '');
if (emptyIndex != -1) {
message.warn(`第${emptyIndex + 1}个模板名称不能为空`, 1);
......
......@@ -355,12 +355,6 @@ export default {
...calendarParams,
};
}
console.log(jobParams, 'jobParams');
console.log(calendarParams, 'calendarParams');
if (title.length > 20) {
message.error('标题长度不能超过20个字!', 1);
return;
}
if (themeAdInfo.id == 0) {
message.error('请选择营销页!', 1);
return;
......@@ -500,40 +494,57 @@ export default {
callBack();
}
if ((newParams.id != undefined) && newParams.id !== 0) {
// yield delay(500);
yield delay(500);
yield put(routerRedux.goBack());
// yield put({
// type: 'thememgt/getCode',
// payload: {
// record: {
// class_id: data.data.class_id,
// id: data.data.id,
// title: data.data.title,
// subject_type: Number(data.data.subject_type),
// },
// },
// });
yield put({
type: 'newthemelist/updateState',
payload: {
clockListParams: {
title: '',
page: 1,
perPage: 10,
subject_type: data.data.subject_type,
},
},
});
yield put({
type: 'newthemelist/getCode',
payload: {
record: {
school_id: data.data.school_id,
id: data.data.id,
title: data.data.title,
subject_type: Number(data.data.subject_type),
},
},
});
} else {
yield delay(500);
yield put(routerRedux.push({
pathname: '/sjd/clockList',
}));
yield put({
type: 'updateState',
type: 'newthemelist/updateState',
payload: {
clockListParams: {
title: '',
page: 1,
perPage: 10,
subject_type: data.data.subject_type,
},
},
});
yield put({
type: 'newthemelist/getCode',
payload: {
record: {
school_id: data.data.school_id,
id: data.data.id,
title: data.data.title,
subject_type: Number(data.data.subject_type),
},
},
});
// yield put({
// type: 'thememgt/getCode',
// payload: {
// record: {
// class_id: data.data.class_id,
// id: data.data.id,
// title: data.data.title,
// subject_type: Number(data.data.subject_type),
// },
// },
// });
}
} else {
yield put({
......
......@@ -149,21 +149,21 @@ export default {
switch (record.subject_type) {
case 1:
params = {
scene: `i=${record.class_id}&t=${record.id}&w=${record.school_id}`,
scene: `t=${record.id}&s=${record.school_id}&w=0`,
page: 'src/pages/themeindex/index',
width: 430,
};
break;
case 2:
params = {
scene: `i=${record.class_id}&t=${record.id}&w=${record.school_id}`,
scene: `t=${record.id}&s=${record.school_id}&w=0`,
page: 'src/pages/calendarthemeindex/index',
width: 430,
};
break;
case 3:
params = {
scene: `i=${record.class_id}&t=${record.id}`,
scene: `t=${record.id}&s=${record.school_id}&w=0`,
page: 'src/pages/sharemoretheme/index',
width: 430,
};
......
......@@ -137,7 +137,6 @@ export default {
const file = files.files ? files.files[0] : null;
uploaderLoading();
const filename = `${signature.dir}${getRandomFilename(file.name)}`;
console.log(filename, 'filename');
const params = {
key: filename,
policy: signature.policy,
......
......@@ -468,7 +468,7 @@ class CalendarClockForm extends React.Component {
},
};
const selectBefore = (
<div>{calendarParams.title.length + textLength || 0}/20</div>
<div>{calendarParams.title.length + textLength || 0}/40</div>
);
const dateFormat = 'YYYY/MM/DD HH:mm';
return (
......@@ -485,7 +485,7 @@ class CalendarClockForm extends React.Component {
},
],
})(
<Input maxLength={20} onChange={e => this.titleChange(e)} addonAfter={selectBefore} placeholder="请输入标题" style={{ width: 435 }} />,
<Input maxLength={40} onChange={e => this.titleChange(e)} addonAfter={selectBefore} placeholder="请输入标题" style={{ width: 435 }} />,
)}
</FormItem>
{getFieldDecorator('subject_type', { initialValue: 2 })(<Input type="hidden" />)}
......@@ -592,7 +592,7 @@ class CalendarClockForm extends React.Component {
</FormItem>
<Divider />
<div className={pageStyle.title} >打卡营销页</div>
<FormItem {...formItemModalLineLayout} label="打卡营销页" style={{ marginBottom: 0 }}>
<FormItem required {...formItemModalLineLayout} label="打卡营销页" style={{ marginBottom: 0 }}>
<span onClick={this.handleClickMarketing}>{themeAdInfo.title ? themeAdInfo.title : '请选择营销页'}<Icon type="right" /></span>
</FormItem>
<p className={pageStyle.markeTip}>可在学生加入打卡前展示, 此功能可收集有意向学生的联系方式 <span>了解详情</span></p>
......
......@@ -585,7 +585,7 @@ class UnClockForm extends React.Component {
)}
<span className="ant-form-text"></span>
</FormItem>
<FormItem {...formItemModalLineLayout} label="打卡营销页" style={{ marginBottom: 0 }}>
<FormItem required {...formItemModalLineLayout} label="打卡营销页">
<span onClick={this.handleClickMarketing}>{themeAdInfo.title ? themeAdInfo.title : '请选择营销页'}<Icon type="right" /></span>
</FormItem>
<FormItem {...formItemModaltypeLayout} label="参与打卡方式" style={{ marginBottom: 0 }}>
......
......@@ -161,6 +161,19 @@ class SuccessStoreForm extends React.Component {
},
});
}
savePublish = (record) => {
const { dispatch } = this.props;
if (record.has_subjects_count == 0) {
message.warning('请先编辑关卡内容再发布噢~', 0.5);
return;
}
dispatch({
type: 'newthemelist/savePublish',
payload: {
record,
},
});
}
render() {
const {
form: { getFieldDecorator, getFieldValue },
......@@ -319,6 +332,13 @@ class SuccessStoreForm extends React.Component {
<Divider type="vertical" />
<span className="hreflink" onClick={() => this.editStore(emigratedObj.id)}>编辑</span>
<Divider type="vertical" />
{
emigratedObj.status == 1 &&
<span>
<span className="hreflink" onClick={() => this.savePublish(emigratedObj)}>发布</span>
<Divider type="vertical" />
</span>
}
<span className="hreflink" onClick={() => this.lookClockMgt(emigratedObj)}>分享</span>
</div>
</div>
......
......@@ -52,7 +52,6 @@ class JobClockForm extends React.Component {
e.preventDefault();
this.props.form.validateFields((err, values) => {
if (!err) {
console.log(values, 'params');
const {
is_cheat,
is_encrypt,
......@@ -421,7 +420,7 @@ class JobClockForm extends React.Component {
lineHeight: '40px',
};
const selectBefore = (
<div>{jobParams.title.length + textLength}/20</div>
<div>{jobParams.title.length + textLength}/40</div>
);
const dateFormat = 'YYYY/MM/DD HH:mm';
return (
......@@ -438,7 +437,7 @@ class JobClockForm extends React.Component {
},
],
})(
<Input maxLength={20} onChange={e => this.titleChange(e)} addonAfter={selectBefore} placeholder="请输入标题" style={{ width: 435 }} />,
<Input maxLength={40} onChange={e => this.titleChange(e)} addonAfter={selectBefore} placeholder="请输入标题" style={{ width: 435 }} />,
)}
</FormItem>
{getFieldDecorator('subject_type', { initialValue: 1 })(<Input type="hidden" />)}
......@@ -492,7 +491,7 @@ class JobClockForm extends React.Component {
</div>
<Divider />
<div className={pageStyle.title} >打卡营销页</div>
<FormItem {...formItemModalLineLayout} label="打卡营销页" style={{ marginBottom: 0 }}>
<FormItem {...formItemModalLineLayout} required label="打卡营销页" style={{ marginBottom: 0 }}>
<span onClick={this.handleClickMarketing}>{themeAdInfo.title ? themeAdInfo.title : '请选择营销页'}<Icon type="right" /></span>
</FormItem>
<p className={pageStyle.markeTip}>可在学生加入打卡前展示, 此功能可收集有意向学生的联系方式 <span>了解详情</span></p>
......
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