许成详 6 年之前
父節點
當前提交
8f62ec6e1d

+ 2
- 2
config/index.js 查看文件

12
     proxyTable: {
12
     proxyTable: {
13
       '/api': {
13
       '/api': {
14
         // target: 'https://dp.huiju360.com.cn/hj_operations',
14
         // target: 'https://dp.huiju360.com.cn/hj_operations',
15
-        target: 'http://192.168.0.62:8080', //wf
15
+        // target: 'http://192.168.0.62:8080', //wf
16
         // target: 'http://127.0.0.1:8080', 
16
         // target: 'http://127.0.0.1:8080', 
17
         // target: 'http://192.168.0.11:8080', //ys
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
         // target: 'http://dev.ycjcjy.com', //frp
19
         // target: 'http://dev.ycjcjy.com', //frp
20
         changeOrigin: true, // 如果接口跨域,需要进行这个参数配置
20
         changeOrigin: true, // 如果接口跨域,需要进行这个参数配置
21
         // pathRewrite: {
21
         // pathRewrite: {

+ 188
- 42
src/pages/system/marketingActivities/snapUpList/edit.vue 查看文件

1
 <template>
1
 <template>
2
   <div class="subPage flex-h">
2
   <div class="subPage flex-h">
3
-    <div class="img"></div>
3
+    <div class="img">
4
+      <img v-if="templateList.length" :src="templateList[templateActiveIndex].ModelImgUrl" width="100%" alt="">
5
+    </div>
4
     <div class="flex-item">
6
     <div class="flex-item">
5
       <h1>基本信息</h1>
7
       <h1>基本信息</h1>
6
       <form class="mainForm">
8
       <form class="mainForm">
27
                   <div style="width:50%">
29
                   <div style="width:50%">
28
                     <el-input
30
                     <el-input
29
                       placeholder="请输入活动名称"
31
                       placeholder="请输入活动名称"
30
-                      v-model="postData.title"
32
+                      v-model="postData.FlashBuyName"
31
                       clearable>
33
                       clearable>
32
                     </el-input>
34
                     </el-input>
33
                   </div>
35
                   </div>
39
                   <div style="width:50%">
41
                   <div style="width:50%">
40
                     <el-input
42
                     <el-input
41
                       placeholder="请输入活动名额"
43
                       placeholder="请输入活动名额"
42
-                      v-model="postData.title"
44
+                      v-model="postData.FlashBuyMaxAttendant"
43
                       clearable>
45
                       clearable>
44
                     </el-input>
46
                     </el-input>
45
                   </div>
47
                   </div>
49
                 <span>活动模板:<em>*</em></span>
51
                 <span>活动模板:<em>*</em></span>
50
                 <div class="flex-item">
52
                 <div class="flex-item">
51
                   <div>
53
                   <div>
54
+                    <div class="templateItem" v-for="(item,index) in templateList" :key="index">
55
+                      <a :class="{'active': templateActiveIndex === index}" @click="cutTemplate(index)">
56
+                        <img :src="item.ModelImgUrl" style="width:100%;height:100%;object-fit: contain;">
57
+                      </a>
58
+                    </div>
52
                   </div>
59
                   </div>
53
                 </div>
60
                 </div>
54
               </li>
61
               </li>
57
                 <div class="flex-item">
64
                 <div class="flex-item">
58
                   <div>
65
                   <div>
59
                     <el-date-picker
66
                     <el-date-picker
67
+                      value-format="yyyy-MM-ddT00:00:00+08:00"
60
                       v-model="postData.StartDate"
68
                       v-model="postData.StartDate"
61
                       type="date"
69
                       type="date"
62
                       placeholder="选择开始日期">
70
                       placeholder="选择开始日期">
63
                     </el-date-picker>
71
                     </el-date-picker>
64
                     <span>至</span>
72
                     <span>至</span>
65
                     <el-date-picker
73
                     <el-date-picker
74
+                      value-format="yyyy-MM-ddT00:00:00+08:00"
66
                       v-model="postData.EndDate"
75
                       v-model="postData.EndDate"
67
                       type="date"
76
                       type="date"
68
                       placeholder="选择截止日期">
77
                       placeholder="选择截止日期">
74
                 <span>活动说明:</span>
83
                 <span>活动说明:</span>
75
                 <div class="flex-item">
84
                 <div class="flex-item">
76
                   <div>
85
                   <div>
77
-                    <quill-editor v-model="postData.editContent"
86
+                    <quill-editor v-model="postData.FlashBuyInfo"
78
                       ref="myQuillEditor"
87
                       ref="myQuillEditor"
79
                       :options="editorOption">
88
                       :options="editorOption">
80
                     </quill-editor>
89
                     </quill-editor>
85
                 <span>参与类型:<em>*</em></span>
94
                 <span>参与类型:<em>*</em></span>
86
                 <div class="flex-item">
95
                 <div class="flex-item">
87
                   <div>
96
                   <div>
88
-                    <el-radio v-model="postData.joinType" label="1">不限</el-radio>
89
-                    <el-radio v-model="postData.joinType" label="2">新用户</el-radio>
97
+                    <el-radio v-model="postData.AttendantType" label="no">不限</el-radio>
98
+                    <el-radio v-model="postData.AttendantType" label="newuser">新用户</el-radio>
90
                   </div>
99
                   </div>
91
                 </div>
100
                 </div>
92
               </li>
101
               </li>
94
                 <span>核销时间:<em>*</em></span>
103
                 <span>核销时间:<em>*</em></span>
95
                 <div class="flex-item">
104
                 <div class="flex-item">
96
                   <div class="flex-h" style="width: 100%;align-item: center;">
105
                   <div class="flex-h" style="width: 100%;align-item: center;">
97
-                    <el-radio v-model="postData.verificationType" label="1" style="margin-right: 5px;"><em style="color: transparent;display:none;">1</em></el-radio>
106
+                    <el-radio v-model="postData.ValidateType" label="days" style="margin-right: 5px;"><em style="color: transparent;display:none;">1</em></el-radio>
98
                     <span>领取后</span>
107
                     <span>领取后</span>
99
                     <div style="width: 100px;display: inline-block;">
108
                     <div style="width: 100px;display: inline-block;">
100
                       <el-input
109
                       <el-input
101
                         placeholder=""
110
                         placeholder=""
102
-                        v-model="postData.validity"
111
+                        v-model="postData.ValidateDays"
103
                         clearable>
112
                         clearable>
104
                       </el-input>
113
                       </el-input>
105
                     </div>
114
                     </div>
106
                     <span>天内有效</span>
115
                     <span>天内有效</span>
107
                   </div>
116
                   </div>
108
                   <div class="flex-h" style="width: 100%;align-item: center;margin-top: 10px;">
117
                   <div class="flex-h" style="width: 100%;align-item: center;margin-top: 10px;">
109
-                    <el-radio v-model="postData.verificationType" label="2" style="margin-right: 5px;"><em style="color: transparent;display:none;">2</em></el-radio>
118
+                    <el-radio v-model="postData.ValidateType" label="date" style="margin-right: 5px;"><em style="color: transparent;display:none;">2</em></el-radio>
110
                     <span>有效期</span>
119
                     <span>有效期</span>
111
                     <div style="display: inline-block;">
120
                     <div style="display: inline-block;">
112
                       <el-date-picker
121
                       <el-date-picker
113
-                        v-model="postData.validityDate"
122
+                        value-format="yyyy-MM-ddT00:00:00+08:00"
123
+                        v-model="postData.ValidateStart"
114
                         type="date"
124
                         type="date"
115
-                        placeholder="选择日期">
125
+                        placeholder="选择开始日期">
126
+                      </el-date-picker>
127
+                      <span>至</span>
128
+                      <el-date-picker
129
+                        value-format="yyyy-MM-ddT00:00:00+08:00"
130
+                        v-model="postData.ValidateEnd"
131
+                        type="date"
132
+                        placeholder="选择截止日期">
116
                       </el-date-picker>
133
                       </el-date-picker>
117
                     </div>
134
                     </div>
118
                   </div>
135
                   </div>
121
               <li>
138
               <li>
122
                 <el-button
139
                 <el-button
123
                   size="mini"
140
                   size="mini"
124
-                  type="primary">保存</el-button>
141
+                  type="primary"
142
+                  @click="submitFlashbuy">保存</el-button>
125
                 <el-button
143
                 <el-button
126
                   size="mini"
144
                   size="mini"
127
                   type="danger" @click="reback">取消</el-button>
145
                   type="danger" @click="reback">取消</el-button>
139
 export default {
157
 export default {
140
   data () {
158
   data () {
141
     return {
159
     return {
160
+      templateActiveIndex: 0, // 当前选择模板索引值
161
+      templateList: [], // 模板列表
142
       postData: {
162
       postData: {
143
-        caseid: '', // 案场id
144
-        title: '', // 活动标题
145
-        StartDate: '', // 开始日期
146
-        EndDate: '', // 截止日期
147
-        editContent: '', // 编辑内容
148
-        tableData: [], // 奖品数据
149
-        joinOff: true, // 参与人数开关
150
-        joinNum: '', // 参与人数
151
-        joinType: '1', // 参与类型
152
-        lotteryNumType: 'fixedNum', // 抽奖次数类型
153
-        lotteryTimeUnit: 'day', // 抽奖周期单位
154
-        lotteryNum: '', // 抽奖次数
155
-        shareType: 'newUser', // 分享设置
156
-        addLotteryNum: '', // 新增抽奖次数
157
-        systemUserLottery: true, // 系统用户抽奖
158
-        prizeDefault: true, // 奖品内定
159
-        prizeTableData: [], // 奖品内定表格数据
160
-        verificationType: '1', // 核销类型
161
-        validity: '', // 领取后有效天数
162
-        validityDate: '', // 有效期
163
+        CaseId: '', // 案场id
164
+        FlashBuyName: '', // 活动名称
165
+        FlashBuyMaxAttendant: '', // 活动名额
166
+        ModelId: '', // 模板id
167
+        StartDate: '', // 活动开始日期
168
+        EndDate: '', // 活动截止日期
169
+        FlashBuyInfo: '', // 活动说明
170
+        AttendantType: 'no', // 参与类型
171
+        ValidateDays: '', // 领取后有效天数
172
+        ValidateStart: '', // 有效期开始时间
173
+        ValidateEnd: '', // 有效期截止时间
174
+        ValidateType: 'days', // 核销类型
175
+        FlashBuyStatus: 'active', // 活动状态
163
       },
176
       },
164
       editorOption: {
177
       editorOption: {
165
-        modules: {
166
-          toolbar: [
167
-            ['bold', 'italic', 'underline', 'strike', { 'color': [] }, { 'font': [] }, { 'header': 1 }, { 'header': 2 }, { 'indent': '-1' }, { 'indent': '+1' }, { 'list': 'ordered' }, { 'list': 'bullet' }, 'align', { 'direction': 'rtl' }, 'clean'], // toggled buttons
168
-            ['blockquote', 'code-block']
169
-          ]
170
-        }
171
       },
178
       },
172
     }
179
     }
173
   },
180
   },
181
     }),
188
     }),
182
     CaseId: {
189
     CaseId: {
183
       get () {
190
       get () {
184
-        return this.postData.caseid || this.defaultCaseId
191
+        return this.postData.CaseId || this.defaultCaseId
185
       },
192
       },
186
       set (val) {
193
       set (val) {
187
-        this.postData.caseid = val
194
+        this.postData.CaseId = val
188
       }
195
       }
189
     }
196
     }
190
   },
197
   },
