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
d1f84946
Commit
d1f84946
authored
Nov 05, 2019
by
wangshuo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
中奖页面
parent
e03bc46c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
190 additions
and
19 deletions
+190
-19
src/components/blessingGetPrize/index.js
+86
-16
src/components/blessingGetPrize/index.scss
+104
-3
No files found.
src/components/blessingGetPrize/index.js
View file @
d1f84946
import
React
,
{
Component
}
from
'react'
;
import
'./index.scss'
;
import
ListHeader
from
'./../blessingPreheat/listHeader/index'
export
default
class
BlessingGetPrize
extends
Component
{
import
{
http
,
getParam
}
from
'@/utils'
;
import
{
Toast
}
from
'antd-mobile'
;
import
AddressPopup
from
'./../blessingPreheat/addressPopup/index'
import
{
Popup
}
from
'@/common'
import
{
connect
}
from
'react-redux'
@
connect
(({
user
})
=>
(
{
uid
:
user
.
data
.
uid
||
''
}
))
class
BlessingGetPrize
extends
Component
{
popupInstance
=
null
constructor
(
props
)
{
super
(
props
);
this
.
state
=
{
stage
:
'11.11 00:00~2:00'
,
prize
:
'Python特训营优惠券'
,
isGet
:
true
,
//是否中奖
prizeType
:
1
,
// 实物奖品 虚拟奖品
date
:
''
,
next_date
:
''
,
name
:
''
,
is_winning
:
1
,
//是否中奖
is_virtual
:
1
,
// 实物奖品 虚拟奖品
prize_data
:
[],
address
:
false
,
}
}
componentDidMount
()
{
http
.
get
(
`
${
API
.
home
}
/sys/lottery_result?id=
${
getParam
(
'id'
)}
`
).
then
(
res
=>
{
const
{
code
,
msg
,
data
}
=
res
.
data
;
if
(
code
===
200
)
{
this
.
setState
({
...
data
.
info
,
prize_data
:
data
.
prize_data
.
slice
(
0
,
6
),
})
}
else
{
Toast
.
info
(
msg
);
}
});
}
showAddress
=
(
bool
)
=>
{
const
{
history
,
uid
}
=
this
.
props
if
(
bool
&&
!
uid
)
{
history
.
push
(
'/passport'
)
}
else
{
if
(
bool
&&
!
this
.
popupInstance
)
{
this
.
popupInstance
=
Popup
({
title
:
'收货信息'
,
content
:
<
AddressPopup
handleToHide
=
{()
=>
this
.
showAddress
(
false
)}
/
>
})
}
else
{
this
.
popupInstance
.
close
()
this
.
popupInstance
=
null
}
}
}
render
()
{
const
{
stage
,
prize
,
isGet
,
prizeType
}
=
this
.
state
;
const
{
date
,
next_date
,
name
,
is_winning
,
is_virtual
,
prize_data
,
address
}
=
this
.
state
;
return
(
<
div
className
=
"blessing_get_prize"
>
<
div
className
=
'is__get_prize'
>
<
div
className
=
"get_piriz__info"
>
<
div
className
=
'result'
>
{
stag
e
}
中奖结果
<
/div
>
<
div
className
=
'result'
>
{
dat
e
}
中奖结果
<
/div
>
{
!
isGet
&&
(
is_winning
===
0
&&
(
<
div
className
=
'no_prize'
>
很遗憾,你未中奖~
<
/div
>
)
}
{
is
Get
&&
prizeType
===
1
&&
(
is
_winning
===
1
&&
is_virtual
===
0
&&
(
<
div
className
=
'real__prize'
>
<
div
>
恭喜你,一抽中
{
priz
e
}
奖品
<
/div
>
<
span
className
=
'address'
>
填写收货地址
<
/span
>
<
div
>
恭喜你,一抽中
{
nam
e
}
奖品
<
/div
>
<
span
onClick
=
{()
=>
this
.
showAddress
(
true
)}
className
=
'address'
>
填写收货地址
<
/span
>
<
/div
>
)
}
{
is
Get
&&
prizeType
===
2
&&
(
is
_winning
===
1
&&
is_virtual
===
1
&&
(
<
div
className
=
'virtual '
>
<
div
>
恭喜你抽中
{
priz
e
}
,
<
/div
>
<
div
>
恭喜你抽中
{
nam
e
}
,
<
/div
>
<
div
>
奖品已存放到你的账户
<
/div
>
<
/div
>
)
...
...
@@ -43,14 +88,38 @@ export default class BlessingGetPrize extends Component {
<
/div
>
<
/div
>
<
div
className
=
'current_stage'
>
11.11
02
:
00
~
04
:
00
{
next_date
}
<
/div
>
<
ListHeader
text
=
"抽奖已开启"
styles
=
{{
margin
:
'16px 0 1
5
px'
}}
/
>
<
ListHeader
text
=
"抽奖已开启"
styles
=
{{
margin
:
'16px 0 1
8
px'
}}
/
>
<
div
className
=
'prize_list_container'
>
{
prize_data
.
length
>
0
&&
prize_data
.
map
((
item
,
index
)
=>
{
return
(
<
div
className
=
'prize__item'
key
=
{
index
}
>
<
img
className
=
'prize__image'
src
=
{
item
.
img
}
><
/img
>
<
div
className
=
'name__num'
>
<
span
>
{
item
.
name
}
<
/span
>
<
span
>
(
{
`*
${
item
.
num
}
`
}
)
<
/span
>
<
/div
>
<
/div>
)
})
}
<
/div
>
<
a
href
=
'/blessingPreheat'
className
=
'join__button'
>
立即参与抽奖
<
/a
>
<
div
className
=
'prize__tip'
>
<
div
className
=
'line'
><
/div
>
<
span
>
中奖小
tips
<
/span
>
<
div
className
=
'line'
><
/div
>
<
/div
>
<
div
className
=
'blessing__des'
>
积攒的福气值越高,中奖概率越大哦
<
/div
>
<
a
className
=
'to__preheat'
href
=
'/blessingPreheat'
>
积攒更多福气值
<
/a
>
<
/div
>
)
}
}
export
default
BlessingGetPrize
\ No newline at end of file
src/components/blessingGetPrize/index.scss
View file @
d1f84946
...
...
@@ -3,6 +3,7 @@
height
:
100vh
;
overflow
:
auto
;
background-color
:
#4B00F3
;
padding-bottom
:
58px
;
.is__get_prize
{
width
:
100%
;
...
...
@@ -84,12 +85,111 @@
color
:rgba
(
255
,
255
,
255
,
1
)
;
text-align
:
center
;
text-align-last
:
center
;
margin-top
:
36px
;
}
.prize_list_container
{
width
:
100%
;
height
:
250px
;
background
:rgba
(
53
,
0
,
162
,
1
)
;
box-shadow
:
0px
3px
6px
0px
rgba
(
0
,
0
,
0
,
0
.1
);
height
:
250px
;
background
:rgba
(
53
,
0
,
162
,
1
)
;
box-shadow
:
0px
3px
6px
0px
rgba
(
0
,
0
,
0
,
0
.1
);
display
:
flex
;
flex-direction
:
row
;
justify-content
:
flex-start
;
align-items
:
flex-start
;
flex-wrap
:
wrap
;
padding
:
16px
;
.prize__item
{
width
:
106px
;
display
:
flex
;
flex-direction
:
column
;
justify-content
:
flex-start
;
align-items
:
center
;
margin-right
:
10px
;
&
:nth-child
(
3n
)
{
margin-right
:
0
;
}
.prize__image
{
width
:
106px
;
height
:
82px
;
}
.name__num
{
display
:
flex
;
flex-direction
:
row
;
justify-content
:
space-around
;
align-items
:
center
;
font-size
:
12px
;
font-weight
:
400
;
color
:rgba
(
255
,
255
,
255
,
1
)
;
margin-top
:
6px
;
span
{
&
:first-child
{
width
:
70px
;
flex
:
0
0
auto
;
overflow
:
hidden
;
text-overflow
:
ellipsis
;
white-space
:
nowrap
;
}
&
:last-child
{
width
:
36px
;
flex
:
0
0
auto
;
}
}
}
}
}
.join__button
{
display
:
block
;
width
:
340px
;
height
:
50px
;
background
:linear-gradient
(
90deg
,
rgba
(
255
,
105
,
5
,
1
)
0
%
,
rgba
(
255
,
180
,
5
,
1
)
100
%
)
;
font-size
:
18px
;
font-weight
:
500
;
color
:rgba
(
255
,
255
,
255
,
1
)
;
border-radius
:
5px
;
margin
:
20px
auto
32px
;
line-height
:
50px
;
text-align
:
center
;
text-align-last
:
center
;
}
.prize__tip
{
display
:
flex
;
flex-direction
:
row
;
justify-content
:
center
;
align-items
:
center
;
font-size
:
14px
;
font-weight
:
400
;
color
:rgba
(
255
,
255
,
255
,
1
)
;
margin-bottom
:
12px
;
.line
{
width
:
128px
;
height
:
1px
;
background
:
#fff
;
}
span
{
margin
:
0
8px
;
}
}
.blessing__des
{
font-size
:
12px
;
font-weight
:
300
;
color
:rgba
(
255
,
255
,
255
,
.6
)
;
text-align
:
center
;
margin-bottom
:
16px
;
}
.to__preheat
{
display
:
inline-block
;
width
:
100%
;
font-size
:
14px
;
font-weight
:
300
;
text-decoration
:underline
;
color
:rgba
(
255
,
255
,
255
,
.6
)
;
text-align
:
center
;
}
}
\ No newline at end of file
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