Commit 9d280df3 by wangshuo

邀请好友新接口添加

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