StoreAudit.js 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. import * as WebBrowser from "expo-web-browser";
  2. import * as React from "react";
  3. import { useFocusEffect } from "@react-navigation/native";
  4. import { Image, StyleSheet } from "react-native";
  5. import { useModel } from "flooks";
  6. import { Layout, Text, useTheme, Button } from "@ui-kitten/components";
  7. import NavHeaderBar from "../components/NavHeaderBar";
  8. import ConnectButton from "../components/ConnectButton";
  9. import ScrollPage from "../components/ScrollPage";
  10. const img = require("../assets/images/shehe1.png");
  11. const img1 = require("../assets/images/shenhe.png");
  12. const img2 = require("../assets/images/shehe2.png");
  13. const styles = StyleSheet.create({
  14. container: {
  15. flex: 1,
  16. paddingBottom: 33,
  17. paddingVertical: 40,
  18. alignItems: "center",
  19. },
  20. icon: {
  21. width: 90,
  22. height: 80,
  23. marginBottom: 26,
  24. },
  25. text: {
  26. fontWeight: "500",
  27. marginBottom: 7,
  28. },
  29. button: {
  30. marginTop: 19,
  31. },
  32. });
  33. export default function StoreAudit() {
  34. const theme = useTheme();
  35. const { changeBackground } = useModel("barModel");
  36. const { status, changeGuideStep, getUserInfo } = useModel("userModel");
  37. const {
  38. storeAudio,
  39. storeAudioText1,
  40. storeAudioText2,
  41. storeAudioText3,
  42. storeAudioText4,
  43. complete,
  44. TGJPSZ,
  45. LIVTXF,
  46. GODOSA,
  47. } = useModel("wordsModel");
  48. useFocusEffect(
  49. React.useCallback(() => {
  50. changeBackground(theme["color-primary-500"]);
  51. }, [])
  52. );
  53. function refreshEvent() {
  54. return getUserInfo();
  55. }
  56. const PENDINGInfo = () => (
  57. <>
  58. <Image source={img1} style={styles.icon} />
  59. <Text category="h6" status="info" style={styles.text}>
  60. {storeAudioText1}
  61. </Text>
  62. <Text category="h6" status="info" style={styles.text}>
  63. {storeAudioText2}
  64. </Text>
  65. </>
  66. );
  67. const PASSInfo = () => (
  68. <>
  69. <Image source={img} style={styles.icon} />
  70. <Text category="h6" status="primary" style={styles.text}>
  71. {storeAudioText3}
  72. </Text>
  73. <Text category="h6" status="primary" style={styles.text}>
  74. {storeAudioText4}
  75. </Text>
  76. <Button style={styles.button} onPress={() => changeGuideStep("finish")}>
  77. {complete}
  78. </Button>
  79. </>
  80. );
  81. const DENYInfo = () => (
  82. <>
  83. <Image source={img2} style={styles.icon} />
  84. <Text category="h6" status="danger" style={styles.text}>
  85. {TGJPSZ}
  86. </Text>
  87. <Text category="h6" status="danger" style={styles.text}>
  88. {LIVTXF}
  89. </Text>
  90. <Button style={styles.button} onPress={() => changeGuideStep("ComeBack")}>
  91. {GODOSA}
  92. </Button>
  93. </>
  94. );
  95. return (
  96. <>
  97. <NavHeaderBar title={storeAudio} back={false} />
  98. <ScrollPage enabledFresh refreshEvent={refreshEvent}>
  99. <Layout style={styles.container}>
  100. {status === "PENDING" && <PENDINGInfo />}
  101. {status === "PASS" && <PASSInfo />}
  102. {status === "DENY" && <DENYInfo />}
  103. <ConnectButton />
  104. </Layout>
  105. </ScrollPage>
  106. </>
  107. );
  108. }