|
@@ -346,6 +346,17 @@ class MsgComponent extends React.Component {
|
|
|
this.setState({ msgId: nextProps.msgId }, () => { self.loadImgs(); ; });
|
|
|
}
|
|
|
}
|
|
|
+ onFinish = e => {
|
|
|
+ e.preventDefault();
|
|
|
+ this.props.form.validateFieldsAndScroll((errors, values) => {
|
|
|
+ console.log('Success:', errors,values);
|
|
|
+ if (errors) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ // this.props.bottomFriom(values);
|
|
|
+ })
|
|
|
+
|
|
|
+ };
|
|
|
loadImgs(){
|
|
|
let self = this;
|
|
|
let mediaId = '';
|
|
@@ -627,7 +638,6 @@ class MsgComponent extends React.Component {
|
|
|
|
|
|
<Form.Item label="添加图片">
|
|
|
<div style={{ display: "flex" }}>
|
|
|
- {/* <div>添加图片:</div> */}
|
|
|
<div onMouseOver={this.mouseOver} onMouseOut={this.mouseOut}
|
|
|
style={{ position: "relative", display: (this.state.imgUrlText != '') ? "block" : "none", width: "150px", height: "150px", border: "1px solid #D7D7D7", marginLeft: "7px", cursor: "pointer" }}>
|
|
|
<img style={{ width: "100%", height: "100%" }} src={imgUrlText} />
|
|
@@ -648,28 +658,9 @@ class MsgComponent extends React.Component {
|
|
|
|
|
|
</Form.Item>
|
|
|
</Form>
|
|
|
- {/* <div style={{ display: "flex", marginLeft: "70px" }}>
|
|
|
- <div>添加图片:</div>
|
|
|
- <div onMouseOver={this.mouseOver} onMouseOut={this.mouseOut}
|
|
|
- style={{ position: "relative", display: (this.state.imgUrlText != '') ? "block" : "none", width: "150px", height: "150px", border: "1px solid #D7D7D7", marginLeft: "7px", cursor: "pointer" }}>
|
|
|
- <img style={{ width: "100%", height: "100%" }} src={this.state.imgUrlText} />
|
|
|
- <div style={{ display: this.state.mouseOver ? "block" : "none", width: "150px", height: "150px", lineHeight: "150px", position: "absolute", top: "0px", left: "0px", backgroundColor: "#000", opacity: "0.7", color: "#fff" }}>
|
|
|
- <span onClick={self.upload1.bind(self)} style={{ marginLeft: "15px" }}>重新上传</span>
|
|
|
- <span onClick={this.deleteImg1} style={{ marginLeft: "25px" }}>删除</span>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div onClick={self.upload1.bind(self)} style={{ display: (this.state.imgUrlText == '') ? "block" : "none", width: "150px", height: "150px", border: "1px solid #D7D7D7", marginLeft: "7px", cursor: "pointer" }}>
|
|
|
- <p style={{ fontSize: "100px", marginLeft: "36px", marginTop: "-40px" }}>+</p>
|
|
|
- <p style={{ marginTop: "-135px", textAlign: "center", color: "#D7D7D7" }}>
|
|
|
- <span>不添加则不显示</span><br />
|
|
|
- <span>大小限制</span><br />
|
|
|
- <span>300k以下</span>
|
|
|
- </p>
|
|
|
- </div>
|
|
|
- </div> */}
|
|
|
</TabPane>
|
|
|
<TabPane tab="发送图文" key="news" forceRender={true}>
|
|
|
- <Form {...formItemLayout} layout="horizontal">
|
|
|
+ <Form {...formItemLayout} layout="horizontal" onFinish= { self.onFinish }>
|
|
|
<Form.Item label="标题">
|
|
|
{self.props.form.getFieldDecorator('title', { rules: [{ required: true, message: '标题不能为空' }] })
|
|
|
(<Input />)}
|
|
@@ -699,11 +690,6 @@ class MsgComponent extends React.Component {
|
|
|
</div>
|
|
|
<div onClick={this.upload1} style={{ display: (this.state.imgUrlNews == '') ? "block" : "none",textAlign:"center" , width: "150px", height: "150px", border: "1px solid #D7D7D7", marginLeft: "7px", cursor: "pointer" }}>
|
|
|
<p style={{ fontSize: "100px"}}>+</p>
|
|
|
- {/* <p style={{ marginTop: "-135px", textAlign: "center", color: "#D7D7D7" }}>
|
|
|
- <span>不添加则不显示</span><br />
|
|
|
- <span>大小限制</span><br />
|
|
|
- <span>300k以下</span>
|
|
|
- </p> */}
|
|
|
<p style={{ textAlign: "center", color: "#D7D7D7", marginTop: "-70px", lineHeight: "20px" }}>
|
|
|
<div>不添加则不显示</div>
|
|
|
<div>大小限制</div>
|
|
@@ -712,29 +698,17 @@ class MsgComponent extends React.Component {
|
|
|
</div>
|
|
|
</div>
|
|
|
</Form.Item>
|
|
|
+
|
|
|
+ {/* <Form.Item {...formItemLayout}>
|
|
|
+ <Button type="primary" htmlType="button" style={{marginLeft:"120px"}} onClick={(e) => this.onFinish(e)}>
|
|
|
+ 保存
|
|
|
+ </Button>
|
|
|
+ </Form.Item> */}
|
|
|
</Form>
|
|
|
- {/* <div style={{ display: "flex", marginLeft: "70px" }}>
|
|
|
- <div>添加图片:</div>
|
|
|
- <div onMouseOver={this.mouseOver} onMouseOut={this.mouseOut}
|
|
|
- style={{ position: "relative", display: (this.state.imgUrlNews != '') ? "block" : "none", width: "150px", height: "150px", border: "1px solid #D7D7D7", marginLeft: "7px", cursor: "pointer" }}>
|
|
|
- <img style={{ width: "100%", height: "100%" }} src={this.state.imgUrlNews} />
|
|
|
- <div style={{ display: this.state.mouseOver ? "block" : "none", width: "150px", height: "150px", lineHeight: "150px", position: "absolute", top: "0px", left: "0px", backgroundColor: "#000", opacity: "0.7", color: "#fff" }}>
|
|
|
- <span onClick={this.upload1} style={{ marginLeft: "15px" }}>重新上传</span>
|
|
|
- <span onClick={this.deleteImg1} style={{ marginLeft: "25px" }}>删除</span>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div onClick={this.upload1} style={{ display: (this.state.imgUrlNews == '') ? "block" : "none", width: "150px", height: "150px", border: "1px solid #D7D7D7", marginLeft: "7px", cursor: "pointer" }}>
|
|
|
- <p style={{ fontSize: "100px", marginLeft: "36px", marginTop: "-40px" }}>+</p>
|
|
|
- <p style={{ marginTop: "-135px", textAlign: "center", color: "#D7D7D7" }}>
|
|
|
- <span>不添加则不显示</span><br />
|
|
|
- <span>大小限制</span><br />
|
|
|
- <span>300k以下</span>
|
|
|
- </p>
|
|
|
- </div>
|
|
|
- </div> */}
|
|
|
</TabPane>
|
|
|
+
|
|
|
<TabPane tab="小程序" key="miniprogrampage" forceRender={true}>
|
|
|
- <Form {...formItemLayout} layout="horizontal">
|
|
|
+ <Form {...formItemLayout} layout="horizontal" style={{ display: ( 0 == 'miniprogrampage') ? "block" : "none"}} onFinish= { self.onFinish }>
|
|
|
<Form.Item label="标题">
|
|
|
{self.props.form.getFieldDecorator('miniAppTitle', { rules: [{ required: true, message: '小程序标题不能为空' }] })
|
|
|
(<Input />)}
|
|
@@ -748,7 +722,6 @@ class MsgComponent extends React.Component {
|
|
|
(<Input />)}
|
|
|
</Form.Item>
|
|
|
|
|
|
-
|
|
|
<Form.Item label="添加图片">
|
|
|
<div style={{ display: "flex" }}>
|
|
|
|
|
@@ -772,25 +745,6 @@ class MsgComponent extends React.Component {
|
|
|
|
|
|
</Form.Item>
|
|
|
</Form>
|
|
|
- {/* <div style={{ display: "flex", marginLeft: "70px" }}>
|
|
|
- <div>添加图片:</div>
|
|
|
- <div onMouseOver={this.mouseOver} onMouseOut={this.mouseOut}
|
|
|
- style={{ position: "relative", display: (this.state.imgUrlMini != '') ? "block" : "none", width: "150px", height: "150px", border: "1px solid #D7D7D7", marginLeft: "7px", cursor: "pointer" }}>
|
|
|
- <img style={{ width: "100%", height: "100%" }} src={this.state.imgUrlMini} />
|
|
|
- <div style={{ display: this.state.mouseOver ? "block" : "none", width: "150px", height: "150px", lineHeight: "150px", position: "absolute", top: "0px", left: "0px", backgroundColor: "#000", opacity: "0.7", color: "#fff" }}>
|
|
|
- <span onClick={this.upload1} style={{ marginLeft: "15px" }}>重新上传</span>
|
|
|
- <span onClick={this.deleteImg1} style={{ marginLeft: "25px" }}>删除</span>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div onClick={this.upload1} style={{ display: (this.state.imgUrlMini == '') ? "block" : "none", width: "150px", height: "150px", border: "1px solid #D7D7D7", marginLeft: "7px", cursor: "pointer" }}>
|
|
|
- <p style={{ fontSize: "100px", marginLeft: "36px", marginTop: "-40px" }}>+</p>
|
|
|
- <p style={{ marginTop: "-135px", textAlign: "center", color: "#D7D7D7" }}>
|
|
|
- <span>不添加则不显示</span><br />
|
|
|
- <span>大小限制</span><br />
|
|
|
- <span>300k以下</span>
|
|
|
- </p>
|
|
|
- </div>
|
|
|
- </div> */}
|
|
|
</TabPane>
|
|
|
</Tabs>
|
|
|
<Modal title="添加链接"
|
|
@@ -897,13 +851,12 @@ function mapStateToProps(state) {
|
|
|
|
|
|
export default connect(mapStateToProps)(Form.create({
|
|
|
mapPropsToFields(props) {
|
|
|
- console.log(props);
|
|
|
+ // console.log(props);
|
|
|
if (!props || !props.chooseKey) {
|
|
|
props = {
|
|
|
content: '', title: '', description: '', url: '',
|
|
|
miniProgramAppId: '', pagepath: '', miniAppTitle: ''
|
|
|
};
|
|
|
- console.log('no');
|
|
|
}
|
|
|
return {
|
|
|
content: Form.createFormField({
|