diff --git a/src/api/chat/index.js b/src/api/chat/index.js index 45fe6a5..5096308 100644 --- a/src/api/chat/index.js +++ b/src/api/chat/index.js @@ -240,3 +240,12 @@ export const ServeConvertText = (data) => { data, }) } + +// 获取用户所在群聊列表(我的群聊) +export const ServeUserGroupChatList = (data) => { + return request({ + url: '/api/v1/group/user/list', + method: 'POST', + data, + }) +} \ No newline at end of file diff --git a/src/main.js b/src/main.js index c87e2b6..8835855 100644 --- a/src/main.js +++ b/src/main.js @@ -92,8 +92,14 @@ export function createApp() { } // 通讯录跳转 window.handleContacts = () => { + // 旧版本-按组织架构树的通讯录 + // uni.navigateTo({ + // url: '/pages/chooseByDeps/index?chooseMode=3&type=true' + // }); + + // 新版本-按公司别、好友、群组的通讯录 uni.navigateTo({ - url: '/pages/chooseByDeps/index?chooseMode=3&type=true' + url: '/pages/addressBook/index?type=true', }); }; diff --git a/src/pages.json b/src/pages.json index 1bd3f0f..85195dd 100644 --- a/src/pages.json +++ b/src/pages.json @@ -193,6 +193,14 @@ "navigationStyle": "custom", "enablePullDownRefresh": false } + }, + { + "path": "pages/addressBook/index", + "type": "page", + "style": { + "navigationStyle": "custom", + "enablePullDownRefresh": false + } } ], "globalStyle": { diff --git a/src/pages/addressBook/index.vue b/src/pages/addressBook/index.vue new file mode 100644 index 0000000..b13cdfd --- /dev/null +++ b/src/pages/addressBook/index.vue @@ -0,0 +1,404 @@ + + + + + + + + + + + + + + + + + + + + companycompany + + + friendsfriends + + + + + + + {{ item?.group_name }} + + + {{ groupTypeMapping[item?.group_type]?.result_type }} + + + + + {{ $t('addressBook.btns.enterGroup') }} + + + + + + + + + + + diff --git a/src/pages/dialog/dialogDetail/userDetail.vue b/src/pages/dialog/dialogDetail/userDetail.vue index 943dc20..5635fb4 100644 --- a/src/pages/dialog/dialogDetail/userDetail.vue +++ b/src/pages/dialog/dialogDetail/userDetail.vue @@ -61,13 +61,17 @@ @@ -123,6 +127,7 @@ const state = reactive({ isShowPhoneCall: false, //是否显示电话拨号弹框 phoneNumber: '', //手机号 uid: computed(() => userStore.uid), //当前用户id + canSendMsg: false, //是否可以发送消息(是好友或同公司别),如果不可以就需要先加好友 }) onLoad((options) => { @@ -237,6 +242,16 @@ const doPhoneCall = () => { }, }) } + +//检查是否可以发送消息,如果不可以要先添加好友 +const checkSendPermission = () => { + if(state.canSendMsg){ + toTalkUser() + } else { + message.success(t('addressBook.message.addSuccess') + ' !') + state.canSendMsg = true + } +}