Commit a96e3c34 by FE

Merge branch 'new-share' into pre

parents c56415f9 5cb6f0cf
......@@ -56,10 +56,41 @@ class RedPacket extends PureComponent {
// 微信进入
const isWechat = getParam('wechat');
const { userInfo } = this.props;
if(isWechat === '1' && !browser.isWeixin) {
this.setState({
type: 1
});
if(userInfo && userInfo.uid) {
http.get(`${API.home}/sys/redPacket/shareUrl/${getParam('id')}`).then(res => {
const { code, data } = res.data;
if(code === 200) {
// 检查收否领取过
http.post(
`${API.home}/sys/redPacket/split`,
{
action: 'check',
share_code: data.share_code
}
).then(res => {
const { code, data } = res.data;
if(code === 200) {
// is_receive 是否领取过 0-否 1-是
if(data.is_receive) {
this.judgeReceiveStatus(data, 8);
}else {
this.setState({
type: 3
});
}
}
})
}
});
}else {
this.setState({
type: 1
});
}
}
this.fetchShareInfo();
......@@ -623,14 +654,17 @@ class RedPacket extends PureComponent {
className="popup-password__button--close iconfont iconiconfront-2"
onClick={() => {
if(getParam('wechat') === '1') {
this.handleToClose(false);
history.push(`/detail?id=${getParam('id')}`);
if(userInfo && userInfo.uid) {
this.handleToClose(true);
history.push(`/detail?id=${getParam('id')}`);
}else {
this.setState({
type: 3
});
}
}else {
this.handleToClose(true);
}
this.setState({
isCopy: false
});
}}
/>
</div>
......
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