|
@@ -55,11 +55,12 @@ export default class Chat extends Component {
|
55
|
55
|
noChatting: false, // 异常
|
56
|
56
|
chatting: null, // 当前聊天对象
|
57
|
57
|
me: null, // 自己
|
|
58
|
+ focus: false,//获取焦点
|
58
|
59
|
}
|
59
|
60
|
|
60
|
61
|
originList = []
|
61
|
62
|
|
62
|
|
- unSubscribeMessage = () => {}
|
|
63
|
+ unSubscribeMessage = () => { }
|
63
|
64
|
|
64
|
65
|
componentWillMount() {
|
65
|
66
|
savePoint({
|
|
@@ -74,7 +75,7 @@ export default class Chat extends Component {
|
74
|
75
|
console.log('在线咨询')
|
75
|
76
|
})
|
76
|
77
|
|
77
|
|
- this.unSubscribeMessage = () => {}
|
|
78
|
+ this.unSubscribeMessage = () => { }
|
78
|
79
|
}
|
79
|
80
|
|
80
|
81
|
componentDidMount() {
|
|
@@ -369,6 +370,7 @@ export default class Chat extends Component {
|
369
|
370
|
this.setState({
|
370
|
371
|
marginTop: 0,
|
371
|
372
|
visExtra: false,
|
|
373
|
+ focus: false,
|
372
|
374
|
})
|
373
|
375
|
})
|
374
|
376
|
}
|
|
@@ -472,7 +474,8 @@ export default class Chat extends Component {
|
472
|
474
|
e.stopPropagation()
|
473
|
475
|
this.setState({
|
474
|
476
|
visExtra: true,
|
475
|
|
- marginTop: -240
|
|
477
|
+ marginTop: -240,
|
|
478
|
+ focus: true,
|
476
|
479
|
})
|
477
|
480
|
}
|
478
|
481
|
|
|
@@ -484,7 +487,8 @@ export default class Chat extends Component {
|
484
|
487
|
|
485
|
488
|
this.setState({
|
486
|
489
|
visExtra: false,
|
487
|
|
- marginTop: 0
|
|
490
|
+ marginTop: 0,
|
|
491
|
+ focus: false,
|
488
|
492
|
})
|
489
|
493
|
}
|
490
|
494
|
|
|
@@ -524,7 +528,7 @@ export default class Chat extends Component {
|
524
|
528
|
}
|
525
|
529
|
|
526
|
530
|
render() {
|
527
|
|
- const { marginTop, visiblePrompt, prompts, msgList, noChatting } = this.state
|
|
531
|
+ const { marginTop, focus, visiblePrompt, prompts, msgList, noChatting } = this.state
|
528
|
532
|
|
529
|
533
|
// 如果有错误, 不显示内容
|
530
|
534
|
if (noChatting) return null;
|
|
@@ -596,6 +600,7 @@ export default class Chat extends Component {
|
596
|
600
|
onInput={this.bindTextInput}
|
597
|
601
|
onConfirm={this.bindInputConfirm}
|
598
|
602
|
placeholder='发送消息'
|
|
603
|
+ focus={focus}
|
599
|
604
|
/>
|
600
|
605
|
<Text className="import-top__extra iconfont icon-Add" onClick={this.showExtraArea}></Text>
|
601
|
606
|
<Button size="mini" className="import-top__submit" onClick={this.bindSendBtn}>发送</Button>
|