Commit e1baa2593d52a5623db5b9995e077ba6dbdb84ff

Authored by ly525
1 parent 3c40c452

feat(image-gallery) support delete background image

front-end/h5/src/components/core/styles/index.scss
... ... @@ -155,6 +155,10 @@
155 155 }
156 156 }
157 157  
  158 +.ant-tabs-nav .ant-tabs-tab {
  159 + padding: 12px 0 !important;
  160 +}
  161 +
158 162 // 动画编辑面板定制
159 163 #animation-edit-panel {
160 164 .ant-collapse-header {
... ...
front-end/h5/src/components/core/support/image-gallery/gallery.js
... ... @@ -38,6 +38,9 @@ export default {
38 38 }
39 39 },
40 40 methods: {
  41 + showGallery () {
  42 + this.innerVisible = true
  43 + },
41 44 handleClose () {
42 45 this.innerVisible = false
43 46 },
... ... @@ -63,24 +66,25 @@ export default {
63 66 renderDefaultActivator () {
64 67 const activatorWithoutImg = (
65 68 <div
66   - class="default-activator cursor-pointer "
67   - onClick={() => { this.innerVisible = true }}
  69 + class="default-activator cursor-pointer empty-bg-activator"
  70 + onClick={this.showGallery}
68 71 >
69 72 <a-icon type="plus" />
70 73 </div>
71 74 )
72 75  
73 76 const activatorWithImg = (
74   - <div
75   - class="default-activator cursor-pointer "
76   - onClick={() => { this.innerVisible = true }}
77   - >
78   - <img src={this.value} />
  77 + <div onClick={this.showGallery}>
  78 + <div class="default-activator cursor-pointer "><img src={this.value} width="50%" style={{ margin: 'auto' }} /></div>
79 79 <div class="flex-space-between" style="margin-top: 8px;">
80   - <a-button>更换图片</a-button>
81   - <a-button onClick={e => {
  80 + <a-button size="small">更换</a-button>
  81 + <a-button size="small" onClick={e => {
  82 + e.stopPropagation()
  83 + }}>裁剪</a-button>
  84 + <a-button size="small" onClick={(e) => {
82 85 e.stopPropagation()
83   - }}>裁剪图片</a-button>
  86 + this.handleSelectImage({ previewURL: '' })
  87 + }}>移除</a-button>
84 88 </div>
85 89 </div>
86 90 )
... ...
front-end/h5/src/components/core/support/image-gallery/gallery.scss
... ... @@ -3,7 +3,12 @@
3 3 text-align: center;
4 4  
5 5 img {
6   - width: 100%;
  6 + width: 50%;
7 7 border: 1px dashed #ccc;
8 8 }
  9 +}
  10 +
  11 +.empty-bg-activator {
  12 + height: 178px;
  13 + line-height: 178px;
9 14 }
10 15 \ No newline at end of file
... ...