|
|
@@ -104,6 +104,7 @@ class Add extends Component{
|
|
|
loading: false,
|
|
|
projectType: '',
|
|
|
sort:'',
|
|
|
+ summary:'',
|
|
|
name:'',
|
|
|
pictureVideoUrl: '',
|
|
|
pictureImgUrl: '',
|
|
|
@@ -129,14 +130,21 @@ class Add extends Component{
|
|
|
}
|
|
|
|
|
|
getVideoOrgCodeUrl(e) {
|
|
|
- let str = e[0].type;
|
|
|
- let index = str.indexOf("/");
|
|
|
- let type =str.substring(0,index);
|
|
|
- console.log(type)
|
|
|
- this.setState({
|
|
|
- pictureVideoUrl: e,
|
|
|
- commodityType: type === 'video' ? 1 : type === 'audio' ? 2 : 0,
|
|
|
- });
|
|
|
+ if(e.length === 0){
|
|
|
+ this.setState({
|
|
|
+ pictureVideoUrl: '',
|
|
|
+ commodityType: 0,
|
|
|
+ });
|
|
|
+ }else{
|
|
|
+ let str = e[0].type;
|
|
|
+ let index = str.indexOf("/");
|
|
|
+ let type =str.substring(0,index);
|
|
|
+ this.setState({
|
|
|
+ pictureVideoUrl: e,
|
|
|
+ commodityType: type === 'video' ? 1 : type === 'audio' ? 2 : 0,
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
onOk(releaseStatus = 0){
|
|
|
@@ -152,10 +160,10 @@ class Add extends Component{
|
|
|
message.warning('请输入正确的金额');
|
|
|
return false;
|
|
|
}
|
|
|
- if(this.state.pictureVideoUrl.length === 0){
|
|
|
- message.warning('请上传视频/音频');
|
|
|
- return false;
|
|
|
- }
|
|
|
+ // if(this.state.pictureVideoUrl.length === 0){
|
|
|
+ // message.warning('请上传视频/音频');
|
|
|
+ // return false;
|
|
|
+ // }
|
|
|
if(this.state.pictureImgUrl.length === 0){
|
|
|
message.warning('请上传略缩图');
|
|
|
return false;
|
|
|
@@ -180,12 +188,13 @@ class Add extends Component{
|
|
|
data: {
|
|
|
name: this.state.name || undefined,
|
|
|
sort:this.state.sort || undefined,
|
|
|
+ summary:this.state.summary || undefined,
|
|
|
content: this.state.content || undefined,
|
|
|
commodityContent: this.state.commodityContent || undefined,
|
|
|
id: this.props.id || undefined,
|
|
|
type: this.state.projectType,
|
|
|
amount: this.state.amount || undefined,
|
|
|
- commodityUrl: this.state.pictureVideoUrl[0].response.data || undefined,
|
|
|
+ commodityUrl: this.state.pictureVideoUrl ? this.state.pictureVideoUrl[0].response.data : '',
|
|
|
commodityType: this.state.commodityType,
|
|
|
thumbnailUrl: this.state.pictureImgUrl[0].response.data || undefined,
|
|
|
host: this.state.host,
|
|
|
@@ -229,11 +238,12 @@ class Add extends Component{
|
|
|
this.setState({
|
|
|
name: this.props.infor.name,
|
|
|
sort:this.props.infor.sort,
|
|
|
+ summary:this.props.infor.summary,
|
|
|
content: this.props.infor.content,
|
|
|
commodityContent: this.props.infor.commodityContent,
|
|
|
projectType: this.props.infor.type,
|
|
|
amount: this.props.infor.amount,
|
|
|
- pictureVideoUrl: this.props.infor.commodityUrl ? splitUrl(this.props.infor.commodityUrl, ',', globalConfig.avatarHost + '/upload') : [],
|
|
|
+ pictureVideoUrl: this.props.infor.commodityUrl ? splitUrl(this.props.infor.commodityUrl, ',', globalConfig.avatarHost + '/upload') : '',
|
|
|
pictureImgUrl: this.props.infor.thumbnailUrl ? splitUrl(this.props.infor.thumbnailUrl, ',', globalConfig.avatarHost + '/upload') : [],
|
|
|
host: this.props.infor.host,
|
|
|
commodityType:this.props.infor.commodityType
|
|
|
@@ -352,6 +362,22 @@ class Add extends Component{
|
|
|
/>
|
|
|
<p>数字越大,排序越前</p>
|
|
|
</FormItem>
|
|
|
+ <FormItem
|
|
|
+ className="half-item"
|
|
|
+ labelCol={{ span: 8 }}
|
|
|
+ wrapperCol={{ span: 12 }}
|
|
|
+ label="摘要"
|
|
|
+ >
|
|
|
+ <Input
|
|
|
+ placeholder="请输入摘要"
|
|
|
+ value={this.state.summary}
|
|
|
+ onChange={e => {
|
|
|
+ this.setState({
|
|
|
+ summary: e.target.value
|
|
|
+ });
|
|
|
+ }}
|
|
|
+ />
|
|
|
+ </FormItem>
|
|
|
<div className="clearfix">
|
|
|
<FormItem
|
|
|
className="half-item"
|