Przeglądaj źródła

feat: 首页跳转;

qiansailong 1 rok temu
rodzic
commit
78069bba4b
1 zmienionych plików z 6 dodań i 1 usunięć
  1. 6 1
      pages/index/index.js

+ 6 - 1
pages/index/index.js

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