mirror of
https://github.com/timepill/timepill-app.git
synced 2025-04-30 09:59:31 +08:00
1. 编辑页初步成形
This commit is contained in:
parent
a5446853d6
commit
e5aae879f3
2 changed files with 132 additions and 23 deletions
|
@ -1,6 +1,6 @@
|
||||||
import React, {Component} from 'react';
|
import React, {Component} from 'react';
|
||||||
import {StyleSheet, Text, View, TouchableOpacity, Alert} from 'react-native';
|
import {StyleSheet, Text, View, TouchableOpacity, Alert} from 'react-native';
|
||||||
import Icon from 'react-native-vector-icons/Ionicons';
|
import Ionicons from 'react-native-vector-icons/Ionicons';
|
||||||
import ActionSheet from 'react-native-actionsheet-api';
|
import ActionSheet from 'react-native-actionsheet-api';
|
||||||
|
|
||||||
import Color from '../../style/color'
|
import Color from '../../style/color'
|
||||||
|
@ -30,7 +30,7 @@ export default class DiaryActionIcon extends Component {
|
||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
<TouchableOpacity onPress={this.props.onPress ? this.props.onPress : this._defaultOnPress.bind(this)}>
|
<TouchableOpacity onPress={this.props.onPress ? this.props.onPress : this._defaultOnPress.bind(this)}>
|
||||||
<Icon name="ios-more"
|
<Ionicons name="ios-more"
|
||||||
size={24}
|
size={24}
|
||||||
color={Color.inactiveText}
|
color={Color.inactiveText}
|
||||||
style={localStyle.moreIcon} />
|
style={localStyle.moreIcon} />
|
||||||
|
|
|
@ -1,33 +1,142 @@
|
||||||
import React, {Component} from 'react';
|
import React, {Component} from 'react';
|
||||||
import {Platform, StyleSheet, Text, View} from 'react-native';
|
import {Platform, StyleSheet, Text, View, ScrollView, TextInput, TouchableOpacity} from 'react-native';
|
||||||
|
import {Navigation} from 'react-native-navigation';
|
||||||
|
import Ionicons from 'react-native-vector-icons/Ionicons';
|
||||||
|
|
||||||
|
import {Icon} from '../style/icon'
|
||||||
|
import Color from '../style/color'
|
||||||
|
import Api from '../util/api'
|
||||||
|
|
||||||
|
|
||||||
export default class WritePage extends Component {
|
export default class WritePage extends Component {
|
||||||
|
|
||||||
|
constructor(props) {
|
||||||
|
super(props);
|
||||||
|
Navigation.events().bindComponent(this);
|
||||||
|
|
||||||
|
this.state = {
|
||||||
|
content: ''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static options(passProps) {
|
||||||
|
return {
|
||||||
|
topBar: {
|
||||||
|
title: {
|
||||||
|
text: '写日记'
|
||||||
|
},
|
||||||
|
leftButtons: [{
|
||||||
|
id: 'cancel',
|
||||||
|
icon: Icon.navButtonClose
|
||||||
|
}],
|
||||||
|
rightButtons: [{
|
||||||
|
id: 'save',
|
||||||
|
icon: Icon.navButtonSave
|
||||||
|
}]
|
||||||
|
},
|
||||||
|
bottomTabs: {
|
||||||
|
visible: false,
|
||||||
|
|
||||||
|
// hide bottom tab for android
|
||||||
|
drawBehind: true,
|
||||||
|
animate: true
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
<View style={styles.container}>
|
<ScrollView style={localStyle.container}
|
||||||
<Text style={styles.welcome}>Write Page !</Text>
|
contentContainerStyle={{flex: 1}}
|
||||||
|
keyboardShouldPersistTaps='always'>
|
||||||
|
|
||||||
|
<TextInput ref={(r) => this.contentInput = r }
|
||||||
|
|
||||||
|
style={localStyle.textContent}
|
||||||
|
selectionColor={Color.light}
|
||||||
|
underlineColorAndroid='transparent'
|
||||||
|
|
||||||
|
multiline={true} maxLength={2000}
|
||||||
|
|
||||||
|
placeholder='记录点滴生活'
|
||||||
|
value={this.state.content}
|
||||||
|
|
||||||
|
onChangeText={() => {}}
|
||||||
|
|
||||||
|
autoCorrect={false}
|
||||||
|
autoCapitalize='none'
|
||||||
|
/>
|
||||||
|
|
||||||
|
<View style={localStyle.bottomBar}>
|
||||||
|
<TouchableOpacity onPress={() => {}}>
|
||||||
|
<View style={localStyle.notebookButton}>
|
||||||
|
<Ionicons name='ios-bookmarks-outline' size={16}
|
||||||
|
color={Color.text} style={{marginTop: 2, marginRight: 6}} />
|
||||||
|
<Text style={{fontSize: 13, color: Color.text }}>{'日记本名'}</Text>
|
||||||
</View>
|
</View>
|
||||||
|
</TouchableOpacity>
|
||||||
|
|
||||||
|
<View style={{flex: 1}} />
|
||||||
|
|
||||||
|
<TouchableOpacity>
|
||||||
|
<Text style={localStyle.topic}># {'话题名'}</Text>
|
||||||
|
</TouchableOpacity>
|
||||||
|
|
||||||
|
<TouchableOpacity style={localStyle.photo} onPress={() => {}}>
|
||||||
|
<Ionicons name="ios-image-outline" size={30}
|
||||||
|
style={{paddingTop: 4}} color={Color.light} />
|
||||||
|
</TouchableOpacity>
|
||||||
|
</View>
|
||||||
|
|
||||||
|
</ScrollView>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const styles = StyleSheet.create({
|
const localStyle = StyleSheet.create({
|
||||||
container: {
|
container: {
|
||||||
flex: 1,
|
flex: 1,
|
||||||
justifyContent: 'center',
|
backgroundColor: Color.navBackground,
|
||||||
|
paddingBottom: Api.IS_IPHONEX ? 30 : 0
|
||||||
|
},
|
||||||
|
textContent: {
|
||||||
|
flex: 1,
|
||||||
|
padding: 15,
|
||||||
|
paddingTop: 10,
|
||||||
|
fontSize: 15,
|
||||||
|
backgroundColor: '#fff',
|
||||||
|
lineHeight: 24,
|
||||||
|
color: Color.text,
|
||||||
|
textAlignVertical:'top'
|
||||||
|
},
|
||||||
|
bottomBar: {
|
||||||
|
height: 50,
|
||||||
|
backgroundColor: Color.navBackground,
|
||||||
|
elevation: 3,
|
||||||
|
borderColor: '#bbb',
|
||||||
|
borderTopWidth: StyleSheet.hairlineWidth,
|
||||||
|
paddingLeft: 10,
|
||||||
|
flexDirection: 'row',
|
||||||
|
alignItems: 'center'
|
||||||
|
},
|
||||||
|
notebookButton: {
|
||||||
|
flexDirection: "row",
|
||||||
|
borderRadius: 99,
|
||||||
|
paddingHorizontal: 15,
|
||||||
|
height: 30,
|
||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
backgroundColor: '#F5FCFF',
|
justifyContent: 'center',
|
||||||
|
backgroundColor: Color.warning
|
||||||
},
|
},
|
||||||
welcome: {
|
topic: {
|
||||||
fontSize: 20,
|
color: Color.light,
|
||||||
textAlign: 'center',
|
fontSize: 15,
|
||||||
margin: 10,
|
paddingRight: 15
|
||||||
},
|
|
||||||
instructions: {
|
|
||||||
textAlign: 'center',
|
|
||||||
color: '#333333',
|
|
||||||
marginBottom: 5,
|
|
||||||
},
|
},
|
||||||
|
photo: {
|
||||||
|
width: 45,
|
||||||
|
height: 40,
|
||||||
|
alignItems: "center",
|
||||||
|
justifyContent: 'center'
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue