yuantianjiao 6 年之前
父節點
當前提交
b7a4e00b4a
共有 3 個檔案被更改,包括 127 行新增80 行删除
  1. 1
    2
      src/components/preview/preview.vue
  2. 75
    30
      src/pages/user/calendar/making.vue
  3. 51
    48
      src/store/making/index.js

+ 1
- 2
src/components/preview/preview.vue 查看文件

@@ -14,8 +14,7 @@
14 14
       <div class="swiper-button-prev">
15 15
         <i class="iconfont icon-left"></i>
16 16
       </div>
17
-      <div class="swiper-pagination" v-show="mainIndex !== 1"></div>
18
-      <div class="swiper-cover" v-show="mainIndex === 1">封面</div>
17
+      <div class="swiper-pagination"></div>
19 18
     </div>
20 19
   </div>
21 20
 </template>

+ 75
- 30
src/pages/user/calendar/making.vue 查看文件

@@ -1,5 +1,5 @@
1 1
 <template>
2
-  <div>
2
+  <div style="background:#fff;">
3 3
     <div v-if="isLoading || windowLoad" class="loading">
4 4
       <img :src="loading" alt>
5 5
       <span>{{msg}}</span>
@@ -7,12 +7,12 @@
7 7
     <div class="cutBox" v-for="(item,index) in banner" :key="index">
8 8
       <div class="cutDom" v-if="index === mainIndex-1">
9 9
         <img :src="item.bgImg" class="cover">
10
-        <img
11
-          :style="item.styleCut"
12
-          v-if="!item.CustomerImg && item.defaultBg"
13
-          :src="item.defaultBg"
14
-        >
15
-        <img :style="item.styleCut" v-if="item.CustomerImg" :src="item.CustomerImg">
10
+        <div :style="item.styleCut" v-if="!item.CustomerImg && item.defaultBg" class="cla">
11
+          <img :src="item.defaultBg">
12
+        </div>
13
+        <div :style="item.styleCut" v-if="item.CustomerImg" class="cla">
14
+          <img :src="item.CustomerImg">
15
+        </div>
16 16
         <img class="text-h" v-if="item.ImgName === '10月'" :src="textH">
17 17
         <img class="text-l" v-if="item.ImgName === '4月' || item.ImgName === '7月'" :src="textL">
18 18
       </div>
@@ -31,7 +31,7 @@
31 31
                 v-if="!item.CustomerImg && item.defaultBg"
32 32
                 :src="item.defaultBg"
33 33
               >
34
-              <img :style="item.style" v-if="item.CustomerImg" :src="item.CustomerImg">
34
+              <img :src="item.CustomerImg" :style="item.style" v-if="item.CustomerImg">
35 35
               <img class="text-h" v-if="item.ImgName === '10月'" :src="textH">
36 36
               <img
37 37
                 class="text-l"
@@ -53,8 +53,7 @@
53 53
       <div class="swiper-button-prev">
54 54
         <i class="iconfont icon-left"></i>
55 55
       </div>
56
-      <div class="swiper-pagination" v-show="mainIndex !== 1"></div>
57
-      <div class="swiper-cover" v-show="mainIndex === 1">封面</div>
56
+      <div class="swiper-pagination"></div>
58 57
     </div>
59 58
     <div class="meassage" v-if="mainIndex !== 1">备注:为了美观效果请上传{{size}}尺寸照片,未按尺寸会默认裁剪</div>
60 59
     <div class="meassage" v-else>&nbsp;</div>
@@ -134,6 +133,9 @@ export default {
134 133
         on: {
135 134
           transitionStart: function () {
136 135
             self.mainIndex = this.activeIndex + 1
136
+            self.$nextTick(() => {
137
+              self.calSize()
138
+            })
137 139
           }
138 140
         }
139 141
       },
@@ -170,14 +172,21 @@ export default {
170 172
   methods: {
171 173
     ...mapMakingActions(['setBanner', 'calendar']),
172 174
     upload (url) {
173
-      this.banner[this.mainIndex - 1].CustomerImg = url + '?x-oss-process=style/calendar-thumb'
174
-      this.setBanner({ type: this.$route.query.type, data: JSON.parse(JSON.stringify(this.banner)) })
175
-      console.log(this.banner)
176
-      let cutDoms = document.getElementsByClassName('cutDom')[0]
177
-      this.convert2canvas(cutDoms, this.mainIndex - 1).then(() => {
178
-        this.isLoading = false
179
-      }).catch(() => {
180
-        this.isLoading = false
175
+      this.banner[this.mainIndex - 1].CustomerImg = url
176
+      this.setBanner({ type: this.$route.query.type, data: JSON.parse(JSON.stringify(this.banner)) }).then(() => {
177
+        this.$nextTick(() => {
178
+          this.calSize().then(() => {
179
+            let cutDoms = document.getElementsByClassName('cutDom')[0]
180
+            let that = this
181
+            cutDoms.onload = function () {
182
+              that.convert2canvas(cutDoms, that.mainIndex - 1).then(() => {
183
+                that.isLoading = false
184
+              }).catch(() => {
185
+                that.isLoading = false
186
+              })
187
+            }
188
+          })
189
+        })
181 190
       })
182 191
     },
183 192
     onRead (file) {
@@ -191,15 +200,21 @@ export default {
191 200
     changeOld () {
192 201
       this.isLoading = true
193 202
       this.banner[this.mainIndex - 1].CustomerImg = ''
194
-      this.setBanner({ type: this.$route.query.type, data: JSON.parse(JSON.stringify(this.banner)) })
195
-      setTimeout(() => {
196
-        let cutDoms = document.getElementsByClassName('cutDom')[0]
197
-        this.convert2canvas(cutDoms, this.mainIndex - 1).then(() => {
198
-          this.isLoading = false
199
-        }).catch(() => {
200
-          this.isLoading = false
203
+      this.setBanner({ type: this.$route.query.type, data: JSON.parse(JSON.stringify(this.banner)) }).then(() => {
204
+        this.$nextTick(() => {
205
+          this.calSize().then(() => {
206
+            let cutDoms = document.getElementsByClassName('cutDom')[0]
207
+            const that = this
208
+            cutDoms.onload = function () {
209
+              that.convert2canvas(cutDoms, that.mainIndex - 1).then(() => {
210
+                that.isLoading = false
211
+              }).catch(() => {
212
+                that.isLoading = false
213
+              })
214
+            }
215
+          })
201 216
         })
202
-      }, 100)
217
+      })
203 218
     },
204 219
     submit () {
205 220
       this.showPop = false
@@ -262,7 +277,6 @@ export default {
262 277
           context.webkitImageSmoothingEnabled = false;
263 278
           context.msImageSmoothingEnabled = false;
264 279
           context.imageSmoothingEnabled = false;
265
-          console.log(canvas.toDataURL('image/jpeg', 0.8))
266 280
           // 【重要】默认转化的格式为png,也可设置为其他格式
267 281
           // var img = canvas2image.convertToJPEG(canvas, canvas.width, canvas.height);
268 282
           // var blobs = that.urltoblob(img.src);
@@ -271,7 +285,6 @@ export default {
271 285
           //   content: img.src,
272 286
           //   file: that.blobToFile(blobs, namestr)
273 287
           // }
274
-          // console.log(file)
275 288
           // that.toolClass.upload(file).then((res) => {
276 289
           //   that.banner[i].CalendarImg = res.result.url
277 290
           //   that.setBanner({ type: that.$route.query.type, data: JSON.parse(JSON.stringify(that.banner)) })
@@ -318,6 +331,33 @@ export default {
318 331
       theBlob.lastModifiedDate = new Date();
319 332
       theBlob.name = fileName;
320 333
       return theBlob;
334
+    },
335
+    calSize () {
336
+      return new Promise((resolve) => {
337
+        let rotate = this.size
338
+        let dom = document.getElementsByClassName('cla')[0]
339
+        dom.children[0].onload = function () {
340
+          let imgW = dom.children[0].naturalWidth
341
+          let imgH = dom.children[0].naturalHeight
342
+          if (rotate === '横') {
343
+            if (imgW <= imgH) {
344
+              dom.children[0].style = 'width:100%;position:absolute;left:0;top:50%;transform:translateY(-50%);'
345
+              resolve()
346
+            } else {
347
+              dom.children[0].style = 'height:100%;position:absolute;top:0;left:50%;transform:translateX(-50%);'
348
+              resolve()
349
+            }
350
+          } else {
351
+            if (imgW >= imgH) {
352
+              dom.children[0].style = 'height:100%;position:absolute;top:0;left:50%;transform:translateX(-50%);'
353
+              resolve()
354
+            } else {
355
+              dom.children[0].style = 'width:100%;position:absolute;left:0;top:50%;transform:translateY(-50%);'
356
+              resolve()
357
+            }
358
+          }
359
+        }
360
+      })
321 361
     }
322 362
   }
323 363
 }
@@ -331,6 +371,11 @@ export default {
331 371
 
332 372
 
333 373
 <style lang="scss" scoped>
374
+.cla {
375
+  overflow: hidden;
376
+  position: relative;
377
+  z-index: 10;
378
+}
334 379
 .loading {
335 380
   width: 100%;
336 381
   height: 100%;
@@ -517,7 +562,7 @@ export default {
517 562
   display: flex;
518 563
   justify-content: center;
519 564
   align-items: center;
520
-  padding: 0.2rem 0.2rem 0.3rem;
565
+  padding: 0.15rem 0.2rem 0.3rem;
521 566
   > div {
522 567
     flex: 1;
523 568
     text-align: center;
@@ -539,7 +584,7 @@ export default {
539 584
   padding: 0 0.25rem;
540 585
   box-sizing: border-box;
541 586
   span {
542
-    width: 0.6rem;
587
+    width: 0.5rem;
543 588
   }
544 589
 }
545 590
 .btn {

+ 51
- 48
src/store/making/index.js 查看文件

@@ -62,7 +62,7 @@ export default {
62 62
         defaultNoUser: 'https://spaceofcheng.oss-cn-beijing.aliyuncs.com/calendar/b1.jpg',
63 63
         ImgName: '1月',
64 64
         Sort: 2,
65
-        style: 'width:1.44rem;height:.94rem;position:absolute;top:.25rem;left:50%;transform:translateX(-50%);object-fit: cover;',
65
+        style: 'width:1.44rem;height:.94rem;position:absolute;top:.25rem;left:50%;transform:translateX(-50%);object-fit:cover;',
66 66
         styleCut: `width: 11.2cm;height: 7.3cm;position: absolute;top: 1.95cm;left: .9cm;`
67 67
       },
68 68
       {
@@ -73,8 +73,8 @@ export default {
73 73
         defaultNoUser: 'https://spaceofcheng.oss-cn-beijing.aliyuncs.com/calendar/b2.jpg',
74 74
         ImgName: '2月',
75 75
         Sort: 3,
76
-        style: 'width:1.01rem;height:1.18rem;position:absolute;top:.23rem;left:0.15rem;object-fit: cover;',
77
-        styleCut: `width: 7.83cm;height: 9.16cm;position: absolute;top: 1.8cm;left: 1.07cm;object-fit: cover;`
76
+        style: 'width:1.01rem;height:1.18rem;position:absolute;top:.23rem;left:0.15rem;object-fit:cover;',
77
+        styleCut: `width: 7.83cm;height: 9.16cm;position: absolute;top: 1.8cm;left: 1.07cm;`
78 78
       },
79 79
       {
80 80
         bgImg: b3bg,
@@ -84,8 +84,8 @@ export default {
84 84
         defaultNoUser: 'https://spaceofcheng.oss-cn-beijing.aliyuncs.com/calendar/b3.jpg',
85 85
         ImgName: '3月',
86 86
         Sort: 4,
87
-        style: 'width:1.01rem;height:1.18rem;position:absolute;top:.23rem;right:0.16rem;object-fit: cover;',
88
-        styleCut: `width: 7.83cm;height: 9.16cm;position: absolute;top: 1.8cm;right: 1.15cm;object-fit: cover;`
87
+        style: 'width:1.01rem;height:1.18rem;position:absolute;top:.23rem;right:0.16rem;object-fit:cover;',
88
+        styleCut: `width: 7.83cm;height: 9.16cm;position: absolute;top: 1.8cm;right: 1.15cm;`
89 89
       },
90 90
       {
91 91
         bgImg: b4bg,
@@ -95,8 +95,8 @@ export default {
95 95
         defaultNoUser: 'https://spaceofcheng.oss-cn-beijing.aliyuncs.com/calendar/b4.jpg',
96 96
         ImgName: '4月',
97 97
         Sort: 5,
98
-        style: 'width:1.44rem;height:.94rem;position:absolute;top:.24rem;left:50%;transform:translateX(-50.5%);object-fit: cover;',
99
-        styleCut: `width: 11.1cm;height: 7.3cm;position: absolute;top: 1.9cm;left: .9cm;object-fit: cover;`
98
+        style: 'width:1.44rem;height:.94rem;position:absolute;top:.24rem;left:50%;transform:translateX(-50.5%);object-fit:cover;',
99
+        styleCut: `width: 11.1cm;height: 7.3cm;position: absolute;top: 1.9cm;left: .9cm;`
100 100
       },
101 101
       {
102 102
         bgImg: b5bg,
@@ -106,8 +106,8 @@ export default {
106 106
         defaultNoUser: 'https://spaceofcheng.oss-cn-beijing.aliyuncs.com/calendar/b5.jpg',
107 107
         ImgName: '5月',
108 108
         Sort: 6,
109
-        style: 'width:1.01rem;height:1.18rem;position:absolute;top:.23rem;left:0.15rem;object-fit: cover;',
110
-        styleCut: `width: 7.83cm;height: 9.16cm;position: absolute;top: 1.8cm;left: 1.07cm;object-fit: cover;`
109
+        style: 'width:1.01rem;height:1.18rem;position:absolute;top:.23rem;left:0.15rem;object-fit:cover;',
110
+        styleCut: `width: 7.83cm;height: 9.16cm;position: absolute;top: 1.8cm;left: 1.07cm;`
111 111
       },
112 112
       {
113 113
         bgImg: b6bg,
@@ -117,8 +117,8 @@ export default {
117 117
         defaultNoUser: 'https://spaceofcheng.oss-cn-beijing.aliyuncs.com/calendar/b6.jpg',
118 118
         ImgName: '6月',
119 119
         Sort: 7,
120
-        style: 'width:1.01rem;height:1.18rem;position:absolute;top:.24rem;right:0.16rem;object-fit: cover;',
121
-        styleCut: `width: 7.83cm;height: 9.16cm;position: absolute;top: 1.87cm;right: 1.15cm;object-fit: cover;`
120
+        style: 'width:1.01rem;height:1.18rem;position:absolute;top:.24rem;right:0.16rem;object-fit:cover;',
121
+        styleCut: `width: 7.83cm;height: 9.16cm;position: absolute;top: 1.87cm;right: 1.15cm;`
122 122
       },
123 123
       {
124 124
         bgImg: b7bg,
@@ -128,8 +128,8 @@ export default {
128 128
         defaultNoUser: 'https://spaceofcheng.oss-cn-beijing.aliyuncs.com/calendar/b7.jpg',
129 129
         ImgName: '7月',
130 130
         Sort: 8,
131
-        style: 'width:1.44rem;height:.94rem;position:absolute;top:.24rem;left:50%;transform:translateX(-50%);object-fit: cover;',
132
-        styleCut: `width: 11.2cm;height: 7.3cm;position: absolute;top: 1.88cm;left: .9cm;object-fit: cover;`
131
+        style: 'width:1.44rem;height:.94rem;position:absolute;top:.24rem;left:50%;transform:translateX(-50%);object-fit:cover;',
132
+        styleCut: `width: 11.2cm;height: 7.3cm;position: absolute;top: 1.88cm;left: .9cm;`
133 133
       },
134 134
       {
135 135
         bgImg: b8bg,
@@ -139,8 +139,8 @@ export default {
139 139
         defaultNoUser: 'https://spaceofcheng.oss-cn-beijing.aliyuncs.com/calendar/b8.jpg',
140 140
         ImgName: '8月',
141 141
         Sort: 9,
142
-        style: 'width:1.01rem;height:1.18rem;position:absolute;top:.2rem;left:0.17rem;object-fit: cover;',
143
-        styleCut: `width: 7.83cm;height: 9.16cm;position: absolute;top: 1.57cm;left: 1.23cm;object-fit: cover;`
142
+        style: 'width:1.01rem;height:1.18rem;position:absolute;top:.2rem;left:0.17rem;object-fit:cover;',
143
+        styleCut: `width: 7.83cm;height: 9.16cm;position: absolute;top: 1.57cm;left: 1.23cm;`
144 144
       },
145 145
       {
146 146
         bgImg: b9bg,
@@ -150,8 +150,8 @@ export default {
150 150
         defaultNoUser: 'https://spaceofcheng.oss-cn-beijing.aliyuncs.com/calendar/b9.jpg',
151 151
         ImgName: '9月',
152 152
         Sort: 10,
153
-        style: 'width:1.01rem;height:1.18rem;position:absolute;top:.2rem;right:0.16rem;object-fit: cover;',
154
-        styleCut: `width: 7.83cm;height: 9.16cm;position: absolute;top: 1.58cm;right: 1.15cm;object-fit: cover;`
153
+        style: 'width:1.01rem;height:1.18rem;position:absolute;top:.2rem;right:0.16rem;object-fit:cover;',
154
+        styleCut: `width: 7.83cm;height: 9.16cm;position: absolute;top: 1.58cm;right: 1.15cm;`
155 155
       },
156 156
       {
157 157
         bgImg: b10bg,
@@ -161,8 +161,8 @@ export default {
161 161
         defaultNoUser: 'https://spaceofcheng.oss-cn-beijing.aliyuncs.com/calendar/b10.jpg',
162 162
         ImgName: '10月',
163 163
         Sort: 11,
164
-        style: 'width:1.44rem;height:.94rem;position:absolute;top:.24rem;left:50%;transform:translateX(-50%);object-fit: cover;',
165
-        styleCut: `width: 11.2cm;height: 7.3cm;position: absolute;top: 1.88cm;left: .9cm;object-fit: cover;`
164
+        style: 'width:1.44rem;height:.94rem;position:absolute;top:.24rem;left:50%;transform:translateX(-50%);object-fit:cover;',
165
+        styleCut: `width: 11.2cm;height: 7.3cm;position: absolute;top: 1.88cm;left: .9cm;`
166 166
       },
167 167
       {
168 168
         bgImg: b11bg,
@@ -172,8 +172,8 @@ export default {
172 172
         defaultNoUser: 'https://spaceofcheng.oss-cn-beijing.aliyuncs.com/calendar/b11.jpg',
173 173
         ImgName: '11月',
174 174
         Sort: 12,
175
-        style: 'width:1.01rem;height:1.18rem;position:absolute;top:.2rem;left:0.16rem;object-fit: cover;',
176
-        styleCut: `width: 7.83cm;height: 9.16cm;position: absolute;top: 1.57cm;left: 1.15cm;object-fit: cover;`
175
+        style: 'width:1.01rem;height:1.18rem;position:absolute;top:.2rem;left:0.16rem;object-fit:cover;',
176
+        styleCut: `width: 7.83cm;height: 9.16cm;position: absolute;top: 1.57cm;left: 1.15cm;`
177 177
       },
178 178
       {
179 179
         bgImg: b12bg,
@@ -183,8 +183,8 @@ export default {
183 183
         defaultNoUser: 'https://spaceofcheng.oss-cn-beijing.aliyuncs.com/calendar/b12.jpg',
184 184
         ImgName: '12月',
185 185
         Sort: 13,
186
-        style: 'width:1.01rem;height:1.18rem;position:absolute;top:.2rem;right:0.16rem;object-fit: cover;',
187
-        styleCut: `width: 7.83cm;height: 9.16cm;position: absolute;top: 1.56cm;right: 1.15cm;object-fit: cover;`
186
+        style: 'width:1.01rem;height:1.18rem;position:absolute;top:.2rem;right:0.16rem;object-fit:cover;',
187
+        styleCut: `width: 7.83cm;height: 9.16cm;position: absolute;top: 1.56cm;right: 1.15cm;`
188 188
       }
189 189
     ],
190 190
     bannerRed: [
@@ -206,8 +206,8 @@ export default {
206 206
         defaultNoUser: 'https://spaceofcheng.oss-cn-beijing.aliyuncs.com/calendar/b1.jpg',
207 207
         ImgName: '1月',
208 208
         Sort: 2,
209
-        style: 'width:1.44rem;height:.94rem;position:absolute;top:.25rem;left:50%;transform:translateX(-50%);object-fit: cover;',
210
-        styleCut: `width: 11.2cm;height: 7.3cm;position: absolute;top: 1.95cm;left: .9cm;object-fit: cover;`
209
+        style: 'width:1.44rem;height:.94rem;position:absolute;top:.25rem;left:50%;transform:translateX(-50%);object-fit:cover;',
210
+        styleCut: `width: 11.2cm;height: 7.3cm;position: absolute;top: 1.95cm;left: .9cm;`
211 211
       },
212 212
       {
213 213
         bgImg: r2bg,
@@ -217,8 +217,8 @@ export default {
217 217
         defaultNoUser: 'https://spaceofcheng.oss-cn-beijing.aliyuncs.com/calendar/b2.jpg',
218 218
         ImgName: '2月',
219 219
         Sort: 3,
220
-        style: 'width:1.01rem;height:1.18rem;position:absolute;top:.23rem;left:0.15rem;object-fit: cover;',
221
-        styleCut: `width: 7.83cm;height: 9.16cm;position: absolute;top: 1.8cm;left: 1.07cm;object-fit: cover;`
220
+        style: 'width:1.01rem;height:1.18rem;position:absolute;top:.23rem;left:0.15rem;object-fit:cover;',
221
+        styleCut: `width: 7.83cm;height: 9.16cm;position: absolute;top: 1.8cm;left: 1.07cm;`
222 222
       },
223 223
       {
224 224
         bgImg: r3bg,
@@ -228,8 +228,8 @@ export default {
228 228
         defaultNoUser: 'https://spaceofcheng.oss-cn-beijing.aliyuncs.com/calendar/b3.jpg',
229 229
         ImgName: '3月',
230 230
         Sort: 4,
231
-        style: 'width:1.01rem;height:1.18rem;position:absolute;top:.23rem;right:0.16rem;object-fit: cover;',
232
-        styleCut: `width: 7.83cm;height: 9.16cm;position: absolute;top: 1.8cm;right: 1.15cm;object-fit: cover;`
231
+        style: 'width:1.01rem;height:1.18rem;position:absolute;top:.23rem;right:0.16rem;object-fit:cover;',
232
+        styleCut: `width: 7.83cm;height: 9.16cm;position: absolute;top: 1.8cm;right: 1.15cm;`
233 233
       },
234 234
       {
235 235
         bgImg: r4bg,
@@ -239,8 +239,8 @@ export default {
239 239
         defaultNoUser: 'https://spaceofcheng.oss-cn-beijing.aliyuncs.com/calendar/b4.jpg',
240 240
         ImgName: '4月',
241 241
         Sort: 5,
242
-        style: 'width:1.44rem;height:.94rem;position:absolute;top:.24rem;left:50%;transform:translateX(-50.5%);object-fit: cover;',
243
-        styleCut: `width: 11.1cm;height: 7.3cm;position: absolute;top: 1.9cm;left: .9cm;object-fit: cover;`
242
+        style: 'width:1.44rem;height:.94rem;position:absolute;top:.24rem;left:50%;transform:translateX(-50.5%);object-fit:cover;',
243
+        styleCut: `width: 11.1cm;height: 7.3cm;position: absolute;top: 1.9cm;left: .9cm;`
244 244
       },
245 245
       {
246 246
         bgImg: r5bg,
@@ -250,8 +250,8 @@ export default {
250 250
         defaultNoUser: 'https://spaceofcheng.oss-cn-beijing.aliyuncs.com/calendar/b5.jpg',
251 251
         ImgName: '5月',
252 252
         Sort: 6,
253
-        style: 'width:1.01rem;height:1.18rem;position:absolute;top:.23rem;left:0.15rem;object-fit: cover;',
254
-        styleCut: `width: 7.83cm;height: 9.16cm;position: absolute;top: 1.8cm;left: 1.07cm;object-fit: cover;`
253
+        style: 'width:1.01rem;height:1.18rem;position:absolute;top:.23rem;left:0.15rem;object-fit:cover;',
254
+        styleCut: `width: 7.83cm;height: 9.16cm;position: absolute;top: 1.8cm;left: 1.07cm;`
255 255
       },
256 256
       {
257 257
         bgImg: r6bg,
@@ -261,8 +261,8 @@ export default {
261 261
         defaultNoUser: 'https://spaceofcheng.oss-cn-beijing.aliyuncs.com/calendar/b6.jpg',
262 262
         ImgName: '6月',
263 263
         Sort: 7,
264
-        style: 'width:1.01rem;height:1.18rem;position:absolute;top:.24rem;right:0.16rem;object-fit: cover;',
265
-        styleCut: `width: 7.83cm;height: 9.16cm;position: absolute;top: 1.87cm;right: 1.15cm;object-fit: cover;`
264
+        style: 'width:1.01rem;height:1.18rem;position:absolute;top:.24rem;right:0.16rem;object-fit:cover;',
265
+        styleCut: `width: 7.83cm;height: 9.16cm;position: absolute;top: 1.87cm;right: 1.15cm;`
266 266
       },
267 267
       {
268 268
         bgImg: r7bg,
@@ -272,8 +272,8 @@ export default {
272 272
         defaultNoUser: 'https://spaceofcheng.oss-cn-beijing.aliyuncs.com/calendar/b7.jpg',
273 273
         ImgName: '7月',
274 274
         Sort: 8,
275
-        style: 'width:1.44rem;height:.94rem;position:absolute;top:.24rem;left:50%;transform:translateX(-50%);object-fit: cover;',
276
-        styleCut: `width: 11.2cm;height: 7.3cm;position: absolute;top: 1.88cm;left: .9cm;object-fit: cover;`
275
+        style: 'width:1.44rem;height:.94rem;position:absolute;top:.24rem;left:50%;transform:translateX(-50%);object-fit:cover;',
276
+        styleCut: `width: 11.2cm;height: 7.3cm;position: absolute;top: 1.88cm;left: .9cm;`
277 277
       },
278 278
       {
279 279
         bgImg: r8bg,
@@ -283,8 +283,8 @@ export default {
283 283
         defaultNoUser: 'https://spaceofcheng.oss-cn-beijing.aliyuncs.com/calendar/b8.jpg',
284 284
         ImgName: '8月',
285 285
         Sort: 9,
286
-        style: 'width:1.01rem;height:1.18rem;position:absolute;top:.2rem;left:0.17rem;object-fit: cover;',
287
-        styleCut: `width: 7.83cm;height: 9.16cm;position: absolute;top: 1.57cm;left: 1.23cm;object-fit: cover;`
286
+        style: 'width:1.01rem;height:1.18rem;position:absolute;top:.2rem;left:0.17rem;object-fit:cover;',
287
+        styleCut: `width: 7.83cm;height: 9.16cm;position: absolute;top: 1.57cm;left: 1.23cm;`
288 288
       },
289 289
       {
290 290
         bgImg: r9bg,
@@ -294,8 +294,8 @@ export default {
294 294
         defaultNoUser: 'https://spaceofcheng.oss-cn-beijing.aliyuncs.com/calendar/b9.jpg',
295 295
         ImgName: '9月',
296 296
         Sort: 10,
297
-        style: 'width:1.01rem;height:1.18rem;position:absolute;top:.2rem;right:0.16rem;object-fit: cover;',
298
-        styleCut: `width: 7.83cm;height: 9.16cm;position: absolute;top: 1.6cm;right: 1.15cm;object-fit: cover;`
297
+        style: 'width:1.01rem;height:1.18rem;position:absolute;top:.2rem;right:0.16rem;object-fit:cover;',
298
+        styleCut: `width: 7.83cm;height: 9.16cm;position: absolute;top: 1.6cm;right: 1.15cm;`
299 299
       },
300 300
       {
301 301
         bgImg: r10bg,
@@ -305,8 +305,8 @@ export default {
305 305
         defaultNoUser: 'https://spaceofcheng.oss-cn-beijing.aliyuncs.com/calendar/b10.jpg',
306 306
         ImgName: '10月',
307 307
         Sort: 11,
308
-        style: 'width:1.44rem;height:.94rem;position:absolute;top:.24rem;left:50%;transform:translateX(-50%);object-fit: cover;',
309
-        styleCut: `width: 11.2cm;height: 7.3cm;position: absolute;top: 1.88cm;left: .9cm;object-fit: cover;`
308
+        style: 'width:1.44rem;height:.94rem;position:absolute;top:.24rem;left:50%;transform:translateX(-50%);object-fit:cover;',
309
+        styleCut: `width: 11.2cm;height: 7.3cm;position: absolute;top: 1.88cm;left: .9cm;`
310 310
       },
311 311
       {
312 312
         bgImg: r11bg,
@@ -316,8 +316,8 @@ export default {
316 316
         defaultNoUser: 'https://spaceofcheng.oss-cn-beijing.aliyuncs.com/calendar/b11.jpg',
317 317
         ImgName: '11月',
318 318
         Sort: 12,
319
-        style: 'width:1.01rem;height:1.18rem;position:absolute;top:.2rem;left:0.16rem;object-fit: cover;',
320
-        styleCut: `width: 7.83cm;height: 9.16cm;position: absolute;top: 1.57cm;left: 1.15cm;object-fit: cover;`
319
+        style: 'width:1.01rem;height:1.18rem;position:absolute;top:.2rem;left:0.16rem;object-fit:cover;',
320
+        styleCut: `width: 7.83cm;height: 9.16cm;position: absolute;top: 1.57cm;left: 1.15cm;`
321 321
       },
322 322
       {
323 323
         bgImg: r12bg,
@@ -327,8 +327,8 @@ export default {
327 327
         defaultNoUser: 'https://spaceofcheng.oss-cn-beijing.aliyuncs.com/calendar/b12.jpg',
328 328
         ImgName: '12月',
329 329
         Sort: 13,
330
-        style: 'width:1.01rem;height:1.18rem;position:absolute;top:.2rem;right:0.16rem;object-fit: cover;',
331
-        styleCut: `width: 7.83cm;height: 9.16cm;position: absolute;top: 1.56cm;right: 1.15cm;object-fit: cover;`
330
+        style: 'width:1.01rem;height:1.18rem;position:absolute;top:.2rem;right:0.16rem;object-fit:cover;',
331
+        styleCut: `width: 7.83cm;height: 9.16cm;position: absolute;top: 1.56cm;right: 1.15cm;`
332 332
       }
333 333
     ]
334 334
   },
@@ -347,7 +347,10 @@ export default {
347 347
   },
348 348
   actions: {
349 349
     setBanner (context, { type, data }) {
350
-      context.commit('upDateBanner', { type, data })
350
+      return new Promise((resolve) => {
351
+        context.commit('upDateBanner', { type, data })
352
+        resolve()
353
+      })
351 354
     },
352 355
     calendar (context, data) {
353 356
       return new Promise((resolve, reject) => {