|
@@ -15,7 +15,9 @@
|
|
|
<script>
|
|
|
import { getCatalog } from "../../api";
|
|
|
import router from '@system.router';
|
|
|
-import prompt from '@system.prompt'
|
|
|
+import prompt from '@system.prompt';
|
|
|
+
|
|
|
+const PER_PAGE_NUM = 100;
|
|
|
|
|
|
export default {
|
|
|
protected: {
|
|
@@ -33,12 +35,12 @@ export default {
|
|
|
var chapter_sequence_index = 0
|
|
|
if (this.chapter_sequence) {
|
|
|
var chapter_sequence = this.chapter_sequence
|
|
|
- chapter_sequence_index = chapter_sequence % 15 - 1
|
|
|
+ chapter_sequence_index = chapter_sequence % PER_PAGE_NUM - 1
|
|
|
this.chapter_sequence_index = chapter_sequence_index
|
|
|
- page = Math.ceil(chapter_sequence / 15)
|
|
|
+ page = Math.ceil(chapter_sequence / PER_PAGE_NUM)
|
|
|
}
|
|
|
this.startpage = page
|
|
|
- getCatalog({ bid: this.bid, page: page }).then(r => {
|
|
|
+ getCatalog({ bid: this.bid, page: page, page_size: PER_PAGE_NUM }).then(r => {
|
|
|
this.list = r.list
|
|
|
this.meta = r.meta
|
|
|
this.$element('catalog').scrollTo({ index: chapter_sequence_index })
|
|
@@ -61,7 +63,7 @@ export default {
|
|
|
loadCatalog() {
|
|
|
console.log("load data");
|
|
|
if (this.meta.last_page < (this.meta.current_page + 1)) return prompt.showToast({ message: '已经到底啦' })
|
|
|
- getCatalog({ bid: '5pNo6A7wqQmB1WgQygDjkOM9VZn2vXeY', page: this.meta.current_page + 1 }).then(r => {
|
|
|
+ getCatalog({ bid: '5pNo6A7wqQmB1WgQygDjkOM9VZn2vXeY', page: this.meta.current_page + 1, page_size: PER_PAGE_NUM }).then(r => {
|
|
|
console.log(...r.list)
|
|
|
this.list.push(...r.list)
|
|
|
this.meta = r.meta
|
|
@@ -70,7 +72,7 @@ export default {
|
|
|
loadPrev() {
|
|
|
console.log("get prev catalog");
|
|
|
if ((this.startpage - 1) < 1) return prompt.showToast({ message: '已经到顶啦' })
|
|
|
- getCatalog({ bid: '5pNo6A7wqQmB1WgQygDjkOM9VZn2vXeY', page: this.startpage - 1 }).then(r => {
|
|
|
+ getCatalog({ bid: '5pNo6A7wqQmB1WgQygDjkOM9VZn2vXeY', page: this.startpage - 1, page_size: PER_PAGE_NUM }).then(r => {
|
|
|
console.log(...r.list)
|
|
|
this.list.unshift(...r.list)
|
|
|
this.startpage = r.meta.current_page
|