123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121 |
- import ajax from '../../util/ajax'
- import api from '../../util/api'
-
- export default {
- namespaced: true,
- state: {},
- mutations: {
- },
- actions: {
- getFlashbuyTemplateList () { // 获取抢购活动模板
- return new Promise((resolve, reject) => {
- ajax(api.activityManager.getFlashbuyTemplateList.url, {
- method: api.activityManager.getFlashbuyTemplateList.method,
- }).then(res => {
- resolve(res)
- }).catch(reject)
- })
- },
- getFlashbuyList ({ commit }, payload) { // 获取抢购活动列表
- return new Promise((resolve, reject) => {
- ajax(api.activityManager.getFlashbuyList.url, {
- method: api.activityManager.getFlashbuyList.method,
- queryData: { ...payload }
- }).then(res => {
- resolve(res)
- }).catch(reject)
- })
- },
- addFlashbuy ({ commit }, payload) { // 新增抢购活动
- return new Promise((resolve, reject) => {
- ajax(api.activityManager.addFlashbuy.url, {
- method: api.activityManager.addFlashbuy.method,
- data: { info: JSON.stringify(payload) }
- }).then(res => {
- resolve(res)
- }).catch(reject)
- })
- },
- getFlashbuyById ({ commit }, id) { // 获取抢购信息
- return new Promise((resolve, reject) => {
- ajax(api.activityManager.getFlashbuyById.url, {
- method: api.activityManager.getFlashbuyById.method,
- urlData: {
- id,
- },
- }).then(res => {
- resolve(res)
- }).catch(reject)
- })
- },
- editFlashbuy ({ commit }, payload) { // 更新抢购活动
- return new Promise((resolve, reject) => {
- ajax(api.activityManager.editFlashbuy.url, {
- method: api.activityManager.editFlashbuy.method,
- data: { info: JSON.stringify(payload) }
- }).then(res => {
- resolve(res)
- }).catch(reject)
- })
- },
- deleteFlashbuy ({ commit }, id) { // 删除抢购活动
- return new Promise((resolve, reject) => {
- ajax(api.activityManager.deleteFlashbuy.url, {
- method: api.activityManager.deleteFlashbuy.method,
- urlData: {
- id,
- },
- }).then(res => {
- resolve(res)
- }).catch(reject)
- })
- },
- getFlashbuyRecordsById ({ commit }, payload) { // 获取抢购活动记录列表
- return new Promise((resolve, reject) => {
- ajax(api.activityManager.getFlashbuyRecordsById.url, {
- method: api.activityManager.getFlashbuyRecordsById.method,
- urlData: {
- id: payload.id
- },
- queryData: { ...payload.info }
- }).then(res => {
- resolve(res)
- }).catch(reject)
- })
- },
- updateFlashbuyStatus ({ commit }, payload) { // 更新抢购活动状态
- return new Promise((resolve, reject) => {
- ajax(api.activityManager.updateFlashbuyStatus.url, {
- method: api.activityManager.updateFlashbuyStatus.method,
- urlData: {...payload},
- }).then(res => {
- resolve(res)
- }).catch(reject)
- })
- },
- getCardListByCaseId ({ commit }, id) { // 获取案场下卡列表
- return new Promise((resolve, reject) => {
- ajax(api.activityManager.getCardListByCaseId.url, {
- method: api.activityManager.getCardListByCaseId.method,
- urlData: {
- id,
- },
- }).then(res => {
- resolve(res)
- }).catch(reject)
- })
- },
- getCouponListByCaseId ({ commit }, id) { // 获取案场下券列表
- return new Promise((resolve, reject) => {
- ajax(api.activityManager.getCouponListByCaseId.url, {
- method: api.activityManager.getCouponListByCaseId.method,
- urlData: {
- id,
- },
- }).then(res => {
- resolve(res)
- }).catch(reject)
- })
- },
- }
- }
|