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
bc983c3e
Commit
bc983c3e
authored
Dec 31, 2019
by
xuzhenghua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pull
parent
7bae7588
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
66 additions
and
58 deletions
+66
-58
build/asset-manifest.json
+0
-0
build/index.html
+0
-0
build/precache-manifest.731286b89f3341429e322e379cab4d51.js
+0
-0
build/service-worker.js
+1
-1
src/common/v-list-base/index.js
+1
-1
src/components/pythonShare/index.js
+54
-54
src/components/pythonShare/index.scss
+1
-0
src/components/study/myCourses/index.js
+9
-2
No files found.
build/asset-manifest.json
View file @
bc983c3e
This diff is collapsed.
Click to expand it.
build/index.html
View file @
bc983c3e
This diff is collapsed.
Click to expand it.
build/precache-manifest.
96b7cacc736890250848cd957cbdf9ec
.js
→
build/precache-manifest.
731286b89f3341429e322e379cab4d51
.js
View file @
bc983c3e
This diff is collapsed.
Click to expand it.
build/service-worker.js
View file @
bc983c3e
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
importScripts
(
"https://storage.googleapis.com/workbox-cdn/releases/3.6.3/workbox-sw.js"
);
importScripts
(
"https://storage.googleapis.com/workbox-cdn/releases/3.6.3/workbox-sw.js"
);
importScripts
(
importScripts
(
"/precache-manifest.
96b7cacc736890250848cd957cbdf9ec
.js"
"/precache-manifest.
731286b89f3341429e322e379cab4d51
.js"
);
);
workbox
.
clientsClaim
();
workbox
.
clientsClaim
();
...
...
src/common/v-list-base/index.js
View file @
bc983c3e
...
@@ -3,7 +3,7 @@ import './index.scss'
...
@@ -3,7 +3,7 @@ import './index.scss'
const
VList
=
(
props
)
=>
{
const
VList
=
(
props
)
=>
{
return
(
return
(
<
li
className
=
'v-list-base-item'
onClick
=
{
props
.
handleClick
.
bind
(
this
,
props
.
id
)}
>
<
li
className
=
'v-list-base-item'
onClick
=
{
props
.
handleClick
.
bind
(
this
,
props
.
id
,
props
.
item
)}
>
<
div
className
=
"content"
>
<
div
className
=
"content"
>
<
div
className
=
"cover"
>
<
div
className
=
"cover"
>
{
props
.
status
}
{
props
.
status
}
...
...
src/components/pythonShare/index.js
View file @
bc983c3e
...
@@ -4,7 +4,7 @@ import {CopyToClipboard} from 'react-copy-to-clipboard';
...
@@ -4,7 +4,7 @@ import {CopyToClipboard} from 'react-copy-to-clipboard';
import
AceEditor
from
'react-ace'
;
import
AceEditor
from
'react-ace'
;
import
{
Toast
}
from
"antd-mobile"
import
{
Toast
}
from
"antd-mobile"
import
{
HeaderBar
}
from
'@/common'
;
import
{
HeaderBar
}
from
'@/common'
;
import
{
browser
,
http
,
getParam
}
from
'@/utils'
;
import
{
browser
,
http
,
getParam
,
wxShare
}
from
'@/utils'
;
import
'./index.scss'
;
import
'./index.scss'
;
import
'ace-builds/src-noconflict/mode-python'
;
import
'ace-builds/src-noconflict/mode-python'
;
import
'ace-builds/src-noconflict/theme-dracula'
;
import
'ace-builds/src-noconflict/theme-dracula'
;
...
@@ -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'
)
{
...
@@ -80,13 +81,38 @@ class PythonClass extends Component {
...
@@ -80,13 +81,38 @@ class PythonClass extends Component {
})
})
}
}
handleToSend
=
()
=>
{
handleToSend
=
(
params
)
=>
{
const
{
history
}
=
this
.
props
;
const
{
history
}
=
this
.
props
;
const
{
isShare
,
entryMode
}
=
this
.
state
;
if
(
browser
.
isWeixin
)
{
if
(
browser
.
isWeixin
)
{
history
.
push
(
`/pythonShare?id=
${
getParam
(
'id'
)}
&type=
${
getParam
(
'type'
)}
&ques=
${
getParam
(
'ques'
)}
&origin=python`
);
this
.
setState
({
this
.
setState
({
entryMode
:
1
isGuide
:
true
});
let
title
=
''
;
let
labelName
=
this
.
formatTitle
(
params
);
if
(
entryMode
!==
0
&&
!
isShare
)
{
title
=
`我在
${
params
.
course_name
}
的
${
labelName
}
遇到了困难`
;
}
if
(
entryMode
!==
0
&&
isShare
)
{
title
=
`我已在【
${
params
.
course_name
}
】上运行了行代码了
${
params
.
code_lines
}
`
}
wxShare
({
title
,
desc
:
labelName
,
link
:
encodeURI
(
location
.
href
),
imgUrl
:
params
.
course_img
,
});
});
history
.
push
(
`/pythonShare?id=
${
getParam
(
'id'
)}
&type=
${
getParam
(
'type'
)}
&ques=
${
getParam
(
'ques'
)}
&from=python`
);
}
}
formatTitle
=
(
params
)
=>
{
const
{
type
}
=
this
.
state
;
if
(
type
===
'1'
)
{
return
`练习-
${
params
.
ques_name
}
`
;
}
if
(
type
===
'2'
)
{
return
`课堂-
${
params
.
video_name
}
`
;
}
}
}
}
...
@@ -105,12 +131,12 @@ class PythonClass extends Component {
...
@@ -105,12 +131,12 @@ class PythonClass extends Component {
handleToHide
=
()
=>
{
handleToHide
=
()
=>
{
this
.
setState
({
this
.
setState
({
entryMode
:
2
isGuide
:
false
});
});
}
}
render
()
{
render
()
{
const
{
isWechat
,
isShare
,
isExecute
,
type
,
entryMode
,
command
,
isCopy
,
data
}
=
this
.
state
;
const
{
isWechat
,
isShare
,
isExecute
,
entryMode
,
command
,
isCopy
,
isGuide
,
data
}
=
this
.
state
;
return
(
return
(
<>
<>
<
HeaderBar
<
HeaderBar
...
@@ -121,12 +147,13 @@ class PythonClass extends Component {
...
@@ -121,12 +147,13 @@ class PythonClass extends Component {
<
PythonContent
<
PythonContent
isWechat
=
{
isWechat
}
isWechat
=
{
isWechat
}
isShare
=
{
isShare
}
isShare
=
{
isShare
}
type
=
{
type
}
isExecute
=
{
isExecute
}
isExecute
=
{
isExecute
}
entryMode
=
{
entryMode
}
entryMode
=
{
entryMode
}
isGuide
=
{
isGuide
}
isCopy
=
{
isCopy
}
isCopy
=
{
isCopy
}
command
=
{
command
}
command
=
{
command
}
data
=
{
data
}
data
=
{
data
}
labelName
=
{
this
.
formatTitle
(
data
)}
handleToExecute
=
{
this
.
handleToExecute
}
handleToExecute
=
{
this
.
handleToExecute
}
handleToSend
=
{
this
.
handleToSend
}
handleToSend
=
{
this
.
handleToSend
}
copyToSuccess
=
{
this
.
copyToSuccess
}
copyToSuccess
=
{
this
.
copyToSuccess
}
...
@@ -158,48 +185,21 @@ function PythonContent(props) {
...
@@ -158,48 +185,21 @@ function PythonContent(props) {
isWechat
,
isWechat
,
isShare
,
isShare
,
isExecute
,
isExecute
,
type
,
entryMode
,
entryMode
,
isCopy
,
isCopy
,
command
,
command
,
data
:
{
head_img
,
nickname
,
code_lines
,
code
,
result
,
ques_name
,
course_name
,
course_id
,
video_name
},
labelName
,
isGuide
,
data
:
{
head_img
,
nickname
,
code_lines
,
code
,
result
,
course_name
,
course_id
},
handleToSend
,
handleToSend
,
copyToSuccess
,
copyToSuccess
,
handleToExecute
,
handleToExecute
,
handleToHide
handleToHide
}
=
props
;
}
=
props
;
let
labelName
=
''
;
if
(
type
===
'1'
)
{
labelName
=
`练习-
${
ques_name
}
`
;
}
if
(
type
===
'2'
)
{
labelName
=
`课堂-
${
video_name
}
`
;
}
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
)
&&
<
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
>
...
@@ -209,9 +209,7 @@ function PythonContent(props) {
...
@@ -209,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
>
{
/* 分享 */
}
{
/* 分享 */
}
...
@@ -223,7 +221,7 @@ function PythonContent(props) {
...
@@ -223,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 /
>
...
@@ -241,7 +239,7 @@ function PythonContent(props) {
...
@@ -241,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 /
>
...
@@ -250,20 +248,22 @@ function PythonContent(props) {
...
@@ -250,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
>
...
@@ -294,7 +294,7 @@ function PythonContent(props) {
...
@@ -294,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
>
...
...
src/components/pythonShare/index.scss
View file @
bc983c3e
...
@@ -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
;
...
...
src/components/study/myCourses/index.js
View file @
bc983c3e
...
@@ -76,8 +76,14 @@ class MyCourses extends Component {
...
@@ -76,8 +76,14 @@ class MyCourses extends Component {
isLoading
:
true
isLoading
:
true
}
}
handleClick
=
id
=>
{
handleClick
=
(
id
,
item
)
=>
{
this
.
props
.
history
.
push
(
`/play/video?id=
${
id
}
`
)
const
{
history
}
=
this
.
props
const
{
mode
,
course_id
}
=
item
if
(
mode
&&
mode
==
6
){
history
.
push
(
`/python?id=
${
course_id
}
`
)
return
}
history
.
push
(
`/play/video?id=
${
id
}
`
)
}
}
addCourseClick
=
()
=>
{
addCourseClick
=
()
=>
{
this
.
props
.
history
.
push
(
'/classify'
)
this
.
props
.
history
.
push
(
'/classify'
)
...
@@ -164,6 +170,7 @@ class MyCourses extends Component {
...
@@ -164,6 +170,7 @@ class MyCourses extends Component {
info
=
{
Info
}
info
=
{
Info
}
status
=
{
status
}
status
=
{
status
}
courseExpire
=
{
courseExpire
}
courseExpire
=
{
courseExpire
}
item
=
{
item
}
id
=
{
item
[
'v_course_id'
]}
id
=
{
item
[
'v_course_id'
]}
/
>
/
>
)
)
...
...
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