This commit is contained in:
2022-02-08 09:42:48 +08:00
parent ab958d0777
commit 85f9a091c9
8 changed files with 260 additions and 254 deletions

View File

@@ -1,28 +1,28 @@
<template> <template>
<view class="sent--popups u-border-top" v-if="show"> <view class="sent--popups u-border-top" v-if="show">
<view class="sent--popups--item" @click="onPopupsItem('picture')"> <view class="item" @click="onPopupsItem('picture')">
<image class="sent--popups--icon" src="@/static/icon/popups-icon-00.png" mode="widthFix"></image> <image class="icon" src="@/static/icon/popups-icon-00.png" mode="widthFix"></image>
<text class="sent--popups--text">相册</text> <text class="text">相册</text>
</view> </view>
<view class="sent--popups--item" @click="onPopupsItem('camera')"> <view class="item" @click="onPopupsItem('camera')">
<image class="sent--popups--icon" src="@/static/icon/popups-icon-01.png" mode="widthFix"></image> <image class="icon" src="@/static/icon/popups-icon-01.png" mode="widthFix"></image>
<text class="sent--popups--text">拍摄</text> <text class="text">拍摄</text>
</view> </view>
<view class="sent--popups--item" @click="onPopupsItem('video')"> <view class="item" @click="onPopupsItem('video')">
<image class="sent--popups--icon" src="@/static/icon/popups-icon-02.png" mode="widthFix"></image> <image class="icon" src="@/static/icon/popups-icon-02.png" mode="widthFix"></image>
<text class="sent--popups--text">视频通话</text> <text class="text">视频通话</text>
</view> </view>
<view class="sent--popups--item" @click="onPopupsItem('location')"> <view class="item" @click="onPopupsItem('location')">
<image class="sent--popups--icon" src="@/static/icon/popups-icon-03.png" mode="widthFix"></image> <image class="icon" src="@/static/icon/popups-icon-03.png" mode="widthFix"></image>
<text class="sent--popups--text">位置</text> <text class="text">位置</text>
</view> </view>
<view class="sent--popups--item" @click="onPopupsItem('redpacket')"> <view class="item" @click="onPopupsItem('redpacket')">
<image class="sent--popups--icon" src="@/static/icon/popups-icon-04.png" mode="widthFix"></image> <image class="icon" src="@/static/icon/popups-icon-04.png" mode="widthFix"></image>
<text class="sent--popups--text">红包</text> <text class="text">红包</text>
</view> </view>
<view class="sent--popups--item" @click="onPopupsItem('file')"> <view class="item" @click="onPopupsItem('file')">
<image class="sent--popups--icon" src="@/static/icon/popups-icon-05.png" mode="widthFix"></image> <image class="icon" src="@/static/icon/popups-icon-05.png" mode="widthFix"></image>
<text class="sent--popups--text">文件</text> <text class="text">文件</text>
</view> </view>
<u-action-sheet :actions="callActions" cancelText="取消" @close="callShow = false" @select="singleCall" <u-action-sheet :actions="callActions" cancelText="取消" @close="callShow = false" @select="singleCall"
@@ -143,19 +143,19 @@
flex-wrap: wrap; flex-wrap: wrap;
flex-direction: row; flex-direction: row;
&--item { .item {
width: 150rpx; width: 150rpx;
margin: 15rpx; margin: 15rpx;
} }
&--text { .text {
text-align: center; text-align: center;
font-size: 26rpx; font-size: 26rpx;
color: #555; color: #555;
padding-top: 15rpx; padding-top: 15rpx;
} }
&--icon { .icon {
width: 110rpx; width: 110rpx;
height: 110rpx; height: 110rpx;
margin: 0 20rpx; margin: 0 20rpx;

View File

@@ -1,5 +1,5 @@
<template> <template>
<view class="text"> <view class="sent--text">
<input class="input" type="text" v-model="inputTxt" confirm-type="send" @confirm="sent" cursor-spacing="10" /> <input class="input" type="text" v-model="inputTxt" confirm-type="send" @confirm="sent" cursor-spacing="10" />
<!-- <button class="button" size="mini" :disabled="disabled" @click="sent">发送</button> --> <!-- <button class="button" size="mini" :disabled="disabled" @click="sent">发送</button> -->
</view> </view>
@@ -56,12 +56,11 @@
} }
</script> </script>
<style scoped> <style scoped lang="less">
.text { .sent--text {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
justify-content: space-between; justify-content: space-between;
}
.input { .input {
background: #F3F6FB; background: #F3F6FB;
@@ -83,8 +82,8 @@
font-size: 30rpx; font-size: 30rpx;
font-weight: bold; font-weight: bold;
} }
// .button[disabled] {
.button[disabled] { // background-color: #555555;
background-color: #555555; // }
} }
</style> </style>

