/**
* @Author: liutao
* @Date: 2017-03-14T18:17:44+08:00
* @Email: 947809647@qq.com
* @Last modified by: liutao
* @Last modified time: 2017-04-25T15:42:38+08:00
*/
import queryString from 'query-string'
import Vue from 'vue'
const SUCCESS = 1000000
const API_ROOT = server.root + '/newmanage'
const activityListResource = Vue.resource(API_ROOT + '/task/activity/list')
const activityUpdateResource = Vue.resource(API_ROOT + '/task/activity/update')
const activityAddResource = Vue.resource(API_ROOT + '/task/activity/insert')
const customMiniListResource = Vue.resource(API_ROOT + '/activity/list')
const customAddResource = Vue.resource(API_ROOT + '/activity/add')
const customUpdateResource = Vue.resource(API_ROOT + '/activity/update')
const customPrizeListResource = Vue.resource(API_ROOT + '/prize/list')
const customPrizeAddResource = Vue.resource(API_ROOT + '/prize/add')
const customPrizeUpdateResource = Vue.resource(API_ROOT + '/prize/update')
const customPrizeResultLResource = Vue.resource(API_ROOT + '/prize/result/list')
const customPrizeCodeLResource = Vue.resource(API_ROOT + '/prize/code/list')
const customCodeRemoveResource = Vue.resource(API_ROOT + '/prize/code/remove')
const customCodeAddResource = Vue.resource(API_ROOT + '/prize/code/batchadd')
const customCodeExcelResource = Vue.resource(API_ROOT + '/prize/code/excel')
export const exportCodeResource = API_ROOT + '/prize/code/export'
const customMsgListResource = Vue.resource(API_ROOT + '/activity/msg/list')
const customMsgConfigResource = Vue.resource(API_ROOT + '/activity/msg/config')
const customMsgSendResource = Vue.resource(API_ROOT + '/activity/msg/send')
const guoxinListResource = Vue.resource(API_ROOT + '/gxopen/list')
const guoxinUpdateResource = Vue.resource(API_ROOT + '/gxopen/changestatus')
const guoxinInviteListResource = Vue.resource(API_ROOT + '/gxopen/sharelist')
const guoxinUpdateInviteResource = Vue.resource(API_ROOT + '/gxopen/sharelist/changestatus')
const customFakeRecordsResource = Vue.resource(API_ROOT + '/activity/fakeaward/list')
const customFakeAddResource = Vue.resource(API_ROOT + '/activity/fakeaward/add')
const customFakeRemoveResource = Vue.resource(API_ROOT + '/activity/fakeaward/remove')
const hualinListResource = Vue.resource(API_ROOT + '/hlopen/list')
const hualinUpdateResource = Vue.resource(API_ROOT + '/hlopen/changestatus')
const hualinInviteListResource = Vue.resource(API_ROOT + '/hlopen/sharelist')
const hualinUpdateInviteResource = Vue.resource(API_ROOT + '/hlopen/sharelist/changestatus')
// 充流量
const getDataflowListResource = Vue.resource(API_ROOT + '/dataflow/list')
const getInvalidOrderResource = Vue.resource(API_ROOT + '/dataflow/invalidOrder')
const chargeDataflowResource = Vue.resource(API_ROOT + '/dataflow/chargeDataflow')
const updateOrderResultResource = Vue.resource(API_ROOT + '/dataflow/updateOrderResult')
const getAccountResource = Vue.resource(API_ROOT + '/dataflow/account')
// 年度票选
const getVoteListResource = Vue.resource(API_ROOT + '/year/top/list')
const getAddVoteResource = Vue.resource(API_ROOT + '/year/top/votes')
const getSearchListResource = Vue.resource(API_ROOT + '/year/top/search')
// 金贝塔小游戏
const awardResource = Vue.resource(API_ROOT + '/game/no/award')
const searchResource = Vue.resource(API_ROOT + '/game/list/phone')
const gameRankResource = Vue.resource(API_ROOT + '/game/list/rank')
const gameUpdateResource = Vue.resource(API_ROOT + '/game/inc')
export const getActivityList = ({dispatch}, params) => {
return activityListResource.get(params)
.then((res) => {
if (+res.data.code === SUCCESS) {
dispatch('UPDATE_ACTIVITY_FRESH', 0)
return Promise.resolve(res.data.data)
}
return Promise.reject(res.data)
})
}
export const updateActivity = ({dispatch}, params) => {
return activityUpdateResource.save(params)
.then((res) => {
if (+res.data.code === SUCCESS) {
return dispatch('UPDATE_ACTIVITY_FRESH', 1)
}
return Promise.reject(res.data)
})
}
export const addActivity = ({dispatch}, params) => {
return activityAddResource.save(params)
.then((res) => {
if (+res.data.code === SUCCESS) {
return dispatch('UPDATE_ACTIVITY_FRESH', 1)
}
return Promise.reject(res.data)
})
}
export const customList = ({dispatch}, params) => {
return customMiniListResource.save(params)
.then((res) => {
if (+res.data.code === SUCCESS) {
dispatch('UPDATE_CUSTOM_FRESH', 0)
return Promise.resolve(res.data.data)
}
return Promise.reject(res.data)
})
}
export const addCustom = ({dispatch}, params) => {
return customAddResource.save(params)
.then((res) => {
if (+res.data.code === SUCCESS) {
return dispatch('UPDATE_CUSTOM_FRESH', 1)
}
return Promise.reject(res.data)
})
}
export const updateCustom = ({dispatch}, params) => {
return customUpdateResource.save(params)
.then((res) => {
if (+res.data.code === SUCCESS) {
return dispatch('UPDATE_CUSTOM_FRESH', 1)
}
return Promise.reject(res.data)
})
}
export const prizeList = ({dispatch}, params) => {
return customPrizeListResource.save(params)
.then((res) => {
if (+res.data.code === SUCCESS) {
dispatch('UPDATE_PRIZE_FRESH', 0)
return Promise.resolve(res.data.data)
}
return Promise.reject(res.data)
})
}
export const addPrize = ({dispatch}, params) => {
return customPrizeAddResource.save(params)
.then((res) => {
if (+res.data.code === SUCCESS) {
return dispatch('UPDATE_PRIZE_FRESH', 1)
}
return Promise.reject(res.data)
})
}
export const updatePrize = ({dispatch}, params) => {
return customPrizeUpdateResource.save(params)
.then((res) => {
if (+res.data.code === SUCCESS) {
return dispatch('UPDATE_PRIZE_FRESH', 1)
}
return Promise.reject(res.data)
})
}
export const prizeResultList = ({dispatch}, params) => {
return customPrizeResultLResource.save(params)
.then((res) => {
if (+res.data.code === SUCCESS) {
return Promise.resolve(res.data.data)
}
return Promise.reject(res.data)
})
}
export const prizeCodeList = ({dispatch}, params) => {
return customPrizeCodeLResource.save(params)
.then((res) => {
if (+res.data.code === SUCCESS) {
dispatch('IMPORT_CODE_FRESH', 0)
return Promise.resolve(res.data.data)
}
return Promise.reject(res.data)
})
}
export const codeRemoveBatch = ({dispatch}, params) => {
return customCodeRemoveResource.save(params)
.then((res) => {
if (+res.data.code === SUCCESS) {
return dispatch('IMPORT_CODE_FRESH', 1)
}
return Promise.reject(res.data)
})
}
export const codeAddBatch = ({dispatch}, params) => {
return customCodeAddResource.save(params)
.then((res) => {
if (+res.data.code === SUCCESS) {
return dispatch('IMPORT_CODE_FRESH', 1)
}
return Promise.reject(res.data)
})
}
export const codeExcel = ({dispatch}, params) => {
return customCodeExcelResource.save(params)
.then((res) => {
if (+res.data.code === SUCCESS) {
return dispatch('IMPORT_CODE_FRESH', 1)
}
return Promise.reject(res.data)
})
}
export const msgList = ({dispatch}, params) => {
return customMsgListResource.save(params)
.then((res) => {
if (+res.data.code === SUCCESS) {
dispatch('UPDATE_MSG_FRESH', 0)
return Promise.resolve(res.data.data)
}
return Promise.reject(res.data)
})
}
export const msgConfig = ({dispatch}, params) => {
return customMsgConfigResource.save(params)
.then((res) => {
if (+res.data.code === SUCCESS) {
return disp
omyligaga
- 粉丝: 97
- 资源: 2万+
最新资源
- 高速追剪程序,定长追剪,威纶触摸屏+汇川5u全套程序,注释清楚
- H3C命令查询工具.zip
- Ubuntu 20.04 LTS安装与优化全流程指南
- 改进鲸鱼优化算法(IWOA,自己融合了多策略改进,名字自己取的破涕为笑),改进包括circle混沌映射,自适应阈值,非线性收敛因子,以及自适应权重和levy飞行策略,具体公式会在readme说明文
- 课程设计大作业-基于python+tkinter+MySQL的选课系统源码(95分以上)
- 西门子PLC屏幕编辑器WIN11可安装板
- STM32单片机开发的串口双机模拟汽车电量里程项目,两个STM32单片机进行数据交互,模拟主控与驱动传感器发送数据,可以手动调节数据,并显示屏显示出来 包括程序源码和protues仿真8.12版本
- 人形机器人灵巧手行业产业链图谱
- 润达医疗(体外诊断产品及技术研发商,上海润达医疗科技股份有限公司)创投信息
- python学生选课信息管理系统源码(tkinter+MySQL)高分项目
- 伺服系统转动惯量离线辨识算法仿真 1.模型简介 模型为永磁同步电机伺服控制仿真,采用Matlab R2018a Simulink搭建 模型内主要包含DC直流电压源、三相逆变器、永磁同步电机、
- HTML环境中WebSocket的应用解析及优化技巧
- MATLAB环境下一种基于深度学习的癫痫发作自动检测方法 算法运行环境为MATLAB R2021b,执行基于深度学习(LSTM)的癫痫发作自动检测 压缩包=程序+数据+参考 运行需要GPU,需要
- dsafagaghjj
- sprinboot+vue+mysql(保证能运行)
- 考虑用户舒适度的冷热电多能互补综合能源系统优化调度-邹云阳 主要内容: 针对综合能源系统优化调度的研究,具体包括: 1.建立含风光、P2G、燃气轮机、燃气锅炉等多能耦合元件的运行特性模型 2.电、热、
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