fix: 预览逻辑bug
This commit is contained in:
@@ -222,12 +222,15 @@ const toPage = (path, title) => {
|
||||
document.title = title;
|
||||
};
|
||||
|
||||
const toPreview = () => {
|
||||
router.push({
|
||||
path: "/preview",
|
||||
query: route.query,
|
||||
});
|
||||
document.title = name;
|
||||
const toPreview = async () => {
|
||||
var res = await canPlanetPublish(route.query.sn);
|
||||
if (res) {
|
||||
router.push({
|
||||
path: "/preview",
|
||||
query: route.query,
|
||||
});
|
||||
document.title = name;
|
||||
}
|
||||
};
|
||||
|
||||
const openPublishModal = async () => {
|
||||
@@ -238,7 +241,7 @@ const openPublishModal = async () => {
|
||||
visible.value = true;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// //console.log();
|
||||
// // return;
|
||||
// let isFb = true;
|
||||
|
||||
@@ -70,13 +70,24 @@
|
||||
</div>
|
||||
<!-- 预览-pc -->
|
||||
<a-spin v-show="current === 'pc'" :spinning="loading">
|
||||
<questions-pc />
|
||||
<div v-if="questionsData.action?.code === 20013" class="action">
|
||||
<img src="@/assets/img/answer/actions/suspend.png" />
|
||||
<div class="msg">感谢您的反馈,期待您下次参与</div>
|
||||
</div>
|
||||
<questions-pc v-else />
|
||||
</a-spin>
|
||||
<!-- 预览-mob -->
|
||||
<!-- 手机模拟器 -->
|
||||
<phone v-show="current === 'mobile'" :title="title">
|
||||
<a-spin :spinning="loading">
|
||||
<questions-mob />
|
||||
<div
|
||||
v-if="questionsData.action?.code === 20013"
|
||||
class="action"
|
||||
>
|
||||
<img src="@/assets/img/answer/actions/suspend.png" />
|
||||
<div class="msg">感谢您的反馈,期待您下次参与</div>
|
||||
</div>
|
||||
<questions-mob v-else />
|
||||
</a-spin>
|
||||
</phone>
|
||||
<!-- 展开 -->
|
||||
@@ -538,6 +549,27 @@ export default defineComponent({
|
||||
}
|
||||
}
|
||||
|
||||
.action {
|
||||
padding-top: 99px;
|
||||
text-align: center;
|
||||
background-size: 224px 118px;
|
||||
background-repeat: no-repeat;
|
||||
background-position: calc(100% - 10px) 24px;
|
||||
background-image: url("../../../assets/img/answer/pc-bg.png");
|
||||
|
||||
img {
|
||||
width: 200px;
|
||||
height: 150px;
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
.msg {
|
||||
font-size: 16px;
|
||||
color: #70b936;
|
||||
line-height: 24px;
|
||||
}
|
||||
}
|
||||
|
||||
.container {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import getlogicStatus from "./logical";
|
||||
const questions = {}
|
||||
|
||||
// 更新code
|
||||
function updateCode(action, skipQuestionIndex) {
|
||||
@@ -103,5 +102,14 @@ export default function answerMock(questionsData, page) {
|
||||
data.action.code = 20011;
|
||||
data.action.msg = "成功结束页";
|
||||
}
|
||||
// 拒绝知情同意书
|
||||
const refuseIndex = questionsData.questions.findIndex(
|
||||
(question) => question.question_type === 23 && question.answer.value === "2"
|
||||
);
|
||||
if (refuseIndex !== -1) {
|
||||
data.action.code = 20013;
|
||||
data.action.msg = "不同意继续参与,已结束作答";
|
||||
}
|
||||
// 返回数据
|
||||
return data;
|
||||
}
|
||||
|
||||
@@ -12,7 +12,12 @@
|
||||
<a-button v-if="!config.is_hide" key="back" :loading="loading" @click="refuse">{{
|
||||
config.disagree_button_text
|
||||
}}</a-button>
|
||||
<a-button key="submit" type="primary" :loading="loading" :disabled="time" @click="agree"
|
||||
<a-button
|
||||
key="submit"
|
||||
type="primary"
|
||||
:loading="loading"
|
||||
:disabled="time ? true : false"
|
||||
@click="agree"
|
||||
>{{ config.agree_button_text }}<span v-if="time" class="time">({{ time }}s)</span></a-button
|
||||
>
|
||||
</template>
|
||||
|
||||
@@ -320,12 +320,12 @@ export default defineComponent({
|
||||
// 下一页
|
||||
function next() {
|
||||
// 作答模式下不进行选择判断
|
||||
if (!props.isAnswer) {
|
||||
if (page.value === pages.value) {
|
||||
return context.emit("next");
|
||||
}
|
||||
return (page.value += 1);
|
||||
}
|
||||
// if (!props.isAnswer) {
|
||||
// if (page.value === pages.value) {
|
||||
// return context.emit("next");
|
||||
// }
|
||||
// return (page.value += 1);
|
||||
// }
|
||||
// 当前页答案
|
||||
const currentOptions = allOptions.value[page.value - 1];
|
||||
if (currentOptions.findIndex((option) => option.value === "b") === -1) {
|
||||
|
||||
Reference in New Issue
Block a user