许成详 il y a 6 ans
Parent
révision
e0c79bc5fa

+ 9
- 2
src/pages/system/marketingActivities/snapUpList/edit.vue Voir le fichier

@@ -133,8 +133,9 @@
133 133
   </div>
134 134
 </template>
135 135
 <script>
136
-import { mapState } from 'vuex'
137 136
 import { quillEditor } from 'vue-quill-editor'
137
+import { mapState, createNamespacedHelpers } from 'vuex'
138
+const { mapActions: mapActivityFlashbuyActions } = createNamespacedHelpers('activityFlashbuy')
138 139
 export default {
139 140
   data () {
140 141
     return {
@@ -187,9 +188,15 @@ export default {
187 188
       }
188 189
     }
189 190
   },
190
-  mounted () {
191
+  created () {
192
+    this.getFlashbuyTemplateList().then((res) => {
193
+      console.log(JSON.stringify(res))
194
+    })
191 195
   },
192 196
   methods: {
197
+    ...mapActivityFlashbuyActions([
198
+      'getFlashbuyTemplateList',
199
+    ]),
193 200
     reback () {
194 201
       this.$router.push({name: 'snapUpList'})
195 202
     },

+ 7
- 2
src/pages/system/marketingActivities/snapUpList/index.vue Voir le fichier

@@ -97,12 +97,14 @@
97 97
   </div>
98 98
 </template>
99 99
 <script>
100
-import { mapState } from 'vuex'
100
+import { mapState, createNamespacedHelpers } from 'vuex'
101
+const { mapActions: mapActivityFlashbuyActions } = createNamespacedHelpers('activityFlashbuy')
101 102
 export default {
102 103
   data () {
103 104
     return {
104 105
       tableData: [],
105
-      postData: { // 表格搜索条件 //caseid: '', // 案场id
106
+      postData: { // 表格搜索条件
107
+        caseid: '', // 案场id
106 108
         page: 1, // 当前页码
107 109
         pageSize: 10, // 请求数据量
108 110
         name: '', // 活动名称
@@ -129,6 +131,9 @@ export default {
129 131
     this.getList()
130 132
   },
131 133
   methods: {
134
+    ...mapActivityFlashbuyActions([
135
+      'getFlashbuyTemplateList',
136
+    ]),
132 137
     handleCurrentChange (val) {
133 138
       this.$data.postData.page = val
134 139
       this.getList()

+ 20
- 0
src/store/activityManager/flashbuy.js Voir le fichier

@@ -0,0 +1,20 @@
1
+import ajax from '../../util/ajax'
2
+import api from '../../util/api'
3
+
4
+export default {
5
+  namespaced: true,
6
+  state: {},
7
+  mutations: {
8
+  },
9
+  actions: {
10
+    getFlashbuyTemplateList () { // 获取抢购活动模板
11
+      return new Promise((resolve, reject) => {
12
+        ajax(api.activityManager.getFlashbuyTemplateList.url, {
13
+          method: api.activityManager.getFlashbuyTemplateList.method,
14
+        }).then(res => {
15
+          resolve(res)
16
+        }).catch(reject)
17
+      })
18
+    },
19
+  }
20
+}

+ 1
- 0
src/store/index.js Voir le fichier

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

+ 5
- 1
src/util/api.js Voir le fichier

@@ -868,7 +868,11 @@ const $api = {
868 868
     stopActivity: { // 停用活动
869 869
       method: 'put',
870 870
       url: `${baseUrl}${common}/luckdraw/:id/stop`
871
-    }
871
+    },
872
+    getFlashbuyTemplateList: { // 营销活动-获取抢购模板列表
873
+      method: 'get',
874
+      url: `${baseUrl}${common}/flashbuy/model`
875
+    },
872 876
   },
873 877
   record: {
874 878
     getRecordList: {