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
b5e8238a
Commit
b5e8238a
authored
Sep 20, 2019
by
xuzhenghua
Browse files
Options
Browse Files
Download
Plain Diff
pull
parents
99a7da27
3100b704
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
5 deletions
+39
-5
src/components/detail/btnstatus/index.js
+14
-5
src/components/detail/redPacket/index.js
+25
-0
No files found.
src/components/detail/btnstatus/index.js
View file @
b5e8238a
...
...
@@ -214,6 +214,16 @@ class BtnStatus extends Component {
}
}
// 开始学习
toStudy
=
(
vCourseId
,
isHaveVideo
)
=>
{
const
{
history
}
=
this
.
props
;
if
(
isHaveVideo
==
0
){
Toast
.
info
(
'尚未开课,开课后立即上传课程~'
,
2
)
}
else
{
history
.
push
(
`/play/video?id=
${
vCourseId
}
`
)
}
}
//获取砍价信息
getBargainInfo
=
()
=>
{
...
...
@@ -269,7 +279,9 @@ class BtnStatus extends Component {
<
i
className
=
'iconfont iconerji'
/>
<
span
>
课程咨询
<
/span
>
<
/a
>
<
Link
to
=
{
`/play/video?id=
${
info
.
v_course_id
}
`
}
className
=
'btn btn-m bg-09f'
>
开始学习
<
/Link
>
<
a
className
=
'btn btn-m bg-09f'
onClick
=
{()
=>
this
.
toStudy
(
info
.
v_course_id
,
info
.
is_have_video
)}
>
开始学习
<
/a
>
<
/div
>
}
{
/*拼团 未开团*/
}
...
...
@@ -372,10 +384,7 @@ class BtnStatus extends Component {
{
info
.
aist_start_time
===
""
?
(
<
Link
to
=
{
`/play/video?id=
${
info
.
v_course_id
}
`
}
className
=
'btn btn-m learn-now'
>
<
span
>
开始学习
<
/span
>
<
/Link
>
<
a
className
=
'btn btn-m bg-09f'
onClick
=
{()
=>
this
.
toStudy
(
info
.
v_course_id
,
info
.
is_have_video
)}
>
开始学习
<
/a
>
)
:
(
<
button
className
=
'btn btn-m wait-open'
>
<
span
>
{
this
.
formatDate
(
info
.
aist_start_time
)}
<
/span
>
...
...
src/components/detail/redPacket/index.js
View file @
b5e8238a
...
...
@@ -9,6 +9,7 @@ import { Toast } from 'antd-mobile';
import
Captcha
from
'@/common/Captcha'
;
import
FollowQRcode
from
'./../followQRcode'
;
import
'./index.scss'
;
import
cookie
from
'js-cookie'
class
RedPacket
extends
PureComponent
{
...
...
@@ -54,9 +55,16 @@ class RedPacket extends PureComponent {
// 分享链接进入
this
.
judgePopupType
();
window
.
addEventListener
(
'beforeunload'
,
this
.
removeStatisticsCookie
)
// 微信进入
const
isWechat
=
getParam
(
'wechat'
);
const
{
userInfo
}
=
this
.
props
;
if
(
!
userInfo
||
!
userInfo
.
uid
)
{
this
.
setRelativeCookie
()
}
if
(
isWechat
===
'1'
&&
!
browser
.
isWeixin
)
{
if
(
userInfo
&&
userInfo
.
uid
)
{
const
type
=
window
.
localStorage
.
getItem
(
'redpacket-click'
);
...
...
@@ -95,6 +103,7 @@ class RedPacket extends PureComponent {
window
.
localStorage
.
removeItem
(
'redpacket-click'
);
}
}
else
{
this
.
setRelativeCookie
()
this
.
setState
({
type
:
1
});
...
...
@@ -103,6 +112,15 @@ class RedPacket extends PureComponent {
this
.
fetchShareInfo
();
}
removeStatisticsCookie
=
()
=>
{
cookie
.
remove
(
'share_code'
,
{
path
:
'/'
,
domain
:
'.julyedu.com'
})
}
componentWillUnmount
()
{
window
.
removeEventListener
(
'beforeunload'
,
this
.
removeStatisticsCookie
)
}
// 获取分享信息
fetchShareInfo
=
()
=>
{
...
...
@@ -582,6 +600,13 @@ class RedPacket extends PureComponent {
});
}
//设置统计信息
setRelativeCookie
=
()
=>
{
const
config
=
{
path
:
'/'
,
domain
:
'.julyedu.com'
}
cookie
.
set
(
'share_code'
,
getParam
(
'share_code'
)
?
getParam
(
'share_code'
)
:
'share_code'
,
config
)
}
render
()
{
// console.log(this.props);
const
{
history
,
userInfo
}
=
this
.
props
;
...
...
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