StoreAudit.js 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  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. } = useModel("wordsModel");
  45. useFocusEffect(
  46. React.useCallback(() => {
  47. changeBackground(theme["color-primary-500"]);
  48. }, [])
  49. );
  50. function refreshEvent() {
  51. return getUserInfo();
  52. }
  53. const PENDINGInfo = () => (
  54. <>
  55. <Image source={img1} style={styles.icon} />
  56. <Text category="h6" status="info" style={styles.text}>
  57. {storeAudioText1}
  58. </Text>
  59. <Text category="h6" status="info" style={styles.text}>
  60. {storeAudioText2}
  61. </Text>
  62. </>
  63. );
  64. const PASSInfo = () => (
  65. <>
  66. <Image source={img} style={styles.icon} />
  67. <Text category="h6" status="primary" style={styles.text}>
  68. {storeAudioText3}
  69. </Text>
  70. <Text category="h6" status="primary" style={styles.text}>
  71. {storeAudioText4}
  72. </Text>
  73. <Button style={styles.button} onPress={() => changeGuideStep("finish")}>
  74. {complete}
  75. </Button>
  76. </>
  77. );
  78. const DENYInfo = () => (
  79. <>
  80. <Image source={img2} style={styles.icon} />
  81. <Text category="h6" status="danger" style={styles.text}>
  82. 很抱歉!!!您的店铺审核暂未通过
  83. </Text>
  84. <Text category="h6" status="danger" style={styles.text}>
  85. 请仔细检查店铺信息重新申请
  86. </Text>
  87. <Button style={styles.button} onPress={() => changeGuideStep("ComeBack")}>
  88. 重新申请
  89. </Button>
  90. </>
  91. );
  92. return (
  93. <>
  94. <NavHeaderBar title={storeAudio} back={false} />
  95. <ScrollPage enabledFresh refreshEvent={refreshEvent}>
  96. <Layout style={styles.container}>
  97. {status === "PENDING" && <PENDINGInfo />}
  98. {status === "PASS" && <PASSInfo />}
  99. {status === "DENY" && <DENYInfo />}
  100. <ConnectButton />
  101. </Layout>
  102. </ScrollPage>
  103. </>
  104. );
  105. }