同步数据
This commit is contained in:
@@ -491,6 +491,13 @@
|
|||||||
"navigationBarTitleText": "选择联系人"
|
"navigationBarTitleText": "选择联系人"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"path": "pages/im/group/reviewed",
|
||||||
|
"name": "imGroupInvite",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "群聊邀请确认"
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"path": "pages/im/group/users",
|
"path": "pages/im/group/users",
|
||||||
"name": "imGroupUsers",
|
"name": "imGroupUsers",
|
||||||
|
|||||||
@@ -1,24 +1,16 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="apply" v-if="loaded">
|
<view class="apply" v-if="loaded">
|
||||||
<u-avatar :src="group.cover || require('@/static/user/cover.png')" size="128" shape="square" />
|
<u-avatar :src="group.cover || require('@/static/user/cover.png')" size="128" shape="square" />
|
||||||
<view class="name">
|
<view class="name"> {{ group.name }} </view>
|
||||||
{{ group.name }}
|
<u-button class="apply-btn" v-if="group.can_join" @click="modalShow = true" text="申请加群" :disabled="disabled" color="#34CE98" />
|
||||||
</view>
|
|
||||||
|
|
||||||
<u-button class="apply-btn" v-if="group.can_join" @click="applyGroup" text="申请加群" :disabled="disabled"
|
|
||||||
color="#34CE98" />
|
|
||||||
<view class="" v-else>
|
<view class="" v-else>
|
||||||
<view class="" v-if="group.is_full">群已满员</view>
|
<view class="" v-if="group.is_full">群已满员</view>
|
||||||
<view class="" v-if="group.deny_apply">禁止申请</view>
|
<view class="" v-if="group.deny_apply">禁止申请</view>
|
||||||
<u-button class="apply-btn2" v-if="group.state === 'accepted'" color="#34CE98" text="进入群聊"
|
<u-button class="apply-btn2" v-if="group.state === 'accepted'" color="#34CE98" text="进入群聊" @click="toGroupChat" />
|
||||||
@click="toGroupChat" />
|
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<u-modal negativeTop="300" :show="modalShow" title="申请原因" showCancelButton @cancel="onHideModal"
|
<u-modal negativeTop="300" :show="modalShow" title="申请原因" showCancelButton @cancel="onHideModal" @confirm="onJoinGroup">
|
||||||
@confirm="onJoinGroup">
|
<view class="slot-content"> <u--input placeholder="申请原因" border="surround" focus v-model="message" /> </view>
|
||||||
<view class="slot-content">
|
|
||||||
<u--input placeholder="申请原因" border="surround" focus v-model="message" />
|
|
||||||
</view>
|
|
||||||
</u-modal>
|
</u-modal>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
@@ -45,6 +37,7 @@
|
|||||||
this.targetId = e.targetId
|
this.targetId = e.targetId
|
||||||
// this.targetId = "TG2"
|
// this.targetId = "TG2"
|
||||||
joinGroupPre(this.targetId).then(res => {
|
joinGroupPre(this.targetId).then(res => {
|
||||||
|
console.log(res, 'res.返回群的基本信息')
|
||||||
this.group = res
|
this.group = res
|
||||||
this.loaded = true
|
this.loaded = true
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
@@ -62,9 +55,6 @@
|
|||||||
url: '/pages/im/group/chat?targetId=' + this.targetId
|
url: '/pages/im/group/chat?targetId=' + this.targetId
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
applyGroup() {
|
|
||||||
this.modalShow = true
|
|
||||||
},
|
|
||||||
onHideModal() {
|
onHideModal() {
|
||||||
this.message = ''
|
this.message = ''
|
||||||
this.modalShow = false
|
this.modalShow = false
|
||||||
@@ -118,6 +108,7 @@
|
|||||||
width: 80%;
|
width: 80%;
|
||||||
font-size: $title-size;
|
font-size: $title-size;
|
||||||
}
|
}
|
||||||
|
|
||||||
.apply-btn2 {
|
.apply-btn2 {
|
||||||
padding: 0 100rpx;
|
padding: 0 100rpx;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
<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" 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>
|
||||||
@@ -105,6 +106,7 @@
|
|||||||
methods: {
|
methods: {
|
||||||
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
|
||||||
@@ -150,6 +152,12 @@
|
|||||||
showGroupQrCode() {
|
showGroupQrCode() {
|
||||||
this.qrCodeShow = true
|
this.qrCodeShow = true
|
||||||
},
|
},
|
||||||
|
// 群聊邀请待确认
|
||||||
|
showGroupsSure(){
|
||||||
|
uni.navigateTo({
|
||||||
|
url:"/pages/im/group/reviewed"
|
||||||
|
})
|
||||||
|
},
|
||||||
onGroupName() {
|
onGroupName() {
|
||||||
this.modalShow = true
|
this.modalShow = true
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -2,22 +2,24 @@
|
|||||||
<view>
|
<view>
|
||||||
<u-index-list :index-list="indexs" inactiveColor="#666" activeColor="#34CE98">
|
<u-index-list :index-list="indexs" inactiveColor="#666" activeColor="#34CE98">
|
||||||
<view class="search">
|
<view class="search">
|
||||||
<u--input class="search-input" placeholder="搜索" border="none" prefixIcon="search" v-model="searchTxt" :disabled="friends.length>0" disabledColor="#Fff"
|
<u--input class="search-input" placeholder="搜索" border="none" prefixIcon="search" v-model="searchTxt"
|
||||||
prefixIconStyle="font-size: 22px;color: #909399" />
|
disabledColor="#Fff" prefixIconStyle="font-size: 22px;color: #909399" />
|
||||||
</view>
|
</view>
|
||||||
<block v-if="friends.length > 0">
|
<block v-if="friends.length > 0">
|
||||||
|
<u-checkbox-group v-model="checkboxValue" placement="column" @change="checkboxChange">
|
||||||
<u-index-item v-for="(item, fkey) in friends" :key="fkey">
|
<u-index-item v-for="(item, fkey) in friends" :key="fkey">
|
||||||
<u-index-anchor :text="indexs[fkey]" bgColor="#ededed" height="20" size="12" color="#666"
|
<u-index-anchor :text="indexs[fkey]" bgColor="#ededed" height="20" size="12" color="#666"
|
||||||
style="padding:10rpx 30rpx" />
|
style="padding:10rpx 30rpx" />
|
||||||
<view v-for="(friendItem, index) in item" :key="index" class="friend-flex"
|
<view v-for="(friendItem, index) in item" :key="index" class="friend-flex"
|
||||||
@click="toFriend(friendItem.targetId)">
|
@click="selectFriend(friendItem.targetId)">
|
||||||
<u-avatar class="avatar-img" size="40" shape="square"
|
<u-checkbox :customStyle="{marginBottom: '8px'}" :name="friendItem.targetId" />
|
||||||
:src="contact(friendItem.targetId).portraitUrl" />
|
<u-avatar class="avatar-img" size="40" shape="square" :src="contact(friendItem.targetId).portraitUrl" />
|
||||||
<view class="info">
|
<view class="info">
|
||||||
<view class="name">{{ contact(friendItem.targetId).name }}</view>
|
<view class="name">{{ contact(friendItem.targetId).name }}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</u-index-item>
|
</u-index-item>
|
||||||
|
</u-checkbox-group>
|
||||||
</block>
|
</block>
|
||||||
<view class="no-lists" v-else>
|
<view class="no-lists" v-else>
|
||||||
<u-image class="cover" radius="4" width="400rpx" height="400rpx"
|
<u-image class="cover" radius="4" width="400rpx" height="400rpx"
|
||||||
@@ -41,7 +43,8 @@
|
|||||||
indexs: [],
|
indexs: [],
|
||||||
friends: [],
|
friends: [],
|
||||||
pendingCount: 0,
|
pendingCount: 0,
|
||||||
searchTxt: ''
|
searchTxt: '',
|
||||||
|
checkboxValue: [],
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@@ -57,56 +60,33 @@
|
|||||||
uni.$on('onContactNotification', this.checkNewFriendPending)
|
uni.$on('onContactNotification', this.checkNewFriendPending)
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
// group事件
|
||||||
|
checkboxChange(n) {
|
||||||
|
console.log('change', n);
|
||||||
|
},
|
||||||
getFriendList() {
|
getFriendList() {
|
||||||
getFriendsLetter().then(res => {
|
getFriendsLetter().then(res => {
|
||||||
|
console.log(res)
|
||||||
this.indexs = res.indexList
|
this.indexs = res.indexList
|
||||||
this.friends = res.itemArr
|
this.friends = res.itemArr
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
checkNewFriendPending() {
|
|
||||||
// 获取是否有新的好友申请
|
selectFriend(targetId) {
|
||||||
RongIMLib.getConversationList([RongIMLib.ConversationType.SYSTEM], 1000, 0, (res) => {
|
console.log(targetId,typeof targetId)
|
||||||
if (res.code === 0) {
|
let arr = this.checkboxValue
|
||||||
this.pendingCount = res.conversations.filter((item) => {
|
let index = arr.findIndex(item => item === targetId)
|
||||||
return item.objectName == RongIMLib.ObjectName.ContactNotification
|
if(index>0){
|
||||||
}).length
|
console.log('选择了再次点击清除数据le')
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
toGroup() {
|
|
||||||
uni.navigateTo({
|
|
||||||
url: '/pages/im/group/index',
|
|
||||||
fail(err) {
|
|
||||||
console.log(err);
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
toFriend(targetId) {
|
|
||||||
// uni.navigateTo({
|
|
||||||
// url: '/pages/im/friends/info?targetId=' + targetId
|
|
||||||
// })
|
|
||||||
console.log('奥克兰打开')
|
|
||||||
},
|
|
||||||
// 新朋友
|
|
||||||
toPending() {
|
|
||||||
if (this.pendingCount > 0) {
|
|
||||||
uni.navigateTo({
|
|
||||||
url: '/pages/im/friends/pending'
|
|
||||||
});
|
|
||||||
}else{
|
}else{
|
||||||
uni.showToast({
|
console.log('没有选择过,添加数据')
|
||||||
title: ` 暂无好友申请 ~ `,
|
|
||||||
icon: "none",
|
|
||||||
mask: true,
|
|
||||||
duration: 3000
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
console.log(this.checkboxValue,index)
|
||||||
|
console.log('奥克兰打开',targetId)
|
||||||
},
|
},
|
||||||
onNavigationBarButtonTap(e) {
|
|
||||||
uni.navigateTo({
|
|
||||||
url: '/pages/im/friends/search'
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
47
pages/im/group/reviewed.vue
Normal file
47
pages/im/group/reviewed.vue
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
<!-- 群聊邀请确认列表页面 -->
|
||||||
|
<template>
|
||||||
|
<view class="reviewed">
|
||||||
|
<view class="reviewed-item">
|
||||||
|
<u-icon name="plus-people-fill" color="#fff" class="add-icon" />
|
||||||
|
{{`' 艾米的猫儿洛基 '想邀请 1位朋友加入群聊`}}
|
||||||
|
<view class="sure"> 去确认 </view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
indexs: [],
|
||||||
|
};
|
||||||
|
},
|
||||||
|
|
||||||
|
onLoad() {
|
||||||
|
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.reviewed{
|
||||||
|
.reviewed-item{
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
box-sizing: border-box;
|
||||||
|
|
||||||
|
.add-icon{
|
||||||
|
background-color: $main-color;
|
||||||
|
padding: 10rpx;
|
||||||
|
border-radius: 6rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
</style>
|
||||||
Reference in New Issue
Block a user