index.js 5.08 KB
Newer Older
李彥志's avatar
李彥志 committed
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 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186
import React from 'react';
import {
  StyleSheet,
  Dimensions,
  View,
  Text,
  Image,
  ScrollView,
  TouchableOpacity,
  Button,
  Alert,
  Modal
} from 'react-native';
import styles from './styles';
// import DialogBox from 'react-native-dialogbox';


export default class home extends React.Component {


  static navigationOptions = ({ navigation }) => ({
    headerLeft:
    <View style={styles.nav_left_icon_container}>
    <Image
      style={styles.nav_icon}
      source={require('../../images/btn_nv_menu.png')}
    />
    </View>,
    headerTitle: 
    <View style={styles.headerTitleContainer}>
    <Text style={styles.headerTitleTxt}>說明及設定</Text>
    </View>
  });

//   handleOnPress = () => {
//     // alert
    
//     this.dialogbox.confirm({
// 			title: <Text style={styles.logoutTitle}>你確定嗎?</Text>,
//       content: [
//         <Text style={styles.logoutMessage}>登出後系統會將移動裝置中的資料進行刪除</Text>],
//       ok: {
//         text:'登出'
//       },
//       cancel: {
//         text:'取消'
//       }
// 		});
// }

logout () {
const title = "你確定嗎?"
const message = "登出後系統會將移動裝置中的資料進行刪除"

Alert.alert(
  title,
  message,
  [
    {text: '取消', onPress: () => console.log('Cancel Pressed'), style: 'cancel'},
    {text: '登出', onPress: () => console.log('OK Pressed')},
  ],
)
}

  render() {

    return (
      <View style={styles.container}>

        <ScrollView
          style={styles.scrollFlex}
          keyboardShouldPersistTaps="always"
          automaticallyAdjustContentInsets={false}
          scrollEventThrottle={200}
        >
      <View style={styles.subRowContainer} />
      <View style={styles.rowBackground}>
        
      <TouchableOpacity>
      <View style={styles.rowContainer}>
        <View>
        <Text style={styles.rowText}>個人檔案</Text>
        </View>
        <View style={styles.rowItemRight}>
                  <Image
                    style={styles.nextArrow}
                    source={require('../../images/kb_arrow_next.png')}
                  />
        </View>
      </View>
      </TouchableOpacity>

      <TouchableOpacity onPress={() => this.props.navigation.navigate('SettingScreen')}>
      <View style={[styles.rowContainer, { borderBottomColor: '#FFF' }]}>
        <View>
        <Text style={styles.rowText}>指標設定 </Text>
        </View>
        <View style={styles.rowItemRight}>
                  <Image
                    style={styles.nextArrow}
                    source={require('../../images/kb_arrow_next.png')}
                  />
        </View>
      </View>
      </TouchableOpacity>
      </View>

    <View style={styles.subRowContainer} />
    <View style={styles.rowBackground}>
      <TouchableOpacity onPress={() => this.props.navigation.navigate('DataSync')}>
      <View style={styles.rowContainer}>
      <View>
      <Text style={styles.rowText}>數據同步</Text>
      </View>
      <View style={styles.rowItemRight}>
                <Image
                  style={styles.nextArrow}
                  source={require('../../images/kb_arrow_next.png')}
                />
      </View>
      </View>
      </TouchableOpacity>

      <TouchableOpacity onPress={() => this.props.navigation.navigate('Notice')}>
        <View style={[styles.rowContainer, { borderBottomColor: '#FFF' }]}>
        <View>
        <Text style={styles.rowText}>通知 </Text>
        </View>
        <View style={styles.rowItemRight}>
                  <Image
                    style={styles.nextArrow}
                    source={require('../../images/kb_arrow_next.png')}
                  />
        </View>
        </View>
      </TouchableOpacity>
      </View>
      

      <View style={styles.subRowContainer} />
      <View style={styles.rowBackground}>
      <TouchableOpacity onPress={() => this.props.navigation.navigate('AboutHRBScreen')}>
      <View style={styles.rowContainer}>
        <View>
        <Text style={styles.rowText}>關於HRB </Text>
        </View>
        <View style={styles.rowItemRight}>
                  <Image
                    style={styles.nextArrow}
                    source={require('../../images/kb_arrow_next.png')}
                  />
        </View>
      </View>
      </TouchableOpacity>

      <TouchableOpacity>
      <View style={[styles.rowContainer, { borderBottomColor: '#FFF' }]}>
        <View>
        <Text style={styles.rowText}>意見回饋 </Text>
        </View>
        <View style={styles.rowItemRight}>
                  <Image
                    style={styles.nextArrow}
                    source={require('../../images/kb_arrow_next.png')}
                  />
        </View>
      </View>
      </TouchableOpacity>
      </View>

      <View style={styles.emptyRowContainer} />
      </ScrollView>

      <TouchableOpacity style={styles.btnLogout} onPress={this.logout}>
          <Text style={styles.btnLogoutText}>
            登出
          </Text>
        
        </TouchableOpacity> 
        
        {/* <DialogBox ref={dialogbox => { this.dialogbox = dialogbox }}/> */}
      </View>
      
    );
  }
}