From 04c7b0163caeae4ab1c5da62e301fa993101cfad Mon Sep 17 00:00:00 2001
From: 闫增涛 <1829501689@qq.com>
Date: 星期一, 31 三月 2025 10:40:45 +0800
Subject: [PATCH] bug修改

---
 packageBookService/pages/bookServices/detail/index.wxml                                |    2 
 packageDomain/pages/resourceDetails/myVideo/index.js                                   |   27 ++--
 packageDomain/pages/teacherCertification/index.js                                      |   27 ++-
 packageDomain/pages/publickBookForm/index.js                                           |   17 +-
 packageDomain/pages/resourceDetails/document/index.js                                  |   35 ++---
 pages/study/index.js                                                                   |    4 
 packageBookService/pages/bookServices/detail/components/learnResource/learnResource.js |   25 ++--
 pages/cart/index.js                                                                    |   17 +-
 packageBookService/pages/bookServices/detail/components/note/note.js                   |   14 +-
 packageBookService/pages/bookServices/detail/components/testResource/testResource.js   |   19 +-
 packageBookService/pages/bookServices/detail/components/tree/index.js                  |    2 
 packageDomain/pages/sampleBookList/index.js                                            |   44 +++----
 packageBookService/pages/bookServices/detail/index.js                                  |   31 +++-
 pages/personalCenter/index.js                                                          |    4 
 pages/bibliographyList/index.js                                                        |   39 ++++--
 15 files changed, 170 insertions(+), 137 deletions(-)

diff --git a/packageBookService/pages/bookServices/detail/components/learnResource/learnResource.js b/packageBookService/pages/bookServices/detail/components/learnResource/learnResource.js
index 5ee8695..5ce392d 100644
--- a/packageBookService/pages/bookServices/detail/components/learnResource/learnResource.js
+++ b/packageBookService/pages/bookServices/detail/components/learnResource/learnResource.js
@@ -2,6 +2,7 @@
 import {
   loginInfo
 } from "../../../../../../assets/js/login";
