stash
This commit is contained in:
@@ -10,11 +10,9 @@
|
||||
|
||||
<view class="status" v-if="!connected || mediaType == 0">
|
||||
<view class="remote">
|
||||
<u-avatar v-if="userInfo.portraitUrl" :src="userInfo.portraitUrl" shape="square" size="96"
|
||||
<u-avatar :src="contact(targetId).portraitUrl" shape="square" size="96"
|
||||
bgColor="#fff" />
|
||||
<u-avatar size="80" v-if="!userInfo.portraitUrl" shape="square"
|
||||
:text="userInfo.name ? userInfo.name.substring(0,1) : '未'" font-size="44" randomBgColor />
|
||||
<view><text class="nickname">{{userInfo.name}}</text></view>
|
||||
<view><text class="nickname">{{ contact(targetId).name }}</text></view>
|
||||
<view v-if="remoteRinging"><text class="mediaType">等待对方接听</text></view>
|
||||
<view v-if="connected"><text class="mediaType">已接通</text></view>
|
||||
<view v-else><text class="mediaType">{{ mediaType == 0 ? '邀请您语音通话' : '邀请您视频通话' }}</text></view>
|
||||
@@ -52,17 +50,14 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
getFriendInfo
|
||||
} from '@/apis/interfaces/im.js'
|
||||
import * as CallLib from '@/uni_modules/RongCloud-CallWrapper/lib/index'
|
||||
import * as IMLib from '@/uni_modules/RongCloud-IMWrapper/js_sdk/index'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
targetId: '',
|
||||
mediaType: 0, // 0 语音 1 视频
|
||||
userInfo: {},
|
||||
isOut: false,
|
||||
connected: false,
|
||||
micStatus: false,
|
||||
@@ -73,10 +68,10 @@
|
||||
},
|
||||
onLoad(e) {
|
||||
this.targetId = e.targetId
|
||||
this.mediaType = e.mediaType
|
||||
getFriendInfo(this.targetId).then(res => {
|
||||
this.userInfo = res
|
||||
})
|
||||
this.mediaType = e.mediaType
|
||||
// 进入页面开启外呼
|
||||
CallLib.startSingleCall(this.targetId, this.mediaType, '');
|
||||
|
||||
this.startRing()
|
||||
// 监听通话链接状态
|
||||
uni.$once('onCallConnected', this.onCallConnected)
|
||||
@@ -87,6 +82,9 @@
|
||||
uni.$once('onRemoteUserJoined', () => {
|
||||
this.remoteRinging = false
|
||||
})
|
||||
},
|
||||
beforeDestroy() {
|
||||
|
||||
},
|
||||
computed: {
|
||||
windowWidth() {
|
||||
@@ -94,6 +92,11 @@
|
||||
},
|
||||
windowHeight() {
|
||||
return uni.getSystemInfoSync().windowHeight
|
||||
},
|
||||
contact() {
|
||||
return function(targetId) {
|
||||
return this.$store.getters.contactInfo(targetId)
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@@ -130,9 +133,7 @@
|
||||
|
||||
setTimeout(() => {
|
||||
this.downRing()
|
||||
uni.switchTab({
|
||||
url: '/pages/im/index'
|
||||
})
|
||||
uni.navigateBack()
|
||||
}, 200);
|
||||
},
|
||||
toHome() {
|
||||
|
||||
Reference in New Issue
Block a user