许成详 6 年之前
父節點
當前提交
96fad8915c

+ 1
- 1
src/pages/system/cardAndCouponManager/couponManager/edit.vue 查看文件

@@ -92,7 +92,7 @@
92 92
           <div class="flex-item">
93 93
             <div>
94 94
               <el-radio v-model="couponInfo.SendType" label="channel" :disabled="isEdit">渠道</el-radio>
95
-              <el-radio v-if="couponInfo.CouponType === 'course'" v-model="couponInfo.SendType" label="case" :disabled="isEdit">案场</el-radio>
95
+              <el-radio v-model="couponInfo.SendType" label="case" :disabled="isEdit">案场</el-radio>
96 96
               <el-radio v-model="couponInfo.SendType" label="system" :disabled="isEdit">系统</el-radio>
97 97
             </div>
98 98
           </div>

+ 627
- 139
src/pages/system/marketingActivities/listOfLotteryActivities/edit.vue
文件差異過大導致無法顯示
查看文件


+ 410
- 34
src/pages/system/marketingActivities/listOfLotteryActivities/index.vue 查看文件

@@ -9,9 +9,9 @@
9 9
           <li>
10 10
             <el-select v-model="CaseId" placeholder="请选择案场">
11 11
               <el-option
12
-                key="all"
13
-                label="所有案场"
14
-                value="all">
12
+                key=""
13
+                label="不限案场"
14
+                value="">
15 15
               </el-option>
16 16
               <el-option
17 17
                 v-for="item in cases"
@@ -22,12 +22,12 @@
22 22
             </el-select>
23 23
           </li>
24 24
           <li>
25
-            <el-select v-model="postData.state" placeholder="请选择状态">
25
+            <el-select v-model="postData.status" placeholder="请选择状态">
26 26
               <el-option
27
-                v-for="item in cases"
28
-                :key="item.CaseId"
29
-                :label="item.CaseName"
30
-                :value="item.CaseId">
27
+                v-for="item in statusList"
28
+                :key="item.id"
29
+                :label="item.value"
30
+                :value="item.id">
31 31
               </el-option>
32 32
             </el-select>
33 33
           </li>
@@ -41,7 +41,8 @@
41 41
         </ul>
42 42
         <el-button
43 43
           size="mini"
44
-          type="primary">搜索</el-button>
44
+          type="primary"
45
+          @click="searchList">搜索</el-button>
45 46
       </div>
46 47
       <div class="moreFilter"></div>
47 48
     </div>
@@ -50,33 +51,43 @@
50 51
           :data="tableData"
51 52
           style="width: 100%">
52 53
           <el-table-column
53
-            prop="CaseName"
54
+            prop="defaultCaseId"
54 55
             label="案场"
55 56
             width="180">
57
+            <template slot-scope="scope">
58
+              {{returnCaseName(scope.row.CaseId)}}
59
+            </template>
56 60
           </el-table-column>
57 61
           <el-table-column
58
-            prop="ActivityName"
62
+            prop="Name"
59 63
             label="活动名称">
60 64
           </el-table-column>
61 65
           <el-table-column
62
-            prop="StartDate"
66
+            prop="BeginDate"
63 67
             label="开始时间">
68
+            <template slot-scope="scope">
69
+              <span v-if="scope.row.BeginDate !== '0001-01-01T00:00:00Z'">{{toolClass.dateFormat(scope.row.BeginDate, 'yyyy-MM-dd')}}</span>
70
+              <span v-else>-</span>
71
+            </template>
64 72
           </el-table-column>
65 73
           <el-table-column
66 74
             prop="EndDate"
67 75
             label="结束时间">
76
+            <template slot-scope="scope">
77
+              <span v-if="scope.row.EndDate !== '0001-01-01T00:00:00Z'">{{toolClass.dateFormat(scope.row.EndDate, 'yyyy-MM-dd')}}</span>
78
+              <span v-else>-</span>
79
+            </template>
68 80
           </el-table-column>
