hookehuyr

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

...@@ -27,20 +27,28 @@ ...@@ -27,20 +27,28 @@
27 <template v-for="(item, key) in kgInfo.book_list" :key="key"> 27 <template v-for="(item, key) in kgInfo.book_list" :key="key">
28 <book-card type="C" :item="item" @on-click="onClick(item)"></book-card> 28 <book-card type="C" :item="item" @on-click="onClick(item)"></book-card>
29 </template> 29 </template>
30 + <van-empty
31 + v-if="!kgInfo.book_list.length"
32 + class="custom-image"
33 + :image="no_image"
34 + description="暂无书籍信息"
35 + />
30 </div> 36 </div>
31 <div style="height: 1rem;"></div> 37 <div style="height: 1rem;"></div>
32 - <shortcut-fixed type="C" :item="['home', 'me']"></shortcut-fixed> 38 + <shortcut-fixed type="C" :item="shortcutItem"></shortcut-fixed>
33 </div> 39 </div>
34 </template> 40 </template>
35 41
36 <script setup> 42 <script setup>
43 +import no_image from '@images/que-shuju@2x.png'
44 +
37 import MyButton from '@/components/MyButton/index.vue' 45 import MyButton from '@/components/MyButton/index.vue'
38 import BookCard from '@/components/BookCard/index.vue' 46 import BookCard from '@/components/BookCard/index.vue'
39 import ShortcutFixed from '@/components/ShortcutFixed/index.vue' 47 import ShortcutFixed from '@/components/ShortcutFixed/index.vue'
40 48
41 import { bookFn } from '@/composables/useBookList.js' 49 import { bookFn } from '@/composables/useBookList.js'
42 50
43 -import { reactive } from 'vue' 51 +import { ref, reactive } from 'vue'
44 import { useRoute, useRouter } from 'vue-router' 52 import { useRoute, useRouter } from 'vue-router'
45 import _ from 'lodash' 53 import _ from 'lodash'
46 54
...@@ -49,6 +57,15 @@ const $router = useRouter(); ...@@ -49,6 +57,15 @@ const $router = useRouter();
49 57
50 const { kg_id, kgInfo } = bookFn($route) 58 const { kg_id, kgInfo } = bookFn($route)
51 59
60 +// 配置快捷跳转条
61 +const shortcutItem = ref(['home', 'me']);
62 +// TODO: 访客是否有个人中心
63 +// if (!$route.query.kg_id) { // 访客模式,没有个人中心
64 +// shortcutItem.value = ['home']
65 +// } else {
66 +// shortcutItem.value = ['home', 'me']
67 +// }
68 +
52 // 自定义按钮颜色样式 69 // 自定义按钮颜色样式
53 const styleObject = reactive({ 70 const styleObject = reactive({
54 backgroundColor: '#F4675A', 71 backgroundColor: '#F4675A',
...@@ -88,7 +105,11 @@ export default { ...@@ -88,7 +105,11 @@ export default {
88 105
89 <style lang="less" scoped> 106 <style lang="less" scoped>
90 @import url('@css/content-bg.less'); 107 @import url('@css/content-bg.less');
91 - 108 +:global(.custom-image .van-empty__image) {
109 + // margin-top: 15vh;
110 + width: 10vh;
111 + height: 10vh;
112 +}
92 .choose-book-page { 113 .choose-book-page {
93 .belong-school { 114 .belong-school {
94 padding: 1.5rem; 115 padding: 1.5rem;
...@@ -130,4 +151,4 @@ export default { ...@@ -130,4 +151,4 @@ export default {
130 } 151 }
131 } 152 }
132 } 153 }
133 -</style>
...\ No newline at end of file ...\ No newline at end of file
154 +</style>
......