Bladeren bron

feat: knowledge item & detail

王晓东 3 weken geleden
bovenliggende
commit
3c6ba9b26a
53 gewijzigde bestanden met toevoegingen van 845 en 543 verwijderingen
  1. 7 0
      project.private.config.json
  2. 17 12
      src/app.config.ts
  3. 35 44
      src/app.less
  4. 13 0
      src/components/BottomBar/index.tsx
  5. 13 0
      src/components/card/card-editable/index.module.less
  6. 28 0
      src/components/card/card-editable/index.tsx
  7. 7 0
      src/components/icon/IconA/index.tsx
  8. 7 0
      src/components/icon/IconAImage/index.tsx
  9. 7 0
      src/components/icon/IconALink/index.tsx
  10. 7 0
      src/components/icon/IconDeleteGray16/index.tsx
  11. 7 0
      src/components/icon/IconEye/index.tsx
  12. 7 0
      src/components/icon/IconPlusColor14/index.tsx
  13. 7 0
      src/components/icon/IconPlusGray16/index.tsx
  14. 7 0
      src/components/icon/IconQ/index.tsx
  15. 0 7
      src/components/icon/icon-magic-stick/index.tsx
  16. 1 1
      src/components/media-item/index.tsx
  17. 127 0
      src/components/slide-delete/index.js
  18. 4 0
      src/components/slide-delete/index.json
  19. 15 0
      src/components/slide-delete/index.wxml
  20. 36 0
      src/components/slide-delete/index.wxss
  21. 0 26
      src/components/store-home/store-home.js
  22. 0 5
      src/components/store-home/store-home.json
  23. 0 3
      src/components/store-home/store-home.wxml
  24. 0 6
      src/components/store-home/store-home.wxss
  25. 0 52
      src/components/store-product-item/store-product-item.js
  26. 0 5
      src/components/store-product-item/store-product-item.json
  27. 0 3
      src/components/store-product-item/store-product-item.wxml
  28. 0 34
      src/components/tab-page-wrapper/index.tsx
  29. 3 0
      src/components/wemeta-input/index.tsx
  30. 0 0
      src/images/svgs/IconAImage.svg
  31. 0 0
      src/images/svgs/IconALink.svg
  32. 3 0
      src/images/svgs/IconDeleteGray16.svg
  33. 3 0
      src/images/svgs/IconEye.svg
  34. 4 0
      src/images/svgs/IconPlusColor14.svg
  35. 3 0
      src/images/svgs/IconPlusGray16.svg
  36. BIN
      src/images/svgs/icon-ai-circle.png
  37. 0 0
      src/images/svgs/icon-magic-stick.svg
  38. 9 128
      src/pages/analysis/index.tsx
  39. 3 1
      src/pages/contact/index.config.ts
  40. 29 21
      src/pages/contact/index.tsx
  41. 43 0
      src/pages/knowledge-item-editor/components/media-grid/index.module.less
  42. 83 0
      src/pages/knowledge-item-editor/components/media-grid/index.tsx
  43. 5 0
      src/pages/knowledge-item-editor/index.config.ts
  44. 122 0
      src/pages/knowledge-item-editor/index.tsx
  45. 5 0
      src/pages/knowledge-item/index.config.ts
  46. 96 0
      src/pages/knowledge-item/index.tsx
  47. 3 7
      src/pages/knowledge/components/personal-tab/index.tsx
  48. 65 0
      src/pages/knowledge/components/view-style/ViewStyleList.tsx
  49. 10 181
      src/pages/member/index.tsx
  50. 1 2
      src/pages/page/index.config.ts
  51. 1 2
      src/pages/page/index.tsx
  52. 1 2
      src/pages/profile/index.config.ts
  53. 1 1
      tailwind.config.js

+ 7 - 0
project.private.config.json

