Commit beaf67be by zhanghaozhe

ai测试

parent 021ae48e
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>
......
......@@ -189,7 +189,7 @@ class Scores extends Component {
<tr>
<th>分数</th>
<th>用时</th>
<th>排名</th>
<th>{index === 0 && '最终'}排名</th>
</tr>
</thead>
<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