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, "