全局:优化请求的提示

This commit is contained in:
YunaiV
2024-01-20 17:28:04 +08:00
parent 33d57fd7e5
commit 22139d9a2d
15 changed files with 172 additions and 110 deletions
+15
View File
@@ -7,6 +7,10 @@ const CouponApi = {
url: '/promotion/coupon-template/list-by-ids',
method: 'GET',
params: { ids },
custom: {
showLoading: false, // 不展示 Loading,避免领取优惠劵时,不成功提示
showError: false,
},
});
},
// 获得优惠劵模版列表
@@ -47,6 +51,13 @@ const CouponApi = {
url: '/promotion/coupon/take',
method: 'POST',
data: { templateId },
custom: {
auth: true,
showLoading: true,
loadingMsg: '领取中',
showSuccess: true,
successMsg: '领取成功',
},
});
},
// 获得优惠劵
@@ -79,6 +90,10 @@ const CouponApi = {
skuIds: skuIds.join(','),
categoryIds: categoryIds.join(','),
},
custom: {
showError: false,
showLoading: false, // 避免影响 settlementOrder 结算的结果
},
});
}
};
+38
View 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;
-15
View File
@@ -1,15 +0,0 @@
import request from '@/sheep/request';
const DiyPageApi = {
getDiyPage: (id) => {
return request({
url: '/promotion/diy-page/get',
method: 'GET',
params: {
id
}
});
},
};
export default DiyPageApi;
-21
View File
@@ -1,21 +0,0 @@
import request from '@/sheep/request';
const DiyTemplateApi = {
getUsedDiyTemplate: () => {
return request({
url: '/promotion/diy-template/used',
method: 'GET',
});
},
getDiyTemplate: (id) => {
return request({
url: '/promotion/diy-template/get',
method: 'GET',
params: {
id
}
});
},
};
export default DiyTemplateApi;