Commit 48418ef9 authored by yyh's avatar yyh

DataType 增加视频,音频

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