接入查询群信息接口

This commit is contained in:
wangyifeng 2025-01-02 17:10:31 +08:00
parent 3824ab7638
commit 0db50f2216
4 changed files with 46 additions and 3 deletions

View File

@ -0,0 +1,11 @@
import request from '@/service/index.js'
import qs from 'qs'
// 群信息查询
export const ServeQueryGroupInfo = (data) => {
return request({
url: '/api/v1/group/detail',
method: 'GET',
data,
})
}

View File

@ -13,6 +13,8 @@
src="/src/static/image/chatSettings/pointer.png" src="/src/static/image/chatSettings/pointer.png"
/> />
<tm-switch <tm-switch
:width="88"
:height="48"
v-if="item.customInfo && item.customInfo === 'switch'" v-if="item.customInfo && item.customInfo === 'switch'"
barIcon="" barIcon=""
color="#46299D" color="#46299D"

View File

@ -143,15 +143,27 @@ import recordSearchTypeIcon_link from '@/static/image/chatSettings/recordSearchT
import ZPaging from '@/uni_modules/z-paging/components/z-paging/z-paging.vue' import ZPaging from '@/uni_modules/z-paging/components/z-paging/z-paging.vue'
import settingFormItem from './components/settingFormItem.vue' import settingFormItem from './components/settingFormItem.vue'
import { computed, onMounted, reactive } from 'vue' import { computed, onMounted, reactive } from 'vue'
import { onLoad } from '@dcloudio/uni-app'
import { ServeQueryGroupInfo } from '@/api/chatSettings/index'
import { useI18n } from 'vue-i18n' import { useI18n } from 'vue-i18n'
const { t } = useI18n() const { t } = useI18n()
onLoad((options) => {
if (options.groupId) {
console.log(options.groupId)
state.groupId = Number(options.groupId)
getGroupInfo()
}
})
const state = reactive({ const state = reactive({
chatGroupMembers: [], // chatGroupMembers: [], //
chatGroupInfos: [], // chatGroupInfos: [], //
recordSearchTypeList: [], // recordSearchTypeList: [], //
chatSettings: [], // chatSettings: [], //
chatManagement: [], // chatManagement: [], //
groupId: '', //id
groupInfo: null, //
}) })
onMounted(() => { onMounted(() => {
@ -176,7 +188,7 @@ onMounted(() => {
{ {
label: t('chat.settings.groupName'), label: t('chat.settings.groupName'),
hasPointer: true, hasPointer: true,
value: '泰丰国际', value: groupName,
subValue: '', subValue: '',
customInfo: '', customInfo: '',
}, },
@ -258,7 +270,7 @@ const groupAvatar = computed(() => {
// //
const groupName = computed(() => { const groupName = computed(() => {
return '泰丰国际' return state?.groupInfo?.group_name
}) })
// //
@ -270,6 +282,24 @@ const groupNum = computed(() => {
const groupType = computed(() => { const groupType = computed(() => {
return '公司' return '公司'
}) })
//
const getGroupInfo = () => {
let params = {
group_id: state.groupId,
}
const resp = ServeQueryGroupInfo(params)
console.log(resp)
resp.then(({ code, data }) => {
console.log(data)
if (code == 200) {
state.groupInfo = data
} else {
}
})
resp.catch(() => {})
}
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.outer-layer { .outer-layer {

View File

@ -683,7 +683,7 @@ const initData = async () => {
// //
const toChatSettingsPage = () => { const toChatSettingsPage = () => {
uni.navigateTo({ uni.navigateTo({
url: '/pages/chatSettings/index' url: '/pages/chatSettings/index?groupId=' + talkParams?.receiver_id
}) })
} }