191
   created () {
198
   created () {
192
     this.getFlashbuyTemplateList().then((res) => {
199
     this.getFlashbuyTemplateList().then((res) => {
193
-      console.log(JSON.stringify(res))
200
+      // console.log(JSON.stringify(res))
201
+      for (var n = 0; n < res.length; n++) {
202
+        res[n].currentImg = ''
203
+      }
204
+      this.templateList = res
205
+      if (this.$route.query.id) {
206
+        this.getFlashbuyById(this.$route.query.id).then((resr) => {
207
+          // console.log(JSON.stringify(resr))
208
+          this.postData = resr
209
+          for (var n = 0; n < this.templateList.length; n++) {
210
+            if (this.templateList[n].ModelId === this.postData.ModelId) {
211
+              this.templateActiveIndex = n
212
+            }
213
+          }
214
+          if (this.postData.ValidateType === 'date') {
215
+            this.postData.ValidateDays = ''
216
+          } else {
217
+            this.postData.ValidateStart = ''
218
+            this.postData.ValidateEnd = ''
219
+          }
220
+        })
221
+      }
194
     })
222
     })
195
   },
223
   },
196
   methods: {
224
   methods: {
197
     ...mapActivityFlashbuyActions([
225
     ...mapActivityFlashbuyActions([
198
       'getFlashbuyTemplateList',
226
       'getFlashbuyTemplateList',
227
+      'addFlashbuy',
228
+      'getFlashbuyById',
229
+      'editFlashbuy',
199
     ]),
230
     ]),
231
+    submitFlashbuy () { // 提交抢购数据
232
+      if (!this.checkData()) {
233
+        return false
234
+      }
235
+      this.postData.FlashBuyMaxAttendant = this.postData.FlashBuyMaxAttendant - 0
236
+      this.postData.ModelId = this.templateList[this.templateActiveIndex].ModelId
237
+      if (this.$route.query.id) {
238
+        this.editFlashbuy(this.postData).then((res) => {
239
+          this.$message({
240
+            message: '操作成功',
241
+            type: 'success'
242
+          })
243
+          this.$router.push({ name: 'snapUpList' })
244
+        })
245
+      } else {
246
+        this.addFlashbuy(this.postData).then((res) => {
247
+          this.$message({
248
+            message: '操作成功',
249
+            type: 'success'
250
+          })
251
+          this.$router.push({ name: 'snapUpList' })
252
+        })
253
+      }
254
+    },
255
+    checkData () { // 校验数据格式
256
+      if (this.postData.CaseId === '') {
257
+        this.$message({
258
+          type: 'error',
259
+          message: '请选择案场'
260
+        })
261
+        return false
262
+      }
263
+      if (this.postData.FlashBuyName === '') {
264
+        this.$message({
265
+          type: 'error',
266
+          message: '活动名称不能为空'
267
+        })
268
+        return false
269
+      }
270
+      if (this.postData.FlashBuyMaxAttendant === '') {
271
+        this.$message({
272
+          type: 'error',
273
+          message: '活动名额不能为空'
274
+        })
275
+        return false
276
+      }
277
+      if (this.postData.StartDate === '') {
278
+        this.$message({
279
+          type: 'error',
280
+          message: '活动开始时间不能为空'
281
+        })
282
+        return false
283
+      }
284
+      if (this.postData.EndDate === '') {
285
+        this.$message({
286
+          type: 'error',
287
+          message: '活动截止时间不能为空'
288
+        })
289
+        return false
290
+      }
291
+      if (this.postData.ValidateType === 'days') {
292
+        if (this.postData.ValidateDays - 0 <= 0 || (this.postData.ValidateDays - 0) % 1 !== 0) {
293
+          this.$message({
294
+            type: 'error',
295
+            message: '领取后有效天数须为大于0正整数'
296
+          })
297
+          return false
298
+        }
299
+        this.postData.ValidateDays = this.postData.ValidateDays - 0
300
+        delete this.postData.ValidateStart
301
+        delete this.postData.ValidateEnd
302
+      } else {
303
+        if (this.postData.ValidateStart === '') {
304
+          this.$message({
305
+            type: 'error',
306
+            message: '有效期开始时间不能为空'
307
+          })
308
+          return false
309
+        }
310
+        if (this.postData.ValidateEnd === '') {
311
+          this.$message({
312
+            type: 'error',
313
+            message: '有效期截止时间不能为空'
314
+          })
315
+          return false
316
+        }
317
+        delete this.postData.ValidateDays
318
+      }
319
+      return true
320
+    },
321
+    cutTemplate (index) { // 切换模板
322
+      this.templateActiveIndex = index
323
+      this.postData.ModelId = this.templateList[index].ModelId
324
+    },
200
     reback () {
325
     reback () {
201
-      this.$router.push({name: 'snapUpList'})
326
+      this.$router.push({ name: 'snapUpList' })
202
     },
327
     },
203
   },
328
   },
