Commit da5d5051 by xuzhenghua
parents ec48b3cc e0236b44
import React, { Component } from 'react'
import { HeaderBar } from '@/common'
import { http } from '@/utils'
import { getParam, http } from '@/utils'
import './index.scss'
import QRCode from 'qrcode'
import html2canvas from 'html2canvas'
......@@ -37,14 +37,14 @@ class scoreReport extends Component {
}
shouldComponentUpdate(nextProps, nextState, nextContext) {
if (this.props.user.data.avatar !== nextProps.user.data.avatar) {
this.getCanvas()
return false
}
return true
}
// shouldComponentUpdate(nextProps, nextState, nextContext) {
// if (this.props.user.data.avatar !== nextProps.user.data.avatar) {
// this.getCanvas()
// return false
// }
// return true
// }
//
getCanvas() {
document.documentElement.scrollTop = 0
......@@ -89,14 +89,14 @@ class scoreReport extends Component {
}
handleFetchInfo = (index) => {
http.get(`${API.home}/sys/at/user_score/${index}`).then(res => {
http.get(`${API.home}/sys/at/user_score/${index}/${getParam('uid') ? getParam('uid') : 0}`).then(res => {
const {code, data} = res.data
if (code === 200) {
this.setState({
myRankList: data,
})
let avatar = this.props.user && this.props.user.data.avatar
let avatar = data.avatar_file
this.getBase64(avatar)
setTimeout(() => {
this.getCanvas()
......@@ -212,7 +212,7 @@ class scoreReport extends Component {
<div className="comment text-overflow-4">
<img className={'avatar_file'} src={avatar_file} alt=""/>
{myRankList && myRankList.title && myRankList.title.comment}
<span dangerouslySetInnerHTML={{__html: myRankList.title}}></span>
</div>
<div className="code">
......
......@@ -2,6 +2,7 @@
width: 100%;
background-color: #09f;
}
.score-report {
width: 100%;
padding: 30px 12px 45px 12px;
......@@ -115,6 +116,10 @@
font-size: 14px;
line-height: 21px;
margin: 15px 33px 0;
em {
text-decoration: line-through;
}
}
.code {
......
......@@ -98,7 +98,7 @@ class Scores extends Component {
}
getUserScores = (type) => {
http.get(`${API.home}/sys/at/user_score/${type}`)
http.get(`${API.home}/sys/at/user_score/${type}/0`)
.then(res => {
const {code, msg, data} = res.data
......
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