Commit 38fd6e29 by FE

pull and solve

parents 96c62e90 1213ac7e
...@@ -45,6 +45,10 @@ function ClosablePopup({ ...@@ -45,6 +45,10 @@ function ClosablePopup({
ReactDOM.render(closablePopup, div) ReactDOM.render(closablePopup, div)
return {
close: _close
}
} }
export default ClosablePopup export default ClosablePopup
...@@ -245,7 +245,6 @@ class CourseList extends Component { ...@@ -245,7 +245,6 @@ class CourseList extends Component {
toReceiveCoupon(id, key = '') { toReceiveCoupon(id, key = '') {
const {isLogin, toLogin} = this.props; const {isLogin, toLogin} = this.props;
alert(cookie.get("uid"))
if(isLogin) { if(isLogin) {
http.post(`${API.home}/sys/activity/coupon/receive`, { http.post(`${API.home}/sys/activity/coupon/receive`, {
......
...@@ -112,16 +112,23 @@ class BlessingPreheat extends Component { ...@@ -112,16 +112,23 @@ class BlessingPreheat extends Component {
const {code} = res.data const {code} = res.data
if (code === 200) { if (code === 200) {
Toast.info('+2点福气值~', 2, null, false) Toast.info('+2点福气值~', 2, null, false)
this.fetchUserBlessing()
} }
}) })
this.fetchUserBlessing()
} }
window['QQWXWBshare'] = result => { window['QQWXWBshare'] = result => {
if (result != 0) { // this.handleToAddBlessing(result)
this.handleToAddBlessing(result) http.post(`${API.home}/sys/add/blessing`, {
} share_platform: result, // 1 朋友圈 2 微博 3 qq
type: 3 // 1:签到;3:分享;4:浏览课程;
}).then(res => {
const {code} = res.data
if (code === 200) {
Toast.info('+2点福气值~', 2, null, false)
this.fetchUserBlessing() this.fetchUserBlessing()
} }
})
}
} }
...@@ -142,7 +149,6 @@ class BlessingPreheat extends Component { ...@@ -142,7 +149,6 @@ class BlessingPreheat extends Component {
appLogin = () => { appLogin = () => {
let expires = addDays(new Date(), 90) let expires = addDays(new Date(), 90)
this.state.userInfoList.map((item, index) => { this.state.userInfoList.map((item, index) => {
Toast.info(item.uid)
cookie.set("token", item.token, {expires, path: '/', domain: '.julyedu.com'}) cookie.set("token", item.token, {expires, path: '/', domain: '.julyedu.com'})
cookie.set("plat", item.plat, {expires, path: '/', domain: '.julyedu.com'}) cookie.set("plat", item.plat, {expires, path: '/', domain: '.julyedu.com'})
cookie.set("uid", item.uid, {expires, path: '/', domain: '.julyedu.com'}) cookie.set("uid", item.uid, {expires, path: '/', domain: '.julyedu.com'})
...@@ -194,7 +200,7 @@ class BlessingPreheat extends Component { ...@@ -194,7 +200,7 @@ class BlessingPreheat extends Component {
} }
} }
} }
fetchMoudleId = (str) => { fetchMoudleId = (str) => {
const {navs} = this.state const {navs} = this.state
...@@ -246,7 +252,6 @@ class BlessingPreheat extends Component { ...@@ -246,7 +252,6 @@ class BlessingPreheat extends Component {
inviteBlessing: (data.types_total_blessing_value && data.types_total_blessing_value.invite) ? data.types_total_blessing_value.invite : 0, inviteBlessing: (data.types_total_blessing_value && data.types_total_blessing_value.invite) ? data.types_total_blessing_value.invite : 0,
}) })
}) })
alert(cookie.get('uid'))
if (data.is_login === 1) { if (data.is_login === 1) {
this.handleToSign() this.handleToSign()
} }
...@@ -270,6 +275,7 @@ class BlessingPreheat extends Component { ...@@ -270,6 +275,7 @@ class BlessingPreheat extends Component {
handleToSign = () => { handleToSign = () => {
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 => {
...@@ -277,7 +283,11 @@ class BlessingPreheat extends Component { ...@@ -277,7 +283,11 @@ class BlessingPreheat extends Component {
if (code === 200) { if (code === 200) {
this.setState({ this.setState({
isSign: true, isSign: true,
userInfo: Object.assign({}, userInfo, {
blessingVal: userInfo.blessingVal + 5
}) })
});
Toast.info('+5点福气值~', 2, null, false) Toast.info('+5点福气值~', 2, null, false)
} }
}) })
......
...@@ -131,7 +131,7 @@ class Live extends Component { ...@@ -131,7 +131,7 @@ class Live extends Component {
<div key={index}> <div key={index}>
{ {
preheatLives.map((item, index) => { preheatLives.map((item, index) => {
return <LiveContent key={index} item={item} makeSubscribe={this.makeSubscribe}/> return <LiveContent key={index} item={item} makeSubscribe={this.makeSubscribe} toLiveRoom={this.toLiveRoom}/>
}) })
} }
</div> </div>
...@@ -147,7 +147,7 @@ class Live extends Component { ...@@ -147,7 +147,7 @@ class Live extends Component {
} }
} }
function LiveContent({item, makeSubscribe}) { function LiveContent({item, makeSubscribe, toLiveRoom}) {
return ( return (
<div className="content"> <div className="content">
{ {
...@@ -181,7 +181,7 @@ function LiveContent({item, makeSubscribe}) { ...@@ -181,7 +181,7 @@ function LiveContent({item, makeSubscribe}) {
</div> </div>
{ {
item['on_live'] item['on_live']
? <button className={'on-living'} onClick={this.toLiveRoom.bind(this, item['live_id'])}>正在直播</button> ? <button className={'on-living'} onClick={() => {toLiveRoom(item['live_id'])}}>正在直播</button>
: :
item['is_end'] item['is_end']
? <button className={'subscribed'}>已结束</button> ? <button className={'subscribed'}>已结束</button>
......
...@@ -11,6 +11,7 @@ import './index.scss' ...@@ -11,6 +11,7 @@ import './index.scss'
} }
)) ))
class BlessingRank extends Component { class BlessingRank extends Component {
popupInstance = null
constructor(props) { constructor(props) {
super(props) super(props)
this.state = { this.state = {
...@@ -44,10 +45,15 @@ class BlessingRank extends Component { ...@@ -44,10 +45,15 @@ class BlessingRank extends Component {
if (bool && !uid) { if (bool && !uid) {
history.push('/passport') history.push('/passport')
} else { } else {
Popup({ if (bool && !this.popupInstance) {
this.popupInstance = Popup({
title: '收货信息', title: '收货信息',
content: <AddressPopup handleToHide={() => this.handleToSwitch(false)}/> content: <AddressPopup handleToHide={() => this.handleToSwitch(false)}/>
}) })
} else {
this.popupInstance.close()
this.popupInstance = null
}
} }
} }
......
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