Browse Source

前端代码格式化(使用vscode默认格式)

master
xsx 1 year ago
parent
commit
cc627ec45a
  1. 1
      im-uniapp/App.vue
  2. 1
      im-uniapp/components/bar/arrow-bar.vue
  3. 2
      im-uniapp/components/bar/btn-bar.vue
  4. 5
      im-uniapp/components/chat-at-box/chat-at-box.vue
  5. 3
      im-uniapp/components/chat-group-readed/chat-group-readed.vue
  6. 1
      im-uniapp/components/chat-item/chat-item.vue
  7. 1
      im-uniapp/components/chat-message-item/chat-message-item.vue
  8. 3
      im-uniapp/components/file-upload/file-upload.vue
  9. 7
      im-uniapp/components/friend-item/friend-item.vue
  10. 3
      im-uniapp/components/group-item/group-item.vue
  11. 3
      im-uniapp/components/group-member-selector/group-member-selector.vue
  12. 5
      im-uniapp/components/group-rtc-join/group-rtc-join.vue
  13. 4
      im-uniapp/components/head-image/head-image.vue
  14. 3
      im-uniapp/components/image-upload/image-upload.vue
  15. 4
      im-uniapp/components/loading/loading.vue
  16. 9
      im-uniapp/components/nav-bar/nav-bar.vue
  17. 2
      im-uniapp/components/pop-menu/pop-menu.vue
  18. 3
      im-uniapp/main.js
  19. 7
      im-uniapp/manifest.json
  20. 55
      im-uniapp/pages.json
  21. 4
      im-uniapp/pages/chat/chat-box.vue
  22. 5
      im-uniapp/pages/chat/chat-private-video.vue
  23. 7
      im-uniapp/pages/chat/chat.vue
  24. 9
      im-uniapp/pages/friend/friend-add.vue
  25. 10
      im-uniapp/pages/friend/friend.vue
  26. 11
      im-uniapp/pages/group/group-edit.vue
  27. 1
      im-uniapp/pages/group/group-info.vue
  28. 17
      im-uniapp/pages/group/group-invite.vue
  29. 12
      im-uniapp/pages/group/group-member.vue
  30. 1
      im-uniapp/pages/group/group.vue
  31. 6
      im-uniapp/pages/mine/mine-edit.vue
  32. 3
      im-uniapp/pages/mine/mine-password.vue
  33. 12
      im-uniapp/pages/mine/mine.vue
  34. 2
      im-uniapp/store/userStore.js
  35. 2
      im-uniapp/vite.config.js
  36. 1
      im-web/src/view/Login.vue

1
im-uniapp/App.vue

