|
@@ -6,6 +6,12 @@
|
|
|
<view>不希望其他人打扰</view>
|
|
|
</view>
|
|
|
<u-top-tips ref="uTips"></u-top-tips>
|
|
|
+ <view class="top_box" :style="{ top: btn_top, left: btn_left}">
|
|
|
+ <image class="top_box_img" :src="head_img"></image>
|
|
|
+ <view class="top_box_text">
|
|
|
+ <text class="text_box_top">{{title}}</text><text class="text_box_bottom" style="display:none">{{user_name}}</text>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
@@ -34,10 +40,24 @@
|
|
|
// 必要参数 身份签名,相当于登录密码的作用
|
|
|
template: '' // 必要参数 组件模版,支持的值 1v1 grid custom ,注意:不支持动态修改, iOS 不支持 pusher 动态渲染
|
|
|
},
|
|
|
- showTipToast: false
|
|
|
+ showTipToast: false,
|
|
|
+ btn_left:0,
|
|
|
+ btn_top:0,
|
|
|
+ title:"",
|
|
|
+ user_name:'1',
|
|
|
+ head_img:"../static/images/loginLogo.png"
|
|
|
}
|
|
|
},
|
|
|
onLoad(options) {
|
|
|
+ let menuButtonObject = wx.getMenuButtonBoundingClientRect();
|
|
|
+ wx.getSystemInfo({
|
|
|
+ success: res => {
|
|
|
+ this.setData({
|
|
|
+ btn_left: res.windowWidth - menuButtonObject.right+'rpx',
|
|
|
+ btn_top:menuButtonObject.top+menuButtonObject.height+14+'rpx'
|
|
|
+ })
|
|
|
+ },
|
|
|
+ })
|
|
|
NET.request(API.linkPickVideo, {
|
|
|
tenantCode : options.tenantCode
|
|
|
}, 'GET').then(res => {
|
|
@@ -104,6 +124,18 @@
|
|
|
const TRTC_EVENT = this.trtcComponent.EVENT;
|
|
|
this.timestamp = []; // 初始化事件订阅
|
|
|
this.trtcComponent.on(TRTC_EVENT.LOCAL_JOIN, event => {
|
|
|
+ var userId=this.trtcComponent.getRemoteUserList()[0].userID;
|
|
|
+ NET.request(API.getMerchantsMainInfo + userId, {}, 'GET').then(res => {
|
|
|
+ this.setData({
|
|
|
+ head_img:res.data.merchantImg,
|
|
|
+ title:res.data.merchantNickname
|
|
|
+ })
|
|
|
+ }).catch(error => {
|
|
|
+ this.$refs.uTips.show({
|
|
|
+ title: '获取个人信息失败',
|
|
|
+ type: 'warning',
|
|
|
+ })
|
|
|
+ })
|
|
|
console.log('* room LOCAL_JOIN', event); // 进房成功,触发该事件后可以对本地视频和音频进行设置
|
|
|
|
|
|
if (this.options.localVideo === true || this.options.template === '1v1') {
|
|
@@ -120,6 +152,18 @@
|
|
|
console.log('* room ERROR', event);
|
|
|
}); // 远端用户进房
|
|
|
this.trtcComponent.on(TRTC_EVENT.REMOTE_USER_JOIN, event => {
|
|
|
+ var userId=this.trtcComponent.getRemoteUserList()[0].userID;
|
|
|
+ NET.request(API.getMerchantsMainInfo + userId, {}, 'GET').then(res => {
|
|
|
+ this.setData({
|
|
|
+ head_img:res.data.merchantImg,
|
|
|
+ title:res.data.merchantNickname
|
|
|
+ })
|
|
|
+ }).catch(error => {
|
|
|
+ this.$refs.uTips.show({
|
|
|
+ title: '获取个人信息失败',
|
|
|
+ type: 'warning',
|
|
|
+ })
|
|
|
+ })
|
|
|
console.log('* room REMOTE_USER_JOIN --- room.vue', event, this.trtcComponent.getRemoteUserList(), this.template);
|
|
|
this.timestamp.push(new Date()); // 1v1视频通话时限制人数为两人的简易逻辑,建议通过后端实现房间人数管理
|
|
|
// 2人以上同时进行通话请选择网格布局
|
|
@@ -143,6 +187,10 @@
|
|
|
}
|
|
|
}); // 远端用户退出
|
|
|
this.trtcComponent.on(TRTC_EVENT.REMOTE_USER_LEAVE, event => {
|
|
|
+ this.setData({
|
|
|
+ head_img:"../static/images/loginLogo.png",
|
|
|
+ title:''
|
|
|
+ })
|
|
|
console.log('* room REMOTE_USER_LEAVE', event, this.trtcComponent.getRemoteUserList());
|
|
|
if (this.template === '1v1') {
|
|
|
this.timestamp = [];
|
|
@@ -243,5 +291,41 @@
|
|
|
padding: 20rpx 0;
|
|
|
font-size: 32rpx;
|
|
|
}
|
|
|
+ .top_box{
|
|
|
+ width: 304rpx;
|
|
|
+ height: 86rpx;
|
|
|
+ position: absolute;
|
|
|
+ z-index: 100;
|
|
|
+ background:rgba(0, 0, 0, 0.4);
|
|
|
+ border-radius: 100px;
|
|
|
+ top: 182rpx;
|
|
|
+ left: 30rpx;
|
|
|
+ }
|
|
|
+ .top_box_img{
|
|
|
+ width: 86rpx;
|
|
|
+ height: 86rpx;
|
|
|
+ border-radius: 100rpx;
|
|
|
+ float: left;
|
|
|
+ }
|
|
|
+ .top_box_text{
|
|
|
+ float: left;
|
|
|
+ color: #fff;
|
|
|
+ margin-left: 30rpx;
|
|
|
+ width: 180rpx;
|
|
|
+ padding-top: 2rpx;
|
|
|
+ }
|
|
|
+ .text_box_top{
|
|
|
+ font-size: 34rpx;
|
|
|
+ width: 100%;
|
|
|
+ display: block;
|
|
|
+ height: 30rpx;
|
|
|
+ float: left;
|
|
|
+ margin-top: 19rpx;
|
|
|
+ }
|
|
|
+ .text_box_bottom{
|
|
|
+ font-size: 22rpx;
|
|
|
+ float: left;
|
|
|
+ margin-top: 10rpx;
|
|
|
+ }
|
|
|
}
|
|
|
</style>
|