notificationDetail.js 6.38 KB
/**
 * Created by Cassie on 2018/05/14
 * 公告详情
 */
import React, { Component } from 'react';
import {
    StyleSheet,
    View,
    Image,
    ScrollView,
    Text,
    TextInput,
    TouchableOpacity,
    InteractionManager
} from 'react-native';
import {StackNavigator} from 'react-navigation';
import ScrollableTabView,{DefaultTabBar} from  'react-native-scrollable-tab-view';
import {width,height,zoomW,zoomH} from '../../utils/getSize';
import {xnToast,xnBorderWidth,isIphoneX} from '../../utils/utils';
import NotificationList from './notificationList';
const back = require('../../img/returnB.png');
const search = require('../../img/search.png');
const allDel = require('../../img/allDel.png');
const bread = require('../../img/bread.png');
const avatar = require('../../img/avatar.png');
const addTarget = require('../../img/addTarget.png');
const withdraw = require('../../img/withdraw.png');


export default class NotificationDetail extends Component {
    static navigationOptions = ({ navigation, screenProps }) => ({
        title: "公告详情",
        headerLeft:(<View style={{display:'flex',flexDirection:'row'}} >
            <TouchableOpacity style={styles.topIcon} onPress={navigation.state.params?navigation.state.params.back:null}>
                <Image source={back} style={{width:(16/zoomH),height:(16/zoomH)}} resizeMode="contain" />
            </TouchableOpacity>
        </View>),
        headerRight:(
            <View style = {{flexDirection:'row',display:'flex',paddingLeft:(10/zoomW), paddingRight:(10/zoomW)}}>
                <TouchableOpacity onPress = {navigation.state.params?navigation.state.params.forwarding:null}>
                    <Image source={addTarget} style={{width:(24/zoomH),height:(24/zoomH),marginRight:(10/zoomW)}} resizeMode="contain"/>
                </TouchableOpacity>
                <TouchableOpacity onPress = {navigation.state.params?navigation.state.params.withdraw:null}>
                    <Image source={addTarget} style={{width:(24/zoomH),height:(24/zoomH)}} resizeMode="contain"/>
                </TouchableOpacity>
            </View>)
    });

    constructor(props) {
        super(props);
        this.state = {
            sheetList: [1, 2, 3],
            unconfirmedList:[1,1],
            confirmedList:[2,1,1,1,1,1,1,1,1,1],
            height:30
        };

    }

    componentDidMount(){
        this.props.navigation.setParams({
            //转发
            forwarding:() => {
                InteractionManager.runAfterInteractions(() => {this.props.navigation.navigate('addPeople');})
            },
            //撤回
            withdraw:()=>{
                alert('撤回');
            },
            back:()=>{
                this.props.navigation.goBack();
            }
        });
    };

    /*显示确认人员页面*/
    toNotificationPage() {
        this.props.navigation.navigate('Notifications');
    }

    render(){
        return(
            <View style={{display:'flex',flex:1}}>
                <ScrollView style={styles.background}>
                    <View style={{padding:18/zoomW,backgroundColor:'#fff'}}>
                        <Text style={{fontSize:21,fontWeight:'600'}}>UED部门月度总结大会</Text>
                        <Text style={{fontSize:14,color:'#999'}}>Alice  322  16:05</Text>
                        <Text style={{marginTop:25,fontSize:16,color:'#333',marginBottom:19/zoomH}}>不少设计师开始利用诸如斑点和小气泡这样的装饰性元素,分散在网页的各个角落。这些装饰性的元素大多以小圆点的形式呈现,它们的形态多种多样,但是总体上有着吸引视线、丰富视觉的功能。即使是基于相同的设计概念,不同的气泡和斑点,让每个设计项目都有着不同的性格。</Text>
                        <TouchableOpacity>
                            <View style={styles.leaderUn}>
                                <Image/>
                                <Text style={{color:'#ee5e53',fontSize:14}}>一人未确认</Text>
                            </View>
                        </TouchableOpacity>
                    </View>
                    <View style={{backgroundColor:'#ECECF1',height:(28/zoomH),width:'100%',justifyContent:'center'}}>
                        <Text style = {{paddingLeft:(15/zoomW),textAlign:'left',fontSize :14,color:'#666',backgroundColor:'#ECECF1'}}>评论</Text>
                    </View>
                </ScrollView>
                <View style={{maxHeight:88,width:'100%',backgroundColor:'#f5f5f5',flexDirection:'row',alignItems:'center',justifyContent:'space-between',padding:9/zoomW}}>
                    <View style={{width:317/zoomW,backgroundColor:'white',padding:6/zoomW}}>
                        <TextInput multiline={global.__ANDROID__?false:true} underlineColorAndroid="transparent" style={{padding:0,fontSize:16,textAlignVertical:'center'}} placeholder='评论...' placeholderTextColor='#999'></TextInput>
                    </View>
                    <View style={{width:28/zoomW,height:28/zoomW,marginLeft:10/zoomW,backgroundColor:'red'}}/>
                </View>
                {isIphoneX() && <View style={{height:34,width:'100%',backgroundColor:'#f5f5f5'}}></View>}
            </View>


        );
    }
}

const styles = StyleSheet.create({
   topIcon:{
     paddingLeft:(10/zoomW),
                paddingRight:(10/zoomW),
                height:'100%',
                display:'flex',
                alignItems:'center'
    },

    background:{
        width:'100%',
        height:'100%',
        backgroundColor:'#fff',
    },

    leaderUn:{
        width:340/zoomW,
        height:39/zoomH,
        backgroundColor:'#f8f8f8',
        borderRadius:50,
        flexDirection:'row',
        justifyContent:'center',
        alignItems:'center'

    },
    leaderAll:{
        width:340/zoomW,
        height:39/zoomH,
        backgroundColor:'#f8f8f8',
        borderRadius:50,
        flexDirection:'row',
        justifyContent:'center',
        alignItems:'center'
    },
    memberUn:{
        width:340/zoomW,
        height:39/zoomH,
        backgroundColor:'#00be3c',
        borderRadius:50,
        flexDirection:'row',
        justifyContent:'center',
        alignItems:'center'
    },
    memberAll:{
        width:340/zoomW,
        height:39/zoomH,
        backgroundColor:'#f8f8f8',
        borderRadius:50,
        flexDirection:'row',
        justifyContent:'center',
        alignItems:'center'
    },
})