Showing
6 changed files
with
17 additions
and
20 deletions
| 1 | import { useVideoList } from '@/composables/useVideoList.js' | 1 | import { useVideoList } from '@/composables/useVideoList.js' |
| 2 | import { useDefaultPerf } from '@/composables/useDefaultPerf.js' | 2 | import { useDefaultPerf } from '@/composables/useDefaultPerf.js' |
| 3 | +import { useBookList } from '@/composables/useBookList.js' | ||
| 3 | 4 | ||
| 4 | export { | 5 | export { |
| 5 | useVideoList, | 6 | useVideoList, |
| 6 | useDefaultPerf, | 7 | useDefaultPerf, |
| 8 | + useBookList | ||
| 7 | } | 9 | } | ... | ... |
| ... | @@ -2,7 +2,7 @@ import { ref } from 'vue' | ... | @@ -2,7 +2,7 @@ import { ref } from 'vue' |
| 2 | import axios from '@/utils/axios'; | 2 | import axios from '@/utils/axios'; |
| 3 | import { Toast } from 'vant'; | 3 | import { Toast } from 'vant'; |
| 4 | 4 | ||
| 5 | -export const bookFn = ($route) => { | 5 | +export const useBookList = ($route) => { |
| 6 | const emptyStatus = ref(false); | 6 | const emptyStatus = ref(false); |
| 7 | const kg_id = $route.query.kg_id ? $route.query.kg_id : ''; | 7 | const kg_id = $route.query.kg_id ? $route.query.kg_id : ''; |
| 8 | const kgInfo = ref({ | 8 | const kgInfo = ref({ | ... | ... |
| ... | @@ -4,6 +4,7 @@ import icon_down from '@images/icon-zhankai@2x.png' | ... | @@ -4,6 +4,7 @@ import icon_down from '@images/icon-zhankai@2x.png' |
| 4 | import icon_subscribed from '@images/icon-dingyue01@2x.png' | 4 | import icon_subscribed from '@images/icon-dingyue01@2x.png' |
| 5 | import icon_unsubscribe from '@images/icon-dingyue02@2x.png' | 5 | import icon_unsubscribe from '@images/icon-dingyue02@2x.png' |
| 6 | import no_image from '@images/que-shuju@2x.png' | 6 | import no_image from '@images/que-shuju@2x.png' |
| 7 | +import icon_avatar from '@images/que-logo@2x.png' | ||
| 7 | 8 | ||
| 8 | export { | 9 | export { |
| 9 | icon_video, | 10 | icon_video, |
| ... | @@ -12,4 +13,5 @@ export { | ... | @@ -12,4 +13,5 @@ export { |
| 12 | icon_subscribed, | 13 | icon_subscribed, |
| 13 | icon_unsubscribe, | 14 | icon_unsubscribe, |
| 14 | no_image, | 15 | no_image, |
| 16 | + icon_avatar | ||
| 15 | } | 17 | } | ... | ... |
| ... | @@ -3,6 +3,7 @@ import VideoCard from '@/components/VideoCard/index.vue' | ... | @@ -3,6 +3,7 @@ import VideoCard from '@/components/VideoCard/index.vue' |
| 3 | import NoticeOverlay from '@/components/NoticeOverlay/index.vue' | 3 | import NoticeOverlay from '@/components/NoticeOverlay/index.vue' |
| 4 | import DonateBook from '@/components/DonateBook/index.vue' | 4 | import DonateBook from '@/components/DonateBook/index.vue' |
| 5 | import ShortcutFixed from '@/components/ShortcutFixed/index.vue' | 5 | import ShortcutFixed from '@/components/ShortcutFixed/index.vue' |
| 6 | +import BookCard from '@/components/BookCard/index.vue' | ||
| 6 | 7 | ||
| 7 | export { | 8 | export { |
| 8 | MyButton, | 9 | MyButton, |
| ... | @@ -10,4 +11,5 @@ export { | ... | @@ -10,4 +11,5 @@ export { |
| 10 | NoticeOverlay, | 11 | NoticeOverlay, |
| 11 | DonateBook, | 12 | DonateBook, |
| 12 | ShortcutFixed, | 13 | ShortcutFixed, |
| 14 | + BookCard | ||
| 13 | } | 15 | } | ... | ... |
| ... | @@ -6,6 +6,7 @@ import { storeToRefs } from 'pinia' | ... | @@ -6,6 +6,7 @@ import { storeToRefs } from 'pinia' |
| 6 | import { mainStore } from '@/store' | 6 | import { mainStore } from '@/store' |
| 7 | import { Toast } from 'vant'; | 7 | import { Toast } from 'vant'; |
| 8 | import { wxInfo, hasEllipsis } from '@/utils/tools'; | 8 | import { wxInfo, hasEllipsis } from '@/utils/tools'; |
| 9 | +import { useTitle } from '@vueuse/core' | ||
| 9 | 10 | ||
| 10 | export { | 11 | export { |
| 11 | Cookies, | 12 | Cookies, |
| ... | @@ -16,5 +17,6 @@ export { | ... | @@ -16,5 +17,6 @@ export { |
| 16 | mainStore, | 17 | mainStore, |
| 17 | Toast, | 18 | Toast, |
| 18 | wxInfo, | 19 | wxInfo, |
| 19 | - hasEllipsis | 20 | + hasEllipsis, |
| 21 | + useTitle | ||
| 20 | } | 22 | } | ... | ... |
| ... | @@ -47,25 +47,14 @@ | ... | @@ -47,25 +47,14 @@ |
| 47 | </template> | 47 | </template> |
| 48 | 48 | ||
| 49 | <script setup> | 49 | <script setup> |
| 50 | -import { useTitle } from '@vueuse/core' | ||
| 51 | -import { mainStore } from '@/store' | ||
| 52 | - | ||
| 53 | -import Cookies from 'js-cookie' | ||
| 54 | - | ||
| 55 | -import no_image from '@images/que-shuju@2x.png' | ||
| 56 | -import icon_avatar from '@images/que-logo@2x.png' | ||
| 57 | - | ||
| 58 | -import MyButton from '@/components/MyButton/index.vue' | ||
| 59 | -import BookCard from '@/components/BookCard/index.vue' | ||
| 60 | -import ShortcutFixed from '@/components/ShortcutFixed/index.vue' | ||
| 61 | - | ||
| 62 | -import { bookFn } from '@/composables/useBookList.js' | ||
| 63 | - | ||
| 64 | import { ref, reactive, onMounted } from 'vue' | 50 | import { ref, reactive, onMounted } from 'vue' |
| 65 | import { useRoute, useRouter } from 'vue-router' | 51 | import { useRoute, useRouter } from 'vue-router' |
| 66 | -import _ from 'lodash' | 52 | + |
| 67 | -import axios from '@/utils/axios'; | 53 | +import { Cookies, _, axios, mainStore, Toast, useTitle } from '@/utils/generatePackage.js' |
| 68 | -import { Toast } from 'vant' | 54 | +import { no_image, icon_avatar } from '@/utils/generateIcons.js' |
| 55 | +import { MyButton, ShortcutFixed, BookCard } from '@/utils/generateModules.js' | ||
| 56 | + | ||
| 57 | +import { useBookList } from '@/composables'; | ||
| 69 | 58 | ||
| 70 | const $route = useRoute(); | 59 | const $route = useRoute(); |
| 71 | const $router = useRouter(); | 60 | const $router = useRouter(); |
| ... | @@ -77,7 +66,7 @@ store.changeKeepPages('clear'); | ... | @@ -77,7 +66,7 @@ store.changeKeepPages('clear'); |
| 77 | // 设置页面标题 | 66 | // 设置页面标题 |
| 78 | useTitle($route.meta.title) | 67 | useTitle($route.meta.title) |
| 79 | 68 | ||
| 80 | -const { kg_id, kgInfo, emptyStatus } = bookFn($route) | 69 | +const { kg_id, kgInfo, emptyStatus } = useBookList($route) |
| 81 | 70 | ||
| 82 | // 配置快捷跳转条 | 71 | // 配置快捷跳转条 |
| 83 | const shortcutItem = ref([]); | 72 | const shortcutItem = ref([]); | ... | ... |
-
Please register or login to post a comment