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
a8c5d649
Commit
a8c5d649
authored
Sep 27, 2019
by
FE
Browse files
Options
Browse Files
Download
Plain Diff
del build
parents
1a7f8849
241193c5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
470 additions
and
254 deletions
+470
-254
package-lock.json
+5
-22
src/App.js
+53
-56
src/common/CallApp/index.js
+0
-6
src/common/VList/index.js
+3
-2
src/components/bargainMiddlePage/barcode/index.js
+0
-1
src/components/coupons/Coupon/index.js
+14
-1
src/components/coupons/myCoupons/index.js
+99
-31
src/components/coupons/myCoupons/index.scss
+106
-21
src/components/detail/index.js
+15
-2
src/components/detail/outline/index.js
+0
-0
src/components/my/edit.js
+1
-1
src/components/passport/index.js
+26
-19
src/components/preferential/index.js
+60
-54
src/components/purchased/index.js
+5
-0
src/components/purchased/index.scss
+15
-1
src/components/scholarship/index.js
+43
-32
src/components/study/myCourses/index.js
+5
-0
src/components/study/myCourses/my-courses.scss
+15
-0
src/router/route-middle-page.js
+3
-3
src/router/router-config.js
+2
-2
No files found.
package-lock.json
View file @
a8c5d649
...
...
@@ -3692,6 +3692,11 @@
"resolved"
:
"https://registry.npmjs.org/cli-width/-/cli-width-2.2.0.tgz"
,
"integrity"
:
"sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk="
},
"clipboard-copy"
:
{
"version"
:
"3.1.0"
,
"resolved"
:
"https://registry.npmjs.org/clipboard-copy/-/clipboard-copy-3.1.0.tgz"
,
"integrity"
:
"sha512-Xsu1NddBXB89IUauda5BIq3Zq73UWkjkaQlPQbLNvNsd5WBMnTWPNKYR6HGaySOxGYZ+BKxP2E9X4ElnI3yiPA=="
},
"cliui"
:
{
"version"
:
"4.1.0"
,
"resolved"
:
"https://registry.npmjs.org/cliui/-/cliui-4.1.0.tgz"
,
...
...
@@ -3984,14 +3989,6 @@
"resolved"
:
"https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz"
,
"integrity"
:
"sha1-Z29us8OZl8LuGsOpJP1hJHSPV40="
},
"copy-to-clipboard"
:
{
"version"
:
"3.2.0"
,
"resolved"
:
"https://registry.npmjs.org/copy-to-clipboard/-/copy-to-clipboard-3.2.0.tgz"
,
"integrity"
:
"sha512-eOZERzvCmxS8HWzugj4Uxl8OJxa7T2k1Gi0X5qavwydHIfuSHq2dTD09LOg/XyGq4Zpb5IsR/2OJ5lbOegz78w=="
,
"requires"
:
{
"toggle-selection"
:
"^1.0.6"
}
},
"core-js"
:
{
"version"
:
"2.6.5"
,
"resolved"
:
"https://registry.npmjs.org/core-js/-/core-js-2.6.5.tgz"
,
...
...
@@ -12087,15 +12084,6 @@
}
}
},
"react-copy-to-clipboard"
:
{
"version"
:
"5.0.1"
,
"resolved"
:
"https://registry.npmjs.org/react-copy-to-clipboard/-/react-copy-to-clipboard-5.0.1.tgz"
,
"integrity"
:
"sha512-ELKq31/E3zjFs5rDWNCfFL4NvNFQvGRoJdAKReD/rUPA+xxiLPQmZBZBvy2vgH7V0GE9isIQpT9WXbwIVErYdA=="
,
"requires"
:
{
"copy-to-clipboard"
:
"^3"
,
"prop-types"
:
"^15.5.8"
}
},
"react-dev-utils"
:
{
"version"
:
"8.0.0"
,
"resolved"
:
"https://registry.npmjs.org/react-dev-utils/-/react-dev-utils-8.0.0.tgz"
,
...
...
@@ -14514,11 +14502,6 @@
"repeat-string"
:
"^1.6.1"
}
},
"toggle-selection"
:
{
"version"
:
"1.0.6"
,
"resolved"
:
"https://registry.npmjs.org/toggle-selection/-/toggle-selection-1.0.6.tgz"
,
"integrity"
:
"sha1-bkWxJj8gF/oKzH2J14sVuL932jI="
},
"topo"
:
{
"version"
:
"2.0.2"
,
"resolved"
:
"https://registry.npmjs.org/topo/-/topo-2.0.2.tgz"
,
...
...
src/App.js
View file @
a8c5d649
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数据
...
...
@@ -16,39 +16,26 @@ mock()*/
// 默认样式
import
'./assets/css/index.scss'
;
import
'./assets/css/index.scss'
// iconfont
import
'./assets/font/iconfont.css'
;
import
'./assets/font/iconfont.css'
class
App
extends
Component
{
previousLocation
=
{
...{
state
:
{
from
:
{
pathname
:
this
.
props
.
location
.
pathname
,
search
:
this
.
props
.
location
.
search
,
hash
:
this
.
props
.
location
.
hash
}
}
},
...
this
.
props
.
location
}
static
displayName
=
'App'
previousLocation
=
{
pathname
:
'/'
,
search
:
''
,
hash
:
''
}
records
=
[]
pathnameBlacklist
=
[
'/country'
,
'/passport'
]
firstLoad
=
true
componentDidMount
()
{
// 友盟统计
const
script
=
document
.
createElement
(
'script'
);
script
.
src
=
'https://s22.cnzz.com/z_stat.php?id=1265696973&web_id=1265696973'
;
script
.
language
=
'JavaScript'
;
document
.
body
.
appendChild
(
script
);
this
.
setNavigationRecord
(
this
.
props
.
location
,
this
.
props
.
history
.
action
)
this
.
umengStatistic
()
//平台信息
...
...
@@ -57,23 +44,37 @@ class App extends Component {
if
(
browser
.
isWeixin
&&
browser
.
isIOS
)
{
sessionStorage
.
setItem
(
'enter_url'
,
window
.
location
.
href
)
}
this
.
getUser
()
this
.
utm
()
const
routeMatchRule
=
/binding-tel|forgot|set-password/
const
{
history
}
=
this
.
props
this
.
setNavigationRecord
(
this
.
props
.
location
,
this
.
props
.
history
.
action
)
this
.
setPreviousLocation
()
history
.
listen
((
location
,
action
)
=>
{
this
.
utm
()
this
.
firstLoad
=
false
this
.
setNavigationRecord
(
location
,
action
)
this
.
utm
()
if
(
cookie
.
get
(
'uid'
)
&&
this
.
props
.
user
.
hasError
)
{
this
.
getUser
()
}
const
{
pathname
}
=
location
const
{
pathname
,
state
}
=
location
if
(
pathname
.
startsWith
(
'/passport'
))
{
if
(
routeMatchRule
.
test
(
pathname
))
{
return
location
.
state
=
{
...
state
,
...{
from
:
{
pathname
:
this
.
previousLocation
.
pathname
,
search
:
this
.
previousLocation
.
search
,
hash
:
this
.
previousLocation
.
hash
}
}
}
location
.
state
=
{...
location
.
state
,
...{
from
:
this
.
previousLocation
}};
}
else
{
this
.
removeShareCodeCookie
()
}
...
...
@@ -82,6 +83,14 @@ class App extends Component {
}
umengStatistic
=
()
=>
{
// 友盟统计
const
script
=
document
.
createElement
(
'script'
)
script
.
src
=
'https://s22.cnzz.com/z_stat.php?id=1265696973&web_id=1265696973'
script
.
language
=
'JavaScript'
document
.
body
.
appendChild
(
script
)
}
removeShareCodeCookie
=
()
=>
{
cookie
.
remove
(
'share_code'
,
{
path
:
'/'
,
domain
:
'.julyedu.com'
})
}
...
...
@@ -89,6 +98,7 @@ class App extends Component {
setNavigationRecord
=
(
location
,
action
)
=>
{
const
{
pathname
,
search
,
hash
}
=
location
let
isLastRecord
=
location
.
pathname
===
(
this
.
records
.
length
&&
this
.
records
[
this
.
records
.
length
-
1
].
pathname
)
switch
(
action
)
{
case
'POP'
:
this
.
firstLoad
?
this
.
records
.
push
({
pathname
,
search
,
hash
})
:
this
.
records
.
pop
()
...
...
@@ -102,7 +112,7 @@ class App extends Component {
location
.
state
&&
location
.
state
.
records
?
(
location
.
state
.
records
=
this
.
records
)
:
location
.
state
?
location
.
state
=
{...
location
.
state
,
records
:
this
.
records
}
:
location
.
state
?
location
.
state
=
{...
location
.
state
,
records
:
this
.
records
}
:
(
location
.
state
=
{
records
:
this
.
records
})
}
...
...
@@ -133,7 +143,7 @@ class App extends Component {
}
getUser
=
()
=>
{
//获取用户信息
this
.
props
.
startFetchUser
()
http
.
get
(
`
${
API
.
home
}
/m/user_info`
).
then
(
res
=>
{
this
.
props
.
setCurrentUser
(
this
.
transformUser
(
res
))
...
...
@@ -170,30 +180,17 @@ class App extends Component {
componentDidUpdate
()
{
this
.
setPreviousLocation
()
if
(
!
this
.
props
.
user
.
hasError
&&
getParam
(
'redirect'
))
{
window
.
location
.
href
=
getParam
(
'redirect'
)
}
}
setPreviousLocation
=
()
=>
{
const
{
location
,
history
:
{
action
}}
=
this
.
props
if
(
location
.
pathname
.
startsWith
(
'/passport'
))
{
/*let index = this.records.findIndex(item => item.pathname.startsWith('/passport'))
this.previousLocation = index > 0
? this.records[index - 1]
: this.records.length
? this.records[this.records.length - 1]
: null*/
}
else
{
if
(
action
===
'POP'
||
action
===
'REPLACE'
)
{
let
index
=
this
.
records
.
findIndex
(
item
=>
item
.
pathname
.
startsWith
(
'/passport'
))
this
.
previousLocation
=
index
>
0
?
this
.
records
[
index
-
1
]
:
this
.
records
[
this
.
records
.
length
-
1
]
}
else
{
this
.
previousLocation
=
location
}
}
const
{
location
}
=
this
.
props
let
isInBlacklist
=
this
.
pathnameBlacklist
.
some
(
item
=>
location
.
pathname
.
startsWith
(
item
))
!
isInBlacklist
&&
(
this
.
previousLocation
=
location
)
}
transformUser
=
res
=>
{
...
...
src/common/CallApp/index.js
View file @
a8c5d649
...
...
@@ -31,12 +31,6 @@ class OpenApp extends Component {
text
:
'在APP打开'
}
componentWillMount
()
{
// this.callApp = new CallApp({});
}
handleClick
=
()
=>
{
this
.
callApp
.
open
({
path
:
''
,
...
...
src/common/VList/index.js
View file @
a8c5d649
...
...
@@ -3,8 +3,8 @@ import './index.scss'
const
VList
=
(
props
)
=>
{
return
(
<
li
className
=
'v-list-item'
<
li
className
=
'v-list-item'
onClick
=
{()
=>
{
typeof
props
.
toDetail
===
'function'
&&
props
.
toDetail
(
props
.
id
)
}}
...
...
@@ -12,6 +12,7 @@ const VList = (props) => {
<
div
className
=
"content"
>
<
div
className
=
"cover"
>
{
props
.
status
}
{
props
.
courseExpire
}
{
props
.
toDetail
?
(
<
img
src
=
{
props
.
img
}
alt
=
""
/>
)
:
(
<
img
src
=
{
props
.
img
}
alt
=
""
/>
)
...
...
src/components/bargainMiddlePage/barcode/index.js
View file @
a8c5d649
...
...
@@ -27,7 +27,6 @@ class FollowBarcode extends Component {
const
_this
=
this
;
return
new
Promise
(
resolve
=>
{
QRCode
.
toDataURL
(
data
.
url
,
{},
function
(
err
,
url
)
{
console
.
log
(
url
);
_this
.
setState
({
codeUrl
:
url
});
...
...
src/components/coupons/Coupon/index.js
View file @
a8c5d649
...
...
@@ -7,11 +7,15 @@ class Coupon extends PureComponent {
pick
=
()
=>
{
let
{
useCoupon
,
invalid
}
=
this
.
props
!
invalid
&&
useCoupon
&&
useCoupon
(
this
.
props
.
id
)
}
GoToUse
=
()
=>
{
this
.
props
.
useCoupon
(
this
.
props
.
id
)
}
ExchangeCourse
=
(
e
)
=>
{
this
.
props
.
toExchangeCourse
(
e
,
this
.
props
.
code
)
}
render
()
{
let
{
...
...
@@ -22,6 +26,7 @@ class Coupon extends PureComponent {
invalid
,
course_title
,
id
,
code
,
selectedCouponId
,
showUseButton
}
=
this
.
props
...
...
@@ -56,13 +61,21 @@ class Coupon extends PureComponent {
limit_course
===
0
?
'可用于大于代金券金额的课程'
:
`仅适用于《
${
course_title
}
》`
}
<
/span
>
{
showUseButton
&&
showUseButton
&&
ctype
==
1
&&
<
button
className
=
'use'
onClick
=
{
this
.
GoToUse
}
>
立即使用
<
/button
>
}
{
showUseButton
&&
ctype
==
2
&&
<
button
className
=
'use'
onClick
=
{(
e
)
=>
this
.
ExchangeCourse
(
e
)}
>
立即兑换
<
/button
>
}
<
/div
>
<
/li
>
...
...
src/components/coupons/myCoupons/index.js
View file @
a8c5d649
import
React
,
{
PureComponent
}
from
'react'
;
import
React
,
{
PureComponent
}
from
'react'
;
import
'./index.scss'
import
RedeemBar
from
"../RedeemBar"
;
import
Coupon
from
'../Coupon'
import
{
http
,
getParam
}
from
'@/utils'
import
{
WithFullSize
}
from
'@/HOCs'
import
{
Toast
}
from
'antd-mobile'
import
{
isEmpty
}
from
'lodash'
import
{
connect
}
from
'react-redux'
;
import
{
http
,
getParam
}
from
'@/utils'
import
{
WithFullSize
}
from
'@/HOCs'
import
{
Toast
}
from
'antd-mobile'
import
{
isEmpty
}
from
'lodash'
import
{
connect
}
from
'react-redux'
;
@
connect
()
class
UseCoupon
extends
PureComponent
{
...
...
@@ -19,11 +19,12 @@ class UseCoupon extends PureComponent {
valid_coupons
:
[],
invalid_coupons
:
[],
courseId
:
getParam
(
'id'
),
showUseButton
:
false
showUseButton
:
false
,
courseCouponExchange
:
false
,
// 课程券兑换弹窗
courseCouponData
:
''
// 兑换课程信息
}
componentDidMount
()
{
const
{
history
,
location
}
=
this
.
props
const
{
state
}
=
this
.
props
.
location
...
...
@@ -47,6 +48,7 @@ class UseCoupon extends PureComponent {
this
.
setState
({
redeemCode
:
value
})
}
// 兑换
exchange
=
()
=>
{
const
{
location
:
{
state
=
{}}}
=
this
.
props
;
if
(
this
.
state
.
redeemCode
!==
''
)
{
...
...
@@ -59,35 +61,33 @@ class UseCoupon extends PureComponent {
const
coupon
=
data
.
data
if
(
this
.
state
.
showUseButton
)
{
if
(
coupon
[
'ctype'
]
==
2
)
{
this
.
setState
({
couponList
:
[...
this
.
state
.
couponList
,
coupon
],
courseCouponData
:
coupon
,
courseCouponExchange
:
true
,
redeemCode
:
''
})
}
else
{
const
coupon
=
data
.
data
if
(
coupon
[
'ctype'
]
==
2
&&
coupon
[
'limit_course'
]
!=
this
.
state
.
courseId
)
{
if
(
this
.
state
.
showUseButton
)
{
this
.
setState
({
invalid_coupons
:
[...
this
.
state
.
invalid_coupons
,
coupon
],
showUseButton
:
null
})
;
couponList
:
[...
this
.
state
.
couponList
,
coupon
],
redeemCode
:
''
})
}
else
{
const
coupon
=
data
.
data
this
.
setState
({
valid_coupons
:
[...
this
.
state
.
valid_coupons
,
coupon
],
redeemCode
:
''
})
}
}
Toast
.
info
(
'兑换成功'
)
if
(
state
.
from
===
'/my'
)
{
this
.
getMyCoupons
()
}
if
(
state
.
from
===
'/order'
)
{
this
.
getAllCoupons
()
Toast
.
info
(
'兑换成功'
)
if
(
state
.
from
===
'/my'
)
{
this
.
getMyCoupons
()
}
if
(
state
.
from
===
'/order'
)
{
this
.
getAllCoupons
()
}
}
}
else
{
Toast
.
info
(
data
.
msg
)
...
...
@@ -135,6 +135,24 @@ class UseCoupon extends PureComponent {
})
}
// 立即兑换课程
toExchangeCourse
=
(
e
,
code
)
=>
{
e
.
stopPropagation
();
http
.
post
(
`
${
API
[
'base-api'
]}
/pay/miandan/
${
code
}
`
,
{
}).
then
(
res
=>
{
const
data
=
res
.
data
if
(
data
.
errno
===
200
)
{
this
.
setState
({
courseCouponExchange
:
true
,
courseCouponData
:
res
.
data
.
data
})
this
.
getMyCoupons
()
}
else
{
Toast
.
info
(
data
.
msg
)
}
})
}
useCoupon
=
val
=>
{
const
{
history
,
dispatch
}
=
this
.
props
const
coupon
=
this
.
state
.
couponList
.
find
(
item
=>
item
.
id
===
val
)
...
...
@@ -142,13 +160,11 @@ class UseCoupon extends PureComponent {
if
(
val
)
{
if
(
this
.
state
.
showUseButton
)
{
if
(
coupon
[
'
ctype'
]
===
1
)
{
if
(
coupon
[
'
limit_course'
]
===
0
)
{
history
.
push
(
`/classify`
)
}
else
{
// dispatch(getCourses(coupon['limit_course'], () => {
history
.
push
(
`/detail?id=
${
coupon
[
'limit_course'
]}
`
);
return
false
;
// }));
history
.
push
(
`/detail?id=
${
coupon
[
'limit_course'
]}
`
);
return
false
;
}
}
else
{
...
...
@@ -206,6 +222,26 @@ class UseCoupon extends PureComponent {
}
// 开始学习
toStudy
=
(
vCourseId
,
isHaveVideo
)
=>
{
const
{
history
}
=
this
.
props
;
if
(
isHaveVideo
==
0
)
{
Toast
.
info
(
'尚未开课,开课后立即上传课程~'
,
2
)
}
else
{
history
.
push
(
`/play/video?id=
${
vCourseId
}
`
)
}
this
.
setState
({
courseCouponExchange
:
false
})
}
// 关闭弹窗
closeFreeCourse
=
()
=>
{
this
.
setState
({
courseCouponExchange
:
false
})
}
render
()
{
const
{
state
}
=
this
.
props
.
location
const
{
showUseButton
,
selectedCouponId
}
=
this
.
state
...
...
@@ -227,6 +263,7 @@ class UseCoupon extends PureComponent {
selectedCouponId
=
{
selectedCouponId
}
select
=
{
this
.
select
}
useCoupon
=
{
this
.
useCoupon
}
toExchangeCourse
=
{
this
.
toExchangeCourse
}
/
>
{
this
.
state
.
invalid_coupons
.
length
>
0
&&
...
...
@@ -244,6 +281,11 @@ class UseCoupon extends PureComponent {
)
}
<
/div
>
{
this
.
state
.
courseCouponExchange
&&
<
FreeCouponCourse
toStudy
=
{
this
.
toStudy
}
closeFreeCourse
=
{
this
.
closeFreeCourse
}
courseCouponData
=
{
this
.
state
.
courseCouponData
}
/
>
}
<
/div
>
);
}
...
...
@@ -275,4 +317,29 @@ function Content({coupons, ...rest}) {
)
}
function
FreeCouponCourse
(
props
)
{
const
{
toStudy
,
closeFreeCourse
,
courseCouponData
}
=
props
return
(
<
div
className
=
"free-coupon-box"
>
<
div
className
=
"free-coupon-content"
>
<
div
className
=
"coures-content-success"
><
i
className
=
{
'iconfont icondanseshixintubiao-5'
}
/></
div
>
<
div
className
=
"coures-content-title"
>
恭喜你课程兑换成功
!
赶快去学习吧
~<
/div
>
<
img
className
=
"coures-content-img"
src
=
{
courseCouponData
.
image_name
}
alt
=
""
/>
{
courseCouponData
.
course_expire
!=
0
&&
<
div
className
=
"coures-content-tip"
><
i
className
=
{
'iconfont icondanseshixintubiao-8'
}
/><span>课程有效期:自今日起{courseCouponData.course_expire}天内,请在有效期内学习该课程哦~</
span
>
<
/div
>
}
<
a
className
=
'toStudy'
onClick
=
{()
=>
toStudy
(
courseCouponData
.
v_course_id
,
courseCouponData
.
is_is_start
)}
>
去学习
<
/a
>
<
/div
>
<
div
className
=
"free-coupon-close"
>
<
i
className
=
{
'iconfont iconiconfront-2'
}
onClick
=
{()
=>
closeFreeCourse
()}
/
>
<
/div
>
<
/div
>
)
}
export
default
WithFullSize
(
UseCoupon
);
\ No newline at end of file
src/components/coupons/myCoupons/index.scss
View file @
a8c5d649
.use-coupon
{
display
:
flex
;
flex-flow
:
column
;
height
:
100%
;
background-color
:
#f5f5f5
;
.coupons-area
{
padding
:
72px
12px
0px
;
background
:
$bg_f5f5f5
;
flex
:
1
1
auto
;
.empty
{
min-height
:
211px
;
line-height
:
211px
;
font-size
:
$font_12
;
color
:
$color_666
;
text-align
:
center
;
display
:
flex
;
flex-flow
:
column
;
height
:
100%
;
background-color
:
#f5f5f5
;
.coupons-area
{
padding
:
72px
12px
0px
;
background
:
$bg_f5f5f5
;
flex
:
1
1
auto
;
.empty
{
min-height
:
211px
;
line-height
:
211px
;
font-size
:
$font_12
;
color
:
$color_666
;
text-align
:
center
;
}
.invalid-title
{
text-align
:
center
;
font-size
:
$font_12
;
line-height
:
52px
;
color
:
$color_999
;
}
}
.free-coupon-box
{
position
:
fixed
;
width
:
100%
;
top
:
0
;
left
:
0
;
right
:
0
;
bottom
:
0
;
text-align
:
center
;
background
:
rgba
(
0
,
0
,
0
,.
6
);
z-index
:
11
;
.free-coupon-content
{
width
:
290px
;
border-radius
:
10px
;
background-color
:
#fff
;
padding
:
20px
;
margin
:
150px
auto
0
auto
;
.coures-content-success
{
height
:
30px
;
line-height
:
30px
;
i
{
font-size
:
34px
;
color
:
#09f
;
}
}
.coures-content-title
{
font-size
:
15px
;
color
:
#333
;
margin-top
:
10px
;
}
.invalid-title
{
text-align
:
center
;
font-size
:
$font_12
;
line-height
:
52px
;
color
:
$color_999
;
.coures-content-img
{
width
:
150px
;
height
:
108px
;
border-radius
:
3px
;
margin-top
:
20px
;
}
.coures-content-tip
{
color
:
#FF3131
;
font-size
:
12px
;
margin-top
:
20px
;
text-align
:
left
;
line-height
:
15px
;
height
:
30px
;
i
{
display
:
inline-block
;
color
:
#FF3131
;
font-size
:
18px
;
position
:
relative
;
top
:
6px
;
}
span
{
display
:
inline-block
;
margin-left
:
20px
;
position
:
relative
;
top
:
-15px
;
}
}
.toStudy
{
display
:
inline-block
;
width
:
138px
;
height
:
30px
;
line-height
:
30px
;
background-color
:
#09f
;
border-radius
:
15px
;
margin-top
:
20px
;
font-size
:
15px
;
color
:
#fff
;
}
}
.free-coupon-close
{
margin-top
:
30px
;
i
{
font-size
:
26px
;
color
:
#fff
;
}
}
}
}
\ No newline at end of file
src/components/detail/index.js
View file @
a8c5d649
...
...
@@ -18,6 +18,7 @@ import {bindActionCreators} from "redux";
import
{
delCountryNum
}
from
'./../country/countryRedux'
;
import
RedPacket
from
'./redPacket'
;
import
{
Link
}
from
"react-router-dom"
;
class
Detail
extends
Component
{
...
...
@@ -318,13 +319,25 @@ class Detail extends Component {
}
// 点击子组件试听按钮
toAudition
=
(
v
_course_id
,
video_i
d
)
=>
{
toAudition
=
(
v
CourseId
,
videoI
d
)
=>
{
const
{
user
}
=
this
.
props
const
uid
=
user
&&
user
.
data
&&
user
.
data
.
uid
if
(
!
uid
)
{
this
.
props
.
history
.
push
(
'/passport/login'
)
}
else
{
this
.
props
.
history
.
push
(
`/play/video?id=
${
v_course_id
}
&video_id=
${
video_id
}
`
);
if
(
videoId
==
''
||
videoId
==
0
||
videoId
==
undefined
){
return
false
;
}
http
.
post
(
`
${
API
[
'base-api'
]}
/sys/get_class_audition?video_id=
${
videoId
}
`
).
then
((
res
)
=>
{
if
(
res
.
data
.
errno
==
200
)
{
this
.
props
.
history
.
push
(
`/play/video?id=
${
vCourseId
+
'&video_id='
+
videoId
}
`
)
}
else
{
Toast
.
info
(
res
.
data
.
msg
,
2
);
}
})
// this.setState({
// auditionBox: true,
// })
}
}
// 点击子组件单集购买按钮
...
...
src/components/detail/outline/index.js
View file @
a8c5d649
This diff is collapsed.
Click to expand it.
src/components/my/edit.js
View file @
a8c5d649
...
...
@@ -40,7 +40,7 @@ class MyEdut extends PureComponent {
// 退出登录
outLogin
=
()
=>
{
this
.
props
.
logout
()
Toast
.
info
(
'已退出'
,
2
)
Toast
.
info
(
'已退出'
,
2
,
null
,
false
)
this
.
props
.
history
.
push
(
'/my'
)
}
...
...
src/components/passport/index.js
View file @
a8c5d649
...
...
@@ -9,9 +9,9 @@ import ForgotPassword from './forgotPassword'
import
SetPassword
from
'./setPassword'
import
BindingTel
from
'./bindingTel'
import
ForgotPasswordEmail
from
'./forgotPasswordEmail'
import
{
connect
}
from
"react-redux"
;
import
{
compose
}
from
"redux"
;
import
{
getParam
}
from
"@/utils"
;
import
{
connect
}
from
"react-redux"
import
{
compose
}
from
"redux"
import
{
getParam
}
from
"@/utils"
import
account
from
'./icons/account.png'
import
qq
from
'./icons/qq.png'
...
...
@@ -22,12 +22,13 @@ import wechat from './icons/wechat.png'
class
Passport
extends
Component
{
redirectURL
=
'/'
count
=
1
constructor
(
props
)
{
super
(
props
)
;
super
(
props
)
const
{
location
}
=
props
const
{
pathname
,
search
,
hash
}
=
location
const
{
from
}
=
location
.
state
||
{
from
:
{
pathname
:
pathname
,
search
:
search
,
hash
:
hash
}
}
const
from
=
location
.
state
&&
location
.
state
.
from
||
{
pathname
:
pathname
,
search
:
search
,
hash
:
hash
}
this
.
redirectURL
=
window
.
location
.
origin
+
from
.
pathname
+
from
.
search
+
from
.
hash
this
.
state
=
{
loginWays
:
[
...
...
@@ -60,27 +61,33 @@ class Passport extends Component {
componentDidMount
()
{
this
.
routeWhenUserLoggedIn
()
const
{
history
}
=
this
.
props
if
(
!
window
.
passportHistoryListener
)
{
this
.
unlisten
=
history
.
listen
((
location
,
action
)
=>
{
window
.
passportHistoryListener
=
this
.
unlisten
location
.
pathname
!==
'/country'
&&
!
location
.
pathname
.
startsWith
(
'/passport'
)
&&
this
.
unlisten
()
if
(
action
===
'PUSH'
)
{
this
.
count
++
}
else
if
(
action
===
'POP'
)
{
this
.
count
--
}
})
}
}
componentDidUpdate
()
{
this
.
routeWhenUserLoggedIn
()
}
routeWhenUserLoggedIn
=
()
=>
{
let
{
history
,
location
}
=
this
.
props
let
{
data
}
=
this
.
props
.
user
if
(
data
&&
Object
.
values
(
data
).
filter
(
item
=>
!!
item
).
length
)
{
if
(
history
.
action
===
'POP'
&&
history
.
length
<=
3
)
{
history
.
push
(
'/'
)
}
else
{
if
(
!
(
this
.
props
.
user
&&
this
.
props
.
user
.
stage
))
{
const
from
=
location
.
state
&&
location
.
state
.
from
||
{
pathname
:
'/'
,
search
:
''
};
const
redirectURI
=
getParam
(
'redirect'
)
redirectURI
?
(
window
.
location
.
href
=
redirectURI
)
:
history
.
replace
(
from
);
}
}
let
{
hasError
}
=
this
.
props
.
user
if
(
!
hasError
)
{
const
redirectURI
=
getParam
(
'redirect'
)
redirectURI
?
(
window
.
location
.
href
=
redirectURI
)
:
this
.
props
.
history
.
go
(
-
this
.
count
)
}
}
...
...
src/components/preferential/index.js
View file @
a8c5d649
...
...
@@ -43,7 +43,8 @@ class Preferential extends Component {
http
.
get
(
`
${
API
.
home
}
/m/home/bargainZone`
).
then
((
res
)
=>
{
if
(
res
.
data
.
code
===
200
)
{
this
.
setState
({
dataList
:
res
.
data
.
data
dataList
:
res
.
data
.
data
,
isLoading
:
false
,
})
}
else
{
Toast
.
info
(
res
.
data
.
msg
,
2
)
...
...
@@ -55,7 +56,8 @@ class Preferential extends Component {
http
.
get
(
`
${
API
.
home
}
/m/home/grouponList`
).
then
((
res
)
=>
{
if
(
res
.
data
.
code
===
200
)
{
this
.
setState
({
dataList
:
res
.
data
.
data
dataList
:
res
.
data
.
data
,
isLoading
:
false
,
})
}
else
{
Toast
.
info
(
res
.
data
.
msg
,
2
)
...
...
@@ -64,7 +66,10 @@ class Preferential extends Component {
}
// tab 切换
ontabclick
=
(
tab
,
index
)
=>
{
this
.
state
.
courseStatus
=
index
this
.
setState
({
courseStatus
:
index
,
isLoading
:
true
,
})
switch
(
index
)
{
case
0
:
this
.
specialSale
()
...
...
@@ -104,66 +109,67 @@ class Preferential extends Component {
animated
=
{
false
}
onChange
=
{(
tab
,
index
)
=>
this
.
ontabclick
(
tab
,
index
)}
swipeable
=
{
false
}
page
=
{
this
.
state
.
courseStatus
}
renderTabBar
=
{
props
=>
<
div
className
=
{
'custom-tab-bar'
}
>
<
Tabs
.
DefaultTabBar
{...
props
}
/
>
<
/div>
}
>
<
div
className
=
'tabs'
>
<
ul
>
{
this
.
state
.
dataList
.
map
((
item
,
index
)
=>
{
const
Info
=
(
<
div
className
=
"info"
>
<
p
className
=
'title'
onClick
=
{()
=>
this
.
toCourseDetail
(
item
.
course_id
)}
>
{
/* <Link to={`/detail?id=${item.course_id}`}> */
}
{
item
.
course_title
}
{
/* </Link> */
}
<
/p
>
<
p
className
=
'contact text-overflow-2'
>
{
item
.
course_desc
}
<
/p
>
<
div
className
=
'des'
>
{
!
item
.
is_buy
&&
<
p
className
=
"course-price"
>
{
this
.
state
.
courseStatus
===
0
&&
<
span
className
=
'price'
>
特惠价:
<
/span
>
}
<
span
className
=
"new"
>
¥
{
item
.
price1
}
<
/span
>
<
span
className
=
"old"
>
¥
{
item
.
price0
}
<
/span
>
<
/p
>
}
{
item
.
is_buy
&&
<
a
className
=
"isbuy"
>
已购买
<
/a
>
<
/Tabs
>
<
div
className
=
'tabs'
>
<
ul
>
{
this
.
state
.
dataList
.
map
((
item
,
index
)
=>
{
const
Info
=
(
<
div
className
=
"info"
>
<
p
className
=
'title'
onClick
=
{()
=>
this
.
toCourseDetail
(
item
.
course_id
)}
>
{
/* <Link to={`/detail?id=${item.course_id}`}> */
}
{
item
.
course_title
}
{
/* </Link> */
}
<
/p
>
<
p
className
=
'contact text-overflow-2'
>
{
item
.
course_desc
}
<
/p
>
<
div
className
=
'des'
>
{
!
item
.
is_buy
&&
<
p
className
=
"course-price"
>
{
this
.
state
.
courseStatus
===
0
&&
<
span
className
=
'price'
>
特惠价:
<
/span
>
}
<
/div
>
<
/div
>
)
const
status
=
(
!
item
.
is_buy
&&
<
div
>
{
this
.
state
.
courseStatus
===
1
&&
<
p
className
=
'course-status'
>
砍价减
{
item
.
bargain_price
}
元
<
/p
>
}
{
this
.
state
.
courseStatus
===
2
&&
<
p
className
=
'course-status'
>
拼团价
{
item
.
price
}
元
<
/p
>
<
span
className
=
"new"
>
¥
{
item
.
price1
}
<
/span
>
<
span
className
=
"old"
>
¥
{
item
.
price0
}
<
/span
>
<
/p
>
}
{
item
.
is_aist
&&
<
span
className
=
'return_cash'
><
/span
>
{
item
.
is_buy
&&
<
a
className
=
"isbuy"
>
已购买
<
/a
>
}
<
/div
>
)
return
(
<
VList
key
=
{
index
}
img
=
{
item
.
image_name
}
id
=
{
item
.
course_id
}
status
=
{
status
}
info
=
{
Info
}
toDetail
=
{
this
.
toCourseDetail
}
/
>
)
})}
<
/ul
>
<
/div
>
)
const
status
=
(
!
item
.
is_buy
&&
<
div
>
{
this
.
state
.
courseStatus
===
1
&&
<
p
className
=
'course-status'
>
砍价减
{
item
.
bargain_price
}
元
<
/p
>
}
{
this
.
state
.
courseStatus
===
2
&&
<
p
className
=
'course-status'
>
拼团价
{
item
.
price
}
元
<
/p
>
}
{
item
.
is_aist
&&
<
span
className
=
'return_cash'
><
/span
>
}
<
/div
>
)
return
(
<
VList
key
=
{
index
}
img
=
{
item
.
image_name
}
id
=
{
item
.
course_id
}
status
=
{
status
}
info
=
{
Info
}
toDetail
=
{
this
.
toCourseDetail
}
/
>
)
})}
<
/ul
>
<
/div
>
<
/Tabs
>
<
/div
>
<
WhiteSpace
/>
<
/div
>
<
/Loading
>
...
...
src/components/purchased/index.js
View file @
a8c5d649
...
...
@@ -82,6 +82,10 @@ class Purchased extends Component {
const
status
=
(
item
.
is_aist
&&
<
span
className
=
'status'
>
返现
<
/span
>
)
const
courseExpire
=
(
item
.
course_expire
&&
item
.
course_expire
!=
''
&&
<
span
className
=
'course-expire'
>
{
item
.
course_expire
}
<
/span
>
)
return
(
<
VList
key
=
{
index
}
...
...
@@ -89,6 +93,7 @@ class Purchased extends Component {
id
=
{
item
.
course_id
}
info
=
{
Info
}
status
=
{
status
}
courseExpire
=
{
courseExpire
}
toDetail
=
{
this
.
toCourseDetail
}
/
>
)
...
...
src/components/purchased/index.scss
View file @
a8c5d649
...
...
@@ -110,5 +110,18 @@ html, body, #root {
color
:
#fff
;
background
:
linear-gradient
(
to
bottom
,
#FF4000
,
#FD7700
);
}
.course-expire
{
display
:
inline-block
;
text-align
:
center
;
position
:
absolute
;
bottom
:
10px
;
left
:
0
;
width
:
92px
;
height
:
20px
;
line-height
:
21px
;
background-color
:
#FF3A3A
;
border-radius
:
0
10px
10px
0
;
color
:
#fff
;
font-size
:
12px
;
}
}
\ No newline at end of file
src/components/scholarship/index.js
View file @
a8c5d649
...
...
@@ -31,6 +31,7 @@ class _Scholarship extends Component {
isLoading
:
false
,
showNoData
:
false
,
hasMore
:
true
,
tab
:
0
,
}
this
.
downImage
=
React
.
createRef
();
this
.
tabIndex
=
0
;
...
...
@@ -307,6 +308,7 @@ class _Scholarship extends Component {
isLoading
:
false
,
hasMore
:
true
,
dataSource
:
this
.
state
.
dataSource
.
cloneWithRows
(
this
.
rData
),
tab
:
index
,
},
()
=>
{
this
.
onEndReached
();
...
...
@@ -314,43 +316,52 @@ class _Scholarship extends Component {
);
}}
>
<
div
style
=
{{
marginTop
:
'15px'
,
backgroundColor
:
'#FFF'
}}
>
{
this
.
state
.
dataSource
.
_cachedRowCount
!==
0
?
(
<
ListView
useBodyScroll
=
{
this
.
state
.
useBodyScroll
}
dataSource
=
{
this
.
state
.
dataSource
}
renderRow
=
{
row
}
renderBodyComponent
=
{()
=>
<
div
/>
}
onEndReached
=
{
this
.
onEndReached
}
pageSize
=
{
4
}
onEndReachedThreshold
=
{
100
}
/
>
)
:
(
<
/Tabs
>
{
this
.
state
.
tab
===
0
?
(
<
div
style
=
{{
marginTop
:
'15px'
,
backgroundColor
:
'#FFF'
}}
>
{
this
.
state
.
dataSource
.
_cachedRowCount
!==
0
?
(
<
ListView
useBodyScroll
=
{
this
.
state
.
useBodyScroll
}
dataSource
=
{
this
.
state
.
dataSource
}
renderRow
=
{
row
}
renderBodyComponent
=
{()
=>
<
div
/>
}
onEndReached
=
{
this
.
onEndReached
}
pageSize
=
{
4
}
onEndReachedThreshold
=
{
100
}
/
>
)
:
(
null
)
}
}
<
/div
>
)
:
null
}
<
/div
>
<
div
>
<
Flex
justify
=
'center'
align
=
'center'
className
=
{
'runtimeList'
}
>
榜单实时更新,仅显示前
50
名
<
/Flex
>
{
this
.
state
.
dataSource
.
_cachedRowCount
!==
0
?
(
<
ListView
useBodyScroll
=
{
this
.
state
.
useBodyScroll
}
dataSource
=
{
this
.
state
.
dataSource
}
renderRow
=
{
row1
}
renderBodyComponent
=
{()
=>
<
div
/>
}
onEndReached
=
{
this
.
onEndReached
}
pageSize
=
{
4
}
onEndReachedThreshold
=
{
100
}
/
>
)
:
(
{
this
.
state
.
tab
===
1
?
(
<
div
>
<
Flex
justify
=
'center'
align
=
'center'
className
=
{
'runtimeList'
}
>
榜单实时更新,仅显示前
50
名
<
/Flex
>
{
this
.
state
.
dataSource
.
_cachedRowCount
!==
0
?
(
<
ListView
useBodyScroll
=
{
this
.
state
.
useBodyScroll
}
dataSource
=
{
this
.
state
.
dataSource
}
renderRow
=
{
row1
}
renderBodyComponent
=
{()
=>
<
div
/>
}
onEndReached
=
{
this
.
onEndReached
}
pageSize
=
{
4
}
onEndReachedThreshold
=
{
100
}
/
>
)
:
(
null
)
}
<
/div
>
<
/Tabs
>
}
<
/div
>
)
:
null
}
<
/div
>
<
/div
>
...
...
src/components/study/myCourses/index.js
View file @
a8c5d649
...
...
@@ -152,6 +152,10 @@ class MyCourses extends Component {
const
status
=
(
item
.
is_aist
&&
<
span
className
=
'status'
>
返现
<
/span
>
)
const
courseExpire
=
(
item
.
course_expire
&&
item
.
course_expire
!=
''
&&
<
span
className
=
'course-expire'
>
{
item
.
course_expire
}
<
/span
>
)
return
(
<
VList
img
=
{
item
.
image_name
}
handleClick
=
{
this
.
handleClick
}
...
...
@@ -159,6 +163,7 @@ class MyCourses extends Component {
key
=
{
index
}
info
=
{
Info
}
status
=
{
status
}
courseExpire
=
{
courseExpire
}
id
=
{
item
[
'v_course_id'
]}
/
>
)
...
...
src/components/study/myCourses/my-courses.scss
View file @
a8c5d649
...
...
@@ -150,4 +150,18 @@
color
:
#fff
;
background
:
linear-gradient
(
to
bottom
,
#FF4000
,
#FD7700
);
}
.course-expire
{
display
:
inline-block
;
text-align
:
center
;
position
:
absolute
;
bottom
:
10px
;
left
:
0
;
width
:
92px
;
height
:
20px
;
line-height
:
21px
;
background-color
:
#FF3A3A
;
border-radius
:
0
10px
10px
0
;
color
:
#fff
;
font-size
:
12px
;
}
}
\ No newline at end of file
src/router/route-middle-page.js
View file @
a8c5d649
...
...
@@ -14,15 +14,15 @@ function RouteMiddlePage(props) {
if
(
!
user
.
isFetching
)
{
if
(
user
.
hasError
)
{
history
.
replace
(
'/passport'
,
{
from
:
location
})
history
.
push
(
'/passport'
,
{
from
:
location
})
setLoadingState
(
false
)
}
else
{
let
{
data
}
=
user
||
{
data
:
{}}
if
(
data
&&
Object
.
values
(
data
).
every
(
item
=>
!!
item
))
{
history
.
replace
(
location
.
pathname
)
history
.
push
(
location
.
pathname
)
setLoadingState
(
false
)
}
else
{
history
.
replace
(
'/passport'
,
{
from
:
location
})
history
.
push
(
'/passport'
,
{
from
:
location
})
}
}
}
...
...
src/router/router-config.js
View file @
a8c5d649
...
...
@@ -29,8 +29,8 @@ const MyEdit = loadable(() => import(/* webpackChunkName: 'MyEdit'*/'@/component
const
Classify
=
loadable
(()
=>
import
(
/* webpackChunkName: 'Classify'*/
'@/components/classify'
))
const
CampTest
=
loadable
(()
=>
import
(
/* webpackChunkName: 'Classify'*/
'@/components/video/camp/campTest'
))
const
CampResolve
=
loadable
(()
=>
import
(
/* webpackChunkName: 'Classify'*/
'@/components/video/camp/campResolve'
))
const
ShareCourse
=
loadable
(()
=>
import
(
'@/components/ShareCourse/index'
))
const
Country
=
loadable
(()
=>
import
(
'@/components/country/index'
))
const
ShareCourse
=
loadable
(()
=>
import
(
/* webpackChunkName: 'ShareCourse'*/
'@/components/ShareCourse/index'
))
const
Country
=
loadable
(()
=>
import
(
/* webpackChunkName: 'Country' */
'@/components/country/index'
))
export
default
[
{
path
:
'/'
,
...
...
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