|
@@ -48,23 +48,21 @@ class TemplateMessage extends React.Component {
|
|
|
AppleID: "",
|
|
|
tagList: "",
|
|
|
selectKey: "",
|
|
|
- PickerTime: "",
|
|
|
+ PickerTime: "",
|
|
|
selectFansKey: false,
|
|
|
inputValueList: [
|
|
|
]
|
|
|
}
|
|
|
}
|
|
|
- componentDidMount() {
|
|
|
+ componentDidMount() {
|
|
|
let that = this
|
|
|
+ that.userSelectList();
|
|
|
document.onclick = function () {
|
|
|
that.setState({
|
|
|
- selectFansKey:null
|
|
|
+ selectFansKey:null,
|
|
|
})
|
|
|
- console.log(that.state.selectArray);
|
|
|
}
|
|
|
- // that.viewSetting();
|
|
|
- }
|
|
|
-
|
|
|
+ }
|
|
|
onChangeAppIdlINK = LINK => {
|
|
|
this.setState({
|
|
|
AppleLink: LINK.target.value
|
|
@@ -80,7 +78,7 @@ class TemplateMessage extends React.Component {
|
|
|
AppletPath: Path.target.value
|
|
|
})
|
|
|
};
|
|
|
- viewSetting = e => {
|
|
|
+ userSelectList = e =>{
|
|
|
let that = this;
|
|
|
let list = {
|
|
|
pageIndex: 1,
|
|
@@ -97,10 +95,13 @@ class TemplateMessage extends React.Component {
|
|
|
}).then(function (res) {
|
|
|
that.setState({
|
|
|
tagList: res.items,
|
|
|
- modelState: true
|
|
|
})
|
|
|
});
|
|
|
-
|
|
|
+ }
|
|
|
+ viewSetting = e => {
|
|
|
+ this.setState({
|
|
|
+ modelState: true
|
|
|
+ })
|
|
|
};
|
|
|
handleChange = (selectColor, key) => {
|
|
|
// console.log(selectColor);
|
|
@@ -125,22 +126,12 @@ class TemplateMessage extends React.Component {
|
|
|
this.props.dispatch({ type: 'TemplateMessage/updateState', payload: TemplateMessage });
|
|
|
|
|
|
}
|
|
|
- selectColorKey = (event,key) => {
|
|
|
- // console.log(event,key);
|
|
|
- // var event = window.event || event;
|
|
|
- // if (event.stopPropagation) {
|
|
|
- // event.stopPropagation();
|
|
|
- // event.preventDefault();
|
|
|
- // } else {
|
|
|
- // console.log('--------------');
|
|
|
- // this.setState({
|
|
|
- // selectFansKey: key,
|
|
|
- // })
|
|
|
- // }
|
|
|
- event.stopPropagation();
|
|
|
- this.setState({
|
|
|
- selectFansKey: key,
|
|
|
- })
|
|
|
+ selectColorKey = (e, key) => {
|
|
|
+ e.stopPropagation();
|
|
|
+ e.nativeEvent.stopImmediatePropagation();
|
|
|
+ this.setState({
|
|
|
+ selectFansKey: key,
|
|
|
+ })
|
|
|
}
|
|
|
addFans = key => {
|
|
|
let inputList = this.props.TemplateMessage.Information.result.contentValueList;
|
|
@@ -168,7 +159,7 @@ class TemplateMessage extends React.Component {
|
|
|
// if (errors) {
|
|
|
// return
|
|
|
// }
|
|
|
-
|
|
|
+ console.log(this.state.selectArray,this.state.tagList, '------------');
|
|
|
var selectNameList = ""
|
|
|
var selectId = ""
|
|
|
for (let i = 0; i < this.state.selectArray.length; i++) {
|
|
@@ -180,7 +171,7 @@ class TemplateMessage extends React.Component {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- console.log(selectNameList,'selectNameList');
|
|
|
+
|
|
|
|
|
|
if (!selectNameList) {
|
|
|
message.error("请选择推送对象");
|
|
@@ -259,7 +250,7 @@ class TemplateMessage extends React.Component {
|
|
|
} else {
|
|
|
selectArray.splice(k, 1);
|
|
|
}
|
|
|
- console.log(selectArray,'selectArray');
|
|
|
+ console.log(selectArray, 'selectArray');
|
|
|
this.setState(
|
|
|
{
|
|
|
selectArray: selectArray
|
|
@@ -396,9 +387,9 @@ class TemplateMessage extends React.Component {
|
|
|
// var PickerTime = self.props.TemplateMessage.Information && self.props.TemplateMessage.Information.result.sendTime && self.props.TemplateMessage.Information.result.sendTime != undefined && self.props.TemplateMessage.Information.result.sendTime
|
|
|
// var PickerTime = "2020-06-28 17:35:13";
|
|
|
const dateFormat = 'YYYY/MM/DD HH:mm:ss';
|
|
|
- var URL = self.props.TemplateMessage.Information && self.props.TemplateMessage.Information.result.url
|
|
|
- var pagePath = self.props.TemplateMessage.Information && self.props.TemplateMessage.Information.result.pagePath
|
|
|
- var miniProgramAppId = self.props.TemplateMessage.Information && self.props.TemplateMessage.Information.result.miniProgramAppId
|
|
|
+ var URL = self.props.TemplateMessage.Information && self.props.TemplateMessage.Information.result.url
|
|
|
+ var pagePath = self.props.TemplateMessage.Information && self.props.TemplateMessage.Information.result.pagePath
|
|
|
+ var miniProgramAppId = self.props.TemplateMessage.Information && self.props.TemplateMessage.Information.result.miniProgramAppId
|
|
|
|
|
|
const formItemLayout = {
|
|
|
labelCol: {
|
|
@@ -517,7 +508,7 @@ class TemplateMessage extends React.Component {
|
|
|
const selectKey = data.state;
|
|
|
array = array.filter(function (el) {
|
|
|
return el !== '';
|
|
|
- });
|
|
|
+ });
|
|
|
console.log(data, 'sendTime');
|
|
|
|
|
|
const selectDate = data;
|
|
@@ -532,7 +523,7 @@ class TemplateMessage extends React.Component {
|
|
|
templateMsgId: selectDate.id,
|
|
|
editStateSmall: false,
|
|
|
PickerTime: data.sendTime,
|
|
|
- selectArray:array,
|
|
|
+ selectArray: array,
|
|
|
}, function () {
|
|
|
let data = {}
|
|
|
data.appId = self.props.wxAppIdValue
|
|
@@ -569,7 +560,7 @@ class TemplateMessage extends React.Component {
|
|
|
onOk={this.handleOkPreview}
|
|
|
onCancel={this.handleCancelPreview}
|
|
|
>
|
|
|
- <p style={{whiteSpace:"pre-wrap"}}>{this.state.previewDate.example}</p>
|
|
|
+ <p style={{ whiteSpace: "pre-wrap" }}>{this.state.previewDate.example}</p>
|
|
|
</Modal>
|
|
|
<Modal
|
|
|
title="扫码粉丝标签"
|
|
@@ -650,9 +641,9 @@ class TemplateMessage extends React.Component {
|
|
|
placement="bottom"
|
|
|
title={item.title}
|
|
|
trigger="hover"
|
|
|
- overlayStyle={{ width: "260px",whiteSpace:"pre-wrap"}}
|
|
|
+ overlayStyle={{ width: "260px", whiteSpace: "pre-wrap" }}
|
|
|
overlayClassName="PopoverFile"
|
|
|
- style={{ display: ("small" === this.state.size) ? "block" : "none" ,width: 80}}
|
|
|
+ style={{ display: ("small" === this.state.size) ? "block" : "none", width: 80 }}
|
|
|
visible={this.state.selectIndex == key && this.state.selectState ? true : false}
|
|
|
onMouseLeave={visible => this.onMouseLeave(visible, key)}
|
|
|
onMouseEnter={visible => this.onMouseEnter(visible, key)}
|
|
@@ -679,7 +670,7 @@ class TemplateMessage extends React.Component {
|
|
|
</Form.Item>
|
|
|
|
|
|
<Form.Item {...formItemLayout} label="推送时间">
|
|
|
- <Radio.Group value={self.state.value} onChange={this.onChangePushMation}>
|
|
|
+ <Radio.Group value={self.state.value} onChange={this.onChangePushMation}>
|
|
|
<Radio value={0}>立即推送 </Radio>
|
|
|
<Radio value={1}>定时推送</Radio>
|
|
|
</Radio.Group>
|
|
@@ -704,36 +695,36 @@ class TemplateMessage extends React.Component {
|
|
|
} */}
|
|
|
{
|
|
|
self.props.TemplateMessage && self.props.TemplateMessage.Information && self.props.TemplateMessage.Information.result && self.props.TemplateMessage.Information.result.contentValueList.map((item, key) => {
|
|
|
- return <Form.Item {...formItemLayout} label={item.lable} style={{ position: "relative", display: "flex" }}>
|
|
|
- <div style={{display:"flex",position:"relative"}}>
|
|
|
+ return <Form.Item {...formItemLayout} label={item.lable} style={{ position: "relative", display: "flex" }}>
|
|
|
+ <div style={{ display: "flex", position: "relative" }}>
|
|
|
<Input placeholder="" onChange={(val) => { this.valChange(val, key) }} value={item.value} style={{ width: 300, color: item.color }} />
|
|
|
<Button style={{ marginLeft: "30px" }} onClick={() => this.addFans(key)}>粉丝昵称</Button>
|
|
|
- <Button style={{ width: "34px", height: '32px', background: item.color,marginTop:"2px" }} onClick={event => this.selectColorKey(event,key)}></Button>
|
|
|
+ <Button style={{ width: "34px", height: '32px', background: item.color, marginTop: "2px" }} onClick={event => this.selectColorKey(event, key)}></Button>
|
|
|
{
|
|
|
- key == this.state.selectFansKey ? (
|
|
|
- <div style={{ width: '220px', position: "absolute", right: '-230px', zIndex: 200 }}>
|
|
|
- <SketchPicker color={item.color} onChange={(color) => { this.handleChange(color, key) }} style={{ position: "absolute" }} />
|
|
|
- </div>
|
|
|
- ) : (
|
|
|
- ""
|
|
|
- )
|
|
|
- }
|
|
|
- </div>
|
|
|
- </Form.Item>
|
|
|
+ key == this.state.selectFansKey ? (
|
|
|
+ <div style={{ width: '220px', position: "absolute", right: '-230px', zIndex: 200 }}>
|
|
|
+ <SketchPicker color={item.color} onChange={(color) => { this.handleChange(color, key) }} style={{ position: "absolute" }} />
|
|
|
+ </div>
|
|
|
+ ) : (
|
|
|
+ ""
|
|
|
+ )
|
|
|
+ }
|
|
|
+ </div>
|
|
|
+ </Form.Item>
|
|
|
})
|
|
|
}
|
|
|
|
|
|
<Tabs defaultActiveKey="1" onChange={self.callback} style={{ display: ("default" === self.state.size) ? "block" : "none", width: "400px", marginLeft: "160px" }}>
|
|
|
<TabPane tab="无跳转链接" key="1">
|
|
|
</TabPane>
|
|
|
- <TabPane tab="跳转链接" key="2">
|
|
|
- <Input addonBefore="页面链接" defaultValue={ URL } onChange={self.onChangeAppIdlINK} />
|
|
|
+ <TabPane tab="跳转链接" key="2">
|
|
|
+ <Input addonBefore="页面链接" defaultValue={URL} onChange={self.onChangeAppIdlINK} />
|
|
|
</TabPane>
|
|
|
|
|
|
<TabPane tab="小程序" key="3">
|
|
|
- <Input addonBefore="小程序appID" defaultValue={ miniProgramAppId } onChange={self.onChangeAppID} />
|
|
|
+ <Input addonBefore="小程序appID" defaultValue={miniProgramAppId} onChange={self.onChangeAppID} />
|
|
|
<div style={{ marginTop: '20px', marginBottom: '20px' }}> 小程序必须关联公众号,且审核发布成功方可跳转 <a>了解更多{self.state.keyIndex}</a></div>
|
|
|
- <Input addonBefore="小程序页面路径" defaultValue={ pagePath } onChange={self.onChangeAppIdPath} />
|
|
|
+ <Input addonBefore="小程序页面路径" defaultValue={pagePath} onChange={self.onChangeAppIdPath} />
|
|
|
<div style={{ marginTop: '20px', marginBottom: '20px' }} > 联系小程序开发者获取路径 </div>
|
|
|
</TabPane>
|
|
|
</Tabs>
|