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
9e29f131
Commit
9e29f131
authored
Oct 30, 2019
by
FE
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user sign start
parent
e14dda9c
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
69 additions
and
21 deletions
+69
-21
src/components/blessingPreheat/collectBlessing/index.js
+27
-17
src/components/blessingPreheat/collectBlessing/index.scss
+7
-1
src/components/blessingPreheat/index.js
+35
-3
No files found.
src/components/blessingPreheat/collectBlessing/index.js
View file @
9e29f131
import
React
,
{
Component
}
from
'react'
;
import
React
,
{
Component
}
from
'react'
;
import
{
Link
}
from
'react-router-dom'
;
import
ListFrame
from
'./../listFrame/index'
;
import
ListFrame
from
'./../listFrame/index'
;
import
ListHeader
from
'./../listHeader'
;
import
ListHeader
from
'./../listHeader'
;
import
'./index.scss'
;
import
'./index.scss'
;
...
@@ -48,26 +49,32 @@ class CollectBlessing extends Component {
...
@@ -48,26 +49,32 @@ class CollectBlessing extends Component {
}
}
render
()
{
render
()
{
const
{
handleToShowNotice
,
handleToShowList
,
handleToShowInvite
}
=
this
.
props
;
const
{
isSign
,
userInfo
:
{
isLogin
=
false
,
blessingVal
=
0
},
handleToShowNotice
,
handleToShowList
,
handleToShowInvite
}
=
this
.
props
;
const
{
rules
,
welfareRuleList
}
=
this
.
state
;
const
{
rules
,
welfareRuleList
}
=
this
.
state
;
return
(
return
(
<>
<
div
className
=
"collect-blessing"
>
<
div
className
=
"collect-blessing"
>
{
{
this
.
props
.
userLogin
?
(
isLogin
<
ListHeader
size
=
"middle"
styles
=
{{
margin
:
'20px 0 0 0'
}}
>
{
`我的福气值:
${
this
.
props
.
blessingNumber
}
`
}
<
/ListHeader
>
?
(
)
:
(
<
ListHeader
text
=
{
`我的福气值:
${
blessingVal
}
分`
}
size
=
"middle"
styles
=
{{
margin
:
'20px 0 0 0'
}}
/
>
)
:
(
<
ListHeader
size
=
"middle"
styles
=
{{
margin
:
'20px 0 0 0'
}}
>
<
ListHeader
size
=
"middle"
styles
=
{{
margin
:
'20px 0 0 0'
}}
>
<
span
className
=
"text_nologin"
>
我的福气值:
<
/span>
<
span
className
=
"text_nologin"
>
我的福气值:
<
/span>
<
div
className
=
"login__btn"
onClick
=
{
this
.
props
.
toLogin
}
>
登录
<
/div
>
<
Link
to
=
'/passport'
className
=
"login__btn"
>
登录
<
/Link
>
<
/ListHeader
>
<
/ListHeader
>
)
)
}
}
<
p
className
=
'activity__over'
>
活动结束
福气榜前
20
名可获奖品一份
<
/p
>
<
p
className
=
'activity__over'
>
活动结束
福气榜前
20
名可获奖品一份
<
/p
>
<
div
className
=
'blessing__rules'
>
{
{
welfareRuleList
.
map
((
item
,
index
)
=>
{
welfareRuleList
.
map
((
item
,
index
)
=>
(
return
<
div
className
=
"rules__item"
key
=
{
index
}
>
<
div
className
=
"rules__item"
key
=
{
index
}
>
<
div
className
=
"item__left"
>
<
div
className
=
"item__left"
>
<
div
className
=
'tip__bubble'
>
<
div
className
=
'tip__bubble'
>
<
div
className
=
"tip__text"
>
福气值
<
/div
>
<
div
className
=
"tip__text"
>
福气值
<
/div
>
...
@@ -88,22 +95,26 @@ class CollectBlessing extends Component {
...
@@ -88,22 +95,26 @@ class CollectBlessing extends Component {
}
}
<
/div
>
<
/div
>
<
/div
>
<
/div
>
}
)
)
)
}
}
<
/div
>
<
ListHeader
text
=
"福气值积攒规则"
size
=
"middle"
styles
=
{{
margin
:
'30px 0 0'
}}
/
>
<
/div
>
<
div
className
=
"collect-blessing"
>
<
ListHeader
text
=
"福气值积攒规则"
size
=
"middle"
styles
=
{{}}
/
>
{
{
rules
.
map
((
item
,
index
)
=>
(
rules
.
map
((
item
,
index
)
=>
(
<
div
className
=
"collect-blessing__item"
key
=
{
index
}
>
<
div
className
=
"collect-blessing__item"
key
=
{
index
}
>
<
i
className
=
"collect-blessing__num"
>
{
index
+
1
}
<
/i
>
<
i
className
=
"collect-blessing__num"
>
{
index
+
1
}
<
/i
>
<
p
className
=
"collect-blessing__title"
>
{
item
}
<
/p
>
<
p
className
=
"collect-blessing__title"
>
{
item
}
<
/p
>
{
{
index
===
0
&&
(
index
===
0
&&
isLogin
&&
isSign
)
?
(
<
a
className
=
"collect-blessing__content"
onClick
=
{
handleToShowNotice
}
>
<
a
className
=
"collect-blessing__content"
onClick
=
{
handleToShowNotice
}
>
点击
<
br
/>
签到
+
5
点
<
br
/>
福气值
<
/a
>
<
/a
>
)
:
(
<
Link
to
=
'/passport'
className
=
"collect-blessing__content"
>
点击
<
br
/>
签到
<
/Link
>
)
}
}
{
{
index
===
1
&&
index
===
1
&&
...
@@ -141,7 +152,6 @@ class CollectBlessing extends Component {
...
@@ -141,7 +152,6 @@ class CollectBlessing extends Component {
))
))
}
}
<
/div
>
<
/div
>
<
/
>
)
)
}
}
}
}
...
...
src/components/blessingPreheat/collectBlessing/index.scss
View file @
9e29f131
...
@@ -82,6 +82,7 @@
...
@@ -82,6 +82,7 @@
&
[
data-type
=
"wechat"
]
{
&
[
data-type
=
"wechat"
]
{
background-image
:
url('https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/active19_1111/m/wechat-icon.png')
;
background-image
:
url('https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/active19_1111/m/wechat-icon.png')
;
}
}
}
.activity__over
{
.activity__over
{
...
@@ -91,6 +92,7 @@
...
@@ -91,6 +92,7 @@
margin
:
10px
auto
;
margin
:
10px
auto
;
text-align
:
center
;
text-align
:
center
;
}
}
.login__btn
{
.login__btn
{
width
:
34px
;
width
:
34px
;
height
:
18px
;
height
:
18px
;
...
@@ -102,6 +104,7 @@
...
@@ -102,6 +104,7 @@
text-align
:
center
;
text-align
:
center
;
margin-right
:
12px
;
margin-right
:
12px
;
}
}
.text_nologin
{
.text_nologin
{
font-size
:
16px
;
font-size
:
16px
;
font-weight
:
600
;
font-weight
:
600
;
...
@@ -114,7 +117,8 @@
...
@@ -114,7 +117,8 @@
background-size
:
100%
100%
;
background-size
:
100%
100%
;
width
:
336px
;
width
:
336px
;
padding
:
18px
18px
10px
18px
;
padding
:
18px
18px
10px
18px
;
margin
:
10px
auto
;
margin
:
10px
auto
0
;
box-sizing
:
border-box
;
display
:
flex
;
display
:
flex
;
flex-direction
:
row
;
flex-direction
:
row
;
justify-content
:
space-between
;
justify-content
:
space-between
;
...
@@ -174,6 +178,8 @@
...
@@ -174,6 +178,8 @@
p
{
p
{
margin-bottom
:
10px
;
margin-bottom
:
10px
;
line-height
:
1
;
&
:last-child
{
&
:last-child
{
margin-bottom
:
0
;
margin-bottom
:
0
;
}
}
...
...
src/components/blessingPreheat/index.js
View file @
9e29f131
...
@@ -30,6 +30,8 @@ class BlessingPreheat extends Component {
...
@@ -30,6 +30,8 @@ class BlessingPreheat extends Component {
isFormal
:
false
,
// 1正式 0 预热
isFormal
:
false
,
// 1正式 0 预热
isServer
:
false
,
isServer
:
false
,
serverUrl
:
''
,
serverUrl
:
''
,
userInfo
:
{},
isSign
:
false
,
}
}
}
}
...
@@ -38,12 +40,35 @@ class BlessingPreheat extends Component {
...
@@ -38,12 +40,35 @@ class BlessingPreheat extends Component {
}
}
fetchUserBlessing
()
{
fetchUserBlessing
()
{
const
{
userInfo
}
=
this
.
state
;
http
.
get
(
`
${
API
.
home
}
/sys/user/blessing`
).
then
(
res
=>
{
http
.
get
(
`
${
API
.
home
}
/sys/user/blessing`
).
then
(
res
=>
{
const
{
code
,
data
}
=
res
.
data
;
const
{
code
,
data
}
=
res
.
data
;
if
(
code
===
200
)
{
if
(
code
===
200
)
{
this
.
setState
({
this
.
setState
({
isFormal
:
data
.
is_activity
isFormal
:
data
.
is_activity
,
userInfo
:
Object
.
assign
({},
userInfo
,
{
isLogin
:
!!
data
.
is_login
,
blessingVal
:
data
.
user_blessing_value
,
})
});
});
if
(
data
.
is_login
===
1
)
{
this
.
handleToSign
();
}
}
});
}
handleToSign
=
()
=>
{
console
.
log
(
2
,
2
);
http
.
post
(
`
${
API
.
home
}
/sys/add/blessing`
,
{
type
:
1
// 1:签到;3:分享;4:浏览课程;
}).
then
(
res
=>
{
const
{
code
}
=
res
.
data
;
if
(
code
===
200
)
{
this
.
setState
({
isSign
:
true
,
});
Toast
.
info
(
'+5点福气值~'
,
2
,
null
,
false
);
}
}
});
});
}
}
...
@@ -56,13 +81,18 @@ class BlessingPreheat extends Component {
...
@@ -56,13 +81,18 @@ class BlessingPreheat extends Component {
})
})
}
}
handleToShow
=
(
key
)
=>
{
handleToShow
=
(
key
,
isLogin
=
false
)
=>
{
const
{
history
}
=
this
.
props
;
if
(
isLogin
)
{
history
.
push
(
'/passport'
)
}
else
{
let
obj
=
{};
let
obj
=
{};
obj
[
key
]
=
true
;
obj
[
key
]
=
true
;
this
.
setState
({
this
.
setState
({
...
obj
...
obj
});
});
}
}
}
handleToShowInvite
=
()
=>
{
handleToShowInvite
=
()
=>
{
QRCode
.
toDataURL
(
'http://m.julyedu.com/invite'
,
{
QRCode
.
toDataURL
(
'http://m.julyedu.com/invite'
,
{
...
@@ -110,12 +140,14 @@ class BlessingPreheat extends Component {
...
@@ -110,12 +140,14 @@ class BlessingPreheat extends Component {
}
}
render
()
{
render
()
{
const
{
isRule
,
isCourse
,
inviteUrl
,
inviteVisible
,
isFormal
,
isServer
,
serverUrl
}
=
this
.
state
const
{
userInfo
,
isRule
,
isCourse
,
inviteUrl
,
inviteVisible
,
isFormal
,
isServer
,
serverUrl
,
isSign
}
=
this
.
state
return
(
return
(
<
div
id
=
{
'blessing-preheat'
}
>
<
div
id
=
{
'blessing-preheat'
}
>
{
/* 积福气 */
}
{
/* 积福气 */
}
<
ListHeader
text
=
"积福气,享受更多福利"
styles
=
{{
margin
:
'0 0 15px'
}}
/
>
<
ListHeader
text
=
"积福气,享受更多福利"
styles
=
{{
margin
:
'0 0 15px'
}}
/
>
<
CollectBlessing
<
CollectBlessing
isSign
=
{
isSign
}
userInfo
=
{
userInfo
}
handleToShowList
=
{()
=>
this
.
handleToShow
(
'isCourse'
)}
handleToShowList
=
{()
=>
this
.
handleToShow
(
'isCourse'
)}
handleToShowInvite
=
{
this
.
handleToShowInvite
}
handleToShowInvite
=
{
this
.
handleToShowInvite
}
handleToShowNotice
=
{
this
.
handleToShowNotice
}
handleToShowNotice
=
{
this
.
handleToShowNotice
}
...
...
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