Commit e0f5359 1 parent 5933eed commit e0f5359 Copy full SHA for e0f5359
File tree 9 files changed +155
-588
lines changed
back-end/h5-api/extensions/documentation/documentation/1.0.0
9 files changed +155
-588
lines changed Original file line number Diff line number Diff line change 14
14
"name" : " Apache 2.0" ,
15
15
"url" : " https://www.apache.org/licenses/LICENSE-2.0.html"
16
16
},
17
- "x-generation-date" : " 12/16/2019 10:29:14 PM "
17
+ "x-generation-date" : " 01/04/2020 12:13:39 AM "
18
18
},
19
19
"x-strapi-config" : {
20
20
"path" : " /documentation" ,
Original file line number Diff line number Diff line change @@ -77,7 +77,7 @@ export default {
77
77
const item = obj . editor
78
78
// https://vuejs.org/v2/guide/render-function.html
79
79
const data = {
80
- style : { width : '100%' } ,
80
+ // style: { width: '100%' },
81
81
props : {
82
82
...item . prop || { } ,
83
83
// https://vuejs.org/v2/guide/render-function.html#v-model
@@ -86,7 +86,9 @@ export default {
86
86
// 比如表单 input,如果用户手动删除了 placeholder的内容,程序会用defaultPropValue填充,
87
87
// 表现在UI上就是:用户永远无法彻底删掉默认值(必须保留至少一个字符)
88
88
// value: editingElement.pluginProps[propKey] || item.defaultPropValue
89
- value : editingElement . pluginProps [ propKey ]
89
+
90
+ // https://cn.vuejs.org/v2/guide/components-custom-events.html#%E8%87%AA%E5%AE%9A%E4%B9%89%E7%BB%84%E4%BB%B6%E7%9A%84-v-model
91
+ [ item . type === 'a-switch' ? 'checked' : 'value' ] : editingElement . pluginProps [ propKey ]
90
92
} ,
91
93
on : {
92
94
// https://vuejs.org/v2/guide/render-function.html#v-model
Original file line number Diff line number Diff line change @@ -101,12 +101,16 @@ export default {
101
101
<a-icon type="down" class="page-controller" onClick={() => { this.postMessage2Iframe('next') }}/>
102
102
*/ }
103
103
< / div>
104
- < iframe
105
- id= " iframe-for-preview"
106
- src= {this .releaseUrl }
107
- frameborder= " 0"
108
- style= " height: 100%;width: 100%;"
109
- >< / iframe>
104
+ {
105
+ // 类似 v-if="this.visible" 的目的:关闭预览弹框之后,销毁 iframe,避免继续播放音乐、视频
106
+ // similar with v-if="this.visible": destory the iframe after close the preview dialog to avoid playing the music and video
107
+ this .visible && < iframe
108
+ id= " iframe-for-preview"
109
+ src= {this .releaseUrl }
110
+ frameborder= " 0"
111
+ style= " height: 100%;width: 100%;"
112
+ >< / iframe>
113
+ }
110
114
{/** <engine :work="editingWork" :map-config="{}" /> */ }
111
115
< / div>
112
116
< / div>
Original file line number Diff line number Diff line change 5
5
justify-content : center ;
6
6
height : 60px !important ;
7
7
width : 100% ;
8
- margin-bottom : 15 px ;
8
+ margin-bottom : 5 px ;
9
9
10
10
border : 1px dashed #fff !important ;
11
11
background-color : #f5f8fb !important ;
Original file line number Diff line number Diff line change
1
+ /*
2
+ * @Author : ly525
3
+ * @Date : 2020-01-03 23:43:34
4
+ * @LastEditors : ly525
5
+ * @LastEditTime : 2020-01-04 13:27:58
6
+ * @FilePath : /luban-h5/front-end/h5/src/components/plugins/lbp-bg-music.js
7
+ * @Github : https://github.com/ly525/luban-h5
8
+ * @Description : Do not edit
9
+ * @Copyright 2018 - 2019 luban-h5. All Rights Reserved
10
+ */
11
+ import './styles/bg-music.scss'
12
+
13
+ export default {
14
+ name : 'lbp-bg-music' ,
15
+ props : {
16
+ disabled : {
17
+ type : Boolean ,
18
+ default : true
19
+ } ,
20
+ autoplay : {
21
+ type : Boolean ,
22
+ default : true ,
23
+ editor : {
24
+ type : 'a-switch' ,
25
+ label : '自动播放'
26
+ }
27
+ } ,
28
+ src : {
29
+ type : String ,
30
+ default : 'http://go.163.com/2018/0209/mengniu/audio/bgm.mp3' ,
31
+ editor : {
32
+ type : 'a-input' ,
33
+ label : '音乐URL' ,
34
+ prop : {
35
+ type : 'textarea'
36
+ }
37
+ }
38
+ }
39
+ } ,
40
+ data : ( ) => ( {
41
+ isPlaying : true
42
+ } ) ,
43
+ methods : {
44
+ toggle ( ) {
45
+ let bgAudio = this . $refs . bgAudio
46
+ if ( ! bgAudio ) return
47
+
48
+ this . isPlaying ? bgAudio . pause ( ) : bgAudio . play ( )
49
+ this . isPlaying = ! this . isPlaying
50
+ }
51
+ } ,
52
+ render ( ) {
53
+ const btnStyle = {
54
+ 'animation-play-state' : this . isPlaying ? 'running' : 'paused'
55
+ }
56
+ return (
57
+ < div class = "bg-music-wrapper" style = "display: block;" >
58
+ < div class = "bg-music-btn rotate" style = { btnStyle } onClick = { this . toggle } disabled = { this . disabled } >
59
+ < audio src = { this . src } autoplay = { this . autoplay } preload loop ref = 'bgAudio' > </ audio >
60
+ </ div >
61
+ </ div >
62
+ )
63
+ } ,
64
+ created ( ) {
65
+ // 在初始化的时候,autoplay 控制是否播放
66
+ // 后面是否播放,由用户的点击行为决定
67
+ this . isPlaying = this . autoplay
68
+ }
69
+ }
Original file line number Diff line number Diff line change
1
+ @keyframes rotating {
2
+ 0% {
3
+ transform : rotate (0deg )
4
+ }
5
+
6
+ to {
7
+ transform : rotate (1turn )
8
+ }
9
+ }
10
+
11
+ @mixin bg-music-icon {
12
+ position : absolute ;
13
+ z-index : 200 ;
14
+ width : 30px ;
15
+ height : 30px
16
+ }
17
+
18
+ .bg-music-wrapper {
19
+ right : 0 ;
20
+ top : 0 ;
21
+ @include bg-music-icon ;
22
+
23
+ .bg-music-btn {
24
+ @include bg-music-icon ;
25
+
26
+ right : 0 ;
27
+ top : 0 ;
28
+ border-radius : 15px ;
29
+ background-image : url (../bg-music.svg );
30
+ background-size : contain ;
31
+ background-repeat : no-repeat ;
32
+
33
+ & .rotate {
34
+ animation : rotating 1.2s linear infinite ;
35
+ }
36
+ }
37
+ }
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ import LbpFormRadioGroup from '../components/plugins/lbp-form-radio-group'
10
10
import LbpFormCheckboxGroup from '../components/plugins/lbp-form-checkbox-group'
11
11
import LbpBackground from '../components/plugins/lbp-background'
12
12
import LbpSlide from '../components/plugins/lbp-slide'
13
+ import LbpBgMusic from '../components/plugins/lbp-bg-music'
13
14
14
15
export const pluginsList = [
15
16
{
@@ -134,6 +135,17 @@ export const pluginsList = [
134
135
component : LbpBackground ,
135
136
visible : false ,
136
137
name : LbpBackground . name
138
+ } ,
139
+ {
140
+ i18nTitle : {
141
+ 'en-US' : 'BgMusic' ,
142
+ 'zh-CN' : '背景音乐'
143
+ } ,
144
+ title : '背景音乐' ,
145
+ icon : 'music' ,
146
+ component : LbpBgMusic ,
147
+ visible : true ,
148
+ name : LbpBgMusic . name
137
149
}
138
150
]
139
151
You can’t perform that action at this time.
0 commit comments