AddGoodsClassification.js 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. import * as WebBrowser from "expo-web-browser";
  2. import * as React from "react";
  3. import {
  4. Image,
  5. Platform,
  6. StyleSheet,
  7. TouchableOpacity,
  8. View,
  9. ImageBackground,
  10. } from "react-native";
  11. import scrollPage from "../decorator/scrollPage";
  12. import { useModel } from "flooks";
  13. import {
  14. Layout,
  15. Tab,
  16. TabView,
  17. Text,
  18. useTheme,
  19. Button,
  20. Card,
  21. } from "@ui-kitten/components";
  22. import FormInput from "../components/FormInput";
  23. import { useFocusEffect } from "@react-navigation/native";
  24. import ScrollPage from "../components/ScrollPage";
  25. import NavHeaderBar from "../components/NavHeaderBar";
  26. import GoodsCard from "../components/GoodsCard";
  27. const Header = (props, title) => (
  28. <Text {...props} category='s1'>
  29. {title}
  30. </Text>
  31. );
  32. export default function AddGoodsClassification({ navigation, route }) {
  33. const theme = useTheme();
  34. const { changeBackground } = useModel("barModel");
  35. const { setNavigation, pushRouter } = useModel("routersModel", true);
  36. const { httpGet } = useModel("httpModel", true);
  37. const { registerSecend, guideStep } = useModel("userModel", true);
  38. const {
  39. goodsClassificationTitle1,
  40. goodsClassificationTitle2,
  41. goodsClassificationTitle3,
  42. } = useModel("wordsModel");
  43. const { showDialog } = useModel("dialogModel");
  44. const [categoryList, changeCategoryList] = React.useState([]);
  45. const [merchantNatureList, changeMerchantNatureList] = React.useState([]);
  46. useFocusEffect(
  47. React.useCallback(() => {
  48. changeBackground(theme["color-primary-500"]);
  49. setNavigation(navigation);
  50. }, [])
  51. );
  52. const [name, changeName] = React.useState("");
  53. const [sort, changeSort] = React.useState("");
  54. const [goodsIds, changeGoodsIds] = React.useState("");
  55. const canNext = React.useMemo(() => {
  56. return true;
  57. }, [name]);
  58. return (
  59. <>
  60. <NavHeaderBar title={goodsClassificationTitle1} />
  61. <ScrollPage>
  62. <Layout style={styles.container}>
  63. <Card
  64. appearance='headerList'
  65. header={(props) => {
  66. return Header(props, goodsClassificationTitle2);
  67. }}
  68. >
  69. <GoodsCard />
  70. <GoodsCard />
  71. </Card>
  72. <Card
  73. appearance='headerList'
  74. header={(props) => {
  75. return Header(props, goodsClassificationTitle3);
  76. }}
  77. >
  78. <GoodsCard />
  79. <GoodsCard />
  80. </Card>
  81. </Layout>
  82. </ScrollPage>
  83. </>
  84. );
  85. }
  86. const styles = StyleSheet.create({
  87. container: {
  88. flex: 1,
  89. paddingBottom: 33,
  90. backgroundColor: "#EEEEEE",
  91. paddingVertical: 20,
  92. },
  93. tabContent: {
  94. backgroundColor: "#fff",
  95. marginTop: 20,
  96. },
  97. img: {
  98. width: 100,
  99. height: 100,
  100. alignSelf: "center",
  101. },
  102. img2: {
  103. width: 97,
  104. height: 21,
  105. alignSelf: "center",
  106. marginTop: 2,
  107. },
  108. text: {
  109. marginTop: 16,
  110. },
  111. layoutLeft: {
  112. // flexDirection: "row",
  113. paddingVertical: 10,
  114. justifyContent: "center",
  115. alignItems: "center",
  116. },
  117. form: {
  118. paddingHorizontal: 26,
  119. paddingVertical: 20,
  120. },
  121. textareaContainer: {
  122. backgroundColor: "#F0F0F0",
  123. height: 100,
  124. borderRadius: 4,
  125. },
  126. textarea: {
  127. textAlignVertical: "top", // hack android
  128. fontSize: 13,
  129. color: "#333",
  130. paddingHorizontal: 14,
  131. paddingVertical: 10,
  132. height: 100,
  133. },
  134. });