69 81
           <el-table-column
70
-            prop="num"
82
+            prop="JoinedNum"
71 83
             label="已参与人数">
72 84
           </el-table-column>
73 85
           <el-table-column
74 86
             prop="Status"
75 87
             label="状态">
76
-          </el-table-column>
77
-          <el-table-column
78
-            prop="url"
79
-            label="活动链接">
88
+            <template slot-scope="scope">
89
+              {{scope.row.Status === 0 ? '已停用' : new Date(scope.row.EndDate).getTime() > new Date().getTime() && scope.row.Status === 1 ? '已启用' : '已结束'}}
90
+            </template>
80 91
           </el-table-column>
81 92
           <el-table-column
82 93
             prop="address"
@@ -84,49 +95,237 @@
84 95
             width="200">
85 96
             <template slot-scope="scope">
86 97
               <el-button
98
+                v-if="scope.row.Status === 0"
99
+                @click="deleteActivityItem(scope.row.Id)"
87 100
                 size="mini"
88 101
                 type="danger">删除</el-button>
89 102
               <el-button
103
+                v-if="scope.row.Status === 1 && new Date(scope.row.EndDate).getTime() > new Date().getTime()"
90 104
                 size="mini"
91
-                type="warning">停用</el-button>
105
+                type="warning"
106
+                @click="toStopActivity(scope.row.Id)">停用</el-button>
92 107
               <el-button
108
+                v-if="scope.row.Status === 0"
93 109
                 size="mini"
94
-                type="success">启用</el-button>
110
+                type="success"
111
+                @click="toOpenActivity(scope.row.Id)">启用</el-button>
95 112
               <el-button
96 113
                 size="mini"
97
-                type="success">编辑</el-button>
114
+                type="success" @click="editActivity(scope.row.Id)">编辑</el-button>
98 115
               <el-button
99 116
                 size="mini"
100
-                type="success">分享记录</el-button>
117
+                type="success"
118
+                @click="getShareListInfo(scope.row.Id)">分享记录</el-button>
101 119
               <el-button
102 120
                 size="mini"
103
-                type="success">抽奖记录</el-button>
121
+                type="success"
122
+                @click="getRecordListInfo(scope.row.Id)">抽奖记录</el-button>
104 123
             </template>
105 124
           </el-table-column>
106 125
         </el-table>
107 126
     </div>
108
-    <el-pagination
109
-      @current-change="handleCurrentChange"
110
-      :current-page.sync="postData.page"
111
-      :page-size="postData.pagesize"
112
-      layout="prev, pager, next, jumper"
113
-      :total="total">
114
-    </el-pagination>
127
+    <div style="margin-bottom:20px;">
128
+      <el-pagination
129
+        @current-change="handleCurrentChange"
130
+        :current-page.sync="postData.page"
131
+        :page-size="postData.pagesize"
132
+        layout="prev, pager, next, jumper"
133
+        :total="total">
134
+      </el-pagination>
135
+    </div>
136
+    <el-dialog
137
+      title="分享记录"
138
+      :visible.sync="showShareList"
139
+      width="1000px"
140
+      @closed="emptyShareList"
141
+      center>
142
+      <div class="popupSearch">
143
+        <div style="width:200px;">
144
+          <el-input
145
+            placeholder="请输入手机号"
146
+            v-model="sharePostData.tel"
147
+            clearable>
148
+          </el-input>
149
+        </div>
150
+        <el-button
151
+          type="primary"
152
+          @click="searchShareList">搜索</el-button>
153
+      </div>
154
+      <div style="border:1px solid #eee;border-bottom:none;margin-top:20px;">
155
+        <el-table
156
+          :data="shareList"
157
+          style="width: 100%">
158
+          <el-table-column
159
+            prop="CaseId"
160
+            label="案场"
161
+            width="180">
162
+            <template slot-scope="scope">
163
+              {{returnCaseName(scope.row.CaseId)}}
164
+            </template>
165
+          </el-table-column>
166
+          <el-table-column
167
+            prop="FromCustomerName"
168
+            label="用户昵称">
169
+          </el-table-column>
170
+          <el-table-column
171
+            prop="FromCustomerWxname"
172
+            label="用户姓名">
173
+          </el-table-column>
174
+          <el-table-column
175
+            prop="FromCustomerTel"
176
+            label="手机号">
177
+          </el-table-column>
178
+          <el-table-column
179
+            prop="ToCustomerWxname"
180
+            label="被分享用户昵称">
181
+          </el-table-column>
182
+          <el-table-column
183
+            prop="ToCustomerName"
184
+            label="被分享用户姓名">
185
+          </el-table-column>
186
+          <el-table-column
187
+            prop="ToCustomerTel"
188
+            label="被分享用户手机号">
189
+          </el-table-column>
190
+          <el-table-column
191
+            prop="CreateDate"
192
+            label="分享时间">
193
+            <template slot-scope="scope">
194
+              <span v-if="scope.row.CreateDate !== '0001-01-01T00:00:00Z'">{{toolClass.dateFormat(scope.row.CreateDate, 'yyyy-MM-dd')}}</span>
195
+              <span v-else>-</span>
196
+            </template>
197
+          </el-table-column>
198
+        </el-table>
199
+      </div>
200
+      <div style="padding-bottom:20px;">
201
+        <el-pagination
202
+          @current-change="cutSharePage"
203
+          :current-page.sync="sharePostData.page"
204
+          :page-size="sharePostData.pagesize"
205
+          layout="prev, pager, next, jumper"
206
+          :total="shareTotal">
207
+        </el-pagination>
208
+      </div>
209
+    </el-dialog>
210
+    <el-dialog
211
+      title="抽奖记录"
212
+      :visible.sync="showRecordsList"
213
+      width="1000px"
214
+      @closed="emptyRecordsList"
215
+      center>
216
+      <div class="popupSearch">
217
+        <div style="width:200px;">
218
+          <el-input
219
+            placeholder="请输入手机号"
220
+            v-model="recordsPostData.tel"
221
+            clearable>
222
+          </el-input>
223
+        </div>
224
+        <el-button
225
+          type="primary"
226
+          @click="searchRecordList">搜索</el-button>
227
+      </div>
228
+      <div style="border:1px solid #eee;border-bottom:none;margin-top:20px;">
229
+        <el-table
230
+          :data="recordsList"
231
+          style="width: 100%">
232
+          <el-table-column
233
+            prop="UserName"
234
+            label="姓名">
235
+          </el-table-column>
236
+          <el-table-column
237
+            prop="CustomerName"
238
+            label="微信昵称">
239
+          </el-table-column>
240
+          <el-table-column
241
+            prop="Phone"
242
+            label="手机号">
243
+          </el-table-column>
244
+          <el-table-column
245
+            prop="PrizeName"
246
+            label="获取奖品">
247
+          </el-table-column>
248
+          <el-table-column
249
+            prop="CreateDate"
250
+            label="获取时间">
251
+            <template slot-scope="scope">
252
+              <span v-if="scope.row.CreateDate !== '0001-01-01T00:00:00Z'">{{toolClass.dateFormat(scope.row.CreateDate, 'yyyy-MM-dd')}}</span>
253
+              <span v-else>-</span>
254
+            </template>
255
+          </el-table-column>
256
+          <el-table-column
257
+            prop="WriteoffDate"
258
+            label="核销时间">
259
+            <template slot-scope="scope">
260
+              <span v-if="scope.row.WriteoffDate !== '0001-01-01T00:00:00Z'">{{toolClass.dateFormat(scope.row.WriteoffDate, 'yyyy-MM-dd')}}</span>
261
+              <span v-else>-</span>
262
+            </template>
263
+          </el-table-column>
264
+          <el-table-column
265
+            prop="Status"
266
+            label="状态">
267
+            <template slot-scope="scope">
268
+              {{scope.row.Status === '0' ? '未核销' : '已核销'}}
269
+            </template>
270
+          </el-table-column>
271
+        </el-table>
272
+      </div>
273
+      <div style="padding-bottom:20px;">
274
+        <el-pagination
275
+          @current-change="cutReocrdPage"
276
+          :current-page.sync="recordsPostData.page"
277
+          :page-size="recordsPostData.pagesize"
278
+          layout="prev, pager, next, jumper"
279
+          :total="recordsTotal">
280
+        </el-pagination>
281
+      </div>
282
+    </el-dialog>
115 283
   </div>
