Commit 429a2a21 by FE

Merge branch 'new-share' into pre

parents 5cdba173 63389b41
body {
height: 100%;
}
#root {
height: 100%;
// background-color: #F5F5F5;
}
.page-body {
height: 100%;
// background-color: #F5F5F5;
}
.country-header {
margin: 0;
padding: 0 13px;
font-size: 15px;
font-family: Hiragino Sans GB;
font-weight: normal;
color: #3E3E3E;
line-height: 28px;
background-color: #F5F5F5;
}
.country-list {
.country-item {
&:nth-child(n+2) {
border-top: 1px solid #ECECEC;
}
}
}
.country-item {
margin: 0 12px;
}
.country-item__link {
display: flex;
align-items: center;
justify-content: space-between;
height: 50px;
}
.country-name {
font-size: 15px;
font-family: Hiragino Sans GB;
color: #3E3E3E;
}
.country-num {
font-size: 15px;
font-family: Hiragino Sans GB;
color: #555;
}
// NAV
.letter-nav {
position: fixed;
top: 0;
right: 2px;
}
.letter-nav__item {
width: 12px;
// height: 12px;
margin-bottom: 6px;
font-size: 10px;
font-family: Hiragino Sans GB;
color: #0099FF;
text-align: center;
line-height: 12px;
}
.letter-nav__item--active {
border-radius: 50%;
color: #fff;
background-color: #0099FF;
}
\ No newline at end of file
......@@ -35,6 +35,7 @@ class RedPacket extends PureComponent {
txt: '手机号绑定超时,红包已失效!',
// txt: '今日已领取5.6元代金券碎片!',
// txt: '今日已领取5.6元现金!',
desc: ''
},
money: '', // 红包金额,
endTime: 10, // 手机绑定时限
......@@ -52,12 +53,90 @@ class RedPacket extends PureComponent {
const { shareInfo } = this.state;
if(share_code) {
this.setState({
type: browser.isWeixin? 2 : 3,
shareInfo: {
...shareInfo,
share_code
}
});
// 检查收否领取过
http.post(
`${API.home}/sys/redPacket/split`,
{
action: 'check',
share_code
}
).then(res => {
const {code, data} = res.data;
if(code === 200) {
// is_overdue 红包是否过期 0-否 1-是
if(data.is_overdue) {
this.setState({
type: 7
});
}else {
// is_receive 是否领取过 0-否 1-是
if(data.is_receive) {
this.judgeReceiveStatus(data);
}else {
this.setState({
type: 3
});
}
}
}
if(code === 4030 || code === 4040) {
this.setState({
type: browser.isWeixin? 2 : 3
});
}
});
}
}
// 判断领取状态--领取后
judgeReceiveStatus = (data) => {
// receive_status 领取状态 1-已领取 2-已领取未绑定 3-已失效
if(data.receive_status === 1) {
let txt = '';
let desc = '';
// receive_type 领取类型 1自己 2别人
if(data.receive_type === 1) {
txt = data.red_packet_type === 1? `今日已领取${data.amount}元现金!`: `今日已领取${data.amount}元代金券碎片!`;
desc = '越多好友领取,你所得越多!';
}
if(data.receive_type === 2) {
txt = data.red_packet_type === 1? `您已经领过该红包 ${data.amount}元现金!`: `您已经领过该红包 ${data.amount}元代金券碎片!`;
desc = '每天只能帮好友领取一次哦~';
}
this.setState({
type: 9,
doneInfo: {
status: 1,
txt,
desc
}
});
}else if(data.receive_status === 2) {
this.setState({
type: 4,
money: data.amount,
endTime: data.end_time
});
this.startCountDown();
}else if(data.receive_status === 3) {
this.setState({
type: 9,
doneInfo: {
status: 2,
txt: '手机号绑定超时,红包已失效!',
desc
}
});
}
}
......@@ -92,8 +171,14 @@ class RedPacket extends PureComponent {
http.get(`${API.home}/sys/redPacket/shareUrl/${getParam('id')}`).then(res => {
const { code, data } = res.data;
if(code === 4030 || code === 4040) {
if(browser.isWeixin) {
this.setState({
type: 2
});
}else {
history.push('/passport/login');
}
}
if(code === 200) {
this.setState({
shareInfo: data,
......@@ -129,50 +214,9 @@ class RedPacket extends PureComponent {
const { code, data } = res.data;
if(code === 200) {
// is_overdue 红包是否过期 0-否 1-是
if(data.is_overdue) {
this.setState({
type: 7
});
}else {
// is_receive 是否领取过 0-否 1-是
if(data.is_receive) {
// receive_status 领取状态 1-已领取 2-已领取未绑定 3-已失效
if(data.receive_status === 1) {
let txt = '';
// receive_type 领取类型 1自己 2别人
if(data.receive_type === 1) {
txt = data.red_packet_type === 1? `今日已领取${data.amount}元现金!`: `今日已领取${data.amount}元代金券碎片!`;
}
if(data.receive_type === 2) {
txt = data.red_packet_type === 1? `您已经领过该红包 ${data.amount}元现金!`: `您已经领过该红包 ${data.amount}元代金券碎片!`;
}
this.setState({
type: 9,
doneInfo: {
status: 1,
txt
}
});
}else if(data.receive_status === 2) {
this.setState({
type: 4,
money: data.amount,
endTime: data.end_time
});
this.startCountDown();
}else if(data.receive_status === 3) {
this.setState({
type: 9,
doneInfo: {
status: 2,
txt: '手机号绑定超时,红包已失效!'
}
});
}
this.judgeReceiveStatus(data);
}else {
// red_packet_type 红包类型 1-现金 2-代金券
......@@ -208,13 +252,13 @@ class RedPacket extends PureComponent {
type: 9,
doneInfo: {
status: 2,
txt: '手机号绑定超时,红包已失效!'
txt: '手机号绑定超时,红包已失效!',
desc: data.receive_type === 1? '越多好友领取,你所得越多!' : data.receive_type === 2? '每天只能帮好友领取一次哦~' : ''
}
});
}
}
}
}
}else if(code === 4030 || code === 4040) {
history.push('/passport/login');
}
......@@ -239,46 +283,13 @@ class RedPacket extends PureComponent {
// is_receive 是否领取过 0-否 1-是
if(data.is_receive) {
// receive_status 领取状态 1-已领取 2-已领取未绑定 3-已失效
if(data.receive_status === 1) {
this.setState({
type: 9,
doneInfo: {
status: 1,
txt: data.red_packet_type === 1? `今日已领取${data.amount}元现金!`: `今日已领取${data.amount}元代金券碎片!`
}
});
}else if(data.receive_status === 2) {
this.setState({
type: 4,
money: data.amount,
endTime: data.end_time
});
this.startCountDown();
}else if(data.receive_status === 3) {
this.setState({
type: 9,
doneInfo: {
status: 2,
txt: '手机号绑定超时,红包已失效!'
}
});
}
}else {
// is_overdue 红包是否过期 0-否 1-是
if(data.is_overdue) {
this.setState({
type: 7
});
this.judgeReceiveStatus(data);
}else {
this.setState({
type: 3
});
}
}
}
});
}else {
if(isShare) {
......@@ -291,6 +302,16 @@ class RedPacket extends PureComponent {
}
}
// 微信内点击蒙层
clickMask = () => {
const { type } = this.state;
if(type === 2) {
this.setState({
type: 0
});
}
}
// 复制口令
handleToCopy = () => {
this.setState({
......@@ -404,7 +425,8 @@ class RedPacket extends PureComponent {
type: 9,
doneInfo: {
status: 2,
txt: '手机号绑定超时,红包已失效!'
txt: '手机号绑定超时,红包已失效!',
desc: data.receive_type === 1? '越多好友领取,你所得越多!' : data.receive_type === 2? '每天只能帮好友领取一次哦~' : ''
}
});
}
......@@ -467,7 +489,7 @@ class RedPacket extends PureComponent {
bindInfo
} = this.state;
const cls = classnames('popup-mask',{
'popup-mask--no': type !== 0
'popup-mask--no': type !== 2
});
return (
<>
......@@ -479,7 +501,7 @@ class RedPacket extends PureComponent {
{/* popup */}
{
type !== 0 &&
<div className={cls}>
<div className={cls} onClick={this.clickMask}>
{/* wechat */}
{
......@@ -758,7 +780,7 @@ class RedPacket extends PureComponent {
}
{doneInfo.txt}
</h4>
<p className="popup-done__desc">每天只能帮好友领取一次哦~</p>
<p className="popup-done__desc">{doneInfo.desc}</p>
<button
className="popup-packet__button--bundle"
data-status="do"
......
......@@ -30,6 +30,7 @@ const Classify = loadable(() => import(/* webpackChunkName: 'Classify'*/'@/compo
const CampTest = loadable(() => import(/* webpackChunkName: 'Classify'*/'@/components/video/camp/campTest'))
const CampResolve = loadable(() => import(/* webpackChunkName: 'Classify'*/'@/components/video/camp/campResolve'))
const ShareCourse = loadable(() => import('@/components/ShareCourse/index'))
const Country = loadable(() => import('@/components/country/index'))
export default [
{
path: '/',
......@@ -154,6 +155,12 @@ export default [
path: '/ShareCourse',
component: ShareCourse
},
// 区号
{
path: '/country',
component: Country
},
{
path: '/togroup',
component: ToGroup
......
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