OperationUnitModal.js 1.71 KB
/**
 * Created by yzdd on 2018/3/14.
 */
import React, {Component} from 'react';
import {
  View,
  Text,
  TouchableOpacity,
  Image,
  StyleSheet
} from 'react-native';
import {width, height, line} from '../../utils/publiscStyle'
import AddReiOrderStore from "../../logics/AddReiOrderStore";

const styles = StyleSheet.create({
  container: {
    flex: 1,
    backgroundColor: "rgba(0,0,0,0.5)",
    justifyContent: "flex-end"
  },
  item: {
    width,
    height: 51,
    alignItems: "center",
    justifyContent: "center",
    backgroundColor: "#FFFFFF",
    borderBottomWidth: line,
    borderBottomColor: "#dddddd"
  },
  font1: {
    fontSize: 18,
    color: "#333333"
  },
  font2: {
    fontSize: 18,
    color: "#333333",
    fontWeight: "bold"
  },
  bg: {
    backgroundColor: "#ececf1"
  }
});

export default class OperationUnitModal extends Component {
  select = (v) => {

    this.props.navigation.state.params.addReiOrderStore.unit = v;
    const {goBack} = this.props.navigation;
    goBack();
  }
  cancel = () => {
    const {goBack} = this.props.navigation;
    goBack();
  }

  render() {
    return (
      <View style={styles.container}>
        <View style={styles.bg}>
          {
            ["犀牛网络", "企新东", "犀牛网络"].map((v, i) => {
              return (
                <TouchableOpacity style={styles.item} key={i} onPress={() => this.select(v)}>
                  <Text style={styles.font1}>{v}</Text>
                </TouchableOpacity>
              )
            })
          }
          <TouchableOpacity style={[styles.item, {marginTop: 12}]} onPress={this.cancel}>
            <Text style={styles.font2}>取消</Text>
          </TouchableOpacity>
        </View>
      </View>
    )
  }
}