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
b91f6919
Commit
b91f6919
authored
Nov 08, 2019
by
wangshuo
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '11-11-formal' into dev
parents
a2761e81
f18b9d30
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
98 additions
and
61 deletions
+98
-61
src/components/blessingPreheat/banner/index.scss
+1
-0
src/components/blessingPreheat/formal-draw/index.js
+58
-41
src/components/blessingPreheat/formal-draw/index.scss
+21
-0
src/components/blessingPreheat/index.js
+18
-20
No files found.
src/components/blessingPreheat/banner/index.scss
View file @
b91f6919
#main-banner
{
overflow
:
auto
;
margin-bottom
:
70px
;
.banner
{
width
:
375px
;
height
:
183px
;
...
...
src/components/blessingPreheat/formal-draw/index.js
View file @
b91f6919
...
...
@@ -77,50 +77,57 @@ class FormalDraw extends Component {
draw
=
id
=>
{
let
{
surplus
,
is_prize
,
hot_value
}
=
this
.
state
.
userValue
if
(
hot_value
<
50
)
{
if
(
hot_value
<
50
)
{
Toast
.
info
(
'你的福气值未达到参与抽奖所需福气值分数,快去积攒福气值吧'
,
2
,
null
,
false
)
}
else
if
(
is_prize
==
1
){
Toast
.
info
(
'你已参与当前时段抽奖'
,
2
,
null
,
false
)
}
else
if
(
surplus
<
1
){
}
else
if
(
is_prize
==
1
)
{
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
}}
})
})
}
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
)
{
...
...
@@ -184,7 +191,16 @@ class FormalDraw extends Component {
{
list
.
map
((
listItem
,
index
)
=>
{
return
(
<
div
className
=
"content"
key
=
{
index
}
>
<
div
className
=
{
`content
${
today
===
userValue
.
today
?
'current'
:
''
}
`
}
key
=
{
index
}
>
{
(
isLogin
&&
(
today
===
userValue
.
today
))
?
<
div
className
=
"prize_number_con"
>
当日剩余抽奖次数:
<
span
className
=
{
'prize__number'
}
>
{
userValue
.
surplus
}
次
<
/span
>
<
/div
>
:
""
}
<
div
className
=
"title"
>
<
img
src
=
"https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/active19_1111/title-decorate-left.png"
alt
=
""
/>
...
...
@@ -199,6 +215,7 @@ class FormalDraw extends Component {
src
=
"https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/active19_1111/title-decorate-right.png"
alt
=
""
/>
<
/div
>
{
isLogin
?
<
div
className
=
"progress-bar"
>
...
...
@@ -224,14 +241,14 @@ class FormalDraw extends Component {
statusContent
=
(
<>
<
span
>
已结束
<
/span
>
<
Link
to
=
{
`/prize-winner-list?tid=
${
item
.
id
}
`
}
>
查看中奖
记录
<
/Link
>
<
Link
to
=
{
`/prize-winner-list?tid=
${
item
.
id
}
`
}
>
查看中奖
名单
<
/Link
>
<
/
>
)
break
case
3
:
statusContent
=
(
<>
<
div
>
参与
抽奖
<
/div
>
<
div
>
立即
抽奖
<
/div
>
<
div
>
{
item
.
num
}
人正在参与
<
/div
>
<
/
>
)
...
...
src/components/blessingPreheat/formal-draw/index.scss
View file @
b91f6919
...
...
@@ -85,6 +85,7 @@
.content
{
position
:
relative
;
.title
{
display
:
flex
;
justify-content
:
center
;
...
...
@@ -126,6 +127,26 @@
}
}
.prize_number_con
{
width
:
280px
;
height
:
30px
;
background
:rgba
(
255
,
255
,
255
,
1
)
;
border-radius
:
15px
;
font-size
:
14px
;
font-weight
:
400
;
color
:rgba
(
83
,
39
,
250
,
1
)
;
text-align
:
center
;
text-align-last
:
center
;
line-height
:
30px
;
position
:
absolute
;
left
:
50%
;
transform
:
translateX
(
-50%
);
top
:
18px
;
}
}
.current
{
padding-top
:
50px
;
}
.progress-bar
{
...
...
src/components/blessingPreheat/index.js
View file @
b91f6919
...
...
@@ -245,9 +245,7 @@ class BlessingPreheat extends Component {
if
(
code
===
200
)
{
this
.
setState
({
isSign
:
!!
data
.
today_signed
,
// isFormal: data.is_activity,
//todo 去掉假数据
isFormal
:
1
,
isFormal
:
data
.
is_activity
,
testSum
:
parseInt
(
data
.
user_test_total
,
10
)
||
0
,
userInfo
:
Object
.
assign
({},
userInfo
,
{
isFollow
:
data
.
subscribed
,
...
...
@@ -540,8 +538,23 @@ class BlessingPreheat extends Component {
toSection
=
{
this
.
toSection
}
index
=
{
index
}
/
>
{
/* 抽奖--正式 */
}
{
isFormal
===
1
&&
<>
<
ListHeader
id
=
{
'lucky-draw'
}
text
=
"幸运大抽奖"
styles
=
{{
margin
:
'30px 0 10px'
}}
/
>
<
div
className
=
"formal-draw-btns"
>
<
button
className
=
"luck-draw__button"
onClick
=
{()
=>
this
.
handleToShow
(
'isRule'
)}
>
活动规则
><
/button
>
<
button
className
=
'prize-record'
onClick
=
{
this
.
getMyPrizeRecord
}
>
中奖记录
><
/button
>
<
/div
>
<
FormalDraw
toLogin
=
{
this
.
toLogin
}
/
>
<
/
>
}
{
/* 积福气 */
}
<
ListHeader
id
=
{
'lucky-value'
}
text
=
"积福气,享受更多福利"
styles
=
{{
margin
:
'
6
0px 0 15px'
}}
/
>
<
ListHeader
id
=
{
'lucky-value'
}
text
=
"积福气,享受更多福利"
styles
=
{{
margin
:
'
3
0px 0 15px'
}}
/
>
<
Link
className
=
"luck-draw__button"
to
=
"/blessingRank"
>
福气排行榜
><
/Link
>
...
...
@@ -558,11 +571,10 @@ class BlessingPreheat extends Component {
/
>
{
/* 幸运大抽奖--预热 */
}
<
ListHeader
id
=
{
'lucky-draw'
}
text
=
"幸运大抽奖"
styles
=
{{
margin
:
'30px 0 10px'
}}
/
>
{
isFormal
===
0
&&
<>
<
ListHeader
id
=
{
'lucky-draw'
}
text
=
"幸运大抽奖"
styles
=
{{
margin
:
'30px 0 10px'
}}
/
>
<
p
className
=
"luck-draw__tip"
>-
将于
11
月
11
日
10
点开启
-<
/p
>
<
button
className
=
"luck-draw__button"
onClick
=
{()
=>
this
.
handleToShow
(
'isRule'
)}
>
活动规则
><
/button
>
<
LuckDraw
/>
...
...
@@ -570,20 +582,6 @@ class BlessingPreheat extends Component {
}
{
/* 抽奖--正式 */
}
{
isFormal
===
1
&&
<>
<
div
className
=
"formal-draw-btns"
>
<
button
className
=
"luck-draw__button"
onClick
=
{()
=>
this
.
handleToShow
(
'isRule'
)}
>
活动规则
><
/button
>
<
button
className
=
'prize-record'
onClick
=
{
this
.
getMyPrizeRecord
}
>
中奖记录
><
/button
>
<
/div
>
<
FormalDraw
toLogin
=
{
this
.
toLogin
}
/
>
<
/
>
}
{
/*定金--只在预热期间显示*/
}
{
isFormal
===
0
&&
...
...
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