Commit 35a937e1 by FE

Merge branch 'pythonClass' into dev

parents bffcbe05 66b17ab7
...@@ -17,7 +17,8 @@ class PythonClass extends Component { ...@@ -17,7 +17,8 @@ class PythonClass extends Component {
isWechat: browser.isWeixin, isWechat: browser.isWeixin,
isShare: true, isShare: true,
type: '1', // 1:课后习题,2:课堂习题 type: '1', // 1:课后习题,2:课堂习题
entryMode: 0, // 0:扫码页,1:落地页,2:直接进入 entryMode: 0, // 0:扫码页,1:落地页
isGuide: false, // 是否展示引导
isExecute: false, isExecute: false,
isCopy: false, isCopy: false,
command: '', command: '',
...@@ -33,19 +34,19 @@ class PythonClass extends Component { ...@@ -33,19 +34,19 @@ class PythonClass extends Component {
initCommand = () => { initCommand = () => {
this.setState({ this.setState({
command: `${API.m}/pythonShare?id=${getParam('id')}&type=${getParam('type')}&ques=${getParam('ques')}&from=python` command: `${API.m}/pythonShare?id=${getParam('id')}&type=${getParam('type')}&ques=${getParam('ques')}&origin=python`
}) })
} }
initPageStatus = () => { initPageStatus = () => {
if(getParam('from') === 'barcode') { if(getParam('origin') === 'barcode') {
this.setState({ this.setState({
entryMode: 0 entryMode: 0
}); });
} }
if(getParam('from') === 'python') { if(getParam('origin') === 'python') {
this.setState({ this.setState({
entryMode: 2 entryMode: 1
}); });
} }
if(getParam('type') === '1') { if(getParam('type') === '1') {
...@@ -84,8 +85,9 @@ class PythonClass extends Component { ...@@ -84,8 +85,9 @@ class PythonClass extends Component {
const { history } = this.props; const { history } = this.props;
const { isShare, entryMode } = this.state; const { isShare, entryMode } = this.state;
if(browser.isWeixin) { if(browser.isWeixin) {
history.push(`/pythonShare?id=${getParam('id')}&type=${getParam('type')}&ques=${getParam('ques')}&from=python`); history.push(`/pythonShare?id=${getParam('id')}&type=${getParam('type')}&ques=${getParam('ques')}&origin=python`);
this.setState({ this.setState({
isGuide: true,
entryMode: 1 entryMode: 1
}); });
let title = ''; let title = '';
...@@ -130,12 +132,12 @@ class PythonClass extends Component { ...@@ -130,12 +132,12 @@ class PythonClass extends Component {
handleToHide = () => { handleToHide = () => {
this.setState({ this.setState({
entryMode: 2 isGuide: false
}); });
} }
render() { render() {
const { isWechat, isShare, isExecute, entryMode, command, isCopy, data } = this.state; const { isWechat, isShare, isExecute, entryMode, command, isCopy, isGuide, data } = this.state;
return ( return (
<> <>
<HeaderBar <HeaderBar
...@@ -148,6 +150,7 @@ class PythonClass extends Component { ...@@ -148,6 +150,7 @@ class PythonClass extends Component {
isShare={isShare} isShare={isShare}
isExecute={isExecute} isExecute={isExecute}
entryMode={entryMode} entryMode={entryMode}
isGuide={isGuide}
isCopy={isCopy} isCopy={isCopy}
command={command} command={command}
data={data} data={data}
...@@ -187,7 +190,8 @@ function PythonContent(props) { ...@@ -187,7 +190,8 @@ function PythonContent(props) {
isCopy, isCopy,
command, command,
labelName, labelName,
data: { head_img, nickname, code_lines, code, result, ques_name, course_name, course_id, video_name }, isGuide,
data: { head_img, nickname, code_lines, code, result, course_name, course_id },
handleToSend, handleToSend,
copyToSuccess, copyToSuccess,
handleToExecute, handleToExecute,
...@@ -217,7 +221,7 @@ function PythonContent(props) { ...@@ -217,7 +221,7 @@ function PythonContent(props) {
} }
{ {
(entryMode === 1 && isWechat) && (entryMode === 1 && isWechat && isGuide) &&
<div className="python-popup" onClick={handleToHide}> <div className="python-popup" onClick={handleToHide}>
<div className="python-header"> <div className="python-header">
<p className="python-wechat__title">请点击右上角分享</p> <p className="python-wechat__title">请点击右上角分享</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