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
c33f67a4
Commit
c33f67a4
authored
Sep 20, 2019
by
FE
Browse files
Options
Browse Files
Download
Plain Diff
pull and solve
parents
4eff0815
201cb0a9
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
138 additions
and
84 deletions
+138
-84
src/App.js
+18
-8
src/components/Index/index.scss
+3
-1
src/components/detail/btnstatus/index.js
+14
-5
src/components/detail/index.js
+20
-9
src/components/detail/redPacket/index.js
+25
-0
src/components/my/index.js
+1
-0
src/components/order/index.js
+47
-47
src/components/passport/accountLogin/index.js
+3
-7
src/components/passport/common/veriCodeInput/veri-code-input.scss
+0
-1
src/components/purchased/index.js
+2
-2
src/components/scholarship/index.js
+1
-0
src/components/study/myCourses/index.js
+2
-2
src/store/userAction.js
+2
-2
No files found.
src/App.js
View file @
c33f67a4
import
React
,
{
Component
}
from
'react'
import
React
,
{
Component
}
from
'react'
import
Routes
from
'./router'
import
cookie
from
'js-cookie'
import
{
connect
}
from
"react-redux"
;
import
{
setCurrentUser
,
startFetchUser
}
from
"@/store/userAction"
;
import
{
withRouter
}
from
'react-router-dom'
import
{
compose
}
from
'redux'
import
{
getParam
,
http
,
browser
}
from
"@/utils"
;
import
{
Toast
}
from
"antd-mobile"
;
import
{
addDays
}
from
'date-fns'
import
{
connect
}
from
"react-redux"
;
import
{
setCurrentUser
,
startFetchUser
}
from
"@/store/userAction"
;
import
{
withRouter
}
from
'react-router-dom'
import
{
compose
}
from
'redux'
import
{
getParam
,
http
,
browser
}
from
"@/utils"
;
import
{
Toast
}
from
"antd-mobile"
;
import
{
addDays
}
from
'date-fns'
//拦截ajax请求,返回mock数据
...
...
@@ -70,12 +70,18 @@ class App extends Component {
return
}
location
.
state
=
{
from
:
this
.
previousLocation
};
}
else
{
this
.
removeShareCodeCookie
()
}
})
}
removeShareCodeCookie
=
()
=>
{
cookie
.
remove
(
'share_code'
,
{
path
:
'/'
,
domain
:
'.julyedu.com'
})
}
setNavigationRecord
=
(
location
)
=>
{
let
{
location
:
_location
}
=
this
.
props
let
{
state
:
_state
=
{}}
=
_location
...
...
@@ -165,6 +171,8 @@ class App extends Component {
transformUser
=
res
=>
{
let
payload
if
(
res
.
data
.
code
===
200
)
{
//移除红包统计cookie
this
.
removeShareCodeCookie
()
const
{
msg
,
data
:
{
avatar_file
:
avatar
,
...
...
@@ -200,6 +208,8 @@ class App extends Component {
transformWxUser
=
res
=>
{
let
data
=
res
.
data
if
(
data
.
errno
==
200
)
{
//移除红包统计cookie
this
.
removeShareCodeCookie
()
let
{
uid
,
token
,
avatar_file
:
avatar
,
uname
:
username
,}
=
data
.
data
return
{
...
...
src/components/Index/index.scss
View file @
c33f67a4
...
...
@@ -8,6 +8,8 @@
height
:
44px
;
background-color
:
$bg_fff
;
padding
:
10px
15px
;
position
:
fixed
;
z-index
:
52
;
.logo
{
width
:
78px
;
...
...
@@ -37,7 +39,7 @@
}
.index-swiper
{
//margin-top: 7
px;
margin-top
:
44
px
;
height
:
168px
;
.swiper-container
{
...
...
src/components/detail/btnstatus/index.js
View file @
c33f67a4
...
...
@@ -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/index.js
View file @
c33f67a4
...
...
@@ -486,23 +486,34 @@ class Detail extends Component {
<
span
className
=
"old"
>
¥
{
course_info
.
price0
}
<
/span
>
<
/p
>
}
{
course_info
.
is_baoming
===
1
&&
<
span
className
=
"isbuy"
>
已购买
<
/span
>
}
{
/*{*/
}
{
/*course_info.is_baoming === 1 &&*/
}
{
/*<span className="isbuy">已购买</span>*/
}
{
/*}*/
}
<
/div
>
<
/div
>
<
/div
>
{
/*正常课程已购买时显示*/
}
{
/*
没有权限:不显示
vip及赠课:显示黄的
不在vip范围内,单独购买:显示蓝的
单独买了课然后买了vip:显示蓝的
vip_range是vip里买的课,而且买了vip才会返回时间
is_pay 1是单独购买 0是买vip赠的
is_vip 1是属于vip赠的 0是不在vip范围内的
*/
}
{
course_info
.
is_baoming
===
1
&&
course_info
.
contact_type
==
1
&&
course_info
.
is_baoming
===
1
&&
course_info
.
is_pay
==
1
&&
course_info
.
contact_type
==
1
&&
course_info
.
course_qq
&&
<
div
className
=
'group'
>
上课
QQ
群:
{
course_info
.
course_qq
}
,加群请备注您的学号:
{
course_info
.
uid
}
<
/div
>
}
{
course_info
.
is_baoming
===
1
&&
course_info
.
contact_type
==
2
&&
course_info
.
is_baoming
===
1
&&
course_info
.
is_pay
==
1
&&
course_info
.
contact_type
==
2
&&
course_info
.
course_qq
&&
<
div
className
=
'group'
>
请添加班主任微信:
{
course_info
.
course_qq
}
,添加时备注学号:
{
course_info
.
uid
}
<
/div
>
...
...
@@ -511,14 +522,14 @@ class Detail extends Component {
{
/*vip课程显示*/
}
{
course_info
.
vip_range
&&
course_info
.
contact_type
==
1
&&
course_info
.
vip_range
&&
course_info
.
is_vip
==
1
&&
course_info
.
is_pay
==
0
&&
course_info
.
contact_type
==
1
&&
course_info
.
course_qq
&&
<
div
className
=
"vip"
>
<
p
>
已开通年会员:
{
course_info
.
vip_range
}
<
/p
>
<
p
>
年会员
QQ
群:
{
course_info
.
course_qq
}
,加群请备注您的学号:
{
course_info
.
uid
}
<
/p
>
<
p
>
上课
QQ
群:
{
course_info
.
course_qq
}
,加群请备注您的学号:
{
course_info
.
uid
}
<
/p
>
<
/div
>
}
{
course_info
.
vip_range
&&
course_info
.
contact_type
==
2
&&
course_info
.
vip_range
&&
course_info
.
is_vip
==
1
&&
course_info
.
is_pay
==
0
&&
course_info
.
contact_type
==
2
&&
course_info
.
course_qq
&&
<
div
className
=
"vip"
>
<
p
>
已开通年会员:
{
course_info
.
vip_range
}
<
/p
>
<
p
>
请添加班主任微信:
{
course_info
.
course_qq
}
,添加时备注学号:
{
course_info
.
uid
}
<
/p
>
...
...
src/components/detail/redPacket/index.js
View file @
c33f67a4
...
...
@@ -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
;
...
...
src/components/my/index.js
View file @
c33f67a4
...
...
@@ -42,6 +42,7 @@ class My extends PureComponent {
const
username
=
user
&&
user
.
data
&&
user
.
data
.
username
const
avatar
=
user
&&
user
.
data
&&
user
.
data
.
avatar
const
isVIP
=
user
&&
user
.
data
&&
user
.
data
.
isVIP
let
list
if
(
!
uid
)
{
list
=
<
List
className
=
"my-list"
>
...
...
src/components/order/index.js
View file @
c33f67a4
...
...
@@ -76,16 +76,16 @@ function OrderList(props) {
}}}
>
{
/* <Link to='coupons' query={{id: course_id}} state={{from: '/order'}}> */
}
<
Flex
justify
=
'between'
>
<
span
style
=
{{
color
:
'#333'
,
fontSize
:
'15px'
<
span
style
=
{{
color
:
'#333'
,
fontSize
:
'15px'
}}
>
优惠券
<
/span
>
<
span
style
=
{{
fontSize
:
'14px'
,
color
:
'#999999'
<
span
style
=
{{
fontSize
:
'14px'
,
color
:
'#999999'
}}
>
{
!
coupon_desc
?
(
coupon_num
===
0
?
'无'
:
`
${
coupon_num
}
张可用`
)
:
(
coupon_desc
)}
...
...
@@ -415,48 +415,48 @@ class Order extends Component {
<
Flex
>
<
Flex
.
Item
>
<
HeaderBar
title
=
'课程报名'
arrow
=
{
true
}
/
>
{
!
this
.
state
.
perfect
&&
<
Link
to
=
{{
pathname
:
'/orderinfo'
,
state
:
{
type
:
this
.
props
.
location
.
state
?
this
.
props
.
location
.
state
.
type
:
null
,
id
:
getParam
(
'id'
)
}
}
}
className
=
"order-information"
>
<
i
className
=
"iconfont iconiconfront-6 order-addsize"
/>
<
div
className
=
"order-infotext"
>
完善报名信息
<
/div
>
<
i
className
=
"iconfont iconiconfront-70 order-next"
/>
<
/Link
>
}
{
this
.
state
.
perfect
&&
<
div
className
=
"order-information2"
>
<
WingBlank
>
<
Link
to
=
{{
pathname
:
'/orderinfo'
,
state
:
{
...
this
.
state
.
perfect
,
...
this
.
props
.
location
.
state
,
id
:
getParam
(
'id'
)
}
}
}
>
<
Flex
align
=
'center'
justify
=
'between'
style
=
{{
height
:
'80px'
}}
>
<
i
className
=
"iconfont iconiconfront-20 user-icon"
><
/i
>
{
/*{*/
}
{
/*!this.state.perfect &&*/
}
{
/*<Link to={{*/
}
{
/*pathname: '/orderinfo',*/
}
{
/*state: {type: this.props.location.state ? this.props.location.state.type : null, id: getParam('id')}*/
}
{
/*}}*/
}
{
/*className="order-information">*/
}
{
/*<i className="iconfont iconiconfront-6 order-addsize" />*/
}
{
/*<div className="order-infotext">完善报名信息</div>*/
}
{
/*<i className="iconfont iconiconfront-70 order-next" />*/
}
{
/*</Link>*/
}
{
/*}*/
}
{
/*{*/
}
{
/*this.state.perfect &&*/
}
{
/*<div className="order-information2">*/
}
{
/*<WingBlank>*/
}
{
/*<Link to={{*/
}
{
/*pathname: '/orderinfo',*/
}
{
/*state: {*/
}
{
/*...this.state.perfect,*/
}
{
/*...this.props.location.state,*/
}
{
/*id: getParam('id')*/
}
{
/*}*/
}
{
/*}*/
}
{
/*} >*/
}
{
/*<Flex align='center' justify='between' style={{ height: '80px' }}>*/
}
{
/*<i className="iconfont iconiconfront-20 user-icon"></i>*/
}
<
Flex
direction
=
'column'
justify
=
'between'
align
=
'start'
className
=
"order-cell"
>
<
div
className
=
"name"
>
{
`姓名:
${
perfect
.
real_name
}
`
}
<
/div
>
<
div
>
{
`电话:
${
perfect
.
cellphone
}
`
}
<
/div
>
<
/Flex
>
{
/*<Flex direction='column' justify='between' align='start' className="order-cell">*/
}
{
/*<div className="name">{`姓名:${perfect.real_name}`}</div>*/
}
{
/*<div>{`电话:${perfect.cellphone}`}</div>*/
}
{
/*</Flex>*/
}
<
Flex
align
=
'start'
className
=
"order-cell"
>
<
div
>
{
`QQ:
${
perfect
.
qq
}
`
}
<
/div
>
<
/Flex
>
{
/*<Flex align='start' className="order-cell">*/
}
{
/*<div>{`QQ:${perfect.qq}`}</div>*/
}
{
/*</Flex>*/
}
<
/Flex
>
<
/Link
>
<
/WingBlank
>
<
/div
>
}
{
/*</Flex>*/
}
{
/*</Link>*/
}
{
/*</WingBlank>*/
}
{
/*</div>*/
}
{
/*}*/
}
<
div
className
=
"order-list"
>
<
OrderList
list
=
{
orderList
}
...
...
src/components/passport/accountLogin/index.js
View file @
c33f67a4
...
...
@@ -74,15 +74,11 @@ const formikConfig = {
const
{
props
,
props
:
{
history
}}
=
formikBag
props
.
accountLogin
({
username
,
password
})
/*.then(res => {
if (!res.hasError) {
let {from} = props.location.state || {from: {pathname: '/', search: ''}}
console.log(from, 'account');
history.replace({pathname: from.pathname, search: from.search || ''})
} else {
}).
then
(
res
=>
{
if
(
res
.
hasError
)
{
Toast
.
info
(
res
.
msg
,
2
,
null
,
false
)
}
})
*/
})
}
}
...
...
src/components/passport/common/veriCodeInput/veri-code-input.scss
View file @
c33f67a4
...
...
@@ -3,7 +3,6 @@
right
:
6px
;
top
:
50%
;
transform
:
translateY
(
-50%
);
width
:
84px
;
height
:
21px
;
padding-left
:
7px
;
border
:
none
;
...
...
src/components/purchased/index.js
View file @
c33f67a4
...
...
@@ -70,11 +70,11 @@ class Purchased extends Component {
<
div
className
=
'des'
>
助教微信:
{
item
.
assist_weixin
}
<
/div
>
}
{
!
item
.
is_aist
&&
item
.
contact_type
==
1
&&
!
item
.
is_aist
&&
item
.
contact_type
==
1
&&
item
.
course_qq
&&
<
div
className
=
'des'
>
QQ
群:
{
item
.
course_qq
}
<
/div
>
}
{
!
item
.
is_aist
&&
item
.
contact_type
==
2
&&
!
item
.
is_aist
&&
item
.
contact_type
==
2
&&
item
.
course_qq
&&
<
div
className
=
'des'
>
班主任微信:
{
item
.
course_qq
}
<
/div
>
}
<
/div
>
...
...
src/components/scholarship/index.js
View file @
c33f67a4
...
...
@@ -295,6 +295,7 @@ class _Scholarship extends Component {
<
div
style
=
{{
backgroundColor
:
'#FFF'
}}
>
<
Tabs
tabs
=
{
this
.
tabList
}
initialPage
=
{
0
}
swipeable
=
{
false
}
// onChange={this.changeTab}
onChange
=
{(
tab
,
index
)
=>
{
this
.
tabIndex
=
index
;
...
...
src/components/study/myCourses/index.js
View file @
c33f67a4
...
...
@@ -127,11 +127,11 @@ class MyCourses extends Component {
<
div
className
=
'contact'
>
助教微信:
{
item
.
assist_weixin
}
<
/div
>
}
{
!
item
.
is_aist
&&
item
.
contact_type
==
1
&&
!
item
.
is_aist
&&
item
.
contact_type
==
1
&&
item
.
course_qq
&&
<
div
className
=
'contact'
>
QQ
群:
{
item
.
course_qq
}
<
/div
>
}
{
!
item
.
is_aist
&&
item
.
contact_type
==
2
&&
!
item
.
is_aist
&&
item
.
contact_type
==
2
&&
item
.
course_qq
&&
<
div
className
=
'contact'
>
班主任微信:
{
item
.
course_qq
}
<
/div
>
}
...
...
src/store/userAction.js
View file @
c33f67a4
...
...
@@ -24,11 +24,11 @@ const storeUser = (res, dispatch) => {
const
data
=
res
.
data
let
payload
if
(
data
.
errno
===
0
)
{
const
{
user_name
:
username
,
avatar_file
:
avatar
,
...
rest
}
=
data
.
data
.
user_info
const
{
user_name
:
username
,
avatar_file
:
avatar
,
is_vip
:
isVIP
,
...
rest
}
=
data
.
data
.
user_info
payload
=
{
hasError
:
false
,
msg
:
data
.
msg
,
data
:
{
username
,
avatar
,
...
rest
}
data
:
{
username
,
avatar
,
isVIP
,
...
rest
}
}
}
else
{
payload
=
{
...
...
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