Commit ab3abbcd authored by baixian's avatar baixian

111222dd

parent 09c6b068
...@@ -191,7 +191,7 @@ export default { ...@@ -191,7 +191,7 @@ export default {
isFather: false, isFather: false,
noIcon: true, noIcon: true,
path: '/sjd/coursegather', path: '/sjd/coursegather',
relativePath: ['/sjd/coursegather'], relativePath: ['/sjd/coursegather', '/sjd/gatherdetail/:id'],
}, },
{ {
id: '33', id: '33',
......
This diff is collapsed.
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
import { routerRedux } from 'dva/router'; import { routerRedux } from 'dva/router';
import { message } from 'antd'; import { message } from 'antd';
import { delay } from 'redux-saga'; import { delay } from 'redux-saga';
import moment from 'moment';
import { import {
LocalStorage, LocalStorage,
SessionStorage, SessionStorage,
...@@ -36,6 +37,9 @@ export default { ...@@ -36,6 +37,9 @@ export default {
content: '', content: '',
}, },
addLoading: false, addLoading: false,
editLoading: false,
materialVisible: false,
courseChartData: {},
}, },
subscriptions: { subscriptions: {
setup({ dispatch, history }) { // eslint-disable-line setup({ dispatch, history }) { // eslint-disable-line
...@@ -74,6 +78,50 @@ export default { ...@@ -74,6 +78,50 @@ export default {
}); });
} }
}, },
* selectChart({ payload }, { call, put, select }) {
const { start, end, id } = payload;
const data = yield call(onlineAjax.staticChart, {
course_id: id,
start,
end,
});
if (data.code == 200) {
yield put({
type: 'updateState',
payload: {
courseChartData: data.data,
},
});
} else {
yield put({
type: 'webapp/errorrequestresolve',
payload: {
data,
},
});
}
},
* selectTotal({ payload }, { call, put, select }) {
const { id } = payload;
const data = yield call(onlineAjax.staticTotal, {
course_id: id,
});
if (data.code == 200) {
yield put({
type: 'updateState',
payload: {
dataAllTotal: data.data,
},
});
} else {
yield put({
type: 'webapp/errorrequestresolve',
payload: {
data,
},
});
}
},
* findCourse({ payload }, { call, put, select }) { * findCourse({ payload }, { call, put, select }) {
const { sid } = yield select(state => state.webapp); const { sid } = yield select(state => state.webapp);
const { id } = payload; const { id } = payload;
...@@ -104,6 +152,20 @@ export default { ...@@ -104,6 +152,20 @@ export default {
}, },
}, },
}); });
yield put({
type: 'selectChart',
payload: {
start: moment().subtract(6, 'days').format('YYYY-MM-DD'),
end: moment().format('YYYY-MM-DD'),
id: data.data.id,
},
});
yield put({
type: 'selectTotal',
payload: {
id: data.data.id,
},
});
} else { } else {
yield put({ yield put({
type: 'webapp/errorrequestresolve', type: 'webapp/errorrequestresolve',
...@@ -190,7 +252,6 @@ export default { ...@@ -190,7 +252,6 @@ export default {
} = payload; } = payload;
addCourseObj.intro = JSON.stringify(addCourseObj.intro); addCourseObj.intro = JSON.stringify(addCourseObj.intro);
const newCourseObj = { ...addCourseObj }; const newCourseObj = { ...addCourseObj };
console.log(addCourseObj, 'addCourseObj1111111111111111111');
const loadmessage = message.loading('保存中...', 0); const loadmessage = message.loading('保存中...', 0);
const newParams = Object.assign(newCourseObj, { const newParams = Object.assign(newCourseObj, {
title, title,
...@@ -609,6 +670,9 @@ export default { ...@@ -609,6 +670,9 @@ export default {
], ],
}, },
addLoading: false, addLoading: false,
editLoading: false,
materialVisible: false,
courseChartData: {},
}, },
}); });
}, },
......
...@@ -12,6 +12,24 @@ ...@@ -12,6 +12,24 @@
.photoWrap { .photoWrap {
display: inline-flex; display: inline-flex;
width: 320px; width: 320px;
.photoCover {
width: 140px;
height: 140px;
position: relative;
&>img {
width: 140px;
height: 140px;
border-radius: 6px;
}
.coverDelete {
font-size: 22px;
color: #fa4f53;
cursor: pointer;
position: absolute;
right: -40px;
top: 0;
}
}
.material { .material {
width: 140px; width: 140px;
height: 140px; height: 140px;
...@@ -22,6 +40,18 @@ ...@@ -22,6 +40,18 @@
align-items: center; align-items: center;
flex-direction: column; flex-direction: column;
margin-right: 11px; margin-right: 11px;
cursor: pointer;
position: relative;
.uploadInput {
position: absolute;
width: 100%;
height: 100%;
left: 0;
top: 0;
opacity: 0;
cursor: pointer;
z-index: 1;
}
.tip { .tip {
font-size:14px; font-size:14px;
font-weight:400; font-weight:400;
...@@ -62,4 +92,28 @@ ...@@ -62,4 +92,28 @@
} }
.voice { .voice {
margin: 0; margin: 0;
position: relative;
width: 400px;
height: 40px;
&>audio {
height: 30px;
}
.audioDelete {
position: absolute;
top: 3px;
right: 0;
font-size: 22px;
color: #fa4f53;
cursor: pointer;
}
.voiceUpload {
position: absolute;
width: 100%;
height: 100%;
left: 0;
top: 0;
opacity: 0;
z-index: 1;
cursor: pointer;
}
} }
...@@ -203,7 +203,7 @@ class StaticCenter extends React.Component { ...@@ -203,7 +203,7 @@ class StaticCenter extends React.Component {
<div className={pageStyle.container}> <div className={pageStyle.container}>
<div className={pageStyle.tabbox}> <div className={pageStyle.tabbox}>
<div className={pageStyle.gatherInfo}> <div className={pageStyle.gatherInfo}>
<img className={pageStyle.titleicon} src="https://cdn.img.shangjiadao.cn/clock-test/member/12186/2019-07-08/240ef0e06262ffb11253e03bf986143c.jpg?x-oss-process=image/resize,w_640/rotate,360/crop,x_176,y_36,w_288,h_288" alt="" /> <img className={pageStyle.titleicon} src={`${__IMGCDN__}/course/book_icon.png`} alt="" />
<div className={pageStyle.gatherDetail}> <div className={pageStyle.gatherDetail}>
<div className={pageStyle.titlebox}> <div className={pageStyle.titlebox}>
<span className={pageStyle.title}>{gatherDetail.title || ''}</span> <span className={pageStyle.title}>{gatherDetail.title || ''}</span>
......
import React from 'react'; import React from 'react';
import { Icon } from 'antd'; import { Icon } from 'antd';
import pageStyle from './Card.less'; import pageStyle from './Card.less';
import { imagify } from '../../../utils';
const MediaCard = (props) => { const MediaCard = (props) => {
const { const {
info, info,
...@@ -8,7 +9,7 @@ const MediaCard = (props) => { ...@@ -8,7 +9,7 @@ const MediaCard = (props) => {
} = props; } = props;
return ( return (
<div className={pageStyle.box} {...props} onClick={() => method.gogatherdetail(info.id)}> <div className={pageStyle.box} {...props} onClick={() => method.gogatherdetail(info.id)}>
<img className={pageStyle.image} src="https://cdn.img.shangjiadao.cn/clock-test/member/12186/2019-07-08/240ef0e06262ffb11253e03bf986143c.jpg?x-oss-process=image/resize,w_640/rotate,360/crop,x_176,y_36,w_288,h_288" alt="" /> <img className={pageStyle.image} src={imagify(info.cover)} alt="" />
<div className={pageStyle.infobox}> <div className={pageStyle.infobox}>
<div className={pageStyle.topbox}> <div className={pageStyle.topbox}>
<div className={pageStyle.title}>{info.title}</div> <div className={pageStyle.title}>{info.title}</div>
......
...@@ -135,7 +135,7 @@ class CourseDetailForm extends React.Component { ...@@ -135,7 +135,7 @@ class CourseDetailForm extends React.Component {
payload: { payload: {
title, title,
remark, remark,
start_time: moment(start_time[0]).format('YYYY-MM-DD HH:mm'), start_time: moment(start_time).format('YYYY-MM-DD HH:mm'),
study_count, study_count,
callBack: () => { callBack: () => {
form.resetFields(); form.resetFields();
...@@ -236,7 +236,6 @@ class CourseDetailForm extends React.Component { ...@@ -236,7 +236,6 @@ class CourseDetailForm extends React.Component {
}); });
} }
materialSave = (values) => { materialSave = (values) => {
console.log(values, '1111111111111');
const { dispatch } = this.props; const { dispatch } = this.props;
dispatch({ dispatch({
type: 'onlineclasses/updateCover', type: 'onlineclasses/updateCover',
...@@ -265,7 +264,6 @@ class CourseDetailForm extends React.Component { ...@@ -265,7 +264,6 @@ class CourseDetailForm extends React.Component {
queryParams, queryParams,
materiaListTotal, materiaListTotal,
} = this.props; } = this.props;
console.log(addCourseObj, 'addCourseObj');
const formItemModalLineLayout = { const formItemModalLineLayout = {
labelCol: { labelCol: {
xs: { span: 24 }, xs: { span: 24 },
......
import React from 'react'; import React from 'react';
import { connect } from 'dva';
import { import {
Row, Row,
Col, Col,
Select, Select,
Button, Empty,
DatePicker, DatePicker, Form,
} from 'antd'; } from 'antd';
import {
G2,
Chart,
Geom,
Axis,
Tooltip,
Coord,
Label,
Legend,
View,
Guide,
Shape,
Facet,
Util,
} from 'bizcharts';
import pageStyle from './StaticBox.less'; import pageStyle from './StaticBox.less';
const { RangePicker } = DatePicker; const { RangePicker } = DatePicker;
const { Option } = Select; const { Option } = Select;
...@@ -17,6 +33,20 @@ class StaticBox extends React.Component { ...@@ -17,6 +33,20 @@ class StaticBox extends React.Component {
componentWillUnmount() { // 卸载 componentWillUnmount() { // 卸载
} }
render() { render() {
const { courseChartData, dataAllTotal } = this.props;
const dataCols = {
month: {
type: 'time',
tickCount: 10,
},
};
const courseChart = courseChartData;
const dataChart = [];
const month = courseChart.dates;
const visitorCount = courseChart.visitor_count;
for (let i = 0; i < month.length && i < visitorCount.length; i++) {
dataChart.push({ month: month[i], count: visitorCount[i], name: '访问人数' });
}
return ( return (
<div> <div>
<div className={pageStyle.StaticBox}> <div className={pageStyle.StaticBox}>
...@@ -40,8 +70,52 @@ class StaticBox extends React.Component { ...@@ -40,8 +70,52 @@ class StaticBox extends React.Component {
</div> </div>
</Col> </Col>
</Row> </Row>
<Row style={{ marginBottom: '20px' }}> <Row style={{ marginBottom: '20px', width: 800 }}>
图表页面 <div>
{dataChart.length > 0 ?
<Chart height={350} data={dataChart} padding="auto" scale={dataCols} forceFit>
<Legend
textStyle={{ fontSize: '15', fill: '#5c5c5c', textBaseline: 'middle' }}
marker="circle"
offsetY={-45}
position="top-left"
items={[
{
value: 'visitor_count',
marker: {
fill: '#FFB879',
radius: 2,
},
},
]}
/>
<Axis name="month" />
<Tooltip
g2-tooltip={{
backgroundColor: '#000',
opacity: '0.75',
color: '#FFFFFF',
}}
crosshairs={{
type: 'y',
fill: '#000',
stroke: '#000',
}}
/>
<Geom
type="line"
position="month*count"
color={['name', ['#FFB879']]}
size={3}
shape="smooth"
/>
</Chart>
:
<div className={pageStyle.chartEmpty}>
<Empty />
</div>
}
</div>
</Row> </Row>
</div> </div>
<div className={pageStyle.divideLine} /> <div className={pageStyle.divideLine} />
...@@ -50,17 +124,17 @@ class StaticBox extends React.Component { ...@@ -50,17 +124,17 @@ class StaticBox extends React.Component {
<Row className={pageStyle.staticitemList}> <Row className={pageStyle.staticitemList}>
<Col className={pageStyle.staticitem} lg={4} md={24} xs={24} sm={24}> <Col className={pageStyle.staticitem} lg={4} md={24} xs={24} sm={24}>
<div className={pageStyle.staticIconBox}> <div className={pageStyle.staticIconBox}>
<img className={pageStyle.staticIcon} src="https://cdn.img.shangjiadao.cn/clock-test/member/12186/2019-07-08/240ef0e06262ffb11253e03bf986143c.jpg?x-oss-process=image/resize,w_640/rotate,360/crop,x_176,y_36,w_288,h_288" alt="" /> <img className={pageStyle.staticIcon} src={`${__IMGCDN__}/course/data_icon1.png`} alt="" />
</div> </div>
<div className={pageStyle.staticRight}> <div className={pageStyle.staticRight}>
<div className={pageStyle.staticName}>访问人数</div> <div className={pageStyle.staticName}>访问人数</div>
<div className={pageStyle.staticCount}> <div className={pageStyle.staticCount}>
<span className={pageStyle.count}>1142</span> <span className={pageStyle.count}>{dataAllTotal.visitor_count}</span>
<span className={pageStyle.countAfter}></span> <span className={pageStyle.countAfter}></span>
</div> </div>
</div> </div>
</Col> </Col>
<Col className={pageStyle.staticitem} lg={4} md={24} xs={24} sm={24}> {/* <Col className={pageStyle.staticitem} lg={4} md={24} xs={24} sm={24}>
<div className={pageStyle.staticIconBox}> <div className={pageStyle.staticIconBox}>
<img className={pageStyle.staticIcon} src="https://cdn.img.shangjiadao.cn/clock-test/member/12186/2019-07-08/240ef0e06262ffb11253e03bf986143c.jpg?x-oss-process=image/resize,w_640/rotate,360/crop,x_176,y_36,w_288,h_288" alt="" /> <img className={pageStyle.staticIcon} src="https://cdn.img.shangjiadao.cn/clock-test/member/12186/2019-07-08/240ef0e06262ffb11253e03bf986143c.jpg?x-oss-process=image/resize,w_640/rotate,360/crop,x_176,y_36,w_288,h_288" alt="" />
</div> </div>
...@@ -95,23 +169,23 @@ class StaticBox extends React.Component { ...@@ -95,23 +169,23 @@ class StaticBox extends React.Component {
<span className={pageStyle.countAfter}>人</span> <span className={pageStyle.countAfter}>人</span>
</div> </div>
</div> </div>
</Col> </Col> */}
</Row> </Row>
<div className={pageStyle.staticTitle}>分享数据</div> <div className={pageStyle.staticTitle}>分享数据</div>
<Row className={pageStyle.staticitemList}> <Row className={pageStyle.staticitemList}>
<Col className={pageStyle.staticitem} lg={4} md={24} xs={24} sm={24}> <Col className={pageStyle.staticitem} lg={4} md={24} xs={24} sm={24}>
<div className={pageStyle.staticIconBox}> <div className={pageStyle.staticIconBox}>
<img className={pageStyle.staticIcon} src="https://cdn.img.shangjiadao.cn/clock-test/member/12186/2019-07-08/240ef0e06262ffb11253e03bf986143c.jpg?x-oss-process=image/resize,w_640/rotate,360/crop,x_176,y_36,w_288,h_288" alt="" /> <img className={pageStyle.staticIcon} src={`${__IMGCDN__}/course/data_icon2.png`} alt="" />
</div> </div>
<div className={pageStyle.staticRight}> <div className={pageStyle.staticRight}>
<div className={pageStyle.staticName}>分享好友</div> <div className={pageStyle.staticName}>分享好友</div>
<div className={pageStyle.staticCount}> <div className={pageStyle.staticCount}>
<span className={pageStyle.count}>1142</span> <span className={pageStyle.count}>{dataAllTotal.share_friend_count}</span>
<span className={pageStyle.countAfter}></span> <span className={pageStyle.countAfter}></span>
</div> </div>
</div> </div>
</Col> </Col>
<Col className={pageStyle.staticitem} lg={4} md={24} xs={24} sm={24}> {/* <Col className={pageStyle.staticitem} lg={4} md={24} xs={24} sm={24}>
<div className={pageStyle.staticIconBox}> <div className={pageStyle.staticIconBox}>
<img className={pageStyle.staticIcon} src="https://cdn.img.shangjiadao.cn/clock-test/member/12186/2019-07-08/240ef0e06262ffb11253e03bf986143c.jpg?x-oss-process=image/resize,w_640/rotate,360/crop,x_176,y_36,w_288,h_288" alt="" /> <img className={pageStyle.staticIcon} src="https://cdn.img.shangjiadao.cn/clock-test/member/12186/2019-07-08/240ef0e06262ffb11253e03bf986143c.jpg?x-oss-process=image/resize,w_640/rotate,360/crop,x_176,y_36,w_288,h_288" alt="" />
</div> </div>
...@@ -122,15 +196,15 @@ class StaticBox extends React.Component { ...@@ -122,15 +196,15 @@ class StaticBox extends React.Component {
<span className={pageStyle.countAfter}>人</span> <span className={pageStyle.countAfter}>人</span>
</div> </div>
</div> </div>
</Col> </Col> */}
<Col className={pageStyle.staticitem} lg={4} md={24} xs={24} sm={24}> <Col className={pageStyle.staticitem} lg={4} md={24} xs={24} sm={24}>
<div className={pageStyle.staticIconBox}> <div className={pageStyle.staticIconBox}>
<img className={pageStyle.staticIcon} src="https://cdn.img.shangjiadao.cn/clock-test/member/12186/2019-07-08/240ef0e06262ffb11253e03bf986143c.jpg?x-oss-process=image/resize,w_640/rotate,360/crop,x_176,y_36,w_288,h_288" alt="" /> <img className={pageStyle.staticIcon} src={`${__IMGCDN__}/course/data_icon3.png`} alt="" />
</div> </div>
<div className={pageStyle.staticRight}> <div className={pageStyle.staticRight}>
<div className={pageStyle.staticName}>分享邀请卡</div> <div className={pageStyle.staticName}>分享邀请卡</div>
<div className={pageStyle.staticCount}> <div className={pageStyle.staticCount}>
<span className={pageStyle.count}>1142</span> <span className={pageStyle.count}>{dataAllTotal.share_card_count}</span>
<span className={pageStyle.countAfter}></span> <span className={pageStyle.countAfter}></span>
</div> </div>
</div> </div>
...@@ -140,12 +214,12 @@ class StaticBox extends React.Component { ...@@ -140,12 +214,12 @@ class StaticBox extends React.Component {
<Row className={pageStyle.staticitemList}> <Row className={pageStyle.staticitemList}>
<Col className={pageStyle.staticitem} lg={4} md={24} xs={24} sm={24}> <Col className={pageStyle.staticitem} lg={4} md={24} xs={24} sm={24}>
<div className={pageStyle.staticIconBox}> <div className={pageStyle.staticIconBox}>
<img className={pageStyle.staticIcon} src="https://cdn.img.shangjiadao.cn/clock-test/member/12186/2019-07-08/240ef0e06262ffb11253e03bf986143c.jpg?x-oss-process=image/resize,w_640/rotate,360/crop,x_176,y_36,w_288,h_288" alt="" /> <img className={pageStyle.staticIcon} src={`${__IMGCDN__}/course/data_icon4.png`} alt="" />
</div> </div>
<div className={pageStyle.staticRight}> <div className={pageStyle.staticRight}>
<div className={pageStyle.staticName}>评论</div> <div className={pageStyle.staticName}>评论</div>
<div className={pageStyle.staticCount}> <div className={pageStyle.staticCount}>
<span className={pageStyle.count}>1142</span> <span className={pageStyle.count}>{dataAllTotal.comment_count}</span>
<span className={pageStyle.countAfter}></span> <span className={pageStyle.countAfter}></span>
</div> </div>
</div> </div>
...@@ -160,5 +234,16 @@ StaticBox.propTypes = { ...@@ -160,5 +234,16 @@ StaticBox.propTypes = {
}; };
export default StaticBox; const StaticBoxForm = Form.create()(StaticBox);
function mapStateToProps(state) {
const {
courseChartData,
dataAllTotal,
} = state.onlineclasses;
return {
courseChartData,
dataAllTotal,
};
}
export default connect(mapStateToProps)(StaticBoxForm);
...@@ -76,7 +76,7 @@ class singleDetailForm extends React.Component { ...@@ -76,7 +76,7 @@ class singleDetailForm extends React.Component {
<div className={pageStyle.container}> <div className={pageStyle.container}>
<div className={pageStyle.head}> <div className={pageStyle.head}>
<div className={pageStyle.hedaTitle}> <div className={pageStyle.hedaTitle}>
<img src="https://gw.alipayobjects.com/zos/rmsportal/KDpgvguMpGfqaHPjicRK.svg" alt="" /> <img src={`${__IMGCDN__}/course/book_icon.png`} alt="" />
<div className={pageStyle.title}>{addCourseObj.title}</div> <div className={pageStyle.title}>{addCourseObj.title}</div>
<Dropdown className={pageStyle.editStatus} overlay={menu} trigger={['click']}> <Dropdown className={pageStyle.editStatus} overlay={menu} trigger={['click']}>
<a className="ant-dropdown-link" href="#"> <a className="ant-dropdown-link" href="#">
......
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