Commit 9e599aa4 by zhanghaozhe

增一得一活动页

parent 1bfa2f93
import React, { Component } from 'react'
class GiveCourseAssistance extends Component {
render() {
return (
<div>
</div>
)
}
}
export default GiveCourseAssistance
...@@ -221,6 +221,7 @@ ...@@ -221,6 +221,7 @@
thead tr { thead tr {
background-color: #fadc7f; background-color: #fadc7f;
height: px2rem(30); height: px2rem(30);
line-height: px2rem(30);
@include px2px(font-size, 26); @include px2px(font-size, 26);
color: #ad4700; color: #ad4700;
} }
......
import React, { Component } from 'react' import React, { Component } from 'react'
import './give-courses.scss' import './give-courses.scss'
import { http } from "@/utils" import { getParam, http } from "@/utils"
import { Toast } from "antd-mobile" import { Toast } from "antd-mobile"
import { Link } from "react-router-dom" import { Link } from "react-router-dom"
...@@ -32,9 +32,12 @@ class GiveCourses extends Component { ...@@ -32,9 +32,12 @@ class GiveCourses extends Component {
banner: data.active_info.m_banner, banner: data.active_info.m_banner,
courses: data.course_info, courses: data.course_info,
rule: data.active_info.rule, rule: data.active_info.rule,
awardstext: data.active_info.awards_text.split('\n\n') awardstext: data.active_info.awards_text.split('\n\n'),
query: data.active_info.activity_name
}) })
this.isRouter(data.active_info.activity_name)
} else { } else {
showToast(msg) showToast(msg)
} }
...@@ -98,6 +101,12 @@ class GiveCourses extends Component { ...@@ -98,6 +101,12 @@ class GiveCourses extends Component {
}) })
} }
isRouter = param => {
if(decodeURIComponent(getParam('activename')) != param){
this.props.history.push('/')
}
}
render() { render() {
const { const {
...@@ -119,7 +128,7 @@ class GiveCourses extends Component { ...@@ -119,7 +128,7 @@ class GiveCourses extends Component {
{ {
courses.map(course => { courses.map(course => {
return ( return (
<div className='give-course'> <div className='give-course' key={course.id}>
<Link className='give-course-img' to={`/detail?id=${course.course_id}`}> <Link className='give-course-img' to={`/detail?id=${course.course_id}`}>
<img src={course.image_name} alt=""/> <img src={course.image_name} alt=""/>
</Link> </Link>
...@@ -148,7 +157,7 @@ class GiveCourses extends Component { ...@@ -148,7 +157,7 @@ class GiveCourses extends Component {
marqueeList.map((item, index) => { marqueeList.map((item, index) => {
return ( return (
<li key={index}> <li key={index}>
<img src={item.head_img} alt/> <img src={item.head_img} alt=""/>
<span>{item.nickname}</span> <span>{item.nickname}</span>
{item.word} {item.word}
</li> </li>
...@@ -160,21 +169,21 @@ class GiveCourses extends Component { ...@@ -160,21 +169,21 @@ class GiveCourses extends Component {
</div> </div>
</div> </div>
<div class="set-prize"> <div className="set-prize">
<p class="set-prize-title"> <p className="set-prize-title">
<img src="//julyedu-cdn.oss-cn-beijing.aliyuncs.com/2018_1111/jpsz_icon.png" <img src="//julyedu-cdn.oss-cn-beijing.aliyuncs.com/2018_1111/jpsz_icon.png"
alt=""/>奖品设置 alt=""/>奖品设置
</p> </p>
<div class="set-prize-content"> <div className="set-prize-content">
{ {
awardstext && awardstext.length && awardstext.map((item, index) => <p key={index}>{item}</p>) awardstext && awardstext.length && awardstext.map((item, index) => <p key={index}>{item}</p>)
} }
</div> </div>
</div> </div>
<div class="ranking-list"> <div className="ranking-list">
<div class="ranking_title"> <div className="ranking_title">
<img src="//julyedu-cdn.oss-cn-beijing.aliyuncs.com/2018_1111/jbei_icon.png" alt/> <img src="//julyedu-cdn.oss-cn-beijing.aliyuncs.com/2018_1111/jbei_icon.png" alt=""/>
<span>排行榜</span> <span>排行榜</span>
<p>数据实时更新 只显示Top50</p> <p>数据实时更新 只显示Top50</p>
</div> </div>
...@@ -223,7 +232,7 @@ class GiveCourses extends Component { ...@@ -223,7 +232,7 @@ class GiveCourses extends Component {
{ {
rankList.list && rankList.list.length && rankList.list.length > 3 ? rankList.other.map((item, index) => { rankList.list && rankList.list.length && rankList.list.length > 3 ? rankList.other.map((item, index) => {
return ( return (
<tr key='index'> <tr key={index}>
<td>{index + 4}</td> <td>{index + 4}</td>
<td><img src={item.head_img} alt=""/><span>{item.name}</span></td> <td><img src={item.head_img} alt=""/><span>{item.name}</span></td>
<td>{item.num}</td> <td>{item.num}</td>
...@@ -244,7 +253,7 @@ class GiveCourses extends Component { ...@@ -244,7 +253,7 @@ class GiveCourses extends Component {
</tbody> </tbody>
</table> </table>
<p class="btm"></p> <p className="btm"></p>
</div> </div>
<p className="julynotice">*本活动最终解释权归七月在线所有*</p> <p className="julynotice">*本活动最终解释权归七月在线所有*</p>
......
...@@ -256,6 +256,11 @@ export default [ ...@@ -256,6 +256,11 @@ export default [
{ {
path: '/activity/givecourses', path: '/activity/givecourses',
exact: true, exact: true,
component: loadable(() => import(/* activity/give-courses */'@components/activity/give-courses/index')) component: loadable(() => import(/* activity-give-courses */'@components/activity/give-courses/index'))
} },
{
path: '/activity/assistance',
exact: true,
component: loadable(() => import(/* activity-give-courses-assistance */'@components/activity/give-courses/assistance/index'))
},
] ]
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