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
beaf67be
Commit
beaf67be
authored
Jun 05, 2020
by
zhanghaozhe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ai测试
parent
021ae48e
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
17 deletions
+14
-17
src/components/ai-test/report/index.js
+13
-16
src/components/ai-test/scores/index.js
+1
-1
No files found.
src/components/ai-test/report/index.js
View file @
beaf67be
import
React
,
{
Component
}
from
'react'
import
{
Toast
}
from
"antd-mobile"
import
{
HeaderBar
}
from
'@/common'
import
{
browser
,
http
,
getParam
,
wxShare
}
from
'@/utils'
import
React
,
{
Component
}
from
'react'
import
{
HeaderBar
}
from
'@/common'
import
{
http
}
from
'@/utils'
import
'./index.scss'
import
QRCode
from
'qrcode'
import
html2canvas
from
'html2canvas'
import
scoreIconL
from
'@assets/image/score_icon-l.png'
import
scoreIconR
from
'@assets/image/score_icon-r.png'
import
scoreReportBg
from
'@assets/image/scoreReport_bg.png'
import
{
connect
}
from
"react-redux"
import
{
connect
}
from
"react-redux"
@
connect
(
state
=>
({
user
:
state
.
user
user
:
state
.
user
,
}),
)
class
scoreReport
extends
Component
{
constructor
(
props
)
{
...
...
@@ -25,7 +23,7 @@ class scoreReport extends Component {
myRankList
:
''
,
imgUrl
:
''
,
codeSrc
:
''
,
avatar_file
:
''
avatar_file
:
''
,
}
}
...
...
@@ -70,7 +68,7 @@ class scoreReport extends Component {
return
new
Promise
(
resolve
=>
{
QRCode
.
toDataURL
(
qrCodeLink
,
{},
function
(
err
,
url
)
{
_this
.
setState
({
codeSrc
:
url
codeSrc
:
url
,
})
})
resolve
()
...
...
@@ -82,15 +80,15 @@ class scoreReport extends Component {
const
{
code
,
data
}
=
res
.
data
if
(
code
===
200
)
{
this
.
setState
({
myRankList
:
data
myRankList
:
data
,
})
let
avatar
=
this
.
props
.
user
&&
this
.
props
.
user
.
data
.
avatar
this
.
getBase64
(
avatar
)
setTimeout
(()
=>
{
setTimeout
(()
=>
{
this
.
getCanvas
()
},
100
)
},
100
)
}
})
}
...
...
@@ -117,7 +115,7 @@ class scoreReport extends Component {
image
.
onload
=
()
=>
{
base64
=
this
.
getBase64Image
(
image
)
this
.
setState
({
avatar_file
:
base64
avatar_file
:
base64
,
})
}
image
.
onerror
=
()
=>
{
...
...
@@ -130,7 +128,7 @@ class scoreReport extends Component {
change
=
(
index
)
=>
{
this
.
setState
({
cutIndex
:
index
cutIndex
:
index
,
})
this
.
handleFetchInfo
(
index
)
}
...
...
@@ -157,7 +155,6 @@ class scoreReport extends Component {
}
<
/ul
>
<
div
className
=
"score-list-box"
>
<
div
className
=
{
'score-list'
}
style
=
{{
backgroundImage
:
`url(
${
scoreReportBg
}
)`
}}
>
...
...
@@ -172,7 +169,7 @@ class scoreReport extends Component {
<
tr
>
<
td
>
分数
<
/td
>
<
td
>
用时
<
/td
>
<
td
>
最终
排名
<
/td
>
<
td
>
{
cutIndex
===
0
&&
'最终'
}
排名
<
/td
>
<
/tr
>
<
/thead
>
<
tbody
>
...
...
src/components/ai-test/scores/index.js
View file @
beaf67be
...
...
@@ -189,7 +189,7 @@ class Scores extends Component {
<
tr
>
<
th
>
分数
<
/th
>
<
th
>
用时
<
/th
>
<
th
>
排名
<
/th
>
<
th
>
{
index
===
0
&&
'最终'
}
排名
<
/th
>
<
/tr
>
<
/thead
>
<
tbody
>
...
...
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