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