+const app = getApp()
 Component({
   /**
    * 缁勪欢鐨勫睘鎬у垪琛�
@@ -57,13 +58,6 @@
     },
     // 璺宠浆璧勬簮璐拱椤�
     goBuyResource() {
-      const token = wx.getStorageSync(app.config.tokenKey);
-      if (token) {
-        gotoPageFun()
-      } else {
-        loginInfo(app, (data) => {
-        })
-      }
       const gotoPageFun = () => {
         if (!this.properties.isGoBuyResource) {
           return wx.showToast({
@@ -74,6 +68,12 @@
         wx.navigateTo({
           url: `/packageBookService/pages/bookServices/detail/buyResource/index?productLinkPath=${this.properties.buyResourceData.productLinkPath}&refCode=${this.properties.buyResourceData.refCode}&bookId=${this.properties.bookId}`,
         })
+      }
+      const token = wx.getStorageSync(app.config.tokenKey);
+      if (token) {
+        gotoPageFun()
+      } else {
+        loginInfo(app, (data) => {})
       }
     },
 
@@ -88,6 +88,11 @@
       })
     },
     goLearnTask() {
+      const gotoPageFun = () => {
+        wx.navigateTo({
+          url: `/packageBookService/pages/bookServices/detail/components/learnTask/index?bookId=${this.properties.bookId}&cmsPath=${this.properties.learnTaskData?.productLinkPath}`,
+        })
+      }
       const token = wx.getStorageSync(app.config.tokenKey);
       if (token) {
         gotoPageFun()
@@ -96,11 +101,7 @@
           if (data) gotoPageFun()
         })
       }
-      const gotoPageFun = () => {
-        wx.navigateTo({
-          url: `/packageBookService/pages/bookServices/detail/components/learnTask/index?bookId=${this.properties.bookId}&cmsPath=${this.properties.learnTaskData?.productLinkPath}`,
-        })
-      }
+
     },
     buyCloudLearnClass() {
       var myEventDetail = {} // detail瀵硅薄锛屾彁渚涚粰浜嬩欢鐩戝惉鍑芥暟
diff --git a/packageBookService/pages/bookServices/detail/components/note/note.js b/packageBookService/pages/bookServices/detail/components/note/note.js
index 8a94230..5daf2d0 100644
--- a/packageBookService/pages/bookServices/detail/components/note/note.js
+++ b/packageBookService/pages/bookServices/detail/components/note/note.js
@@ -18,8 +18,7 @@
    * 缁勪欢鐨勫垵濮嬫暟鎹�
    */
   data: {
-    inputStyle:
-      "border: 2rpx solid rgba(220,220,220,1);border-radius: 12rpx; padding:16rpx",
+    inputStyle: "border: 2rpx solid rgba(220,220,220,1);border-radius: 12rpx; padding:16rpx",
     placeholderstyle: "font-size:28rpx",
     flag: false, // 杈撳叆妗嗘槸鍚︽樉绀�
     submitType: "new", //  鏂板缓 or 缂栬緫
@@ -68,10 +67,11 @@
     },
     openDialog() {
       loginInfo(app, (data) => {})
-      this.setData({
-        submitTitle: this.properties.bookInfo.name,
-        showNoteDialog: true,
-      });
+      if (data)
+        this.setData({
+          submitTitle: this.properties.bookInfo.name,
+          showNoteDialog: true,
+        });
     },
     closeDialog() {
       this.setData({
@@ -346,4 +346,4 @@
       });
     },
   },
-});
+});
\ No newline at end of file
diff --git a/packageBookService/pages/bookServices/detail/components/testResource/testResource.js b/packageBookService/pages/bookServices/detail/components/testResource/testResource.js
index f4170f5..b23e79d 100644
--- a/packageBookService/pages/bookServices/detail/components/testResource/testResource.js
+++ b/packageBookService/pages/bookServices/detail/components/testResource/testResource.js
@@ -148,15 +148,6 @@
       }
     },
     goMycollect(e) {
-      const answertype = e.currentTarget.dataset.answertype;
-      const token = wx.getStorageSync("jsek-token");
-      if (token) {
-        gotoPage()
-      } else {
-        loginInfo(app, (data) => {
-          if (data) gotoPage()
-        })
-      }
       const gotoPage = () => {
         wx.navigateTo({
           url: `/packageBookService/pages/bookServices/examination/examination?bookId=${
@@ -166,6 +157,16 @@
           }&answerType=${answertype}`,
         });
       }
+      const answertype = e.currentTarget.dataset.answertype;
+      const token = wx.getStorageSync("jsek-token");
+      if (token) {
+        gotoPage()
+      } else {
+        loginInfo(app, (data) => {
+          if (data) {}
+        })
+      }
+
     },
     // 缁冧範 缁勪欢鍒囨崲
     onRadioChange(e) {
diff --git a/packageBookService/pages/bookServices/detail/components/tree/index.js b/packageBookService/pages/bookServices/detail/components/tree/index.js
index 13e27ed..d7151ef 100644
--- a/packageBookService/pages/bookServices/detail/components/tree/index.js
+++ b/packageBookService/pages/bookServices/detail/components/tree/index.js
@@ -261,7 +261,7 @@
       const token = wx.getStorageSync(app.config.tokenKey);
       if (!token && this.data.tab != 'jsek_teachingResources') {
         loginInfo(app, (data) => {
-          if (data) goPlayerFun()
+          if (data) {}
         })
       } else {
         goPlayerFun()
diff --git a/packageBookService/pages/bookServices/detail/index.js b/packageBookService/pages/bookServices/detail/index.js
index f9aefe9..4a1ea38 100644
--- a/packageBookService/pages/bookServices/detail/index.js
+++ b/packageBookService/pages/bookServices/detail/index.js
@@ -301,6 +301,7 @@
     }
     this.setData({
       num: Number(this.data.paperBookList.length) + Number(this.data.electronicBookList.length),
+      editDialog: false
     });
     if (this.data.bookDetail.id) {
       this.getBookInfo(this.data.bookDetail.id)
@@ -771,7 +772,11 @@
       editDialog: true
     })
   },
