@@ -2,6 +2,7 @@
|
|||||||
import { Icon } from "@iconify/vue"
|
import { Icon } from "@iconify/vue"
|
||||||
import { ProblemSet, UserBadge as UserBadgeType } from "utils/types"
|
import { ProblemSet, UserBadge as UserBadgeType } from "utils/types"
|
||||||
import UserBadge from "shared/components/UserBadge.vue"
|
import UserBadge from "shared/components/UserBadge.vue"
|
||||||
|
import { useUserStore } from "shared/store/user"
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
problemSet: ProblemSet
|
problemSet: ProblemSet
|
||||||
@@ -17,6 +18,8 @@ interface Emits {
|
|||||||
const props = defineProps<Props>()
|
const props = defineProps<Props>()
|
||||||
const emit = defineEmits<Emits>()
|
const emit = defineEmits<Emits>()
|
||||||
|
|
||||||
|
const userStore = useUserStore()
|
||||||
|
|
||||||
function getDifficultyTag(difficulty: string) {
|
function getDifficultyTag(difficulty: string) {
|
||||||
const difficultyMap: Record<
|
const difficultyMap: Record<
|
||||||
string,
|
string,
|
||||||
@@ -60,7 +63,7 @@ function handleJoin() {
|
|||||||
</n-tooltip>
|
</n-tooltip>
|
||||||
</n-flex>
|
</n-flex>
|
||||||
|
|
||||||
<n-flex align="center">
|
<n-flex align="center" v-if="userStore.isAuthed">
|
||||||
<!-- 用户徽章显示区域 - 只在已加入且有徽章时显示 -->
|
<!-- 用户徽章显示区域 - 只在已加入且有徽章时显示 -->
|
||||||
<n-flex v-if="isJoined && userBadges.length > 0" align="center">
|
<n-flex v-if="isJoined && userBadges.length > 0" align="center">
|
||||||
<n-text>已获徽章</n-text>
|
<n-text>已获徽章</n-text>
|
||||||
|
|||||||
@@ -63,6 +63,10 @@ async function init() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function handleProblemClick(problemId: string) {
|
async function handleProblemClick(problemId: string) {
|
||||||
|
if (!userStore.isAuthed) {
|
||||||
|
message.warning("请先登录!")
|
||||||
|
return
|
||||||
|
}
|
||||||
if (!isJoined.value) {
|
if (!isJoined.value) {
|
||||||
message.warning("请先点击【加入题单】按钮!")
|
message.warning("请先点击【加入题单】按钮!")
|
||||||
return
|
return
|
||||||
|
|||||||
Reference in New Issue
Block a user