litian
2024-07-11 57ba8e29b5cfdd3fc5b0b9b631a26ff095d1ac5d
证书
6个文件已修改
341 ■■■■■ 已修改文件
pages/digitalCourses/digitalCoursesDetails/index.js 94 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/digitalCourses/digitalCoursesDetails/index.wxml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/digitalTextbooks/digitalTextbooksDetails/index.js 135 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/digitalTextbooks/digitalTextbooksDetails/index.json 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/digitalTextbooks/digitalTextbooksDetails/index.wxml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/digitalTextbooks/digitalTextbooksDetails/index.wxss 107 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
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: "您申请的证书正在审核中",
    //     icon: "none",
    //     duration: 1000,
    //   });
    //   return false
    // }
    var page = getCurrentPages().pop(); // 获取当前页面实例
    page.setData({
@@ -714,11 +729,52 @@
      scrollJudge: true
    })
  },
  confirmM() {
  //姓名
  onFullNameInput(e) {
    this.setData({
      "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() {
    // 首页测试登录功能,后续注释
pages/digitalCourses/digitalCoursesDetails/index.wxml
@@ -200,7 +200,7 @@
          <view class="dialog-title">学习证书申请</view>
          <view style="width: 100%; height: 2rpx; background-color: #F4F4F4;"></view>
          <view class="input-box">
            <t-input class="input" borderless placeholder="请输入真实姓名" value="{{input}}" bind:change="inputChange"></t-input>
            <t-input class="input" borderless placeholder="请输入真实姓名" value="{{userInfo.fullName}}" bind:change="onFullNameInput"></t-input>
          </view>
        </view>
        <view class="row-btn">
pages/digitalTextbooks/digitalTextbooksDetails/index.js
@@ -3,6 +3,9 @@
import {
  loginInfo
} from '../../../assets/js/login';
import {
  worksDataBytool
} from "../../../assets/js/toolClass.js";
const app = getApp()
Page({
@@ -58,7 +61,11 @@
    },
    userInfo: {
      fullName: '' //名称
    }
    },
    worksInfo: [],
    isCertificate: {},
    isLearn: false,
    isTest: false,
  },
  /**
@@ -70,6 +77,8 @@
      digitalTextId: options.id
    })
    this.digitalTextbooksDetailsGet(this.data.digitalTextId)
    this.getType()
    this.getCertificateList()
  },
  // 格式化日期
  // 格式化日期
@@ -640,4 +649,128 @@
    //   })
  },
  //申请证书
  //获取字段
  getType() {
    app.MG.resource.getCmsTypeByRefCode({
      refCodes: ['jsek_textbookCertificate']
    }).then((res) => {
      this.setData({
        worksInfo: res[0].cmsTypeLinks[0].children,
      })
    })
  },
  getCertificateList() {
    const data = {
      start: 0,
      size: 9999,
      topicIdOrRefCode: 'applyTextbookCertificate',
      appRefCode: app.config.appRefCode,
      sort: {
        type: 'Desc',
        field: 'CreateDate'
      }
    }
    app.MG.ugc.getTopicMessageList(data).then((res) => {
      res.datas.map((item) => {
        item.content = JSON.parse(item.content)
        if (item.content.id == this.data.digitalsData.id) {
          this.setData({
            isCertificate: item
          })
        }
      })
    })
  },
  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.isCertificate && this.data.isCertificate.state == 'WaitAudit') {
      wx.showToast({
        title: "您申请的证书正在审核中",
        icon: "none",
        duration: 1000,
      });
      return false
    }
    var page = getCurrentPages().pop(); // 获取当前页面实例
    page.setData({
      // 动态设置禁止滚动的样式
      disableScrollStyle: 'overflow: hidden;'
    });
    this.setData({
      dialogBox: true,
      scrollJudge: ''
    })
  },
  closeDialog() {
    this.setData({
      dialogBox: false,
      scrollJudge: true
    })
  },
  //姓名
  onFullNameInput(e) {
    this.setData({
      "userInfo.fullName": e.detail.value,
    });
  },
  confirmM() {
    if (this.data.userInfo.fullName) {
      let data = {}
      data = {
        topicIdOrRefCode: 'applyTextbookCertificate',
        name: this.data.userInfo.fullName,
        content: JSON.stringify(this.data.digitalsData),
        state: 'WaitAudit',
        cmsTypeRefCode: 'jsek_textbookCertificate',
        type: 'applyTextbook',
        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,
      });
    }
  },
})
pages/digitalTextbooks/digitalTextbooksDetails/index.json
@@ -7,6 +7,7 @@
    "t-toast": "tdesign-miniprogram/toast/toast",
    "t-empty": "tdesign-miniprogram/empty/empty",
    "suggest": "/packageBookService/pages/bookServices/detail/components/suggest/suggest",
    "t-input": "tdesign-miniprogram/input/input",
    "empty": "/components/empty/index"
  }
}
pages/digitalTextbooks/digitalTextbooksDetails/index.wxml
@@ -200,7 +200,7 @@
          <view class="dialog-title">学习证书申请</view>
          <view style="width: 100%; height: 2rpx; background-color: #F4F4F4;"></view>
          <view class="input-box">
            <t-input class="input" borderless placeholder="请输入真实姓名" value="{{input}}" bind:change="inputChange"></t-input>
            <t-input class="input" borderless placeholder="请输入真实姓名" value="{{userInfo.fullName}}" bind:change="onFullNameInput"></t-input>
          </view>
        </view>
        <view class="row-btn">
pages/digitalTextbooks/digitalTextbooksDetails/index.wxss
@@ -417,3 +417,110 @@
  text-overflow: ellipsis;
  -o-text-overflow: ellipsis;
}
.placeholder {
  color: var(--td-text-color-placeholder);
  line-height: 96rpx;
  height: 96rpx !important;
  display: flex;
  align-items: center;
}
.dialog-input {
  padding-top: 12px;
  padding-bottom: 12px;
  text-align: left;
  margin-top: 32rpx;
  border-radius: 8rpx;
  background-color: var(--td-bg-color-page);
  box-sizing: border-box;
}
/* 蒙层 */
.popup-box {
  position: absolute;
  z-index: 99;
  top: 0;
  background-color: rgba(0, 0, 0, 0.5);
  width: 100%;
  height: 100vh;
}
.info-center {
  position: fixed;
  top: 32%;
  z-index: 999;
  background-color: white;
  align-items: center;
  justify-content: center;
  border-radius: 10rpx;
  width: 80%;
  margin-left: 10%;
  margin-right: 10%;
}
.row-info .body {
  min-height: 300rpx;
}
.dialog-title {
  padding: 20rpx 0;
  text-align: center;
  font-weight: bold;
  font-size: 29rpx;
  color: #333333;
}
.input-box {
  padding: 0 20rpx;
  width: 92%;
  margin-bottom: 16rpx;
  margin-top: 60rpx;
}
.t-input__content,
.t-textarea {
  border: 2rpx solid #D9D9D9 !important;
  border-radius: 15rpx;
  padding: 10rpx !important;
}
.row-btn {
  width: 100%;
  display: flex;
  flex-direction: row;
  align-items: center;
  border-top: 1rpx solid #f1f1f1;
}
.row-btn view {
  flex: 1;
  text-align: center;
  margin: 20rpx 10%;
  padding: 12rpx 0;
  font-size: 32rpx;
  border-radius: 10rpx;
}
.left-btn {
  background-color: #f1f1f1;
  color: #5C5C5C;
}
.right-btn {
  background-color: #ff6c00;
  color: white;
}
.t-input {
  background-color: var(--td-input-bg-color, var(--td-bg-color-container, var(--td-font-white-1, #ffffff)));
  display: flex;
  align-items: center;
  flex: 1;
  padding: var(--td-input-vertical-padding, 10rpx) !important;
}
.t-input__placeholder,
.t-textarea__placeholder {
  font-size: 28rpx !important;
}