Skip to content

Commit 0ac5bf8

Browse files
authored
feat: 新增图片、语音、文件收发,图标头像封装等 (#74)
1 parent 831e885 commit 0ac5bf8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+2410
-981
lines changed

package.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
"alova": "^2.6.0",
2828
"dayjs": "^1.11.8",
2929
"element-plus": "^2.3.6",
30-
"gsap": "^3.12.1",
3130
"lodash": "^4.17.21",
3231
"pinia": "^2.1.3",
3332
"pinia-plugin-persistedstate": "^3.1.0",
@@ -47,6 +46,7 @@
4746
"@vue/eslint-config-prettier": "^7.1.0",
4847
"@vue/eslint-config-typescript": "^11.0.3",
4948
"@vue/tsconfig": "^0.1.3",
49+
"@vueuse/core": "^10.2.0",
5050
"autoprefixer": "^10.4.14",
5151
"eslint": "^8.42.0",
5252
"eslint-plugin-vue": "^9.14.1",
@@ -71,6 +71,7 @@
7171
"unplugin-vue-components": "^0.24.1",
7272
"vite": "4.3.5",
7373
"vite-plugin-mkcert": "^1.16.0",
74-
"vue-tsc": "^1.6.5"
74+
"vue-tsc": "^1.6.5",
75+
"xgplayer": "^3.0.5"
7576
}
7677
}

pnpm-lock.yaml

+186-13
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/assets/avatars/default.png

-1.19 KB
Binary file not shown.

src/assets/iconfont/index-color.css

+143
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
/* stylelint-disable */
2+
/* eslint-disable */
3+
/* prettier-ignore */
4+
@font-face {
5+
font-family: "mallchatcolor"; /* Project id 4141022 */
6+
/* Color fonts */
7+
src:
8+
url('//at.alicdn.com/t/c/font_4141022_j7dvq8wg0dr.woff2?t=1688220706250') format('woff2'),
9+
url('//at.alicdn.com/t/c/font_4141022_j7dvq8wg0dr.woff?t=1688220706250') format('woff'),
10+
url('//at.alicdn.com/t/c/font_4141022_j7dvq8wg0dr.ttf?t=1688220706250') format('truetype');
11+
}
12+
13+
.mallchatcolor {
14+
font-family: 'mallchatcolor' !important;
15+
font-size: 16px;
16+
font-style: normal;
17+
-webkit-font-smoothing: antialiased;
18+
-moz-osx-font-smoothing: grayscale;
19+
}
20+
21+
.icon-happy1:before {
22+
content: '\e620';
23+
}
24+
25+
.icon-laughing:before {
26+
content: '\e62b';
27+
}
28+
29+
.icon-other:before {
30+
content: '\e67a';
31+
}
32+
33+
.icon-posun:before {
34+
content: '\e67e';
35+
}
36+
37+
.icon-zip:before {
38+
content: '\e60c';
39+
}
40+
41+
.icon-wenjianjia1:before {
42+
content: '\e64d';
43+
}
44+
45+
.icon-at:before {
46+
content: '\e629';
47+
}
48+
49+
.icon-wenjianjia2:before {
50+
content: '\e647';
51+
}
52+
53+
.icon-tupian:before {
54+
content: '\e679';
55+
}
56+
57+
.icon-qcloud:before {
58+
content: '\e600';
59+
}
60+
61+
.icon-yuque:before {
62+
content: '\e7c0';
63+
}
64+
65+
.icon-dazed:before {
66+
content: '\e60f';
67+
}
68+
69+
.icon-happy:before {
70+
content: '\e621';
71+
}
72+
73+
.icon-secret:before {
74+
content: '\e63c';
75+
}
76+
77+
.icon-shocked:before {
78+
content: '\e63e';
79+
}
80+
81+
.icon-smiling:before {
82+
content: '\e642';
83+
}
84+
85+
.icon-yawn:before {
86+
content: '\e64e';
87+
}
88+
89+
.icon-github:before {
90+
content: '\e709';
91+
}
92+
93+
.icon-weixin:before {
94+
content: '\e60d';
95+
}
96+
97+
.icon-bilibili:before {
98+
content: '\e60e';
99+
}
100+
101+
.icon-doc:before {
102+
content: '\e601';
103+
}
104+
105+
.icon-code:before {
106+
content: '\e602';
107+
}
108+
109+
.icon-ppt:before {
110+
content: '\e603';
111+
}
112+
113+
.icon-txt:before {
114+
content: '\e604';
115+
}
116+
117+
.icon-java:before {
118+
content: '\e605';
119+
}
120+
121+
.icon-pdf:before {
122+
content: '\e606';
123+
}
124+
125+
.icon-jpg:before {
126+
content: '\e607';
127+
}
128+
129+
.icon-mp3:before {
130+
content: '\e608';
131+
}
132+
133+
.icon-mp4:before {
134+
content: '\e609';
135+
}
136+
137+
.icon-wenjianjia:before {
138+
content: '\e60a';
139+
}
140+
141+
.icon-xls:before {
142+
content: '\e60b';
143+
}