204
 }
329
 }
241
     border: 1px solid #eee;
366
     border: 1px solid #eee;
242
     border-bottom: none;
367
     border-bottom: none;
243
   }
368
   }
369
+  .templateItem {
370
+    width: 120px;
371
+    display: inline-block;
372
+    margin: 0 20px 20px 0;
373
+    position: relative;
374
+    overflow: hidden;
375
+    text-align: center;
376
+    vertical-align: top;
377
+    & > a {
378
+      width: 100%;
379
+      height: 120px;
380
+      display: inline-block;
381
+      position: relative;
382
+      overflow: hidden;
383
+      border: 1px dashed #ccc;
384
+      box-sizing: border-box;
385
+      &.active {
386
+        border-color: #409eff;
387
+      }
388
+    }
389
+  }
244
 }
390
 }
245
 </style>
391
 </style>

+ 55
- 16
src/pages/system/marketingActivities/snapUpList/index.vue 查看文件

22
             </el-select>
22
             </el-select>
23
           </li>
23
           </li>
24
           <li>
24
           <li>
25
-            <el-select v-model="postData.state" placeholder="请选择状态">
25
+            <el-select v-model="postData.flashbuystatus" placeholder="请选择状态">
26
               <el-option
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
               </el-option>
31
               </el-option>
32
             </el-select>
32
             </el-select>
33
           </li>
33
           </li>
41
         </ul>
41
         </ul>
42
         <el-button
42
         <el-button
43
           size="mini"
43
           size="mini"
44
-          type="primary">搜索</el-button>
44
+          type="primary"
45
+          @click="getList">搜索</el-button>
45
       </div>
46
       </div>
46
       <div class="moreFilter"></div>
47
       <div class="moreFilter"></div>
47
     </div>
48
     </div>
55
             width="180">
56
             width="180">
56
           </el-table-column>
57
           </el-table-column>
57
           <el-table-column
58
           <el-table-column
58
-            prop="ActivityName"
59
+            prop="FlashBuyName"
59
             label="活动名称">
60
             label="活动名称">
60
           </el-table-column>
61
           </el-table-column>
61
           <el-table-column
62
           <el-table-column
62
-            prop="Status"
63
+            prop="FlashBuyStatus"
63
             label="状态">
64
             label="状态">
64
-          </el-table-column>
65
-          <el-table-column
66
-            prop="url"
67
-            label="活动链接">
65
+            <template slot-scope="scope">
66
+              {{scope.row.FlashBuyStatus === 'active' ? '已启用' : scope.row.FlashBuyStatus === 'inactive' ? '已停用' : '已结束'}}
67
+            </template>
68
           </el-table-column>
