Преглед изворни кода

Merge branch 'dev' into x_l_remak

谢杰标 пре 2 година
родитељ
комит
b1203c2f4f

+ 1 - 2
common/api.js

@@ -22,7 +22,6 @@ import exam from './httpList/exam.js'
 import profileStamp from './httpList/profileStamp.js'
 import lock from './httpList/lock.js'
 import mock from './httpList/mock.js'
-
 export default {
 	...mock,
 	...login,
@@ -47,5 +46,5 @@ export default {
 	...note,
 	...exam,
 	...profileStamp,
-	...lock
+	...lock,
 }

+ 1 - 1
common/compressPhoto.js

@@ -76,12 +76,12 @@ function myCompressImage(url, limitSize = 2048) {
       // #endif
     }
     const size = url.size;
-    console.log(size, "压缩前");
     if (size < limitSize) {
       return _resolve(url);
     }
     num++;
     const quality = limitSize / size;
+    console.log(size, quality, "压缩前");
     // #ifdef MP-WEIXIN
     getLessLimitSizeImage(url.path, quality);
     // #endif

+ 9 - 0
common/config.js

@@ -12,6 +12,7 @@ const index = 0; // 测试环境
 // const index = 3 // 勘设云学堂
 // const index = 4 // 中正云学堂
 // const index = 5 // 山西云学堂
+// const index = 6 // 预发布
 const set = [
   test,
   // 祥粤云学堂
@@ -54,6 +55,14 @@ const set = [
     appid: "wx5872ef563d13dabf",
     tenantName: "山西云学堂",
   },
+  {
+    BASE_URL: "https://test.xyyxt.net",
+    BASE_IMG_URL: "https://file.xyyxt.net/",
+    domain: "h.xyyxt.net",
+    tenantId: "867735392558919680", //详粤云学堂
+    appid: "wxd3c8ae80cf43a305",
+    tenantName: "祥粤云学堂",
+  },
 ];
 export default set[index];
 // #ifdef H5

+ 21 - 18
common/httpList/exam.js

@@ -1,19 +1,22 @@
-import {
-	myRequest
-} from '../request.js'
+import { myRequest } from "../request.js";
 export default {
-
-	getExamDetail(data) {
-		return myRequest({
-			url: '/bank/exam/'+data,
-			method: 'get',
-		})
-	},
-	getExamLearnStatus(data) {
-		return myRequest({
-		  url: '/bank/record/check/bank/record',
-		  data,
-		  method: 'GET',
-		})
-	  },
-}
+  getExamDetail(data) {
+    return myRequest({
+      url: "/bank/exam/" + data,
+      method: "get",
+    });
+  },
+  getExamLearnStatus(data) {
+    return myRequest({
+      url: "/bank/record/check/bank/record",
+      data,
+      method: "GET",
+    });
+  },
+  getExamTip() {
+    return myRequest({
+      url: "/apply/before/know",
+      method: "GET",
+    });
+  },
+};

+ 24 - 0
common/httpList/goods.js

@@ -512,4 +512,28 @@ export default {
       data: data,
     });
   },
+  // 山东题库列表
+  sdQuestionList(data) {
+    return myRequest({
+      url: "/course/special/question/list",
+      method: "get",
+      data: data,
+    });
+  },
+  // 查询用户是否有山东题库
+  getIsHaveOtherQuetion(data) {
+    return myRequest({
+      url: "/course/special/question/count",
+      method: "get",
+      data: data,
+    });
+  },
+  // 获取三方题库试卷ID
+  getOtherExamId(data) {
+    return myRequest({
+      url: "/goods/rel/exam",
+      method: "post",
+      data: data,
+    });
+  },
 };

+ 0 - 5
common/httpList/order.js

@@ -124,9 +124,4 @@ export default {
 			data: data
 		})
 	}
-	
-	
-	
-
-
 }

+ 74 - 41
common/httpList/wxpay.js

@@ -1,42 +1,75 @@
-import {
-	myRequest
-} from '../request.js'
+import { myRequest } from "../request.js";
 export default {
-	//获取支付回调凭证
-	wxCallback(data) {
-		return myRequest({
-			url: '/wx/pay/callback',
-			method: 'post',
-			data: data
-		})
-	},
-	//获取支付凭证
-	wxPayment(data) {
-		return myRequest({
-			url: '/wx/pay/payment',
-			method: 'post',
-			data: data
-		})
-	},
-	wxOpenid(data) {
-		return myRequest({
-			url: '/wx/getOpenid',
-			method: 'post',
-			data: data
-		})
-	},
-	checkBindGzh(data) {
-		return myRequest({
-			url: '/app/user/checkBindGzh',
-			method: 'get',
-			data: data
-		})
-	},
-	OfficialLogin(data) {
-		return myRequest({
-			url: '/app/user/gzh_bind',
-			method: 'post',
-			data: data
-		})
-	},
-}
+  //获取支付回调凭证
+  wxCallback(data) {
+    return myRequest({
+      url: "/wx/pay/callback",
+      method: "post",
+      data: data,
+    });
+  },
+  //获取支付凭证
+  wxPayment(data) {
+    return myRequest({
+      url: "/wx/pay/payment",
+      method: "post",
+      data: data,
+    });
+  },
+  wxOpenid(data) {
+    return myRequest({
+      url: "/wx/getOpenid",
+      method: "post",
+      data: data,
+    });
+  },
+  checkBindGzh(data) {
+    return myRequest({
+      url: "/app/user/checkBindGzh",
+      method: "get",
+      data: data,
+    });
+  },
+  OfficialLogin(data) {
+    return myRequest({
+      url: "/app/user/gzh_bind",
+      method: "post",
+      data: data,
+    });
+  },
+  // 获取公众号openid
+  getH5Openid(data) {
+    return myRequest({
+      url: "/app/common/wx/gzh_bind",
+      method: "post",
+      noToken: true,
+      data: data,
+    });
+  },
+  // 获取小程序openid
+  getWxOpenid(data) {
+    return myRequest({
+      url: "/app/common/wx/exam/getOpenid",
+      method: "post",
+      noToken: true,
+      data: data,
+    });
+  },
+  // 检查账号是否绑定该openid
+  checkBindOpenId(data) {
+    return myRequest({
+      url: "/app/user/checkBindOpenId",
+      method: "post",
+      data: data,
+    });
+  },
+  // 小程序openId登录
+  openIdLogin(data) {
+    return myRequest({
+      url: "/app/common/openIdLogin",
+      method: "post",
+      noToken: true,
+      data: data,
+    });
+  },
+};

+ 0 - 31
common/methodTool.js

@@ -519,10 +519,7 @@ export default {
     let rightQuestionIds = []; //做对的题目id
     let totalQuestionNum = 0; //排除主观题的总条数(简单题)
     data.forEach((item) => {
-      console.log("答案--", item.ans, "选择--", item.ques);
-
       totalScore += item.score * (item.type == 4 ? item.jsonStr.length : 1);
-
       if (
         item.type < 4 ||
         (item.type == 4 && !item.jsonStr.some((e) => e.type == 5))
@@ -764,32 +761,4 @@ export default {
         });
     });
   },
-  examClientCanLearn(examLimitClient) {
-    // 限制学习
-    if (!examLimitClient) {
-      return true;
-    }
-    // #ifdef MP-WEIXIN
-    if (examLimitClient.includes("2")) {
-      return true;
-    }
-    // #endif
-    // #ifdef H5
-    if (examLimitClient.includes("1") && this.isWeixin()) {
-      return true;
-    }
-    // #endif
-    uni.showModal({
-      title: "提示",
-      showCancel: false,
-      content:
-        "请去" + (examLimitClient == 2 ? "微信小程序" : "公众号") + "学习",
-      success: (k) => {
-        if (k.confirm) {
-          uni.navigateBack();
-        }
-      },
-    });
-    return false;
-  },
 };

+ 1 - 1
common/request.js

@@ -109,7 +109,7 @@ export const myRequest = (options) => {
       },
       complete: () => {
         // uni.hideLoading()
-        //		uni.hideToast()
+        // uni.hideToast()
       },
     });
   });

+ 177 - 0
components/common/selectGradeBox.vue

@@ -0,0 +1,177 @@
+<template>
+  <view>
+    <u-popup v-model="isShow" @close="close" mode="bottom" border-radius="40">
+      <view class="popup_box">
+        <view class="check_head">
+          <view class="grade">选择班级</view>
+          <u-icon
+            name="close"
+            color="#CFCFCF"
+            size="30"
+            @click="close"
+          ></u-icon>
+        </view>
+        <view class="check_con">
+          <scroll-view scroll-y="true" style="height: 580rpx">
+            <view>
+              <u-radio-group v-model="gradeValue">
+                <view
+                  v-for="(item, index) in gradeList"
+                  :key="index"
+                  class="items_c"
+                >
+                  <view class="border_c">
+                    <view>
+                      <u-radio
+                        shape="circle"
+                        active-color="#FC3F3F"
+                        :name="index"
+                        :disabled="
+                          item.studentNum > 0 &&
+                          item.studentNum == item.studentUpper
+                        "
+                      >
+                        <view
+                          :class="
+                            index == gradeValue
+                              ? 'white-box blue-box'
+                              : 'white-box'
+                          "
+                        >
+                          <view>
+                            <view class="blackTxt">{{ item.className }}</view>
+                            <Class-time-tip :classInfo="item"></Class-time-tip>
+                          </view>
+                        </view>
+                      </u-radio>
+                    </view>
+                  </view>
+                </view>
+              </u-radio-group>
+            </view>
+          </scroll-view>
+        </view>
+        <view class="confrim-btn">
+          <view class="okBtn" @click="okPopup()">确定</view>
+        </view>
+      </view>
+    </u-popup>
+  </view>
+</template>
+
+<script>
+import ClassTimeTip from "@/components/common/ClassTimeTip.vue";
+export default {
+  name: "SaasMiniprogramSelectGradeBox",
+  data() {
+    return {
+      gradeValue: 0,
+      gradeList: [],
+      isShow: false,
+    };
+  },
+
+  mounted() {},
+
+  methods: {
+    goodsGradeList(id) {
+      return this.$api.goodsGradeList({ goodsId: id }).then((res) => {
+        let { code, rows } = res.data;
+        if (code == 200) {
+          if (rows.length == 0) {
+            let item = {
+              className: "系统分班",
+              gradeId: 0,
+            };
+            rows.push(item);
+          } else {
+            let isGradeFull = rows.every(
+              (item) =>
+                item.studentNum > 0 && item.studentNum == item.studentUpper
+            );
+            //所有班级都满了
+            if (isGradeFull) {
+              let item = {
+                className: "系统分班",
+                gradeId: 0,
+              };
+              rows.unshift(item);
+            }
+          }
+          return Promise.resolve(rows);
+        }
+      });
+    },
+    async open(data, selectGradeId) {
+      console.log(data, selectGradeId, "data, selectGradeId");
+      this.isShow = true;
+      this.gradeValue = 0;
+      if (Array.isArray(data)) {
+        this.gradeList = data;
+      } else {
+        this.gradeList = await this.goodsGradeList(data);
+      }
+      if (selectGradeId) {
+        this.gradeValue = this.gradeList.findIndex(
+          (e) => e.gradeId == selectGradeId
+        );
+      }
+      console.log(this.gradeValue, "this.gradeValue");
+    },
+    okPopup() {
+      this.isShow = false;
+      this.$emit("submit", this.gradeList[this.gradeValue]);
+    },
+    close() {
+      this.isShow = false;
+      console.log(this.isShow, "this.isShow");
+      //   this.$emit("close");
+    },
+  },
+  components: { ClassTimeTip },
+};
+</script>
+
+<style lang="scss" scoped>
+.popup_box {
+  height: 824rpx;
+  box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(145, 156, 178, 0.1);
+  border-radius: 28rpx 28rpx 0rpx 0rpx;
+  .check_head {
+    padding: 0rpx 32rpx;
+    display: flex;
+    align-items: center;
+    justify-content: space-between;
+    height: 104rpx;
+    background: #f2f2f2;
+  }
+  .items_c {
+    padding: 0rpx 32rpx;
+  }
+  .border_c {
+    display: flex;
+    align-items: center;
+    padding: 20rpx 0rpx;
+    border-bottom: 1rpx solid #f2f2f2;
+  }
+  .okBtn {
+    width: 232rpx;
+    height: 92rpx;
+    line-height: 92rpx;
+    background: #fc3f3f;
+    border-radius: 120rpx;
+    color: #ffffff;
+    text-align: center;
+    font-size: 32rpx;
+    font-weight: 500;
+  }
+  .confrim-btn {
+    // border-top:1px solid #eee;
+    height: 98rpx;
+    width: 100%;
+    display: flex;
+    align-items: center;
+    justify-content: center;
+  }
+}
+</style>

+ 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
+};

+ 11 - 0
pages.json

@@ -546,6 +546,17 @@
             }
           }
         },
