Forráskód Böngészése

迎新v1.0.0(增加授权页面)

4 éve
szülő
commit
7dcdc5fdaf

+ 10 - 5
.hbuilderx/launch.json

@@ -2,10 +2,15 @@
   // launchtype项可配置值为local或remote, local代表前端连本地云函数,remote代表前端连云端云函数
     "version": "0.0",
     "configurations": [{
-            "type": "uniCloud",
-            "default": {
-                "launchtype": "local"
-            }
-        }
+     	"default" : 
+     	{
+     		"launchtype" : "local"
+     	},
+     	"h5" : 
+     	{
+     		"launchtype" : "local"
+     	},
+     	"type" : "uniCloud"
+     }
     ]
 }

+ 7 - 0
pages.json

@@ -1,6 +1,13 @@
 {
 	"pages": [ 
 		{
+			"path": "pages/loginFilter/loginFilter",
+			"style":{
+				"navigationBarTitleText": "预报到",
+				"navigationStyle": "custom"
+			}
+		},
+		{
 			"path": "pages/faceSearch/faceSea",
 			"style":{
 				"navigationBarTitleText": "人脸采集",

+ 8 - 12
pages/confirm/confirm.vue

@@ -1,12 +1,5 @@
 <template>
   <view class="content">
-    <view class="status_bar">
-      <!-- 这里是状态栏 -->
-    </view>
-    <view class="navBar">
-      <view class="back" @click="back()"></view>
-      <text>信息确认</text>
-    </view>
     <!-- 叠层背景 -->
     <view class="messageBg1"></view>
     <view class="messageBg2"></view>
@@ -34,10 +27,10 @@
 export default {
   data() {
     return {
-      name: "",
-      sex: "",
-      examNumber: "",
-      idnum: "",
+      name: "", //姓名
+      sex: "", //性别
+      examNumber: "", //准考证号
+      idnum: "", //学号或身份证号
     };
   },
   created() {
@@ -54,12 +47,15 @@ export default {
       let that = this;
 
       uni.navigateTo({
-        url: "../index/index",
+        url: "/pages/index/index",
       });
       setTimeout(() => {
         let webUrl = "https://wj.qq.com/s2/8767613/e476?openid=";
+
         let openid = that.idnum;
+
         let url = webUrl + openid;
+
         window.location.href = url;
       }, 500);
     },

+ 16 - 55
pages/confirm/css/confirm.css

@@ -1,66 +1,25 @@
-@charset "UTF-8";
-page {
-  height: 100%;
-}
-
 .content {
   position: relative;
-  width: 100%;
-  height: 100%;
+  width: 750rpx;
+  height: 1334rpx;
   font-family: "MicrosoftYaHei";
   font-weight: 400;
-  background-image: url(../../static/images/背景.png);
+  background-image: url(../../static/images/bg.png);
   background-size: 100% 100%;
   background-attachment: fixed;
-}
-
-.content background-repeat:no-repeat
-.status_bar {
-  position: fixed;
-  top: 0;
-  height: var(--status-bar-height);
-  width: 100%;
-  background: #f8f8f8;
-  z-index: 1000;
-}
-
-.content .navBar {
-  position: fixed;
-  top: 0;
-  left: 0;
-  width: 750rpx;
-  height: 55rpx;
-  margin-top: 34rpx;
-  color: #fff;
-  font-weight: bold;
-  background-color: rbga(0, 0, 0, 0.1);
-  text-align: center;
-  line-height: 55rpx;
-}
-
-.content .navBar .back {
-  display: inline-block;
-  position: absolute;
-  top: 16rpx;
-  left: 30rpx;
-  width: 10px;
-  height: 10px;
-  border: none;
-  border-bottom: 4rpx solid #fff;
-  border-left: 4rpx solid #fff;
-  transform: rotate(45deg);
-  text-align: center;
+  background-repeat: no-repeat;
 }
 
 .content .messageCard {
   position: absolute;
-  top: 330rpx;
+  top: 231rpx;
   left: 36rpx;
   width: 678rpx;
   height: 680rpx;
   background: #fff;
   border-radius: 14rpx;
   box-sizing: border-box;
+  z-index: 4;
 }
 
 .content .messageCard .detail {
@@ -81,7 +40,7 @@ page {
 .content .messageCard .detail .head view {
   width: 8rpx;
   height: 30rpx;
-  background: #6EAFF0;
+  background: #6eaff0;
   margin-top: 12rpx;
   margin-right: 19rpx;
 }
@@ -101,11 +60,11 @@ page {
 .content .messageCard .confirm {
   width: 322rpx;
   height: 80rpx;
-  background: #6EAFF0;
+  background: #6eaff0;
   border-radius: 10rpx;
   margin: 0 auto;
   font-size: 28rpx;
-  color: #FFFFFF;
+  color: #ffffff;
   line-height: 80rpx;
   text-align: center;
   margin-top: 100rpx;
@@ -118,28 +77,30 @@ page {
   margin: 0 auto;
   margin-top: 38rpx;
   font-size: 24rpx;
-  color: #B3B3B3;
+  color: #b3b3b3;
   line-height: 40rpx;
 }
 
 .content .messageBg1 {
   position: absolute;
-  top: 344rpx;
+  top: 245rpx;
   left: 51rpx;
   width: 648rpx;
   height: 680rpx;
-  background: #FFFFFF;
+  background: #ffffff;
   opacity: 0.7;
   border-radius: 14rpx;
+  z-index: 3;
 }
 
 .content .messageBg2 {
   position: absolute;
-  top: 357rpx;
+  top: 258rpx;
   left: 58rpx;
   width: 634rpx;
   height: 680rpx;
-  background: #FFFFFF;
+  background: #ffffff;
   opacity: 0.5;
   border-radius: 14rpx;
+  z-index: 2;
 }

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 1 - 1
pages/confirm/css/confirm.min.css


+ 96 - 147
pages/confirm/css/confirm.scss

@@ -1,153 +1,102 @@
-  page {
-      height: 100%;
-  }
-  .content {
-      position: relative;
-      width: 100%;
-      height: 100%;
-      font-family: "MicrosoftYaHei";
-      font-weight: 400;
-      background-image: url(../../static/images/背景.png);
-      background-size:100% 100%;
-      background-attachment: fixed;
-      background-repeat:no-repeat
-    .status_bar {
-            position: fixed;
-            top: 0;
-            height: var(--status-bar-height);
-            width: 100%;
-            background: #f8f8f8;
-            z-index: 1000;
-        }
-        .navBar{
-            position: fixed;
-            top: 0;
-            left: 0;
-            width: 750rpx;
-            height: 55rpx;
-            margin-top: 34rpx;
-            color: #fff;
-            font-weight: bold;
-            background-color: rbga(0,0,0,0.1);
-            text-align: center;
-            line-height: 55rpx;
-            .back{
-                display: inline-block;
-                position: absolute;
-                top: 16rpx;
-                left:30rpx ;
-                width: 10px;
-                height: 10px;
-                border: none;
-                border-bottom: 4rpx solid #fff;
-                border-left: 4rpx solid #fff;
-                transform: rotate(45deg);
-                text-align: center;
-                
-            }
-        }
-    //   .bgImg {
-    //       position: absolute;
-    //       left: 0;
-    //       top: 0;
-    //       z-index: 1000;
-    //       width: 100%;
-    //       height: 100%;
-
-		  
-    //   }
-
-      .messageCard {
-          position: absolute;
-          top: 330rpx;
-          left: 36rpx;
-          width: 678rpx;
-          height: 680rpx;
-          background: #fff;
-          border-radius: 14rpx;
-          box-sizing: border-box;
-
-          .detail {
-              display: flex;
-              flex-direction: column;
-              justify-content: space-between;
-              width: 578rpx;
-              height: 300rpx;
-              margin-top: 50rpx;
-              margin-left: 50rpx;
-
-              .head {
-                  display: flex;
-                  justify-content: flex-start;
-
-                  view {
-                      width: 8rpx;
-                      height: 30rpx;
-                      background: #6EAFF0;
-                      margin-top: 12rpx;
-                      margin-right: 19rpx;
-                  }
+.content {
+    position: relative;
+    width: 750rpx;
+    height: 1334rpx;
+    font-family: "MicrosoftYaHei";
+    font-weight: 400;
+    background-image: url(../../static/images/bg.png);
+    background-size: 100% 100%;
+    background-attachment: fixed;
+    background-repeat: no-repeat;
+    .messageCard {
+        position: absolute;
+        top: 231rpx;
+        left: 36rpx;
+        width: 678rpx;
+        height: 680rpx;
+        background: #fff;
+        border-radius: 14rpx;
+        box-sizing: border-box;
+        z-index: 4;
+        .detail {
+            display: flex;
+            flex-direction: column;
+            justify-content: space-between;
+            width: 578rpx;
+            height: 300rpx;
+            margin-top: 50rpx;
+            margin-left: 50rpx;
 
-                  text {
-                      font-size: 32rpx;
-                      font-weight: bold;
-                      color: #333333;
-                      line-height: 54rpx;
-                  }
-              }
+            .head {
+                display: flex;
+                justify-content: flex-start;
 
-              .mes {
-                  font-size: 28rpx;
-                  line-height: 54rpx;
-              }
-          }
+                view {
+                    width: 8rpx;
+                    height: 30rpx;
+                    background: #6eaff0;
+                    margin-top: 12rpx;
+                    margin-right: 19rpx;
+                }
 
-          .confirm {
-              width: 322rpx;
-              height: 80rpx;
-              background: #6EAFF0;
-              border-radius: 10rpx;
-              margin: 0 auto;
-              font-size: 28rpx;
-              color: #FFFFFF;
-              line-height: 80rpx;
-              text-align: center;
-              margin-top: 100rpx;
-          }
-
-          .footer {
-              display: block;
-              width: 578rpx;
-              height: 63rpx;
-              margin: 0 auto;
-              margin-top: 38rpx;
-              font-size: 24rpx;
-              color: #B3B3B3;
-              line-height: 40rpx;
-
-          }
-      }
+                text {
+                    font-size: 32rpx;
+                    font-weight: bold;
+                    color: #333333;
+                    line-height: 54rpx;
+                }
+            }
 
-      .messageBg1 {
-          position: absolute;
-          top: 344rpx;
-          left: 51rpx;
-          width: 648rpx;
-          height: 680rpx;
-          background: #FFFFFF;
-          opacity: 0.7;
-          border-radius: 14rpx;
-      }
+            .mes {
+                font-size: 28rpx;
+                line-height: 54rpx;
+            }
+        }
 
-      .messageBg2 {
-          position: absolute;
-          top: 357rpx;
-          left: 58rpx;
-          width: 634rpx;
-          height: 680rpx;
-          background: #FFFFFF;
-          opacity: 0.5;
-          border-radius: 14rpx;
-      }
+        .confirm {
+            width: 322rpx;
+            height: 80rpx;
+            background: #6eaff0;
+            border-radius: 10rpx;
+            margin: 0 auto;
+            font-size: 28rpx;
+            color: #ffffff;
+            line-height: 80rpx;
+            text-align: center;
+            margin-top: 100rpx;
+        }
 
-  }
+        .footer {
+            display: block;
+            width: 578rpx;
+            height: 63rpx;
+            margin: 0 auto;
+            margin-top: 38rpx;
+            font-size: 24rpx;
+            color: #b3b3b3;
+            line-height: 40rpx;
+        }
+    }
+    .messageBg1 {
+        position: absolute;
+        top: 245rpx;
+        left: 51rpx;
+        width: 648rpx;
+        height: 680rpx;
+        background: #ffffff;
+        opacity: 0.7;
+        border-radius: 14rpx;
+        z-index: 3;
+    }
+    .messageBg2 {
+        position: absolute;
+        top: 258rpx;
+        left: 58rpx;
+        width: 634rpx;
+        height: 680rpx;
+        background: #ffffff;
+        opacity: 0.5;
+        border-radius: 14rpx;
+        z-index: 2;
+    }
+}

+ 3 - 53
pages/faceSearch/css/faceSea.css

@@ -13,7 +13,6 @@
   width: 750rpx;
   height: 1000rpx;
   background: #6eaff0;
-  z-index: 2;
   overflow: hidden;
 }
 
@@ -24,7 +23,7 @@
   width: 100%;
   height: 100%;
   border-radius: 5rpx;
-  z-index: 3;
+  z-index: 2;
 }
 
 .content .cameraField .hint {
@@ -40,7 +39,7 @@
   text-align: center;
   line-height: 72rpx;
   box-sizing: border-box;
-  z-index: 4;
+  z-index: 3;
 }
 
 .content .cameraField .hint image {
@@ -51,55 +50,6 @@
   margin-bottom: 4rpx;
 }
 
-.content .cameraField .uploading {
-  display: flex;
-  position: absolute;
-  top: 251rpx;
-  left: 244rpx;
-  flex-direction: column;
-  justify-content: space-around;
-  width: 263rpx;
-  height: 296rpx;
-  font-size: 24rpx;
-  border-radius: 10rpx;
-  background: rgba(0, 0, 0, 0.33);
-  box-sizing: border-box;
-  z-index: 4;
-}
-
-.content .cameraField .uploading image {
-  max-width: 60rpx;
-  max-height: 60rpx;
-  text-align: center;
-  margin-left: 102rpx;
-  margin-top: 40rpx;
-  animation: myMove 2s linear infinite normal;
-}
-
-@keyframes myMove {
-  0% {
-    transform: rotate(0deg);
-  }
-  25% {
-    transform: rotate(90deg);
-  }
-  50% {
-    transform: rotate(180deg);
-  }
-  75% {
-    transform: rotate(270deg);
-  }
-  100% {
-    transform: rotate(360deg);
-  }
-}
-
-.content .cameraField .uploading text {
-  margin-bottom: 30rpx;
-  color: #fff;
-  text-align: center;
-}
-
 .content .cameraField .head {
   position: absolute;
   bottom: 16%;
@@ -107,7 +57,7 @@
   transform: translateX(-376rpx);
   width: 750rpx;
   height: 620rpx;
-  z-index: 5;
+  z-index: 3;
 }
 
 .content .controlField {

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 1 - 1
pages/faceSearch/css/faceSea.min.css


+ 4 - 64
pages/faceSearch/css/faceSea.scss

@@ -6,13 +6,11 @@
     height: 100%;
     background: #fff;
     font-family: "MicrosoftYaHei";
-
     .cameraField {
         position: relative;
         width: 750rpx;
         height: 1000rpx;
         background: #6eaff0;
-        z-index: 2;
         overflow: hidden;
         canvas {
             position: absolute;
@@ -21,9 +19,8 @@
             width: 100%;
             height: 100%;
             border-radius: 5rpx;
-            z-index: 3;
+            z-index: 2;
         }
-
         .hint {
             position: absolute;
             top: 45rpx;
@@ -37,8 +34,7 @@
             text-align: center;
             line-height: 72rpx;
             box-sizing: border-box;
-            z-index: 4;
-
+            z-index: 3;
             image {
                 max-width: 30rpx;
                 max-height: 30rpx;
@@ -47,60 +43,6 @@
                 margin-bottom: 4rpx;
             }
         }
-
-        .uploading {
-            display: flex;
-            position: absolute;
-            top: 251rpx;
-            left: 244rpx;
-            flex-direction: column;
-            justify-content: space-around;
-            width: 263rpx;
-            height: 296rpx;
-            font-size: 24rpx;
-            border-radius: 10rpx;
-            background: rgba($color: #000000, $alpha: 0.33);
-            box-sizing: border-box;
-            z-index: 4;
-
-            image {
-                max-width: 60rpx;
-                max-height: 60rpx;
-                text-align: center;
-                margin-left: 102rpx;
-                margin-top: 40rpx;
-                animation: myMove 2s linear infinite normal;
-
-                @keyframes myMove {
-                    0% {
-                        transform: rotate(0deg);
-                    }
-
-                    25% {
-                        transform: rotate(90deg);
-                    }
-
-                    50% {
-                        transform: rotate(180deg);
-                    }
-
-                    75% {
-                        transform: rotate(270deg);
-                    }
-
-                    100% {
-                        transform: rotate(360deg);
-                    }
-                }
-            }
-
-            text {
-                margin-bottom: 30rpx;
-                color: #fff;
-                text-align: center;
-            }
-        }
-
         .head {
             position: absolute;
             bottom: 16%;
@@ -108,16 +50,14 @@
             transform: translateX(-376rpx);
             width: 750rpx;
             height: 620rpx;
-
-            z-index: 5;
+            z-index: 3;
         }
     }
 
     .controlField {
         width: 750rpx;
-        //  height: 447rpx;
+        // height: 334rpx;
         color: #fff;
-
         .control1 {
             display: flex;
             justify-content: space-between;

+ 66 - 160
pages/faceSearch/faceSea.vue

@@ -1,4 +1,5 @@
 <template>
+  <!-- 人脸识别页面 -->
   <view class="content">
     <!-- 拍照区域 -->
     <view class="cameraField">
@@ -14,11 +15,6 @@
         <image :src="hintImage" />
         {{ hintWord }}
       </view>
-      <!-- “上传中”提示框 -->
-      <!-- <view class="uploading" v-if="isShow4">
-        <image src="../../static/images/等待@2x.png" mode="scaleToFill" />
-        <text>人脸匹配中...</text>
-      </view> -->
       <!-- 头像限制框    -->
       <image
         class="head"
@@ -50,8 +46,8 @@
 </template>
 
 <script>
-import { EXIF } from "../../node_modules/exif-js/exif";
-import { mapState, mapMutations } from "vuex";
+import { EXIF } from "../../node_modules/exif-js/exif"; //引入exif.js判断图片旋转方向
+import { mapState, mapMutations } from "vuex"; //引入vuex
 import {
   pathToBase64,
   base64ToPath,
@@ -63,23 +59,19 @@ export default {
       isShow2: false, //重拍/上传控件
       isShow3: true, //提示框
       // isShow4: false, //“上传中”提示框
-      hintImage: "../../static/images/注意@2x.png", //提示图标
+      hintImage: "../../static/images/hint@2x.png", //提示图标
       hintWord: "请勿遮挡面部", //提示文字
-      imgPath: "", //上传的人脸图片
-      tipFlag: "",
-      maxWidth: "",
-      maxHeight: "",
+      imgPath: "", //上传的人脸图片本地路径
+      tipFlag: "", //手机机型
+      maxWidth: "", //手机屏幕宽度
+      maxHeight: "", //手机屏幕高度
     };
   },
 
   computed: mapState(["position", "userData"]),
 
   onLoad(options) {
-    //拉取微信授权获取cardNumber
-    this.loginFilter();
-  },
-
-  mounted() {
+    //判断设备机型
     let that = this;
 
     (function () {
@@ -87,7 +79,7 @@ export default {
 
       var isAndroid = u.indexOf("Android") > -1 || u.indexOf("Linux") > -1; //android终端或者uc浏览器
 
-      var isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
+      var isiOS = u.indexOf("iPhone") > -1; //苹果手机
 
       if (isiOS) {
         that.tipFlag = "ios";
@@ -101,109 +93,6 @@ export default {
   methods: {
     ...mapMutations(["getPosition", "getUserData"]),
 
-    // 授权获取信息
-    loginFilter() {
-      let cardNumber = localStorage.getItem("cardNumber");
-
-      if (!cardNumber) {
-        let cardNumber = this.getQueryString("cardNumber");
-
-        let name = this.getQueryString("name");
-
-        let error = this.getQueryString("error");
-
-        let homeWeb =
-          "https://open.wecard.qq.com/connect/oauth/authorize?app_key=8C41E2FECF2E9925&response_type=code&scope=snsapi_userinfo&ocode=1015730314&redirect_uri=https://jtishfw.ncjti.edu.cn/yinxin/ncjtSecurityManagement/getUserInfo&state=1";
-
-        if (!cardNumber) {
-          window.location.href = homeWeb;
-        } else {
-          if (error) {
-            uni.showToast({
-              title: "获取cardNumber失败",
-              icon: "error",
-              mask: true,
-              duration: 1000,
-            });
-            setTimeout(function () {
-              uni.navigateTo({
-                url: "../index/index",
-              });
-            }, 1000);
-          }
-          localStorage.setItem("cardNumber", cardNumber);
-          this.$store.state.name = name;
-          this.$store.state.idnum = cardNumber;
-          this.judgeGrade();
-        }
-      } else {
-        this.judgeGrade();
-      }
-    },
-
-    //判断老生无权限
-    judgeGrade() {
-      let cardNumber = localStorage.getItem("cardNumber");
-
-      let date = new Date();
-
-      let year = date.getFullYear().toString();
-
-      let grade = this.getQueryString("grade");
-
-      if (grade == year && cardNumber) {
-        this.judgeWrite();
-      } else {
-        uni.showToast({
-          title: "无权限,仅对新生请退出",
-          icon: "error",
-          mask: true,
-          duration: 120000,
-        });
-      }
-    },
-
-    //判断是否填写问卷
-    judgeWrite() {
-      let cardNumber = localStorage.getItem("cardNumber");
-
-      uni.request({
-        url: "https://jtishfw.ncjti.edu.cn/yinxin/ncjtSecurityManagement/freshmanSurveyDoneByIdnum",
-        data: {
-          idnum: cardNumber,
-        },
-        header: {
-          Accept: "application/json",
-          "Content-Type": "application/json",
-          "X-Requested-With": "XMLHttpRequest",
-        },
-        method: "GET",
-        sslVerify: true,
-        success: ({ data, statusCode, header }) => {
-          // console.log(data);
-          if (data.result === "success") {
-            uni.navigateTo({
-              url: "../index/index",
-            });
-          }
-        },
-        fail: (error) => {},
-      });
-    },
-
-    //获取当前URL指定参数
-    getQueryString(name) {
-      let url = window.location.href; // 获取URL
-
-      let pattern = new RegExp("[\?\&]" + name + "=([^\&]+)", "i"); // 正则匹配URL
-
-      let matcher = pattern.exec(url);
-
-      if (matcher == null || matcher.length < 1) {
-        return false;
-      }
-      return decodeURIComponent(matcher[1]); // 输出指定的参数值 中文也可以
-    },
     //拍照控件变重拍上传控件
     takeToReset() {
       this.isShow1 = !this.isShow1;
@@ -219,6 +108,46 @@ export default {
       this.isShow2 = !this.isShow2;
       this.photo();
     },
+    //照片
+    photo() {
+      let that = this;
+
+      uni.chooseImage({
+        count: 1,
+        sourceType: ["camera"],
+        sizeType: ["compressed"],
+        success: (res) => {
+          //获取设备屏幕尺寸
+          uni.getSystemInfo({
+            success: function (res2) {
+              that.maxWidth = res2.screenWidth;
+
+              let base = 4 / 3;
+
+              that.maxHeight = that.maxWidth * base;
+            },
+          });
+
+          that.imgPath = res.tempFilePaths[0]; //这就是要的blod
+
+          that.toBase64(that.imgPath); //转base64图片
+
+          //图片显示
+          if (that.tipFlag == "ios") {
+            let canvas = uni.createCanvasContext("canvas");
+
+            canvas.drawImage(that.imgPath, 0, 0, that.maxWidth, that.maxHeight);
+
+            canvas.draw();
+
+            this.takeToReset(); //图片显示后显示重拍控件
+          } else {
+            that.detail(that.imgPath);
+          }
+        },
+      });
+    },
+
     //安卓机图片修正
     async detail(url) {
       let Orientation = 1;
@@ -227,12 +156,15 @@ export default {
       await this.getImageTag(url, "Orientation", function (e) {
         if (e != undefined) Orientation = e;
       });
+
       var img = null;
+
       var canvas = null;
       await this.comprossImage(url, function (e) {
         img = e.img;
         canvas = e.canvas;
       });
+
       //  console.log(Orientation,"Orientation")
       //如果方向角不为1,都需要进行旋转
       switch (Orientation) {
@@ -362,36 +294,6 @@ export default {
           break;
       }
     },
-    //照片
-    photo() {
-      let that = this;
-
-      uni.chooseImage({
-        count: 1,
-        sourceType: ["camera"],
-        sizeType: ["compressed"],
-        success: (res) => {
-          uni.getSystemInfo({
-            success: function (res2) {
-              that.maxWidth = res2.screenWidth;
-              let base = 4 / 3;
-              that.maxHeight = that.maxWidth * base;
-            },
-          });
-          that.imgPath = res.tempFilePaths[0]; //这就是要的blod
-          that.toBase64(that.imgPath); //转base64图片
-          //图片页面显示
-          if (that.tipFlag == "ios") {
-            let canvas = uni.createCanvasContext("canvas");
-            canvas.drawImage(that.imgPath, 0, 0, that.maxWidth, that.maxHeight);
-            canvas.draw();
-            this.takeToReset();
-          } else {
-            that.detail(that.imgPath);
-          }
-        },
-      });
-    },
     //上传图片
     upload() {
       let idnum = this.$store.state.idnum;
@@ -404,7 +306,7 @@ export default {
         title: "人脸匹配中",
         icon: "loading",
         mask: true,
-        duration: 2500,
+        duration: 2000,
       });
       if (idnum && image) {
         uni.request({
@@ -441,18 +343,24 @@ export default {
             setTimeout(this.back, 1000);
           },
         });
+      } else {
+        uni.showToast({
+          title: "image或idnum不能为空",
+          icon: "error",
+          mask: true,
+          duration: 1500,
+        });
+        this.isShow3 = !this.isShow3;
       }
     },
-
     //人脸采集成功
     uploadSucceed() {
       this.hintWord = "人脸匹配成功";
-      this.hintImage = "../../static/images/成功@2x.png";
+      this.hintImage = "../../static/images/success@2x.png";
       this.isShow3 = !this.isShow3;
       this.takeToReset();
-      setTimeout(this.navigateToConfirm, 2000);
+      setTimeout(this.navigateToConfirm, 1500);
     },
-
     //图片转Base64
     toBase64(path) {
       pathToBase64(path)
@@ -464,18 +372,16 @@ export default {
           console.error(error);
         });
     },
-
     //跳转人脸采集确认页面
     navigateToConfirm() {
       uni.navigateTo({
-        url: "../confirm/confirm",
+        url: "/pages/confirm/confirm",
       });
     },
-
     //返回重新拍照
     back() {
       uni.reLaunch({
-        url: "../faceSearch/faceSea",
+        url: "/pages/faceSearch/faceSea",
       });
     },
   },

+ 5 - 9
pages/index/index.vue

@@ -1,4 +1,5 @@
 <template>
+  <!-- 首页面 -->
   <view class="container">
     <view class="item-image"> </view>
     <view class="item-title">
@@ -14,10 +15,6 @@
         <image src="../../static/images/card.png" class="img-btn"></image>
         <text class="list-txt">临时卡领取</text>
       </view>
-      <!-- <view class="item-list-one" @click="navigateToPay">
-        <image src="../../static/images/pay.png" class="img-btn"></image>
-        <text class="list-txt">在线缴费</text>
-      </view> -->
     </view>
   </view>
 </template>
@@ -29,26 +26,25 @@ export default {
   },
 
   onLoad() {
+    //预加载页面
     uni.preloadPage({ url: "../map/map" });
     uni.preloadPage({ url: "../weiChat/weiChat" });
   },
   upUnload() {},
   methods: {
+    //跳转地图导览页面
     navigateToMap() {
       uni.navigateTo({
         url: "../map/map",
       });
     },
+    //跳转临时卡页面
     navigateToCard() {
       uni.navigateTo({
         url: "../weiChat/weiChat",
       });
     },
-    navigateToPay() {
-      // uni.navigateTo({
-      //   url: "../Pay/pay",
-      // });
-    },
+    //跳转学校官网
     navigateToGW() {
       let gwUrl = "https://www.ecjtuit.edu.cn/?ivk_sa=1024320u";
       window.location.href = gwUrl;

+ 123 - 0
pages/loginFilter/loginFilter.vue

@@ -0,0 +1,123 @@
+<template>
+  <!-- 授权页面 -->
+  <view></view>
+</template>
+
+<script>
+import { mapState, mapMutations } from "vuex"; //引入vuex存储idnum与name
+export default {
+  data() {
+    return {
+      homeUrl: "https://jtishfw.ncjti.edu.cn/yinxin/ncjtSecurityManagement",
+    };
+  },
+  computed: mapState(["position", "userData"]),
+  onLoad(options) {
+    //拉取微校授权获取cardNumber
+    this.loginFilter();
+  },
+  methods: {
+    ...mapMutations(["getPosition", "getUserData"]),
+    // 授权获取信息
+    loginFilter() {
+      let cardNumber = this.getQueryString("cardNumber");
+
+      let name = this.getQueryString("name");
+
+      let error = this.getQueryString("error");
+
+      let errorMsg = this.getQueryString("errorMsg");
+
+      let homeWeb = `https://open.wecard.qq.com/connect/oauth/authorize?app_key=8C41E2FECF2E9925&response_type=code&scope=snsapi_userinfo&ocode=1015730314&redirect_uri=${this.homeUrl}/getUserInfo&state=1`;
+
+      if (error) {
+        uni.showToast({
+          title: errorMsg,
+          icon: "error",
+          mask: true,
+          duration: 1000,
+        });
+        setTimeout(() => {
+          uni.navigateTo({
+            url: "/pages/index/index",
+          });
+        }, 1000);
+      } else if (!cardNumber) {
+        window.location.href = homeWeb;
+      } else {
+        localStorage.setItem("cardNumber", cardNumber);
+        this.$store.state.name = name;
+        this.$store.state.idnum = cardNumber;
+        this.judgeGrade();
+      }
+    },
+    //判断老生无权限
+    judgeGrade() {
+      let cardNumber = localStorage.getItem("cardNumber");
+
+      let date = new Date();
+
+      let year = date.getFullYear().toString();
+
+      let grade = this.getQueryString("grade");
+
+      if (grade == year && cardNumber) {
+        this.judgeWrite();
+      } else {
+        uni.showToast({
+          title: "无权限,仅对新生请退出",
+          icon: "error",
+          mask: true,
+          duration: 120000,
+        });
+      }
+    },
+    //判断是否填写问卷
+    judgeWrite() {
+      let cardNumber = localStorage.getItem("cardNumber");
+
+      let url = this.homeUrl + "/freshmanSurveyDoneByIdnum";
+
+      uni.request({
+        url: url,
+        data: {
+          idnum: cardNumber,
+        },
+        header: {
+          Accept: "application/json",
+          "Content-Type": " application/x-www-form-urlencoded;charset=utf-8",
+          "X-Requested-With": "XMLHttpRequest",
+        },
+        method: "GET",
+        sslVerify: true,
+        success: ({ data, statusCode, header }) => {
+          // console.log(data);
+          if (data.result === "success") {
+            uni.navigateTo({
+              url: "/pages/index/index",
+            });
+          } else {
+            uni.navigateTo({ url: "/pages/faceSearch/faceSea" });
+          }
+        },
+        fail: (error) => {},
+      });
+    },
+    //获取当前URL指定参数
+    getQueryString(name) {
+      let url = window.location.href; // 获取URL
+
+      let pattern = new RegExp("[\?\&]" + name + "=([^\&]+)", "i"); // 正则匹配URL
+
+      let matcher = pattern.exec(url);
+
+      if (matcher == null || matcher.length < 1) {
+        return false;
+      }
+      return decodeURIComponent(matcher[1]); // 输出指定的参数值 中文也可以
+    },
+  },
+};
+</script>
+
+<style lang="less"></style>

+ 2 - 1
pages/map/map.vue

@@ -1,4 +1,5 @@
 <template>
+  <!-- 地图导览页面 -->
   <view class="content">
     <image :src="'data:image/png;base64,' + imgUrl" mode="aspectFit" />
   </view>
@@ -29,7 +30,7 @@ export default {
           if (statusCode == 200) {
             // console.log(data);
             // console.log(data.replace(/[\r\n]/g, ""));
-            var url = JSON.parse(data.replace(/[\r\n]/g, ""));
+            var url = JSON.parse(data.replace(/[\r\n]/g, "")); //解析base64字符串
             // console.log(url);
             this.imgUrl = url.map;
             // console.log(this.imgUrl);

+ 1 - 0
pages/weiChat/weiChat.vue

@@ -1,4 +1,5 @@
 <template>
+  <!-- 临时卡领取页面 -->
   <view class="content">
     <image :src="'data:image/jpeg;base64,' + imgUrl" mode="aspectFit" />
   </view>

static/images/背景.png → static/images/bg.png


static/images/注意@2x.png → static/images/hint@2x.png


BIN
static/images/pay.png


static/images/成功@2x.png → static/images/success@2x.png


BIN
static/images/付款成功.png


BIN
static/images/等待@2x.png


BIN
static/images/背景2.png


+ 5 - 5
store/index.js

@@ -3,11 +3,11 @@ import Vuex from 'vuex'
 Vue.use(Vuex)
 const store = new Vuex.Store({
 	state: {
-		name: '',
-		sex: '',
-		examNumber:'',
-        idnum: '',
-		imageBase: '',
+		name: '',//姓名
+		sex: '',//性别
+		examNumber:'',//准考证号
+        idnum: '',//学号或身份证号
+		imageBase: '',//人脸照片
 	},
 	mutations: {