From 6a500855ba053c3f74fb9aefcf92516767bf28f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E6=B1=9F=E8=BE=B0?= Date: Wed, 5 Jul 2023 15:52:45 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9E=E8=A7=86=E9=A2=91?= =?UTF-8?q?=E6=92=AD=E6=94=BE=E3=80=81=E4=BF=AE=E5=A4=8D=E6=B6=88=E6=81=AF?= =?UTF-8?q?=E4=B8=80=E7=B3=BB=E5=88=97bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- pnpm-lock.yaml | 111 +++++++++++++---- src/assets/iconfont/index-color.css | 30 ++++- src/assets/iconfont/index.css | 22 +++- src/components/RenderMessage/image.vue | 70 ++++++----- src/components/RenderMessage/text.vue | 16 +-- src/components/RenderMessage/video.vue | 18 ++- src/components/RenderMessage/voice.vue | 54 ++------ src/components/VideoPlayer/index.vue | 52 ++++++-- src/hooks/useRecording.ts | 115 ++++++++++-------- src/hooks/useUpload.ts | 80 ++++++++++-- src/services/types.ts | 1 + src/stores/preview.ts | 109 +++++++++++++++++ src/utils/index.ts | 79 ++++++++---- src/views/Home/components/ChatBox/index.vue | 33 +++-- .../components/ChatList/MsgItem/index.vue | 1 + .../components/ChatList/MsgItem/styles.scss | 47 +++++-- src/views/Home/components/ChatList/index.vue | 5 +- src/views/Home/index.vue | 39 +++++- src/views/Home/styles.scss | 71 ++++++++--- 20 files changed, 684 insertions(+), 271 deletions(-) create mode 100644 src/stores/preview.ts diff --git a/package.json b/package.json index e0c443e3..dae5359c 100644 --- a/package.json +++ b/package.json @@ -72,6 +72,6 @@ "vite": "4.3.5", "vite-plugin-mkcert": "^1.16.0", "vue-tsc": "^1.6.5", - "xgplayer": "^3.0.5" + "xgplayer": "^2.31.2" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 690ad67e..7fe50fa4 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -155,8 +155,8 @@ devDependencies: specifier: ^1.6.5 version: registry.npmmirror.com/vue-tsc@1.6.5(typescript@5.1.3) xgplayer: - specifier: ^3.0.5 - version: registry.npmmirror.com/xgplayer@3.0.5(core-js@3.31.0) + specifier: ^2.31.2 + version: registry.npmmirror.com/xgplayer@2.31.2(core-js@3.31.0) packages: @@ -2748,10 +2748,10 @@ packages: type: registry.npmmirror.com/type@1.2.0 dev: true - registry.npmmirror.com/danmu.js@1.1.8: - resolution: {integrity: sha512-GIFSHqJ+HFTGLLaL2BHMPBaOuPY1bWPwC0Pvi/V06uMIoxNTyEGxMuoO2SzNHsDvKC/r252zR9T/Gwx93AaKfw==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/danmu.js/-/danmu.js-1.1.8.tgz} + registry.npmmirror.com/danmu.js@0.5.10: + resolution: {integrity: sha512-zLpSd5Yi+fxVVd0GHjrf5lZA45KKpbvc4Q8BbSVO3OdmCBkoB2vlDCGnVn18cnKpTNqi8Soy7AnzUw1YcqtzUA==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/danmu.js/-/danmu.js-0.5.10.tgz} name: danmu.js - version: 1.1.8 + version: 0.5.10 dependencies: event-emitter: registry.npmmirror.com/event-emitter@0.3.5 dev: true @@ -2829,12 +2829,6 @@ packages: engines: {node: '>=0.4.0'} dev: true - registry.npmmirror.com/delegate@3.2.0: - resolution: {integrity: sha512-IofjkYBZaZivn0V8nnsMJGBr4jVLxHDheKSW88PyxS5QC4Vo9ZbZVvhzlSxY87fVq3STR6r+4cGepyHkcWOQSw==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/delegate/-/delegate-3.2.0.tgz} - name: delegate - version: 3.2.0 - dev: true - registry.npmmirror.com/deprecation@2.3.1: resolution: {integrity: sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/deprecation/-/deprecation-2.3.1.tgz} name: deprecation @@ -2916,6 +2910,15 @@ packages: version: 1.4.7 dev: true + registry.npmmirror.com/draggabilly@2.4.1: + resolution: {integrity: sha512-HHHLPEPZqRXIDQDFRFdK7RONZausNlJ4WkA73ST7Z6O2HPWttxFHVwHo8nccuDLzXWwiVKRVuc6fTkW+CQA++A==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/draggabilly/-/draggabilly-2.4.1.tgz} + name: draggabilly + version: 2.4.1 + dependencies: + get-size: registry.npmmirror.com/get-size@2.0.3 + unidragger: registry.npmmirror.com/unidragger@2.4.0 + dev: true + registry.npmmirror.com/duplexer@0.1.2: resolution: {integrity: sha512-jtD6YG370ZCIi/9GTaJKQxWTZD045+4R4hTk/x1UyoqadyJ9x9CgSi1RlVDQF8U2sxLLSnFkCaMihqljHIWgMg==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/duplexer/-/duplexer-0.1.2.tgz} name: duplexer @@ -3335,6 +3338,12 @@ packages: engines: {node: '>=0.10.0'} dev: true + registry.npmmirror.com/ev-emitter@1.1.1: + resolution: {integrity: sha512-ipiDYhdQSCZ4hSbX4rMW+XzNKMD1prg/sTvoVmSLkuQ1MVlwjJQQA+sW8tMYR3BLUr9KjodFV4pvzunvRhd33Q==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/ev-emitter/-/ev-emitter-1.1.1.tgz} + name: ev-emitter + version: 1.1.1 + dev: true + registry.npmmirror.com/event-emitter@0.3.5: resolution: {integrity: sha512-D9rRn9y7kLPnJ+hMq7S/nhvoKwwvVJahBi2BPmx3bvbsEdK3W9ii8cBSGjP+72/LnM4n6fo3+dkCX5FeTQruXA==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/event-emitter/-/event-emitter-0.3.5.tgz} name: event-emitter @@ -3559,6 +3568,16 @@ packages: universalify: registry.npmmirror.com/universalify@2.0.0 dev: true + registry.npmmirror.com/fs-extra@5.0.0: + resolution: {integrity: sha512-66Pm4RYbjzdyeuqudYqhFiNBbCIuI9kgRqLPSHIlXHidW8NIQtVdkM1yeZ4lXwuhbTETv3EUGMNHAAw6hiundQ==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/fs-extra/-/fs-extra-5.0.0.tgz} + name: fs-extra + version: 5.0.0 + dependencies: + graceful-fs: registry.npmmirror.com/graceful-fs@4.2.11 + jsonfile: registry.npmmirror.com/jsonfile@4.0.0 + universalify: registry.npmmirror.com/universalify@0.1.2 + dev: true + registry.npmmirror.com/fs.realpath@1.0.0: resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/fs.realpath/-/fs.realpath-1.0.0.tgz} name: fs.realpath @@ -3624,6 +3643,12 @@ packages: has-symbols: registry.npmmirror.com/has-symbols@1.0.3 dev: true + registry.npmmirror.com/get-size@2.0.3: + resolution: {integrity: sha512-lXNzT/h/dTjTxRbm9BXb+SGxxzkm97h/PCIKtlN/CBCxxmkkIVV21udumMS93MuVTDX583gqc94v3RjuHmI+2Q==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/get-size/-/get-size-2.0.3.tgz} + name: get-size + version: 2.0.3 + dev: true + registry.npmmirror.com/get-stream@6.0.1: resolution: {integrity: sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/get-stream/-/get-stream-6.0.1.tgz} name: get-stream @@ -4333,6 +4358,14 @@ packages: version: 3.2.0 dev: true + registry.npmmirror.com/jsonfile@4.0.0: + resolution: {integrity: sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/jsonfile/-/jsonfile-4.0.0.tgz} + name: jsonfile + version: 4.0.0 + optionalDependencies: + graceful-fs: registry.npmmirror.com/graceful-fs@4.2.11 + dev: true + registry.npmmirror.com/jsonfile@6.1.0: resolution: {integrity: sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/jsonfile/-/jsonfile-6.1.0.tgz} name: jsonfile @@ -6518,6 +6551,14 @@ packages: which-boxed-primitive: registry.npmmirror.com/which-boxed-primitive@1.0.2 dev: true + registry.npmmirror.com/unidragger@2.4.0: + resolution: {integrity: sha512-MueZK2oXuGE6OAlGKIrSXK2zCq+8yb1QUZgqyTDCSJzvwYL0g2Llrad+TtoQTYxtFnNyxxSw0IMnKNIgEMia1w==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/unidragger/-/unidragger-2.4.0.tgz} + name: unidragger + version: 2.4.0 + dependencies: + unipointer: registry.npmmirror.com/unipointer@2.4.0 + dev: true + registry.npmmirror.com/unimport@3.0.7: resolution: {integrity: sha512-2dVQUxJEGcrSZ0U4qtwJVODrlfyGcwmIOoHVqbAFFUx7kPoEN5JWr1cZFhLwoAwTmZOvqAm3YIkzv1engIQocg==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/unimport/-/unimport-3.0.7.tgz} name: unimport @@ -6538,12 +6579,27 @@ packages: - rollup dev: true + registry.npmmirror.com/unipointer@2.4.0: + resolution: {integrity: sha512-VjzDLPjGK7aYpQKH7bnDZS8X4axF5AFU/LQi+NQe1oyEHfaz6lWKhaQ7n4o7vJ1iJ4i2T0quCIfrQM139p05Sw==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/unipointer/-/unipointer-2.4.0.tgz} + name: unipointer + version: 2.4.0 + dependencies: + ev-emitter: registry.npmmirror.com/ev-emitter@1.1.1 + dev: true + registry.npmmirror.com/universal-user-agent@6.0.0: resolution: {integrity: sha512-isyNax3wXoKaulPDZWHQqbmIx1k2tb9fb3GGDBRxCscfYV2Ch7WxPArBsFEG8s/safwXTT7H4QGhaIkTp9447w==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/universal-user-agent/-/universal-user-agent-6.0.0.tgz} name: universal-user-agent version: 6.0.0 dev: true + registry.npmmirror.com/universalify@0.1.2: + resolution: {integrity: sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/universalify/-/universalify-0.1.2.tgz} + name: universalify + version: 0.1.2 + engines: {node: '>= 4.0.0'} + dev: true + registry.npmmirror.com/universalify@2.0.0: resolution: {integrity: sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/universalify/-/universalify-2.0.0.tgz} name: universalify @@ -6985,11 +7041,11 @@ packages: optional: true dev: true - registry.npmmirror.com/xgplayer-subtitles@3.0.5(core-js@3.31.0): - resolution: {integrity: sha512-NH7UjkK+2gy15DZsB4SFNUkdcgLMm6THVEMzl026pxEQyqXr0F65fMhx3nzFGZLzL2TSRpQHPJCeBNqGY0uWEg==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/xgplayer-subtitles/-/xgplayer-subtitles-3.0.5.tgz} - id: registry.npmmirror.com/xgplayer-subtitles/3.0.5 + registry.npmmirror.com/xgplayer-subtitles@1.1.1(core-js@3.31.0): + resolution: {integrity: sha512-GYzrK/e4ydAATP3Xg06sXYliiSCcyNIqqQSwnWbs7pw+cc5NwyrYXuLfa3Bp9skIxT6pT+A7qTicUps58N3eEQ==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/xgplayer-subtitles/-/xgplayer-subtitles-1.1.1.tgz} + id: registry.npmmirror.com/xgplayer-subtitles/1.1.1 name: xgplayer-subtitles - version: 3.0.5 + version: 1.1.1 peerDependencies: core-js: '>=3.12.1' dependencies: @@ -6997,20 +7053,23 @@ packages: eventemitter3: registry.npmmirror.com/eventemitter3@4.0.7 dev: true - registry.npmmirror.com/xgplayer@3.0.5(core-js@3.31.0): - resolution: {integrity: sha512-QmKcc2l/ETF6JYOYbYz8dm1OWOwft/6AuUy6RF8ms+3T05sqMXlAqEoXPVnCmiHs4BB4W2LSXsxyQXX6+xNBTw==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/xgplayer/-/xgplayer-3.0.5.tgz} - id: registry.npmmirror.com/xgplayer/3.0.5 + registry.npmmirror.com/xgplayer@2.31.2(core-js@3.31.0): + resolution: {integrity: sha512-s852GRqBW5Aon6qUomGv/mYZZGOGQnHhFHlBWQL3yaLJsaM4ehX2qCofnVbZmtNrks7hOuYo19Q9cDjQJMlJUg==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/xgplayer/-/xgplayer-2.31.2.tgz} + id: registry.npmmirror.com/xgplayer/2.31.2 name: xgplayer - version: 3.0.5 - peerDependencies: - core-js: '>=3.12.1' + version: 2.31.2 + hasBin: true dependencies: - core-js: registry.npmmirror.com/core-js@3.31.0 - danmu.js: registry.npmmirror.com/danmu.js@1.1.8 - delegate: registry.npmmirror.com/delegate@3.2.0 + chalk: registry.npmmirror.com/chalk@2.4.2 + commander: registry.npmmirror.com/commander@2.20.3 + danmu.js: registry.npmmirror.com/danmu.js@0.5.10 downloadjs: registry.npmmirror.com/downloadjs@1.4.7 - eventemitter3: registry.npmmirror.com/eventemitter3@4.0.7 - xgplayer-subtitles: registry.npmmirror.com/xgplayer-subtitles@3.0.5(core-js@3.31.0) + draggabilly: registry.npmmirror.com/draggabilly@2.4.1 + event-emitter: registry.npmmirror.com/event-emitter@0.3.5 + fs-extra: registry.npmmirror.com/fs-extra@5.0.0 + xgplayer-subtitles: registry.npmmirror.com/xgplayer-subtitles@1.1.1(core-js@3.31.0) + transitivePeerDependencies: + - core-js dev: true registry.npmmirror.com/xml-name-validator@4.0.0: diff --git a/src/assets/iconfont/index-color.css b/src/assets/iconfont/index-color.css index 89408aa7..bf21ecb4 100644 --- a/src/assets/iconfont/index-color.css +++ b/src/assets/iconfont/index-color.css @@ -5,9 +5,9 @@ font-family: "mallchatcolor"; /* Project id 4141022 */ /* Color fonts */ src: - url('//at.alicdn.com/t/c/font_4141022_j7dvq8wg0dr.woff2?t=1688220706250') format('woff2'), - url('//at.alicdn.com/t/c/font_4141022_j7dvq8wg0dr.woff?t=1688220706250') format('woff'), - url('//at.alicdn.com/t/c/font_4141022_j7dvq8wg0dr.ttf?t=1688220706250') format('truetype'); + url('//at.alicdn.com/t/c/font_4141022_l6s8lv2vhvi.woff2?t=1688484028839') format('woff2'), + url('//at.alicdn.com/t/c/font_4141022_l6s8lv2vhvi.woff?t=1688484028839') format('woff'), + url('//at.alicdn.com/t/c/font_4141022_l6s8lv2vhvi.ttf?t=1688484028839') format('truetype'); } .mallchatcolor { @@ -18,6 +18,26 @@ -moz-osx-font-smoothing: grayscale; } +.icon-md:before { + content: '\e90d'; +} + +.icon-sketch:before { + content: '\e67f'; +} + +.icon-exe:before { + content: '\e96f'; +} + +.icon-svg:before { + content: '\e67c'; +} + +.icon-txt:before { + content: '\e67b'; +} + .icon-happy1:before { content: '\e620'; } @@ -110,11 +130,11 @@ content: '\e603'; } -.icon-txt:before { +.icon-log:before { content: '\e604'; } -.icon-java:before { +.icon-log1:before { content: '\e605'; } diff --git a/src/assets/iconfont/index.css b/src/assets/iconfont/index.css index 39928c0f..e260204b 100644 --- a/src/assets/iconfont/index.css +++ b/src/assets/iconfont/index.css @@ -3,9 +3,9 @@ /* prettier-ignore */ @font-face { font-family: "mallchat"; /* Project id 4142069 */ - src: url('//at.alicdn.com/t/c/font_4142069_q7wdf7ccbx.woff2?t=1688219879090') format('woff2'), - url('//at.alicdn.com/t/c/font_4142069_q7wdf7ccbx.woff?t=1688219879090') format('woff'), - url('//at.alicdn.com/t/c/font_4142069_q7wdf7ccbx.ttf?t=1688219879090') format('truetype'); + src: url('//at.alicdn.com/t/c/font_4142069_nzdc1c9l0lr.woff2?t=1688480111830') format('woff2'), + url('//at.alicdn.com/t/c/font_4142069_nzdc1c9l0lr.woff?t=1688480111830') format('woff'), + url('//at.alicdn.com/t/c/font_4142069_nzdc1c9l0lr.ttf?t=1688480111830') format('truetype'); } .mallchat { @@ -16,6 +16,22 @@ -moz-osx-font-smoothing: grayscale; } +.icon-bofang:before { + content: '\e62a'; +} + +.icon-guanbi1:before { + content: '\eaf2'; +} + +.icon-guanbi:before { + content: '\e61e'; +} + +.icon-aite:before { + content: '\e60c'; +} + .icon-tupian1:before { content: '\e640'; } diff --git a/src/components/RenderMessage/image.vue b/src/components/RenderMessage/image.vue index 2cd58ee9..e296ac5a 100644 --- a/src/components/RenderMessage/image.vue +++ b/src/components/RenderMessage/image.vue @@ -1,57 +1,55 @@