This commit is contained in:
Z
2022-02-21 14:04:07 +08:00
3 changed files with 130 additions and 75 deletions

View File

@@ -4,10 +4,12 @@
<group-user-list ref="userList" :targetId="targetId" :count="14" /> <group-user-list ref="userList" :targetId="targetId" :count="14" />
</view> </view>
<u-cell-group class="cells" :border="false" > <u-cell-group class="cells" :border="false">
<u-cell :border="false" class="u-border-bottom" isLink title="群公告" :label="announcement" @click="toAnnouncement" /> <u-cell :border="false" class="u-border-bottom" isLink title="群公告" :label="announcement"
@click="toAnnouncement" />
<u-cell :border="false" class="u-border-bottom" isLink title="二维码" @click="showGroupQrCode" /> <u-cell :border="false" class="u-border-bottom" isLink title="二维码" @click="showGroupQrCode" />
<u-cell :border="false" class="u-border-bottom" v-if="group.can_makesure" isLink title="群聊邀请确认" @click="showGroupsSure" /> <u-cell :border="false" class="u-border-bottom" v-if="group.can_makesure" isLink title="群聊邀请确认"
@click="showGroupsSure" />
<u-cell :border="false" class="u-border-bottom" title="聊天置顶"> <u-cell :border="false" class="u-border-bottom" title="聊天置顶">
<u-switch slot="value" size="20" v-model="isTop" activeColor="#34CE98" @change="setTop" /> <u-switch slot="value" size="20" v-model="isTop" activeColor="#34CE98" @change="setTop" />
</u-cell> </u-cell>
@@ -17,11 +19,13 @@
</u-cell-group> </u-cell-group>
<u-cell-group class="cells" v-if="group.is_admin" :border="false"> <u-cell-group class="cells" v-if="group.is_admin" :border="false">
<u-cell :border="false" class="u-border-bottom" isLink title="修改群聊名称" :value="groupName" @click="onGroupName" /> <u-cell :border="false" class="u-border-bottom" isLink title="修改群聊名称" :value="groupName"
@click="onGroupName" />
<u-cell :border="false" class="u-border-bottom" isLink title="修改群头像" @click="onGroupAvatar"> <u-cell :border="false" class="u-border-bottom" isLink title="修改群头像" @click="onGroupAvatar">
<u-avatar slot="value" size="25" shape="square" :src="group.cover" /> <u-avatar slot="value" size="25" shape="square" :src="group.cover" />
</u-cell> </u-cell>
<u-cell :border="false" class="u-border-bottom" isLink v-if="group.is_owner" title="准入方式" :value="joinType" @click="onChangeJoinType" /> <u-cell :border="false" class="u-border-bottom" isLink v-if="group.is_owner" title="准入方式" :value="joinType"
@click="onChangeJoinType" />
</u-cell-group> </u-cell-group>
<view class="cells actions" v-if="loaded"> <view class="cells actions" v-if="loaded">
@@ -30,7 +34,8 @@
<view class="action u-border-bottom" v-else @click="onQuite">删除并退出</view> <view class="action u-border-bottom" v-else @click="onQuite">删除并退出</view>
</view> </view>
<u-modal negativeTop="300" :show="modalShow" title="修改群名称" showCancelButton @cancel="onHideModal" @confirm="onChangeGroupName"> <u-modal negativeTop="300" :show="modalShow" title="修改群名称" showCancelButton @cancel="onHideModal"
@confirm="onChangeGroupName">
<view class="slot-content"> <view class="slot-content">
<u--input placeholder="群名称" border="surround" focus v-model="groupName" /> <u--input placeholder="群名称" border="surround" focus v-model="groupName" />
</view> </view>
@@ -42,7 +47,8 @@
</view> </view>
</u-modal> </u-modal>
<u-action-sheet @select="doAction" :actions="joinTypeMap" cancelText="取消" :show="showActions" @close="showActions=false" /> <u-action-sheet @select="doAction" :actions="joinTypeMap" cancelText="取消" :show="showActions"
@close="showActions=false" />
</view> </view>
</template> </template>
@@ -84,10 +90,15 @@
onLoad(e) { onLoad(e) {
this.targetId = e.targetId this.targetId = e.targetId
this.qrContent += e.targetId this.qrContent += e.targetId
RongIMLib.getConversationNotificationStatus(this.conversationType, this.targetId, ({status}) => { RongIMLib.getConversationNotificationStatus(this.conversationType, this.targetId, ({
status
}) => {
this.status = !Boolean(status) this.status = !Boolean(status)
}) })
RongIMLib.getConversation(this.conversationType, this.targetId, ({code,conversation}) => { RongIMLib.getConversation(this.conversationType, this.targetId, ({
code,
conversation
}) => {
if (code == 0) { if (code == 0) {
this.isTop = conversation.isTop this.isTop = conversation.isTop
} }
@@ -105,7 +116,6 @@
}, },
initData() { initData() {
getGroupInfo(this.targetId).then(res => { getGroupInfo(this.targetId).then(res => {
console.log(res,'群信息。。。。。')
this.group = res.group this.group = res.group
this.groupName = res.group.name this.groupName = res.group.name
this.announcement = res.announcement this.announcement = res.announcement
@@ -152,9 +162,9 @@
this.qrCodeShow = true this.qrCodeShow = true
}, },
// 群聊邀请待确认 // 群聊邀请待确认
showGroupsSure(){ showGroupsSure() {
uni.navigateTo({ uni.navigateTo({
url:"/pages/im/group/reviewed?id="+this.targetId url: "/pages/im/group/reviewed?targetId=" + this.targetId
}) })
}, },
onGroupName() { onGroupName() {
@@ -347,5 +357,4 @@
.u-border-bottom { .u-border-bottom {
border-bottom: solid 1rpx #f9f9f9 !important; border-bottom: solid 1rpx #f9f9f9 !important;
} }
</style> </style>

View File

@@ -1,5 +1,112 @@
<!-- 群聊邀请确认列表页面 --> <!-- 群聊邀请确认列表页面 -->
<template> <template>
<<<<<<< HEAD
<view class="reviewed">
<view class="reviewed-item" v-for="(item, index) in pendings" :key="index">
<u-avatar class="avatar" :src="JSON.parse(item.latestMessage.extra).portraitUrl" shape="square" size="36" />
<view style="flex:1;" v-if="item.latestMessage.operation == 'GroupPending'">
<view class="nickname">用户: {{ JSON.parse(item.latestMessage.extra).name }} 申请加入群聊</view>
<view> 申请原因{{ item.latestMessage.message }}</view>
</view>
<view style="flex:1;" v-if="item.latestMessage.operation == 'GroupInvite'">
<view class="nickname">
<text>{{ contact(item.latestMessage.sourceUserId )}}</text>想邀请<span>{{ JSON.parse(item.latestMessage.extra).name }}</span>加入群聊
</view>
</view>
<view class="sure" @click="sure(item.latestMessage.targetUserId)"> 通过 </view>
</view>
</view>
</template>
<!--
[{
"latestMessage": {
"operation": "GroupPending", // GroupPending 申请加群 GroupInvite 邀请进群
"message": "null", 申请的消息
"sourceUserId": "10047", 邀请人
申请人的简要信息
"extra": "{\"name\":\"JasonChen\",\"portraitUrl\":\"http:\\/\\/storage.zh.shangkelian.cn\\/uploads\\/2022\\/02\\/17\\/2b3cb44bc8335b25ac3dc762ef810bad.jpg\"}",
"targetUserId": "10051", 被邀请人或者是申请人
"objectName": "RC:ContactNtf"
},
}]
-->
<script>
import {
getGroupMakeSure,
getGroupMakeSureAllow
} from "@/apis/interfaces/im.js"
import im from '@/utils/im/message.js'
export default {
data() {
return {
targetId: '',
pendings: [],
};
},
computed: {
contact() {
return function(targetId) {
return this.$store.getters.contactInfo(targetId)
}
}
},
onLoad(e) {
this.targetId = e.targetId
im.getGroupPendinglist(this.targetId, (result) => {
this.pendings = result
})
},
methods: {
sure(targetUserId) {
// 直接调用通过或拒绝的接口
}
}
};
</script>
<style lang="scss" scoped>
.reviewed {
.reviewed-item {
margin: $padding - 10;
display: flex;
flex-direction: row;
align-items: flex-start;
justify-content: flex-start;
box-sizing: border-box;
border-bottom: solid 1rpx #f9f9f9;
font-size: $title-size-m - 2;
padding-bottom: 20rpx;
color: $text-gray-m;
.avatar {
background-color: $main-color;
border-radius: 6rpx;
margin-right: 20rpx;
}
.nickname {
font-size: $title-size-m;
span {
color: $text-color;
font-size: $title-size-m +1;
}
}
.sure {
background-color: $main-color;
color: #Fff;
text-align: center;
font-size: $title-size-m;
padding: 6rpx 20rpx;
border-radius: 10rpx;
margin-left: 10rpx;
}
}
}
=======
<view class="reviewed"> <view class="reviewed">
<view class="reviewed-item"> <view class="reviewed-item">
<u-avatar class="avatar" src="require('@/static/user/cover.png')" shape="square" size="36" /> <u-avatar class="avatar" src="require('@/static/user/cover.png')" shape="square" size="36" />
@@ -82,4 +189,5 @@
} }
} }
>>>>>>> e99ef72050d54c27a6fe46e8063bb57fc903fac4
</style> </style>

View File

@@ -1,62 +0,0 @@
<!-- 群聊邀请确认列表页面 -->
<template>
<view class="reviewed">
确认信息页面
</view>
</template>
<script>
export default {
data() {
return {
lists: [],
};
},
onLoad() {
},
methods: {
sure(id) {
uni.navigateTo({
url:"/pages/im/group/reviewedInfo?id="+id
})
}
}
};
</script>
<style lang="scss" scoped>
.reviewed {
.reviewed-item {
margin: $padding;
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-start;
box-sizing: border-box;
border-bottom: solid 1rpx #f9f9f9;
font-size: $title-size-m;
padding-bottom: 20rpx;
color: $text-gray;
.add-icon {
background-color: $main-color;
padding: 10rpx;
border-radius: 6rpx;
margin-right: 20rpx;
}
.sure {
// width: 140rpx;
// background-color: $main-color;
color: $main-color;
text-align: center;
font-size: $title-size-m;
padding: 6rpx 20rpx;
border-radius: 10rpx;
}
}
}
</style>