refactor(survey): 优化创建问卷页面样式和逻辑
- 修改问卷列表展示逻辑,移除 parentCode 判断条件 - 更新问卷列表项的图片和标题字段- 优化投放设置弹窗的样式和结构 - 调整全局样式,增加 van-cell 的样式 - 添加 babel 配置文件,配置 preset-env
This commit is contained in:
4
auto-imports.d.ts
vendored
4
auto-imports.d.ts
vendored
@@ -5,4 +5,6 @@
|
||||
// Generated by unplugin-auto-import
|
||||
// biome-ignore lint: disable
|
||||
export {}
|
||||
declare global {}
|
||||
declare global {
|
||||
|
||||
}
|
||||
|
||||
15
babel.config.json
Normal file
15
babel.config.json
Normal file
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"presets": [
|
||||
[
|
||||
"@babel/preset-env",
|
||||
{
|
||||
"useBuiltIns": "usage",
|
||||
"corejs": 3,
|
||||
"targets": {
|
||||
"chrome": "58",
|
||||
"ie": "11"
|
||||
}
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
5
components.d.ts
vendored
5
components.d.ts
vendored
@@ -26,11 +26,8 @@ declare module 'vue' {
|
||||
VanCellGroup: typeof import('vant/es')['CellGroup']
|
||||
VanCheckbox: typeof import('vant/es')['Checkbox']
|
||||
VanCheckboxGroup: typeof import('vant/es')['CheckboxGroup']
|
||||
VanCol: typeof import('vant/es')['Col']
|
||||
VanDivider: typeof import('vant/es')['Divider']
|
||||
VanField: typeof import('vant/es')['Field']
|
||||
VanGrid: typeof import('vant/es')['Grid']
|
||||
VanGridItem: typeof import('vant/es')['GridItem']
|
||||
VanIcon: typeof import('vant/es')['Icon']
|
||||
VanList: typeof import('vant/es')['List']
|
||||
VanNavBar: typeof import('vant/es')['NavBar']
|
||||
@@ -38,9 +35,7 @@ declare module 'vue' {
|
||||
VanPopup: typeof import('vant/es')['Popup']
|
||||
VanRadio: typeof import('vant/es')['Radio']
|
||||
VanRadioGroup: typeof import('vant/es')['RadioGroup']
|
||||
VanRow: typeof import('vant/es')['Row']
|
||||
VanSearch: typeof import('vant/es')['Search']
|
||||
VanStep: typeof import('vant/es')['Step']
|
||||
VanStepper: typeof import('vant/es')['Stepper']
|
||||
VanSwitch: typeof import('vant/es')['Switch']
|
||||
VanTab: typeof import('vant/es')['Tab']
|
||||
|
||||
@@ -4,7 +4,7 @@ import { onMounted } from 'vue';
|
||||
import appBridge from '@/assets/js/appBridge';
|
||||
import utils from '@/assets/js/common';
|
||||
|
||||
onMounted(async() => {
|
||||
onMounted(async () => {
|
||||
if (utils.getParameter('digitalYiliToken')) {
|
||||
// 隐藏/显示 header
|
||||
appBridge.setHeaderShown(false);
|
||||
|
||||
@@ -87,12 +87,12 @@ const getList = () => {
|
||||
if (res.data.code === 0) {
|
||||
if (res.data.data) {
|
||||
res.data.data.forEach((item) => {
|
||||
if (item.parentCode && item.parentCode === 1) {
|
||||
surveys.value.push(item);
|
||||
}
|
||||
// if (item.parentCode && item.parentCode === 1) {
|
||||
surveys.value.push(item);
|
||||
// }
|
||||
});
|
||||
|
||||
surveys.value.push({});
|
||||
// surveys.value.push({});
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -118,8 +118,8 @@ onMounted(() => {
|
||||
class="survey"
|
||||
@click="createdQuestion(survey)"
|
||||
>
|
||||
<img :src="survey.image" alt="" width="40" />
|
||||
<span>{{ survey.title }}</span>
|
||||
<img :src="survey.h5Image" alt="" width="40" />
|
||||
<span>{{ survey.h5Title }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -146,11 +146,9 @@
|
||||
<!-- 投放设置-->
|
||||
|
||||
<van-action-sheet v-model:show="showSetting" title="" style="background-color: #f2f2f2">
|
||||
<template #description>
|
||||
<div class="setting_title flex flex-start">投放设置</div>
|
||||
</template>
|
||||
<van-cell-group :border="false" class="setting_group">
|
||||
<van-cell title="每页一题" class="setting_block" :border="false" label-align="left">
|
||||
<div class="van-action-sheet-title flex flex-start">投放设置</div>
|
||||
<van-cell-group :border="false" class="round-group br12">
|
||||
<van-cell title="每页一题" :border="false" label-align="left">
|
||||
<template #right-icon>
|
||||
<van-switch
|
||||
v-model="questionInfo.survey.is_one_page_one_question"
|
||||
@@ -162,7 +160,8 @@
|
||||
></van-switch>
|
||||
</template>
|
||||
</van-cell>
|
||||
<van-divider></van-divider>
|
||||
</van-cell-group>
|
||||
<van-cell-group :border="false" class="round-group br12">
|
||||
<van-cell title="投放数量" class="setting_block" :border="false" label-align="left">
|
||||
<template #right-icon>
|
||||
<van-switch
|
||||
@@ -190,8 +189,10 @@
|
||||
<template #right-icon> 份 </template>
|
||||
</van-field>
|
||||
</van-cell-group>
|
||||
<van-divider></van-divider>
|
||||
<van-cell title="有效期" class="border-top" :border="false" label-align="left">
|
||||
</van-cell-group>
|
||||
|
||||
<van-cell-group :border="false" class="round-group br12">
|
||||
<van-cell title="有效期" class="border-top" label-align="left">
|
||||
<template #right-icon>
|
||||
<van-switch
|
||||
v-model="questionInfo.survey.is_time"
|
||||
@@ -225,7 +226,7 @@
|
||||
</van-field>
|
||||
</van-cell-group>
|
||||
|
||||
<van-cell title="断点续答" :border="false" label-align="left">
|
||||
<van-cell title="断点续答" label-align="left">
|
||||
<template #right-icon>
|
||||
<van-switch
|
||||
v-model="questionInfo.survey.is_breakpoint"
|
||||
@@ -241,7 +242,6 @@
|
||||
<van-cell
|
||||
title="企微身份获取(开启后仅支持私有化企业环境作答)"
|
||||
class="border-bottom"
|
||||
:border="false"
|
||||
label-align="left"
|
||||
>
|
||||
<template #right-icon>
|
||||
@@ -255,8 +255,10 @@
|
||||
></van-switch>
|
||||
</template>
|
||||
</van-cell>
|
||||
<van-divider></van-divider>
|
||||
<van-cell title="IP答题次数限制" class="border-top" :border="false" label-align="left">
|
||||
</van-cell-group>
|
||||
|
||||
<van-cell-group class="round-group br12" :border="false">
|
||||
<van-cell title="IP答题次数限制" class="border-top" label-align="left">
|
||||
<template #right-icon>
|
||||
<van-switch
|
||||
v-model="questionInfo.survey.is_ip_number"
|
||||
@@ -268,7 +270,11 @@
|
||||
></van-switch>
|
||||
</template>
|
||||
</van-cell>
|
||||
<van-cell-group v-if="questionInfo.survey.is_ip_number === 1" class="child-group">
|
||||
<van-cell-group
|
||||
:border="false"
|
||||
v-if="questionInfo.survey.is_ip_number === 1"
|
||||
class="child-group"
|
||||
>
|
||||
<van-field
|
||||
v-model="questionInfo.survey.is_number"
|
||||
label="同一个IP地址只能作答"
|
||||
@@ -306,18 +312,6 @@
|
||||
<template #right-icon> 次 </template>
|
||||
</van-field>
|
||||
</van-cell-group>
|
||||
<van-divider></van-divider>
|
||||
<!-- <van-field-->
|
||||
<!-- v-model="endText"-->
|
||||
<!-- label="结束语"-->
|
||||
<!-- :border="false"-->
|
||||
<!-- readonly-->
|
||||
<!-- label-align="left"-->
|
||||
<!-- input-align="right"-->
|
||||
<!-- is-link-->
|
||||
<!-- @click="openEndTextModel"-->
|
||||
<!-- >-->
|
||||
<!-- </van-field>-->
|
||||
</van-cell-group>
|
||||
</van-action-sheet>
|
||||
|
||||
@@ -798,6 +792,9 @@ onMounted(async () => {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
:deep(.van-cell) {
|
||||
padding: 8px;
|
||||
}
|
||||
.survey-action {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
|
||||
Reference in New Issue
Block a user