View File

@@ -1,12 +1,12 @@
<template> <template>
<view> <view class="send--voice">
<view class="voice" hover-class="chat-hover" @touchstart="startRecord" @touchend="stopRecord"> <view class="voice" hover-class="chat-hover" @touchstart="startRecord" @touchend="stopRecord">
<text class="button">按住说话</text> <text class="button">按住说话</text>
</view> </view>
<!-- 录音中提示 --> <!-- 录音中提示 -->
<view class="audio-transcribe" v-if="showRecordTip"> <view class="modal" v-if="showRecordTip">
<image class="audio-transcribe-src" src="@/static/icon/record-icon.png" mode="widthFix"></image> <image class="icon" src="@/static/icon/record-icon.png" mode="widthFix"></image>
<text class="audio-transcribe-text">录音中 {{recordTime}} s</text> <text class="text">录音中 {{recordTime}} s</text>
</view> </view>
</view> </view>
</template> </template>
@@ -79,7 +79,8 @@
clearInterval(this.interval) clearInterval(this.interval)
// 监听录音结束 // 监听录音结束
this.recorderManager.onStop(res => { this.recorderManager.onStop(res => {
im.sentVoice(this.conversationType, this.targetId, res.tempFilePath, (this.maxRecordTime - this im.sentVoice(this.conversationType, this.targetId, res.tempFilePath, (this.maxRecordTime -
this
.recordTime), () => { .recordTime), () => {
setTimeout(() => { setTimeout(() => {
this.$emit('success') this.$emit('success')
@@ -93,9 +94,10 @@
} }
</script> </script>
<style scoped> <style scoped lang="scss">
.send--voice {
.voice { .voice {
background: #F3F6FB; background: $window-color;
height: 70rpx; height: 70rpx;
line-height: 70rpx; line-height: 70rpx;
justify-content: center; justify-content: center;
@@ -103,14 +105,14 @@
width: 460rpx; width: 460rpx;
border-radius: 10rpx; border-radius: 10rpx;
margin-right: 15rpx; margin-right: 15rpx;
}
.button { .button {
font-size: 30rpx; font-size: 30rpx;
color: #333; color: #333;
} }
}
.audio-transcribe { .modal {
background: rgba(0, 0, 0, .6); background: rgba(0, 0, 0, .6);
position: fixed; position: fixed;
height: 200rpx; height: 200rpx;
@@ -122,15 +124,16 @@
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
}
.audio-transcribe-src { .icon {
width: 88rpx; width: 88rpx;
height: 88rpx; height: 88rpx;
} }
.audio-transcribe-text { .text {
font-size: 28rpx; font-size: 28rpx;
color: #FFFFFF; color: #FFFFFF;
} }
}
}
</style> </style>

View File

@@ -1,5 +1,5 @@
<template> <template>
<view class="im--image" :class="guest ? 'right': 'left'"> <view class="msg--image" :class="guest ? 'right': 'left'">
<image class="img" :src="msg.thumbnail" @click="previewImage" mode="widthFix"></image> <image class="img" :src="msg.thumbnail" @click="previewImage" mode="widthFix"></image>
</view> </view>
</template> </template>
@@ -39,7 +39,7 @@
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.im--image { .msg--image {
padding: 20rpx; padding: 20rpx;
&.left { &.left {

View File

@@ -1,5 +1,5 @@
<template> <template>
<view class="im--box"> <view class="msg--text">
<text class="im--text" :class="guest ? 'right': 'left'">{{ msg.content }}</text> <text class="im--text" :class="guest ? 'right': 'left'">{{ msg.content }}</text>
</view> </view>
</template> </template>

View File

@@ -1,11 +1,9 @@
<template> <template>
<view> <view class="msg--voice" :class="guest ? 'right': 'left'" @click="onPlayMsg">
<view class="im--voice" :class="guest ? 'right': 'left'" @click="onPlayMsg">
<image v-if="!guest" class="icon" src="@/static/icon/audio_green.png" mode="widthFix"></image> <image v-if="!guest" class="icon" src="@/static/icon/audio_green.png" mode="widthFix"></image>
<text class="duration">{{msg.duration}}"</text> <text class="duration">{{msg.duration}}"</text>
<image v-if="guest" class="icon" src="@/static/icon/audio_white.png" mode="widthFix"></image> <image v-if="guest" class="icon" src="@/static/icon/audio_white.png" mode="widthFix"></image>
</view> </view>
</view>
</template> </template>
<script> <script>
@@ -58,7 +56,7 @@
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.im--voice { .msg--voice {
flex-direction: row; flex-direction: row;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;

View File

@@ -1,5 +1,5 @@
<template> <template>
<view class="call-page"> <view class="call">
<view class="video"> <view class="video">
<RongCloud-Call-RCUniCallView ref="bigVideoView" :style="{width:windowWidth+'px',height:windowHeight+'px'}" <RongCloud-Call-RCUniCallView ref="bigVideoView" :style="{width:windowWidth+'px',height:windowHeight+'px'}"
class="bigVideoView"> class="bigVideoView">
@@ -9,9 +9,11 @@
</view> </view>
<view class="status" v-if="!connected || mediaType == 0"> <view class="status" v-if="!connected || mediaType == 0">
<view class="call-user"> <view class="remote">
<u-avatar v-if="userInfo.portraitUrl" :src="userInfo.portraitUrl" shape="square" size="96" bgColor="#fff" /> <u-avatar v-if="userInfo.portraitUrl" :src="userInfo.portraitUrl" shape="square" size="96"
<u-avatar size="80" v-if="!userInfo.portraitUrl" shape="square" :text="userInfo.name ? userInfo.name.substring(0,1) : '未'" font-size="44" randomBgColor /> 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">{{userInfo.name}}</text></view>
<view v-if="remoteRinging"><text class="mediaType">等待对方接听</text></view> <view v-if="remoteRinging"><text class="mediaType">等待对方接听</text></view>
<view v-if="connected"><text class="mediaType">已接通</text></view> <view v-if="connected"><text class="mediaType">已接通</text></view>
@@ -163,14 +165,14 @@
} }
</script> </script>
<style scoped> <style scoped lang="scss">
.call-page { .call {
display: flex; display: flex;
flex: 1; flex: 1;
flex-direction: column; flex-direction: column;
position: relative; position: relative;
}
.video {
.bigVideoView { .bigVideoView {
background: #000; background: #000;
} }
@@ -183,38 +185,6 @@
width: 180rpx; width: 180rpx;
height: 320rpx; height: 320rpx;
} }
.buttons {
position: fixed;
bottom: 100rpx;
width: 750rpx;
display: flex;
flex-direction: row;
justify-content: space-around;
}
.btn {
align-items: center;
}
.icon {
background: #34CE98;
width: 132rpx;
height: 132rpx;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
}
.btn .text {
margin-top: 16rpx;
color: #FFFFFF;
font-size: 32rpx;
}
.icon.hangup {
background: #dd524d;
} }
.status { .status {
@@ -224,15 +194,13 @@
position: fixed; position: fixed;
bottom: 0; bottom: 0;
top: 0; top: 0;
}
.call-user { .remote {
flex: 1; flex: 1;
width: 750rpx; width: 750rpx;
display: flex; display: flex;
align-items: center; align-items: center;
top: 300rpx; top: 300rpx;
}
.mediaType { .mediaType {
font-size: 32rpx; font-size: 32rpx;
@@ -244,4 +212,41 @@
font-size: 44rpx; font-size: 44rpx;
color: #ffffff; color: #ffffff;
} }
}
}
.buttons {
position: fixed;
bottom: 100rpx;
width: 750rpx;
display: flex;
flex-direction: row;
justify-content: space-around;
}
.btn {
align-items: center;
&.hangup {
background: $text-price;
}
.icon {
background: $main-color;
width: 132rpx;
height: 132rpx;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
}
.text {
margin-top: 16rpx;
color: #FFFFFF;
font-size: 32rpx;
}
}
}
</style> </style>

View File

@@ -1,13 +1,13 @@
<template> <template>
<view class="chat"> <view class="chat">
<!-- chat --> <!-- chat -->
<list class="chat-scroll" :show-scrollbar="false"> <list class="body" :show-scrollbar="false">
<cell class="cell" v-for="(item, index) in messages" :key="index"> <cell class="cell" v-for="(item, index) in messages" :key="index">
<view class="cell-time"> <view class="time">
<text class="cell-time-text">{{ customCN(item.sentTime) }}</text> <text class="text">{{ customCN(item.sentTime) }}</text>
</view> </view>
<view class="cell-item" :class="item.messageDirection == 1 ? 'right' : 'left'"> <view class="cell-item" :class="item.messageDirection == 1 ? 'right' : 'left'">
<image class="active" :src="userInfo.portraitUrl" mode="aspectFill" <image class="avatar" :src="userInfo.portraitUrl" mode="aspectFill"
@click="showUser(targetId, item.messageDirection)"></image> @click="showUser(targetId, item.messageDirection)"></image>
<view class="msg"> <view class="msg">
<show-voice v-if="item.objectName === 'RC:HQVCMsg'" :guest="item.messageDirection == 1" <show-voice v-if="item.objectName === 'RC:HQVCMsg'" :guest="item.messageDirection == 1"
@@ -25,11 +25,11 @@
<cell class="cell-footer" ref="chatBottom"></cell> <cell class="cell-footer" ref="chatBottom"></cell>
</list> </list>
<!-- footer --> <!-- footer -->
<view class="chat-footer"> <view class="footer">
<view class="msg-type" @click="changeMessageType"> <view class="msg-type" @click="changeMessageType">
<image class="msg-type-icon" src="@/static/icon/key-icon.png" v-if="chatType === 0" mode="widthFix"> <image class="icon" src="@/static/icon/key-icon.png" v-if="chatType === 0" mode="widthFix">
</image> </image>
<image class="msg-type-icon" src="@/static/icon/msg-icon.png" v-if="chatType === 1" mode="widthFix"> <image class="icon" src="@/static/icon/msg-icon.png" v-if="chatType === 1" mode="widthFix">
</image> </image>
</view> </view>
<sent-voice v-if="chatType === 0" :conversationType="conversationType" :targetId="targetId" <sent-voice v-if="chatType === 0" :conversationType="conversationType" :targetId="targetId"
@@ -37,7 +37,7 @@
<sent-text v-if="chatType === 1" :conversationType="conversationType" :targetId="targetId" <sent-text v-if="chatType === 1" :conversationType="conversationType" :targetId="targetId"
@success="getMessageList" /> @success="getMessageList" />
<view class="msg-type msg-push" @click="showPopups = !showPopups"> <view class="msg-type msg-push" @click="showPopups = !showPopups">
<image class="msg-type-icon" src="@/static/icon/popups-icon.png"></image> <image class="icon" src="@/static/icon/popups-icon.png"></image>
</view> </view>
</view> </view>
<!-- 弹出层 --> <!-- 弹出层 -->
@@ -159,28 +159,25 @@
} }
</script> </script>
<style scoped> <style scoped lang="scss">
/* 窗口 */ /* 窗口 */
.chat { .chat {
background: #F3F6FB; background: $window-color;
flex: 1; flex: 1;
}
.chat-scroll {
.body {
flex: 1; flex: 1;
}
.cell { .cell {
padding: 10rpx 30rpx; padding: 10rpx 30rpx;
}
.cell-time { .time {
justify-content: center; justify-content: center;
align-items: center; align-items: center;
padding-bottom: 20rpx; padding-bottom: 20rpx;
}
.cell-time-text { .text {
background: #fff; background: #fff;
font-size: 24rpx; font-size: 24rpx;
color: #666; color: #666;
@@ -188,17 +185,27 @@
padding: 0 20rpx; padding: 0 20rpx;
border-radius: 10rpx; border-radius: 10rpx;
} }
}
.cell-item { .cell-item {
width: 690rpx; width: 690rpx;
justify-content: flex-start; justify-content: flex-start;
&.left {
flex-direction: row;
} }
.cell-footer { &.right {
height: 20rpx; flex-direction: row-reverse;
.state {
flex-direction: row;
justify-content: flex-end;
}
} }
.active { .avatar {
width: 78rpx; width: 78rpx;
height: 78rpx; height: 78rpx;
background-color: white; background-color: white;
@@ -207,47 +214,41 @@
.msg { .msg {
margin: 0 20rpx; margin: 0 20rpx;
}
.state { .state {
padding-top: 10rpx; padding-top: 10rpx;
}
.state-text { .state-text {
font-size: 24rpx; font-size: 24rpx;
color: #666; color: #666;
} }
}
.cell-item.left { }
flex-direction: row;
} }
.cell-item.right { .cell-footer {
flex-direction: row-reverse; height: 20rpx;
}
}
} }
.cell-item.right .state { .footer {
flex-direction: row;
justify-content: flex-end;
}
/* footer */
.chat-footer {
background: white; background: white;
padding: 20rpx 30rpx; padding: 20rpx 30rpx;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
flex-direction: row; flex-direction: row;
}
.msg-type { .msg-type {
width: 70rpx; width: 70rpx;
height: 70rpx; height: 70rpx;
}
.msg-type>.msg-type-icon { .icon {
margin: 5rpx; margin: 5rpx;
width: 60rpx; width: 60rpx;
height: 60rpx; height: 60rpx;
} }
}
}
}
</style> </style>