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
3f69bcd8
Commit
3f69bcd8
authored
Jun 10, 2020
by
zhanghaozhe
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'ai-test'
parents
e55e8f9c
9d34350f
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
15 deletions
+37
-15
src/components/ai-test/report/index.js
+11
-12
src/components/ai-test/scores/index.js
+22
-3
src/components/ai-test/scores/index.scss
+4
-0
No files found.
src/components/ai-test/report/index.js
View file @
3f69bcd8
import
React
,
{
Component
}
from
'react'
import
React
,
{
Component
}
from
'react'
import
{
HeaderBar
}
from
'@/common'
import
{
HeaderBar
}
from
'@/common'
import
{
http
}
from
'@/utils'
import
{
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'
import
scoreIconL
from
'@assets/image/score_icon-l.png'
import
scoreIconL
from
'@assets/image/score_icon-l.png'
import
scoreIconR
from
'@assets/image/score_icon-r.png'
import
scoreIconR
from
'@assets/image/score_icon-r.png'
import
scoreReportBg
from
'@assets/image/scoreReport_bg.png'
import
scoreReportBg
from
'@assets/image/scoreReport_bg.png'
import
{
connect
}
from
"react-redux"
import
{
connect
}
from
"react-redux"
@
connect
(
state
=>
({
@
connect
(
state
=>
({
user
:
state
.
user
,
user
:
state
.
user
,
...
@@ -23,7 +23,7 @@ class scoreReport extends Component {
...
@@ -23,7 +23,7 @@ class scoreReport extends Component {
myRankList
:
''
,
myRankList
:
''
,
imgUrl
:
''
,
imgUrl
:
''
,
codeSrc
:
''
,
codeSrc
:
''
,
avatar_file
:
''
avatar_file
:
''
,
}
}
}
}
...
@@ -92,14 +92,8 @@ class scoreReport extends Component {
...
@@ -92,14 +92,8 @@ class scoreReport extends Component {
http
.
get
(
`
${
API
.
home
}
/sys/at/user_score/
${
index
}
`
).
then
(
res
=>
{
http
.
get
(
`
${
API
.
home
}
/sys/at/user_score/
${
index
}
`
).
then
(
res
=>
{
const
{
code
,
data
}
=
res
.
data
const
{
code
,
data
}
=
res
.
data
if
(
code
===
200
)
{
if
(
code
===
200
)
{
const
{
user
,
history
}
=
this
.
props
if
(
user
.
hasError
)
{
history
.
push
(
'/passport'
)
return
}
this
.
setState
({
this
.
setState
({
myRankList
:
data
myRankList
:
data
,
})
})
let
avatar
=
this
.
props
.
user
&&
this
.
props
.
user
.
data
.
avatar
let
avatar
=
this
.
props
.
user
&&
this
.
props
.
user
.
data
.
avatar
...
@@ -107,6 +101,11 @@ class scoreReport extends Component {
...
@@ -107,6 +101,11 @@ class scoreReport extends Component {
setTimeout
(()
=>
{
setTimeout
(()
=>
{
this
.
getCanvas
()
this
.
getCanvas
()
},
500
)
},
500
)
}
else
if
(
code
===
4030
)
{
const
{
user
,
history
}
=
this
.
props
if
(
user
.
hasError
)
{
history
.
push
(
'/passport'
)
}
}
}
})
})
}
}
...
...
src/components/ai-test/scores/index.js
View file @
3f69bcd8
...
@@ -6,6 +6,7 @@ import storage from 'store2'
...
@@ -6,6 +6,7 @@ import storage from 'store2'
import
{
html
}
from
'@/utils'
import
{
html
}
from
'@/utils'
import
{
compareDesc
}
from
"date-fns"
;
import
{
compareDesc
}
from
"date-fns"
;
import
{
Link
}
from
"react-router-dom"
;
import
{
Link
}
from
"react-router-dom"
;
import
{
connect
}
from
"react-redux"
;
class
Scores
extends
Component
{
class
Scores
extends
Component
{
...
@@ -48,9 +49,11 @@ class Scores extends Component {
...
@@ -48,9 +49,11 @@ class Scores extends Component {
componentDidMount
()
{
componentDidMount
()
{
this
.
getInitialData
()
this
.
getInitialData
()
this
.
getRankList
(
null
,
0
)
this
.
getRankList
(
null
,
0
)
if
(
!
this
.
props
.
user
.
hasError
)
{
this
.
getUserScores
(
0
)
this
.
getUserScores
(
0
)
this
.
getUserAddress
()
this
.
getUserAddress
()
}
}
}
handleChange
=
(
e
)
=>
{
handleChange
=
(
e
)
=>
{
const
isNeverSHow
=
e
.
target
.
checked
const
isNeverSHow
=
e
.
target
.
checked
...
@@ -171,6 +174,7 @@ class Scores extends Component {
...
@@ -171,6 +174,7 @@ class Scores extends Component {
userAddress
,
userAddress
,
entryButtonInRule
,
entryButtonInRule
,
}
=
this
.
state
}
=
this
.
state
const
{
user
,
history
}
=
this
.
props
const
_rankList
=
Array
.
isArray
(
rankList
)
?
isExpandRankList
?
rankList
:
rankList
.
slice
(
0
,
10
)
:
[]
const
_rankList
=
Array
.
isArray
(
rankList
)
?
isExpandRankList
?
rankList
:
rankList
.
slice
(
0
,
10
)
:
[]
return
(
return
(
<
div
className
=
{
'scores'
}
>
<
div
className
=
{
'scores'
}
>
...
@@ -202,7 +206,14 @@ class Scores extends Component {
...
@@ -202,7 +206,14 @@ class Scores extends Component {
<
/tr
>
<
/tr
>
<
/thead
>
<
/thead
>
<
tbody
>
<
tbody
>
<
tr
>
{
user
.
hasError
?
<
tr
>
<
td
>--<
/td
>
<
td
>--<
/td
>
<
td
>--<
/td
>
<
/tr
>
:
<
tr
>
{
{
userScore
.
score
===
'-'
?
'-'
:
userScore
.
score
===
'-'
?
'-'
:
<
td
>
{
userScore
.
score
}
<
Link
to
=
{
`/ai-test/analysis/
${
userScore
.
r_id
}
`
}
>
解析
<
/Link></
td
>
<
td
>
{
userScore
.
score
}
<
Link
to
=
{
`/ai-test/analysis/
${
userScore
.
r_id
}
`
}
>
解析
<
/Link></
td
>
...
@@ -212,6 +223,7 @@ class Scores extends Component {
...
@@ -212,6 +223,7 @@ class Scores extends Component {
userScore
.
rank
===
'-'
?
'-'
:
<
td
>
{
userScore
.
rank
}
名
<
/td
>
userScore
.
rank
===
'-'
?
'-'
:
<
td
>
{
userScore
.
rank
}
名
<
/td
>
}
}
<
/tr
>
<
/tr
>
}
<
/tbody
>
<
/tbody
>
<
/table
>
<
/table
>
<
/div
>
<
/div
>
...
@@ -231,9 +243,13 @@ class Scores extends Component {
...
@@ -231,9 +243,13 @@ class Scores extends Component {
<
div
>
<
div
>
<
span
>
仅显示前
50
名
<
/span
>
<
span
>
仅显示前
50
名
<
/span
>
<
a
href
=
"javascript:void(0);"
onClick
=
{()
=>
{
<
a
href
=
"javascript:void(0);"
onClick
=
{()
=>
{
if
(
user
.
hasError
){
history
.
push
(
'/passport'
)
}
else
{
this
.
setState
({
this
.
setState
({
isShowUserAddress
:
true
,
isShowUserAddress
:
true
,
})
})
}
}}
>
收货地址
<
/a
>
}}
>
收货地址
<
/a
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
...
@@ -386,4 +402,7 @@ function Rule({neverShow, isNeverShow, rule, close, startTest, entryButtonInRule
...
@@ -386,4 +402,7 @@ function Rule({neverShow, isNeverShow, rule, close, startTest, entryButtonInRule
}
}
export
default
Scores
;
export
default
connect
(
\ No newline at end of file
({
user
})
=>
({
user
}),
null
,
)(
Scores
);
\ No newline at end of file
src/components/ai-test/scores/index.scss
View file @
3f69bcd8
...
@@ -50,6 +50,10 @@
...
@@ -50,6 +50,10 @@
background-color
:
$blue-bg
;
background-color
:
$blue-bg
;
}
}
th
{
width
:
33
.333333%
;
}
}
}
th
{
th
{
...
...
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