|
@@ -1,3 +1,7 @@
|
|
|
|
|
+/* eslint-disable react/jsx-props-no-spreading */
|
|
|
|
|
+/* eslint-disable no-shadow */
|
|
|
|
|
+/* eslint-disable no-underscore-dangle */
|
|
|
|
|
+/* eslint-disable no-restricted-syntax */
|
|
|
import * as WebBrowser from "expo-web-browser";
|
|
import * as WebBrowser from "expo-web-browser";
|
|
|
import * as React from "react";
|
|
import * as React from "react";
|
|
|
import { View, StyleSheet, TouchableWithoutFeedback } from "react-native";
|
|
import { View, StyleSheet, TouchableWithoutFeedback } from "react-native";
|
|
@@ -5,25 +9,75 @@ import {
|
|
|
Layout,
|
|
Layout,
|
|
|
Input,
|
|
Input,
|
|
|
Button,
|
|
Button,
|
|
|
- useTheme,
|
|
|
|
|
Icon,
|
|
Icon,
|
|
|
Text,
|
|
Text,
|
|
|
SelectItem,
|
|
SelectItem,
|
|
|
} from "@ui-kitten/components";
|
|
} from "@ui-kitten/components";
|
|
|
import { Cascader, BottomModal } from "beeshell";
|
|
import { Cascader, BottomModal } from "beeshell";
|
|
|
-import variables from "../constants/customTheme";
|
|
|
|
|
import { useModel } from "flooks";
|
|
import { useModel } from "flooks";
|
|
|
|
|
+import moment from "moment";
|
|
|
import OpenTime from "./OpenTime";
|
|
import OpenTime from "./OpenTime";
|
|
|
import Datepicker from "./Datepicker";
|
|
import Datepicker from "./Datepicker";
|
|
|
import UpLoadImage from "./UpLoadImage";
|
|
import UpLoadImage from "./UpLoadImage";
|
|
|
-import moment from "moment";
|
|
|
|
|
import Actionsheet from "./Actionsheet";
|
|
import Actionsheet from "./Actionsheet";
|
|
|
|
|
|
|
|
-const AlertIcon = props => <Icon {...props} name='alert-circle-outline' />;
|
|
|
|
|
|
|
+
|
|
|
|
|
+const styles = StyleSheet.create({
|
|
|
|
|
+ inputContainer: {
|
|
|
|
|
+ flexDirection: "row",
|
|
|
|
|
+ alignItems: "center",
|
|
|
|
|
+ paddingVertical: 10,
|
|
|
|
|
+ paddingHorizontal: 4,
|
|
|
|
|
+ },
|
|
|
|
|
+ input: {
|
|
|
|
|
+ flex: 1,
|
|
|
|
|
+ },
|
|
|
|
|
+ label: {
|
|
|
|
|
+ width: 80,
|
|
|
|
|
+ marginRight: 19,
|
|
|
|
|
+ flexShrink: 0,
|
|
|
|
|
+ },
|
|
|
|
|
+ labelleft: {
|
|
|
|
|
+ width: 73,
|
|
|
|
|
+ flexShrink: 0,
|
|
|
|
|
+ },
|
|
|
|
|
+ right: {
|
|
|
|
|
+ flexDirection: "row",
|
|
|
|
|
+ },
|
|
|
|
|
+ code: {
|
|
|
|
|
+ paddingHorizontal: 5,
|
|
|
|
|
+ marginLeft: 5,
|
|
|
|
|
+ },
|
|
|
|
|
+ selectContent: {
|
|
|
|
|
+ backgroundColor: "#F0F0F0",
|
|
|
|
|
+ },
|
|
|
|
|
+ titleStyle: {
|
|
|
|
|
+ fontSize: 15,
|
|
|
|
|
+ },
|
|
|
|
|
+ leftLabelTextStyle: {
|
|
|
|
|
+ fontSize: 13,
|
|
|
|
|
+ },
|
|
|
|
|
+ rightLabelTextStyle: {
|
|
|
|
|
+ fontSize: 13,
|
|
|
|
|
+ },
|
|
|
|
|
+ sub: {
|
|
|
|
|
+ color: "#787878",
|
|
|
|
|
+ position: "absolute",
|
|
|
|
|
+ left: 90,
|
|
|
|
|
+ zIndex: 2,
|
|
|
|
|
+ },
|
|
|
|
|
+ upload: {
|
|
|
|
|
+ marginTop: 20,
|
|
|
|
|
+ width: 67,
|
|
|
|
|
+ height: 67,
|
|
|
|
|
+ },
|
|
|
|
|
+});
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
|
|
|
function* flattenSelect(array, key) {
|
|
function* flattenSelect(array, key) {
|
|
|
for (const item of array) {
|
|
for (const item of array) {
|
|
|
- let _array = key ? item[key] : item;
|
|
|
|
|
|
|
+ const _array = key ? item[key] : item;
|
|
|
if (Array.isArray(_array) && _array.length > 0) {
|
|
if (Array.isArray(_array) && _array.length > 0) {
|
|
|
yield* flattenSelect(_array, key);
|
|
yield* flattenSelect(_array, key);
|
|
|
} else {
|
|
} else {
|
|
@@ -33,43 +87,44 @@ function* flattenSelect(array, key) {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
const FormInput = React.memo(props => {
|
|
const FormInput = React.memo(props => {
|
|
|
- const { appearance } = props;
|
|
|
|
|
|
|
+ const { appearance,type } = props;
|
|
|
const [secureTextEntry, setSecureTextEntry] = React.useState(true);
|
|
const [secureTextEntry, setSecureTextEntry] = React.useState(true);
|
|
|
const { cancel, confirm } = useModel("wordsModel");
|
|
const { cancel, confirm } = useModel("wordsModel");
|
|
|
const toggleSecureEntry = () => {
|
|
const toggleSecureEntry = () => {
|
|
|
setSecureTextEntry(!secureTextEntry);
|
|
setSecureTextEntry(!secureTextEntry);
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+ // eslint-disable-next-line no-shadow
|
|
|
const renderIcon = props => (
|
|
const renderIcon = props => (
|
|
|
- <TouchableWithoutFeedback onPress={toggleSecureEntry}>
|
|
|
|
|
- <Icon {...props} name={secureTextEntry ? "eye-off" : "eye"} />
|
|
|
|
|
- </TouchableWithoutFeedback>
|
|
|
|
|
|
|
+ <TouchableWithoutFeedback onPress={toggleSecureEntry}>
|
|
|
|
|
+ <Icon {...props} name={secureTextEntry ? "eye-off" : "eye"} />
|
|
|
|
|
+ </TouchableWithoutFeedback>
|
|
|
);
|
|
);
|
|
|
function getInputProps(props) {
|
|
function getInputProps(props) {
|
|
|
let _props = {
|
|
let _props = {
|
|
|
value: props.value || "",
|
|
value: props.value || "",
|
|
|
placeholder: props.placeholder,
|
|
placeholder: props.placeholder,
|
|
|
};
|
|
};
|
|
|
- if (props.type === "phone") {
|
|
|
|
|
|
|
+ if (type === "phone") {
|
|
|
_props = {
|
|
_props = {
|
|
|
..._props,
|
|
..._props,
|
|
|
dataDetectorTypes: "phoneNumber",
|
|
dataDetectorTypes: "phoneNumber",
|
|
|
maxLength: 11,
|
|
maxLength: 11,
|
|
|
keyboardType: "phone-pad",
|
|
keyboardType: "phone-pad",
|
|
|
};
|
|
};
|
|
|
- } else if (props.type === "password") {
|
|
|
|
|
|
|
+ } else if (type === "password") {
|
|
|
_props = {
|
|
_props = {
|
|
|
..._props,
|
|
..._props,
|
|
|
accessoryRight: ImageProps => renderIcon(ImageProps),
|
|
accessoryRight: ImageProps => renderIcon(ImageProps),
|
|
|
- secureTextEntry: secureTextEntry,
|
|
|
|
|
|
|
+ secureTextEntry,
|
|
|
};
|
|
};
|
|
|
- } else if (props.type == "code") {
|
|
|
|
|
|
|
+ } else if (type === "code") {
|
|
|
_props = {
|
|
_props = {
|
|
|
..._props,
|
|
..._props,
|
|
|
maxLength: 6,
|
|
maxLength: 6,
|
|
|
keyboardType: "numeric",
|
|
keyboardType: "numeric",
|
|
|
};
|
|
};
|
|
|
- } else if (props.type == "amount" || props.type == "money") {
|
|
|
|
|
|
|
+ } else if (type === "amount" || props.type === "money") {
|
|
|
_props = {
|
|
_props = {
|
|
|
..._props,
|
|
..._props,
|
|
|
keyboardType: "numeric",
|
|
keyboardType: "numeric",
|
|
@@ -93,24 +148,24 @@ const FormInput = React.memo(props => {
|
|
|
// }
|
|
// }
|
|
|
// };
|
|
// };
|
|
|
|
|
|
|
|
- const Label = props => {
|
|
|
|
|
|
|
+ const Label = ({type,labelStyle,label}) => {
|
|
|
return (
|
|
return (
|
|
|
- <View
|
|
|
|
|
- style={[
|
|
|
|
|
|
|
+ <View
|
|
|
|
|
+ style={[
|
|
|
appearance === "inner" ? styles.labelleft : styles.label,
|
|
appearance === "inner" ? styles.labelleft : styles.label,
|
|
|
- props.type === "img" ? { alignSelf: "flex-start" } : {},
|
|
|
|
|
- props.labelStyle || {},
|
|
|
|
|
|
|
+ type === "img" ? { alignSelf: "flex-start" } : {},
|
|
|
|
|
+ labelStyle || {},
|
|
|
]}
|
|
]}
|
|
|
- >
|
|
|
|
|
- <Text
|
|
|
|
|
- category='c1'
|
|
|
|
|
- style={{
|
|
|
|
|
- textAlign: appearance != "inner" ? "right" : "left",
|
|
|
|
|
|
|
+ >
|
|
|
|
|
+ <Text
|
|
|
|
|
+ category='c1'
|
|
|
|
|
+ style={{
|
|
|
|
|
+ textAlign: appearance !== "inner" ? "right" : "left",
|
|
|
}}
|
|
}}
|
|
|
- >
|
|
|
|
|
- {props.label}
|
|
|
|
|
- </Text>
|
|
|
|
|
- </View>
|
|
|
|
|
|
|
+ >
|
|
|
|
|
+ {label}
|
|
|
|
|
+ </Text>
|
|
|
|
|
+ </View>
|
|
|
);
|
|
);
|
|
|
};
|
|
};
|
|
|
const ForwardIcon = props => <Icon {...props} name='arrow-ios-forward' />;
|
|
const ForwardIcon = props => <Icon {...props} name='arrow-ios-forward' />;
|
|
@@ -121,255 +176,187 @@ const FormInput = React.memo(props => {
|
|
|
const [selectVal, setSelectVal] = React.useState("");
|
|
const [selectVal, setSelectVal] = React.useState("");
|
|
|
|
|
|
|
|
const selectInfo = React.useMemo(() => {
|
|
const selectInfo = React.useMemo(() => {
|
|
|
- if (props.type === "select" && props.value && selectList.length > 0) {
|
|
|
|
|
|
|
+ if (type === "select" && props.value && selectList.length > 0) {
|
|
|
const childrens = [...flattenSelect(selectList, "children")];
|
|
const childrens = [...flattenSelect(selectList, "children")];
|
|
|
return (
|
|
return (
|
|
|
childrens.find(item => {
|
|
childrens.find(item => {
|
|
|
- return item.id == props.value;
|
|
|
|
|
|
|
+ return item.id === props.value;
|
|
|
}) || { name: " " }
|
|
}) || { name: " " }
|
|
|
);
|
|
);
|
|
|
- } else {
|
|
|
|
|
|
|
+ }
|
|
|
return { name: " " };
|
|
return { name: " " };
|
|
|
- }
|
|
|
|
|
|
|
+
|
|
|
}, [props.value, props.type, selectList]);
|
|
}, [props.value, props.type, selectList]);
|
|
|
|
|
|
|
|
const [open, ChangeOpen] = React.useState(false);
|
|
const [open, ChangeOpen] = React.useState(false);
|
|
|
|
|
|
|
|
- function submitEvent(val) {
|
|
|
|
|
- console.log(val);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
const Btn = ({ btnText }) => (
|
|
const Btn = ({ btnText }) => (
|
|
|
- <Button
|
|
|
|
|
- appearance='ghost'
|
|
|
|
|
- size='tiny'
|
|
|
|
|
- style={{ paddingVertical: 8, marginLeft: 5 }}
|
|
|
|
|
- >
|
|
|
|
|
- {btnText}
|
|
|
|
|
- </Button>
|
|
|
|
|
|
|
+ <Button
|
|
|
|
|
+ appearance='ghost'
|
|
|
|
|
+ size='tiny'
|
|
|
|
|
+ style={{ paddingVertical: 8, marginLeft: 5 }}
|
|
|
|
|
+ >
|
|
|
|
|
+ {btnText}
|
|
|
|
|
+ </Button>
|
|
|
);
|
|
);
|
|
|
|
|
|
|
|
- const theme = useTheme();
|
|
|
|
|
|
|
|
|
|
function getMain(type, props) {
|
|
function getMain(type, props) {
|
|
|
- if (type == "select") {
|
|
|
|
|
|
|
+ if (type === "select") {
|
|
|
return (
|
|
return (
|
|
|
- <>
|
|
|
|
|
- <SelectItem
|
|
|
|
|
- appearance='form'
|
|
|
|
|
- style={{ flex: 1 }}
|
|
|
|
|
- accessoryRight={ForwardIcon}
|
|
|
|
|
- title={selectInfo.name}
|
|
|
|
|
- onPress={() => {
|
|
|
|
|
|
|
+ <>
|
|
|
|
|
+ <SelectItem
|
|
|
|
|
+ appearance='form'
|
|
|
|
|
+ style={{ flex: 1 }}
|
|
|
|
|
+ accessoryRight={ForwardIcon}
|
|
|
|
|
+ title={selectInfo.name}
|
|
|
|
|
+ onPress={() => {
|
|
|
bottomModalX.open();
|
|
bottomModalX.open();
|
|
|
}}
|
|
}}
|
|
|
- />
|
|
|
|
|
- <BottomModal
|
|
|
|
|
- ref={c => {
|
|
|
|
|
|
|
+ />
|
|
|
|
|
+ <BottomModal
|
|
|
|
|
+ ref={c => {
|
|
|
changeBottomModalx(c);
|
|
changeBottomModalx(c);
|
|
|
}}
|
|
}}
|
|
|
- title={props.selectTitle}
|
|
|
|
|
- titleStyle={styles.titleStyle}
|
|
|
|
|
- cancelable={true}
|
|
|
|
|
- leftLabelText={cancel}
|
|
|
|
|
- leftLabelTextStyle={styles.leftLabelTextStyle}
|
|
|
|
|
- rightLabelText={confirm}
|
|
|
|
|
- rightLabelTextStyle={styles.rightLabelTextStyle}
|
|
|
|
|
- rightCallback={() => {
|
|
|
|
|
|
|
+ title={props.selectTitle}
|
|
|
|
|
+ titleStyle={styles.titleStyle}
|
|
|
|
|
+ cancelable
|
|
|
|
|
+ leftLabelText={cancel}
|
|
|
|
|
+ leftLabelTextStyle={styles.leftLabelTextStyle}
|
|
|
|
|
+ rightLabelText={confirm}
|
|
|
|
|
+ rightLabelTextStyle={styles.rightLabelTextStyle}
|
|
|
|
|
+ rightCallback={() => {
|
|
|
props.onChange(selectVal);
|
|
props.onChange(selectVal);
|
|
|
}}
|
|
}}
|
|
|
- >
|
|
|
|
|
- <Cascader
|
|
|
|
|
- style={{
|
|
|
|
|
|
|
+ >
|
|
|
|
|
+ <Cascader
|
|
|
|
|
+ style={{
|
|
|
width: "100%",
|
|
width: "100%",
|
|
|
height: 200,
|
|
height: 200,
|
|
|
marginBottom: 50,
|
|
marginBottom: 50,
|
|
|
minHeight: 200,
|
|
minHeight: 200,
|
|
|
}}
|
|
}}
|
|
|
- data={selectList}
|
|
|
|
|
- fieldKeys={{
|
|
|
|
|
|
|
+ data={selectList}
|
|
|
|
|
+ fieldKeys={{
|
|
|
labelKey: "name",
|
|
labelKey: "name",
|
|
|
idKey: "id",
|
|
idKey: "id",
|
|
|
activeKey: "choose",
|
|
activeKey: "choose",
|
|
|
}}
|
|
}}
|
|
|
- onChange={(value, info) => {
|
|
|
|
|
|
|
+ onChange={(value) => {
|
|
|
setSelectVal(value[0]);
|
|
setSelectVal(value[0]);
|
|
|
}}
|
|
}}
|
|
|
- />
|
|
|
|
|
- </BottomModal>
|
|
|
|
|
- </>
|
|
|
|
|
|
|
+ />
|
|
|
|
|
+ </BottomModal>
|
|
|
|
|
+ </>
|
|
|
);
|
|
);
|
|
|
- } else if (type == "openTime") {
|
|
|
|
|
|
|
+ } if (type === "openTime") {
|
|
|
return (
|
|
return (
|
|
|
- <OpenTime
|
|
|
|
|
- open={open}
|
|
|
|
|
- submit={(start, end, week) => {
|
|
|
|
|
|
|
+ <OpenTime
|
|
|
|
|
+ open={open}
|
|
|
|
|
+ submit={(start, end, week) => {
|
|
|
ChangeOpen(false);
|
|
ChangeOpen(false);
|
|
|
props.onChange(
|
|
props.onChange(
|
|
|
week.join(","),
|
|
week.join(","),
|
|
|
moment(start, "HH:mm").format("HH:mm:ss"),
|
|
moment(start, "HH:mm").format("HH:mm:ss"),
|
|
|
moment(end, "HH:mm").format("HH:mm:ss")
|
|
moment(end, "HH:mm").format("HH:mm:ss")
|
|
|
);
|
|
);
|
|
|
- console.log(
|
|
|
|
|
- moment(start, "HH:mm").format("HH:mm:ss"),
|
|
|
|
|
- moment(end, "HH:mm").format("HH:mm:ss"),
|
|
|
|
|
- week
|
|
|
|
|
- );
|
|
|
|
|
}}
|
|
}}
|
|
|
- cancelEvent={() => {
|
|
|
|
|
|
|
+ cancelEvent={() => {
|
|
|
ChangeOpen(false);
|
|
ChangeOpen(false);
|
|
|
}}
|
|
}}
|
|
|
- openModal={() => {
|
|
|
|
|
|
|
+ openModal={() => {
|
|
|
ChangeOpen(true);
|
|
ChangeOpen(true);
|
|
|
}}
|
|
}}
|
|
|
- defaultValue={props.defaultValue}
|
|
|
|
|
- />
|
|
|
|
|
|
|
+ defaultValue={props.defaultValue}
|
|
|
|
|
+ />
|
|
|
);
|
|
);
|
|
|
- } else if (type == "date") {
|
|
|
|
|
|
|
+ } if (type === "date") {
|
|
|
return (
|
|
return (
|
|
|
- <Datepicker chooseDate={props.onChange} value={props.value} />
|
|
|
|
|
|
|
+ <Datepicker chooseDate={props.onChange} value={props.value} />
|
|
|
);
|
|
);
|
|
|
- } else if (type == "url") {
|
|
|
|
|
|
|
+ } if (type === "url") {
|
|
|
return (
|
|
return (
|
|
|
- <SelectItem
|
|
|
|
|
- appearance='form'
|
|
|
|
|
- style={{ flex: 1 }}
|
|
|
|
|
- accessoryRight={ForwardIcon}
|
|
|
|
|
- title={props.value || " "}
|
|
|
|
|
- onPress={props.changePath}
|
|
|
|
|
- />
|
|
|
|
|
|
|
+ <SelectItem
|
|
|
|
|
+ appearance='form'
|
|
|
|
|
+ style={{ flex: 1 }}
|
|
|
|
|
+ accessoryRight={ForwardIcon}
|
|
|
|
|
+ title={props.value || " "}
|
|
|
|
|
+ onPress={props.changePath}
|
|
|
|
|
+ />
|
|
|
);
|
|
);
|
|
|
- } else if (type == "actionSheet") {
|
|
|
|
|
|
|
+ } if (type === "actionSheet") {
|
|
|
return (
|
|
return (
|
|
|
- <>
|
|
|
|
|
- <Actionsheet
|
|
|
|
|
- list={props.list}
|
|
|
|
|
- value={props.value}
|
|
|
|
|
- onChange={props.onChange}
|
|
|
|
|
- />
|
|
|
|
|
- </>
|
|
|
|
|
|
|
+ <>
|
|
|
|
|
+ <Actionsheet
|
|
|
|
|
+ list={props.list}
|
|
|
|
|
+ value={props.value}
|
|
|
|
|
+ onChange={props.onChange}
|
|
|
|
|
+ />
|
|
|
|
|
+ </>
|
|
|
);
|
|
);
|
|
|
- } else if (type == "img") {
|
|
|
|
|
|
|
+ } if (type === "img") {
|
|
|
return (
|
|
return (
|
|
|
- <UpLoadImage
|
|
|
|
|
- style={styles.upload}
|
|
|
|
|
- value={props.value}
|
|
|
|
|
- changeIcon={props.onChange}
|
|
|
|
|
- />
|
|
|
|
|
|
|
+ <UpLoadImage
|
|
|
|
|
+ style={styles.upload}
|
|
|
|
|
+ value={props.value}
|
|
|
|
|
+ changeIcon={props.onChange}
|
|
|
|
|
+ />
|
|
|
);
|
|
);
|
|
|
- } else if (appearance == "inner" && props.type == "code") {
|
|
|
|
|
|
|
+ } if (appearance === "inner" && type === "code") {
|
|
|
return (
|
|
return (
|
|
|
- <Input
|
|
|
|
|
- {...inputProps}
|
|
|
|
|
- accessoryLeft={leftprops => (
|
|
|
|
|
- <Label {...props} {...leftprops} />
|
|
|
|
|
|
|
+ <Input
|
|
|
|
|
+ {...inputProps}
|
|
|
|
|
+ accessoryLeft={leftprops => (
|
|
|
|
|
+ <Label {...props} {...leftprops} />
|
|
|
)}
|
|
)}
|
|
|
- accessoryRight={() => <Btn btnText={props.btnText} />}
|
|
|
|
|
- size='small'
|
|
|
|
|
- style={styles.input}
|
|
|
|
|
- appearance='innerCode'
|
|
|
|
|
- />
|
|
|
|
|
|
|
+ accessoryRight={() => <Btn btnText={props.btnText} />}
|
|
|
|
|
+ size='small'
|
|
|
|
|
+ style={styles.input}
|
|
|
|
|
+ appearance='innerCode'
|
|
|
|
|
+ />
|
|
|
);
|
|
);
|
|
|
- } else if (appearance == "inner") {
|
|
|
|
|
|
|
+ } if (appearance === "inner") {
|
|
|
return (
|
|
return (
|
|
|
- <Input
|
|
|
|
|
- {...inputProps}
|
|
|
|
|
- accessoryLeft={leftprops => (
|
|
|
|
|
- <Label {...props} {...leftprops} />
|
|
|
|
|
|
|
+ <Input
|
|
|
|
|
+ {...inputProps}
|
|
|
|
|
+ accessoryLeft={leftprops => (
|
|
|
|
|
+ <Label {...props} {...leftprops} />
|
|
|
)}
|
|
)}
|
|
|
- size='small'
|
|
|
|
|
- style={styles.input}
|
|
|
|
|
- appearance='inner'
|
|
|
|
|
- />
|
|
|
|
|
|
|
+ size='small'
|
|
|
|
|
+ style={styles.input}
|
|
|
|
|
+ appearance='inner'
|
|
|
|
|
+ />
|
|
|
);
|
|
);
|
|
|
- } else {
|
|
|
|
|
|
|
+ }
|
|
|
return <Input {...inputProps} size='small' style={styles.input} />;
|
|
return <Input {...inputProps} size='small' style={styles.input} />;
|
|
|
- }
|
|
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
return (
|
|
return (
|
|
|
- <Layout
|
|
|
|
|
- level='1'
|
|
|
|
|
- style={[
|
|
|
|
|
|
|
+ <Layout
|
|
|
|
|
+ level='1'
|
|
|
|
|
+ style={[
|
|
|
styles.inputContainer,
|
|
styles.inputContainer,
|
|
|
{ ...props.style },
|
|
{ ...props.style },
|
|
|
props.type === "img" ? { flexDirection: "column" } : {},
|
|
props.type === "img" ? { flexDirection: "column" } : {},
|
|
|
- { paddingVertical: appearance == "inner" ? 0 : 10 },
|
|
|
|
|
|
|
+ { paddingVertical: appearance === "inner" ? 0 : 10 },
|
|
|
]}
|
|
]}
|
|
|
- >
|
|
|
|
|
- {appearance !== "inner" && <Label {...props} />}
|
|
|
|
|
|
|
+ >
|
|
|
|
|
+ {appearance !== "inner" && <Label {...props} />}
|
|
|
|
|
|
|
|
- {(!props.value || props.value == " ") && (
|
|
|
|
|
- <Text category='c1' style={styles.sub}>
|
|
|
|
|
- {props.sub}
|
|
|
|
|
- </Text>
|
|
|
|
|
|
|
+ {(!props.value || props.value === " ") && (
|
|
|
|
|
+ <Text category='c1' style={styles.sub}>
|
|
|
|
|
+ {props.sub}
|
|
|
|
|
+ </Text>
|
|
|
)}
|
|
)}
|
|
|
|
|
|
|
|
- {getMain(props.type, props)}
|
|
|
|
|
|
|
+ {getMain(props.type, props)}
|
|
|
|
|
|
|
|
- {appearance !== "inner" && props.type == "code" && Btn(props)}
|
|
|
|
|
- </Layout>
|
|
|
|
|
|
|
+ {appearance !== "inner" && props.type === "code" && Btn(props)}
|
|
|
|
|
+ </Layout>
|
|
|
);
|
|
);
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
-function ChnageTime(sendNum, isSend, changeSend_Num) {
|
|
|
|
|
- let num = sendNum - 1;
|
|
|
|
|
- console.log(num);
|
|
|
|
|
- changeSend_Num(true, num);
|
|
|
|
|
- setTimeout(() => {
|
|
|
|
|
- ChnageTime(num, isSend, changeSend_Num);
|
|
|
|
|
- }, 1000);
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-const styles = StyleSheet.create({
|
|
|
|
|
- inputContainer: {
|
|
|
|
|
- flexDirection: "row",
|
|
|
|
|
- alignItems: "center",
|
|
|
|
|
- paddingVertical: 10,
|
|
|
|
|
- paddingHorizontal: 4,
|
|
|
|
|
- },
|
|
|
|
|
- input: {
|
|
|
|
|
- flex: 1,
|
|
|
|
|
- },
|
|
|
|
|
- label: {
|
|
|
|
|
- width: 80,
|
|
|
|
|
- marginRight: 19,
|
|
|
|
|
- flexShrink: 0,
|
|
|
|
|
- },
|
|
|
|
|
- labelleft: {
|
|
|
|
|
- width: 73,
|
|
|
|
|
- flexShrink: 0,
|
|
|
|
|
- },
|
|
|
|
|
- right: {
|
|
|
|
|
- flexDirection: "row",
|
|
|
|
|
- },
|
|
|
|
|
- code: {
|
|
|
|
|
- paddingHorizontal: 5,
|
|
|
|
|
- marginLeft: 5,
|
|
|
|
|
- },
|
|
|
|
|
- selectContent: {
|
|
|
|
|
- backgroundColor: "#F0F0F0",
|
|
|
|
|
- },
|
|
|
|
|
- titleStyle: {
|
|
|
|
|
- fontSize: 15,
|
|
|
|
|
- },
|
|
|
|
|
- leftLabelTextStyle: {
|
|
|
|
|
- fontSize: 13,
|
|
|
|
|
- },
|
|
|
|
|
- rightLabelTextStyle: {
|
|
|
|
|
- fontSize: 13,
|
|
|
|
|
- },
|
|
|
|
|
- sub: {
|
|
|
|
|
- color: "#787878",
|
|
|
|
|
- position: "absolute",
|
|
|
|
|
- left: 90,
|
|
|
|
|
- zIndex: 2,
|
|
|
|
|
- },
|
|
|
|
|
- upload: {
|
|
|
|
|
- marginTop: 20,
|
|
|
|
|
- width: 67,
|
|
|
|
|
- height: 67,
|
|
|
|
|
- },
|
|
|
|
|
-});
|
|
|
|
|
|
|
|
|
|
export default FormInput;
|
|
export default FormInput;
|