Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Hooke
/
tswj
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
hookehuyr
2022-05-26 22:26:13 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
a46a16cfe3b764159d86bec98bd61d0aad6788e8
a46a16cf
1 parent
8a712595
✨ feat(书籍详情页): 订阅API接口调整,滚动恢复调整
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
16 deletions
src/api/C/perf.js
src/views/client/bookDetail.vue
src/api/C/perf.js
0 → 100644
View file @
a46a16c
import
{
fn
,
fetch
}
from
'@/api/fn'
;
const
Api
=
{
PERF_INFO
:
'/srv/?a=perf_info'
,
ADD_FOLLOW
:
'/srv/?a=add_follow'
,
}
/**
* @description: 获取表演者信息
* @param {String} perf_id 表演者ID
* @returns
*/
export
const
perfInfoAPI
=
(
params
)
=>
fn
(
fetch
.
post
(
Api
.
PERF_INFO
,
params
));
/**
* @description: 关注用户操作
* @param {String} perf_id 表演者ID
* @returns
*/
export
const
addFollowAPI
=
(
params
)
=>
fn
(
fetch
.
post
(
Api
.
ADD_FOLLOW
,
params
));
src/views/client/bookDetail.vue
View file @
a46a16c
...
...
@@ -121,10 +121,13 @@ import { Cookies, $, _, storeToRefs, mainStore, Toast, hasEllipsis } from '@/uti
import { MyButton, VideoCard, NoticeOverlay, DonateBook, ShortcutFixed } from '@/utils/generateModules'
import { icon_video, icon_up, icon_down, icon_subscribed, icon_unsubscribe, no_image } from '@/utils/generateIcons'
import { JSJ_FORM_C } from '@/constant'
import { useVideoList, useDefaultPerf, useShortcutBar } from '@/composables';
import { useVideoList, useDefaultPerf, useShortcutBar
, useScrollTop
} from '@/composables';
import { addSubscribeAPI } from '@/api/C/book.js'
const { shortcutItem } = useShortcutBar(['home', 'me']); // 配置快捷跳转条
const { resetScrollTop } = useScrollTop(); // 页面滚动恢复
resetScrollTop('scrollTop');
const $route = useRoute();
const $router = useRouter();
...
...
@@ -166,7 +169,7 @@ const toDonate = () => {
const closeDonate = (v) => {
showDonate.value = v;
}
/**********************************/
/**********************************
*********
/
/**
...
...
@@ -257,30 +260,18 @@ onActivated(() => { // keepAlive 重置后执行回调
})
// 触发更新
prod_list.value = arr.value;
const { scrollTop } = storeToRefs(store);
// 嵌套滚动,执行两个,先滚外面再滚里面
_.times(2, () => {
$("html,body").animate({ "scrollTop": String(scrollTop.value) + 'px' });
});
// 滚动恢复
resetScrollTop('scrollTop');
// 更新页面名称,因为不刷新副作用~
document.title = $route.meta.title;
});
const { scrollTop } = storeToRefs(store);
// 嵌套滚动,执行两个,先滚外面再滚里面
_.times(2, () => {
$("html,body").animate({ "scrollTop": String(scrollTop.value) + 'px' });
});
onBeforeRouteLeave(() => {
// 监听记录滚动位置
store.changeScrollTop(window.scrollY)
})
/*****************************************************/
/****************** 视频组件相关操作 *******************/
const goToDetail = (prod_id, book_id, type) => { // 跳转作品详情页
$router.push({
...
...
Please
register
or
login
to post a comment