瀏覽代碼

七大元预约考试更改

谢杰标 2 年之前
父節點
當前提交
e6a0eb09ca
共有 5 個文件被更改,包括 781 次插入211 次删除
  1. 8 0
      common/httpList/course.js
  2. 124 88
      filters/index.js
  3. 86 35
      pages/learn/index.vue
  4. 400 0
      pages/learn/quill.core.css
  5. 163 88
      pages2/appointment/order.vue

+ 8 - 0
common/httpList/course.js

@@ -217,6 +217,14 @@ export default {
 			compleLoading: true
 		})
 	},
+	// 查询考前须知
+	getExamTip(data) {
+		return myRequest({
+			url: '/apply/before/know',
+			method: 'get',
+			data: data
+		})
+	},
 	reSectionExamList(data) {
 		return myRequest({
 			url: '/course/sectionExamList',

+ 124 - 88
filters/index.js

@@ -2,97 +2,133 @@
  * 时间戳转换成时间
  * @param {*} time
  */
-const formDate = (time, formate = 'yyyy-mm-dd hh:mm:ss') => {
-    var padDate = function (va) {
-        va = va < 10 ? '0' + va : va
-        return va
+const formDate = (time, formate = "yyyy-mm-dd hh:mm:ss") => {
+  var padDate = function (va) {
+    va = va < 10 ? "0" + va : va;
+    return va;
+  };
+  if (time) {
+    var value = new Date(time * 1000); //时间戳为10位需*1000,时间戳为13位的话不需乘1000
+    // var value = new Date(parseFloat(time))
+    var year = value.getFullYear();
+    var month = padDate(value.getMonth() + 1);
+    var day = padDate(value.getDate());
+    var hour = padDate(value.getHours());
+    var minutes = padDate(value.getMinutes());
+    var seconds = padDate(value.getSeconds());
+    let res = "";
+    switch (formate) {
+      case "mm-dd": {
+        res = month + "-" + day;
+        break;
+      }
+      case "yyyy-mm-dd": {
+        res = year + "-" + month + "-" + day;
+        break;
+      }
+      case "yyyy-mm": {
+        res = year + "-" + month;
+        break;
+      }
+      case "mm月dd日": {
+        res = month + "月" + day + "日";
+        break;
+      }
+      case "yyyy年mm月dd日": {
+        res = year + "年" + month + "月" + day + "日";
+        break;
+      }
+      case "yyyy年mm月": {
+        res = year + "年" + month + "月";
+        break;
+      }
+      case "hh:mm": {
+        res = hour + ":" + minutes;
+        break;
+      }
+      case "yyyy-mm-dd hh:mm": {
+        res = year + "-" + month + "-" + day + " " + hour + ":" + minutes;
+        break;
+      }
+      case "yyyy.mm.dd":
+        res = year + "." + month + "." + day;
+        break;
+      case "yyyy-mm-dd hh:mm:ss":
+      default: {
+        res =
+          year +
+          "-" +
+          month +
+          "-" +
+          day +
+          " " +
+          hour +
+          ":" +
+          minutes +
+          ":" +
+          seconds;
+        break;
+      }
     }
-    if (time) {
-        var value = new Date(time * 1000); //时间戳为10位需*1000,时间戳为13位的话不需乘1000
-        // var value = new Date(parseFloat(time))
-        var year = value.getFullYear()
-        var month = padDate(value.getMonth() + 1)
-        var day = padDate(value.getDate())
-        var hour = padDate(value.getHours())
-        var minutes = padDate(value.getMinutes())
-        var seconds = padDate(value.getSeconds())
-        let res = ''
-        switch (formate) {
-            case 'mm-dd': {
-                res =  month + '-' + day
-                break
-            }
-            case 'yyyy-mm-dd': {
-                res = year + '-' + month + '-' + day
-                break
-            }
-            case 'yyyy-mm': {
-                res = year + '-' + month
-                break
-            }
-            case 'mm月dd日': {
-                res = month + '月' + day + '日'
-                break
-            }
-            case 'yyyy年mm月dd日': {
-                res = year + '年' + month + '月' + day + '日'
-                break
-            }
-            case 'yyyy年mm月': {
-                res = year + '年' + month + '月'
-                break
-            }
-            case 'hh:mm': {
-                res = hour + ':' + minutes
-                break
-            }
-            case 'yyyy-mm-dd hh:mm': {
-                res = year + '-' + month + '-' + day + ' ' + hour + ':' + minutes
-                break
-            }
-            case 'yyyy.mm.dd':
-                res = year + '.' + month + '.' + day
-                break
-            case 'yyyy-mm-dd hh:mm:ss':
-            default: {
-                res = year + '-' + month + '-' + day + ' ' + hour + ':' + minutes + ':' + seconds
-                break
-            }
-        }
-        return res
-    }
-    return '--'
-}
+    return res;
+  }
+  return "--";
+};
 
 const formDateStr = (time) => {
-    var padDate = function (va) {
-        va = va < 10 ? '0' + va : va
-        return va
+  var padDate = function (va) {
+    va = va < 10 ? "0" + va : va;
+    return va;
+  };
+  if (time) {
+    var value = new Date(parseFloat(time));
+    var year = value.getFullYear();
+    var month = padDate(value.getMonth() + 1);
+    var day = value.getDate();
+    var hour = padDate(value.getHours());
+    var minutes = padDate(value.getMinutes());
+    var seconds = padDate(value.getSeconds());
+    let res = "";
+    if (day == new Date().getDate()) {
+      res = "今天" + hour + ":" + minutes;
+      return res;
     }
-    if (time) {
-        var value = new Date(parseFloat(time))
-        var year = value.getFullYear()
-        var month = padDate(value.getMonth() + 1)
-        var day = value.getDate()
-        var hour = padDate(value.getHours())
-        var minutes = padDate(value.getMinutes())
-        var seconds = padDate(value.getSeconds())
-        let res = ''
-        if(day == new Date().getDate()){
-             res = '今天' + hour + ':' + minutes
-             return res
-        }
-        if(year == new Date().getFullYear() ){
-            res =  month + '-' + padDate(day) + ' ' + hour + ':' + minutes
-            return res
-        }
-        res = year + '-' + month + '-' + padDate(day)
-        return res
+    if (year == new Date().getFullYear()) {
+      res = month + "-" + padDate(day) + " " + hour + ":" + minutes;
+      return res;
     }
-    return '--'
-}
+    res = year + "-" + month + "-" + padDate(day);
+    return res;
+  }
+  return "--";
+};
+
+const formatRichText = (html) => {
+  //控制小程序中图片大小
+  let newContent = html.replace(/<img[^>]*>/gi, function (match, capture) {
+    match = match.replace(/style="[^"]+"/gi, "").replace(/style='[^']+'/gi, "");
+    match = match.replace(/width="[^"]+"/gi, "").replace(/width='[^']+'/gi, "");
+    match = match
+      .replace(/height="[^"]+"/gi, "")
+      .replace(/height='[^']+'/gi, "");
+    return match;
+  });
+  newContent = newContent.replace(/style="[^"]+"/gi, function (match, capture) {
+    match = match
+      .replace(/width:[^;]+;/gi, "max-width:100%;")
+      .replace(/width:[^;]+;/gi, "max-width:100%;");
+    return match;
+  });
+  newContent = newContent.replace(/<br[^>]*\/>/gi, "");
+  newContent = newContent.replace(
+    /\<img/gi,
+    '<img style="max-width:100%;height:auto;display:inline-block;margin:10rpx auto;"'
+  );
+  return newContent;
+};
 
-export default { 
-	formDate,
-	formDateStr
-}
+export default {
+  formDate,
+  formDateStr,
+  formatRichText
+};

+ 86 - 35
pages/learn/index.vue

@@ -375,11 +375,7 @@
                 </view>
               </template>
               <!-- examApplyGoodsList.length -是判断是否关联指定学员 -->
-              <view v-else class="exam_btns">
-                <view
-                  class="box_appoint"
-                  v-if="
-                    item.applyStatus === 1 &&
+              <!-- item.applyStatus === 1 &&
                     !(
                       sysTime <= item.serviceStartTime ||
                       sysTime >= item.serviceEndTime ||
@@ -390,9 +386,12 @@
                       (item.learningStatus == 3 &&
                         sysTime < item.learningTimeStart) ||
                       !item.examApplyGoodsList.length
-                    )
-                  "
-                  @click="appointment(item, appoint)"
+                    ) -->
+              <view v-else class="exam_btns">
+                <view
+                  class="box_appoint"
+                  v-if="item.examApplyGoodsList"
+                  @click="appointment(item)"
                 >
                   <view class="exam_word ones">预约考试</view>
                 </view>
@@ -551,7 +550,7 @@
       <view class="popuptest_box">
         <view class="check_head">
           <view class="headers">
-            <view class="grade">预约课程</view>
+            <view class="grade">预约考试</view>
             <u-icon
               name="close"
               color="#9C9C9C"
@@ -570,23 +569,36 @@
               <view class="course_lefts">
                 <view class="course_title">{{ appoint.applyName }}</view>
               </view>
-              <view
-                class="course_rights"
-                @click="jumpTest(appointItemIndex, appoint)"
-              >
-                <view class="intoStudy">预约</view>
+              <view class="course_rights" @click="jumpTest(appoint)">
+                <view
+                  class="intoStudy"
+                  v-if="appointItemIndex.subscribeSign !== 2"
+                  >预约</view
+                >
               </view>
             </view>
           </scroll-view>
         </view>
       </view>
     </u-popup>
+    <!-- 考前须知 -->
+    <u-modal
+      v-model="showTip"
+      title="考前须知"
+      :show-cancel-button="true"
+      @confirm="confirmTip"
+    >
+      <view class="slot-content ql-editor" style="white-space: pre-wrap">
+        <rich-text :nodes="nodesCcontent | formatRichText"></rich-text>
+      </view>
+    </u-modal>
   </view>
 </template>
 
 <script>
 var curTime = new Date().getTime(); // 当前时间的时间戳
 import { mapGetters, mapActions } from "vuex";
+import filters from "../../filters/index";
 export default {
   data() {
     return {
@@ -614,8 +626,11 @@ export default {
       appointTestShow: false, //预约考试弹窗
       appointTestList: [],
       appointItemIndex: {}, // 点击了哪项课程
+      appoint: {},
       imgwidth: 0,
       imgheight: 0,
+      showTip: false,
+      nodesCcontent: "",
     };
   },
   filters: {
@@ -628,6 +643,7 @@ export default {
         return watchStatus == "live" ? "正在直播中" : "即将开播";
       }
     },
+    formatRichText: filters.formatRichText,
   },
   computed: {
     ...mapGetters(["userInfo", "config"]),
@@ -791,10 +807,27 @@ export default {
           if (res1.code == 200) {
             this.total = res1.total;
             this.courseLists = res1.rows || [];
+            const goods = this.courseLists.find(
+              (e) => e.subscribeSign == 1 || e.subscribeSign == 3
+            );
+            if (goods) {
+              let { goodsName, subscribeSign } = goods;
+              let text =
+                `您七大员新考【${goodsName}】课程` +
+                (subscribeSign == 1
+                  ? "已学完,可以预约考试了!"
+                  : "课程考试未通过,请重新预约考试!");
+              uni.showModal({
+                title: "提示",
+                content: text,
+                success: (res) => {
+                  if (res.confirm) {
+                    this.appointment(goods);
+                  }
+                },
+              });
+            }
           }
-          // if (res2.code == 200) {
-          // 	this.questionLists = res2.rows || []
-          // }
           if (res2.code == 200) {
             this.livingLists = res2.rows || [];
           } else {
@@ -1319,27 +1352,44 @@ export default {
     closePop() {
       this.appointTestShow = false;
     },
-    jumpTest(item, appoint) {
-      this.appoint_an(item, appoint);
+    jumpTest(appoint) {
+      this.$api
+        .getExamTip()
+        .then((res) => {
+          this.nodesCcontent = res.data.data.value;
+          this.appoint = appoint;
+          this.showTip = true;
+        })
+        .catch(() => {
+          this.appoint_an(appoint);
+          this.appointTestShow = false;
+        });
+    },
+    confirmTip() {
+      this.showTip = false;
       this.appointTestShow = false;
+      this.appoint_an(this.appoint);
     },
-    appointment(item, appoint) {
+    appointment(item) {
       this.appointItemIndex = item;
-      if (item.examApplyGoodsList.length > 1) {
-        // 多个考试预约
-        this.appointTestList = item.examApplyGoodsList;
-        this.appointTestShow = true;
-        return;
-      }
-      let appoint_item = item.examApplyGoodsList[0];
-      this.appoint_an(item, appoint_item);
+      this.appointTestList = item.examApplyGoodsList;
+      this.appointTestShow = true;
+      // if (item.examApplyGoodsList.length > 1) {
+      //   // 多个考试预约
+      //   this.appointTestList = item.examApplyGoodsList;
+      //   this.appointTestShow = true;
+      //   return;
+      // }
+      // let appoint_item = item.examApplyGoodsList[0];
+      // this.appoint_an(item, appoint_item);
     },
-    appoint_an(item, appoint) {
+    appoint_an(appoint) {
+      const { goodsId, gradeId, orderGoodsId } = this.appointItemIndex;
       var data = {
-        goodsId: item.goodsId,
-        gradeId: item.gradeId,
+        goodsId,
+        gradeId,
         applyId: appoint.applyId,
-        orderGoodsId: item.orderGoodsId,
+        orderGoodsId,
       };
       this.$api.getApplysubscribe(data).then((res) => {
         if (res.data.code === 500) {
@@ -1350,9 +1400,9 @@ export default {
         }
         if (res.data.code === 200) {
           this.$navTo.togo("/pages2/appointment/index", {
-            goodsId: item.goodsId,
-            gradeId: item.gradeId,
-            orderGoodsId: item.orderGoodsId,
+            goodsId,
+            gradeId,
+            orderGoodsId,
             applyId: appoint.applyId,
           });
         }
@@ -1392,4 +1442,5 @@ page {
 </style>
 <style lang="scss" scoped>
 @import "./index.scss";
+@import "./quill.core";
 </style>

+ 400 - 0
pages/learn/quill.core.css

@@ -0,0 +1,400 @@
+/*!
+ * Quill Editor v1.3.7
+ * https://quilljs.com/
+ * Copyright (c) 2014, Jason Chen
+ * Copyright (c) 2013, salesforce.com
+ */
+.ql-container {
+  box-sizing: border-box;
+  font-family: Helvetica, Arial, sans-serif;
+  font-size: 13px;
+  height: 100%;
+  margin: 0px;
+  position: relative;
+}
+.ql-container.ql-disabled .ql-tooltip {
+  visibility: hidden;
+}
+.ql-container.ql-disabled .ql-editor ul[data-checked] > li::before {
+  pointer-events: none;
+}
+.ql-clipboard {
+  left: -100000px;
+  height: 1px;
+  overflow-y: hidden;
+  position: absolute;
+  top: 50%;
+}
+.ql-clipboard p {
+  margin: 0;
+  padding: 0;
+}
+.ql-editor {
+  box-sizing: border-box;
+  line-height: 1.42;
+  height: 100%;
+  outline: none;
+  overflow-y: auto;
+  padding: 12px 15px;
+  tab-size: 4;
+  -moz-tab-size: 4;
+  text-align: left;
+  white-space: pre-wrap;
+  word-wrap: break-word;
+}
+.ql-editor > * {
+  cursor: text;
+}
+.ql-editor p,
+.ql-editor ol,
+.ql-editor ul,
+.ql-editor pre,
+.ql-editor blockquote,
+.ql-editor h1,
+.ql-editor h2,
+.ql-editor h3,
+.ql-editor h4,
+.ql-editor h5,
+.ql-editor h6 {
+  margin: 0;
+  padding: 0;
+  counter-reset: list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9;
+}
+.ql-editor ol,
+.ql-editor ul {
+  padding-left: 1.5em;
+}
+.ql-editor ol > li,
+.ql-editor ul > li {
+  list-style-type: none;
+}
+.ql-editor ul > li::before {
+  content: '\2022';
+}
+.ql-editor ul[data-checked=true],
+.ql-editor ul[data-checked=false] {
+  pointer-events: none;
+}
+.ql-editor ul[data-checked=true] > li *,
+.ql-editor ul[data-checked=false] > li * {
+  pointer-events: all;
+}
+.ql-editor ul[data-checked=true] > li::before,
+.ql-editor ul[data-checked=false] > li::before {
+  color: #777;
+  cursor: pointer;
+  pointer-events: all;
+}
+.ql-editor ul[data-checked=true] > li::before {
+  content: '\2611';
+}
+.ql-editor ul[data-checked=false] > li::before {
+  content: '\2610';
+}
+.ql-editor li::before {
+  display: inline-block;
+  white-space: nowrap;
+  width: 1.2em;
+}
+.ql-editor li:not(.ql-direction-rtl)::before {
+  margin-left: -1.5em;
+  margin-right: 0.3em;
+  text-align: right;
+}
+.ql-editor li.ql-direction-rtl::before {
+  margin-left: 0.3em;
+  margin-right: -1.5em;
+}
+.ql-editor ol li:not(.ql-direction-rtl),
+.ql-editor ul li:not(.ql-direction-rtl) {
+  padding-left: 1.5em;
+}
+.ql-editor ol li.ql-direction-rtl,
+.ql-editor ul li.ql-direction-rtl {
+  padding-right: 1.5em;
+}
+.ql-editor ol li {
+  counter-reset: list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9;
+  counter-increment: list-0;
+}
+.ql-editor ol li:before {
+  content: counter(list-0, decimal) '. ';
+}
+.ql-editor ol li.ql-indent-1 {
+  counter-increment: list-1;
+}
+.ql-editor ol li.ql-indent-1:before {
+  content: counter(list-1, lower-alpha) '. ';
+}
+.ql-editor ol li.ql-indent-1 {
+  counter-reset: list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9;
+}
+.ql-editor ol li.ql-indent-2 {
+  counter-increment: list-2;
+}
+.ql-editor ol li.ql-indent-2:before {
+  content: counter(list-2, lower-roman) '. ';
+}
+.ql-editor ol li.ql-indent-2 {
+  counter-reset: list-3 list-4 list-5 list-6 list-7 list-8 list-9;
+}
+.ql-editor ol li.ql-indent-3 {
+  counter-increment: list-3;
+}
+.ql-editor ol li.ql-indent-3:before {
+  content: counter(list-3, decimal) '. ';
+}
+.ql-editor ol li.ql-indent-3 {
+  counter-reset: list-4 list-5 list-6 list-7 list-8 list-9;
+}
+.ql-editor ol li.ql-indent-4 {
+  counter-increment: list-4;
+}
+.ql-editor ol li.ql-indent-4:before {
+  content: counter(list-4, lower-alpha) '. ';
+}
+.ql-editor ol li.ql-indent-4 {
+  counter-reset: list-5 list-6 list-7 list-8 list-9;
+}
+.ql-editor ol li.ql-indent-5 {
+  counter-increment: list-5;
+}
+.ql-editor ol li.ql-indent-5:before {
+  content: counter(list-5, lower-roman) '. ';
+}
+.ql-editor ol li.ql-indent-5 {
+  counter-reset: list-6 list-7 list-8 list-9;
+}
+.ql-editor ol li.ql-indent-6 {
+  counter-increment: list-6;
+}
+.ql-editor ol li.ql-indent-6:before {
+  content: counter(list-6, decimal) '. ';
+}
+.ql-editor ol li.ql-indent-6 {
+  counter-reset: list-7 list-8 list-9;
+}
+.ql-editor ol li.ql-indent-7 {
+  counter-increment: list-7;
+}
+.ql-editor ol li.ql-indent-7:before {
+  content: counter(list-7, lower-alpha) '. ';
+}
+.ql-editor ol li.ql-indent-7 {
+  counter-reset: list-8 list-9;
+}
+.ql-editor ol li.ql-indent-8 {
+  counter-increment: list-8;
+}
+.ql-editor ol li.ql-indent-8:before {
+  content: counter(list-8, lower-roman) '. ';
+}
+.ql-editor ol li.ql-indent-8 {
+  counter-reset: list-9;
+}
+.ql-editor ol li.ql-indent-9 {
+  counter-increment: list-9;
+}
+.ql-editor ol li.ql-indent-9:before {
+  content: counter(list-9, decimal) '. ';
+}
+.ql-editor .ql-indent-1:not(.ql-direction-rtl) {
+  padding-left: 3em;
+}
+.ql-editor li.ql-indent-1:not(.ql-direction-rtl) {
+  padding-left: 4.5em;
+}
+.ql-editor .ql-indent-1.ql-direction-rtl.ql-align-right {
+  padding-right: 3em;
+}
+.ql-editor li.ql-indent-1.ql-direction-rtl.ql-align-right {
+  padding-right: 4.5em;
+}
+.ql-editor .ql-indent-2:not(.ql-direction-rtl) {
+  padding-left: 6em;
+}
+.ql-editor li.ql-indent-2:not(.ql-direction-rtl) {
+  padding-left: 7.5em;
+}
+.ql-editor .ql-indent-2.ql-direction-rtl.ql-align-right {
+  padding-right: 6em;
+}
+.ql-editor li.ql-indent-2.ql-direction-rtl.ql-align-right {
+  padding-right: 7.5em;
+}
+.ql-editor .ql-indent-3:not(.ql-direction-rtl) {
+  padding-left: 9em;
+}
+.ql-editor li.ql-indent-3:not(.ql-direction-rtl) {
+  padding-left: 10.5em;
+}
+.ql-editor .ql-indent-3.ql-direction-rtl.ql-align-right {
+  padding-right: 9em;
+}
+.ql-editor li.ql-indent-3.ql-direction-rtl.ql-align-right {
+  padding-right: 10.5em;
+}
+.ql-editor .ql-indent-4:not(.ql-direction-rtl) {
+  padding-left: 12em;
+}
+.ql-editor li.ql-indent-4:not(.ql-direction-rtl) {
+  padding-left: 13.5em;
+}
+.ql-editor .ql-indent-4.ql-direction-rtl.ql-align-right {
+  padding-right: 12em;
+}
+.ql-editor li.ql-indent-4.ql-direction-rtl.ql-align-right {
+  padding-right: 13.5em;
+}
+.ql-editor .ql-indent-5:not(.ql-direction-rtl) {
+  padding-left: 15em;
+}
+.ql-editor li.ql-indent-5:not(.ql-direction-rtl) {
+  padding-left: 16.5em;
+}
+.ql-editor .ql-indent-5.ql-direction-rtl.ql-align-right {
+  padding-right: 15em;
+}
+.ql-editor li.ql-indent-5.ql-direction-rtl.ql-align-right {
+  padding-right: 16.5em;
+}
+.ql-editor .ql-indent-6:not(.ql-direction-rtl) {
+  padding-left: 18em;
+}
+.ql-editor li.ql-indent-6:not(.ql-direction-rtl) {
+  padding-left: 19.5em;
+}
+.ql-editor .ql-indent-6.ql-direction-rtl.ql-align-right {
+  padding-right: 18em;
+}
+.ql-editor li.ql-indent-6.ql-direction-rtl.ql-align-right {
+  padding-right: 19.5em;
+}
+.ql-editor .ql-indent-7:not(.ql-direction-rtl) {
+  padding-left: 21em;
+}
+.ql-editor li.ql-indent-7:not(.ql-direction-rtl) {
+  padding-left: 22.5em;
+}
+.ql-editor .ql-indent-7.ql-direction-rtl.ql-align-right {
+  padding-right: 21em;
+}
+.ql-editor li.ql-indent-7.ql-direction-rtl.ql-align-right {
+  padding-right: 22.5em;
+}
+.ql-editor .ql-indent-8:not(.ql-direction-rtl) {
+  padding-left: 24em;
+}
+.ql-editor li.ql-indent-8:not(.ql-direction-rtl) {
+  padding-left: 25.5em;
+}
+.ql-editor .ql-indent-8.ql-direction-rtl.ql-align-right {
+  padding-right: 24em;
+}
+.ql-editor li.ql-indent-8.ql-direction-rtl.ql-align-right {
+  padding-right: 25.5em;
+}
+.ql-editor .ql-indent-9:not(.ql-direction-rtl) {
+  padding-left: 27em;
+}
+.ql-editor li.ql-indent-9:not(.ql-direction-rtl) {
+  padding-left: 28.5em;
+}
+.ql-editor .ql-indent-9.ql-direction-rtl.ql-align-right {
+  padding-right: 27em;
+}
+.ql-editor li.ql-indent-9.ql-direction-rtl.ql-align-right {
+  padding-right: 28.5em;
+}
+.ql-editor .ql-video {
+  display: block;
+  max-width: 100%;
+}
+.ql-editor .ql-video.ql-align-center {
+  margin: 0 auto;
+}
+.ql-editor .ql-video.ql-align-right {
+  margin: 0 0 0 auto;
+}
+.ql-editor .ql-bg-black {
+  background-color: #000;
+}
+.ql-editor .ql-bg-red {
+  background-color: #e60000;
+}
+.ql-editor .ql-bg-orange {
+  background-color: #f90;
+}
+.ql-editor .ql-bg-yellow {
+  background-color: #ff0;
+}
+.ql-editor .ql-bg-green {
+  background-color: #008a00;
+}
+.ql-editor .ql-bg-blue {
+  background-color: #06c;
+}
+.ql-editor .ql-bg-purple {
+  background-color: #93f;
+}
+.ql-editor .ql-color-white {
+  color: #fff;
+}
+.ql-editor .ql-color-red {
+  color: #e60000;
+}
+.ql-editor .ql-color-orange {
+  color: #f90;
+}
+.ql-editor .ql-color-yellow {
+  color: #ff0;
+}
+.ql-editor .ql-color-green {
+  color: #008a00;
+}
+.ql-editor .ql-color-blue {
+  color: #06c;
+}
+.ql-editor .ql-color-purple {
+  color: #93f;
+}
+.ql-editor .ql-font-serif {
+  font-family: Georgia, Times New Roman, serif;
+}
+.ql-editor .ql-font-monospace {
+  font-family: Monaco, Courier New, monospace;
+}
+.ql-editor .ql-size-small {
+  font-size: 0.75em;
+}
+.ql-editor .ql-size-large {
+  font-size: 1.5em;
+}
+.ql-editor img{
+  width: 300rpx;
+}
+.ql-editor .ql-size-huge {
+  font-size: 2.5em;
+}
+.ql-editor .ql-direction-rtl {
+  direction: rtl;
+  text-align: inherit;
+}
+.ql-editor .ql-align-center {
+  text-align: center;
+}
+.ql-editor .ql-align-justify {
+  text-align: justify;
+}
+.ql-editor .ql-align-right {
+  text-align: right;
+}
+.ql-editor.ql-blank::before {
+  color: rgba(0,0,0,0.6);
+  content: attr(data-placeholder);
+  font-style: italic;
+  left: 15px;
+  pointer-events: none;
+  position: absolute;
+  right: 15px;
+}

+ 163 - 88
pages2/appointment/order.vue

@@ -63,20 +63,22 @@
       </view>
       <!-- 考试疫情承诺书 -->
       <view v-if="reportStatus == 1" class="appointmentItem">
-        <view class="title"><text class="star_red">*</text>考试疫情防控承诺书</view>
+        <view class="title"
+          ><text class="star_red">*</text>考试疫情防控承诺书</view
+        >
         <view class="commitment">
-          本人参加“住房和城乡建设领域施工现场专业人员岗位”考试,愿意遵守疫情防控各项管理的相关要求,秉承对自己、对他人负责的原则,承担疫情防控社会责任,郑重作出以下承诺:<br/>
-          一、充分理解并遵守考试期间考点各项防疫安全的要求。<br/>
-          二、在考试前14天内,没有到过国内疫情中风险、高风险地区,未出境,不存在自境外回国情形。<br/>
-          三、在考试前14天内,每日自觉监测体温,体温均未出现高于37.3度的情形,无发热和呼吸道门诊就诊史。<br/>
-          四、在考试前14天内,未和新冠肺炎病例或疑似病例密切接触或间接接触,没有发烧、干咳、乏力、咳痰、气短、肌肉痛或关节痛、咽喉痛、头痛、寒颤、恶心或呕吐、鼻塞、腹泻、咳血、结膜充血等疑似新冠肺炎症状。<br/>
-          五、如出现与前述第二、三、四项任何一项不符的情形之一的,本人将及时在考前向相关管理机构报告,自觉配合采取隔离或其他防疫措施,并根据情况,自愿放弃参加考试。<br/>
-          六、考试当日自行做好防护工作,佩戴防护口罩。提前抵达考点,配合查验健康码、测量体温等。<br/>
-          七、考试期间,将严格遵守应考人员考场守则及疫情防控相关管理要求,完成考试后立即离场,不扎堆,不聚集。<br/>
+          本人参加“住房和城乡建设领域施工现场专业人员岗位”考试,愿意遵守疫情防控各项管理的相关要求,秉承对自己、对他人负责的原则,承担疫情防控社会责任,郑重作出以下承诺:<br />
+          一、充分理解并遵守考试期间考点各项防疫安全的要求。<br />
+          二、在考试前14天内,没有到过国内疫情中风险、高风险地区,未出境,不存在自境外回国情形。<br />
+          三、在考试前14天内,每日自觉监测体温,体温均未出现高于37.3度的情形,无发热和呼吸道门诊就诊史。<br />
+          四、在考试前14天内,未和新冠肺炎病例或疑似病例密切接触或间接接触,没有发烧、干咳、乏力、咳痰、气短、肌肉痛或关节痛、咽喉痛、头痛、寒颤、恶心或呕吐、鼻塞、腹泻、咳血、结膜充血等疑似新冠肺炎症状。<br />
+          五、如出现与前述第二、三、四项任何一项不符的情形之一的,本人将及时在考前向相关管理机构报告,自觉配合采取隔离或其他防疫措施,并根据情况,自愿放弃参加考试。<br />
+          六、考试当日自行做好防护工作,佩戴防护口罩。提前抵达考点,配合查验健康码、测量体温等。<br />
+          七、考试期间,将严格遵守应考人员考场守则及疫情防控相关管理要求,完成考试后立即离场,不扎堆,不聚集。<br />
           八、本人承诺遵守《应考人员安全承诺书》中所有承诺内容,若因有瞒报、谎报造成新冠肺炎疫情传播的,一经查实,由本人承担相应的法律和经济责任。
         </view>
       </view>
-      <view v-if="reportStatus == 1" class="appointmentItem ">
+      <view v-if="reportStatus == 1" class="appointmentItem">
         <view class="title"><text class="star_red">*</text>签名板</view>
         <view class="dis_stys">
           <text style="color: #999999">请在下方签名区进行签名</text>
@@ -142,6 +144,39 @@
         <view class="btn" @click="sureAddress">确认</view>
       </view>
     </u-popup>
+    <u-modal v-model="showSuccessTip" width="560" @confirm="confirmTip">
+      <view class="slot-content">
+        <view class="modal_centent">
+          <view>
+            <text>考试时间:</text
+            ><text v-if="activeList.length">{{
+              activeList[0].dataTime +
+              " " +
+              activeList[0].startTime +
+              " ~ " +
+              activeList[0].endTime
+            }}</text>
+          </view>
+          <view>
+            <text>考试地址:</text><text>{{ addressName }}</text>
+          </view>
+          <view> <text>考试时间:</text><text>2小时 </text> </view>
+          <view> <text>考试形式:</text><text>机考</text> </view>
+          <view>
+            <text>考试成绩:</text>
+            <text>提交试卷后即刻显示成绩,60 分以上合格。</text>
+          </view>
+          <view>
+            <text style="width: 194rpx">学校咨询电话:</text
+            ><text>{{ userInfo && userInfo.eduPhone }}</text>
+          </view>
+        </view>
+        <view class="modal_tip">
+          注意事项:考试当天请学员携带本人身份证提前 30
+          分钟到达考场,迟到将不得进入考场,并被认定为缺考处理。
+        </view>
+      </view>
+    </u-modal>
   </view>
 </template>
 
@@ -162,15 +197,16 @@ export default {
       applyStatus: null, //学员状态ID
       sysTime: 0,
       dataId: null, //跳转拷贝
-      handwriting: '',
+      handwriting: "",
       lineColor: "black",
       slideValue: 30,
       openVerify: false, // 控制是否手动验证
-      commitment_electr_signature: '',
+      commitment_electr_signature: "",
       isUploading: false,
-      siteId: '', // 考场id
+      siteId: "", // 考场id
       reportStatus: 0, // 是否线上签署疫情防控承诺书, 1是,0否
-      baseAddress: '', // 签名转成base64
+      baseAddress: "", // 签名转成base64
+      showSuccessTip: false,
     };
   },
   async onLoad(option) {
@@ -179,7 +215,7 @@ export default {
     this.applyStatus = Number(option.applyStatus);
     this.dataId = Number(option.dataId);
     this.orderGoodsId = Number(option.orderGoodsId);
-    this.reportStatus = option.reportStatus
+    this.reportStatus = option.reportStatus;
     await this.commonSystemTime();
     this.getInfo();
   },
@@ -212,7 +248,7 @@ export default {
               item.checked = false;
             });
             this.listData = res.data.data;
-            console.log('this.listData:', this.listData)
+            console.log("this.listData:", this.listData);
           }
         });
     },
@@ -220,7 +256,7 @@ export default {
       this.address_show = true;
     },
     choAddress(item, index) {
-      this.siteId = item.siteId
+      this.siteId = item.siteId;
       this.listData.forEach((item, idx) => {
         this.$set(item, "checked", false);
         if (idx === index) {
@@ -238,14 +274,14 @@ export default {
         });
         return;
       }
-      this.siteId = this.listData[index].siteId
-      console.log('siteId: ', this.siteId, index)
+      this.siteId = this.listData[index].siteId;
+      console.log("siteId: ", this.siteId, index);
       if (this.addressId === this.listData[index].id) {
         this.address_show = false;
         return;
       }
       this.addressName = this.listData[index].siteAddress;
-      console.log('addressName', this.addressName, this.listData)
+      console.log("addressName", this.addressName, this.listData);
       this.addressId = this.listData[index].id;
       var arrays = [];
       this.listData[index].examUserApplySiteTime.forEach((item) => {
@@ -271,7 +307,7 @@ export default {
           });
         });
       });
-      console.log('arrays', arrays)
+      console.log("arrays", arrays);
       this.activeList = arrays.filter((item, index) => {
         console.log(item);
         // const newTime = parseInt(new Date().getTime() / 1000)
@@ -290,7 +326,7 @@ export default {
         }
       });
 
-      console.log('----',this.activeList);
+      console.log("----", this.activeList);
       this.address_show = false;
     },
     choItem(index) {
@@ -309,82 +345,80 @@ export default {
       if (this.isUploading) {
         return;
       }
-      this.isUploading = true
+      this.isUploading = true;
 
       var self = this;
       if (self.addressId) {
         var ast = self.activeList.some((item) => {
           return item.checked === true;
         });
-        console.log('ast',this.activeList, ast)
+        console.log("ast", this.activeList, ast);
         if (ast) {
           if (this.reportStatus == 1) {
-            await this.subCanvas()
+            await this.subCanvas();
             if (!this.commitment_electr_signature) {
               uni.showToast({
                 title: "请签名",
                 icon: "none",
-              })
-              this.isUploading = false
-              return
+              });
+              this.isUploading = false;
+              return;
             } else {
               // await this.submitApi()
-                uni.getFileSystemManager().readFile({
-                  filePath: this.commitment_electr_signature, //临时路径
-                  encoding: 'base64', //编码格式
-                  success: res => {
-                    console.log('返回结果', res)
-                    const base64 = "data:image/png;base64," + res.data
-                    console.log('sfs签名转成base64', base64)
-                    this.baseAddress = base64
-                    // return
-                    this.submits()
-                  },
-                  fail: err => {
-                    console.log('转base64错误', err)
-                    this.isUploading = false
-                  }
-                })
-                // uni.request({
-                //   url: this.commitment_electr_signature, //临时路径
-                //   responseType: 'arraybuffer', //设置返回的数据格式为arraybuffer
-                //   success: res => {
-                //     const base64 = "data:image/png;base64," + uni.arrayBufferToBase64(res.data)
-                //     console.log('sfs签名转成base64', base64)
-                //     this.baseAddress = base64
-                //     this.submits()
-                //   },
-                //   fail: err => {
-                //     console.log('转base64错误', err)
-                //     this.isUploading = false
-                //   }
-                // })
+              uni.getFileSystemManager().readFile({
+                filePath: this.commitment_electr_signature, //临时路径
+                encoding: "base64", //编码格式
+                success: (res) => {
+                  console.log("返回结果", res);
+                  const base64 = "data:image/png;base64," + res.data;
+                  console.log("sfs签名转成base64", base64);
+                  this.baseAddress = base64;
+                  // return
+                  this.submits();
+                },
+                fail: (err) => {
+                  console.log("转base64错误", err);
+                  this.isUploading = false;
+                },
+              });
+              // uni.request({
+              //   url: this.commitment_electr_signature, //临时路径
+              //   responseType: 'arraybuffer', //设置返回的数据格式为arraybuffer
+              //   success: res => {
+              //     const base64 = "data:image/png;base64," + uni.arrayBufferToBase64(res.data)
+              //     console.log('sfs签名转成base64', base64)
+              //     this.baseAddress = base64
+              //     this.submits()
+              //   },
+              //   fail: err => {
+              //     console.log('转base64错误', err)
+              //     this.isUploading = false
+              //   }
+              // })
             }
           } else {
-            this.submits()
+            this.submits();
           }
-          
-          
         } else {
           uni.showToast({
             title: "请选择考试时间",
             icon: "none",
           });
-          this.isUploading = false
+          this.isUploading = false;
         }
       } else {
         uni.showToast({
           title: "请选择考试地点",
           icon: "none",
         });
-        this.isUploading = false
+        this.isUploading = false;
       }
     },
     submits() {
       uni.showLoading({
-        title: '拼命加载中...',
-        mask:true,
-      })
+        title: "拼命加载中...",
+        mask: true,
+      });
       var copyData = JSON.parse(JSON.stringify(this.activeList));
       const index = copyData.findIndex((item) => item.checked);
       var data = {
@@ -397,12 +431,11 @@ export default {
         applySiteEndTime: copyData[index].endTimeC,
         orderGoodsId: this.orderGoodsId,
         siteId: this.siteId, // 考场id
-        
       };
       if (this.reportStatus == 1) {
-        data.signImageStr = this.baseAddress
+        data.signImageStr = this.baseAddress;
       }
-      console.log('-----data', data, this.dataId)
+      console.log("-----data", data, this.dataId);
       // return
       if (this.dataId === 1) {
         this.$store.commit("updateApplyData", data);
@@ -412,24 +445,28 @@ export default {
           goodsId: this.goodsId,
           orderGoodsId: this.orderGoodsId,
         });
-        uni.hideLoading()
+        uni.hideLoading();
       }
       if (this.dataId === 2) {
         this.$api.addApply(data).then((res) => {
           if (res.data.code === 200) {
-            uni.reLaunch({
-              url: `/pages2/appointment/appointment_success?subscribeId=${res.data.data}`,
-            });
+            // uni.reLaunch({
+            //   url: `/pages2/appointment/appointment_success?subscribeId=${res.data.data}`,
+            // });
+            this.$u.toast("预约成功");
+            setTimeout(() => {
+              this.showSuccessTip = true;
+            }, 500);
           } else {
             uni.showToast({
               icon: "none",
-              title: res.data.msg || '预约失败,请重新预约',
+              title: res.data.msg || "预约失败,请重新预约",
             });
           }
-          uni.hideLoading()
+          uni.hideLoading();
         });
       }
-      this.isUploading = false
+      this.isUploading = false;
     },
     backPage() {
       uni.navigateBack({
@@ -437,8 +474,8 @@ export default {
       });
     },
     retDraw() {
-      this.handwriting.retDraw()
-      this.commitment_electr_signature = ''
+      this.handwriting.retDraw();
+      this.commitment_electr_signature = "";
       // this.$set(this.form, "commitment_electr_signature", "");
       this.openVerify = false;
     },
@@ -458,23 +495,32 @@ export default {
           resolve();
           return;
         }
-        this.handwriting.saveCanvas().then((res) => {
+        this.handwriting
+          .saveCanvas()
+          .then((res) => {
             if (this.handwriting.linePrack.length) {
-              console.log('签名-----res', res)
-              this.commitment_electr_signature = res
+              console.log("签名-----res", res);
+              this.commitment_electr_signature = res;
             }
-            resolve(res)
+            resolve(res);
           })
           .catch((err) => {
             uni.showToast({
               title: "签名上传失败",
               icon: "error",
             });
-            this.isUploading = false
+            this.isUploading = false;
           });
-          
       });
     },
+    confirmTip() {
+      uni.switchTab({
+        url: "/pages/learn/index",
+      });
+    },
+  },
+  computed: {
+    ...mapGetters(["userInfo"]),
   },
 };
 </script>
@@ -488,9 +534,35 @@ page {
 }
 </style>
 <style scoped lang="scss">
-  .safeAreas {
-    padding-bottom: 30rpx;
+.slot-content {
+  padding: 30rpx;
+  .modal_centent {
+    view {
+      display: flex;
+      margin: 20rpx 0;
+      text {
+        &:nth-of-type(1) {
+          width: 140rpx;
+          color: #606266;
+          font-size: 28rpx;
+        }
+        &:nth-of-type(2) {
+          flex: 1;
+          color: #909399;
+          font-size: 26rpx;
+        }
+      }
+    }
+  }
+  .modal_tip {
+    margin-top: 30rpx;
+    font-size: 28rpx;
+    color: red;
   }
+}
+.safeAreas {
+  padding-bottom: 30rpx;
+}
 .appointment {
   padding: 0 8rpx;
   .appointmentItem {
@@ -522,7 +594,9 @@ page {
       background: #ffffff;
       overflow-y: auto;
     }
-    .handCenter, .dis_stys, .commitment {
+    .handCenter,
+    .dis_stys,
+    .commitment {
       margin: 0rpx 24rpx;
     }
     .dis_stys {
@@ -532,7 +606,8 @@ page {
       margin-bottom: 16rpx;
     }
     .handCenter {
-      .handWriting, .no_true {
+      .handWriting,
+      .no_true {
         width: 100%;
         height: 400rpx;
         background: #fff;