@ -390,6 +390,7 @@
uni-page-head { uni-page-head {
display: none; // h5 display: none; // h5
} }
// #endif // #endif
.tab-page { .tab-page {

1
im-uniapp/components/bar/arrow-bar.vue

@ -27,6 +27,7 @@
background-color: white; background-color: white;
line-height: 90rpx; line-height: 90rpx;
display: flex; display: flex;
.title { .title {
flex: 1; flex: 1;
margin-left: 40rpx; margin-left: 40rpx;

2
im-uniapp/components/bar/btn-bar.vue

@ -53,11 +53,13 @@
text-align: center; text-align: center;
display: flex; display: flex;
justify-content: center; justify-content: center;
.icon { .icon {
font-size: 40rpx; font-size: 40rpx;
font-weight: 600; font-weight: 600;
margin-right: 10rpx; margin-right: 10rpx;
} }
.title { .title {
font-size: 32rpx; font-size: 32rpx;
font-weight: 600; font-weight: 600;

5
im-uniapp/components/chat-at-box/chat-at-box.vue

@ -9,7 +9,7 @@
</view> </view>
<scroll-view v-show="atUserIds.length > 0" scroll-x="true" scroll-left="120"> <scroll-view v-show="atUserIds.length > 0" scroll-x="true" scroll-left="120">
<view class="at-user-items"> <view class="at-user-items">
<view v-for="m in showMembers" v-show="m.checked" class="at-user-item"> <view v-for="m in showMembers" v-show="m.checked" class="at-user-item" :key="m.userId">
<head-image :name="m.showNickName" :url="m.headImage" size="mini"></head-image> <head-image :name="m.showNickName" :url="m.headImage" size="mini"></head-image>
</view> </view>
</view> </view>
@ -19,8 +19,7 @@
</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">
<view v-for="m in showMembers" v-show="m.showNickName.includes(searchText)" <view v-for="m in showMembers" v-show="m.showNickName.includes(searchText)" :key="m.userId">
:key="m.userId">
<view class="member-item" :class="{ checked: m.checked }" @click="onSwitchChecked(m)"> <view class="member-item" :class="{ checked: m.checked }" @click="onSwitchChecked(m)">
<head-image :name="m.showNickName" :online="m.online" :url="m.headImage" <head-image :name="m.showNickName" :online="m.online" :url="m.headImage"
size="small"></head-image> size="small"></head-image>

3
im-uniapp/components/chat-group-readed/chat-group-readed.vue

@ -2,7 +2,8 @@
<uni-popup ref="popup" type="bottom"> <uni-popup ref="popup" type="bottom">
<view class="chat-group-readed"> <view class="chat-group-readed">
<view class="uni-padding-wrap uni-common-mt"> <view class="uni-padding-wrap uni-common-mt">
<uni-segmented-control :current="current" :values="items" style-type="button" @clickItem="onClickItem"/> <uni-segmented-control :current="current" :values="items" style-type="button"
@clickItem="onClickItem" />
</view> </view>
<view class="content"> <view class="content">
<view v-if="current === 0"> <view v-if="current === 0">

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

@ -155,6 +155,7 @@
font-size: $im-font-size-smaller; font-size: $im-font-size-smaller;
color: $im-text-color-lighter; color: $im-text-color-lighter;
padding-top: 8rpx; padding-top: 8rpx;
.chat-at-text { .chat-at-text {
color: $im-color-danger; color: $im-color-danger;
} }

1
im-uniapp/components/chat-message-item/chat-message-item.vue

@ -393,6 +393,7 @@
line-height: $im-font-size-smaller-extra; line-height: $im-font-size-smaller-extra;
font-size: $im-font-size-smaller-extra; font-size: $im-font-size-smaller-extra;
padding-top: 2rpx; padding-top: 2rpx;
.chat-readed { .chat-readed {
display: block; display: block;
padding-top: 2rpx; padding-top: 2rpx;

3
im-uniapp/components/file-upload/file-upload.vue

@ -113,5 +113,4 @@
} }
</script> </script>
<style> <style></style>
</style>

7
im-uniapp/components/friend-item/friend-item.vue

@ -4,10 +4,8 @@
<view class="friend-info"> <view class="friend-info">
<view class="friend-name">{{ friend.nickName }}</view> <view class="friend-name">{{ friend.nickName }}</view>
<view class="friend-online"> <view class="friend-online">
<image v-show="friend.onlineWeb" class="online" src="/static/image/online_web.png" <image v-show="friend.onlineWeb" class="online" src="/static/image/online_web.png" title="电脑设备在线" />
title="电脑设备在线" /> <image v-show="friend.onlineApp" class="online" src="/static/image/online_app.png" title="移动设备在线" />
<image v-show="friend.onlineApp" class="online" src="/static/image/online_app.png"
title="移动设备在线" />
</view> </view>
</view> </view>
</view> </view>
@ -65,6 +63,7 @@
.friend-online { .friend-online {
margin-top: 4rpx; margin-top: 4rpx;
.online { .online {
padding-right: 4rpx; padding-right: 4rpx;
width: 24rpx; width: 24rpx;

3
im-uniapp/components/group-item/group-item.vue

@ -1,7 +1,6 @@
<template> <template>
<view class="group-item" @click="showGroupInfo()"> <view class="group-item" @click="showGroupInfo()">
<head-image :name="group.showGroupName" <head-image :name="group.showGroupName" :url="group.headImage" size="small"></head-image>
:url="group.headImage" size="small"></head-image>
<view class="group-name"> <view class="group-name">
<view>{{ group.showGroupName }}</view> <view>{{ group.showGroupName }}</view>
</view> </view>

3
im-uniapp/components/group-member-selector/group-member-selector.vue

@ -9,7 +9,7 @@
</view> </view>
<scroll-view v-show="checkedIds.length > 0" scroll-x="true" scroll-left="120"> <scroll-view v-show="checkedIds.length > 0" scroll-x="true" scroll-left="120">
<view class="checked-users"> <view class="checked-users">
<view v-for="m in members" v-show="m.checked" class="user-item"> <view v-for="m in members" v-show="m.checked" class="user-item" :key="m.userId">
<head-image :name="m.showNickName" :url="m.headImage" :size="60"></head-image> <head-image :name="m.showNickName" :url="m.headImage" :size="60"></head-image>
</view> </view>
</view> </view>
@ -135,6 +135,7 @@
align-items: center; align-items: center;
height: 90rpx; height: 90rpx;
padding: 0 30rpx; padding: 0 30rpx;
.user-item { .user-item {
padding: 3rpx; padding: 3rpx;
} }

5
im-uniapp/components/group-rtc-join/group-rtc-join.vue

@ -1,7 +1,6 @@
<template> <template>
<uni-popup ref="popup" type="center"> <uni-popup ref="popup" type="center">
<uni-popup-dialog mode="base" :duration="2000" title="是否加入通话?" confirmText="加入" <uni-popup-dialog mode="base" :duration="2000" title="是否加入通话?" confirmText="加入" @confirm="onOk">
@confirm="onOk">
<div class="group-rtc-join"> <div class="group-rtc-join">
<div class="host-info"> <div class="host-info">
<div>发起人</div> <div>发起人</div>
@ -11,7 +10,7 @@
<div>{{ rtcInfo.userInfos.length + '人正在通话中' }}</div> <div>{{ rtcInfo.userInfos.length + '人正在通话中' }}</div>
<scroll-view scroll-x="true" scroll-left="120"> <scroll-view scroll-x="true" scroll-left="120">
<view class="user-list"> <view class="user-list">
<view v-for="user in rtcInfo.userInfos" class="user-item"> <view v-for="user in rtcInfo.userInfos" class="user-item" :key="user.id">
<head-image :name="user.nickName" :url="user.headImage" :size="80"></head-image> <head-image :name="user.nickName" :url="user.headImage" :size="80"></head-image>
</view> </view>
</view> </view>

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

@ -1,7 +1,7 @@
<template> <template>
<view class="head-image" @click="showUserInfo($event)" :title="name"> <view class="head-image" @click="showUserInfo($event)" :title="name">
<image class="avatar-image" v-if="url" :src="url" <image class="avatar-image" v-if="url" :src="url" :style="avatarImageStyle" lazy-load="true"
:style="avatarImageStyle" lazy-load="true" mode="aspectFill"/> mode="aspectFill" />
<view class="avatar-text" v-if="!url" :style="avatarTextStyle"> <view class="avatar-text" v-if="!url" :style="avatarTextStyle">
{{ name?.substring(0, 1).toUpperCase() }} {{ name?.substring(0, 1).toUpperCase() }}
</view> </view>

3
im-uniapp/components/image-upload/image-upload.vue

@ -89,5 +89,4 @@
} }
</script> </script>
<style> <style></style>
</style>

4
im-uniapp/components/loading/loading.vue

@ -6,9 +6,7 @@
</template> </template>
<script> <script>
import {
computed
} from "vue"
export default { export default {
data() { data() {
return {} return {}

9
im-uniapp/components/nav-bar/nav-bar.vue

@ -11,9 +11,11 @@
<slot></slot> <slot></slot>
</view> </view>
<view class="btn"> <view class="btn">
<uni-icons class="btn-item" v-if="search" type="search" :size="iconFontSize" @click="$emit('search')"></uni-icons> <uni-icons class="btn-item" v-if="search" type="search" :size="iconFontSize"
@click="$emit('search')"></uni-icons>
<uni-icons class="btn-item" v-if="add" type="plusempty" :size="iconFontSize" @click="$emit('add')"></uni-icons> <uni-icons class="btn-item" v-if="add" type="plusempty" :size="iconFontSize" @click="$emit('add')"></uni-icons>
<uni-icons class="btn-item" v-if="more" type="more-filled" :size="iconFontSize" @click="$emit('more')"></uni-icons> <uni-icons class="btn-item" v-if="more" type="more-filled" :size="iconFontSize"
@click="$emit('more')"></uni-icons>
</view> </view>
</view> </view>
</view> </view>
@ -85,8 +87,7 @@ export default {
box-sizing: border-box; box-sizing: border-box;
height: $im-nav-bar-height; height: $im-nav-bar-height;
.title { .title {}
}
.back { .back {
position: absolute; position: absolute;

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

@ -6,7 +6,6 @@
<view v-if="isShowMenu" class="pop-menu" @touchstart="onClose()" @contextmenu.prevent=""></view> <view v-if="isShowMenu" class="pop-menu" @touchstart="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="20"></uni-icons>-->
<text :style="itemStyle(item)"> {{ item.name }}</text> <text :style="itemStyle(item)"> {{ item.name }}</text>
</view> </view>
</view> </view>
@ -100,6 +99,7 @@
background-color: #fff; background-color: #fff;
z-index: 1000; z-index: 1000;
box-shadow: $im-box-shadow-dark; box-shadow: $im-box-shadow-dark;
.menu-item { .menu-item {
height: 28px; height: 28px;
min-width: 120rpx; min-width: 120rpx;

3
im-uniapp/main.js

@ -27,9 +27,6 @@ import * as recorder from './common/recorder-h5';
// #ifndef H5 // #ifndef H5
import * as recorder from './common/recorder-app'; import * as recorder from './common/recorder-app';
// #endif // #endif
export function createApp() { export function createApp() {
const app = createSSRApp(App) const app = createSSRApp(App)
app.use(uviewPlus); app.use(uviewPlus);

7
im-uniapp/manifest.json

@ -45,7 +45,11 @@
"<uses-permission android:name=\"android.permission.MODIFY_AUDIO_SETTINGS\" />", "<uses-permission android:name=\"android.permission.MODIFY_AUDIO_SETTINGS\" />",
"<uses-permission android:name=\"android.permission.RECORD_AUDIO\" />" "<uses-permission android:name=\"android.permission.RECORD_AUDIO\" />"
], ],
"abiFilters" : [ "armeabi-v7a", "arm64-v8a", "x86" ], "abiFilters": [
"armeabi-v7a",
"arm64-v8a",
"x86"
],
"minSdkVersion": 21 "minSdkVersion": 21
}, },
/* ios */ /* ios */
@ -128,4 +132,3 @@
} }
} }
/* ios */ /* SDK */ /* ios */ /* SDK */

55
im-uniapp/pages.json

@ -7,39 +7,56 @@
"^u-([^-].*)": "@/uni_modules/uview-plus/components/u-$1/u-$1.vue" "^u-([^-].*)": "@/uni_modules/uview-plus/components/u-$1/u-$1.vue"
} }
}, },
"pages": [{ "pages": [
{
"path": "pages/login/login" "path": "pages/login/login"
}, { },
{
"path": "pages/register/register" "path": "pages/register/register"
},{ },
{
"path": "pages/chat/chat" "path": "pages/chat/chat"
}, { },
{
"path": "pages/friend/friend" "path": "pages/friend/friend"
}, { },
{
"path": "pages/group/group" "path": "pages/group/group"
}, { },
{
"path": "pages/mine/mine" "path": "pages/mine/mine"
}, { },
{
"path": "pages/common/user-info" "path": "pages/common/user-info"
}, { },
{
"path": "pages/chat/chat-box" "path": "pages/chat/chat-box"
},{ },
{
"path": "pages/chat/chat-private-video" "path": "pages/chat/chat-private-video"
},{ },
{
"path": "pages/chat/chat-group-video" "path": "pages/chat/chat-group-video"
}, { },
{
"path": "pages/friend/friend-add" "path": "pages/friend/friend-add"
}, { },
{
"path": "pages/group/group-info" "path": "pages/group/group-info"
}, { },
{
"path": "pages/group/group-edit" "path": "pages/group/group-edit"
}, { },
{
"path": "pages/group/group-invite" "path": "pages/group/group-invite"
}, { },
{
"path": "pages/group/group-member" "path": "pages/group/group-member"
}, { },
{
"path": "pages/mine/mine-edit" "path": "pages/mine/mine-edit"
},{ },
{
"path": "pages/mine/mine-password" "path": "pages/mine/mine-password"
} }
], ],
@ -53,12 +70,12 @@
"selectedColor": "#587ff0", "selectedColor": "#587ff0",
"borderStyle": "black", "borderStyle": "black",
"backgroundColor": "#ffffff", "backgroundColor": "#ffffff",
"list": [{ "list": [
{
"pagePath": "pages/chat/chat", "pagePath": "pages/chat/chat",
"iconPath": "static/tarbar/chat.png", "iconPath": "static/tarbar/chat.png",
"selectedIconPath": "static/tarbar/chat_active.png", "selectedIconPath": "static/tarbar/chat_active.png",
"text": "消息" "text": "消息"
}, },
{ {
"pagePath": "pages/friend/friend", "pagePath": "pages/friend/friend",

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

@ -41,7 +41,8 @@
@touchend.prevent="sendTextMessage()" size="mini">发送</button> @touchend.prevent="sendTextMessage()" size="mini">发送</button>
</view> </view>
<view class="chat-tab-bar" v-show="chatTabBox!='none' || (showKeyBoard && !isH5) " :style="{height:`${keyboardHeight}px`}"> <view class="chat-tab-bar" v-show="chatTabBox != 'none' || (showKeyBoard && !isH5)"
:style="{ height: `${keyboardHeight}px` }">
<view v-if="chatTabBox == 'tools'" class="chat-tools"> <view v-if="chatTabBox == 'tools'" class="chat-tools">
<view class="chat-tools-item"> <view class="chat-tools-item">
<image-upload :maxCount="9" sourceType="album" :onBefore="onUploadImageBefore" <image-upload :maxCount="9" sourceType="album" :onBefore="onUploadImageBefore"
@ -832,6 +833,7 @@
} }
$icon-color: rgba(0, 0, 0, 0.88); $icon-color: rgba(0, 0, 0, 0.88);
.send-bar { .send-bar {
display: flex; display: flex;
align-items: center; align-items: center;

5
im-uniapp/pages/chat/chat-private-video.vue

@ -96,8 +96,5 @@
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.chat-web-view {}
.chat-web-view{
}
</style> </style>

7
im-uniapp/pages/chat/chat.vue

@ -16,10 +16,8 @@
</view> </view>
<scroll-view class="scroll-bar" v-else scroll-with-animation="true" scroll-y="true"> <scroll-view class="scroll-bar" v-else scroll-with-animation="true" scroll-y="true">
<view v-for="(chat, index) in chatStore.chats" :key="index"> <view v-for="(chat, index) in chatStore.chats" :key="index">
<pop-menu v-if="isShowChat(chat)" :items="menu.items" <pop-menu v-if="isShowChat(chat)" :items="menu.items" @select="onSelectMenu($event, index)">
@select="onSelectMenu($event,index)"> <chat-item :chat="chat" :index="index" :active="menu.chatIdx == index"></chat-item>
<chat-item :chat="chat" :index="index"
:active="menu.chatIdx==index"></chat-item>
</pop-menu> </pop-menu>
</view> </view>
</scroll-view> </scroll-view>
@ -27,7 +25,6 @@
</template> </template>
<script> <script>
import useChatStore from '@/store/chatStore.js'
export default { export default {
data() { data() {

9
im-uniapp/pages/friend/friend-add.vue

@ -3,16 +3,16 @@
<nav-bar back>添加好友</nav-bar> <nav-bar back>添加好友</nav-bar>
<view class="nav-bar"> <view class="nav-bar">
<view class="nav-search"> <view class="nav-search">
<uni-search-bar v-model="searchText" radius="100" :focus="true" @confirm="onSearch()" @cancel="onCancel()" <uni-search-bar v-model="searchText" radius="100" :focus="true" @confirm="onSearch()"
placeholder="用户名/昵称"></uni-search-bar> @cancel="onCancel()" placeholder="用户名/昵称"></uni-search-bar>
</view> </view>
</view> </view>
<view class="user-items"> <view class="user-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">
<view v-for="(user) in users" :key="user.id" v-show="user.id != userStore.userInfo.id"> <view v-for="(user) in users" :key="user.id" v-show="user.id != userStore.userInfo.id">
<view class="user-item"> <view class="user-item">
<head-image :id="user.id" :name="user.nickName" <head-image :id="user.id" :name="user.nickName" :online="user.online"
:online="user.online" :url="user.headImage"></head-image> :url="user.headImage"></head-image>
<view class="user-name">{{ user.nickName }}</view> <view class="user-name">{{ user.nickName }}</view>
<view class="user-btns"> <view class="user-btns">
<button type="primary" v-show="!isFriend(user.id)" size="mini" <button type="primary" v-show="!isFriend(user.id)" size="mini"
@ -88,6 +88,7 @@
position: relative; position: relative;
flex: 1; flex: 1;
overflow: hidden; overflow: hidden;
.user-item { .user-item {
height: 120rpx; height: 120rpx;
display: flex; display: flex;

10
im-uniapp/pages/friend/friend.vue

@ -1,9 +1,11 @@
<template> <template>
<nav-bar add search @add="onAddNewFriends" @search="showSearch = !showSearch">好友</nav-bar>
<view class="tab-page friend"> <view class="tab-page friend">
<nav-bar add search @add="onAddNewFriends" @search="showSearch = !showSearch">好友</nav-bar>
<view class="nav-bar" v-if="showSearch"> <view class="nav-bar" v-if="showSearch">
<view class="nav-search"> <view class="nav-search">
<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> </view>
<view class="friend-tip" v-if="friends.length == 0"> <view class="friend-tip" v-if="friends.length == 0">
@ -21,7 +23,6 @@
</template> </template>
</up-index-list> </up-index-list>
</view> </view>
</view> </view>
</template> </template>
@ -112,13 +113,16 @@
background-color: unset !important; background-color: unset !important;
border-bottom: none !important; border-bottom: none !important;
} }
:deep(.u-index-anchor__text) { :deep(.u-index-anchor__text) {
color: $im-text-color !important; color: $im-text-color !important;
} }
:deep(.u-index-list__letter__item) { :deep(.u-index-list__letter__item) {
width: 48rpx !important; width: 48rpx !important;
height: 48rpx !important; height: 48rpx !important;
} }
:deep(.u-index-list__letter__item__index) { :deep(.u-index-list__letter__item__index) {
font-size: $im-font-size-small !important; font-size: $im-font-size-small !important;
} }

11
im-uniapp/pages/group/group-edit.vue

@ -1,6 +1,6 @@
<template> <template>
<nav-bar back>修改群资料</nav-bar>
<view v-if="userStore.userInfo.type == 1" class="page group-edit"> <view v-if="userStore.userInfo.type == 1" class="page group-edit">
<nav-bar back>修改群资料</nav-bar>
<uni-card :is-shadow="false" is-full :border="false"> <uni-card :is-shadow="false" is-full :border="false">
<uni-forms ref="form" :modelValue="group" :rules="rules" validate-trigger="bind" label-position="top" <uni-forms ref="form" :modelValue="group" :rules="rules" validate-trigger="bind" label-position="top"
label-width="100%"> label-width="100%">
@ -8,8 +8,8 @@
<image-upload v-if="isOwner" :onSuccess="onUnloadImageSuccess"> <image-upload v-if="isOwner" :onSuccess="onUnloadImageSuccess">
<image :src="group.headImageThumb" class="group-image"></image> <image :src="group.headImageThumb" class="group-image"></image>
</image-upload> </image-upload>
<head-image v-if="!isOwner" :name="group.showGroupName" <head-image v-if="!isOwner" :name="group.showGroupName" :url="group.headImageThumb"
:url="group.headImageThumb" :size="200"></head-image> :size="200"></head-image>
</uni-forms-item> </uni-forms-item>
<uni-forms-item label="群聊名称" name="name" :required="true"> <uni-forms-item label="群聊名称" name="name" :required="true">
<uni-easyinput type="text" v-model="group.name" :disabled="!isOwner" placeholder="请输入群聊名称" /> <uni-easyinput type="text" v-model="group.name" :disabled="!isOwner" placeholder="请输入群聊名称" />
@ -18,7 +18,8 @@
<uni-easyinput v-model="group.remarkGroupName" type="text" :placeholder="group.name" /> <uni-easyinput v-model="group.remarkGroupName" type="text" :placeholder="group.name" />
</uni-forms-item> </uni-forms-item>
<uni-forms-item label="我在本群的昵称" name="remarkNickName"> <uni-forms-item label="我在本群的昵称" name="remarkNickName">
<uni-easyinput v-model="group.remarkNickName" type="text" :placeholder="userStore.userInfo.nickName" /> <uni-easyinput v-model="group.remarkNickName" type="text"
:placeholder="userStore.userInfo.nickName" />
</uni-forms-item> </uni-forms-item>
<uni-forms-item label="群公告" name="notice"> <uni-forms-item label="群公告" name="notice">
<uni-easyinput type="textarea" v-model="group.notice" :disabled="!isOwner" placeholder="请输入群公告" /> <uni-easyinput type="textarea" v-model="group.notice" :disabled="!isOwner" placeholder="请输入群公告" />
@ -45,7 +46,6 @@
} }
} }
}, },
methods: { methods: {
submit() { submit() {
if (this.group.id) { if (this.group.id) {
@ -150,6 +150,7 @@
border-radius: 5%; border-radius: 5%;
} }
} }
.avatar { .avatar {
margin-top: -30px; margin-top: -30px;
} }

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

@ -30,7 +30,6 @@
<text class="detail-text">{{ ownerName }}</text> <text class="detail-text">{{ ownerName }}</text>
</template> </template>
</uni-section> </uni-section>
<uni-section title="群名备注"> <uni-section title="群名备注">
<template v-slot:right> <template v-slot:right>
<text class="detail-text"> {{ group.remarkGroupName }}</text> <text class="detail-text"> {{ group.remarkGroupName }}</text>

17
im-uniapp/pages/group/group-invite.vue

@ -2,26 +2,25 @@
<view class="page group-invite"> <view class="page group-invite">
<view class="nav-bar"> <view class="nav-bar">
<view class="nav-search"> <view class="nav-search">
<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> </view>
<view class="friend-items"> <view class="friend-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">
<view v-for="friend in friendItems" v-show="!searchText || friend.nickName.includes(searchText)" <view v-for="friend in friendItems" v-show="!searchText || friend.nickName.includes(searchText)"
:key="friend.id"> :key="friend.id">
<view class="friend-item" @click="onSwitchChecked(friend)" :class="{checked: friend.checked, disabled: friend.disabled}"> <view class="friend-item" @click="onSwitchChecked(friend)"
<head-image :name="friend.nickName" :class="{ checked: friend.checked, disabled: friend.disabled }">
:online="friend.online" :url="friend.headImage"></head-image> <head-image :name="friend.nickName" :online="friend.online"
:url="friend.headImage"></head-image>
<view class="friend-name">{{ friend.nickName }}</view> <view class="friend-name">{{ friend.nickName }}</view>
<!-- <view class="friend-checked">-->
<!-- <radio :checked="friend.checked" :disabled="friend.disabled" @click.stop="onSwitchChecked(friend)"/>-->
<!-- </view>-->
</view> </view>
</view> </view>
</scroll-view> </scroll-view>
</view> </view>
<button class="bottom-btn" type="primary" :disabled="inviteSize==0" @click="onInviteFriends()">邀请({{inviteSize}}) </button> <button class="bottom-btn" type="primary" :disabled="inviteSize == 0"
@click="onInviteFriends()">邀请({{ inviteSize }}) </button>
</view> </view>
</template> </template>

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

@ -3,7 +3,8 @@
<nav-bar back>群成员</nav-bar> <nav-bar back>群成员</nav-bar>
<view class="nav-bar"> <view class="nav-bar">
<view class="nav-search"> <view class="nav-search">
<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> </view>
<view class="member-items"> <view class="member-items">
@ -11,13 +12,12 @@
<view v-for="(member, idx) in groupMembers" <view v-for="(member, idx) in groupMembers"
v-show="!searchText || member.showNickName.includes(searchText)" :key="idx"> v-show="!searchText || member.showNickName.includes(searchText)" :key="idx">
<view class="member-item" @click="onShowUserInfo(member.userId)"> <view class="member-item" @click="onShowUserInfo(member.userId)">
<head-image :name="member.showNickName" :online="member.online" :url="member.headImage"></head-image> <head-image :name="member.showNickName" :online="member.online"
:url="member.headImage"></head-image>
<view class="member-name">{{ member.showNickName }} <view class="member-name">{{ member.showNickName }}
<uni-tag v-if="member.userId==group.ownerId" <uni-tag v-if="member.userId == group.ownerId" text="群主" size="small" circle type="error">
text="群主" size="small" circle type="error">
</uni-tag> </uni-tag>
<uni-tag v-if="member.userId==userStore.userInfo.id" <uni-tag v-if="member.userId == userStore.userInfo.id" text="我" size="small" circle></uni-tag>
text="我" size="small" circle></uni-tag>
</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"

1
im-uniapp/pages/group/group.vue

@ -39,7 +39,6 @@
}) })
} }
} }
} }
</script> </script>

6
im-uniapp/pages/mine/mine-edit.vue

@ -2,8 +2,7 @@
<view class="page mine-edit"> <view class="page mine-edit">
<nav-bar back>修改我的信息</nav-bar> <nav-bar back>修改我的信息</nav-bar>
<uni-card :is-shadow="false" is-full :border="false"> <uni-card :is-shadow="false" is-full :border="false">
<uni-forms ref="form" :modelValue="userInfo" label-position="top" <uni-forms ref="form" :modelValue="userInfo" label-position="top" label-width="100%">
label-width="100%">
<uni-forms-item name="headImage" class="avatar"> <uni-forms-item name="headImage" class="avatar">
<image-upload :onSuccess="onUnloadImageSuccess"> <image-upload :onSuccess="onUnloadImageSuccess">
<image :src="userInfo.headImageThumb" class="head-image"></image> <image :src="userInfo.headImageThumb" class="head-image"></image>
@ -16,7 +15,8 @@
<uni-easyinput v-model="userInfo.nickName" type="text" :placeholder="userInfo.userName" /> <uni-easyinput v-model="userInfo.nickName" type="text" :placeholder="userInfo.userName" />
</uni-forms-item> </uni-forms-item>
<uni-forms-item label="性别" name="sex"> <uni-forms-item label="性别" name="sex">
<uni-data-checkbox v-model="userInfo.sex" :localdata="[{text: '男', value: 0}, {text: '女', value: 1}]"></uni-data-checkbox> <uni-data-checkbox v-model="userInfo.sex"
:localdata="[{ text: '男', value: 0 }, { text: '女', value: 1 }]"></uni-data-checkbox>
</uni-forms-item> </uni-forms-item>
<uni-forms-item label="签名" name="signature"> <uni-forms-item label="签名" name="signature">
<uni-easyinput type="textarea" v-model="userInfo.signature" placeholder="编辑个性标签,展示我的独特态度" /> <uni-easyinput type="textarea" v-model="userInfo.signature" placeholder="编辑个性标签,展示我的独特态度" />

3
im-uniapp/pages/mine/mine-password.vue

@ -98,5 +98,4 @@
} }
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss"></style>
</style>

