From 5b19b0e39a91e566a835460bf1213e7b3a0582b9 Mon Sep 17 00:00:00 2001
From: litian <C21AF165>
Date: 星期一, 17 三月 2025 14:27:14 +0800
Subject: [PATCH] 图

---
 packageCourse/pages/course/detail/index.js |   31 +++++++++++++++++++++++++++----
 1 files changed, 27 insertions(+), 4 deletions(-)

diff --git a/packageCourse/pages/course/detail/index.js b/packageCourse/pages/course/detail/index.js
index bdb935c..433de22 100644
--- a/packageCourse/pages/course/detail/index.js
+++ b/packageCourse/pages/course/detail/index.js
@@ -15,6 +15,7 @@
     startTime: '',
     endTime: '',
     className: '',
+    isShow: "",
     count: null,
     classList: [],
     searchKey: '',
@@ -179,13 +180,15 @@
   // 鎵撳紑閫夋嫨鏃ユ湡
   openDateStart() {
     this.setData({
-      visibleStart: true
+      visibleStart: true,
+      isShow: 'none',
     })
   },
 
   openDateEnd() {
     this.setData({
-      visibleEnd: true
+      visibleEnd: true,
+      isShow: 'none'
     })
   },
 
@@ -197,6 +200,7 @@
     const dateStr = moment(value).format('YYYY-MM-DD')
     this.setData({
       startTime: dateStr,
+      isShow: ''
     });
   },
 
@@ -207,6 +211,7 @@
     const dateStr = moment(value).format('YYYY-MM-DD')
     this.setData({
       endTime: dateStr,
+      isShow: ''
     });
   },
 
@@ -217,8 +222,18 @@
     })
   },
 
+  calendarClose() {
+    this.setData({
+      visibleStart: false,
+      visibleEnd: false,
+      isShow: ''
+    })
+  },
+
   // 鐢宠鎻愪氦鐝骇
   submitClass() {
+    const bTime = moment(this.data.startTime).valueOf()
+    const eTime = moment(this.data.endTime).valueOf()
     if (!this.data.className) {
       wx.showToast({
         title: '璇峰~鍐欒绋嬪悕绉�',
@@ -238,6 +253,14 @@
     if (!this.data.startTime || !this.data.endTime) {
       wx.showToast({
         title: '璇烽�夋嫨鐝骇鏈夋晥鏈�',
+        duration: 1000,
+        icon: 'none',
+      })
+      return false
+    }
+    if (bTime && eTime && eTime < bTime) {
+      wx.showToast({
+        title: '璇烽�夋嫨鐝纭殑鐝骇鏈夋晥鏈�',
         duration: 1000,
         icon: 'none',
       })
@@ -273,7 +296,7 @@
         wx.showToast({
           title: '鐢宠寮�鐝嚭閿�',
           duration: 1000,
-          icon: 'err',
+          icon: 'none',
         })
         this.setData({
           visible: false
@@ -386,7 +409,7 @@
       return false
     }
     wx.navigateTo({
-      url: '/packageCourse/pages/teachClass/index?classId=' + classId + '&courseId=' + this.data.courseId + '&author=' + this.data.bookData.author + '&isbn=' + this.data.bookData.isbn + '&bookId=' + this.data.bookData.id + '&rootCmsItemId=' + this.data.bookData.rootCmsItemId + "&bookRefCode=" + this.data.defaultCmsPath,
+      url: '/packageCourse/pages/teachClass/index?classId=' + classId + '&courseId=' + this.data.courseId + '&author=' + this.data.bookData.author + '&isbn=' + this.data.bookData.isbn + '&bookId=' + this.data.bookData.id + '&rootCmsItemId=' + this.data.bookData.rootCmsItemId + "&bookRefCode=" + item.linkProductDto.product.refCode,
     })
   },
 

--
Gitblit v1.9.1