作答,0 秒立刻跳转;两个问卷 '7YGakdEN' 'oxy4lVY6' 设备超限提示页;
This commit is contained in:
@@ -106,6 +106,11 @@ const constantRoutes = [
|
||||
meta: { noRedirectLogin: true },
|
||||
component: () => import(/* webpackChunkName: "answer" */ '../views/Answer/Index.vue')
|
||||
},
|
||||
{
|
||||
path: '/answer/limitResult',
|
||||
name: 'AnswerLimitResult',
|
||||
component: () => import(/* webpackChunkName: "answer" */ '../views/Answer/pages/AnswerLimitResult.vue')
|
||||
},
|
||||
{
|
||||
path: '/preview',
|
||||
name: 'Preview',
|
||||
|
||||
@@ -45,7 +45,8 @@
|
||||
<!-- 提前终止和正常完成 -->
|
||||
<q-last
|
||||
v-if="page === pages.length + 1"
|
||||
:code="questionsData.action.code"
|
||||
:code="questionsData.action?.code"
|
||||
:action="questionsData.action"
|
||||
:survey="questionsData.survey"
|
||||
:isAnswer="isAnswer"
|
||||
/>
|
||||
|
||||
@@ -63,7 +63,8 @@
|
||||
<q-last
|
||||
class="q-last"
|
||||
v-if="page === pages.length + 1"
|
||||
:code="questionsData.action.code"
|
||||
:code="questionsData.action?.code"
|
||||
:action="questionsData.action"
|
||||
:survey="questionsData.survey"
|
||||
:isAnswer="isAnswer"
|
||||
/>
|
||||
|
||||
@@ -76,6 +76,16 @@ export default defineComponent({
|
||||
is_test: proxy.$route.query.is_test,
|
||||
},
|
||||
});
|
||||
|
||||
// 专门为 正式环境中 这两个问卷写的功能,talr 用于测试环境进行测试
|
||||
if (data.action?.code === 20017 && (['7YGakdEN', 'oxy4lVY6'].includes(proxy.$route.query.sn) || proxy.$route.query['talr'])) {
|
||||
proxy.$router.push({
|
||||
path: '/answer/limitResult',
|
||||
query: {...(proxy.$route.query || {})},
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
// 多语言
|
||||
data.languageType = [
|
||||
data?.survey?.style?.is_en_tips ? "en" : "",
|
||||
|
||||
@@ -703,9 +703,62 @@ export default defineComponent({
|
||||
page.value += 1;
|
||||
}
|
||||
scrollbar.value.scrollTop = 0;
|
||||
jumpImmediately(); // 如果有结束跳转,则判断是否需要立即跳转
|
||||
}, callbackBeforePage);
|
||||
}
|
||||
|
||||
function jumpImmediately() {
|
||||
if (page.value !== pages.value.length + 1) {
|
||||
return;
|
||||
}
|
||||
const code = questionsData.value.action.code;
|
||||
const survey = questionsData.value.survey;
|
||||
let countTime = 0;
|
||||
let url = '';
|
||||
|
||||
page.value += 2; // 防止 QuestionsMob QuestionPc 组件里显示最后一页
|
||||
questionsData.value.action.code = 9999999; // 防止 AnswerMob AnswerPc 组件里显示最后一页
|
||||
|
||||
if ((code === 20004 && survey.screening_end_url_select && survey.screening_end_url)) {
|
||||
countTime = survey.screening_standing_time;
|
||||
url = survey.screening_end_url;
|
||||
}
|
||||
if ((code === 20011 && survey.success_end_url_select && survey.success_end_url)) {
|
||||
countTime = survey.success_standing_time;
|
||||
url = survey.success_end_url
|
||||
}
|
||||
if ((code === 20016 && survey.quota_end_url_select && survey.quota_end_url)) {
|
||||
countTime = survey.quota_standing_time;
|
||||
url = survey.quota_end_url
|
||||
}
|
||||
|
||||
// 跳转链接
|
||||
if (countTime <= 0 && url) {
|
||||
url = url.replaceAll('#sn#', questionsData.value.answer.sn);
|
||||
url = url.replaceAll('#user#', questionsData.value.answer.respondent);
|
||||
url = url.replaceAll('#survey_sn#', questionsData.value.answer.survey_sn);
|
||||
if (proxy.$route.query.source === 'YILI_APP_WANGYI') {
|
||||
Object.keys(proxy.$route.query).forEach((key) => {
|
||||
if (!['sn', 'source', 'is_template', 'channelUCode'].includes(key)) {
|
||||
url += `${ url.indexOf('?') === -1 ? '?' : '&' }${ key }=${ proxy.$route.query[key] }`;
|
||||
}
|
||||
});
|
||||
}
|
||||
// 判断是否小程序路径
|
||||
if (url[0] === '/') {
|
||||
// 判断是否在小程序环境
|
||||
wx.miniProgram.getEnv(() => {
|
||||
wx.miniProgram.redirectTo({url});
|
||||
});
|
||||
} else {
|
||||
if (url.indexOf('http://') === -1 && url.indexOf('https://') === -1) {
|
||||
url = `http://${ url }`;
|
||||
}
|
||||
open(url, '_self');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 选项隐藏
|
||||
function hideOptions(hide) {
|
||||
const questionIndex = hide?.question_index;
|
||||
|
||||
16
src/views/Answer/pages/AnswerLimitResult.vue
Normal file
16
src/views/Answer/pages/AnswerLimitResult.vue
Normal file
@@ -0,0 +1,16 @@
|
||||
<script setup>
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<img src="./img/answer-limit-result.jpg" alt="" class="img">
|
||||
</template>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.img {
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
}
|
||||
</style>
|
||||
BIN
src/views/Answer/pages/img/answer-limit-result.jpg
Normal file
BIN
src/views/Answer/pages/img/answer-limit-result.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 399 KiB |
Reference in New Issue
Block a user