Commit 229ec75a by xuzhenghua

联调

parents ee9acf4b a265b317
...@@ -119,3 +119,7 @@ ...@@ -119,3 +119,7 @@
} }
} }
.demo {
font-size: 30px;
color: red;
}
...@@ -35,6 +35,12 @@ class BlessingPreheat extends Component { ...@@ -35,6 +35,12 @@ class BlessingPreheat extends Component {
this.prevY = 0 this.prevY = 0
this.state = { this.state = {
userInfoList: [], userInfoList: [],
// userInfoList: [{
// token:'fcfef221e60ab7a2-92a80d5d30196999',
// uid:'545292',
// uname:'xzhtest2',
// avatar_file:''
// }],
isRule: false, isRule: false,
isCourse: false, isCourse: false,
inviteUrl: '', inviteUrl: '',
...@@ -100,6 +106,10 @@ class BlessingPreheat extends Component { ...@@ -100,6 +106,10 @@ class BlessingPreheat extends Component {
window['getNewData'] = result => { window['getNewData'] = result => {
this.fetchUserBlessing(); this.fetchUserBlessing();
} }
window['QQWXWBshare'] = result => {
this.handleToAddBlessing(result);
}
} }
...@@ -118,8 +128,7 @@ class BlessingPreheat extends Component { ...@@ -118,8 +128,7 @@ 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) => {
alert(this.props.user.hasError) Toast.info(item.uid)
Toast.info(String(this.props.user.hasError))
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'});
...@@ -148,6 +157,8 @@ class BlessingPreheat extends Component { ...@@ -148,6 +157,8 @@ class BlessingPreheat extends Component {
} }
getActiveIndex = (arr, n) => { getActiveIndex = (arr, n) => {
for (let i = 0, len = arr.length; i < len; i++) { for (let i = 0, len = arr.length; i < len; i++) {
if (arr[i] > n) { if (arr[i] > n) {
...@@ -216,6 +227,20 @@ class BlessingPreheat extends Component { ...@@ -216,6 +227,20 @@ class BlessingPreheat extends Component {
}) })
} }
handleToAddBlessing = (key) => {
http.post(`${API.home}/sys/add/blessing`, {
share_platform: key, // 1 朋友圈 2 微博 3 qq
type: 3 // 1:签到;3:分享;4:浏览课程;
}).then(res => {
const {code } = res.data;
if (code === 200) {
Toast.info('+2点福气值~', 2, null, false);
}
});
}
handleToSign = () => { handleToSign = () => {
http.post(`${API.home}/sys/add/blessing`, { http.post(`${API.home}/sys/add/blessing`, {
type: 1 // 1:签到;3:分享;4:浏览课程; type: 1 // 1:签到;3:分享;4:浏览课程;
...@@ -405,6 +430,10 @@ class BlessingPreheat extends Component { ...@@ -405,6 +430,10 @@ class BlessingPreheat extends Component {
{/* 积福气 */} {/* 积福气 */}
<ListHeader id={'lucky-value'} text="积福气,享受更多福利" styles={{margin: '60px 0 15px'}}/> <ListHeader id={'lucky-value'} text="积福气,享受更多福利" styles={{margin: '60px 0 15px'}}/>
<Link className="luck-draw__button" to="/blessingRank">福气排行榜></Link> <Link className="luck-draw__button" to="/blessingRank">福气排行榜></Link>
<div className='demo'>{String(!this.props.user.hasError)}</div>
<CollectBlessing <CollectBlessing
isSign={isSign} isSign={isSign}
userInfo={userInfo} userInfo={userInfo}
......
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