116 284
 </template>
117 285
 <script>
118
-import { mapState } from 'vuex'
286
+import { mapState, createNamespacedHelpers } from 'vuex'
287
+const { mapActions: mapActivityLuckDrawActions } = createNamespacedHelpers('activityLuckDraw')
119 288
 export default {
120 289
   data () {
121 290
     return {
291
+      showShareList: false,
292
+      showRecordsList: false,
293
+      statusList: [{
294
+        id: '',
295
+        value: '不限状态'
296
+      }, {
297
+        id: '0',
298
+        value: '已停用'
299
+      }, {
300
+        id: '1',
301
+        value: '已启用'
302
+      }, {
303
+        id: '9',
304
+        value: '已结束'
305
+      }],
122 306
       tableData: [],
123
-      postData: { // 表格搜索条件 //caseid: '', // 案场id
307
+      postData: {
308
+        caseid: '', // 案场id
124 309
         page: 1, // 当前页码
125
-        pageSize: 10, // 请求数据量
310
+        pagesize: 10, // 请求数据量
126 311
         name: '', // 活动名称
127
-        state: '', // 状态
312
+        status: '', // 状态
128 313
       },
129
-      total: 0 // 数据条数
314
+      total: 0, // 数据条数
315
+      recordsPostData: {
316
+        page: 1, // 当前页码
317
+        pagesize: 5, // 请求数据量
318
+        tel: '', // 电话号码
319
+      },
320
+      recordsTotal: 0, // 数据条数
321
+      recordsList: [], // 抽奖记录
322
+      sharePostData: {
323
+        page: 1, // 当前页码
324
+        pagesize: 5, // 请求数据量
325
+        tel: '', // 电话号码
326
+      },
327
+      shareTotal: 0, // 数据条数
328
+      shareList: [], // 分享记录
130 329
     }
131 330
   },
132 331
   computed: {
@@ -147,18 +346,181 @@ export default {
147 346
     this.getList()
148 347
   },
149 348
   methods: {
349
+    ...mapActivityLuckDrawActions([
350
+      'getLuckdrawList',
351
+      'getRecordsList',
352
+      'getShareList',
353
+      'deleteLuckdraw',
354
+      'openActivity',
355
+      'stopActivity',
356
+    ]),
357
+    toOpenActivity (id) { // 开启活动
358
+      this.$confirm('确认开启此活动?', '提示', {
359
+        confirmButtonText: '确定',
360
+        cancelButtonText: '取消',
361
+        type: 'warning'
362
+      }).then(() => {
363
+        this.openActivity(id).then(() => {
364
+          this.getList()
365
+          this.$message({
366
+            type: 'success',
367
+            message: '操作成功!'
368
+          })
369
+        })
370
+      }).catch(() => {
371
+        this.$message({
372
+          type: 'info',
373
+          message: '已取消操作'
374
+        })
375
+      })
376
+    },
377
+    toStopActivity (id) { // 停用活动
378
+      this.$confirm('确认停用此活动?', '提示', {
379
+        confirmButtonText: '确定',
380
+        cancelButtonText: '取消',
381
+        type: 'warning'
382
+      }).then(() => {
383
+        this.stopActivity(id).then(() => {
384
+          this.getList()
385
+          this.$message({
386
+            type: 'success',
387
+            message: '操作成功!'
388
+          })
389
+        })
390
+      }).catch(() => {
391
+        this.$message({
392
+          type: 'info',
393
+          message: '已取消操作'
394
+        })
395
+      })
396
+    },
397
+    deleteActivityItem (id) { // 删除活动
398
+      this.$confirm('确认删除此活动?', '提示', {
399
+        confirmButtonText: '确定',
400
+        cancelButtonText: '取消',
401
+        type: 'warning'
402
+      }).then(() => {
403
+        this.deleteLuckdraw(id).then(() => {
404
+          this.getList()
405
+          this.$message({
406
+            type: 'success',
407
+            message: '删除成功!'
408
+          })
409
+        })
410
+      }).catch(() => {
411
+        this.$message({
412
+          type: 'info',
413
+          message: '已取消删除'
414
+        })
415
+      })
416
+    },
417
+    emptyRecordsList () {
418
+      this.recordsList = []
419
+      this.recordsPostData.page = 1
420
+      this.recordsPostData.tel = ''
421
+      this.recordsTotal = 1
422
+    },
423
+    emptyShareList () {
424
+      this.shareList = []
425
+      this.sharePostData.page = 1
426
+      this.sharePostData.tel = ''
427
+      this.shareTotal = 1
428
+    },
429
+    searchRecordList () { // 搜索抽奖记录列表
430
+      this.recordsPostData.page = 1
431
+      this.recordsTotal = 1
432
+      this.toGetRecordList()
433
+    },
434
+    searchShareList () { // 搜索分享记录列表
435
+      this.sharePostData.page = 1
436
+      this.shareTotal = 1
437
+      this.toGetShareList()
438
+    },
439
+    getShareListInfo (id) { // 获取分享记录列表
440
+      this.currentShareId = id
441
+      this.sharePostData.page = 1
442
+      this.shareTotal = 1
443
+      this.showShareList = true
444
+      this.toGetShareList()
445
+    },
446
+    toGetShareList () { // 获取分享记录
447
+      this.getShareList({
448
+        id: this.currentShareId,
449
+        payload: this.sharePostData
450
+      }).then((res) => {
451
+        // console.log(JSON.stringify(res))
452
+        this.shareList = []
453
+        this.shareList = res.list
454
+        this.sharePostData.page = res.page
455
+        this.shareTotal = res.pagenum
456
+      })
457
+    },
458
+    getRecordListInfo (id) { // 获取抽奖记录列表
459
+      this.currentRecordId = id
460
+      this.recordsPostData.page = 1
461
+      this.recordsTotal = 1
462
+      this.showRecordsList = true
463
+      this.toGetRecordList()
464
+    },
465
+    toGetRecordList () { // 获取抽奖记录
466
+      this.getRecordsList({
467
+        id: this.currentRecordId,
468
+        payload: this.recordsPostData
469
+      }).then((res) => {
470
+        console.log(JSON.stringify(res))
471
+        this.recordsList = []
472
+        this.recordsList = res.list
473
+        this.recordsPostData.page = res.page
474
+        this.recordsTotal = res.pagenum
475
+      })
476
+    },
477
+    editActivity (id) {
478
+      this.$router.push({
479
+        name: 'editLotteryActivities',
480
+        query: {
481
+          id,
482
+        }
483
+      })
484
+    },
150 485
     handleCurrentChange (val) {
151 486
       this.$data.postData.page = val
152 487
       this.getList()
153 488
     },
489
+    cutSharePage (val) { // 分享记录分页切换
490
+      this.$data.sharePostData.page = val
491
+      this.toGetShareList()
492
+    },
493
+    cutReocrdPage (val) { // 分享抽奖分页切换
494
+      this.$data.recordsPostData.page = val
495
+      this.toGetRecordList()
496
+    },
154 497
     redirection (pathName) { // 重定向
155 498
       this.$router.push({ name: pathName })
156 499
     },
157 500
     getList () { // 获取数据列表
501
+      this.getLuckdrawList({
502
+        ...this.postData
503
+      }).then((res) => {
504
+        this.tableData = res.list
505
+        this.postData.page = res.page
506
+        this.total = res.pagenum
507
+      })
508
+    },
509
+    returnCaseName (id) {
510
+      for (var n = 0; n < this.cases.length; n++) {
511
+        if (id === this.cases[n].CaseId) {
512
+          return this.cases[n].CaseName
513
+        }
514
+      }
158 515
     },
159 516
     addLotteryActivities () {
160 517
       this.$router.push({ name: 'addLotteryActivities' })
161 518
     },
519
+    searchList () {
520
+      this.postData.page = 1
521
+      this.total = 1
522
+      this.getList()
523
+    },
162 524
   },
163 525
 }
164 526
 </script>
@@ -166,4 +528,18 @@ export default {
166 528
 <!-- Add "scoped" attribute to limit CSS to this component only -->
167 529
 <style lang="scss" scoped>
168 530
 @import "page.scss";
531
+table {
532
+  button {
533
+    margin-bottom: 10px;
534
+  }
535
+}
536
+.popupSearch {
537
+  width: 100%;
538
+  text-align: right;
539
+  font-size: 0;
540
+  & > * {
541
+    display: inline-block;
542
+    margin-left: 10px;
543
+  }
544
+}
169 545
 </style>

+ 26
- 0
src/pages/system/marketingActivities/listOfLotteryActivities/page.scss 查看文件

@@ -40,4 +40,30 @@
40 40
       }
41 41
     }
42 42
   }
