Sfoglia il codice sorgente

Merge branch 'master' of iqiyoo:zhuishuyun_quickapp_front

Zhengxiaowei 5 anni fa
parent
commit
cf100b7a4e

+ 1 - 0
src/assets/less/reader.less

@@ -1,6 +1,7 @@
 .reader-wrap {
   flex-direction: column;
   background-color: #e6e6e6;
+  width: 100%;
   
   .reader-title {
     margin: 0 24px;

+ 2 - 1
src/helper/interface.js

@@ -24,7 +24,7 @@ const getShortCut = (fn) => {
 
 }
 // 判断用户是否创建图标
-const hasCreateShortCut = (isPayPage = false) => {
+const hasCreateShortCut = (isPayPage = false,fn) => {
   shortcut.hasInstalled({
     success: (ret) => {
       if (!ret) {
@@ -32,6 +32,7 @@ const hasCreateShortCut = (isPayPage = false) => {
           message: "添加【追书云】到桌面,方便下次阅读",
           success: () => {
             prompt.showToast("添加成功!");
+            fn && fn(true);
           },
           fail: (code) => {
             if (code === SHORT_CUT_FORBIDDEN_INFO && !isPayPage) app.exit();

+ 1 - 1
src/manifest.json

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

+ 3 - 4
src/views/Index/index.ux

@@ -91,10 +91,6 @@ export default {
   onInit() {
     this.$on('dispathEvt', this.changeSignPop);
     //今日已签到过不在弹框签到
-    console.log("app backClickCount", this.$app.$def.data.backClickCount);
-    if (this.$app.$def.data.backClickCount === 0) {
-      this.showShortPop = true;
-    }
     this.getCoustom();
   },
   onShow() {
@@ -120,6 +116,9 @@ export default {
   onMenuPress() {
     this.$app.$def.showMenu();
   },
+  changeShortCut(){
+    this.showShortPop=false;
+  },
   async getCoustom() {
     let res = await getCustomQrcode();
     this.cutomerQrcode = res.url;

+ 1 - 7
src/views/Raderover/index.ux

@@ -21,13 +21,7 @@
             <text @click='changebooklist()'>换一换</text>
         </div>
         <div>
-            <x-book multi="{{true}}" width="{{180}}" book="{{bookdata[0]}}" prevent="{{true}}">
-                <div class="book-info">
-                    <text class="name">{{bookdata[0]&&bookdata[0].book_name}}</text>
-                    <div>
-                        <text class="info">{{bookdata[0]&&bookdata[0].book_summary}}</text>
-                    </div>
-                </div>
+            <x-book multi="{{true}}" width="{{180}}" book="{{bookdata[0]}}">
             </x-book>
         </div>
         <div class='booklist'>

+ 40 - 17
src/views/Reader/index.ux

@@ -2,21 +2,21 @@
  <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>
-    <short-page if="{{showShortPop}}"></short-page>
+      </div>
+    </div>
+    <short-page if="{{showShortPop}}" @addshort="shortEnd"></short-page>
     <!-- <wechat-page></wechat-page> -->
   </div>
 
@@ -39,10 +39,7 @@ export default {
   },
   onInit() {
     this.getChapters(this.bid, this.chapter_id)
-    this.addShelf()
-    if (this.$app.$def.data.backClickCount === 0) {
-      this.showShortPop = true;
-    }
+    this.addShelf();
   },
   onShow() {
     it.getShortCut((value) => {
@@ -55,11 +52,14 @@ export default {
       r.is_on ? '' : postUserShelfBooks({ bid: this.bid })
     })
   },
+    shortEnd(value) {
+    this.showShortPop = !value.detail.installed;
+  },
   getChapters(bid, chapter_id) {
     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)
@@ -68,7 +68,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)
@@ -106,11 +106,34 @@ 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");
-    this.getChapters(this.bookinfo.bid, this.bookinfo.next_cid)
+    if (this.bookinfo.next_cid == 0) {
+      router.push({
+        uri: "/views/Raderover",
+        params: {
+          bid: this.bid
+        }
+      })
+      return
+    }
+    // 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: [],