-
+  closeEditDialog() {
+    this.setData({
+      editDialog: false
+    })
+  },
   // 鎴戣寤鸿
   suggestBtn() {
     // 妫�鏌ョ櫥褰曠姸鎬�
@@ -2099,12 +2104,6 @@
   },
   // 璐拱缁勫嵎
   buyMock() {
-    const token = wx.getStorageSync(app.config.tokenKey);
-    if (token) {
-      buyMockFun()
-    } else {
-      this.logInFun(() => {})
-    }
     const buyMockFun = async () => {
       let res;
       if (!this.data.mockData.id)
@@ -2153,6 +2152,13 @@
         console.log(error);
       }
     }
+    const token = wx.getStorageSync(app.config.tokenKey);
+    if (token) {
+      buyMockFun()
+    } else {
+      this.logInFun(() => {})
+    }
+
   },
   // 璁板綍璐拱缁勫嵎鏃堕棿
   recordBuyMock() {
@@ -2679,9 +2685,14 @@
 
   //鍘绘牱涔︾敵璇峰崟
   goApply() {
-    wx.navigateTo({
-      url: "/packageDomain/pages/sampleBookList/applicationForm/index",
-    });
+    const token = wx.getStorageSync(app.config.tokenKey);
+    if (token) {
+      wx.navigateTo({
+        url: "/packageDomain/pages/sampleBookList/applicationForm/index",
+      });
+    } else {
+      this.logInFun(() => {})
+    }
   },
   handleTree() {
     // const child = this.selectComponent('#teach-tree')
diff --git a/packageBookService/pages/bookServices/detail/index.wxml b/packageBookService/pages/bookServices/detail/index.wxml
index 00177b8..d8164b8 100644
--- a/packageBookService/pages/bookServices/detail/index.wxml
+++ b/packageBookService/pages/bookServices/detail/index.wxml
@@ -352,7 +352,7 @@
     </movable-view>
   </movable-area>
   <!-- 鑱旂郴缂栬緫寮圭獥 -->
-  <t-dialog visible="{{editDialog}}" close-btn>
+  <t-dialog visible="{{editDialog}}" close-btn bind:close="closeEditDialog">
     <view slot="content" class="editContent">
       <view class="editText">鍥句功缂栬緫锛歿{bookDetail.bookEditor}}</view>
       <view class="editText">鑱旂郴鏂瑰紡锛歿{bookDetail.contactInformation}}</view>
diff --git a/packageDomain/pages/publickBookForm/index.js b/packageDomain/pages/publickBookForm/index.js
index 2ebbc55..bf7f175 100644
--- a/packageDomain/pages/publickBookForm/index.js
+++ b/packageDomain/pages/publickBookForm/index.js
@@ -43,12 +43,6 @@
    * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍔犺浇
    */
   onLoad() {
-    const token = wx.getStorageSync(app.config.tokenKey)
-    if (!token) {
-      loginInfo(app, (data) => {
-        if (data) {}
-      })
-    } else {}
     this.getType()
   },
 
