@@ -241,7 +245,7 @@ const formatTime = (value: number = 0) => {
}
}
-html[theme-mode='dark'] {
+html[theme-mode="dark"] {
.im-message-audio {
--audio-bg-color: #2c2c32;
--audio-btn-bg-color: rgb(78, 75, 75);
diff --git a/src/components/talk/message/CodeMessage.vue b/src/components/talk/message/CodeMessage.vue
index bd91c76..3524ce4 100644
--- a/src/components/talk/message/CodeMessage.vue
+++ b/src/components/talk/message/CodeMessage.vue
@@ -1,33 +1,32 @@
diff --git a/src/connect.js b/src/connect.js
index 43ecbc2..1eaa55e 100644
--- a/src/connect.js
+++ b/src/connect.js
@@ -30,6 +30,7 @@ class Connect {
},
// Websocket 连接成功回调方法
onOpen: () => {
+ console.log("socket已连接")
// 更新 WebSocket 连接状态
useUserStore().updateSocketStatus(true)
// online.value = true;
@@ -37,6 +38,7 @@ class Connect {
},
// Websocket 断开连接回调方法
onClose: () => {
+ console.log("socket已断开")
// 更新 WebSocket 连接状态
useUserStore().updateSocketStatus(false)
// online.value = false
diff --git a/src/constant/message.ts b/src/constant/message.ts
index 1ddfe37..e983c3f 100644
--- a/src/constant/message.ts
+++ b/src/constant/message.ts
@@ -11,6 +11,7 @@ export const ChatMsgTypeLogin = 10 // 登录消息
export const ChatMsgTypeVote = 11 // 投票消息
export const ChatMsgTypeMixed = 12 // 混合消息
export const ChatMsgTypeGroupNotice = 13 // 群公告消息
+export const ChatMsgTypeLink = 14 // 链接消息
export const ChatMsgSysText = 1000 // 系统文本消息
export const ChatMsgSysGroupCreate = 1101 // 创建群聊消息
@@ -40,6 +41,7 @@ export const ChatMsgTypeMapping = {
[ChatMsgTypeCode]: '[代码消息]',
[ChatMsgTypeMixed]: '[图文消息]',
[ChatMsgTypeGroupNotice]: '[群公告]',
+ [ChatMsgTypeLink]: '[链接]',
[ChatMsgSysText]: '[系统消息]',
[ChatMsgSysGroupCreate]: '[创建群消息]',
[ChatMsgSysGroupMemberJoin]: '[加入群消息]',
@@ -69,6 +71,7 @@ export const MessageComponents = {
[ChatMsgTypeCode]: 'code-message',
[ChatMsgTypeMixed]: 'mixed-message',
[ChatMsgTypeGroupNotice]: 'group-notice-message',
+ [ChatMsgTypeLink]: 'link-message',
[ChatMsgSysText]: 'sys-text-message',
[ChatMsgSysGroupCreate]: 'sys-group-create-message',
[ChatMsgSysGroupMemberJoin]: 'sys-group-join-message',
@@ -92,5 +95,6 @@ export const ForwardableMessageType = [
ChatMsgTypeVideo,
ChatMsgTypeFile,
ChatMsgTypeLocation,
- ChatMsgTypeCard
+ ChatMsgTypeCard,
+ ChatMsgTypeLink
]
diff --git a/src/hooks/useTalkRecord.js b/src/hooks/useTalkRecord.js
index 98fc220..f9dcc76 100644
--- a/src/hooks/useTalkRecord.js
+++ b/src/hooks/useTalkRecord.js
@@ -7,25 +7,29 @@ import lodash from 'lodash'
export const useTalkRecord = (uid) => {
const dialogueStore = useDialogueStore()
- const { getDialogueList,addDialogueRecord,zpagingComplete } = useDialogueListStore()
+ const {
+ getDialogueList,
+ addDialogueRecord,
+ zpagingComplete,
+ } = useDialogueListStore()
const records = computed(() => {
const dialogueList = getDialogueList(dialogueStore.index_name)
- if(dialogueList){
+ if (dialogueList) {
return lodash.cloneDeep(dialogueList.records).reverse()
}
return lodash.cloneDeep(dialogueStore.records)?.reverse()
- } )
+ })
const location = reactive({
msgid: '',
- num: 0
+ num: 0,
})
const loadConfig = reactive({
receiver_id: 0,
talk_type: 0,
status: 0,
- cursor: 0
+ cursor: 0,
})
const onJumpMessage = (msgid) => {
@@ -49,7 +53,7 @@ export const useTalkRecord = (uid) => {
return el?.scrollTo({
top: 0,
- behavior: 'smooth'
+ behavior: 'smooth',
})
}
@@ -57,7 +61,7 @@ export const useTalkRecord = (uid) => {
location.num = 0
element?.scrollIntoView({
- behavior: 'smooth'
+ behavior: 'smooth',
})
addClass(element, 'border')
@@ -70,7 +74,7 @@ export const useTalkRecord = (uid) => {
// 加载数据列表
const load = async (params) => {
const request = {
- limit:30,
+ limit: 30,
...params,
talk_type: params.talk_type,
receiver_id: params.receiver_id,
@@ -81,9 +85,9 @@ export const useTalkRecord = (uid) => {
let scrollHeight = 0
const el = document.getElementById('imChatPanel')
- // if (el) {
- // scrollHeight = el.scrollHeight
- // }
+ if (el) {
+ scrollHeight = el.scrollHeight
+ }
const { data, code } = await ServeTalkRecords(request)
if (code != 200) {
return (loadConfig.status = 1)
@@ -104,10 +108,14 @@ export const useTalkRecord = (uid) => {
const reverseItems = lodash.cloneDeep(items).reverse()
dialogueStore.unshiftDialogueRecord(reverseItems)
- addDialogueRecord(params.direction=='down'?reverseItems:items,params.direction=='down'?'add':'unshift')
- zpagingComplete(dialogueStore.index_name)
+ addDialogueRecord(
+ params.direction == 'down' ? reverseItems : items,
+ params.direction == 'down' ? 'add' : 'unshift',
+ )
+ zpagingComplete(dialogueStore.index_name, reverseItems)
const dialogueList = getDialogueList(dialogueStore.index_name)
- loadConfig.status = dialogueList.records?.[0]?.sequence > 1 ? 1 : 2
+ loadConfig.status =
+ dialogueList.records?.[0]?.sequence > 1 && data?.items?.length > 0 ? 1 : 2
// loadConfig.cursor = data.cursor
nextTick(() => {
@@ -133,17 +141,19 @@ export const useTalkRecord = (uid) => {
const onRefreshLoad = () => {
let dialogueList = getDialogueList(dialogueStore.index_name)
- if (dialogueList.records[0].sequence === 1 ) {
+ if (dialogueList.records[0].sequence === 1) {
return false
}
if (loadConfig.status == 1) {
- let filterList = dialogueList.records.filter(item=>item.sequence !== -1)
+ let filterList = dialogueList.records.filter(
+ (item) => item.sequence !== -1,
+ )
loadConfig.cursor = filterList[0].sequence
load({
receiver_id: loadConfig.receiver_id,
talk_type: loadConfig.talk_type,
- direction:'up',
- no_limit:0,
+ direction: 'up',
+ no_limit: 0,
})
}
}
@@ -152,12 +162,14 @@ export const useTalkRecord = (uid) => {
let dialogueList = getDialogueList(params.index_name)
if (!dialogueList) {
loadConfig.cursor = 0
- }else{
- let filterList = dialogueList.records.filter(item=>item.sequence !== -1)
- if(params.direction=='up'){
+ } else {
+ let filterList = dialogueList.records.filter(
+ (item) => item.sequence !== -1,
+ )
+ if (params.direction == 'up') {
loadConfig.cursor = filterList?.[0]?.sequence
- }else{
- loadConfig.cursor = filterList?.[filterList.length-1]?.sequence
+ } else {
+ loadConfig.cursor = filterList?.[filterList.length - 1]?.sequence
}
}
loadConfig.receiver_id = params.receiver_id
diff --git a/src/main.js b/src/main.js
index 6597748..b6e6ad7 100644
--- a/src/main.js
+++ b/src/main.js
@@ -16,7 +16,7 @@ import pageAnimation from '@/components/page-animation/index.vue'
import * as plugins from './plugins'
const { showMessage } = messagePopup()
dayjs.locale('zh-cn')
-if (import.meta.env.VITE_SHOW_CONSOLE) {
+if (import.meta.env.VITE_SHOW_CONSOLE === 'true') {
new VConsole()
}
export function createApp() {
diff --git a/src/pages/chatSettings/components/settingFormItem.vue b/src/pages/chatSettings/components/settingFormItem.vue
index fcf7639..94b0384 100644
--- a/src/pages/chatSettings/components/settingFormItem.vue
+++ b/src/pages/chatSettings/components/settingFormItem.vue
@@ -4,12 +4,14 @@
{{ props?.item?.label }}
-
-
+
+
{{ props?.item?.value }}
![]()
+
{{ props?.item?.value }}
@@ -65,7 +70,14 @@ const props = defineProps({
})
const emits = defineEmits(['toManagePage', 'changeSwitch'])
const toManagePage = (item) => {
- emits('toManagePage', item.label)
+ if (
+ props?.item?.hasPointer &&
+ (props?.isManager ||
+ (!props?.isManager &&
+ props?.item?.label !== t('chat.settings.groupName')))
+ ) {
+ emits('toManagePage', item.label)
+ }
}
const modelValue = computed(() => {
let switchStatus = false
@@ -115,6 +127,7 @@ const changeSwitch = (e, item) => {
flex-direction: row;
align-items: center;
justify-content: flex-end;
+ padding: 0 0 0 20rpx;
span {
line-height: 44rpx;
color: #747474;
@@ -135,7 +148,7 @@ const changeSwitch = (e, item) => {
color: #747474;
}
}
- .cab1{
+ .cab1 {
white-space: nowrap;
overflow: hidden;
max-width: 100%;
diff --git a/src/pages/chatSettings/index.vue b/src/pages/chatSettings/index.vue
index c38920a..330e68a 100644
--- a/src/pages/chatSettings/index.vue
+++ b/src/pages/chatSettings/index.vue
@@ -21,12 +21,15 @@
{{ groupName }}
-
+
{{ '(' + groupNum + ')' }}
-
+
{
value: t('record.searchType.files'),
typeIcon: recordSearchTypeIcon_files,
},
- {
- value: t('record.searchType.link'),
- typeIcon: recordSearchTypeIcon_link,
- },
+ // {
+ // value: t('record.searchType.link'),
+ // typeIcon: recordSearchTypeIcon_link,
+ // },
]
if (dialogueParams.type === 2) {
state.recordSearchTypeList.unshift({
diff --git a/src/pages/dialog/dialogDetail/userDetail.vue b/src/pages/dialog/dialogDetail/userDetail.vue
index 91dc1c6..6522693 100644
--- a/src/pages/dialog/dialogDetail/userDetail.vue
+++ b/src/pages/dialog/dialogDetail/userDetail.vue
@@ -27,7 +27,10 @@
{{ state?.userInfo?.nickname }}
-
+
{{ $t('user.info.jobNum') + ':' + state?.userInfo?.job_num }}
diff --git a/src/pages/dialog/index.vue b/src/pages/dialog/index.vue
index 1265976..aebfa4a 100644
--- a/src/pages/dialog/index.vue
+++ b/src/pages/dialog/index.vue
@@ -2,19 +2,17 @@
@@ -39,13 +37,13 @@
-
+
正在加载数据中 ...
-
+
查看更多消息 ...
- 没有更多消息了
+
+ 没有更多消息了
+
diff --git a/src/pages/search/searchByCondition/index.vue b/src/pages/search/searchByCondition/index.vue
index 1339773..faacf4a 100644
--- a/src/pages/search/searchByCondition/index.vue
+++ b/src/pages/search/searchByCondition/index.vue
@@ -446,7 +446,11 @@ const inputSearchText = (e) => {
}
//点击取消搜索
-const cancelSearch = () => {}
+const cancelSearch = () => {
+ uni.navigateBack({
+ delta: 1,
+ })
+}
//查询数据
const queryAllSearch = () => {
diff --git a/src/store/modules/dialogueList.js b/src/store/modules/dialogueList.js
index c225b4e..a9a8c84 100644
--- a/src/store/modules/dialogueList.js
+++ b/src/store/modules/dialogueList.js
@@ -99,9 +99,8 @@ export const useDialogueListStore = createGlobalState(() => {
zpagingRef.value = params
}
- const zpagingComplete = (index_name) => {
- const item = getDialogueList(index_name)
- zpagingRef.value?.complete(lodash.cloneDeep(item.records).reverse())
+ const zpagingComplete = (index_name, newRecords) => {
+ zpagingRef.value?.complete(lodash.cloneDeep(newRecords).reverse())
}
const addChatRecord = (indexName, item) => {
diff --git a/src/uni_modules/tmui/components/tm-navbar/tm-navbar.vue b/src/uni_modules/tmui/components/tm-navbar/tm-navbar.vue
index bde0c51..1e72577 100644
--- a/src/uni_modules/tmui/components/tm-navbar/tm-navbar.vue
+++ b/src/uni_modules/tmui/components/tm-navbar/tm-navbar.vue
@@ -1,78 +1,98 @@
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
diff --git a/src/uni_modules/tmui/locale/zh-Hans.json b/src/uni_modules/tmui/locale/zh-Hans.json
index e2d6866..ad991eb 100644
--- a/src/uni_modules/tmui/locale/zh-Hans.json
+++ b/src/uni_modules/tmui/locale/zh-Hans.json
@@ -149,5 +149,6 @@
"button.multiple.choice": "多选",
"button.text.close": "关闭",
"choose.deps.all": "全部",
- "choose.deps.current": "当前"
+ "choose.deps.current": "当前",
+ "msg.type": "图片"
}
diff --git a/vite.config.js b/vite.config.js
index 9dfb1e3..928f5a2 100644
--- a/vite.config.js
+++ b/vite.config.js
@@ -1,43 +1,60 @@
+import AutoImport from 'unplugin-auto-import/vite'
+import { NaiveUiResolver } from 'unplugin-vue-components/resolvers'
+import Components from 'unplugin-vue-components/vite'
import { defineConfig } from 'vite'
import Uni from '@dcloudio/vite-plugin-uni'
import UniKuRoot from '@uni-ku/root'
-import { resolve } from "path"
-export default async () => {
- const UnoCSS = (await import('unocss/vite')).default
+import { resolve } from 'node:path'
+import UnoCSS from 'unocss/vite'
- return defineConfig({
- envDir: './env', // 自定义env目录
- resolve: {
- alias: [
- {
- find: "@",
- replacement: resolve(__dirname, 'src')
- }
- ]
- },
- server: {
- host: '0.0.0.0', // 监听所有网络接口
- port: 2367,
- // 选项写法
- proxy: {
- '/pag': {
- target: 'https://cdn.tmui.design',
- changeOrigin: true,
- rewrite: (path) => path.replace(/^\/api/, '/api')
- },
+export default defineConfig({
+ envDir: './env', // 自定义env目录
+ resolve: {
+ alias: [
+ {
+ find: "@",
+ replacement: resolve(process.cwd(), 'src')
}
- },
- plugins: [
- Uni(),
- UniKuRoot(),
- UnoCSS()
- ],
- css: {
- preprocessorOptions: {
- scss: {
- additionalData: `@import "@/static/css/color.scss";`,
- },
+ ]
+ },
+ server: {
+ host: '0.0.0.0', // 监听所有网络接口
+ port: 2367,
+ // 选项写法
+ proxy: {
+ '/pag': {
+ target: 'https://cdn.tmui.design',
+ changeOrigin: true,
+ rewrite: (path) => path.replace(/^\/api/, '/api')
},
}
- })
-}
+ },
+ plugins: [
+ Uni(),
+ UniKuRoot(),
+ UnoCSS(),
+ AutoImport({
+ imports: [
+ 'vue',
+ {
+ 'naive-ui': [
+ 'useDialog',
+ 'useMessage',
+ 'useNotification',
+ 'useLoadingBar'
+ ]
+ }
+ ]
+ }),
+ Components({
+ resolvers: [NaiveUiResolver()]
+ })
+ ],
+ css: {
+ preprocessorOptions: {
+ scss: {
+ additionalData: `@import "@/static/css/color.scss";`,
+ },
+ },
+ }
+})