yangg 1 mese fa
parent
commit
5af3c2e8c4

+ 63 - 39
pages/identity-verify/identity-verify.vue

@@ -2142,50 +2142,74 @@ export default {
         // 所有视频都播放完毕,显示完成页面或返回
         console.log('所有视频已播放完毕');
         
-       /*  // 显示提示信息
-        uni.showToast({
-          title: '面试已完成',
-          icon: 'success',
-          duration: 2000
-        }); */
-        
         // 清理资源
         this.stopUserCamera();
         this.clearCountdown();
         
-        // 延迟后跳转到camera页面
+        // 获取当前职位ID
+        const currentJobDetail = JSON.parse(uni.getStorageSync('selectedJob'));
+        console.log('当前职位ID:', currentJobDetail);
+        const jobId = currentJobDetail ? currentJobDetail.id : null;
+        
+        console.log('当前职位ID:', jobId);
+        
+        // 延迟后根据职位ID跳转到不同页面
         setTimeout(() => {
-          // 使用navigateTo而不是redirectTo,这样用户可以通过返回按钮回到面试页面
-          uni.navigateTo({
-            url: '/pages/camera/camera',
-            success: () => {
-              console.log('成功跳转到camera页面');
-            },
-            fail: (err) => {
-              console.error('跳转到camera页面失败:', err);
-              
-              // 如果跳转失败,尝试使用redirectTo
-              uni.redirectTo({
-                url: '/pages/camera/camera',
-                fail: (redirectErr) => {
-                  console.error('重定向到camera页面也失败:', redirectErr);
-                  
-                  // 最后尝试使用switchTab(如果camera是tabBar页面)
-                  uni.switchTab({
-                    url: '/pages/camera/camera',
-                    fail: (switchErr) => {
-                      console.error('所有跳转方式都失败:', switchErr);
-                      
-                      // 如果所有跳转方式都失败,尝试返回上一页
-                      uni.navigateBack({
-                        delta: 1
-                      });
-                    }
-                  });
-                }
-              });
-            }
-          });
+          // 如果职位ID为9,跳转到interview-question页面
+          if (jobId === 9) {
+            uni.navigateTo({
+              url: '/pages/interview-question/interview-question',
+              success: () => {
+                console.log('成功跳转到interview-question页面');
+              },
+              fail: (err) => {
+                console.error('跳转到interview-question页面失败:', err);
+                // 如果跳转失败,尝试使用redirectTo
+                uni.redirectTo({
+                  url: '/pages/interview-question/interview-question',
+                  fail: (redirectErr) => {
+                    console.error('重定向到interview-question页面也失败:', redirectErr);
+                    // 如果所有跳转方式都失败,尝试返回上一页
+                    uni.navigateBack({
+                      delta: 1
+                    });
+                  }
+                });
+              }
+            });
+          } else {
+            // 其他职位ID跳转到camera页面
+            uni.navigateTo({
+              url: '/pages/camera/camera',
+              success: () => {
+                console.log('成功跳转到camera页面');
+              },
+              fail: (err) => {
+                console.error('跳转到camera页面失败:', err);
+                
+                // 如果跳转失败,尝试使用redirectTo
+                uni.redirectTo({
+                  url: '/pages/camera/camera',
+                  fail: (redirectErr) => {
+                    console.error('重定向到camera页面也失败:', redirectErr);
+                    
+                    // 最后尝试使用switchTab(如果camera是tabBar页面)
+                    uni.switchTab({
+                      url: '/pages/camera/camera',
+                      fail: (switchErr) => {
+                        console.error('所有跳转方式都失败:', switchErr);
+                        
+                        // 如果所有跳转方式都失败,尝试返回上一页
+                        uni.navigateBack({
+                          delta: 1
+                        });
+                      }
+                    });
+                  }
+                });
+              }
+            });
+          }
         }, 2000);
       }
     },

+ 42 - 14
pages/interview-question/interview-question.vue

@@ -19,7 +19,6 @@
         
         <!-- 视频播放区域,当showGif为false时显示 -->
         <video 
-        
           :src="videoUrl"
           id="myVideo"
           ref="videoPlayer" 
