liting2017 6 years ago
parent
commit
66681c36c7

+ 7 - 4
js/component/administration/video/videoForm.jsx

@@ -81,7 +81,11 @@ const NewDetailForm = Form.create()(React.createClass({
 			}else{
 				message.warning('请上传视频文件!');
 				return false;
-			}
+			};
+			if(!theVideoUrl.length){
+				message.warning('请上传视频文件!');
+				return false;
+			};
             if (!this.state.videoImg.length) {
 				message.warning('请上传视频封面图片!');
 				return false;
@@ -132,7 +136,7 @@ const NewDetailForm = Form.create()(React.createClass({
         } else {
 			this.state.data = {};
 			this.state.videoImg = [];
-			this.state.videoUrl=[];
+			this.state.fileList=[];
         };
 	},
     componentWillReceiveProps(nextProps) {
@@ -143,7 +147,7 @@ const NewDetailForm = Form.create()(React.createClass({
 				this.state.data = {};
 				this.state.videoImg = [];
 				this.state.theData={};
-				this.state.videoUrl=[];
+				this.state.fileList=[];
             };
 			this.props.form.resetFields();
         };
@@ -203,7 +207,6 @@ const NewDetailForm = Form.create()(React.createClass({
             wrapperCol: { span: 12 },
 		};
 		const fileList= this.state.fileList||[];
-		console.log(fileList)
         return (
 			<div className='login'>
 			<Form layout="horizontal" onSubmit={(e)=>{this.handleSubmit(e,0)}} id="demand-form">

+ 1 - 5
js/component/crop/cropBlock.jsx

@@ -62,11 +62,7 @@ class CropBlock extends Component {
 		}
 	}
 	componentWillReceiveProps(data){
-		if(data.urlArr.length>0){
-			this.setState({
-				urlArr:data.urlArr
-			})
-		}
+		this.state.urlArr=data.urlArr;
 	}
 	render() {
 		let imgList = this.state.urlArr.map((src, index) =>