Commit 35a937e1 by FE

Merge branch 'pythonClass' into dev

parents bffcbe05 66b17ab7
......@@ -17,7 +17,8 @@ class PythonClass extends Component {
isWechat: browser.isWeixin,
isShare: true,
type: '1', // 1:课后习题,2:课堂习题
entryMode: 0, // 0:扫码页,1:落地页,2:直接进入
entryMode: 0, // 0:扫码页,1:落地页
isGuide: false, // 是否展示引导
isExecute: false,
isCopy: false,
command: '',
......@@ -33,19 +34,19 @@ class PythonClass extends Component {
initCommand = () => {
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 = () => {
if(getParam('from') === 'barcode') {
if(getParam('origin') === 'barcode') {
this.setState({
entryMode: 0
});
}
if(getParam('from') === 'python') {
if(getParam('origin') === 'python') {
this.setState({
entryMode: 2
entryMode: 1
});
}
if(getParam('type') === '1') {
......@@ -84,8 +85,9 @@ class PythonClass extends Component {
const { history } = this.props;
const { isShare, entryMode } = this.state;
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({
isGuide: true,
entryMode: 1
});
let title = '';
......@@ -130,12 +132,12 @@ class PythonClass extends Component {
handleToHide = () => {
this.setState({
entryMode: 2
isGuide: false
});
}
render() {
const { isWechat, isShare, isExecute, entryMode, command, isCopy, data } = this.state;
const { isWechat, isShare, isExecute, entryMode, command, isCopy, isGuide, data } = this.state;
return (
<>
<HeaderBar
......@@ -148,6 +150,7 @@ class PythonClass extends Component {
isShare={isShare}
isExecute={isExecute}
entryMode={entryMode}
isGuide={isGuide}
isCopy={isCopy}
command={command}
data={data}
......@@ -187,7 +190,8 @@ function PythonContent(props) {
isCopy,
command,
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,
copyToSuccess,
handleToExecute,
......@@ -217,7 +221,7 @@ function PythonContent(props) {
}
{
(entryMode === 1 && isWechat) &&
(entryMode === 1 && isWechat && isGuide) &&
<div className="python-popup" onClick={handleToHide}>
<div className="python-header">
<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