接入查询群信息接口
This commit is contained in:
parent
3824ab7638
commit
0db50f2216
11
src/api/chatSettings/index.js
Normal file
11
src/api/chatSettings/index.js
Normal 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,
|
||||||
|
})
|
||||||
|
}
|
@ -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"
|
||||||
|
@ -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 {
|
||||||
|
@ -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
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user