许成详 6 年前
父节点
当前提交
942100389a

+ 4
- 0
dist/index.html 查看文件

@@ -0,0 +1,4 @@
1
+<<<<<<< HEAD
2
+=======
3
+<!DOCTYPE html><html><head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"><link rel=stylesheet href=//at.alicdn.com/t/font_775069_dwqa9wy3lkh.css><link rel="shortcut icon" href=favorite.ico><title>城的空间后台管理系统</title><link href=./static/css/app.cc1f90c9ffc52c3f483a949e2c10acd6.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.3ad1d5771e9b13dbdad2.js></script><script type=text/javascript src=./static/js/vendor.7e921535e20f729cf046.js></script><script type=text/javascript src=./static/js/app.5c35c9c3aac1bbcf9f74.js></script></body></html>
4
+>>>>>>> 0b9bbc49e3efad436d5b6723a315ca00d7060653

+ 13
- 3
src/pages/system/caseManager/caseAreaManager/add.vue 查看文件

@@ -34,10 +34,12 @@
34 34
         <li class="flex-h">
35 35
           <span>图片:<em>*</em></span>
36 36
           <div class="flex-item">
37
+            <div class="red-hint">建议上传30*30尺寸的图片</div>
37 38
             <div>
38 39
               <el-upload
39 40
                 class="avatar-uploader"
40 41
                 action='string'
42
+                :before-upload="toolClass.beforeUpload"
41 43
                 :http-request="toolClass.upload"
42 44
                 :show-file-list="false"
43 45
                 :on-success="handleAvatarSuccess">
@@ -50,10 +52,12 @@
50 52
         <li class="flex-h">
51 53
           <span>黑白图片:<em>*</em></span>
52 54
           <div class="flex-item">
55
+            <div class="red-hint">建议上传30*30尺寸的图片</div>
53 56
             <div>
54 57
               <el-upload
55 58
                 class="avatar-uploader"
56 59
                 action='string'
60
+                :before-upload="toolClass.beforeUpload"
57 61
                 :http-request="toolClass.upload"
58 62
                 :show-file-list="false"
59 63
                 :on-success="handleAvatarSuccesser">
@@ -73,7 +77,7 @@
73 77
 </template>
74 78
 
75 79
 <script>
76
-import { mapState } from 'vuex'
80
+import { mapState, mapActions } from 'vuex'
77 81
 
78 82
 export default {
79 83
   name: '',
@@ -105,7 +109,13 @@ export default {
105 109
     }
106 110
   },
107 111
   components: {},
112
+  created () {
113
+    this.picSize({ w: 30, h: 30 })
114
+  },
108 115
   methods: {
116
+    ...mapActions([
117
+      'picSize'
118
+    ]),
109 119
     handleAvatarSuccesser (res, file) {
110 120
       this.postData.AreaIconWhite = res.result.url
111 121
     },
@@ -150,11 +160,11 @@ export default {
150 160
           type: 'success',
151 161
           message: '操作成功!'
152 162
         })
153
-        this.$router.push({name: 'caseAreaManager'})
163
+        this.$router.push({ name: 'caseAreaManager' })
154 164
       })
155 165
     },
156 166
     cancel () {
157
-      this.$router.push({name: 'caseAreaManager'})
167
+      this.$router.push({ name: 'caseAreaManager' })
158 168
     }
159 169
   },
160 170
   mounted () { }

+ 9
- 1
src/pages/system/caseManager/caseAreaManager/edit.vue 查看文件

@@ -34,10 +34,12 @@
34 34
         <li class="flex-h">
35 35
           <span>图片:</span>
36 36
           <div class="flex-item">
37
+            <div class="red-hint">建议上传30*30尺寸的图片</div>
37 38
             <div>
38 39
               <el-upload
39 40
                 class="avatar-uploader"
40 41
                 action='string'
42
+                :before-upload="toolClass.beforeUpload"
41 43
                 :http-request="toolClass.upload"
42 44
                 :show-file-list="false"
43 45
                 :on-success="handleAvatarSuccess">
@@ -50,10 +52,12 @@
50 52
         <li class="flex-h">
51 53
           <span>黑白图片:</span>
52 54
           <div class="flex-item">
55
+            <div class="red-hint">建议上传30*30尺寸的图片</div>
53 56
             <div>
54 57
               <el-upload
55 58
                 class="avatar-uploader"
56 59
                 action='string'
60
+                :before-upload="toolClass.beforeUpload"
57 61
                 :http-request="toolClass.upload"
58 62
                 :show-file-list="false"
59 63
                 :on-success="handleAvatarSuccesser">
@@ -73,7 +77,7 @@
73 77
 </template>
74 78
 
75 79
 <script>
76
-import { mapState } from 'vuex'
80
+import { mapState, mapActions } from 'vuex'
77 81
 
78 82
 export default {
79 83
   name: '',
@@ -106,9 +110,13 @@ export default {
106 110
   },
107 111
   created () {
108 112
     this.getCaseAreaInfo()
113
+    this.picSize({ w: 30, h: 30 })
109 114
   },
110 115
   components: {},
111 116
   methods: {
117
+    ...mapActions([
118
+      'picSize'
119
+    ]),
112 120
     getCaseAreaInfo () { // 获取区域信息
113 121
       this.$ajax(this.$api.caseManager.getCaseAreaInfo.url, {
114 122
         method: this.$api.caseManager.getCaseAreaInfo.method,

+ 6
- 1
src/pages/system/caseManager/caseInfo/addCase/index.vue 查看文件

@@ -59,6 +59,7 @@
59 59
         <li class="flex-h">
60 60
           <span>案场头像:<em>*</em></span>
61 61
           <div class="flex-item">
62
+            <div class="red-hint">建议上传480*300尺寸的图片</div>
62 63
             <div>
63 64
               <!-- <a class="formImg">
64 65
                 <img :src="postData.CaseIcon" class="centerLabel contain" alt="">
@@ -67,6 +68,7 @@
67 68
               <el-upload
68 69
                 class="avatar-uploader"
69 70
                 action='string'
71
+                :before-upload="toolClass.beforeUpload"
70 72
                 :http-request="toolClass.upload"
71 73
                 :show-file-list="false"
72 74
                 :on-success="handleAvatarSuccess">
@@ -158,10 +160,13 @@ export default {
158 160
       OrgId: x => x.app.user.OrgId,
159 161
     }),
160 162
   },
163
+  created () {
164
+    this.picSize({ w: 480, h: 300 })
165
+  },
161 166
   components: {},
162 167
   methods: {
163 168
     ...mapActions([
164
-      'updateSystemInfo'
169
+      'updateSystemInfo', 'picSize'
165 170
     ]),
166 171
     handleAvatarSuccess (res, file) {
167 172
       this.postData.CaseIcon = res.result.url

+ 4
- 1
src/pages/system/caseManager/caseInfo/editCase/index.vue 查看文件

@@ -55,6 +55,7 @@
55 55
         <li class="flex-h">
56 56
           <span>案场头像:<em>*</em></span>
57 57
           <div class="flex-item">
58
+            <div class="red-hint">建议上传480*300尺寸的图片</div>
58 59
             <div>
59 60
               <!-- <a class="formImg">
60 61
                 <img :src="postData.CaseIcon" class="centerLabel contain" alt="">
@@ -63,6 +64,7 @@
63 64
               <el-upload
64 65
                 class="avatar-uploader"
65 66
                 action='string'
67
+                :before-upload="toolClass.beforeUpload"
66 68
                 :http-request="toolClass.upload"
67 69
                 :show-file-list="false"
68 70
                 :on-success="handleAvatarSuccess">
@@ -156,11 +158,12 @@ export default {
156 158
   },
157 159
   created () {
158 160
     this.getCaseInfoById()
161
+    this.picSize({ w: 480, h: 300 })
159 162
   },
160 163
   components: {},
161 164
   methods: {
162 165
     ...mapActions([
163
-      'updateSystemInfo'
166
+      'updateSystemInfo', 'picSize'
164 167
     ]),
165 168
     getCaseInfoById () { // 获取案场信息
166 169
       this.$ajax(this.$api.caseManager.getCaseInfo.url, {

+ 4
- 1
src/pages/system/cmsManager/bannerManager/add.vue 查看文件

@@ -77,9 +77,11 @@
77 77
         <li class="flex-h">
78 78
           <span>图片:<em>*</em></span>
79 79
           <div class="flex-item">
80
+            <div class="red-hint">建议上650*300尺寸的图片</div>
80 81
             <el-upload
81 82
               class="avatar-uploader"
82 83
               action='string'
84
+              :before-upload="toolClass.beforeUpload"
83 85
               :http-request="toolClass.upload"
84 86
               :show-file-list="false"
85 87
               :on-success="handleAvatarSuccess">
@@ -131,6 +133,7 @@ export default {
131 133
     // imageUploader: () => import('@/components/upload')
132 134
   },
133 135
   created () {
136
+    this.picSize({ w: 650, h: 300 })
134 137
     this.GetCourseList({ page: 1, pagesize: 100 })
135 138
     this.updateLocationAllInfo()
136 139
     this.updateSystemInfo().then(() => {
@@ -153,7 +156,7 @@ export default {
153 156
       'GetCourseList',
154 157
     ]),
155 158
     ...mapCmsActions(['updateLocationAllInfo']),
156
-    ...mapActions(['updateSystemInfo']),
159
+    ...mapActions(['updateSystemInfo', 'picSize']),
157 160
     submit () {
158 161
       if (this.postData.ForwardType === 'url') {
159 162
         this.postData.ForwardResourceId = ''

+ 5
- 1
src/pages/system/cmsManager/bannerManager/edit.vue 查看文件

@@ -77,9 +77,11 @@
77 77
         <li class="flex-h">
78 78
           <span>图片:<em>*</em></span>
79 79
           <div class="flex-item">
80
+            <div class="red-hint">建议上传650*300尺寸的图片</div>
80 81
             <el-upload
81 82
               class="avatar-uploader"
82 83
               action='string'
84
+              :before-upload="toolClass.beforeUpload"
83 85
               :http-request="toolClass.upload"
84 86
               :show-file-list="false"
85 87
               :on-success="handleAvatarSuccess">
@@ -98,7 +100,7 @@
98 100
 </template>
99 101
 
100 102
 <script>
101
-import { mapState, createNamespacedHelpers } from 'vuex'
103
+import { mapState, createNamespacedHelpers, mapActions } from 'vuex'
102 104
 const { mapActions: mapCmsActions } = createNamespacedHelpers('cms')
103 105
 const { mapState: mapCourseState, mapActions: mapCourseActions } = createNamespacedHelpers('course')
104 106
 
@@ -125,6 +127,7 @@ export default {
125 127
   },
126 128
   components: {},
127 129
   created () {
130
+    this.picSize({ w: 650, h: 300 })
128 131
     this.GetCourseList({page: 1, pagesize: 100, callback: this.getDetail})
129 132
     this.updateLocationAllInfo()
130 133
   },
@@ -143,6 +146,7 @@ export default {
143 146
       'GetCourseList',
144 147
     ]),
145 148
     ...mapCmsActions(['updateLocationAllInfo']),
149
+    ...mapActions(['picSize']),
146 150
     submit () {
147 151
       if (this.postData.ForwardType === 'url') {
148 152
         this.postData.ForwardResourceId = ''

+ 14
- 3
src/pages/system/cmsManager/majorProjects/edit.vue 查看文件

@@ -48,10 +48,12 @@
48 48
         </li>
49 49
         <li class="flex-h">
50 50
           <span>图片:<em>*</em></span>
51
-          <div class="flex-item">
51
+          <div class="flex-item" @click="pictSize()">
52
+            <div class="red-hint">建议上传704*208尺寸的图片</div>
52 53
             <el-upload
53 54
               class="avatar-uploader"
54 55
               action='string'
56
+              :before-upload="toolClass.beforeUpload"
55 57
               :http-request="toolClass.upload"
56 58
               :show-file-list="false"
57 59
               :on-success="handleImgSuccess">
@@ -62,10 +64,12 @@
62 64
         </li>
63 65
         <li class="flex-h">
64 66
           <span>详细图片:<em>*</em></span>
65
-          <div class="flex-item">
67
+          <div class="flex-item" @click="descSize()">
68
+            <div class="red-hint">建议上传105*64尺寸的图片</div>
66 69
             <el-upload
67 70
               class="avatar-uploader"
68 71
               action='string'
72
+              :before-upload="toolClass.beforeUpload"
69 73
               :http-request="toolClass.upload"
70 74
               :show-file-list="false"
71 75
               :on-success="handleDetailImgSuccess">
@@ -203,7 +207,7 @@
203 207
 </template>
204 208
 
205 209
 <script>
206
-import { createNamespacedHelpers, mapState } from 'vuex'
210
+import { createNamespacedHelpers, mapState, mapActions } from 'vuex'
207 211
 
208 212
 const { mapState: mapCaseState, mapActions: mapCaseActions } = createNamespacedHelpers('cmscase')
209 213
 const { mapState: mapCourseState, mapActions: mapCourseActions } = createNamespacedHelpers('course')
@@ -276,10 +280,17 @@ export default {
276 280
     ...mapCourseActions([
277 281
       'GetCourseList',
278 282
     ]),
283
+    ...mapActions(['picSize']),
279 284
     caseChange () {
280 285
       this.selCourseList = []
281 286
       this.detail.Courses = []
282 287
     },
288
+    pictSize () {
289
+      this.picSize({ w: 704, h: 208 })
290
+    },
291
+    descSize () {
292
+      this.picSize({ w: 105, h: 64 })
293
+    },
283 294
     checkFn (arr) {
284 295
       for (var n = 0; n < arr.length; n++) {
285 296
         if (arr[n].type === 'isNull' && !arr[n].target) {

+ 4
- 1
src/pages/system/cmsManager/newsManager/add.vue 查看文件

@@ -77,9 +77,11 @@
77 77
         <li class="flex-h">
78 78
           <span>图片:<em>*</em></span>
79 79
           <div class="flex-item">
80
+            <div class="red-hint">建议上传172*106尺寸的图片</div>
80 81
             <el-upload
81 82
               class="avatar-uploader"
82 83
               action='string'
84
+              :before-upload="toolClass.beforeUpload"
83 85
               :http-request="toolClass.upload"
84 86
               :show-file-list="false"
85 87
               :on-success="handleAvatarSuccess">
@@ -125,6 +127,7 @@ export default {
125 127
   },
126 128
   components: {},
127 129
   created () {
130
+    this.picSize({ w: 172, h: 106 })
128 131
     this.updateSystemInfo().then(() => {
129 132
       this.postData.OrgId = this.OrgId
130 133
       this.postData.CaseId = this.CaseId
@@ -147,7 +150,7 @@ export default {
147 150
     ...mapCourseActions([
148 151
       'GetCourseList',
149 152
     ]),
150
-    ...mapActions(['updateSystemInfo']),
153
+    ...mapActions(['updateSystemInfo', 'picSize']),
151 154
     ...mapCmsActions([
152 155
       'updateLocationAllInfo',
153 156
     ]),

+ 5
- 1
src/pages/system/cmsManager/newsManager/edit.vue 查看文件

@@ -77,9 +77,11 @@
77 77
         <li class="flex-h">
78 78
           <span>图片:<em>*</em></span>
79 79
           <div class="flex-item">
80
+            <div class="red-hint">建议上传172*106尺寸的图片</div>
80 81
             <el-upload
81 82
               class="avatar-uploader"
82 83
               action='string'
84
+              :before-upload="toolClass.beforeUpload"
83 85
               :http-request="toolClass.upload"
84 86
               :show-file-list="false"
85 87
               :on-success="handleAvatarSuccess">
@@ -98,7 +100,7 @@
98 100
 </template>
99 101
 
100 102
 <script>
101
-import { mapState, createNamespacedHelpers } from 'vuex'
103
+import { mapState, mapActions, createNamespacedHelpers } from 'vuex'
102 104
 const { mapActions: mapCmsActions } = createNamespacedHelpers('cms')
103 105
 const { mapState: mapCourseState, mapActions: mapCourseActions } = createNamespacedHelpers('course')
104 106
 export default {
@@ -124,6 +126,7 @@ export default {
124 126
   },
125 127
   components: {},
126 128
   created () {
129
+    this.picSize({ w: 172, h: 106 })
127 130
     this.updateLocationAllInfo().then(() => {
128 131
       this.getDetail()
129 132
       this.GetCourseList({ page: 1, pagesize: 10000 })
@@ -141,6 +144,7 @@ export default {
141 144
     ...mapCourseActions([
142 145
       'GetCourseList',
143 146
     ]),
147
+    ...mapActions(['picSize']),
144 148
     ...mapCmsActions(['updateLocationAllInfo']),
145 149
     submit () {
146 150
       if (this.postData.ForwardType === 'url') {

+ 5
- 1
src/pages/system/courseManager/courseList/add.vue 查看文件

@@ -5,10 +5,12 @@
5 5
         <li class="flex-h">
6 6
           <span>课程主图:<em>*</em></span>
7 7
           <div class="flex-item">
8
+            <div class="red-hint">建议上传750*960尺寸的图片</div>
8 9
             <div>
9 10
               <el-upload
10 11
                 class="avatar-uploader"
11 12
                 action='string'
13
+                :before-upload="toolClass.beforeUpload"
12 14
                 :http-request="toolClass.upload"
13 15
                 :show-file-list="false"
14 16
                 :on-success="handleAvatarSuccess">
@@ -209,7 +211,7 @@
209 211
 </template>
210 212
 
211 213
 <script>
212
-import { createNamespacedHelpers, mapState } from 'vuex'
214
+import { createNamespacedHelpers, mapState, mapActions } from 'vuex'
213 215
 
214 216
 const { mapState: mapCourseState, mapActions: mapCourseActions } = createNamespacedHelpers('course')
215 217
 const { mapState: mapLocationState, mapActions: mapLocationActions } = createNamespacedHelpers('cms')
@@ -288,6 +290,7 @@ export default {
288 290
     ...mapTagActions([
289 291
       'GetCourseTagList',
290 292
     ]),
293
+    ...mapActions(['picSize']),
291 294
     handleAvatarSuccess (res, file) {
292 295
       this.UpdateInfo({ ...this.detail, CourseImg: res.result.url })
293 296
     },
@@ -386,6 +389,7 @@ export default {
386 389
     }
387 390
   },
388 391
   mounted () {
392
+    this.picSize({ w: 750, h: 960 })
389 393
     this.updateLocationInfo({issys: 0})
390 394
     this.GetCourseTagList({ pagesize: 100 })
391 395
     const { id } = this.$route.query

+ 28
- 0
src/pages/system/dataStatistics/goodsOrderList/index.vue 查看文件

@@ -23,6 +23,16 @@
23 23
               </el-option>
24 24
             </el-select>
25 25
           </li>
26
+          <li>
27
+            <el-select v-model="postData.paytype" placeholder="请选择下单支付方式">
28
+              <el-option
29
+                v-for="item in paytype"
30
+                :key="item.id"
31
+                :label="item.value"
32
+                :value="item.id">
33
+              </el-option>
34
+            </el-select>
35
+          </li>
26 36
           <li>
27 37
             <el-select v-model="postData.status" placeholder="请选择订单状态">
28 38
               <el-option
@@ -71,6 +81,7 @@
71 81
               <span>案场:{{returnListItem(goodsOrderList, index).CaseName}}</span>
72 82
               <span>用户类型:{{returnListItem(goodsOrderList, index).UserType === 'sales' ? '销售' : returnListItem(goodsOrderList, index).UserType === 'manager' ? '主管' : '用户'}}</span>
73 83
               <span>下单时间:{{toolClass.dateFormat(returnListItem(goodsOrderList, index).CreateDate)}}</span>
84
+              <span>支付方式:{{returnListItem(goodsOrderList, index).PayTypeStr}}</span>
74 85
             </div>
75 86
             <span>{{returnStatus(returnListItem(goodsOrderList, index).MakeStatus)}}</span>
76 87
           </div>
@@ -146,6 +157,7 @@ export default {
146 157
         usertype: '', // 用户类型
147 158
         begindate: '', // 起始日期
148 159
         enddate: '', // 截止日期
160
+        paytype: '', // 支付方式
149 161
         page: 1, // 当前页码
150 162
         pagesize: 10, // 请求数据量
151 163
       },
@@ -162,6 +174,22 @@ export default {
162 174
         value: '用户',
163 175
         id: 'customer'
164 176
       }],
177
+      paytype: [{
178
+        value: '',
179
+        id: ''
180
+      }, {
181
+        value: '城币',
182
+        id: 'cheng-coin'
183
+      }, {
184
+        value: '优惠券',
185
+        id: 'coupon'
186
+      }, {
187
+        value: '案场',
188
+        id: 'sys user'
189
+      }, {
190
+        value: '积分',
191
+        id: 'points'
192
+      }],
165 193
       statusList: [{
166 194
         value: '',
167 195
         id: ''

+ 7
- 1
src/pages/system/goodsManager/goodManager/edit.vue 查看文件

@@ -32,10 +32,12 @@
32 32
         <li class="flex-h">
33 33
           <span>商品图片:<em>*</em></span>
34 34
           <div class="flex-item">
35
+            <div class="red-hint">建议上传150*150尺寸的图片</div>
35 36
             <div style="width:50%">
36 37
               <el-upload
37 38
                 class="avatar-uploader"
38 39
                 action='string'
40
+                :before-upload="toolClass.beforeUpload"
39 41
                 :http-request="toolClass.upload"
40 42
                 :show-file-list="false"
41 43
                 :on-success="handleAvatarSuccess">
@@ -97,7 +99,7 @@
97 99
 </template>
98 100
 
99 101
 <script>
100
-import { createNamespacedHelpers, mapState } from 'vuex'
102
+import { createNamespacedHelpers, mapState, mapActions } from 'vuex'
101 103
 
102 104
 const { mapState: mapGoodsState, mapActions: mapGoodsActions } = createNamespacedHelpers('goods')
103 105
 export default {
@@ -163,6 +165,9 @@ export default {
163 165
       'UpdateInfo',
164 166
       'GetGoodSpecs',
165 167
     ]),
168
+    ...mapActions([
169
+      'picSize'
170
+    ]),
166 171
     submit () {
167 172
       this.detail.specs = JSON.stringify(this.detailSpecs.map(x => ({ SpecId: x, GoodsPrice: this.detail.Price })))
168 173
       this.detail.images = (this.detail.Images || []).map(x => {
@@ -234,6 +239,7 @@ export default {
234 239
     },
235 240
   },
236 241
   created () {
242
+    this.picSize({ w: 150, h: 150 })
237 243
     const { id } = this.$route.query
238 244
     if (id && id !== '') {
239 245
       this.GetGoodTypes({ pagesize: 1000, caseid: this.Case })

+ 1
- 0
src/pages/system/newOrder/newOrderList/index.vue 查看文件

@@ -313,6 +313,7 @@ export default {
313 313
         this.websockets[wsRealPath].onopen = console.log
314 314
         this.websockets[wsRealPath].onmessage = this.websocketonmessage
315 315
         this.websockets[wsRealPath].onclose = this.reloadWebSocket
316
+        this.websockets[wsRealPath].onerror = this.reloadWebSocket
316 317
         this.websockets[wsRealPath].interval = setInterval(() => this.websockets[wsRealPath].send(10), 120000)
317 318
       }
318 319
     },

+ 11
- 1
src/store/app.js 查看文件

@@ -59,6 +59,10 @@ export default {
59 59
     roles: [],
60 60
     user: {},
61 61
     clientUrl: '',
62
+    picSize: {
63
+      w: 0,
64
+      height: 0
65
+    }
62 66
   },
63 67
   mutations: {
64 68
     init (state, data) { // 这里的state对应着上面这个state
@@ -94,7 +98,10 @@ export default {
94 98
       // 获取 面包屑
95 99
       if (currentRoute) state.breadcrumb = currentRoute.parent.slice(1).concat(currentRoute)
96 100
       // console.log(state.breadcrumb)
97
-    }
101
+    },
102
+    setPicSize (state, data) { // 设置图片尺寸限制
103
+      state.picSize = data
104
+    },
98 105
   },
99 106
   actions: {
100 107
     updateSystemInfo (context) { // 这里的context和我们使用的$store拥有相同的对象和方法
@@ -106,6 +113,9 @@ export default {
106 113
           resolve()
107 114
         })
108 115
       })
116
+    },
117
+    picSize (context, data) {
118
+      context.commit('setPicSize', data)
109 119
     }
110 120
   }
111 121
 }

+ 4
- 0
src/style/main.css 查看文件

@@ -409,6 +409,10 @@ select:focus {
409 409
   color: #ccc;
410 410
 }
411 411
 
412
+.red-hint{
413
+  min-height: 25px !important;
414
+  color: red;
415
+}
412 416
 
413 417
 
414 418
 

+ 39
- 0
src/util/util.js 查看文件

@@ -1,5 +1,7 @@
1 1
 import Ajax from './ajax'
2 2
 import api from './api'
3
+// import { Message } from 'element-ui'
4
+// import store from '../store'
3 5
 const toolClass = {
4 6
   dateFormat: (timestamp, fmt) => {
5 7
     if (!fmt) {
@@ -43,6 +45,43 @@ const toolClass = {
43 45
         resolve(result)
44 46
       }).catch(reject)
45 47
     })
48
+  },
49
+  beforeUpload (file) {
50
+    return true
51
+    // return new Promise((resolve, reject) => {
52
+    //   let w = store.state.app.picSize.w
53
+    //   let h = store.state.app.picSize.h
54
+    //   if ('image'.indexOf(file.type) > -1) {
55
+    //     Message({
56
+    //       type: 'error',
57
+    //       message: `请上传${w}像素*${h}像素尺寸的图片`
58
+    //     })
59
+    //     reject(new Error('error'))
60
+    //   }
61
+    //   var reader = new FileReader()
62
+    //   reader.onload = function (e) {
63
+    //     var data = e.target.result
64
+    //     // 加载图片获取图片真实宽度和高度
65
+    //     var image = new Image()
66
+    //     image.onload = function () {
67
+    //       var width = image.width
68
+    //       var height = image.height
69
+    //       console.log(width)
70
+    //       console.log(height)
71
+    //       if (width === w && height === h) {
72
+    //         resolve()
73
+    //       } else {
74
+    //         Message({
75
+    //           type: 'error',
76
+    //           message: `请上传${w}像素*${h}像素尺寸的图片`
77
+    //         })
78
+    //         reject(new Error('error'))
79
+    //       }
80
+    //     }
81
+    //     image.src = data
82
+    //   }
83
+    //   reader.readAsDataURL(file)
84
+    // })
46 85
   }
47 86
 }
48 87