Commit 80033267 by zhanghaozhe

Merge branch 'intelligent-recommend' into pre

parents ea9a8dc1 c08f4cbd
......@@ -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>
......@@ -254,7 +257,7 @@ function Options({options, handleSelect}) {
{
!!options.length && options.map(item => {
return <li onClick={() => handleSelect(item)} key={item.id}>
{item.describe}
<button>{item.describe}</button>
</li>
})
}
......
......@@ -86,7 +86,6 @@
.text {
position: relative;
padding: 0 16px;
height: 40px;
display: inline-block;
background: rgba(255, 255, 255, 1);
border-radius: 4px;
......@@ -159,15 +158,21 @@
}
li {
width: 126px;
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;
margin-bottom: 15px;
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 @@
font-size: 18px;
line-height: 36px;
font-weight: 600;
white-space: pre-line;
&.project {
font-size: 14px;
......
......@@ -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})
......
......@@ -338,6 +338,7 @@ export default [
//智能选课
{
path: '/intelligent-recommend',
isPrivate: true,
component: loadable(() => import(/* webpackChunkName: 'intelligent-recommend' */'@/components/intelligent-recommend')),
},
]
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment