帖子收藏 #100

This commit is contained in:
目棃
2024-03-19 21:51:57 +08:00
parent c5587211fd
commit 8996c1bce1
12 changed files with 602 additions and 19 deletions

View File

@@ -1,5 +1,6 @@
<template>
<TSwitchTheme />
<TSetCollect v-if="collectExist" :model-value="postId" :data="postData" />
<TShareBtn
v-show="!loadingEmpty"
v-model="postRef"
@@ -85,6 +86,7 @@ import { appWindow } from "@tauri-apps/api/window";
import { nextTick, onMounted, onUnmounted, ref, watch } from "vue";
import { useRoute } from "vue-router";
import TSetCollect from "../components/app/t-setCollect.vue";
import TSwitchTheme from "../components/app/t-switchTheme.vue";
import TShareBtn from "../components/main/t-shareBtn.vue";
import ToLoading from "../components/overlay/to-loading.vue";
@@ -92,6 +94,7 @@ import TpAvatar from "../components/post/tp-avatar.vue";
import TpParser from "../components/post/tp-parser.vue";
import TpoCollection from "../components/post/tpo-collection.vue";
import Mys from "../plugins/Mys";
import TGSqlite from "../plugins/Sqlite";
import { useAppStore } from "../store/modules/app";
import TGClient from "../utils/TGClient";
import TGLogger from "../utils/TGLogger";
@@ -119,6 +122,7 @@ const shareTime = ref<number>(Math.floor(Date.now() / 1000));
const shareTimeTimer = ref<any>();
// 合集
const showCollection = ref<boolean>(false);
const collectExist = ref<boolean>(false);
onMounted(async () => {
await appWindow.show();
@@ -160,6 +164,7 @@ onMounted(async () => {
await TGLogger.Info(`[t-post][${postId}][onMounted] 打开 JSON 窗口`);
createPostJson(postId);
}
collectExist.value = await TGSqlite.checkTableExist("UserCollection");
await nextTick(() => {
shareTimeTimer.value = setInterval(() => {
shareTime.value = Math.floor(Date.now() / 1000);