refactor: 重构最新问卷组件
- 最新问卷组件样式更新 - 内容调整 - 增加 hooks 内容支持
This commit is contained in:
@@ -41,7 +41,6 @@ import CreateSurvey from './components/CreateSurvey/Index.vue';
|
|||||||
padding: 20px 10px;
|
padding: 20px 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -1,31 +1,31 @@
|
|||||||
export const surveys = [
|
export const surveys = [
|
||||||
{
|
{
|
||||||
title: '报名签到',
|
title: '报名签到',
|
||||||
icon: 'https://files.axshare.com/gsc/DR6075/de/a0/49/dea049d6ad3e4c2c80af44258c6c76d6/images/%E9%A6%96%E9%A1%B5_1/u48.png?pageId=74b3e5b2-848e-4258-8a34-9e220127c8a6'
|
icon: 'https://files.axshare.com/gsc/DR6075/de/a0/49/dea049d6ad3e4c2c80af44258c6c76d6/images/%E9%A6%96%E9%A1%B5_1/u48.png?pageId=74b3e5b2-848e-4258-8a34-9e220127c8a6'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '满意度调研',
|
title: '满意度调研',
|
||||||
icon: 'https://files.axshare.com/gsc/DR6075/63/4d/77/634d77293a4d41d1b3d145974a8fb6a7/images/%E9%A6%96%E9%A1%B5_1/u27.png?pageId=5cc10b9f-56eb-48dc-943a-bfe7afb18a64'
|
icon: 'https://files.axshare.com/gsc/DR6075/63/4d/77/634d77293a4d41d1b3d145974a8fb6a7/images/%E9%A6%96%E9%A1%B5_1/u27.png?pageId=5cc10b9f-56eb-48dc-943a-bfe7afb18a64'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '快速投票',
|
title: '快速投票',
|
||||||
icon: 'https://files.axshare.com/gsc/DR6075/63/4d/77/634d77293a4d41d1b3d145974a8fb6a7/images/首页_1/u29.png?pageId=5cc10b9f-56eb-48dc-943a-bfe7afb18a64'
|
icon: 'https://files.axshare.com/gsc/DR6075/63/4d/77/634d77293a4d41d1b3d145974a8fb6a7/images/首页_1/u29.png?pageId=5cc10b9f-56eb-48dc-943a-bfe7afb18a64'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '打分评估',
|
title: '打分评估',
|
||||||
icon: 'https://files.axshare.com/gsc/DR6075/63/4d/77/634d77293a4d41d1b3d145974a8fb6a7/images/首页_1/u31.png?pageId=5cc10b9f-56eb-48dc-943a-bfe7afb18a64'
|
icon: 'https://files.axshare.com/gsc/DR6075/63/4d/77/634d77293a4d41d1b3d145974a8fb6a7/images/首页_1/u31.png?pageId=5cc10b9f-56eb-48dc-943a-bfe7afb18a64'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'NPS调研',
|
title: 'NPS调研',
|
||||||
icon: 'https://files.axshare.com/gsc/DR6075/63/4d/77/634d77293a4d41d1b3d145974a8fb6a7/images/首页_1/u22.png?pageId=5cc10b9f-56eb-48dc-943a-bfe7afb18a64'
|
icon: 'https://files.axshare.com/gsc/DR6075/63/4d/77/634d77293a4d41d1b3d145974a8fb6a7/images/首页_1/u22.png?pageId=5cc10b9f-56eb-48dc-943a-bfe7afb18a64'
|
||||||
},{
|
}, {
|
||||||
title: '考评测试',
|
title: '考评测试',
|
||||||
icon: 'https://files.axshare.com/gsc/DR6075/63/4d/77/634d77293a4d41d1b3d145974a8fb6a7/images/首页_1/u24.png?pageId=5cc10b9f-56eb-48dc-943a-bfe7afb18a64'
|
icon: 'https://files.axshare.com/gsc/DR6075/63/4d/77/634d77293a4d41d1b3d145974a8fb6a7/images/首页_1/u24.png?pageId=5cc10b9f-56eb-48dc-943a-bfe7afb18a64'
|
||||||
},{
|
}, {
|
||||||
title: '表单收集',
|
title: '表单收集',
|
||||||
icon: 'https://files.axshare.com/gsc/DR6075/63/4d/77/634d77293a4d41d1b3d145974a8fb6a7/images/首页_1/u16.png?pageId=5cc10b9f-56eb-48dc-943a-bfe7afb18a64'
|
icon: 'https://files.axshare.com/gsc/DR6075/63/4d/77/634d77293a4d41d1b3d145974a8fb6a7/images/首页_1/u16.png?pageId=5cc10b9f-56eb-48dc-943a-bfe7afb18a64'
|
||||||
},{
|
}, {
|
||||||
title: '消费者测试',
|
title: '消费者测试',
|
||||||
icon: 'https://files.axshare.com/gsc/DR6075/63/4d/77/634d77293a4d41d1b3d145974a8fb6a7/images/首页_1/u18.png?pageId=5cc10b9f-56eb-48dc-943a-bfe7afb18a64'
|
icon: 'https://files.axshare.com/gsc/DR6075/63/4d/77/634d77293a4d41d1b3d145974a8fb6a7/images/首页_1/u18.png?pageId=5cc10b9f-56eb-48dc-943a-bfe7afb18a64'
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
@@ -1,18 +1,18 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { surveys } from "./Hooks/useRequestHooks"
|
import { surveys } from './Hooks/useRequestHooks';
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<van-cell>
|
<van-cell>
|
||||||
<div style="text-align: left;">新建问卷</div>
|
<div style="text-align: left;">新建问卷</div>
|
||||||
<van-row>
|
<van-row>
|
||||||
<van-col span="6" v-for="survey in surveys" :key="survey.title" class="survey">
|
<van-col v-for="survey in surveys" :key="survey.title" span="6" class="survey">
|
||||||
<img width="45px" :src="survey.icon" alt=" " />
|
<img width="45px" :src="survey.icon" alt=" " />
|
||||||
<span>{{ survey.title }}</span>
|
<span>{{ survey.title }}</span>
|
||||||
</van-col>
|
</van-col>
|
||||||
</van-row>
|
</van-row>
|
||||||
</van-cell>
|
</van-cell>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|||||||
@@ -1,45 +1,89 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import { lastSurveys } from './hooks/useLastSurveyHooks';
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<!-- 问卷 -->
|
<!-- 问卷 -->
|
||||||
<div class="survey">
|
<div class="last-survey">
|
||||||
<div>
|
<div>
|
||||||
<h4>问卷</h4>
|
<small>最新问卷</small>
|
||||||
<span @click="$router.push('/survey')">全部问卷></span>
|
<span @click="$router.push('/survey')">全部问卷></span>
|
||||||
</div>
|
</div>
|
||||||
<div class="survey_items">
|
<!-- 问卷列表容器 -->
|
||||||
<div v-for="survey in 3" :key="survey"></div>
|
<div class="last-survey_items">
|
||||||
|
<!-- 问卷列表项 -->
|
||||||
|
<div v-for="survey in lastSurveys" :key="survey">
|
||||||
|
<div class="last-survey_items_status">
|
||||||
|
<img
|
||||||
|
src="https://files.axshare.com/gsc/DR6075/63/4d/77/634d77293a4d41d1b3d145974a8fb6a7/images/首页_1/u249.svg?pageId=5cc10b9f-56eb-48dc-943a-bfe7afb18a64"
|
||||||
|
alt=" " width="10px" height="10px" />
|
||||||
|
<small> {{ survey.status }} - 100</small>
|
||||||
|
</div>
|
||||||
|
<div class="last-survey_items_info">
|
||||||
|
<small> 报名签到</small> <small>| {{ survey.platform }} | 创建时间: {{ survey.createTime }}</small>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="last-survey_items_content">
|
||||||
|
<p><small>{{ survey.title }}</small></p>
|
||||||
|
<p><small>{{ survey.describe }}</small></p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts"></script>
|
<style scoped lang="scss">
|
||||||
|
.last-survey {
|
||||||
<style scoped>
|
&> :first-child {
|
||||||
.survey {
|
|
||||||
& > :first-child {
|
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: end;
|
align-items: end;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
margin: 10px 0;
|
margin: 10px 0;
|
||||||
|
|
||||||
& > span {
|
&>span {
|
||||||
color: grey;
|
color: grey;
|
||||||
font-size: 10px;
|
font-size: 10px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.survey_items {
|
.last-survey_items {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-flow: row wrap;
|
flex-flow: column nowrap;
|
||||||
justify-content: space-around;
|
justify-content: space-around;
|
||||||
|
|
||||||
div {
|
&>div {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
width: calc(129px / 1.3);
|
width: 100%;
|
||||||
height: calc(135px / 1.3);
|
|
||||||
|
/* width: calc(129px / 1.3); */
|
||||||
|
|
||||||
|
/* height: calc(135px / 1.3); */
|
||||||
|
margin: 5px 0;
|
||||||
|
padding: 5px 0 5px 5px;
|
||||||
border-radius: 6px;
|
border-radius: 6px;
|
||||||
background-color: white;
|
background-color: white;
|
||||||
|
|
||||||
|
.last-survey_items_status {
|
||||||
|
&>small {
|
||||||
|
color: red;
|
||||||
|
font-size: 10px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.last-survey_items_info {
|
||||||
|
color: #999;
|
||||||
|
font-size: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.last-survey_items_content {
|
||||||
|
font-size: 12px;
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
22
src/views/Home/components/Suvrey/hooks/useLastSurveyHooks.ts
Normal file
22
src/views/Home/components/Suvrey/hooks/useLastSurveyHooks.ts
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
|
||||||
|
export const lastSurveys = [
|
||||||
|
{
|
||||||
|
status: '已结束',
|
||||||
|
platform: '移动端',
|
||||||
|
createTime: '2025-03-04',
|
||||||
|
title: '签到报名问卷标题',
|
||||||
|
describe: '问卷描述'
|
||||||
|
}, {
|
||||||
|
status: '已结束',
|
||||||
|
platform: '移动端',
|
||||||
|
createTime: '2025-03-04',
|
||||||
|
title: '签到报名问卷标题',
|
||||||
|
describe: '问卷描述'
|
||||||
|
}, {
|
||||||
|
status: '已结束',
|
||||||
|
platform: '移动端',
|
||||||
|
createTime: '2025-03-04',
|
||||||
|
title: '签到报名问卷标题',
|
||||||
|
describe: '问卷描述'
|
||||||
|
}
|
||||||
|
];
|
||||||
Reference in New Issue
Block a user