index.tsx 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. import { Text, View } from "@tarojs/components";
  2. import IconPlusBig from "@/components/icon/icon-plus-big";
  3. import Popup from "@/components/popup/popup";
  4. import { useState } from "react";
  5. import ScrollListChat from "./components/ScrollListChat";
  6. import ScrollList from './components/ScrollList';
  7. import WeComQRcode from '@/components/WeComQRcode'
  8. import StyleFilter, {TListStyle} from '../StyleFilter'
  9. const Index = () => {
  10. const [showAiAsistant, setShowAiAsistant] = useState(false);
  11. const [listStyle, setListStyle] = useState<TListStyle>("chat");
  12. const [totalCount, setTotalCount] = useState<number>(0);
  13. const [assistantOnly, setAssistantOnly] = useState(false);
  14. const handleShowAsistantTip = () => {
  15. setShowAiAsistant(true)
  16. };
  17. return (
  18. <>
  19. <View className="pt-20 pb-20">
  20. <StyleFilter onlyAssistantButton checked={assistantOnly} setChecked={setAssistantOnly} listStyle={listStyle} setListStyle={setListStyle}>
  21. <View className="flex-1 text-12 leading-20 text-gray-45">
  22. 共 {totalCount} 个文件
  23. </View>
  24. </StyleFilter>
  25. </View>
  26. {listStyle === "chat" ? <ScrollListChat setTotalCount={setTotalCount} assistantOnly={assistantOnly} /> : <ScrollList setTotalCount={setTotalCount} />}
  27. <View
  28. onClick={handleShowAsistantTip}
  29. className="fixed right-20 bottom-20 z-[200] w-48 h-48 rounded-full bg-primary flex-center drop-shadow-[0_4px_16px_rgba(49,124,250,0.25)]"
  30. >
  31. <IconPlusBig></IconPlusBig>
  32. </View>
  33. <Popup title="添加AI小助理的企业微信" setShow={setShowAiAsistant} show={showAiAsistant}>
  34. <View className="p-20">
  35. <View className="text-12 leading-24 text-[#414A64]">请将资料发送到我的企业微信,我会自动为你解析内容,并同步到这里。</View>
  36. <WeComQRcode text="长按二维码添加" />
  37. </View>
  38. </Popup>
  39. </>
  40. );
  41. };
  42. export default Index;