Skip to content

Commit a5d40bb

Browse files
committed
imp: bill page
1 parent f06627b commit a5d40bb

4 files changed

Lines changed: 31 additions & 18 deletions

File tree

package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
{
22
"devDependencies": {
33
"@tailwindcss/vite": "^4.1.10",
4+
"@types/markdown-it": "^14.1.2",
45
"daisyui": "^5.0.43",
56
"tailwindcss": "^4.1.10",
67
"vitepress": "^1.6.3"
78
},
89
"scripts": {
9-
"docs:dev": "vitepress dev src",
10-
"docs:build": "vitepress build src",
11-
"docs:preview": "vitepress preview src"
10+
"dev": "vitepress dev src",
11+
"build": "vitepress build src",
12+
"preview": "vitepress preview src"
1213
},
1314
"dependencies": {
1415
"@nolebase/vitepress-plugin-enhanced-mark": "^2.15.1",

src/bill/bill.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
11
[
2+
{
3+
"date": "2025-11-01",
4+
"exchanged-amount": 376.42,
5+
"target": "Mirror 酱",
6+
"operator": "EncVar",
7+
"description": "开发者分成提现",
8+
"type": "income"
9+
},
210
{
311
"date": "2025-10-06",
412
"exchanged-amount": 89.00,
513
"target": "Ruollin",
614
"operator": "EncVar",
7-
"description": "给社区成员赞助一个正版账号~供调试使用~",
15+
"description": "给社区成员赞助一个正版账号(~~供调试使用~~)",
816
"type": "outlay"
917
},
1018
{

src/bill/bill.vue

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
<script setup lang="ts">
2-
import { Bill, BillManager } from "./bill.ts";
2+
import MarkdownIt from "markdown-it";
3+
import { BillManager } from "./bill.ts";
34
const bills = BillManager.getBills();
5+
const mdRenderer = new MarkdownIt();
46
</script>
57

68
<template>
@@ -21,10 +23,10 @@
2123
</p>
2224
</div>
2325
</div>
24-
<div class="border border-[var(--vp-c-brand-3)] rounded-[20px] p-2 m-2 flex flex-col gap-2 bg-[var(--vp-c-divider)]">
26+
<div class="border border-(--vp-c-brand-3) rounded-[20px] p-2 m-2 flex flex-col gap-2 bg-(--vp-c-divider)">
2527
<div class="collapse collapse-arrow rounded-[12.5px]" v-for="bill in bills">
2628
<input type="checkbox" />
27-
<div class="collapse-title font-semibold flex gap-2 bg-[var(--vp-nav-screen-bg-color)]">
29+
<div class="collapse-title font-semibold flex gap-2 bg-(--vp-nav-screen-bg-color)">
2830
<svg
2931
v-if="bill.type === 'outlay'"
3032
width="28"
@@ -66,33 +68,33 @@
6668
opacity: 75%;
6769
border-top: 0px;
6870
margin: 0px;
69-
margin-top: 8px;
71+
margin-top: 10px;
7072
border-right: 1px solid var(--vp-c-divider);
71-
margin-right: 4px;
73+
margin-right: 8px;
7274
padding-right: 8px;
7375
padding-top: 2px;
7476
">
75-
{{ bill["original-unit"] + bill["original-amount"] }}
77+
{{ bill["original-unit"] + bill["original-amount"].toFixed(2) }}
7678
</h3>
77-
<h2 style="border-top: 0px; margin: 0px; padding-top: 8px">{{
78-
bill["type"] === "income" ? "+" : bill["type"] === "outlay" ? "-" : ""
79-
}}¥{{ bill["exchanged-amount"] }}</h2>
79+
<h2 style="border-top: 0px; margin: 0px; padding-top: 8px">
80+
{{ bill["type"] === "income" ? "+" : bill["type"] === "outlay" ? "-" : "" }}¥{{ bill["exchanged-amount"].toFixed(2) }}
81+
</h2>
8082
</div>
8183
</div>
82-
<div class="collapse-content text-sm bg-[var(--vp-nav-screen-bg-color)]">
84+
<div class="collapse-content text-sm bg-(--vp-nav-screen-bg-color)">
8385
<div class="flex gap-2 items-center">
84-
<div class="badge badge-md badge-inline text-[var(--vp-nav-screen-bg-color)]" style="--badge-color: var(--vp-c-brand-3)">
86+
<div class="badge badge-md badge-inline text-(--vp-nav-screen-bg-color)" style="--badge-color: var(--vp-c-brand-3)">
8587
{{
8688
bill["type"] === "income" ? "收入来源" : bill["type"] === "outlay" ? "支出目标" : "交易对象"
8789
}}
8890
</div>
8991
{{ bill["target"] }}
9092
</div>
9193
<div class="flex gap-2 items-center mt-1">
92-
<div class="badge badge-md badge-inline text-[var(--vp-nav-screen-bg-color)]" style="--badge-color: var(--vp-c-warning-1)">
94+
<div class="badge badge-md badge-inline text-(--vp-nav-screen-bg-color)" style="--badge-color: var(--vp-c-warning-1)">
9395
交易内容
9496
</div>
95-
{{ bill["description"] }}
97+
<div id="bill-description" class="mt-0 mb-0" v-html="mdRenderer.render(bill['description'])"></div>
9698
</div>
9799
</div>
98100
</div>
@@ -123,4 +125,7 @@
123125
margin-left: 7.5px;
124126
color: black;
125127
}
128+
#bill-description p {
129+
margin: 0px;
130+
}
126131
</style>

src/projects/pcl-ce/changelog.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ export interface Release {
77
}
88

99
export async function getReleases(): Promise<Release[]> {
10-
let release: Release[] = [];
1110
return (await axios.get<Release[]>("https://api.github.com/repos/PCL-Community/PCL2-CE/releases")).data;
1211
}
1312

0 commit comments

Comments
 (0)