68
           </el-table-column>
69
           <el-table-column
69
           <el-table-column
70
             prop="address"
70
             prop="address"
72
             width="200">
72
             width="200">
73
             <template slot-scope="scope">
73
             <template slot-scope="scope">
74
               <el-button
74
               <el-button
75
+                v-if="scope.row.FlashBuyStatus !== 'active'"
75
                 size="mini"
76
                 size="mini"
76
                 type="danger">删除</el-button>
77
                 type="danger">删除</el-button>
77
               <el-button
78
               <el-button
79
+                v-if="scope.row.FlashBuyStatus === 'active'"
78
                 size="mini"
80
                 size="mini"
79
                 type="warning">停用</el-button>
81
                 type="warning">停用</el-button>
80
               <el-button
82
               <el-button
83
+                size="mini"
84
+                type="success"
85
+                @click="editFlashbuy(scope.row.FlashBuyId)">编辑</el-button>
86
+              <el-button
87
+                v-if="scope.row.FlashBuyStatus === 'inactive'"
81
                 size="mini"
88
                 size="mini"
82
                 type="success">启用</el-button>
89
                 type="success">启用</el-button>
83
               <el-button
90
               <el-button
102
 export default {
109
 export default {
103
   data () {
110
   data () {
104
     return {
111
     return {
112
+      statusList: [{ // 状态列表
113
+        id: '',
114
+        value: '不限状态'
115
+      }, {
116
+        id: 'active',
117
+        value: '已启用'
118
+      }, {
119
+        id: 'inactive',
120
+        value: '已停用'
121
+      }, {
122
+        id: 'over',
123
+        value: '已结束'
124
+      }],
105
       tableData: [],
125
       tableData: [],
106
       postData: { // 表格搜索条件
126
       postData: { // 表格搜索条件
107
         caseid: '', // 案场id
127
         caseid: '', // 案场id
108
         page: 1, // 当前页码
128
         page: 1, // 当前页码
109
-        pageSize: 10, // 请求数据量
129
+        pagesize: 10, // 请求数据量
110
         name: '', // 活动名称
130
         name: '', // 活动名称
111
-        state: '', // 状态
131
+        flashbuystatus: '', // 状态
112
       },
132
       },
113
       total: 0 // 数据条数
133
       total: 0 // 数据条数
114
     }
134
     }
127
       }
147
       }
128
     }
148
     }
