Merge branch 'dev_aliyun' of http://bdgit.educoder.net/Hjqreturn/educoder into dev_aliyun

dev_hss
cxt 6 years ago
commit da70b86fd0

@ -324,7 +324,7 @@ class App extends Component {
title: 'EduCoder',
desc: '创新源于实践',
link: currentUrl,
imgUrl: currentUrl + '/images/educoder/index/subject/subject15.jpg'
imgUrl: (currentUrl.endsWith('/') ? currentUrl : currentUrl + '/') + 'images/educoder/index/subject/subject15.jpg'
};
wx.onMenuShareAppMessage(shareData);//分享给好友

@ -21,16 +21,16 @@ let hashTimeout
// TODO 开发期多个身份切换
let debugType =""
// if (isDev) {
// const _search = window.location.search;
// let parsed = {};
// if (_search) {
// parsed = queryString.parse(_search);
// }
// debugType = window.location.search.indexOf('debug=t') != -1 ? 'teacher' :
// window.location.search.indexOf('debug=s') != -1 ? 'student' :
// window.location.search.indexOf('debug=a') != -1 ? 'admin' : parsed.debug || 'admin'
// }
if (isDev) {
const _search = window.location.search;
let parsed = {};
if (_search) {
parsed = queryString.parse(_search);
}
debugType = window.location.search.indexOf('debug=t') != -1 ? 'teacher' :
window.location.search.indexOf('debug=s') != -1 ? 'student' :
window.location.search.indexOf('debug=a') != -1 ? 'admin' : parsed.debug || 'admin'
}
window._debugType = debugType;
export function initAxiosInterceptors(props) {

@ -59,7 +59,7 @@ class GtaskBanksEdit extends Component {
});
}
toWorkDetail = () => {
this.props.history.push(`/banks/gtask/${this.props.match.params.workId}/${this.props.match.params.type}?tab=0`);
window.location.href=`/banks/gtask/${this.props.match.params.workId}/${this.props.match.params.type}?tab=0`;
this.props.initPublic(undefined);
}
onCancel = () => {

@ -19,6 +19,7 @@ class NewGtaskForms extends Component{
initValue = (data) => {
if (data.isEdit===true) {
const contentFileList = data.attachments.map(item => {
return {
id: item.id,
@ -31,10 +32,10 @@ class NewGtaskForms extends Component{
})
this.setState({
...data,
base_on_project: data.group_info.base_on_project,
base_on_project: data.task_type===2?data.group_info.base_on_project:undefined,
title_num: parseInt(data.name.length),
min_num: data.group_info.min_number,
max_num: data.group_info.max_number,
min_num: data.task_type===2?data.group_info.min_number:undefined,
max_num: data.task_type===2?data.group_info.max_number:undefined,
contentFileList,
}, () => {
setTimeout(() => {
@ -47,6 +48,8 @@ class NewGtaskForms extends Component{
});
})
}
}
@ -120,27 +123,28 @@ class NewGtaskForms extends Component{
values.description = mdContnet;
if (!err) {
if (this.props.data.isEdit===true) {
let url="/task_banks/"+topicId+".json";
axios.put(url, {
gtask_bank: {
name: values.title,
description: values.description,
min_num:task_type===1?undefined:min_num,
max_num:task_type===1?undefined:max_num,
base_on_project: task_type===1?undefined:base_on_project===true?1:0
},
attachment_ids:contentFileList
gtask_bank: {
name: values.title,
description: values.description,
min_num:task_type===1?undefined:min_num,
max_num:task_type===1?undefined:max_num,
base_on_project: task_type===1?undefined:base_on_project===true?1:0
},
attachment_ids:contentFileList
}
).then((response) => {
if(response.data.status===0){
this.props.showNotification(response.data.message)
}else{
this.props.showNotification(response.data.message)
}
if(response.data.status===0){
this.props.showNotification(response.data.message)
}else{
this.props.showNotification(response.data.message)
}
}).catch((error) => {
console.log(error)
})
}
} else {
$("html").animate({ scrollTop: $('html').scrollTop() - 100 })
}

Loading…
Cancel
Save