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
80033267
Commit
80033267
authored
Jun 19, 2020
by
zhanghaozhe
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'intelligent-recommend' into pre
parents
ea9a8dc1
c08f4cbd
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
17 deletions
+26
-17
src/components/intelligent-recommend/index.js
+10
-7
src/components/intelligent-recommend/index.scss
+15
-9
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 @
80033267
...
@@ -31,10 +31,7 @@ class IntelligentRecommend extends Component {
...
@@ -31,10 +31,7 @@ class IntelligentRecommend extends Component {
}
}
componentDidMount
()
{
componentDidMount
()
{
const
{
user
,
intelligentRecommend
,
history
,
reselect
}
=
this
.
props
const
{
intelligentRecommend
,
reselect
}
=
this
.
props
if
(
user
.
hasError
)
{
return
history
.
push
(
'/passport'
)
}
if
(
isEmpty
(
intelligentRecommend
.
result
))
{
if
(
isEmpty
(
intelligentRecommend
.
result
))
{
reselect
()
reselect
()
this
.
getMessage
()
this
.
getMessage
()
...
@@ -100,6 +97,12 @@ class IntelligentRecommend extends Component {
...
@@ -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
=
()
=>
{
goBack
=
()
=>
{
const
{
state
}
=
this
.
props
.
location
const
{
state
}
=
this
.
props
.
location
if
(
browser
.
isWeixin
&&
getParam
(
'code'
)
&&
getParam
(
'state'
))
{
if
(
browser
.
isWeixin
&&
getParam
(
'code'
)
&&
getParam
(
'state'
))
{
...
@@ -208,8 +211,8 @@ class IntelligentRecommend extends Component {
...
@@ -208,8 +211,8 @@ class IntelligentRecommend extends Component {
{
{
item
.
c_type
===
1
&&
<
React
.
Fragment
key
=
{
item
.
course_id
}
>
item
.
c_type
===
1
&&
<
React
.
Fragment
key
=
{
item
.
course_id
}
>
<
div
className
=
"prices"
>
<
div
className
=
"prices"
>
<
span
className
=
{
'price'
}
>
¥
{
item
.
price_sale
}
<
/span
>
<
span
className
=
{
'price'
}
>
¥
{
this
.
displayPrice
(
item
.
price_sale
)
}
<
/span
>
<
span
className
=
{
'old-price'
}
>
¥
{
item
.
price_original
}
<
/span
>
<
span
className
=
{
'old-price'
}
>
¥
{
this
.
displayPrice
(
item
.
price_original
)
}
<
/span
>
<
/div
>
<
/div
>
<
Link
className
=
{
'register'
}
to
=
{
`/detail?id=
${
item
.
course_id
}
`
}
>
{
item
.
second_btn
}
<
/Link
>
<
Link
className
=
{
'register'
}
to
=
{
`/detail?id=
${
item
.
course_id
}
`
}
>
{
item
.
second_btn
}
<
/Link
>
<
/React.Fragment
>
<
/React.Fragment
>
...
@@ -254,7 +257,7 @@ function Options({options, handleSelect}) {
...
@@ -254,7 +257,7 @@ function Options({options, handleSelect}) {
{
{
!!
options
.
length
&&
options
.
map
(
item
=>
{
!!
options
.
length
&&
options
.
map
(
item
=>
{
return
<
li
onClick
=
{()
=>
handleSelect
(
item
)}
key
=
{
item
.
id
}
>
return
<
li
onClick
=
{()
=>
handleSelect
(
item
)}
key
=
{
item
.
id
}
>
{
item
.
describe
}
<
button
>
{
item
.
describe
}
<
/button
>
<
/li
>
<
/li
>
})
})
}
}
...
...
src/components/intelligent-recommend/index.scss
View file @
80033267
...
@@ -86,7 +86,6 @@
...
@@ -86,7 +86,6 @@
.text
{
.text
{
position
:
relative
;
position
:
relative
;
padding
:
0
16px
;
padding
:
0
16px
;
height
:
40px
;
display
:
inline-block
;
display
:
inline-block
;
background
:
rgba
(
255
,
255
,
255
,
1
);
background
:
rgba
(
255
,
255
,
255
,
1
);
border-radius
:
4px
;
border-radius
:
4px
;
...
@@ -159,15 +158,21 @@
...
@@ -159,15 +158,21 @@
}
}
li
{
li
{
width
:
126px
;
margin-bottom
:
15px
;
height
:
33px
;
margin
:
0
auto
15px
;
background
:
linear-gradient
(
90deg
,
rgba
(
0
,
153
,
255
,
1
)
0%
,
rgba
(
77
,
184
,
255
,
1
)
100%
);
border-radius
:
17px
;
font-size
:
16px
;
color
:
#fff
;
text-align
:
center
;
text-align
:
center
;
line-height
:
33px
;
button
{
padding
:
9px
30px
;
box-sizing
:
border-box
;
background
:
linear-gradient
(
90deg
,
rgba
(
0
,
153
,
255
,
1
)
0%
,
rgba
(
77
,
184
,
255
,
1
)
100%
);
border-radius
:
17px
;
font-size
:
16px
;
color
:
#fff
;
-webkit-appearance
:
none
;
outline
:
none
;
border
:
none
;
}
}
}
}
}
...
@@ -216,6 +221,7 @@
...
@@ -216,6 +221,7 @@
font-size
:
18px
;
font-size
:
18px
;
line-height
:
36px
;
line-height
:
36px
;
font-weight
:
600
;
font-weight
:
600
;
white-space
:
pre-line
;
&
.project
{
&
.project
{
font-size
:
14px
;
font-size
:
14px
;
...
...
src/router/route-middle-page.js
View file @
80033267
...
@@ -19,7 +19,6 @@ function RouteMiddlePage(props) {
...
@@ -19,7 +19,6 @@ function RouteMiddlePage(props) {
}
else
{
}
else
{
let
{
data
}
=
user
||
{
data
:
{}}
let
{
data
}
=
user
||
{
data
:
{}}
if
(
data
&&
Object
.
values
(
data
).
every
(
item
=>
!!
item
))
{
if
(
data
&&
Object
.
values
(
data
).
every
(
item
=>
!!
item
))
{
history
.
push
(
location
.
pathname
)
setLoadingState
(
false
)
setLoadingState
(
false
)
}
else
{
}
else
{
history
.
push
(
'/passport'
,
{
from
:
location
})
history
.
push
(
'/passport'
,
{
from
:
location
})
...
...
src/router/router-config.js
View file @
80033267
...
@@ -338,6 +338,7 @@ export default [
...
@@ -338,6 +338,7 @@ export default [
//智能选课
//智能选课
{
{
path
:
'/intelligent-recommend'
,
path
:
'/intelligent-recommend'
,
isPrivate
:
true
,
component
:
loadable
(()
=>
import
(
/* webpackChunkName: 'intelligent-recommend' */
'@/components/intelligent-recommend'
)),
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