Commit ab3abbcd authored by baixian's avatar baixian

111222dd

parent 09c6b068
......@@ -191,7 +191,7 @@ export default {
isFather: false,
noIcon: true,
path: '/sjd/coursegather',
relativePath: ['/sjd/coursegather'],
relativePath: ['/sjd/coursegather', '/sjd/gatherdetail/:id'],
},
{
id: '33',
......
This diff is collapsed.
......@@ -2,6 +2,7 @@
import { routerRedux } from 'dva/router';
import { message } from 'antd';
import { delay } from 'redux-saga';
import moment from 'moment';
import {
LocalStorage,
SessionStorage,
......@@ -36,6 +37,9 @@ export default {
content: '',
},
addLoading: false,
editLoading: false,
materialVisible: false,
courseChartData: {},
},
subscriptions: {
setup({ dispatch, history }) { // eslint-disable-line
......@@ -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 }) {
const { sid } = yield select(state => state.webapp);
const { id } = payload;
......@@ -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 {
yield put({
type: 'webapp/errorrequestresolve',
......@@ -190,7 +252,6 @@ export default {
} = payload;
addCourseObj.intro = JSON.stringify(addCourseObj.intro);
const newCourseObj = { ...addCourseObj };
console.log(addCourseObj, 'addCourseObj1111111111111111111');
const loadmessage = message.loading('保存中...', 0);
const newParams = Object.assign(newCourseObj, {
title,
......@@ -609,6 +670,9 @@ export default {
],
},
addLoading: false,
editLoading: false,
materialVisible: false,
courseChartData: {},
},
});
},
......
......@@ -12,6 +12,24 @@
.photoWrap {
display: inline-flex;
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 {
width: 140px;
height: 140px;
......@@ -22,6 +40,18 @@
align-items: center;
flex-direction: column;
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 {
font-size:14px;
font-weight:400;
......@@ -62,4 +92,28 @@
}
.voice {
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 {
<div className={pageStyle.container}>
<div className={pageStyle.tabbox}>
<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.titlebox}>
<span className={pageStyle.title}>{gatherDetail.title || ''}</span>
......
import React from 'react';
import { Icon } from 'antd';
import pageStyle from './Card.less';
import { imagify } from '../../../utils';
const MediaCard = (props) => {
const {
info,
......@@ -8,7 +9,7 @@ const MediaCard = (props) => {
} = props;
return (
<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.topbox}>
<div className={pageStyle.title}>{info.title}</div>
......
......@@ -135,7 +135,7 @@ class CourseDetailForm extends React.Component {
payload: {
title,
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,
callBack: () => {
form.resetFields();
......@@ -236,7 +236,6 @@ class CourseDetailForm extends React.Component {
});
}
materialSave = (values) => {
console.log(values, '1111111111111');
const { dispatch } = this.props;
dispatch({
type: 'onlineclasses/updateCover',
......@@ -265,7 +264,6 @@ class CourseDetailForm extends React.Component {
queryParams,
materiaListTotal,
} = this.props;
console.log(addCourseObj, 'addCourseObj');
const formItemModalLineLayout = {
labelCol: {
xs: { span: 24 },
......
import React from 'react';
import { connect } from 'dva';
import {
Row,
Col,
Select,
Button,
DatePicker,
Empty,
DatePicker, Form,
} from 'antd';
import {
G2,
Chart,
Geom,
Axis,
Tooltip,
Coord,
Label,
Legend,
View,
Guide,
Shape,
Facet,
Util,
} from 'bizcharts';
import pageStyle from './StaticBox.less';
const { RangePicker } = DatePicker;
const { Option } = Select;
......@@ -17,6 +33,20 @@ class StaticBox extends React.Component {
componentWillUnmount() { // 卸载
}
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 (
<div>
<div className={pageStyle.StaticBox}>
......@@ -40,8 +70,52 @@ class StaticBox extends React.Component {
</div>
</Col>
</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>
</div>
<div className={pageStyle.divideLine} />
......@@ -50,17 +124,17 @@ class StaticBox extends React.Component {
<Row className={pageStyle.staticitemList}>
<Col className={pageStyle.staticitem} lg={4} md={24} xs={24} sm={24}>
<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 className={pageStyle.staticRight}>
<div className={pageStyle.staticName}>访问人数</div>
<div className={pageStyle.staticCount}>
<span className={pageStyle.count}>1142</span>
<span className={pageStyle.count}>{dataAllTotal.visitor_count}</span>
<span className={pageStyle.countAfter}></span>
</div>
</div>
</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}>
<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>
......@@ -95,23 +169,23 @@ class StaticBox extends React.Component {
<span className={pageStyle.countAfter}>人</span>
</div>
</div>
</Col>
</Col> */}
</Row>
<div className={pageStyle.staticTitle}>分享数据</div>
<Row className={pageStyle.staticitemList}>
<Col className={pageStyle.staticitem} lg={4} md={24} xs={24} sm={24}>
<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 className={pageStyle.staticRight}>
<div className={pageStyle.staticName}>分享好友</div>
<div className={pageStyle.staticCount}>
<span className={pageStyle.count}>1142</span>
<span className={pageStyle.count}>{dataAllTotal.share_friend_count}</span>
<span className={pageStyle.countAfter}></span>
</div>
</div>
</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}>
<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>
......@@ -122,15 +196,15 @@ class StaticBox extends React.Component {
<span className={pageStyle.countAfter}>人</span>
</div>
</div>
</Col>
</Col> */}
<Col className={pageStyle.staticitem} lg={4} md={24} xs={24} sm={24}>
<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 className={pageStyle.staticRight}>
<div className={pageStyle.staticName}>分享邀请卡</div>
<div className={pageStyle.staticCount}>
<span className={pageStyle.count}>1142</span>
<span className={pageStyle.count}>{dataAllTotal.share_card_count}</span>
<span className={pageStyle.countAfter}></span>
</div>
</div>
......@@ -140,12 +214,12 @@ class StaticBox extends React.Component {
<Row className={pageStyle.staticitemList}>
<Col className={pageStyle.staticitem} lg={4} md={24} xs={24} sm={24}>
<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 className={pageStyle.staticRight}>
<div className={pageStyle.staticName}>评论</div>
<div className={pageStyle.staticCount}>
<span className={pageStyle.count}>1142</span>
<span className={pageStyle.count}>{dataAllTotal.comment_count}</span>
<span className={pageStyle.countAfter}></span>
</div>
</div>
......@@ -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 {
<div className={pageStyle.container}>
<div className={pageStyle.head}>
<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>
<Dropdown className={pageStyle.editStatus} overlay={menu} trigger={['click']}>
<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