12
im-uniapp/pages/mine/mine.vue

@ -3,18 +3,14 @@
<nav-bar>我的</nav-bar> <nav-bar>我的</nav-bar>
<uni-card :is-shadow="false" is-full :border="false"> <uni-card :is-shadow="false" is-full :border="false">
<view class="content" @click="onModifyInfo()"> <view class="content" @click="onModifyInfo()">
<head-image :name="userInfo.nickName" <head-image :name="userInfo.nickName" :url="userInfo.headImage" :size="160"></head-image>
:url="userInfo.headImage"
:size="160"></head-image>
<view class="info-item"> <view class="info-item">
<view class="info-primary"> <view class="info-primary">
<text class="info-username"> <text class="info-username">
{{ userInfo.userName }} {{ userInfo.userName }}
</text> </text>
<text v-show="userInfo.sex==0" class="iconfont icon-man" <text v-show="userInfo.sex == 0" class="iconfont icon-man" color="darkblue"></text>
color="darkblue"></text> <text v-show="userInfo.sex == 1" class="iconfont icon-girl" color="darkred"></text>
<text v-show="userInfo.sex==1" class="iconfont icon-girl"
color="darkred"></text>
</view> </view>
<view class="info-text"> <view class="info-text">
<text class="label-text"> <text class="label-text">
@ -113,6 +109,7 @@
color: $im-text-color-light; color: $im-text-color-light;
} }
.content-text { .content-text {
font-size: $im-font-size-small; font-size: $im-font-size-small;
color: $im-text-color-light; color: $im-text-color-light;
@ -122,6 +119,7 @@
display: flex; display: flex;
align-items: center; align-items: center;
margin-bottom: 10rpx; margin-bottom: 10rpx;
.info-username { .info-username {
font-size: $im-font-size-large; font-size: $im-font-size-large;
font-weight: 600; font-weight: 600;

2
im-uniapp/store/userStore.js

@ -14,7 +14,7 @@ export default defineStore('userStore', {
clear() { clear() {
this.userInfo = {}; this.userInfo = {};
}, },
loadUser(context) { loadUser() {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
http({ http({
url: '/user/self', url: '/user/self',

2
im-uniapp/vite.config.js

@ -1,7 +1,5 @@
import { defineConfig } from "vite" import { defineConfig } from "vite"
import uni from "@dcloudio/vite-plugin-uni"; import uni from "@dcloudio/vite-plugin-uni";
const path = require('path')
const fs = require('fs')
export default defineConfig({ export default defineConfig({
plugins: [ plugins: [
uni() uni()

1
im-web/src/view/Login.vue

@ -29,7 +29,6 @@
</div> </div>
<icp></icp> <icp></icp>
</div> </div>
</template> </template>
<script> <script>

Loading…
Cancel
Save