43
+  .drawTemplateItem{
44
+    width: 120px;
45
+    display: inline-block;
46
+    margin: 0 20px 20px 0;
47
+    position: relative;
48
+    overflow: hidden;
49
+    text-align: center;
50
+    vertical-align: top;
51
+    &>a{
52
+      width: 100%;
53
+      height: 120px;
54
+      display: inline-block;
55
+      position: relative;
56
+      overflow: hidden;
57
+      border: 1px dashed #ccc;
58
+      box-sizing: border-box;
59
+      &.active{
60
+        border-color: #409EFF;
61
+      }
62
+    }
63
+  }
64
+  .addPrizeForm{
65
+    li{
66
+      width: 100%;
67
+    }
68
+  }
43 69
 }

+ 5
- 2
src/pages/system/marketingActivities/snapUpList/edit.vue 查看文件

@@ -124,7 +124,7 @@
124 124
                   type="primary">保存</el-button>
125 125
                 <el-button
126 126
                   size="mini"
127
-                  type="danger">取消</el-button>
127
+                  type="danger" @click="reback">取消</el-button>
128 128
               </li>
129 129
             </ul>
130 130
           </div>
@@ -190,6 +190,9 @@ export default {
190 190
   mounted () {
191 191
   },
192 192
   methods: {
193
+    reback () {
194
+      this.$router.push({name: 'snapUpList'})
195
+    },
193 196
   },
194 197
 }