129
   },
149
   },
130
-  mounted () {
150
+  created () {
131
     this.getList()
151
     this.getList()
132
   },
152
   },
133
   methods: {
153
   methods: {
134
     ...mapActivityFlashbuyActions([
154
     ...mapActivityFlashbuyActions([
135
-      'getFlashbuyTemplateList',
155
+      'getFlashbuyList',
136
     ]),
156
     ]),
157
+    editFlashbuy (id) {
158
+      this.$router.push({ name: 'editSnapUpList', query: { id } })
159
+    },
160
+    toGetFlashbuyList () {
161
+      this.getFlashbuyList(this.postData).then((res) => {
162
+        // console.log(JSON.stringify(res))
163
+        this.postData.page = res.page
164
+        this.total = res.pagenum
165
+        this.tableData = res.list
166
+      })
167
+    },
137
     handleCurrentChange (val) {
168
     handleCurrentChange (val) {
138
       this.$data.postData.page = val
169
       this.$data.postData.page = val
139
       this.getList()
170
       this.getList()
142
       this.$router.push({ name: pathName })
173
       this.$router.push({ name: pathName })
143
     },
174
     },
144
     getList () { // 获取数据列表
175
     getList () { // 获取数据列表
176
+      this.postData.page = 1
177
+      this.total = 1
178
+      this.toGetFlashbuyList()
145
     },
179
     },
146
     addSnapUpList () {
180
     addSnapUpList () {
147
       this.$router.push({ name: 'addSnapUpList' })
181
       this.$router.push({ name: 'addSnapUpList' })
153
 <!-- Add "scoped" attribute to limit CSS to this component only -->
187
 <!-- Add "scoped" attribute to limit CSS to this component only -->
154
 <style lang="scss" scoped>
188
 <style lang="scss" scoped>
155
 @import "page.scss";
189
 @import "page.scss";
190
+table {
191
+  button {
192
+    margin-bottom: 10px;
193
+  }
194
+}
156
 </style>
195
 </style>

+ 54
- 0
src/store/activityManager/flashbuy.js 查看文件

16
         }).catch(reject)
16
         }).catch(reject)
