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
75adef29
Commit
75adef29
authored
Nov 12, 2019
by
zhanghaozhe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
抽奖预约
parent
5909e197
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
55 additions
and
40 deletions
+55
-40
src/components/blessingPreheat/formal-draw/index.js
+55
-40
No files found.
src/components/blessingPreheat/formal-draw/index.js
View file @
75adef29
...
@@ -34,35 +34,35 @@ class FormalDraw extends Component {
...
@@ -34,35 +34,35 @@ class FormalDraw extends Component {
}
}
shouldComponentUpdate
(
nextProps
,
nextState
,
nextContext
)
{
shouldComponentUpdate
(
nextProps
,
nextState
,
nextContext
)
{
if
(
this
.
props
.
isApp
!==
nextProps
.
isApp
)
{
if
(
this
.
props
.
isApp
!==
nextProps
.
isApp
)
{
this
.
getPrizeData
()
this
.
getPrizeData
()
return
false
;
return
false
}
}
return
true
;
return
true
}
}
getPrizeData
=
()
=>
{
getPrizeData
=
()
=>
{
http
.
get
(
`
${
API
.
home
}
/sys/activity/prize_data`
)
http
.
get
(
`
${
API
.
home
}
/sys/activity/prize_data`
)
.
then
(
res
=>
{
.
then
(
res
=>
{
const
{
data
,
code
,
msg
}
=
res
.
data
const
{
data
,
code
,
msg
}
=
res
.
data
if
(
code
==
200
)
{
if
(
code
==
200
)
{
const
{
today
}
=
data
.
value
const
{
today
}
=
data
.
value
const
oneDay
=
data
.
list
.
filter
(
item
=>
item
.
date
===
data
.
value
.
today
)
const
oneDay
=
data
.
list
.
filter
(
item
=>
item
.
date
===
data
.
value
.
today
)
const
activeIndex
=
oneDay
[
0
][
'son'
].
findIndex
(
item
=>
item
.
status
==
3
)
const
activeIndex
=
oneDay
[
0
][
'son'
].
findIndex
(
item
=>
item
.
status
==
3
)
this
.
setState
({
this
.
setState
({
tabs
:
data
.
list
.
map
(
item
=>
({
title
:
item
.
date
})),
tabs
:
data
.
list
.
map
(
item
=>
({
title
:
item
.
date
})),
today
,
today
,
initialPageIndex
:
data
.
list
.
findIndex
(
item
=>
item
.
date
==
today
)
||
0
,
initialPageIndex
:
data
.
list
.
findIndex
(
item
=>
item
.
date
==
today
)
||
0
,
list
:
data
.
list
,
list
:
data
.
list
,
userValue
:
data
.
value
,
userValue
:
data
.
value
,
activeTimeRangeIndex
:
activeIndex
<
0
?
0
:
activeIndex
activeTimeRangeIndex
:
activeIndex
<
0
?
0
:
activeIndex
},
()
=>
{
},
()
=>
{
this
.
initializeSwiper
()
this
.
initializeSwiper
()
})
})
}
else
{
}
else
{
Toast
.
info
(
msg
,
2
,
null
,
false
)
Toast
.
info
(
msg
,
2
,
null
,
false
)
}
}
})
})
}
}
initializeSwiper
=
()
=>
{
initializeSwiper
=
()
=>
{
...
@@ -161,25 +161,40 @@ class FormalDraw extends Component {
...
@@ -161,25 +161,40 @@ class FormalDraw extends Component {
if
(
this
.
subscribePopupInstance
)
{
if
(
this
.
subscribePopupInstance
)
{
return
return
}
}
http
.
get
(
`
${
API
[
"base-api"
]}
/sys/activity/create_pre_qrcode`
,{
params
:{
id
}})
if
(
!
this
.
state
.
userValue
[
'is_pre'
])
{
.
then
(
res
=>
{
http
.
get
(
`
${
API
[
"base-api"
]}
/sys/activity/create_pre_qrcode`
,
{
params
:
{
id
}})
const
{
code
,
data
,
msg
}
=
res
.
data
.
then
(
res
=>
{
if
(
code
==
200
)
{
const
{
code
,
data
,
msg
}
=
res
.
data
this
.
subscribePopupInstance
=
QRCode
.
toDataURL
(
data
.
url
,
(
err
,
url
)
=>
{
if
(
code
==
200
)
{
Popup
({
this
.
subscribePopupInstance
=
QRCode
.
toDataURL
(
data
.
url
,
(
err
,
url
)
=>
{
title
:
'微信扫码“七月在线”服务号即可预约'
,
Popup
({
className
:
'subscribe'
,
title
:
'微信扫码“七月在线”服务号即可预约'
,
content
:
<
img
src
=
{
url
}
alt
=
""
className
=
"qr-code"
/>
,
className
:
'subscribe'
,
close
:
()
=>
new
Promise
(
resolve
=>
{
content
:
<
img
src
=
{
url
}
alt
=
""
className
=
"qr-code"
/>
,
this
.
subscribePopupInstance
=
null
close
:
()
=>
new
Promise
(
resolve
=>
{
resolve
()
this
.
subscribePopupInstance
=
null
resolve
()
})
})
})
})
})
})
}
else
{
}
else
{
Toast
.
info
(
msg
,
2
,
null
,
false
)
Toast
.
info
(
msg
,
2
,
null
,
false
)
}
}
})
})
}
else
{
http
.
get
(
`
${
API
[
"base-api"
]}
/activity_pre/
${
id
}
`
)
.
then
(
res
=>
{
const
{
code
}
=
res
.
data
if
(
code
==
200
)
{
Toast
.
info
(
'预约成功'
,
2
,
null
,
false
)
}
})
.
catch
(
err
=>
{
console
.
log
(
err
)
})
}
}
}
render
()
{
render
()
{
...
...
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