PC-vote/components/Empty.vue

86 lines
2.1 KiB
Vue
Raw Normal View History

2024-01-12 19:12:30 +08:00
<template>
<div class="empty-box-list flexcenter">
<div class="dot-list flexacenter">
<img class="item" src="@/assets/img/dot-yellow.svg" />
<img class="item" src="@/assets/img/dot-yellow.svg" />
<img class="item" src="@/assets/img/dot-yellow.svg" />
<img class="item" src="@/assets/img/dot-gray.svg" />
<img class="item" src="@/assets/img/dot-gray.svg" />
<img class="item" src="@/assets/img/dot-gray.svg" />
</div>
2025-03-21 16:42:52 +08:00
<img class="empty-icon" src="@/assets/img/empty-icon.png" />
2024-01-15 19:02:10 +08:00
<template v-if="isNeedIssue">
<div class="empty-hint" style="margin-bottom: 7px;">没有找到相关结果请更换搜索关键词</div>
<div class="empty-hint flexacenter">
或者
<div class="sponsor" @click="goIssue">发起一个新投票</div>
</div>
</template>
<div v-else class="empty-hint">{{ hint || "暂无内容" }}</div>
2024-01-12 19:12:30 +08:00
</div>
</template>
<script setup>
2024-01-15 19:02:10 +08:00
import { useRouter } from "vue-router"
const router = useRouter()
2024-01-12 19:12:30 +08:00
let props = defineProps({
hint: String,
2024-01-15 19:02:10 +08:00
isNeedIssue: Boolean,
2024-01-12 19:12:30 +08:00
})
2024-01-15 19:02:10 +08:00
2024-01-29 11:53:50 +08:00
let isNeedLogin = inject("isNeedLogin")
const goLogin = inject("goLogin")
const goIssue = () => {
if (isNeedLogin.value) {
goLogin()
return
}
// router.push(`/publish`)
goToURL(`/publish`)
}
2024-01-12 19:12:30 +08:00
</script>
<style lang="less" scoped>
.empty-box-list {
// width: 690px;
// height: 490px;
background-color: #ffffff;
border-radius: 6px;
margin: 0 auto;
flex-direction: column;
2024-05-15 11:08:06 +08:00
padding-right: 42px;
2024-01-12 19:12:30 +08:00
.dot-list .item {
width: 8px;
height: 8px;
&:not(:last-of-type) {
margin-right: 5px;
}
}
.empty-icon {
width: 100px;
height: 100px;
margin-top: 10px;
margin-bottom: 15px;
}
.empty-hint {
font-size: 13px;
color: #7f7f7f;
line-height: 22px;
2024-01-15 19:02:10 +08:00
.sponsor {
text-decoration: underline;
color: #72db86;
margin-left: 5px;
cursor: pointer;
}
2024-01-12 19:12:30 +08:00
}
}
</style>