Commit 2933eacd authored by wangxuelai's avatar wangxuelai

''

parent 0ac1c9e6
import React from 'react';
import { Modal, Button } from 'antd';
import componentStyle from './UserGuide.less';
import { audioorigin } from '../utils/index';
class UserGuide extends React.Component {
constructor(props) {
super(props);
this.state = {
};
}
componentDidMount() {
}
componentWillUpdate() {
}
cancelCropper = () => {
}
sureCropper = () => {
}
rotateLeft = () => {
}
rotateRight = () => {
}
closeImgPreview = () => {
}
caculateCirclePosition = (place, params) => {
const {
width, height, top, left, right, bottom,
} = params;
const position = {};
switch (place) {
case 'top':
position.top = top - 4;
position.left = (left + (width / 2)) - 8;
position.right = (left + (width / 2)) + 8;
position.bottom = top + 12;
// position.top = '';
break;
case 'right':
position.top = (top + (height / 2)) - 8;
position.left = left + width + 4;
position.right = left + width + 20;
position.bottom = (top + (height / 2)) + 8;
break;
case 'bottom':
position.top = top + height + 4;
position.left = (left + (width / 2)) - 8;
position.right = (left + (width / 2)) + 8;
position.bottom = top + height + 20;
break;
case 'left':
position.top = (top + (height / 2)) - 8;
position.left = left - 4;
position.right = left + 12;
position.bottom = (top + (height / 2)) + 8;
break;
default:
break;
}
return position;
}
render() {
const {
guideShow, step, continueGuide, skipGuide,
} = this.props;
let menuBtn = null;
let addCourseBtn = null;
let addStudentBtn = null;
const stepPosition = {};
switch (Number(step)) {
case 1:
break;
case 2:
menuBtn = document.getElementById('menu_6');
if (menuBtn) {
menuBtn.style.position = 'relative';
menuBtn.style.zIndex = 105;
stepPosition.menuBtn = this.caculateCirclePosition('right', menuBtn.getClientRects()[0]);
}
addCourseBtn = document.getElementById('course_addcourse');
if (addCourseBtn) {
addCourseBtn.style.position = 'relative';
addCourseBtn.style.zIndex = 105;
stepPosition.addCourseBtn = this.caculateCirclePosition('bottom', addCourseBtn.getClientRects()[0]);
}
break;
case 3:
menuBtn = document.getElementById('menu_5');
if (menuBtn) {
menuBtn.style.position = 'relative';
menuBtn.style.zIndex = 105;
stepPosition.menuBtn = this.caculateCirclePosition('right', menuBtn.getClientRects()[0]);
}
addStudentBtn = document.getElementById('student_addStudent');
if (addStudentBtn) {
addStudentBtn.style.position = 'relative';
addStudentBtn.style.zIndex = 105;
stepPosition.addStudentBtn = this.caculateCirclePosition('bottom', addStudentBtn.getClientRects()[0]);
}
break;
default:
break;
}
return (
<div>
{guideShow &&
<div className={`${componentStyle.UserGuide} UserGuide`}>
<Modal
visible={step == 1}
footer={null}
closable={false}
wrapClassName="UserGuideModal"
title={<div className={componentStyle.modalHeader}><span className={componentStyle.title}>页面新人引导</span><span className={componentStyle.skip} onClick={skipGuide}>跳过</span></div>}
>
<img className={componentStyle.guidecover} src={`${__IMGCDN__}guide/guidecover.png`} alt="" />
<div className={componentStyle.guidedesc}>完成以下引导,更快了解教务系统</div>
<div className={componentStyle.btnbox}>
<Button type="primary" onClick={continueGuide}>开始引导</Button>
</div>
</Modal>
{step == 2 &&
<div className={componentStyle.guidemask}>
<div className={componentStyle.circledot} style={stepPosition.menuBtn} />
<div className={componentStyle.circledot} style={stepPosition.addCourseBtn} />
<div
className={componentStyle.textdesc}
style={{
top: stepPosition.menuBtn.top - 8,
left: stepPosition.addCourseBtn.left + 38,
}}
>
创建机构课程
</div>
{/* 横线 */}
<div
className={componentStyle.linetype1}
style={{
width: (stepPosition.addCourseBtn.left - stepPosition.menuBtn.right) + 6,
left: stepPosition.menuBtn.right + 2,
top: stepPosition.menuBtn.top + 8,
}}
/>
{/* 竖线 */}
<div
className={componentStyle.linetype2}
style={{
height: (stepPosition.menuBtn.top - stepPosition.addCourseBtn.bottom) + 8,
left: stepPosition.addCourseBtn.left + 7,
top: stepPosition.addCourseBtn.bottom + 2,
}}
/>
<div
className={componentStyle.nextStep}
style={{
top: stepPosition.menuBtn.top + 74,
left: stepPosition.addCourseBtn.left + 150,
}}
onClick={continueGuide}
>
下一步
</div>
</div>
}
{step == 3 &&
<div className={componentStyle.guidemask}>
<div className={componentStyle.circledot} style={stepPosition.menuBtn} />
<div className={componentStyle.circledot} style={stepPosition.addStudentBtn} />
{/* 横线 */}
<div
className={componentStyle.linetype1}
style={{
width: ((stepPosition.addStudentBtn && stepPosition.addStudentBtn.left) || 0 - stepPosition.menuBtn.right) + 6,
left: stepPosition.menuBtn.right + 2,
top: stepPosition.menuBtn.top + 8,
}}
/>
{/* 竖线 */}
<div
className={componentStyle.linetype2}
style={{
height: (stepPosition.menuBtn.top - (stepPosition.addStudentBtn && stepPosition.addStudentBtn.bottom) || 0) + 8,
left: (stepPosition.addStudentBtn && stepPosition.addStudentBtn.left) + 7,
top: (stepPosition.addStudentBtn && stepPosition.addStudentBtn.bottom) + 2,
}}
/>
</div>
}
</div>
}
</div>
);
}
}
export default UserGuide;
......@@ -218,6 +218,15 @@ class UserGuide extends React.Component {
document.getElementById('index_paywarn').style.position = '';
document.getElementById('index_paywarn').style.zIndex = '';
}
// dispatch({
// type: 'userguide/updateState',
// payload: {
// guideShow: false, // 引导步骤
// guideStep: 1, // 引导步骤
// },
// });
break;
case 12:
dispatch({
type: 'userguide/updateState',
payload: {
......@@ -738,6 +747,30 @@ class UserGuide extends React.Component {
left: position.paywarnbtn.left - 100,
}}
onClick={this.continueGuide}
>
下一步
</div>
</div>
}
{guideStep == 12 &&
<div className={componentStyle.guidemask}>
<img
src={`${__IMGCDN__}guide/callguide.png`}
className={componentStyle.callguide}
alt=""
style={{
position: 'absolute',
bottom: 27,
left: 400,
}}
/>
<div
className={componentStyle.nextStep}
style={{
bottom: 200,
left: 1000,
}}
onClick={this.continueGuide}
>
完成
</div>
......
......@@ -24,6 +24,7 @@ export default {
timer: null,
location_address: '',
deployType: 3, // 类型 1-口才 2-美术 3-书法 4-跆拳道 5-通用
schoolId: 0,
},
subscriptions: {
setup({ dispatch, history }) { // eslint-disable-line
......
......@@ -185,7 +185,7 @@ class QxLoginForm extends React.Component {
</Form>
<div className={LoginStyles.registerbox}>
<div className={LoginStyles.noaccount}>还没有账号?</div>
<Link className={LoginStyles.goregister} to="/register" target="_blank">去注册</Link>
<Link className={LoginStyles.goregister} to="/register">去注册</Link>
</div>
</div>
</div>
......
......@@ -198,7 +198,7 @@ class SjdLoginForm extends React.Component {
</Form>
<div className={LoginStyles.registerbox}>
<div className={LoginStyles.noaccount}>还没有账号?</div>
<Link className={LoginStyles.goregister} to="/register" target="_blank">去注册</Link>
<Link className={LoginStyles.goregister} to="/register">去注册</Link>
</div>
</div>}
</div>
......
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