Просмотр исходного кода

阅读器按钮点击两次才成功修复

gdy96 5 лет назад
Родитель
Сommit
532a8c81a6
4 измененных файлов с 35 добавлено и 21 удалено
  1. 1 1
      src/components/book/book.ux
  2. 1 1
      src/manifest.json
  3. 28 14
      src/views/Reader/index.ux
  4. 5 5
      src/views/Shelf/index.ux

+ 1 - 1
src/components/book/book.ux

@@ -73,7 +73,7 @@ export default {
         uri: "/views/Reader",
         params: {
           bid: book.bid,
-          chapter_id: book.last_cid
+          chapter_id: book.recent_cid
         }
       })
       return

+ 1 - 1
src/manifest.json

@@ -122,7 +122,7 @@
         "menu": false
       },
       "views/Shelf": {
-        "titleBarText": "我的书架",
+        "titleBarText": "最近阅读",
         "menu": false
       },
       "views/Sign": {

+ 28 - 14
src/views/Reader/index.ux

@@ -2,20 +2,20 @@
  <import name="wechat-page" src="../../components/wechat/index.ux"></import> 
 <template>
   <div id="reader-content">
-    <list class="reader-wrap" id='list'>
-      <list-item type='title' class="reader-title">
+    <div class="reader-wrap" id='list'>
+      <div type='title' class="reader-title">
         <text class="title">{{bookinfo.chapter_name}}</text>
         <!-- <text class="add-shelf" @click="addShelf">加入书架</text> -->
-      </list-item>
-      <list-item type='content' class="reader-content">
+      </div>
+      <div type='content' class="reader-content">
         <text class="chapter-text" for='content'>{{$item}}</text>
-      </list-item>
-      <list-item type='button' class="reader-operator">
+      </div>
+      <div type='button' class="reader-operator">
         <text class="operator prev" @click="getPrevChapter">上一章</text>
         <text class="operator catalog" @click="toCatalog">目录</text>
         <text class="operator next" @click="getNextChapter">下一章</text>
-      </list-item>
-    </list>
+      </div>
+    </div>
     <short-page if="{{showShortPop}}"></short-page>
     <!-- <wechat-page></wechat-page> -->
   </div>
@@ -44,8 +44,8 @@ export default {
       this.showShortPop = true;
     }
   },
-   onShow(){
-    it.getShortCut(()=>{
+  onShow() {
+    it.getShortCut(() => {
       this.showShortPop = true;
 
     })
@@ -60,7 +60,7 @@ export default {
     getChapters({ bid: bid, chapter_id: chapter_id }).then(r => {
       this.content = r.chapter_content.trim().split(/\n/)
       this.bookinfo = r
-      this.$element('list').scrollTo({ index: 0 })
+      // this.$element('list').scrollTo({ index: 0 })
     }).catch(e => {
       console.log('e code')
       console.log(e.data)
@@ -69,7 +69,7 @@ export default {
         chapterOrders({ bid: bid, chapter_id: chapter_id }).then(r => {
           this.content = r.chapter_content.trim().split(/\n/)
           this.bookinfo = r
-          this.$element('list').scrollTo({ index: 0 })
+          // this.$element('list').scrollTo({ index: 0 })
         }).catch(f => {
           console.log('f code')
           console.log(f.data)
@@ -107,7 +107,14 @@ export default {
   },
   getPrevChapter() {
     console.log("get prev chapter");
-    this.getChapters(this.bookinfo.bid, this.bookinfo.prev_cid)
+    // this.getChapters(this.bookinfo.bid, this.bookinfo.prev_cid)
+    router.replace({
+      uri: "/views/Reader",
+      params: {
+        bid: this.bookinfo.bid,
+        chapter_id: this.bookinfo.prev_cid
+      }
+    })
   },
   getNextChapter() {
     console.log("get next chapter");
@@ -120,7 +127,14 @@ export default {
       })
       return
     }
-    this.getChapters(this.bookinfo.bid, this.bookinfo.next_cid)
+    // this.getChapters(this.bookinfo.bid, this.bookinfo.next_cid)
+    router.replace({
+      uri: "/views/Reader",
+      params: {
+        bid: this.bookinfo.bid,
+        chapter_id: this.bookinfo.next_cid
+      }
+    })
   }
 }
 </script>

+ 5 - 5
src/views/Shelf/index.ux

@@ -2,14 +2,14 @@
  
 <template>
   <div class="shelf-wrap">
-    <div class="type-bar">
+    <!-- <div class="type-bar">
       <block for="type in typeList">
         <div class="type-item" @click="typeChange(type.index)">
           <text class="{{type.index === current ? 'cur' : ''}}">{{type.name}}</text>
           <text class="choose-bar" show="{{type.index === current}}"></text>
         </div>
       </block>
-    </div>
+    </div> -->
     <div class="shelf-total {{current === 1 ? 'shelf-total__inRecent' : ''}}">
       <text>共{{booksize}}本</text>
       <text class="manager" @click="changeMode">{{modeText}}</text>
@@ -42,8 +42,8 @@
                 <div class="book-info__wrap">
                   <text class="name">{{$item.book_name}}</text>
                   <text class="lastest">最新 {{$item.last_chapter}}</text>
-                  <text class="last-read">上次阅读:{{$item.recent_reading_chapter}}</text>
-                  <text class="shelf-status">❤️ 已加入书架</text>
+                  <text class="last-read">{{$item.recent_reading_chapter}}</text>
+                  <!-- <text class="shelf-status">❤️ 已加入书架</text> -->
                 </div>
               </x-book>
               <div class="book-del__item" show="{{isDelMode}}" @click='deleteBook($item)'>
@@ -70,7 +70,7 @@ export default {
   },
   data() {
     return {
-      current: 0,
+      current: 1,
       isDelMode: false,
       modeText: "管理",
       mockList: [],