统一聊天页的头像大小,改用rpx2px的计算,84rpx
This commit is contained in:
14
pages.json
14
pages.json
@@ -373,19 +373,7 @@
|
|||||||
{
|
{
|
||||||
"path": "pages/im/private/chat",
|
"path": "pages/im/private/chat",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarBackgroundColor":"#FFFFFF",
|
"navigationBarBackgroundColor":"#FFFFFF"
|
||||||
"disableScroll": false,
|
|
||||||
"app-plus": {
|
|
||||||
"titleNView": {
|
|
||||||
"type": "default",
|
|
||||||
"buttons": [{
|
|
||||||
"float": "right",
|
|
||||||
"fontSrc": "/static/iconfont.ttf",
|
|
||||||
"text": "\ue607",
|
|
||||||
"fontSize": "20px"
|
|
||||||
}]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,67 +1,67 @@
|
|||||||
<template>
|
<template>
|
||||||
<u-alert type="warning" v-if="connection != 0" :description="description" show-icon />
|
<u-alert type="warning" v-if="connection != 0" :description="description" show-icon />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
props: {
|
props: {
|
||||||
connection: {
|
connection: {
|
||||||
type: Number,
|
type: Number,
|
||||||
default: 0
|
default: 0
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
description() {
|
description() {
|
||||||
return this.connectionStatusMap.filter(item => item.index == this.connection)[0].text
|
return this.connectionStatusMap.filter(item => item.index == this.connection)[0].text
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
connectionStatusMap: [{
|
connectionStatusMap: [{
|
||||||
index: -1,
|
index: -1,
|
||||||
text: '网络不可用'
|
text: '网络不可用'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
index: 0,
|
index: 0,
|
||||||
text: '连接成功'
|
text: '连接成功'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
index: 1,
|
index: 1,
|
||||||
text: '连接中'
|
text: '连接中'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
index: 2,
|
index: 2,
|
||||||
text: '未连接'
|
text: '未连接'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
index: 3,
|
index: 3,
|
||||||
text: '用户账号在其它设备登录'
|
text: '用户账号在其它设备登录'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
index: 4,
|
index: 4,
|
||||||
text: 'TOKEN过期'
|
text: 'TOKEN过期'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
index: 6,
|
index: 6,
|
||||||
text: '用户被禁用'
|
text: '用户被禁用'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
index: 12,
|
index: 12,
|
||||||
text: '退出登录'
|
text: '退出登录'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
index: 13,
|
index: 13,
|
||||||
text: '连接暂时被挂起'
|
text: '连接暂时被挂起'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
index: 14,
|
index: 14,
|
||||||
text: '连接超时'
|
text: '连接超时'
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -59,7 +59,7 @@
|
|||||||
actionMap: [],
|
actionMap: [],
|
||||||
actionTitle: '',
|
actionTitle: '',
|
||||||
currentUser: {},
|
currentUser: {},
|
||||||
avatarSize: 45,
|
avatarSize: 84,
|
||||||
labelSize: 14,
|
labelSize: 14,
|
||||||
iconSize: 14
|
iconSize: 14
|
||||||
}
|
}
|
||||||
@@ -72,7 +72,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.avatarSize = utils.rpx2px(90)
|
this.avatarSize = utils.rpx2px(84)
|
||||||
this.labelSize = utils.rpx2px(24)
|
this.labelSize = utils.rpx2px(24)
|
||||||
this.iconSize = utils.rpx2px(26)
|
this.iconSize = utils.rpx2px(26)
|
||||||
},
|
},
|
||||||
@@ -271,8 +271,8 @@
|
|||||||
.avatar {
|
.avatar {
|
||||||
border-radius: 0 8rpx 0 0;
|
border-radius: 0 8rpx 0 0;
|
||||||
position: relative;
|
position: relative;
|
||||||
width: 90rpx;
|
width: 84rpx;
|
||||||
height: 90rpx;
|
height: 84rpx;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
|
||||||
.admin {
|
.admin {
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<view class="message--cell">
|
<view class="message--cell">
|
||||||
<view class="avatar">
|
<view class="avatar">
|
||||||
<u-badge max="99" shape="horn" absolute :offset="[-5, -8]" :value="item.unreadMessageCount" />
|
<u-badge max="99" shape="horn" absolute :offset="[-5, -8]" :value="item.unreadMessageCount" />
|
||||||
<u-avatar :src="contact(item.targetId).portraitUrl" shape="square" size="44" />
|
<u-avatar :src="contact(item.targetId).portraitUrl" shape="square" :size="avatarSize" />
|
||||||
</view>
|
</view>
|
||||||
<view class="content">
|
<view class="content">
|
||||||
<view class="header">
|
<view class="header">
|
||||||
@@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import messagePreview from './messagePreview'
|
import messagePreview from './messagePreview'
|
||||||
|
import utils from '@/utils/index.js'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
props: {
|
props: {
|
||||||
@@ -27,8 +28,16 @@
|
|||||||
return {}
|
return {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
avatarRpx: 84
|
||||||
|
}
|
||||||
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
avatarSize() {
|
||||||
|
return utils.rpx2px(this.avatarRpx)
|
||||||
|
},
|
||||||
contact() {
|
contact() {
|
||||||
return function(targetId) {
|
return function(targetId) {
|
||||||
return this.$store.getters.contactInfo(targetId)
|
return this.$store.getters.contactInfo(targetId)
|
||||||
@@ -48,6 +57,7 @@
|
|||||||
|
|
||||||
.avatar {
|
.avatar {
|
||||||
position: relative;
|
position: relative;
|
||||||
|
padding-top: 5rpx;
|
||||||
|
|
||||||
.u-badge {
|
.u-badge {
|
||||||
z-index: 998;
|
z-index: 998;
|
||||||
@@ -59,8 +69,6 @@
|
|||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
position: relative;
|
position: relative;
|
||||||
flex: 1;
|
flex: 1;
|
||||||
|
|
||||||
|
|
||||||
border-bottom-width: 0.5px !important;
|
border-bottom-width: 0.5px !important;
|
||||||
border-color: #f9f9f9 !important;
|
border-color: #f9f9f9 !important;
|
||||||
border-bottom-style: solid;
|
border-bottom-style: solid;
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
<view class="cell" v-for="(item, index) in messages" :key="index">
|
<view class="cell" v-for="(item, index) in messages" :key="index">
|
||||||
<view class="time" v-if="item.senderUserId === '__system__'">{{ item.content.message }}</view>
|
<view class="time" v-if="item.senderUserId === '__system__'">{{ item.content.message }}</view>
|
||||||
<view v-else :class="['cell-item', item.messageDirection == 1 ? 'right' : 'left']">
|
<view v-else :class="['cell-item', item.messageDirection == 1 ? 'right' : 'left']">
|
||||||
<u-avatar class="avatar" @click="toUser(item)" size="36" shape="square"
|
<u-avatar class="avatar" @click="toUser(item)" :size="avatarSize" shape="square"
|
||||||
:src="contact(item.senderUserId).portraitUrl" />
|
:src="contact(item.senderUserId).portraitUrl" />
|
||||||
<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"
|
||||||
@@ -37,6 +37,7 @@
|
|||||||
import showImage from '../components/showImage'
|
import showImage from '../components/showImage'
|
||||||
import showText from '../components/showText'
|
import showText from '../components/showText'
|
||||||
import sentMessageBar from '../components/sentMessageBar'
|
import sentMessageBar from '../components/sentMessageBar'
|
||||||
|
import utils from '@/utils/index.js'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
@@ -47,6 +48,7 @@
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
avatarRpx: 84,
|
||||||
targetId: '',
|
targetId: '',
|
||||||
conversationType: RongIMLib.ConversationType.GROUP,
|
conversationType: RongIMLib.ConversationType.GROUP,
|
||||||
messages: [],
|
messages: [],
|
||||||
@@ -56,6 +58,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
avatarSize() {
|
||||||
|
return utils.rpx2px(this.avatarRpx)
|
||||||
|
},
|
||||||
latestMessage() {
|
latestMessage() {
|
||||||
if (this.messages.length) {
|
if (this.messages.length) {
|
||||||
return this.messages[0]
|
return this.messages[0]
|
||||||
@@ -74,8 +79,8 @@
|
|||||||
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);
|
console.log(res);
|
||||||
uni.setNavigationBarTitle({
|
uni.setNavigationBarTitle({
|
||||||
title: res.name + `(${res.members})`
|
title: res.name + `(${res.members})`
|
||||||
})
|
})
|
||||||
@@ -174,6 +179,7 @@
|
|||||||
|
|
||||||
.cell {
|
.cell {
|
||||||
padding: 10rpx 30rpx;
|
padding: 10rpx 30rpx;
|
||||||
|
|
||||||
.time {
|
.time {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- content -->
|
<!-- content -->
|
||||||
<view v-if="$store.state.token !== ''">
|
<view v-if="$store.state.token !== ''">
|
||||||
<connection-status :connection="connection" />
|
<connection-status :connection="connection" />
|
||||||
<conversation-list @refresh="getConversationList()" :conversations="conversations" />
|
<conversation-list @refresh="getConversationList()" :conversations="conversations" />
|
||||||
</view>
|
</view>
|
||||||
@@ -76,13 +76,7 @@
|
|||||||
onHide() {
|
onHide() {
|
||||||
uni.$off('onReceiveMessage')
|
uni.$off('onReceiveMessage')
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
onDemo(){
|
|
||||||
console.log('1111')
|
|
||||||
uni.navigateTo({
|
|
||||||
url: '/pages/im/chatDemo'
|
|
||||||
})
|
|
||||||
},
|
|
||||||
checkNewFriendPending() {
|
checkNewFriendPending() {
|
||||||
im.getPendingList((pendings) => {
|
im.getPendingList((pendings) => {
|
||||||
this.hasNewFriends = pendings.length
|
this.hasNewFriends = pendings.length
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
<view class="cell" v-for="(item, index) in messages" :key="index">
|
<view class="cell" v-for="(item, index) in messages" :key="index">
|
||||||
<view class="time">{{ item.sentTime|timeCustomCN }}</view>
|
<view class="time">{{ item.sentTime|timeCustomCN }}</view>
|
||||||
<view :class="['cell-item', item.messageDirection == 1 ? 'right' : 'left']">
|
<view :class="['cell-item', item.messageDirection == 1 ? 'right' : 'left']">
|
||||||
<u-avatar class="avatar" size="40" shape="square"
|
<u-avatar class="avatar" :size="avatarSize" shape="square"
|
||||||
@click="showUser(item.senderUserId, item.messageDirection)"
|
@click="showUser(item.senderUserId, item.messageDirection)"
|
||||||
:src="contact(item.senderUserId).portraitUrl" />
|
:src="contact(item.senderUserId).portraitUrl" />
|
||||||
<view class="msg">
|
<view class="msg">
|
||||||
@@ -37,7 +37,9 @@
|
|||||||
import showImage from '../components/showImage'
|
import showImage from '../components/showImage'
|
||||||
import showText from '../components/showText'
|
import showText from '../components/showText'
|
||||||
import showCall from '../components/showCall'
|
import showCall from '../components/showCall'
|
||||||
import sentMessageBar from '../components/sentMessageBar'
|
import sentMessageBar from '../components/sentMessageBar'
|
||||||
|
import utils from '@/utils/index.js'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
sentMessageBar,
|
sentMessageBar,
|
||||||
@@ -47,7 +49,8 @@
|
|||||||
showCall
|
showCall
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
avatarRpx: 84,
|
||||||
targetId: '',
|
targetId: '',
|
||||||
messages: [],
|
messages: [],
|
||||||
conversationType: 1,
|
conversationType: 1,
|
||||||
@@ -58,7 +61,10 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
avatarSize() {
|
||||||
|
return utils.rpx2px(this.avatarRpx)
|
||||||
|
},
|
||||||
latestMessage() {
|
latestMessage() {
|
||||||
if (this.messages.length) {
|
if (this.messages.length) {
|
||||||
return this.messages[0]
|
return this.messages[0]
|
||||||
@@ -179,7 +185,8 @@
|
|||||||
.time {
|
.time {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
color: #666;
|
color: #666;
|
||||||
|
margin-bottom: 10rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.cell-item {
|
.cell-item {
|
||||||
|
|||||||
Reference in New Issue
Block a user