|
@@ -3567,19 +3567,52 @@ const _sfc_main = {
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
} else {
|
|
} else {
|
|
|
|
|
+ let configData = {};
|
|
|
|
|
+ try {
|
|
|
|
|
+ const configStr = common_vendor.index.getStorageSync("configData");
|
|
|
|
|
+ if (configStr && configStr.trim()) {
|
|
|
|
|
+ configData = JSON.parse(configStr);
|
|
|
|
|
+ }
|
|
|
|
|
+ } catch (error) {
|
|
|
|
|
+ console.error("解析configData失败:", error);
|
|
|
|
|
+ configData = {};
|
|
|
|
|
+ }
|
|
|
|
|
+ console.log("获取到的配置数据:", configData);
|
|
|
|
|
+ const questionFormSwitches = (configData == null ? void 0 : 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 == null ? void 0 : configData.enable_posture_check;
|
|
|
|
|
+ const hasCandidateQuestions = questionFormSwitches.enable_candidate_questions;
|
|
|
|
|
+ let targetUrl = "/pages/camera/camera";
|
|
|
|
|
+ let pageName = "camera页面";
|
|
|
|
|
+ console.log("当前配置数据:", hasScoringQuestions);
|
|
|
|
|
+ if (hasChoiceQuestions) {
|
|
|
|
|
+ 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 {
|
|
|
|
|
+ targetUrl = "/pages/success/success";
|
|
|
|
|
+ pageName = "camera页面";
|
|
|
|
|
+ }
|
|
|
|
|
+ console.log("根据配置跳转到:", targetUrl, "配置项:", questionFormSwitches);
|
|
|
common_vendor.index.navigateTo({
|
|
common_vendor.index.navigateTo({
|
|
|
- url: "/pages/camera/camera",
|
|
|
|
|
|
|
+ url: targetUrl,
|
|
|
success: () => {
|
|
success: () => {
|
|
|
- console.log("成功跳转到camera页面");
|
|
|
|
|
|
|
+ console.log(`成功跳转到${pageName}`);
|
|
|
},
|
|
},
|
|
|
fail: (err) => {
|
|
fail: (err) => {
|
|
|
- console.error("跳转到camera页面失败:", err);
|
|
|
|
|
|
|
+ console.error(`跳转到${pageName}失败:`, err);
|
|
|
common_vendor.index.redirectTo({
|
|
common_vendor.index.redirectTo({
|
|
|
- url: "/pages/camera/camera",
|
|
|
|
|
|
|
+ url: targetUrl,
|
|
|
fail: (redirectErr) => {
|
|
fail: (redirectErr) => {
|
|
|
- console.error("重定向到camera页面也失败:", redirectErr);
|
|
|
|
|
|
|
+ console.error(`重定向到${pageName}也失败:`, redirectErr);
|
|
|
common_vendor.index.switchTab({
|
|
common_vendor.index.switchTab({
|
|
|
- url: "/pages/camera/camera",
|
|
|
|
|
|
|
+ url: targetUrl,
|
|
|
fail: (switchErr) => {
|
|
fail: (switchErr) => {
|
|
|
console.error("所有跳转方式都失败:", switchErr);
|
|
console.error("所有跳转方式都失败:", switchErr);
|
|
|
common_vendor.index.navigateBack({
|
|
common_vendor.index.navigateBack({
|