notificationDetail.js 5.24 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} 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:(29/zoomH),height:(29/zoomH),marginRight:(10/zoomW)}} resizeMode="contain"/>
                </TouchableOpacity>
                <TouchableOpacity onPress = {navigation.state.params?navigation.state.params.withdraw:null}>
                    <Image source={addTarget} style={{width:(29/zoomH),height:(29/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],
        };

    }

    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={styles.title}>
                        <View style = {{backgroundColor:'#ffffff',padding:(15/zoomW)}}>
                           <Text style={{fontSize:21,color:'#000000'}}>UED部门月度总结大会</Text>
                           <Text style={{fontSize:14,color:'#999999'}}>Alice  322 16:05</Text>
                           <Text style={{fontSize:16,color:'#333333',marginTop:(25/zoomH)}}>不少设计师开始利用诸如斑点和小气泡这样的装饰性元素,分散在网页的各个角落。这些装饰性的元素大多以小圆点的形式呈现,它们的形态多种多样,但是总体上有着吸引视线、丰富视觉的功能。即使是基于相同的设计概念,不同的气泡和斑点,让每个设计项目都有着不同的性格。</Text>
                            <TouchableOpacity style = {styles.btnConfirm} onPress = {() =>{this.toNotificationPage()}}>
                                 <View style = {{width:(340/zoomW),height:(39/zoomH),flexDirection:'row',alignItems:'center',justifyContent:'center'}}>
                                     <Text style={{fontSize:14,color:'#EE5E53'}}>一人未确认</Text>
                                 </View>
                            </TouchableOpacity>
                        </View>
                        <Text style = {{height:(28/zoomH),includeFontPadding:false, textAlignVertical:'center',paddingLeft:(15/zoomW),textAlign:'left',fontSize :12,color:'#999999',backgroundColor:'#ECECF1'}}>评论</Text>
                    </View>
                </ScrollView>
            </View>


        );
    }
}

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

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

    title:{
        marginTop:(20/zoomH),
        marginBottom:(20/zoomH),

    },

    btnConfirm:{
        marginLeft:(20/zoomW),
        marginRight:(20/zoomW),
        marginTop:(20/zoomW),
        marginBottom:7,
        backgroundColor:'#EEEEEE',
        borderRadius:180,
        borderWidth:1,
        borderColor:'#EEEEEE',
        borderStyle:'solid'
    }
})