@@ -63,7 +57,16 @@
    * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鏄剧ず
    */
   onShow() {
-
+    const token = wx.getStorageSync(app.config.tokenKey)
+    if (!token) {
+      loginInfo(app, (data) => {
+        if (data) {} else {
+          wx.switchTab({
+            url: '/pages/home/home',
+          })
+        }
+      })
+    } else {}
   },
 
   /**
diff --git a/packageDomain/pages/resourceDetails/document/index.js b/packageDomain/pages/resourceDetails/document/index.js
index 67d6273..dac4ffc 100644
--- a/packageDomain/pages/resourceDetails/document/index.js
+++ b/packageDomain/pages/resourceDetails/document/index.js
@@ -333,19 +333,14 @@
         isBuy: res.datas.purchasedSaleMethodIdList.includes(res.datas.defaultSaleMethodId)
       })
       res.datas.cmsDatas[0].datas.forEach((item) => {
-        // if (this.data.productLinkPath == item.productLinkPath) {
-        //   this.handleTeachData(item)
-        //   this.setData({
-        //     titleName: item.name,
-        //     selectType: item.selectType,
-        //     learnSelectType: item.learnSelectType
-        //   })
-        // } else {
-        //   return wx.showToast({
-        //     icon: 'none',
-        //     title: '鏆傛棤璧勬簮',
-        //   })
-        // }
+        if (this.data.productLinkPath == item.productLinkPath) {
+          this.handleTeachData(item)
+          this.setData({
+            titleName: item.name,
+            selectType: item.selectType,
+            learnSelectType: item.learnSelectType
+          })
+        }
         if (this.data.storeInfo == 'jsek_digitalCourses') {
           if (this.data.isBuy) {
             if (this.data.productLinkPath == item.productLinkPath) {
@@ -415,13 +410,13 @@
           learnSelectType: item.learnSelectType,
         })
       } else {
-        wx.showToast({
-          icon: 'none',
-          title: '璇峰厛杩斿洖璧勬簮鎵�鍦ㄥ浘涔﹁鎯呰喘涔拌棰戣祫婧�',
-        })
-        wx.navigateTo({
-          url: `/packageBookService/pages/bookServices/detail/index?id=${this.data.bookDetail.id}&name=${this.data.bookDetail.name}&tabValue=jsek_cloudLearning`,
-        });
+        // wx.showToast({
+        //   icon: 'none',
+        //   title: '璇峰厛杩斿洖璧勬簮鎵�鍦ㄥ浘涔﹁鎯呰喘涔拌棰戣祫婧�',
+        // })
+        // wx.navigateTo({
+        //   url: `/packageBookService/pages/bookServices/detail/index?id=${this.data.bookDetail.id}&name=${this.data.bookDetail.name}&tabValue=jsek_cloudLearning`,
+        // });
       }
     })
   },
diff --git a/packageDomain/pages/resourceDetails/myVideo/index.js b/packageDomain/pages/resourceDetails/myVideo/index.js
index fc8426c..3d65fe1 100644
--- a/packageDomain/pages/resourceDetails/myVideo/index.js
+++ b/packageDomain/pages/resourceDetails/myVideo/index.js
@@ -438,7 +438,6 @@
                 showData: app.config.requestCtx + '/file/api/ApiDownloadForAuthorize?md5=' + file + '&token=' + wx.getStorageSync(app.config.tokenKey),
                 titleName: items.name
               })
-              debugger
               this.aliVod(file, this.data.showData)
             } else {
               this.setData({
@@ -865,17 +864,21 @@
   },
   // 鍒ゆ柇褰撳墠鐐瑰嚮鐨勬暟鎹槸鍚﹁喘涔�
   cmsItemIsBuy(item) {
-    // 1.this.data.buyIdList 涓婃槸鍚︽湁 cmsItem鐨刲inkpath閲岀殑id
-    const linkData = item.productLinkInfo.find(citem => citem.LinkType == 'Link' && citem.CmsItemId == item.id)
-    let linkids = []
-    try {
-      linkids = linkData.LinkPath.split('\\')
-    } catch (error) {}
-    if (!this.data.buyIdList.length) return false
-    const flag = linkids.some(citem => {
-      return this.data.buyIdList.includes(Number(citem))
-    })
-    console.log(linkids, flag);
+    let flag = false
+    // 涔颁簡
+    if (this.data.buyList.length) {
+      if (this.data.buyList.some(citem => item.productLinkPath.includes(citem.productLinkPath)))
+        flag = true
+    } else {
+      // 娌′拱涓旀棤閿�鍞柟寮�
+      if (!item.saleMethod.length) {
+        flag = true
+      } else {
+        // 娌′拱涓旈攢鍞柟寮忚繃鏈�//娌′拱锛岄攢鍞柟寮忎环鏍间负0
+        const itemSaleMethod = item.saleMethod.find(citem => citem.SaleType == 'Normal')
+        if (new Date().getTime() > new Date(itemSaleMethod.EndDate).getTime() || itemSaleMethod.Price == 0) flag = true
+      }
+    }
     return flag
   }
 })
\ No newline at end of file
diff --git a/packageDomain/pages/sampleBookList/index.js b/packageDomain/pages/sampleBookList/index.js
index 66082cd..2db2783 100644
--- a/packageDomain/pages/sampleBookList/index.js
+++ b/packageDomain/pages/sampleBookList/index.js
@@ -142,21 +142,7 @@
 
     // 妫�鏌ョ櫥褰曠姸鎬�
     const token = wx.getStorageSync(app.config.tokenKey)
-    if (!token) {
-      loginInfo(app, (data) => {
-        if (data) {
-          that.setData({
-            userInfo: JSON.parse(wx.getStorageSync(app.config.userInfoKey))
-          })
-          that.getAlreadyPBookList()
-          that.getAlreadyEBookList()
-          // 鑾峰彇鐢宠娆℃暟
-          that.getSelectPaperBookCount()
-          that.getSelectBookCount()
-
-        }
-      })
-    } else {
+    if (token) {
       that.setData({
         userInfo: JSON.parse(wx.getStorageSync(app.config.userInfoKey))
       })
@@ -181,16 +167,24 @@
    */
   onShow() {
     let that = this;
-    // that.setData({
-    //   page: 1,
-    //   paperBookList: [],
-    //   electronicBookList: []
-    // })
-    that.getAlreadyPBookList()
-    that.getAlreadyEBookList()
-    // 鑾峰彇鐢宠娆℃暟
-    that.getSelectPaperBookCount()
-    that.getSelectBookCount()
+    const token = wx.getStorageSync(app.config.tokenKey)
+    if (!token) {
+      loginInfo(app, (data) => {
+        if (data) {
+          that.setData({
+            userInfo: JSON.parse(wx.getStorageSync(app.config.userInfoKey))
+          })
+          that.getAlreadyPBookList()
+          that.getAlreadyEBookList()
+          that.getSelectPaperBookCount()
+          that.getSelectBookCount()
+        } else {
+          wx.switchTab({
+            url: '/pages/home/home',
+          })
+        }
+      })
+    }
     if (wx.getStorageSync("paperBookList") || wx.getStorageSync("electronicBookList")) {
       if (wx.getStorageSync("paperBookList")) {
         that.setData({
diff --git a/packageDomain/pages/teacherCertification/index.js b/packageDomain/pages/teacherCertification/index.js
index a5d6c50..df343fc 100644
--- a/packageDomain/pages/teacherCertification/index.js
+++ b/packageDomain/pages/teacherCertification/index.js
@@ -57,17 +57,7 @@
     //鑾峰彇鑱岀О
     this.getpositionalTitle();
     this.getAgreement();
-    // 妫�鏌ョ櫥褰曠姸鎬�
-    const token = wx.getStorageSync(app.config.tokenKey)
-    if (!token) {
-      loginInfo(app, (data) => {
-        if (data) {
-          this.getUserRole()
-        }
-      })
-    } else {
-      this.getUserRole()
-    }
+
   },
 
   /**
@@ -81,6 +71,21 @@
    * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鏄剧ず
    */
   onShow() {
+    // 妫�鏌ョ櫥褰曠姸鎬�
+    const token = wx.getStorageSync(app.config.tokenKey)
+    if (!token) {
+      loginInfo(app, (data) => {
+        if (data) {
+          this.getUserRole()
+        } else {
+          wx.switchTab({
+            url: '/pages/home/home',
+          })
+        }
+      })
+    } else {
+      this.getUserRole()
+    }
 
   },
 
diff --git a/pages/bibliographyList/index.js b/pages/bibliographyList/index.js
index 29c8f65..932a2c1 100644
--- a/pages/bibliographyList/index.js
+++ b/pages/bibliographyList/index.js
@@ -70,6 +70,10 @@
         });
       },
     })
