|
@@ -17,6 +17,7 @@ import { |
|
@@ -17,6 +17,7 @@ import { |
17
|
Easing,
|
17
|
Easing,
|
18
|
ScrollView,
|
18
|
ScrollView,
|
19
|
NativeModules,
|
19
|
NativeModules,
|
|
|
20
|
+ Alert,
|
20
|
} from 'react-native'
|
21
|
} from 'react-native'
|
21
|
|
22
|
|
22
|
import AssertsPicker from './AssertsPicker';
|
23
|
import AssertsPicker from './AssertsPicker';
|
|
@@ -79,6 +80,9 @@ export default class Posting extends Component { |
|
@@ -79,6 +80,9 @@ export default class Posting extends Component { |
79
|
}
|
80
|
}
|
80
|
|
81
|
|
81
|
showBoardPannel() {
|
82
|
showBoardPannel() {
|
|
|
83
|
+ if (this.props.fromSection) {
|
|
|
84
|
+ return;
|
|
|
85
|
+ }
|
82
|
this.boardInView= true;
|
86
|
this.boardInView= true;
|
83
|
|
87
|
|
84
|
this.setState({boardState:this.boardSelectionHeight,imageState:0});
|
88
|
this.setState({boardState:this.boardSelectionHeight,imageState:0});
|
|
@@ -147,6 +151,8 @@ export default class Posting extends Component { |
|
@@ -147,6 +151,8 @@ export default class Posting extends Component { |
147
|
maxLength={30}
|
151
|
maxLength={30}
|
148
|
numberOfLines={1}
|
152
|
numberOfLines={1}
|
149
|
autoFocus={true}
|
153
|
autoFocus={true}
|
|
|
154
|
+ autoCapitalize={'none'}
|
|
|
155
|
+ autoCorrect={false}
|
150
|
onChangeText={
|
156
|
onChangeText={
|
151
|
(text)=>{
|
157
|
(text)=>{
|
152
|
this.titleLength = text.length;
|
158
|
this.titleLength = text.length;
|
|
@@ -155,7 +161,9 @@ export default class Posting extends Component { |
|
@@ -155,7 +161,9 @@ export default class Posting extends Component { |
155
|
}
|
161
|
}
|
156
|
onKeyPress={
|
162
|
onKeyPress={
|
157
|
(event)=>{
|
163
|
(event)=>{
|
|
|
164
|
+
|
158
|
if (this.titleLength>=30) {
|
165
|
if (this.titleLength>=30) {
|
|
|
166
|
+ Alert.alert('抱歉','超出30字符最长限制');
|
159
|
console.log('满了');
|
167
|
console.log('满了');
|
160
|
}
|
168
|
}
|
161
|
}
|
169
|
}
|
|
@@ -177,9 +185,11 @@ export default class Posting extends Component { |
|
@@ -177,9 +185,11 @@ export default class Posting extends Component { |
177
|
this.props.contentEdited(text);
|
185
|
this.props.contentEdited(text);
|
178
|
}
|
186
|
}
|
179
|
}
|
187
|
}
|
|
|
188
|
+
|
180
|
onKeyPress={
|
189
|
onKeyPress={
|
181
|
(event)=>{
|
190
|
(event)=>{
|
182
|
if (this.contentLength>=2000) {
|
191
|
if (this.contentLength>=2000) {
|
|
|
192
|
+ Alert.alert('抱歉','超出2000字符最长限制');
|
183
|
console.log('满了');
|
193
|
console.log('满了');
|
184
|
}
|
194
|
}
|
185
|
}
|
195
|
}
|
|
@@ -215,10 +225,11 @@ export default class Posting extends Component { |
|
@@ -215,10 +225,11 @@ export default class Posting extends Component { |
215
|
<View style={[styles.boardSelectionContainer,{height:this.state.boardState,}]} opacity={this.state.boardState}>
|
225
|
<View style={[styles.boardSelectionContainer,{height:this.state.boardState,}]} opacity={this.state.boardState}>
|
216
|
<View style={styles.boardSelectionScroll}>
|
226
|
<View style={styles.boardSelectionScroll}>
|
217
|
{this.props.boards.map((item,i)=>{
|
227
|
{this.props.boards.map((item,i)=>{
|
|
|
228
|
+ let bgColor = item.forumName === this.props.selectedBoard?'#cccccc':'white'
|
218
|
return(
|
229
|
return(
|
219
|
<Text
|
230
|
<Text
|
220
|
key={i}
|
231
|
key={i}
|
221
|
- style={styles.boardSelectionItem}
|
232
|
+ style={[styles.boardSelectionItem,{backgroundColor: bgColor}]}
|
222
|
onPress={event=>{
|
233
|
onPress={event=>{
|
223
|
this.props.onBoardPress(item.forumName,item.forumCode);
|
234
|
this.props.onBoardPress(item.forumName,item.forumCode);
|
224
|
// this.blurAll();
|
235
|
// this.blurAll();
|
|
@@ -249,7 +260,7 @@ const styles = StyleSheet.create({ |
|
@@ -249,7 +260,7 @@ const styles = StyleSheet.create({ |
249
|
left: 0,
|
260
|
left: 0,
|
250
|
top:0,
|
261
|
top:0,
|
251
|
height:44,
|
262
|
height:44,
|
252
|
- padding:15,
|
263
|
+ padding:14,
|
253
|
color: 'black',
|
264
|
color: 'black',
|
254
|
fontSize: 15,
|
265
|
fontSize: 15,
|
255
|
},
|
266
|
},
|