|
@@ -89,12 +89,9 @@ class PushMessage extends React.Component {
|
|
|
{}
|
|
|
],
|
|
|
selectIndex: 'text',
|
|
|
- fromText: {},
|
|
|
- fromNews: {},
|
|
|
- fromminiprogrampage: {},
|
|
|
disabled: false,
|
|
|
contentValueItem: "",
|
|
|
- typeText:"text",
|
|
|
+ typeText: "text",
|
|
|
TimePicker: [
|
|
|
{
|
|
|
value: [],
|
|
@@ -129,10 +126,10 @@ class PushMessage extends React.Component {
|
|
|
if (items) {
|
|
|
if (!items[key])
|
|
|
items[key] = {};
|
|
|
- items[key].disable = checked ? 0 : 1;
|
|
|
- var chooseKey
|
|
|
- let keys = this.props.pushMessage.initData && this.props.pushMessage.initData.items && this.props.pushMessage.initData.items[this.state.currentState]
|
|
|
- chooseKey = keys && keys.message && keys.message.msgType ? keys.message.msgType : 'text';
|
|
|
+ items[key].disable = checked ? 0 : 1;
|
|
|
+ var chooseKey
|
|
|
+ let keys = this.props.pushMessage.initData && this.props.pushMessage.initData.items && this.props.pushMessage.initData.items[this.state.currentState]
|
|
|
+ chooseKey = keys && keys.message && keys.message.msgType ? keys.message.msgType : 'text';
|
|
|
let messageItem = {}
|
|
|
messageItem.content = content;
|
|
|
messageItem.miniAppTitle = miniAppTitle;
|
|
@@ -145,7 +142,7 @@ class PushMessage extends React.Component {
|
|
|
items[key].message = messageItem;
|
|
|
initData.items = items;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
this.props.dispatch({ type: 'pushMessage/updateState', payload: { initData: initData } });
|
|
|
}
|
|
|
|
|
@@ -172,10 +169,10 @@ class PushMessage extends React.Component {
|
|
|
if (items) {
|
|
|
if (!items[key])
|
|
|
items[key] = {};
|
|
|
- items[key].week = value;
|
|
|
- var chooseKey
|
|
|
- let keys = this.props.pushMessage.initData && this.props.pushMessage.initData.items && this.props.pushMessage.initData.items[this.state.currentState]
|
|
|
- chooseKey = keys && keys.message && keys.message.msgType ? keys.message.msgType : 'text';
|
|
|
+ items[key].week = value;
|
|
|
+ var chooseKey
|
|
|
+ let keys = this.props.pushMessage.initData && this.props.pushMessage.initData.items && this.props.pushMessage.initData.items[this.state.currentState]
|
|
|
+ chooseKey = keys && keys.message && keys.message.msgType ? keys.message.msgType : 'text';
|
|
|
let messageItem = {}
|
|
|
messageItem.content = content;
|
|
|
messageItem.miniAppTitle = miniAppTitle;
|
|
@@ -229,14 +226,14 @@ class PushMessage extends React.Component {
|
|
|
var description = updateFromItm && updateFromItm.props.form ? updateFromItm.props.form.getFieldValue('description') : ""
|
|
|
var miniProgramAppId = updateFromItm && updateFromItm.props.form ? updateFromItm.props.form.getFieldValue('miniProgramAppId') : ""
|
|
|
var pagepath = updateFromItm && updateFromItm.props.form ? updateFromItm.props.form.getFieldValue('pagepath') : ""
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
if (items) {
|
|
|
if (!items[key])
|
|
|
items[key] = {};
|
|
|
- var chooseKey
|
|
|
- let keys = this.props.pushMessage.initData && this.props.pushMessage.initData.items && this.props.pushMessage.initData.items[this.state.currentState]
|
|
|
- chooseKey = keys && keys.message && keys.message.msgType ? keys.message.msgType : 'text';
|
|
|
+ var chooseKey
|
|
|
+ let keys = this.props.pushMessage.initData && this.props.pushMessage.initData.items && this.props.pushMessage.initData.items[this.state.currentState]
|
|
|
+ chooseKey = keys && keys.message && keys.message.msgType ? keys.message.msgType : 'text';
|
|
|
let messageItem = {}
|
|
|
messageItem.content = content;
|
|
|
messageItem.miniAppTitle = miniAppTitle;
|
|
@@ -280,13 +277,13 @@ class PushMessage extends React.Component {
|
|
|
var description = updateFromItm && updateFromItm.props.form ? updateFromItm.props.form.getFieldValue('description') : ""
|
|
|
var miniProgramAppId = updateFromItm && updateFromItm.props.form ? updateFromItm.props.form.getFieldValue('miniProgramAppId') : ""
|
|
|
var pagepath = updateFromItm && updateFromItm.props.form ? updateFromItm.props.form.getFieldValue('pagepath') : ""
|
|
|
-
|
|
|
+
|
|
|
if (items) {
|
|
|
if (!items[key])
|
|
|
items[key] = {};
|
|
|
- var chooseKey
|
|
|
- let keys = this.props.pushMessage.initData && this.props.pushMessage.initData.items && this.props.pushMessage.initData.items[this.state.currentState]
|
|
|
- chooseKey = keys && keys.message && keys.message.msgType ? keys.message.msgType : 'text';
|
|
|
+ var chooseKey
|
|
|
+ let keys = this.props.pushMessage.initData && this.props.pushMessage.initData.items && this.props.pushMessage.initData.items[this.state.currentState]
|
|
|
+ chooseKey = keys && keys.message && keys.message.msgType ? keys.message.msgType : 'text';
|
|
|
let messageItem = {}
|
|
|
messageItem.content = content;
|
|
|
messageItem.miniAppTitle = miniAppTitle;
|
|
@@ -313,12 +310,12 @@ class PushMessage extends React.Component {
|
|
|
if (!items[key])
|
|
|
items[key] = {};
|
|
|
|
|
|
- var message1 = { msgType:this.state.typeText };
|
|
|
+ var message1 = { msgType: this.state.typeText };
|
|
|
if (this.props.pushMessage.initData.items[key] && this.props.pushMessage.initData.items[key].message) {
|
|
|
message1 = this.props.pushMessage.initData.items[key].message;
|
|
|
message1.msgType = this.props.pushMessage.initData.items[key].message.msgType ? this.props.pushMessage.initData.items[key].message.msgType : 'text'
|
|
|
message1.msgId = this.props.pushMessage.initData.items[key].message.msgId ? this.props.pushMessage.initData.items[key].message.msgId : null
|
|
|
- message1.thumbMediaId = this.props.pushMessage.initData.items[key].message.mediaId ? this.props.pushMessage.initData.items[key].message.mediaId : null
|
|
|
+ message1.thumbMediaId = this.props.pushMessage.initData.items[key].message.mediaId ? this.props.pushMessage.initData.items[key].message.mediaId : null
|
|
|
}
|
|
|
// thumbMediaId
|
|
|
message1.content = this.state.msgComponent[key].props.form.getFieldValue('content')
|
|
@@ -331,7 +328,6 @@ class PushMessage extends React.Component {
|
|
|
items[key].message = message1;
|
|
|
initData.items = items;
|
|
|
}
|
|
|
- console.log(message1,'message1');
|
|
|
var data = initData.items[key];
|
|
|
if (typeof (data.disable) === 'undefined')
|
|
|
data.disable = 0;
|
|
@@ -357,7 +353,7 @@ class PushMessage extends React.Component {
|
|
|
|
|
|
let week1 = items.week;
|
|
|
|
|
|
- var message1 = { msgType:this.state.typeText }
|
|
|
+ var message1 = { msgType: this.state.typeText }
|
|
|
if (this.props.pushMessage.initData.items && this.props.pushMessage.initData.items[key]
|
|
|
&& this.props.pushMessage.initData.items[key].message) {
|
|
|
|
|
@@ -406,9 +402,9 @@ class PushMessage extends React.Component {
|
|
|
if (items) {
|
|
|
if (!items[key])
|
|
|
items[key] = {};
|
|
|
- var chooseKey
|
|
|
- let keys = this.props.pushMessage.initData && this.props.pushMessage.initData.items && this.props.pushMessage.initData.items[this.state.currentState]
|
|
|
- chooseKey = keys && keys.message && keys.message.msgType ? keys.message.msgType : 'text';
|
|
|
+ var chooseKey
|
|
|
+ let keys = this.props.pushMessage.initData && this.props.pushMessage.initData.items && this.props.pushMessage.initData.items[this.state.currentState]
|
|
|
+ chooseKey = keys && keys.message && keys.message.msgType ? keys.message.msgType : 'text';
|
|
|
let messageItem = {}
|
|
|
messageItem.content = content;
|
|
|
messageItem.miniAppTitle = miniAppTitle;
|
|
@@ -434,14 +430,14 @@ class PushMessage extends React.Component {
|
|
|
if (items) {
|
|
|
if (!items[key])
|
|
|
items[key] = {};
|
|
|
- var message1 = { msgType:this.state.typeText }
|
|
|
+ var message1 = { msgType: this.state.typeText }
|
|
|
if (this.props.pushMessage.initData.items && this.props.pushMessage.initData.items[key]
|
|
|
&& this.props.pushMessage.initData.items[key].message) {
|
|
|
message1 = this.props.pushMessage.initData.items[key].message
|
|
|
}
|
|
|
|
|
|
if (chooseKey)
|
|
|
- message1.chooseKey = chooseKey;
|
|
|
+ message1.chooseKey = chooseKey;
|
|
|
message1.msgType = chooseKey;
|
|
|
items[key].message = message1;
|
|
|
initData.items = items;
|
|
@@ -509,9 +505,9 @@ class PushMessage extends React.Component {
|
|
|
if (items) {
|
|
|
if (!items[key])
|
|
|
items[key] = {};
|
|
|
- var chooseKey
|
|
|
- let keys = this.props.pushMessage.initData && this.props.pushMessage.initData.items && this.props.pushMessage.initData.items[this.state.currentState]
|
|
|
- chooseKey = keys && keys.message && keys.message.msgType ? keys.message.msgType : 'text';
|
|
|
+ var chooseKey
|
|
|
+ let keys = this.props.pushMessage.initData && this.props.pushMessage.initData.items && this.props.pushMessage.initData.items[this.state.currentState]
|
|
|
+ chooseKey = keys && keys.message && keys.message.msgType ? keys.message.msgType : 'text';
|
|
|
let messageItem = {}
|
|
|
messageItem.content = content;
|
|
|
messageItem.miniAppTitle = miniAppTitle;
|
|
@@ -531,11 +527,7 @@ class PushMessage extends React.Component {
|
|
|
onSelect = (index) => {
|
|
|
this.setState({
|
|
|
currentState: index,
|
|
|
- fromText: {},
|
|
|
- fromNews: {},
|
|
|
- fromminiprogrampage: {}
|
|
|
})
|
|
|
- // this.props.dispatch({ type: 'pushMessage/initMessage', payload: {} });
|
|
|
}
|
|
|
|
|
|
render() {
|
|
@@ -572,6 +564,8 @@ class PushMessage extends React.Component {
|
|
|
weekItem = data.items && data.items[key] && typeof (data.items[key].week) !== 'undefined' ? data.items[key].week : 1;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+
|
|
|
var chooseKey = 'text';
|
|
|
var cutextKey = "text"
|
|
|
var message1 = {};
|
|
@@ -582,12 +576,10 @@ class PushMessage extends React.Component {
|
|
|
keys ? chooseKey = keys.message && keys.message.msgType : chooseKey = "text"
|
|
|
let item = self.props.pushMessage.selectKesData.items[self.state.currentState]
|
|
|
item ? cutextKey = item.message && item.message.msgType : cutextKey = "text"
|
|
|
-
|
|
|
message1 = self.props.pushMessage.initData.items[self.state.currentState].message;
|
|
|
- message1.content = self.props.pushMessage.initData.items[self.state.currentState].message.content ?
|
|
|
- self.props.pushMessage.initData.items[self.state.currentState].message.content : this.state.contentValueItem
|
|
|
+ message1.content = self.props.pushMessage.initData.items[self.state.currentState].message.content ?
|
|
|
+ self.props.pushMessage.initData.items[self.state.currentState].message.content : this.state.contentValueItem
|
|
|
}
|
|
|
- // console.log(message1,'-----message1--()--message1------');
|
|
|
|
|
|
return (
|
|
|
<div className={styles.connect} style={{ display: (key === self.state.currentState) ? "block" : "none" }}>
|
|
@@ -619,10 +611,10 @@ class PushMessage extends React.Component {
|
|
|
|
|
|
<div className={styles.contentList}>
|
|
|
<MsgComponent tabIndex={key}
|
|
|
- { ...message1 }
|
|
|
+ {...message1}
|
|
|
chooseKey={chooseKey}
|
|
|
- cutextKey = { cutextKey }
|
|
|
- selectKeys = { self.state.currentState }
|
|
|
+ cutextKey={cutextKey}
|
|
|
+ selectKeys={self.state.currentState}
|
|
|
bottomFriom={(key) => { self.handleSubmit(key) }}
|
|
|
mediaIdChange={(v) => { self.cb_mediaId(v, key) }}
|
|
|
onChange={(v, av) => { self.cb_formChange(v, av, key) }}
|