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
50f7de97
Commit
50f7de97
authored
Jun 08, 2020
by
xuzhenghua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
头像
parent
08b54cab
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
9 deletions
+16
-9
src/components/ai-test/report/index.js
+16
-9
No files found.
src/components/ai-test/report/index.js
View file @
50f7de97
import
React
,
{
Component
}
from
'react'
import
{
HeaderBar
}
from
'@/common'
import
{
http
}
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
,
...
...
@@ -23,7 +23,7 @@ class scoreReport extends Component {
myRankList
:
''
,
imgUrl
:
''
,
codeSrc
:
''
,
avatar_file
:
''
,
avatar_file
:
''
}
}
...
...
@@ -38,6 +38,14 @@ class scoreReport extends Component {
this
.
handleFetchInfo
(
0
)
}
shouldComponentUpdate
(
nextProps
,
nextState
,
nextContext
)
{
if
(
this
.
props
.
user
.
data
.
avatar
!==
nextProps
.
user
.
data
.
avatar
)
{
this
.
getCanvas
()
return
false
}
return
true
}
getCanvas
()
{
let
_this
=
this
...
...
@@ -64,7 +72,7 @@ class scoreReport extends Component {
// 获取二维码
getCodeWe
()
{
let
_this
=
this
let
qrCodeLink
=
'/ai-test'
let
qrCodeLink
=
`
${
API
.
m
}
/ai-test`
return
new
Promise
(
resolve
=>
{
QRCode
.
toDataURL
(
qrCodeLink
,
{},
function
(
err
,
url
)
{
_this
.
setState
({
...
...
@@ -80,15 +88,14 @@ 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
(()
=>
{
this
.
getCanvas
()
},
100
)
},
100
)
}
})
}
...
...
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