Commit c0553215 by zhanghaozhe

中奖纪录

parent 4066361e
...@@ -97,7 +97,7 @@ class BlessingPreheat extends Component { ...@@ -97,7 +97,7 @@ class BlessingPreheat extends Component {
} }
componentDidMount() { componentDidMount() {
document.title = `11.11-11.13 AI充电节,预热来袭!积福气享1折秒课,海量奖品来就送-七月在线`; document.title = `11.11-11.13 AI充电节,预热来袭!积福气享1折秒课,海量奖品来就送-七月在线`
this.fetchUserBlessing() this.fetchUserBlessing()
this.setInitialNavActiveStatus() this.setInitialNavActiveStatus()
window.addEventListener('scroll', throttle(this.calcNavActive, 100)) window.addEventListener('scroll', throttle(this.calcNavActive, 100))
...@@ -277,7 +277,7 @@ class BlessingPreheat extends Component { ...@@ -277,7 +277,7 @@ class BlessingPreheat extends Component {
handleToSign = () => { handleToSign = () => {
const { userInfo } = this.state; const {userInfo} = this.state
http.post(`${API.home}/sys/add/blessing`, { http.post(`${API.home}/sys/add/blessing`, {
type: 1 // 1:签到;3:分享;4:浏览课程; type: 1 // 1:签到;3:分享;4:浏览课程;
}).then(res => { }).then(res => {
...@@ -310,15 +310,15 @@ class BlessingPreheat extends Component { ...@@ -310,15 +310,15 @@ class BlessingPreheat extends Component {
if (isLogin && !isLoginnew) { if (isLogin && !isLoginnew) {
this.toLogin() this.toLogin()
} else { } else {
if(key === 'shareMark') { if (key === 'shareMark') {
this.setState({ this.setState({
isClose: false isClose: false
}); })
setTimeout(() => { setTimeout(() => {
this.setState({ this.setState({
isClose: true isClose: true
}); })
}, 5000); }, 5000)
} }
let obj = {} let obj = {}
obj[key] = true obj[key] = true
...@@ -330,7 +330,7 @@ class BlessingPreheat extends Component { ...@@ -330,7 +330,7 @@ class BlessingPreheat extends Component {
handleToShowNotice = () => { handleToShowNotice = () => {
http.get(`${API['base-api']}/sys/activity/create_blessing_qrcode`).then(res => { http.get(`${API['base-api']}/sys/activity/create_blessing_qrcode`).then(res => {
const {errno, data, msg} = res.data; const {errno, data, msg} = res.data
if (errno === 200) { if (errno === 200) {
QRCode.toDataURL(data.url, { QRCode.toDataURL(data.url, {
width: 120, width: 120,
...@@ -436,14 +436,17 @@ class BlessingPreheat extends Component { ...@@ -436,14 +436,17 @@ class BlessingPreheat extends Component {
</div> </div>
<ul> <ul>
{ {
data.map((item, index) => { Array.isArray(data)
return ( ? data.map((item, index) => {
<li key={index}> return (
<div className="time">{item.time}</div> <li key={index}>
<div className="name" onClick={this.showAddressPopup.bind(this, item['is_virtual'],item.prize)}>{item.prize}</div> <div className="time">{item.time}</div>
</li> <div className="name"
) onClick={this.showAddressPopup.bind(this, item['is_virtual'], item.prize)}>{item.prize}</div>
}) </li>
)
})
: <li style={{justifyContent: 'center'}}>暂无中奖纪录</li>
} }
</ul> </ul>
</div> </div>
...@@ -486,7 +489,7 @@ class BlessingPreheat extends Component { ...@@ -486,7 +489,7 @@ class BlessingPreheat extends Component {
} }
showAddressPopup = (isVirtual, prize) => { showAddressPopup = (isVirtual, prize) => {
if(isVirtual){ if (isVirtual) {
Toast.info(`恭喜你抽中${prize},奖品已存放到你的账户`, 2, null, false) Toast.info(`恭喜你抽中${prize},奖品已存放到你的账户`, 2, null, false)
return return
} }
...@@ -612,7 +615,7 @@ class BlessingPreheat extends Component { ...@@ -612,7 +615,7 @@ class BlessingPreheat extends Component {
} }
{ {
showRecordList && showRecordList &&
<RecordPopup <RecordPopup
history={this.props.history} history={this.props.history}
handleToHide={() => this.handleToHide('showRecordList')} handleToHide={() => this.handleToHide('showRecordList')}
/> />
......
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