Ver Fonte

【uni-app】update uni-app

mileszzhang há 1 ano atrás
pai
commit
807b2e7d3d
40 ficheiros alterados com 965 adições e 1140 exclusões
  1. 16 0
      uni-app/App.vue
  2. 0 0
      uni-app/env.d.ts
  3. 2 2
      uni-app/index.html
  4. 0 1
      uni-app/main.ts
  5. 78 0
      uni-app/manifest.json
  6. 11 75
      uni-app/package.json
  7. 4 8
      uni-app/pages.json
  8. 3 2
      uni-app/pages/index/index.vue
  9. 7 0
      uni-app/shime-uni.d.ts
  10. 0 22
      uni-app/src/App.vue
  11. 0 97
      uni-app/src/manifest.json
  12. 335 328
      uni-app/src/roomkit/TUIRoom/assets/iconfonts/iconfont.js
  13. BIN
      uni-app/src/roomkit/TUIRoom/assets/iconfonts/iconfont.ttf
  14. BIN
      uni-app/src/roomkit/TUIRoom/assets/iconfonts/iconfont.woff
  15. BIN
      uni-app/src/roomkit/TUIRoom/assets/iconfonts/iconfont.woff2
  16. 158 97
      uni-app/src/roomkit/TUIRoom/components/Chat/ChatEditor/index.vue
  17. 0 102
      uni-app/src/roomkit/TUIRoom/components/Chat/ChatEditor/useChatEditor.ts
  18. 10 9
      uni-app/src/roomkit/TUIRoom/components/Chat/EditorTools/index.vue
  19. 90 90
      uni-app/src/roomkit/TUIRoom/components/Chat/MessageList/index.vue
  20. 39 28
      uni-app/src/roomkit/TUIRoom/components/Chat/MessageList/useMessageListHook.ts
  21. 19 16
      uni-app/src/roomkit/TUIRoom/components/Chat/MessageTypes/MessageText.vue
  22. 24 14
      uni-app/src/roomkit/TUIRoom/components/Chat/index.vue
  23. 3 3
      uni-app/src/roomkit/TUIRoom/components/RoomFooter/MoreControl/index.vue
  24. 13 8
      uni-app/src/roomkit/TUIRoom/components/RoomFooter/index/index.vue
  25. 11 17
      uni-app/src/roomkit/TUIRoom/components/RoomSidebar/index.vue
  26. 4 39
      uni-app/src/roomkit/TUIRoom/components/RoomSidebar/useSideBarHooks.ts
  27. 10 13
      uni-app/src/roomkit/TUIRoom/components/common/base/Badge.vue
  28. 3 3
      uni-app/src/roomkit/TUIRoom/components/common/base/IconButton.vue
  29. 4 6
      uni-app/src/roomkit/TUIRoom/index.vue
  30. 25 3
      uni-app/src/roomkit/TUIRoom/services/roomService.ts
  31. 3 4
      uni-app/src/roomkit/TUIRoom/stores/chat.ts
  32. 1 21
      uni-app/src/roomkit/pages/home.vue
  33. 1 1
      uni-app/src/roomkit/pages/room.nvue
  34. 0 6
      uni-app/src/shime-uni.d.ts
  35. BIN
      uni-app/src/static/logo.png
  36. BIN
      uni-app/static/logo.png
  37. 0 13
      uni-app/tsconfig.json
  38. 13 0
      uni-app/uni.promisify.adaptor.js
  39. 78 76
      uni-app/uni.scss
  40. 0 36
      uni-app/vite.config.ts

+ 16 - 0
uni-app/App.vue

@@ -0,0 +1,16 @@
+<script>
+export default {
+  onLaunch() {
+    console.log('App Launch');
+  },
+  onShow() {
+    console.log('App Show');
+  },
+  onHide() {
+    console.log('App Hide');
+  },
+};
+</script>
+
+<style>
+</style>

+ 0 - 0
uni-app/src/env.d.ts → uni-app/env.d.ts


+ 2 - 2
uni-app/index.html

@@ -1,5 +1,5 @@
 <!DOCTYPE html>
-<html>
+<html lang="en">
   <head>
     <meta charset="UTF-8" />
     <script>
@@ -15,6 +15,6 @@
   </head>
   <body>
     <div id="app"><!--app-html--></div>
-    <script type="module" src="/src/main.ts"></script>
+    <script type="module" src="/main.ts"></script>
   </body>
 </html>

+ 0 - 1
uni-app/src/main.ts → uni-app/main.ts

@@ -1,6 +1,5 @@
 import { createSSRApp } from 'vue';
 import App from '@/App.vue';
