Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mr-julyedu
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
baiguangyao
mr-julyedu
Commits
ef55b20f
Commit
ef55b20f
authored
Nov 08, 2019
by
zhanghaozhe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
抽奖
parent
a9885b44
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
35 deletions
+42
-35
src/components/blessingPreheat/formal-draw/index.js
+42
-35
No files found.
src/components/blessingPreheat/formal-draw/index.js
View file @
ef55b20f
...
...
@@ -80,47 +80,54 @@ class FormalDraw extends Component {
if
(
hot_value
<
50
)
{
Toast
.
info
(
'你的福气值未达到参与抽奖所需福气值分数,快去积攒福气值吧'
,
2
,
null
,
false
)
}
else
if
(
is_prize
==
1
)
{
Toast
.
info
(
'你已参与当前时段抽奖'
,
2
,
null
,
false
)
Toast
.
info
(
'你已参与当前时段抽奖'
,
2
,
()
=>
{
this
.
requestDraw
(
id
)
},
false
)
}
else
if
(
surplus
<
1
)
{
Toast
.
info
(
'你的抽奖次数已用光,快去积攒福气值可获得更多抽奖机会'
,
2
,
null
,
false
)
}
else
{
http
.
post
(
`
${
API
.
home
}
/sys/activity/prize`
,
{
id
}).
then
(
res
=>
{
const
{
code
,
msg
,
data
}
=
res
.
data
if
(
code
==
200
)
{
var
_czc
=
_czc
||
[]
_czc
.
push
([
"_trackEvent"
,
'点击抽奖'
,
'm端双十一正式活动-点击抽奖'
])
QRCode
.
toDataURL
(
data
.
url
,
(
err
,
url
)
=>
{
this
.
popupInstance
=
Popup
({
title
:
'你已成功参与本时段抽奖'
,
className
:
'join-lottery'
,
content
:
(
<>
<
div
className
=
"text"
>
<
div
className
=
"code"
>
抽奖码为:
{
data
.
code
}
<
/div
>
<
div
className
=
"time"
>
本时段的中奖结果将在
{
data
.
date
}
公布
<
/div
>
<
div
className
=
"hint"
>
你可关注‘七月在线’服务号第一时间获得中奖信息。
<
/div
>
<
img
src
=
{
url
}
className
=
'qr-code'
alt
=
""
/>
<
/div
>
<
button
onClick
=
{()
=>
{
this
.
popupInstance
.
close
()
}}
>
知道了
<
/button
>
<
/
>
)
})
this
.
setState
({
userValue
:
{...
this
.
state
.
userValue
,
...{
surplus
:
--
surplus
},
...{
is_prize
:
1
}}
},
()
=>
{
console
.
log
(
this
.
state
.
userValue
)})
})
}
else
{
Toast
.
info
(
msg
,
2
,
null
,
false
)
}
})
this
.
requestDraw
(
id
)
}
}
requestDraw
=
id
=>
{
let
{
surplus
}
=
this
.
state
.
userValue
http
.
post
(
`
${
API
.
home
}
/sys/activity/prize`
,
{
id
}).
then
(
res
=>
{
const
{
code
,
msg
,
data
}
=
res
.
data
if
(
code
==
200
)
{
var
_czc
=
_czc
||
[]
_czc
.
push
([
"_trackEvent"
,
'点击抽奖'
,
'm端双十一正式活动-点击抽奖'
])
QRCode
.
toDataURL
(
data
.
url
,
(
err
,
url
)
=>
{
this
.
popupInstance
=
Popup
({
title
:
'你已成功参与本时段抽奖'
,
className
:
'join-lottery'
,
content
:
(
<>
<
div
className
=
"text"
>
<
div
className
=
"code"
>
抽奖码为:
{
data
.
code
}
<
/div
>
<
div
className
=
"time"
>
本时段的中奖结果将在
{
data
.
date
}
公布
<
/div
>
<
div
className
=
"hint"
>
你可关注‘七月在线’服务号第一时间获得中奖信息。
<
/div
>
<
img
src
=
{
url
}
className
=
'qr-code'
alt
=
""
/>
<
/div
>
<
button
onClick
=
{()
=>
{
this
.
popupInstance
.
close
()
}}
>
知道了
<
/button
>
<
/
>
)
})
this
.
setState
({
userValue
:
{...
this
.
state
.
userValue
,
...{
surplus
:
--
surplus
},
...{
is_prize
:
1
}}
})
})
}
else
{
Toast
.
info
(
msg
,
2
,
null
,
false
)
}
})
}
lotteryFunc
=
(
status
,
id
)
=>
{
const
{
hasError
}
=
this
.
props
.
user
if
(
hasError
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment