Commit a24d7435f8603b6ea685c4f202c1e5f2d7d232bc

Authored by ly525
1 parent fd75f972

update preview modal style

front-end/h5/package.json
@@ -5,7 +5,7 @@ @@ -5,7 +5,7 @@
5 "scripts": { 5 "scripts": {
6 "serve": "vue-cli-service serve", 6 "serve": "vue-cli-service serve",
7 "build": "vue-cli-service build", 7 "build": "vue-cli-service build",
8 - "lint": "vue-cli-service lint", 8 + "lint": "vue-cli-service lint --fix",
9 "test:e2e": "vue-cli-service test:e2e", 9 "test:e2e": "vue-cli-service test:e2e",
10 "test:unit": "vue-cli-service test:unit", 10 "test:unit": "vue-cli-service test:unit",
11 "deploy": "rm -rf dist && npm run build && ./deploy.sh" 11 "deploy": "rm -rf dist && npm run build && ./deploy.sh"
front-end/h5/src/components/core/editor/canvas/edit.js
@@ -203,7 +203,6 @@ export default { @@ -203,7 +203,6 @@ export default {
203 }} 203 }}
204 > 204 >
205 {h(element.name, data)} 205 {h(element.name, data)}
206 - {element.commonStyle.zindex}  
207 </Shape> 206 </Shape>
208 ) 207 )
209 }) 208 })
front-end/h5/src/components/core/editor/modals/preview.vue
@@ -14,52 +14,52 @@ export default { @@ -14,52 +14,52 @@ export default {
14 }, 14 },
15 computed: { 15 computed: {
16 ...mapState('editor', { 16 ...mapState('editor', {
17 - work: state => state.work, 17 + work: state => state.work
18 }), 18 }),
19 releaseUrl () { 19 releaseUrl () {
20 return `//localhost:1337/works/preview/${this.work.id}` 20 return `//localhost:1337/works/preview/${this.work.id}`
21 } 21 }
22 }, 22 },
23 - data() { 23 + data () {
24 return { 24 return {
25 confirmLoading: false, 25 confirmLoading: false,
26 - qrcodeSize: 500, 26 + qrcodeSize: 500
27 } 27 }
28 }, 28 },
29 watch: { 29 watch: {
30 visible (val) { 30 visible (val) {
31 - if (!val) return;  
32 - this.$nextTick(() => this.drawQRcode());  
33 - }, 31 + if (!val) return
  32 + this.$nextTick(() => this.drawQRcode())
  33 + }
34 }, 34 },
35 methods: { 35 methods: {
36 ...mapActions('editor', [ 36 ...mapActions('editor', [
37 'saveWork', 37 'saveWork',
38 'updateWork' 38 'updateWork'
39 ]), 39 ]),
40 - handleOk(e) {  
41 - this.confirmLoading = true; 40 + handleOk (e) {
  41 + this.confirmLoading = true
42 this.saveWork().then(res => { 42 this.saveWork().then(res => {
43 this.handleClose() 43 this.handleClose()
44 - this.confirmLoading = false; 44 + this.confirmLoading = false
45 }) 45 })
46 // setTimeout(() => { 46 // setTimeout(() => {
47 // }, 2000); 47 // }, 2000);
48 }, 48 },
49 - handleCancel(e) {  
50 - console.log('Clicked cancel button'); 49 + handleCancel (e) {
  50 + console.log('Clicked cancel button')
51 this.handleClose() 51 this.handleClose()
52 }, 52 },
53 drawQRcode () { 53 drawQRcode () {
54 - var canvas = document.getElementById('qrcode-container'); 54 + var canvas = document.getElementById('qrcode-container')
55 QRCode.toCanvas(canvas, this.releaseUrl, { scale: 4 }, err => { 55 QRCode.toCanvas(canvas, this.releaseUrl, { scale: 4 }, err => {
56 - console.log(err);  
57 - }); 56 + console.log(err)
  57 + })
58 }, 58 },
59 postMessage2Iframe (message) { 59 postMessage2Iframe (message) {
60 let iframeWin = document.getElementById('iframe-for-preview').contentWindow 60 let iframeWin = document.getElementById('iframe-for-preview').contentWindow
61 // iframeWin.postMessage('next', window.location.origin); 61 // iframeWin.postMessage('next', window.location.origin);
62 - iframeWin.postMessage(message, 'http://localhost:1337'); 62 + iframeWin.postMessage(message, 'http://localhost:1337')
63 } 63 }
64 }, 64 },
65 render (h) { 65 render (h) {
@@ -71,11 +71,11 @@ export default { @@ -71,11 +71,11 @@ export default {
71 onCancel={this.handleCancel} 71 onCancel={this.handleCancel}
72 width="70%" 72 width="70%"
73 okText="保存" 73 okText="保存"
74 - > 74 + >
75 <div class="preview-wrapper"> 75 <div class="preview-wrapper">
76 <a-row gutter={20}> 76 <a-row gutter={20}>
77 <a-col span={8}> 77 <a-col span={8}>
78 - <div class="phone-wrapper" style={{ transform: 'scale(0.8)'}}> 78 + <div class="phone-wrapper" style={{ transform: 'scale(0.8)' }}>
79 <div class="phone"> 79 <div class="phone">
80 <div class="float-ctrl-panel"> 80 <div class="float-ctrl-panel">
81 <a class="page-controller" onClick={(e) => { this.postMessage2Iframe('prev') }}>上一页</a> 81 <a class="page-controller" onClick={(e) => { this.postMessage2Iframe('prev') }}>上一页</a>
@@ -104,14 +104,14 @@ export default { @@ -104,14 +104,14 @@ export default {
104 <a-input 104 <a-input
105 class="input" 105 class="input"
106 value={this.work.title} 106 value={this.work.title}
107 - onChange={e => this.updateWork({ title: e.target.value})} 107 + onChange={e => this.updateWork({ title: e.target.value })}
108 // onBlur={this.saveTitle} 108 // onBlur={this.saveTitle}
109 placeholder="请输入标题" 109 placeholder="请输入标题"
110 ></a-input> 110 ></a-input>
111 <a-input 111 <a-input
112 class="input" 112 class="input"
113 value={this.work.description} 113 value={this.work.description}
114 - onChange={e => this.updateWork({ description: e.target.value})} 114 + onChange={e => this.updateWork({ description: e.target.value })}
115 // v-model="description" 115 // v-model="description"
116 // onBlur={this.saveDescription} 116 // onBlur={this.saveDescription}
117 placeholder="请输入描述" 117 placeholder="请输入描述"
@@ -122,7 +122,7 @@ export default { @@ -122,7 +122,7 @@ export default {
122 <div class="label">手机扫码分享给好友</div> 122 <div class="label">手机扫码分享给好友</div>
123 <div class="code"> 123 <div class="code">
124 <canvas style="float: left" id="qrcode-container"></canvas> 124 <canvas style="float: left" id="qrcode-container"></canvas>
125 - <a-radio-group class="radios" value={this.qrcodeSize} onChange={e => {this.qrcodeSize = e.target.value}}> 125 + <a-radio-group class="radios" value={this.qrcodeSize} onChange={e => { this.qrcodeSize = e.target.value }}>
126 <a-radio label={500} value={500}>500x500</a-radio> 126 <a-radio label={500} value={500}>500x500</a-radio>
127 <a-radio label={1000} value={1000}>1000x1000</a-radio> 127 <a-radio label={1000} value={1000}>1000x1000</a-radio>
128 <a-radio label={2000} value={2000}>2000x2000</a-radio> 128 <a-radio label={2000} value={2000}>2000x2000</a-radio>
@@ -141,7 +141,6 @@ export default { @@ -141,7 +141,6 @@ export default {
141 } 141 }
142 </script> 142 </script>
143 143
144 -  
145 <style lang="scss"> 144 <style lang="scss">
146 .preview-wrapper { 145 .preview-wrapper {
147 position: relative; 146 position: relative;
@@ -234,4 +233,4 @@ export default { @@ -234,4 +233,4 @@ export default {
234 } 233 }
235 } 234 }
236 235
237 -</style>  
238 \ No newline at end of file 236 \ No newline at end of file
  237 +</style>
front-end/h5/src/components/core/styles/index.scss
@@ -18,7 +18,8 @@ @@ -18,7 +18,8 @@
18 18
19 .shortcut-button { 19 .shortcut-button {
20 width: 100%; 20 width: 100%;
21 - height: 40px; 21 + height: 30px;
  22 + font-size: 14px;
22 23
23 .shortcut-icon { 24 .shortcut-icon {
24 padding-right: 4px; 25 padding-right: 4px;
front-end/h5/src/components/plugins/lbp-text.js
@@ -10,7 +10,7 @@ export default { @@ -10,7 +10,7 @@ export default {
10 } = this 10 } = this
11 11
12 const style = { 12 const style = {
13 - color, 13 + color: `${color} !important`,
14 textAlign, 14 textAlign,
15 backgroundColor: 'transparent', 15 backgroundColor: 'transparent',
16 fontSize: fontSize, 16 fontSize: fontSize,
front-end/h5/src/store/modules/editor.js
1 // initial state 1 // initial state
2 -import strapi from '../../utils/strapi'  
3 import Work from '../../components/core/models/work' 2 import Work from '../../components/core/models/work'
4 import { actions as pageActions, mutations as pageMutations } from './page' 3 import { actions as pageActions, mutations as pageMutations } from './page'
5 import { actions as elementActions, mutations as elementMutations } from './element' 4 import { actions as elementActions, mutations as elementMutations } from './element'
front-end/h5/src/views/Editor.vue
1 <script> 1 <script>
2 -import Vue from 'vue'  
3 import CoreEditor from '../components/core/editor/index.js' 2 import CoreEditor from '../components/core/editor/index.js'
4 import loadPluginMixin from '../mixins/load-plugins.js' 3 import loadPluginMixin from '../mixins/load-plugins.js'
5 4
6 export default { 5 export default {
7 extends: CoreEditor, 6 extends: CoreEditor,
8 - mixins: [loadPluginMixin], 7 + mixins: [loadPluginMixin]
9 } 8 }
10 </script> 9 </script>
11 <style lang="scss"> 10 <style lang="scss">