Commit 4bffadfb by FE

Merge branch '11-11' of gitlab.julyedu.com:baiguangyao/mr-julyedu into 11-11

parents 5019ac9a 77363ffc
import React, { Component } from 'react' import React, { Component } from 'react'
import {connect} from "react-redux"; import {connect} from "react-redux";
import { http, getParam } from '@/utils'; import { http, getParam } from '@/utils';
import cookie from 'js-cookie'
import './index.scss'; import './index.scss';
import {Toast} from "antd-mobile"; import {Toast} from "antd-mobile";
import jsCookie from 'js-cookie'; import jsCookie from 'js-cookie';
...@@ -8,11 +9,19 @@ import jsCookie from 'js-cookie'; ...@@ -8,11 +9,19 @@ import jsCookie from 'js-cookie';
class Activity extends Component { class Activity extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.state = {
'butText': '立即领取'
}
} }
componentWillMount() { componentWillMount() {
jsCookie.set('blessing_invite_uid', getParam('shareuid'), {domain: '.julyedu.com', expires: 30}); jsCookie.set('blessing_invite_uid', getParam('shareuid'), {domain: '.julyedu.com', expires: 30});
jsCookie.set('blessing_invite_code', getParam('inviteCode'), {domain: '.julyedu.com', expires: 30}); jsCookie.set('blessing_invite_code', getParam('inviteCode'), {domain: '.julyedu.com', expires: 30});
if(cookie.get('uid')) {
this.setState(()=>({
butText: '已领取'
}));
}
} }
getGift = () => { getGift = () => {
...@@ -20,15 +29,17 @@ class Activity extends Component { ...@@ -20,15 +29,17 @@ class Activity extends Component {
this.props.history.push('/passport'); this.props.history.push('/passport');
} else { } else {
Toast.info('领取成功,你可前往七月在线官网/APP进行查看', 2); Toast.info('领取成功,你可前往七月在线官网/APP进行查看', 2);
localStorage.setItem('lingqu', 1);
} }
} }
render() { render() {
const {butText} = this.state;
return ( return (
<div className="activity__con"> <div className="activity__con">
<div className='banner__con'></div> <div className='banner__con'></div>
<div className='content__con'> <div className='content__con'>
<div className="button__get" onClick={this.getGift}>立即领取</div> <div className="button__get" onClick={this.getGift}>{butText}</div>
</div> </div>
</div> </div>
) )
......
...@@ -201,8 +201,8 @@ class Invite extends Component { ...@@ -201,8 +201,8 @@ class Invite extends Component {
return ( return (
<div className="user__item-info item__con-only" key={index}> <div className="user__item-info item__con-only" key={index}>
<div className="item__con"> <div className="item__con">
<img className="user_avatar" src={item.avatar} /> <img className="user_avatar" src={item.head_image} />
<div className="user_name">{item.name}</div> <div className="user_name">{item.user_name}</div>
</div> </div>
</div> </div>
) )
......
...@@ -180,7 +180,11 @@ class CollectBlessing extends Component { ...@@ -180,7 +180,11 @@ class CollectBlessing extends Component {
history.push('/passport') history.push('/passport')
} }
}else { }else {
history.push('/invite') if(getParam('version')) {
history.push('/invite?version=' + getParam('version'))
} else {
history.push('/invite')
}
} }
} }
......
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