From 3d73fb33c46aada16a6060adcd4ea14bb33b6b2a Mon Sep 17 00:00:00 2001
From: 闫增涛 <1829501689@qq.com>
Date: 星期二, 09 四月 2024 10:39:11 +0800
Subject: [PATCH] 详情页tabs样式优化,答题添加页面退出拦截,合并代码

---
 packagePersonal/pages/sampleBooks/index.js |   33 ++++++++++++++++++++++++++++++---
 1 files changed, 30 insertions(+), 3 deletions(-)

diff --git a/packagePersonal/pages/sampleBooks/index.js b/packagePersonal/pages/sampleBooks/index.js
index 984fa38..bc1a1e4 100644
--- a/packagePersonal/pages/sampleBooks/index.js
+++ b/packagePersonal/pages/sampleBooks/index.js
@@ -9,8 +9,7 @@
     active: 0,
     topicIdOrRefCode: "applyEntityBook",
     active1: 0,
-    tabList: [
-      {
+    tabList: [{
         label: '鍏ㄩ儴',
         value: 'all',
       },
@@ -46,6 +45,22 @@
    */
   onLoad(options) {
     console.log(options);
+    if (options) {
+      this.setData({
+        active: options.tabActive,
+        active1: options.stateTab
+      })
+      if (this.data.active == '1') {
+        this.setData({
+          topicIdOrRefCode: 'applyBook',
+        })
+      } else {
+        this.setData({
+          topicIdOrRefCode: 'applyEntityBook',
+        })
+      }
+    }
+    console
     this.getDataList(false);
   },
   tabClick(item) {
@@ -78,7 +93,10 @@
     that.setData({
       skeletonLoding: true,
       active1: item.detail.value,
-      queryFilter: info.value == 'all' ? [] : [{ field: 'State', value: info.value }],
+      queryFilter: info.value == 'all' ? [] : [{
+        field: 'State',
+        value: info.value
+      }],
       list: [],
       page: 1,
       bottomLoading: false,
@@ -135,6 +153,15 @@
     })
   },
 
+  goBookDetails(e) {
+    const {
+      book
+    } = e.currentTarget.dataset;
+    wx.navigateTo({
+      url: `/packageBookService/pages/bookServices/detail/index?id=${book.id}&name=${book.title}`,
+    });
+  },
+
   /**
    * 椤甸潰鐩稿叧浜嬩欢澶勭悊鍑芥暟--鐩戝惉鐢ㄦ埛涓嬫媺鍔ㄤ綔
    */

--
Gitblit v1.9.1