Commit 015bdece by xuzhenghua

登录

parents 4bd2d265 af76a1e0
import React, { Component } from 'react';
import { connect } from 'react-redux';
import { Link } from 'react-router-dom';
import { http } from '@/utils';
import { http, getParam, SendMessageToApp } from '@/utils';
import { Toast } from "antd-mobile";
import ListFrame from './../listFrame/index';
import ListHeader from './../listHeader';
......@@ -47,7 +47,7 @@ class CollectBlessing extends Component {
{id: 1, text: '1.每天三次抽奖机会;'},
{id: 2, text: '2.中奖概率翻4倍', des: '(热力值越高,中奖概率越大);'},
{id: 3, text: '3.满111减51、满1111减411;'},
{id: 4, text: '4.AI水平测试增加1次。'},
{id: 4, text: '4.AI水平测试增加2次。'},
]
}
],
......@@ -57,28 +57,68 @@ class CollectBlessing extends Component {
qqToShare = () => {
const { uid, history } = this.props;
if(!uid) {
history.push('/passport');
if(getParam('version')) {
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 {
history.push('/blessingPreheat?utm_source=1&utm_medium=1&utm_campaign=11&utm_content=1&utm_term=1');
this.fetchUserBlessing(3, () => {
this.handleToAddBlessing(3);
});
if(!uid) {
history.push('/passport');
}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 = () => {
const { uid, history } = this.props;
if(getParam('version')) {
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 {
if(!uid) {
history.push('/passport');
}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);
});
}
}
}
weiboToShare = () => {
const { uid, history } = this.props;
if(!uid) {
history.push('/passport');
}else {
history.push('/blessingPreheat?utm_source=q&utm_medium=11&utm_campaign=qq11&utm_content=11&utm_term=11');
this.fetchUserBlessing(1, () => {
this.handleToAddBlessing(1);
history.push('/blessingPreheat?utm_source=sina&utm_medium=11&utm_campaign=sina11&utm_content=1&utm_term=11');
this.fetchUserBlessing(2, () => {
this.handleToAddBlessing(2);
});
}
}
fetchUserBlessing(key, cb) {
const { handleToShowShare, handleToHideShare } = this.props;
let { seconds } = this.state;
......@@ -123,7 +163,7 @@ class CollectBlessing extends Component {
render() {
const {
isSign,
userInfo: { isLogin = false, blessingVal = 0 },
userInfo: { isLogin = false, blessingVal = 0, buyBlessing = 0, inviteBlessing = 0 },
handleToShowNotice,
handleToShowList,
handleToShowInvite,
......@@ -211,6 +251,11 @@ class CollectBlessing extends Component {
data-type="wechat"
onClick={this.wechatToShare}
></a>
<a
className="collect-blessing__share-button"
data-type="weibo"
onClick={this.weiboToShare}
></a>
</div>
</div>
}
......@@ -223,14 +268,18 @@ class CollectBlessing extends Component {
{
index === 4 &&
<a className="collect-blessing__content" onClick={handleToShowInvite}>
邀请<br/>链接
<span>邀请链接</span>
<i>已加{inviteBlessing}</i>
</a>
}
{
index === 5 &&
<a
className="collect-blessing__content"
onClick={toSection}>去选课</a>
onClick={toSection}>
<span>去选课</span>
<i>已加{buyBlessing}</i>
</a>
}
</div>
))
......
......@@ -42,6 +42,7 @@
.collect-blessing__content {
display: inline-flex;
flex-direction: column;
align-items: center;
justify-content: center;
width: 64px;
......@@ -52,6 +53,11 @@
text-align: center;
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"] {
flex-direction: column;
}
......@@ -72,10 +78,9 @@
}
.collect-blessing__share-button {
display: inline-block;
width: 14px;
display: block;
width: 20px;
height: 11px;
margin: 0 4px;
background-size: auto 100%;
background-repeat: no-repeat;
background-position: center;
......@@ -87,6 +92,10 @@
&[data-type="wechat"] {
background-image: url('https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/active19_1111/m/wechat-icon.png');
}
&[data-type="weibo"] {
background-image: url('https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/active19_1111/icon-weibo.png');
}
}
.activity__over {
......
......@@ -206,6 +206,8 @@ class BlessingPreheat extends Component {
userInfo: Object.assign({}, userInfo, {
isLogin: !!uid,
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) {
......
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