hookehuyr

✨ feat(选择书籍页面): 新增数据为空展示

......@@ -27,20 +27,28 @@
<template v-for="(item, key) in kgInfo.book_list" :key="key">
<book-card type="C" :item="item" @on-click="onClick(item)"></book-card>
</template>
<van-empty
v-if="!kgInfo.book_list.length"
class="custom-image"
:image="no_image"
description="暂无书籍信息"
/>
</div>
<div style="height: 1rem;"></div>
<shortcut-fixed type="C" :item="['home', 'me']"></shortcut-fixed>
<shortcut-fixed type="C" :item="shortcutItem"></shortcut-fixed>
</div>
</template>
<script setup>
import no_image from '@images/que-shuju@2x.png'
import MyButton from '@/components/MyButton/index.vue'
import BookCard from '@/components/BookCard/index.vue'
import ShortcutFixed from '@/components/ShortcutFixed/index.vue'
import { bookFn } from '@/composables/useBookList.js'
import { reactive } from 'vue'
import { ref, reactive } from 'vue'
import { useRoute, useRouter } from 'vue-router'
import _ from 'lodash'
......@@ -49,6 +57,15 @@ const $router = useRouter();
const { kg_id, kgInfo } = bookFn($route)
// 配置快捷跳转条
const shortcutItem = ref(['home', 'me']);
// TODO: 访客是否有个人中心
// if (!$route.query.kg_id) { // 访客模式,没有个人中心
// shortcutItem.value = ['home']
// } else {
// shortcutItem.value = ['home', 'me']
// }
// 自定义按钮颜色样式
const styleObject = reactive({
backgroundColor: '#F4675A',
......@@ -88,7 +105,11 @@ export default {
<style lang="less" scoped>
@import url('@css/content-bg.less');
:global(.custom-image .van-empty__image) {
// margin-top: 15vh;
width: 10vh;
height: 10vh;
}
.choose-book-page {
.belong-school {
padding: 1.5rem;
......@@ -130,4 +151,4 @@ export default {
}
}
}
</style>
\ No newline at end of file
</style>
......