Commit a096ee83 authored by wangtao's avatar wangtao

'最新代码提交'

parents 5a760857 a6321435
......@@ -18,5 +18,5 @@
</head>
<body>
<div id="root"></div>
<script type="text/javascript" src="https://cdn.img.shangjiadao.cn/qingxiao/biz/dist/main.828990.js"></script></body>
<script type="text/javascript" src="/dist/main.05bc89.js"></script></body>
</html>
\ No newline at end of file
This diff is collapsed.
......@@ -1064,11 +1064,11 @@ export default {
});
}
if (pathname === '/sjd/newtheme') {
dispatch({
type: 'createtheme/pageInit',
payload: {
},
});
// dispatch({
// type: 'createtheme/pageInit',
// payload: {
// },
// });
dispatch({
type: 'createtheme/queryClassList',
payload: {
......
......@@ -10,7 +10,6 @@ class Errorpage extends React.Component {
componentWillUnmount() { // 卸载
}
goback = () => {
console.log('dsadasdsa');
const {
dispatch,
} = this.props;
......
import { connect } from 'dva';
import React from 'react';
import { Icon, Divider, Tabs, Select, Form, Upload, Row, Col, Input, Radio, Modal, message } from 'antd';
import { Icon, Divider, Tabs, Select, Form, Upload, Row, Col, Input, Radio, Modal, message, Progress } from 'antd';
import pageStyle from './ThemeEditor.less';
import { pageIn, hasBtnPower, imagify, ossVideofy, audioorigin } from '../../utils/index';
const upImg = `${__IMGCDN__}subjectUp.png`;
......@@ -45,9 +45,16 @@ class ThemeEditor extends React.Component {
editorAddText,
moveContent,
editorUploadVoice,
progressRate,
} = this.props;
return (
<div className={pageStyle.container}>
{progressRate && progressRate > 0 ?
<div className={pageStyle.progressWrap}>
<Progress width={150} type="circle" percent={progressRate} />
<p> {progressRate == 100 ? '上传成功' : '上传中。。。'}</p>
</div> : ''
}
<div className={pageStyle.editorwrap}>
{/* eslint-disable-next-line array-callback-return,consistent-return */}
{commentParams.content.length > 0 && commentParams.content.map((item, index) => {
......@@ -124,6 +131,7 @@ class ThemeEditor extends React.Component {
<div className={pageStyle.uploadimg}><input type="file" id="uploadVoice" className={pageStyle.fileuploadinput} onChange={editorUploadVoice} accept="audio/mp3" /><Icon style={{ marginRight: 10 }} type="audio" />添加录音</div>
<div className={pageStyle.uploadimg}><input type="file" id="uploadVideo" className={pageStyle.fileuploadinput} onChange={editorUploadAudio} accept="video/mp4,video/*" /><Icon style={{ marginRight: 10 }} type="video-camera" />添加视频</div>
</div>
<p className={pageStyle.tip}>请上传视频小于1G,支持MP4格式</p>
<Modal visible={previewVisible} footer={null} onCancel={this.handleCancel}>
<img alt="图片" style={{ width: '100%' }} src={imagify(previewImage)} />
</Modal>
......
......@@ -182,3 +182,28 @@
z-index: 1;
}
}
.progressWrap {
width: 300px;
height: 300px;
position: fixed;
left: 50%;
top: 50%;
transform: translate(-50%,-50%);
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
background-color: #f1f1f1;
border-radius: 15px;
z-index: 9999;
&>p {
font-size: 18px;
margin-top: 30px;
color: #1e8bff;
}
}
.tip {
color: #888;
margin-top: 8px;
line-height: 20px;
}
\ No newline at end of file
......@@ -137,6 +137,14 @@ class CalendarClockForm extends React.Component {
payload: {
files: e.target,
uploadtype: 'uploadVideoCalendar',
progressCallBack(res) {
dispatch({
type: 'createtheme/updateState',
payload: {
progressRate: ((res.loaded / res.total) * 100).toFixed(0),
},
});
},
},
});
}
......@@ -262,6 +270,7 @@ class CalendarClockForm extends React.Component {
currentTimestamp,
selectPlanDays,
isCopy,
progressRate,
} = this.props;
let new_rest_dates = [];
new_rest_dates = [...new Set(new_rest_dates.concat(...rest_dates))];
......@@ -632,6 +641,7 @@ class CalendarClockForm extends React.Component {
deleteThemeImg={this.deleteCalendarImg}
editorAddText={this.calendarAddText}
moveContent={this.calendarMoveContent}
progressRate={progressRate}
/>
<FormItem {...submitFormLayout} style={{ marginTop: 32 }}>
<Button type="primary" htmlType="submit" loading={themeAddLoading}>
......@@ -659,6 +669,7 @@ function mapStateToProps(state) {
currentTimestamp,
selectPlanDays,
isCopy,
progressRate,
} = state.createtheme;
return {
themeAddLoading,
......@@ -671,6 +682,7 @@ function mapStateToProps(state) {
currentTimestamp,
selectPlanDays,
isCopy,
progressRate,
};
}
export default connect(mapStateToProps)(CalendarClock);
......
......@@ -103,6 +103,14 @@ class ContentSettingForm extends React.Component {
payload: {
files: e.target,
uploadtype: 'uploadVideoEmigrate',
progressCallBack(res) {
dispatch({
type: 'createtheme/updateState',
payload: {
progressRate: ((res.loaded / res.total) * 100).toFixed(0),
},
});
},
},
});
}
......@@ -233,6 +241,7 @@ class ContentSettingForm extends React.Component {
screenIsBig,
isShowCustoms,
subjectList,
progressRate,
} = this.props;
const formItemModalLineLayout = {
labelCol: {
......@@ -330,6 +339,7 @@ class ContentSettingForm extends React.Component {
editorUploadAudio={this.emigrateUploadAudio}
editorChange={this.changeEmigrateText}
deleteThemeImg={this.deleteEmigrate}
progressRate={progressRate}
/>
</div>
</FormItem>
......@@ -488,6 +498,7 @@ function mapStateToProps(state) {
customsNumberList,
isShowCustoms,
subjectList,
progressRate,
} = state.createtheme;
const { collapsed, screenIsBig } = state.webapp;
return {
......@@ -502,6 +513,7 @@ function mapStateToProps(state) {
screenIsBig,
isShowCustoms,
subjectList,
progressRate,
};
}
export default connect(mapStateToProps)(ContentSetting);
......
......@@ -15,11 +15,12 @@ import {
Collapse,
DatePicker,
Select, Radio, InputNumber, Input, message,
Progress,
} from 'antd';
import moment from 'moment';
import pageStyle from './Unclock.less';
import { hasBtnPower, imagify } from '../../../utils';
import ThemeEditor from '../ThemeEditor';
import { hasBtnPower, imagify } from '../../../utils/index';
import ThemeEditorOne from './components/ThemeEditor';
const { TabPane } = Tabs;
const FormItem = Form.Item;
const { Option } = Select;
......@@ -139,37 +140,48 @@ class UnClockForm extends React.Component {
},
});
}
customsUploadImg = (e) => {
customsUploadImg = (e, sort) => {
const { dispatch } = this.props;
dispatch({
type: 'createtheme/queryimagesignature',
payload: {
files: e.target,
uploadtype: 'quickCustomsImg',
contentSort: sort,
},
});
}
customsUploadAudio = (e) => {
customsUploadAudio = (e, sort) => {
const { dispatch } = this.props;
dispatch({
type: 'createtheme/queryvideosignature',
payload: {
files: e.target,
uploadtype: 'uploadVideoCustoms',
contentSort: sort,
progressCallBack(res) {
dispatch({
type: 'createtheme/updateState',
payload: {
progressRate: ((res.loaded / res.total) * 100).toFixed(0),
},
});
},
},
});
}
customsUploadVoice = (e) => {
customsUploadVoice = (e, sort) => {
const { dispatch } = this.props;
dispatch({
type: 'createtheme/queryvoicesignature',
payload: {
files: e.target,
uploadtype: 'uploadVoiceCustoms',
contentSort: sort,
},
});
}
customsChangeSize = (e, index) => {
customsChangeSize = (e, index, sort) => {
const { dispatch } = this.props;
const textValue = e.target.value;
if (textValue.length > 500) {
......@@ -181,36 +193,72 @@ class UnClockForm extends React.Component {
payload: {
textValue,
index,
sort,
},
});
}
customsChangeTitle = (e, sort) => {
const { dispatch } = this.props;
const textValue = e.target.value;
if (textValue.length > 20) {
message.warning('最多20字', 0.5);
return;
}
dispatch({
type: 'createtheme/customsChangeTitle',
payload: {
textValue,
sort,
},
});
}
deleteCustomsImg = (index) => {
deleteCustomsImg = (index, sort) => {
const { dispatch } = this.props;
dispatch({
type: 'createtheme/deleteCustomsImg',
payload: {
index,
sort,
},
});
}
customsAddText = () => {
customsAddText = (index) => {
const { dispatch } = this.props;
dispatch({
type: 'createtheme/changeCustomsText',
payload: {
index,
},
});
}
customsAddPlate = () => {
const { dispatch } = this.props;
dispatch({
type: 'createtheme/customsAddPlate',
payload: {
},
});
}
customsMoveContent = (index, direction) => {
customsMoveContent = (index, sort, direction) => {
const { dispatch } = this.props;
dispatch({
type: 'createtheme/customsMoveContent',
payload: {
index,
sort,
direction,
},
});
}
customsDeletePlate = (sort) => {
const { dispatch } = this.props;
dispatch({
type: 'createtheme/customsDeletePlate',
payload: {
sort,
},
});
}
uploadBanner = (e) => {
const { dispatch } = this.props;
dispatch({
......@@ -249,6 +297,7 @@ class UnClockForm extends React.Component {
radioList,
collapsed,
screenIsBig,
progressRate,
} = this.props;
const formItemModalLineLayout = {
labelCol: {
......@@ -480,7 +529,7 @@ class UnClockForm extends React.Component {
</FormItem>
<FormItem {...formItemModaltypeLayout} label="闯关介绍">
<div className={pageStyle.introduceWrap}>
<ThemeEditor
<ThemeEditorOne
commentParams={customsParams}
editorUploadImg={this.customsUploadImg}
editorUploadAudio={this.customsUploadAudio}
......@@ -489,6 +538,10 @@ class UnClockForm extends React.Component {
deleteThemeImg={this.deleteCustomsImg}
moveContent={this.customsMoveContent}
editorAddText={this.customsAddText}
editorAddPlate={this.customsAddPlate}
editorChangeTitle={this.customsChangeTitle}
editorDeletePlate={this.customsDeletePlate}
progressRate={progressRate}
/>
</div>
</FormItem>
......@@ -533,6 +586,7 @@ function mapStateToProps(state) {
customsParams,
radioname,
radioList,
progressRate,
} = state.createtheme;
const { collapsed, screenIsBig } = state.webapp;
return {
......@@ -543,6 +597,7 @@ function mapStateToProps(state) {
radioList,
collapsed,
screenIsBig,
progressRate,
};
}
export default connect(mapStateToProps)(UnClock);
......
......@@ -226,7 +226,7 @@
.introduceWrap {
width: 650px;
min-height: 319px;
padding: 0 40px 126px;
padding:20px;
background-color: #fafafa;
-webkit-border-radius: 4px;
border-radius: 4px;
......
......@@ -103,6 +103,14 @@ class UnclockDetailForm extends React.Component {
payload: {
files: e.target,
uploadtype: 'uploadVideoEmigrate',
progressCallBack(res) {
dispatch({
type: 'createtheme/updateState',
payload: {
progressRate: ((res.loaded / res.total) * 100).toFixed(0),
},
});
},
},
});
}
......@@ -204,6 +212,7 @@ class UnclockDetailForm extends React.Component {
collapsed,
screenIsBig,
emigratedObj,
progressRate,
} = this.props;
const formItemModalLineLayout = {
labelCol: {
......@@ -284,6 +293,7 @@ class UnclockDetailForm extends React.Component {
editorUploadAudio={this.emigrateUploadAudio}
editorChange={this.changeEmigrateText}
deleteThemeImg={this.deleteEmigrate}
progressRate={progressRate}
/>
</div>
</FormItem>
......@@ -434,6 +444,7 @@ function mapStateToProps(state) {
emigratedObj,
releaseLoading,
customsNumberList,
progressRate,
} = state.createtheme;
const { collapsed, screenIsBig } = state.webapp;
return {
......@@ -444,6 +455,7 @@ function mapStateToProps(state) {
customsNumberList,
collapsed,
screenIsBig,
progressRate,
};
}
export default connect(mapStateToProps)(UnclockDetail);
......
......@@ -99,6 +99,14 @@ class UnclockDetailForm extends React.Component {
payload: {
files: e.target,
uploadtype: 'uploadVideoEmigrate',
progressCallBack(res) {
dispatch({
type: 'createtheme/updateState',
payload: {
progressRate: ((res.loaded / res.total) * 100).toFixed(0),
},
});
},
},
});
}
......@@ -192,6 +200,7 @@ class UnclockDetailForm extends React.Component {
collapsed,
screenIsBig,
emigratedObj,
progressRate,
} = this.props;
const formItemModalLineLayout = {
labelCol: {
......@@ -256,6 +265,7 @@ class UnclockDetailForm extends React.Component {
editorUploadAudio={this.emigrateUploadAudio}
editorChange={this.changeEmigrateText}
deleteThemeImg={this.deleteEmigrate}
progressRate={progressRate}
/>
</div>
</FormItem>
......@@ -406,6 +416,7 @@ function mapStateToProps(state) {
emigratedObj,
releaseLoading,
customsNumberList,
progressRate,
} = state.createtheme;
const { collapsed, screenIsBig } = state.webapp;
return {
......@@ -416,6 +427,7 @@ function mapStateToProps(state) {
customsNumberList,
collapsed,
screenIsBig,
progressRate,
};
}
export default connect(mapStateToProps)(UnclockDetail);
......
This diff is collapsed.
.textWrap {
width: 560px;
height: auto;
position: relative;
margin-bottom:10px;
:global {
.ant-input {
padding: 6px 15px 20px;
}
}
.sizeNumber {
position: absolute;
bottom: 8px;
right: 10px;
}
}
.editorwrap {
//width: 563px;
margin-top: 15px;
.videowrap {
width: 100%;
height: 200px;
position: relative;
margin-bottom: 10px;
.videoPoster {
width: 100%;
height: 100%;
}
}
.videowrap:hover {
cursor: pointer;
.videohide {
opacity: 1;
background-color: rgba(0,0,0,0.5);
transition: all .3s;
z-index: 1;
color: #fff;
}
}
.videohide {
position: absolute;
width: 100%;
height: 100%;
bottom: 0;
left: 0;
display: flex;
justify-content: center;
align-items: center;
opacity: 0;
color: #fff;
z-index: -1;
a {
color: #fff;
}
}
.uploadimgbox {
display: flex;
align-items: flex-end;
margin-bottom: 18px;
flex-wrap: wrap;
.imgwrap {
width: 100%;
// height: 120px;
border-radius: 4px;
margin-right: 6px;
position: relative;
.uploadimgwrap {
width: 100%;
// height: 120px;
overflow: hidden;
}
}
.imgwrap:hover {
cursor: pointer;
.imghide {
opacity: 1;
background-color: rgba(0,0,0,0.5);
transition: all .3s;
z-index: 1;
color: #fff;
}
}
.imghide {
position: absolute;
width: 100%;
height: 100%;
bottom: 0;
left: 0;
display: flex;
justify-content: center;
align-items: center;
opacity: 0;
color: #fff;
z-index: -1;
a {
color: #fff;
}
}
.teacheruploadimg {
object-fit: contain;
border-radius: 4px;
width: 100%;
}
.teacheruploadimg:nth-child(4n){
margin-right: 0;
}
}
}
.uploadflex {
display: flex;
align-items: center;
margin-top: 20px;
.uploadimg {
cursor: pointer;
width: 106px;
height: 32px;
line-height: 32px;
text-align: center;
border: 1px solid #D9D9D9;
border-radius: 4px;
color: rgba(0,0,0,0.65);
position: relative;
margin-right: 30px;
.fileuploadinput {
cursor: pointer;
position: absolute;
width: 100%;
height: 100%;
z-index: 1;
opacity: 0;
left: 0;
top: 0;
}
}
}
.toolList {
position: absolute;
right: -30px;
top: 0;
width: 30px;
height: 90px;
display: flex;
flex-direction: column;
background-color: #D3D3D3;
opacity: 0;
border-radius: 2px;
z-index: -1;
div {
width: 30px;
height: 30px;
display: flex;
align-items: center;
justify-content: center;
color: #fff;
font-size: 14px;
cursor: pointer;
}
div>img {
width: 14px;
height: 14px;
}
.up:hover {
background-color: #1890FF;
}
.down,.nodown {
transform: rotate(180deg);
}
.nodown,.noup {
cursor: not-allowed;
}
.down:hover {
background-color: #1890FF;
}
.delete:hover {
background-color: #FF6060;
}
}
.textWrap:hover,.imgwrap:hover,.videowrap:hover {
.toolList {
opacity: 1;
z-index: 1;
}
}
.addPlate {
width: 214px;
height: 34px;
line-height: 34px;
text-align: center;
color: #65B8F4;
border: 1px solid #65B8F4;
border-radius: 17px;
margin: 40px auto 0;
cursor: pointer;
}
.plateWrap {
border:2px dashed rgba(208,208,208,1);
padding: 20px;
margin-bottom: 30px;
position: relative;
}
.plateDelete {
position: absolute;
right: -20px;
top: -25px;
font-size: 30px;
color: #FF6060;
cursor: pointer;
}
.progressWrap {
width: 300px;
height: 300px;
position: fixed;
left: 50%;
top: 50%;
transform: translate(-50%,-50%);
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
background-color: #f1f1f1;
border-radius: 15px;
z-index: 9999;
&>p {
font-size: 18px;
margin-top: 30px;
color: #1e8bff;
}
}
\ No newline at end of file
......@@ -118,6 +118,14 @@ class JobClockForm extends React.Component {
payload: {
files: e.target,
uploadtype: 'uploadVideoJob',
progressCallBack(res) {
dispatch({
type: 'createtheme/updateState',
payload: {
progressRate: ((res.loaded / res.total) * 100).toFixed(0),
},
});
},
},
});
}
......@@ -205,6 +213,7 @@ class JobClockForm extends React.Component {
jobParams,
editorText,
isCopy,
progressRate,
} = this.props;
const formItemModalLineLayout = {
labelCol: {
......@@ -469,6 +478,7 @@ class JobClockForm extends React.Component {
deleteThemeImg={this.deleteJobImg}
moveContent={this.jobMoveContent}
editorAddText={this.jobAddText}
progressRate={progressRate}
/>
<FormItem {...submitFormLayout} style={{ marginTop: 32 }}>
<Button type="primary" htmlType="submit" loading={themeAddLoading}>
......@@ -491,6 +501,7 @@ function mapStateToProps(state) {
jobParams,
editorText,
isCopy,
progressRate,
} = state.createtheme;
return {
themeAddLoading,
......@@ -498,6 +509,7 @@ function mapStateToProps(state) {
jobParams,
editorText,
isCopy,
progressRate,
};
}
export default connect(mapStateToProps)(JobClock);
......
......@@ -272,14 +272,12 @@ class ThemeMgt extends React.Component {
},
{
title: '打卡人数',
dataIndex: 'clock_count',
dataIndex: 'clock_student_count',
align: 'center',
key: 'student_total',
key: 'clock_student_count',
render: (text, record, index) => (
<div className={pageStyle.tablecell}>
{record.subject_type == 1 && record.student_total}
{record.subject_type == 2 && record.student_total}
{record.subject_type == 3 && record.class_students_count}
{text}
</div>
),
},
......
......@@ -27,7 +27,7 @@ export function uploadVideoSignature({ type, token, schoolId }) {
});
}
export function uploadVideo(params) {
export function uploadVideo(params, progressCallback) {
const {
OSSAccessKeyId,
file,
......@@ -35,12 +35,17 @@ export function uploadVideo(params) {
policy,
signature,
url,
callback,
} = params;
const formData = new FormData();
formData.append('key', key);
formData.append('policy', policy);
formData.append('OSSAccessKeyId', OSSAccessKeyId);
formData.append('signature', signature);
if (callback) {
formData.append('callback', callback);
}
formData.append('success_action_status', 200);
formData.append('file', file);
return request({
url: params.url,
......@@ -50,6 +55,16 @@ export function uploadVideo(params) {
'Content-Type': 'multipart/form-data',
},
data: formData,
retry: 0,
onUploadProgress(progressEvent) { // 原生获取上传进度的事件
if (progressEvent.lengthComputable) {
// 属性lengthComputable主要表明总共需要完成的工作量和已经完成的工作是否可以被测量
// 如果lengthComputable为false,就获取不到progressEvent.total和progressEvent.loaded
if (progressCallback && (typeof progressCallback == 'function')) {
progressCallback(progressEvent);
}
}
},
});
}
export function uploadImageSignature({ type, token, schoolId }) {
......
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