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
da5d5051
Commit
da5d5051
authored
Jun 11, 2020
by
xuzhenghua
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'ai-test' of
https://gitlab.julyedu.com/baiguangyao/mr-julyedu
parents
ec48b3cc
e0236b44
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
13 deletions
+18
-13
src/components/ai-test/report/index.js
+12
-12
src/components/ai-test/report/index.scss
+5
-0
src/components/ai-test/scores/index.js
+1
-1
No files found.
src/components/ai-test/report/index.js
View file @
da5d5051
import
React
,
{
Component
}
from
'react'
import
React
,
{
Component
}
from
'react'
import
{
HeaderBar
}
from
'@/common'
import
{
HeaderBar
}
from
'@/common'
import
{
http
}
from
'@/utils'
import
{
getParam
,
http
}
from
'@/utils'
import
'./index.scss'
import
'./index.scss'
import
QRCode
from
'qrcode'
import
QRCode
from
'qrcode'
import
html2canvas
from
'html2canvas'
import
html2canvas
from
'html2canvas'
...
@@ -37,14 +37,14 @@ class scoreReport extends Component {
...
@@ -37,14 +37,14 @@ class scoreReport extends Component {
}
}
shouldComponentUpdate
(
nextProps
,
nextState
,
nextContext
)
{
//
shouldComponentUpdate(nextProps, nextState, nextContext) {
if
(
this
.
props
.
user
.
data
.
avatar
!==
nextProps
.
user
.
data
.
avatar
)
{
//
if (this.props.user.data.avatar !== nextProps.user.data.avatar) {
this
.
getCanvas
()
//
this.getCanvas()
return
false
//
return false
}
//
}
return
true
//
return true
}
//
}
//
getCanvas
()
{
getCanvas
()
{
document
.
documentElement
.
scrollTop
=
0
document
.
documentElement
.
scrollTop
=
0
...
@@ -89,14 +89,14 @@ class scoreReport extends Component {
...
@@ -89,14 +89,14 @@ class scoreReport extends Component {
}
}
handleFetchInfo
=
(
index
)
=>
{
handleFetchInfo
=
(
index
)
=>
{
http
.
get
(
`
${
API
.
home
}
/sys/at/user_score/
${
index
}
`
).
then
(
res
=>
{
http
.
get
(
`
${
API
.
home
}
/sys/at/user_score/
${
index
}
/
${
getParam
(
'uid'
)
?
getParam
(
'uid'
)
:
0
}
`
).
then
(
res
=>
{
const
{
code
,
data
}
=
res
.
data
const
{
code
,
data
}
=
res
.
data
if
(
code
===
200
)
{
if
(
code
===
200
)
{
this
.
setState
({
this
.
setState
({
myRankList
:
data
,
myRankList
:
data
,
})
})
let
avatar
=
this
.
props
.
user
&&
this
.
props
.
user
.
data
.
avatar
let
avatar
=
data
.
avatar_file
this
.
getBase64
(
avatar
)
this
.
getBase64
(
avatar
)
setTimeout
(()
=>
{
setTimeout
(()
=>
{
this
.
getCanvas
()
this
.
getCanvas
()
...
@@ -212,7 +212,7 @@ class scoreReport extends Component {
...
@@ -212,7 +212,7 @@ class scoreReport extends Component {
<
div
className
=
"comment text-overflow-4"
>
<
div
className
=
"comment text-overflow-4"
>
<
img
className
=
{
'avatar_file'
}
src
=
{
avatar_file
}
alt
=
""
/>
<
img
className
=
{
'avatar_file'
}
src
=
{
avatar_file
}
alt
=
""
/>
{
myRankList
&&
myRankList
.
title
&&
myRankList
.
title
.
comment
}
<
span
dangerouslySetInnerHTML
=
{{
__html
:
myRankList
.
title
}}
><
/span
>
<
/div
>
<
/div
>
<
div
className
=
"code"
>
<
div
className
=
"code"
>
...
...
src/components/ai-test/report/index.scss
View file @
da5d5051
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
width
:
100%
;
width
:
100%
;
background-color
:
#09f
;
background-color
:
#09f
;
}
}
.score-report
{
.score-report
{
width
:
100%
;
width
:
100%
;
padding
:
30px
12px
45px
12px
;
padding
:
30px
12px
45px
12px
;
...
@@ -115,6 +116,10 @@
...
@@ -115,6 +116,10 @@
font-size
:
14px
;
font-size
:
14px
;
line-height
:
21px
;
line-height
:
21px
;
margin
:
15px
33px
0
;
margin
:
15px
33px
0
;
em
{
text-decoration
:
line-through
;
}
}
}
.code
{
.code
{
...
...
src/components/ai-test/scores/index.js
View file @
da5d5051
...
@@ -98,7 +98,7 @@ class Scores extends Component {
...
@@ -98,7 +98,7 @@ class Scores extends Component {
}
}
getUserScores
=
(
type
)
=>
{
getUserScores
=
(
type
)
=>
{
http
.
get
(
`
${
API
.
home
}
/sys/at/user_score/
${
type
}
`
)
http
.
get
(
`
${
API
.
home
}
/sys/at/user_score/
${
type
}
/0
`
)
.
then
(
res
=>
{
.
then
(
res
=>
{
const
{
code
,
msg
,
data
}
=
res
.
data
const
{
code
,
msg
,
data
}
=
res
.
data
...
...
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