From 29823bd10e862d5ff628f0bfa073d4e8489dfd0d Mon Sep 17 00:00:00 2001 From: "liu.huiying@ebiz-digits.com" Date: Tue, 18 Mar 2025 10:35:25 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E6=8A=95=E6=94=BE=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/layouts/index.vue | 2 +- src/layouts/utils.js | 33 +++++++++++++-------------------- 2 files changed, 14 insertions(+), 21 deletions(-) diff --git a/src/layouts/index.vue b/src/layouts/index.vue index faa1080..05e1744 100644 --- a/src/layouts/index.vue +++ b/src/layouts/index.vue @@ -27,7 +27,7 @@ const route = useRoute(); const router = useRouter(); function goBack() { - if (window.history.length > 1 && route.meta.title !== '伊调研') { + if (window.history.length > 1 && route.name !== 'home') { router.go(-1); } else { appBridge.navigateBack(); diff --git a/src/layouts/utils.js b/src/layouts/utils.js index d195998..c572742 100644 --- a/src/layouts/utils.js +++ b/src/layouts/utils.js @@ -13,29 +13,13 @@ import { getDomText } from '@/utils/utils'; * @param options */ function showModal(options) { - // const confirm = (...rest) => { - // if (options.incompleteQuestionList?.length) { - // if (options.onOk) { - // options.onOk(...rest); - // } - // const firstQuestion = options.incompleteQuestionList[0]; - // store.commit(`common/${A_COMMON_SET_ACTIVEQUESTION}`, JSON.stringify(firstQuestion)); - // const el = document.getElementById(firstQuestion.id); - // new Scroll(el).animate(); - // } - // }; - showConfirmDialog({ title: '提示', icon: null, ...options }) - .then(() => { - // confirm(); - }) - .catch(() => { - // catch(); - }); + .then(() => {}) + .catch(() => {}); } /** @@ -445,7 +429,7 @@ export const canPlanetPublish = async function (sn, publishType) { if (parsedPublishType === 2) { const qrcodeRes = await getCheckSurvey(sn); - if (qrcodeRes?.data?.show_test_button) { + if (qrcodeRes?.data?.data?.show_test_button) { const res = await new Promise((resolve) => { showConfirmDialog({ class: 'custom-modal custom-modal-title-confirm-notice show-icon', @@ -466,7 +450,16 @@ export const canPlanetPublish = async function (sn, publishType) { '投放前测试能帮助您确认问卷设计逻辑及作答数据是否正确,避免因问卷设计问题造成重大损失。', confirmButtonText: '去测试', onConfirm() { - appBridge.openInBrowser(`${location.origin}/#/answer?sn=${sn}&is_test=1`); + resolve(false); + if (utils.getSessionStorage('xToken')) { + appBridge.openInBrowser( + `${location.origin}/preview?sn=${sn}&name=${data.data.survey.project_name}+source=0&is_test=1` + ); + } else { + window.open( + `${location.origin}/preview?sn=${sn}&name=${data.data.survey.project_name}+source=0&is_test=1` + ); + } }, width: '640px', height: '364px',