|
@@ -1,10 +1,10 @@
|
|
|
-import { Image, View } from "@tarojs/components";
|
|
|
+import { ScrollView, View } from "@tarojs/components";
|
|
|
import RoundedLabel from "../rounded-label";
|
|
|
import IconFilterFeeds from "@/components/icon/IconFilterFeeds";
|
|
|
import IconFilterBatch from "@/components/icon/IconFilterBatch";
|
|
|
import IconFilterList from "@/components/icon/IconFilterList";
|
|
|
|
|
|
-import IconFIleTxt from "@/components/icon/IconFIleTxt";
|
|
|
+import IconPlusBig from "@/components/icon/icon-plus-big";
|
|
|
import IconFIlePDF from "@/components/icon/IconFIlePDF";
|
|
|
import IconFIleXLSX from "@/components/icon/IconFIleXLSX";
|
|
|
|
|
@@ -15,30 +15,40 @@ import Popup from "@/components/popup/popup";
|
|
|
import WemetaSwitch from "@/components/wemeta-switch";
|
|
|
import { useEffect, useState } from "react";
|
|
|
|
|
|
-import ViewStyleChat from '../view-style/ViewStyleChat'
|
|
|
-import ViewStyleList from '../view-style/ViewStyleList'
|
|
|
-
|
|
|
+import ViewStyleChat from "../view-style/ViewStyleChat";
|
|
|
+import ViewStyleList from "../view-style/ViewStyleList";
|
|
|
+import Taro from "@tarojs/taro";
|
|
|
+import { uploadKnowledgeFile } from "@/service/knowledge";
|
|
|
+import style from "../../index.module.less";
|
|
|
type TListStyle = "chat" | "list";
|
|
|
|
|
|
const Index = () => {
|
|
|
-
|
|
|
const [checked, setChecked] = useState(false);
|
|
|
const [showPopup, setShowPopup] = useState(false);
|
|
|
const [listStyle, setListStyle] = useState<TListStyle>("chat");
|
|
|
-
|
|
|
const handleListStyleChange = (listStyle: TListStyle) => {
|
|
|
setListStyle(listStyle);
|
|
|
};
|
|
|
|
|
|
-
|
|
|
-
|
|
|
- useEffect(() => {
|
|
|
- console.log("hellow");
|
|
|
- }, []);
|
|
|
+ const handleChooseFile = () => {
|
|
|
+ Taro.chooseMessageFile({
|
|
|
+ count: 1,
|
|
|
+ type: "all",
|
|
|
+ async success(res) {
|
|
|
+ // tempFilePath可以作为img标签的src属性显示图片
|
|
|
+ const tempFilePaths = res.tempFiles;
|
|
|
+ const response = await uploadKnowledgeFile({
|
|
|
+ tmpPath: tempFilePaths[0].path,
|
|
|
+ fileName: "field",
|
|
|
+ });
|
|
|
+ console.log(response);
|
|
|
+ },
|
|
|
+ });
|
|
|
+ };
|
|
|
|
|
|
return (
|
|
|
<>
|
|
|
- <View className="pt-12">
|
|
|
+ <View className="pt-12 h-full">
|
|
|
<View className="rounded-container-header"></View>
|
|
|
<View className="px-16 pb-20">
|
|
|
<View className="flex items-center">
|
|
@@ -70,11 +80,20 @@ const Index = () => {
|
|
|
</View>
|
|
|
</View>
|
|
|
</View>
|
|
|
- <View className="px-16">
|
|
|
- {listStyle === "chat" ? <ViewStyleChat/> : <ViewStyleList />}
|
|
|
+ <View className="px-16 h-full">
|
|
|
+
|
|
|
+ {listStyle === "chat" ? <ViewStyleChat /> : <ViewStyleList />}
|
|
|
+
|
|
|
</View>
|
|
|
</View>
|
|
|
-
|
|
|
+
|
|
|
+ <View
|
|
|
+ onClick={handleChooseFile}
|
|
|
+ className="fixed right-20 bottom-20 w-48 h-48 rounded-full bg-primary flex-center drop-shadow-[0_4px_16px_rgba(49,124,250,0.25)]"
|
|
|
+ >
|
|
|
+ <IconPlusBig></IconPlusBig>
|
|
|
+ </View>
|
|
|
+
|
|
|
<Popup setShow={setShowPopup} show={showPopup} title="展示样式">
|
|
|
<View
|
|
|
className={`rounded-card ${
|