yuantianjiao 6 år sedan
förälder
incheckning
5fc2ca4620

+ 1
- 1
config/index.js Visa fil

@@ -15,7 +15,7 @@ module.exports = {
15 15
         // target: 'http://192.168.0.62:8080', //wf
16 16
         // target: 'http://127.0.0.1:8080', 
17 17
         // target: 'http://192.168.0.11:8080', //ys
18
-        // target: 'http://192.168.0.125:8080', //hyq
18
+        // target: 'http://192.168.0.102:8080', //hyq
19 19
         target: 'http://dev.ycjcjy.com', //frp
20 20
         changeOrigin: true, // 如果接口跨域,需要进行这个参数配置
21 21
         // pathRewrite: {

+ 11
- 3
src/pages/system/caseManager/caseAreaManager/add.vue Visa fil

@@ -38,6 +38,7 @@
38 38
               <el-upload
39 39
                 class="avatar-uploader"
40 40
                 action='string'
41
+                :before-upload="toolClass.beforeUpload"
41 42
                 :http-request="toolClass.upload"
42 43
                 :show-file-list="false"
43 44
                 :on-success="handleAvatarSuccess">
@@ -54,6 +55,7 @@
54 55
               <el-upload
55 56
                 class="avatar-uploader"
56 57
                 action='string'
58
+                :before-upload="toolClass.beforeUpload"
57 59
                 :http-request="toolClass.upload"
58 60
                 :show-file-list="false"
59 61
                 :on-success="handleAvatarSuccesser">
@@ -73,7 +75,7 @@
73 75
 </template>
74 76
 
75 77
 <script>
76
-import { mapState } from 'vuex'
78
+import { mapState, mapActions } from 'vuex'
77 79
 
78 80
 export default {
79 81
   name: '',
@@ -105,7 +107,13 @@ export default {
105 107
     }
106 108
   },
107 109
   components: {},
110
+  created () {
111
+    this.picSize({ w: 30, h: 30 })
112
+  },
108 113
   methods: {
114
+    ...mapActions([
115
+      'picSize'
116
+    ]),
109 117
     handleAvatarSuccesser (res, file) {
110 118
       this.postData.AreaIconWhite = res.result.url
111 119
     },
@@ -150,11 +158,11 @@ export default {
150 158
           type: 'success',
151 159
           message: '操作成功!'
152 160
         })
153
-        this.$router.push({name: 'caseAreaManager'})
161
+        this.$router.push({ name: 'caseAreaManager' })
154 162
       })
155 163
     },
156 164
     cancel () {
157
-      this.$router.push({name: 'caseAreaManager'})
165
+      this.$router.push({ name: 'caseAreaManager' })
158 166
     }
159 167
   },
160 168
   mounted () { }

+ 7
- 1
src/pages/system/caseManager/caseAreaManager/edit.vue Visa fil

@@ -38,6 +38,7 @@
38 38
               <el-upload
39 39
                 class="avatar-uploader"
40 40
                 action='string'
41
+                :before-upload="toolClass.beforeUpload"
41 42
                 :http-request="toolClass.upload"
42 43
                 :show-file-list="false"
43 44
                 :on-success="handleAvatarSuccess">
@@ -54,6 +55,7 @@
54 55
               <el-upload
55 56
                 class="avatar-uploader"
56 57
                 action='string'
58
+                :before-upload="toolClass.beforeUpload"
57 59
                 :http-request="toolClass.upload"
58 60
                 :show-file-list="false"
59 61
                 :on-success="handleAvatarSuccesser">
@@ -73,7 +75,7 @@
73 75
 </template>
74 76
 
75 77
 <script>
76
-import { mapState } from 'vuex'
78
+import { mapState, mapActions } from 'vuex'
77 79
 
78 80
 export default {
79 81
   name: '',
@@ -106,9 +108,13 @@ export default {
106 108
   },
107 109
   created () {
108 110
     this.getCaseAreaInfo()
111
+    this.picSize({ w: 30, h: 30 })
109 112
   },
110 113
   components: {},
111 114
   methods: {
115
+    ...mapActions([
116
+      'picSize'
117
+    ]),
112 118
     getCaseAreaInfo () { // 获取区域信息
113 119
       this.$ajax(this.$api.caseManager.getCaseAreaInfo.url, {
114 120
         method: this.$api.caseManager.getCaseAreaInfo.method,

+ 5
- 1
src/pages/system/caseManager/caseInfo/addCase/index.vue Visa fil

@@ -67,6 +67,7 @@
67 67
               <el-upload
68 68
                 class="avatar-uploader"
69 69
                 action='string'
70
+                :before-upload="toolClass.beforeUpload"
70 71
                 :http-request="toolClass.upload"
71 72
                 :show-file-list="false"
72 73
                 :on-success="handleAvatarSuccess">
@@ -158,10 +159,13 @@ export default {
158 159
       OrgId: x => x.app.user.OrgId,
159 160
     }),
160 161
   },
162
+  created () {
163
+    this.picSize({ w: 480, h: 300 })
164
+  },
161 165
   components: {},
162 166
   methods: {
163 167
     ...mapActions([
164
-      'updateSystemInfo'
168
+      'updateSystemInfo', 'picSize'
165 169
     ]),
166 170
     handleAvatarSuccess (res, file) {
167 171
       this.postData.CaseIcon = res.result.url

+ 3
- 1
src/pages/system/caseManager/caseInfo/editCase/index.vue Visa fil

@@ -63,6 +63,7 @@
63 63
               <el-upload
64 64
                 class="avatar-uploader"
65 65
                 action='string'
66
+                :before-upload="toolClass.beforeUpload"
66 67
                 :http-request="toolClass.upload"
67 68
                 :show-file-list="false"
68 69
                 :on-success="handleAvatarSuccess">
@@ -156,11 +157,12 @@ export default {
156 157
   },
157 158
   created () {
158 159
     this.getCaseInfoById()
160
+    this.picSize({ w: 480, h: 300 })
159 161
   },
160 162
   components: {},
161 163
   methods: {
162 164
     ...mapActions([
163
-      'updateSystemInfo'
165
+      'updateSystemInfo', 'picSize'
164 166
     ]),
165 167
     getCaseInfoById () { // 获取案场信息
166 168
       this.$ajax(this.$api.caseManager.getCaseInfo.url, {

+ 3
- 1
src/pages/system/cmsManager/bannerManager/add.vue Visa fil

@@ -80,6 +80,7 @@
80 80
             <el-upload
81 81
               class="avatar-uploader"
82 82
               action='string'
83
+              :before-upload="toolClass.beforeUpload"
83 84
               :http-request="toolClass.upload"
84 85
               :show-file-list="false"
85 86
               :on-success="handleAvatarSuccess">
@@ -131,6 +132,7 @@ export default {
131 132
     // imageUploader: () => import('@/components/upload')
132 133
   },
133 134
   created () {
135
+    this.picSize({ w: 650, h: 300 })
134 136
     this.GetCourseList({ page: 1, pagesize: 100 })
135 137
     this.updateLocationAllInfo()
136 138
     this.updateSystemInfo().then(() => {
@@ -153,7 +155,7 @@ export default {
153 155
       'GetCourseList',
154 156
     ]),
155 157
     ...mapCmsActions(['updateLocationAllInfo']),
156
-    ...mapActions(['updateSystemInfo']),
158
+    ...mapActions(['updateSystemInfo', 'picSize']),
157 159
     submit () {
158 160
       if (this.postData.ForwardType === 'url') {
159 161
         this.postData.ForwardResourceId = ''

+ 4
- 1
src/pages/system/cmsManager/bannerManager/edit.vue Visa fil

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

+ 12
- 3
src/pages/system/cmsManager/majorProjects/edit.vue Visa fil

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

+ 3
- 1
src/pages/system/cmsManager/newsManager/add.vue Visa fil

@@ -80,6 +80,7 @@
80 80
             <el-upload
81 81
               class="avatar-uploader"
82 82
               action='string'
83
+              :before-upload="toolClass.beforeUpload"
83 84
               :http-request="toolClass.upload"
84 85
               :show-file-list="false"
85 86
               :on-success="handleAvatarSuccess">
@@ -125,6 +126,7 @@ export default {
125 126
   },
126 127
   components: {},
127 128
   created () {
129
+    this.picSize({ w: 172, h: 106 })
128 130
     this.updateSystemInfo().then(() => {
129 131
       this.postData.OrgId = this.OrgId
130 132
       this.postData.CaseId = this.CaseId
@@ -147,7 +149,7 @@ export default {
147 149
     ...mapCourseActions([
148 150
       'GetCourseList',
149 151
     ]),
150
-    ...mapActions(['updateSystemInfo']),
152
+    ...mapActions(['updateSystemInfo', 'picSize']),
151 153
     ...mapCmsActions([
152 154
       'updateLocationAllInfo',
153 155
     ]),

+ 4
- 1
src/pages/system/cmsManager/newsManager/edit.vue Visa fil

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

+ 4
- 1
src/pages/system/courseManager/courseList/add.vue Visa fil

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

+ 28
- 0
src/pages/system/dataStatistics/goodsOrderList/index.vue Visa fil

@@ -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: ''

+ 6
- 1
src/pages/system/goodsManager/goodManager/edit.vue Visa fil

@@ -36,6 +36,7 @@
36 36
               <el-upload
37 37
                 class="avatar-uploader"
38 38
                 action='string'
39
+                :before-upload="toolClass.beforeUpload"
39 40
                 :http-request="toolClass.upload"
40 41
                 :show-file-list="false"
41 42
                 :on-success="handleAvatarSuccess">
@@ -97,7 +98,7 @@
97 98
 </template>
98 99
 
99 100
 <script>
100
-import { createNamespacedHelpers, mapState } from 'vuex'
101
+import { createNamespacedHelpers, mapState, mapActions } from 'vuex'
101 102
 
102 103
 const { mapState: mapGoodsState, mapActions: mapGoodsActions } = createNamespacedHelpers('goods')
103 104
 export default {
@@ -163,6 +164,9 @@ export default {
163 164
       'UpdateInfo',
164 165
       'GetGoodSpecs',
165 166
     ]),
167
+    ...mapActions([
168
+      'picSize'
169
+    ]),
166 170
     submit () {
167 171
       this.detail.specs = JSON.stringify(this.detailSpecs.map(x => ({ SpecId: x, GoodsPrice: this.detail.Price })))
168 172
       this.detail.images = (this.detail.Images || []).map(x => {
@@ -234,6 +238,7 @@ export default {
234 238
     },
235 239
   },
236 240
   created () {
241
+    this.picSize({ w: 150, h: 150 })
237 242
     const { id } = this.$route.query
238 243
     if (id && id !== '') {
239 244
       this.GetGoodTypes({ pagesize: 1000, caseid: this.Case })

+ 11
- 1
src/store/app.js Visa fil

@@ -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
 }

+ 38
- 0
src/util/util.js Visa fil

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