Commit 5d96362a by zhangquan

ui初版

1 parent 37465db3
<template>
<div class="bar-content">
<label for="" class="content-label">{{label}}</label>
<div class="editor">
<quill-editor ref="myQuillEditor" class="quill" v-model="content[key]" :options="editorOption"></quill-editor>
<div class="extend-bar">
<i class="el-icon-circle-plus extend-icon" @click="insertContent">购买条件</i>
</div>
</div>
</div>
</template>
<script>
import { quillEditor, Quill } from 'vue-quill-editor'
import Label from '@/util/quillTool'
Quill.register(Label, true)
import 'quill/dist/quill.core.css'
import 'quill/dist/quill.snow.css'
export default {
name: 'FoldFrame',
components:{
quillEditor,
},
props: {
content: {
type: Object,
default: ()=>{
return {}
},
},
key: {
type: String,
default: '',
},
label:{
type: String,
default: '',
},
editorOption: {
type: String,
default: ()=>{
return {
modules: {
toolbar: {
container: [
['bold', 'italic', 'underline', 'strike'],
// [{ list: 'ordered' }],
// [{ script: 'sub' }, { script: 'super' }],
[{ color: [] }, { background: [] }],
[{'indent': '-1'}, {'indent': '+1'}],
[{ align: [] }],
[{ size: ['small', false, 'large', 'huge'] }],
// ['clean']
// ['link', 'image']
],
}
}
}
}
}
},
data() {
return {
}
},
methods: {
insertContent(){
let quill = this.$refs.myQuillEditor.quill;
let length = quill.selection.savedRange.index;
quill.insertEmbed(length, 'label', 132);
quill.setSelection(length + 1);
}
}
}
</script>
<style lang="scss" scoped>
.bar-content{
background: #F9F9F9;
padding: 20px;
margin-bottom: 10px;
.content-label{
width: 154px;
display: inline-block;
vertical-align: top;
height: 20px;
font-weight: 400;
font-size: 14px;
color: #333333;
text-align: right;
line-height: 20px;
}
.editor{
display: inline-block;
background-color: #fff;
.quill{
background-color: #fff;
display: inline-block;
border-color: #E5E5E5;
/deep/ .ql-toolbar.ql-snow, /deep/ .ql-container.ql-snow{
border-color: #E5E5E5;
}
/deep/ .ql-label{
color: #26a2ff;
}
}
.extend-bar{
width: 100%;
height: 40px;
padding: 0 20px;
line-height: 40px;
margin-top: -1px;
background: #FAFBFE;
border: 1px solid #E5E5E5;
box-sizing: border-box;
border-radius: 0 0 4px 4px;
border-top: none;
.extend-icon{
cursor: pointer;
&::before{
// font-size: 16px;
margin-right: 5px;
}
font-size: 14px;
color: #666;
}
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<div class="table-wrap">
<table>
<tr>
<th rowspan="2">规格</th>
<th rowspan="2">价格区间(万元)</th>
<th rowspan="2">价格系数</th>
<th colspan="2">1年版</th>
<th colspan="2">2年版</th>
<th colspan="2">3年版</th>
</tr>
<tr>
<th>上架成本</th>
<th>销售成本</th>
<th>上架成本</th>
<th>销售成本</th>
<th>上架成本</th>
<th>销售成本</th>
</tr>
<tr>
<td rowspan="4">A</td>
<td>标准</td>
<td>-</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>标准</td>
<td>-</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>标准</td>
<td>-</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>标准</td>
<td>-</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</table>
</div>
</template>
<script>
export default {
name: 'ServicesTable',
props: {
name: {
type: String,
default: ''
},
url: {
type: String,
default: ''
},
key: {
type: String,
default: ''
}
},
data() {
return {
}
},
methods: {
}
}
</script>
<style lang="scss" scoped>
.table-wrap{
th, td{
border: 1px solid #E5E5E5;
padding: 0 16px;
vertical-align: middle;
text-align: center;
}
th{
background: #F4F6FC;
font-weight: 600;
font-size: 14px;
color: #333333;
}
td{
font-weight: 400;
font-size: 14px;
color: #666666;
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template> <template>
<div class="upload-wrap"> <div class="upload-ctnr">
<label v-if="name" class="label" for="">{{name}}</label> <label v-if="name" class="label" for="">{{name}}</label>
<div class="add-img" :style="defaultStyle"> <div :class="['upload-wrap']" :style="defaultStyle">
<img v-if="url" class="image" :src="url" alt="" />
<div v-else class="add-img">
<i class="el-icon-plus add"></i> <i class="el-icon-plus add"></i>
<p>上传照片</p> <p>上传照片</p>
</div> </div>
<div class="operate" v-if="url">
<div class="btn-wrap">
<i class="el-icon-view"></i>
<i class="el-icon-delete"></i>
</div>
</div>
</div>
</div> </div>
</template> </template>
...@@ -18,7 +27,7 @@ ...@@ -18,7 +27,7 @@
}, },
url: { url: {
type: String, type: String,
default: '' default: 'https://img02.glsx.com.cn/weapp/resource/saas/scrm/assets/glsx/logo_menu.png'
}, },
key: { key: {
type: String, type: String,
...@@ -42,8 +51,7 @@ ...@@ -42,8 +51,7 @@
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.upload-wrap{ .upload-ctnr{
cursor: pointer;
.label{ .label{
display: inline-block; display: inline-block;
vertical-align: top; vertical-align: top;
...@@ -55,13 +63,30 @@ ...@@ -55,13 +63,30 @@
line-height: 20px; line-height: 20px;
box-sizing: border-box; box-sizing: border-box;
} }
.add-img{ .upload-wrap{
box-sizing: border-box; display: inline-flex;
border: 1px dashed #00000026;
// box-sizing: border-box;
width: 104px; width: 104px;
height: 104px; height: 104px;
background: #0000000a; background: #0000000a;
border: 1px dashed #00000026;
border-radius: 4px; border-radius: 4px;
position: relative;
&:hover{
.operate{
display: block;
}
}
.image{
width: 100%;
height: 100%;
z-index: 2;
position: relative;
}
.add-img{
width: 100%;
height: 100%;
cursor: pointer;
display: inline-flex; display: inline-flex;
flex-direction: column; flex-direction: column;
justify-content: center; justify-content: center;
...@@ -75,6 +100,32 @@ ...@@ -75,6 +100,32 @@
line-height: 32px; line-height: 32px;
} }
} }
.operate{
display: none;
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.4);
border-radius: 4px;
z-index: 5;
.btn-wrap{
color: #fff;
position: absolute;
transform: translate(-50%, -50%);
top: 50%;
left: 50%;
i{
font-size: 16px;
cursor: pointer;
&:first-child{
margin-right: 12px;
}
}
}
}
}
} }
</style> </style>
\ No newline at end of file \ No newline at end of file
...@@ -5,26 +5,18 @@ ...@@ -5,26 +5,18 @@
<div class="edit-bar"> <div class="edit-bar">
<FoldFrame name="Logo区域"> <FoldFrame name="Logo区域">
<div class="bar-content"> <div class="bar-content">
<Upload name="Logo图:" :defaultStyle="{width:'208px'}"></Upload> <Upload class="upload" name="Logo图:" :defaultStyle="{width:'208px'}"></Upload>
<span class="upload-tip">建议高度:48px</span> <span class="upload-tip">建议高度:48px</span>
</div> </div>
</FoldFrame> </FoldFrame>
<FoldFrame name="合同介绍区域"> <FoldFrame name="合同介绍区域">
<div class="bar-content"> <Editor label="标题和介绍:" :content="obj" key="content"></Editor>
<label for="" class="content-label">标题和介绍:</label>
<div class="editor">
<quill-editor ref="myQuillEditor" class="quill" v-model="serviceContent" :options="editorOption"></quill-editor>
<div class="extend-bar">
<i class="el-icon-circle-plus extend-icon" @click="insertContent">购买条件</i>
</div>
</div>
</div>
</FoldFrame> </FoldFrame>
</div> </div>
<div class="preview-area"> <div class="preview-area">
<div v-html="serviceContent"></div> <div v-html="obj.content"></div>
</div> </div>
<button @click="cons">dasdasdas</button>
</div> </div>
</div> </div>
</template> </template>
...@@ -32,51 +24,29 @@ ...@@ -32,51 +24,29 @@
<script> <script>
import FoldFrame from './components/FoldFrame' import FoldFrame from './components/FoldFrame'
import Upload from '@/components/Upload' import Upload from '@/components/Upload'
import { quillEditor, Quill } from 'vue-quill-editor' import Editor from '@/components/Editor'
import Label from '@/util/quillTool'
Quill.register(Label, true)
import 'quill/dist/quill.core.css'
import 'quill/dist/quill.snow.css'
export default { export default {
name: 'AddTmpl', name: 'AddTmpl',
components:{ components:{
quillEditor, Editor,
Upload, Upload,
FoldFrame FoldFrame
}, },
data() { data() {
return { return {
serviceContent: '', obj: {
editorOption: { content: ''
modules: {
toolbar: {
container: [
['bold', 'italic', 'underline', 'strike'],
// [{ list: 'ordered' }],
// [{ script: 'sub' }, { script: 'super' }],
[{ color: [] }, { background: [] }],
[{'indent': '-1'}, {'indent': '+1'}],
[{ align: [] }],
[{ size: ['small', false, 'large', 'huge'] }],
// ['clean']
// ['link', 'image']
],
}
} }
},
} }
}, },
mounted() { mounted() {
}, },
methods: { methods: {
insertContent(){ cons(){
let quill = this.$refs.myQuillEditor.quill; console.log(this.obj.content)
let length = quill.selection.savedRange.index;
quill.insertEmbed(length, 'label', 132);
quill.setSelection(length + 1);
} }
} }
} }
...@@ -92,54 +62,7 @@ export default { ...@@ -92,54 +62,7 @@ export default {
background: #F9F9F9; background: #F9F9F9;
padding: 20px; padding: 20px;
margin-bottom: 10px; margin-bottom: 10px;
.content-label{ .upload{
width: 154px;
display: inline-block;
vertical-align: top;
height: 20px;
font-weight: 400;
font-size: 14px;
color: #333333;
text-align: right;
line-height: 20px;
}
.editor{
display: inline-block;
background-color: #fff;
.quill{
background-color: #fff;
display: inline-block;
border-color: #E5E5E5;
/deep/ .ql-toolbar.ql-snow, /deep/ .ql-container.ql-snow{
border-color: #E5E5E5;
}
/deep/ .ql-label{
color: #26a2ff;
}
}
.extend-bar{
width: 100%;
height: 40px;
padding: 0 20px;
line-height: 40px;
margin-top: -1px;
background: #FAFBFE;
border: 1px solid #E5E5E5;
box-sizing: border-box;
border-radius: 0 0 4px 4px;
border-top: none;
.extend-icon{
cursor: pointer;
&::before{
// font-size: 16px;
margin-right: 5px;
}
font-size: 14px;
color: #666;
}
}
}
.upload-wrap{
display: inline-block; display: inline-block;
} }
.upload-tip{ .upload-tip{
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!