项目初始化
This commit is contained in:
16
sheep/api/promotion/activity.js
Normal file
16
sheep/api/promotion/activity.js
Normal file
@@ -0,0 +1,16 @@
|
||||
import request from '@/sheep/request';
|
||||
|
||||
const ActivityApi = {
|
||||
// 获得单个商品,近期参与的每个活动
|
||||
getActivityListBySpuId: (spuId) => {
|
||||
return request({
|
||||
url: '/promotion/activity/list-by-spu-id',
|
||||
method: 'GET',
|
||||
params: {
|
||||
spuId,
|
||||
},
|
||||
});
|
||||
},
|
||||
};
|
||||
|
||||
export default ActivityApi;
|
12
sheep/api/promotion/article.js
Normal file
12
sheep/api/promotion/article.js
Normal file
@@ -0,0 +1,12 @@
|
||||
import request from '@/sheep/request';
|
||||
|
||||
export default {
|
||||
// 获得文章详情
|
||||
getArticle: (id, title) => {
|
||||
return request({
|
||||
url: '/promotion/article/get',
|
||||
method: 'GET',
|
||||
params: { id, title }
|
||||
});
|
||||
}
|
||||
}
|
68
sheep/api/promotion/combination.js
Normal file
68
sheep/api/promotion/combination.js
Normal file
@@ -0,0 +1,68 @@
|
||||
import request from '@/sheep/request';
|
||||
|
||||
// 拼团 API
|
||||
const CombinationApi = {
|
||||
|
||||
// 获得拼团活动分页
|
||||
getCombinationActivityPage: (params) => {
|
||||
return request({
|
||||
url: '/promotion/combination-activity/page',
|
||||
method: 'GET',
|
||||
params,
|
||||
});
|
||||
},
|
||||
|
||||
// 获得拼团活动明细
|
||||
getCombinationActivity: (id) => {
|
||||
return request({
|
||||
url: '/promotion/combination-activity/get-detail',
|
||||
method: 'GET',
|
||||
params: {
|
||||
id,
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 获得最近 n 条拼团记录(团长发起的)
|
||||
getHeadCombinationRecordList: (activityId, status, count) => {
|
||||
return request({
|
||||
url: '/promotion/combination-record/get-head-list',
|
||||
method: 'GET',
|
||||
params: {
|
||||
activityId,
|
||||
status,
|
||||
count,
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 获得我的拼团记录分页
|
||||
getCombinationRecordPage: (params) => {
|
||||
return request({
|
||||
url: "/promotion/combination-record/page",
|
||||
method: 'GET',
|
||||
params
|
||||
});
|
||||
},
|
||||
|
||||
// 获得拼团记录明细
|
||||
getCombinationRecordDetail: (id) => {
|
||||
return request({
|
||||
url: '/promotion/combination-record/get-detail',
|
||||
method: 'GET',
|
||||
params: {
|
||||
id,
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 获得拼团记录的概要信息
|
||||
getCombinationRecordSummary: () => {
|
||||
return request({
|
||||
url: '/promotion/combination-record/get-summary',
|
||||
method: 'GET',
|
||||
});
|
||||
},
|
||||
};
|
||||
|
||||
export default CombinationApi;
|
101
sheep/api/promotion/coupon.js
Normal file
101
sheep/api/promotion/coupon.js
Normal file
@@ -0,0 +1,101 @@
|
||||
import request from '@/sheep/request';
|
||||
|
||||
const CouponApi = {
|
||||
// 获得优惠劵模板列表
|
||||
getCouponTemplateListByIds: (ids) => {
|
||||
return request({
|
||||
url: '/promotion/coupon-template/list-by-ids',
|
||||
method: 'GET',
|
||||
params: { ids },
|
||||
custom: {
|
||||
showLoading: false, // 不展示 Loading,避免领取优惠劵时,不成功提示
|
||||
showError: false,
|
||||
},
|
||||
});
|
||||
},
|
||||
// 获得优惠劵模版列表
|
||||
getCouponTemplateList: (spuId, productScope, count) => {
|
||||
return request({
|
||||
url: '/promotion/coupon-template/list',
|
||||
method: 'GET',
|
||||
params: { spuId, productScope, count },
|
||||
});
|
||||
},
|
||||
// 获得优惠劵模版分页
|
||||
getCouponTemplatePage: (params) => {
|
||||
return request({
|
||||
url: '/promotion/coupon-template/page',
|
||||
method: 'GET',
|
||||
params,
|
||||
});
|
||||
},
|
||||
// 获得优惠劵模版
|
||||
getCouponTemplate: (id) => {
|
||||
return request({
|
||||
url: '/promotion/coupon-template/get',
|
||||
method: 'GET',
|
||||
params: { id },
|
||||
});
|
||||
},
|
||||
// 我的优惠劵列表
|
||||
getCouponPage: (params) => {
|
||||
return request({
|
||||
url: '/promotion/coupon/page',
|
||||
method: 'GET',
|
||||
params,
|
||||
});
|
||||
},
|
||||
// 领取优惠券
|
||||
takeCoupon: (templateId) => {
|
||||
return request({
|
||||
url: '/promotion/coupon/take',
|
||||
method: 'POST',
|
||||
data: { templateId },
|
||||
custom: {
|
||||
auth: true,
|
||||
showLoading: true,
|
||||
loadingMsg: '领取中',
|
||||
showSuccess: true,
|
||||
successMsg: '领取成功',
|
||||
},
|
||||
});
|
||||
},
|
||||
// 获得优惠劵
|
||||
getCoupon: (id) => {
|
||||
return request({
|
||||
url: '/promotion/coupon/get',
|
||||
method: 'GET',
|
||||
params: { id },
|
||||
});
|
||||
},
|
||||
// 获得未使用的优惠劵数量
|
||||
getUnusedCouponCount: () => {
|
||||
return request({
|
||||
url: '/promotion/coupon/get-unused-count',
|
||||
method: 'GET',
|
||||
custom: {
|
||||
showLoading: false,
|
||||
auth: true,
|
||||
},
|
||||
});
|
||||
},
|
||||
// 获得匹配指定商品的优惠劵列表
|
||||
getMatchCouponList: (price, spuIds, skuIds, categoryIds) => {
|
||||
return request({
|
||||
url: '/promotion/coupon/match-list',
|
||||
method: 'GET',
|
||||
params: {
|
||||
price,
|
||||
spuIds: spuIds.join(','),
|
||||
skuIds: skuIds.join(','),
|
||||
categoryIds: categoryIds.join(','),
|
||||
},
|
||||
custom: {
|
||||
showError: false,
|
||||
showLoading: false, // 避免影响 settlementOrder 结算的结果
|
||||
},
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
export default CouponApi;
|
38
sheep/api/promotion/diy.js
Normal file
38
sheep/api/promotion/diy.js
Normal file
@@ -0,0 +1,38 @@
|
||||
import request from '@/sheep/request';
|
||||
|
||||
const DiyApi = {
|
||||
getUsedDiyTemplate: () => {
|
||||
return request({
|
||||
url: '/promotion/diy-template/used',
|
||||
method: 'GET',
|
||||
custom: {
|
||||
showError: false,
|
||||
showLoading: false,
|
||||
},
|
||||
});
|
||||
},
|
||||
getDiyTemplate: (id) => {
|
||||
return request({
|
||||
url: '/promotion/diy-template/get',
|
||||
method: 'GET',
|
||||
params: {
|
||||
id
|
||||
},
|
||||
custom: {
|
||||
showError: false,
|
||||
showLoading: false,
|
||||
},
|
||||
});
|
||||
},
|
||||
getDiyPage: (id) => {
|
||||
return request({
|
||||
url: '/promotion/diy-page/get',
|
||||
method: 'GET',
|
||||
params: {
|
||||
id
|
||||
}
|
||||
});
|
||||
},
|
||||
};
|
||||
|
||||
export default DiyApi;
|
31
sheep/api/promotion/kefu.js
Normal file
31
sheep/api/promotion/kefu.js
Normal file
@@ -0,0 +1,31 @@
|
||||
import request from '@/sheep/request';
|
||||
|
||||
const KeFuApi = {
|
||||
sendKefuMessage: (data) => {
|
||||
return request({
|
||||
url: '/promotion/kefu-message/send',
|
||||
method: 'POST',
|
||||
data,
|
||||
custom: {
|
||||
auth: true,
|
||||
showLoading: true,
|
||||
loadingMsg: '发送中',
|
||||
showSuccess: true,
|
||||
successMsg: '发送成功',
|
||||
},
|
||||
});
|
||||
},
|
||||
getKefuMessagePage: (params) => {
|
||||
return request({
|
||||
url: '/promotion/kefu-message/page',
|
||||
method: 'GET',
|
||||
params,
|
||||
custom: {
|
||||
auth: true,
|
||||
showLoading: false,
|
||||
},
|
||||
});
|
||||
},
|
||||
};
|
||||
|
||||
export default KeFuApi;
|
14
sheep/api/promotion/rewardActivity.js
Normal file
14
sheep/api/promotion/rewardActivity.js
Normal file
@@ -0,0 +1,14 @@
|
||||
import request from '@/sheep/request';
|
||||
|
||||
const RewardActivityApi = {
|
||||
// 获得满减送活动
|
||||
getRewardActivity: (id) => {
|
||||
return request({
|
||||
url: '/promotion/reward-activity/get',
|
||||
method: 'GET',
|
||||
params: { id },
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
export default RewardActivityApi;
|
33
sheep/api/promotion/seckill.js
Normal file
33
sheep/api/promotion/seckill.js
Normal file
@@ -0,0 +1,33 @@
|
||||
import request from "@/sheep/request";
|
||||
|
||||
const SeckillApi = {
|
||||
// 获得秒杀时间段列表
|
||||
getSeckillConfigList: () => {
|
||||
return request({ url: 'promotion/seckill-config/list', method: 'GET' });
|
||||
},
|
||||
|
||||
// 获得当前秒杀活动
|
||||
getNowSeckillActivity: () => {
|
||||
return request({ url: 'promotion/seckill-activity/get-now', method: 'GET' });
|
||||
},
|
||||
|
||||
// 获得秒杀活动分页
|
||||
getSeckillActivityPage: (params) => {
|
||||
return request({ url: 'promotion/seckill-activity/page', method: 'GET', params });
|
||||
},
|
||||
|
||||
/**
|
||||
* 获得秒杀活动明细
|
||||
* @param {number} id 秒杀活动编号
|
||||
* @return {*}
|
||||
*/
|
||||
getSeckillActivity: (id) => {
|
||||
return request({
|
||||
url: 'promotion/seckill-activity/get-detail',
|
||||
method: 'GET',
|
||||
params: { id }
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
export default SeckillApi;
|
Reference in New Issue
Block a user