|
@@ -6,7 +6,49 @@
|
|
|
<hero-sub-title :type="4" />
|
|
|
<div class="detail">
|
|
|
<div class="back" @click="$router.go(-1)"></div>
|
|
|
- <div class="info"></div>
|
|
|
+ <div class="info">
|
|
|
+ <!-- {{ details }} -->
|
|
|
+
|
|
|
+ <template v-for="detail in details">
|
|
|
+ <n-space
|
|
|
+ vertical
|
|
|
+ align="start"
|
|
|
+ justify="center"
|
|
|
+ style="padding: 1.25rem"
|
|
|
+ >
|
|
|
+ <h3>{{ detail.question }}</h3>
|
|
|
+ <n-radio-group
|
|
|
+ v-model:value="detail.value"
|
|
|
+ name="radiogroup"
|
|
|
+ v-if="
|
|
|
+ detail.answer &&
|
|
|
+ JSON.parse(detail.answer).answer &&
|
|
|
+ Number(detail.type) === 1
|
|
|
+ "
|
|
|
+ >
|
|
|
+ <n-space>
|
|
|
+ <n-radio
|
|
|
+ v-for="answer in JSON.parse(detail.answer).answer"
|
|
|
+ :key="answer.val"
|
|
|
+ :value="answer.val"
|
|
|
+ >
|
|
|
+ {{ answer.name }}
|
|
|
+ </n-radio>
|
|
|
+ </n-space>
|
|
|
+ </n-radio-group>
|
|
|
+ </n-space>
|
|
|
+ </template>
|
|
|
+ <div class="btn">
|
|
|
+ <n-button
|
|
|
+ class="submit"
|
|
|
+ size="large"
|
|
|
+ type="primary"
|
|
|
+ @click="submit"
|
|
|
+ >
|
|
|
+ 提交
|
|
|
+ </n-button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<side-menu />
|
|
@@ -15,63 +57,95 @@
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
-import { watchEffect, ref } from "vue";
|
|
|
-import { useFullscreen } from "@vueuse/core";
|
|
|
+import { watchEffect, ref, onMounted, computed } from "vue";
|
|
|
import subHeader from "../components/subHeader";
|
|
|
import sideMenu from "../components/sideMenu";
|
|
|
import heroSubTitle from "../components/heroSubTitle";
|
|
|
-import { useInfoStore } from "../store/info";
|
|
|
+import { useSurveyStore } from "../store/survey";
|
|
|
+const surveyStore = useSurveyStore();
|
|
|
const title = ref("detail");
|
|
|
|
|
|
+const details = computed(() => surveyStore.details);
|
|
|
+
|
|
|
+const props = defineProps({
|
|
|
+ id: {
|
|
|
+ type: [String, Number],
|
|
|
+ default: () => null,
|
|
|
+ required: true,
|
|
|
+ },
|
|
|
+});
|
|
|
watchEffect(() => {
|
|
|
document.title = title.value;
|
|
|
+ if (props.id) {
|
|
|
+ surveyStore.getDetail(props.id);
|
|
|
+ }
|
|
|
});
|
|
|
+
|
|
|
+const submit = () => {};
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
.detail {
|
|
|
--main-show-case-background: #ddd5d5;
|
|
|
- --main-detail-margin: 1.875rem;
|
|
|
- --main-detail-padding: 1.875rem;
|
|
|
+ --main-detail-margin: 30px;
|
|
|
+ --main-detail-padding: 30px;
|
|
|
margin: var(--main-detail-margin);
|
|
|
margin-bottom: 0;
|
|
|
flex: 1;
|
|
|
- border-radius: 0.8125rem;
|
|
|
- padding: 2rem 3rem 4rem 3rem;
|
|
|
+ border-radius: 13px;
|
|
|
+ padding: 32px 48px 64px 48px;
|
|
|
overflow-y: scroll;
|
|
|
background-image: var(--main-detail-background-img);
|
|
|
background-size: cover;
|
|
|
- background-position: top 100%;
|
|
|
+ background-position: top center;
|
|
|
background-repeat: no-repeat;
|
|
|
+ display: inline-flex;
|
|
|
|
|
|
.back {
|
|
|
background-image: url("/img/back_arrow.png");
|
|
|
- width: 7.5rem;
|
|
|
- height: 1.875rem;
|
|
|
+ width: 120px;
|
|
|
+ height: 30px;
|
|
|
background-repeat: no-repeat;
|
|
|
background-size: contain;
|
|
|
- margin-bottom: 0.75rem;
|
|
|
+ margin-bottom: 12px;
|
|
|
}
|
|
|
.info {
|
|
|
- max-width: 66.8125rem;
|
|
|
+ max-width: 1069px;
|
|
|
margin: 0 auto;
|
|
|
- font-size: 20px;
|
|
|
-
|
|
|
+ font-size: 1.25rem;
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ justify-content: space-between;
|
|
|
+ flex: 1;
|
|
|
+ :deep(.n-radio) {
|
|
|
+ --n-font-size: 1.125rem !important;
|
|
|
+ }
|
|
|
.title {
|
|
|
- font-size: 1.875rem;
|
|
|
- line-height: 3.75rem;
|
|
|
- margin: 1.2rem 0;
|
|
|
+ font-size: 30px;
|
|
|
+ line-height: 60px;
|
|
|
+ margin: 19.2px 0;
|
|
|
}
|
|
|
.text {
|
|
|
font-weight: 400;
|
|
|
color: #6e6e6e;
|
|
|
- line-height: 2.125rem;
|
|
|
- font-size: 1.25rem;
|
|
|
+ line-height: 34px;
|
|
|
+ font-size: 20px;
|
|
|
+ }
|
|
|
+ .btn {
|
|
|
+ width: 100%;
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
+ align-items: center;
|
|
|
+ :deep(.n-button) {
|
|
|
+ font-size: 1.25rem;
|
|
|
+ padding: 25px 50px;
|
|
|
+ border-radius: 60px;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
.show-case {
|
|
|
- max-width: 66.8125rem;
|
|
|
- height: 34.1875rem;
|
|
|
+ max-width: 1069px;
|
|
|
+ height: 547px;
|
|
|
background: var(--main-show-case-background);
|
|
|
}
|
|
|
}
|