From d7b7435558c15789e9a2c650389cd28ce88d443b Mon Sep 17 00:00:00 2001
From: 闫增涛 <1829501689@qq.com>
Date: 星期二, 06 五月 2025 15:05:42 +0800
Subject: [PATCH] 资源查看判断是否购买

---
 packageBookService/pages/bookServices/detail/components/tree/index.js |   33 +++++++++++++++++++++++++++++----
 1 files changed, 29 insertions(+), 4 deletions(-)

diff --git a/packageBookService/pages/bookServices/detail/components/tree/index.js b/packageBookService/pages/bookServices/detail/components/tree/index.js
index 8a0515a..a36aa4a 100644
--- a/packageBookService/pages/bookServices/detail/components/tree/index.js
+++ b/packageBookService/pages/bookServices/detail/components/tree/index.js
@@ -59,6 +59,12 @@
     },
     isCloundHaveSaleMethod: {
       type: Boolean
+    },
+    activeId: {
+      type: String
+    },
+    source: {
+      type: String
     }
   },
   data: {
@@ -71,7 +77,27 @@
     canExecute: true,
     purchaseList: []
   },
-  ready() {},
+  ready() {
+    var query = this.createSelectorQuery()
+    const that = this
+    try {
+      if (this.data.activeId)
+        setTimeout(() => {
+          query.select('.cms-' + this.data.activeId).boundingClientRect(function (res) {
+            if (res && res.top > 0) {
+              var myEventDetail = {
+                top: res.top
+              };
+              var myEventOption = {
+                bubbles: true,
+                composed: true,
+              };
+              that.triggerEvent("handleScrollTop", myEventDetail, myEventOption);
+            }
+          }).exec()
+        }, 500)
+    } catch (err) {}
+  },
   onLoad() {},
   observers: {
     treeList: function (newValue) {
@@ -227,7 +253,7 @@
           let buyList = []
           if (learn.length) buyList = learn.filter((item) => this.properties.buyIds.includes(item.saleMethod.find((citem) => citem.SaleType == 'Normal').Id))
           // 鏈夌埗绾�(鍖呭惈閿�鍞柟寮�)锛屼笖鏈喘涔�
-          if (learn.length && !buyList.length) return wx.showToast({
+          if (learn.length && !buyList.length && !item.freeFile) return wx.showToast({
             icon: 'error',
             title: '璇峰厛璐拱璇ヨ祫婧�',
           })
@@ -261,12 +287,11 @@
       const token = wx.getStorageSync(app.config.tokenKey);
       if (!token && this.data.tab != 'jsek_teachingResources') {
         loginInfo(app, (data) => {
-          if (data) goPlayerFun()
+          if (data) {}
         })
       } else {
         goPlayerFun()
       }
-
     },
 
     // 鎷垮埌鎵�鏈夐」

--
Gitblit v1.9.1