罗广聪

准备接入通信录接口

... ... @@ -9,7 +9,8 @@ import {
ScrollView,
ListView,
Dimensions,
AsyncStorage
AsyncStorage,
Alert
} from "react-native";
import { StackNavigator, TabNavigator } from "react-navigation";
import post from "../../utils/fetch";
... ... @@ -22,11 +23,26 @@ export default class Customer extends Component {
USER_ID: "",
NICKNAME: "",
PROFESSION: "",
hasCustomer: true,
customersList: ["张某某", "周某某", "林某某", "李某某"]
hasCustomer: false,
customersList: ["张某某", "周某某", "林某某", "李某某"],
customersList2: [{
name: "Tina",
id: "",
phone: "",
},{
name: "aaaa",
id: "",
phone: "",
},{
name: "dddd",
id: "",
phone: "",
}]
};
}
componentWillMount() {}
componentWillMount() {
this.getAsyncStorage();
}
componentDidMount() {}
... ... @@ -84,10 +100,28 @@ export default class Customer extends Component {
style={styles.beginPic}
/>
<View style={styles.beginBtnContaier}>
<TouchableOpacity style={styles.beginBtnLeft} onPress={() => {navigate("CustomerEdit")}}>
<Text style={styles.beginBtnLeftText}>手动选择</Text>
<TouchableOpacity
style={styles.beginBtnLeft}
onPress={() => {
if (this.state.IS_LOGIN != "yes") {
Alert.alert("请先登录账号");
} else {
navigate("CustomerEdit");
}
}}
>
<Text style={styles.beginBtnLeftText}>手动添加</Text>
</TouchableOpacity>
<TouchableOpacity style={styles.beginBtnRight}>
<TouchableOpacity
style={styles.beginBtnRight}
onPress={() => {
if (this.state.IS_LOGIN != "yes") {
Alert.alert("请先登录账号");
} else {
{/* navigate("CustomerEdit"); */}
}
}}
>
<Text style={styles.beginBtnRightText}>通信录导入</Text>
</TouchableOpacity>
</View>
... ... @@ -100,7 +134,12 @@ export default class Customer extends Component {
return (
<View style={styles.mainContaier}>
<View style={styles.mainBtnContaier}>
<TouchableOpacity style={styles.mainBtnContaierLeft} onPress={() => {navigate("CustomerEdit")}}>
<TouchableOpacity
style={styles.mainBtnContaierLeft}
onPress={() => {
navigate("CustomerEdit");
}}
>
<Image
style={styles.mainBtnLeftImg}
source={require("../../assets/customer/ic_add.png")}
... ... @@ -138,14 +177,10 @@ export default class Customer extends Component {
render() {
const { navigate } = this.props.navigation;
const { IS_LOGIN,hasCustomer, customers } = this.state;
const { IS_LOGIN, hasCustomer, customers } = this.state;
return (
<View style={styles.container}>
{hasCustomer ? (
this._renderMain()
) : (
this._renderBegin()
)}
{hasCustomer ? this._renderMain() : this._renderBegin()}
</View>
);
}
... ...