+    const token = wx.getStorageSync(app.config.tokenKey)
+    if (token) {
+      this.getUserInfo()
+    }
   },
 
   /**
@@ -84,17 +88,7 @@
    */
   onShow() {
     // console.log(this.data.value);
-    // 妫�鏌ョ櫥褰曠姸鎬�
-    const token = wx.getStorageSync(app.config.tokenKey)
-    if (!token) {
-      loginInfo(app, (data) => {
-        if (data) {
-          this.getUserInfo()
-        }
-      })
-    } else {
-      this.getUserInfo()
-    }
+
   },
 
   /**
@@ -454,10 +448,25 @@
   mailbox(e) {
     const key = e.currentTarget.dataset.key;
     const item = e.currentTarget.dataset.item;
-    this.setData({
-      Md5: item.datas.freeFile.FileList[0].Md5,
-      dialogBox: true
-    })
+    // 妫�鏌ョ櫥褰曠姸鎬�
+    const token = wx.getStorageSync(app.config.tokenKey)
+    if (!token) {
+      loginInfo(app, (data) => {
+        if (data) {
+          this.getUserInfo()
+          this.setData({
+            Md5: item.datas.freeFile.FileList[0].Md5,
+            dialogBox: true
+          })
+        } else {}
+      })
+    } else {
+      this.setData({
+        Md5: item.datas.freeFile.FileList[0].Md5,
+        dialogBox: true
+      })
+    }
+
     // wx.scanCode({
     //   success: res => {
     //     console.log(res); 
diff --git a/pages/cart/index.js b/pages/cart/index.js
index 889a690..4a4ceb1 100644
--- a/pages/cart/index.js
+++ b/pages/cart/index.js
@@ -33,12 +33,21 @@
     wx.setNavigationBarTitle({
       title: '璐墿杞�'
     });
-    this.shoppingCartGet();
+    // this.shoppingCartGet();
     this.setData({
       swipeOpened: true
     })
   },
   onShow() {
+    loginInfo(app, (data) => {
+      if (data) {
+        this.shoppingCartGet();
+      } else {
+        wx.switchTab({
+          url: '/pages/home/home',
+        })
+      }
+    })
     this.setData({
       swipeOpened: false
     })
@@ -47,7 +56,6 @@
         active: 3
       })
     }
-    this.shoppingCartGet();
     this.setData({
       totalPrice: 0.00,
       selectedCount: 0,
@@ -216,12 +224,7 @@
     });
   },
 
-
-
-
-
   goPaymentPage() {
-
     // 棣栭〉娴嬭瘯鐧诲綍鍔熻兘锛屽悗缁敞閲�
     // 妫�鏌ョ櫥褰曠姸鎬�
     const token = wx.getStorageSync(app.config.tokenKey)
diff --git a/pages/personalCenter/index.js b/pages/personalCenter/index.js
index 16b1abe..341ca0e 100644
--- a/pages/personalCenter/index.js
+++ b/pages/personalCenter/index.js
@@ -170,6 +170,10 @@
           });
           this.getUserInfo()
           this.getIntegral()
+        } else {
+          wx.switchTab({
+            url: '/pages/home/home',
+          })
         }
       })
     } else {
diff --git a/pages/study/index.js b/pages/study/index.js
index a925f80..fcd584b 100644
--- a/pages/study/index.js
+++ b/pages/study/index.js
@@ -64,6 +64,10 @@
           this.getStaticsSum();
           this.getDataList(false);
           this.getListCount()
+        } else {
+          wx.switchTab({
+            url: '/pages/home/home',
+          })
         }
       })
     } else {

--
Gitblit v1.9.1