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 +1,3 @@
export { default } from './wx-video-play.vue';
// TODO @hw每个组件下的 index.ts 要不都删除,统一在 mp/components/index.ts 暴露就好了?

View File

@@ -1,15 +1,3 @@
<!--
- Copyright (C) 2018-2019
- All rights reserved, Designed By www.joolun.com
微信消息 - 视频
芋道源码
bug 修复
1joolun 的做法使用 mediaId 从微信公众号下载对应的 mp4 素材从而播放内容
存在的问题mediaId 有效期是 3 超过时间后无法播放
2重构后的做法后端接收到微信公众号的视频消息后将视频消息的 media_id 的文件内容保存到文件服务器中这样前端可以直接使用 URL 播放
体验优化弹窗关闭后自动暂停视频的播放
-->
<script lang="ts" setup>
import { ref } from 'vue';
@@ -20,8 +8,10 @@ import { ElDialog } from 'element-plus';
import 'video.js/dist/video-js.css';
defineOptions({ name: 'VideoPlayer' });
/** 微信消息 - 视频 */
defineOptions({ name: 'WxVideoPlayer' });
// TODO @hwantd 或者 eleprops 保持一致;
const props = defineProps({
url: {
type: String,
@@ -31,10 +21,6 @@ const props = defineProps({
const dialogVideo = ref(false);
// const handleEvent = (log) => {
// console.log('Basic player event', log)
// }
const playVideo = () => {
dialogVideo.value = true;
};
@@ -61,6 +47,7 @@ const playVideo = () => {
:width="800"
:playback-rates="[0.7, 1.0, 1.5, 2.0]"
/>
<!-- TODO @hw删除掉 -->
<!-- 事件暫時沒用
@mounted="handleMounted"-->
<!-- @ready="handleEvent($event)"-->