@@ -8,6 +8,13 @@
   "condition": {
     "miniprogram": {
       "list": [
+        {
+          "name": "知识库编辑",
+          "pathName": "pages/knowledge-item-editor/index",
+          "query": "",
+          "launchMode": "default",
+          "scene": null
+        },
         {
           "name": "pages/editor-pages/editor-greeting-questions/index",
           "pathName": "pages/editor-pages/editor-greeting-questions/index",

+ 17 - 12
src/app.config.ts

@@ -1,7 +1,12 @@
 export default defineAppConfig({
   pages: [
-    'pages/knowledge/index',
     'pages/index/index',
+    'pages/contact/index',
+    'pages/knowledge/index',
+    'pages/knowledge-item/index',
+    'pages/knowledge-item-editor/index',
+    'pages/member/index',
+    'pages/analysis/index',
     'pages/profile/index',
     'pages/agent/index',
     'pages/editor-pages/editor-personality/index',
@@ -24,9 +29,9 @@ export default defineAppConfig({
 
     
     'pages/editor-pages/editor-channels/index',
-    'pages/analysis/index',
     
-    'pages/member/index',
+    
+    
     
     'pages/choose-contact/index',
     'pages/page/index',
@@ -40,7 +45,7 @@ export default defineAppConfig({
     'pages/editor-pages/editor-link-contact/index',
     'pages/editor-pages/editor-textarea/index',
     'pages/editor-pages/editor-title/index',
-    'pages/contact/index',
+    
     'pages/chat-history/index',
     
     'pages/webview/index',
@@ -51,25 +56,25 @@ export default defineAppConfig({
     selectedColor: '#000000',
     backgroundColor: '#f5f5f2',
     list: [
-      {
-        pagePath: 'pages/knowledge/index',
-        selectedIconPath: 'images/tabbar/contact-actived.png',
-        iconPath: 'images/tabbar/contact.png',
-        text: '知识库'
-      },
       {
         pagePath: 'pages/index/index',
         selectedIconPath: 'images/tabbar/home-actived.png',
         iconPath: 'images/tabbar/home.png',
         text: '主页'
       },
-      
       {
         pagePath: 'pages/contact/index',
         selectedIconPath: 'images/tabbar/contact-actived.png',
         iconPath: 'images/tabbar/contact.png',
         text: '联系人'
       },
+      {
+        pagePath: 'pages/knowledge/index',
+        selectedIconPath: 'images/tabbar/contact-actived.png',
+        iconPath: 'images/tabbar/contact.png',
+        text: '知识库'
+      },
+      
       {
         pagePath: 'pages/analysis/index',
         selectedIconPath: 'images/tabbar/analysis-actived.png',
@@ -80,7 +85,7 @@ export default defineAppConfig({
         pagePath: 'pages/member/index',
         selectedIconPath: 'images/tabbar/vip-actived.png',
         iconPath: 'images/tabbar/vip.png',
-        text: '会员'
+        text: '我的'
       }
     ]
   },

+ 35 - 44
src/app.less

@@ -73,37 +73,6 @@
   background-color: var(--color-bg-primary);
 }
 
-// buttons
-
-.button-rounded-big{
-  display: flex;
-  width: 100%;
-  height: 48px;
-  justify-content: center;
-  align-items: center;
-  background-color: var(--color-primary);
-  border-radius: 8px;
-  overflow: hidden;
-  color: white;
-}
-
-.button-plain{
-  .button-rounded-big();
-  background-color: white;
-  &:active{
-    background-color: var(--color-primary);
-  }
-}
-.button-warn{
-  .warn-color();
-}
-
-.wemeta-button{
-  .button-rounded-big();
-  border-radius: 12px;  
-}
-
-
 .icon-24{
   .iconfont();
   width: 24px;
@@ -126,24 +95,28 @@
   background-color: var(--color-primary);
 }
 
-.button-rounded-mini{
+// buttons
+
+.button-rounded-big{
   display: flex;
-  padding: 2px 14px;
+  height: 48px;
   justify-content: center;
   align-items: center;
-  border-radius: 40px;
-  border: 1px solid #000;
-  color: #000;
-  text-align: center;
-  font-family: "PingFang SC";
-  font-size: 12px;
-  font-style: normal;
-  font-weight: 400;
-  line-height: 20px;
+  background-color: var(--color-primary);
+  border-radius: 8px;
+  overflow: hidden;
+  color: white;
 }
 
-.button-rounded-mini.disabled{
-  opacity: .2;
+.button-plain{
+  .button-rounded-big();
+  background-color: white;
+}
+
+
+.wemeta-button{
+  .button-rounded-big();
+  border-radius: 12px;  
 }
 
 
@@ -177,7 +150,12 @@
   background-color: rgba(var(--color-primary-rgb), .1);
 }
 
+.button-warn{
+  .warn-color();
+}
+
 
+// 社交媒体icon 
 .social-media-icon{
   width: 24px;
   height: 24px;
@@ -301,6 +279,9 @@
 .border-bottom1-gray{
   border-bottom: 1px solid rgba(#000, .05);
 }
+.border-top1-gray{
+  border-top: 1px solid rgba(#000, .05);
+}
 
 
 // 灰底圆框
@@ -315,4 +296,14 @@
   .rounded-card();
   background-color: rgba(var(--color-primary-rgb), .06);
   border: 1px solid var(--color-primary);
+}
+
+.rounded-container-header{
+  width: 100%;
+  border-top-left-radius: 24px;
+  border-top-right-radius: 24px;
+  padding-top: 20px;
+  border-top-width: 1px;
+  border-top: 1px solid #FFFFFF;
+  backdrop-filter: blur(38px);
 }

+ 13 - 0
src/components/BottomBar/index.tsx

@@ -0,0 +1,13 @@
+import { View } from "@tarojs/components";
+
+const Index = ({ children }) => {
+  return (
+    <View className="bottom-bar">
+      <View className="flex gap-8 px-20 py-12">
+        {children}
+      </View>
+    </View>
+  );
+};
+
+export default Index;

+ 13 - 0
src/components/card/card-editable/index.module.less

@@ -0,0 +1,13 @@
+.button{
+  flex: 1;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  font-size: 12px;
+  line-height: 20px;
+  padding: 12px 0;
+  color: rgba(#000, .45);
+}
+.gutterLine{
+  border-right: 1px solid rgba(#000 ,0.05);
+}

+ 28 - 0
src/components/card/card-editable/index.tsx

@@ -0,0 +1,28 @@
+import { View } from "@tarojs/components";
+import style from  './index.module.less'
+export interface IndexProps {
+  buttons: JSX.Element[],
+  children: JSX.Element|JSX.Element[]
+}
+
+const Index = ({children, buttons }: IndexProps) => {
+  const buttonLen = buttons.length - 1
+  return (
+    <View className="rounded-12 bg-white">
+      <View className="pt-12">
+        <View className="px-16 pb-16">
+          {children}
+        </View>
+      </View>
+      <View className="border-top1-gray">
+        <View className="flex items-center px-16">
+          {buttons.map((buttons,index)=> {
+            return <View className={`${style.button} ${index < buttonLen ? style.gutterLine : ''}`}>{buttons}</View>
+          })}
+        </View>
+      </View>
+    </View>
+  )
+}
+
+export default Index;

+ 7 - 0
src/components/icon/IconA/index.tsx

@@ -0,0 +1,7 @@
+import { Image } from '@tarojs/components'
+import Icon from '@/images/svgs/IconA.svg'
+export default () => {
+  return (
+    <Image src={Icon} mode="widthFix" style={{width: '24px', height: '24px'}}></Image>
+  )
+}

+ 7 - 0
src/components/icon/IconAImage/index.tsx

@@ -0,0 +1,7 @@
+import { Image } from '@tarojs/components'
+import Icon from '@/images/svgs/IconAImage.svg'
+export default () => {
+  return (
+    <Image src={Icon} mode="widthFix" style={{width: '24px', height: '24px'}}></Image>
+  )
+}

+ 7 - 0
src/components/icon/IconALink/index.tsx

@@ -0,0 +1,7 @@
+import { Image } from '@tarojs/components'
+import Icon from '@/images/svgs/IconALink.svg'
+export default () => {
+  return (
+    <Image src={Icon} mode="widthFix" style={{width: '24px', height: '24px'}}></Image>
+  )
+}

+ 7 - 0
src/components/icon/IconDeleteGray16/index.tsx

@@ -0,0 +1,7 @@
+import { Image } from '@tarojs/components'
+import Icon from '@/images/svgs/IconDeleteGray16.svg'
+export default () => {
+  return (
+    <Image src={Icon} mode="widthFix" style={{width: '16px', height: '16px'}}></Image>
+  )
+}

+ 7 - 0
src/components/icon/IconEye/index.tsx

@@ -0,0 +1,7 @@
+import { Image } from '@tarojs/components'
+import Icon from '@/images/svgs/IconEye.svg'
+export default () => {
+  return (
+    <Image src={Icon} mode="widthFix" style={{width: '16px', height: '16px'}}></Image>
+  )
+}

+ 7 - 0
src/components/icon/IconPlusColor14/index.tsx

@@ -0,0 +1,7 @@
+import { Image } from '@tarojs/components'
+import Icon from '@/images/svgs/IconPlusColor14.svg'
+export default () => {
+  return (
+    <Image src={Icon} mode="widthFix" style={{width: '14px', height: '14px'}}></Image>
+  )
+}

+ 7 - 0
src/components/icon/IconPlusGray16/index.tsx

@@ -0,0 +1,7 @@
+import { Image } from '@tarojs/components'
+import Icon from '@/images/svgs/IconPlusGray16.svg'
+export default () => {
+  return (
+    <Image src={Icon} mode="widthFix" style={{width: '16px', height: '16px'}}></Image>
+  )
+}

+ 7 - 0
src/components/icon/IconQ/index.tsx

@@ -0,0 +1,7 @@
+import { Image } from '@tarojs/components'
+import Icon from '@/images/svgs/IconQ.svg'
+export default () => {
+  return (
+    <Image src={Icon} mode="widthFix" style={{width: '24px', height: '24px'}}></Image>
+  )
+}

+ 0 - 7
src/components/icon/icon-magic-stick/index.tsx

@@ -1,7 +0,0 @@
-import { Image } from '@tarojs/components'
-import Icon from '@/images/svgs/icon-magic-stick.svg'
-export default () => {
-  return (
-    <Image src={Icon} mode="widthFix" style={{width: '30px', height: '30px'}}></Image>
-  )
-}

+ 1 - 1
src/components/media-item/index.tsx

@@ -27,7 +27,7 @@ export default ({media, extraClass, isAspectRatio=false, mode='aspectFill'}:Prop
       setDuration(event.detail.duration)
     }
   }
-  console.log(media, 99999)
+  
   if (media.fileType === "video") {
 
     return (

+ 127 - 0
src/components/slide-delete/index.js

@@ -0,0 +1,127 @@
+Component({
+  /**
+   * 组件的属性列表
+   */
+  properties: {
+    pid: {
+      type: Number,
+      value: 0,
+      observer(newVal) {
+        if(newVal) {
+          this.setData({
+              animate: true
+          }, () => {
+              this.setData({
+                  translateX: 0
+              })
+          })
+        }
+      }
+    }
+  },
+
+  /**
+   * 组件的初始数据
+   */
+  data: {
+    translateX: 0,
+    animate: false
+  },
+
+  /**
+   * 组件的方法列表
+   */
+  methods: {
+    /**
+     * 处理touchstart事件
+     */
+    handleTouchStart(e) {
+      // touch事件初始时,组件禁掉transition动画
+      this.setData({
+        animate: false
+      }, () => {
+        this.touchStartX = e.touches[0].pageX
+        this.touchStartY = e.touches[0].pageY
+        this.startX = this.data.translateX      // 组件初始位置
+        this.direction = null                   // 记录手指滑动方向 X:左右滑动; Y:上下滑动
+      })
+    },
+
+    /**
+     * 处理touchmove事件
+     */
+    handleTouchMove: function (e) {
+      this.touchMoveX = e.touches[0].pageX
+      this.touchMoveY = e.touches[0].pageY
+      this.moveX = this.touchMoveX - this.touchStartX
+
+      // 竖直移动距离超过了左右移动距离
+      if(Math.abs(this.touchMoveY - this.touchStartY) > Math.abs(this.moveX)) {
+        this.direction = 'Y'
+        return
+      }
+      this.direction = 'X'
+
+      // 以下两种情况不进行移动:1. 在最右边时向右滑动; 2. 在最左边时向左滑动
+      if((this.startX === 0 && this.moveX > 0) || (this.startX === -this.actionWidth && this.moveX < 0)) {
+        return
+      } else if(Math.abs(this.moveX) >= this.actionWidth) {
+        // 移动超出删除按钮的宽度时取按钮宽度作为移动距离
+        this.moveX = this.moveX < 0 ? -this.actionWidth : this.actionWidth
+        this.setData({
+          translateX: this.moveX
+        })
+      } else {  // 其他情况:手指滑动多少就位移多少
+        this.setData({
+          translateX: this.touchMoveX - this.touchStartX + this.startX
+        })
+      }
+    },
+
+    /**
+     * 处理touchend事件
+     */
+    handleTouchEnd: function (e) {
+      // 非左右滑动时不进行任何操作
+      if(this.direction !== 'X') {
+        return
+      }
+      let translateX = 0
+      // 移动超出右滑最大位移
+      if(this.moveX + this.startX >= 0) {
+        translateX = 0
+      } else if(this.moveX + this.startX <= -this.actionWidth) {
+        // 移动超出左滑最大位移
+        translateX = -this.actionWidth
+      } else if((this.startX === 0 && Math.abs(this.moveX) < this.actionWidth / 2) || (this.startX === -this.actionWidth && Math.abs(this.moveX) > this.actionWidth / 2)) {
+        // 以下两种情况都滑动到右边起点(即删除按钮隐藏的状态):
+        // 1. 从右边起点左滑但未超过最大位移的一半,回退到右边起点
+        // 2. 从左边起点右滑且超过最大位移的一半,继续滑到到右边起点
+        translateX = 0
+      } else {
+        translateX = -this.actionWidth
+      }
+      this.setData({
+          animate: true
+      }, () => {
+          this.setData({
+              translateX
+          })
+      })
+    },
+
+    /**
+     * 组件操作事件(此示例只有删除事件,可根据需要增加其他事件)
+     */
+    handleAction({ currentTarget: { dataset: data } }) {
+      this.triggerEvent('action', {
+        type: data.type,
+        id: this.data.pid
+      })
+    }
+  },
+
+  ready() {
+    this.actionWidth = 60
+  }
+})

+ 4 - 0
src/components/slide-delete/index.json

@@ -0,0 +1,4 @@
+{
+  "component": true,
+  "usingComponents": {}
+}

+ 15 - 0
src/components/slide-delete/index.wxml

@@ -0,0 +1,15 @@
+<view class="wrap">
+  <view class="content {{animate ? 'animate' : ''}}"
+        bindtouchstart="handleTouchStart"
+        bindtouchmove="handleTouchMove"
+        bindtouchend="handleTouchEnd"
+        style="transform: translateX({{translateX * 2}}rpx)"
+  >
+      <slot/>
+  </view>
+  <view class="action-wrap">
+      <view class="action del" bindtap="handleAction" data-type="del">
+          <text>删除</text>
+      </view>
+  </view>
+</view>

+ 36 - 0
src/components/slide-delete/index.wxss

@@ -0,0 +1,36 @@
+.wrap {
+  position: relative;
+}
+
+.wrap .content {
+  position: relative;
+  z-index: 1;
+  background: #fff;
+}
+
+.wrap .content.animate {
+  transition: transform 0.3s;
+}
+
+.wrap .action-wrap {
+  position: absolute;
+  display: flex;
+  width: 120rpx;
+  top: 0;
+  bottom: 0;
+  right: 0;
+}
+
+.wrap .action {
+  display: flex;
+  width: 120rpx;
+  height: 100%;
+  justify-content: center;
+  align-items: center;
+  background: #E66671;
+}
+
+.wrap .action text {
+  font-size: 24rpx;
+  color: #fff;
+}

+ 0 - 26
src/components/store-home/store-home.js

@@ -1,26 +0,0 @@
-Component({
-  behaviors: [],
-  properties: {
-    appid: { // 属性名
-      type: String, // 类型(必填),目前接受的类型包括:String, Number, Boolean, Object, Array, null(表示任意类型)
-      value: '', // 属性初始值(可选),如果未指定则会根据类型选择一个
-      observer: function(newVal, oldVal, changedPath) {
-         // 属性被改变时执行的函数(可选),也可以写成在methods段中定义的方法名字符串, 如:'_propertyChange'
-         // 通常 newVal 就是新设置的数据, oldVal 是旧数据
-      }
-    }
-  },
-  data: {}, // 私有数据,可用于模版渲染
-
-  // 生命周期函数,可以为函数,或一个在methods段中定义的方法名
-  attached: function(){},
-  moved: function(){},
-  detached: function(){},
-
-  methods: {
-    clickHandler () {
-      console.log('clicked')
-    }
-  }
-
-})

+ 0 - 5
src/components/store-home/store-home.json

@@ -1,5 +0,0 @@
-{
-  "component": true,
-  "usingComponents": {
-  }
-}

+ 0 - 3
src/components/store-home/store-home.wxml

@@ -1,3 +0,0 @@
-<view>
-  <store-home appid="{{appid}}" />
-</view>

+ 0 - 6
src/components/store-home/store-home.wxss

@@ -1,6 +0,0 @@
-.wx_store_home .wx_store_home_info{
-  background: red;
-}
-.wx_store_home .wx_store_home_img_desc {
-  display: none;
-}

+ 0 - 52
src/components/store-product-item/store-product-item.js

@@ -1,52 +0,0 @@
-Component({
-  behaviors: [],
-  properties: {
-    appid: { // 属性名
-      type: String, // 类型(必填),目前接受的类型包括:String, Number, Boolean, Object, Array, null(表示任意类型)
-      value: '', // 属性初始值(可选),如果未指定则会根据类型选择一个
-      observer: function(newVal, oldVal, changedPath) {
-         // 属性被改变时执行的函数(可选),也可以写成在methods段中定义的方法名字符串, 如:'_propertyChange'
-         // 通常 newVal 就是新设置的数据, oldVal 是旧数据
-      }
-    },
-    productId: String, // 简化的定义方式
-    // productPromotionLink: String // 简化的定义方式
-  },
-  data: {
-    customStyle: {
-      card: {
-        'background-color': '#FFFFFF',
-      },
-      title: {
-        color: 'rgba(0, 0, 0, 0.8)',
-      },
-      price: {
-        color: '#FF6146'
-      },
-      'buy-button': {
-        width: '100px',
-        'border-radius': '30px',
-        'background-color': 'rgba(0,0,0,0.9)',
-        color: '#FFD48D',
-      },
-      'buy-button-disabled': {
-        width: '100px',
-        'border-radius': '30px',
-        'background-color': 'rgba(0,0,0,0.9)',
-        color: '#FFD48D',
-      },
-    },
-  }, // 私有数据,可用于模版渲染
-
-  // 生命周期函数,可以为函数,或一个在methods段中定义的方法名
-  attached: function(){},
-  moved: function(){},
-  detached: function(){},
-
-  methods: {
-    clickHandler () {
-      console.log('clicked')
-    }
-  }
-
-})

+ 0 - 5
src/components/store-product-item/store-product-item.json

@@ -1,5 +0,0 @@
-{
-  "component": true,
-  "usingComponents": {
-  }
-}

+ 0 - 3
src/components/store-product-item/store-product-item.wxml

@@ -1,3 +0,0 @@
-<view>
-  <store-product appid="{{appid}}" product-id="{{productId}}" />
-</view>

+ 0 - 34
src/components/tab-page-wrapper/index.tsx

@@ -1,34 +0,0 @@
-import { View } from "@tarojs/components";
-import React from "react";
-import PageWrapper from "../page-wrapper/index";
-import { useAppStore } from "@/store/appStore";
-
-interface Props {
-  children?: React.ReactChild | React.ReactChild[];
-  bgColor?: string;
-  isflex?: boolean; // 有横向滚动的scroll-view 容器不能包裹在 flex comlumn 布局中
-  style?: React.CSSProperties;
-  paddingTop?: number;
-}
-
-const Index: React.FC<Props> = ({ children, isflex = true, paddingTop, style }) => {
-  const headerHeight = useAppStore((state) => state.headerHeight);
-  const flexStyle = isflex ? "flex flex-col items-center" : "";
-  const pt = paddingTop ?? headerHeight 
-  // 内容高度全屏
-  const styles = `min-height: calc(100vh - ${pt}px)`
-  return (
-    <PageWrapper style={style}>
-      <View style={{ paddingTop: pt}}>
-        <View
-            className={`${flexStyle} w-full px-28 py-20`}
-            style={styles}
-          >
-            {children}
-          </View>
-      </View>
-    </PageWrapper>
-  );
-};
-
-export default Index;

+ 3 - 0
src/components/wemeta-input/index.tsx

@@ -7,6 +7,7 @@ interface Props {
   value: string;
   disabled?: boolean;
   prefix?: () => JSX.Element | JSX.Element[] | undefined;
+  suffix?: () => JSX.Element | JSX.Element[] | undefined;
   onInput: (value: string) => void;
   confirmType?: keyof InputProps.ConfirmType;
   onConfirm?: (value: string) => void;
@@ -25,6 +26,7 @@ const index = ({
   confirmType = "done",
   extraStyle,
   prefix,
+  suffix,
   adjustPosition,
 }: Props) => {
   const [focus, setFocus] = useState(false);
@@ -81,6 +83,7 @@ const index = ({
             onConfirm && onConfirm(e.detail.value);
           }}
         />
+        {suffix && suffix()}
       </View>
     </View>
   );

+ 0 - 0
src/images/svgs/IconQAImage.svg → src/images/svgs/IconAImage.svg


+ 0 - 0
src/images/svgs/IconQALink.svg → src/images/svgs/IconALink.svg


+ 3 - 0
src/images/svgs/IconDeleteGray16.svg

@@ -0,0 +1,3 @@
+<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path fill-rule="evenodd" clip-rule="evenodd" d="M13.5247 3.49596C13.7841 3.49596 14 3.71129 14 3.98529V4.23862C14 4.50595 13.7841 4.72795 13.5247 4.72795H2.4759C2.21591 4.72795 2 4.50595 2 4.23862V3.98529C2 3.71129 2.21591 3.49596 2.4759 3.49596H4.41971C4.81457 3.49596 5.1582 3.2153 5.24703 2.8193L5.34882 2.36464C5.50702 1.74531 6.02766 1.33398 6.62351 1.33398H9.37649C9.96585 1.33398 10.4923 1.74531 10.6447 2.33197L10.7536 2.81864C10.8418 3.2153 11.1854 3.49596 11.5809 3.49596H13.5247ZM12.5371 12.7568C12.74 10.8654 13.0953 6.37216 13.0953 6.32682C13.1083 6.18949 13.0635 6.05949 12.9747 5.95483C12.8794 5.85683 12.7588 5.79883 12.6259 5.79883H3.37887C3.24531 5.79883 3.11823 5.85683 3.03005 5.95483C2.94057 6.05949 2.89648 6.18949 2.90297 6.32682C2.90416 6.33515 2.91691 6.49343 2.93822 6.75804C3.03291 7.93354 3.29664 11.2075 3.46705 12.7568C3.58765 13.8981 4.33651 14.6154 5.42123 14.6414C6.25827 14.6607 7.1206 14.6674 8.00239 14.6674C8.83294 14.6674 9.67647 14.6607 10.5395 14.6414C11.6618 14.6221 12.41 13.9174 12.5371 12.7568Z" fill="black" fill-opacity="0.25"/>
+</svg>

+ 3 - 0
src/images/svgs/IconEye.svg

@@ -0,0 +1,3 @@
+<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path fill-rule="evenodd" clip-rule="evenodd" d="M5.39854 8.00037C5.39854 9.42259 6.56277 10.5798 8.00017 10.5798C9.43106 10.5798 10.5953 9.42259 10.5953 8.00037C10.5953 6.57168 9.43106 5.41451 8.00017 5.41451C6.56277 5.41451 5.39854 6.57168 5.39854 8.00037ZM11.8246 4.03103C12.9628 4.91022 13.9319 6.19669 14.6278 7.80639C14.6798 7.92921 14.6798 8.07144 14.6278 8.1878C13.2359 11.4072 10.7579 13.3337 8.00016 13.3337H7.99366C5.24244 13.3337 2.76439 11.4072 1.37252 8.1878C1.32049 8.07144 1.32049 7.92921 1.37252 7.80639C2.76439 4.58699 5.24244 2.66699 7.99366 2.66699H8.00016C9.37902 2.66699 10.6863 3.14538 11.8246 4.03103ZM8.00096 9.60863C8.89201 9.60863 9.62047 8.88459 9.62047 7.99893C9.62047 7.10681 8.89201 6.38277 8.00096 6.38277C7.92291 6.38277 7.84486 6.38924 7.77331 6.40217C7.7473 7.11328 7.16193 7.68217 6.43998 7.68217H6.40746C6.38795 7.7856 6.37494 7.88903 6.37494 7.99893C6.37494 8.88459 7.10339 9.60863 8.00096 9.60863Z" fill="black" fill-opacity="0.25"/>
+</svg>

+ 4 - 0
src/images/svgs/IconPlusColor14.svg

@@ -0,0 +1,4 @@
+<svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
+<circle cx="7" cy="7" r="6" fill="#317CFA"/>
+<path d="M9.135 7.48419H7.47833V9.13503C7.47833 9.40336 7.2625 9.61919 6.99417 9.61919C6.72583 9.61919 6.51 9.40336 6.51 9.13503V7.48419H4.85917C4.59083 7.47836 4.375 7.26253 4.375 6.99419C4.375 6.86528 4.4275 6.74336 4.515 6.65003C4.60833 6.56253 4.73083 6.51003 4.85917 6.51003H6.51V4.86503C6.51 4.59669 6.72583 4.38086 6.99417 4.38086C7.2625 4.38086 7.47833 4.59669 7.47833 4.86503V6.51003H9.135C9.40333 6.51003 9.61917 6.72586 9.61917 6.99419C9.61917 7.26253 9.40333 7.47836 9.135 7.48419Z" fill="white"/>
+</svg>

+ 3 - 0
src/images/svgs/IconPlusGray16.svg

@@ -0,0 +1,3 @@
+<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path fill-rule="evenodd" clip-rule="evenodd" d="M7 9V16H9V9H16V7H9V0H7V7H0V9H7Z" fill="black" fill-opacity="0.45"/>
+</svg>

BIN
src/images/svgs/icon-ai-circle.png


File diff suppressed because it is too large
+ 0 - 0
src/images/svgs/icon-magic-stick.svg


+ 9 - 128
src/pages/analysis/index.tsx

@@ -1,134 +1,15 @@
 import { View, Text, Image } from "@tarojs/components";
 import Taro, { useDidShow } from "@tarojs/taro";
-import NavBar from "@/components/nav-bar/index";
-import { useAppStore } from "@/store/appStore";
-import style from "./index.module.less";
-import { getWeeklyStats, getChatHistories } from "@/service/stats";
-import { useState } from "react";
-import { TWeeklyChatStatistics, TEntityChatSession } from "@/types/index";
-import IconPeople from "@/images/icon-people.png";
-import { formatDateFull } from "@/utils/index";
-import { useUserStore } from "@/store/userStore";
-import { APP_NAME_TEXT } from '@/config'
-import { reportPageVisit } from "@/utils/report";
-import TabPageWrapper from "@/components/tab-page-wrapper/index";
-export default () => {
-  const headerHeight = useAppStore((state) => state.headerHeight);
-  const [stats, setStats] = useState<TWeeklyChatStatistics | null>(null);
-  const [chatHistories, setChatHistories] = useState<TEntityChatSession[] | []>(
-    []
-  );
-  const user = useUserStore((state) => state.user);
-  const isVip = user?.vip !== "vip_free";
-  const fetchStatsData = async () => {
-    const res = await getWeeklyStats();
-    if (res?.data) {
-      setStats(res.data);
-    }
-  };
-  const fetchHistories = async () => {
-    const res = await getChatHistories({ page: 1, pageSize: 50 });
-    if (res?.data) {
-      setChatHistories(res.data);
-    }
-  };
-  const handleNav = (item: TEntityChatSession) => {
-    Taro.navigateTo({
-      url: `/pages/chat-history/index?sessionId=${item.sessionId}&characterName=${item.characterName}&createAt=${item.createdAt}&num=${item.num}`,
-    });
-  };
-  const gohome = ()=> {
-    Taro.switchTab({
-      url: '/pages/index/index'
-    })
-  }
-  const go2Vip = ()=> {
-    Taro.switchTab({
-      url: '/pages/member/index'
-    })
-  }
-  useDidShow(() => {
-    fetchStatsData();
-    if(isVip){
-      fetchHistories();  
-    }
-  });
-
-  reportPageVisit();
+import NavBarNormal from "@/components/nav-bar-normal/index";
+import PageCustom from "@/components/page-custom/index";
 
-  const renderList = ()=> {
-    if(chatHistories?.length){
-      return <>
-      {chatHistories.map((item: TEntityChatSession) => {
-        return (
-          <View
-            className={`${style.chatItem}`}
-            onClick={() => handleNav(item)}
-          >
-            <Image
-              src={IconPeople}
-              className="w-28 h-28 rounded-6"
-            ></Image>
-            <View className={style.turnRow}>
-              <View className={style.turnNum}>{item.num}</View>
-              <View className={style.turnText}>轮</View>
-            </View>
-            <View className={style.datetime}>
-              {formatDateFull(new Date(item.createdAt))}
-            </View>
-            <View className={style.userName}>
-              {item.characterName}
-            </View>
-          </View>
-        );
-      })}
-      </>
-    }
-      
-    return <View className="flex flex-col pt-56 items-center">
-      <View className='data-empty'></View>
-      <View className='text-12 text-gray-45 text-center leading-24 mt-12'>暂时没有互动记录,请先创建{APP_NAME_TEXT}</View>
-      <View className='full-button-rounded mt-20' style={{paddingLeft: '90px', paddingRight: '90px'}} onClick={gohome}>创建{APP_NAME_TEXT}</View>
-    </View>
-  }
+export default () => {
+  
   return (
-    <TabPageWrapper>
-      <NavBar>
-        <View className="flex items-center">
-          <Text>聊天分析</Text>
-        </View>
-      </NavBar>
-      
-      <View className="w-full">
-        {!isVip && <View className="absolute bottom-0 left-0 right-0 z-10 popup-vip-tips" onClick={go2Vip}>
-          <Image className='w-full' src='https://cdn.wehome.cn/cmn/png/214/META-H8UKYHWU-E9EPKMQUBSVOJ4T4NHO63-MKACO82M-A9.png' mode="widthFix"></Image>
-        </View>
-        }
-        <View
-          className={`flex px-20 py-40 bg-white rounded-20 gap-20 mb-40 w-full ${style.dashboardScoreBar}`}
-        >
-          <View className={`flex flex-col flex-1 gap-4}`}>
-            <Text className={style.dashboardScore}>
-              {stats?.weeklyNewUsers ?? 0}
-            </Text>
-            <View className={style.dashboardSubText}>本周聊天人数</View>
-          </View>
-          <View className="flex flex-col flex-1 gap-4">
-            <Text className={style.dashboardScore}>
-              {stats?.weeklyTotalChats ?? 0}
-            </Text>
-            <View className={style.dashboardSubText}>本周聊天轮次</View>
-          </View>
-        </View>
-
-        <View className="mb-16 text-black text-18 leading-26 font-medium">
-          最新互动
-        </View>
-
-        <View className={style.chatList}>
-          {renderList()}
-        </View>
-      </View>
-    </TabPageWrapper>
+    <PageCustom>
+      <NavBarNormal leftColumn={()=> <Text>数据分析</Text>}>
+      </NavBarNormal>
+      <View className="p-20">暂无数据</View>
+    </PageCustom>
   );
 };

+ 3 - 1
src/pages/contact/index.config.ts

@@ -1,6 +1,8 @@
 export default definePageConfig({
   navigationBarTitleText: '分类页',
-  "usingComponents": {},
   navigationStyle: 'custom',
   onReachBottomDistance: 20,
+  usingComponents: {
+    'slide-delete': '../../components/slide-delete/index',
+  }
 })

+ 29 - 21
src/pages/contact/index.tsx

@@ -1,9 +1,8 @@
 import Taro, { useReachBottom } from "@tarojs/taro";
 import { View, Text } from "@tarojs/components";
 
-import NavBar from "@/components/nav-bar/index";
+import NavBarNormal from "@/components/nav-bar-normal/index";
 import SearchBar from "@/components/search-bar/index";
-import TabPageWrapper from "@/components/tab-page-wrapper/index";
 import style from "./index.module.less";
 import { useEffect, useState } from "react";
 import ContactCard from "./components/contact-card/index";
@@ -12,6 +11,7 @@ import { IContactModel } from "@/types/index";
 import { useDebounceWithParams } from "@/utils/index";
 import { reportPageVisit } from "@/utils/report";
 import { useLoadMore } from "@/utils/loadMore";
+import PageCustom from "@/components/page-custom/index";
 
 export default function Index() {
   const [searchValue, setSearchValue] = useState("");
@@ -83,16 +83,24 @@ export default function Index() {
 
   reportPageVisit();
 
+  const handleHello = (e:any)=> {
+    console.log(e)
+  }
+
   const renderContent = () => {
     if (list?.length) {
       return list.map((item) => (
-        <ContactCard
-          refresh={resetFetchList}
-          deleteable
-          key={item.contactProfileId}
-          data={item}
-          fromContact
-        ></ContactCard>
+        // @ts-ignore
+        <slide-delete pid={item.contactProfileId} onAction={handleHello}>
+          <ContactCard
+            refresh={resetFetchList}
+            deleteable
+            key={item.contactProfileId}
+            data={item}
+            fromContact
+          ></ContactCard>
+        </slide-delete>
+        
       ));
     }
     return (
@@ -106,19 +114,19 @@ export default function Index() {
   };
 
   return (
-    <TabPageWrapper>
-      <NavBar>
-        <View className={style.titleMarkup}></View>
-        <Text>联系人</Text>
-      </NavBar>
+    <PageCustom>
+      <NavBarNormal leftColumn={()=> <Text>联系人</Text>}></NavBarNormal>
       <View className="flex flex-col gap-20 w-full">
-        <SearchBar
-          value={searchValue}
-          onChange={(e) => handleSearchBarChanged(e)}
-          onClear={() => handleClear()}
-        ></SearchBar>
-        <View className="flex flex-col gap-8 w-full">{renderContent()}</View>
+        <View className="px-8">
+          <SearchBar
+            value={searchValue}
+            onChange={(e) => handleSearchBarChanged(e)}
+            onClear={() => handleClear()}
+          ></SearchBar>
+        </View>
+        
+        <View className="flex flex-col w-full overflow-hidden">{renderContent()}</View>
       </View>
-    </TabPageWrapper>
+    </PageCustom>
   );
 }

+ 43 - 0
src/pages/knowledge-item-editor/components/media-grid/index.module.less

@@ -0,0 +1,43 @@
+.addImageBtn{
+  display: flex;
+  width: 110px;
+  height: 110px;
+  justify-content: center;
+  align-items: center;
+  border-radius: 10px;
+  background: white;
+}
+.imageItem{
+  .addImageBtn();
+  position: relative;
+  overflow: hidden;
+}
+.media{
+  display: flex;
+  width: 110px;
+  height: 110px;
+  align-items: center;
+  justify-items: center;
+  // line-height: 220px;
+  font-size: 0;
+  // vertical-align: middle;
+}
+.addImageBtnIcon{
+  width: 20px;
+  height: 20px;
+  font-size: 20px;
+}
+.deleteButton{
+  position: absolute;
+  top: 0;
+  right: 0;
+  z-index: 1;
+  width: 32px;
+  height: 32px;
+  left: 79px;
+  border-top-right-radius: 8px;
+  border-bottom-left-radius: 8px;
+  padding: 8px;
+  background-color: rgba(white, .85);
+}
+

+ 83 - 0
src/pages/knowledge-item-editor/components/media-grid/index.tsx

@@ -0,0 +1,83 @@
+import { View } from "@tarojs/components";
+import MediaItem from "@/components/media-item/index";
+import style from './index.module.less'
+import IconDeleteGray16 from "@/components/icon/IconDeleteGray16";
+import IconPlusGray16 from "@/components/icon/IconPlusGray16";
+const Index = () => {
+  const handleDelete = (e:any)=> {
+    e.stopPropagation();
+    console.log('delete')
+  }
+  return (
+    <View className="grid grid-cols-3 gap-x-8 gap-y-12 justify-center">
+      <View className="flex">
+        <View className={style.addImageBtn}>
+          <IconPlusGray16/>
+        </View>
+      </View>
+      <View className="flex">
+        <View className={style.imageItem}>
+          <MediaItem media={{fileType: 'image',url: 'https://cdn.wehome.cn/cmn/png/53/META-H8UKWHWU-2JNUAG2BARJF55VHU9QS3-YBQGHDAM-IW.png'}}></MediaItem>
+
+          <View
+            className={style.deleteButton}
+            onClick={handleDelete}
+          >
+            
+            <IconDeleteGray16/>
+          </View>
+        </View>
+      </View>
+      <View className="flex">
+        <View className={style.imageItem}>
+          <MediaItem media={{fileType: 'image',url: 'https://cdn.wehome.cn/cmn/png/53/META-H8UKWHWU-2JNUAG2BARJF55VHU9QS3-YBQGHDAM-IW.png'}}></MediaItem>
+
+          <View
+            className={style.deleteButton}
+            onClick={handleDelete}
+          >
+            <IconDeleteGray16/>
+          </View>
+        </View>
+      </View>
+      <View className="flex">
+        <View className={style.imageItem}>
+          <MediaItem media={{fileType: 'image',url: 'https://cdn.wehome.cn/cmn/png/53/META-H8UKWHWU-2JNUAG2BARJF55VHU9QS3-YBQGHDAM-IW.png'}}></MediaItem>
+
+          <View
+            className={style.deleteButton}
+            onClick={handleDelete}
+          >
+            <IconDeleteGray16/>
+          </View>
+        </View>
+      </View>
+      <View className="flex">
+        <View className={style.imageItem}>
+          <MediaItem media={{fileType: 'image',url: 'https://cdn.wehome.cn/cmn/png/53/META-H8UKWHWU-2JNUAG2BARJF55VHU9QS3-YBQGHDAM-IW.png'}}></MediaItem>
+
+          <View
+            className={style.deleteButton}
+            onClick={handleDelete}
+          >
+            <IconDeleteGray16/>
+          </View>
+        </View>
+      </View>
+      <View className="flex">
+        <View className={style.imageItem}>
+          <MediaItem media={{fileType: 'image',url: 'https://cdn.wehome.cn/cmn/png/53/META-H8UKWHWU-2JNUAG2BARJF55VHU9QS3-YBQGHDAM-IW.png'}}></MediaItem>
+
+          <View
+            className={style.deleteButton}
+            onClick={handleDelete}
+          >
+            <IconDeleteGray16/>
+          </View>
+        </View>
+      </View>
+    </View>
+  )
+}
+
+export default Index;

+ 5 - 0
src/pages/knowledge-item-editor/index.config.ts

@@ -0,0 +1,5 @@
+export default definePageConfig({
+  navigationBarTitleText: '知识库编辑',
+  "usingComponents": {},
+  navigationStyle: 'custom'
+})

+ 122 - 0
src/pages/knowledge-item-editor/index.tsx

@@ -0,0 +1,122 @@
+/**
+ * 知识库项目编辑
+ */
+
+import { Text, View } from "@tarojs/components";
+
+import PageCustom from "@/components/page-custom/index";
+import NavBarNormal from "@/components/nav-bar-normal/index";
+import BottomBar from "@/components/BottomBar";
+
+import IconQ from "@/components/icon/IconQ";
+import IconA from "@/components/icon/IconA";
+import IconAImage from "@/components/icon/IconAImage";
+import IconPlusColor14 from "@/components/icon/IconPlusColor14";
+import IconALink from "@/components/icon/IconALink";
+import IconDeleteGray16 from "@/components/icon/IconDeleteGray16";
+import { useState } from "react";
+import Taro from "@tarojs/taro";
+import WemetaTextarea from '@/components/wemeta-textarea'
+import WemetaInput from '@/components/wemeta-input'
+import MediaGrid from './components/media-grid'
+
+
+export default function Index() {
+  const [value, setValue] = useState("手术费用大概多少?能刷医保吗?");
+  const [valueA, setValueA] = useState("全飞秒手术费用通常在1.5万-2万元左右,半飞秒约1.2万起,ICL晶体术因晶体品牌不同在2.5万-4万元不等。屈光手术属于择业性消费,一般不纳入医保范围,但部分城市可用商业保险或税优健康险报销。");
+  const handleInput = (value: string) => {
+    setValue(value);
+  };
+  const handleValueAInput = (value: string) => {
+    setValueA(value);
+  };
+  const handleDelete = (e:any)=> {
+    e.stopPropagation();
+    console.log('delete')
+  }
+
+  const handleAddLink = ()=> {
+
+  }
+
+  return (
+    <PageCustom>
+      <NavBarNormal backText="飞秒小知识"></NavBarNormal>
+      <View className="w-full pb-120">
+        <View className="p-16">
+          <View className="flex flex-col gap-16">
+
+            <View className="flex flex-col">
+              <View className="flex items-start gap-8 mb-6">
+                <View className="flex-center h-28"><IconQ/></View>
+                <View className="flex-1 text-14 leading-28">问题描述</View>
+              </View>
+              <View className="">
+                <WemetaTextarea
+                  value={value}
+                  onInput={handleInput}
+                  placeholder="描述你想要生成的画面和动作。例如:职场精英在点头微笑"
+                />
+              </View>
+            </View>
+
+            {/* 回答 */}
+            <View className="flex flex-col">
+              <View className="flex items-start gap-8 mb-6">
+                <View className="flex-center h-28"><IconA/></View>
+                <View className="flex-1 text-14 leading-28">回答</View>
+              </View>
+              <View>
+                <WemetaTextarea
+                  value={valueA}
+                  onInput={handleValueAInput}
+                  placeholder="描述你想要生成的画面和动作。例如:职场精英在点头微笑"
+                />
+              </View>
+            </View>
+
+            {/* 链接 */}
+            <View className="flex flex-col">
+              <View className="flex items-start gap-8 mb-6">
+                <View className="flex-center h-28"><IconALink/></View>
+                <View className="flex-1 text-14 leading-28">链接</View>
+                <View className="flex-center px-8 gap-4" onClick={handleAddLink}>
+                  <IconPlusColor14/>
+                  <View className="text-primary">新增</View>
+                </View>
+              </View>
+              <View className="flex flex-col gap-8">
+                <WemetaInput
+                  value={valueA}
+                  onInput={handleValueAInput}
+                  suffix={()=> <View onClick={handleDelete}><IconDeleteGray16/></View>}
+                  placeholder="请输入查看链接,支持长按粘贴..."
+                />
+                
+                <WemetaInput
+                  value=""
+                  onInput={()=> {}}
+                  suffix={()=> <View onClick={handleDelete}><IconDeleteGray16/></View>}
+                  placeholder="请输入查看链接,支持长按粘贴..."
+                />
+              </View>
+            </View>
+
+            {/* 图片 */}
+            <View className="flex flex-col">
+              <View className="flex items-start gap-8 mb-6">
+                <View className="flex-center h-28"><IconAImage/></View>
+                <View className="flex-1 text-14 leading-28">图片</View>
+              </View>
+              <MediaGrid />
+            </View>
+          </View>
+        </View>
+        
+        <BottomBar>
+          <View className="button-rounded button-primary flex-1">保存</View>
+        </BottomBar>
+      </View>
+    </PageCustom>
+  );
+}

+ 5 - 0
src/pages/knowledge-item/index.config.ts

@@ -0,0 +1,5 @@
+export default definePageConfig({
+  navigationBarTitleText: '知识库解析详情',
+  "usingComponents": {},
+  navigationStyle: 'custom'
+})

+ 96 - 0
src/pages/knowledge-item/index.tsx

@@ -0,0 +1,96 @@
+/**
+ * 知识库
+ */
+
+import { Text, View } from "@tarojs/components";
+
+import PageCustom from "@/components/page-custom/index";
+import NavBarNormal from "@/components/nav-bar-normal/index";
+import FigureListItem from "@/components/list/figure-list-item";
+import IconFIleTxt from "@/components/icon/IconFIleTxt";
+import IconEye from "@/components/icon/IconEye";
+import IconA from "@/components/icon/IconA";
+import IconQ from "@/components/icon/IconQ";
+import WemetaSwitch from "@/components/wemeta-switch";
+import { useState } from "react";
+import CardEditable from "@/components/card/card-editable/index";
+import Taro from "@tarojs/taro";
+
+export default function Index() {
+  const [checked, setChecked] = useState(false);
+  const handleEdit = ()=> {
+    Taro.navigateTo({
+      url: '/pages/knowledge-item-editor/index'
+    })
+  }
+  return (
+    <PageCustom>
+      <NavBarNormal backText="知识库"></NavBarNormal>
+      <View className="w-full">
+        <View className="p-16">
+          <View className="mb-16">
+            <FigureListItem
+              figure={IconFIleTxt}
+              rightRenderer={() => (
+                <View>
+                  <IconEye />
+                </View>
+              )}
+            >
+              <View className="flex flex-col flex-1 gap-2 w-full">
+                <View className="text-14 leading-22">飞秒小知识</View>
+                <View className="text-12 leading-20 text-gray-45">
+                  03-24 12:20 | 822.KB
+                </View>
+              </View>
+            </FigureListItem>
+          </View>
+          <View className="flex rounded-12 p-16 gap-16 bg-white">
+            <View className="flex-1">
+              <View className="text-14 font-medium leading-22 text-black pb-2">
+                个人知识
+              </View>
+              <View className="text-12 leading-20 text-gray-45">
+                使用你上传的内容(如文档、链接等)作为智能体回答的知识基础。
+              </View>
+            </View>
+
+            <View className="flex-center">
+              <WemetaSwitch
+                checked={checked}
+                onChange={(checked) => setChecked(checked)}
+              ></WemetaSwitch>
+            </View>
+          </View>
+        </View>
+        <View>
+          <View className="rounded-container-header">
+            <View className="text-14 font-medium leading-22 px-16 pb-16">
+              问答列表共<Text className="text-primary">10</Text>条
+            </View>
+          </View>
+          <View className="flex flex-col gap-16 px-16">
+            <CardEditable buttons={[<View>删除</View>, <View onClick={handleEdit}>编辑</View>]}>
+              <View className="flex items-start mb-8 gap-8">
+                <View className="flex-center h-28"><IconQ/></View>
+                <View className="flex-1 font-medium text-14 leading-28">你们医院可以做哪些近视手术?</View>
+              </View>
+
+              <View className="flex items-start gap-8">
+                <View className="flex-center  h-28"><IconA/></View>
+                <View className="flex-1 text-12 leading-20 text-gray-45">我们医院目前开展的近视手术包括:全飞秒SMILE、半飞秒LASIK、ICL人工晶体植入术等。医生会根据您的角膜厚度、度数、眼部条件推荐最适合您的手术方式。</View>
+              </View>
+
+            </CardEditable>
+          </View>
+        </View>
+        <View className="bottom-bar">
+          <View className="flex gap-8 px-20 py-12">
+            <View className="button-rounded button-plain button-warn w-88">删除</View>
+            <View className="button-rounded button-primary flex-1">共享到企业知识</View>
+          </View>
+        </View>
+      </View>
+    </PageCustom>
+  );
+}

File diff suppressed because it is too large
+ 3 - 7
src/pages/knowledge/components/personal-tab/index.tsx


+ 65 - 0
src/pages/knowledge/components/view-style/ViewStyleList.tsx

@@ -0,0 +1,65 @@
+import { Image, View } from "@tarojs/components";
+import MessageRobotRich from "@/components/chat-message/MessageRobotRich";
+import MessageRich from "@/components/chat-message/MessageRich";
+import { WelcomeCard, AddSuccessfulTips } from "../asistant-message";
+
+import IconFIleTxt from "@/components/icon/IconFIleTxt";
+import IconFIlePDF from "@/components/icon/IconFIlePDF";
+import IconFIleXLSX from "@/components/icon/IconFIleXLSX";
+
+import FigureList from "@/components/list/figure-list";
+import FigureListItem from "@/components/list/figure-list-item";
+
+import { useEffect, useState } from "react";
+
+import RotateLoading from "@/components/rotate-loading";
+import Taro from "@tarojs/taro";
+
+const Index = () => {
+  const handleEdit = ()=> {
+    Taro.navigateTo({
+      url: '/pages/knowledge-item/index'
+    })
+  }
+  const rightRenderer = () => {
+    return (
+      <View className="flex items-center gap-4">
+        <RotateLoading />
+        <View className="text-primary text-12">解析中</View>
+      </View>
+    );
+  };
+
+  return (
+    <View>
+      <FigureList>
+        <FigureListItem
+          figure={IconFIleTxt}
+          underline
+          arrow
+          onClick={handleEdit}
+        >
+          <View className="flex flex-col flex-1 gap-2 w-full">
+            <View className="text-14 leading-22">飞秒小知识</View>
+            <View className="text-12 leading-20 text-gray-45">
+              03-24 12:20 | 822.KB
+            </View>
+          </View>
+        </FigureListItem>
+        <FigureListItem
+          figure={IconFIlePDF}
+          rightRenderer={rightRenderer}
+        >
+          <View className="flex flex-col flex-1 gap-2 w-full">
+            <View className="text-14 leading-22">飞秒小知识.pdf</View>
+            <View className="text-12 leading-20 text-gray-45">
+              03-24 12:20 | 822.KB
+            </View>
+          </View>
+        </FigureListItem>
+      </FigureList>
+    </View>
+  );
+};
+
+export default Index;

+ 10 - 181
src/pages/member/index.tsx

@@ -1,186 +1,15 @@
-import { View, Text, Button } from "@tarojs/components";
-import { useState } from "react";
-import Taro, { useDidShow, useRouter } from "@tarojs/taro";
-import MemberRights from "./components/member-rights/index";
-import ListRow from "@/components/list/list-row";
-import { useAppStore } from "@/store/appStore";
-import { useUserStore } from "@/store/userStore";
-import { formatDate } from "@/utils/index";
-import NavBar from "@/components/nav-bar/index";
-import { navToWebView, navToVip } from "@/utils/index";
-import { ENABLE_UPGRADE_VIP, VIP_LEVEL } from "@/config/index";
-// import PopupMp from "@/components/popup/popup-mp";
-import { APP_STORY_URL, APP_AGREEMENT_URL } from "@/config";
-import { reportPageVisit, reportClicked } from "@/utils/report";
-import TabPageWrapper from "@/components/tab-page-wrapper/index";
-import ListRowAuthPhone from "./components/list-row-auth-phone/index";
-import { IS_MINI_GREEN_LEAF } from "@/config";
-import PopupModal from '@/components/popup/popup-modal'
+import { View, Text, Image } from "@tarojs/components";
+import Taro, { useDidShow } from "@tarojs/taro";
+import NavBarNormal from "@/components/nav-bar-normal/index";
+import PageCustom from "@/components/page-custom/index";
 
 export default () => {
-  const isIos = useAppStore((state) => state.isIos);
-  const appConfig = useAppStore((state) => state.appConfig);
-  const { fetchUser } = useUserStore();
-  const user = useUserStore((state) => state.user);
-  const { fetchAppConfig } = useAppStore();
-  const vip = user?.vip ?? VIP_LEVEL.FREE;
-  const [visible, setVisible] = useState(false);
-  const router = useRouter();
-  console.log(router.params)
-  const goVip = () => {
-    // isIos && appConfig?.auditing
-    if (isIos) {
-      reportClicked("upgradeButton");
-
-      setVisible(true);
-      // Taro.showModal({
-      //   content: '根据微信规定,iOS平台暂不提供支付功能。',
-      //   showCancel: false,
-      // });
-    } else {
-      reportClicked("upgradeButton");
-      navToVip();
-    }
-  };
-
-  // 每次显示都要重新获取,用户可能在公众号充值成为 vip
-  useDidShow(() => {
-    fetchAppConfig();
-    fetchUser();
-  });
-
-  reportPageVisit();
-
-  const renderCardHeader = () => {
-    if (!ENABLE_UPGRADE_VIP) {
-      return (
-        <>
-          <Text className="text-black text-16 leading-24 font-medium py-12 flex-1">
-            普通会员
-          </Text>
-        </>
-      );
-    }
-
-    if (vip === VIP_LEVEL.SUPER) {
-      return (
-        <>
-          <View className="flex flex-col gap-2 flex-1">
-            <Text className="text-black text-16 leading-24 font-medium">
-              超级会员
-            </Text>
-            {user?.vipExpireAt && (
-              <View className="text-black-6 text-12 leading-20">
-                有效期至 {formatDate(new Date(user.vipExpireAt))}
-              </View>
-            )}
-          </View>
-        </>
-      );
-    }
-    if (vip === VIP_LEVEL.PLUS) {
-      return (
-        <>
-          <View className="flex flex-col gap-2 flex-1">
-            <Text className="text-black text-16 leading-24 font-medium">
-              高级会员
-            </Text>
-            {user?.vipExpireAt && (
-              <View className="text-black-6 text-12 leading-20">
-                有效期至 {formatDate(new Date(user.vipExpireAt))}
-              </View>
-            )}
-          </View>
-          <View
-            className="text-black-3 px-12 py-6 text-12 leading-20 rounded-50 bg-white font-medium"
-            onClick={goVip}
-          >
-            升级超级权益
-          </View>
-        </>
-      );
-    }
-    return (
-      <>
-        <Text className="text-black text-16 leading-24 font-medium py-12 flex-1">
-          普通会员
-        </Text>
-        <View
-          className="text-black-3 px-12 py-6 text-12 leading-20 rounded-50 bg-white font-medium"
-          onClick={goVip}
-        >
-          升级权益
-        </View>
-      </>
-    );
-  };
-
+  
   return (
-    <TabPageWrapper>
-      <NavBar>
-        <View className="flex items-center">
-          <Text>会员</Text>
-        </View>
-      </NavBar>
-
-      <View className="w-full">
-        <View className="w-full flex py-24 px-20 bg-primary-color rounded-20">
-          <View className="flex w-full flex-col gap-36 items-start">
-            <View className="flex w-full items-center">
-              {appConfig && renderCardHeader()}
-            </View>
-
-            {appConfig && (
-              <MemberRights vip={vip} appConfig={appConfig}></MemberRights>
-            )}
-          </View>
-        </View>
-        <View className="flex flex-col gap-8 w-full pt-32 mb-38">
-          {IS_MINI_GREEN_LEAF && (
-            <>
-              <ListRow
-                emoji="😎"
-                label="产品故事"
-                onClick={() => navToWebView(APP_STORY_URL)}
-              ></ListRow>
-              <ListRow
-                emoji="💌"
-                label="服务协议"
-                onClick={() => navToWebView(APP_AGREEMENT_URL)}
-              ></ListRow>
-            </>
-          )}
-          <ListRow emoji="🌟" label="提一些想法">
-            <Button
-              openType="contact"
-              className="absolute left-0 top-0 right-0 bottom-0 opacity-0"
-            ></Button>
-          </ListRow>
-
-          <ListRowAuthPhone></ListRowAuthPhone>
-          {/* <ListRow
-            label="版本说明"
-            arrow={false}
-            rightRenderer={() => (
-              <Text className="text-black-3 text-14 leading-22">
-                v{APP_VERSION}
-              </Text>
-            )}
-          ></ListRow> */}
-          {/* <ListRow label="安全退出"></ListRow> */}
-        </View>
-      </View>
-      <PopupModal show={visible} setShow={setVisible}>
-        <View className="mb-10">根据微信规定,iOS平台暂不提供支付功能。</View>
-        <View className="w-4/5 h-30 relative">
-          <Button
-              openType="contact"
-              className="absolute left-0 top-0 right-0 bottom-0 opacity-0"
-            ></Button>
-            更多咨询请 <Text className="primary-color-dark">联系客服</Text>
-        </View>
-      </PopupModal>
-      {/* <PopupMp show={visible} onClose={() => setVisible(false)}></PopupMp> */}
-    </TabPageWrapper>
+    <PageCustom>
+      <NavBarNormal leftColumn={()=> <Text>我的</Text>}>
+      </NavBarNormal>
+      <View className="p-20">暂无数据</View>
+    </PageCustom>
   );
 };

+ 1 - 2
src/pages/page/index.config.ts

@@ -4,7 +4,6 @@ export default definePageConfig({
   enableShareTimeline: true,
   navigationStyle: 'custom',
   usingComponents: {
-    'store-product-item': '../../components/store-product-item/store-product-item',
-    'store-home': '../../components/store-home/store-home'
+    
   }
 })

+ 1 - 2
src/pages/page/index.tsx

@@ -19,7 +19,6 @@ import AvatarMagicStyle from "./components/avatar-magic-style/index";
 import BottomNavBar from "./components/bottom-nav-bar";
 import TabButtons from "./components/tab-buttons";
 import { EUploadFileScene } from "@/types";
-import IconMagicStick from '@/components/icon/icon-magic-stick'
 
 
 
@@ -257,7 +256,7 @@ export default function Index() {
         <View className="relative">
           {renderAI()}
           <View className="absolute right-40 top-120 z-10 w-40 h-40" onClick={toggleMagicStylePanel}>
-            <IconMagicStick></IconMagicStick>
+            
             {/* {showMagicStyle ? 'yoyo':'go'} */}
           </View>
         </View>

+ 1 - 2
src/pages/profile/index.config.ts

@@ -5,7 +5,6 @@ export default definePageConfig({
   enableShareTimeline: true,
   enablePageMeta: true,
   usingComponents: {
-    'store-product-item': '../../components/store-product-item/store-product-item',
-    'store-home': '../../components/store-home/store-home'
+    
   }
 })

+ 1 - 1
tailwind.config.js

@@ -7,7 +7,7 @@ for(let i=10;i<=64; i+=2){
   configLineHeight[i] = `${i}px`
 }
 let configSpace = {}
-for(let i=2;i<=160; i+=2){
+for(let i=2;i<=200; i+=2){
   configSpace[i] = `${i}px`
 }
 let configBorderRadius = {}

Some files were not shown because too many files changed in this diff