From c9e229a5cd67230e69f5fd89c848c102e238bd9f Mon Sep 17 00:00:00 2001
From: "DESKTOP-RQ919RC\\Pc" <1300399510@qq.com>
Date: Wed, 19 Nov 2025 19:27:43 +0800
Subject: [PATCH] =?UTF-8?q?fix(bi):=20=E6=B7=BB=E5=8A=A0=E6=8A=95=E5=B8=81?=
=?UTF-8?q?=E6=95=B0=E9=87=8F=E5=BF=85=E9=A1=BB=E5=A4=A7=E4=BA=8E0?=
=?UTF-8?q?=E7=9A=84=E6=A0=A1=E9=AA=8C?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
feat(item-bottom): 实现二维码弹窗自适应右侧边界
添加判断逻辑使二维码弹窗在靠近右侧边界时向左弹出
refactor(public.js): 优化ajax请求配置和登录跳转逻辑
统一设置axios默认配置,提取登录跳转函数
style(public.css): 调整QRcode-box.right的定位
修复二维码弹窗靠近右侧时的显示问题
fix(details.js): 修复粗体标记正则匹配多行内容
使用[\s\S]*?匹配可能的多行内容
refactor(index.js): 优化列表加载和滚动逻辑
移除模拟数据,添加加载状态,调整滚动加载阈值
chore: 更新html模板中的唯一标识和广告类名
---
component/bi/bi.js | 4 +
component/item-bottom/item-bottom.js | 25 +++-
component/item-bottom/item-bottom.txt | 4 +-
component/latest-list/latest-list.js | 2 +-
css/public.css | 4 +-
css/public.less | 5 +-
details.html | 2 +-
index.html | 4 +-
js/details.js | 27 +---
js/edit.js | 67 ++++++----
js/index.js | 106 +++++----------
js/public.js | 178 ++++++++++++++------------
12 files changed, 211 insertions(+), 217 deletions(-)
diff --git a/component/bi/bi.js b/component/bi/bi.js
index 1e692fe..0701493 100644
--- a/component/bi/bi.js
+++ b/component/bi/bi.js
@@ -139,6 +139,10 @@ class BiCard extends HTMLElement {
coinSubmit() {
const num = Number(this.input.value || this.defaultcoinnum) || 0;
+ if (num <= 0) {
+ creationAlertBox("error", "投币数量必须大于0");
+ return;
+ }
this.fetchData(`https://api.gter.net/v2/api/forum/postTopicCoin`, {
token: this.token,
num,
diff --git a/component/item-bottom/item-bottom.js b/component/item-bottom/item-bottom.js
index afe7bdc..50476e2 100644
--- a/component/item-bottom/item-bottom.js
+++ b/component/item-bottom/item-bottom.js
@@ -114,17 +114,36 @@ export const itemBottom = defineComponent({
});
};
+ let isright = ref(false);
+
const share = () => {
const token = item.value.token || "";
- ajax(`/v2/api/forum/postTopicShare`, {token});
+ ajax(`/v2/api/forum/postTopicShare`, { token });
+
+ if (!shareBoxRef.value) return
+
+ // 1. 获取元素相对于可视窗口的位置信息
+ const rect = shareBoxRef.value.getBoundingClientRect();
+
+ // 2. 获取可视窗口宽度(不包含滚动条,更准确)
+ const clientWidth = document.documentElement.clientWidth;
+
+ // 3. 计算距离:可视窗口宽度 - 元素右边缘到左边缘的距离
+ const distance = clientWidth - rect.right;
+ console.log('distance', distance);
+
+ if (distance < 140) isright.value = true;
+ else isright.value = false;
};
- return { share, QRcode, showQRcode, copyLinkClick, collectClick, item, likeClick, isLogin, isLikeGif };
+ const shareBoxRef = ref(null);
+
+ return { isright, shareBoxRef, share, QRcode, showQRcode, copyLinkClick, collectClick, item, likeClick, isLogin, isLikeGif };
},
components: {
like,
},
- template: `
-
+
diff --git a/js/details.js b/js/details.js
index 7fac8cf..fde684b 100644
--- a/js/details.js
+++ b/js/details.js
@@ -151,31 +151,6 @@ const appSectionIndex = createApp({
timestamp.value = strtimeago(targetInfo.release_at, 4);
updatedTime.value = targetInfo.updated_at ? strtimeago(targetInfo.updated_at, 4) : null;
- // targetInfo.content = "[attach]976054[/attach]\n\n[attachimg]1008585[/attachimg]\n[attach]850105[/attach]";
- // targetInfo.attachments = {
- // images: [
- // {
- // aid: 1008585,
- // url: "https://o.x-php.com/Zvt57TuJSUvkyhw-xG_Y2l-U_pokcHeD1NFX9ddrB_WbUGy8P79gQxcXHOeQ4soV7NkzNDQyOQ~~",
- // thumb: "https://o.x-php.com/Zvt57TuJSUvkyhw-xG_Y2l-U_pokcHeD1NFX9ddrB_WbUWy8K_hyVFweFbPD7IZK4sVMAmnF5Vzp9Fkg0jQ0Mjk~",
- // },
- // ],
- // files: [],
- // videos: [
- // {
- // aid: 976054,
- // posterurl: "https://o.x-php.com/Zvt57TuJSUvkyhw-xG_Y2l-U_pokc36P1NFX9ddrB_WbUWy8K_hyVFweFrPD7IZK4sVMAm3Btwy-9Fkg0jQ0Mjk~",
- // url: "https://o.x-php.com/Zvt57TuJSUvkyhw-xG7Y2l-c-ZwscHvqqsgFptxhXa6RWi26P-BuTQFFE7SQttkb8LQ0NDI5",
- // thumb: "https://o.x-php.com/Zvt57TuJSUvkyhw-xG7Y2l-c-ZwscHvqqsgFptxhXa6QWi2uePJ5Bg8VFLPIqoYV7MtbCG2RtAz_-kVNNDQyOQ~~",
- // },
- // {
- // aid: 850105,
- // posterurl: "https://o.x-php.com/Zvt57TuJSUvkyhw-xG_Y2l-U_pokc32G1NFX9ddrB_WbUWy8K_hyVFweFrPD7IZK4sVMA2eU5Vvl9Fkg0jQ0Mjk~",
- // url: "https://o.x-php.com/Zvt57TuJSUvkyhw-xG7Y2l-d-5otdXrqqsgFptxhXa6RWi26P-BuTQNAEuHBs9kb8LQ0NDI5",
- // thumb: "https://o.x-php.com/Zvt57TuJSUvkyhw-xG7Y2l-d-5otdXrqqsgFptxhXa6QWi2uePJ5Bg8VFLPIqoYV7MsICzzBsFj_-kVNNDQyOQ~~",
- // },
- // ],
- // };
if (targetInfo.content) targetInfo.content = restoreHtml(targetInfo.content, targetInfo.attachments);
info.value = targetInfo;
@@ -213,7 +188,7 @@ const appSectionIndex = createApp({
html = html.replace(/\[tag\]([^[]+)\[\/tag\]/gi, '#$1 ');
// 4. 还原粗体标记为h2标签
- html = html.replace(/\[b\]([^[]+)\[\/b\]/gi, "