hookehuyr

客户新需求:书籍列表传值kg_id

1 /* 1 /*
2 * @Date: 2022-05-05 18:07:16 2 * @Date: 2022-05-05 18:07:16
3 * @LastEditors: hookehuyr hookehuyr@gmail.com 3 * @LastEditors: hookehuyr hookehuyr@gmail.com
4 - * @LastEditTime: 2022-06-20 11:01:53 4 + * @LastEditTime: 2022-10-01 21:13:07
5 * @FilePath: /tswj/src/composables/useVideoList.js 5 * @FilePath: /tswj/src/composables/useVideoList.js
6 * @Description: 文件描述 6 * @Description: 文件描述
7 */ 7 */
...@@ -21,7 +21,7 @@ export const useVideoList = () => { ...@@ -21,7 +21,7 @@ export const useVideoList = () => {
21 const chooseLanguage = ref({ text: '普通话', val: '普通话' }); // 默认选中普通话 21 const chooseLanguage = ref({ text: '普通话', val: '普通话' }); // 默认选中普通话
22 /** 22 /**
23 * 切换视频语言回调 23 * 切换视频语言回调
24 - * @param {*} type 24 + * @param {*} type
25 */ 25 */
26 const toggleLanguage = (type) => { 26 const toggleLanguage = (type) => {
27 if (type === 'mandarin') { 27 if (type === 'mandarin') {
...@@ -70,11 +70,11 @@ export const useVideoList = () => { ...@@ -70,11 +70,11 @@ export const useVideoList = () => {
70 }) 70 })
71 .catch(err => { 71 .catch(err => {
72 // tslint:disable-next-line: no-console 72 // tslint:disable-next-line: no-console
73 - console.error(err); 73 + console.error(err);
74 }) 74 })
75 75
76 const showPicker = ref(false); 76 const showPicker = ref(false);
77 - 77 +
78 /** 78 /**
79 * 选择方言确认后回调 79 * 选择方言确认后回调
80 * @param {*} param 80 * @param {*} param
...@@ -108,7 +108,7 @@ export const useVideoList = () => { ...@@ -108,7 +108,7 @@ export const useVideoList = () => {
108 */ 108 */
109 const onLoad = async () => { 109 const onLoad = async () => {
110 // 异步更新数据 110 // 异步更新数据
111 - const { data, code } = await bookInfoAPI({ book_id: $route.query.id, localism_type: chooseLanguage.value.text, limit: limit.value, offset: offset.value }) 111 + const { data, code } = await bookInfoAPI({ book_id: $route.query.id, kg_id: $route.query.kg_id ? $route.query.kg_id : 0, localism_type: chooseLanguage.value.text, limit: limit.value, offset: offset.value })
112 if (code === 1) { 112 if (code === 1) {
113 bookInfo.value = data; 113 bookInfo.value = data;
114 flowFn(data.prod_list, prod_list, offset, loading, finished, finishedTextStatus, emptyStatus); 114 flowFn(data.prod_list, prod_list, offset, loading, finished, finishedTextStatus, emptyStatus);
......
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
43 </van-sticky> --> 43 </van-sticky> -->
44 <template v-for="(item, key) in kgInfo.book_list" :key="key"> 44 <template v-for="(item, key) in kgInfo.book_list" :key="key">
45 <book-card v-if="item.show" :type="USER_ROLE.CLIENT" :item="item" 45 <book-card v-if="item.show" :type="USER_ROLE.CLIENT" :item="item"
46 - @on-click="go('/client/bookDetail', { id: item.id })" /> 46 + @on-click="go('/client/bookDetail', { id: item.id, kg_id: $route.query.kg_id })" />
47 </template> 47 </template>
48 <van-empty v-if="emptyStatus" class="custom-image" :image="no_image" description="暂无书籍信息" /> 48 <van-empty v-if="emptyStatus" class="custom-image" :image="no_image" description="暂无书籍信息" />
49 </div> 49 </div>
...@@ -66,6 +66,7 @@ import { ref, watch } from 'vue' ...@@ -66,6 +66,7 @@ import { ref, watch } from 'vue'
66 import { USER_ROLE } from '@/constant' 66 import { USER_ROLE } from '@/constant'
67 import { sharePage } from '@/composables/useShare.js' 67 import { sharePage } from '@/composables/useShare.js'
68 68
69 +const $route = useRoute();
69 const go = useGo(); 70 const go = useGo();
70 // 删除所有的 keep-alive 缓存 71 // 删除所有的 keep-alive 缓存
71 killPages(); 72 killPages();
......