@@ -2270,27 +2269,56 @@ export default {
       }
       
       console.log('导航到下一个页面');
+
+      // 检查 selectedJob 的 id
+      try {
+        const currentJobDetail = uni.getStorageSync('selectedJob');
+        const jobId = currentJobDetail ? JSON.parse(currentJobDetail).id : null;
+        
+        // 如果 id 为 9 或 10,直接跳转到 success 页面
+        if (jobId === 9 || jobId === 10) {
+          uni.navigateTo({
+            url: '/pages/success/success',
+            success: () => {
+              console.log('成功跳转到成功页面');
+            },
+            fail: (err) => {
+              console.error('跳转失败:', err);
+              // 如果跳转失败,尝试其他页面
+              this.handleNavigationFailure();
+            }
+          });
+          return; // 提前返回,不执行后续代码
+        }
+      } catch (e) {
+        console.error('解析 selectedJob 失败:', e);
+        // 解析失败时继续默认跳转逻辑
+      }
       
-      // 移除延迟,直接跳转
+      // 原有的跳转逻辑
       uni.navigateTo({
-        url: '/pages/interview-result/interview-result?uploading=' + (this.uploadQueue.length > 0 ? 'true' : 'false'),
+        url: '/pages/posture-guide/posture-guide?uploading=' + (this.uploadQueue.length > 0 ? 'true' : 'false'),
         success: () => {
           console.log('成功跳转到结果页面');
         },
         fail: (err) => {
           console.error('跳转失败:', err);
+          this.handleNavigationFailure();
+        }
+      });
+    },
+
+    // 添加处理导航失败的方法
+    handleNavigationFailure() {
+      // 尝试跳转到其他页面
+      uni.navigateTo({
+        url: '/pages/posture-guide/posture-guide',
+        fail: (err2) => {
+          console.error('备用跳转也失败:', err2);
           
-          // 如果跳转失败,尝试跳转到其他页面
-          uni.navigateTo({
-            url: '/pages/posture-guide/posture-guide',
-            fail: (err2) => {
-              console.error('备用跳转也失败:', err2);
-              
-              // 最后尝试返回上一页
-              uni.navigateBack({
-                delta: 1
-              });
-            }
+          // 最后尝试返回上一页
+          uni.navigateBack({
+            delta: 1
           });
         }
       });

+ 44 - 11
pages/job-detail/job-detail.vue

@@ -31,22 +31,23 @@
     </view>
     
     <!-- 福利待遇区域 -->
-    <view class="section">
+   <!--  <view class="section">
       <view class="section-title">福利待遇</view>
       <view class="benefits-list">
-        <view class="benefit-tag" v-for="(benefit, index) in jobDetail.benefits" :key="index">{{ benefit }}</view>
+        <view class="benefit-tag" >暂无数据</view>
       </view>
-    </view>
+    </view> -->
     
     <!-- 岗位介绍区域 -->
     <view class="section">
       <view class="section-title">岗位介绍</view>
       <view class="job-description">
-        <view class="description-subtitle">{{ jobDetail.description[0].subtitle }}</view>
+      <!--   <view class="description-subtitle">{{ jobDetail.description[0].subtitle }}</view> -->
         <view class="description-content">
           <view class="description-item" v-for="(item, index) in jobDetail.description[0].items" :key="index">
             <view class="blue-dot"></view>
-            <text>{{ item }}</text>
+            <text style="color: #333;">{{ item }}</text>
+            <!-- <view v-html="item"></view> -->
           </view>
         </view>
       </view>
@@ -118,7 +119,32 @@ export default {
         });
         
         if (data.code === 2000) {
-          // 将API返回的数据映射到页面所需的格式
+          // 处理富文本description
+          let descriptionItems = [];
+          if (data.data.description) {
+            // 使用正则表达式提取<li>标签中的文本内容
+            const liRegex = /<li[^>]*>(.*?)<\/li>/g;
+            const stripTagsRegex = /<[^>]*>/g;
+            
+            let match;
+            while ((match = liRegex.exec(data.data.description)) !== null) {
+              // 移除剩余的HTML标签,并清理空白字符
+              const text = match[1]
+                .replace(stripTagsRegex, '')
+                .replace(/&nbsp;/g, ' ')
+                .trim();
+              
+              if (text) {
+                descriptionItems.push(text);
+              }
+            }
+          }
+
+          // 如果requirements存在,添加到描述项前面
+          if (data.data.requirements) {
+            descriptionItems.unshift(data.data.requirements);
+          }
+
           this.jobDetail = {
             title: data.data.title || '',
             salary: data.data.salary_range ? `${data.data.salary_range}/月` : '',
@@ -129,10 +155,7 @@ export default {
             description: [
               {
                 subtitle: '岗位要求',
-                items: [
-                  data.data.requirements || '',
-                  data.data.description || ''
-                ].filter(item => item) // 过滤掉空值
+                items: descriptionItems
               }
             ]
           };
@@ -358,13 +381,23 @@ export default {
 .description-item {
   display: flex;
   margin-bottom: 20rpx;
+  
+ 
+/*   * {
+    background-color: #fff !important;
+    color: #333 !important;
+  }
+
+  strong {
+    font-weight: bold;
+  } */
 }
 
 .blue-dot {
   min-width: 16rpx;
   height: 16rpx;
   border-radius: 50%;
-  background-color: #0039b3;
+  background-color: #0039b3 !important;
   margin-right: 10rpx;
   margin-top: 12rpx;
 }

+ 20 - 9
pages/success/success.vue

@@ -28,10 +28,10 @@ export default {
   data() {
     return {
       interviewInfo: {
-        position: '前端岗位',
-        startTime: '2024/06/28 14:48',
-        endTime: '2024/06/28 16:47',
-        company: '敏龙科技集团有限公司'
+        position: '',
+        startTime: '',
+        endTime: '',
+        company: ''
       }
     }
   },
@@ -41,7 +41,8 @@ export default {
   methods: {
     async completeInterview() {
       try {
-        const result = await uni.request({
+        // 完成面试的请求
+        const completeResult = await uni.request({
           url: `${apiBaseUrl}/api/job/complete_interview`,
           method: 'POST',
           data: {
@@ -50,13 +51,23 @@ export default {
           }
         });
         
-        // if (result.statusCode === 200) {
-        //   console.log('面试完成状态已更新');
+        // 触发综合分析的请求
+        const analysisResult = await uni.request({
+          url: `${apiBaseUrl}/api/job/trigger_comprehensive_analysis`,
+          method: 'POST',
+          data: {
+            "application_id": JSON.parse(uni.getStorageSync('appId')),
+            "tenant_id": JSON.parse(uni.getStorageSync('userInfo')).tenant_id
+          }
+        });
+
+        // if (completeResult.statusCode === 200 && analysisResult.statusCode === 200) {
+        //   console.log('面试完成状态已更新,综合分析已触发');
         // } else {
-        //   console.error('更新面试状态失败');
+        //   console.error('操作失败');
         // }
       } catch (error) {
-       // console.error('请求失败:', error);
+        // console.error('请求失败:', error);
       }
     },
     goBack() {

+ 49 - 24
unpackage/dist/dev/mp-weixin/pages/identity-verify/identity-verify.js

@@ -1454,31 +1454,56 @@ const _sfc_main = {
         console.log("所有视频已播放完毕");
         this.stopUserCamera();
         this.clearCountdown();
+        const currentJobDetail = JSON.parse(common_vendor.index.getStorageSync("selectedJob"));
+        console.log("当前职位ID:", currentJobDetail);
+        const jobId = currentJobDetail ? currentJobDetail.id : null;
+        console.log("当前职位ID:", jobId);
         setTimeout(() => {
-          common_vendor.index.navigateTo({
-            url: "/pages/camera/camera",
-            success: () => {
-              console.log("成功跳转到camera页面");
-            },
-            fail: (err) => {
-              console.error("跳转到camera页面失败:", err);
-              common_vendor.index.redirectTo({
-                url: "/pages/camera/camera",
-                fail: (redirectErr) => {
-                  console.error("重定向到camera页面也失败:", redirectErr);
-                  common_vendor.index.switchTab({
-                    url: "/pages/camera/camera",
-                    fail: (switchErr) => {
-                      console.error("所有跳转方式都失败:", switchErr);
-                      common_vendor.index.navigateBack({
-                        delta: 1
-                      });
-                    }
-                  });
-                }
-              });
-            }
-          });
+          if (jobId === 9) {
+            common_vendor.index.navigateTo({
+              url: "/pages/interview-question/interview-question",
+              success: () => {
+                console.log("成功跳转到interview-question页面");
+              },
+              fail: (err) => {
+                console.error("跳转到interview-question页面失败:", err);
+                common_vendor.index.redirectTo({
+                  url: "/pages/interview-question/interview-question",
+                  fail: (redirectErr) => {
+                    console.error("重定向到interview-question页面也失败:", redirectErr);
+                    common_vendor.index.navigateBack({
+                      delta: 1
+                    });
+                  }
+                });
+              }
+            });
+          } else {
+            common_vendor.index.navigateTo({
+              url: "/pages/camera/camera",
+              success: () => {
+                console.log("成功跳转到camera页面");
+              },
+              fail: (err) => {
+                console.error("跳转到camera页面失败:", err);
+                common_vendor.index.redirectTo({
+                  url: "/pages/camera/camera",
+                  fail: (redirectErr) => {
+                    console.error("重定向到camera页面也失败:", redirectErr);
+                    common_vendor.index.switchTab({
+                      url: "/pages/camera/camera",
+                      fail: (switchErr) => {
+                        console.error("所有跳转方式都失败:", switchErr);
+                        common_vendor.index.navigateBack({
+                          delta: 1
+                        });
+                      }
+                    });
+                  }
+                });
+              }
+            });
+          }
         }, 2e3);
       }
     },

+ 32 - 9
unpackage/dist/dev/mp-weixin/pages/interview-question/interview-question.js

@@ -1495,21 +1495,44 @@ const _sfc_main = {
         return;
       }
       console.log("导航到下一个页面");
+      try {
+        const currentJobDetail = common_vendor.index.getStorageSync("selectedJob");
+        const jobId = currentJobDetail ? JSON.parse(currentJobDetail).id : null;
+        if (jobId === 9 || jobId === 10) {
+          common_vendor.index.navigateTo({
+            url: "/pages/success/success",
+            success: () => {
+              console.log("成功跳转到成功页面");
+            },
+            fail: (err) => {
+              console.error("跳转失败:", err);
+              this.handleNavigationFailure();
+            }
+          });
+          return;
+        }
+      } catch (e) {
+        console.error("解析 selectedJob 失败:", e);
+      }
       common_vendor.index.navigateTo({
-        url: "/pages/interview-result/interview-result?uploading=" + (this.uploadQueue.length > 0 ? "true" : "false"),
+        url: "/pages/posture-guide/posture-guide?uploading=" + (this.uploadQueue.length > 0 ? "true" : "false"),
         success: () => {
           console.log("成功跳转到结果页面");
         },
         fail: (err) => {
           console.error("跳转失败:", err);
-          common_vendor.index.navigateTo({
-            url: "/pages/posture-guide/posture-guide",
-            fail: (err2) => {
-              console.error("备用跳转也失败:", err2);
-              common_vendor.index.navigateBack({
-                delta: 1
-              });
-            }
+          this.handleNavigationFailure();
+        }
+      });
+    },
+    // 添加处理导航失败的方法
+    handleNavigationFailure() {
+      common_vendor.index.navigateTo({
+        url: "/pages/posture-guide/posture-guide",
+        fail: (err2) => {
+          console.error("备用跳转也失败:", err2);
+          common_vendor.index.navigateBack({
+            delta: 1
           });
         }
       });

+ 18 - 14
unpackage/dist/dev/mp-weixin/pages/job-detail/job-detail.js

@@ -53,6 +53,21 @@ const _sfc_main = {
           method: "GET"
         });
         if (data.code === 2e3) {
+          let descriptionItems = [];
+          if (data.data.description) {
+            const liRegex = /<li[^>]*>(.*?)<\/li>/g;
+            const stripTagsRegex = /<[^>]*>/g;
+            let match;
+            while ((match = liRegex.exec(data.data.description)) !== null) {
+              const text = match[1].replace(stripTagsRegex, "").replace(/&nbsp;/g, " ").trim();
+              if (text) {
+                descriptionItems.push(text);
+              }
+            }
+          }
+          if (data.data.requirements) {
+            descriptionItems.unshift(data.data.requirements);
+          }
           this.jobDetail = {
             title: data.data.title || "",
             salary: data.data.salary_range ? `${data.data.salary_range}/月` : "",
@@ -63,11 +78,7 @@ const _sfc_main = {
             description: [
               {
                 subtitle: "岗位要求",
-                items: [
-                  data.data.requirements || "",
-                  data.data.description || ""
-                ].filter((item) => item)
-                // 过滤掉空值
+                items: descriptionItems
               }
             ]
           };
@@ -144,20 +155,13 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
     c: common_vendor.t($data.jobDetail.department),
     d: common_vendor.t($data.jobDetail.location),
     e: common_vendor.t($data.jobDetail.experience),
-    f: common_vendor.f($data.jobDetail.benefits, (benefit, index, i0) => {
-      return {
-        a: common_vendor.t(benefit),
-        b: index
-      };
-    }),
-    g: common_vendor.t($data.jobDetail.description[0].subtitle),
-    h: common_vendor.f($data.jobDetail.description[0].items, (item, index, i0) => {
+    f: common_vendor.f($data.jobDetail.description[0].items, (item, index, i0) => {
       return {
         a: common_vendor.t(item),
         b: index
       };
     }),
-    i: common_vendor.o((...args) => $options.startInterview && $options.startInterview(...args))
+    g: common_vendor.o((...args) => $options.startInterview && $options.startInterview(...args))
   };
 }
 const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-2bde8e2a"]]);

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

@@ -1 +1 @@
-<view class="job-detail-container data-v-2bde8e2a"><view class="job-header data-v-2bde8e2a"><view class="job-title data-v-2bde8e2a">{{a}}</view><view class="job-salary data-v-2bde8e2a">{{b}}</view><view class="job-department data-v-2bde8e2a">{{c}}</view><view class="job-requirements data-v-2bde8e2a"><view class="requirement-item data-v-2bde8e2a"><view class="dot data-v-2bde8e2a"></view><text class="data-v-2bde8e2a">{{d}}</text></view><view class="requirement-item data-v-2bde8e2a"><view class="time-icon data-v-2bde8e2a"></view><text class="data-v-2bde8e2a">{{e}}</text></view></view></view><view class="section data-v-2bde8e2a"><view class="section-title data-v-2bde8e2a">工作地点</view><view class="map-container data-v-2bde8e2a"><image class="map-image data-v-2bde8e2a" src="https://data.qicai321.com/minlong/6be6ec51-d4a2-4f2b-9bfc-23e046a3db37.png" mode="aspectFill"></image><view class="refresh-icon data-v-2bde8e2a"><text class="iconfont icon-refresh data-v-2bde8e2a"></text></view></view></view><view class="section data-v-2bde8e2a"><view class="section-title data-v-2bde8e2a">福利待遇</view><view class="benefits-list data-v-2bde8e2a"><view wx:for="{{f}}" wx:for-item="benefit" wx:key="b" class="benefit-tag data-v-2bde8e2a">{{benefit.a}}</view></view></view><view class="section data-v-2bde8e2a"><view class="section-title data-v-2bde8e2a">岗位介绍</view><view class="job-description data-v-2bde8e2a"><view class="description-subtitle data-v-2bde8e2a">{{g}}</view><view class="description-content data-v-2bde8e2a"><view wx:for="{{h}}" wx:for-item="item" wx:key="b" class="description-item data-v-2bde8e2a"><view class="blue-dot data-v-2bde8e2a"></view><text class="data-v-2bde8e2a">{{item.a}}</text></view></view></view></view><view class="interview-button data-v-2bde8e2a" bindtap="{{i}}"><text class="data-v-2bde8e2a">开始面试</text></view></view>
+<view class="job-detail-container data-v-2bde8e2a"><view class="job-header data-v-2bde8e2a"><view class="job-title data-v-2bde8e2a">{{a}}</view><view class="job-salary data-v-2bde8e2a">{{b}}</view><view class="job-department data-v-2bde8e2a">{{c}}</view><view class="job-requirements data-v-2bde8e2a"><view class="requirement-item data-v-2bde8e2a"><view class="dot data-v-2bde8e2a"></view><text class="data-v-2bde8e2a">{{d}}</text></view><view class="requirement-item data-v-2bde8e2a"><view class="time-icon data-v-2bde8e2a"></view><text class="data-v-2bde8e2a">{{e}}</text></view></view></view><view class="section data-v-2bde8e2a"><view class="section-title data-v-2bde8e2a">工作地点</view><view class="map-container data-v-2bde8e2a"><image class="map-image data-v-2bde8e2a" src="https://data.qicai321.com/minlong/6be6ec51-d4a2-4f2b-9bfc-23e046a3db37.png" mode="aspectFill"></image><view class="refresh-icon data-v-2bde8e2a"><text class="iconfont icon-refresh data-v-2bde8e2a"></text></view></view></view><view class="section data-v-2bde8e2a"><view class="section-title data-v-2bde8e2a">岗位介绍</view><view class="job-description data-v-2bde8e2a"><view class="description-content data-v-2bde8e2a"><view wx:for="{{f}}" wx:for-item="item" wx:key="b" class="description-item data-v-2bde8e2a"><view class="blue-dot data-v-2bde8e2a"></view><text class="data-v-2bde8e2a" style="color:#333">{{item.a}}</text></view></view></view></view><view class="interview-button data-v-2bde8e2a" bindtap="{{g}}"><text class="data-v-2bde8e2a">开始面试</text></view></view>

+ 9 - 1
unpackage/dist/dev/mp-weixin/pages/job-detail/job-detail.wxss

@@ -148,12 +148,20 @@
 .description-item.data-v-2bde8e2a {
   display: flex;
   margin-bottom: 20rpx;
+  /*   * {
+      background-color: #fff !important;
+      color: #333 !important;
+    }
+
+    strong {
+      font-weight: bold;
+    } */
 }
 .blue-dot.data-v-2bde8e2a {
   min-width: 16rpx;
   height: 16rpx;
   border-radius: 50%;
-  background-color: #0039b3;
+  background-color: #0039b3 !important;
   margin-right: 10rpx;
   margin-top: 12rpx;
 }

+ 13 - 5
unpackage/dist/dev/mp-weixin/pages/success/success.js

@@ -5,10 +5,10 @@ const _sfc_main = {
   data() {
     return {
       interviewInfo: {
-        position: "前端岗位",
-        startTime: "2024/06/28 14:48",
-        endTime: "2024/06/28 16:47",
-        company: "敏龙科技集团有限公司"
+        position: "",
+        startTime: "",
+        endTime: "",
+        company: ""
       }
     };
   },
@@ -18,7 +18,7 @@ const _sfc_main = {
   methods: {
     async completeInterview() {
       try {
-        const result = await common_vendor.index.request({
+        const completeResult = await common_vendor.index.request({
           url: `${common_config.apiBaseUrl}/api/job/complete_interview`,
           method: "POST",
           data: {
@@ -26,6 +26,14 @@ const _sfc_main = {
             "tenant_id": JSON.parse(common_vendor.index.getStorageSync("userInfo")).tenant_id
           }
         });
+        const analysisResult = await common_vendor.index.request({
+          url: `${common_config.apiBaseUrl}/api/job/trigger_comprehensive_analysis`,
+          method: "POST",
+          data: {
+            "application_id": JSON.parse(common_vendor.index.getStorageSync("appId")),
+            "tenant_id": JSON.parse(common_vendor.index.getStorageSync("userInfo")).tenant_id
+          }
+        });
       } catch (error) {
       }
     },

+ 1 - 1
unpackage/dist/dev/mp-weixin/project.config.json

@@ -8,7 +8,7 @@
     "urlCheck": false,
     "es6": true,
     "postcss": false,
-    "minified": false,
+    "minified": true,
     "newFeature": true,
     "bigPackageSizeSupport": true,
     "babelSetting": {