Browse Source

update sign title and change catalog per_page_number

Zhengxiaowei 5 years ago
parent
commit
a33d554542
2 changed files with 9 additions and 7 deletions
  1. 8 6
      src/views/Catalog/index.ux
  2. 1 1
      src/views/My/index.ux

+ 8 - 6
src/views/Catalog/index.ux

@@ -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

+ 1 - 1
src/views/My/index.ux

@@ -17,7 +17,7 @@
       <div class="operator-item" @click="pageChange('Sign')">
         <div class="item-name">
           <image src="../../assets/imgs/sign.png"></image>
-          <text>签到</text>
+          <text>签到记录</text>
         </div>
         <div class="info-text">
           <image class="arrow" src="../../assets/imgs/arrow-right.png"></image>