src/assets/iconfont/index.css

+85
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
/* stylelint-disable */
2+
/* eslint-disable */
3+
/* prettier-ignore */
4+
@font-face {
5+
font-family: "mallchat"; /* Project id 4142069 */
6+
src: url('//at.alicdn.com/t/c/font_4142069_q7wdf7ccbx.woff2?t=1688219879090') format('woff2'),
7+
url('//at.alicdn.com/t/c/font_4142069_q7wdf7ccbx.woff?t=1688219879090') format('woff'),
8+
url('//at.alicdn.com/t/c/font_4142069_q7wdf7ccbx.ttf?t=1688219879090') format('truetype');
9+
}
10+
11+
.mallchat {
12+
font-family: 'mallchat' !important;
13+
font-size: 16px;
14+
font-style: normal;
15+
-webkit-font-smoothing: antialiased;
16+
-moz-osx-font-smoothing: grayscale;
17+
}
18+
19+
.icon-tupian1:before {
20+
content: '\e640';
21+
}
22+
23+
.icon-jianpan:before {
24+
content: '\e6d8';
25+
}
26+
27+
.icon-saying:before {
28+
content: '\e62f';
29+
}
30+
31+
.icon-xiazai:before {
32+
content: '\e616';
33+
}
34+
35+
.icon-dislike:before {
36+
content: '\e67c';
37+
}
38+
39+
.icon-huojian:before {
40+
content: '\e68b';
41+
}
42+
43+
.icon-like:before {
44+
content: '\e85c';
45+
}
46+
47+
.icon-reply:before {
48+
content: '\e716';
49+
}
50+
51+
.icon-totop:before {
52+
content: '\e63a';
53+
}
54+
55+
.icon-zhankai:before {
56+
content: '\e657';
57+
}
58+
59+
.icon-chehui:before {
60+
content: '\e665';
61+
}
62+
63+
.icon-shanchu:before {
64+
content: '\e6bb';
65+
}
66+
67+
.icon-voice:before {
68+
content: '\e85e';
69+
}
70+
71+
.icon-avatar:before {
72+
content: '\e648';
73+
}
74+
75+
.icon-loading:before {
76+
content: '\e6de';
77+
}
78+
79+
.icon-copy:before {
80+
content: '\e62d';
81+
}
82+
83+
.icon-lahei:before {
84+
content: '\e651';
85+
}

src/assets/icons/icon_bilibili.svg

-1
This file was deleted.

src/assets/icons/icon_github.svg

-1
This file was deleted.

src/assets/icons/icon_like.svg

-1
This file was deleted.

src/assets/icons/icon_liked.svg

-1
This file was deleted.

src/assets/icons/icon_reply.svg

-1
This file was deleted.

src/assets/icons/icon_tencent_cloud.svg

-1
This file was deleted.

src/assets/icons/icon_tiktok.svg

-1
This file was deleted.

src/assets/icons/icon_wechat.svg

-1
This file was deleted.

src/assets/icons/icon_yuque.png

-4.95 KB
Binary file not shown.

src/assets/operate-icons/to_top.svg

-1
This file was deleted.

src/components.d.ts

+10-17
Original file line numberDiff line numberDiff line change
@@ -9,44 +9,37 @@ export {}
99