-// import { createPinia } from 'pinia';
 import * as Pinia from 'pinia' 
 export function createApp() {
 	const app = createSSRApp(App);

+ 78 - 0
uni-app/manifest.json

@@ -0,0 +1,78 @@
+{
+    "name": "tui-room-app",
+    "appid": "__UNI__2D9CC9B",
+    "description": "",
+    "versionName": "1.0.0",
+    "versionCode": "100",
+    "transformPx": false,
+    /* 5+App特有相关 */
+    "app-plus": {
+        "usingComponents": true,
+        "nvueStyleCompiler": "uni-app",
+        "compilerVersion": 3,
+        "splashscreen": {
+            "alwaysShowBeforeRender": true,
+            "waiting": true,
+            "autoclose": true,
+            "delay": 0
+        },
+        /* 模块配置 */
+        "modules": {
+            "Camera": {},
+            "Record": {}
+        },
+        /* 应用发布信息 */
+        "distribute": {
+            /* android打包配置 */
+            "android": {
+                "permissions": [
+                    "<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
+                    "<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
+                    "<uses-permission android:name=\"android.permission.VIBRATE\"/>",
+                    "<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
+                    "<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
+                    "<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
+                    "<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
+                    "<uses-permission android:name=\"android.permission.CAMERA\"/>",
+                    "<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
+                    "<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
+                    "<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
+                    "<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
+                    "<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
+                    "<uses-feature android:name=\"android.hardware.camera\"/>",
+                    "<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
+                ]
+            },
+            /* ios打包配置 */
+            "ios": {
+                "dSYMs": false
+            },
+            /* SDK配置 */
+            "sdkConfigs": {}
+        },
+        "nativePlugins": {}
+    },
+    /* 快应用特有相关 */
+    "quickapp": {},
+    /* 小程序特有相关 */
+    "mp-weixin": {
+        "appid": "",
+        "setting": {
+            "urlCheck": false
+        },
+        "usingComponents": true
+    },
+    "mp-alipay": {
+        "usingComponents": true
+    },
+    "mp-baidu": {
+        "usingComponents": true
+    },
+    "mp-toutiao": {
+        "usingComponents": true
+    },
+    "uniStatistics": {
+        "enable": false
+    },
+    "vueVersion": "3"
+}

+ 11 - 75
uni-app/package.json

@@ -1,82 +1,18 @@
 {
   "name": "@tencentcloud/tui-roomkit-app",
-  "version": "2.5.0",
+  "version": "2.7.1",
+  "description": "",
+  "main": "uni.promisify.adaptor.js",
   "scripts": {
-    "dev:app": "uni -p app",
-    "dev:app-android": "uni -p app-android",
-    "dev:app-ios": "uni -p app-ios",
-    "dev:custom": "uni -p",
-    "dev:h5": "uni",
-    "dev:h5:ssr": "uni --ssr",
-    "dev:mp-alipay": "uni -p mp-alipay",
-    "dev:mp-baidu": "uni -p mp-baidu",
-    "dev:mp-jd": "uni -p mp-jd",
-    "dev:mp-kuaishou": "uni -p mp-kuaishou",
-    "dev:mp-lark": "uni -p mp-lark",
-    "dev:mp-qq": "uni -p mp-qq",
-    "dev:mp-toutiao": "uni -p mp-toutiao",
-    "dev:mp-weixin": "uni -p mp-weixin",
-    "dev:quickapp-webview": "uni -p quickapp-webview",
-    "dev:quickapp-webview-huawei": "uni -p quickapp-webview-huawei",
-    "dev:quickapp-webview-union": "uni -p quickapp-webview-union",
-    "build:app": "uni build -p app",
-    "build:app-android": "uni build -p app-android",
-    "build:app-ios": "uni build -p app-ios",
-    "build:custom": "uni build -p",
-    "build:h5": "uni build",
-    "build:h5:ssr": "uni build --ssr",
-    "build:mp-alipay": "uni build -p mp-alipay",
-    "build:mp-baidu": "uni build -p mp-baidu",
-    "build:mp-jd": "uni build -p mp-jd",
-    "build:mp-kuaishou": "uni build -p mp-kuaishou",
-    "build:mp-lark": "uni build -p mp-lark",
-    "build:mp-qq": "uni build -p mp-qq",
-    "build:mp-toutiao": "uni build -p mp-toutiao",
-    "build:mp-weixin": "uni build -p mp-weixin && bash wxmini_prod.sh",
-    "build:quickapp-webview": "uni build -p quickapp-webview",
-    "build:quickapp-webview-huawei": "uni build -p quickapp-webview-huawei",
-    "build:quickapp-webview-union": "uni build -p quickapp-webview-union",
-    "type-check": "vue-tsc --noEmit",
-    "upload-uniapp-qrcode": "cd scripts && node buildWx.js"
+    "test": "echo \"Error: no test specified\" && exit 1"
   },
+  "author": "",
+  "license": "ISC",
   "dependencies": {
-    "@dcloudio/uni-app": "3.0.0-alpha-3070720230316001",
-    "@dcloudio/uni-app-plus": "3.0.0-alpha-3070720230316001",
-    "@dcloudio/uni-components": "3.0.0-alpha-3070720230316001",
-    "@dcloudio/uni-h5": "3.0.0-alpha-3070720230316001",
-    "@dcloudio/uni-mp-alipay": "3.0.0-alpha-3070720230316001",
-    "@dcloudio/uni-mp-baidu": "3.0.0-alpha-3070720230316001",
-    "@dcloudio/uni-mp-jd": "3.0.0-alpha-3070720230316001",
-    "@dcloudio/uni-mp-kuaishou": "3.0.0-alpha-3070720230316001",
-    "@dcloudio/uni-mp-lark": "3.0.0-alpha-3070720230316001",
-    "@dcloudio/uni-mp-qq": "3.0.0-alpha-3070720230316001",
-    "@dcloudio/uni-mp-toutiao": "3.0.0-alpha-3070720230316001",
-    "@dcloudio/uni-mp-weixin": "3.0.0-alpha-3070720230316001",
-    "@dcloudio/uni-quickapp-webview": "3.0.0-alpha-3070720230316001",
-    "@dcloudio/vue-cli-plugin-uni-optimize": "2.0.2-3080720230703001",
-    "@tencentcloud/universal-api": "^2.0.9",
-    "@tencentcloud/tuiroom-engine-uniapp-app": "^2.5.0",
-    "axios": "^0.27.2",
-    "inquirer": "^9.2.11",
-    "interactjs": "^1.10.26",
-    "js-cookie": "^3.0.1",
-    "jsonc-parser": "^3.2.0",
-    "mitt": "^3.0.0",
-    "pinia": "2.0.36",
-    "replace-in-file": "^7.0.1",
-    "sass": "^1.63.6",
-    "vue": "^3.2.45"
-  },
-  "devDependencies": {
-    "@dcloudio/types": "^3.3.2",
-    "@dcloudio/uni-automator": "3.0.0-alpha-3070720230316001",
-    "@dcloudio/uni-cli-shared": "3.0.0-alpha-3070720230316001",
-    "@dcloudio/uni-stacktracey": "3.0.0-alpha-3070720230316001",
-    "@dcloudio/vite-plugin-uni": "3.0.0-alpha-3070720230316001",
-    "@vue/tsconfig": "^0.1.3",
-    "fs-sync": "^1.0.6",
-    "typescript": "^4.9.4",
-    "vite": "3.2.4",
-    "vue-tsc": "^1.0.24"
+    "@tencentcloud/chat": "^3.4.6",
+    "@tencentcloud/tuiroom-engine-uniapp-app": " ^2.7.1",
+    "@tencentcloud/universal-api": "^2.3.2",
+    "mitt": "^3.0.1",
+    "pinia": "^2.2.5"
   }
 }

+ 4 - 8
uni-app/src/pages.json → uni-app/pages.json

@@ -2,7 +2,7 @@
   "pages": [
     //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
     {
-      "path": "pages/index",
+      "path": "pages/index/index",
       "style": {
         "navigationBarTitleText": ""
       }
@@ -10,16 +10,16 @@
   ],
   "subpackages": [
     {
-      "root": "roomkit",
+      "root": "src",
       "pages": [
         {
-          "path": "pages/home",
+          "path": "roomkit/pages/home",
           "style": {
             "navigationBarTitleText": "home"
           }
         },
         {
-          "path": "pages/room",
+          "path": "roomkit/pages/room",
           "style": {
             "navigationBarTitleText": "room",
 						"navigationStyle": "custom",
@@ -36,10 +36,6 @@
     "navigationBarTitleText": "uni-app",
     "navigationBarBackgroundColor": "#F8F8F8",
     "backgroundColor": "#F8F8F8",
-    "usingComponents": {
-      "trtc-pusher": "@tencentcloud/trtc-component-wx/trtc-pusher",
-      "trtc-player": "@tencentcloud/trtc-component-wx/trtc-player"
-    },
 		"app-plus": {
 			"titleView": false
 		}

+ 3 - 2
uni-app/src/pages/index.vue → uni-app/pages/index/index.vue

@@ -1,11 +1,12 @@
 <template>
+  <div></div>
 </template>
 <script setup lang="ts">
-import router from '@/router';
+import router from '../../src/router';
 import { onMounted } from 'vue';
 
 onMounted(() => {
-  router.replace({ path: '/roomkit/pages/home' });
+  router.replace({ path: '/src/roomkit/pages/home' });
   uni.showToast({
     icon: 'loading',
   });

+ 7 - 0
uni-app/shime-uni.d.ts

@@ -0,0 +1,7 @@
+export { }
+
+declare module "vue" {
+  // eslint-disable-next-line no-undef
+  type Hooks = App.AppInstance & Page.PageInstance;
+  interface ComponentCustomOptions extends Hooks { }
+}

+ 0 - 22
uni-app/src/App.vue

@@ -1,22 +0,0 @@
-<script setup lang="ts">
-import { onLaunch, onShow, onHide } from '@dcloudio/uni-app';
-onLaunch(() => {
-  console.log('App Launch');
-});
-onShow(() => {
-  console.log('App Show');
-});
-onHide(() => {
-  console.log('App Hide');
-});
-</script>
-<style>
-/* page{
-  height: 100%;
-  box-sizing: border-box;
-}
-
-view, label {
-  box-sizing: border-box;
-} */
-</style>

+ 0 - 97
uni-app/src/manifest.json

@@ -1,97 +0,0 @@
-{
-    "name" : "tui-room-uniapp",
-    "appid" : "__UNI__2D9CC9B",
-    "description" : "",
-    "versionName" : "1.0.0",
-    "versionCode" : "100",
-    "transformPx" : false,
-    /* 5+App特有相关 */
-    "app-plus" : {
-        "usingComponents" : true,
-        "nvueStyleCompiler" : "uni-app",
-        "compilerVersion" : 3,
-        "splashscreen" : {
-            "alwaysShowBeforeRender" : true,
-            "waiting" : true,
-            "autoclose" : true,
-            "delay" : 0
-        },
-        /* 模块配置 */
-        "modules" : {
-            "Record" : {},
-            "Camera" : {}
-        },
-        /* 应用发布信息 */
-        "distribute" : {
-            /* android打包配置 */
-            "android" : {
-                "permissions" : [
-                    "<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
-                    "<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
-                    "<uses-permission android:name=\"android.permission.VIBRATE\"/>",
-                    "<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
-                    "<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
-                    "<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
-                    "<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
-                    "<uses-permission android:name=\"android.permission.CAMERA\"/>",
-                    "<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
-                    "<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
-                    "<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
-                    "<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
-                    "<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
-                    "<uses-feature android:name=\"android.hardware.camera\"/>",
-                    "<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>",
-                    "<uses-permission android:name=\"android.permission.MODIFY_AUDIO_SETTINGS\" />",
-                    "<uses-permission android:name=\"android.permission.RECORD_AUDIO\" />"
-                ]
-            },
-            /* ios打包配置 */
-            "ios" : {
-                "dSYMs" : false
-            },
-            /* SDK配置 */
-            "sdkConfigs" : {
-                "ad" : {}
-            }
-        },
-        "nativePlugins" : {},
-        "nvueCompiler" : "uni-app"
-    },
-    /* 快应用特有相关 */
-    "quickapp" : {},
-    /* 小程序特有相关 */
-    "mp-weixin" : {
-        "appid" : "",
-        "setting" : {
-            "urlCheck" : false,
-            "packNpmManually" : true,
-            "packNpmRelationList" : [
-                {
-                    "packageJsonPath" : "./package.json",
-                    "miniprogramNpmDistDir" : "./"
-                },
-                {
-                    "packageJsonPath" : "./roomkit/package.json",
-                    "miniprogramNpmDistDir" : "./roomkit"
-                }
-            ]
-        },
-        "usingComponents" : true,
-        "optimization" : {
-            "subPackages" : true
-        }
-    },
-    "mp-alipay" : {
-        "usingComponents" : true
-    },
-    "mp-baidu" : {
-        "usingComponents" : true
-    },
-    "mp-toutiao" : {
-        "usingComponents" : true
-    },
-    "uniStatistics" : {
-        "enable" : false
-    },
-    "vueVersion" : "3"
-}

+ 335 - 328
uni-app/src/roomkit/TUIRoom/assets/iconfonts/iconfont.js

@@ -1,457 +1,464 @@
 export default {
-  id: '4545427',
-  name: 'TUIRoomKit',
-  font_family: 'roomkiticons',
-  css_prefix_text: 'roomkit-icon-',
-  description: '',
-  glyphs: [
+  "id": "4545427",
+  "name": "TUIRoomKit",
+  "font_family": "roomkiticons",
+  "css_prefix_text": "roomkit-icon-",
+  "description": "",
+  "glyphs": [
     {
-      icon_id: '41176603',
-      name: 'StopScreenShareIcon',
-      font_class: 'jieshugongxiang',
-      unicode: 'e60a',
-      unicode_decimal: 58890,
+      "icon_id": "42361561",
+      "name": "EmojiIcon",
+      "font_class": "a-EmojiIcon111",
+      "unicode": "e60e",
+      "unicode_decimal": 58894
     },
     {
-      icon_id: '40923006',
-      name: 'ScreenShareIcon',
-      font_class: 'ScreenShareIcon',
-      unicode: 'e601',
-      unicode_decimal: 58881,
+      "icon_id": "41176603",
+      "name": "StopScreenShareIcon",
+      "font_class": "jieshugongxiang",
+      "unicode": "e60a",
+      "unicode_decimal": 58890
     },
     {
-      icon_id: '40923008',
-      name: 'ScreenSharingIcon',
-      font_class: 'ScreenSharingIcon',
-      unicode: 'e603',
-      unicode_decimal: 58883,
+      "icon_id": "40923006",
+      "name": "ScreenShareIcon",
+      "font_class": "ScreenShareIcon",
+      "unicode": "e601",
+      "unicode_decimal": 58881
     },
     {
-      icon_id: '40437582',
-      name: 'ApplyActiveIcon',
-      font_class: 'ApplyActiveIcon',
-      unicode: 'e67d',
-      unicode_decimal: 59005,
+      "icon_id": "40923008",
+      "name": "ScreenSharingIcon",
+      "font_class": "ScreenSharingIcon",
+      "unicode": "e603",
+      "unicode_decimal": 58883
     },
     {
-      icon_id: '40437367',
-      name: 'ApplyTipsIcon',
-      font_class: 'ApplyTipsIcon',
-      unicode: 'e676',
-      unicode_decimal: 58998,
+      "icon_id": "40437582",
+      "name": "ApplyActiveIcon",
+      "font_class": "ApplyActiveIcon",
+      "unicode": "e67d",
+      "unicode_decimal": 59005
     },
     {
-      icon_id: '40437368',
-      name: 'DenyOnStageIcon',
-      font_class: 'DenyOnStageIcon1',
-      unicode: 'e677',
-      unicode_decimal: 58999,
+      "icon_id": "40437367",
+      "name": "ApplyTipsIcon",
+      "font_class": "ApplyTipsIcon",
+      "unicode": "e676",
+      "unicode_decimal": 58998
     },
     {
-      icon_id: '40437369',
-      name: 'KickOutIcon',
-      font_class: 'KickOutIcon',
-      unicode: 'e679',
-      unicode_decimal: 59001,
+      "icon_id": "40437368",
+      "name": "DenyOnStageIcon",
+      "font_class": "DenyOnStageIcon1",
+      "unicode": "e677",
+      "unicode_decimal": 58999
     },
     {
-      icon_id: '40437370',
-      name: 'InviteOnStageIcon',
-      font_class: 'InviteOnStageIcon1',
-      unicode: 'e67a',
-      unicode_decimal: 59002,
+      "icon_id": "40437369",
+      "name": "KickOutIcon",
+      "font_class": "KickOutIcon",
+      "unicode": "e679",
+      "unicode_decimal": 59001
     },
     {
-      icon_id: '40437371',
-      name: 'SearchIcon',
-      font_class: 'SearchIcon1',
-      unicode: 'e67b',
-      unicode_decimal: 59003,
+      "icon_id": "40437370",
+      "name": "InviteOnStageIcon",
+      "font_class": "InviteOnStageIcon1",
+      "unicode": "e67a",
+      "unicode_decimal": 59002
     },
     {
-      icon_id: '40437372',
-      name: 'OffStageIcon',
-      font_class: 'OffStageIcon1',
-      unicode: 'e67c',
-      unicode_decimal: 59004,
+      "icon_id": "40437371",
+      "name": "SearchIcon",
+      "font_class": "SearchIcon1",
+      "unicode": "e67b",
+      "unicode_decimal": 59003
     },
     {
-      icon_id: '40400095',
-      name: 'ScreenOpenIcon',
-      font_class: 'ScreenOpenIcon',
-      unicode: 'e669',
-      unicode_decimal: 58985,
+      "icon_id": "40437372",
+      "name": "OffStageIcon",
+      "font_class": "OffStageIcon1",
+      "unicode": "e67c",
+      "unicode_decimal": 59004
     },
     {
-      icon_id: '40400018',
-      name: 'ChatIcon',
-      font_class: 'ChatIcon',
-      unicode: 'e678',
-      unicode_decimal: 59000,
+      "icon_id": "40400095",
+      "name": "ScreenOpenIcon",
+      "font_class": "ScreenOpenIcon",
+      "unicode": "e669",
+      "unicode_decimal": 58985
     },
     {
-      icon_id: '40399599',
-      name: 'CancelStageIcon',
-      font_class: 'CancelStageIcon1',
-      unicode: 'e675',
-      unicode_decimal: 58997,
+      "icon_id": "40400018",
+      "name": "ChatIcon",
+      "font_class": "ChatIcon",
+      "unicode": "e678",
+      "unicode_decimal": 59000
     },
     {
-      icon_id: '40399573',
-      name: 'ApplyStageIcon',
-      font_class: 'ApplyStageIcon2',
-      unicode: 'e674',
-      unicode_decimal: 58996,
+      "icon_id": "40399599",
+      "name": "CancelStageIcon",
+      "font_class": "CancelStageIcon1",
+      "unicode": "e675",
+      "unicode_decimal": 58997
     },
     {
-      icon_id: '40398369',
-      name: 'TransferOwnerIcon',
-      font_class: 'TransferOwnerIcon',
-      unicode: 'e673',
-      unicode_decimal: 58995,
+      "icon_id": "40399573",
+      "name": "ApplyStageIcon",
+      "font_class": "ApplyStageIcon2",
+      "unicode": "e674",
+      "unicode_decimal": 58996
     },
     {
-      icon_id: '40397092',
-      name: 'SetAdminIcon',
-      font_class: 'SetAdminIcon',
-      unicode: 'e672',
-      unicode_decimal: 58994,
+      "icon_id": "40398369",
+      "name": "TransferOwnerIcon",
+      "font_class": "TransferOwnerIcon",
+      "unicode": "e673",
+      "unicode_decimal": 58995
     },
     {
-      icon_id: '40373104',
-      name: 'CorrectIcon',
-      font_class: 'CorrectIcon',
-      unicode: 'e667',
-      unicode_decimal: 58983,
+      "icon_id": "40397092",
+      "name": "SetAdminIcon",
+      "font_class": "SetAdminIcon",
+      "unicode": "e672",
+      "unicode_decimal": 58994
     },
     {
-      icon_id: '40373103',
-      name: 'CloseIcon',
-      font_class: 'CloseIcon',
-      unicode: 'e649',
-      unicode_decimal: 58953,
+      "icon_id": "40373104",
+      "name": "CorrectIcon",
+      "font_class": "CorrectIcon",
+      "unicode": "e667",
+      "unicode_decimal": 58983
     },
     {
-      icon_id: '40373102',
-      name: 'CopyIcon',
-      font_class: 'CopyIcon',
-      unicode: 'e668',
-      unicode_decimal: 58984,
+      "icon_id": "40373103",
+      "name": "CloseIcon",
+      "font_class": "CloseIcon",
+      "unicode": "e649",
+      "unicode_decimal": 58953
     },
     {
-      icon_id: '40373101',
-      name: 'ChatForbiddenIcon',
-      font_class: 'ChatForbiddenIcon',
-      unicode: 'e648',
-      unicode_decimal: 58952,
+      "icon_id": "40373102",
+      "name": "CopyIcon",
+      "font_class": "CopyIcon",
+      "unicode": "e668",
+      "unicode_decimal": 58984
     },
     {
-      icon_id: '40373099',
-      name: 'CameraSwitchIcon',
-      font_class: 'CameraSwitchIcon',
-      unicode: 'e647',
-      unicode_decimal: 58951,
+      "icon_id": "40373101",
+      "name": "ChatForbiddenIcon",
+      "font_class": "ChatForbiddenIcon",
+      "unicode": "e648",
+      "unicode_decimal": 58952
     },
     {
-      icon_id: '40373098',
-      name: 'CameraOnIcon',
-      font_class: 'CameraOnIcon1',
-      unicode: 'e646',
-      unicode_decimal: 58950,
+      "icon_id": "40373099",
+      "name": "CameraSwitchIcon",
+      "font_class": "CameraSwitchIcon",
+      "unicode": "e647",
+      "unicode_decimal": 58951
     },
     {
-      icon_id: '40373097',
-      name: 'CameraOffIcon',
-      font_class: 'CameraOffIcon',
-      unicode: 'e66a',
-      unicode_decimal: 58986,
+      "icon_id": "40373098",
+      "name": "CameraOnIcon",
+      "font_class": "CameraOnIcon1",
+      "unicode": "e646",
+      "unicode_decimal": 58950
     },
     {
-      icon_id: '40373096',
-      name: 'AudioOpenIcon',
-      font_class: 'AudioOpenIcon',
-      unicode: 'e66b',
-      unicode_decimal: 58987,
+      "icon_id": "40373097",
+      "name": "CameraOffIcon",
+      "font_class": "CameraOffIcon",
+      "unicode": "e66a",
+      "unicode_decimal": 58986
     },
     {
-      icon_id: '40373095',
-      name: 'AudioCloseIcon',
-      font_class: 'AudioCloseIcon',
-      unicode: 'e645',
-      unicode_decimal: 58949,
+      "icon_id": "40373096",
+      "name": "AudioOpenIcon",
+      "font_class": "AudioOpenIcon",
+      "unicode": "e66b",
+      "unicode_decimal": 58987
     },
     {
-      icon_id: '40373094',
-      name: 'ArrowStrokeSelectDownIcon',
-      font_class: 'ArrowStrokeSelectDownIcon',
-      unicode: 'e644',
-      unicode_decimal: 58948,
+      "icon_id": "40373095",
+      "name": "AudioCloseIcon",
+      "font_class": "AudioCloseIcon",
+      "unicode": "e645",
+      "unicode_decimal": 58949
     },
     {
-      icon_id: '40373092',
-      name: 'ArrowStrokeTurnPageIcon',
-      font_class: 'ArrowStrokeTurnPageIcon',
-      unicode: 'e66c',
-      unicode_decimal: 58988,
+      "icon_id": "40373094",
+      "name": "ArrowStrokeSelectDownIcon",
+      "font_class": "ArrowStrokeSelectDownIcon",
+      "unicode": "e644",
+      "unicode_decimal": 58948
     },
     {
-      icon_id: '40373093',
-      name: 'ArrowUpIcon',
-      font_class: 'ArrowUpIcon',
-      unicode: 'e66d',
-      unicode_decimal: 58989,
+      "icon_id": "40373092",
+      "name": "ArrowStrokeTurnPageIcon",
+      "font_class": "ArrowStrokeTurnPageIcon",
+      "unicode": "e66c",
+      "unicode_decimal": 58988
     },
     {
-      icon_id: '40373091',
-      name: 'ArrowStrokeBackIcon',
-      font_class: 'ArrowStrokeBackIcon',
-      unicode: 'e643',
-      unicode_decimal: 58947,
+      "icon_id": "40373093",
+      "name": "ArrowUpIcon",
+      "font_class": "ArrowUpIcon",
+      "unicode": "e66d",
+      "unicode_decimal": 58989
     },
     {
-      icon_id: '40373090',
-      name: 'ArrowStrokeLeftIcon',
-      font_class: 'ArrowStrokeLeftIcon',
-      unicode: 'e66e',
-      unicode_decimal: 58990,
+      "icon_id": "40373091",
+      "name": "ArrowStrokeBackIcon",
+      "font_class": "ArrowStrokeBackIcon",
+      "unicode": "e643",
+      "unicode_decimal": 58947
     },
     {
-      icon_id: '40373087',
-      name: 'ApplyManageIcon',
-      font_class: 'ApplyManageIcon',
-      unicode: 'e66f',
-      unicode_decimal: 58991,
+      "icon_id": "40373090",
+      "name": "ArrowStrokeLeftIcon",
+      "font_class": "ArrowStrokeLeftIcon",
+      "unicode": "e66e",
+      "unicode_decimal": 58990
     },
     {
-      icon_id: '40373086',
-      name: 'ApplyLittleIcon',
-      font_class: 'ApplyLittleIcon',
-      unicode: 'e670',
-      unicode_decimal: 58992,
+      "icon_id": "40373087",
+      "name": "ApplyManageIcon",
+      "font_class": "ApplyManageIcon",
+      "unicode": "e66f",
+      "unicode_decimal": 58991
     },
     {
-      icon_id: '40373126',
-      name: 'OnStageIcon',
-      font_class: 'OnStageIcon',
-      unicode: 'e65c',
-      unicode_decimal: 58972,
+      "icon_id": "40373086",
+      "name": "ApplyLittleIcon",
+      "font_class": "ApplyLittleIcon",
+      "unicode": "e670",
+      "unicode_decimal": 58992
     },
     {
-      icon_id: '40373125',
-      name: 'OffStageIcon',
-      font_class: 'OffStageIcon',
-      unicode: 'e653',
-      unicode_decimal: 58963,
+      "icon_id": "40373126",
+      "name": "OnStageIcon",
+      "font_class": "OnStageIcon",
+      "unicode": "e65c",
+      "unicode_decimal": 58972
     },
     {
-      icon_id: '40373124',
-      name: 'NextIcon',
-      font_class: 'NextIcon',
-      unicode: 'e65d',
-      unicode_decimal: 58973,
+      "icon_id": "40373125",
+      "name": "OffStageIcon",
+      "font_class": "OffStageIcon",
+      "unicode": "e653",
+      "unicode_decimal": 58963
     },
     {
-      icon_id: '40373123',
-      name: 'MoreIcon',
-      font_class: 'MoreIcon',
-      unicode: 'e652',
-      unicode_decimal: 58962,
+      "icon_id": "40373124",
+      "name": "NextIcon",
+      "font_class": "NextIcon",
+      "unicode": "e65d",
+      "unicode_decimal": 58973
     },
     {
-      icon_id: '40373122',
-      name: 'MicOffIcon',
-      font_class: 'MicOffIcon',
-      unicode: 'e65e',
-      unicode_decimal: 58974,
+      "icon_id": "40373123",
+      "name": "MoreIcon",
+      "font_class": "MoreIcon",
+      "unicode": "e652",
+      "unicode_decimal": 58962
     },
     {
-      icon_id: '40373120',
-      name: 'MirrorIcon',
-      font_class: 'MirrorIcon',
-      unicode: 'e65f',
-      unicode_decimal: 58975,
+      "icon_id": "40373122",
+      "name": "MicOffIcon",
+      "font_class": "MicOffIcon",
+      "unicode": "e65e",
+      "unicode_decimal": 58974
     },
     {
-      icon_id: '40373121',
-      name: 'MicDisabledIcon',
-      font_class: 'MicDisabledIcon',
-      unicode: 'e660',
-      unicode_decimal: 58976,
+      "icon_id": "40373120",
+      "name": "MirrorIcon",
+      "font_class": "MirrorIcon",
+      "unicode": "e65f",
+      "unicode_decimal": 58975
     },
     {
-      icon_id: '40373119',
-      name: 'MicOnIcon',
-      font_class: 'MicOnIcon',
-      unicode: 'e661',
-      unicode_decimal: 58977,
+      "icon_id": "40373121",
+      "name": "MicDisabledIcon",
+      "font_class": "MicDisabledIcon",
+      "unicode": "e660",
+      "unicode_decimal": 58976
     },
     {
-      icon_id: '40373118',
-      name: 'ManageMemberIcon',
-      font_class: 'ManageMemberIcon1',
-      unicode: 'e651',
-      unicode_decimal: 58961,
+      "icon_id": "40373119",
+      "name": "MicOnIcon",
+      "font_class": "MicOnIcon",
+      "unicode": "e661",
+      "unicode_decimal": 58977
     },
     {
-      icon_id: '40373117',
-      name: 'MailIcon',
-      font_class: 'MailIcon',
-      unicode: 'e650',
-      unicode_decimal: 58960,
+      "icon_id": "40373118",
+      "name": "ManageMemberIcon",
+      "font_class": "ManageMemberIcon1",
+      "unicode": "e651",
+      "unicode_decimal": 58961
     },
     {
-      icon_id: '40373116',
-      name: 'LogoTitleInEnglish',
-      font_class: 'LogoTitleInEnglish',
-      unicode: 'e64f',
-      unicode_decimal: 58959,
+      "icon_id": "40373117",
+      "name": "MailIcon",
+      "font_class": "MailIcon",
+      "unicode": "e650",
+      "unicode_decimal": 58960
     },
     {
-      icon_id: '40373114',
-      name: 'LoginAvatar',
-      font_class: 'LoginAvatar',
-      unicode: 'e64e',
-      unicode_decimal: 58958,
+      "icon_id": "40373116",
+      "name": "LogoTitleInEnglish",
+      "font_class": "LogoTitleInEnglish",
+      "unicode": "e64f",
+      "unicode_decimal": 58959
     },
     {
-      icon_id: '40373113',
-      name: 'InviteSolidIcon',
-      font_class: 'InviteSolidIcon',
-      unicode: 'e64d',
-      unicode_decimal: 58957,
+      "icon_id": "40373114",
+      "name": "LoginAvatar",
+      "font_class": "LoginAvatar",
+      "unicode": "e64e",
+      "unicode_decimal": 58958
     },
     {
-      icon_id: '40373112',
-      name: 'InviteOnStageIcon',
-      font_class: 'InviteOnStageIcon',
-      unicode: 'e64c',
-      unicode_decimal: 58956,
+      "icon_id": "40373113",
+      "name": "InviteSolidIcon",
+      "font_class": "InviteSolidIcon",
+      "unicode": "e64d",
+      "unicode_decimal": 58957
     },
     {
-      icon_id: '40373111',
-      name: 'InviteIcon',
-      font_class: 'InviteIcon',
-      unicode: 'e662',
-      unicode_decimal: 58978,
+      "icon_id": "40373112",
+      "name": "InviteOnStageIcon",
+      "font_class": "InviteOnStageIcon",
+      "unicode": "e64c",
+      "unicode_decimal": 58956
     },
     {
-      icon_id: '40373109',
-      name: 'EmojiIcon',
-      font_class: 'EmojiIcon',
-      unicode: 'e64b',
-      unicode_decimal: 58955,
+      "icon_id": "40373111",
+      "name": "InviteIcon",
+      "font_class": "InviteIcon",
+      "unicode": "e662",
+      "unicode_decimal": 58978
     },
     {
-      icon_id: '40373110',
-      name: 'EnterRoomIcon',
-      font_class: 'EnterRoomIcon',
-      unicode: 'e663',
-      unicode_decimal: 58979,
+      "icon_id": "40373109",
+      "name": "EmojiIcon",
+      "font_class": "EmojiIcon",
+      "unicode": "e64b",
+      "unicode_decimal": 58955
     },
     {
-      icon_id: '40373107',
-      name: 'ExtensionIcon',
-      font_class: 'ExtensionIcon',
-      unicode: 'e664',
-      unicode_decimal: 58980,
+      "icon_id": "40373110",
+      "name": "EnterRoomIcon",
+      "font_class": "EnterRoomIcon",
+      "unicode": "e663",
+      "unicode_decimal": 58979
     },
     {
-      icon_id: '40373108',
-      name: 'EndRoomIcon',
-      font_class: 'EndRoomIcon1',
-      unicode: 'e665',
-      unicode_decimal: 58981,
+      "icon_id": "40373107",
+      "name": "ExtensionIcon",
+      "font_class": "ExtensionIcon",
+      "unicode": "e664",
+      "unicode_decimal": 58980
     },
     {
-      icon_id: '40373106',
-      name: 'DenyOnStageIcon',
-      font_class: 'DenyOnStageIcon',
-      unicode: 'e64a',
-      unicode_decimal: 58954,
+      "icon_id": "40373108",
+      "name": "EndRoomIcon",
+      "font_class": "EndRoomIcon1",
+      "unicode": "e665",
+      "unicode_decimal": 58981
     },
     {
-      icon_id: '40373105',
-      name: 'CreateRoomIcon',
-      font_class: 'CreateRoomIcon',
-      unicode: 'e666',
-      unicode_decimal: 58982,
+      "icon_id": "40373106",
+      "name": "DenyOnStageIcon",
+      "font_class": "DenyOnStageIcon",
+      "unicode": "e64a",
+      "unicode_decimal": 58954
     },
     {
-      icon_id: '40373134',
-      name: 'VideoOpenIcon',
-      font_class: 'VideoOpenIcon',
-      unicode: 'e659',
-      unicode_decimal: 58969,
+      "icon_id": "40373105",
+      "name": "CreateRoomIcon",
+      "font_class": "CreateRoomIcon",
+      "unicode": "e666",
+      "unicode_decimal": 58982
     },
     {
-      icon_id: '40373133',
-      name: 'VideoCloseIcon',
-      font_class: 'VideoCloseIcon',
-      unicode: 'e658',
-      unicode_decimal: 58968,
+      "icon_id": "40373134",
+      "name": "VideoOpenIcon",
+      "font_class": "VideoOpenIcon",
+      "unicode": "e659",
+      "unicode_decimal": 58969
     },
     {
-      icon_id: '40373132',
-      name: 'UserIcon',
-      font_class: 'UserIcon',
-      unicode: 'e65a',
-      unicode_decimal: 58970,
+      "icon_id": "40373133",
+      "name": "VideoCloseIcon",
+      "font_class": "VideoCloseIcon",
+      "unicode": "e658",
+      "unicode_decimal": 58968
     },
     {
-      icon_id: '40373131',
-      name: 'StepDownIcon',
-      font_class: 'StepDownIcon',
-      unicode: 'e657',
-      unicode_decimal: 58967,
+      "icon_id": "40373132",
+      "name": "UserIcon",
+      "font_class": "UserIcon",
+      "unicode": "e65a",
+      "unicode_decimal": 58970
     },
     {
-      icon_id: '40373130',
-      name: 'StageApplicationIcon',
-      font_class: 'StageApplicationIcon',
-      unicode: 'e65b',
-      unicode_decimal: 58971,
+      "icon_id": "40373131",
+      "name": "StepDownIcon",
+      "font_class": "StepDownIcon",
+      "unicode": "e657",
+      "unicode_decimal": 58967
     },
     {
-      icon_id: '40373129',
-      name: 'ellipsisIcon',
-      font_class: 'ellipsisIcon',
-      unicode: 'e656',
-      unicode_decimal: 58966,
+      "icon_id": "40373130",
+      "name": "StageApplicationIcon",
+      "font_class": "StageApplicationIcon",
+      "unicode": "e65b",
+      "unicode_decimal": 58971
     },
     {
-      icon_id: '40373128',
-      name: 'RevokeAdminIcon',
-      font_class: 'RevokeAdminIcon',
-      unicode: 'e655',
-      unicode_decimal: 58965,
+      "icon_id": "40373129",
+      "name": "ellipsisIcon",
+      "font_class": "ellipsisIcon",
+      "unicode": "e656",
+      "unicode_decimal": 58966
     },
     {
-      icon_id: '40373127',
-      name: 'PhoneIcon',
-      font_class: 'PhoneIcon',
-      unicode: 'e654',
-      unicode_decimal: 58964,
+      "icon_id": "40373128",
+      "name": "RevokeAdminIcon",
+      "font_class": "RevokeAdminIcon",
+      "unicode": "e655",
+      "unicode_decimal": 58965
     },
     {
-      icon_id: '40373007',
-      name: 'ManageMemberIcon',
-      font_class: 'ManageMemberIcon',
-      unicode: 'e63e',
-      unicode_decimal: 58942,
+      "icon_id": "40373127",
+      "name": "PhoneIcon",
+      "font_class": "PhoneIcon",
+      "unicode": "e654",
+      "unicode_decimal": 58964
     },
     {
-      icon_id: '40373005',
-      name: 'CameraOnIcon',
-      font_class: 'CameraOnIcon',
-      unicode: 'e63f',
-      unicode_decimal: 58943,
+      "icon_id": "40373007",
+      "name": "ManageMemberIcon",
+      "font_class": "ManageMemberIcon",
+      "unicode": "e63e",
+      "unicode_decimal": 58942
     },
     {
-      icon_id: '40373004',
-      name: 'EndRoomIcon',
-      font_class: 'EndRoomIcon',
-      unicode: 'e640',
-      unicode_decimal: 58944,
+      "icon_id": "40373005",
+      "name": "CameraOnIcon",
+      "font_class": "CameraOnIcon",
+      "unicode": "e63f",
+      "unicode_decimal": 58943
     },
-  ],
-};
+    {
+      "icon_id": "40373004",
+      "name": "EndRoomIcon",
+      "font_class": "EndRoomIcon",
+      "unicode": "e640",
+      "unicode_decimal": 58944
+    },
+  ]
+}

BIN
uni-app/src/roomkit/TUIRoom/assets/iconfonts/iconfont.ttf


BIN
uni-app/src/roomkit/TUIRoom/assets/iconfonts/iconfont.woff


BIN
uni-app/src/roomkit/TUIRoom/assets/iconfonts/iconfont.woff2


+ 158 - 97
uni-app/src/roomkit/TUIRoom/components/Chat/ChatEditor/index.vue

@@ -2,118 +2,179 @@
   <div :class="['chat-editor', cannotSendMessage ? 'disable-editor' : '']">
     <div class="chat-input-container">
       <div class="input-content">
-        <svg-icon
-          style="display: flex"
-          @tap="togglePopover" :icon="EmojiIcon" :class="['emoji-icon', { 'disable-emoji': cannotSendMessage }]"
-        />
+        <div style="display: flex;background-size: cover; padding-left: 10px;" @click="togglePopover">
+          <svg-icon size="20" icon="EmojiIcon"></svg-icon>
+        </div>
         <input
-          ref="editorInputEle"
-          v-model="sendMsg"
-          type="text"
-          :disabled="cannotSendMessage"
+          ref="editorInputEle" v-model="sendMsg" type="text" :disabled="cannotSendMessage"
           class="content-bottom-input"
-          :placeholder="cannotSendMessage ? t('Muted by the moderator') : t('Type a message')"
-          enterkeyhint="send"
-          @keyup.enter="sendMessage"
+          :placeholder="cannotSendMessage ? t('Muted by the moderator') : t('Type a message')" confirm-type="send"
+          @confirm="sendMessage"
         />
       </div>
-      <span @tap="sendMessage" class="send">{{ t('Send') }}</span>
+      <span class="send" @tap="sendMessage">{{ t('Send') }}</span>
     </div>
-    <emoji v-if="isEmojiToolbarVisible" class="chat-emoji" @choose-emoji="handleChooseEmoji"></emoji>
   </div>
 </template>
 
 <script setup lang="ts">
-import emoji from '../EditorTools/index.vue';
-import useChatEditor from './useChatEditor';
+import { computed, ref, watch, defineEmits } from 'vue';
 import SvgIcon from '../../common/base/SvgIcon.vue';
-import EmojiIcon from '../../../assets/icons/EmojiIcon.png';
-const {
-  t,
-  editorInputEle,
-  sendMsg,
-  isEmojiToolbarVisible,
-  cannotSendMessage,
-  sendMessage,
+import { storeToRefs } from 'pinia';
+import TUIMessage from '../../common/base/Message/index';
+import TencentCloudChat from '@tencentcloud/chat';
+import { useChatStore } from '../../../stores/chat';
+import { useRoomStore } from '../../../stores/room';
+import { useI18n } from '../../../locales';
+import { useBasicStore } from '../../../stores/basic';
+import { decodeSendTextMsg } from '../util';
+import { roomService } from '../../../services/roomService';
+
+const { t } = useI18n();
+const basicStore = useBasicStore();
+const chatStore = useChatStore();
+const roomStore = useRoomStore();
+
+const { roomId } = storeToRefs(basicStore);
+const { isMessageDisableByAdmin } = storeToRefs(chatStore);
+const { isMessageDisableForAllUser } = storeToRefs(roomStore);
+const editorInputEle = ref();
+const sendMsg = ref('');
+const isEmojiToolbarVisible = ref(false);
+const emit = defineEmits([
+  'on-show-emoji',
+]);
+
+watch([isMessageDisableByAdmin, isMessageDisableForAllUser], ([adminFlag, globalFlag]) => {
+  if (adminFlag || globalFlag) {
+    sendMsg.value = '';
+  }
+});
+
+const cannotSendMessage = computed(() => isMessageDisableByAdmin.value || isMessageDisableForAllUser.value);
+const sendMessage = async () => {
+  const result = decodeSendTextMsg(sendMsg.value);
+  if (result === '') {
+    return;
+  }
+  sendMsg.value = '';
+  handleShowEmoji(false);
+  try {
+    const message = roomService.tim.createTextMessage({
+      to: roomId.value,
+      conversationType: TencentCloudChat.TYPES.CONV_GROUP,
+      payload: {
+        text: result,
+      },
+    });
+    await roomService.tim.sendMessage(message);
+    uni.hideKeyboard();
+    chatStore.updateMessageList({
+      ID: Math.random().toString(),
+      type: 'TIMTextElem',
+      payload: {
+        text: result,
+      },
+      nick: roomStore.localUser.userName || roomStore.localUser.userId,
+      from: roomStore.localUser.userId,
+      flow: 'out',
+      sequence: Math.random(),
+    });
+  } catch (e) {
+    /**
+       * Message delivery failure
+       *
+       * 消息发送失败
+      **/
+    TUIMessage({ type: 'error', message: t('Failed to send the message') });
+  }
+};
+
+const handleChooseEmoji = (emojiName: string) => {
+  sendMsg.value += emojiName;
+  editorInputEle.value.focus();
+};
+
+defineExpose({
   handleChooseEmoji,
-  togglePopover,
-} = useChatEditor();
+});
+
+
+const togglePopover = () => {
+  if (cannotSendMessage.value) return;
+  isEmojiToolbarVisible.value = !isEmojiToolbarVisible.value;
+  handleShowEmoji(isEmojiToolbarVisible.value);
+};
+
+const handleShowEmoji = (visible: boolean) => {
+  emit('on-show-emoji', visible);
+};
 
 </script>
+<style lang="scss" scoped>
+.chat-editor {
+  height: 140rpx;
+  width: 750rpx;
 
-  <style lang="scss" scoped>
-    .chat-editor {
-      .input-content {
-        display: flex;
-        width: 80%;
-        align-items: center;
-        justify-content: center;
-        color: #676c80;
-        background: #dfdcdc;
-        box-sizing: border-box;
-        font-family: 'PingFang SC';
-        font-style: normal;
-        font-weight: 450;
-        font-size: 16px;
-        line-height: 4vh;
-        caret-color: #000000;
-        border-radius: 8px;
-        resize: none;
-        .chat-emoji {
-          display: flex;
-          align-items: center;
-          justify-content: center;
-        }
-      .content-bottom-input {
-          color: #676c80;
-          width: 84%;
-          height: 34px;
-          background: #dfdcdc;
-          border: none;
-          box-sizing: border-box;
-          font-family: 'PingFang SC';
-          font-style: normal;
-          font-weight: 450;
-          font-size: 16px;
-          line-height: 4vh;
-          caret-color: #000000;
-          border-radius: 8px;
-          resize: none;
-          padding-left: 10px;
-          ::placeholder {
-            font-family: 'PingFang SC';
-            font-style: normal;
-            font-weight: 400;
-            font-size: 16px;
-            line-height: 18px;
-            color: #676c80;
-          }
-          &:focus-visible {
-            outline: none;
-          }
-        }
-      }
-    }
-    .chat-input-container{
-      width: 100vw;
+  .chat-input-container {
+    height: 140rpx;
+    width: 750rpx;
+    display: flex;
+    flex-direction: row;
+    align-items: center;
+    position: absolute;
+    bottom: 0;
+    left: 0;
+    background: white;
+  }
+
+  .input-content {
+    display: block;
+    height: 80rpx;
+    flex: 3;
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    flex-direction: row;
+    color: #676c80;
+    background: #dfdcdc;
+    box-sizing: border-box;
+    font-family: 'PingFang SC';
+    font-style: normal;
+    font-weight: 450;
+    font-size: 16px;
+    line-height: 4vh;
+    border-radius: 8px;
+    resize: none;
+
+    .content-bottom-input {
+      width: 600rpx;
       display: flex;
-      justify-content: center;
       align-items: center;
-      padding: 5px 0;
-    }
-    .emoji-icon{
-      width: 20px;
-      height: 20px;
-    }
-    .disable-emoji {
-      pointer-events: none;
-    }
-    .chat-emoji{
-      width: 100vw;
-      height: 200px;
-    }
-    .send{
-      padding-left: 10px;
+      margin-left: 10px;
+
+      ::placeholder {
+        width: 20px;
+        padding-left: 10px;
+      }
+
+      &:focus-visible {
+        outline: none;
+      }
     }
-  </style>
+  }
+}
+
+.emoji-icon {
+  width: 20px;
+  height: 20px;
+}
+
+.disable-emoji {
+  pointer-events: none;
+}
 
+.send {
+  padding-right: 5px;
+}
+</style>

+ 0 - 102
uni-app/src/roomkit/TUIRoom/components/Chat/ChatEditor/useChatEditor.ts

@@ -1,102 +0,0 @@
-import { computed, ref, watch } from 'vue';
-import { storeToRefs } from 'pinia';
-import TUIMessage from '../../common/base/Message/index';
-
-// // #ifdef APP-PLUS
-// import  { TUIRoomEngine }  from '@tencentcloud/tuiroom-engine-uniapp-app';
-// // #endif
-// // #ifdef MP-WEIXIN
-// import { TencentCloudChat } from '@tencentcloud/tuiroom-engine-wx';
-// // #endif
-import useGetRoomEngine from '../../../hooks/useRoomEngine';
-import { useChatStore } from '../../../stores/chat';
-import { useRoomStore } from '../../../stores/room';
-import { useI18n } from '../../../locales';
-import { useBasicStore } from '../../../stores/basic';
-import { decodeSendTextMsg } from '../util';
-export default function useChatEditor() {
-  const roomEngine = useGetRoomEngine();
-
-  const { t } = useI18n();
-  const basicStore = useBasicStore();
-  const chatStore = useChatStore();
-  const roomStore = useRoomStore();
-
-  const { roomId } = storeToRefs(basicStore);
-  const { isMessageDisableByAdmin } = storeToRefs(chatStore);
-  const { isMessageDisableForAllUser } = storeToRefs(roomStore);
-  const editorInputEle = ref();
-  const sendMsg = ref('');
-  const isEmojiToolbarVisible = ref(false);
-  watch(isMessageDisableByAdmin, (value) => {
-    if (value) {
-      sendMsg.value = '';
-    }
-  });
-
-  watch(isMessageDisableForAllUser, (value) => {
-    if (value) {
-      sendMsg.value = '';
-    }
-  });
-  const cannotSendMessage = computed(() => Boolean(isMessageDisableByAdmin.value || isMessageDisableForAllUser.value));
-  const sendMessage = async () => {
-    const result = decodeSendTextMsg(sendMsg.value);
-    if (result === '') {
-      return;
-    }
-    sendMsg.value = '';
-    isEmojiToolbarVisible.value = false;
-    try {
-      const tim = roomEngine.instance?.getTIM();
-      if (!tim) {
-        throw new Error('tim is null');
-      }
-      const message = tim.createTextMessage({
-        to: roomId.value,
-        conversationType: TencentCloudChat.TYPES.CONV_GROUP,
-        payload: {
-          text: result,
-        },
-      });
-      await tim.sendMessage(message);
-      chatStore.updateMessageList({
-        ID: Math.random().toString(),
-        type: 'TIMTextElem',
-        payload: {
-          text: result,
-        },
-        nick: roomStore.localUser.userName || roomStore.localUser.userId,
-        from: roomStore.localUser.userId,
-        flow: 'out',
-        sequence: Math.random(),
-      });
-    } catch (e) {
-    /**
-     * Message delivery failure
-     *
-     * 消息发送失败
-    **/
-      TUIMessage({ type: 'error', message: t('Failed to send the message') });
-    }
-  };
-
-  const handleChooseEmoji = (emojiName: string) => {
-    sendMsg.value += emojiName;
-    editorInputEle.value.focus();
-  };
-  const togglePopover = () => {
-    isEmojiToolbarVisible.value = !isEmojiToolbarVisible.value;
-  };
-  return {
-    t,
-    editorInputEle,
-    sendMsg,
-    isMessageDisableByAdmin,
-    cannotSendMessage,
-    sendMessage,
-    handleChooseEmoji,
-    isEmojiToolbarVisible,
-    togglePopover,
-  };
-}

+ 10 - 9
uni-app/src/roomkit/TUIRoom/components/Chat/EditorTools/index.vue

@@ -3,15 +3,16 @@
     <div
       v-for="(childrenItem, childrenIndex) in emojiList"
       :key="childrenIndex"
-      @tap="() => chooseEmoji(childrenItem)"
       class="emoji-item"
+      @tap="() => chooseEmoji(childrenItem)"
     >
-      <img class="emoji-image" :src="emojiBaseUrl + emojiMap[childrenItem]" />
+      <image class="emoji-image" :src="emojiBaseUrl + emojiMap[childrenItem]" />
     </div>
   </div>
 </template>
 
 <script setup lang="ts">
+import { defineEmits } from 'vue';
 import { emojiBaseUrl, emojiMap, emojiList } from '../util';
 
 
@@ -29,19 +30,19 @@ const chooseEmoji = (itemName: string) => {
     justify-content: center;
     background: #FFFFFF;
     flex-wrap: wrap;
-    width: 100%;
-    height: 200px;
+    width: 20rpx;
+    height: 600px;
     flex-wrap: wrap;
     overflow-y: auto
   }
   .emoji-item{
-    width: 9vw;
-    height: 9vw;
-    margin: 2vw;
+    width: 30px;
+    height: 30px;
+    margin: 5px;
   }
   .emoji-image{
-    width: 100%;
-    height: 100%;
+    width: 30px;
+    height: 30px;
   }
   </style>
 

+ 90 - 90
uni-app/src/roomkit/TUIRoom/components/Chat/MessageList/index.vue

@@ -1,12 +1,12 @@
 <template>
   <div class="message-list-container-wx">
-<!--    <scroll-view
+    <scroll-view
       id="messageScrollList" ref="messageListRef" class="message-list" scroll-y="true"
-      :scroll-top="scrollTop" @scroll="handleScroll"
+      style="padding-bottom: 80px;" :scroll-into-view="targetJumpMessage" scroll-with-animation="true"
+      lower-threshold="50" upper-threshold="50" @scrolltoupper="handleScrolltoupper" @scrolltolower="handleScrolltolower"
     >
       <div
-        v-for="(item, index) in messageList"
-        :key="item.ID"
+        v-for="(item, index) in messageList" :id="'ID' + '-' + item.ID" :key="item.ID"
         :class="['message-item', `${'out' === item.flow ? 'is-me' : ''}`]"
       >
         <div v-if="getDisplaySenderName(index)" class="message-header" :title="item.nick || item.from">
@@ -16,62 +16,26 @@
           <message-text :data="item.payload.text" />
         </div>
       </div>
-    </scroll-view> -->
+    </scroll-view>
   </div>
 </template>
 
 <script setup lang="ts">
-import { getCurrentInstance, nextTick, onMounted, ref, watch } from 'vue';
+import { onMounted } from 'vue';
 import MessageText from '../MessageTypes/MessageText.vue';
 import useMessageList from './useMessageListHook';
-import { getBoundingClientRect, getScrollInfo, instanceMapping } from '../../../utils/domOperation';
-import { throttle } from '../../../utils/utils';
-const thisInstance = getCurrentInstance()?.proxy || getCurrentInstance();
-const scrollTop = ref();
-let isScrollAtBottom = true;
+
 const {
   setMessageListInfo,
   messageList,
-  handleGetHistoryMessageList,
   getDisplaySenderName,
-  isCompleted,
+  targetJumpMessage,
+  handleScrolltoupper,
+  handleScrolltolower,
 } = useMessageList();
 
-async function scrollToLatestMessage() {
-  const { scrollHeight } = await getScrollInfo('#messageScrollList', 'messageList');
-  scrollTop.value = scrollHeight;
-}
-
-const handleMessageListScroll = async (e: any) => {
-  const messageContainer = e.target as HTMLElement;
-  const { scrollTop } = await getScrollInfo('#messageScrollList', 'messageList');
-  const { height } = await getBoundingClientRect('#messageScrollList', 'messageList');
-  isScrollAtBottom = (scrollTop > height);
-  if (messageContainer.scrollTop < 40 && !isCompleted.value) {
-    handleGetHistoryMessageList();
-  }
-};
-
-const handleScroll = throttle(handleMessageListScroll, 1000);
-
-watch(messageList, async (newMessageList, oldMessageList) => {
-  if ((newMessageList as any).length === 0) return;
-  const lastMessage = (newMessageList as any).slice(-1);
-  const oldLastMessage = (oldMessageList as any).slice(-1);
-  const isSendByMe = lastMessage[0].flow === 'out';
-  const isNewMessage = lastMessage[0].ID !== oldLastMessage[0]?.ID;
-  await nextTick();
-  if (isScrollAtBottom) {
-    scrollToLatestMessage();
-    return;
-  }
-  if (isSendByMe && isNewMessage) {
-    scrollToLatestMessage();
-  }
-});
 
 onMounted(async () => {
-  instanceMapping.set('messageList', thisInstance);
   setMessageListInfo();
 });
 </script>
@@ -79,68 +43,104 @@ onMounted(async () => {
 <style lang="scss" scoped>
 .message-list-container-wx {
   background-color: #d4d4d4;
-  height: 100%;
-  width: 100%;
+  width: 750rpx;
+  height: 1300rpx;
+  padding-bottom: 30px;
   overflow: scroll;
+
   &::-webkit-scrollbar {
     display: none;
   }
+
   .message-top {
     display: flex;
     justify-content: center;
   }
+
+  .load-more {
+    height: 30px;
+    width: 200px;
+    display: flex;
+    align-self: center;
+    justify-content: center;
+    align-items: center;
+  }
+
+  .load-more-text {
+    display: block;
+    justify-content: center;
+    font-size: 14px;
+    line-height: 20px;
+    font-weight: 400;
+  }
+
   .message-list {
     overflow-y: scroll;
-    height: 100%;
-  .message-item {
-    padding: 0 20px;
-    word-break: break-all;
-    display: flex;
-    flex-direction: column;
-    align-items: flex-start;
-    &:last-of-type {
-      margin-bottom: 0;
-    }
-    &.is-me {
-      align-items: flex-end;
+    height: 1440rpx;
+    white-space: nowrap;
+
+    .message-item {
+      padding: 0 20px;
+      word-break: break-all;
+      display: flex;
+      flex-direction: column;
+      align-items: flex-start;
+
+      &:last-of-type {
+        margin-bottom: 0;
+      }
+
+      &.is-me {
+        align-items: flex-end;
+
+        .message-body {
+          background-color: #4791FF;
+          min-width: 24px;
+          border-radius: 8px;
+          display: inline-block;
+          padding: 7px;
+          font-weight: 400;
+          font-size: 14px;
+          color: #FFFFFF;
+          display: flex;
+          flex-direction: row;
+          max-width: 270px;
+          flex-wrap: wrap;
+        }
+      }
+
+      .message-header {
+        max-width: 180px;
+        white-space: nowrap;
+        text-overflow: ellipsis;
+        overflow: hidden;
+        font-family: 'PingFang SC';
+        font-style: normal;
+        font-weight: 500;
+        font-size: 10px;
+        color: #ff7200;
+        line-height: 14px;
+        max-width: 180px;
+        white-space: nowrap;
+        text-overflow: ellipsis;
+        overflow: hidden;
+      }
+
       .message-body {
-        background-color: #4791FF;
-        min-width: 24px;
-        border-radius: 8px;
+        background-color: #817e7e;
         display: inline-block;
         padding: 7px;
         font-weight: 400;
         font-size: 14px;
         color: #FFFFFF;
+        border-radius: 8px;
+        margin-top: 10px;
+        display: flex;
+        flex-direction: row;
+        max-width: 270px;
+        flex-wrap: wrap;
       }
     }
-    .message-header {
-      max-width: 180px;
-      white-space: nowrap;
-      text-overflow: ellipsis;
-      overflow: hidden;
-      font-family: 'PingFang SC';
-      font-style: normal;
-      font-weight: 500;
-      font-size: 10px;
-      color: #ff7200;
-      line-height: 14px;
-      max-width: 180px;
-      white-space: nowrap;
-      text-overflow: ellipsis;
-      overflow: hidden;
-    }
-    .message-body {
-      background-color: #817e7e;
-      display: inline-block;
-      padding: 7px;
-      font-weight: 400;
-      font-size: 14px;
-      color: #FFFFFF;
-      border-radius: 8px;
-      margin-top: 10px
-    }
   }
 }
-}
 </style>

+ 39 - 28
uni-app/src/roomkit/TUIRoom/components/Chat/MessageList/useMessageListHook.ts

@@ -1,32 +1,32 @@
-import { watch, onUnmounted, ref } from 'vue';
+import { watch, onUnmounted, onMounted, ref, nextTick } from 'vue';
 import { storeToRefs } from 'pinia';
 import { useChatStore } from '../../../stores/chat';
 import { useBasicStore } from '../../../stores/basic';
-import { useI18n } from '../../../locales';
-// // #ifdef APP-PLUS
-// import  { TUIRoomEngine }  from '@tencentcloud/tuiroom-engine-uniapp-app';
-// // #endif
-// // #ifdef MP-WEIXIN
-// import { TUIRoomEngine, TencentCloudChat } from '@tencentcloud/tuiroom-engine-wx';
-// // #endif
-import useGetRoomEngine from '../../../hooks/useRoomEngine';
+import TencentCloudChat from '@tencentcloud/chat';
+import { roomService } from '../../../services/roomService';
 
 export default function useMessageList() {
-  const { t } = useI18n();
-  const roomEngine = useGetRoomEngine();
   const chatStore = useChatStore();
   const basicStore = useBasicStore();
   const { roomId } = storeToRefs(basicStore);
   const { messageList, isCompleted, nextReqMessageId } = storeToRefs(chatStore);
+  const targetJumpMessage = ref('');
+  const isAtBottom = ref(false);
 
   watch(isCompleted, (value) => {
     isCompleted.value = value;
   }, { immediate: true, deep: true });
 
+  watch(messageList, async (val) => {
+    if (val && val[val.length - 1].flow === 'out') {
+      await nextTick();
+      targetJumpMessage.value = `ID-${val[val.length - 1].ID}`;
+    }
+  });
+
 
   async function handleGetHistoryMessageList() {
-    const tim = roomEngine.instance?.getTIM();
-    const imResponse = await tim?.getMessageList({
+    const imResponse = await roomService.tim.getMessageList({
       conversationID: `GROUP${roomId.value}`,
       nextReqMessageID: nextReqMessageId.value,
     });
@@ -51,7 +51,6 @@ export default function useMessageList() {
       isCompleted: false,
       nextReqMessageId: '',
     };
-    const tim: any = roomEngine.instance?.getTIM();
     const getIMMessageList = async () => {
       const conversationData: {
         conversationID: string,
@@ -62,7 +61,7 @@ export default function useMessageList() {
       if (result.nextReqMessageId !== '') {
         conversationData.nextReqMessageID = result.nextReqMessageId;
       }
-      const imResponse = await tim.getMessageList(conversationData);
+      const imResponse = await roomService.tim.getMessageList(conversationData);
       const { messageList, isCompleted, nextReqMessageID } = imResponse.data;
       result.currentMessageList.splice(0, 0, ...messageList);
       result.isCompleted = messageList.length > 0 ? isCompleted : true;
@@ -89,7 +88,7 @@ export default function useMessageList() {
       if (message.type !== TencentCloudChat.TYPES.MSG_TEXT) {
         return;
       }
-      const { ID, payload: { text }, nick: userName, from: userId } = message;
+      const { ID, payload: { text }, nick: userName, from: userId, sequence } = message;
       chatStore.updateMessageList({
         ID,
         type: 'TIMTextElem',
@@ -99,8 +98,11 @@ export default function useMessageList() {
         nick: userName || userId,
         from: userId,
         flow: 'in',
-        sequence: Math.random(),
+        sequence,
       });
+      if (isAtBottom.value) {
+        targetJumpMessage.value = `ID-${message.ID}`;
+      }
     });
   };
 
@@ -108,6 +110,7 @@ export default function useMessageList() {
     const { currentMessageList, isCompleted, nextReqMessageId } = await getMessageList();
     const filterCurrentMessageList = currentMessageList.filter((item: any) => item.type === 'TIMTextElem');
     chatStore.setMessageListInfo(filterCurrentMessageList, isCompleted, nextReqMessageId);
+    targetJumpMessage.value = `ID-${filterCurrentMessageList[filterCurrentMessageList.length - 1].ID}`;
   }
 
   function getDisplaySenderName(index: number) {
@@ -115,25 +118,33 @@ export default function useMessageList() {
     return messageList.value[index].from !== messageList.value[index - 1].from;
   }
 
-  // let tim = roomEngine.instance?.getTIM();
-  // if (!tim) {
-  //   tim = TencentCloudChat.create({ SDKAppID: basicStore.sdkAppId });
-  // }
+  const handleScrolltoupper = () => {
+    isAtBottom.value = false;
+    if (!isCompleted.value) {
+      handleGetHistoryMessageList();
+    }
+  };
+
+  const handleScrolltolower = () => {
+    isAtBottom.value = true;
+  };
 
-  // TUIRoomEngine.once('ready', () => {
-  //   tim?.on(TencentCloudChat.EVENT.MESSAGE_RECEIVED, onReceiveMessage);
-  // });
-  // onUnmounted(() => {
-  //   tim?.off(TencentCloudChat.EVENT.MESSAGE_RECEIVED, onReceiveMessage);
-  // });
+  onMounted(() => {
+    roomService.tim.on(TencentCloudChat.EVENT.MESSAGE_RECEIVED, onReceiveMessage);
+  });
+  onUnmounted(() => {
+    roomService.tim.off(TencentCloudChat.EVENT.MESSAGE_RECEIVED, onReceiveMessage);
+  });
 
   return {
-    t,
     handleGetHistoryMessageList,
     messageList,
     getMessageList,
     setMessageListInfo,
     getDisplaySenderName,
     isCompleted,
+    targetJumpMessage,
+    handleScrolltoupper,
+    handleScrolltolower,
   };
 }

+ 19 - 16
uni-app/src/roomkit/TUIRoom/components/Chat/MessageTypes/MessageText.vue

@@ -1,29 +1,32 @@
 <template>
-  <span>
-    <span v-for="(item, index) in handleTextMessageShowContext(props.data)" :key="index">
-      <span v-if="item.name === 'text'" class="text-box">{{ item.text }}</span>
-      <img v-else-if="item.name === 'img'" class="text-img" :src="item.src" />
-    </span>
-  </span>
+  <div v-for="(item) in decodeMessageText(props.data)" :key="item.ID">
+    <text v-if="item.name === 'text'" class="text-box">{{ item.text }}</text>
+    <image v-else-if="item.name === 'img'" class="text-img" :src="item.src" />
+  </div>
 </template>
 
 <script setup lang="ts">
+import { defineProps } from 'vue';
 import { decodeMessageText } from '../util';
 
+// eslint-disable-next-line vue/require-prop-types
 const props = defineProps(['data']);
 
-const handleTextMessageShowContext = (text: string) => decodeMessageText(text);
 
 </script>
 
 <style lang="scss" scoped>
-  .text-img {
-    width: 20px;
-    height: 20px;
-    vertical-align: middle;
-  }
-  .text-box {
-    line-height: 20px;
-    vertical-align: middle;
-  }
+.text-img {
+  width: 20px;
+  height: 20px;
+  vertical-align: middle;
+}
+
+.text-box {
+  line-height: 20px;
+  vertical-align: middle;
+  display: flex;
+  max-width: 260px;
+  flex-wrap: wrap;
+}
 </style>

+ 24 - 14
uni-app/src/roomkit/TUIRoom/components/Chat/index.vue

@@ -1,24 +1,34 @@
 <template>
-  <div :class="[isMobile ? 'chat-container-h5' : 'chat-container' ]">
+  <div class="chat-container">
     <message-list></message-list>
-    <chat-editor v-if="!isMobile"></chat-editor>
+    <emoji-list
+      v-if="isEmojiToolbarVisible" class="chat-emoji"
+      style="width: 750rpx; height: 200px; position: absolute; bottom: 80px;" @choose-emoji="handleChooseEmoji"
+    ></emoji-list>
+    <chat-editor ref="editor" @on-show-emoji="handleShowEmoji"></chat-editor>
   </div>
 </template>
 
 <script setup lang="ts">
+import { ref } from 'vue';
 import MessageList from './MessageList/index.vue';
 import ChatEditor from './ChatEditor/index.vue';
-import { isMobile }  from '../../utils/environment';
+import emojiList from './EditorTools/index.vue';
+
+const isEmojiToolbarVisible = ref(false);
+
+const editor = ref();
+
+
+const handleShowEmoji = (event: boolean) => {
+  isEmojiToolbarVisible.value = event;
+};
+
+const handleChooseEmoji = (emojiName: string) => {
+  editor.value.handleChooseEmoji(emojiName);
+};
+
+
 </script>
 
-<style lang="scss" scoped>
-  .chat-container {
-    display: flex;
-    flex-direction: column;
-    height: 100%;
-    padding: 20px;
-  }
-  .chat-container-h5 {
-    height: 100%;
-  }
-</style>
+<style lang="scss" scoped></style>

+ 3 - 3
uni-app/src/roomkit/TUIRoom/components/RoomFooter/MoreControl/index.vue

@@ -10,10 +10,10 @@
     </div>
     <div v-if="showMoreContent" ref="moreContentRef" class="show-more-content">
       <div class="control-compent">
-        <!-- <chat-control
+        <chat-control
           v-if="roomStore.isSpeakAfterTakingSeatMode"
           @click="handleControlClick('chatControl')"
-        ></chat-control> -->
+        ></chat-control>
         <contact-control @click="handleControlClick('contactControl')"></contact-control>
         <invite-control @click="handleControlClick('inviteControl')"></invite-control>
       </div>
@@ -24,7 +24,7 @@
 <script setup lang="ts">
 import IconButton from '../../common/base/IconButton.vue';
 import userMoreControl from './useMoreControlHooks';
-// import ChatControl from '../ChatControl.vue';
+import ChatControl from '../ChatControl.vue';
 import InviteControl from '../InviteControl.vue';
 import ContactControl from '../ContactControl.vue';
 import { useRoomStore } from '../../../stores/room';

+ 13 - 8
uni-app/src/roomkit/TUIRoom/components/RoomFooter/index/index.vue

@@ -2,32 +2,38 @@
   <div class="footer-container" :class="[showRoomTool ? '' : 'footer-hidden']">
     <audio-control
       v-if="!isAudience || isAdmin"
+      style="flex: 1.5;"
       @tap="() => handleControlClick('audioControl')"
     ></audio-control>
     <video-control
       v-if="!isAudience || isAdmin"
+      style="flex: 1.5;"
       @tap="() => handleControlClick('videoControl')"
     ></video-control>
-    <!-- <chat-control
+    <chat-control
       v-if="!roomStore.isSpeakAfterTakingSeatMode"
+      style="flex: 1.5;"
       @tap="() => handleControlClick('chatControl')"
-    ></chat-control> -->
+    ></chat-control>
     <master-apply-control
       v-if="roomStore.isSpeakAfterTakingSeatMode && (isMaster || isAdmin)"
+      style="flex: 2;"
       @tap="() => handleControlClick('MasterApplyControl')"
     ></master-apply-control>
     <screen-share-control
-      class="center-container-item"
+      style="flex: 2;"
       @click="handleControlClick('screenShareControl')"
     ></screen-share-control>
     <member-apply-control
       v-if="roomStore.isSpeakAfterTakingSeatMode && !isMaster"
+      style="flex: 1;"
       @tap="() => handleControlClick('MemberApplyControl')"
     ></member-apply-control>
     <manage-member-control
+      style="flex: 1.5;"
       @tap="() => handleControlClick('manageMemberControl')"
     ></manage-member-control>
-    <more-control @tap="() => handleControlClick('moreControl')"></more-control>
+    <more-control style="flex: 1;" @tap="() => handleControlClick('moreControl')"></more-control>
   </div>
 </template>
 <script setup lang="ts">
@@ -35,7 +41,7 @@ import { inject } from 'vue';
 import AudioControl from '../AudioControl.vue';
 import VideoControl from '../VideoControl.vue';
 import ManageMemberControl from '../ManageMemberControl.vue';
-// import ChatControl from '../ChatControl.vue';
+import ChatControl from '../ChatControl.vue';
 import MasterApplyControl from '../ManageStageControl.vue';
 import MemberApplyControl from '../ApplyControl/MemberApplyControl.vue';
 import MoreControl from '../MoreControl/index.vue';
@@ -69,15 +75,14 @@ function handleControlClick(name: string) {
   bottom: 0;
   left: 0;
   display: flex;
-  justify-content: space-between;
+  justify-content: space-around;
   align-items: center;
-  flex-wrap: wrap;
+  flex-wrap: nowrap;
   flex-direction: row;
   background-color: #FBFCFE;
   padding: 12px 12px 20px 12px;
   /* box-shadow: 0px -8px 30px var(--footer-shadow-color); */
 }
-
 .footer-hidden {
    bottom: -150px !important;
 }

+ 11 - 17
uni-app/src/roomkit/TUIRoom/components/RoomSidebar/index.vue

@@ -1,15 +1,9 @@
 <template>
-  <popup
-    v-if="showSideBar"
-    :title="title"
-    class="sidebar-container-mobile"
-  >
+  <popup v-if="showSideBar" :title="title" class="sidebar-container-mobile">
     <template #sidebarContent>
       <div style="height: 1440rpx">
         <chat v-if="sidebarName === 'chat'"></chat>
-        <manage-member
-          v-if="sidebarName === 'manage-member'"
-        ></manage-member>
+        <manage-member v-if="sidebarName === 'manage-member'"></manage-member>
         <master-apply v-if="sidebarName === 'apply'"></master-apply>
       </div>
     </template>
@@ -24,15 +18,15 @@
 <script setup lang="ts">
 import useSideBar from './useSideBarHooks';
 import { ref } from 'vue';
-// import Chat from '../Chat/index.vue';
+import Chat from '../Chat/index.vue';
 import MasterApply from '../RoomFooter/ApplyControl/MasterApplyControl/index';
 import ManageMember from '../ManageMember/index';
 import popup from '../common/base/PopUpH5.vue';
-// import ChatEditor from '../Chat/ChatEditor/index.vue';
+import ChatEditor from '../Chat/ChatEditor/index.vue';
 
-const screenHeight = ref()
+const screenHeight = ref();
 
-screenHeight.value = uni.getSystemInfoSync().screenHeight
+screenHeight.value = uni.getSystemInfoSync().screenHeight;
 
 const {
   title,
@@ -44,10 +38,10 @@ const {
 </script>
 <style lang="scss" scoped>
 .sidebar-container-mobile {
-		height: 1440rpx;
-    position: fixed;
-    top: 0;
-    right: 0;
-    z-index: 101;
+  height: 1440rpx;
+  position: fixed;
+  top: 0;
+  right: 0;
+  z-index: 101;
 }
 </style>

+ 4 - 39
uni-app/src/roomkit/TUIRoom/components/RoomSidebar/useSideBarHooks.ts

@@ -1,23 +1,18 @@
-// import { TencentCloudChat } from '@tencentcloud/tuiroom-engine-uniapp-app';
-import useGetRoomEngine from '../../hooks/useRoomEngine';
-import { useChatStore } from '../../stores/chat';
 import { storeToRefs } from 'pinia';
 import { useBasicStore } from '../../stores/basic';
 import { useI18n } from '../../locales';
-import { onMounted, computed, onUnmounted, watch } from 'vue';
+import { computed } from 'vue';
 import { useRoomStore } from '../../stores/room';
 
 export default function useSideBar() {
-  const roomEngine = useGetRoomEngine();
   const { t } = useI18n();
 
-  const chatStore = useChatStore();
   const basicStore = useBasicStore();
-  const { sdkAppId, isSidebarOpen, sidebarName } = storeToRefs(basicStore);
+  const { isSidebarOpen, sidebarName } = storeToRefs(basicStore);
   const roomStore = useRoomStore();
   const { userNumber } = storeToRefs(roomStore);
 
-	
+
   const showSideBar = computed(() => isSidebarOpen.value && sidebarName.value !== 'transfer-leave');
   const title = computed((): string => {
     let sidebarTitle = '';
@@ -49,35 +44,6 @@ export default function useSideBar() {
     done();
   }
 
-  /** 监听消息接收,放在这里是为了打开 chat 之前只记录消息未读数 */
-  // const onReceiveMessage = (options: { data: any }) => {
-  //   if (!options || !options.data) {
-  //     return;
-  //   }
-  //   options.data.forEach((message: any) => {
-  //     if (message.type === TencentCloudChat.TYPES.MSG_TEXT) {
-  //       if (!basicStore.isSidebarOpen || basicStore.sidebarName !== 'chat') {
-  //         // eslint-disable-next-line no-plusplus
-  //         chatStore.updateUnReadCount(++chatStore.unReadCount);
-  //       }
-  //     }
-  //   });
-  // };
-
-  // let tim = roomEngine.instance?.getTIM();
-  // let tim = {}
-
-  // watch(sdkAppId, () => {
-  //   if (!tim) {
-  //     tim = TencentCloudChat.create({ SDKAppID: basicStore.sdkAppId });
-  //   }
-  //   tim?.on(TencentCloudChat.EVENT.MESSAGE_RECEIVED, onReceiveMessage);
-  // }, { immediate: true });
-
-  // onUnmounted(() => {
-  //   tim?.off(TencentCloudChat.EVENT.MESSAGE_RECEIVED, onReceiveMessage);
-  // });
-
 
   return {
     t,
@@ -86,7 +52,6 @@ export default function useSideBar() {
     sidebarName,
     handleClose,
     showSideBar,
-  }
-  ;
+  };
 }
 

+ 10 - 13
uni-app/src/roomkit/TUIRoom/components/common/base/Badge.vue

@@ -1,12 +1,14 @@
 <template>
   <div :class="badgeClass">
-    <slot></slot>
-    <sup v-if="showBadge" class="tui-badge-count">{{ content }}</sup>
+    <slot style="position: relative;"></slot>
+    <div v-if="showBadge" class="tui-badge-count">
+      <text style="font-size: 12px;font-weight: 500;">{{ content }}</text>
+    </div>
   </div>
 </template>
 
 <script lang="ts" setup>
-import { computed } from 'vue';
+import { computed, defineProps } from 'vue';
 
 interface Props {
   type?: 'primary' | 'danger';
@@ -42,16 +44,11 @@ const badgeClass = computed(() => ['tui-badge', `tui-badge-${props.type}`, props
   display: inline-block;
 
   .tui-badge-count {
-    position: absolute;
-    top: 0;
-    right: 15px;
-    display: inline-block;
-    padding: 1px 6px;
-    font-size: 12px;
-    color: #FFFFFF;
-    transform: translateY(-50%) translateX(100%);
-    font-weight: bold;
-    border-radius: 10px;
+	  padding: 1px 3px;
+	  position: absolute;
+	  top: 0;
+	  right: 3px;
+	  border-radius: 10px;
   }
 }
 

+ 3 - 3
uni-app/src/roomkit/TUIRoom/components/common/base/IconButton.vue

@@ -24,7 +24,7 @@
     >
       <slot></slot>
       <svg-icon style="display: flex" v-if="icon" size="24" :icon="icon"></svg-icon>
-      <span class="title">{{ title }}</span>
+      <text class="title">{{ title }}</text>
     </div>
     <div
       v-else
@@ -127,7 +127,7 @@ const handleClickEvent = () => {
     .title {
       font-size: 14px;
       line-height: 26px;
-      font-weight: 500;
+      font-weight: 600;
       margin-left: 4px;
     }
   }
@@ -143,7 +143,7 @@ const handleClickEvent = () => {
     .title {
       font-size: 12px;
       line-height: 20px;
-      font-weight: 400;
+      font-weight: 500;
       margin-top: 4px;
     }
   }

+ 4 - 6
uni-app/src/roomkit/TUIRoom/index.vue

@@ -26,14 +26,13 @@
 </template>
 
 <script setup lang="ts">
-import { ref, onMounted, onUnmounted, Ref, watch, computed, provide } from 'vue';
+import { ref, onMounted, onUnmounted, Ref, watch, provide } from 'vue';
 import RoomHeader from './components/RoomHeader/index/index.vue';
 import RoomFooter from './components/RoomFooter/index/index.vue';
 import RoomSidebar from './components/RoomSidebar/index.vue';
 import RoomContent from './components/RoomContent/index.vue';
 import RoomSetting from './components/RoomSetting/index.vue';
 import { debounce, throttle } from './utils/utils';
-import { useBasicStore } from './stores/basic';
 import { isMobile, isWeChat } from './utils/environment';
 import { TUIKickedOutOfRoomReason }  from '@tencentcloud/tuiroom-engine-uniapp-app';
 
@@ -42,7 +41,7 @@ import { MESSAGE_DURATION } from './constants/message';
 
 import TUIMessageBox from './components/common/base/MessageBox/index';
 import TUIMessage from './components/common/base/Message/index';
-import { roomService, EventType, RoomParam, RoomInitData } from './services/index';
+import { roomService, EventType, RoomParam, RoomInitData, RoomService } from './services/index';
 import useDeviceManager from './hooks/useDeviceManager';
 useDeviceManager({ listenForDeviceChange: true });
 
@@ -133,9 +132,10 @@ onUnmounted(() => {
   roomService.off(EventType.ROOM_KICKED_OUT, onKickedOutOfRoom);
   roomService.off(EventType.ROOM_USER_SIG_EXPIRED, onUserSigExpired);
   roomService.off(EventType.ROOM_KICKED_OFFLINE, onKickedOffLine);
+  RoomService.destroyInstance();
 });
 
-const { sdkAppId, showHeaderTool } = roomService.basicStore;
+const { sdkAppId } = roomService.basicStore;
 watch(
   () => sdkAppId,
   (val: number) => {
@@ -149,8 +149,6 @@ watch(
   },
 );
 
-const tuiRoomClass = ref('white');
-
 // const tuiRoomClass = computed(() => (isMobile ? ['tui-room', `tui-theme-${roomService.basicStore.defaultTheme}`, 'tui-room-h5'] : ['tui-room', `tui-theme-${roomService.basicStore.defaultTheme}`]));
 /**
  * Handle page mouse hover display toolbar logic

+ 25 - 3
uni-app/src/roomkit/TUIRoom/services/roomService.ts

@@ -1,7 +1,7 @@
 import mitt from 'mitt';
 import useGetRoomEngine from '../hooks/useRoomEngine';
 import { EventType, RoomInitData, RoomParam } from './types';
-import  {
+import {
   TUIRoomEngine,
   TRTCVideoEncParam,
   TRTCVideoFillMode,
@@ -11,7 +11,6 @@ import  {
   TUIKickedOutOfRoomReason,
   TUIRole,
   TUIRoomEvents,
-  TUIRoomInfo,
   TUIRoomType,
   TUISeatMode,
 } from '@tencentcloud/tuiroom-engine-uniapp-app';
@@ -24,6 +23,7 @@ import { isMobile, isWeChat, isApp } from '../utils/environment';
 import TUIRoomAegis from '../utils/aegis';
 import i18n from '../locales';
 import { MESSAGE_DURATION } from '../constants/message';
+import TencentCloudChat, { ChatSDK } from '@tencentcloud/chat';
 const { t } = i18n.global;
 
 const logPrefix = '[RoomService]';
@@ -36,6 +36,7 @@ smallParam.videoBitrate = 550;
 export class RoomService {
   static instance?: RoomService;
   private emitter = mitt();
+  public tim: ChatSDK;
   get basicStore() {
     return useBasicStore();
   }
@@ -71,6 +72,7 @@ export class RoomService {
     this.onAllUserCameraDisableChanged = this.onAllUserCameraDisableChanged.bind(this);
     this.onAllUserMicrophoneDisableChanged = this.onAllUserMicrophoneDisableChanged.bind(this);
     this.onSendMessageForAllUserDisableChanged = this.onSendMessageForAllUserDisableChanged.bind(this);
+    this.onReceiveMessage = this.onReceiveMessage.bind(this);
   }
 
   static getInstance(): RoomService {
@@ -117,6 +119,10 @@ export class RoomService {
     useDeviceManager({ listenForDeviceChange: true });
   }
 
+  public bindChatEvents() {
+    this.tim.on(TencentCloudChat.EVENT.MESSAGE_RECEIVED, this.onReceiveMessage);
+  }
+
   public bindRoomEngineEvents() {
     roomEngine.instance?.on(TUIRoomEvents.onError, this.onError);
     roomEngine.instance?.on(TUIRoomEvents.onUserVoiceVolumeChanged, this.onUserVoiceVolumeChanged);
@@ -150,6 +156,7 @@ export class RoomService {
       TUIRoomEvents.onSendMessageForAllUserDisableChanged,
       this.onSendMessageForAllUserDisableChanged,
     );
+    this.tim.off(TencentCloudChat.EVENT.MESSAGE_RECEIVED, this.onReceiveMessage);
   }
 
   private onError(error: any) {
@@ -165,6 +172,19 @@ export class RoomService {
     }
   }
 
+  private onReceiveMessage(options: { data: any }) {
+    if (!options || !options.data) {
+      return;
+    }
+    options.data.forEach((message: any) => {
+      if (message.type === TencentCloudChat.TYPES.MSG_TEXT) {
+        if (!this.basicStore?.isSidebarOpen || this.basicStore?.sidebarName !== 'chat') {
+          this.chatStore?.updateUnReadCount((this.chatStore?.unReadCount || 0) + 1);
+        }
+      }
+    });
+  }
+
   private onUserVoiceVolumeChanged(eventInfo: { userVolumeList: [] }) {
     const { userVolumeList } = eventInfo;
     this.roomStore.setAudioVolume(userVolumeList);
@@ -343,9 +363,11 @@ export class RoomService {
     const { sdkAppId, userId, userSig, userName, avatarUrl } = option;
     await TUIRoomEngine.login({ sdkAppId, userId, userSig });
     await TUIRoomEngine.setSelfInfo({ userName, avatarUrl });
+    this.tim = TUIRoomEngine.getTIM();
+    this.bindChatEvents();
   }
 
-  private async doEnterRoom(options: { roomId: string; roomType: TUIRoomType}) {
+  private async doEnterRoom(options: { roomId: string; roomType: TUIRoomType }) {
     const { roomId, roomType } = options;
     if (!isApp) {
       const isH5 = isMobile && !isWeChat;

+ 3 - 4
uni-app/src/roomkit/TUIRoom/stores/chat.ts

@@ -1,5 +1,4 @@
 import { defineStore } from 'pinia';
-
 interface MessageItem {
   ID: string;
   type: string;
@@ -39,7 +38,7 @@ export const useChatStore = defineStore('chat', {
         this.messageList = this.messageList.concat([message]);
       }
     },
-    setMessageListInfo(messageList:MessageItem[], isCompleted: boolean, nextReqMessageId: string) {
+    setMessageListInfo(messageList: MessageItem[], isCompleted: boolean, nextReqMessageId: string) {
       this.messageList = messageList;
       this.isCompleted = isCompleted;
       this.nextReqMessageId = nextReqMessageId;
@@ -50,12 +49,12 @@ export const useChatStore = defineStore('chat', {
     addHistoryMessages(messageList: MessageItem[]) {
       const messageIds = this.messageList.map(message => message.ID);
       const filteredMessageList = messageList.filter(message => messageIds.indexOf(message.ID) === -1);
-      this.messageList = filteredMessageList.concat(this.messageList).sort((
-        messageA: MessageItem, messageB: MessageItem) => messageA.sequence - messageB.sequence);
+      this.messageList = filteredMessageList.concat(this.messageList).sort((messageA: MessageItem, messageB: MessageItem) => messageA.sequence - messageB.sequence);
     },
     setSendMessageDisableChanged(isDisable: boolean) {
       this.isMessageDisableByAdmin = isDisable;
     },
+
     reset() {
       this.messageList = [];
       this.unReadCount = 0;

+ 1 - 21
uni-app/src/roomkit/pages/home.vue

@@ -28,29 +28,21 @@
 import UserInfo from '../TUIRoom/components/RoomHeader/UserInfo/index.vue';
 import RoomControl from '../TUIRoom/components/RoomHome/RoomControl/index.vue';
 import SwitchTheme from '../TUIRoom/components/common/SwitchTheme.vue';
-import { checkNumber } from '../TUIRoom/utils/common';
-import router from '@/router';
-import { useRoute } from '@/router/wxRouter';
+import router from '../../router';
 import { Ref, ref } from 'vue';
 import { getBasicInfo } from '../config/basic-info-config';
 import { useBasicStore } from '../TUIRoom/stores/basic';
 import { TUIRoomEngine } from '@tencentcloud/tuiroom-engine-uniapp-app';
-import useGetRoomEngine from '../TUIRoom/hooks/useRoomEngine';
-import logger from '../TUIRoom/utils/common/logger';
 import { storeToRefs } from 'pinia';
 
 
-const route = useRoute();
 const userName: Ref<string> = ref('');
 const avatarUrl: Ref<string> = ref('');
 const userId: Ref<string> = ref('');
-const roomEngine = useGetRoomEngine();
 const basicStore = useBasicStore();
 const { defaultTheme } = storeToRefs(basicStore);
 const roomControlRef = ref();
 
-const roomId = checkNumber((route.query?.roomId) as string) ? route.query?.roomId : '';
-
 
 function setTUIRoomData(action: string, mode?: string) {
   const roomParam = roomControlRef.value.getRoomParam();
@@ -62,18 +54,6 @@ function setTUIRoomData(action: string, mode?: string) {
   uni.setStorageSync('tuiRoom-roomInfo', JSON.stringify(roomData));
 }
 
-async function checkRoomExistWhenCreateRoom(roomId: string) {
-  let isRoomExist = false;
-  const tim = roomEngine.instance?.getTIM();
-  try {
-    await tim?.searchGroupByID(roomId);
-    isRoomExist = true;
-  } catch (error: any) {
-    // 房间不存在
-  }
-  return isRoomExist;
-}
-
 /**
  * Generate room number when creating a room
  *

+ 1 - 1
uni-app/src/roomkit/pages/room.nvue

@@ -16,7 +16,7 @@
 <script setup lang="ts">
 import { ref, onMounted } from 'vue';
 import Room from '../TUIRoom/index.vue';
-import router from '@/router';
+import router from '../../router';
 import { checkNumber } from '../TUIRoom/utils/common';
 import { useI18n } from '../TUIRoom/locales';
 import TUIMessageBox from '../TUIRoom/components/common/base/MessageBox/index';

+ 0 - 6
uni-app/src/shime-uni.d.ts

@@ -1,6 +0,0 @@
-export {}
-
-declare module "vue" {
-  type Hooks = App.AppInstance & Page.PageInstance;
-  interface ComponentCustomOptions extends Hooks {}
-}

BIN
uni-app/src/static/logo.png


BIN
uni-app/static/logo.png


+ 0 - 13
uni-app/tsconfig.json

@@ -1,13 +0,0 @@
-{
-  "extends": "@vue/tsconfig/tsconfig.json",
-  "compilerOptions": {
-    "sourceMap": true,
-    "baseUrl": ".",
-    "paths": {
-      "@/*": ["./src/*"]
-    },
-    "lib": ["esnext", "dom"],
-    "types": ["@dcloudio/types"]
-  },
-  "include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"]
-}

+ 13 - 0
uni-app/uni.promisify.adaptor.js

@@ -0,0 +1,13 @@
+uni.addInterceptor({
+  returnValue (res) {
+    if (!(!!res && (typeof res === "object" || typeof res === "function") && typeof res.then === "function")) {
+      return res;
+    }
+    return new Promise((resolve, reject) => {
+      res.then((res) => {
+        if (!res) return resolve(res) 
+        return res[0] ? reject(res[0]) : resolve(res[1])
+      });
+    });
+  },
+});

+ 78 - 76
uni-app/src/uni.scss → uni-app/uni.scss

@@ -1,76 +1,78 @@
-/**
- * 这里是uni-app内置的常用样式变量
- *
- * uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
- * 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
- *
- */
-
-/**
- * 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
- *
- * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
- */
-
-/* 颜色变量 */
-
-/* 行为相关颜色 */
-$uni-color-primary: #007aff;
-$uni-color-success: #4cd964;
-$uni-color-warning: #f0ad4e;
-$uni-color-error: #dd524d;
-
-/* 文字基本颜色 */
-$uni-text-color: #333; // 基本色
-$uni-text-color-inverse: #fff; // 反色
-$uni-text-color-grey: #999; // 辅助灰色,如加载更多的提示信息
-$uni-text-color-placeholder: #808080;
-$uni-text-color-disable: #c0c0c0;
-
-/* 背景颜色 */
-$uni-bg-color: #fff;
-$uni-bg-color-grey: #f8f8f8;
-$uni-bg-color-hover: #f1f1f1; // 点击状态颜色
-$uni-bg-color-mask: rgba(0, 0, 0, 0.4); // 遮罩颜色
-
-/* 边框颜色 */
-$uni-border-color: #c8c7cc;
-
-/* 尺寸变量 */
-
-/* 文字尺寸 */
-$uni-font-size-sm: 12px;
-$uni-font-size-base: 14px;
-$uni-font-size-lg: 16;
-
-/* 图片尺寸 */
-$uni-img-size-sm: 20px;
-$uni-img-size-base: 26px;
-$uni-img-size-lg: 40px;
-
-/* Border Radius */
-$uni-border-radius-sm: 2px;
-$uni-border-radius-base: 3px;
-$uni-border-radius-lg: 6px;
-$uni-border-radius-circle: 50%;
-
-/* 水平间距 */
-$uni-spacing-row-sm: 5px;
-$uni-spacing-row-base: 10px;
-$uni-spacing-row-lg: 15px;
-
-/* 垂直间距 */
-$uni-spacing-col-sm: 4px;
-$uni-spacing-col-base: 8px;
-$uni-spacing-col-lg: 12px;
-
-/* 透明度 */
-$uni-opacity-disabled: 0.3; // 组件禁用态的透明度
-
-/* 文章场景相关 */
-$uni-color-title: #2c405a; // 文章标题颜色
-$uni-font-size-title: 20px;
-$uni-color-subtitle: #555; // 二级标题颜色
-$uni-font-size-subtitle: 18px;
-$uni-color-paragraph: #3f536e; // 文章段落颜色
-$uni-font-size-paragraph: 15px;
+/**
+ * 这里是uni-app内置的常用样式变量
+ *
+ * uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
+ * 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
+ *
+ */
+
+/**
+ * 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
+ *
+ * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
+ */
+
+/* 颜色变量 */
+
+/* 行为相关颜色 */
+$uni-color-primary: #007aff;
+$uni-color-success: #4cd964;
+$uni-color-warning: #f0ad4e;
+$uni-color-error: #dd524d;
+
+/* 文字基本颜色 */
+$uni-text-color: #333;
+
+// 基本色
+$uni-text-color-inverse: #fff;// 反色
+$uni-text-color-grey: #999;// 辅助灰色,如加载更多的提示信息
+$uni-text-color-placeholder: #808080;
+$uni-text-color-disable: #c0c0c0;
+
+/* 背景颜色 */
+$uni-bg-color: #fff;
+$uni-bg-color-grey: #f8f8f8;
+$uni-bg-color-hover: #f1f1f1;// 点击状态颜色
+$uni-bg-color-mask: rgba(0, 0, 0, 0.4);// 遮罩颜色
+
+/* 边框颜色 */
+$uni-border-color: #c8c7cc;
+
+/* 尺寸变量 */
+
+/* 文字尺寸 */
+$uni-font-size-sm: 12px;
+$uni-font-size-base: 14px;
+$uni-font-size-lg: 16px;
+
+/* 图片尺寸 */
+$uni-img-size-sm: 20px;
+$uni-img-size-base: 26px;
+$uni-img-size-lg: 40px;
+
+/* Border Radius */
+$uni-border-radius-sm: 2px;
+$uni-border-radius-base: 3px;
+$uni-border-radius-lg: 6px;
+$uni-border-radius-circle: 50%;
+
+/* 水平间距 */
+$uni-spacing-row-sm: 5px;
+$uni-spacing-row-base: 10px;
+$uni-spacing-row-lg: 15px;
+
+/* 垂直间距 */
+$uni-spacing-col-sm: 4px;
+$uni-spacing-col-base: 8px;
+$uni-spacing-col-lg: 12px;
+
+/* 透明度 */
+$uni-opacity-disabled: 0.3; // 组件禁用态的透明度
+
+/* 文章场景相关 */
+$uni-color-title: #2C405A; // 文章标题颜色
+$uni-font-size-title: 20px;
+$uni-color-subtitle: #555; // 二级标题颜色
+$uni-font-size-subtitle: 26px;
+$uni-color-paragraph: #3F536E; // 文章段落颜色
+$uni-font-size-paragraph: 15px;

+ 0 - 36
uni-app/vite.config.ts

@@ -1,36 +0,0 @@
-import { defineConfig } from 'vite';
-import uni from '@dcloudio/vite-plugin-uni';
-
-import path from 'path';
-
-function resolve(dir) {
-  return path.join(__dirname, dir);
-}
-
-// https://vitejs.dev/config/
-export default defineConfig(({ mode }) => {
-  const isProd = mode === 'production';
-
-  const commonConfig = {
-    plugins: [
-      uni(),
-    ],
-    resolve: {
-      alias: {
-        '@': resolve('src'),
-        '@TUIRoom': resolve('src/roomkit/TUIRoom'),
-      },
-    },
-    build: {
-    },
-  };
-  const devConfig = {
-    ...commonConfig,
-  };
-
-  const prodConfig = {
-    ...commonConfig,
-  };
-
-  return isProd ? prodConfig : devConfig;
-});