From 57ba8e29b5cfdd3fc5b0b9b631a26ff095d1ac5d Mon Sep 17 00:00:00 2001
From: litian <C21AF165>
Date: 星期四, 11 七月 2024 17:28:19 +0800
Subject: [PATCH] 证书

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

diff --git a/pages/digitalCourses/digitalCoursesDetails/index.js b/pages/digitalCourses/digitalCoursesDetails/index.js
index f057cab..69d1f5a 100644
--- a/pages/digitalCourses/digitalCoursesDetails/index.js
+++ b/pages/digitalCourses/digitalCoursesDetails/index.js
@@ -1,5 +1,8 @@
 // pages/digitalCourses/digitalCoursesDetails/index.js
 const app = getApp()
+import {
+  worksDataBytool
+} from "../../../assets/js/toolClass.js";
 import moment from 'moment'
 import Toast from "tdesign-miniprogram/toast";
 import {
@@ -76,6 +79,9 @@
     isCertificate: {},
     isLearn: false,
     isTest: false,
+    userInfo: {
+      fullName: '' //鍚嶇О
+    }
   },
   formatDate(dateString) {
     if (!dateString) {
@@ -132,7 +138,8 @@
     })
     this.digitalCoursesDetailsGet(options.id)
     this.getPlayerList()
-    this.getResource()
+    this.getType()
+    this.getCertificateList()
   },
 
   /**
@@ -661,7 +668,7 @@
       start: 0,
       size: 9999,
       topicIdOrRefCode: 'applyCourseCertificate',
-      appRefCode: config.appRefCode,
+      appRefCode: app.config.appRefCode,
       sort: {
         type: 'Desc',
         field: 'CreateDate'
@@ -681,22 +688,30 @@
   },
 
   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湪瀹℃牳涓�",
+    //     icon: "none",
+    //     duration: 1000,
+    //   });
+    //   return false
+    // }
 
     var page = getCurrentPages().pop(); // 鑾峰彇褰撳墠椤甸潰瀹炰緥
     page.setData({
@@ -714,11 +729,52 @@
       scrollJudge: true
     })
   },
-  confirmM() {
+
+  //濮撳悕
+  onFullNameInput(e) {
     this.setData({
-      dialogBox: false,
-      scrollJudge: true
-    })
+      "userInfo.fullName": e.detail.value,
+    });
+  },
+  confirmM() {
+    if (this.data.userInfo.fullName) {
+      let data = {}
+      data = {
+        topicIdOrRefCode: 'applyCourseCertificate',
+        name: this.data.userInfo.fullName,
+        content: JSON.stringify(this.data.digitalsData),
+        state: 'WaitAudit',
+        cmsTypeRefCode: 'jsek_courseCertificate',
+        type: 'applyCourse',
+        newDataListRequest: worksDataBytool(this.data.worksInfo, this.data.userInfo)
+      }
+      app.MG.ugc
+        .newTopicMessage(data)
+        .then((res) => {
+          wx.showToast({
+            title: "宸叉彁浜ょ敵璇�",
+            icon: "none",
+            duration: 1000,
+          });
+          this.setData({
+            "userInfo.fullName": "",
+            dialogBox: false,
+            scrollJudge: true
+          })
+          this.getCertificateList()
+        })
+        .catch(() => {
+          this.setData({
+            "userInfo.fullName": "",
+          })
+        })
+    } else {
+      wx.showToast({
+        title: "濮撳悕涓嶈兘涓虹┖",
+        icon: "none",
+        duration: 1000,
+      });
+    }
   },
   setCoolect() {
     // 棣栭〉娴嬭瘯鐧诲綍鍔熻兘锛屽悗缁敞閲�

--
Gitblit v1.9.1