Ver Fonte

Merge branch 'master' of iqiyoo:zhuishuyun_quickapp_front

xiabx há 5 anos atrás
pai
commit
6b20bb0265

+ 2 - 2
src/assets/less/reader.less

@@ -13,7 +13,6 @@
     .title {
       font-weight: bolder;
       color: #1a1a1a;
-      font-size: 48px;
       font-size: 38px;
       padding: 150px 0;
     }
@@ -33,9 +32,10 @@
     flex-direction: column;
 
     .chapter-text {
+      font-size: 19px;
       color: #1a1a1a;
       text-indent: 2em;
-      font-size: 32px;
+      font-size: 38px;
       margin-bottom: 30px;
       line-height: 60px;
     }

+ 23 - 3
src/views/Catalog/index.ux

@@ -34,9 +34,28 @@ export default {
     chapter_sequence_index: 0,
     startpage: 1,
     loading: false,
-    end: false
+    end: false,
   },
   onInit() {
+    // let page = 1
+    // var chapter_sequence_index = 0
+    // if (this.chapter_sequence) {
+    //   var chapter_sequence = this.chapter_sequence
+    //   chapter_sequence_index = chapter_sequence % PER_PAGE_NUM - 1
+    //   this.chapter_sequence_index = chapter_sequence_index
+    //   page = Math.ceil(chapter_sequence / PER_PAGE_NUM)
+    // }
+    // this.startpage = page;
+    // getCatalog({ bid: this.bid, page: page, page_size: PER_PAGE_NUM }).then(r => {
+    //   this.list = r.list
+    //   this.meta = r.meta
+    //   setTimeout(() => {
+    //     this.$element('catalog').scrollTo({ index: chapter_sequence_index })
+    //   }, 500)
+
+    // })
+  },
+  onShow() {
     let page = 1
     var chapter_sequence_index = 0
     if (this.chapter_sequence) {
@@ -57,6 +76,7 @@ export default {
   },
   jumpReader(info) {
     if (info.is_need_charge == 1) {
+      this.chapter_sequence = info.chapter_sequence
       router.push({
         uri: "/views/Pay",
         params: {
@@ -80,7 +100,7 @@ export default {
       return;
     }
     let params = {
-      bid: '5pNo6A7wqQmB1WgQygDjkOM9VZn2vXeY',
+      bid: this.bid,
       page: this.meta.current_page + 1,
       page_size: PER_PAGE_NUM
     }
@@ -95,7 +115,7 @@ export default {
     console.log("get prev catalog");
     if ((this.startpage - 1) < 1) return prompt.showToast({ message: '已经到顶啦' });
     let params = {
-      bid: '5pNo6A7wqQmB1WgQygDjkOM9VZn2vXeY',
+      bid: this.bid,
       page: this.startpage - 1,
       page_size: PER_PAGE_NUM
     }

+ 18 - 4
src/views/Detail/index.ux

@@ -23,7 +23,7 @@
         <text class="toggle" @click="toggleTextStatus">{{showLongText ? '收起' : '展开'}}</text>
       </stack>
     </div>
-    <text class="lastest-chapter" @click="toRead(book.last_cid)">最新章节:{{book.last_chapter}}</text>
+    <text class="lastest-chapter" @click="toRead(book.last_cid,book.is_need_charge)">最新章节:{{book.last_chapter}}</text>
     <div class="box-wrap short-chapter__list">
       <div class="small-title">
         <div class="wrap-left">
@@ -35,7 +35,7 @@
       </div>
       <div class="chapter-list">
         <block for="chapters">
-          <text class="chapter-item" @click="toRead($item.chapter_id)">{{$item.chapter_name}}</text>
+          <text class="chapter-item" @click="toRead($item.chapter_id,$item.is_need_charge)">{{$item.chapter_name}}</text>
         </block>
       </div>
       <text class="more-chapters" @click="toBookCatalog">更多目录 &gt;</text>
@@ -86,7 +86,17 @@ export default {
       if (ret) this.book.is_on_user_shelf = 1, prompt.showToast({ message: "添加成功" });
     }
   },
-  toRead(cid = "") {
+  toRead(cid = "", needCharge = 0) {
+    if (needCharge == 1) {
+      this.chapter_sequence = needCharge
+      router.push({
+        uri: "/views/Pay",
+        params: {
+          bid: this.book.book_id,
+        }
+      })
+      return
+    }
     let chapter_id = cid;
     router.push({
       uri: "/views/Reader",
@@ -113,10 +123,14 @@ export default {
     this.chapters = await getShortCatalog(bid);
     this.similar = await getSimilarBooks(this.book.book_category_id, bid);
   },
-  onInit() {
+  onShow() {
     console.log("book bid", this.bid);
     this.getBooksInfo(this.bid);
   },
+  onInit() {
+    // console.log("book bid", this.bid);
+    // this.getBooksInfo(this.bid);
+  },
 }
 </script>
 

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

@@ -188,7 +188,7 @@ export default {
     this.showLoading = false;
     let msg = "支付成功!";
     switch (code) {
-      case "9000": msg = "支付成功!"; break;
+      case "9000": (msg = "支付成功!", router.back()); break;
       case "8000": msg = "订单已提交,请等待结果"; break;
       case "4000": msg = "订单支付失败!"; break;
       case "5000": msg = "订单重复!"; break;