1010
declare module '@vue/runtime-core' {
1111
export interface GlobalComponents {
12-
AnimateCount: typeof import('./components/AnimateCount.vue')['default']
12+
Avatar: typeof import('./components/avatar/index.vue')['default']
1313
ElAlert: typeof import('element-plus/es')['ElAlert']
1414
ElAvatar: typeof import('element-plus/es')['ElAvatar']
1515
ElButton: typeof import('element-plus/es')['ElButton']
1616
ElDialog: typeof import('element-plus/es')['ElDialog']
1717
ElIcon: typeof import('element-plus/es')['ElIcon']
18+
ElImage: typeof import('element-plus/es')['ElImage']
1819
ElInput: typeof import('element-plus/es')['ElInput']
1920
ElPopover: typeof import('element-plus/es')['ElPopover']
2021
ElTooltip: typeof import('element-plus/es')['ElTooltip']
21-
IconCommunity: typeof import('./components/icons/IconCommunity.vue')['default']
22-
IconCopy: typeof import('./components/icons/IconCopy.vue')['default']
23-
IconDelete: typeof import('./components/icons/IconDelete.vue')['default']
24-
IconDislike: typeof import('./components/icons/iconDislike.vue')['default']
25-
IconDocumentation: typeof import('./components/icons/IconDocumentation.vue')['default']
26-
IconEcosystem: typeof import('./components/icons/IconEcosystem.vue')['default']
27-
IconLike: typeof import('./components/icons/iconLike.vue')['default']
28-
IconMore: typeof import('./components/icons/IconMore.vue')['default']
29-
IconRecall: typeof import('./components/icons/IconRecall.vue')['default']
30-
IconReply: typeof import('./components/icons/IconReply.vue')['default']
31-
IconShield: typeof import('./components/icons/IconShield.vue')['default']
32-
IconSupport: typeof import('./components/icons/IconSupport.vue')['default']
33-
IconTooling: typeof import('./components/icons/IconTooling.vue')['default']
22+
File: typeof import('./components/RenderMessage/file.vue')['default']
23+
Icon: typeof import('./components/Icon/index.vue')['default']
3424
IEpArrowDownBold: typeof import('~icons/ep/arrow-down-bold')['default']
3525
IEpChatDotRound: typeof import('~icons/ep/chat-dot-round')['default']
3626
IEpClose: typeof import('~icons/ep/close')['default']
3727
IEpFemale: typeof import('~icons/ep/female')['default']
38-
IEpFold: typeof import('~icons/ep/fold')['default']
3928
IEpInfoFilled: typeof import('~icons/ep/info-filled')['default']
4029
IEpLoading: typeof import('~icons/ep/loading')['default']
4130
IEpLock: typeof import('~icons/ep/lock')['default']
4231
IEpMale: typeof import('~icons/ep/male')['default']
4332
IEpSuccessFilled: typeof import('~icons/ep/success-filled')['default']
44-
LikeButton: typeof import('./components/LikeButton/index.vue')['default']
33+
Image: typeof import('./components/RenderMessage/image.vue')['default']
4534
LoginBox: typeof import('./components/LoginBox/index.vue')['default']
46-
RenderMsg: typeof import('./components/RenderMsg.vue')['default']
35+
RenderMessage: typeof import('./components/RenderMessage/index.vue')['default']
4736
RouterLink: typeof import('vue-router')['RouterLink']
4837
RouterView: typeof import('vue-router')['RouterView']
38+
Text: typeof import('./components/RenderMessage/text.vue')['default']
4939
UserSettingBox: typeof import('./components/UserSettingBox/index.vue')['default']
40+
Video: typeof import('./components/RenderMessage/video.vue')['default']
41+
VideoPlayer: typeof import('./components/VideoPlayer/index.vue')['default']
42+
Voice: typeof import('./components/RenderMessage/voice.vue')['default']
5043
}
5144
export interface ComponentCustomProperties {
5245
vLoading: typeof import('element-plus/es')['ElLoadingDirective']

src/components/AnimateCount.vue

-19
This file was deleted.

src/components/Icon/index.vue

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<script lang="ts" setup>
2+
import { computed, type CSSProperties } from 'vue'
3+
const props = defineProps({
4+
/** 图标名称 */
5+
icon: {
6+
type: String,
7+
default: '',
8+
},
9+
/** 图标尺寸 */
10+
size: {
11+
type: [Number, String],
12+
default: 16,
13+
},
14+
/** 旋转角度 */
15+
rotate: Number,
16+
/** 加载态 */
17+
spin: Boolean,
18+
/** 是否多色 */
19+
colorful: Boolean,
20+
})
21+
22+
const iconCls = computed(() => {
23+
return [
24+
{
25+
mallchat: !props.colorful,
26+
mallchatcolor: props.colorful,
27+
[`icon-spin`]: props.spin,
28+
},
29+
`icon-${props.icon}`,
30+
]
31+
})
32+
33+
const innerStyle = computed(() => {
34+
const styles: CSSProperties = {}
35+
if (props.size) {
36+
styles.fontSize = typeof props.size === 'number' ? `${props.size}px` : props.size
37+
}
38+
if (props.rotate) {
39+
styles.transform = `rotate(${props.rotate}deg)`
40+
}
41+
return styles
42+
})
43+
</script>
44+
45+
<template>
46+
<i :class="iconCls" :style="innerStyle" />
47+
</template>

0 commit comments

Comments
 (0)