Selaa lähdekoodia

添加实名认证及面试成功页面

yangg 2 kuukautta sitten
vanhempi
sitoutus
c92b2d56d2

+ 59 - 61
pages/index/index.vue

@@ -62,6 +62,7 @@
 </template>
 
 <script>
+import { apiBaseUrl } from '@/common/config.js';
 	import {
 		fillUserInfo,
 		getUserInfo,
@@ -318,14 +319,6 @@
 					return;
 				}
 
-				/* if (!this.formData.gender) {
-					uni.showToast({
-						title: '请选择性别',
-						icon: 'none'
-					});
-					return;
-				} */
-
 				if (!this.formData.phone.trim()) {
 					uni.showToast({
 						title: '请输入手机号',
@@ -359,38 +352,6 @@
 					return;
 				}
 
-				/* if (!this.formData.emergencyContact.trim()) {
-					uni.showToast({
-						title: '请输入紧急联系人',
-						icon: 'none'
-					});
-					return;
-				}
-
-				if (!this.formData.emergencyPhone.trim()) {
-					uni.showToast({
-						title: '请输入紧急联系人电话',
-						icon: 'none'
-					});
-					return;
-				} */
-
-				/* if (!/^1\d{10}$/.test(this.formData.emergencyPhone)) {
-					uni.showToast({
-						title: '请输入正确的紧急联系人电话',
-						icon: 'none'
-					});
-					return;
-				}
-
-				if (!this.formData.relation) {
-					uni.showToast({
-						title: '请选择与紧急联系人关系',
-						icon: 'none'
-					});
-					return;
-				} */
-
 				if (!this.isAgreed) {
 					uni.showToast({
 						title: '请阅读并同意相关协议',
@@ -399,6 +360,53 @@
 					return;
 				}
 
+				uni.showLoading({
+					title: '验证身份信息...'
+				});
+
+				// 先调用身份验证接口
+				uni.request({
+					url: `${apiBaseUrl}/wechat/identity/verify`,
+					method: 'POST',
+					data: {
+						name: this.formData.name,
+						id_number: this.formData.idCard,
+						mobile: this.formData.phone
+					},
+					header: {
+						'content-type': 'application/x-www-form-urlencoded'
+					},
+					success: (res) => {
+						// 身份验证成功后,继续提交用户信息
+						console.log(res);
+						if (res.statusCode === 200) {
+							if (res.data.code === 200) {
+								this.submitUserInfo();
+							} else {
+								uni.showToast({
+									title: res.data.data.message,
+									icon: 'none'
+								});
+							}
+						} else {
+							uni.hideLoading();
+							uni.showToast({
+								title: '身份验证失败,请检查信息是否正确',
+								icon: 'none'
+							});
+						}
+					},
+					fail: (err) => {
+						uni.hideLoading();
+						console.error('身份验证失败:', err);
+						uni.showToast({
+							title: '网络错误,请稍后重试',
+							icon: 'none'
+						});
+					}
+				});
+			},
+			submitUserInfo() {
 				const submitData = {
 					openid: JSON.parse(uni.getStorageSync('userInfo') || '{}').openid || '',
 					name: this.formData.name,
@@ -415,31 +423,21 @@
 					job_id: this.selectedJobId
 				};
 
-				uni.showLoading({
-					title: '提交中...'
-				});
-
 				fillUserInfo(submitData)
 					.then(res => {
 						uni.hideLoading();
-							this.updateLocalUserInfo(res.id);
+						this.updateLocalUserInfo(res.id);
 
-							uni.showToast({
-								title: '提交成功',
-								icon: 'success',
-								duration: 1500,
-								success: () => {
-									this.userInfoFilled = false;
-									// setTimeout(() => {
-									// }, 1500);
-								}
-							});
-						// } else {
-						// 	uni.showToast({
-						// 		title: res.msg || '提交失败,请重试',
-						// 		icon: 'none'
-						// 	});
-						// }
+						uni.showToast({
+							title: '提交成功',
+							icon: 'success',
+							duration: 1500,
+							success: () => {
+								this.userInfoFilled = false;
+								// setTimeout(() => {
+								// }, 1500);
+							}
+						});
 					})
 					.catch(err => {
 						uni.hideLoading();

+ 59 - 90
pages/success/success.vue

@@ -1,37 +1,23 @@
 <template>
   <view class="success-container">
-    <!-- 成功图标 -->
-    <view class="success-icon">
-      <view class="icon-circle">
-        <text class="iconfont icon-check">✓</text>
-      </view>
-      <text class="success-text">面试报名成功</text>
+    <!-- 用户头像 -->
+    <view class="avatar-container">
+      <view class="avatar-circle"></view>
     </view>
     
-    <!-- 面试信息 -->
-    <view class="interview-info">
-      <view class="info-title">面试信息</view>
-      <view class="info-item">
-        <text class="label">面试时间:</text>
-        <text class="value">2024/06/28 14:48</text>
-      </view>
-      <view class="info-item time-end">
-        <text class="value">2024/06/28 16:47</text>
-      </view>
-      <view class="info-item">
-        <text class="label">面试公司:</text>
-        <text class="value">敏龙科技集团有限公司</text>
-      </view>
+    <!-- 面试结束提示 -->
+    <view class="interview-status">
+      <text class="status-text">AI面试已结束</text>
     </view>
     
-    <!-- 底部按钮 -->
-    <view class="btn-container">
-      <button class="start-btn" @click="startInterview">开始面试</button>
+    <!-- 提示信息 -->
+    <view class="tips-container">
+      <text class="tips-text">本次面试的全部环节已结束,非常感谢您的参与</text>
     </view>
     
-    <!-- 底部提示 -->
-    <view class="bottom-tips">
-      <text>本次面试将在约定时间内有效,请按时参加面试</text>
+    <!-- 底部按钮 -->
+    <view class="btn-container">
+      <button class="confirm-btn" @click="goBack">我知道了</button>
     </view>
   </view>
 </template>
@@ -49,14 +35,12 @@ export default {
     }
   },
   methods: {
-    startInterview() {
-      uni.navigateTo({
-        url: '/pages/interview-notice/interview-notice',
-        fail: (err) => {
-          console.error('页面跳转失败:', err);
-          uni.showToast({
-            title: '页面跳转失败',
-            icon: 'none'
+    goBack() {
+      uni.navigateBack({
+        delta: 1,
+        fail: () => {
+          uni.reLaunch({
+            url: '/pages/index/index'
           });
         }
       });
@@ -69,89 +53,74 @@ export default {
 .success-container {
   display: flex;
   flex-direction: column;
+  align-items: center;
   min-height: 100vh;
-  background-color: #f5f7fa;
+  background-color: #ffffff;
   padding: 30rpx;
 }
 
-.success-icon {
-  display: flex;
-  flex-direction: column;
-  align-items: center;
-  margin: 60rpx 0;
+.avatar-container {
+  margin-top: 100rpx;
+  margin-bottom: 40rpx;
 }
 
-.icon-circle {
-  width: 120rpx;
-  height: 120rpx;
-  background-color: #4cd137;
+.avatar-circle {
+  width: 180rpx;
+  height: 180rpx;
+  background-color: #f5f5f5;
   border-radius: 50%;
-  display: flex;
-  justify-content: center;
-  align-items: center;
-  margin-bottom: 20rpx;
-}
-
-.icon-check {
-  color: white;
-  font-size: 60rpx;
-  font-weight: bold;
-}
-
-.success-text {
-  font-size: 36rpx;
-  font-weight: bold;
-  color: #333;
+  position: relative;
 }
 
-.interview-info {
-  background-color: #fff;
-  border-radius: 12rpx;
-  padding: 30rpx;
-  margin-bottom: 40rpx;
+.avatar-circle::after {
+  content: '';
+  position: absolute;
+  bottom: -30rpx;
+  left: 50%;
+  transform: translateX(-50%);
+  width: 120rpx;
+  height: 60rpx;
+  background-color: #f5f5f5;
+  border-radius: 60rpx 60rpx 0 0;
 }
 
-.info-title {
-  font-size: 32rpx;
-  font-weight: bold;
+.interview-status {
+  margin-top: 60rpx;
   margin-bottom: 20rpx;
 }
 
-.info-item {
-  display: flex;
-  margin: 15rpx 0;
-  font-size: 28rpx;
-  color: #333;
+.status-text {
+  font-size: 36rpx;
+  color: #007AFF;
+  font-weight: normal;
 }
 
-.time-end {
-  margin-top: -10rpx;
-  padding-left: 120rpx;
+.tips-container {
+  padding: 0 60rpx;
+  text-align: center;
+  margin-bottom: 60rpx;
 }
 
-.label {
-  color: #666;
-  width: 120rpx;
+.tips-text {
+  font-size: 28rpx;
+  color: #999999;
+  line-height: 1.5;
 }
 
 .btn-container {
-  margin: 40rpx 0;
+  margin-top: 80rpx;
+  width: 100%;
+  padding: 0 40rpx;
 }
 
-.start-btn {
+.confirm-btn {
   width: 100%;
   height: 90rpx;
   line-height: 90rpx;
-  background-color: #6c5ce7;
-  color: #fff;
+  background-color: #ffffff;
+  color: #333333;
   border-radius: 45rpx;
   font-size: 32rpx;
-}
-
-.bottom-tips {
-  text-align: center;
-  font-size: 24rpx;
-  color: #999;
-  margin-top: 20rpx;
+  border: 1px solid #e0e0e0;
 }
 </style> 

+ 45 - 3
unpackage/dist/dev/mp-weixin/pages/index/index.js

@@ -1,5 +1,6 @@
 "use strict";
 const common_vendor = require("../../common/vendor.js");
+const common_config = require("../../common/config.js");
 const api_user = require("../../api/user.js");
 const _sfc_main = {
   data() {
@@ -250,6 +251,50 @@ const _sfc_main = {
         });
         return;
       }
+      common_vendor.index.showLoading({
+        title: "验证身份信息..."
+      });
+      common_vendor.index.request({
+        url: `${common_config.apiBaseUrl}/wechat/identity/verify`,
+        method: "POST",
+        data: {
+          name: this.formData.name,
+          id_number: this.formData.idCard,
+          mobile: this.formData.phone
+        },
+        header: {
+          "content-type": "application/x-www-form-urlencoded"
+        },
+        success: (res) => {
+          console.log(res);
+          if (res.statusCode === 200) {
+            if (res.data.code === 200) {
+              this.submitUserInfo();
+            } else {
+              common_vendor.index.showToast({
+                title: res.data.data.message,
+                icon: "none"
+              });
+            }
+          } else {
+            common_vendor.index.hideLoading();
+            common_vendor.index.showToast({
+              title: "身份验证失败,请检查信息是否正确",
+              icon: "none"
+            });
+          }
+        },
+        fail: (err) => {
+          common_vendor.index.hideLoading();
+          console.error("身份验证失败:", err);
+          common_vendor.index.showToast({
+            title: "网络错误,请稍后重试",
+            icon: "none"
+          });
+        }
+      });
+    },
+    submitUserInfo() {
       const submitData = {
         openid: JSON.parse(common_vendor.index.getStorageSync("userInfo") || "{}").openid || "",
         name: this.formData.name,
@@ -265,9 +310,6 @@ const _sfc_main = {
         age: "20",
         job_id: this.selectedJobId
       };
-      common_vendor.index.showLoading({
-        title: "提交中..."
-      });
       api_user.fillUserInfo(submitData).then((res) => {
         common_vendor.index.hideLoading();
         this.updateLocalUserInfo(res.id);

+ 7 - 9
unpackage/dist/dev/mp-weixin/pages/success/success.js

@@ -12,14 +12,12 @@ const _sfc_main = {
     };
   },
   methods: {
-    startInterview() {
-      common_vendor.index.navigateTo({
-        url: "/pages/interview-notice/interview-notice",
-        fail: (err) => {
-          console.error("页面跳转失败:", err);
-          common_vendor.index.showToast({
-            title: "页面跳转失败",
-            icon: "none"
+    goBack() {
+      common_vendor.index.navigateBack({
+        delta: 1,
+        fail: () => {
+          common_vendor.index.reLaunch({
+            url: "/pages/index/index"
           });
         }
       });
@@ -28,7 +26,7 @@ const _sfc_main = {
 };
 function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
   return {
-    a: common_vendor.o((...args) => $options.startInterview && $options.startInterview(...args))
+    a: common_vendor.o((...args) => $options.goBack && $options.goBack(...args))
   };
 }
 const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);

+ 1 - 1
unpackage/dist/dev/mp-weixin/pages/success/success.wxml

@@ -1 +1 @@
-<view class="success-container"><view class="success-icon"><view class="icon-circle"><text class="iconfont icon-check">✓</text></view><text class="success-text">面试报名成功</text></view><view class="interview-info"><view class="info-title">面试信息</view><view class="info-item"><text class="label">面试时间:</text><text class="value">2024/06/28 14:48</text></view><view class="info-item time-end"><text class="value">2024/06/28 16:47</text></view><view class="info-item"><text class="label">面试公司:</text><text class="value">敏龙科技集团有限公司</text></view></view><view class="btn-container"><button class="start-btn" bindtap="{{a}}">开始面试</button></view><view class="bottom-tips"><text>本次面试将在约定时间内有效,请按时参加面试</text></view></view>
+<view class="success-container"><view class="avatar-container"><view class="avatar-circle"></view></view><view class="interview-status"><text class="status-text">AI面试已结束</text></view><view class="tips-container"><text class="tips-text">本次面试的全部环节已结束,非常感谢您的参与</text></view><view class="btn-container"><button class="confirm-btn" bindtap="{{a}}">我知道了</button></view></view>

+ 41 - 53
unpackage/dist/dev/mp-weixin/pages/success/success.wxss

@@ -2,76 +2,64 @@
 .success-container {
   display: flex;
   flex-direction: column;
+  align-items: center;
   min-height: 100vh;
-  background-color: #f5f7fa;
+  background-color: #ffffff;
   padding: 30rpx;
 }
-.success-icon {
-  display: flex;
-  flex-direction: column;
-  align-items: center;
-  margin: 60rpx 0;
+.avatar-container {
+  margin-top: 100rpx;
+  margin-bottom: 40rpx;
 }
-.icon-circle {
-  width: 120rpx;
-  height: 120rpx;
-  background-color: #4cd137;
+.avatar-circle {
+  width: 180rpx;
+  height: 180rpx;
+  background-color: #f5f5f5;
   border-radius: 50%;
-  display: flex;
-  justify-content: center;
-  align-items: center;
-  margin-bottom: 20rpx;
-}
-.icon-check {
-  color: white;
-  font-size: 60rpx;
-  font-weight: bold;
+  position: relative;
 }
-.success-text {
-  font-size: 36rpx;
-  font-weight: bold;
-  color: #333;
-}
-.interview-info {
-  background-color: #fff;
-  border-radius: 12rpx;
-  padding: 30rpx;
-  margin-bottom: 40rpx;
+.avatar-circle::after {
+  content: '';
+  position: absolute;
+  bottom: -30rpx;
+  left: 50%;
+  transform: translateX(-50%);
+  width: 120rpx;
+  height: 60rpx;
+  background-color: #f5f5f5;
+  border-radius: 60rpx 60rpx 0 0;
 }
-.info-title {
-  font-size: 32rpx;
-  font-weight: bold;
+.interview-status {
+  margin-top: 60rpx;
   margin-bottom: 20rpx;
 }
-.info-item {
-  display: flex;
-  margin: 15rpx 0;
-  font-size: 28rpx;
-  color: #333;
+.status-text {
+  font-size: 36rpx;
+  color: #007AFF;
+  font-weight: normal;
 }
-.time-end {
-  margin-top: -10rpx;
-  padding-left: 120rpx;
+.tips-container {
+  padding: 0 60rpx;
+  text-align: center;
+  margin-bottom: 60rpx;
 }
-.label {
-  color: #666;
-  width: 120rpx;
+.tips-text {
+  font-size: 28rpx;
+  color: #999999;
+  line-height: 1.5;
 }
 .btn-container {
-  margin: 40rpx 0;
+  margin-top: 80rpx;
+  width: 100%;
+  padding: 0 40rpx;
 }
-.start-btn {
+.confirm-btn {
   width: 100%;
   height: 90rpx;
   line-height: 90rpx;
-  background-color: #6c5ce7;
-  color: #fff;
+  background-color: #ffffff;
+  color: #333333;
   border-radius: 45rpx;
   font-size: 32rpx;
-}
-.bottom-tips {
-  text-align: center;
-  font-size: 24rpx;
-  color: #999;
-  margin-top: 20rpx;
+  border: 1px solid #e0e0e0;
 }