index.tsx 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217
  1. import NavBarNormal from "@/components/NavBarNormal/index";
  2. import { View } from "@tarojs/components";
  3. import PageCustom from "@/components/page-custom/index";
  4. import IconVoiceColor from "@/components/icon/icon-voice-color";
  5. import TabBarButtons from "@/components/wemeta-tabs/TabBarButtons";
  6. import WemetaTabs from "@/components/wemeta-tabs/index";
  7. import CardList from "@/components/list/card-list";
  8. import CardListItem from "@/components/list/card-list-item";
  9. import IconIdeaColor from "@/components/icon/icon-idea-color";
  10. import IconPageColor from "@/components/icon/icon-page-color";
  11. import WemetaSwitch from "@/components/WemetaSwitch";
  12. import { useState } from "react";
  13. import IconArrow from "@/components/icon/icon-arrow";
  14. import Popup from "@/components/popup/popup";
  15. import PopupSheets from "@/components/popup/popup-sheets";
  16. export default function Index() {
  17. const [tabIndex, setTabIndex] = useState("1");
  18. const handleTabIndexChange = (index: string) => {
  19. setTabIndex(index);
  20. };
  21. const tabList = [
  22. {
  23. key: "1",
  24. label: "智能体",
  25. },
  26. {
  27. key: "2",
  28. label: "微官网",
  29. },
  30. ];
  31. const [checked, setChecked] = useState(false);
  32. const handleSwitchChange = (checked: boolean) => {
  33. setChecked(checked);
  34. // onSwitchChanged && onSwitchChanged(checked);
  35. };
  36. const [showPopup, setShowPopup] = useState(false);
  37. const IconArrowRight = () => {
  38. return (
  39. <View className="flex items-center">
  40. <IconArrow />
  41. </View>
  42. );
  43. };
  44. const dataLibTabList = [
  45. {
  46. key: "1",
  47. label: "个人知识",
  48. children: <>
  49. <View>
  50. hello
  51. </View>
  52. </>
  53. },
  54. {
  55. key: "2",
  56. label: "企业知识",
  57. children: <>
  58. <View>
  59. world
  60. </View>
  61. </>
  62. },
  63. ];
  64. return (
  65. <PageCustom>
  66. <NavBarNormal>创建</NavBarNormal>
  67. <View className="px-16 w-full flex flex-col gap-20">
  68. <View className="w-full">
  69. <TabBarButtons
  70. current={tabIndex}
  71. list={tabList}
  72. onTabIndexChange={handleTabIndexChange}
  73. ></TabBarButtons>
  74. </View>
  75. <CardList>
  76. <CardListItem
  77. className="pl-16 pr-8"
  78. underline
  79. rightRenderer={IconArrowRight}
  80. leftRenderer={IconVoiceColor}
  81. >
  82. <View className="text-14 py-18 font-medium leading-22">声音</View>
  83. </CardListItem>
  84. <CardListItem
  85. className="pl-16 pr-8"
  86. rightRenderer={IconArrowRight}
  87. leftRenderer={IconIdeaColor}
  88. >
  89. <View className="text-14 py-18 font-medium leading-22">
  90. 开场提问引导
  91. </View>
  92. </CardListItem>
  93. </CardList>
  94. <View className="pt-20">
  95. <CardList>
  96. <CardListItem
  97. className="pl-16 pr-8"
  98. leftRenderer={IconPageColor}
  99. rightRenderer={IconArrowRight}
  100. >
  101. <View className="text-14 py-18 font-medium leading-22">
  102. 知识库
  103. </View>
  104. </CardListItem>
  105. <View className="">
  106. <View className="flex flex-col gap-12 px-16 pb-16">
  107. <View className="flex rounded-8 p-16 gap-16 bg-gray-3">
  108. <View className="flex-1">
  109. <View className="text-14 font-medium leading-22 text-black pb-2">
  110. 个人知识
  111. </View>
  112. <View className="text-12 leading-20 text-gray-4">
  113. 使用你上传的内容(如文档、链接等)作为智能体回答的知识基础。
  114. </View>
  115. </View>
  116. <View className="flex-center">
  117. <WemetaSwitch
  118. checked={checked}
  119. onChange={(checked) => handleSwitchChange(checked)}
  120. ></WemetaSwitch>
  121. </View>
  122. </View>
  123. <View className="flex rounded-8 p-16 bg-gray-3">
  124. <View className="flex-1">
  125. <View className="text-14 font-medium leading-22 text-black pb-2">
  126. 杭州茗视光眼科医院
  127. </View>
  128. <View className="text-12 leading-20 text-gray-4">
  129. 引用企业统一配置的知识库内容,如用于支持专业、统一的客户沟通。
  130. </View>
  131. </View>
  132. <View className="flex-center">
  133. <WemetaSwitch
  134. checked={checked}
  135. onChange={(checked) => handleSwitchChange(checked)}
  136. ></WemetaSwitch>
  137. </View>
  138. </View>
  139. </View>
  140. </View>
  141. </CardList>
  142. </View>
  143. <View className="pt-20">
  144. <CardList>
  145. <View className="py-16 px-20 flex flex-col gap-20">
  146. <CardListItem underline arrow>
  147. <View className="flex items-center font-normal pb-16">
  148. <View className="flex-1 font-normal">姓名</View>
  149. <View className="text-gray-5 mr-8">张三</View>
  150. </View>
  151. </CardListItem>
  152. <CardListItem underline arrow>
  153. <View className="flex items-center font-normal pb-16">
  154. <View className="flex-1 font-normal">手机号码</View>
  155. <View className="text-gray-5 mr-8">137 1234 1234</View>
  156. </View>
  157. </CardListItem>
  158. <CardListItem underline arrow>
  159. <View className="flex items-center font-normal pb-16">
  160. <View className="flex-1 font-normal">联系邮箱</View>
  161. <View className="text-gray-5 mr-8 truncate max-w-[188px]">zhangsan@eyeclear.com</View>
  162. </View>
  163. </CardListItem>
  164. <CardListItem underline arrow>
  165. <View className="flex items-center font-normal pb-16">
  166. <View className="flex-1 font-normal">联系地址</View>
  167. <View className="text-gray-5 mr-8 truncate max-w-[188px]">浙江省杭州市上城区钱江国际时代广场2幢</View>
  168. </View>
  169. </CardListItem>
  170. </View>
  171. </CardList>
  172. </View>
  173. <View className="button-rounded-big" onClick={()=> setShowPopup(true)}>拉起弹层</View>
  174. {/* <Popup setShow={setShowPopup} show={showPopup} title="知识库-图片/视频">
  175. <View>你好啊世界</View>
  176. <WemetaTabs current="1" list={dataLibTabList}>
  177. </WemetaTabs>
  178. </Popup> */}
  179. <PopupSheets
  180. setShow={setShowPopup}
  181. show={showPopup}
  182. content={[
  183. {item: <View className="text-12 font-normal text-gray-4">推荐知识库导入,可自动解析内容并提取知识</View>},
  184. {item: '从知识库导入', type: 'primary', onClick: ()=> {console.log(111)}},
  185. {item:'手动添加', onClick: ()=> {console.log(22)}},
  186. {item:'删除', type: 'warn', onClick: ()=> {console.log(333)}},
  187. ]}
  188. >
  189. </PopupSheets>
  190. </View>
  191. </PageCustom>
  192. );
  193. }