Bläddra i källkod

feat: 加入getNovelDetail;

qiansailong 1 år sedan
förälder
incheckning
fa4e2eae4c
1 ändrade filer med 4 tillägg och 2 borttagningar
  1. 4 2
      pages/index/index.js

+ 4 - 2
pages/index/index.js

@@ -1,7 +1,7 @@
 // index.js
 const defaultAvatarUrl = 'https://mmbiz.qpic.cn/mmbiz/icTdbqWNOwNRna42FI242Lcia07jQodd2FJGIYQfG0LAJGFxM4FbnQP6yfMxBgJ0F3YRqJCJ1aPAK2dQagdusBZg/0'
 const testCover = '/assets/images/bg-book.png'
-import { getBannerList, getCardNovels, getBrowsingHistory } from '../../api/api'
+import { getBannerList, getCardNovels, getBrowsingHistory, getNovelDetail } from '../../api/api'
 import { goToBookDetail } from '../../utils/util'
 
 const app = getApp()
@@ -59,7 +59,9 @@ Page({
 
     const bookId = parseInt(options.bookId);
     if (bookId) {
-      goToBookDetail({ bookId })
+      getNovelDetail(bookId).then(res => {
+        goToBookDetail({ bookId, wxBookId: res.wxBookId })
+      })
     }
   },