许成详 6 years ago
parent
commit
e0c79bc5fa

+ 9
- 2
src/pages/system/marketingActivities/snapUpList/edit.vue View File

133
   </div>
133
   </div>
134
 </template>
134
 </template>
135
 <script>
135
 <script>
136
-import { mapState } from 'vuex'
137
 import { quillEditor } from 'vue-quill-editor'
136
 import { quillEditor } from 'vue-quill-editor'
137
+import { mapState, createNamespacedHelpers } from 'vuex'
138
+const { mapActions: mapActivityFlashbuyActions } = createNamespacedHelpers('activityFlashbuy')
138
 export default {
139
 export default {
139
   data () {
140
   data () {
140
     return {
141
     return {
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
   methods: {
196
   methods: {
197
+    ...mapActivityFlashbuyActions([
198
+      'getFlashbuyTemplateList',
199
+    ]),
193
     reback () {
200
     reback () {
194
       this.$router.push({name: 'snapUpList'})
201
       this.$router.push({name: 'snapUpList'})
195
     },
202
     },

+ 7
- 2
src/pages/system/marketingActivities/snapUpList/index.vue View File

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

+ 20
- 0
src/store/activityManager/flashbuy.js View File

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 View File

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

+ 5
- 1
src/util/api.js View File

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