音视频呼叫优化

This commit is contained in:
2022-02-21 09:30:00 +08:00
parent 4f7096a9c4
commit ce954c5dcc
6 changed files with 35 additions and 17 deletions

View File

@@ -5,7 +5,7 @@
import im from '@/utils/im/index.js' import im from '@/utils/im/index.js'
export default { export default {
onLaunch: function() { onLaunch: function() {
im.initIm('lmxuhwaglu76d') im.initIm('lmxuhwaglu76d')
return return
//#ifdef APP-PLUS //#ifdef APP-PLUS
@@ -29,7 +29,7 @@
uni.downloadFile({ uni.downloadFile({
url: res.info.download, url: res.info.download,
success: apkPick => { success: apkPick => {
plus.runtime.install(apkPick plus.runtime.install(apkPick
.tempFilePath, '', .tempFilePath, '',
installRES => { installRES => {
// 安装完成用于提示新版本引导,暂时无用 // 安装完成用于提示新版本引导,暂时无用

View File

@@ -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.10", "versionName" : "1.0.11",
"versionCode" : 110, "versionCode" : 111,
"transformPx" : false, "transformPx" : false,
/* 5+App */ /* 5+App */
"app-plus" : { "app-plus" : {
@@ -24,7 +24,9 @@
"SQLite" : {}, "SQLite" : {},
"VideoPlayer" : {}, "VideoPlayer" : {},
"Geolocation" : {}, "Geolocation" : {},
"Fingerprint" : {} "Fingerprint" : {},
"Maps" : {},
"Push" : {}
}, },
/* */ /* */
"distribute" : { "distribute" : {
@@ -80,7 +82,9 @@
} }
}, },
"ad" : {}, "ad" : {},
"push" : {}, "push" : {
"unipush" : {}
},
"geolocation" : { "geolocation" : {
"amap" : { "amap" : {
"__platform__" : [ "android" ], "__platform__" : [ "android" ],
@@ -90,6 +94,12 @@
"system" : { "system" : {
"__platform__" : [ "android" ] "__platform__" : [ "android" ]
} }
},
"maps" : {
"amap" : {
"appkey_ios" : "",
"appkey_android" : "05b7f32ca9c897c8b63c505d92cd654b"
}
} }
}, },
"icons" : { "icons" : {

View File

@@ -72,7 +72,7 @@
methods: { methods: {
singleCall(e) { singleCall(e) {
uni.navigateTo({ uni.navigateTo({
url: '/pages/im/private/call?targetId=' + this.targetId + '&mediaType=' + e.type url: '/pages/im/private/call?targetId=' + this.targetId + '&mediaType=' + e.type + '&isCall=true'
}) })
}, },
onPopupsItem(type) { onPopupsItem(type) {

View File

@@ -229,7 +229,7 @@
}, },
singleCall(e) { singleCall(e) {
uni.redirectTo({ uni.redirectTo({
url: '/pages/im/private/call?targetId=' + this.targetId + '&mediaType=' + e.type url: '/pages/im/private/call?targetId=' + this.targetId + '&mediaType=' + e.type + '&isCall=true'
}) })
} }
} }

View File

@@ -74,9 +74,10 @@
onLoad(e) { onLoad(e) {
this.targetId = e.targetId this.targetId = e.targetId
// 获取群成员数量 // 获取群成员数量
getGroupBase(this.targetId).then(res => { getGroupBase(this.targetId).then(res => {
console.log(res);
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: this.groupInfo.name + `(${res.members})` title: res.name + `(${res.members})`
}) })
}) })
// 获取历史消息列表 // 获取历史消息列表
@@ -100,9 +101,6 @@
this.$refs.messageBar.onHidePopus() this.$refs.messageBar.onHidePopus()
}, },
toUser(item) { toUser(item) {
if (item.senderUserId == '__system__') {
return
}
if (item.messageDirection == 1) { if (item.messageDirection == 1) {
uni.navigateTo({ uni.navigateTo({
url: '/pages/im/friends/mine?targetId=' + item.senderUserId url: '/pages/im/friends/mine?targetId=' + item.senderUserId

View File

@@ -31,7 +31,7 @@
</view> </view>
<text class="text">挂断</text> <text class="text">挂断</text>
</view> </view>
<view class="btn" v-if="!connected" @click="accept"> <view class="btn" v-if="!connected && this.isCall == false" @click="accept">
<view class="icon"> <view class="icon">
<u-icon name="checkmark" color="#ffffff" size="30" /> <u-icon name="checkmark" color="#ffffff" size="30" />
</view> </view>
@@ -62,14 +62,24 @@
micStatus: false, micStatus: false,
speStatus: false, speStatus: false,
remoteRinging: false, remoteRinging: false,
ring: null ring: null,
isCall: false
} }
}, },
onLoad(e) { onLoad(e) {
this.targetId = e.targetId this.targetId = e.targetId
this.mediaType = e.mediaType this.mediaType = e.mediaType
this.isCall = Boolean(e.isCall)
// 进入页面开启外呼 // 进入页面开启外呼
CallLib.startSingleCall(this.targetId, this.mediaType, ''); if (this.isCall) {
CallLib.startSingleCall(this.targetId, this.mediaType, '');
if (this.mediaType == 1) {
const session = CallLib.getCurrentCallSession()
this.$nextTick(() => {
CallLib.setVideoView(session.mine.userId, this.$refs.bigVideoView.ref, 0, false)
})
}
}
// 响铃 // 响铃
this.startRing() this.startRing()
// 监听通话链接状态 // 监听通话链接状态
@@ -227,7 +237,7 @@
align-items: center; align-items: center;
&.hangup { &.hangup {
background: $text-price; background-color: $text-price;
} }
.icon { .icon {