merge
This commit is contained in:
@@ -323,6 +323,7 @@ export {
|
|||||||
dismissGroup,
|
dismissGroup,
|
||||||
inviteGroupUser,
|
inviteGroupUser,
|
||||||
removeGroupUser,
|
removeGroupUser,
|
||||||
|
transferGroupOwner,
|
||||||
setGroupAdmin,
|
setGroupAdmin,
|
||||||
removeGroupAdmin,
|
removeGroupAdmin,
|
||||||
groupMakeSure, // 通过审核
|
groupMakeSure, // 通过审核
|
||||||
|
|||||||
@@ -2,8 +2,8 @@
|
|||||||
"name" : "ZH-HEALTH",
|
"name" : "ZH-HEALTH",
|
||||||
"appid" : "__UNI__C29473D",
|
"appid" : "__UNI__C29473D",
|
||||||
"description" : "ZH-HEALTH,您手上的健康管理专家",
|
"description" : "ZH-HEALTH,您手上的健康管理专家",
|
||||||
"versionName" : "1.0.15",
|
"versionName" : "1.0.16",
|
||||||
"versionCode" : 113,
|
"versionCode" : 100,
|
||||||
"transformPx" : false,
|
"transformPx" : false,
|
||||||
/* 5+App特有相关 */
|
/* 5+App特有相关 */
|
||||||
"app-plus" : {
|
"app-plus" : {
|
||||||
|
|||||||
@@ -21,8 +21,12 @@
|
|||||||
<script>
|
<script>
|
||||||
import messagePreview from './messagePreview'
|
import messagePreview from './messagePreview'
|
||||||
import utils from '@/utils/index.js'
|
import utils from '@/utils/index.js'
|
||||||
|
import imBase from '../../mixins/imBase.js'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
mixins: [
|
||||||
|
imBase
|
||||||
|
],
|
||||||
props: {
|
props: {
|
||||||
item: {
|
item: {
|
||||||
type: Object,
|
type: Object,
|
||||||
@@ -31,21 +35,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
avatarRpx: 84
|
|
||||||
}
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
avatarSize() {
|
|
||||||
return utils.rpx2px(this.avatarRpx)
|
|
||||||
},
|
|
||||||
contact() {
|
|
||||||
return function(targetId) {
|
|
||||||
return this.$store.getters.contactInfo(targetId)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
components: {
|
components: {
|
||||||
messagePreview
|
messagePreview
|
||||||
}
|
}
|
||||||
@@ -1,23 +1,24 @@
|
|||||||
<template>
|
<template>
|
||||||
<view>
|
<view>
|
||||||
<view v-for="(item, index) in conversations" :key="index" :class="['message', { 'is-top': item.isTop, 'is-active': pickedItem.targetId == item.targetId }]"
|
<view class="shade" @click="hidePop" @touchmove="hidePop" v-show="showPop">
|
||||||
:data-item="item" @longpress="onLongPress" @click="toDetail(item)">
|
|
||||||
<message-cell :item="item" />
|
|
||||||
</view>
|
|
||||||
<view class="shade" @click="hidePop" v-show="showPop">
|
|
||||||
<view class="pop" :style="popStyle" :class="{'show':showPop}">
|
<view class="pop" :style="popStyle" :class="{'show':showPop}">
|
||||||
<view v-for="(item, index) in popButton" :key="index" @click="pickerMenu" :data-index="index">
|
<view v-for="(item, index) in popButton" :key="index" @click="pickerMenu" :data-index="index">
|
||||||
{{item}}
|
{{item}}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<view v-for="(item, index) in conversations" :key="index"
|
||||||
|
:class="['message', { 'is-top': item.isTop, 'is-active': pickedItem.targetId == item.targetId }]"
|
||||||
|
:data-item="item" @longpress="onLongPress" @click="toDetail(item)">
|
||||||
|
<message-cell :item="item" />
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import * as RongIMLib from '@/uni_modules/RongCloud-IMWrapper/js_sdk/index'
|
import * as RongIMLib from '@/uni_modules/RongCloud-IMWrapper/js_sdk/index'
|
||||||
import im from '@/utils/im/index.js'
|
import im from '@/utils/im/index.js'
|
||||||
import messageCell from './messageCell'
|
import messageCell from './conversation/messageCell'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
props: {
|
props: {
|
||||||
@@ -142,6 +143,7 @@
|
|||||||
position: fixed;
|
position: fixed;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
z-index: 999;
|
||||||
|
|
||||||
.pop {
|
.pop {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="apply--cell">
|
<view class="apply--cell">
|
||||||
<view class="avatar">
|
<view class="avatar">
|
||||||
<u-avatar :src="user.portraitUrl || require('@/static/user/cover.png')" shape="square" size="46" />
|
<u-avatar :src="user.portraitUrl || require('@/static/user/cover.png')" shape="square" :size="avatarSize" />
|
||||||
</view>
|
</view>
|
||||||
<view class="info">
|
<view class="info">
|
||||||
<view class="name"> {{ user.name }}</view>
|
<view class="name"> {{ user.name }}</view>
|
||||||
@@ -20,8 +20,12 @@
|
|||||||
resolveFriend,
|
resolveFriend,
|
||||||
rejectFriend
|
rejectFriend
|
||||||
} from '@/apis/interfaces/im.js'
|
} from '@/apis/interfaces/im.js'
|
||||||
|
import imBase from '../mixins/imBase.js'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
mixins: [
|
||||||
|
imBase
|
||||||
|
],
|
||||||
props: {
|
props: {
|
||||||
message: {
|
message: {
|
||||||
type: Object,
|
type: Object,
|
||||||
@@ -36,7 +40,6 @@
|
|||||||
methods: {
|
methods: {
|
||||||
resolve() {
|
resolve() {
|
||||||
resolveFriend(this.message.sourceUserId).then(res => {
|
resolveFriend(this.message.sourceUserId).then(res => {
|
||||||
this.clearMessages()
|
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
title: '通过好友申请'
|
title: '通过好友申请'
|
||||||
@@ -47,6 +50,8 @@
|
|||||||
icon: 'none',
|
icon: 'none',
|
||||||
title: err.message
|
title: err.message
|
||||||
})
|
})
|
||||||
|
}).finally(() => {
|
||||||
|
this.clearMessages()
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
reject() {
|
reject() {
|
||||||
@@ -70,9 +75,9 @@
|
|||||||
clearMessages() {
|
clearMessages() {
|
||||||
RongIMLib.deleteMessages(RongIMLib.ConversationType.SYSTEM, this.message.sourceUserId)
|
RongIMLib.deleteMessages(RongIMLib.ConversationType.SYSTEM, this.message.sourceUserId)
|
||||||
this.$emit('success')
|
this.$emit('success')
|
||||||
uni.$emit('onNewContactConversation', message)
|
uni.$emit('onNewContactConversation')
|
||||||
uni.$emit('onNewContactFriends', message)
|
uni.$emit('onNewContactFriends')
|
||||||
uni.$emit('onNewContactPendings', message)
|
uni.$emit('onNewContactPendings')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<block v-for="(item, index) in lists" v-if="lists.length > 0" :key="index">
|
<block v-for="(item, index) in lists" v-if="lists.length > 0" :key="index">
|
||||||
<view class="lists">
|
<view class="lists">
|
||||||
<view class="" style="width: 100rpx;height: 100rpx;">
|
<view class="" style="width: 100rpx;height: 100rpx;">
|
||||||
<u-avatar :src="JSON.parse(item.latestMessage.extra).portraitUrl" shape="square" size="44" />
|
<u-avatar :src="JSON.parse(item.latestMessage.extra).portraitUrl" shape="square" :size="avatarSize" />
|
||||||
</view>
|
</view>
|
||||||
<view class="right">
|
<view class="right">
|
||||||
<view class="title">
|
<view class="title">
|
||||||
@@ -14,7 +14,8 @@
|
|||||||
<span v-if="isAgree" @click="action('agree', item)">通过</span>
|
<span v-if="isAgree" @click="action('agree', item)">通过</span>
|
||||||
<span v-if="isAgree" @click="action('reject', item)">拒绝</span>
|
<span v-if="isAgree" @click="action('reject', item)">拒绝</span>
|
||||||
<span v-if="isApply && !item.is_friend" @click="action('apply', item)">查看</span>
|
<span v-if="isApply && !item.is_friend" @click="action('apply', item)">查看</span>
|
||||||
<span class="isFri" v-if="isApply && item.is_friend" @click="action('isFriend', item)">已是好友</span>
|
<span class="isFri" v-if="isApply && item.is_friend"
|
||||||
|
@click="action('isFriend', item)">已是好友</span>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -23,7 +24,12 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import imBase from '../mixins/imBase.js'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
mixins:[
|
||||||
|
imBase
|
||||||
|
],
|
||||||
name: 'friend-apply-reject-agree',
|
name: 'friend-apply-reject-agree',
|
||||||
props: {
|
props: {
|
||||||
lists: {
|
lists: {
|
||||||
@@ -50,9 +56,16 @@ export default {
|
|||||||
action(type, item) {
|
action(type, item) {
|
||||||
if (type === 'isFriend') {
|
if (type === 'isFriend') {
|
||||||
// ,后期可以跳转到信息介绍页面,先留在这里
|
// ,后期可以跳转到信息介绍页面,先留在这里
|
||||||
return uni.showToast({ title: '已是好友,无需重复添加', icon: 'none', duration:2000});
|
return uni.showToast({
|
||||||
|
title: '已是好友,无需重复添加',
|
||||||
|
icon: 'none',
|
||||||
|
duration: 2000
|
||||||
|
});
|
||||||
}
|
}
|
||||||
this.$emit('action', { type, item });
|
this.$emit('action', {
|
||||||
|
type,
|
||||||
|
item
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -72,6 +85,7 @@ export default {
|
|||||||
.cover {
|
.cover {
|
||||||
background-color: #ffffff;
|
background-color: #ffffff;
|
||||||
}
|
}
|
||||||
|
|
||||||
.right {
|
.right {
|
||||||
width: 570rpx;
|
width: 570rpx;
|
||||||
margin-left: $margin - 10;
|
margin-left: $margin - 10;
|
||||||
@@ -81,8 +95,10 @@ export default {
|
|||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
padding: $padding 0;
|
padding: $padding 0;
|
||||||
border-bottom: solid 1rpx #f9f9f9;
|
border-bottom: solid 1rpx #f9f9f9;
|
||||||
|
|
||||||
.title {
|
.title {
|
||||||
width: 370rpx;
|
width: 370rpx;
|
||||||
|
|
||||||
.name {
|
.name {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
color: $text-color;
|
color: $text-color;
|
||||||
@@ -91,6 +107,7 @@ export default {
|
|||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
.des {
|
.des {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
flex: 1;
|
flex: 1;
|
||||||
@@ -102,20 +119,24 @@ export default {
|
|||||||
color: $text-gray-m;
|
color: $text-gray-m;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.agress-btn {
|
.agress-btn {
|
||||||
display: flex;
|
display: flex;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
font-size: $title-size-m;
|
font-size: $title-size-m;
|
||||||
|
|
||||||
span {
|
span {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
padding: 6rpx 14rpx;
|
padding: 6rpx 14rpx;
|
||||||
background-color: $text-price;
|
background-color: $text-price;
|
||||||
border-radius: 10rpx;
|
border-radius: 10rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
span:nth-child(1) {
|
span:nth-child(1) {
|
||||||
background-color: $main-color;
|
background-color: $main-color;
|
||||||
margin-right: 10rpx;
|
margin-right: 10rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.isFri {
|
.isFri {
|
||||||
background-color: #f9f9f9 !important;
|
background-color: #f9f9f9 !important;
|
||||||
color: #666;
|
color: #666;
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<block v-for="(item, index) in lists" v-if="lists.length > 0" :key="index">
|
<block v-for="(item, index) in lists" v-if="lists.length > 0" :key="index">
|
||||||
<view class="lists">
|
<view class="lists">
|
||||||
<view class="" style="width: 100rpx;height: 100rpx;">
|
<view class="" style="width: 100rpx;height: 100rpx;">
|
||||||
<u-avatar :src="item.portraitUrl || require('@/static/user/cover.png')" shape="square" size="44" />
|
<u-avatar :src="item.portraitUrl || require('@/static/user/cover.png')" shape="square" :size="avatarSize" />
|
||||||
</view>
|
</view>
|
||||||
<view class="right">
|
<view class="right">
|
||||||
<view class="title">
|
<view class="title">
|
||||||
@@ -21,7 +21,12 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import imBase from '../mixins/imBase.js'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
mixins: [
|
||||||
|
imBase
|
||||||
|
],
|
||||||
name: 'friend-apply-reject-agree',
|
name: 'friend-apply-reject-agree',
|
||||||
props: {
|
props: {
|
||||||
lists: {
|
lists: {
|
||||||
|
|||||||
@@ -38,8 +38,12 @@
|
|||||||
transferGroupOwner
|
transferGroupOwner
|
||||||
} from '@/apis/interfaces/im.js'
|
} from '@/apis/interfaces/im.js'
|
||||||
import utils from '@/utils/index.js'
|
import utils from '@/utils/index.js'
|
||||||
|
import imBase from '../mixins/imBase.js'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
mixins: [
|
||||||
|
imBase
|
||||||
|
],
|
||||||
props: {
|
props: {
|
||||||
targetId: {
|
targetId: {
|
||||||
type: String,
|
type: String,
|
||||||
@@ -67,13 +71,6 @@
|
|||||||
iconSize: 14
|
iconSize: 14
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
|
||||||
contact() {
|
|
||||||
return function(targetId) {
|
|
||||||
return this.$store.getters.contactInfo(targetId)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
created() {
|
created() {
|
||||||
this.avatarSize = utils.rpx2px(84)
|
this.avatarSize = utils.rpx2px(84)
|
||||||
this.labelSize = utils.rpx2px(24)
|
this.labelSize = utils.rpx2px(24)
|
||||||
|
|||||||
@@ -33,9 +33,12 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import im from '@/utils/im/index.js'
|
import im from '@/utils/im/index.js'
|
||||||
import * as CallLib from '@/uni_modules/RongCloud-CallWrapper/lib/index'
|
import imBase from '../../mixins/imBase.js'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
mixins: [
|
||||||
|
imBase
|
||||||
|
],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
callActions: [{
|
callActions: [{
|
||||||
@@ -64,15 +67,11 @@
|
|||||||
default: ''
|
default: ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
|
||||||
sender() {
|
|
||||||
return this.$store.getters.sender
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
methods: {
|
||||||
singleCall(e) {
|
singleCall(e) {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pages/im/private/call?targetId=' + this.targetId + '&mediaType=' + e.type + '&isCall=true'
|
url: '/pages/im/private/call?targetId=' + this.targetId + '&mediaType=' + e.type +
|
||||||
|
'&isCall=true'
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
onPopupsItem(type) {
|
onPopupsItem(type) {
|
||||||
@@ -144,6 +143,7 @@
|
|||||||
display: flex;
|
display: flex;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
|
|
||||||
.item {
|
.item {
|
||||||
width: 150rpx;
|
width: 150rpx;
|
||||||
margin: 15rpx;
|
margin: 15rpx;
|
||||||
@@ -8,8 +8,12 @@
|
|||||||
<script>
|
<script>
|
||||||
import im from '@/utils/im/index.js'
|
import im from '@/utils/im/index.js'
|
||||||
import * as RongIMLib from '@/uni_modules/RongCloud-IMWrapper/js_sdk/index'
|
import * as RongIMLib from '@/uni_modules/RongCloud-IMWrapper/js_sdk/index'
|
||||||
|
import imBase from '../../mixins/imBase.js'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
mixins: [
|
||||||
|
imBase
|
||||||
|
],
|
||||||
props: {
|
props: {
|
||||||
conversationType: {
|
conversationType: {
|
||||||
type: Number,
|
type: Number,
|
||||||
@@ -23,9 +27,6 @@
|
|||||||
computed: {
|
computed: {
|
||||||
disabled() {
|
disabled() {
|
||||||
return this.inputTxt.length === 0
|
return this.inputTxt.length === 0
|
||||||
},
|
|
||||||
sender() {
|
|
||||||
return this.$store.getters.sender
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
@@ -20,8 +20,12 @@
|
|||||||
<script>
|
<script>
|
||||||
import im from '@/utils/im/index.js'
|
import im from '@/utils/im/index.js'
|
||||||
import permision from '@/utils/permission.js'
|
import permision from '@/utils/permission.js'
|
||||||
|
import imBase from '../../mixins/imBase.js'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
mixins: [
|
||||||
|
imBase
|
||||||
|
],
|
||||||
props: {
|
props: {
|
||||||
conversationType: {
|
conversationType: {
|
||||||
type: Number,
|
type: Number,
|
||||||
@@ -169,6 +173,7 @@
|
|||||||
width: 500rpx;
|
width: 500rpx;
|
||||||
border-radius: 10rpx;
|
border-radius: 10rpx;
|
||||||
margin-right: 15rpx;
|
margin-right: 15rpx;
|
||||||
|
|
||||||
.button {
|
.button {
|
||||||
font-size: 30rpx;
|
font-size: 30rpx;
|
||||||
color: #333;
|
color: #333;
|
||||||
@@ -219,6 +224,7 @@
|
|||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
|
||||||
.icon {
|
.icon {
|
||||||
width: 88rpx;
|
width: 88rpx;
|
||||||
height: 88rpx;
|
height: 88rpx;
|
||||||
@@ -16,9 +16,9 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import sentText from './sentText'
|
import sentText from './sent/sentText'
|
||||||
import sentVoice from './sentVoice'
|
import sentVoice from './sent/sentVoice'
|
||||||
import sentPopups from './sentPopups'
|
import sentPopups from './sent/sentPopups'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
props: {
|
props: {
|
||||||
|
|||||||
@@ -11,8 +11,12 @@
|
|||||||
<script>
|
<script>
|
||||||
import utils from '@/utils/index.js'
|
import utils from '@/utils/index.js'
|
||||||
import moment from 'moment'
|
import moment from 'moment'
|
||||||
|
import imBase from '../../mixins/imBase.js'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
mixins: [
|
||||||
|
imBase
|
||||||
|
],
|
||||||
name: 'showText',
|
name: 'showText',
|
||||||
props: {
|
props: {
|
||||||
message: {
|
message: {
|
||||||
@@ -38,11 +42,6 @@
|
|||||||
isRemote() {
|
isRemote() {
|
||||||
return this.message.messageDirection == 2
|
return this.message.messageDirection == 2
|
||||||
},
|
},
|
||||||
contact() {
|
|
||||||
return function(targetId) {
|
|
||||||
return this.$store.getters.contactInfo(targetId)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
duration() {
|
duration() {
|
||||||
if (this.message.duration > 3600) {
|
if (this.message.duration > 3600) {
|
||||||
return moment.utc(this.message.duration * 1000).format('HH:mm:ss')
|
return moment.utc(this.message.duration * 1000).format('HH:mm:ss')
|
||||||
|
|||||||
@@ -14,8 +14,12 @@
|
|||||||
<script>
|
<script>
|
||||||
import * as RongIMLib from '@/uni_modules/RongCloud-IMWrapper/js_sdk/index'
|
import * as RongIMLib from '@/uni_modules/RongCloud-IMWrapper/js_sdk/index'
|
||||||
import messageState from './messageState'
|
import messageState from './messageState'
|
||||||
|
import imBase from '../../mixins/imBase.js'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
mixins: [
|
||||||
|
imBase
|
||||||
|
],
|
||||||
name: 'showImage',
|
name: 'showImage',
|
||||||
props: {
|
props: {
|
||||||
message: {
|
message: {
|
||||||
@@ -38,11 +42,6 @@
|
|||||||
},
|
},
|
||||||
content() {
|
content() {
|
||||||
return this.message.content
|
return this.message.content
|
||||||
},
|
|
||||||
contact() {
|
|
||||||
return function(targetId) {
|
|
||||||
return this.$store.getters.contactInfo(targetId)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@@ -57,10 +56,10 @@
|
|||||||
if (this.content.local && this.content.local.indexOf('///data/user/') < 0) {
|
if (this.content.local && this.content.local.indexOf('///data/user/') < 0) {
|
||||||
this.showImage(this.content.local)
|
this.showImage(this.content.local)
|
||||||
} else {
|
} else {
|
||||||
|
this.showImage(this.content.remote)
|
||||||
RongIMLib.downloadMediaMessage(this.message.messageId, {
|
RongIMLib.downloadMediaMessage(this.message.messageId, {
|
||||||
success: (path) => {
|
success: (path) => {
|
||||||
this.content.local = path
|
this.content.local = path
|
||||||
this.showImage(path)
|
|
||||||
},
|
},
|
||||||
error: (errorCode, messageId) => {
|
error: (errorCode, messageId) => {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
|
|||||||
@@ -11,9 +11,13 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import messageState from './messageState'
|
import messageState from './messageState'
|
||||||
|
import imBase from '../../mixins/imBase.js'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'showText',
|
name: 'showText',
|
||||||
|
mixins: [
|
||||||
|
imBase,
|
||||||
|
],
|
||||||
props: {
|
props: {
|
||||||
message: {
|
message: {
|
||||||
type: Object,
|
type: Object,
|
||||||
@@ -35,11 +39,6 @@
|
|||||||
},
|
},
|
||||||
content() {
|
content() {
|
||||||
return this.message.content.content
|
return this.message.content.content
|
||||||
},
|
|
||||||
contact() {
|
|
||||||
return function(targetId) {
|
|
||||||
return this.$store.getters.contactInfo(targetId)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -58,7 +57,7 @@
|
|||||||
.text {
|
.text {
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
max-width: 502rpx;
|
max-width: 502rpx;
|
||||||
padding: 20rpx;
|
padding: 20rpx 24rpx;
|
||||||
line-height: 46rpx;
|
line-height: 46rpx;
|
||||||
font-size: 32rpx;
|
font-size: 32rpx;
|
||||||
color: $text-color;
|
color: $text-color;
|
||||||
|
|||||||
@@ -23,8 +23,12 @@
|
|||||||
<script>
|
<script>
|
||||||
import * as RongIMLib from '@/uni_modules/RongCloud-IMWrapper/js_sdk/index'
|
import * as RongIMLib from '@/uni_modules/RongCloud-IMWrapper/js_sdk/index'
|
||||||
import messageState from './messageState'
|
import messageState from './messageState'
|
||||||
|
import imBase from '../../mixins/imBase.js'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
mixins: [
|
||||||
|
imBase
|
||||||
|
],
|
||||||
props: {
|
props: {
|
||||||
message: {
|
message: {
|
||||||
type: Object,
|
type: Object,
|
||||||
@@ -54,11 +58,6 @@
|
|||||||
isRemote() {
|
isRemote() {
|
||||||
return this.message.messageDirection == 2
|
return this.message.messageDirection == 2
|
||||||
},
|
},
|
||||||
contact() {
|
|
||||||
return function(targetId) {
|
|
||||||
return this.$store.getters.contactInfo(targetId)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
width() {
|
width() {
|
||||||
if (this.duration > 3) {
|
if (this.duration > 3) {
|
||||||
return (this.duration * 5) + 150
|
return (this.duration * 5) + 150
|
||||||
|
|||||||
@@ -2,8 +2,8 @@
|
|||||||
<view class="">
|
<view class="">
|
||||||
<view class="notify" v-if="message.objectName === 'RC:GrpNtf'">
|
<view class="notify" v-if="message.objectName === 'RC:GrpNtf'">
|
||||||
{{ message.content.message }}
|
{{ message.content.message }}
|
||||||
<text class="link" @click="toAnnounce(message.content.extra)"
|
<text class="link" @click="toAnnounce(message)" v-if="message.content.operation == 'ANNOUNCEMENT'">点击查看
|
||||||
v-if="message.content.operation == 'ANNOUNCEMENT'">点击查看 </text>
|
</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="notify" v-else-if="message.objectName === 'RC:RcNtf'">
|
<view class="notify" v-else-if="message.objectName === 'RC:RcNtf'">
|
||||||
{{ contact(message.senderUserId).name }} 撤回了一条消息
|
{{ contact(message.senderUserId).name }} 撤回了一条消息
|
||||||
@@ -26,14 +26,21 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import {
|
||||||
|
getGroupAnnouncement
|
||||||
|
} from '@/apis/interfaces/im.js'
|
||||||
import * as IMLib from '@/uni_modules/RongCloud-IMWrapper/js_sdk/index'
|
import * as IMLib from '@/uni_modules/RongCloud-IMWrapper/js_sdk/index'
|
||||||
import showVoice from './show/showVoice'
|
import showVoice from './show/showVoice'
|
||||||
import showImage from './show/showImage'
|
import showImage from './show/showImage'
|
||||||
import showText from './show/showText'
|
import showText from './show/showText'
|
||||||
import showCall from './show/showCall'
|
import showCall from './show/showCall'
|
||||||
import utils from '@/utils/index.js'
|
import utils from '@/utils/index.js'
|
||||||
|
import imBase from '../mixins/imBase.js'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
mixins: [
|
||||||
|
imBase
|
||||||
|
],
|
||||||
components: {
|
components: {
|
||||||
showCall,
|
showCall,
|
||||||
showVoice,
|
showVoice,
|
||||||
@@ -52,21 +59,6 @@
|
|||||||
default: false
|
default: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
avatarRpx: 84
|
|
||||||
}
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
avatarSize() {
|
|
||||||
return utils.rpx2px(this.avatarRpx)
|
|
||||||
},
|
|
||||||
contact() {
|
|
||||||
return function(targetId) {
|
|
||||||
return this.$store.getters.contactInfo(targetId)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
methods: {
|
||||||
toUser(item) {
|
toUser(item) {
|
||||||
if (item.messageDirection == 1) {
|
if (item.messageDirection == 1) {
|
||||||
@@ -80,10 +72,25 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 跳转群公告
|
// 跳转群公告
|
||||||
toAnnounce(targetId) {
|
toAnnounce(message) {
|
||||||
if (targetId) {
|
if (message.content.extra) {
|
||||||
|
getGroupAnnouncement(message.targetId, message.content.extra).then(res => {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pages/im/group/announceCreate?targetId=' + this.targetId
|
url: '/pages/im/group/announceCreate?type=check&targetId=' + message
|
||||||
|
.targetId + '&aId=' + message.content.extra
|
||||||
|
})
|
||||||
|
}).catch(err => {
|
||||||
|
IMLib.deleteMessagesByIds([message.messageId], ({
|
||||||
|
code
|
||||||
|
}) => {
|
||||||
|
if (code === 0) {
|
||||||
|
uni.$emit('remove_message_' + message.targetId, message.messageId)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
uni.showToast({
|
||||||
|
title: '公告不存在或已删除',
|
||||||
|
icon: 'none',
|
||||||
|
})
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
@@ -137,7 +144,7 @@
|
|||||||
color: #666;
|
color: #666;
|
||||||
|
|
||||||
.link {
|
.link {
|
||||||
color: blue;
|
color: $main-color;
|
||||||
margin-left: 10rpx;
|
margin-left: 10rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,15 +12,21 @@
|
|||||||
</view>
|
</view>
|
||||||
<block v-if="friends.length > 0">
|
<block v-if="friends.length > 0">
|
||||||
<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="#f9f9f9" height="20" size="12" color="#666" class="anchor" />
|
<u-index-anchor :text="indexs[fkey]" bgColor="#f9f9f9" height="20" size="12" color="#666"
|
||||||
<view v-for="(friendItem, index) in item" :key="index" class="friend-flex" @click="toFriend(friendItem.targetId)">
|
class="anchor" />
|
||||||
<u-avatar class="avatar-img" size="40" shape="square" :src="contact(friendItem.targetId).portraitUrl" />
|
<view v-for="(friendItem, index) in item" :key="index" class="friend-flex"
|
||||||
<view class="info"> <view class="name">{{ contact(friendItem.targetId).name }}</view> </view>
|
@click="toFriend(friendItem.targetId)">
|
||||||
|
<u-avatar class="avatar-img" size="40" shape="square"
|
||||||
|
:src="contact(friendItem.targetId).portraitUrl" />
|
||||||
|
<view class="info">
|
||||||
|
<view class="name">{{ contact(friendItem.targetId).name }}</view>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</u-index-item>
|
</u-index-item>
|
||||||
</block>
|
</block>
|
||||||
<view class="no-lists" v-else>
|
<view class="no-lists" v-else>
|
||||||
<u-image class="cover" radius="4" width="400rpx" height="400rpx" :src=" require('@/static/imgs/no-friend.png')" :lazy-load="true" />
|
<u-image class="cover" radius="4" width="400rpx" height="400rpx"
|
||||||
|
:src=" require('@/static/imgs/no-friend.png')" :lazy-load="true" />
|
||||||
<span>暂无好友列表~</span>
|
<span>暂无好友列表~</span>
|
||||||
</view>
|
</view>
|
||||||
</u-index-list>
|
</u-index-list>
|
||||||
@@ -28,11 +34,17 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {getFriendsLetter} from '@/apis/interfaces/im';
|
import {
|
||||||
|
getFriendsLetter
|
||||||
|
} from '@/apis/interfaces/im';
|
||||||
import * as RongIMLib from '@/uni_modules/RongCloud-IMWrapper/js_sdk/index'
|
import * as RongIMLib from '@/uni_modules/RongCloud-IMWrapper/js_sdk/index'
|
||||||
import im from '@/utils/im/index.js'
|
import im from '@/utils/im/index.js'
|
||||||
|
import imBase from '../mixins/imBase.js'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
mixins: [
|
||||||
|
imBase
|
||||||
|
],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
indexs: [],
|
indexs: [],
|
||||||
@@ -47,18 +59,19 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
onLoad() {
|
||||||
|
uni.$on('onNewContactFriends', this.checkNewFriendPending)
|
||||||
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
this.getFriendList()
|
this.getFriendList()
|
||||||
this.checkNewFriendPending()
|
this.checkNewFriendPending()
|
||||||
uni.$on('onContactNotification', this.checkNewFriendPending)
|
|
||||||
},
|
},
|
||||||
onUnload() {
|
onUnload() {
|
||||||
uni.$off("onContactNotification")
|
uni.$off("onNewContactFriends")
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
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
|
||||||
})
|
})
|
||||||
@@ -70,10 +83,7 @@
|
|||||||
},
|
},
|
||||||
toGroup() {
|
toGroup() {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pages/im/group/index',
|
url: '/pages/im/group/index'
|
||||||
fail(err) {
|
|
||||||
console.log(err);
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
toFriend(targetId) {
|
toFriend(targetId) {
|
||||||
@@ -85,13 +95,13 @@
|
|||||||
toPending() {
|
toPending() {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pages/im/friends/pending'
|
url: '/pages/im/friends/pending'
|
||||||
});
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onNavigationBarButtonTap(e) {
|
onNavigationBarButtonTap(e) {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pages/im/friends/search'
|
url: '/pages/im/friends/search'
|
||||||
});
|
})
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
@@ -160,6 +170,7 @@
|
|||||||
line-height: 24px;
|
line-height: 24px;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
}
|
}
|
||||||
|
|
||||||
.no-lists {
|
.no-lists {
|
||||||
padding-top: $padding * 3;
|
padding-top: $padding * 3;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|||||||
@@ -23,7 +23,8 @@
|
|||||||
<script>
|
<script>
|
||||||
import {
|
import {
|
||||||
getUserInfo
|
getUserInfo
|
||||||
} from '@/apis/interfaces/im'
|
} from '@/apis/interfaces/im.js'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -8,17 +8,17 @@
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<view class="search">
|
<view class="search">
|
||||||
<!-- 搜索 、 -->
|
<!-- 搜索 -->
|
||||||
<u-sticky>
|
<u-sticky>
|
||||||
<view class="header-search">
|
<view class="header-search">
|
||||||
<u-search placeholder="输入用户账号、手机号" searchIcon="search" @custom="search" v-model="searchValue"
|
<u-search placeholder="输入用户账号、手机号" searchIcon="search" @custom="search" v-model="searchValue"
|
||||||
@search="search" bgColor="#f9f9f9" :focus="focused" />
|
@search="search" bgColor="#F3F6FB" :focus="focused" />
|
||||||
</view>
|
</view>
|
||||||
</u-sticky>
|
</u-sticky>
|
||||||
<block v-if="searchResult.length > 0">
|
<block v-if="searchResult.length > 0">
|
||||||
<applyFriend :lists="searchResult" :isApply="true" @action="action" />
|
<applyFriend :lists="searchResult" :isApply="true" @action="action" />
|
||||||
</block>
|
</block>
|
||||||
<view class="no-lists" v-else>
|
<view class="no-lists" v-if="searchResult.length === 0 && searchValue.length > 1">
|
||||||
<u-image class="cover" radius="4" width="400rpx" height="400rpx"
|
<u-image class="cover" radius="4" width="400rpx" height="400rpx"
|
||||||
:src="require('@/static/imgs/no-search.png')" :lazy-load="true" />
|
:src="require('@/static/imgs/no-search.png')" :lazy-load="true" />
|
||||||
<span>暂无匹配内容~</span>
|
<span>暂无匹配内容~</span>
|
||||||
@@ -32,6 +32,7 @@
|
|||||||
pedingFriend
|
pedingFriend
|
||||||
} from '@/apis/interfaces/im.js';
|
} from '@/apis/interfaces/im.js';
|
||||||
import applyFriend from '../components/friendSearchList.vue';
|
import applyFriend from '../components/friendSearchList.vue';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
applyFriend
|
applyFriend
|
||||||
@@ -43,6 +44,20 @@
|
|||||||
focused: true
|
focused: true
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
watch: {
|
||||||
|
searchValue(value) {
|
||||||
|
console.log(value.length, 'length...')
|
||||||
|
if (value.length > 1) {
|
||||||
|
this.searchResult = []
|
||||||
|
this.search()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if(value.length === 0){
|
||||||
|
this.searchResult = []
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
search() {
|
search() {
|
||||||
// friendship: '' 没有好友关系
|
// friendship: '' 没有好友关系
|
||||||
|
|||||||
@@ -1,13 +1,15 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="create">
|
<view class="create">
|
||||||
<view class="create-title">公告内容</view>
|
<view class="create-title">公告内容</view>
|
||||||
<block v-if="type !== 'check'">
|
|
||||||
|
<block v-if="type === 'check'">
|
||||||
|
<view class="content"> {{content}} </view>
|
||||||
|
</block>
|
||||||
|
|
||||||
|
<block v-else>
|
||||||
<u--textarea v-model="content" count height="240" maxlength="240" placeholder="请输入公告内容" />
|
<u--textarea v-model="content" count height="240" maxlength="240" placeholder="请输入公告内容" />
|
||||||
<u-button type="primary" text="发布" :disabled="disabled" @click="onCreate" color="#34CE98" />
|
<u-button type="primary" text="发布" :disabled="disabled" @click="onCreate" color="#34CE98" />
|
||||||
</block>
|
</block>
|
||||||
<block v-if="type === 'check'">
|
|
||||||
<view class="content-a"> {{content}} </view>
|
|
||||||
</block>
|
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -16,7 +18,7 @@
|
|||||||
createGroupAnnouncement,
|
createGroupAnnouncement,
|
||||||
getGroupAnnouncement
|
getGroupAnnouncement
|
||||||
} from '@/apis/interfaces/im.js'
|
} from '@/apis/interfaces/im.js'
|
||||||
import onGroupDismiss from '@/utils/im/onGroupDismiss.js'
|
import onGroupDismiss from '../mixins/onGroupDismiss.js'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
mixins: [
|
mixins: [
|
||||||
@@ -27,25 +29,31 @@
|
|||||||
targetId: '',
|
targetId: '',
|
||||||
content: '',
|
content: '',
|
||||||
aId: '',
|
aId: '',
|
||||||
type: '' // check ' 查看详情'
|
type: '' // cheack ' 查看详情'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad(e) {
|
onLoad(e) {
|
||||||
this.targetId = e.targetId
|
this.targetId = e.targetId
|
||||||
if (e.type) {
|
|
||||||
this.type = e.type
|
|
||||||
}
|
|
||||||
if (e.aId) {
|
if (e.aId) {
|
||||||
|
this.type = e.type
|
||||||
|
uni.setNavigationBarTitle({
|
||||||
|
title: '群公告'
|
||||||
|
})
|
||||||
this.aId = e.aId
|
this.aId = e.aId
|
||||||
getGroupAnnouncement(this.targetId, this.aId).then(res => {
|
getGroupAnnouncement(this.targetId, this.aId).then(res => {
|
||||||
console.log(res.content)
|
|
||||||
this.content = res.content
|
this.content = res.content
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
|
if (err.status_code == 404) {
|
||||||
|
this.$nextTick(() => {
|
||||||
|
uni.navigateBack()
|
||||||
|
})
|
||||||
|
} else {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: err.message,
|
title: err.message,
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
mask: true
|
mask: true
|
||||||
})
|
})
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -99,7 +107,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.content-a {
|
.content {
|
||||||
color: $text-color;
|
color: $text-color;
|
||||||
font-size: $title-size;
|
font-size: $title-size;
|
||||||
line-height: 1.7;
|
line-height: 1.7;
|
||||||
|
|||||||
@@ -35,10 +35,12 @@
|
|||||||
deleteGroupAnnouncement,
|
deleteGroupAnnouncement,
|
||||||
topGroupAnnouncement
|
topGroupAnnouncement
|
||||||
} from '@/apis/interfaces/im.js'
|
} from '@/apis/interfaces/im.js'
|
||||||
import onGroupDismiss from '@/utils/im/onGroupDismiss.js'
|
import onGroupDismiss from '../mixins/onGroupDismiss.js'
|
||||||
|
import imBase from '../mixins/imBase.js'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
mixins: [
|
mixins: [
|
||||||
|
imBase,
|
||||||
onGroupDismiss
|
onGroupDismiss
|
||||||
],
|
],
|
||||||
data() {
|
data() {
|
||||||
@@ -76,7 +78,7 @@
|
|||||||
onNavigationBarButtonTap() {
|
onNavigationBarButtonTap() {
|
||||||
if (this.isAdmin) {
|
if (this.isAdmin) {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pages/im/group/announceCreate?type=check&targetId=' + this.targetId
|
url: '/pages/im/group/announceCreate?targetId=' + this.targetId
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
@@ -132,14 +134,6 @@
|
|||||||
uni.$emit('updateAnnouncement')
|
uni.$emit('updateAnnouncement')
|
||||||
this.initData()
|
this.initData()
|
||||||
})
|
})
|
||||||
// uni.showModal({
|
|
||||||
// title: ' 置顶该公告',
|
|
||||||
// success: (res) => {
|
|
||||||
// if (res.confirm) {
|
|
||||||
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// })
|
|
||||||
},
|
},
|
||||||
// 删除公告
|
// 删除公告
|
||||||
onDelete(aId) {
|
onDelete(aId) {
|
||||||
@@ -152,14 +146,6 @@
|
|||||||
uni.$emit('updateAnnouncement')
|
uni.$emit('updateAnnouncement')
|
||||||
this.initData()
|
this.initData()
|
||||||
})
|
})
|
||||||
// uni.showModal({
|
|
||||||
// title: '删除该公告',
|
|
||||||
// success: (res) => {
|
|
||||||
// if (res.confirm) {
|
|
||||||
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// })
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -198,7 +184,8 @@
|
|||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
font-size: $title-size-m;
|
font-size: $title-size-m;
|
||||||
color: $text-gray-m;
|
color: $text-gray-m;
|
||||||
padding: 10rpx;
|
padding: 20rpx 10rpx 10rpx 10rpx;
|
||||||
|
border-top: solid 1rpx #F9F9F9;
|
||||||
|
|
||||||
.name {
|
.name {
|
||||||
padding-left: 10rpx;
|
padding-left: 10rpx;
|
||||||
@@ -219,8 +206,6 @@
|
|||||||
-webkit-line-clamp: 3;
|
-webkit-line-clamp: 3;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
line-height: 1.5;
|
line-height: 1.5;
|
||||||
border-bottom: solid 1rpx #F9F9F9;
|
|
||||||
padding-bottom: 20rpx;
|
|
||||||
|
|
||||||
span {
|
span {
|
||||||
color: #fff;
|
color: #fff;
|
||||||
|
|||||||
@@ -20,10 +20,12 @@
|
|||||||
joinGroupPre,
|
joinGroupPre,
|
||||||
joinGroup
|
joinGroup
|
||||||
} from '@/apis/interfaces/im.js'
|
} from '@/apis/interfaces/im.js'
|
||||||
import onGroupDismiss from '@/utils/im/onGroupDismiss.js'
|
import onGroupDismiss from '../mixins/onGroupDismiss.js'
|
||||||
|
import imBase from '../mixins/imBase.js'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
mixins: [
|
mixins: [
|
||||||
|
imBase,
|
||||||
onGroupDismiss
|
onGroupDismiss
|
||||||
],
|
],
|
||||||
data() {
|
data() {
|
||||||
|
|||||||
@@ -21,10 +21,12 @@
|
|||||||
import sentMessageBar from '../components/sentMessageBar'
|
import sentMessageBar from '../components/sentMessageBar'
|
||||||
import showMessageCell from '../components/showMessageCell'
|
import showMessageCell from '../components/showMessageCell'
|
||||||
import utils from '@/utils/index.js'
|
import utils from '@/utils/index.js'
|
||||||
import onGroupDismiss from '@/utils/im/onGroupDismiss.js'
|
import onGroupDismiss from '../mixins/onGroupDismiss.js'
|
||||||
|
import imBase from '../mixins/imBase.js'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
mixins: [
|
mixins: [
|
||||||
|
imBase,
|
||||||
onGroupDismiss
|
onGroupDismiss
|
||||||
],
|
],
|
||||||
components: {
|
components: {
|
||||||
@@ -87,22 +89,24 @@
|
|||||||
})
|
})
|
||||||
// 清理聊天记录
|
// 清理聊天记录
|
||||||
uni.$once('cleanGroupMessage', this.getMessageList)
|
uni.$once('cleanGroupMessage', this.getMessageList)
|
||||||
uni.$on('onRecallMessage', (res) => {
|
uni.$on('onRecallMessage_' + this.targetId, (message) => {
|
||||||
if (res.targetId == this.targetId) {
|
|
||||||
this.messages = this.messages.map(item => {
|
this.messages = this.messages.map(item => {
|
||||||
if (res.messageId == item.messageId) {
|
if (message.messageId == item.messageId) {
|
||||||
return res
|
return message
|
||||||
} else {
|
} else {
|
||||||
return item
|
return item
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
})
|
||||||
|
uni.$on('remove_message_' + this.targetId, (messageId) => {
|
||||||
|
this.messages = this.messages.filter(item => item.messageId != messageId)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
onUnload() {
|
onUnload() {
|
||||||
|
uni.$off('remove_message_' + this.targetId)
|
||||||
uni.$off('onReceiveMessage_' + this.targetId)
|
uni.$off('onReceiveMessage_' + this.targetId)
|
||||||
uni.$off('onUpdateProfile_' + this.targetId)
|
uni.$off('onUpdateProfile_' + this.targetId)
|
||||||
uni.$off('onRecallMessage')
|
uni.$off('onRecallMessage_' + this.targetId)
|
||||||
uni.$off('onReceiptRequest')
|
uni.$off('onReceiptRequest')
|
||||||
uni.$off('onReceiptResponse')
|
uni.$off('onReceiptResponse')
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<block v-if="groups.length > 0">
|
<block v-if="groups.length > 0">
|
||||||
<view class="title"> 群聊 </view>
|
<view class="title"> 群聊 </view>
|
||||||
<view v-for="(item, index) in groups" :key="index" class="friend-flex" @click="toGroup(item.targetId)">
|
<view v-for="(item, index) in groups" :key="index" class="friend-flex" @click="toGroup(item.targetId)">
|
||||||
<u-avatar size="36" shape="square" :src="item.portraitUrl !== ''?contact(item.targetId).portraitUrl :require('@/static/user/cover-s.png')" />
|
<u-avatar size="36" shape="square" :src="contact(item.targetId).portraitUrl" />
|
||||||
<view class="info">
|
<view class="info">
|
||||||
<view class="name">{{ item.name }} <span class="total">共{{ item.members }} 成员</span></view>
|
<view class="name">{{ item.name }} <span class="total">共{{ item.members }} 成员</span></view>
|
||||||
</view>
|
</view>
|
||||||
|
|||||||
@@ -21,9 +21,9 @@
|
|||||||
<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"
|
<u-cell :border="false" class="u-border-bottom" isLink title="修改群聊名称" :value="groupName"
|
||||||
@click="onGroupName" />
|
@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>
|
||||||
|
|
||||||
@@ -57,13 +57,15 @@
|
|||||||
} from '@/apis/interfaces/uploading'
|
} from '@/apis/interfaces/uploading'
|
||||||
import * as RongIMLib from '@/uni_modules/RongCloud-IMWrapper/js_sdk/index'
|
import * as RongIMLib from '@/uni_modules/RongCloud-IMWrapper/js_sdk/index'
|
||||||
import groupUserList from '../components/groupUserList'
|
import groupUserList from '../components/groupUserList'
|
||||||
import onGroupDismiss from '@/utils/im/onGroupDismiss.js'
|
import onGroupDismiss from '../mixins/onGroupDismiss.js'
|
||||||
|
import imBase from '../mixins/imBase.js'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
groupUserList
|
groupUserList
|
||||||
},
|
},
|
||||||
mixins: [
|
mixins: [
|
||||||
|
imBase,
|
||||||
onGroupDismiss
|
onGroupDismiss
|
||||||
],
|
],
|
||||||
data() {
|
data() {
|
||||||
|
|||||||
@@ -45,11 +45,13 @@
|
|||||||
getGroupUsers
|
getGroupUsers
|
||||||
} from '@/apis/interfaces/im';
|
} from '@/apis/interfaces/im';
|
||||||
import utils from '@/utils/index.js'
|
import utils from '@/utils/index.js'
|
||||||
import onGroupDismiss from '@/utils/im/onGroupDismiss.js'
|
import onGroupDismiss from '../mixins/onGroupDismiss.js'
|
||||||
import * as RongIMLib from '@/uni_modules/RongCloud-IMWrapper/js_sdk/index'
|
import * as RongIMLib from '@/uni_modules/RongCloud-IMWrapper/js_sdk/index'
|
||||||
|
import imBase from '../mixins/imBase.js'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
mixins: [
|
mixins: [
|
||||||
|
imBase,
|
||||||
onGroupDismiss
|
onGroupDismiss
|
||||||
],
|
],
|
||||||
data() {
|
data() {
|
||||||
@@ -64,13 +66,6 @@
|
|||||||
selectValue: []
|
selectValue: []
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
|
||||||
contact() {
|
|
||||||
return function(targetId) {
|
|
||||||
return this.$store.getters.contactInfo(targetId)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
onLoad(e) {
|
onLoad(e) {
|
||||||
this.targetId = e.targetId
|
this.targetId = e.targetId
|
||||||
this.getFriendList()
|
this.getFriendList()
|
||||||
|
|||||||
@@ -34,10 +34,12 @@
|
|||||||
} from "@/apis/interfaces/im.js"
|
} from "@/apis/interfaces/im.js"
|
||||||
import im from '@/utils/im/message.js'
|
import im from '@/utils/im/message.js'
|
||||||
import * as RongIMLib from '@/uni_modules/RongCloud-IMWrapper/js_sdk/index'
|
import * as RongIMLib from '@/uni_modules/RongCloud-IMWrapper/js_sdk/index'
|
||||||
import onGroupDismiss from '@/utils/im/onGroupDismiss.js'
|
import onGroupDismiss from '../mixins/onGroupDismiss.js'
|
||||||
|
import imBase from '../mixins/imBase.js'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
mixins: [
|
mixins: [
|
||||||
|
imBase,
|
||||||
onGroupDismiss
|
onGroupDismiss
|
||||||
],
|
],
|
||||||
data() {
|
data() {
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import groupUserList from '../components/groupUserList'
|
import groupUserList from '../components/groupUserList'
|
||||||
import onGroupDismiss from '@/utils/im/onGroupDismiss.js'
|
import onGroupDismiss from '../mixins/onGroupDismiss.js'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
mixins: [
|
mixins: [
|
||||||
|
|||||||
@@ -46,7 +46,8 @@
|
|||||||
return {
|
return {
|
||||||
conversations: [], // 会话列表
|
conversations: [], // 会话列表
|
||||||
connection: 0,
|
connection: 0,
|
||||||
hasNewFriends: 0
|
hasNewFriends: 0,
|
||||||
|
perPage: 200
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
@@ -54,12 +55,17 @@
|
|||||||
connectionStatus
|
connectionStatus
|
||||||
},
|
},
|
||||||
onLoad() {
|
onLoad() {
|
||||||
// 好友申请数量
|
|
||||||
this.checkNewFriendPending()
|
|
||||||
// 监听新的好友申请
|
// 监听新的好友申请
|
||||||
uni.$on('onNewContactConversation', this.checkNewFriendPending)
|
uni.$on('onNewContactConversation', () => {
|
||||||
|
console.log('更新好友申请数量');
|
||||||
|
// 更新好友申请数量
|
||||||
|
this.checkNewFriendPending()
|
||||||
|
})
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
|
// 好友申请数量
|
||||||
|
this.checkNewFriendPending()
|
||||||
|
|
||||||
if (this.$store.state.token !== '') {
|
if (this.$store.state.token !== '') {
|
||||||
this.getConversationList()
|
this.getConversationList()
|
||||||
}
|
}
|
||||||
@@ -76,7 +82,6 @@
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
onHide() {
|
onHide() {
|
||||||
// 页面隐藏的时候,不监听了,性能可能会好一点
|
|
||||||
uni.$off('onReceiveMessage')
|
uni.$off('onReceiveMessage')
|
||||||
uni.$off('onConnectionStatusChange')
|
uni.$off('onConnectionStatusChange')
|
||||||
},
|
},
|
||||||
@@ -95,11 +100,9 @@
|
|||||||
}
|
}
|
||||||
return true
|
return true
|
||||||
},
|
},
|
||||||
// 获取私聊的会话列表
|
// 获取会话列表,最新的一千条
|
||||||
getConversationList() {
|
getConversationList() {
|
||||||
const count = 1000
|
RongIMLib.getConversationList([1, 3], this.perPage, 0, ({
|
||||||
const timestamp = 0
|
|
||||||
RongIMLib.getConversationList([1, 3], count, timestamp, ({
|
|
||||||
code,
|
code,
|
||||||
conversations
|
conversations
|
||||||
}) => {
|
}) => {
|
||||||
|
|||||||
17
pages/im/mixins/imBase.js
Normal file
17
pages/im/mixins/imBase.js
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
import utils from '@/utils/index.js'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
computed: {
|
||||||
|
contact() {
|
||||||
|
return function(targetId) {
|
||||||
|
return this.$store.getters.contactInfo(targetId)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
avatarSize() {
|
||||||
|
return utils.rpx2px(84)
|
||||||
|
},
|
||||||
|
sender() {
|
||||||
|
return this.$store.getters.sender
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
// 监听群解散的消息,直接跳转到会话列表页面
|
// 监听群解散的消息,直接跳转到会话列表页面
|
||||||
const onGroupDismiss = {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
currentTargetId: ''
|
currentTargetId: ''
|
||||||
@@ -32,5 +32,3 @@ const onGroupDismiss = {
|
|||||||
uni.$off('onGroupRemoveYou_' + this.currentTargetId)
|
uni.$off('onGroupRemoveYou_' + this.currentTargetId)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default onGroupDismiss
|
|
||||||
@@ -18,8 +18,12 @@
|
|||||||
import sentMessageBar from '../components/sentMessageBar'
|
import sentMessageBar from '../components/sentMessageBar'
|
||||||
import showMessageCell from '../components/showMessageCell'
|
import showMessageCell from '../components/showMessageCell'
|
||||||
import utils from '@/utils/index.js'
|
import utils from '@/utils/index.js'
|
||||||
|
import imBase from '../mixins/imBase.js'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
mixins: [
|
||||||
|
imBase
|
||||||
|
],
|
||||||
components: {
|
components: {
|
||||||
sentMessageBar,
|
sentMessageBar,
|
||||||
showMessageCell
|
showMessageCell
|
||||||
@@ -45,11 +49,6 @@
|
|||||||
sentTime: 0
|
sentTime: 0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
|
||||||
contact() {
|
|
||||||
return function(targetId) {
|
|
||||||
return this.$store.getters.contactInfo(targetId)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad(e) {
|
onLoad(e) {
|
||||||
@@ -76,20 +75,19 @@
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
uni.$on('onRecallMessage', (res) => {
|
uni.$on('onRecallMessage_' + this.targetId, (message) => {
|
||||||
if (res.targetId == this.targetId) {
|
|
||||||
this.messages = this.messages.map(item => {
|
this.messages = this.messages.map(item => {
|
||||||
if (res.messageId == item.messageId) {
|
if (message.messageId == item.messageId) {
|
||||||
return res
|
return message
|
||||||
} else {
|
} else {
|
||||||
return item
|
return item
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
onUnload() {
|
onUnload() {
|
||||||
uni.$off('onReceiveMessage_' + this.targetId)
|
uni.$off('onReceiveMessage_' + this.targetId)
|
||||||
|
uni.$off('onRecallMessage_' + this.targetId)
|
||||||
uni.$off('onRecallMessage')
|
uni.$off('onRecallMessage')
|
||||||
uni.$off('onReadReceiptReceived')
|
uni.$off('onReadReceiptReceived')
|
||||||
},
|
},
|
||||||
|
|||||||
BIN
static/.DS_Store
vendored
BIN
static/.DS_Store
vendored
Binary file not shown.
@@ -55,8 +55,7 @@ const notifyMsgTypes = [
|
|||||||
IMLib.ObjectName.Location,
|
IMLib.ObjectName.Location,
|
||||||
IMLib.ObjectName.Voice,
|
IMLib.ObjectName.Voice,
|
||||||
IMLib.ObjectName.HQVoice,
|
IMLib.ObjectName.HQVoice,
|
||||||
IMLib.ObjectName.Sight,
|
IMLib.ObjectName.Sight
|
||||||
IMLib.ObjectName.GroupNotification
|
|
||||||
]
|
]
|
||||||
|
|
||||||
const imLibListeners = () => {
|
const imLibListeners = () => {
|
||||||
@@ -68,7 +67,7 @@ const imLibListeners = () => {
|
|||||||
// 添加消息监听函数
|
// 添加消息监听函数
|
||||||
IMLib.addReceiveMessageListener((res) => {
|
IMLib.addReceiveMessageListener((res) => {
|
||||||
const message = res.data.message
|
const message = res.data.message
|
||||||
console.error('[收到消息]', message)
|
console.error('[收到消息]',IMLib.ObjectName.GroupNotification, message)
|
||||||
checkContactExists(message)
|
checkContactExists(message)
|
||||||
if (utils.inArray(message.objectName, notifyMsgTypes)) {
|
if (utils.inArray(message.objectName, notifyMsgTypes)) {
|
||||||
onReceiveMessage(message)
|
onReceiveMessage(message)
|
||||||
@@ -84,6 +83,7 @@ const imLibListeners = () => {
|
|||||||
uni.$emit('onNewContactFriends', message)
|
uni.$emit('onNewContactFriends', message)
|
||||||
uni.$emit('onNewContactPendings', message)
|
uni.$emit('onNewContactPendings', message)
|
||||||
} else if (message.objectName === IMLib.ObjectName.GroupNotification) {
|
} else if (message.objectName === IMLib.ObjectName.GroupNotification) {
|
||||||
|
console.log('踢出用户',message);
|
||||||
// 解散群
|
// 解散群
|
||||||
if (message.content.operation === 'Dismiss') {
|
if (message.content.operation === 'Dismiss') {
|
||||||
IMLib.cleanHistoryMessages(message.conversationType, message.targetId, message.sentTime,
|
IMLib.cleanHistoryMessages(message.conversationType, message.targetId, message.sentTime,
|
||||||
@@ -94,6 +94,7 @@ const imLibListeners = () => {
|
|||||||
uni.$emit('onGroupDismiss')
|
uni.$emit('onGroupDismiss')
|
||||||
uni.$emit('onGroupDismiss_' + message.targetId)
|
uni.$emit('onGroupDismiss_' + message.targetId)
|
||||||
} else if (message.content.operation === 'REMOVE') {
|
} else if (message.content.operation === 'REMOVE') {
|
||||||
|
console.log('踢出', message.content);
|
||||||
// 要判断是否当前用户,然后把当前用户踢出到主页去, 删除聊天记录,会话列表
|
// 要判断是否当前用户,然后把当前用户踢出到主页去, 删除聊天记录,会话列表
|
||||||
if (message.content.extra == store.getters.sender.userId) {
|
if (message.content.extra == store.getters.sender.userId) {
|
||||||
IMLib.cleanHistoryMessages(message.conversationType, message.targetId, message.sentTime,
|
IMLib.cleanHistoryMessages(message.conversationType, message.targetId, message.sentTime,
|
||||||
@@ -119,10 +120,16 @@ const imLibListeners = () => {
|
|||||||
uni.$emit('onReadReceiptReceived', data)
|
uni.$emit('onReadReceiptReceived', data)
|
||||||
})
|
})
|
||||||
// 监听消息撤回操作
|
// 监听消息撤回操作
|
||||||
IMLib.addRecallMessageListener((res) => {
|
IMLib.addRecallMessageListener(({
|
||||||
IMLib.getMessage(res.data.messageId, (res) => {
|
data
|
||||||
console.error("消息撤回: ", res.message);
|
}) => {
|
||||||
uni.$emit('onRecallMessage', res.message)
|
IMLib.getMessage(data.messageId, ({
|
||||||
|
message
|
||||||
|
}) => {
|
||||||
|
console.error("消息撤回: ", message);
|
||||||
|
im.setNotifyBadge()
|
||||||
|
uni.$emit('onReceiveMessage', message)
|
||||||
|
uni.$emit('onRecallMessage_' + message.targetId, message)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
// 监听需要群聊消息回执
|
// 监听需要群聊消息回执
|
||||||
|
|||||||
Reference in New Issue
Block a user