+        {
+          "path": "verify/info_fill",
+          "style": {
+            "navigationBarTitleText": "填写资料",
+            "navigationStyle": "custom", // 隐藏系统导航栏
+            "app-plus": {
+              "titleNView": false, //禁用原生导航栏
+              "bounce": "none"
+            }
+          }
+        },
         {
           "path": "appointment/index",
           "style": {

+ 6 - 6
pages/course/index.vue

@@ -523,12 +523,12 @@ export default {
     },
     active2(item) {
       // console.log('item', item)
-      if (item.topicId) {
-        uni.navigateTo({
-          url: "/pages4/courseTopic/goodsTopic?topicId=" + item.topicId,
-        });
-        return;
-      }
+      // if (item.topicId) {
+      //   uni.navigateTo({
+      //     url: "/pages4/courseTopic/goodsTopic?topicId=" + item.topicId,
+      //   });
+      //   return;
+      // }
 
       this.selObj.bId = item.id;
       this.show = false;

+ 130 - 47
pages/learn/index.vue

@@ -358,6 +358,13 @@
             </view>
             <!-- 按钮 -->
             <view class="study_btns">
+              <view
+                v-if="item.userProfile == 1"
+                class="box_appoint"
+                @click="toInput(item)"
+              >
+                <view class="exam_word intos">学习资料</view>
+              </view>
               <template
                 v-if="
                   item.gradeStatus == 1 &&
@@ -377,27 +384,22 @@
                   选班重学
                 </view>
               </template>
-              <!-- examApplyGoodsList.length -是判断是否关联指定学员 -->
               <view v-else class="exam_btns">
                 <view
                   class="box_appoint"
-                  v-if="
-                    item.applyStatus === 1 &&
-                    !(
-                      sysTime <= item.serviceStartTime ||
-                      sysTime >= item.serviceEndTime ||
-                      (item.classStartTime && sysTime <= item.classStartTime) ||
-                      (item.classEndTime && sysTime >= item.classEndTime) ||
-                      item.learningStatus == 2 ||
-                      item.classStatus == 0 ||
-                      (item.learningStatus == 3 &&
-                        sysTime < item.learningTimeStart) ||
-                      !item.examApplyGoodsList.length
-                    )
-                  "
-                  @click="appointment(item, appoint)"
+                  v-if="item.openQuestion === 1"
+                  @click="toBuyQuestionBank(item)"
                 >
-                  <view class="exam_word ones">预约考试</view>
+                  <view class="exam_word ones">购买题库</view>
+                </view>
+                <view
+                  class="box_appoint"
+                  v-if="item.examApplyGoodsList"
+                  @click="appointment(item)"
+                >
+                  <view class="exam_word ones">{{
+                    item.subscribeSign == 4 ? "预约记录" : "预约考试"
+                  }}</view>
                 </view>
                 <view
                   class="box_appoint"
@@ -554,7 +556,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"
@@ -572,18 +574,36 @@
             >
               <view class="course_lefts">
                 <view class="course_title">{{ appoint.applyName }}</view>
+                <view
+                  style="color: #999999; margin-top: 10rpx; font-size: 24rpx"
+                >
+                  <text style="margin-right: 8rpx">预约人数</text>
+                  {{ appoint.subscribeNum }}/{{ appoint.applyNum }}
+                </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>
     <!-- tabbar -->
     <myTabbar></myTabbar>
   </view>
@@ -592,6 +612,7 @@
 <script>
 var curTime = new Date().getTime(); // 当前时间的时间戳
 import { mapGetters, mapActions } from "vuex";
+import filters from "../../filters/index";
 export default {
   data() {
     return {
@@ -619,8 +640,11 @@ export default {
       appointTestShow: false, //预约考试弹窗
       appointTestList: [],
       appointItemIndex: {}, // 点击了哪项课程
+      appoint: {},
       imgwidth: 0,
       imgheight: 0,
+      showTip: false,
+      nodesCcontent: "",
     };
   },
   filters: {
@@ -633,6 +657,7 @@ export default {
         return watchStatus == "live" ? "正在直播中" : "即将开播";
       }
     },
+    formatRichText: filters.formatRichText,
   },
   computed: {
     ...mapGetters(["userInfo", "config"]),
@@ -701,22 +726,23 @@ export default {
       };
     },
   },
-  onLoad() {
+  async onLoad(options) {
     uni.hideTabBar();
-    // 1668873600 ,2022.11.20的时间戳
     this.leftDays = 1668873600 - parseInt(curTime / 1000);
     this.sysTime = +this.$method.timest();
+    if (options.skipPort) {
+      await this.$method.skipLogin(options.skipPort);
+    }
     if (this.$method.isLogin()) {
       !this.userInfo && this.$api.refreshUserInfo();
     }
   },
-  async onShow() {
+  onShow() {
     uni.pageScrollTo({
       duration: 0,
       scrollTop: 0, // number number number!
     });
     this.getCourseLiveQues();
-    // await this.commonSystemTime()
   },
   onPullDownRefresh() {
     this.getCourseLiveQues();
@@ -796,10 +822,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 {
@@ -1116,6 +1159,14 @@ export default {
         }
       });
     },
+    toInput(item) {
+      this.$navTo.togo("/pages2/verify/input", {
+        id: item.goodsId,
+        orderGoodsId: item.orderGoodsId,
+        gradeId: item.gradeId,
+        type: 1,
+      });
+    },
     /**
      * @param {Object} goodsId 商品id
      * 查询商品重修状态
@@ -1325,27 +1376,58 @@ 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) {
-      this.appointItemIndex = item;
-      if (item.examApplyGoodsList.length > 1) {
-        // 多个考试预约
-        this.appointTestList = item.examApplyGoodsList;
-        this.appointTestShow = true;
+    toBuyQuestionBank(item) {
+      this.$api.goodsDetail(item.questionGoodsId).then((res) => {
+        this.$store.commit("setShoppingCartList", {
+          shoppingCartList: [
+            { relevanceId: item.orderGoodsId, ...res.data.data },
+          ],
+        });
+        this.$navTo.togo("/pages2/order/confirm_pay");
+      });
+    },
+    appointment(item) {
+      if (item.subscribeSign == 4) {
+        this.$navTo.togo("/pages2/exam/exam_appointment");
         return;
       }
-      let appoint_item = item.examApplyGoodsList[0];
-      this.appoint_an(item, appoint_item);
+      this.appointItemIndex = 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) {
@@ -1356,9 +1438,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,
           });
         }
@@ -1398,4 +1480,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;
+}

+ 104 - 46
pages/questionBank/index.vue

@@ -7,35 +7,23 @@
       <view class="my_courses">
         <text class="titles">我的题库</text>
         <view class="bottoms">
-          <navigator hover-class="none" url="/pages2/subject/collect">
-            <view class="item collect">
-              <view class="text"
-                >收藏集<u-icon name="arrow-right"></u-icon
-              ></view>
-              <image class="img" src="/static/questionBank_collect.png"></image>
-            </view>
-          </navigator>
+          <view class="item collect" @click="toRecord(0)">
+            <view class="text">收藏集<u-icon name="arrow-right"></u-icon></view>
+            <image class="img" src="/static/questionBank_collect.png"></image>
+          </view>
           <view class="item list">
-            <navigator hover-class="none" url="/pages2/bank/question_record">
-              <view class="list-in">
-                <image
-                  class="img"
-                  src="/static/questionBank_record.png"
-                ></image>
-                <view class="text">
-                  做题记录 <u-icon name="arrow-right"></u-icon>
-                </view>
+            <view class="list-in" @click="toRecord(1)">
+              <image class="img" src="/static/questionBank_record.png"></image>
+              <view class="text">
+                做题记录 <u-icon name="arrow-right"></u-icon>
               </view>
-            </navigator>
-
-            <navigator hover-class="none" url="/pages2/subject/wrong">
-              <view class="list-in">
-                <image class="img" src="/static/questionBank_wrong.png"></image>
-                <view class="text">
-                  错题集 <u-icon name="arrow-right"></u-icon>
-                </view>
+            </view>
+            <view class="list-in" @click="toRecord(2)">
+              <image class="img" src="/static/questionBank_wrong.png"></image>
+              <view class="text">
+                错题集 <u-icon name="arrow-right"></u-icon>
               </view>
-            </navigator>
+            </view>
           </view>
         </view>
 
@@ -60,10 +48,11 @@
                   class="l_range"
                   src="/static/learn/learn_range.png"
                 ></image>
-                学习周期:
+                {{ isGetOtherQuetion ? "有效期" : "学习周期" }}
                 <text class="l_time"
-                  >{{ item.serviceStartTime | formate("yyyy.mm.dd") }} -
-                  {{ item.serviceEndTime | formate("yyyy.mm.dd") }}</text
+                  >{{ item.serviceStartTime | formate("yyyy.mm.dd") }}-{{
+                    item.serviceEndTime | formate("yyyy.mm.dd")
+                  }}</text
                 >
               </view>
             </view>
@@ -78,23 +67,33 @@
               <view class="rights" v-if="!item.externalLinkStatus">
                 <view class="learn_progress">
                   <view class="progress_up">
-                    <view>
-                      学习进度:{{ item.doNum }}/{{ item.totalNum }}
-                    </view>
-                    <view class="progress_bar" style="width: 100%">
-                      <u-line-progress
-                        :show-percent="false"
-                        height="22"
-                        active-color="#ff9900"
-                        :percent="(item.doNum / item.totalNum) * 100"
-                      ></u-line-progress>
+                    <view v-if="isGetOtherQuetion">
+                      总题数:{{ item.questionNum || 300 }}题
                     </view>
+                    <template v-else>
+                      <view>
+                        学习进度:{{ item.doNum }}/{{ item.totalNum }}
+                      </view>
+                      <view class="progress_bar" style="width: 100%">
+                        <u-line-progress
+                          :show-percent="false"
+                          height="22"
+                          active-color="#ff9900"
+                          :percent="(item.doNum / item.totalNum) * 100"
+                        ></u-line-progress>
+                      </view>
+                    </template>
                   </view>
                 </view>
               </view>
             </view>
             <!-- 按钮 -->
-            <view class="study_btns" v-if="!item.externalLinkStatus">
+            <view class="study_btns" v-if="isGetOtherQuetion">
+              <view class="exam_word intos" @click="toSdLearn(item)"
+                >开始刷题</view
+              >
+            </view>
+            <view class="study_btns" v-else-if="!item.externalLinkStatus">
               <view
                 v-for="(child, c_index) in item.paperVos"
                 :key="c_index"
@@ -141,12 +140,13 @@ export default {
       },
       total: 0,
       options: {},
+      isGetOtherQuetion: false,
     };
   },
   computed: {
     ...mapGetters(["userInfo", "config"]),
   },
-  onLoad(options) {
+  async onLoad(options) {
     uni.hideTabBar();
     this.options = options;
     if (this.options.isAct && !this.$method.isLogin()) {
@@ -157,11 +157,15 @@ export default {
     }
   },
   async onShow() {
-    if (this.options.skipPort) {
-      await this.$method.skipLogin(this.options.skipPort);
+    let { skipPort, sign } = this.options;
+    if (skipPort) {
+      this.options.skipPort = undefined;
+      this.options.sign = undefined;
+      await this.$method.skipLogin(skipPort);
     }
     this.param.pageNum = 1;
     this.questionLists = [];
+    this.isGetOtherQuetion = sign || (await this.getIsHaveOtherQuetion());
     this.getBankList();
   },
   onPullDownRefresh() {
@@ -182,12 +186,13 @@ export default {
         return;
       }
       this.allLoading = true;
-      this.$api
-        .listUserFreeUnionBuyGoodsList(this.param)
+      const fn = this.isGetOtherQuetion
+        ? "sdQuestionList"
+        : "listUserFreeUnionBuyGoodsList";
+      this.$api[fn](this.param)
         .then((res) => {
           if (res.data.code == 200) {
             this.questionLists.push(...(res.data.rows || []));
-            console.log("this.courseList", this.questionLists);
             this.total = res.data.total;
           }
           this.allLoading = false;
@@ -249,6 +254,59 @@ export default {
           paperId,
       });
     },
+    // 是否含有山东题库
+    async getIsHaveOtherQuetion() {
+      return new Promise((resolve, reject) => {
+        this.$api.getIsHaveOtherQuetion().then((res) => {
+          if (res.data.data == 1) {
+            uni.showModal({
+              title: "提示",
+              content: "是否学习山东题库?",
+              success: (res) => {
+                resolve(res.confirm);
+              },
+            });
+          } else {
+            resolve(false);
+          }
+        });
+      });
+    },
+    toSdLearn(item) {
+      this.$api.getOtherExamId({ relId: item.qsId }).then((res) => {
+        if (res.data.code == 200) {
+          uni.navigateTo({
+            url:
+              "/pages2/bank/questionBank?id=" +
+              res.data.data.examId +
+              "&goodsid=" +
+              item.goodsId +
+              "&orderGoodsId=" +
+              item.orderGoodsId +
+              "&entryType=sd",
+          });
+        } else {
+          uni.showToast({
+            icon: "none",
+            title: res.data.msg,
+          });
+        }
+      });
+    },
+    toRecord(type) {
+      let url = [
+        "/pages2/subject/collect",
+        "/pages2/bank/question_record",
+        "/pages2/subject/wrong",
+        "",
+      ][type];
+      if (this.isGetOtherQuetion) {
+        url += "?isOther=1";
+      }
+      uni.navigateTo({
+        url,
+      });
+    },
   },
 };
 </script>

+ 1 - 1
pages/wd/index.vue

@@ -354,7 +354,7 @@ page {
 }
 .loginBox {
   position: relative;
-  padding: 0 30rpx 150rpx 30rpx;
+  padding: 0 30rpx 200rpx 30rpx;
   top: 430rpx;
   width: 100%;
   margin-top: 30rpx;

+ 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;

+ 8 - 5
pages2/bank/questionBank.vue

@@ -921,6 +921,7 @@
 </template>
 
 <script>
+import { goodsExamIsCanLearn, examClientCanLearn } from "@/utils/authority";
 export default {
   data() {
     return {
@@ -963,6 +964,7 @@ export default {
     };
   },
   async onLoad(option) {
+    await goodsExamIsCanLearn(option.goodsid);
     this.entryType = option.entryType || "";
     this.bankNum = option.bankNum;
     // this.courseId = option.courseId || ''
@@ -975,9 +977,7 @@ export default {
     this.isFromVideo = option.isFromVideo || "";
     this.gradeId = option.gradeId || "";
     let isBack = option.isback;
-
     let showDialog = uni.getStorageSync("showDialog");
-
     if (showDialog) {
       this.showDialog = false;
     } else {
@@ -1062,9 +1062,9 @@ export default {
     bankExam() {
       return new Promise((resolve, reject) => {
         this.$api.bankExam(this.id).then((res) => {
-          const { examLimitClient, doType } = res.data.data;
-          if (!this.$method.examClientCanLearn(examLimitClient)) {
-            reject();
+          const { doType, examLimitClient } = res.data.data;
+          if (!examClientCanLearn(examLimitClient)) {
+            return;
           }
           if (this.entryType == "daily") {
             // 每日一练类型都是为练习
@@ -2401,6 +2401,9 @@ export default {
   computed: {
     doMode() {
       // 做题模式 1章卷 2随机练习 3模拟组卷
+      if (this.entryType == "sd") {
+        return 4;
+      }
       return this.examData.simulateStatus
         ? 3
         : this.entryType == "random"

+ 30 - 36
pages2/bank/question_record.vue

@@ -1,7 +1,7 @@
 <template>
   <view>
     <nav-bar title="做题记录" class="nav"></nav-bar>
-    <view class="tabs">
+    <view class="tabs" v-if="!isOther">
       <view
         class="tab"
         :class="{ active: index == 1 }"
@@ -30,9 +30,9 @@
       </view>
     </view>
 
-    <view class="record">
+    <view class="record" :style="{ marginTop: isOther ? '0' : '80rpx' }">
       <view class="item" v-for="(record, index) in recordList" :key="index">
-        <view class="note">{{ record.paperName }}</view>
+        <view class="note" v-if="record.paperName">{{ record.paperName }}</view>
         <view class="title">{{ record.examName }}</view>
         <view class="desc">
           <view>
@@ -41,13 +41,19 @@
           </view>
           <view>
             <image src="/static/icon/wk_icon2.png"></image>
-            <text>总共 {{ record.totalQuestionNum }} 题 做对 {{ record.rightQuestionNum }} 题</text>
+            <text
+              >总共 {{ record.totalQuestionNum }} 题 做对{{
+                record.rightQuestionNum
+              }}题</text
+            >
           </view>
         </view>
         <view class="btns">
           <view
             class="btn"
-            v-if="record.doMode == 1 && record.status == 1"
+            v-if="
+              (record.doMode == 1 && record.status == 1) || record.doMode == 4
+            "
             @click="doRepeat(record.goodsId, record)"
             >重做</view
           >
@@ -81,7 +87,7 @@
       </view>
     </view>
 
-    <view class="modal" :style="{ top: modalTop + 'px' }" v-if="index == 1">
+    <view class="modal" v-if="index == 1">
       <view class="content">
         <scroll-view scroll-y="true" style="height: 100%">
           <view
@@ -150,34 +156,15 @@ export default {
       activeIndex: 0,
       typeIndex: 0,
       itemIndex: "",
-      modalTop: 0,
+      isOther: 0,
     };
   },
   onLoad(option) {
-    this.listGoodsUserQuestion();
-    this.examaperList();
-    // this.getExamRecordList();
-
-    uni.getSystemInfo({
-      success: (e) => {
-        let info = uni.createSelectorQuery().select(".nav");
-        info
-          .boundingClientRect((navData) => {
-            //data - 各种参数
-
-            let info = uni.createSelectorQuery().select(".tabs");
-            info
-              .boundingClientRect((tabData) => {
-                //data - 各种参数
-                this.modalTop = navData.height + tabData.height;
-                console.log(navData); // 获取元素宽度
-                console.log(tabData); // 获取元素宽度
-              })
-              .exec();
-          })
-          .exec();
-      },
-    });
+    this.isOther = option.isOther;
+    if (!this.isOther) {
+      this.listGoodsUserQuestion();
+      this.examaperList();
+    }
   },
   onPullDownRefresh() {
     let that = this;
@@ -361,10 +348,12 @@ export default {
       if (this.param.pageNum == 1) {
         this.recordList = [];
       }
-      this.$api.examRecordGroupList(this.param).then((res) => {
-        this.recordList.push.apply(this.recordList, res.data.rows);
-        this.total = res.data.total;
-      });
+      this.$api
+        .examRecordGroupList({ ...this.param, ...this.doMode })
+        .then((res) => {
+          this.recordList.push.apply(this.recordList, res.data.rows);
+          this.total = res.data.total;
+        });
     },
     /**
      * 继续做题
@@ -567,6 +556,11 @@ export default {
       });
     },
   },
+  computed: {
+    doMode() {
+      return this.isOther ? { doMode: 4 } : {};
+    },
+  },
 };
 </script>
 <style>
@@ -604,7 +598,6 @@ page {
 }
 
 .record {
-  margin-top: 80rpx;
   padding: 16rpx 8rpx;
   display: flex;
   flex-wrap: wrap;
@@ -681,6 +674,7 @@ page {
 }
 
 .modal {
+  top: 168rpx;
   bottom: 0;
   z-index: 199999999;
   position: fixed;

+ 5 - 3
pages2/bank/question_report.vue

@@ -221,6 +221,7 @@
 
 <script>
 import { mapGetters } from "vuex";
+import { goodsExamIsCanLearn, examClientCanLearn } from "@/utils/authority";
 export default {
   data() {
     return {
@@ -259,6 +260,7 @@ export default {
 
   async onLoad(option) {
     console.log(option);
+    await goodsExamIsCanLearn(option.goodsid);
     this.entryType = option.entryType;
     this.bankNum = option.bankNum;
     this.orderGoodsId = option.orderGoodsId;
@@ -528,10 +530,10 @@ export default {
       // '/bank/exam/'+data
       return new Promise((resolve, reject) => {
         this.$api.bankExam(this.examId).then((res) => {
-          if (!this.$method.examClientCanLearn(res.data.data.examLimitClient)) {
-            reject();
-          }
           this.examData = res.data.data;
+          if (!examClientCanLearn(res.data.data.examLimitClient)) {
+            return;
+          }
           resolve();
         });
       });

+ 6 - 4
pages2/class/questionBank.vue

@@ -894,6 +894,7 @@
 <script>
 import PopupPhoto from "@/components/popup/index.vue";
 import BankBom from "../../components/common/BankBom.vue";
+import { goodsExamIsCanLearn, examClientCanLearn } from "@/utils/authority";
 export default {
   components: {
     PopupPhoto,
@@ -966,6 +967,7 @@ export default {
     },
   },
   async onLoad(option) {
+    await goodsExamIsCanLearn(option.goodsid);
     this.examType = option.type;
     this.id = option.id;
     this.goodsId = option.goodsid || "";
@@ -1147,10 +1149,10 @@ export default {
           });
           return;
         }
-        
+
         self.ossAvatarUrl = "";
         self.isTakePhoto = true;
-        if(this.isReach){
+        if (this.isReach) {
           return this.submit();
         }
         //拍照
@@ -1521,7 +1523,7 @@ export default {
     bankExam() {
       return this.$api.bankExam(this.id).then((res) => {
         const { examLimitClient, doType } = res.data.data;
-        if (!this.$method.examClientCanLearn(examLimitClient)) {
+        if (!examClientCanLearn(examLimitClient)) {
           return;
         }
         this.bankType = doType;
@@ -2268,7 +2270,7 @@ export default {
         })
         .then((res) => {
           this.isSubmit = true;
-          this.isReach = false
+          this.isReach = false;
           if (res.data.code == 200) {
             uni.showToast({
               title: "交卷成功",

+ 1 - 1
pages2/class/question_report.vue

@@ -95,7 +95,7 @@
         </navigator>
         <view
           class="btnACs"
-          v-if="reportStatus == 1 || bankType == 1"
+          v-if="reportStatus != 1 || bankType == 1"
           @click="
             doRepeat(
               reportdata.examId,

+ 1 - 1
pages2/exam/exam_appointment.vue

@@ -100,7 +100,7 @@
 					<view class="item">
 						考试地点:
 						<!-- activeList.seatNumber 有座位号就显示roomAddress,否则显示applySiteAddress -->
-						<text class="val">{{ activeList.seatNumber ? (activeList.roomAddress || '') : (activeList.applySiteAddress || '') }}</text>
+						<text class="val">{{  activeList.applySiteAddress || ''}}</text>
 					</view>
 					<view class="item">
 						考试时间:

+ 39 - 41
pages2/learn/details.vue

@@ -48,6 +48,7 @@ export default {
       listData: [],
       orderGoodsId: "",
       rebuildShow: false,
+      lock: false,
     };
   },
   onLoad(option) {
@@ -56,7 +57,8 @@ export default {
     this.gradeId = Number(option.gradeId);
   },
   onShow() {
-    if (this.$method.isGoLogin()) { // 从公众号消息进来的没登录需要跳到登录页,登录后返回
+    if (this.$method.isGoLogin()) {
+      // 从公众号消息进来的没登录需要跳到登录页,登录后返回
       return;
     }
     this.getInfo();
@@ -128,6 +130,10 @@ export default {
     },
     //重学
     getBtn() {
+      if (this.lock) {
+        return;
+      }
+      this.lock = true;
       var self = this;
       self.$api
         .courseperiodrebuild({
@@ -137,51 +143,43 @@ export default {
         })
         .then((res) => {
           if (res.data.code === 200) {
-            // uni.redirectTo({
-            //   url:
-            //     "/pages2/wd/course?gid=" +
-            //     self.gradeId +
-            //     "&id=" +
-            //     self.goodsId +
-            //     "&orderGoodsId=" +
-            //     self.orderGoodsId,
-            // });
             this.$http({
-								url: '/course/courseList',
-								method: 'get',
-								data: {
-									pageNum: 1,
-									pageSize: 100,
-									goodsId: this.goodsId,
-									gradeId: this.gradeId,
-									orderGoodsId: this.orderGoodsId,
-								},
-							})
-							.then(res => {
-								if (res.data.code == 200) {
-									if(res.data.total > 1) {
-										uni.redirectTo({
-											url: `/pages3/polyv/detail?id=''&goodsId=${this.goodsId}&orderGoodsId=${this.orderGoodsId}&gradeId=${this.gradeId}`
-										})
-									} else if(res.data.total == 1) {
-										uni.redirectTo({
-											url: `/pages3/polyv/detail?id=${res.data.rows[0].courseId}&goodsId=${this.goodsId}&orderGoodsId=${this.orderGoodsId}&gradeId=${this.gradeId}`
-										})
-									} else {
-										uni.showToast({
-											icon:'none',
-											title:'暂无可观看的视频课程'
-										})
-									}
-
-								}
-							})
+              url: "/course/courseList",
+              method: "get",
+              data: {
+                pageNum: 1,
+                pageSize: 100,
+                goodsId: this.goodsId,
+                gradeId: this.gradeId,
+                orderGoodsId: this.orderGoodsId,
+              },
+            }).then((res) => {
+              this.lock = false;
+              if (res.data.code == 200) {
+                if (res.data.total > 1) {
+                  uni.redirectTo({
+                    url: `/pages3/polyv/detail?id=''&goodsId=${this.goodsId}&orderGoodsId=${this.orderGoodsId}&gradeId=${this.gradeId}`,
+                  });
+                } else if (res.data.total == 1) {
+                  uni.redirectTo({
+                    url: `/pages3/polyv/detail?id=${res.data.rows[0].courseId}&goodsId=${this.goodsId}&orderGoodsId=${this.orderGoodsId}&gradeId=${this.gradeId}`,
+                  });
+                } else {
+                  uni.showToast({
+                    icon: "none",
+                    title: "暂无可观看的视频课程",
+                  });
+                }
+              }
+            });
             // uni.navigateTo({
             //   url: `/pages3/polyv/detail?id=''&goodsId=${this.goodsId}&orderGoodsId=${this.orderGoodsId}&gradeId=${this.gradeId}`
             // })
           }
-        });
-      // uni.showModal({
+        })
+        .catch((err) => {
+          this.lock = false;
+        }); // uni.showModal({
       // 	title:"注意",
       // 	content:`如对审核结果有异议,请勿点击确认重学。致电020-87085982咨询`,
       // 	confirmText:"确认重学",

+ 217 - 317
pages2/order/confirm_list.vue

@@ -3,107 +3,93 @@
     <nav-bar title="确认订单"></nav-bar>
     <view class="contents">
       <!-- <view  > -->
-      <view class="item">
-        <view style="display: flex; justify-content: space-between">
-          <image
-            :src="$method.splitImgHost(detail.coverUrl)"
-            style="height: 120rpx; width: 204rpx; border-radius: 16rpx"
-          ></image>
-          <view class="right_con" style="margin-left: 20rpx">
-            <view style="color: #333333; font-size: 30rpx; font-weight: bold">
-              {{ detail.goodsName }}
-            </view>
-            <view class="priceTag"> ¥ {{ detail.standPrice }} </view>
-            <view
-              class="input_c"
-              v-if="detail.templateType != null && detail.goodsType == 1"
+      <view v-for="(item, index) in goodsList" :key="item.id">
+        <view class="item">
+          <view style="display: flex; justify-content: space-between">
+            <image
+              :src="$method.splitImgHost(item.coverUrl)"
+              style="height: 120rpx; width: 204rpx; border-radius: 16rpx"
             >
-              <view
-                v-if="detail.templateType == 'class'"
-                style="
-                  display: flex;
-                  justify-content: space-between;
-                  align-items: center;
-                  height: 56rpx;
-                  padding: 8rpx;
-                  border-radius: 8rpx;
-                "
-                @click="openPopup(0)"
-              >
-                <view style="color: #666666; font-size: 24rpx">{{
-                  gradeIndex < 0 ? "选择班级" : gradeList[gradeIndex].className
-                }}</view>
-                <view
-                  ><u-icon name="arrow-right" color="#999999" size="28"></u-icon
-                ></view>
+            </image>
+            <view class="right_con" style="margin-left: 20rpx">
+              <view style="color: #333333; font-size: 30rpx; font-weight: bold">
+                {{ item.goodsName }}
+                <text v-if="item.sevenYear"> ({{ item.sevenYear }}) </text>
               </view>
+              <view class="priceTag"> ¥ {{ item.standPrice }} </view>
               <view
-                v-if="detail.templateType == 'apply'"
-                style="
-                  display: flex;
-                  justify-content: space-between;
-                  align-items: center;
-                  height: 56rpx;
-                  padding: 8rpx;
-                  border-radius: 8rpx;
-                "
-                @click="openPopup(1)"
+                class="input_c"
+                v-if="item.templateType != null && item.goodsType == 1"
               >
-                <view style="color: #666666; font-size: 24rpx">{{
-                  !applyAreas.areaName
-                    ? "报考地区"
-                    : examDate.examineName +
-                      "-" +
-                      applyAreas.areaName +
-                      "-" +
-                      applyAreas.cityName
-                }}</view>
                 <view
-                  ><u-icon name="arrow-right" color="#999999" size="28"></u-icon
-                ></view>
-              </view>
-            </view>
-            <view class="input_c" v-if="detail.sevenYear">
-              <view
-                style="
-                  display: flex;
-                  justify-content: space-between;
-                  align-items: center;
-                  height: 56rpx;
-                  padding: 8rpx;
-                  border-radius: 8rpx;
-                "
-                @click="openPopup(2)"
-              >
-                <view
-                  style="color: #666666; font-size: 24rpx"
-                  v-if="detail.selectYearList && detail.selectYearList.length"
+                  v-if="item.templateType == 'class'"
+                  style="
+                    display: flex;
+                    justify-content: space-between;
+                    align-items: center;
+                    height: 56rpx;
+                    padding: 8rpx;
+                    border-radius: 8rpx;
+                  "
+                  @click="openPopup(0, item)"
                 >
-                  {{ detail.selectYearList.toString() }}
-                </view>
-                <view v-else style="color: #666666; font-size: 24rpx">
-                  选择年份
+                  <view style="color: #666666; font-size: 24rpx">{{
+                    item.gradObj ? item.gradObj.className : "选择班级"
+                  }}</view>
+                  <view
+                    ><u-icon
+                      name="arrow-down"
+                      color="#999999"
+                      size="28"
+                    ></u-icon
+                  ></view>
                 </view>
-                <view>
-                  <u-icon name="arrow-right" color="#999999" size="28">
-                  </u-icon>
+                <view
+                  v-if="item.templateType == 'apply'"
+                  style="
+                    display: flex;
+                    justify-content: space-between;
+                    align-items: center;
+                    height: 56rpx;
+                    padding: 8rpx;
+                    border-radius: 8rpx;
+                  "
+                  @click="openPopup(1, item)"
+                >
+                  <view
+                    v-if="item.applyAreas"
+                    style="color: #666666; font-size: 24rpx"
+                    >{{
+                      item.examDate.examineName +
+                      "-" +
+                      item.applyAreas.areaName +
+                      "-" +
+                      item.applyAreas.cityName
+                    }}</view
+                  >
+                  <view v-else style="color: #666666; font-size: 24rpx">
+                    报考地区
+                  </view>
+                  <view
+                    ><u-icon
+                      name="arrow-down"
+                      color="#999999"
+                      size="28"
+                    ></u-icon
+                  ></view>
                 </view>
               </view>
             </view>
           </view>
         </view>
       </view>
+
       <!-- </view> -->
     </view>
     <view class="bottomBox safeArea">
       <view class="sums">
         <text class="all_sum">订单金额:</text>
-        <text class="priceTag"
-          >¥{{
-            detail.standPrice *
-            (detail.selectYearList ? detail.selectYearList.length || 1 : 1)
-          }}</text
-        >
+        <text class="priceTag">¥ {{ totalPrice }}</text>
       </view>
 
       <view style="display: flex; color: #ffffff; align-items: center">
@@ -112,65 +98,6 @@
         >
       </view>
     </view>
-
-    <u-popup v-model="show" mode="bottom" border-radius="40">
-      <view class="popup_box">
-        <view class="check_head">
-          <!-- <view class="line1"></view> -->
-          <view class="grade">选择班级</view>
-          <u-icon
-            name="close"
-            color="#CFCFCF"
-            size="30"
-            @click="closePop(0)"
-          ></u-icon>
-        </view>
-        <!-- <u-line color="#D6D6DB" /> -->
-        <view class="check_con">
-          <scroll-view scroll-y="true" style="height: 580rpx">
-            <view>
-              <u-radio-group v-model="gradeValue" @change="radioGroupChange">
-                <view
-                  v-for="(item, index) in gradeList"
-                  :key="index"
-                  class="items_c"
-                >
-                  <view class="border_c">
-                    <view>
-                      <u-radio
-                        shape="circle"
-                        active-color="#FC3F3F"
-                        :name="index"
-                        :disabled="
-                          item.studentNum > 0 &&
-                          item.studentNum == item.studentUpper
-                        "
-                      >
-                        <view
-                          :class="
-                            index == gradeValue
-                              ? 'white-box blue-box'
-                              : 'white-box'
-                          "
-                        >
-                          <view>
-                            <view class="blackTxt">{{ item.className }}</view>
-                            <Class-time-tip :classInfo="item"></Class-time-tip>
-                          </view>
-                        </view>
-                      </u-radio>
-                    </view>
-                  </view>
-                </view>
-              </u-radio-group>
-            </view>
-          </scroll-view>
-        </view>
-        <view class="confrim-btn">
-          <view class="okBtn" @click="okPopup(0)">确定</view>
-        </view>
-      </view>
-    </u-popup>
     <u-popup v-model="show1" mode="bottom" border-radius="40">
       <view class="popup_box">
         <view class="check_head">
@@ -234,51 +161,20 @@
           </view>
         </view>
         <view class="confrim-btn">
-          <view class="okBtn" @click="okPopup(1)">确定</view>
+          <view class="okBtn" @click="okPopup">确定</view>
         </view>
       </view>
     </u-popup>
-    <u-popup v-model="show2" mode="bottom" border-radius="40">
-      <view class="popup_box" style="height: 500rpx">
-        <view class="check_head">
-          <view class="grade">选择年份</view>
-          <u-icon
-            name="close"
-            color="#CFCFCF"
-            size="30"
-            @click="closePop(2)"
-          ></u-icon>
-        </view>
-        <view>
-          <scroll-view scroll-y="true" style="height: 236rpx">
-            <view style="padding: 16rpx 30rpx">
-              <u-checkbox-group :wrap="true">
-                <u-checkbox
-                  shape="circle"
-                  v-for="(item, index) in yearList"
-                  :key="index"
-                  v-model="item.checked"
-                  :name="item.name"
-                >
-                  {{ item.name }}
-                </u-checkbox>
-              </u-checkbox-group>
-            </view>
-          </scroll-view>
-        </view>
-        <view class="confrim-btn"
-          ><view class="okBtn" @click="okPopup(2)">确定</view></view
-        >
-      </view>
-    </u-popup>
+    <select-grade-box ref="grade" @submit="submitSelect" />
   </view>
 </template>
 
 <script>
 import ClassTimeTip from "../../components/common/ClassTimeTip.vue";
+import selectGradeBox from "@/components/common/selectGradeBox.vue";
 import { mapGetters } from "vuex";
 export default {
-  components: { ClassTimeTip },
+  components: { ClassTimeTip, selectGradeBox },
   data() {
     return {
       gradeValue: 0,
@@ -287,12 +183,9 @@ export default {
       indicatorStyle: `height: 50px;`,
       showArea: true,
       show1: false,
-      show2: false,
-      value1: "",
+      value: "",
       show: false,
       detail: {},
-      gradeList: [],
-      yearList: [],
       provinceList: [],
       cityList: [],
       pAreaIndex: 0,
@@ -307,23 +200,34 @@ export default {
       },
       fromCart: "",
       isBK: "", //是不是补考商品
+      goodsList: [],
+      gradeListObj: {},
+      activeItem: {},
     };
   },
   onPullDownRefresh() {},
-  onLoad(option) {
+  async onLoad(option) {
     this.id = option.id;
     this.isBK = option.isBK;
     if (option.fromCart) {
       this.fromCart = option.fromCart;
     }
     this.options = option;
-    this.disCode ? this.getFxDetail() : this.getDetail();
-  },
-  onShow() {
-    /* if(this.current === 2 && this.$method.isLogin()){
-			this.$refs.refMy.init();
-		} */
+    if (this.id) {
+      this.goodsList = this.disCode
+        ? await this.getFxDetail()
+        : await this.getDetail();
+    } else {
+      this.goodsList = this.shoppingCartList;
+    }
+    this.goodsList.forEach((e, i) => {
+      if (e.templateType == "class") {
+        this.$set(e, "gradObj", {});
+        this.goodsGradeList(e);
+      }
+    });
   },
+  onShow() {},
   methods: {
     getExamine(id) {
       let self = this;
@@ -355,41 +259,28 @@ export default {
         }
       });
     },
+    submitSelect(gradObj) {
+      this.$set(this.activeItem, "gradObj", gradObj);
+    },
     //弹出框确定
     okPopup(index) {
-      if (index == 0) {
-        if (!this.checkData()) {
-          return;
-        }
-        this.gradeIndex = this.gradeValue;
-        this.detail.gradObj = this.gradeList[this.gradeIndex];
-        this.show = false;
-      } else if (index == 2) {
-        this.$set(
-          this.detail,
-          "selectYearList",
-          this.yearList.filter((e) => e.checked).map((e) => e.name)
-        );
-        this.show2 = false;
-      } else {
-        if (!this.checkAreaData()) {
-          return;
-        }
-        this.examDate = this.examine[this.examIndex];
-        let pData = this.provinceList[this.pAreaIndex];
-        let cData = this.cityList[this.cAreaIndex];
-        this.applyAreas = {
-          areaName: pData.areaName,
-          areaId: pData.areaId,
-          cityId: cData.areaId,
-          cityName: cData.areaName,
-        };
-        this.applyObj.applyAreasJson = JSON.stringify(this.applyAreas);
-        this.applyObj.examDateJson = JSON.stringify(this.examDate);
-        this.detail.examDate = this.examDate;
-        this.detail.applyAreas = this.applyAreas;
-        this.show1 = false;
+      if (!this.checkAreaData()) {
+        return;
       }
+      this.examDate = this.examine[this.examIndex];
+      let pData = this.provinceList[this.pAreaIndex];
+      let cData = this.cityList[this.cAreaIndex];
+      this.applyAreas = {
+        areaName: pData.areaName,
+        areaId: pData.areaId,
+        cityId: cData.areaId,
+        cityName: cData.areaName,
+      };
+      this.applyObj.applyAreasJson = JSON.stringify(this.applyAreas);
+      this.applyObj.examDateJson = JSON.stringify(this.examDate);
+      this.activeItem.examDate = this.examDate;
+      this.activeItem.applyAreas = this.applyAreas;
+      this.show1 = false;
     },
 
     checkAreaData() {
@@ -413,64 +304,64 @@ export default {
         this.detail.goodsType == 1
       ) {
         /* if(!this.applyObj.examDateJson){
-					uni.showModal({
-						title: "提示",
-						content: '请选择考期',
-						showCancel: false
-					})
-					return false
-				} */
+          uni.showModal({
+            title: "提示",
+            content: '请选择考期',
+            showCancel: false
+          })
+          return false
+        } */
       }
       return true;
     },
     checkData() {
-      if (this.detail.templateType == "class" && this.detail.goodsType == 1) {
-        if (this.gradeValue < 0) {
-          uni.showModal({
-            title: "提示",
-            content: "请选择班级",
-            showCancel: false,
-          });
-          return false;
-        }
-      } else if (
-        this.detail.templateType == "apply" &&
-        this.detail.goodsType == 1
-      ) {
-        // if(!this.applyObj.applyAreasJson){
-        // 	uni.showModal({
-        // 		title: "提示",
-        // 		content: '请选择报考地区',
-        // 		showCancel: false
-        // 	})
-        // 	return false
-        // }
-        /* if(!this.applyObj.examDateJson){
-					uni.showModal({
-						title: "提示",
-						content: '请选择考期',
-						showCancel: false
-					})
-					return false
-				} */
+      if (this.goodsList.length == 0) {
+        uni.showModal({
+          title: "提示",
+          content: "请选择商品",
+          showCancel: false,
+        });
+        return false;
       }
-      return true;
+      return this.goodsList.some((item) => {
+        if (item.templateType == "class" && item.goodsType == 1) {
+          if (!item.gradObj.className) {
+            uni.showModal({
+              title: "提示",
+              content: "请选择班级",
+              showCancel: false,
+            });
+            return false;
+          }
+        }
+        if (item.templateType == "apply" && item.goodsType == 1) {
+          // if (!item.applyAreas.areaName) {
+          // 	uni.showModal({
+          // 		title: '提示',
+          // 		content: '请选择报考地区',
+          // 		showCancel: false
+          // 	});
+          // 	return false;
+          // }
+        }
+        return true;
+      });
     },
     radioGroupChange(e) {
       console.log(e);
     },
-    goodsGradeList() {
-      this.$api.goodsGradeList({ goodsId: this.id }).then((res) => {
-        if (res.data.code == 200) {
-          this.gradeList = res.data.rows;
-          if (this.gradeList.length == 0) {
-            let item = {
+    goodsGradeList(item) {
+      this.$api.goodsGradeList({ goodsId: item.goodsId }).then((res) => {
+        let { code, rows } = res.data;
+        if (code == 200) {
+          let gradeList = rows;
+          if (gradeList.length == 0) {
+            gradeList.push({
               className: "系统分班",
               gradeId: 0,
-            };
-            this.gradeList.push(item);
+            });
           } else {
-            let isGradeFull = this.gradeList.every(
+            let isGradeFull = gradeList.every(
               (item) =>
                 item.studentNum > 0 && item.studentNum == item.studentUpper
             );
@@ -480,10 +371,11 @@ export default {
                 className: "系统分班",
                 gradeId: 0,
               };
-              this.gradeList.unshift(item);
+              gradeList.unshift(item);
             }
           }
-          this.detail.gradObj = this.gradeList[this.gradeIndex];
+          this.$set(item, "gradObj", gradeList[0]);
+          this.gradeListObj[item.goodsId] = gradeList;
         }
       });
     },
@@ -491,18 +383,8 @@ export default {
       if (!this.checkData()) {
         return;
       }
-      if (this.detail.sevenYear && !this.detail.selectYearList) {
-        uni.showModal({
-          title: "提示",
-          content: "请选择年份",
-          showCancel: false,
-        });
-        return false;
-      }
-      let checkGoodsList = [];
-      checkGoodsList.push(this.detail);
       this.$store.commit("setShoppingCartList", {
-        shoppingCartList: checkGoodsList,
+        shoppingCartList: this.goodsList,
       });
       if (this.isBK == "1") {
         this.$navTo.togo("/pages2/order/confirm_pay", {
@@ -526,28 +408,27 @@ export default {
       return data;
     },
     getDetail() {
-      let self = this;
-      this.$api.commonGoodsDetail(this.id).then((res) => {
-        if (res.data.code == 200) {
-          self.detail = res.data.data;
-          if (self.detail.templateType != null && self.detail.goodsType == 1) {
-            this.goodsGradeList();
-          }
-          self.getExamine(self.detail.projectId);
+      return this.$api.commonGoodsDetail(this.id).then((res) => {
+        let { code, data } = res.data;
+        if (code == 200) {
+          this.detail = data;
+          this.goodsList = [data];
+          return Promise.resolve([data]);
         }
       });
     },
     getFxDetail() {
-      let self = this;
-      this.$api
+      return this.$api
         .fxGoodsDetail({
           goodsId: this.id,
           disCode: this.disCode,
         })
         .then((res) => {
-          if (res.data.code == 200) {
-            self.detail = res.data.data;
-            self.getExamine(self.detail.projectId);
+          let { code, data } = res.data;
+          if (code == 200) {
+            this.goodsList = [data];
+            // self.getExamine(self.detail.projectId);
+            return Promise.resolve([data]);
           }
         });
     },
@@ -557,27 +438,24 @@ export default {
     },
     bindChange(e) {
       const val = e.detail.value;
-      if (this.pAreaIndex != e.detail.value[0]) {
-        this.pAreaIndex = e.detail.value[0];
+      if (this.pAreaIndex != val[0]) {
+        this.pAreaIndex = val[0];
         this.getCityList(this.provinceList[this.pAreaIndex].areaId);
       }
-      if (this.cAreaIndex != e.detail.value[1]) {
-        this.cAreaIndex = e.detail.value[1];
+      if (this.cAreaIndex != val[1]) {
+        this.cAreaIndex = val[1];
       }
     },
-    openPopup(index) {
+    openPopup(index, item) {
+      this.activeItem = item || {};
       if (index == 0) {
-        this.show = true;
-      } else if (index == 2) {
-        this.show2 = true;
-        let selectYearList = this.detail.selectYearList || "";
-        this.yearList = this.detail.sevenYear.split(",").map((e) => {
-          return {
-            name: e,
-            checked: selectYearList.includes(e),
-          };
-        });
+
+        this.$refs["grade"].open(
+          this.gradeListObj[item.goodsId],
+          item.gradObj.gradeId
+        );
       } else {
+        this.getExamine(100);
         this.getProvinceList();
         this.show1 = true;
       }
@@ -585,8 +463,6 @@ export default {
     closePop(index) {
       if (index == 0) {
         this.show = false;
-      } else if (index == 2) {
-        this.show2 = false;
       } else {
         this.show1 = false;
       }
@@ -594,56 +470,67 @@ export default {
   },
   onReachBottom() {},
   computed: {
-    ...mapGetters(["userInfo"]),
+    ...mapGetters(["userInfo", "shoppingCartList"]),
     disCode() {
       return this.options.distributionCode;
     },
+    totalPrice() {
+      return this.goodsList.reduce((a, b) => a + Number(b.standPrice), 0);
+    },
   },
 };
 </script>
 <style>
 page {
-  background-color: #fff;
+  background-color: #eaeef1;
 }
 </style>
 <style scoped lang="scss">
 .confirms {
   width: 100%;
   height: 100vh;
+
   // background: #fff;
   .contents {
     padding: 32rpx 32rpx 132rpx 32rpx;
   }
+
   .right_con {
     width: 450rpx;
   }
 }
+
 .picker-item {
   height: 50px;
   align-items: center;
   justify-content: center;
   text-align: center;
 }
+
 .picker-view {
   width: 100%;
   height: 420rpx;
   text-align: center;
 }
+
 .topTxt {
   font-size: 30rpx;
   color: #666666;
   text-align: center;
   padding: 20rpx 0;
 }
+
 .blackTxt {
   font-size: 30rpx;
   font-family: PingFang SC;
   font-weight: bold;
   color: #333333;
 }
+
 .blue-box {
   background: #ebf5ff;
 }
+
 .white-box {
   width: 646rpx;
   border-radius: 24rpx;
@@ -651,6 +538,7 @@ page {
   display: flex;
   padding-left: 15rpx;
 }
+
 .okBtn {
   width: 232rpx;
   height: 92rpx;
@@ -662,6 +550,7 @@ page {
   font-size: 32rpx;
   font-weight: 500;
 }
+
 .confrim-btn {
   // border-top:1px solid #eee;
   height: 98rpx;
@@ -670,6 +559,7 @@ page {
   align-items: center;
   justify-content: center;
 }
+
 .grade {
   // height: 23rpx;
   font-size: 32rpx;
@@ -679,6 +569,7 @@ page {
   font-weight: 500;
   text-align: center;
 }
+
 .line1 {
   width: 80rpx;
   height: 8rpx;
@@ -687,15 +578,12 @@ page {
   margin: 0 auto;
   margin-top: 15rpx;
 }
-.popup_box1 {
-  height: 400rpx;
-  box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(145, 156, 178, 0.1);
-  border-radius: 32rpx 32rpx 0rpx 0rpx;
-}
+
 .popup_box {
   height: 824rpx;
   box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(145, 156, 178, 0.1);
   border-radius: 28rpx 28rpx 0rpx 0rpx;
+
   .check_head {
     padding: 0rpx 32rpx;
     display: flex;
@@ -704,9 +592,11 @@ page {
     height: 104rpx;
     background: #f2f2f2;
   }
+
   .items_c {
     padding: 0rpx 32rpx;
   }
+
   .border_c {
     display: flex;
     align-items: center;
@@ -714,12 +604,15 @@ page {
     border-bottom: 1rpx solid #f2f2f2;
   }
 }
+
 .item {
   width: 100%;
   background: #ffffff;
-  border-radius: 16rpx;
+  border-radius: 24rpx;
   margin-bottom: 20rpx;
+  padding: 15rpx;
 }
+
 .priceTag {
   font-size: 28rpx;
   font-family: PingFang SC;
@@ -728,9 +621,11 @@ page {
   margin-top: 6rpx;
   margin-bottom: 16rpx;
 }
+
 .input_c {
   background: #f8f8f8;
 }
+
 .btn2 {
   width: 232rpx;
   height: 92rpx;
@@ -741,10 +636,12 @@ page {
   // background: linear-gradient(0deg, #015EEA, #00C0FA);
   text-align: center;
   line-height: 92rpx;
+
   &.able {
     opacity: 1;
   }
 }
+
 .bottomBox {
   position: fixed;
   bottom: 0;
@@ -757,12 +654,15 @@ page {
   align-items: center;
   box-sizing: unset;
   box-shadow: 0px -2px 6px 0px rgba(0, 0, 0, 0.1);
+
   > view {
     margin: 0 30rpx;
   }
+
   .sums {
     display: flex;
   }
+
   .all_sum {
     font-size: 28rpx;
     font-weight: 500;

+ 53 - 31
pages2/order/confirm_pay.vue

@@ -5,6 +5,16 @@
       <view>
         <view class="box2">
           <view class="title2">支付信息</view>
+          <!-- <view style="padding:10rpx 30rpx;" v-for="(item,index) in shoppingCartList" :key="index">
+						<view class="list_title">
+							<view class="txt_left">商品名称</view>
+							<view class="txt_right">{{item.goodsName}}</view>
+						</view>
+						<view class="list_item">
+							<view class="txt_left">应付金额</view>
+							<view class="txt_right_price">¥ {{item.standPrice}}</view>
+						</view>
+					</view> -->
           <view
             v-for="(item, index) in shoppingCartList"
             :key="index"
@@ -23,9 +33,6 @@
                 {{ item.goodsName }}
               </view>
               <view class="priceTag"> ¥ {{ item.standPrice }} </view>
-              <view class="priceTag" v-if="item.sevenYear">{{
-                item.selectYearList.toString()
-              }}</view>
               <Class-time-tip
                 v-if="item.gradObj && item.gradObj.gradeId"
                 :classInfo="item.gradObj"
@@ -77,11 +84,9 @@
       </view>
 
       <view style="display: flex; color: #ffffff; align-items: center">
-        <!-- <view class="btn2" @click="pay()">确认支付</view> -->
         <button class="btn2" @click="pay()" :disabled="btnNo">确认支付</button>
       </view>
     </view>
-    <!-- <button class="bottomBtn" @click="pay()" :disabled="btnNo">确认支付</button> -->
 
     <u-modal
       v-model="showModal"
@@ -100,10 +105,9 @@
 </template>
 
 <script>
-import { mapGetters } from "vuex";
+import { mapGetters, mapActions } from "vuex";
 import { getQueryString } from "../../common/navTo";
 import ClassTimeTip from "../../components/common/ClassTimeTip.vue";
-import { forEach } from "../../pages3/static/polyv-sdk/common/chat/emotionList";
 export default {
   data() {
     return {
@@ -147,9 +151,9 @@ export default {
     // #ifdef H5
     this.authorize();
     // #endif
-    console.log(this.shoppingCartList, 798);
   },
   methods: {
+    ...mapActions(["getUserInfo"]),
     authorize() {
       if (location.search.includes("code")) {
         const code = getQueryString("code");
@@ -194,7 +198,39 @@ export default {
           }
         });
     },
-    postOrder() {
+    // 二建 && 七大员 需要先完善信息
+    async checkNeedInfo() {
+      let keys = [];
+      this.shoppingCartList.forEach((item) => {
+        if (item.erJianErZao) {
+          keys.push("realname", "idCard");
+        }
+        if (item.jjShiGongYuan) {
+          keys.push("realname", "idCard", "sex", "companyName", "eduLevel");
+        }
+      });
+      if (keys.length) {
+        if (!this.userInfo) await this.getUserInfo();
+        if (keys.some((key) => !this.userInfo[key])) {
+          uni.showModal({
+            title: "提示",
+            content: "请先完善个人信息!",
+            success: (res) => {
+              if (res.confirm) {
+                uni.navigateTo({
+                  url:
+                    "/pages2/verify/info_fill?keys=" +
+                    Array.from(new Set(keys)).toString(),
+                });
+              }
+            },
+          });
+          return false;
+        }
+      }
+      return true;
+    },
+    async postOrder() {
       let list = this.shoppingCartList;
       for (let i = 0; i < list.length; i++) {
         let item = list[i];
@@ -222,20 +258,6 @@ export default {
           item.distributionCode = this.options.distributionCode;
         }
       }
-      // 处理七大员多年份==>多商品
-      list
-        .filter((item) => item.sevenYear)
-        .forEach((item) => {
-          let yearList = item.selectYearList;
-          if (item.sevenYear && yearList) {
-            item.sevenYear = yearList[0];
-            for (let j = 1; j < yearList.length; j++) {
-              let cItem = JSON.parse(JSON.stringify(item));
-              cItem.sevenYear = yearList[j];
-              list.push(cItem);
-            }
-          }
-        });
       let data = { goodsList: list };
       // 邀请码
       if (this.sac) {
@@ -429,14 +451,16 @@ export default {
         }
       });
     },
-    pay() {
+    async pay() {
+      if (!(await this.checkNeedInfo())) {
+        return;
+      }
       let self = this;
       this.btnNo = true;
       // #ifdef MP-WEIXIN
       uni.login({
         provider: "weixin",
         success: function (loginRes) {
-          console.log(loginRes, 69);
           self.getOpenid(loginRes.code);
         },
       });
@@ -465,12 +489,10 @@ export default {
   computed: {
     ...mapGetters(["userInfo", "shoppingCartList", "sac", "config"]),
     totalPrice() {
-      let price = 0;
-      this.shoppingCartList.forEach((e) => {
-        let multiple = e.selectYearList?.length || 1;
-        price += e.standPrice * multiple;
-      });
-      return price;
+      return this.shoppingCartList.reduce(
+        (a, b) => a + Number(b.standPrice),
+        0
+      );
     },
   },
   components: { ClassTimeTip },

+ 460 - 409
pages2/subject/collect.vue

@@ -1,429 +1,480 @@
 <template>
-	<view class="safeArea">
-		<nav-bar title="收藏集" class="nav"></nav-bar>
-		<view class="sceenBox">
-			<view :class="['item', {'active':sceenType===1} ]" @click="showSceen(1)">全部题库记录<u-icon class="icon" :class="sceenType ===1 ? 'animals':''"  name="arrow-down"></u-icon></view>
-			<view :class="['item', {'active':sceenType===2} ]" @click="showSceen(2)">全部试卷类型<u-icon class="icon" :class="sceenType ===2 ? 'animals':''"  name="arrow-down"></u-icon></view>
-		</view>
-		<view class="sceenModel" v-if="sceenType"  :style="{top:modalTop+'px'}" >
-			<view class="sceenModelBg" @click="hideSceen"></view>
-			<view class="sceenMain" >
-				<scroll-view scroll-y="true" style="height:100%">
-					<div class="sceenMainContent">
-						<template v-if="sceenType===1">
-							<view :class="['item',{'active':item.checked}]" v-for="(item, index) in scennList1" :key="index" @click="choseRecord(index)">{{item.goodsName}}</view>
-						</template>
-						<template v-if="sceenType===2">
-							<view :class="['item',{'active':item.checked}]" v-for="(item, index) in scennList2" :key="index" @click="choseType(index)">{{item.paperName}}</view>
-						</template>
-					</div>
-					
-				</scroll-view>
-				
-			</view>
-		</view>
-		<view class="wrap">
-			<view class="wrongTab">
-				<view class="item" :class="{active:type == 1}" @click="selectType(1)">试卷归类</view>
-				<view class="item" :class="{active:type == 2}" @click="selectType(2)">题型归类</view>
-			</view>
-			<view class="wrongHead">
-				<view class="title">收藏统计</view>
-				<view class="progress">
-					<text>{{total}}</text>
-				</view>
-			</view>
-			<view class="wrongList" v-if="type == 1">
-				<view class="item" v-for="(item,index) in testList.rows" :key="index">
-					<view class="title">{{item.examName}}</view>
-					<view class="bt">
-						<view class="left">收藏数<text class="num">{{item.questionNum}}</text></view>
-						<view class="right">
-							<navigator  hover-class="none" :url="'/pages2/subject/collectBank?examId='+item.examId + '&distinction=1' + '&doMode=' + item.doMode">
-								<view class="btn">重做</view>
-							</navigator>
-							<navigator  hover-class="none" :url="'/pages2/subject/collectBank?examId='+item.examId+'&explain=1' + '&distinction=1'+ '&doMode=' + item.doMode">
-								<view class="btn">解析</view>
-							</navigator>
-							<!-- <view class="btn">解析</view> -->
-						</view>
-					</view>
-				</view> 
-			</view>
-			
-			<view class="wrongList" v-if="type == 2">
-				<view class="item" v-for="(item,index) in typeList.rows" :key="index">
-					<view class="title">
-						<text v-if="item.type==1">单选题</text>
-						<text v-if="item.type==2">多选题</text>
-						<text v-if="item.type==3">判断题</text>
-						<text v-if="item.type==4">案例题</text>
-						<text v-if="item.type==5">简答题</text>
-					</view>
-					<view class="bt">
-						<view class="left">收藏数<text class="num">{{item.num}}</text></view>
-						<view class="right">
-							<navigator  hover-class="none" :url="'/pages2/subject/collectBank?type='+item.type + '&distinction=2'+ '&doMode=' + item.doMode">
-								<view class="btn">重做</view>
-							</navigator>
-							<navigator  hover-class="none" :url="'/pages2/subject/collectBank?type='+item.type+'&explain=1' + '&distinction=2'+ '&doMode=' + item.doMode">
-								<view class="btn">解析</view>
-							</navigator>
-							<!-- <navigator  hover-class="none" :url="'/pages2/subject/collectTypeBank?type='+item.type + '&distinction=2'">
-								<view class="btn">重做</view>
-							</navigator>
-							<navigator  hover-class="none" :url="'/pages2/subject/collectTypeBank?type='+item.type+'&explain=1' + '&distinction=2'">
-								<view class="btn">解析</view>
-							</navigator> -->
-						</view>
-					</view>
-				</view>
-			</view>
-		</view>
-	</view>
+  <view class="safeArea">
+    <nav-bar title="收藏集" class="nav"></nav-bar>
+    <view class="sceenBox" v-if="!isOther">
+      <view :class="['item', { active: sceenType === 1 }]" @click="showSceen(1)"
+        >全部题库记录<u-icon
+          class="icon"
+          :class="sceenType === 1 ? 'animals' : ''"
+          name="arrow-down"
+        ></u-icon
+      ></view>
+      <view :class="['item', { active: sceenType === 2 }]" @click="showSceen(2)"
+        >全部试卷类型<u-icon
+          class="icon"
+          :class="sceenType === 2 ? 'animals' : ''"
+          name="arrow-down"
+        ></u-icon
+      ></view>
+    </view>
+    <view class="sceenModel" v-if="sceenType">
+      <view class="sceenModelBg" @click="hideSceen"></view>
+      <view class="sceenMain">
+        <scroll-view scroll-y="true" style="height: 100%">
+          <div class="sceenMainContent">
+            <template v-if="sceenType === 1">
+              <view
+                :class="['item', { active: item.checked }]"
+                v-for="(item, index) in scennList1"
+                :key="index"
+                @click="choseRecord(index)"
+                >{{ item.goodsName }}</view
+              >
+            </template>
+            <template v-if="sceenType === 2">
+              <view
+                :class="['item', { active: item.checked }]"
+                v-for="(item, index) in scennList2"
+                :key="index"
+                @click="choseType(index)"
+                >{{ item.paperName }}</view
+              >
+            </template>
+          </div>
+        </scroll-view>
+      </view>
+    </view>
+    <view :class="isOther ? 'wrap1' : 'wrap'">
+      <view class="wrongTab" v-if="!isOther">
+        <view class="item" :class="{ active: type == 1 }" @click="selectType(1)"
+          >试卷归类</view
+        >
+        <view class="item" :class="{ active: type == 2 }" @click="selectType(2)"
+          >题型归类</view
+        >
+      </view>
+      <view class="wrongHead">
+        <view class="title">收藏统计</view>
+        <view class="progress">
+          <text>{{ total }}</text>
+        </view>
+      </view>
+      <view class="wrongList" v-if="type == 1">
+        <view class="item" v-for="(item, index) in testList.rows" :key="index">
+          <view class="title">{{ item.examName }}</view>
+          <view class="bt">
+            <view class="left"
+              >收藏数<text class="num">{{ item.questionNum }}</text></view
+            >
+            <view class="right">
+              <navigator
+                hover-class="none"
+                :url="
+                  '/pages2/subject/collectBank?examId=' +
+                  item.examId +
+                  '&distinction=1' +
+                  '&doMode=' +
+                  item.doMode
+                "
+              >
+                <view class="btn">重做</view>
+              </navigator>
+              <navigator
+                hover-class="none"
+                :url="
+                  '/pages2/subject/collectBank?examId=' +
+                  item.examId +
+                  '&explain=1' +
+                  '&distinction=1' +
+                  '&doMode=' +
+                  item.doMode
+                "
+              >
+                <view class="btn">解析</view>
+              </navigator>
+              <!-- <view class="btn">解析</view> -->
+            </view>
+          </view>
+        </view>
+      </view>
+
+      <view class="wrongList" v-if="type == 2">
+        <view class="item" v-for="(item, index) in typeList.rows" :key="index">
+          <view class="title">
+            <text v-if="item.type == 1">单选题</text>
+            <text v-if="item.type == 2">多选题</text>
+            <text v-if="item.type == 3">判断题</text>
+            <text v-if="item.type == 4">案例题</text>
+            <text v-if="item.type == 5">简答题</text>
+          </view>
+          <view class="bt">
+            <view class="left"
+              >收藏数<text class="num">{{ item.num }}</text></view
+            >
+            <view class="right">
+              <navigator
+                hover-class="none"
+                :url="
+                  '/pages2/subject/collectBank?type=' +
+                  item.type +
+                  '&distinction=2' +
+                  '&doMode=' +
+                  item.doMode
+                "
+              >
+                <view class="btn">重做</view>
+              </navigator>
+              <navigator
+                hover-class="none"
+                :url="
+                  '/pages2/subject/collectBank?type=' +
+                  item.type +
+                  '&explain=1' +
+                  '&distinction=2' +
+                  '&doMode=' +
+                  item.doMode
+                "
+              >
+                <view class="btn">解析</view>
+              </navigator>
+            </view>
+          </view>
+        </view>
+      </view>
+    </view>
+  </view>
 </template>
 
 <script>
-import { mapGetters } from 'vuex';
+import { mapGetters } from "vuex";
 export default {
-	components: {},
-	data() {
-		return {
-			sceenType: null,
-			scennList1:[
-				{goodsId: '', goodsName: '全部题库记录', checked: true}
-			],
-			scennList2:[
-				{paperId: '', paperName: '全部试卷类型', checked: true}
-			],
-			type:1,
-			total:0,
-			modalTop:0,
-			testList:[],
-			typeList:[],
-			goodsid:'',
-			orderGoodsId:'',
-			paperid:''
-		};
-	},
-	onPullDownRefresh() {},
-	onLoad(option) {
-		this.orderGoodsId = option.orderGoodsId || '';
-		this.listGoodsUserQuestion();
-		this.examaperList();
-		
-		
-		uni.getSystemInfo({
-			success:(e) => {
-				let info = uni.createSelectorQuery().select(".nav");
-				info.boundingClientRect((navData) => { //data - 各种参数
-				
-					let info = uni.createSelectorQuery().select(".sceenBox");
-					info.boundingClientRect((tabData) => { //data - 各种参数
-						this.modalTop = navData.height + tabData.height
-						console.log(navData) // 获取元素宽度
-						console.log(tabData) // 获取元素宽度
-					}).exec()
-				}).exec()
-			}
-		})
-	},
-	onShow() {
-		this.getData()
-	},
-	methods: {
-		getData() {
-			if(this.type == 1) {
-				this.goodsCollectExamList()
-			} else if(this.type == 2) {
-				this.collectQuestionTypeList();
-			}
-		},
-		examaperList() {
-			this.$api.examaperList({
-				
-			}).then(res => {
-				this.scennList2 = [...this.scennList2,...res.data.rows];
-			})
-		},
-		
-		listGoodsUserQuestion() {
-			this.$api.listGoodsUserQuestion({
-				
-			}).then(res => {
-				this.scennList1 = [...this.scennList1,...res.data.rows];
-			})
-		},
-		goodsCollectExamList() {
-			this.$api.goodsCollectExamList({
-				paperId:this.paperid,
-				goodsId:this.goodsid,
-				orderGoodsId:this.orderGoodsId
-			}).then(res => {
-				this.testList = res.data 
-				let total = 0;
-				this.testList.rows.forEach(item => {
-					total += item.questionNum;
-				})
-				
-				this.total = total
-			})
-		},
-		collectQuestionTypeList() {
-			// let params = {}
-			// this.paperid && (params['paperId'] = this.paperid)
-			// this.orderGoodsId && (params['orderGoodsId'])
-			this.$api.collectQuestionTypeList({
-				paperId:this.paperid,
-				orderGoodsId:this.orderGoodsId
-			}).then(res => {
-				this.typeList = res.data 
-				let total = 0;
-				this.typeList.rows.forEach(item => {
-					total += item.num;
-				})
-				
-				this.total = total
-			})
-		},
-		showSceen(type){
-			if(this.sceenType == type) {
-				this.sceenType = null
-				return;
-			}
-			this.sceenType = type
-		},
-		/**
-		 * @param {Object} tab切换
-		 */
-		selectType(type) {
-			this.type = type;
-			this.getData();
-		},
-		hideSceen(){
-			this.sceenType = null
-		},
-		choseRecord(index) {
-			this.sceenType = null
-			this.scennList1.forEach((item,idx)=>{
-				this.$set(item, 'checked',false)
-				if(index==idx){
-					this.goodsid = item.goodsId
-					this.$set(item, 'checked',true)
-				}
-			})
-			
-			this.getData()
-		},
-		choseType(index) {
-			this.sceenType = null
-			this.scennList2.forEach((item,idx)=>{
-				this.$set(item, 'checked',false)
-				if(index==idx){
-					this.paperid = item.paperId
-					this.$set(item, 'checked',true)
-				}
-			})
-			this.getData()
-		},
-	}
+  components: {},
+  data() {
+    return {
+      sceenType: null,
+      scennList1: [{ goodsId: "", goodsName: "全部题库记录", checked: true }],
+      scennList2: [{ paperId: "", paperName: "全部试卷类型", checked: true }],
+      type: 1,
+      total: 0,
+      testList: [],
+      typeList: [],
+      goodsid: "",
+      orderGoodsId: "",
+      paperid: "",
+      isOther: 0,
+    };
+  },
+  onPullDownRefresh() {},
+  onLoad(option) {
+    this.orderGoodsId = option.orderGoodsId || "";
+    this.isOther = option.isOther;
+    if (!this.isOther) {
+      this.listGoodsUserQuestion();
+      this.examaperList();
+    }
+  },
+  onShow() {
+    this.getData();
+  },
+  methods: {
+    getData() {
+      if (this.type == 1) {
+        this.goodsCollectExamList();
+      } else if (this.type == 2) {
+        this.collectQuestionTypeList();
+      }
+    },
+    examaperList() {
+      this.$api.examaperList({}).then((res) => {
+        this.scennList2 = [...this.scennList2, ...res.data.rows];
+      });
+    },
+
+    listGoodsUserQuestion() {
+      this.$api.listGoodsUserQuestion({ ...this.doMode }).then((res) => {
+        this.scennList1 = [...this.scennList1, ...res.data.rows];
+      });
+    },
+    goodsCollectExamList() {
+      this.$api
+        .goodsCollectExamList({
+          paperId: this.paperid,
+          goodsId: this.goodsid,
+          orderGoodsId: this.orderGoodsId,
+          ...this.doMode,
+        })
+        .then((res) => {
+          this.testList = res.data;
+          let total = 0;
+          this.testList.rows.forEach((item) => {
+            total += item.questionNum;
+          });
+
+          this.total = total;
+        });
+    },
+    collectQuestionTypeList() {
+      // let params = {}
+      // this.paperid && (params['paperId'] = this.paperid)
+      // this.orderGoodsId && (params['orderGoodsId'])
+      this.$api
+        .collectQuestionTypeList({
+          paperId: this.paperid,
+          orderGoodsId: this.orderGoodsId,
+        })
+        .then((res) => {
+          this.typeList = res.data;
+          let total = 0;
+          this.typeList.rows.forEach((item) => {
+            total += item.num;
+          });
+
+          this.total = total;
+        });
+    },
+    showSceen(type) {
+      if (this.sceenType == type) {
+        this.sceenType = null;
+        return;
+      }
+      this.sceenType = type;
+    },
+    /**
+     * @param {Object} tab切换
+     */
+    selectType(type) {
+      this.type = type;
+      this.getData();
+    },
+    hideSceen() {
+      this.sceenType = null;
+    },
+    choseRecord(index) {
+      this.sceenType = null;
+      this.scennList1.forEach((item, idx) => {
+        this.$set(item, "checked", false);
+        if (index == idx) {
+          this.goodsid = item.goodsId;
+          this.$set(item, "checked", true);
+        }
+      });
+
+      this.getData();
+    },
+    choseType(index) {
+      this.sceenType = null;
+      this.scennList2.forEach((item, idx) => {
+        this.$set(item, "checked", false);
+        if (index == idx) {
+          this.paperid = item.paperId;
+          this.$set(item, "checked", true);
+        }
+      });
+      this.getData();
+    },
+  },
+  computed: {
+    doMode() {
+      return this.isOther ? { doMode: 4 } : {};
+    },
+  },
 };
 </script>
 <style lang="scss">
 page {
-	background: #EAEEF1;
+  background: #eaeef1;
 }
-
 </style>
 <style scoped lang="scss">
-	.animals{
-		transition: all 0.3s;
-		transform: rotate(180deg);
-	}
+.animals {
+  transition: all 0.3s;
+  transform: rotate(180deg);
+}
 .sceenBox {
-	width:100%;
-	height: 80rpx;
-	background: #FFFFFF;
-	display: flex;
-	justify-content: center;
-	align-items: center;
-	font-size: 32rpx;
-	font-family: PingFang SC;
-	font-weight: 500;
-	color: #999999;
-	position: fixed;
-	z-index: 999;
-	border-bottom: 1px solid #eee;
-	.item{
-		flex:1;
-		text-align: center;
-		&.active{
-			color:#333;
-			font-weight: bold;
-			.icon{
-				transform: rotate(180deg);
-			}
-		}
-	}
+  width: 100%;
+  height: 80rpx;
+  background: #ffffff;
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  font-size: 32rpx;
+  font-family: PingFang SC;
+  font-weight: 500;
+  color: #999999;
+  position: fixed;
+  z-index: 999;
+  border-bottom: 1px solid #eee;
+  .item {
+    flex: 1;
+    text-align: center;
+    &.active {
+      color: #333;
+      font-weight: bold;
+      .icon {
+        transform: rotate(180deg);
+      }
+    }
+  }
+}
+.sceenModel {
+  left: 0;
+  bottom: 0;
+  top: 168rpx;
+  width: 100%;
+  position: fixed;
+  z-index: 998;
+  .sceenModelBg {
+    width: 100%;
+    height: 100%;
+    position: fixed;
+    background: rgba(0, 0, 0, 0.3);
+    z-index: 998;
+  }
+  .sceenMain {
+    position: relative;
+    z-index: 999;
+    background: #fff;
+    height: 80%;
+    .sceenMainContent {
+      display: flex;
+      flex-wrap: wrap;
+      padding: 8rpx;
+      justify-content: space-between;
+
+      .item {
+        width: 350rpx;
+        background: #f5f5f5;
+        border-radius: 16rpx;
+        padding: 25rpx 19rpx;
+        margin: 8rpx;
+        font-size: 32rpx;
+        font-family: PingFang SC;
+        font-weight: bold;
+        color: #666666;
+        &.active {
+          background: #007aff;
+          color: #fff;
+        }
+        &:first-child {
+          width: 100%;
+          text-align: center;
+        }
+      }
+    }
+  }
 }
-.sceenModel{
-	left:0;
-	bottom:0;
-	width:100%;
-	position: fixed;
-	z-index: 998;
-	.sceenModelBg{
-		width:100%;
-		height:100%;
-		position: fixed;
-		background: rgba(0,0,0,.3);
-		z-index: 998;
-	}
-	.sceenMain{
-		position: relative;
-		z-index: 999;
-		background: #fff;
-		height:80%;
-		.sceenMainContent {
-			
-			display: flex;
-			flex-wrap: wrap;
-			padding: 8rpx;
-			justify-content: space-between;
-			
-			.item{
-				width: 350rpx;
-				background: #F5F5F5;
-				border-radius: 16rpx;
-				padding: 25rpx 19rpx;
-				margin: 8rpx;
-				font-size: 32rpx;
-				font-family: PingFang SC;
-				font-weight: bold;
-				color: #666666;
-				&.active{
-					background: #007AFF;
-					color:#fff;
-				}
-				&:first-child{
-					width:100%;
-					text-align: center;
-				}
-			}
-		}
-		
-	}
+.wrap {
+  padding: 96rpx 16rpx 16rpx;
 }
-.wrap{
-	padding:96rpx 16rpx 16rpx;
+.wrap1 {
+  padding: 16rpx;
 }
-.wrongHead{
-	background: #FFFFFF;
-	border-radius: 16px;
-	padding:24rpx;
-	.title{
-		font-size: 30rpx;
-		font-family: PingFang SC;
-		font-weight: bold;
-		color: #333333;
-		.sub{
-			font-size: 20rpx;
-			font-weight: 500;
-			color: #999999;
-		}
-	}
-	.progress{
-		width: 180rpx;
-		height: 180rpx;
-		line-height: 140rpx;
-		border: 20rpx solid #EEEEEE;
-		border-radius: 50%;
-		margin: 24rpx auto;
-		font-size: 50rpx;
-		text-align: center;
-		
-	}
+.wrongHead {
+  background: #ffffff;
+  border-radius: 16px;
+  padding: 24rpx;
+  .title {
+    font-size: 30rpx;
+    font-family: PingFang SC;
+    font-weight: bold;
+    color: #333333;
+    .sub {
+      font-size: 20rpx;
+      font-weight: 500;
+      color: #999999;
+    }
+  }
+  .progress {
+    width: 180rpx;
+    height: 180rpx;
+    line-height: 140rpx;
+    border: 20rpx solid #eeeeee;
+    border-radius: 50%;
+    margin: 24rpx auto;
+    font-size: 50rpx;
+    text-align: center;
+  }
 }
-.wrongTab{
-	display: flex;
-	margin: 24rpx 0;
-	.item{
-		width: 144rpx;
-		height: 48rpx;
-		line-height: 48rpx;
-		text-align: center;
-		background: #fff;
-		border-radius: 16px;
-		font-size: 28rpx;
-		font-family: PingFang SC;
-		font-weight: 500;
-		color: #666666;
-		margin-left: 15rpx;
-		&.active{
-			background: #007AFF;
-			color: #fff;
-		}
-	}
+.wrongTab {
+  display: flex;
+  margin: 24rpx 0;
+  .item {
+    width: 144rpx;
+    height: 48rpx;
+    line-height: 48rpx;
+    text-align: center;
+    background: #fff;
+    border-radius: 16px;
+    font-size: 28rpx;
+    font-family: PingFang SC;
+    font-weight: 500;
+    color: #666666;
+    margin-left: 15rpx;
+    &.active {
+      background: #007aff;
+      color: #fff;
+    }
+  }
 }
-.wrongList{
-	margin-top:20rpx;
-	.item{
-		background: #FFFFFF;
-		border-radius: 16rpx;
-		padding: 0 30rpx;
-		margin-bottom: 16rpx;
-		overflow: hidden;
-		.title{
-			font-size: 32rpx;
-			font-family: PingFang SC;
-			font-weight: bold;
-			color: #333333;
-			margin: 40rpx 0 17rpx;
-		}
-		.bt{
-			display: flex;
-			justify-content: space-between;
-			align-items: center;
-			padding-bottom: 24rpx;
-			.left{
-				width: 176rpx;
-				height: 40rpx;
-				background: #FFFFFF;
-				border: 1px solid #EEEEEE;
-				border-radius: 16rpx;
-				font-size: 26rpx;
-				font-family: PingFang SC;
-				font-weight: 500;
-				color: #999999;
-				display: flex;
-				justify-content: center;
-				align-items: center;
-				.num{
-					font-size: 26rpx;
-					font-weight: bold;
-					color: #FF3B30;
-					margin-left: 16rpx;
-				}
-			}
-			.right{
-				display: flex;
-				.btn{
-					width: 100rpx;
-					height: 48rpx;
-					background: #FFFFFF;
-					border: 1px solid #007AFF;
-					border-radius: 16px;
-					font-size: 24rpx;
-					font-family: PingFang SC;
-					font-weight: 500;
-					color: #007AFF;
-					margin-left:9rpx;
-					display: flex;
-					align-items: center;
-					justify-content: center;
-				}
-			}
-		}
-	}
+.wrongList {
+  margin-top: 20rpx;
+  .item {
+    background: #ffffff;
+    border-radius: 16rpx;
+    padding: 0 30rpx;
+    margin-bottom: 16rpx;
+    overflow: hidden;
+    .title {
+      font-size: 32rpx;
+      font-family: PingFang SC;
+      font-weight: bold;
+      color: #333333;
+      margin: 40rpx 0 17rpx;
+    }
+    .bt {
+      display: flex;
+      justify-content: space-between;
+      align-items: center;
+      padding-bottom: 24rpx;
+      .left {
+        width: 176rpx;
+        height: 40rpx;
+        background: #ffffff;
+        border: 1px solid #eeeeee;
+        border-radius: 16rpx;
+        font-size: 26rpx;
+        font-family: PingFang SC;
+        font-weight: 500;
+        color: #999999;
+        display: flex;
+        justify-content: center;
+        align-items: center;
+        .num {
+          font-size: 26rpx;
+          font-weight: bold;
+          color: #ff3b30;
+          margin-left: 16rpx;
+        }
+      }
+      .right {
+        display: flex;
+        .btn {
+          width: 100rpx;
+          height: 48rpx;
+          background: #ffffff;
+          border: 1px solid #007aff;
+          border-radius: 16px;
+          font-size: 24rpx;
+          font-family: PingFang SC;
+          font-weight: 500;
+          color: #007aff;
+          margin-left: 9rpx;
+          display: flex;
+          align-items: center;
+          justify-content: center;
+        }
+      }
+    }
+  }
 }
 </style>

+ 437 - 393
pages2/subject/wrong.vue

@@ -1,413 +1,457 @@
 <template>
-	<view class="safeArea">
-		<nav-bar title="错题集"  class="nav"></nav-bar>
-		<view class="sceenBox">
-			<view :class="['item', {'active':sceenType===1} ]" @click="showSceen(1)">全部题库记录<u-icon class="icon" :class="sceenType ===1 ? 'animals':''"  name="arrow-down"></u-icon></view>
-			<view :class="['item', {'active':sceenType===2} ]" @click="showSceen(2)">全部试卷类型<u-icon class="icon" :class="sceenType ===2? 'animals':''"  name="arrow-down"></u-icon></view>
-		</view>
-		<view class="sceenModel" v-if="sceenType" :style="{top:modalTop+'px'}" >
-			<view class="sceenModelBg" @click="hideSceen"></view>
-			<view class="sceenMain">
-				<scroll-view scroll-y="true" style="height:100%">
-					<view class="sceenMainContent">
-						<template v-if="sceenType===1">
-							<view :class="['item',{'active':item.checked}]" v-for="(item, index) in scennList1" :key="index" @click="choseRecord(index)">{{item.goodsName}}</view>
-						</template>
-						<template v-if="sceenType===2">
-							<view :class="['item',{'active':item.checked}]" v-for="(item, index) in scennList2" :key="index" @click="choseType(index)">{{item.paperName}}</view>
-						</template>
-					</view>
-				</scroll-view>
-				
-			</view>
-		</view>
-		<view class="wrap">
-			<view class="wrongTab">
-				<view class="item" :class="{active:type == 1}" @click="selectType(1)">试卷归类</view>
-				<view class="item" :class="{active:type == 2}" @click="selectType(2)">题型归类</view>
-			</view>
-			<view class="wrongHead">
-				<view class="title">错题统计<text class="sub">(不含简答和案例题)</text></view>
-				<view class="progress">
-					<text>{{total}}</text>
-				</view>
-			</view> 
-			<view class="wrongList" v-if="type == 1">
-				<view class="item" v-for="(item,index) in testList.rows" :key="index">
-					<view class="title">{{item.examName}}</view>
-					<view class="bt">
-						<view class="left">错题数<text class="num">{{item.wrongQuestionNum}}</text></view>
-						<view class="right">
-							<navigator  hover-class="none" :url="'/pages2/subject/wrongBank?examId='+item.examId">
-								<view class="btn">重做</view>
-							</navigator>
-							<navigator  hover-class="none" :url="'/pages2/subject/wrongBank?examId='+item.examId+'&explain=1'">
-								<view class="btn">解析</view>
-							</navigator>
-							<!-- <view class="btn">解析</view> -->
-						</view>
-					</view>
-				</view>
-			</view>
-			
-			<view class="wrongList" v-if="type == 2">
-				<view class="item" v-for="(item,index) in typeList.rows" :key="index">
-					<view class="title">
-						<text v-if="item.type==1">单选题</text>
-						<text v-if="item.type==2">多选题</text>
-						<text v-if="item.type==3">判断题</text>
-						<text v-if="item.type==4">案例题</text>
-						<text v-if="item.type==5">简答题</text>
-					</view>
-					<view class="bt">
-						<view class="left">错题数<text class="num">{{item.num}}</text></view>
-						<view class="right">
-							<navigator  hover-class="none" :url="'/pages2/subject/wrongTypeBank?type='+item.type">
-								<view class="btn">重做</view>
-							</navigator>
-							<navigator  hover-class="none" :url="'/pages2/subject/wrongTypeBank?type='+item.type+'&explain=1'">
-								<view class="btn">解析</view>
-							</navigator>
-						</view>
-					</view>
-				</view>
-			</view>
-		</view>
-	</view>
+  <view class="safeArea">
+    <nav-bar title="错题集" class="nav"></nav-bar>
+    <view class="sceenBox" v-if="!isOther">
+      <view :class="['item', { active: sceenType === 1 }]" @click="showSceen(1)"
+        >全部题库记录<u-icon
+          class="icon"
+          :class="sceenType === 1 ? 'animals' : ''"
+          name="arrow-down"
+        ></u-icon
+      ></view>
+      <view :class="['item', { active: sceenType === 2 }]" @click="showSceen(2)"
+        >全部试卷类型<u-icon
+          class="icon"
+          :class="sceenType === 2 ? 'animals' : ''"
+          name="arrow-down"
+        ></u-icon
+      ></view>
+    </view>
+    <view class="sceenModel" v-if="sceenType">
+      <view class="sceenModelBg" @click="hideSceen"></view>
+      <view class="sceenMain">
+        <scroll-view scroll-y="true" style="height: 100%">
+          <view class="sceenMainContent">
+            <template v-if="sceenType === 1">
+              <view
+                :class="['item', { active: item.checked }]"
+                v-for="(item, index) in scennList1"
+                :key="index"
+                @click="choseRecord(index)"
+                >{{ item.goodsName }}</view
+              >
+            </template>
+            <template v-if="sceenType === 2">
+              <view
+                :class="['item', { active: item.checked }]"
+                v-for="(item, index) in scennList2"
+                :key="index"
+                @click="choseType(index)"
+                >{{ item.paperName }}</view
+              >
+            </template>
+          </view>
+        </scroll-view>
+      </view>
+    </view>
+    <view :class="isOther ? 'wrap1' : 'wrap'">
+      <view class="wrongTab" v-if="!isOther">
+        <view class="item" :class="{ active: type == 1 }" @click="selectType(1)"
+          >试卷归类</view
+        >
+        <view class="item" :class="{ active: type == 2 }" @click="selectType(2)"
+          >题型归类</view
+        >
+      </view>
+      <view class="wrongHead">
+        <view class="title"
+          >错题统计<text class="sub">(不含简答和案例题)</text></view
+        >
+        <view class="progress">
+          <text>{{ total }}</text>
+        </view>
+      </view>
+      <view class="wrongList" v-if="type == 1">
+        <view class="item" v-for="(item, index) in testList.rows" :key="index">
+          <view class="title">{{ item.examName }}</view>
+          <view class="bt">
+            <view class="left"
+              >错题数<text class="num">{{ item.wrongQuestionNum }}</text></view
+            >
+            <view class="right">
+              <navigator
+                hover-class="none"
+                :url="'/pages2/subject/wrongBank?examId=' + item.examId"
+              >
+                <view class="btn">重做</view>
+              </navigator>
+              <navigator
+                hover-class="none"
+                :url="
+                  '/pages2/subject/wrongBank?examId=' +
+                  item.examId +
+                  '&explain=1'
+                "
+              >
+                <view class="btn">解析</view>
+              </navigator>
+              <!-- <view class="btn">解析</view> -->
+            </view>
+          </view>
+        </view>
+      </view>
+
+      <view class="wrongList" v-if="type == 2">
+        <view class="item" v-for="(item, index) in typeList.rows" :key="index">
+          <view class="title">
+            <text v-if="item.type == 1">单选题</text>
+            <text v-if="item.type == 2">多选题</text>
+            <text v-if="item.type == 3">判断题</text>
+            <text v-if="item.type == 4">案例题</text>
+            <text v-if="item.type == 5">简答题</text>
+          </view>
+          <view class="bt">
+            <view class="left"
+              >错题数<text class="num">{{ item.num }}</text></view
+            >
+            <view class="right">
+              <navigator
+                hover-class="none"
+                :url="'/pages2/subject/wrongTypeBank?type=' + item.type"
+              >
+                <view class="btn">重做</view>
+              </navigator>
+              <navigator
+                hover-class="none"
+                :url="
+                  '/pages2/subject/wrongTypeBank?type=' +
+                  item.type +
+                  '&explain=1'
+                "
+              >
+                <view class="btn">解析</view>
+              </navigator>
+            </view>
+          </view>
+        </view>
+      </view>
+    </view>
+  </view>
 </template>
 
 <script>
-import { mapGetters } from 'vuex';
+import { mapGetters } from "vuex";
 export default {
-	components: {},
-	data() {
-		return {
-			sceenType: null,
-			scennList1:[
-				{goodsId: '', goodsName: '全部题库记录', checked: true}
-			],
-			scennList2:[
-				{paperId: '', paperName: '全部试卷类型', checked: true}
-			],
-			type:1,
-			testList:[],
-			typeList:[],
-			goodsid:'',
-			paperid:'',
-			total:0,
-			orderGoodsId:'',
-			modalTop:0,
-		};
-	},
-	onPullDownRefresh() {},
-	onShow() {
-		this.getData();
-	},
-	onLoad(option) {
-		this.orderGoodsId = option.orderGoodsId || ''
-		this.listGoodsUserQuestion();
-		this.examaperList();
-		
-		uni.getSystemInfo({
-			success:(e) => {
-				let info = uni.createSelectorQuery().select(".nav");
-				info.boundingClientRect((navData) => { //data - 各种参数
-				
-					let info = uni.createSelectorQuery().select(".sceenBox");
-					info.boundingClientRect((tabData) => { //data - 各种参数
-						this.modalTop = navData.height + tabData.height
-						console.log(navData) // 获取元素宽度
-						console.log(tabData) // 获取元素宽度
-					}).exec()
-				}).exec()
-			}
-		})
-	},
-	methods: {
-		getData() {
-			if(this.type == 1) {
-				this.wrongRecordList()
-			} else if(this.type == 2) {
-				this.wrongRecordTypeList();
-			}
-		},
-		examaperList() {
-			this.$api.examaperList({
-				
-			}).then(res => {
-				this.scennList2 = [...this.scennList2,...res.data.rows];
-			})
-		},
-		
-		listGoodsUserQuestion() {
-			this.$api.listGoodsUserQuestion({
-				
-			}).then(res => {
-				this.scennList1 = [...this.scennList1,...res.data.rows];
-			})
-		},
-		wrongRecordList() {
-			this.$api.wrongRecordList({
-				paperId:this.paperid,
-				goodsId:this.goodsid,
-				orderGoodsId:this.orderGoodsId
-			}).then(res => {
-				this.testList = res.data;
-				let total = 0;
-				this.testList.rows.forEach(item => {
-					total += item.wrongQuestionNum;
-				})
-				
-				this.total = total
-			})
-		},
-		wrongRecordTypeList() {
-			this.$api.wrongRecordTypeList({
-				paperId:this.paperid,
-				orderGoodsId:this.orderGoodsId
-			}).then(res => {
-				this.typeList = res.data;
-				
-				let total = 0;
-				this.typeList.rows.forEach(item => {
-					total += item.num;
-				})
-				
-				this.total = total
-			})
-		},
-		selectType(type) {
-			this.type = type;
-			this.getData();
-		},
-		showSceen(type){
-			if(this.sceenType == type) {
-				this.sceenType = null
-				return;
-			}
-			this.sceenType = type
-		},
-		hideSceen(){
-			this.sceenType = null
-		},
-		choseRecord(index) {
-			this.sceenType = null
-			this.scennList1.forEach((item,idx)=>{
-				this.$set(item, 'checked',false)
-				if(index==idx){
-					this.goodsid = item.goodsId
-					this.$set(item, 'checked',true)
-				}
-			})
-			
-			this.getData()
-		},
-		choseType(index) {
-			this.sceenType = null
-			this.scennList2.forEach((item,idx)=>{
-				this.$set(item, 'checked',false)
-				if(index==idx){
-					this.paperid = item.paperId
-					this.$set(item, 'checked',true)
-				}
-			})
-			this.getData()
-		},
-	}
+  components: {},
+  data() {
+    return {
+      sceenType: null,
+      scennList1: [{ goodsId: "", goodsName: "全部题库记录", checked: true }],
+      scennList2: [{ paperId: "", paperName: "全部试卷类型", checked: true }],
+      type: 1,
+      testList: [],
+      typeList: [],
+      goodsid: "",
+      paperid: "",
+      total: 0,
+      orderGoodsId: "",
+      isOther: 0,
+    };
+  },
+  onPullDownRefresh() {},
+  onShow() {
+    this.getData();
+  },
+  onLoad(option) {
+    this.orderGoodsId = option.orderGoodsId || "";
+    this.isOther = option.isOther;
+    if (!this.isOther) {
+      this.listGoodsUserQuestion();
+      this.examaperList();
+    }
+  },
+  methods: {
+    getData() {
+      if (this.type == 1) {
+        this.wrongRecordList();
+      } else if (this.type == 2) {
+        this.wrongRecordTypeList();
+      }
+    },
+    examaperList() {
+      this.$api.examaperList({}).then((res) => {
+        this.scennList2 = [...this.scennList2, ...res.data.rows];
+      });
+    },
+
+    listGoodsUserQuestion() {
+      this.$api.listGoodsUserQuestion({}).then((res) => {
+        this.scennList1 = [...this.scennList1, ...res.data.rows];
+      });
+    },
+    wrongRecordList() {
+      this.$api
+        .wrongRecordList({
+          paperId: this.paperid,
+          goodsId: this.goodsid,
+          orderGoodsId: this.orderGoodsId,
+          ...this.doMode,
+        })
+        .then((res) => {
+          this.testList = res.data;
+          let total = 0;
+          this.testList.rows.forEach((item) => {
+            total += item.wrongQuestionNum;
+          });
+
+          this.total = total;
+        });
+    },
+    wrongRecordTypeList() {
+      this.$api
+        .wrongRecordTypeList({
+          paperId: this.paperid,
+          orderGoodsId: this.orderGoodsId,
+        })
+        .then((res) => {
+          this.typeList = res.data;
+
+          let total = 0;
+          this.typeList.rows.forEach((item) => {
+            total += item.num;
+          });
+
+          this.total = total;
+        });
+    },
+    selectType(type) {
+      this.type = type;
+      this.getData();
+    },
+    showSceen(type) {
+      if (this.sceenType == type) {
+        this.sceenType = null;
+        return;
+      }
+      this.sceenType = type;
+    },
+    hideSceen() {
+      this.sceenType = null;
+    },
+    choseRecord(index) {
+      this.sceenType = null;
+      this.scennList1.forEach((item, idx) => {
+        this.$set(item, "checked", false);
+        if (index == idx) {
+          this.goodsid = item.goodsId;
+          this.$set(item, "checked", true);
+        }
+      });
+
+      this.getData();
+    },
+    choseType(index) {
+      this.sceenType = null;
+      this.scennList2.forEach((item, idx) => {
+        this.$set(item, "checked", false);
+        if (index == idx) {
+          this.paperid = item.paperId;
+          this.$set(item, "checked", true);
+        }
+      });
+      this.getData();
+    },
+  },
+  computed: {
+    doMode() {
+      return this.isOther ? { doMode: 4 } : {};
+    },
+  },
 };
 </script>
 <style lang="scss">
 page {
-	background: #EAEEF1;
+  background: #eaeef1;
 }
-
 </style>
 <style scoped lang="scss">
-	.animals{
-		transition: all 0.3s;
-		transform: rotate(180deg);
-	}
+.animals {
+  transition: all 0.3s;
+  transform: rotate(180deg);
+}
 .sceenBox {
-	width:100%;
-	height: 80rpx;
-	background: #FFFFFF;
-	display: flex;
-	justify-content: center;
-	align-items: center;
-	font-size: 32rpx;
-	font-family: PingFang SC;
-	font-weight: 500;
-	color: #999999;
-	position: fixed;
-	z-index: 999;
-	border-bottom: 1px solid #eee;
-	.item{
-		flex:1;
-		text-align: center;
-		&.active{
-			color:#333;
-			font-weight: bold;
-			.icon{
-				transform: rotate(180deg);
-			}
-		}
-	}
+  width: 100%;
+  height: 80rpx;
+  background: #ffffff;
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  font-size: 32rpx;
+  font-family: PingFang SC;
+  font-weight: 500;
+  color: #999999;
+  position: fixed;
+  z-index: 999;
+  border-bottom: 1px solid #eee;
+  .item {
+    flex: 1;
+    text-align: center;
+    &.active {
+      color: #333;
+      font-weight: bold;
+      .icon {
+        transform: rotate(180deg);
+      }
+    }
+  }
+}
+.sceenModel {
+  left: 0;
+  bottom: 0;
+  width: 100%;
+  position: fixed;
+  z-index: 998;
+  .sceenModelBg {
+    width: 100%;
+    height: 100%;
+    position: fixed;
+    background: rgba(0, 0, 0, 0.3);
+    z-index: 998;
+  }
+  .sceenMain {
+    position: relative;
+    z-index: 999;
+    background: #fff;
+    height: 80%;
+    .sceenMainContent {
+      display: flex;
+      flex-wrap: wrap;
+      padding: 8rpx;
+      justify-content: space-between;
+      .item {
+        width: 350rpx;
+        background: #f5f5f5;
+        border-radius: 16rpx;
+        padding: 25rpx 19rpx;
+        margin: 8rpx;
+        font-size: 32rpx;
+        font-family: PingFang SC;
+        font-weight: bold;
+        color: #666666;
+        &.active {
+          background: #007aff;
+          color: #fff;
+        }
+        &:first-child {
+          width: 100%;
+          text-align: center;
+        }
+      }
+    }
+  }
 }
-.sceenModel{
-	left:0;
-	bottom:0;
-	width:100%;
-	position: fixed;
-	z-index: 998;
-	.sceenModelBg{
-		width:100%;
-		height:100%;
-		position: fixed;
-		background: rgba(0,0,0,.3);
-		z-index: 998;
-	}
-	.sceenMain{
-		position: relative;
-		z-index: 999;
-		background: #fff;
-		height:80%;
-		.sceenMainContent {
-			
-			display: flex;
-			flex-wrap: wrap;
-			padding: 8rpx;
-			justify-content: space-between;
-				.item{
-					width: 350rpx;
-					background: #F5F5F5;
-					border-radius: 16rpx;
-					padding: 25rpx 19rpx;
-					margin: 8rpx;
-					font-size: 32rpx;
-					font-family: PingFang SC;
-					font-weight: bold;
-					color: #666666;
-					&.active{
-						background: #007AFF;
-						color:#fff;
-					}
-					&:first-child{
-						width:100%;
-						text-align: center;
-					}
-				}
-		}		
-	}
+.wrap {
+  padding: 96rpx 16rpx 16rpx;
 }
-.wrap{
-	padding:96rpx 16rpx 16rpx;
+.wrap1 {
+  padding: 16rpx;
 }
-.wrongHead{
-	background: #FFFFFF;
-	border-radius: 16px;
-	padding:24rpx;
-	.title{
-		font-size: 30rpx;
-		font-family: PingFang SC;
-		font-weight: bold;
-		color: #333333;
-		.sub{
-			font-size: 20rpx;
-			font-weight: 500;
-			color: #999999;
-		}
-	}
-	.progress{
-		width: 180rpx;
-		height: 180rpx;
-		line-height: 140rpx;
-		border: 20rpx solid #EEEEEE;
-		border-radius: 50%;
-		margin: 24rpx auto;
-		font-size: 50rpx;
-		text-align: center;
-	}
+.wrongHead {
+  background: #ffffff;
+  border-radius: 16px;
+  padding: 24rpx;
+  .title {
+    font-size: 30rpx;
+    font-family: PingFang SC;
+    font-weight: bold;
+    color: #333333;
+    .sub {
+      font-size: 20rpx;
+      font-weight: 500;
+      color: #999999;
+    }
+  }
+  .progress {
+    width: 180rpx;
+    height: 180rpx;
+    line-height: 140rpx;
+    border: 20rpx solid #eeeeee;
+    border-radius: 50%;
+    margin: 24rpx auto;
+    font-size: 50rpx;
+    text-align: center;
+  }
 }
-.wrongTab{
-	display: flex;
-	margin: 24rpx 0;
-	.item{
-		width: 144rpx;
-		height: 48rpx;
-		line-height: 48rpx;
-		text-align: center;
-		background: #fff;
-		border-radius: 16px;
-		font-size: 28rpx;
-		font-family: PingFang SC;
-		font-weight: 500;
-		color: #666666;
-		margin-left: 15rpx;
-		&.active{
-			background: #007AFF;
-			color: #fff;
-		}
-	}
+.wrongTab {
+  display: flex;
+  margin: 24rpx 0;
+  .item {
+    width: 144rpx;
+    height: 48rpx;
+    line-height: 48rpx;
+    text-align: center;
+    background: #fff;
+    border-radius: 16px;
+    font-size: 28rpx;
+    font-family: PingFang SC;
+    font-weight: 500;
+    color: #666666;
+    margin-left: 15rpx;
+    &.active {
+      background: #007aff;
+      color: #fff;
+    }
+  }
 }
-.wrongList{
-	margin-top:20rpx;
-	.item{
-		background: #FFFFFF;
-		border-radius: 16rpx;
-		padding: 0 30rpx;
-		margin-bottom: 16rpx;
-		overflow: hidden;
-		.title{
-			font-size: 32rpx;
-			font-family: PingFang SC;
-			font-weight: bold;
-			color: #333333;
-			margin: 40rpx 0 17rpx;
-		}
-		.bt{
-			display: flex;
-			justify-content: space-between;
-			align-items: center;
-			padding-bottom: 24rpx;
-			.left{
-				width: 176rpx;
-				height: 40rpx;
-				background: #FFFFFF;
-				border: 1px solid #EEEEEE;
-				border-radius: 16rpx;
-				font-size: 26rpx;
-				font-family: PingFang SC;
-				font-weight: 500;
-				color: #999999;
-				display: flex;
-				justify-content: center;
-				align-items: center;
-				.num{
-					font-size: 26rpx;
-					font-weight: bold;
-					color: #FF3B30;
-					margin-left: 16rpx;
-				}
-			}
-			.right{
-				display: flex;
-				.btn{
-					width: 100rpx;
-					height: 48rpx;
-					background: #FFFFFF;
-					border: 1px solid #007AFF;
-					border-radius: 16px;
-					font-size: 24rpx;
-					font-family: PingFang SC;
-					font-weight: 500;
-					color: #007AFF;
-					margin-left:9rpx;
-					display: flex;
-					align-items: center;
-					justify-content: center;
-				}
-			}
-		}
-	}
+.wrongList {
+  margin-top: 20rpx;
+  .item {
+    background: #ffffff;
+    border-radius: 16rpx;
+    padding: 0 30rpx;
+    margin-bottom: 16rpx;
+    overflow: hidden;
+    .title {
+      font-size: 32rpx;
+      font-family: PingFang SC;
+      font-weight: bold;
+      color: #333333;
+      margin: 40rpx 0 17rpx;
+    }
+    .bt {
+      display: flex;
+      justify-content: space-between;
+      align-items: center;
+      padding-bottom: 24rpx;
+      .left {
+        width: 176rpx;
+        height: 40rpx;
+        background: #ffffff;
+        border: 1px solid #eeeeee;
+        border-radius: 16rpx;
+        font-size: 26rpx;
+        font-family: PingFang SC;
+        font-weight: 500;
+        color: #999999;
+        display: flex;
+        justify-content: center;
+        align-items: center;
+        .num {
+          font-size: 26rpx;
+          font-weight: bold;
+          color: #ff3b30;
+          margin-left: 16rpx;
+        }
+      }
+      .right {
+        display: flex;
+        .btn {
+          width: 100rpx;
+          height: 48rpx;
+          background: #ffffff;
+          border: 1px solid #007aff;
+          border-radius: 16px;
+          font-size: 24rpx;
+          font-family: PingFang SC;
+          font-weight: 500;
+          color: #007aff;
+          margin-left: 9rpx;
+          display: flex;
+          align-items: center;
+          justify-content: center;
+        }
+      }
+    }
+  }
 }
 </style>

+ 280 - 0
pages2/verify/info_fill.vue

@@ -0,0 +1,280 @@
+<template>
+  <view>
+    <nav-bar title="填写资料"></nav-bar>
+    <view style="margin-top: 30rpx; padding: 0 40rpx">
+      <u-form :model="form" ref="uForm" :error-type="errorType">
+        <template v-for="(item, index) in listData">
+          <u-form-item
+            :key="index"
+            v-if="item.type === 'input'"
+            :label="item.label"
+            :required="item.required"
+            :label-width="auto"
+            :prop="item.required ? item.prop : ''"
+          >
+            <u-input
+              v-model="form[item.key]"
+              :disabled="item.disabled"
+              :placeholder="`请输入${item.label}`"
+            />
+          </u-form-item>
+          <u-form-item
+            :key="index"
+            v-else-if="item.type === 'radio'"
+            :label="item.label"
+            :required="item.required"
+            :label-width="auto"
+            :prop="item.required ? item.prop : ''"
+          >
+            <u-radio-group v-model="form[item.key]">
+              <u-radio
+                v-for="(item1, i) in backDictArr(item)"
+                :key="i"
+                :name="item1.value"
+                :disabled="item.disabled"
+              >
+                {{ item1.label }}
+              </u-radio>
+            </u-radio-group>
+          </u-form-item>
+          <u-form-item
+            :key="index"
+            v-else-if="item.type === 'select'"
+            :label="item.label"
+            :required="item.required"
+            :label-width="auto"
+            :prop="item.required ? item.prop : ''"
+          >
+            <u-input
+              @click="open(item)"
+              v-model="form[item.key]"
+              type="select"
+              :placeholder="`请选择${item.label}`"
+            />
+            <u-select
+              v-model="item.show"
+              :list="backDictArr(item)"
+              :default-value="defaultValue"
+              @confirm="
+                (e) => {
+                  confirm(e, item.key);
+                }
+              "
+            ></u-select>
+          </u-form-item>
+        </template>
+      </u-form>
+    </view>
+    <view @click="submitForm" class="submit_btn">提交资料</view>
+  </view>
+</template>
+
+<script>
+import { mapGetters, mapActions } from "vuex";
+const list = [
+  {
+    key: "realname",
+    type: "input",
+    label: "姓名",
+    required: true,
+    prop: "realname",
+  },
+  {
+    key: "idCard",
+    type: "input",
+    label: "身份证号",
+    required: true,
+    prop: "idCard",
+  },
+  {
+    key: "companyName",
+    type: "input",
+    label: "工作单位",
+    required: true,
+    prop: "companyName",
+  },
+  {
+    key: "sex",
+    type: "radio",
+    label: "性别",
+    required: true,
+    list: [
+      { label: "男", value: 1 },
+      { label: "女", value: 2 },
+    ],
+    prop: "sex",
+  },
+  {
+    key: "eduLevel",
+    type: "select",
+    label: "学历",
+    dictKey: "edu_level",
+    show: false,
+    required: true,
+    prop: "eduLevel",
+  },
+];
+export default {
+  name: "SaasMiniprogramInfoFill",
+
+  data() {
+    return {
+      listData: [],
+      form: {},
+      options: {},
+      errorType: ["message"],
+      auto: "180rpx",
+      defaultValue: [0],
+      isUploading: false,
+      rules: {
+        realname: [
+          {
+            required: true,
+            message: "请输入姓名",
+            trigger: ["change", "blur"],
+          },
+        ],
+        sex: [
+          {
+            validator: (rule, value, callback) => {
+              return !!value;
+            },
+            message: "请选择性别",
+            trigger: "change",
+          },
+        ],
+        idCard: [
+          {
+            required: true,
+            message: "请输入身份证号",
+            trigger: ["change", "blur"],
+          },
+        ],
+        eduLevel: [
+          {
+            required: true,
+            message: "请选择学历",
+            trigger: ["change", "blur"],
+          },
+        ],
+        companyName: [
+          {
+            required: true,
+            message: "请输入工作单位",
+            trigger: ["change", "blur"],
+          },
+        ],
+      },
+    };
+  },
+
+  async onLoad(options) {
+    this.options = options;
+    !this.userInfo && (await this.getUserInfo());
+    this.init();
+  },
+
+  methods: {
+    ...mapActions(["getUserInfo"]),
+    init() {
+      let { keys } = this.options;
+      if (!keys) {
+        return;
+      }
+      keys.split(",").forEach((key) => {
+        let item = list.find((item) => item.key == key);
+        if (item) {
+          const value = this.userInfo[key];
+          this.$set(this.form, key, value);
+          this.listData.push({ ...item, disabled: !!value });
+        }
+      });
+    },
+    backDictArr(item) {
+      let { dictKey, list } = item;
+      if (dictKey) {
+        if (!this.dictObj) {
+          return [];
+        }
+        list = this.dictObj[dictKey].map((e, i) => {
+          return { label: e, value: i };
+        });
+        item.list = list;
+      }
+      return list;
+    },
+    open(item) {
+      if (item.disabled) {
+        return;
+      }
+      let { key, list } = item;
+      const option = list.find((e) => e.label === this.form[key]);
+      this.defaultValue = [option ? option.value : 0];
+      item.show = true;
+    },
+    confirm(e, key) {
+      this.form[key] = e[0].label;
+    },
+    submitForm() {
+      if (this.isUploading) {
+        return;
+      }
+      this.isUploading = true;
+      this.$nextTick(() => {
+        this.$refs.uForm.validate((valid) => {
+          if (valid) {
+            this.$api
+              .appuserInfo(this.form)
+              .then((res) => {
+                if (res.data.code === 200) {
+                  uni.showToast({
+                    title: "提交成功",
+                    icon: "none",
+                  });
+                  this.getUserInfo();
+                  setTimeout(() => {
+                    uni.navigateBack();
+                  }, 1500);
+                } else {
+                  uni.showToast({
+                    title: res.data.msg,
+                    icon: "none",
+                  });
+                }
+              })
+              .finally(() => {
+                this.isUploading = false;
+              });
+          } else {
+            this.isUploading = false;
+            console.log(this.form);
+            console.log("验证失败");
+          }
+        });
+      });
+    },
+  },
+  computed: {
+    ...mapGetters(["userInfo", "dictObj"]),
+  },
+  onReady(res) {
+    this.$refs.uForm.setRules(this.rules);
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+.submit_btn {
+  width: 526rpx;
+  height: 80rpx;
+  background: #007aff;
+  border-radius: 40rpx;
+  text-align: center;
+  line-height: 80rpx;
+  color: #ffffff;
+  position: absolute;
+  left: 50%;
+  margin-left: -263rpx;
+  bottom: 140rpx;
+}
+</style>

+ 104 - 63
pages2/verify/input.vue

@@ -36,7 +36,7 @@
             >
               <u-input
                 v-model="form.name"
-                :disabled="disName"
+                :disabled="disable || disName"
                 :placeholder="`请输入${item.fieldName}`"
               />
             </u-form-item>
@@ -49,7 +49,7 @@
               :prop="item.required ? item.fieldKey : ''"
             >
               <u-input
-                :disabled="disCard"
+                :disabled="disable || disCard"
                 v-model="form.idcard"
                 :placeholder="`请输入${item.fieldName}`"
               />
@@ -78,6 +78,7 @@
               :prop="item.required ? item.fieldKey : ''"
             >
               <u-input
+                :disabled="disable"
                 v-model="form.school"
                 :placeholder="`请输入${item.fieldName}`"
               />
@@ -91,6 +92,7 @@
               :prop="item.required ? item.fieldKey : ''"
             >
               <u-input
+                :disabled="disable"
                 v-model="form.work_unit"
                 :placeholder="`请输入${item.fieldName}`"
               />
@@ -104,6 +106,7 @@
               :prop="item.required ? item.fieldKey : ''"
             >
               <u-input
+                :disabled="disable"
                 v-model="form.unit_contact"
                 :placeholder="`请输入${item.fieldName}`"
               />
@@ -117,24 +120,11 @@
               :prop="item.required ? item.fieldKey : ''"
             >
               <u-input
+                :disabled="disable"
                 v-model="form.unit_tel"
                 :placeholder="`请输入${item.fieldName}`"
               />
             </u-form-item>
-            <u-form-item
-              :key="index"
-              v-if="item.fieldKey == 'apply_post'"
-              :label="item.fieldName"
-              :required="item.required"
-              :label-width="auto"
-              :prop="item.required ? item.fieldKey : ''"
-            >
-              <u-input
-                v-model="form.apply_post"
-                :disabled="apply_post_disabled"
-                :placeholder="`请输入${item.fieldName}`"
-              />
-            </u-form-item>
             <u-form-item
               :key="index"
               v-if="item.fieldKey == 'major'"
@@ -144,6 +134,7 @@
               :prop="item.required ? item.fieldKey : ''"
             >
               <u-input
+                :disabled="disable"
                 v-model="form.major"
                 :placeholder="`请输入${item.fieldName}`"
               />
@@ -157,6 +148,8 @@
               :prop="item.required ? item.fieldKey : ''"
             >
               <picker
+                :disabled="disable"
+                :key="item.fieldKey"
                 @change="bindPickerChange(item.fieldKey, $event)"
                 :value="form[item.fieldKey]"
                 :range="getarrays(item.fieldKey)"
@@ -190,6 +183,7 @@
                 mode="date"
                 :value="form[item.fieldKey]"
                 @change="bindDateChange(item.fieldKey, $event)"
+                :disabled="disable"
               >
                 <view class="picker">
                   {{ getTimes(item.fieldKey) }}
@@ -258,6 +252,7 @@
                 @on-list-change="changePhotoListHeader($event, item.fieldKey)"
                 :auto-upload="false"
                 :custom-btn="true"
+                :deletable="!disable"
                 action="#"
                 :file-list="
                   item.fieldKey === 'recent_photos'
@@ -338,7 +333,7 @@
                 <div style="width: 100%">
                   <view class="dis_stys">
                     <text style="color: #999999">请在下方签名区进行签名</text>
-                    <text @click="retDraw" mode="">清空</text>
+                    <text @click="retDraw" mode="" v-if="!disable">清空</text>
                   </view>
                   <view class="handCenter">
                     <canvas
@@ -417,7 +412,9 @@
                     :src="$method.splitImgHost(form[item.fieldKey])"
                     style="width: 100%; height: 100%"
                     mode="aspectFit"
-                    @click="seePhotos(form[item.fieldKey])"
+                    @click="
+                      seePhotos($method.splitImgHost(form[item.fieldKey]))
+                    "
                   ></image>
                   <u-icon
                     name="close-circle-fill"
@@ -432,7 +429,7 @@
           </template>
         </u-form>
       </view>
-      <view @click="submits" class="submit_btn">提交资料</view>
+      <view v-if="!disable" @click="submits" class="submit_btn">提交资料</view>
     </view>
 
     <u-popup
@@ -505,7 +502,7 @@ export default {
       showTableDown: false,
       gradeId: 0,
       errorType: ["message"],
-      agreementModal: true,
+      agreementModal: false,
       goodsData: {},
       itemStyle: {
         marginTop: "20px",
@@ -659,8 +656,8 @@ export default {
         apply_post: [
           {
             required: true,
-            message: "请输入报名岗位",
-            trigger: ["change", "blur"],
+            message: "请选择报名岗位",
+            trigger: "change",
           },
         ],
         major: [
@@ -719,6 +716,8 @@ export default {
       disName: false, // 姓名是否禁止输入
       disCard: false, // 身份证是否禁止输入
       auto: "180rpx",
+      dictList: [],
+      isDetail: undefined,
     };
   },
   created() {
@@ -728,6 +727,7 @@ export default {
     this.orderGoodsId = Number(option.orderGoodsId);
     this.goodsId = Number(option.id);
     this.gradeId = Number(option.gradeId);
+    this.isDetail = option.type;
     !this.userInfo && this.$api.refreshUserInfo();
     await this.getGoodsDetail();
     await this.getInfo();
@@ -740,7 +740,12 @@ export default {
     });
     this.$refs.uForm.setRules(this.rules);
   },
-  computed: { ...mapGetters(["dictObj", "userInfo"]) },
+  computed: {
+    ...mapGetters(["dictObj", "userInfo"]),
+    disable() {
+      return this.isDetail == 1;
+    },
+  },
   watch: {
     userInfo(val, oldVal) {
       //普通的watch监听
@@ -777,6 +782,7 @@ export default {
       this.showTableDown = true;
     },
     seePhotos(url) {
+      console.log(url, 798);
       uni.previewImage({
         urls: [url],
       });
@@ -899,13 +905,16 @@ export default {
           })
           .then((res) => {
             this.goodsData = res.data.data;
-            if (this.goodsData.categoryName) {
-              this.$set(this.form, "apply_post", this.goodsData.categoryName);
-              console.log(this.form);
-              if (this.goodsData.categoryName) {
-                this.apply_post_disabled = true;
-              }
-            }
+            console.log(
+              "🚀 ~ file: input.vue:908 ~ .then ~ goodsData:",
+              this.goodsData
+            );
+            // if (this.goodsData.categoryName) {
+            //   this.$set(this.form, "apply_post", this.goodsData.categoryName);
+            //   if (this.goodsData.categoryName) {
+            //     this.apply_post_disabled = true;
+            //   }
+            // }
             if (this.userInfo && this.userInfo.companyName) {
               this.$set(this.form, "work_unit", this.userInfo.companyName);
             }
@@ -921,23 +930,6 @@ export default {
           if (res.tempFiles[0].size > 2097152) {
             this.$method.showToast("上传图片不得大于2M");
             return;
-            // this.$method.showToast("上传图片不得大于2M");
-            // 需要压缩
-            let canvasId = "zipCanvas";
-            let imagePath = res.tempFiles[0].path; //原图的路径
-            let limitSize = 2048; //大小限制2048kb
-            let drawWidth = wx.getSystemInfoSync().windowWidth; //初始绘画区域是画布自身的宽度也就是屏幕宽度
-            getLessLimitSizeImage(
-              canvasId,
-              imagePath,
-              limitSize,
-              drawWidth,
-              async (resPath) => {
-                //resPath就是压缩后图片的路径
-                this.uploadImgsChild(resPath);
-              }
-            );
-            return;
           } else {
             // this.uploadImgsChild(res.tempFiles[0].path);
             // #ifdef MP-WEIXIN
@@ -951,6 +943,22 @@ export default {
               return;
             }
             this.$set(this.form, "commitment_seal", res.tempFiles[0].path);
+            // 查看 职能修改承诺书
+            if (this.disable) {
+              this.$method
+                .uploadFile(res.tempFiles[0].path, 0)
+                .then((imageUrl) => {
+                  this.$api
+                    .updateCommitment({ imageUrl, id: this.id })
+                    .then((res) => {
+                      if (res.data.code == 200) {
+                        this.$method.showToast("上传承诺书成功");
+                      } else {
+                        this.$method.showToast(res.data.msg);
+                      }
+                    });
+                });
+            }
             this.$nextTick(() => {
               this.resultForm();
             });
@@ -1021,6 +1029,9 @@ export default {
     },
     //清除按钮
     clearWatch(key) {
+      if (this.disable) {
+        return false;
+      }
       if (this.form[key]) {
         return true;
       } else {
@@ -1093,7 +1104,6 @@ export default {
                   orderGoodsId: this.orderGoodsId,
                   keyValue: JSON.stringify(arsty),
                 };
-                console.log(datas, "datas0");
                 // this.isUploading = false;
                 // return;
                 this.$api.editbaseprofiletp(datas).then((res) => {
@@ -1132,8 +1142,6 @@ export default {
                   orderGoodsId: this.orderGoodsId,
                   keyValue: JSON.stringify(objs),
                 };
-
-                console.log(data, "datas");
                 // this.isUploading = false;
                 // return;
                 this.$api.addbaseprofiletp(datas).then((res) => {
@@ -1508,6 +1516,9 @@ export default {
     },
     getarrays(key) {
       if (!this.dictObj) return;
+      if (key === "apply_post") {
+        return this.dictObj["apply_post"];
+      }
       if (key === "sex") {
         return this.dictObj["sys_user_sex"];
       }
@@ -1520,6 +1531,13 @@ export default {
     },
     returnName(key) {
       if (!this.dictObj) return;
+      if (key === "apply_post") {
+        if (this.form[key]) {
+          return this.form[key];
+        } else {
+          return "请选择报名岗位";
+        }
+      }
       if (key === "sex") {
         if (this.form[key]) {
           return this.dictObj["sys_user_sex"][Number(this.form[key])];
@@ -1552,7 +1570,7 @@ export default {
           self.listData = JSON.parse(res.data.data.keyValue);
           var ast = JSON.parse(res.data.data.keyValue2);
           self.listData = [...self.listData, ...ast];
-          self.listData.forEach((item) => {
+          self.listData.forEach((item, index) => {
             if (item.fieldKey == "idcard") {
               this.form.idcard = this.userInfo.idCard;
               this.disCard = this.form.idcard ? true : false;
@@ -1569,15 +1587,21 @@ export default {
           self.isRequired = self.listData.every((ims) => {
             return ims.required === false;
           });
-          this.$nextTick(() => {
-            this.agreementModal = true;
-          });
+          if (!this.disable) {
+            this.$nextTick(() => {
+              this.agreementModal = true;
+            });
+          }
           self.$api
             .getbaseprofiletpgetInfo({
               goodsId: self.goodsId,
               orderGoodsId: self.orderGoodsId,
             })
             .then((result) => {
+              console.log(
+                "🚀 ~ file: input.vue:1592 ~ .then ~ result:",
+                result
+              );
               if (result.data.code === 200) {
                 if (!result.data.data) {
                   self.$api
@@ -1611,7 +1635,7 @@ export default {
                                 if (ajson[k].value) {
                                   self.fileList1 = [
                                     {
-                                      url: baseUrls + ajson[k].value,
+                                      url: self.baseUrls + ajson[k].value,
                                     },
                                   ];
                                 }
@@ -1620,7 +1644,7 @@ export default {
                                 if (ajson[k].value) {
                                   self.fileList2 = [
                                     {
-                                      url: baseUrls + ajson[k].value,
+                                      url: self.baseUrls + ajson[k].value,
                                     },
                                   ];
                                 }
@@ -1629,7 +1653,7 @@ export default {
                                 if (ajson[k].value) {
                                   self.fileList3 = [
                                     {
-                                      url: baseUrls + ajson[k].value,
+                                      url: self.baseUrls + ajson[k].value,
                                     },
                                   ];
                                 }
@@ -1667,7 +1691,10 @@ export default {
                       }
                     });
                 }
-                if (result.data.data && result.data.data.status === 3) {
+                if (
+                  self.disable ||
+                  (result.data.data && result.data.data.status === 3)
+                ) {
                   self.remark = result.data.data.text;
                   self.remarkStatus = true;
                   self.id = result.data.data.id;
@@ -1701,17 +1728,23 @@ export default {
                     } else if (k === "recent_photos") {
                       self.$set(self.form, k, arrays[k].value);
                       if (arrays[k].value) {
-                        self.fileList1 = [{ url: baseUrls + arrays[k].value }];
+                        self.fileList1 = [
+                          { url: self.baseUrls + arrays[k].value },
+                        ];
                       }
                     } else if (k === "idcard_face_photo") {
                       self.$set(self.form, k, arrays[k].value);
                       if (arrays[k].value) {
-                        self.fileList2 = [{ url: baseUrls + arrays[k].value }];
+                        self.fileList2 = [
+                          { url: self.baseUrls + arrays[k].value },
+                        ];
                       }
                     } else if (k === "idcard_national_photo") {
                       self.$set(self.form, k, arrays[k].value);
                       if (arrays[k].value) {
-                        self.fileList3 = [{ url: baseUrls + arrays[k].value }];
+                        self.fileList3 = [
+                          { url: self.baseUrls + arrays[k].value },
+                        ];
                       }
                     } else if (k === "name") {
                       self.$set(
@@ -1762,7 +1795,11 @@ export default {
       });
     },
     bindPickerChange(key, e) {
-      this.$set(this.form, key, e.detail.value + "");
+      let value = e.detail.value + "";
+      if (key === "apply_post") {
+        value = this.dictObj["apply_post"][value];
+      }
+      this.$set(this.form, key, value);
       this.openVerify = false;
       this.$nextTick(function () {
         this.resultForm();
@@ -1857,6 +1894,11 @@ page {
   position: relative;
   border: 2rpx solid #eee;
   border-radius: 8rpx;
+  .optionsAbs {
+    position: absolute;
+    right: 5px;
+    top: 5px;
+  }
 }
 .handWriting {
   width: 100%;
@@ -1953,7 +1995,6 @@ input {
   padding: 0 20rpx;
   font-size: 24rpx;
 }
-
 .modal {
   .agreement {
     width: 640rpx;

+ 6 - 1
pages3/course/detail.vue

@@ -383,6 +383,7 @@ export default {
       options: {},
       courseId: "",
       refPlv: null,
+      isQdy: 0,
     };
   },
   computed: {
@@ -463,7 +464,6 @@ export default {
       ];
       this.current = 3;
     }
-
     // #ifdef MP-WEIXIN
     wx.showShareMenu({
       withShareTicket: true,
@@ -965,6 +965,7 @@ export default {
           this.toggleSkuShow = true;
           this.specAttrPriceList = data.specAttrPriceList;
           this.specList = this.changeData(data.specList || []);
+          this.isQdy = data.sign;
         } else {
           if (this.isCarOrBuy == 1) {
             // 加入购物车
@@ -1190,6 +1191,10 @@ export default {
             this.$store.commit("setShoppingCartList", {
               shoppingCartList: data,
             });
+            if (this.isQdy == 1) {
+              this.toConfirmList("");
+              return;
+            }
             this.$navTo.togo("/pages2/order/confirm_pay" + this.addParam("?"));
           }
         }

+ 1 - 0
pages3/polyv/detail.vue

@@ -1361,6 +1361,7 @@ export default {
       let currentTime = this.refPlv.playCurrentTime();
       let PlayDuration = this.refPlv.playVideoTime();
       if (currentTime < 10 && !this.ossAvatarUrl) {
+        console.log("不提交", currentTime);
         return;
       }
       let self = this;

+ 28 - 28
pages4/login/login.vue

@@ -128,17 +128,20 @@
       <view class="wxBtn">
         <view class="wxBtn_title">
           <view class="line"></view>
-          <view class="text">手机号快捷登录</view>
+          <view class="text">快捷登录</view>
           <view class="line"></view>
         </view>
-        <button
+        <button type="default" @click="quickLogin" class="wxloginBtn fl_c">
+          <image mode="widthFix" src="/static/icon_phone.png"></image>
+        </button>
+        <!-- <button
           type="default"
           open-type="getPhoneNumber"
           @getphonenumber="wxLogin"
           class="wxloginBtn fl_c"
         >
           <image mode="widthFix" src="/static/icon_phone.png"></image>
-        </button>
+        </button> -->
       </view>
       <!-- #endif -->
     </view>
@@ -158,6 +161,7 @@ RVQplIVs5z3MxcUa9ptKPHUTgh8xMCBvl8sUJKwkmn4vYWeDfHT22EL7Hr1pTMwU
 hF6WiNlWfQTVoF1rhwIDAQAB
 -----END PUBLIC KEY-----`;
 import JSEncrypt from "@/pages4/static/jsencrypt.min.js";
+import { getOpenid } from "../../utils/authority";
 export default {
   data() {
     return {
@@ -228,6 +232,7 @@ export default {
       isBack: false,
       isDualAuth: false,
       isAct: "",
+      bindForm: {},
     };
   },
   onLoad(option) {
@@ -249,7 +254,7 @@ export default {
   onShow() {
     // 获取code
     // #ifdef MP-WEIXIN
-    this.getwxCode();
+    // this.getwxCode();
     // #endif
   },
   onReady() {
@@ -559,7 +564,12 @@ export default {
       this.$api.getInfo({ fromPlat: 1 }).then((resdata) => {
         if (resdata.data.code == 200) {
           this.$store.state.userInfo = resdata.data.data;
-
+          if (this.bindForm.openId) {
+            this.$api.openIdLogin({
+              ...this.bindForm,
+              userId: resdata.data.data.userId,
+            });
+          }
           if (!this.isBack) {
             let goPath = "";
             if (types == "wxlogin" || types == "smslogin") {
@@ -592,30 +602,20 @@ export default {
           }
         }
       });
-
-      // } else {
-      // 	//未完善信息,存为临时信息
-      // 	uni.setStorageSync('user_account_temp', res.data.data.user_account);
-      // 	uni.setStorageSync('token_temp', res.data.data.token);
-      // 	this.$navTo.togo('/pages2/register/bind');
-
-      // }
     },
-    // scanLoginCheck小程序校验PC登录二维码,执行登录获取到令牌,然后把扫码的路径最后面的6位标识码提交给后台就行
-    // submitCode() {
-    // 	console.log('跳转请求提交code到接口', this.scanCode)
-    // 	this.$api.scanLoginCheck({
-    // 		scanCode: this.scanCode
-    // 	}).then((res) => {
-    // 		if (res.data.code == 200) {
-    // 			uni.navigateTo({
-    // 				url: '/pages4/login/pcLoginSuccess'
-    // 			})
-    // 		} else {
-    // 			this.$u.toast(res.data.msg)
-    // 		}
-    // 	})
-    // }
+    async quickLogin() {
+      let openId = await getOpenid();
+      let res = await this.$api.openIdLogin({ openId });
+      if (res.data.code === 200) {
+        this.loginCallback(res);
+      } else {
+        this.bindForm = { openId, unionId: uni.getStorageSync("unionId") };
+        uni.showToast({
+          icon: "none",
+          title: res.data.msg + "请用密码或验证码登录!",
+        });
+      }
+    },
   },
 };
 </script>

+ 16 - 97
pages4/shopping/shoppingCart.vue

@@ -35,9 +35,12 @@
                               ></image>
                             </view>
                             <view class="flex__auto">
-                              <view class="goods-title">{{
-                                item.goodsName
-                              }}</view>
+                              <view class="goods-title"
+                                >{{ item.goodsName }}
+                                <text v-if="item.sevenYear">
+                                  ({{ item.sevenYear }})
+                                </text>
+                              </view>
                               <view class="priceTag"
                                 >¥ {{ item.standPrice }}</view
                               >
@@ -65,43 +68,17 @@
                           @click="openPopup(0, item, index)"
                         >
                           <view style="color: #666666; font-size: 24rpx">{{
-                            !item.gradObj && !item.gradObj.className
+                            !item.gradObj.className
                               ? "选择班级"
                               : item.gradObj.className
                           }}</view>
-                          <view>
-                            <u-icon
-                              name="arrow-right"
-                              color="#999999"
-                              size="28"
-                            >
-                            </u-icon>
-                          </view>
-                        </view>
-                        <view
-                          class="goods-select__type"
-                          v-if="item.sevenYear"
-                          @click="openPopup(2, item, index)"
-                        >
                           <view
-                            style="color: #666666; font-size: 24rpx"
-                            v-if="
-                              item.selectYearList && item.selectYearList.length
-                            "
-                          >
-                            {{ item.selectYearList.toString() }}
-                          </view>
-                          <view v-else style="color: #666666; font-size: 24rpx">
-                            选择年份
-                          </view>
-                          <view>
-                            <u-icon
+                            ><u-icon
                               name="arrow-right"
                               color="#999999"
                               size="28"
-                            >
-                            </u-icon>
-                          </view>
+                            ></u-icon
+                          ></view>
                         </view>
                         <view
                           v-if="item.gradObj.gradeId"
@@ -255,35 +232,6 @@
           >
         </view>
       </u-popup>
-      <u-popup v-model="show2" mode="bottom" border-radius="40">
-        <view class="popup_box" style="height: 400rpx">
-          <view style="margin-bottom: 20rpx">
-            <view class="line1"></view>
-            <view class="grade">选择年份</view>
-          </view>
-          <u-line color="#D6D6DB" />
-          <view>
-            <scroll-view scroll-y="true" style="height: 236rpx">
-              <view style="padding: 16rpx 30rpx">
-                <u-checkbox-group :wrap="true">
-                  <u-checkbox
-                    shape="circle"
-                    v-for="(item, index) in yearList"
-                    :key="index"
-                    v-model="item.checked"
-                    :name="item.name"
-                  >
-                    {{ item.name }}
-                  </u-checkbox>
-                </u-checkbox-group>
-              </view>
-            </scroll-view>
-          </view>
-          <view class="confrim-btn"
-            ><view class="okBtn" @click="okPopup(2)">确定</view></view
-          >
-        </view>
-      </u-popup>
     </view>
     <view v-show="!isLogin">
       <view
@@ -346,7 +294,6 @@ export default {
       value: "",
       show: false,
       show1: false,
-      show2: false,
       allChecked: false,
       isOld: false,
       gradeList: [],
@@ -355,7 +302,6 @@ export default {
       cityList: [],
       detail: {},
       detailIndex: -1,
-      yearList: [],
       applyObj: {
         applyAreasJson: null,
         examDateJson: null,
@@ -371,10 +317,7 @@ export default {
     ...mapGetters(["userInfo", "hideBuyState", "config"]),
     totalPrice() {
       let price = 0;
-      this.checkList.forEach((e) => {
-        let multiple = e.selectYearList?.length || 1;
-        price += e.standPrice * multiple;
-      });
+      this.checkList.forEach((e) => (price += e.standPrice));
       return price;
     },
     canCheckList() {
@@ -467,13 +410,6 @@ export default {
         //   this.gradeList[this.gradeIndex]
         // );
         this.show = false;
-      } else if (index == 2) {
-        this.$set(
-          this.detail,
-          "selectYearList",
-          this.yearList.filter((e) => e.checked).map((e) => e.name)
-        );
-        this.show2 = false;
       } else {
         if (!this.checkAreaData()) {
           return;
@@ -544,19 +480,11 @@ export default {
     },
     openPopup(index, item, itemIndex) {
       this.detail = item;
+      console.log(this.detail, 798);
       this.detailIndex = itemIndex;
       if (index == 0) {
         this.show = true;
         this.goodsGradeList(item.goodsId);
-      } else if (index == 2) {
-        this.show2 = true;
-        let selectYearList = item.selectYearList || "";
-        this.yearList = item.sevenYear.split(",").map((e) => {
-          return {
-            name: e,
-            checked: selectYearList.includes(e),
-          };
-        });
       } else {
         this.applyObj = {
           applyAreasJson: null,
@@ -604,16 +532,15 @@ export default {
               item.checked = choiceStatus == 1;
               if (templateType === "class" && goodsType == 1) {
                 // 无返回就默认系统分班
-                if (!gradeList || gradeList.length === 0) {
+                if (gradeList || gradeList.length === 0) {
                   gradeList = [
                     {
                       className: "系统分班",
                       gradeId: 0,
                     },
                   ];
-                  item.gradeList = gradeList;
                 }
-                item.gradObj = gradeList[0];
+                item.gradObj = item.gradeList[0];
               }
             }
           }
@@ -649,7 +576,7 @@ export default {
         });
         return;
       }
-      for (const item of this.checkList) {
+      this.checkList.forEach((item) => {
         if (item.templateType == "class" && item.goodsType == 1) {
           if (!item.gradObj.className) {
             uni.showModal({
@@ -659,14 +586,6 @@ export default {
             });
             return false;
           }
-          if (!item.selectYearList) {
-            uni.showModal({
-              title: "提示",
-              content: "请选择年份",
-              showCancel: false,
-            });
-            return false;
-          }
         }
         if (item.templateType == "apply" && item.goodsType == 1) {
           // if (!item.applyAreas.areaName) {
@@ -678,7 +597,7 @@ export default {
           // 	return false;
           // }
         }
-      }
+      });
       this.$store.commit("setShoppingCartList", {
         shoppingCartList: this.checkList,
       });

+ 4 - 2
pages5/examBank/index.vue

@@ -867,6 +867,7 @@
 <script>
 import { mapGetters, mapActions } from "vuex";
 import BankBom from "../../components/common/BankBom.vue";
+import { goodsExamIsCanLearn, examClientCanLearn } from "@/utils/authority";
 export default {
   data() {
     return {
@@ -908,6 +909,7 @@ export default {
     };
   },
   async onLoad(option) {
+    await goodsExamIsCanLearn(option.goodsid);
     this.examStartTime = option.examStartTime;
     this.examEndTime = option.examEndTime;
     this.subscribeId = option.subscribeId || "";
@@ -1008,8 +1010,8 @@ export default {
       return new Promise((resolve, reject) => {
         this.$api.bankExam(this.examId).then((res) => {
           const { examLimitClient, doType } = res.data.data;
-          if (!this.$method.examClientCanLearn(examLimitClient)) {
-            reject();
+          if (!examClientCanLearn(examLimitClient)) {
+            return;
           }
           this.bankType = doType;
           this.examData = res.data.data;

+ 4 - 3
pages5/examReport/index.vue

@@ -283,6 +283,7 @@
 </template>
 
 <script>
+import { examClientCanLearn } from "@/utils/authority";
 import { mapGetters, mapActions } from "vuex";
 export default {
   data() {
@@ -579,10 +580,10 @@ export default {
     bankExam() {
       return new Promise((resolve, reject) => {
         this.$api.bankExam(this.examId).then((res) => {
-          if (!this.$method.examClientCanLearn(res.data.data.examLimitClient)) {
-            reject();
-          }
           this.examData = res.data.data;
+          if (!examClientCanLearn(res.data.data.examLimitClient)) {
+            return;
+          }
           resolve();
         });
       });

+ 132 - 0
utils/authority.js

@@ -0,0 +1,132 @@
+import store from "@/store/index.js";
+import api from "@/common/api.js";
+import { isWeixin, modalComfirm } from "./shared";
+import { getQueryString } from "../common/navTo";
+export function getCode(url = window.location.href) {
+  return new Promise((resolve, reject) => {
+    // #ifdef H5
+    if (location.search.includes("code")) {
+      const code = getQueryString("code");
+      uni.setStorageSync("h5_code", code);
+      resolve(code);
+    } else {
+      // 没有code,就重定向到地址https://www.xyyxt.net?ask_type=https://api.xyyxt.net/pages2/order/confirm_pay 去获取code,授权后就会把code带上然后访问域名
+      // ?fromCart=&code=061F5a1w3aolh03SLe1w3sMsCF4F5a16&state=STATE
+      if (process.env.NODE_ENV !== "development") {
+        // 跳自己授权
+        if (store.getters.config.gzhSelfLicense) {
+          api.getWxConfig().then((res) => {
+            location.replace(
+              `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${
+                res.data.data.gzhAppId
+              }&redirect_uri=${encodeURIComponent(
+                url
+              )}&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect`
+            );
+          });
+        } else {
+          url = url.split("//")[1];
+          location.replace("https://www.xyyxt.net/home/index2?ask_type=" + url);
+        }
+      }
+    }
+    // #endif
+    // #ifdef MP-WEIXIN
+    uni.login({
+      provider: "weixin",
+      success: (loginRes) => {
+        resolve(loginRes.code);
+      },
+    });
+    // #endif
+  });
+}
+
+// 获得openid
+export async function getOpenid() {
+  let openid = uni.getStorageSync("openid");
+  if (!openid) {
+    let code = await getCode();
+    openid = await codeGetOpenid(code);
+    uni.setStorageSync("openid", openid);
+  }
+  return openid;
+}
+
+// code去换openid
+export async function codeGetOpenid(code) {
+  // #ifdef H5
+  let { data } = await api.getH5Openid({ code });
+  return data.msg;
+  // #endif
+  // #ifdef MP-WEIXIN
+  let { data } = await api.getWxOpenid({ code });
+  uni.setStorageSync("unionId", data.data.unionId);
+  return data.data.openId;
+  // #endif
+}
+
+export async function checkOpenidIsUser() {
+  let openid = uni.getStorageSync("openid");
+  if (!openid) {
+    openid = await getOpenid();
+  }
+  let fromPlat = 1;
+  // #ifdef MP-WEIXIN
+  fromPlat = 2;
+  // #endif
+  let { data } = await api.checkBindOpenId({ openid, fromPlat });
+  console.log("🚀 ~ file: authority.js:72 ~ checkOpenidIsUser ~ data:", data);
+  return data;
+}
+export function examClientCanLearn(examLimitClient) {
+  // 限制学习
+  if (!examLimitClient) {
+    return true;
+  }
+  // #ifdef MP-WEIXIN
+  if (examLimitClient.includes("2")) {
+    return true;
+  }
+  // #endif
+  // #ifdef H5
+  if (examLimitClient.includes("1") && isWeixin()) {
+    return true;
+  }
+  // #endif
+  modalComfirm(
+    "请去" + (examLimitClient == 2 ? "微信小程序" : "公众号") + "学习"
+  );
+  throw new Error("examLimitClient:" + examLimitClient);
+}
+
+export async function isCanDoExam(examLimitClient) {
+  if (!examLimitClient || !examClientCanLearn(examLimitClient)) {
+    return false;
+  }
+  let { data } = await checkOpenidIsUser();
+  if (!data) {
+    modalComfirm({
+      content: "该题库只允许同一用户学习",
+      scb: () => {
+        uni.switchTab({
+          url: "/pages/questionBank/index",
+        });
+      },
+    });
+    throw new Error("data:" + data);
+  }
+  return false;
+}
+
+export async function goodsExamIsCanLearn(goodsId) {
+  if (!goodsId) {
+    return true;
+  }
+  let { data } = await api.goodsDetail(goodsId);
+  let { examLimitClient } = data.data;
+  if (await isCanDoExam(examLimitClient)) {
+    throw new Error("openid不一致");
+  }
+  return true;
+}

+ 51 - 0
utils/shared.js

@@ -0,0 +1,51 @@
+export function isWeixin() {
+  var ua = window.navigator.userAgent.toLowerCase();
+  if (
+    ua.match(/MicroMessenger/i) == "micromessenger" ||
+    ua.match(/_SQ_/i) == "_sq_"
+  ) {
+    return true;
+  } else {
+    return false;
+  }
+}
+
+export function isBase64(str) {
+  var reg =
+    /^\s*data:([a-z]+\/[a-z0-9-+.]+(;[a-z-]+=[a-z0-9-]+)?)?(;base64)?,([a-z0-9!$&',()*+;=\-._~:@\/?%\s]*?)\s*$/i;
+  return reg.test(str);
+}
+export function isObject(object) {
+  return object !== null && typeof object === "object";
+}
+export function isEmptyObject(object) {
+  return this.isObject(object) && Object.keys(object).length < 1;
+}
+
+export function modalComfirm(config = {}, t) {
+  if (!isObject(config)) {
+    config = {
+      content: config,
+      title: t,
+    };
+  }
+  let {
+    title = "提示",
+    showCancel = false,
+    content,
+    scb = uni.navigateBack,
+    ecb,
+  } = config;
+  uni.showModal({
+    title: title,
+    showCancel: showCancel,
+    content: content,
+    success: (k) => {
+      if (k.confirm) {
+        scb && scb();
+      } else {
+        ecb && ecb();
+      }
+    },
+  });
+}