邀请好友
This commit is contained in:
@@ -5,9 +5,11 @@
|
||||
</view>
|
||||
|
||||
<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" 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-switch slot="value" size="20" v-model="isTop" activeColor="#34CE98" @change="setTop" />
|
||||
</u-cell>
|
||||
@@ -17,11 +19,13 @@
|
||||
</u-cell-group>
|
||||
|
||||
<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-avatar slot="value" size="25" shape="square" :src="group.cover" />
|
||||
</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>
|
||||
|
||||
<view class="cells actions" v-if="loaded">
|
||||
@@ -30,7 +34,8 @@
|
||||
<view class="action u-border-bottom" v-else @click="onQuite">删除并退出</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">
|
||||
<u--input placeholder="群名称" border="surround" focus v-model="groupName" />
|
||||
</view>
|
||||
@@ -42,7 +47,8 @@
|
||||
</view>
|
||||
</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>
|
||||
</template>
|
||||
|
||||
@@ -84,10 +90,15 @@
|
||||
onLoad(e) {
|
||||
this.targetId = e.targetId
|
||||
this.qrContent += e.targetId
|
||||
RongIMLib.getConversationNotificationStatus(this.conversationType, this.targetId, ({status}) => {
|
||||
RongIMLib.getConversationNotificationStatus(this.conversationType, this.targetId, ({
|
||||
status
|
||||
}) => {
|
||||
this.status = !Boolean(status)
|
||||
})
|
||||
RongIMLib.getConversation(this.conversationType, this.targetId, ({code,conversation}) => {
|
||||
RongIMLib.getConversation(this.conversationType, this.targetId, ({
|
||||
code,
|
||||
conversation
|
||||
}) => {
|
||||
if (code == 0) {
|
||||
this.isTop = conversation.isTop
|
||||
}
|
||||
@@ -105,7 +116,6 @@
|
||||
},
|
||||
initData() {
|
||||
getGroupInfo(this.targetId).then(res => {
|
||||
console.log(res,'群信息。。。。。')
|
||||
this.group = res.group
|
||||
this.groupName = res.group.name
|
||||
this.announcement = res.announcement
|
||||
@@ -154,7 +164,7 @@
|
||||
// 群聊邀请待确认
|
||||
showGroupsSure() {
|
||||
uni.navigateTo({
|
||||
url:"/pages/im/group/reviewed?id="+this.targetId
|
||||
url: "/pages/im/group/reviewed?targetId=" + this.targetId
|
||||
})
|
||||
},
|
||||
onGroupName() {
|
||||
@@ -347,5 +357,4 @@
|
||||
.u-border-bottom {
|
||||
border-bottom: solid 1rpx #f9f9f9 !important;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
@@ -1,35 +1,64 @@
|
||||
<!-- 群聊邀请确认列表页面 -->
|
||||
<template>
|
||||
<view class="reviewed">
|
||||
<view class="reviewed-item">
|
||||
<u-avatar class="avatar" src="require('@/static/user/cover.png')" shape="square" size="36" />
|
||||
<view style="flex:1;">
|
||||
<view class="nickname"><span>{{`艾米的猫儿 `}}</span>想邀请<span>{{` 用户8066`}}</span>加入群聊</view>
|
||||
<view> 申请原因:{{`呵呵哒。。`}}</view>
|
||||
<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 class="sure" @click="sure(2)"> 通过 </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 {
|
||||
lists: [],
|
||||
targetId: '',
|
||||
pendings: [],
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
|
||||
sure(id) {
|
||||
console.log(id, '....')
|
||||
uni.navigateTo({
|
||||
url: "/pages/im/group/reviewedInfo?id=" + id
|
||||
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) {
|
||||
// 直接调用通过或拒绝的接口
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -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>
|
||||
@@ -60,8 +60,7 @@ const getPendingList = (callback, total) => {
|
||||
|
||||
// 群组申请列表,邀请列表
|
||||
const getGroupPendinglist = (targetId, callback) => {
|
||||
total = total || 100
|
||||
RongIMLib.getConversationList([RongIMLib.ConversationType.SYSTEM], total, 0, (res) => {
|
||||
RongIMLib.getConversationList([RongIMLib.ConversationType.SYSTEM], 100, 0, (res) => {
|
||||
if (res.code === 0) {
|
||||
const pendings = res.conversations.filter((item) => {
|
||||
return item.targetId == targetId &&
|
||||
|
||||
Reference in New Issue
Block a user