From 7974f3266c323e4cd4fdff7d457fe75f39b8c199 Mon Sep 17 00:00:00 2001
From: 闫增涛 <1829501689@qq.com>
Date: 星期三, 25 九月 2024 15:59:06 +0800
Subject: [PATCH] 云学习跳转逻辑修改

---
 pages/digitalCourses/digitalCoursesDetails/index.js |   41 ++++++++++++++++++++++-------------------
 1 files changed, 22 insertions(+), 19 deletions(-)

diff --git a/pages/digitalCourses/digitalCoursesDetails/index.js b/pages/digitalCourses/digitalCoursesDetails/index.js
index 57eed2f..05c9f2d 100644
--- a/pages/digitalCourses/digitalCoursesDetails/index.js
+++ b/pages/digitalCourses/digitalCoursesDetails/index.js
@@ -179,6 +179,9 @@
     this.digitalCoursesDetailsGet(options.id)
     this.getPlayerList()
     this.getType()
+    this.setData({
+      userName: JSON.parse(wx.getStorageSync(app.config.userInfoKey)).name,
+    })
   },
 
   /**
@@ -192,11 +195,11 @@
    * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鏄剧ず
    */
   onShow() {
-    if (this.data.tabValue == 2) {
+    if (this.data.tabValue == 2 && this.data.selectActive == 'learn') {
       this.getPlayerList()
       this.getResource()
+      this.getRelationBook()
     }
-
   },
 
   /**
@@ -240,6 +243,7 @@
         keys: [this.data.bookId + '']
       })
       .then((res) => {
+        console.log(1, res);
         if (res.length > 0) {
           this.setData({
             playerList: JSON.parse(res[0].value)
@@ -545,7 +549,6 @@
               learnList: list,
               openTeachids: result,
             });
-            console.log(1, this.data.learnList, this.data.playerList)
           }
         } else {
           const data = test.filter(
@@ -1100,22 +1103,22 @@
   },
 
   onCertificate() {
-    // if (!this.data.isBuy) {
-    //   wx.showToast({
-    //     title: "璇峰厛璐拱锛屼綋楠屽畬鏁存湇鍔�",
-    //     icon: "none",
-    //     duration: 1000,
-    //   });
-    //   return false
-    // }
-    // if (!this.data.isLearn) {
-    //   wx.showToast({
-    //     title: "鎮ㄧ殑瀛︿範浠诲姟杩樻湭瀹屾垚锛屾殏涓嶈兘鐢宠璇佷功锛屽姞娌瑰摝锛�",
-    //     icon: "none",
-    //     duration: 1000,
-    //   });
-    //   return false
-    // }
+    if (!this.data.isBuy) {
+      wx.showToast({
+        title: "璇峰厛璐拱锛屼綋楠屽畬鏁存湇鍔�",
+        icon: "none",
+        duration: 1000,
+      });
+      return false
+    }
+    if (!this.data.isLearn) {
+      wx.showToast({
+        title: "鎮ㄧ殑瀛︿範浠诲姟杩樻湭瀹屾垚锛屾殏涓嶈兘鐢宠璇佷功锛屽姞娌瑰摝锛�",
+        icon: "none",
+        duration: 1000,
+      });
+      return false
+    }
     if (this.data.isCertificate && this.data.isCertificate.state == 'WaitAudit') {
       wx.showToast({
         title: "鎮ㄧ敵璇风殑璇佷功姝e湪瀹℃牳涓�",

--
Gitblit v1.9.1