Sfoglia il codice sorgente

feat: 首页跳转;

qiansailong 1 anno fa
parent
commit
78069bba4b
1 ha cambiato i file con 6 aggiunte e 1 eliminazioni
  1. 6 1
      pages/index/index.js

+ 6 - 1
pages/index/index.js

@@ -49,13 +49,18 @@ Page({
     canIUseNicknameComp: wx.canIUse('input.type.nickname'),
   },
   
-  onLoad() {
+  onLoad(options) {
     this.autoLogin();
     // 创建动画实例
     this.recentBookAnimator = wx.createAnimation({
       duration: 300,
       timingFunction: 'ease',
     });
+
+    const bookId = parseInt(options.bookId);
+    if (bookId) {
+      goToBookDetail({ bookId })
+    }
   },
 
   onShow() {