Commit af76a1e0 by FE

bug moidfy

parent 68582250
import React, { Component } from 'react'; import React, { Component } from 'react';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import { Link } from 'react-router-dom'; import { Link } from 'react-router-dom';
import { http, getParam } from '@/utils'; import { http, getParam, SendMessageToApp } from '@/utils';
import { Toast } from "antd-mobile"; import { Toast } from "antd-mobile";
import ListFrame from './../listFrame/index'; import ListFrame from './../listFrame/index';
import ListHeader from './../listHeader'; import ListHeader from './../listHeader';
...@@ -47,7 +47,7 @@ class CollectBlessing extends Component { ...@@ -47,7 +47,7 @@ class CollectBlessing extends Component {
{id: 1, text: '1.每天三次抽奖机会;'}, {id: 1, text: '1.每天三次抽奖机会;'},
{id: 2, text: '2.中奖概率翻4倍', des: '(热力值越高,中奖概率越大);'}, {id: 2, text: '2.中奖概率翻4倍', des: '(热力值越高,中奖概率越大);'},
{id: 3, text: '3.满111减51、满1111减411;'}, {id: 3, text: '3.满111减51、满1111减411;'},
{id: 4, text: '4.AI水平测试增加1次。'}, {id: 4, text: '4.AI水平测试增加2次。'},
] ]
} }
], ],
...@@ -57,25 +57,53 @@ class CollectBlessing extends Component { ...@@ -57,25 +57,53 @@ class CollectBlessing extends Component {
qqToShare = () => { qqToShare = () => {
const { uid, history } = this.props; const { uid, history } = this.props;
if(!uid) { if(getParam('version')) {
history.push('/passport'); if(!uid) {
SendMessageToApp("toLogin");
}else {
let data = {
title: 'AI充电节,积福气享1折秒课,超10万元奖品来就送!!',
desc: '把这门超5万人报名的【Python基础入门 升级版】课程送给你,附200元红包,请笑纳!--七月在线',
link: 'https://m.julyedu.com/blessingPreheat',
imgUrl: 'https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/active19_1111/m/index-share-img.png',
};
SendMessageToApp("QQshare", data);
}
}else { }else {
history.push('/blessingPreheat?utm_source=qq&utm_medium=11&utm_campaign=QQ11&utm_content=11&utm_term=11') if(!uid) {
this.fetchUserBlessing(3, () => { history.push('/passport');
this.handleToAddBlessing(3); }else {
}); history.push('/blessingPreheat?utm_source=qq&utm_medium=11&utm_campaign=QQ11&utm_content=11&utm_term=11')
this.fetchUserBlessing(3, () => {
this.handleToAddBlessing(3);
});
}
} }
} }
wechatToShare = () => { wechatToShare = () => {
const { uid, history } = this.props; const { uid, history } = this.props;
if(!uid) { if(getParam('version')) {
history.push('/passport'); if(!uid) {
SendMessageToApp("toLogin");
}else {
let data = {
title: 'AI充电节,积福气享1折秒课,超10万元奖品来就送!!',
desc: '把这门超5万人报名的【Python基础入门 升级版】课程送给你,附200元红包,请笑纳!--七月在线',
link: 'https://m.julyedu.com/blessingPreheat',
imgUrl: 'https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/active19_1111/m/index-share-img.png',
};
SendMessageToApp("WXshare", data);
}
}else { }else {
history.push('/blessingPreheat?utm_source=1&utm_medium=1&utm_campaign=11&utm_content=1&utm_term=1'); if(!uid) {
this.fetchUserBlessing(1, () => { history.push('/passport');
this.handleToAddBlessing(1); }else {
}); history.push('/blessingPreheat?utm_source=1&utm_medium=1&utm_campaign=11&utm_content=1&utm_term=1');
this.fetchUserBlessing(1, () => {
this.handleToAddBlessing(1);
});
}
} }
} }
...@@ -135,7 +163,7 @@ class CollectBlessing extends Component { ...@@ -135,7 +163,7 @@ class CollectBlessing extends Component {
render() { render() {
const { const {
isSign, isSign,
userInfo: { isLogin = false, blessingVal = 0 }, userInfo: { isLogin = false, blessingVal = 0, buyBlessing = 0, inviteBlessing = 0 },
handleToShowNotice, handleToShowNotice,
handleToShowList, handleToShowList,
handleToShowInvite, handleToShowInvite,
...@@ -240,14 +268,18 @@ class CollectBlessing extends Component { ...@@ -240,14 +268,18 @@ class CollectBlessing extends Component {
{ {
index === 4 && index === 4 &&
<a className="collect-blessing__content" onClick={handleToShowInvite}> <a className="collect-blessing__content" onClick={handleToShowInvite}>
邀请<br/>链接 <span>邀请链接</span>
<i>已加{inviteBlessing}</i>
</a> </a>
} }
{ {
index === 5 && index === 5 &&
<a <a
className="collect-blessing__content" className="collect-blessing__content"
onClick={toSection}>去选课</a> onClick={toSection}>
<span>去选课</span>
<i>已加{buyBlessing}</i>
</a>
} }
</div> </div>
)) ))
......
...@@ -42,6 +42,7 @@ ...@@ -42,6 +42,7 @@
.collect-blessing__content { .collect-blessing__content {
display: inline-flex; display: inline-flex;
flex-direction: column;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
width: 64px; width: 64px;
...@@ -52,6 +53,11 @@ ...@@ -52,6 +53,11 @@
text-align: center; text-align: center;
background: linear-gradient(-40deg,rgba(255,75,240,1) 0%,rgba(162,0,255,1) 100%); background: linear-gradient(-40deg,rgba(255,75,240,1) 0%,rgba(162,0,255,1) 100%);
i {
font-style: normal;
font-size: 12px;
}
&[data-layout="column"] { &[data-layout="column"] {
flex-direction: column; flex-direction: column;
} }
......
...@@ -152,6 +152,8 @@ class BlessingPreheat extends Component { ...@@ -152,6 +152,8 @@ class BlessingPreheat extends Component {
userInfo: Object.assign({}, userInfo, { userInfo: Object.assign({}, userInfo, {
isLogin: !!data.is_login, isLogin: !!data.is_login,
blessingVal: data.user_blessing_value, blessingVal: data.user_blessing_value,
buyBlessing: (data.types_total_blessing_value &&data.types_total_blessing_value.buy_course)? data.types_total_blessing_value.buy_course : 0,
inviteBlessing: (data.types_total_blessing_value &&data.types_total_blessing_value.invite)? data.types_total_blessing_value.invite : 0,
}) })
}) })
if (data.is_login === 1) { if (data.is_login === 1) {
......
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