Browse Source

!117 样式调整

Merge pull request !117 from blue/v_3.0.0
master
blue 1 year ago
committed by Gitee
parent
commit
147b2a5289
No known key found for this signature in database GPG Key ID: 173E9B9CA92EEF8F
  1. 4
      im-uniapp/.env.js
  2. 26
      im-uniapp/components/chat-item/chat-item.vue
  3. 21
      im-uniapp/components/head-image/head-image.vue
  4. 18
      im-uniapp/components/pop-menu/pop-menu.vue
  5. 3
      im-uniapp/pages/chat/chat-box.vue
  6. 15
      im-uniapp/pages/group/group-info.vue
  7. 23
      im-uniapp/pages/group/group-member.vue
  8. 20
      im-web/src/components/chat/ChatBox.vue
  9. 1
      im-web/src/components/chat/ChatInput.vue
  10. 29
      im-web/src/components/chat/ChatItem.vue
  11. 14
      im-web/src/components/common/HeadImage.vue
  12. 6
      im-web/src/components/common/UserInfo.vue
  13. 2
      im-web/src/view/Friend.vue
  14. 2
      im-web/src/view/Group.vue
  15. 2
      im-web/src/view/Home.vue

4
im-uniapp/.env.js

@ -2,8 +2,8 @@
const ENV = "DEV"; const ENV = "DEV";
const UNI_APP = {} const UNI_APP = {}
if(ENV=="DEV"){ if(ENV=="DEV"){
UNI_APP.BASE_URL = "http://192.168.43.199:8888"; UNI_APP.BASE_URL = "http://127.0.0.1:8888";
UNI_APP.WS_URL = "ws://192.168.43.199:8878/im"; UNI_APP.WS_URL = "ws://127.0.0.1:8878/im";
// H5 走本地代理解决跨域问题 // H5 走本地代理解决跨域问题
// #ifdef H5 // #ifdef H5
UNI_APP.BASE_URL = "/api"; UNI_APP.BASE_URL = "/api";

26
im-uniapp/components/chat-item/chat-item.vue

@ -7,11 +7,9 @@
</view> </view>
<view class="chat-right"> <view class="chat-right">
<view class="chat-name"> <view class="chat-name">
<view class="chat-tag" v-if="chat.type=='GROUP'">
<uni-tag disabled text="群" size="mini" type="primary"></uni-tag>
</view>
<view class="chat-name-text"> <view class="chat-name-text">
{{chat.showName}} <view>{{chat.showName}}</view>
<uni-tag v-if="chat.type=='GROUP'" circle text="群" size="small"></uni-tag>
</view> </view>
<view class="chat-time">{{$date.toTimeText(chat.lastSendTime,true)}}</view> <view class="chat-time">{{$date.toTimeText(chat.lastSendTime,true)}}</view>
</view> </view>
@ -127,18 +125,26 @@
line-height: 44rpx; line-height: 44rpx;
height: 44rpx; height: 44rpx;
.chat-tag {
display: flex;
align-items: center;
margin-right: 5rpx;
}
.chat-name-text { .chat-name-text {
flex: 1; flex: 1;
font-size: 30rpx; font-size: 30rpx;
font-weight: 600; font-weight: 600;
white-space: nowrap; white-space: nowrap;
overflow: hidden; overflow: hidden;
display: flex;
align-items: center;
.uni-tag {
text-align: center;
margin-left: 5rpx;
border: 0;
height: 30rpx;
line-height: 30rpx;
font-size: 20rpx;
padding: 1px 5px;
background-color: #de1c1c;
opacity: 0.8;
}
} }
.chat-time { .chat-time {

21
im-uniapp/components/head-image/head-image.vue

@ -15,9 +15,8 @@
name: "head-image", name: "head-image",
data() { data() {
return { return {
colors: ["#7dd24b", "#c7515a", "#db68ef", "#15d29b", "#85029b", colors: ["#5daa31", "#c7515a", "#e03697", "#85029b",
"#c9b455", "#fb2609", "#bda818", "#af0831", "#326eb6" "#c9b455", "#326eb6"]
]
} }
}, },
props: { props: {
@ -51,13 +50,15 @@
}, },
computed: { computed: {
avatarImageStyle() { avatarImageStyle() {
return `width:${this.size}rpx; height:${this.size}rpx;` return `width:${this.size}rpx;
height:${this.size}rpx;`
}, },
avatarTextStyle() { avatarTextStyle() {
return `width: ${this.size}rpx;height:${this.size}rpx; return `width: ${this.size}rpx;
color:${this.textColor};font-size:${this.size*0.5}rpx; height:${this.size}rpx;
border: 2px solid ${this.textColor}; background-color:${this.textColor};
box-shadow: 0px 0px 5rpx ${this.textColor}` font-size:${this.size*0.5}rpx;
`
}, },
textColor() { textColor() {
let hash = 0; let hash = 0;
@ -79,13 +80,11 @@
position: relative; position: relative;
overflow: hidden; overflow: hidden;
border-radius: 50%; border-radius: 50%;
border: 2px solid #6664eb;
vertical-align: bottom; vertical-align: bottom;
box-shadow: 0px 0px 10rpx #6664eb;
} }
.avatar-text { .avatar-text {
background-color: #f2f2f2; color: white;
border-radius: 50%; border-radius: 50%;
display: flex; display: flex;
align-items: center; align-items: center;

18
im-uniapp/components/pop-menu/pop-menu.vue

@ -1,10 +1,9 @@
<template> <template>
<view> <view>
<view @longpress.stop="onLongPress($event)" @touchmove="onTouchMove" @touchend="onTouchEnd"> <view @longpress.stop="onLongPress($event)" @touchmove="onTouchMove">
<slot></slot> <slot></slot>
</view> </view>
<view v-if="isShowMenu" class="pop-menu" @touchstart="onClose()" @contextmenu.prevent=""></view>
<view v-if="isShowMenu" class="pop-menu" @tap="onClose()" @contextmenu.prevent=""></view>
<view v-if="isShowMenu" class="menu" :style="menuStyle"> <view v-if="isShowMenu" class="menu" :style="menuStyle">
<view class="menu-item" v-for="(item) in items" :key="item.key" @click.prevent="onSelectMenu(item)"> <view class="menu-item" v-for="(item) in items" :key="item.key" @click.prevent="onSelectMenu(item)">
<uni-icons class="menu-icon" :type="item.icon" :style="itemStyle(item)" size="22"></uni-icons> <uni-icons class="menu-icon" :type="item.icon" :style="itemStyle(item)" size="22"></uni-icons>
@ -30,9 +29,6 @@
}, },
methods: { methods: {
onLongPress(e){ onLongPress(e){
if(this.isTouchMove){
return;
}
uni.getSystemInfo({ uni.getSystemInfo({
success: (res) => { success: (res) => {
let touches = e.touches[0]; let touches = e.touches[0];
@ -57,10 +53,7 @@
}) })
}, },
onTouchMove(){ onTouchMove(){
this.isTouchMove = true; this.onClose()
},
onTouchEnd(){
this.isTouchMove = false;
}, },
onSelectMenu(item) { onSelectMenu(item) {
this.$emit("select", item); this.$emit("select", item);
@ -89,9 +82,8 @@
width: 100%; width: 100%;
height: 100%; height: 100%;
background-color: #333; background-color: #333;
z-index: 99; z-index: 999;
opacity: 0.5; opacity: 0.5;
} }
.menu { .menu {
@ -100,7 +92,7 @@
border-radius: 7px; border-radius: 7px;
overflow: hidden; overflow: hidden;
background-color: #f5f6ff; background-color: #f5f6ff;
z-index: 100; z-index: 1000;
.menu-item { .menu-item {
height: 25px; height: 25px;
min-width: 150rpx; min-width: 150rpx;

3
im-uniapp/pages/chat/chat-box.vue

@ -780,8 +780,7 @@
padding: 5px; padding: 5px;
background-color: #f8f8f8; background-color: #f8f8f8;
line-height: 50px; line-height: 50px;
font-size: 40rpx; font-size: 36rpx;
font-weight: 600;
border: #dddddd solid 1px; border: #dddddd solid 1px;

15
im-uniapp/pages/group/group-info.vue

@ -15,7 +15,7 @@
<uni-icons type="plusempty" size="28" color="#888888"></uni-icons> <uni-icons type="plusempty" size="28" color="#888888"></uni-icons>
</view> </view>
</view> </view>
<view class="member-more" @click="onShowMoreMmeber()">查看更多群成员 ></view> <view class="member-more" @click="onShowMoreMmeber()">{{`查看全部群成员${groupMembers.length}`}}></view>
</view> </view>
<view class="group-detail"> <view class="group-detail">
<uni-section title="群聊名称:" titleFontSize="14px"> <uni-section title="群聊名称:" titleFontSize="14px">
@ -39,7 +39,7 @@
<text class="detail-text"> {{group.showNickName}}</text> <text class="detail-text"> {{group.showNickName}}</text>
</template> </template>
</uni-section> </uni-section>
<uni-section title="群公告:" titleFontSize="14px"> <uni-section v-if="group.notice" title="群公告:" titleFontSize="14px">
<uni-notice-bar :text="group.notice" /> <uni-notice-bar :text="group.notice" />
</uni-section> </uni-section>
<view v-if="!group.quit" class="group-edit" @click="onEditGroup()">修改群聊资料 > </view> <view v-if="!group.quit" class="group-edit" @click="onEditGroup()">修改群聊资料 > </view>
@ -237,9 +237,10 @@
} }
.member-more { .member-more {
padding: 20rpx; padding-top: 30rpx;
text-align: center; text-align: center;
font-size: 16px; font-size: 32rpx;
color: #333;
} }
} }
@ -253,10 +254,12 @@
font-size: 28rpx; font-size: 28rpx;
font-weight: 600; font-weight: 600;
} }
.group-edit { .group-edit {
padding: 20rpx; padding-top: 30rpx;
text-align: center; text-align: center;
font-size: 30rpx; font-size: 32rpx;
color: #333;
} }
} }

23
im-uniapp/pages/group/group-member.vue

@ -1,7 +1,7 @@
<template> <template>
<view class="page group-member"> <view class="page group-member">
<view class="search-bar"> <view class="search-bar">
<uni-search-bar v-model="searchText" radius="100" cancelButton="none" placeholder="输入成员昵称搜索"></uni-search-bar> <uni-search-bar v-model="searchText" radius="100" cancelButton="none" placeholder="输入昵称搜索"></uni-search-bar>
</view> </view>
<view class="member-items"> <view class="member-items">
<scroll-view class="scroll-bar" scroll-with-animation="true" scroll-y="true"> <scroll-view class="scroll-bar" scroll-with-animation="true" scroll-y="true">
@ -11,8 +11,15 @@
<head-image :name="member.showNickName" <head-image :name="member.showNickName"
:online="member.online" :url="member.headImage" :online="member.online" :url="member.headImage"
:size="100"></head-image> :size="100"></head-image>
<view class="member-name">{{ member.showNickName}}
<uni-tag v-if="member.userId==group.ownerId"
text="群主" size="small" circle
custom-style="background-color: #e30a0a;">
</uni-tag>
<uni-tag v-if="member.userId==userStore.userInfo.id"
text="我" size="small" circle></uni-tag>
<view class="member-name">{{ member.showNickName}}</view> </view>
<view class="member-kick"> <view class="member-kick">
<button type="warn" plain v-show="isOwner && !isSelf(member.userId)" size="mini" <button type="warn" plain v-show="isOwner && !isSelf(member.userId)" size="mini"
@ -125,6 +132,8 @@
white-space: nowrap; white-space: nowrap;
.member-name { .member-name {
display: flex;
align-items: center;
flex:1; flex:1;
padding-left: 20rpx; padding-left: 20rpx;
font-size: 30rpx; font-size: 30rpx;
@ -132,6 +141,16 @@
line-height: 60rpx; line-height: 60rpx;
white-space: nowrap; white-space: nowrap;
overflow: hidden; overflow: hidden;
.uni-tag {
margin-left: 5rpx;
width: 40rpx;
border: 0;
height: 30rpx;
line-height: 30rpx;
font-size: 20rpx;
text-align: center;
}
} }
} }

20
im-web/src/components/chat/ChatBox.vue

@ -689,7 +689,7 @@
.im-chat-main { .im-chat-main {
padding: 0; padding: 0;
background-color: #f8f8f8; background-color: white;
.im-chat-box { .im-chat-box {
>ul { >ul {
@ -716,7 +716,7 @@
box-sizing: border-box; box-sizing: border-box;
border-top: #ccc solid 1px; border-top: #ccc solid 1px;
padding: 2px; padding: 2px;
background-color: #e8f2ff; background-color: #f8faff;
>div { >div {
font-size: 22px; font-size: 22px;
@ -727,22 +727,20 @@
height: 30px; height: 30px;
text-align: center; text-align: center;
border-radius: 3px; border-radius: 3px;
margin: 3px; margin: 3px 5px;
color: #0f46ae;
&:hover { &:hover {
color: black; font-weight: 600;
color: #042259;
} }
&.chat-tool-active { &.chat-tool-active {
font-weight: 600; color: white;
color: #195ee2; background-color: #195ee2;
background-color: #ddd;
} }
} }
>div:hover {
color: #949494;
}
} }
.send-content-area { .send-content-area {

1
im-web/src/components/chat/ChatInput.vue

@ -480,7 +480,6 @@
left: 0; left: 0;
right: 0; right: 0;
bottom: 0; bottom: 0;
border: 1px solid #c3c3c3;
outline: none; outline: none;
padding: 5px; padding: 5px;
line-height: 30px; line-height: 30px;

29
im-web/src/components/chat/ChatItem.vue

@ -7,11 +7,13 @@
</div> </div>
<div class="chat-right"> <div class="chat-right">
<div class="chat-name"> <div class="chat-name">
<div class="chat-tag" v-if="chat.type=='GROUP'"> <div class="chat-name-text">
<el-tag size="mini" ></el-tag> <div>{{chat.showName}}</div>
<el-tag v-if="chat.type=='GROUP'" size="mini" effect="dark"></el-tag>
</div> </div>
<div class="chat-name-text">{{chat.showName}}</div>
<div class="chat-time-text">{{showTime}}</div> <div class="chat-time-text">{{showTime}}</div>
</div> </div>
<div class="chat-content"> <div class="chat-content">
<div class="chat-at-text">{{atText}}</div> <div class="chat-at-text">{{atText}}</div>
@ -162,19 +164,26 @@
line-height: 25px; line-height: 25px;
height: 25px; height: 25px;
.chat-tag {
display: flex;
align-items: center;
justify-content: center;
margin-right: 1px;
}
.chat-name-text { .chat-name-text {
flex: 1; flex: 1;
display: flex;
align-items: center;
font-size: 15px; font-size: 15px;
font-weight: 600; font-weight: 600;
white-space: nowrap; white-space: nowrap;
overflow: hidden; overflow: hidden;
.el-tag {
background-color: #2830d3;
border-radius: 10px;
border: 0;
height: 16px;
line-height: 16px;
font-size: 10px;
margin-left: 2px;
opacity: 0.8;
}
} }

14
im-web/src/components/common/HeadImage.vue

@ -3,7 +3,7 @@
<img class="avatar-image" v-show="url" :src="url" <img class="avatar-image" v-show="url" :src="url"
:style="avatarImageStyle" loading="lazy" /> :style="avatarImageStyle" loading="lazy" />
<div class="avatar-text" v-show="!url" :style="avatarTextStyle"> <div class="avatar-text" v-show="!url" :style="avatarTextStyle">
{{name.substring(0,1).toUpperCase()}}</div> {{name.substring(0,2).toUpperCase()}}</div>
<div v-show="online" class="online" title="用户当前在线"></div> <div v-show="online" class="online" title="用户当前在线"></div>
<slot></slot> <slot></slot>
</div> </div>
@ -15,8 +15,8 @@
name: "headImage", name: "headImage",
data() { data() {
return { return {
colors:["#7dd24b","#c7515a","#db68ef","#15d29b","#85029b", colors: ["#5daa31", "#c7515a", "#e03697", "#85029b",
"#c9b455","#fb2609","#bda818","#af0831","#326eb6"] "#c9b455", "#326eb6"]
} }
}, },
@ -36,7 +36,7 @@
}, },
radius:{ radius:{
type: String, type: String,
default: "10%" default: "50%"
}, },
url: { url: {
type: String type: String
@ -74,7 +74,8 @@
let w = this.width ? this.width : this.size; let w = this.width ? this.width : this.size;
let h = this.height ? this.height : this.size; let h = this.height ? this.height : this.size;
return `width: ${w}px;height:${h}px; return `width: ${w}px;height:${h}px;
color:${this.textColor};font-size:${w*0.6}px; background-color:${this.textColor};
font-size:${w*0.35}px;
border-radius: ${this.radius};` border-radius: ${this.radius};`
}, },
textColor(){ textColor(){
@ -99,8 +100,7 @@
} }
.avatar-text{ .avatar-text{
background-color: #f2f2f2; /* 默认背景色 */ color: white;
border-radius: 15%; /* 圆角效果 */
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;

6
im-web/src/components/common/UserInfo.vue

@ -3,7 +3,8 @@
<div class="user-info" :style="{left: pos.x+'px',top: pos.y+'px'}" @click.stop> <div class="user-info" :style="{left: pos.x+'px',top: pos.y+'px'}" @click.stop>
<div class="user-info-box"> <div class="user-info-box">
<div class="avatar"> <div class="avatar">
<head-image :name="user.nickName" :url="user.headImageThumb" :size="60" :online="user.online" <head-image :name="user.nickName" :url="user.headImageThumb" :size="70"
:online="user.online" radius="10%"
@click.native="showFullImage()"> </head-image> @click.native="showFullImage()"> </head-image>
</div> </div>
<div> <div>
@ -114,6 +115,7 @@
.user-info-box { .user-info-box {
display: flex; display: flex;
align-items: center;
.user-info-items { .user-info-items {
margin-left: 10px; margin-left: 10px;
@ -125,7 +127,7 @@
} }
.el-descriptions__title { .el-descriptions__title {
font-size: 20px; font-size: 18px;
} }
.el-descriptions-item__cell { .el-descriptions-item__cell {

2
im-web/src/view/Friend.vue

@ -25,7 +25,7 @@
<div v-show="userInfo.id"> <div v-show="userInfo.id">
<div class="friend-detail"> <div class="friend-detail">
<head-image :size="200" :name="userInfo.nickName" :url="userInfo.headImage" <head-image :size="200" :name="userInfo.nickName" :url="userInfo.headImage"
@click.native="showFullImage()"></head-image> @click.native="showFullImage()" radius="10%"></head-image>
<div> <div>
<div class="info-item"> <div class="info-item">
<el-descriptions title="好友信息" class="description" :column="1"> <el-descriptions title="好友信息" class="description" :column="1">

2
im-web/src/view/Group.vue

@ -30,7 +30,7 @@
<i v-else class="el-icon-plus avatar-uploader-icon"></i> <i v-else class="el-icon-plus avatar-uploader-icon"></i>
</file-upload> </file-upload>
<head-image v-show="!isOwner" class="avatar" :size="200" :url="activeGroup.headImage" <head-image v-show="!isOwner" class="avatar" :size="200" :url="activeGroup.headImage"
:name="activeGroup.showGroupName"> radius="10%" :name="activeGroup.showGroupName">
</head-image> </head-image>
<el-button class="send-btn" icon="el-icon-position" type="primary" <el-button class="send-btn" icon="el-icon-position" type="primary"
@click="onSendMessage()">发消息</el-button> @click="onSendMessage()">发消息</el-button>

2
im-web/src/view/Home.vue

@ -385,7 +385,7 @@
.icon { .icon {
font-size: 26px; font-size: 26px;
color: #888; color: #666;
} }
.unread-text { .unread-text {

Loading…
Cancel
Save