diff --git a/public/react/package.json b/public/react/package.json index d29adb905..e644e2166 100644 --- a/public/react/package.json +++ b/public/react/package.json @@ -61,6 +61,7 @@ "postcss-loader": "2.0.8", "promise": "8.0.1", "prop-types": "^15.6.1", + "qrcode.react": "^1.0.0", "qs": "^6.6.0", "quill": "^1.3.7", "quill-delta-to-html": "^0.11.0", diff --git a/public/react/src/modules/courses/signin/component/teachercomponent/Teaccomponent.js b/public/react/src/modules/courses/signin/component/teachercomponent/Teaccomponent.js index 26a871416..e2f51d4e1 100644 --- a/public/react/src/modules/courses/signin/component/teachercomponent/Teaccomponent.js +++ b/public/react/src/modules/courses/signin/component/teachercomponent/Teaccomponent.js @@ -39,10 +39,15 @@ class Teaccomponent extends Component{ axios.post(url, data) .then((result) => { if (result.data.status === 0) { - // this.props.showNotification(`组卷成功`); - // console.log(result.data.exam_id); - //本来调试卷库首页的 + // try { + // this.props.showNotification(`截止成功`); + // }catch (e) { + // + // } this.props.getsetdatas(); + }else{ + this.props.showNotification(result.data.message); + } }).catch((error) => { //console.log(error); @@ -57,10 +62,16 @@ class Teaccomponent extends Component{ axios.delete(url, data) .then((result) => { if (result.data.status === 0) { - // this.props.showNotification(`组卷成功`); - // console.log(result.data.exam_id); - //本来调试卷库首页的 + // try { + // this.props.showNotification(`删除成功`); + // }catch (e) { + // + // } + this.props.getsetdatas(); + }else{ + this.props.showNotification(result.data.message); + } }).catch((error) => { //console.log(error); @@ -68,7 +79,51 @@ class Teaccomponent extends Component{ } //学生签到 - Signin=(type,)=>{ + Signin=(attendance_mode,attendance_id,code)=>{ + const url = `/weapps/course_member_attendances.json`; + var data={ + + } + if(attendance_mode==="QUICK"){ + //快捷签到 + data={ + attendance_mode:"QUICK", + attendance_id:attendance_id, + } + axios.post(url, data) + .then((result) => { + if (result.data.status === 0) { + try { + this.props.showNotification(`签到成功`); + }catch (e) { + + } + + this.props.getsetdatas(); + }else{ + this.props.showNotification(result.data.message); + + } + }).catch((error) => { + }) + }else if(attendance_mode==="QRCODE"){ + //二维码签到 + data={ + attendance_mode:"QRCODE", + attendance_id:attendance_id, + code:code, + } + this.props.GotomQrcodesodesy(data,true) + }else if(attendance_mode==="NUMBER"){ + //数字签到 + data={ + attendance_mode:"NUMBER", + attendance_id:attendance_id, + code:code, + } + this.props.Gotomodes(data,true) + + } } diff --git a/public/react/src/modules/courses/signin/css/signincdi.css b/public/react/src/modules/courses/signin/css/signincdi.css index e6f4ccf21..08ebe7f0a 100644 --- a/public/react/src/modules/courses/signin/css/signincdi.css +++ b/public/react/src/modules/courses/signin/css/signincdi.css @@ -211,8 +211,8 @@ } .ymaxnamewidth60{ - max-width: 60px; - width: 60px; + max-width: 70px; + width: 70px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; diff --git a/public/react/src/modules/courses/signin/model/Qrcodesignin.js b/public/react/src/modules/courses/signin/model/Qrcodesignin.js index aa028cb17..1979a6370 100644 --- a/public/react/src/modules/courses/signin/model/Qrcodesignin.js +++ b/public/react/src/modules/courses/signin/model/Qrcodesignin.js @@ -1,12 +1,11 @@ import React,{ Component } from "react"; - import { Modal , Button} from 'antd'; +import QRCode from 'qrcode.react'; class Qrcodesignin extends Component { constructor(props) { super(props) } - render() { const leftbuton={ @@ -33,7 +32,11 @@ class Qrcodesignin extends Component {
共{attendances_count}个签到正在进行
-this.Qrcodesignintypefun()}>创建签到
-