️ 添加观测枢跳转入口

This commit is contained in:
BTMuli
2024-01-08 16:00:32 +08:00
parent 8fa5bda2e1
commit 03772b22ee
2 changed files with 68 additions and 5 deletions

View File

@@ -4,8 +4,12 @@
<TItembox :model-value="box" />
<div class="twc-brief-info">
<div class="twc-bi-top">
<span>{{ data.name }} {{ data.title }}</span>
<span>{{ data.description }}</span>
<div class="twc-bi-title">
<span>{{ data.name }}</span>
<span>{{ data.title }}</span>
<span @click="toWiki()"><v-icon>mdi-link</v-icon></span>
</div>
<div class="twc-bi-desc">{{ data.description }}</div>
</div>
<div class="twc-bi-grid1">
<div class="twc-big-item">
@@ -93,6 +97,8 @@ import TwcConstellations from "./twc-constellations.vue";
import TwcMaterials from "./twc-materials.vue";
import TwcSkills from "./twc-skills.vue";
import { getWikiData } from "../../data";
import Mys from "../../plugins/Mys";
import { createTGWindow } from "../../utils/TGWindow";
import showSnackbar from "../func/snackbar";
import TItembox, { TItemBoxData } from "../main/t-itembox.vue";
@@ -154,6 +160,25 @@ watch(
onMounted(async () => {
await loadData();
});
async function toWiki(): Promise<void> {
if (props.item.contentId === 0) {
showSnackbar({
text: `角色 ${props.item.name} 暂无详情`,
color: "warn",
});
return;
}
const url = Mys.Api.Obc.replace("{contentId}", props.item.contentId.toString());
createTGWindow(
url,
"Sub_window",
`Content_${props.item.contentId} ${props.item.name}`,
1200,
800,
true,
);
}
</script>
<style lang="css" scoped>
.twc-box {
@@ -180,13 +205,20 @@ onMounted(async () => {
flex-direction: column;
}
.twc-bi-top :nth-child(1) {
.twc-bi-title {
display: flex;
align-items: center;
color: var(--common-text-title);
column-gap: 10px;
font-family: var(--font-title);
font-size: 20px;
}
.twc-bi-top :nth-child(2) {
.twc-bi-title :last-child {
cursor: pointer;
}
.twc-bi-desc {
display: flex;
align-items: flex-end;
font-size: 14px;

View File

@@ -3,7 +3,10 @@
<div class="tww-brief">
<TItembox :model-value="box" />
<div class="tww-brief-info">
<div class="tww-brief-title">{{ data.name }}</div>
<div class="tww-brief-title">
<span>{{ data.name }}</span>
<span @click="toWiki()"><v-icon>mdi-link</v-icon></span>
</div>
<v-rating
class="tww-brief-rating"
v-model="select"
@@ -51,6 +54,8 @@ import { computed, onMounted, ref, watch } from "vue";
import TwcMaterials from "./twc-materials.vue";
import { getWikiData } from "../../data";
import Mys from "../../plugins/Mys";
import { createTGWindow } from "../../utils/TGWindow";
import { parseHtmlText } from "../../utils/toolFunc";
import showSnackbar from "../func/snackbar";
import TItembox, { TItemBoxData } from "../main/t-itembox.vue";
@@ -104,6 +109,25 @@ watch(
);
onMounted(async () => await loadData());
async function toWiki(): Promise<void> {
if (props.item.contentId === 0) {
showSnackbar({
text: `武器 ${props.item.name} 暂无详情`,
color: "warn",
});
return;
}
const url = Mys.Api.Obc.replace("{contentId}", props.item.contentId.toString());
createTGWindow(
url,
"Sub_window",
`Content_${props.item.contentId} ${props.item.name}`,
1200,
800,
true,
);
}
</script>
<style lang="css" scoped>
.tww-box {
@@ -126,11 +150,18 @@ onMounted(async () => await loadData());
}
.tww-brief-title {
display: flex;
align-items: center;
color: var(--common-text-title);
column-gap: 10px;
font-family: var(--font-title);
font-size: 20px;
}
.tww-brief-info :last-child {
cursor: pointer;
}
.tww-brief-rating {
color: var(--common-text-title);
}