Compare commits

...

2 Commits

Author SHA1 Message Date
Tim
9b4c36c76a feat: add point rules and products 2025-08-17 01:32:26 +08:00
Tim
edfc81aeb0 Merge pull request #603 from nagisa77/codex/add
feat: add point mall module
2025-08-17 01:24:06 +08:00

View File

@@ -2,6 +2,20 @@
<div class="point-mall-page">
<p v-if="authState.loggedIn && point !== null">我的积分{{ point }}</p>
<p v-else>请先登录以查看积分</p>
<section class="rules">
<h2>积分规则</h2>
<ul>
<li v-for="(rule, idx) in pointRules" :key="idx">{{ rule }}</li>
</ul>
</section>
<section class="goods">
<h2>积分兑换商品</h2>
<ul>
<li v-for="(good, idx) in goods" :key="idx">{{ good.name }} - {{ good.cost }} 积分</li>
</ul>
</section>
</div>
</template>
@@ -11,6 +25,18 @@ import { authState, fetchCurrentUser } from '~/utils/auth'
const point = ref(null)
const pointRules = [
'发帖:每天前两次,每次 30 积分',
'评论:每天前四条评论可获 10 积分,你的帖子被评论也可获 10 积分',
'帖子被点赞:每次 10 积分',
'评论被点赞:每次 10 积分',
]
const goods = [
{ name: 'GPT Plus for 1 month', cost: 20000 },
{ name: '奶茶', cost: 5000 },
]
onMounted(async () => {
if (authState.loggedIn) {
const user = await fetchCurrentUser()
@@ -26,4 +52,9 @@ onMounted(async () => {
background-color: var(--background-color);
margin: 0 auto;
}
.rules,
.goods {
margin-top: 20px;
}
</style>