Commit 85c5542f by FE

Merge branch 'pythonClass' into dev

parents 06c512bc dee252cd
...@@ -87,8 +87,7 @@ class PythonClass extends Component { ...@@ -87,8 +87,7 @@ class PythonClass extends Component {
if(browser.isWeixin) { if(browser.isWeixin) {
history.push(`/pythonShare?id=${getParam('id')}&type=${getParam('type')}&ques=${getParam('ques')}&origin=python`); history.push(`/pythonShare?id=${getParam('id')}&type=${getParam('type')}&ques=${getParam('ques')}&origin=python`);
this.setState({ this.setState({
isGuide: true, isGuide: true
entryMode: 1
}); });
let title = ''; let title = '';
let labelName = this.formatTitle(params); let labelName = this.formatTitle(params);
...@@ -197,31 +196,10 @@ function PythonContent(props) { ...@@ -197,31 +196,10 @@ function PythonContent(props) {
handleToExecute, handleToExecute,
handleToHide handleToHide
} = props; } = props;
return ( return (
<div className="python-container"> <div className="python-container">
{/* 微信 */}
{
// (entryMode === 0 && isWechat) &&
// <div className="python-header">
// <p className="python-wechat__title">请点击右上角分享</p>
// <i className="iconfont iconyindao"></i>
// </div>
}
{/* 非微信 */}
{ {
// (entryMode === 0 && !isWechat) && isGuide &&
// <div className="python-header">
// <p className="python-wechat__title">
// {isShare? '快分享给好友吧' : '快发给好友求助吧'}
// </p>
// </div>
}
{
(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>
...@@ -231,9 +209,7 @@ function PythonContent(props) { ...@@ -231,9 +209,7 @@ function PythonContent(props) {
} }
<div className="python-content"> <div className="python-content">
<div className="python-user"> <div className="python-user">
<div className="python-user__portrait"> <i className="python-user__portrait" style={{backgroundImage: `url(${head_img})`}}></i>
<img src={head_img} alt=""/>
</div>
<h2 className="python-user__id">{nickname}</h2> <h2 className="python-user__id">{nickname}</h2>
{/* 分享 */} {/* 分享 */}
...@@ -245,7 +221,7 @@ function PythonContent(props) { ...@@ -245,7 +221,7 @@ function PythonContent(props) {
</p> </p>
} }
{ {
(entryMode !== 0 && isShare) && (entryMode === 1 && isShare) &&
<p className="python-user__desc"> <p className="python-user__desc">
<span>{course_name}</span>完成了<br /> <span>{course_name}</span>完成了<br />
...@@ -263,7 +239,7 @@ function PythonContent(props) { ...@@ -263,7 +239,7 @@ function PythonContent(props) {
</p> </p>
} }
{ {
(entryMode !== 0 && !isShare) && (entryMode === 1 && !isShare) &&
<p className="python-user__desc"> <p className="python-user__desc">
<span>{course_name}</span>的<br /> <span>{course_name}</span>的<br />
...@@ -272,20 +248,22 @@ function PythonContent(props) { ...@@ -272,20 +248,22 @@ function PythonContent(props) {
} }
</div> </div>
<h4 className="python-code__title"> <h4 className="python-code__title">
{entryMode !== 0 && isShare && !isWechat? `这是Ta的第${code_lines}行代码` : '运行结果'} {entryMode === 1 && isShare? `这是Ta的第${code_lines}行代码` : '运行结果'}
</h4> </h4>
<div className="python-code__content"> <div className="python-code__content">
<SelfAceEditor code={entryMode !== 0 && isShare && !isWechat? code : result} /> <SelfAceEditor code={entryMode === 1 && isShare? code : result} />
</div> </div>
<h4 className="python-code__title">{entryMode !== 0 && isShare && !isWechat? '运行结果' : '代码'}</h4> <h4 className="python-code__title">
{entryMode === 1 && isShare? '运行结果' : '代码'}
</h4>
<div className="python-code__content"> <div className="python-code__content">
{ {
entryMode !== 0 && isShare && !isWechat entryMode === 1 && isShare
? <SelfAceEditor code={isExecute? result : ''} /> ? <SelfAceEditor code={isExecute? result : ''} />
: <SelfAceEditor code={code} /> : <SelfAceEditor code={code} />
} }
{ {
(entryMode !== 0 && isShare && !isWechat && !isExecute) && (entryMode === 1 && isShare && !isExecute) &&
<button className="python-button python-button__execute" onClick={handleToExecute}>运行看看</button> <button className="python-button python-button__execute" onClick={handleToExecute}>运行看看</button>
} }
</div> </div>
...@@ -316,7 +294,7 @@ function PythonContent(props) { ...@@ -316,7 +294,7 @@ function PythonContent(props) {
} }
{ {
entryMode !== 0 && entryMode === 1 &&
<Link className="python-button python-button__study" to={`/python?id=${course_id}`}>我也要学Python</Link> <Link className="python-button python-button__study" to={`/python?id=${course_id}`}>我也要学Python</Link>
} }
</div> </div>
......
...@@ -56,6 +56,7 @@ ...@@ -56,6 +56,7 @@
border-radius: 50%; border-radius: 50%;
box-sizing: border-box; box-sizing: border-box;
background-color: #fff; background-color: #fff;
background-size: cover;
img { img {
display: block; display: block;
......
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