hookehuyr

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

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