Commit beaf67be by zhanghaozhe

ai测试

parent 021ae48e
import React, {Component} from 'react' import React, { Component } from 'react'
import {Toast} from "antd-mobile" import { HeaderBar } from '@/common'
import {HeaderBar} from '@/common' import { http } from '@/utils'
import {browser, http, getParam, wxShare} 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,
}), }),
) )
class scoreReport extends Component { class scoreReport extends Component {
constructor(props) { constructor(props) {
...@@ -25,7 +23,7 @@ class scoreReport extends Component { ...@@ -25,7 +23,7 @@ class scoreReport extends Component {
myRankList: '', myRankList: '',
imgUrl: '', imgUrl: '',
codeSrc: '', codeSrc: '',
avatar_file: '' avatar_file: '',
} }
} }
...@@ -70,7 +68,7 @@ class scoreReport extends Component { ...@@ -70,7 +68,7 @@ class scoreReport extends Component {
return new Promise(resolve => { return new Promise(resolve => {
QRCode.toDataURL(qrCodeLink, {}, function (err, url) { QRCode.toDataURL(qrCodeLink, {}, function (err, url) {
_this.setState({ _this.setState({
codeSrc: url codeSrc: url,
}) })
}) })
resolve() resolve()
...@@ -82,15 +80,15 @@ class scoreReport extends Component { ...@@ -82,15 +80,15 @@ class scoreReport extends Component {
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 = this.props.user && this.props.user.data.avatar
this.getBase64(avatar) this.getBase64(avatar)
setTimeout(()=> { setTimeout(() => {
this.getCanvas() this.getCanvas()
},100) }, 100)
} }
}) })
} }
...@@ -117,7 +115,7 @@ class scoreReport extends Component { ...@@ -117,7 +115,7 @@ class scoreReport extends Component {
image.onload = () => { image.onload = () => {
base64 = this.getBase64Image(image) base64 = this.getBase64Image(image)
this.setState({ this.setState({
avatar_file: base64 avatar_file: base64,
}) })
} }
image.onerror = () => { image.onerror = () => {
...@@ -130,7 +128,7 @@ class scoreReport extends Component { ...@@ -130,7 +128,7 @@ class scoreReport extends Component {
change = (index) => { change = (index) => {
this.setState({ this.setState({
cutIndex: index cutIndex: index,
}) })
this.handleFetchInfo(index) this.handleFetchInfo(index)
} }
...@@ -157,7 +155,6 @@ class scoreReport extends Component { ...@@ -157,7 +155,6 @@ class scoreReport extends Component {
} }
</ul> </ul>
<div className="score-list-box"> <div className="score-list-box">
<div className={'score-list'} style={{backgroundImage: `url(${scoreReportBg})`}}> <div className={'score-list'} style={{backgroundImage: `url(${scoreReportBg})`}}>
...@@ -172,7 +169,7 @@ class scoreReport extends Component { ...@@ -172,7 +169,7 @@ class scoreReport extends Component {
<tr> <tr>
<td>分数</td> <td>分数</td>
<td>用时</td> <td>用时</td>
<td>最终排名</td> <td>{cutIndex === 0 && '最终'}排名</td>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
......
...@@ -189,7 +189,7 @@ class Scores extends Component { ...@@ -189,7 +189,7 @@ class Scores extends Component {
<tr> <tr>
<th>分数</th> <th>分数</th>
<th>用时</th> <th>用时</th>
<th>排名</th> <th>{index === 0 && '最终'}排名</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment