Commit 48418ef9 authored by yyh's avatar yyh

DataType 增加视频,音频

parent 4ad99be5
......@@ -39,6 +39,8 @@ export enum DataType {
Unit = 3, // 有下级
Select = 5, // 选择 单选
Date = 6, // 时间戳
Video = 8, // 视频
Audio = 9, // 音频
}
export enum AuthStatus {
......
<template>
<div class="template">
<div>
<base-info :showBaseInfo.sync="showBaseInfo" @next="baseInfoNext" @cancel="cancelCreateTempl"></base-info>
<words-manager :data.sync="words" @show-preview="showPreview= true;" @confirm-words="confirm"></words-manager>
<transition name="van-slide-up">
......@@ -68,13 +68,3 @@ export default class Add extends Vue {
}
}
</script>
<style scoped lang="scss">
.template{
position: relative;
.tip{
font-size: 12px;
color: #737582;
margin-bottom: 100px;
}
}
</style>
......@@ -16,7 +16,7 @@
<common-svg name="zidingyimoban-duigou" class="active" v-show="activeName === item.type"></common-svg>
</div>
<div
v-if="activeName === 5 && item.type === 5"
v-if="activeName === DataType.Select && item.type === DataType.Select"
style="background:rgba(246,249,255,1);margin:0 -17px;">
<van-swipe-cell
v-for="(option,index) in options"
......@@ -57,16 +57,17 @@ export default class AddOption extends Vue {
})
private show!: boolean;
private activeName: number = 0;
private readonly DataType: any = DataType;
private data = [
{
title: '单行文本',
desc: '只能输入一行,适合文字少的内容',
type: 0,
type: DataType.Input,
},
{
title: '上传图片',
desc: '可以上传多个图片,但只能选择一项',
type: 1,
type: DataType.Image,
},
// {
// title: '多行文本',
......@@ -75,27 +76,27 @@ export default class AddOption extends Vue {
{
title: 'PDF文件',
desc: '选择PDF文件',
type: 2,
type: DataType.File,
},
{
title: '多选框',
desc: '可以定义多个选择项,但只能选择一项',
type: 5,
type: DataType.Select,
},
{
title: '日期',
desc: '选择单个日期时间',
type: 6,
type: DataType.Date,
},
{
title: '上传视频',
desc: '上传视频',
type: 8,
type: DataType.Video,
},
{
title: '上传音频',
desc: '上传音频',
type: 9,
type: DataType.Audio,
},
];
private options: string[] = [];
......@@ -125,8 +126,6 @@ export default class AddOption extends Vue {
background: #ffffff;
.item{
padding: 0 17px;
// border-top: 1px solid rgba(239,239,239,1);
// border-bottom: 1px solid rgba(239,239,239,1);
.item-inner{
display: grid;
grid-template-columns: auto 27px;
......
......@@ -50,7 +50,7 @@ export default class Add extends Vue {
})
private words!: any[];
private wordType: number = DataType.Unit;
private DataType: any = DataType;
private readonly DataType: any = DataType;
private wordName: string = '';
private flag: string = '';
private options: string[] = [];
......@@ -81,15 +81,15 @@ export default class Add extends Vue {
action: this.delWord.bind(this),
},
];
private typeObj: any = {
0: '单行文本',
1: '图片',
2: 'pdf文件',
3: '一级标题',
5: '选择',
6: '日期',
8: '视频',
9: '音频',
private readonly typeObj: any = {
[DataType.Input]: '单行文本',
[DataType.Image]: '图片',
[DataType.File]: 'pdf文件',
[DataType.Unit]: '一级标题',
[DataType.Select]: '选择',
[DataType.Date]: '日期',
[DataType.Video]: '视频',
[DataType.Audio]: '音频',
};
private typeValue: any = {
0: {
......@@ -170,7 +170,7 @@ export default class Add extends Vue {
label: '音频',
},
};
private showActionHandler({ index, parentIndex}: any) {
private showActionHandler({ index, parentIndex}: any) {
this.showMoreAction = true;
this.currentAction = {index, parentIndex};
}
......@@ -265,6 +265,11 @@ export default class Add extends Vue {
border-radius:6px;
border:1px dashed rgba(63,121,254,1);
}
.tip{
font-size: 12px;
color: #737582;
margin-bottom: 100px;
}
.btn-group{
.preview{
align-self: center;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment