Commit c39b1536 by FE

solve copy and close action repeate question

parent 5cb6f0cf
...@@ -59,6 +59,8 @@ class RedPacket extends PureComponent { ...@@ -59,6 +59,8 @@ class RedPacket extends PureComponent {
const { userInfo } = this.props; const { userInfo } = this.props;
if(isWechat === '1' && !browser.isWeixin) { if(isWechat === '1' && !browser.isWeixin) {
if(userInfo && userInfo.uid) { if(userInfo && userInfo.uid) {
const type = window.localStorage.getItem('redpacket-click');
if(type === 'split') {
http.get(`${API.home}/sys/redPacket/shareUrl/${getParam('id')}`).then(res => { http.get(`${API.home}/sys/redPacket/shareUrl/${getParam('id')}`).then(res => {
const { code, data } = res.data; const { code, data } = res.data;
if(code === 200) { if(code === 200) {
...@@ -73,7 +75,7 @@ class RedPacket extends PureComponent { ...@@ -73,7 +75,7 @@ class RedPacket extends PureComponent {
).then(res => { ).then(res => {
const { code, data } = res.data; const { code, data } = res.data;
if(code === 200) { if(code === 200) {
window.localStorage.removeItem('redpacket-click');
// is_receive 是否领取过 0-否 1-是 // is_receive 是否领取过 0-否 1-是
if(data.is_receive) { if(data.is_receive) {
this.judgeReceiveStatus(data, 8); this.judgeReceiveStatus(data, 8);
...@@ -90,6 +92,12 @@ class RedPacket extends PureComponent { ...@@ -90,6 +92,12 @@ class RedPacket extends PureComponent {
this.setState({ this.setState({
type: 1 type: 1
}); });
window.localStorage.removeItem('redpacket-click');
}
}else {
this.setState({
type: 1
});
} }
} }
...@@ -638,6 +646,7 @@ class RedPacket extends PureComponent { ...@@ -638,6 +646,7 @@ class RedPacket extends PureComponent {
<button <button
className="popup-password__button--copy" className="popup-password__button--copy"
onClick={() => { onClick={() => {
window.localStorage.setItem('redpacket-click', 'copy');
history.push('/passport/login'); history.push('/passport/login');
}} }}
>复制口令</button> >复制口令</button>
...@@ -661,6 +670,7 @@ class RedPacket extends PureComponent { ...@@ -661,6 +670,7 @@ class RedPacket extends PureComponent {
this.setState({ this.setState({
type: 3 type: 3
}); });
window.localStorage.setItem('redpacket-click', 'split');
} }
}else { }else {
this.handleToClose(true); this.handleToClose(true);
......
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