195 198
 </script>
@@ -197,7 +200,7 @@ export default {
197 200
 <!-- Add "scoped" attribute to limit CSS to this component only -->
198 201
 <style lang="scss" scoped>
199 202
 @import "page.scss";
200
-h1{
203
+h1 {
201 204
   line-height: 40px;
202 205
   font-size: 16px;
203 206
 }

+ 135
- 0
src/store/activityManager/luckDraw.js 查看文件

@@ -0,0 +1,135 @@
1
+import ajax from '../../util/ajax'
2
+import api from '../../util/api'
3
+
4
+export default {
5
+  namespaced: true,
6
+  state: {
7
+    luckDrawList: [],
8
+  },
9
+  mutations: {
10
+    updateLuckDrawList (state, payload) {
11
+      state.luckDrawList = payload || []
12
+    },
13
+  },
14
+  actions: {
15
+    getLuckdrawList ({ commit }, payload) { // 获取抽奖活动列表
16
+      return new Promise((resolve, reject) => {
17
+        ajax(api.activityManager.luckdrawList.url, {
18
+          method: api.activityManager.luckdrawList.method,
19
+          queryData: {
20
+            ...payload,
21
+          }
22
+        }).then(res => {
23
+          commit('updateLuckDrawList', res)
24
+          resolve(res)
25
+        }).catch(reject)
26
+      })
27
+    },
28
+    getLuckdrawById ({ commit }, id) { // 获取抽奖活动详情
29
+      return new Promise((resolve, reject) => {
30
+        ajax(api.activityManager.luckdrawInfoById.url, {
31
+          method: api.activityManager.luckdrawInfoById.method,
32
+          urlData: {
33
+            id,
34
+          }
35
+        }).then(res => {
36
+          resolve(res)
37
+        }).catch(reject)
38
+      })
39
+    },
40
+    addLuckdraw ({ commit }, payload) { // 新增抽奖活动
41
+      return new Promise((resolve, reject) => {
42
+        ajax(api.activityManager.addLuckdraw.url, {
43
+          method: api.activityManager.addLuckdraw.method,
44
+          data: { info: JSON.stringify(payload) },
45
+        }).then(res => {
46
+          resolve(res)
47
+        }).catch(reject)
48
+      })
49
+    },
50
+    editLuckdraw ({ commit }, payload) { // 编辑抽奖活动
51
+      return new Promise((resolve, reject) => {
52
+        ajax(api.activityManager.editLuckdraw.url, {
53
+          method: api.activityManager.editLuckdraw.method,
54
+          urlData: {
55
+            id: payload.Id,
56
+          },
57
+          data: { info: JSON.stringify(payload) },
58
+        }).then(res => {
59
+          resolve(res)
60
+        }).catch(reject)
61
+      })
62
+    },
63
+    deleteLuckdraw ({ commit }, id) { // 删除抽奖活动
64
+      return new Promise((resolve, reject) => {
65
+        ajax(api.activityManager.deleteLuckdraw.url, {
66
+          method: api.activityManager.deleteLuckdraw.method,
67
+          urlData: {
68
+            id,
69
+          },
70
+        }).then(res => {
71
+          resolve(res)
72
+        }).catch(reject)
73
+      })
74
+    },
75
+    getDrawTemplateList () { // 获取抽奖活动模板
76
+      return new Promise((resolve, reject) => {
77
+        ajax(api.activityManager.getDrawTemplateList.url, {
78
+          method: api.activityManager.getDrawTemplateList.method,
79
+        }).then(res => {
80
+          resolve(res)
81
+        }).catch(reject)
82
+      })
83
+    },
84
+    getRecordsList ({ commit }, { id, payload }) { // 获取抽奖记录列表
85
+      return new Promise((resolve, reject) => {
86
+        ajax(api.activityManager.getRecordsList.url, {
87
+          method: api.activityManager.getRecordsList.method,
88
+          urlData: {
89
+            id,
90
+          },
91
+          queryData: { ...payload },
92
+        }).then(res => {
93
+          resolve(res)
94
+        }).catch(reject)
95
+      })
96
+    },
97
+    getShareList ({ commit }, { id, payload }) { // 获取分享记录列表
98
+      return new Promise((resolve, reject) => {
99
+        ajax(api.activityManager.getShareList.url, {
100
+          method: api.activityManager.getShareList.method,
101
+          urlData: {
102
+            id,
103
+          },
104
+          queryData: { ...payload },
105
+        }).then(res => {
106
+          resolve(res)
107
+        }).catch(reject)
108
+      })
109
+    },
110
+    openActivity ({ commit }, id) { // 开启抽奖活动
111
+      return new Promise((resolve, reject) => {
112
+        ajax(api.activityManager.openActivity.url, {
113
+          method: api.activityManager.openActivity.method,
114
+          urlData: {
115
+            id,
116
+          },
117
+        }).then(res => {
118
+          resolve(res)
119
+        }).catch(reject)
120
+      })
121
+    },
122
+    stopActivity ({ commit }, id) { // 停用抽奖活动
123
+      return new Promise((resolve, reject) => {
124
+        ajax(api.activityManager.stopActivity.url, {
125
+          method: api.activityManager.stopActivity.method,
126
+          urlData: {
127
+            id,
128
+          },
129
+        }).then(res => {
130
+          resolve(res)
131
+        }).catch(reject)
132
+      })
133
+    },
134
+  }
135
+}

+ 1
- 0
src/store/index.js 查看文件

@@ -38,6 +38,7 @@ export const modules = {
38 38
   sta: () => require('./sta/sta').default,
39 39
   health: () => require('./health/health').default,
40 40
   luckDraw: () => require('./luckDraw/luckDraw').default,
41
+  activityLuckDraw: () => require('./activityManager/luckDraw').default,
41 42
 }
42 43
 
43 44
 Object.keys(modules).forEach((modKey) => {

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

@@ -828,6 +828,48 @@ const $api = {
828 828
       url: `${baseUrl}${common}/luckdrawlist/share`
829 829
     }
830 830
   },
831
+  activityManager: {
832
+    luckdrawList: { // 营销活动-抽奖活动列表
833
+      method: 'get',
834
+      url: `${baseUrl}${common}/luckdraw`
835
+    },
836
+    luckdrawInfoById: { // 营销活动-抽奖活动详情
837
+      method: 'get',
838
+      url: `${baseUrl}${common}/luckdraw/:id`
839
+    },
840
+    addLuckdraw: { // 营销活动-新增抽奖活动
841
+      method: 'post',
842
+      url: `${baseUrl}${common}/luckdraw`
843
+    },
844
+    editLuckdraw: { // 营销活动-编辑抽奖活动
845
+      method: 'put',
846
+      url: `${baseUrl}${common}/luckdraw/:id`
847
+    },
848
+    deleteLuckdraw: { // 营销活动-删除抽奖活动
849
+      method: 'delete',
850
+      url: `${baseUrl}${common}/luckdraw/:id`
851
+    },
852
+    getDrawTemplateList: { // 营销活动-获取抽奖模板列表
853
+      method: 'get',
854
+      url: `${baseUrl}${common}/luckdrawtpl`
855
+    },
856
+    getRecordsList: { // 营销活动-获取抽奖记录列表
857
+      method: 'get',
858
+      url: `${baseUrl}${common}/luckdraw/records/:id`
859
+    },
860
+    getShareList: { // 营销活动-获取分享记录列表
861
+      method: 'get',
862
+      url: `${baseUrl}${common}/luckdraw/share/:id`
863
+    },
864
+    openActivity: { // 开启活动
865
+      method: 'put',
866
+      url: `${baseUrl}${common}/luckdraw/:id/open`
867
+    },
868
+    stopActivity: { // 停用活动
869
+      method: 'put',
870
+      url: `${baseUrl}${common}/luckdraw/:id/stop`
871
+    }
872
+  },
831 873
   record: {
832 874
     getRecordList: {
833 875
       method: 'get',

+ 4
- 2
src/util/util.js 查看文件

@@ -40,8 +40,10 @@ const toolClass = {
40 40
         let result = {
41 41
           result: res
42 42
         }
43
-        item.onSuccess(result, item.file)
44
-        console.log(result)
43
+        if (item.onSuccess) {
44
+          item.onSuccess(result, item.file)
45
+        }
46
+        // console.log(result)
45 47
         resolve(result)
46 48
       }).catch(reject)
47 49
     })