|
|
@@ -5041,24 +5041,75 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
} else {
|
|
|
- // 其他职位ID跳转到camera页面
|
|
|
+ // 获取本地存储的配置数据
|
|
|
+ let configData = {};
|
|
|
+ try {
|
|
|
+ const configStr = uni.getStorageSync('configData');
|
|
|
+ if (configStr && configStr.trim()) {
|
|
|
+ configData = JSON.parse(configStr);
|
|
|
+ }
|
|
|
+ } catch (error) {
|
|
|
+ console.error('解析configData失败:', error);
|
|
|
+ configData = {};
|
|
|
+ }
|
|
|
+
|
|
|
+ console.log('获取到的配置数据:', configData);
|
|
|
+
|
|
|
+ // 获取问题形式开关配置
|
|
|
+ const questionFormSwitches = configData?.question_form_switches || {};
|
|
|
+
|
|
|
+ // 检查是否启用了选择题相关功能
|
|
|
+ const hasChoiceQuestions = questionFormSwitches.enable_fill_blank ||
|
|
|
+ questionFormSwitches.enable_image_choice ||
|
|
|
+ questionFormSwitches.enable_multiple_choice ||
|
|
|
+ questionFormSwitches.enable_single_choice;
|
|
|
+
|
|
|
+ // 检查是否启用了评分题功能
|
|
|
+ const hasScoringQuestions = questionFormSwitches.enable_scoring_questions;
|
|
|
+ //肢体检测
|
|
|
+ const hasPostureDetection = configData?.enable_posture_check;
|
|
|
+ //候选人提问
|
|
|
+ const hasCandidateQuestions = questionFormSwitches.enable_candidate_questions;
|
|
|
+ let targetUrl = '/pages/camera/camera'; // 默认跳转到camera页面
|
|
|
+ let pageName = 'camera页面';
|
|
|
+ console.log('当前配置数据:', hasScoringQuestions);
|
|
|
+ // 根据配置决定跳转页面
|
|
|
+ if (hasChoiceQuestions) {
|
|
|
+ // 如果启用了评分题,跳转到posture-guide页面
|
|
|
+ targetUrl = '/pages/camera/camera';
|
|
|
+ pageName = 'posture-guide页面';
|
|
|
+ }else if(hasPostureDetection){
|
|
|
+ targetUrl = '/pages/posture-guide/posture-guide';
|
|
|
+ pageName = 'posture-guide页面';
|
|
|
+ }else if(hasCandidateQuestions){
|
|
|
+ targetUrl = '/pages/interview-question/interview-question';
|
|
|
+ pageName = 'interview-question页面';
|
|
|
+ } else {
|
|
|
+ // 如果启用了选择题相关功能,跳转到camera页面
|
|
|
+ targetUrl = '/pages/success/success';
|
|
|
+ pageName = 'camera页面';
|
|
|
+ }
|
|
|
+
|
|
|
+ console.log('根据配置跳转到:', targetUrl, '配置项:', questionFormSwitches);
|
|
|
+
|
|
|
+ // 执行页面跳转
|
|
|
uni.navigateTo({
|
|
|
- url: '/pages/camera/camera',
|
|
|
+ url: targetUrl,
|
|
|
success: () => {
|
|
|
- console.log('成功跳转到camera页面');
|
|
|
+ console.log(`成功跳转到${pageName}`);
|
|
|
},
|
|
|
fail: (err) => {
|
|
|
- console.error('跳转到camera页面失败:', err);
|
|
|
+ console.error(`跳转到${pageName}失败:`, err);
|
|
|
|
|
|
// 如果跳转失败,尝试使用redirectTo
|
|
|
uni.redirectTo({
|
|
|
- url: '/pages/camera/camera',
|
|
|
+ url: targetUrl,
|
|
|
fail: (redirectErr) => {
|
|
|
- console.error('重定向到camera页面也失败:', redirectErr);
|
|
|
+ console.error(`重定向到${pageName}也失败:`, redirectErr);
|
|
|
|
|
|
- // 最后尝试使用switchTab(如果camera是tabBar页面)
|
|
|
+ // 最后尝试使用switchTab(如果是tabBar页面)
|
|
|
uni.switchTab({
|
|
|
- url: '/pages/camera/camera',
|
|
|
+ url: targetUrl,
|
|
|
fail: (switchErr) => {
|
|
|
console.error('所有跳转方式都失败:', switchErr);
|
|
|
|