xia vor 4 Jahren
Ursprung
Commit
6578abe9b2

+ 2 - 2
src/api/config.js

@@ -7,8 +7,8 @@
  */
 const apiConfig = {
    //baseURL: "https://quickapp.leyuee.com/api",
- baseURL: "https://quickapptest.leyuee.com/api",
- package:'com.beidao.kuaiying.zsy'
+   baseURL: "https://quickapptest.leyuee.com/api",
+    package:'com.beidao.kuaiying.zsy'
 };
 
 export default apiConfig;

+ 5 - 0
src/api/index.js

@@ -218,4 +218,9 @@ export const getHotMain = (pages) => {
 //限免书籍
 export const getFreeBook = (sex) => {
   return fly.get(`/books/free/${sex}`);
+}
+
+//阅读记录
+export const getReadrecord = () =>{
+  return fly.get('readrecord');
 }

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

@@ -72,7 +72,7 @@ export default {
       router.push({
         uri: "/views/Reader",
         params: {
-          bid: book.bid,
+          bid: book.book_id,
           chapter_id: book.recent_cid
         }
       })

+ 85 - 68
src/views/Free/index.ux

@@ -11,25 +11,26 @@
         </block>
       </div>
     </list-item>
-    <list-item type="banner" class="free-title">
+    <list-item type="banner" class="free-title" if="{{endTime}}">
       <text>限时免费结束时间:{{endTime}}</text>
     </list-item>
-    <block for="list">
-      <list-item type="books-item" class="book-list__wrap book-list__wrap--multi" >
+    <block for="book in list" if="{{isInit && list.length>0}}">
+      <list-item type="books-item" class="book-list__wrap book-list__wrap--multi">
         <div class="book-list__multi">
-            <block for="book in list">
-              <div class="book-item">
-                <x-book multi="{{true}}" width="{{150}}" book="{{book}}">
-                  <div class="book-info__multi">
-                    <text class="name">{{book.book_name}}</text>
-                    <text class="intro">{{book.intro}}</text>
-                  </div>
-                </x-book>
-              </div>
-            </block>
-          </div>
-        </list-item>
+            <div class="book-item">
+              <x-book multi="{{true}}" width="{{150}}" book="{{book}}">
+                <div class="book-info__multi">
+                  <text class="name">{{book.book_name}}</text>
+                  <text class="intro">{{book.intro}}</text>
+                </div>
+              </x-book>
+            </div>
+        </div>
+      </list-item>
     </block>
+    <list-item type="blank" if="{{isInit && list.length<=0}}" class="blank_img">
+      <image src="https://cdn-novel.iycdm.com/quickapp/activity/white_shelf.png"></image>
+    </list-item>
   </list>
 </template>
 
@@ -46,9 +47,9 @@ export default {
     chapter_sequence: "",
   },
   private: {
-    isInit:false,
+    isInit: false,
     list: [],
-    endTime:'',
+    endTime: '',
     typeList: [
       {
         name: "男生",
@@ -59,7 +60,7 @@ export default {
         index: 2
       }
     ],
-    current:2
+    current: 2
   },
   onInit() {
     this.getBookList(this.current)
@@ -70,11 +71,18 @@ export default {
     this.getBookList(index);
 
   },
-  async getBookList(index = 2){
+  async getBookList(index = 2) {
     let data = await getFreeBook(index);
-    this.list = data.list;
-    this.endTime = data.end_time;
-    this.isInit = true;
+    if (!data || (Array.isArray(data) && data.length <= 0)) {
+      this.list = [];
+      this.endTime = undefined;
+      this.isInit = true;
+    } else {
+      this.list = data.list;
+      this.endTime = data.end_time;
+      this.isInit = true;
+    }
+
   },
 
 
@@ -97,62 +105,71 @@ export default {
     border-radius: 30px;
   }
 }
-  .book-list__wrap {
-    background-color: #fff;
-    // margin-top: 24px;
-    padding: 0 24px;
-    flex-direction: column;
-
-    .book-list__title {
-      padding: 30px 0;
-      align-items: center;
+.book-list__wrap {
+  background-color: #fff;
+  // margin-top: 24px;
+  padding: 0 24px;
+  flex-direction: column;
+
+  .book-list__title {
+    padding: 30px 0;
+    align-items: center;
 
-      text {
-        color: #333;
-        font-size: 32px;
-      }
+    text {
+      color: #333;
+      font-size: 32px;
     }
   }
+}
 
-  .book-list {
-    flex: 1;
-    flex-direction: row;
-    flex-wrap: wrap;
-    justify-content: space-between;
+.book-list {
+  flex: 1;
+  flex-direction: row;
+  flex-wrap: wrap;
+  justify-content: space-between;
+}
+.book-list__multi {
+  margin-top: 30px;
+  flex-direction: column;
+
+  .book-item {
+    margin-bottom: 30px;
   }
-  .book-list__multi {
-    margin-top: 30px;
-    flex-direction: column;
 
-    .book-item {
-      margin-bottom: 30px;
+  .book-info__multi {
+    flex: 1;
+    flex-direction: column;
+    justify-content: flex-start;
+    align-items: flex-start;
+    margin-left: 38px;
+    // margin-bottom: 40px;
+
+    .name {
+      font-size: 32px;
+      color: #333;
+      lines: 1;
+      text-overflow: ellipsis;
     }
 
-    .book-info__multi {
-      flex: 1;
-      flex-direction: column;
-      justify-content: flex-start;
-      align-items: flex-start;
-      margin-left: 38px;
-      // margin-bottom: 40px;
-
-      .name {
-        font-size: 32px;
-        color: #333;
-        lines: 1;
-        text-overflow: ellipsis;
-      }
-
-      .intro {
-        font-size: 24px;
-        color: #666;
-        lines: 3;
-        text-overflow: ellipsis;
-        margin-top: 36px;
-        line-height: 36px;
-      }
+    .intro {
+      font-size: 24px;
+      color: #666;
+      lines: 3;
+      text-overflow: ellipsis;
+      margin-top: 36px;
+      line-height: 36px;
     }
   }
+}
+.blank_img {
+  width: 100%;
+  height: 100%;
+  align-items: center;
+  justify-content: center;
+  image {
+    width: 500px;
+  }
+}
 .type-bar {
   width: 100%;
   .type-item {

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

@@ -30,7 +30,7 @@
         <div class="entrance_block">
           <div><image src="../../assets/imgs/home_fl.png" @click="jump('Category')"></image><text>分类</text></div>
           <div><image src="../../assets/imgs/home_rank.png" @click="jump('Leaderboard')"></image><text>排行榜</text></div>
-          <div><image src="../../assets/imgs/home_rank.png" @click="jump('Free')"></image><text>限时免费</text></div>
+          <div><image src="../../assets/imgs/home_free.png" @click="jump('Free')"></image><text>限时免费</text></div>
         </div>
       </list-item>
       <block for="bookObj in list">

+ 6 - 10
src/views/Index/index.ux

@@ -104,6 +104,7 @@ export default {
     showSignPop: false,
     home_show: 0,
     home_alert:null,
+    back_alert:0,
     isInit:false,
   },
   async onInit() {
@@ -127,7 +128,8 @@ export default {
       this.home_alert = home_alert[0];
       this.showActivitys = true;
     }
-    
+    let {sign_out_app_show} = await getConfig('add_desk_alert');
+    this.back_alert = sign_out_app_show;
     
   },
   goActicity(){
@@ -137,22 +139,16 @@ export default {
     })
   },
   showActivity() {
-    this.showActivitys = 1;
+    this.showActivitys = true;
   },
   closeAcitivity() {
-    this.showActivitys = 0;
+    this.showActivitys = false;
   },
   async onShow() {
     const hasInit = this.$app.getAppData('hasInit');
     if(hasInit){
       this.$broadcast('refreshData',{current:this.current});
     }
-    let device_info = (await device.getInfo()).data;
-    this.brand = device_info.brand;
-    /* if (data == 'phone') {
-      this.current = 0;
-      this.$app.setAppData('backfrom', '');
-    } */
     it.getShortCut((value) => {
       this.showShortPop = !value;
     })
@@ -182,7 +178,7 @@ export default {
   },
   onBackPress() {
     // 退出逻辑
-    if (this.$app.$def.data.backClickCount === 0 && this.brand !== 'vivo') {
+    if (this.$app.$def.data.backClickCount === 0 && this.back_alert==1) {
       this.$app.$def.data.backClickCount++;
       this.$app.$def.createShortcut();
       return true;

+ 19 - 12
src/views/Reader/index.ux

@@ -99,6 +99,7 @@ export default {
     showSetting: false,
     force_add_desk_type: 0,
     showMustTost: false,
+    back_reader: 0,
     colorList: [
       { color: '#E6E6E6', borderColor: '#CCC', btColor: '#F2F2F2', isIcon: false },
       { color: '#EED9BB', borderColor: '#C6A473', btColor: '#FFFBE8', isIcon: false },
@@ -145,7 +146,8 @@ export default {
     getConfig = getAppConfig(this);
     let { reader_banner } = await getConfig('position');
     this.reader_banner = reader_banner;
-
+    let { sign_out_reader_show } = await getConfig('add_desk_alert');
+    this.back_reader = sign_out_reader_show;
     userAddDsktop(this.$app.$def.data.backClickCount).then(res => {
       //TODO 加桌后统计上报
     }).catch(r => {
@@ -286,8 +288,8 @@ export default {
       params: {
         chapter_sequence: this.bookinfo.chapter_sequence,
         bid: this.bid,
-        chapter_id:this.chapter_id,
-        fromReader:true,
+        chapter_id: this.chapter_id,
+        fromReader: true,
       }
     })
   },
@@ -353,17 +355,22 @@ export default {
     })
   },
   onBackPress() {
-    it.backCreateShortCut(res => {
-      if (res == 'back') {
-        if (router.getLength() === 1) {
-          router.replace({ uri: "/views/Index" });
-          return true;
-        } else {
-          router.back()
+    if (this.back_reader == 1) {
+      it.backCreateShortCut(res => {
+        if (res == 'back') {
+          if (router.getLength() === 1) {
+            router.replace({ uri: "/views/Index" });
+            return true;
+          } else {
+            router.back()
+          }
         }
-      }
+      });
+    }else{
+       router.back()
+    }
+
 
-    });
     return true;
   }
 }

+ 6 - 3
src/views/Shelf/index.ux

@@ -45,7 +45,7 @@
                 <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="last-read">最近阅读 {{$item.chapter_name}}</text>
                   <!-- <text class="shelf-status">❤️ 已加入书架</text> -->
                 </div>
               </x-book>
@@ -62,7 +62,7 @@
 </template>
 
 <script>
-import { getUserShelfBooks, deleteShelfBook } from "../../api";
+import { getUserShelfBooks, deleteShelfBook,getReadrecord } from "../../api";
 
 export default {
   props: {
@@ -73,6 +73,7 @@ export default {
   },
   data() {
     return {
+      isInit:false,
       current: 1,
       isDelMode: false,
       modeText: "管理",
@@ -108,10 +109,12 @@ export default {
     }
   },
   getUserShelfBooks() {
-    getUserShelfBooks().then(r => {
+    getReadrecord().then(r => {
       r.map(m => {
         m.cover_url = m.cover
+        m.recent_cid = m.cid
         delete m.cover
+        delete m.cid
       })
       this.booksize = r.length
       this.mockList = r