CommentInput.js
2.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
import React, {Component} from 'react';
import {
Image,
InteractionManager,
Keyboard,
KeyboardAvoidingView,
NativeModules,
Platform,
StyleSheet,
Text,
TextInput,
TouchableOpacity,
View,
ScrollView
} from 'react-native';
import {zoomH, zoomW} from '../../utils/getSize';
import EmojiSelector, {Categories} from 'react-native-emoji-selector';
import AppService from "../../service/AppService";
import {isIphoneX, getHomeColor,NoDoublePress,xnToast} from '../../utils/utils';
import CommentInputAndroid from './CommentInputAndroid';
import CommentInputIos from './CommentInputIos';
/**
* 详情-评论输入框
*/
export default class CommentInput extends Component {
// 构造
constructor(props) {
super(props);
}
reset(){
this.refs.CommentInput.reset();
}
setMinLength(length){
this.refs.CommentInput.setMinLength(length);
}
setDefaultValue(value){
this.refs.CommentInput.setDefaultValue(value);
}
setCustomPublish(){
this.refs.CommentInput.setCustomPublish();
}
showInputLayout(){
this.refs.CommentInput.showInputLayout();
}
focus(){
if(this.refs.CommentInput != undefined){
this.refs.CommentInput.focus()
}
}
render() {
if (Platform.OS == 'android'){
return(
<CommentInputAndroid ref = "CommentInput"
boardId = {this.props.boardId}
callback = { this.props.callback}
uploadCallback = {this.props.uploadCallback}
nav = {this.props.nav}
hasNavHeight = {!!this.props.hasNavHeight?this.props.hasNavHeight:false}
isEdit = {!!this.props.isEdit?this.props.isEdit:false}
hideForward = {!!this.props.hideForward?this.props.hideForward:false}
>
</CommentInputAndroid>
);
}else {
return(
<CommentInputIos ref = "CommentInput"
boardId = {!!this.props.boardId?this.props.boardId:0}
callback = { !!this.props.callback?this.props.callback:()=>{}}
uploadCallback = {!!this.props.uploadCallback?this.props.uploadCallback:()=>{}}
nav = {!!this.props.nav?this.props.nav:()=>{}}
hasNavHeight = {!!this.props.hasNavHeight?this.props.hasNavHeight:false}
isEdit = {!!this.props.isEdit?this.props.isEdit:false}
hideForward = {!!this.props.hideForward?this.props.hideForward:false}
>
</CommentInputIos>)
}
}
}