fix(bi): 添加投币数量必须大于0的校验
feat(item-bottom): 实现二维码弹窗自适应右侧边界 添加判断逻辑使二维码弹窗在靠近右侧边界时向左弹出 refactor(public.js): 优化ajax请求配置和登录跳转逻辑 统一设置axios默认配置,提取登录跳转函数 style(public.css): 调整QRcode-box.right的定位 修复二维码弹窗靠近右侧时的显示问题 fix(details.js): 修复粗体标记正则匹配多行内容 使用[\s\S]*?匹配可能的多行内容 refactor(index.js): 优化列表加载和滚动逻辑 移除模拟数据,添加加载状态,调整滚动加载阈值 chore: 更新html模板中的唯一标识和广告类名
This commit is contained in:
67
js/edit.js
67
js/edit.js
@@ -160,7 +160,7 @@ const editApp = createApp({
|
||||
html = html.replace(/\[tag\]([^[]+)\[\/tag\]/gi, '<span class="blue">#$1</span> <span class="fill"></span> ');
|
||||
|
||||
// 4. 还原粗体标记为h2标签
|
||||
html = html.replace(/\[b\]([^[]+)\[\/b\]/gi, "<h2>$1</h2>");
|
||||
html = html.replace(/\[b\]([\s\S]*?)\[\/b\]/gi, "<h2>$1</h2>");
|
||||
|
||||
// 5. 还原图片标记为img标签(使用提供的imageList)
|
||||
html = html.replace(/\[attachimg\](\d+)\[\/attachimg\]/gi, (match, aid) => {
|
||||
@@ -699,39 +699,50 @@ const editApp = createApp({
|
||||
video.src = "";
|
||||
};
|
||||
|
||||
video.addEventListener("error", () => {
|
||||
cleanup();
|
||||
reject(new Error("视频加载失败,请检查文件完整性"));
|
||||
}, { once: true });
|
||||
video.addEventListener(
|
||||
"error",
|
||||
() => {
|
||||
cleanup();
|
||||
reject(new Error("视频加载失败,请检查文件完整性"));
|
||||
},
|
||||
{ once: true }
|
||||
);
|
||||
|
||||
video.addEventListener("loadeddata", () => {
|
||||
const canvas = document.createElement("canvas");
|
||||
const w = video.videoWidth || 320;
|
||||
const h = video.videoHeight || 240;
|
||||
canvas.width = w;
|
||||
canvas.height = h;
|
||||
const ctx = canvas.getContext("2d");
|
||||
try {
|
||||
ctx.drawImage(video, 0, 0, w, h);
|
||||
} catch (e) {
|
||||
cleanup();
|
||||
reject(e);
|
||||
return;
|
||||
}
|
||||
canvas.toBlob((blob) => {
|
||||
cleanup();
|
||||
if (!blob) {
|
||||
reject(new Error("第一帧提取失败,Blob 生成异常"));
|
||||
video.addEventListener(
|
||||
"loadeddata",
|
||||
() => {
|
||||
const canvas = document.createElement("canvas");
|
||||
const w = video.videoWidth || 320;
|
||||
const h = video.videoHeight || 240;
|
||||
canvas.width = w;
|
||||
canvas.height = h;
|
||||
const ctx = canvas.getContext("2d");
|
||||
try {
|
||||
ctx.drawImage(video, 0, 0, w, h);
|
||||
} catch (e) {
|
||||
cleanup();
|
||||
reject(e);
|
||||
return;
|
||||
}
|
||||
const frameFile = new File([blob], `video_cover_${Date.now()}.png`, { type: "image/png" });
|
||||
resolve(frameFile);
|
||||
}, "image/png", 0.9);
|
||||
}, { once: true });
|
||||
canvas.toBlob(
|
||||
(blob) => {
|
||||
cleanup();
|
||||
if (!blob) {
|
||||
reject(new Error("第一帧提取失败,Blob 生成异常"));
|
||||
return;
|
||||
}
|
||||
const frameFile = new File([blob], `video_cover_${Date.now()}.png`, { type: "image/png" });
|
||||
resolve(frameFile);
|
||||
},
|
||||
"image/png",
|
||||
0.9
|
||||
);
|
||||
},
|
||||
{ once: true }
|
||||
);
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
const linkClick = () => {};
|
||||
|
||||
return { linkClick, insertVideo, insertLink, linkUrl, linkText, linkState, openLink, closeLink, handleClick, uniqid, userInfoWin, titleLength, submit, emojiState, openEmoji, closeEmoji, selectEmoji, optionEmoji, isPTitle, onEditorInput, onEditorFocus, onEditorBlur, paragraphTitle, info, tagList, token, cutAnonymity, editorRef, insertImage, judgeIsEmpty, isEmpty };
|
||||
|
||||
Reference in New Issue
Block a user