This commit is contained in:
2022-02-18 13:19:08 +08:00
3 changed files with 26 additions and 23 deletions

View File

@@ -6,7 +6,7 @@
bg-color="#fff"></u-avatar>
<view class="info-text">
<view class="nickname">{{ userInfo.name }}</view>
<view class="address" @longpress="copyAddress">Hash{{ userInfo.address }}</view>
<view class="address" @longpress="copyAddress">地址{{ userInfo.address }}</view>
</view>
</view>
<!-- 用户资料 -->
@@ -106,7 +106,8 @@
name: '视频通话'
}
],
callShow: false
callShow: false,
hasPeding: false
}
},
onLoad(e) {
@@ -201,36 +202,35 @@
},
// 申请好友
toBeFriend() {
pedingFriend(this.targetId).then(res => {
if (this.hasPeding) {
uni.showToast({
icon: 'none',
title: '请不要频繁操作'
})
return
}
pedingFriend(this.targetId, 'message').then(res => {
uni.showToast({
title: ` 申请成功,等待审核 `,
icon: 'none',
duration: 3000,
mask: true
});
this.hasPeding = true
})
.catch(err => {
// if(err.status_code === 6001){
// this.userInfo.friendship = 'accepted'
// }else{
uni.showToast({
icon: 'error',
title: err.message,
duration: 2000,
mask: true
})
// }
uni.showToast({
icon: 'error',
title: err.message,
duration: 2000,
mask: true
})
})
},
singleCall(e) {
uni.showToast({
icon: 'none',
title: '功能正在开发中'
uni.redirectTo({
url: '/pages/im/private/call?targetId=' + this.targetId + '&mediaType=' + e.type
})
// CallLib.startSingleCall(this.targetId, e.type, '');
// uni.redirectTo({
// url: '/pages/im/private/call?targetId=' + this.targetId + '&mediaType=' + e.type
// })
}
}
}

View File

@@ -5,7 +5,7 @@
<view class="cell" v-for="(item, index) in messages" :key="index">
<view class="time">{{ item.sentTime|timeCustomCN }}</view>
<view :class="['cell-item', item.messageDirection == 1 ? 'right' : 'left']">
<u-avatar class="avatar" size="40" shape="square" @click="showUser(targetId, item.messageDirection)"
<u-avatar class="avatar" size="40" shape="square" @click="showUser(item.senderUserId, item.messageDirection)"
:src="contact(item.senderUserId).portraitUrl" />
<view class="msg">
<show-voice v-if="item.objectName === 'RC:HQVCMsg'" :guest="item.messageDirection == 1"