Commit 9d280df3 by wangshuo

邀请好友新接口添加

parent 18407a8f
......@@ -11,7 +11,8 @@ class Activity extends Component {
}
componentWillMount() {
jsCookie.set('blessing_invite_code', getParam('shareuid'));
jsCookie.set('blessing_invite_uid', getParam('shareuid'));
jsCookie.set('blessing_invite_code', getParam('code'));
}
getGift = () => {
......
......@@ -24,7 +24,7 @@ class Invite extends Component {
} else {
if(getParam('new')) {
this.props.history.push(`/activity?shareuid=${shareuid}`);
this.props.history.push(`/activity?shareuid=${shareuid}&code=${inviteCode}`);
}
}
}
......@@ -74,12 +74,16 @@ class Invite extends Component {
if(this.props.user.hasError) {
this.props.history.push('/passport');
} else {
http.get(`${API.home}/sys/user/invite/link`).then(res => {
let {code, data, msg} = res;
if(code === 200) {
let inviteCode = data.blessing_invite_code;
if(is_weixin()) {
// TODO 这里需要运营确定文案
wxShare({
title: "哈哈哈哈哈哈哈",
desc: "你的老相好在七月在线学习呢你来不来",
link: encodeURI(location.origin + `/invite?shareuid=${shareuid}new=1`),
link: encodeURI(location.origin + `/invite?shareuid=${jsCookie.get('uid')}&new=1&code=${inviteCode}`),
imgUrl: 'https://julyedu-img-public.oss-cn-beijing.aliyuncs.com/Public/Image/20a86c1353.jpg'
});
this.setState({
......@@ -87,11 +91,15 @@ class Invite extends Component {
isWeiXin: true,
});
}else{
history.replaceState(null,null,`invite?shareuid=${jsCookie.get('uid')}&new=1`)
history.replaceState(null,null,`invite?shareuid=${jsCookie.get('uid')}&new=1&code=${inviteCode}`)
this.setState({
showTip: true,
});
}
}else{
Toast.info(msg, 2);
}
});
}
}
......
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