Commit 9110cf5b by FE

collect blessing modify

parent a7d05ce7
...@@ -131,7 +131,7 @@ class CollectBlessing extends Component { ...@@ -131,7 +131,7 @@ class CollectBlessing extends Component {
} }
fetchUserBlessing(key, cb) { fetchUserBlessing(key, cb) {
const { handleToShowShare, handleToHideShare } = this.props; const { handleToShowShare } = this.props;
let { seconds } = this.state; let { seconds } = this.state;
http.get(`${API.home}/sys/user/blessing`).then(res => { http.get(`${API.home}/sys/user/blessing`).then(res => {
const { code, data } = res.data; const { code, data } = res.data;
...@@ -149,7 +149,6 @@ class CollectBlessing extends Component { ...@@ -149,7 +149,6 @@ class CollectBlessing extends Component {
() => { () => {
if (seconds === 0) { if (seconds === 0) {
typeof cb === 'function' && cb(); typeof cb === 'function' && cb();
handleToHideShare();
clearInterval(this.shareTimer); clearInterval(this.shareTimer);
} }
} }
...@@ -192,7 +191,6 @@ class CollectBlessing extends Component { ...@@ -192,7 +191,6 @@ class CollectBlessing extends Component {
isLogin, isLogin,
handleToShowNotice, handleToShowNotice,
handleToShowList, handleToShowList,
handleToShow,
toLogin, toLogin,
toSection toSection
} = this.props; } = this.props;
...@@ -249,14 +247,14 @@ class CollectBlessing extends Component { ...@@ -249,14 +247,14 @@ class CollectBlessing extends Component {
{ {
(isLogin && isSign) (isLogin && isSign)
? ( ? (
<a className="collect-blessing__content" data-status="done"> <button className="collect-blessing__content" data-status="done">
+5<br/>福气值 +5<br/>福气值
</a> </button>
) )
: ( : (
<span onClick={toLogin} className="collect-blessing__content"> <button onClick={toLogin} className="collect-blessing__content">
点击<br/>签到 点击<br/>签到
</span> </button>
) )
} }
</> </>
...@@ -267,67 +265,64 @@ class CollectBlessing extends Component { ...@@ -267,67 +265,64 @@ class CollectBlessing extends Component {
{ {
isFollow === 1 isFollow === 1
? ( ? (
<a className="collect-blessing__content" data-status="done" onClick={handleToShowNotice}> <button className="collect-blessing__content" data-status="done" onClick={handleToShowNotice}>
已加30 已加30
</a> </button>
) )
: ( : (
<a className="collect-blessing__content" onClick={handleToShowNotice}> <button className="collect-blessing__content" onClick={handleToShowNotice}>
关注<br/>二维码 关注<br/>二维码
</a> </button>
) )
} }
</> </>
} }
{ {
index === 2 && index === 2 &&
<div className="collect-blessing__content" data-layout="column"> <div className="collect-blessing__content" data-layout="column">
<p className="collect-blessing__label">去分享</p> <p className="collect-blessing__label">去分享</p>
<div className="collect-blessing__share"> <div className="collect-blessing__share">
<a <button
className="collect-blessing__share-button" className="collect-blessing__share-button"
data-type="qq" data-type="qq"
onClick={this.qqToShare} onClick={this.qqToShare}
></a> ></button>
<a <button
className="collect-blessing__share-button" className="collect-blessing__share-button"
data-type="wechat" data-type="wechat"
onClick={this.wechatToShare} onClick={this.wechatToShare}
></a> ></button>
<a <button
className="collect-blessing__share-button" className="collect-blessing__share-button"
data-type="weibo" data-type="weibo"
onClick={this.weiboToShare} onClick={this.weiboToShare}
></a> ></button>
</div> </div>
</div> </div>
} }
{ {
index === 3 && index === 3 &&
<a className="collect-blessing__content" onClick={handleToShowList}> <button className="collect-blessing__content" onClick={handleToShowList}>
浏览课程<br/>详情页 浏览课程<br/>详情页
</a> </button>
} }
{ {
index === 4 && index === 4 &&
<a className="collect-blessing__content" onClick={this.handleToInvite}> <button className="collect-blessing__content" onClick={this.handleToInvite}>
<span>邀请链接</span> <span>邀请链接</span>
{ {
inviteBlessing > 0 && <i>已加{inviteBlessing}</i> inviteBlessing > 0 && <i>已加{inviteBlessing}</i>
} }
</a> </button>
} }
{ {
index === 5 && index === 5 &&
<a <button className="collect-blessing__content" onClick={toSection}>
className="collect-blessing__content"
onClick={toSection}>
<span>去选课</span> <span>去选课</span>
{ {
buyBlessing > 0 && <i>已加{buyBlessing}</i> buyBlessing > 0 && <i>已加{buyBlessing}</i>
} }
</a> </button>
} }
</div> </div>
)) ))
......
...@@ -47,6 +47,7 @@ ...@@ -47,6 +47,7 @@
justify-content: center; justify-content: center;
width: 64px; width: 64px;
height: 100%; height: 100%;
border-style: none;
border-radius: 5px; border-radius: 5px;
font-size: 12px; font-size: 12px;
color: #fff; color: #fff;
...@@ -81,6 +82,8 @@ ...@@ -81,6 +82,8 @@
display: block; display: block;
width: 20px; width: 20px;
height: 11px; height: 11px;
border-style: none;
background-color: transparent;
background-size: auto 100%; background-size: auto 100%;
background-repeat: no-repeat; background-repeat: no-repeat;
background-position: center; background-position: center;
......
...@@ -16,7 +16,6 @@ import LevelTest from './levelTest/index' ...@@ -16,7 +16,6 @@ import LevelTest from './levelTest/index'
import RankList from './rankList/index' import RankList from './rankList/index'
import './index.scss' import './index.scss'
import { Popup } from '@/common' import { Popup } from '@/common'
import { CopyToClipboard } from 'react-copy-to-clipboard'
import { Toast } from "antd-mobile" import { Toast } from "antd-mobile"
import Live from './live' import Live from './live'
import Banner from './banner' import Banner from './banner'
...@@ -82,7 +81,8 @@ class BlessingPreheat extends Component { ...@@ -82,7 +81,8 @@ class BlessingPreheat extends Component {
], ],
index: 0, index: 0,
userHasError: props.user.hasError, userHasError: props.user.hasError,
isApp: false isApp: false,
isClose: false,
} }
} }
...@@ -298,6 +298,16 @@ class BlessingPreheat extends Component { ...@@ -298,6 +298,16 @@ class BlessingPreheat extends Component {
if (isLogin && !isLoginnew) { if (isLogin && !isLoginnew) {
this.toLogin() this.toLogin()
} else { } else {
if(key === 'shareMark') {
this.setState({
isClose: false
});
setTimeout(() => {
this.setState({
isClose: true
});
}, 5000);
}
let obj = {} let obj = {}
obj[key] = true obj[key] = true
this.setState({ this.setState({
...@@ -308,7 +318,7 @@ class BlessingPreheat extends Component { ...@@ -308,7 +318,7 @@ class BlessingPreheat extends Component {
handleToShowNotice = () => { handleToShowNotice = () => {
http.get(`${API['base-api']}/sys/activity/create_blessing_qrcode`).then(res => { http.get(`${API['base-api']}/sys/activity/create_blessing_qrcode`).then(res => {
const {errno, data} = res.data const {errno, data, msg} = res.data;
if (errno === 200) { if (errno === 200) {
QRCode.toDataURL(data.url, { QRCode.toDataURL(data.url, {
width: 120, width: 120,
...@@ -326,6 +336,8 @@ class BlessingPreheat extends Component { ...@@ -326,6 +336,8 @@ class BlessingPreheat extends Component {
}) })
} else if (errno === 4030 || errno === 4040) { } else if (errno === 4030 || errno === 4040) {
this.toLogin() this.toLogin()
}else {
Toast.info(msg, 2, null, false);
} }
}) })
} }
...@@ -407,7 +419,8 @@ class BlessingPreheat extends Component { ...@@ -407,7 +419,8 @@ class BlessingPreheat extends Component {
showRecordList, showRecordList,
shareMark, shareMark,
index, index,
isApp isApp,
isClose
} = this.state } = this.state
const {history} = this.props const {history} = this.props
const isLogin = !this.props.user.hasError const isLogin = !this.props.user.hasError
...@@ -432,10 +445,8 @@ class BlessingPreheat extends Component { ...@@ -432,10 +445,8 @@ class BlessingPreheat extends Component {
toSection={(e) => this.toSection(this.fetchMoudleId('best-courses'), e)} toSection={(e) => this.toSection(this.fetchMoudleId('best-courses'), e)}
handleToShowList={() => this.handleToShow('isCourse')} handleToShowList={() => this.handleToShow('isCourse')}
handleToShowNotice={this.handleToShowNotice} handleToShowNotice={this.handleToShowNotice}
handleToShow={this.handleToShow}
toLogin={this.toLogin} toLogin={this.toLogin}
handleToShowShare={() => this.handleToShow('shareMark')} handleToShowShare={() => this.handleToShow('shareMark')}
handleToHideShare={() => this.handleToHide('shareMark')}
/> />
{/* 幸运大抽奖--预热 */} {/* 幸运大抽奖--预热 */}
...@@ -478,7 +489,7 @@ class BlessingPreheat extends Component { ...@@ -478,7 +489,7 @@ class BlessingPreheat extends Component {
} }
{ {
shareMark && shareMark &&
<SharePopup toClose={() => this.handleToHide('shareMark')}/> <SharePopup isClose={isClose} toClose={() => this.handleToHide('shareMark')}/>
} }
{/* {/*
......
...@@ -5,7 +5,11 @@ import './index.scss' ...@@ -5,7 +5,11 @@ import './index.scss'
export default class SharePopup extends Component { export default class SharePopup extends Component {
render() { render() {
return ( return (
<div className="share__container" onClick={this.props.toClose}> <div className="share__container" onClick={() => {
if(this.props.isClose) {
this.props.toClose();
}
}}>
{ {
browser.isWeixin && browser.isWeixin &&
<div className="share__row"> <div className="share__row">
......
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