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
47114801
Commit
47114801
authored
Nov 04, 2019
by
xuzhenghua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
测试
parent
18053bb6
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
89 additions
and
50 deletions
+89
-50
src/components/activity/index.js
+14
-3
src/components/activity/invite.js
+5
-4
src/components/blessingPreheat/collectBlessing/index.js
+29
-30
src/components/blessingPreheat/collectBlessing/index.scss
+3
-0
src/components/blessingPreheat/index.js
+30
-9
src/components/blessingPreheat/levelTest/index.js
+3
-3
src/components/blessingPreheat/sharePopup/index.js
+5
-1
No files found.
src/components/activity/index.js
View file @
47114801
import
React
,
{
Component
}
from
'react'
import
{
connect
}
from
"react-redux"
;
import
{
http
,
getParam
}
from
'@/utils'
;
import
cookie
from
'js-cookie'
import
'./index.scss'
;
import
{
Toast
}
from
"antd-mobile"
;
import
jsCookie
from
'js-cookie'
;
...
...
@@ -8,11 +9,19 @@ import jsCookie from 'js-cookie';
class
Activity
extends
Component
{
constructor
(
props
)
{
super
(
props
);
this
.
state
=
{
'butText'
:
'立即领取'
}
}
componentWillMount
()
{
jsCookie
.
set
(
'blessing_invite_uid'
,
getParam
(
'shareuid'
),
{
domain
:
'.julyedu.com'
});
jsCookie
.
set
(
'blessing_invite_code'
,
getParam
(
'inviteCode'
),
{
domain
:
'.julyedu.com'
});
jsCookie
.
set
(
'blessing_invite_uid'
,
getParam
(
'shareuid'
),
{
domain
:
'.julyedu.com'
,
expires
:
30
});
jsCookie
.
set
(
'blessing_invite_code'
,
getParam
(
'inviteCode'
),
{
domain
:
'.julyedu.com'
,
expires
:
30
});
if
(
cookie
.
get
(
'uid'
))
{
this
.
setState
(()
=>
({
butText
:
'已领取'
}));
}
}
getGift
=
()
=>
{
...
...
@@ -20,15 +29,17 @@ class Activity extends Component {
this
.
props
.
history
.
push
(
'/passport'
);
}
else
{
Toast
.
info
(
'领取成功,你可前往七月在线官网/APP进行查看'
,
2
);
localStorage
.
setItem
(
'lingqu'
,
1
);
}
}
render
()
{
const
{
butText
}
=
this
.
state
;
return
(
<
div
className
=
"activity__con"
>
<
div
className
=
'banner__con'
><
/div
>
<
div
className
=
'content__con'
>
<
div
className
=
"button__get"
onClick
=
{
this
.
getGift
}
>
立即领取
<
/div
>
<
div
className
=
"button__get"
onClick
=
{
this
.
getGift
}
>
{
butText
}
<
/div
>
<
/div
>
<
/div
>
)
...
...
src/components/activity/invite.js
View file @
47114801
...
...
@@ -119,6 +119,7 @@ class Invite extends Component {
history
.
push
(
'/passport'
);
}
else
{
if
(
is_weixin
())
{
history
.
push
(
`/invite?shareuid=
${
jsCookie
.
get
(
'uid'
)}
&new=1&inviteCode=
${
inviteCode
}
`
);
wxShare
({
title
:
'AI充电节,积福气享1折秒课,超10万元奖品来就送!!'
,
desc
:
'把这门超5万人报名的【Python基础入门 升级版】课程送给你,附200元红包,请笑纳!--七月在线'
,
...
...
@@ -200,8 +201,8 @@ class Invite extends Component {
return
(
<
div
className
=
"user__item-info item__con-only"
key
=
{
index
}
>
<
div
className
=
"item__con"
>
<
img
className
=
"user_avatar"
src
=
{
item
.
avatar
}
/
>
<
div
className
=
"user_name"
>
{
item
.
name
}
<
/div
>
<
img
className
=
"user_avatar"
src
=
{
item
.
head_image
}
/
>
<
div
className
=
"user_name"
>
{
item
.
user_
name
}
<
/div
>
<
/div
>
<
/div
>
)
...
...
@@ -213,8 +214,8 @@ class Invite extends Component {
return
(
<
div
className
=
"user__item-info"
key
=
{
index
}
>
<
div
className
=
"item__con"
>
<
img
className
=
"user_avatar"
src
=
{
item
.
avatar
}
/
>
<
div
className
=
"user_name"
>
{
item
.
name
}
<
/div
>
<
img
className
=
"user_avatar"
src
=
{
item
.
head_image
}
/
>
<
div
className
=
"user_name"
>
{
item
.
user_
name
}
<
/div
>
<
/div
>
<
/div
>
)
...
...
src/components/blessingPreheat/collectBlessing/index.js
View file @
47114801
...
...
@@ -55,8 +55,7 @@ class CollectBlessing extends Component {
};
}
qqToShare
=
(
e
)
=>
{
e
.
preventDefault
();
qqToShare
=
()
=>
{
const
{
uid
,
history
}
=
this
.
props
;
if
(
getParam
(
'version'
))
{
if
(
!
uid
)
{
...
...
@@ -132,12 +131,13 @@ class CollectBlessing extends Component {
}
fetchUserBlessing
(
key
,
cb
)
{
const
{
handleToShowShare
,
handleToHideShare
}
=
this
.
props
;
const
{
handleToShowShare
}
=
this
.
props
;
let
{
seconds
}
=
this
.
state
;
http
.
get
(
`
${
API
.
home
}
/sys/user/blessing`
).
then
(
res
=>
{
const
{
code
,
data
}
=
res
.
data
;
if
(
code
===
200
)
{
if
(
data
.
today_shared_platforms
.
some
(
item
=>
item
===
key
))
{
handleToShowShare
();
Toast
.
info
(
'今日已分享,记得明天来~'
,
2
,
null
,
false
);
}
else
{
handleToShowShare
();
...
...
@@ -149,7 +149,6 @@ class CollectBlessing extends Component {
()
=>
{
if
(
seconds
===
0
)
{
typeof
cb
===
'function'
&&
cb
();
handleToHideShare
();
clearInterval
(
this
.
shareTimer
);
}
}
...
...
@@ -181,7 +180,11 @@ class CollectBlessing extends Component {
history
.
push
(
'/passport'
)
}
}
else
{
history
.
push
(
'/invite'
)
if
(
getParam
(
'version'
))
{
history
.
push
(
'/invite?version='
+
getParam
(
'version'
))
}
else
{
history
.
push
(
'/invite'
)
}
}
}
...
...
@@ -192,7 +195,6 @@ class CollectBlessing extends Component {
isLogin
,
handleToShowNotice
,
handleToShowList
,
handleToShow
,
toLogin
,
toSection
}
=
this
.
props
;
...
...
@@ -249,14 +251,14 @@ class CollectBlessing extends Component {
{
(
isLogin
&&
isSign
)
?
(
<
a
className
=
"collect-blessing__content"
data
-
status
=
"done"
>
<
button
className
=
"collect-blessing__content"
data
-
status
=
"done"
>
+
5
点
<
br
/>
福气值
<
/
a
>
<
/
button
>
)
:
(
<
spa
n
onClick
=
{
toLogin
}
className
=
"collect-blessing__content"
>
<
butto
n
onClick
=
{
toLogin
}
className
=
"collect-blessing__content"
>
点击
<
br
/>
签到
<
/
spa
n
>
<
/
butto
n
>
)
}
<
/
>
...
...
@@ -267,67 +269,64 @@ class CollectBlessing extends Component {
{
isFollow
===
1
?
(
<
a
className
=
"collect-blessing__content"
data
-
status
=
"done"
onClick
=
{
handleToShowNotice
}
>
<
button
className
=
"collect-blessing__content"
data
-
status
=
"done"
onClick
=
{
handleToShowNotice
}
>
已加
30
点
<
/
a
>
<
/
button
>
)
:
(
<
a
className
=
"collect-blessing__content"
onClick
=
{
handleToShowNotice
}
>
<
button
className
=
"collect-blessing__content"
onClick
=
{
handleToShowNotice
}
>
关注
<
br
/>
二维码
<
/
a
>
<
/
button
>
)
}
<
/
>
}
{
index
===
2
&&
<
div
className
=
"collect-blessing__content"
data
-
layout
=
"column"
>
<
p
className
=
"collect-blessing__label"
>
去分享
<
/p
>
<
div
className
=
"collect-blessing__share"
>
<
a
<
button
className
=
"collect-blessing__share-button"
data
-
type
=
"qq"
onClick
=
{
(
e
)
=>
this
.
qqToShare
(
e
)
}
><
/
a
>
<
a
onClick
=
{
this
.
qqToShare
}
><
/
button
>
<
button
className
=
"collect-blessing__share-button"
data
-
type
=
"wechat"
onClick
=
{
this
.
wechatToShare
}
><
/
a
>
<
a
><
/
button
>
<
button
className
=
"collect-blessing__share-button"
data
-
type
=
"weibo"
onClick
=
{
this
.
weiboToShare
}
><
/
a
>
><
/
button
>
<
/div
>
<
/div
>
}
{
index
===
3
&&
<
a
className
=
"collect-blessing__content"
onClick
=
{
handleToShowList
}
>
<
button
className
=
"collect-blessing__content"
onClick
=
{
handleToShowList
}
>
浏览课程
<
br
/>
详情页
<
/
a
>
<
/
button
>
}
{
index
===
4
&&
<
a
className
=
"collect-blessing__content"
onClick
=
{
this
.
handleToInvite
}
>
<
button
className
=
"collect-blessing__content"
onClick
=
{
this
.
handleToInvite
}
>
<
span
>
邀请链接
<
/span
>
{
inviteBlessing
>
0
&&
<
i
>
已加
{
inviteBlessing
}
点
<
/i
>
}
<
/
a
>
<
/
button
>
}
{
index
===
5
&&
<
a
className
=
"collect-blessing__content"
onClick
=
{
toSection
}
>
<
button
className
=
"collect-blessing__content"
onClick
=
{
toSection
}
>
<
span
>
去选课
<
/span
>
{
buyBlessing
>
0
&&
<
i
>
已加
{
buyBlessing
}
点
<
/i
>
}
<
/
a
>
<
/
button
>
}
<
/div
>
))
...
...
src/components/blessingPreheat/collectBlessing/index.scss
View file @
47114801
...
...
@@ -47,6 +47,7 @@
justify-content
:
center
;
width
:
64px
;
height
:
100%
;
border-style
:
none
;
border-radius
:
5px
;
font-size
:
12px
;
color
:
#fff
;
...
...
@@ -81,6 +82,8 @@
display
:
block
;
width
:
20px
;
height
:
11px
;
border-style
:
none
;
background-color
:
transparent
;
background-size
:
auto
100%
;
background-repeat
:
no-repeat
;
background-position
:
center
;
...
...
src/components/blessingPreheat/index.js
View file @
47114801
...
...
@@ -16,7 +16,6 @@ import LevelTest from './levelTest/index'
import
RankList
from
'./rankList/index'
import
'./index.scss'
import
{
Popup
}
from
'@/common'
import
{
CopyToClipboard
}
from
'react-copy-to-clipboard'
import
{
Toast
}
from
"antd-mobile"
import
Live
from
'./live'
import
Banner
from
'./banner'
...
...
@@ -82,7 +81,9 @@ class BlessingPreheat extends Component {
],
index
:
0
,
userHasError
:
props
.
user
.
hasError
,
isApp
:
false
isApp
:
false
,
isClose
:
false
,
testSum
:
0
,
}
}
...
...
@@ -232,9 +233,11 @@ class BlessingPreheat extends Component {
http
.
get
(
`
${
API
.
home
}
/sys/user/blessing`
).
then
(
res
=>
{
const
{
code
,
data
}
=
res
.
data
if
(
code
===
200
)
{
console
.
log
(
data
.
user_test_total
);
this
.
setState
({
isSign
:
!!
data
.
today_signed
,
isFormal
:
data
.
is_activity
,
testSum
:
parseInt
(
data
.
user_test_total
,
10
)
||
0
,
userInfo
:
Object
.
assign
({},
userInfo
,
{
isFollow
:
data
.
subscribed
,
blessingVal
:
data
.
user_blessing_value
,
...
...
@@ -298,6 +301,16 @@ class BlessingPreheat extends Component {
if
(
isLogin
&&
!
isLoginnew
)
{
this
.
toLogin
()
}
else
{
if
(
key
===
'shareMark'
)
{
this
.
setState
({
isClose
:
false
});
setTimeout
(()
=>
{
this
.
setState
({
isClose
:
true
});
},
5000
);
}
let
obj
=
{}
obj
[
key
]
=
true
this
.
setState
({
...
...
@@ -308,7 +321,7 @@ class BlessingPreheat extends Component {
handleToShowNotice
=
()
=>
{
http
.
get
(
`
${
API
[
'base-api'
]}
/sys/activity/create_blessing_qrcode`
).
then
(
res
=>
{
const
{
errno
,
data
}
=
res
.
data
const
{
errno
,
data
,
msg
}
=
res
.
data
;
if
(
errno
===
200
)
{
QRCode
.
toDataURL
(
data
.
url
,
{
width
:
120
,
...
...
@@ -326,6 +339,8 @@ class BlessingPreheat extends Component {
})
}
else
if
(
errno
===
4030
||
errno
===
4040
)
{
this
.
toLogin
()
}
else
{
Toast
.
info
(
msg
,
2
,
null
,
false
);
}
})
}
...
...
@@ -407,8 +422,11 @@ class BlessingPreheat extends Component {
showRecordList
,
shareMark
,
index
,
isApp
}
=
this
.
state
isApp
,
isClose
,
testSum
}
=
this
.
state
;
console
.
log
(
testSum
);
const
{
history
}
=
this
.
props
const
isLogin
=
!
this
.
props
.
user
.
hasError
return
(
...
...
@@ -432,10 +450,8 @@ class BlessingPreheat extends Component {
toSection
=
{(
e
)
=>
this
.
toSection
(
this
.
fetchMoudleId
(
'best-courses'
),
e
)}
handleToShowList
=
{()
=>
this
.
handleToShow
(
'isCourse'
)}
handleToShowNotice
=
{
this
.
handleToShowNotice
}
handleToShow
=
{
this
.
handleToShow
}
toLogin
=
{
this
.
toLogin
}
handleToShowShare
=
{()
=>
this
.
handleToShow
(
'shareMark'
)}
handleToHideShare
=
{()
=>
this
.
handleToHide
(
'shareMark'
)}
/
>
{
/* 幸运大抽奖--预热 */
}
...
...
@@ -478,7 +494,7 @@ class BlessingPreheat extends Component {
}
{
shareMark
&&
<
SharePopup
/>
<
SharePopup
isClose
=
{
isClose
}
toClose
=
{()
=>
this
.
handleToHide
(
'shareMark'
)}
/
>
}
{
/*
...
...
@@ -514,7 +530,12 @@ class BlessingPreheat extends Component {
<
div
className
=
"test__record"
onClick
=
{()
=>
this
.
handleToShow
(
'showRecordList'
,
true
)}
>
测试记录
>
<
/div
>
<
LevelTest
history
=
{
history
}
isLogin
=
{
isLogin
}
toLogin
=
{
this
.
toLogin
}
><
/LevelTest
>
<
LevelTest
history
=
{
history
}
testSum
=
{
testSum
}
isLogin
=
{
isLogin
}
toLogin
=
{
this
.
toLogin
}
/
>
<
RankList
><
/RankList
>
...
...
src/components/blessingPreheat/levelTest/index.js
View file @
47114801
...
...
@@ -7,7 +7,7 @@ class LevelTest extends Component {
constructor
(
props
)
{
super
(
props
);
this
.
state
=
{
testNumber
:
12345
,
testNumber
:
''
,
number
:
1
,
prizeListUrl
:
[
{
...
...
@@ -70,7 +70,7 @@ class LevelTest extends Component {
number
,
prizeListUrl
,
}
=
this
.
state
;
const
{
isLogin
}
=
this
.
props
;
const
{
isLogin
,
testSum
}
=
this
.
props
;
return
(
<>
<
div
className
=
"level__test_module"
>
...
...
@@ -83,7 +83,7 @@ class LevelTest extends Component {
<
div
className
=
'test__number'
>
已有
<
span
className
=
'number'
>
{
testNumber
}
{
testNumber
||
testSum
}
<
/span
>
人参加测试
<
/div
>
...
...
src/components/blessingPreheat/sharePopup/index.js
View file @
47114801
...
...
@@ -5,7 +5,11 @@ import './index.scss'
export
default
class
SharePopup
extends
Component
{
render
()
{
return
(
<
div
className
=
"share__container"
>
<
div
className
=
"share__container"
onClick
=
{()
=>
{
if
(
this
.
props
.
isClose
)
{
this
.
props
.
toClose
();
}
}}
>
{
browser
.
isWeixin
&&
<
div
className
=
"share__row"
>
...
...
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