feat:【antd】【mp】mp 的代码评审(components)

This commit is contained in:
YunaiV
2025-11-20 21:09:02 +08:00
parent c39a445d77
commit 8d2da0a4d1
62 changed files with 631 additions and 583 deletions

View File

@@ -1,14 +1,3 @@
<!--
- Copyright (C) 2018-2019
- All rights reserved, Designed By www.joolun.com
微信消息 - 语音
芋道源码
bug 修复
1joolun 的做法使用 mediaId 从微信公众号下载对应的 mp4 素材从而播放内容
存在的问题mediaId 有效期是 3 超过时间后无法播放
2重构后的做法后端接收到微信公众号的视频消息后将视频消息的 media_id 的文件内容保存到文件服务器中这样前端可以直接使用 URL 播放
代码优化 props 中的 reply 调成为 data 中对应的属性并补充相关注释
-->
<script lang="ts" setup>
import { ref } from 'vue';
@@ -17,8 +6,10 @@ import { IconifyIcon } from '@vben/icons';
// 因为微信语音是 amr 格式,所以需要用到 amr 解码器https://www.npmjs.com/package/benz-amr-recorder
import BenzAMRRecorder from 'benz-amr-recorder';
/** 微信消息 - 语音 */
defineOptions({ name: 'VoicePlayer' });
// TODO @hwantd 和 ele 代码风格一致;
const props = defineProps({
url: {
type: String, // 语音地址例如说https://www.iocoder.cn/xxx.amr
@@ -92,6 +83,7 @@ const amrStop = () => {
</div>
</template>
<style lang="scss" scoped>
/** TODO @dylan看看有没适合 tindwind 的哈。 */
.wx-voice-div {
display: flex;
align-items: center;