Commit 85c5542f by FE

Merge branch 'pythonClass' into dev

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