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
ba540b28
Commit
ba540b28
authored
Jun 19, 2020
by
zhanghaozhe
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'intelligent-recommend' into dev
parents
7fc402e2
016284d8
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
7 deletions
+11
-7
src/components/intelligent-recommend/index.js
+9
-6
src/components/intelligent-recommend/index.scss
+1
-0
src/router/route-middle-page.js
+0
-1
src/router/router-config.js
+1
-0
No files found.
src/components/intelligent-recommend/index.js
View file @
ba540b28
...
...
@@ -31,10 +31,7 @@ class IntelligentRecommend extends Component {
}
componentDidMount
()
{
const
{
user
,
intelligentRecommend
,
history
,
reselect
}
=
this
.
props
if
(
user
.
hasError
)
{
return
history
.
push
(
'/passport'
)
}
const
{
intelligentRecommend
,
reselect
}
=
this
.
props
if
(
isEmpty
(
intelligentRecommend
.
result
))
{
reselect
()
this
.
getMessage
()
...
...
@@ -100,6 +97,12 @@ class IntelligentRecommend extends Component {
})
}
displayPrice
=
(
price
)
=>
{
let
_price
=
price
.
toString
()
let
decimal
=
_price
.
split
(
'.'
)
return
parseInt
(
decimal
[
1
])
===
0
?
decimal
[
0
]
:
price
}
goBack
=
()
=>
{
const
{
state
}
=
this
.
props
.
location
if
(
browser
.
isWeixin
&&
getParam
(
'code'
)
&&
getParam
(
'state'
))
{
...
...
@@ -208,8 +211,8 @@ class IntelligentRecommend extends Component {
{
item
.
c_type
===
1
&&
<
React
.
Fragment
key
=
{
item
.
course_id
}
>
<
div
className
=
"prices"
>
<
span
className
=
{
'price'
}
>
¥
{
item
.
price_sale
}
<
/span
>
<
span
className
=
{
'old-price'
}
>
¥
{
item
.
price_original
}
<
/span
>
<
span
className
=
{
'price'
}
>
¥
{
this
.
displayPrice
(
item
.
price_sale
)
}
<
/span
>
<
span
className
=
{
'old-price'
}
>
¥
{
this
.
displayPrice
(
item
.
price_original
)
}
<
/span
>
<
/div
>
<
Link
className
=
{
'register'
}
to
=
{
`/detail?id=
${
item
.
course_id
}
`
}
>
{
item
.
second_btn
}
<
/Link
>
<
/React.Fragment
>
...
...
src/components/intelligent-recommend/index.scss
View file @
ba540b28
...
...
@@ -216,6 +216,7 @@
font-size
:
18px
;
line-height
:
36px
;
font-weight
:
600
;
white-space
:
pre-line
;
&
.project
{
font-size
:
14px
;
...
...
src/router/route-middle-page.js
View file @
ba540b28
...
...
@@ -19,7 +19,6 @@ function RouteMiddlePage(props) {
}
else
{
let
{
data
}
=
user
||
{
data
:
{}}
if
(
data
&&
Object
.
values
(
data
).
every
(
item
=>
!!
item
))
{
history
.
push
(
location
.
pathname
)
setLoadingState
(
false
)
}
else
{
history
.
push
(
'/passport'
,
{
from
:
location
})
...
...
src/router/router-config.js
View file @
ba540b28
...
...
@@ -338,6 +338,7 @@ export default [
//智能选课
{
path
:
'/intelligent-recommend'
,
isPrivate
:
true
,
component
:
loadable
(()
=>
import
(
/* webpackChunkName: 'intelligent-recommend' */
'@/components/intelligent-recommend'
)),
},
]
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