Guide3Screen.js 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  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 ConnectButton from "../components/ConnectButton";
  26. import GuideHeaderBar from "../components/GuideHeaderBar";
  27. import Textarea from "react-native-textarea";
  28. export default function Guide1Screen({ navigation, route }) {
  29. const theme = useTheme();
  30. const { changeBackground } = useModel("barModel");
  31. const { setNavigation, pushRouter } = useModel("routersModel", true);
  32. const { httpGet } = useModel("httpModel", true);
  33. const { saveMerchant, guideStep, checkInfo } = useModel("userModel", true);
  34. const {
  35. guide3_title1,
  36. guide3_title2,
  37. guide3_form_1,
  38. guide3_pla_1,
  39. guide3_form_2,
  40. guide3_pla_2,
  41. complete,
  42. } = useModel("wordsModel");
  43. const [aliName, changeAliName] = React.useState("");
  44. const [aliAccount, changeAliAccount] = React.useState("");
  45. useFocusEffect(
  46. React.useCallback(() => {
  47. changeBackground(theme["color-primary-500"]);
  48. setNavigation(navigation);
  49. checkInfo({
  50. aliAccountEvent: changeAliAccount,
  51. aliNameEvent: changeAliName,
  52. });
  53. }, [])
  54. );
  55. const canNext = React.useMemo(() => {
  56. return true;
  57. }, [name]);
  58. return (
  59. <>
  60. <GuideHeaderBar />
  61. <ScrollPage>
  62. <Layout style={styles.container}>
  63. <Card appearance='headFilled'>
  64. <Text category='s1'>{guide3_title1}</Text>
  65. <Text category='s1'>{guide3_title2}</Text>
  66. </Card>
  67. <Card appearance='formFilled'>
  68. {/* 支付宝账号 */}
  69. <FormInput
  70. label={guide3_form_1}
  71. placeholder={guide3_pla_1}
  72. value={aliName}
  73. onChange={changeAliName}
  74. style={{ paddingVertical: 3 }}
  75. />
  76. {/* 支付宝账户名 */}
  77. <FormInput
  78. label={guide3_form_2}
  79. placeholder={guide3_pla_2}
  80. value={aliAccount}
  81. onChange={changeAliAccount}
  82. style={{ paddingVertical: 3 }}
  83. />
  84. <Layout style={styles.layoutLeft} level='1'>
  85. <Button
  86. status='primary'
  87. disabled={!canNext}
  88. onPress={() =>
  89. saveMerchant({ aliName, aliAccount })
  90. }
  91. >
  92. {complete}
  93. </Button>
  94. </Layout>
  95. </Card>
  96. <ConnectButton />
  97. </Layout>
  98. </ScrollPage>
  99. </>
  100. );
  101. }
  102. const styles = StyleSheet.create({
  103. container: {
  104. flex: 1,
  105. paddingBottom: 33,
  106. },
  107. tabContent: {
  108. backgroundColor: "#fff",
  109. marginTop: 20,
  110. },
  111. img: {
  112. width: 100,
  113. height: 100,
  114. alignSelf: "center",
  115. },
  116. img2: {
  117. width: 97,
  118. height: 21,
  119. alignSelf: "center",
  120. marginTop: 2,
  121. },
  122. text: {
  123. marginTop: 16,
  124. },
  125. layoutLeft: {
  126. // flexDirection: "row",
  127. paddingVertical: 10,
  128. justifyContent: "center",
  129. alignItems: "center",
  130. marginTop: 50,
  131. },
  132. form: {
  133. paddingHorizontal: 26,
  134. paddingVertical: 20,
  135. },
  136. textareaContainer: {
  137. backgroundColor: "#F0F0F0",
  138. height: 100,
  139. borderRadius: 4,
  140. },
  141. textarea: {
  142. textAlignVertical: "top", // hack android
  143. fontSize: 13,
  144. color: "#333",
  145. paddingHorizontal: 14,
  146. paddingVertical: 10,
  147. height: 100,
  148. },
  149. });