Procházet zdrojové kódy

修改问答题逻辑

yangg před 1 měsícem
rodič
revize
e1a130f06c

+ 1 - 1
common/config.js

@@ -2,7 +2,7 @@
 //线上 https://minlong.raycos.com.cn
 //测试 http://192.168.66.187:8083
 //https://backend.qicai321.com
-export const apiBaseUrl = 'https://backend.qicai321.com';
+export const apiBaseUrl = 'http://192.168.66.187:8083';
 
 // You can add other global configuration settings here
 export const appVersion = '1.0.0';

+ 31 - 23
pages/camera/camera.vue

@@ -758,45 +758,53 @@
 					return;
 				}
 				
-				// 使用更简单的防重复点击逻辑
-				// 检查是否在提交中
-				if (this.isSubmitting) {
-					console.log('正在提交答案,请稍候...');
+				// 防重复点击
+				if (this._isClicking) {
 					return;
 				}
+				this._isClicking = true;
 				
-				// 设置临时标记防止重复点击
-				this.isSubmitting = true;
-				
-				// 如果是当前题目,调用原有的选择逻辑
-				this.selectOption(index);
+				// 清除之前的计时器
+				if (this._clickTimer) {
+					clearTimeout(this._clickTimer);
+				}
 				
-				// 短暂延迟后重置状态,允许下一次点击
-				setTimeout(() => {
-					this.isSubmitting = false;
-				}, 500);
+				try {
+					// 如果是当前题目,调用选择逻辑
+					this.selectOption(index);
+					
+					// 设置延时,防止快速重复点击
+					this._clickTimer = setTimeout(() => {
+						this._isClicking = false;
+					}, 1000);
+					
+				} catch (error) {
+					console.error('处理选项点击失败:', error);
+					uni.showToast({
+						title: '操作失败,请重试',
+						icon: 'none'
+					});
+					this._isClicking = false;
+				}
 			},
 
 			// 处理题目分组
 			processQuestionGroups(questions) {
-				// 创建三个分组
-				const group1 = []; // category 为 10 或 7 的题目
-				const group2 = []; // category 为 5 的题目
-				const group3 = []; // 其他题目
+				// 创建两个分组
+				const group1 = []; // category 为 5 的题目
+				const group2 = []; // 其他题目
 
 				// 对题目进行分类
 				questions.forEach(q => {
-					if (q.category === 10 || q.category === 7) {
+					if (q.category === 5) {
 						group1.push(q);
-					} else if (q.category === 5) {
-						group2.push(q);
 					} else {
-						group3.push(q);
+						group2.push(q);
 					}
 				});
 
-				// 按照要求的顺序组合题目组
-				this.questionGroups = [group3, group1, group2].filter(group => group.length > 0);
+				// 按照要求的顺序组合题目组:先显示其他题目,再显示 category 为 5 的题目
+				this.questionGroups = [group2, group1].filter(group => group.length > 0);
 				
 				// 设置当前显示的题目
 				this.questions = this.questionGroups[0] || [];

+ 12 - 12
pages/interview/interview.vue

@@ -146,12 +146,12 @@ import { apiBaseUrl } from '@/common/config.js'; // Import the base URL from a c
 				cameraMode: 'normal', // 添加相机模式
 				cameraInitRetries: 0, // 添加重试计数器
 				gestureOverlays: [
-					'http://121.36.251.245:9000/minlong/%E5%B7%A6%E6%89%8B%E6%89%8B%E6%8E%8C.png',
-					'http://121.36.251.245:9000/minlong/%E5%B7%A6%E6%89%8B%E6%89%8B%E8%83%8C.png',
-					'http://121.36.251.245:9000/minlong/%E5%B7%A6%E6%89%8B%E6%8F%A1%E6%8B%B3.png',
-					'http://121.36.251.245:9000/minlong/%E5%8F%B3%E6%89%8B%E6%89%8B%E6%8E%8C.png',
-					'http://121.36.251.245:9000/minlong/%E5%8F%B3%E6%89%8B%E6%89%8B%E8%83%8C.png',
-					'http://121.36.251.245:9000/minlong/%E5%8F%B3%E6%89%8B%E6%8F%A1%E6%8B%B3.png'
+					'http://data.qicai321.com/minlong/18590378-6792-4a26-be18-ad9f2bcc4159.png',
+					'http://data.qicai321.com/minlong/e08cff2b-3b1d-478f-a62b-766b38445a16.png',
+					'http://data.qicai321.com/minlong/d30ccab7-9cfe-4386-bf0e-ac1f0045bd76.png',
+					'http://data.qicai321.com/minlong/8068a698-ac40-4a5d-a737-54dba47a668d.png',
+					'http://data.qicai321.com/minlong/f04a1f7e-4f79-49c7-9a02-bbad296672ea.png',
+					'http://data.qicai321.com/minlong/1d9bbc36-2fb8-4489-bff6-c36e7a31bd37.png'
 					/* '/static/images/palm_overlay.png',  // 手掌正面引导图
 					'/static/images/back_overlay.png',  // 手掌反面引导图
 					'/static/images/fist_overlay.png'   // 握拳引导图 */
@@ -167,12 +167,12 @@ import { apiBaseUrl } from '@/common/config.js'; // Import the base URL from a c
 				photoLinks: [null, null, null, null, null, null], // 存储上传后的图片链接
 				cameraPosition: 'front', // 修改默认为前置摄像头
 				guideIcon: [
-					'http://121.36.251.245:9000/minlong/01%E5%B7%A6%E6%89%8B%E6%89%8B%E6%8E%8C.mp4',
-					'http://121.36.251.245:9000/minlong/02%E5%B7%A6%E6%89%8B%E6%89%8B%E8%83%8C.mp4',
-					'http://121.36.251.245:9000/minlong/03%E5%B7%A6%E6%89%8B%E6%8F%A1%E6%8B%B3.mp4',
-					'http://121.36.251.245:9000/minlong/04%E5%8F%B3%E6%89%8B%E6%89%8B%E6%8E%8C.mp4',
-					'http://121.36.251.245:9000/minlong/05%E5%8F%B3%E6%89%8B%E6%89%8B%E8%83%8C.mp4',
-					'http://121.36.251.245:9000/minlong/06%E5%8F%B3%E6%89%8B%E6%8F%A1%E6%8B%B3.mp4',
+					'http://data.qicai321.com/minlong/fd080e3b-67be-4ce7-87a3-58d047cfbbb1.mp4',
+					'http://data.qicai321.com/minlong/394a858c-672a-44bd-8206-450913863900.mp4',
+					'http://data.qicai321.com/minlong/37153e68-a8f0-4a93-b677-5e5678379243.mp4',
+					'http://data.qicai321.com/minlong/ebf6e43f-ffdf-49bb-8b00-adeff9ce1b56.mp4',
+					'http://data.qicai321.com/minlong/e0ca45e2-af3e-42a0-9dd1-4de545e9c720.mp4',
+					'http://data.qicai321.com/minlong/77028dd6-22bb-41b4-8879-19699e8b1dbb.mp4',
 				]
 			}
 		},

+ 1 - 1
unpackage/dist/dev/mp-weixin/common/config.js

@@ -1,3 +1,3 @@
 "use strict";
-const apiBaseUrl = "https://backend.qicai321.com";
+const apiBaseUrl = "http://192.168.66.187:8083";
 exports.apiBaseUrl = apiBaseUrl;

+ 21 - 13
unpackage/dist/dev/mp-weixin/pages/camera/camera.js

@@ -494,31 +494,39 @@ const _sfc_main = {
         this.currentScrollId = "question-" + firstUnansweredIndex;
         return;
       }
-      if (this.isSubmitting) {
-        console.log("正在提交答案,请稍候...");
+      if (this._isClicking) {
         return;
       }
-      this.isSubmitting = true;
-      this.selectOption(index);
-      setTimeout(() => {
-        this.isSubmitting = false;
-      }, 500);
+      this._isClicking = true;
+      if (this._clickTimer) {
+        clearTimeout(this._clickTimer);
+      }
+      try {
+        this.selectOption(index);
+        this._clickTimer = setTimeout(() => {
+          this._isClicking = false;
+        }, 1e3);
+      } catch (error) {
+        console.error("处理选项点击失败:", error);
+        common_vendor.index.showToast({
+          title: "操作失败,请重试",
+          icon: "none"
+        });
+        this._isClicking = false;
+      }
     },
     // 处理题目分组
     processQuestionGroups(questions) {
       const group1 = [];
       const group2 = [];
-      const group3 = [];
       questions.forEach((q) => {
-        if (q.category === 10 || q.category === 7) {
+        if (q.category === 5) {
           group1.push(q);
-        } else if (q.category === 5) {
-          group2.push(q);
         } else {
-          group3.push(q);
+          group2.push(q);
         }
       });
-      this.questionGroups = [group3, group1, group2].filter((group) => group.length > 0);
+      this.questionGroups = [group2, group1].filter((group) => group.length > 0);
       this.questions = this.questionGroups[0] || [];
     },
     // 处理继续按钮点击

+ 12 - 12
unpackage/dist/dev/mp-weixin/pages/interview/interview.js

@@ -34,12 +34,12 @@ const _sfc_main = {
       cameraInitRetries: 0,
       // 添加重试计数器
       gestureOverlays: [
-        "http://121.36.251.245:9000/minlong/%E5%B7%A6%E6%89%8B%E6%89%8B%E6%8E%8C.png",
-        "http://121.36.251.245:9000/minlong/%E5%B7%A6%E6%89%8B%E6%89%8B%E8%83%8C.png",
-        "http://121.36.251.245:9000/minlong/%E5%B7%A6%E6%89%8B%E6%8F%A1%E6%8B%B3.png",
-        "http://121.36.251.245:9000/minlong/%E5%8F%B3%E6%89%8B%E6%89%8B%E6%8E%8C.png",
-        "http://121.36.251.245:9000/minlong/%E5%8F%B3%E6%89%8B%E6%89%8B%E8%83%8C.png",
-        "http://121.36.251.245:9000/minlong/%E5%8F%B3%E6%89%8B%E6%8F%A1%E6%8B%B3.png"
+        "http://data.qicai321.com/minlong/18590378-6792-4a26-be18-ad9f2bcc4159.png",
+        "http://data.qicai321.com/minlong/e08cff2b-3b1d-478f-a62b-766b38445a16.png",
+        "http://data.qicai321.com/minlong/d30ccab7-9cfe-4386-bf0e-ac1f0045bd76.png",
+        "http://data.qicai321.com/minlong/8068a698-ac40-4a5d-a737-54dba47a668d.png",
+        "http://data.qicai321.com/minlong/f04a1f7e-4f79-49c7-9a02-bbad296672ea.png",
+        "http://data.qicai321.com/minlong/1d9bbc36-2fb8-4489-bff6-c36e7a31bd37.png"
         /* '/static/images/palm_overlay.png',  // 手掌正面引导图
         '/static/images/back_overlay.png',  // 手掌反面引导图
         '/static/images/fist_overlay.png'   // 握拳引导图 */
@@ -57,12 +57,12 @@ const _sfc_main = {
       cameraPosition: "front",
       // 修改默认为前置摄像头
       guideIcon: [
-        "http://121.36.251.245:9000/minlong/01%E5%B7%A6%E6%89%8B%E6%89%8B%E6%8E%8C.mp4",
-        "http://121.36.251.245:9000/minlong/02%E5%B7%A6%E6%89%8B%E6%89%8B%E8%83%8C.mp4",
-        "http://121.36.251.245:9000/minlong/03%E5%B7%A6%E6%89%8B%E6%8F%A1%E6%8B%B3.mp4",
-        "http://121.36.251.245:9000/minlong/04%E5%8F%B3%E6%89%8B%E6%89%8B%E6%8E%8C.mp4",
-        "http://121.36.251.245:9000/minlong/05%E5%8F%B3%E6%89%8B%E6%89%8B%E8%83%8C.mp4",
-        "http://121.36.251.245:9000/minlong/06%E5%8F%B3%E6%89%8B%E6%8F%A1%E6%8B%B3.mp4"
+        "http://data.qicai321.com/minlong/fd080e3b-67be-4ce7-87a3-58d047cfbbb1.mp4",
+        "http://data.qicai321.com/minlong/394a858c-672a-44bd-8206-450913863900.mp4",
+        "http://data.qicai321.com/minlong/37153e68-a8f0-4a93-b677-5e5678379243.mp4",
+        "http://data.qicai321.com/minlong/ebf6e43f-ffdf-49bb-8b00-adeff9ce1b56.mp4",
+        "http://data.qicai321.com/minlong/e0ca45e2-af3e-42a0-9dd1-4de545e9c720.mp4",
+        "http://data.qicai321.com/minlong/77028dd6-22bb-41b4-8879-19699e8b1dbb.mp4"
       ]
     };
   },

+ 7 - 0
unpackage/dist/dev/mp-weixin/project.private.config.json

@@ -7,6 +7,13 @@
   "condition": {
     "miniprogram": {
       "list": [
+        {
+          "name": "pages/identity-verify/identity-verify",
+          "pathName": "pages/identity-verify/identity-verify",
+          "query": "",
+          "launchMode": "default",
+          "scene": null
+        },
         {
           "name": "pages/interview/interview",
           "pathName": "pages/interview/interview",