Commit c369b0cd by FE

Merge branch 'student-register' into dev

parents da642bff ea2d0167
.college-banner { .college-banner {
height: 100px; height: 100px;
background-image: url('https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/college-plan/college-banner.png'); // background-image: url('https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/college-plan/college-banner.png');
background-image: url('https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/college-plan/m-banner.png');
background-size: cover; background-size: cover;
} }
\ No newline at end of file
...@@ -2,6 +2,7 @@ import React, { Component } from 'react'; ...@@ -2,6 +2,7 @@ import React, { Component } from 'react';
import { http } from '@/utils'; import { http } from '@/utils';
import { HeaderBar } from "@/common"; import { HeaderBar } from "@/common";
import CollegeBanner from './banner'; import CollegeBanner from './banner';
import CollegeHeader from './header';
import './courseList.scss'; import './courseList.scss';
import { Toast } from 'antd-mobile'; import { Toast } from 'antd-mobile';
...@@ -10,6 +11,7 @@ class CollegeCourse extends Component { ...@@ -10,6 +11,7 @@ class CollegeCourse extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.state = { this.state = {
header: '',
courseList: [] courseList: []
}; };
} }
...@@ -25,8 +27,10 @@ class CollegeCourse extends Component { ...@@ -25,8 +27,10 @@ class CollegeCourse extends Component {
const { code, data } = res.data; const { code, data } = res.data;
if(code === 200) { if(code === 200) {
this.setState({ this.setState({
courseList: data header: data.name,
courseList: data.data
}); });
document.title = `助力高校在线教学计划之${data.name}专区 - 七月在线`
} }
}); });
} }
...@@ -50,15 +54,18 @@ class CollegeCourse extends Component { ...@@ -50,15 +54,18 @@ class CollegeCourse extends Component {
} }
render() { render() {
const { courseList = [] } = this.state; const { courseList = [], header } = this.state;
return ( return (
<> <>
<HeaderBar title={'助学计划'} arrow={true}/> <HeaderBar title={'助学计划'} arrow={true}/>
<CollegeBanner /> <CollegeBanner />
<div className="college-course__header"> <CollegeHeader
<i className="header__decorate"></i> headerStyle={{
<p className="header__desc">点击需要学习的课程封面,在课程详情页进入购买流程凭免单券免费兑换课程。</p> marginTop: '20px'
</div> }}
title={header}
/>
<p className="college-course__desc">点击需要学习的课程封面,在课程详情页进入购买流程凭免单券免费兑换课程。</p>
<div className="college-course__body"> <div className="college-course__body">
{ {
courseList.map(item => ( courseList.map(item => (
......
.college-course__header { .college-course__desc {
margin-top: 20px;
.header__decorate {
display: block;
width: 39px;
height: 3px;
margin: 0 auto;
border-radius: 2px;
background: linear-gradient(90deg,rgba(0,153,255,1) 0%,rgba(55,117,239,1) 100%);
}
.header__desc {
margin: 8px 19px 12px; margin: 8px 19px 12px;
font-size: 12px; font-size: 12px;
color: #0099FF; color: #0099FF;
text-align: center; text-align: center;
line-height: 15px; line-height: 15px;
}
} }
.college-course__body { .college-course__body {
......
import React from 'react';
import './header.scss';
export default (props) => {
const { title, isDecorate = true, headerStyle = {} } = props;
return (
<>
<div className="college-header" style={headerStyle}>
<i className="college-header__icon" data-direction="left"></i>
<h2 className="college-header__text">{title}</h2>
<i className="college-header__icon" data-direction="right"></i>
</div>
{
isDecorate &&
<i className="college-header__decorate"></i>
}
</>
);
};
.college-header {
display: flex;
justify-content: center;
align-items: center;
height: 34px;
}
.college-header__icon {
width: 44px;
height: 8px;
background-size: cover;
&[data-direction="left"] {
background-image: url('https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/college-plan/icon-left.png');
background-position: right;
}
&[data-direction="right"] {
background-image: url('https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/college-plan/icon-right.png');
background-position: left;
}
}
.college-header__text {
margin: 0;
padding: 0 10px;
font-size: 14px;
font-weight: 500;
color: #525C65;
line-height: 1;
}
.college-header__decorate {
display: block;
width: 39px;
height: 3px;
margin: 0 auto;
border-radius: 2px;
background: linear-gradient(90deg,rgba(0,153,255,1) 0%,rgba(55,117,239,1) 100%);
}
\ No newline at end of file
...@@ -2,6 +2,7 @@ import React, { Component } from 'react'; ...@@ -2,6 +2,7 @@ import React, { Component } from 'react';
import { http } from '@/utils'; import { http } from '@/utils';
import { HeaderBar } from "@/common"; import { HeaderBar } from "@/common";
import CollegeBanner from './banner'; import CollegeBanner from './banner';
import CollegeHeader from './header';
import './index.scss'; import './index.scss';
class CollegePage extends Component { class CollegePage extends Component {
...@@ -26,15 +27,16 @@ class CollegePage extends Component { ...@@ -26,15 +27,16 @@ class CollegePage extends Component {
componentDidMount() { componentDidMount() {
this.fetchSchoolList(); this.fetchSchoolList();
document.title = `免费提供在线教学系统 助力全国高校在线教学 - 七月在线`
} }
fetchSchoolList = () => { fetchSchoolList = () => {
const { schoolList } = this.state;
http.get(`${API['home']}/sys/school/list`).then(res => { http.get(`${API['home']}/sys/school/list`).then(res => {
console.log(res);
const { code, data } = res.data; const { code, data } = res.data;
if(code === 200) { if(code === 200) {
this.setState({ this.setState({
schoolList: data, schoolList: data.concat(schoolList),
}); });
} }
}); });
...@@ -42,8 +44,10 @@ class CollegePage extends Component { ...@@ -42,8 +44,10 @@ class CollegePage extends Component {
toCollegeCourse = (id) => { toCollegeCourse = (id) => {
const { history } = this.props; const { history } = this.props;
if(id) {
history.push(`/college/${id}`); history.push(`/college/${id}`);
} }
}
render() { render() {
const { sectionInfo = [], schoolList = [] } = this.state; const { sectionInfo = [], schoolList = [] } = this.state;
...@@ -56,7 +60,7 @@ class CollegePage extends Component { ...@@ -56,7 +60,7 @@ class CollegePage extends Component {
headerStyle={{ headerStyle={{
marginTop: '20px' marginTop: '20px'
}} }}
title="助力高校在线教学计划,在线不停课" title="助力高校在线教学计划"
/> />
<p className="college-page__contact">免费入驻联系周先生:18910848502(微信同)</p> <p className="college-page__contact">免费入驻联系周先生:18910848502(微信同)</p>
{ {
...@@ -75,7 +79,7 @@ class CollegePage extends Component { ...@@ -75,7 +79,7 @@ class CollegePage extends Component {
marginTop: '20px' marginTop: '20px'
}} }}
isDecorate={false} isDecorate={false}
title="入驻学院" title="入驻院校"
/> />
<div className="college-page__college"> <div className="college-page__college">
{ {
...@@ -96,21 +100,4 @@ class CollegePage extends Component { ...@@ -96,21 +100,4 @@ class CollegePage extends Component {
} }
} }
const CollegeHeader = (props) => {
const { title, isDecorate = true, headerStyle = {} } = props;
return (
<>
<div className="college-header" style={headerStyle}>
<i className="college-header__icon" data-direction="left"></i>
<h2 className="college-header__text">{title}</h2>
<i className="college-header__icon" data-direction="right"></i>
</div>
{
isDecorate &&
<i className="college-header__decorate"></i>
}
</>
);
}
export default CollegePage; export default CollegePage;
\ No newline at end of file
...@@ -43,25 +43,14 @@ ...@@ -43,25 +43,14 @@
} }
.college-page__college { .college-page__college {
display: flex; // display: flex;
flex-wrap: wrap; // flex-wrap: wrap;
padding: 4px 10px 0; padding: 4px 10px 0;
.college__item { .college__item {
width: 166px; // width: 166px;
margin: 0 5px 10px; margin: 0 5px 10px;
cursor: pointer; cursor: pointer;
&:hover {
.college__iamge {
border-color: #0099FF;
}
.college__name {
color: #0099ff;
}
}
} }
.college__iamge { .college__iamge {
...@@ -69,7 +58,7 @@ ...@@ -69,7 +58,7 @@
height: 60px; height: 60px;
border: 1px solid #ECECEC; border: 1px solid #ECECEC;
border-radius: 1px; border-radius: 1px;
background-size: auto 100%; background-size: auto 95%;
background-position: center; background-position: center;
background-repeat: no-repeat; background-repeat: no-repeat;
} }
...@@ -82,44 +71,3 @@ ...@@ -82,44 +71,3 @@
line-height: 16px; line-height: 16px;
} }
} }
\ No newline at end of file
.college-header {
display: flex;
justify-content: center;
align-items: center;
height: 34px;
}
.college-header__icon {
width: 44px;
height: 8px;
background-size: cover;
&[data-direction="left"] {
background-image: url('https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/college-plan/icon-left.png');
background-position: right;
}
&[data-direction="right"] {
background-image: url('https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/college-plan/icon-right.png');
background-position: left;
}
}
.college-header__text {
margin: 0;
padding: 0 10px;
font-size: 14px;
font-weight: 500;
color: #525C65;
line-height: 1;
}
.college-header__decorate {
display: block;
width: 39px;
height: 3px;
margin: 0 auto;
border-radius: 2px;
background: linear-gradient(90deg,rgba(0,153,255,1) 0%,rgba(55,117,239,1) 100%);
}
\ No newline at end of file
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