17
       })
17
       })
18
     },
18
     },
19
+    getFlashbuyList ({ commit }, payload) { // 获取抢购活动列表
20
+      return new Promise((resolve, reject) => {
21
+        ajax(api.activityManager.getFlashbuyList.url, {
22
+          method: api.activityManager.getFlashbuyList.method,
23
+          queryData: { ...payload }
24
+        }).then(res => {
25
+          resolve(res)
26
+        }).catch(reject)
27
+      })
28
+    },
29
+    addFlashbuy ({ commit }, payload) { // 新增抢购活动
30
+      return new Promise((resolve, reject) => {
31
+        ajax(api.activityManager.addFlashbuy.url, {
32
+          method: api.activityManager.addFlashbuy.method,
33
+          data: { info: JSON.stringify(payload) }
34
+        }).then(res => {
35
+          resolve(res)
36
+        }).catch(reject)
37
+      })
38
+    },
39
+    getFlashbuyById ({ commit }, id) { // 获取抢购信息
40
+      return new Promise((resolve, reject) => {
41
+        ajax(api.activityManager.getFlashbuyById.url, {
42
+          method: api.activityManager.getFlashbuyById.method,
43
+          urlData: {
44
+            id,
45
+          },
46
+        }).then(res => {
47
+          resolve(res)
48
+        }).catch(reject)
49
+      })
50
+    },
51
+    editFlashbuy ({ commit }, payload) { // 更新抢购活动
52
+      return new Promise((resolve, reject) => {
53
+        ajax(api.activityManager.editFlashbuy.url, {
54
+          method: api.activityManager.editFlashbuy.method,
55
+          data: { info: JSON.stringify(payload) }
56
+        }).then(res => {
57
+          resolve(res)
58
+        }).catch(reject)
59
+      })
60
+    },
61
+    deleteFlashbuy ({ commit }, id) { // 删除抢购活动
62
+      return new Promise((resolve, reject) => {
63
+        ajax(api.activityManager.deleteFlashbuy.url, {
64
+          method: api.activityManager.deleteFlashbuy.method,
65
+          urlData: {
66
+            id,
67
+          },
68
+        }).then(res => {
69
+          resolve(res)
70
+        }).catch(reject)
71
+      })
72
+    },
19
   }
73
   }
20
 }
74
 }

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

873
       method: 'get',
873
       method: 'get',
874
       url: `${baseUrl}${common}/flashbuy/model`
874
       url: `${baseUrl}${common}/flashbuy/model`
875
     },
875
     },
876
+    addFlashbuy: { // 营销活动-新增抢购活动
877
+      method: 'post',
878
+      url: `${baseUrl}${common}/flashbuy`
879
+    },
880
+    getFlashbuyList: { // 营销活动-获取抢购活动列表
881
+      method: 'get',
882
+      url: `${baseUrl}${common}/flashbuy`
883
+    },
884
+    getFlashbuyById: { // 营销活动-获取抢购活动信息
885
+      method: 'get',
886
+      url: `${baseUrl}${common}/flashbuy/:id`
887
+    },
888
+    editFlashbuy: { // 营销活动-更新抢购活动
889
+      method: 'put',
890
+      url: `${baseUrl}${common}/flashbuy/edit`
891
+    },
892
+    deleteFlashbuy: { // 营销活动-删除抢购活动
893
+      method: 'delete',
894
+      url: `${baseUrl}${common}/flashbuy/:id`
895
+    },
876
   },
896
   },
877
   record: {
897
   record: {
878
     getRecordList: {
898
     getRecordList: {