xlb-main-login
Version:
``` yarn install ```
57 lines (50 loc) • 1.42 kB
JavaScript
import { locality } from './config'
import { axios } from '@/utils/request'
// 活动列表
export function activityList(type, params) {
return axios({
url: locality + '/v1/shop/event/' + type + '/',
method: 'get',
params,
})
}
// 删除活动
export function deleActivity(type, id) {
return axios({
url: locality + '/v1/shop/event/' + type + '/' + id + '/',
method: 'delete',
})
}
// 上架/下架/开关状态
export function activityState(type, id, changeType, state) {
return axios({
headers: { 'Content-Type': 'application/json;charset=UTF-8' },
url: locality + '/v1/shop/event/' + type + '/' + id + '/' + changeType + '/' + state + '/',
method: 'put',
})
}
// 新增活动
export function addActivity(type, data) {
return axios({
headers: { 'Content-Type': 'application/json;charset=UTF-8' },
url: locality + '/v1/shop/event/' + type + '/',
method: 'post',
data,
})
}
// 修改活动
export function amendActivity(type, data) {
return axios({
headers: { 'Content-Type': 'application/json;charset=UTF-8' },
url: locality + '/v1/shop/event/' + type + '/',
method: 'put',
data,
})
}
// 查询单个活动
export function findActivity(type, eventId) {
return axios({
url: locality + '/v1/shop/event/' + type + '/' + eventId + '/',
method: 'get',
})
}