Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mr-julyedu
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
baiguangyao
mr-julyedu
Commits
35a937e1
Commit
35a937e1
authored
Dec 26, 2019
by
FE
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'pythonClass' into dev
parents
bffcbe05
66b17ab7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
10 deletions
+14
-10
src/components/pythonShare/index.js
+14
-10
No files found.
src/components/pythonShare/index.js
View file @
35a937e1
...
@@ -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
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment