✨ 请求:将自己的请求,从 request2 且到 request 中
parent
2600716d46
commit
ab48b4d640
|
@ -1,16 +1,16 @@
|
||||||
import request2 from '@/sheep/request2';
|
import request from '@/sheep/request';
|
||||||
|
|
||||||
const AddressApi = {
|
const AddressApi = {
|
||||||
// 获得用户收件地址列表
|
// 获得用户收件地址列表
|
||||||
getAddressList: () => {
|
getAddressList: () => {
|
||||||
return request2({
|
return request({
|
||||||
url: '/app-api/member/address/list',
|
url: '/app-api/member/address/list',
|
||||||
method: 'GET'
|
method: 'GET'
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 创建用户收件地址
|
// 创建用户收件地址
|
||||||
createAddress: (data) => {
|
createAddress: (data) => {
|
||||||
return request2({
|
return request({
|
||||||
url: '/app-api/member/address/create',
|
url: '/app-api/member/address/create',
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
data
|
data
|
||||||
|
@ -18,7 +18,7 @@ const AddressApi = {
|
||||||
},
|
},
|
||||||
// 更新用户收件地址
|
// 更新用户收件地址
|
||||||
updateAddress: (data) => {
|
updateAddress: (data) => {
|
||||||
return request2({
|
return request({
|
||||||
url: '/app-api/member/address/update',
|
url: '/app-api/member/address/update',
|
||||||
method: 'PUT',
|
method: 'PUT',
|
||||||
data
|
data
|
||||||
|
@ -26,7 +26,7 @@ const AddressApi = {
|
||||||
},
|
},
|
||||||
// 获得用户收件地址
|
// 获得用户收件地址
|
||||||
getAddress: (id) => {
|
getAddress: (id) => {
|
||||||
return request2({
|
return request({
|
||||||
url: '/app-api/member/address/get',
|
url: '/app-api/member/address/get',
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
params: { id }
|
params: { id }
|
||||||
|
@ -34,7 +34,7 @@ const AddressApi = {
|
||||||
},
|
},
|
||||||
// 删除用户收件地址
|
// 删除用户收件地址
|
||||||
deleteAddress: (id) => {
|
deleteAddress: (id) => {
|
||||||
return request2({
|
return request({
|
||||||
url: '/app-api/member/address/delete',
|
url: '/app-api/member/address/delete',
|
||||||
method: 'DELETE',
|
method: 'DELETE',
|
||||||
params: { id }
|
params: { id }
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
import request2 from "@/sheep/request2";
|
import request from "@/sheep/request";
|
||||||
|
|
||||||
// 拼团 API
|
// 拼团 API
|
||||||
const CombinationApi = {
|
const CombinationApi = {
|
||||||
// 获得拼团活动列表
|
// 获得拼团活动列表
|
||||||
getCombinationActivityList: (count) => {
|
getCombinationActivityList: (count) => {
|
||||||
return request2({
|
return request({
|
||||||
url: "promotion/combination-activity/list",
|
url: "promotion/combination-activity/list",
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
params: {count}
|
params: {count}
|
||||||
|
@ -13,7 +13,7 @@ const CombinationApi = {
|
||||||
|
|
||||||
// 获得拼团活动分页
|
// 获得拼团活动分页
|
||||||
getCombinationActivityPage: (params) => {
|
getCombinationActivityPage: (params) => {
|
||||||
return request2({
|
return request({
|
||||||
url: "promotion/combination-activity/page",
|
url: "promotion/combination-activity/page",
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
params
|
params
|
||||||
|
@ -22,7 +22,7 @@ const CombinationApi = {
|
||||||
|
|
||||||
// 获得拼团活动明细
|
// 获得拼团活动明细
|
||||||
getCombinationActivity: (id) => {
|
getCombinationActivity: (id) => {
|
||||||
return request2({
|
return request({
|
||||||
url: "promotion/combination-activity/get-detail",
|
url: "promotion/combination-activity/get-detail",
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
params: {
|
params: {
|
||||||
|
@ -33,7 +33,7 @@ const CombinationApi = {
|
||||||
|
|
||||||
// 获得最近 n 条拼团记录(团长发起的)
|
// 获得最近 n 条拼团记录(团长发起的)
|
||||||
getHeadCombinationRecordList: (activityId, status, count) => {
|
getHeadCombinationRecordList: (activityId, status, count) => {
|
||||||
return request2({
|
return request({
|
||||||
url: "promotion/combination-record/get-head-list",
|
url: "promotion/combination-record/get-head-list",
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
params: {
|
params: {
|
||||||
|
@ -46,7 +46,7 @@ const CombinationApi = {
|
||||||
|
|
||||||
// 获得拼团记录明细
|
// 获得拼团记录明细
|
||||||
getCombinationRecordDetail: (id) => {
|
getCombinationRecordDetail: (id) => {
|
||||||
return request2({
|
return request({
|
||||||
url: "promotion/combination-record/get-detail",
|
url: "promotion/combination-record/get-detail",
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
params: {
|
params: {
|
||||||
|
@ -57,7 +57,7 @@ const CombinationApi = {
|
||||||
|
|
||||||
// 获得拼团记录的概要信息
|
// 获得拼团记录的概要信息
|
||||||
getCombinationRecordSummary: () => {
|
getCombinationRecordSummary: () => {
|
||||||
return request2({
|
return request({
|
||||||
url: "promotion/combination-record/get-summary",
|
url: "promotion/combination-record/get-summary",
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
import request2 from '@/sheep/request2';
|
import request from '@/sheep/request';
|
||||||
|
|
||||||
const AreaApi = {
|
const AreaApi = {
|
||||||
// 获得地区树
|
// 获得地区树
|
||||||
getAreaTree: () => {
|
getAreaTree: () => {
|
||||||
return request2({
|
return request({
|
||||||
url: '/app-api/system/area/tree',
|
url: '/app-api/system/area/tree',
|
||||||
method: 'GET'
|
method: 'GET'
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,10 +1,9 @@
|
||||||
import request2 from '@/sheep/request2';
|
|
||||||
import request from '@/sheep/request';
|
import request from '@/sheep/request';
|
||||||
|
|
||||||
const AfterSaleApi = {
|
const AfterSaleApi = {
|
||||||
// 创建售后
|
// 创建售后
|
||||||
createAfterSale: (data) => {
|
createAfterSale: (data) => {
|
||||||
return request2({
|
return request({
|
||||||
url: `/app-api/trade/after-sale/create`,
|
url: `/app-api/trade/after-sale/create`,
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
data,
|
data,
|
||||||
|
@ -12,7 +11,7 @@ const AfterSaleApi = {
|
||||||
},
|
},
|
||||||
// 获得售后
|
// 获得售后
|
||||||
getAfterSale: (id) => {
|
getAfterSale: (id) => {
|
||||||
return request2({
|
return request({
|
||||||
url: `/app-api/trade/after-sale/get`,
|
url: `/app-api/trade/after-sale/get`,
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
params: {
|
params: {
|
||||||
|
@ -22,7 +21,7 @@ const AfterSaleApi = {
|
||||||
},
|
},
|
||||||
// 取消售后
|
// 取消售后
|
||||||
cancelAfterSale: (id) => {
|
cancelAfterSale: (id) => {
|
||||||
return request2({
|
return request({
|
||||||
url: `/app-api/trade/after-sale/cancel`,
|
url: `/app-api/trade/after-sale/cancel`,
|
||||||
method: 'DELETE',
|
method: 'DELETE',
|
||||||
params: {
|
params: {
|
||||||
|
@ -32,7 +31,7 @@ const AfterSaleApi = {
|
||||||
},
|
},
|
||||||
// 获得售后日志列表
|
// 获得售后日志列表
|
||||||
getAfterSaleLogList: (afterSaleId) => {
|
getAfterSaleLogList: (afterSaleId) => {
|
||||||
return request2({
|
return request({
|
||||||
url: `/app-api/trade/after-sale-log/list`,
|
url: `/app-api/trade/after-sale-log/list`,
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
params: {
|
params: {
|
||||||
|
|
|
@ -1,12 +1,11 @@
|
||||||
import request2 from '@/sheep/request2';
|
import request from '@/sheep/request';
|
||||||
|
|
||||||
const CartApi = {
|
const CartApi = {
|
||||||
addCart: (data) => {
|
addCart: (data) => {
|
||||||
return request2({
|
return request({
|
||||||
url: '/app-api/trade/cart/add',
|
url: '/app-api/trade/cart/add',
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
data: data,
|
data: data,
|
||||||
// TODO 芋艿:这里没提示
|
|
||||||
custom: {
|
custom: {
|
||||||
showSuccess: true,
|
showSuccess: true,
|
||||||
successMsg: '已添加到购物车~',
|
successMsg: '已添加到购物车~',
|
||||||
|
@ -14,21 +13,21 @@ const CartApi = {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
updateCartCount: (data) => {
|
updateCartCount: (data) => {
|
||||||
return request2({
|
return request({
|
||||||
url: '/app-api/trade/cart/update-count',
|
url: '/app-api/trade/cart/update-count',
|
||||||
method: 'PUT',
|
method: 'PUT',
|
||||||
data: data
|
data: data
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
updateCartSelected: (data) => {
|
updateCartSelected: (data) => {
|
||||||
return request2({
|
return request({
|
||||||
url: '/app-api/trade/cart/update-selected',
|
url: '/app-api/trade/cart/update-selected',
|
||||||
method: 'PUT',
|
method: 'PUT',
|
||||||
data: data
|
data: data
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
deleteCart: (ids) => {
|
deleteCart: (ids) => {
|
||||||
return request2({
|
return request({
|
||||||
url: '/app-api/trade/cart/delete',
|
url: '/app-api/trade/cart/delete',
|
||||||
method: 'DELETE',
|
method: 'DELETE',
|
||||||
params: {
|
params: {
|
||||||
|
@ -37,7 +36,7 @@ const CartApi = {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
getCartList: () => {
|
getCartList: () => {
|
||||||
return request2({
|
return request({
|
||||||
url: '/app-api/trade/cart/list',
|
url: '/app-api/trade/cart/list',
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,10 +1,9 @@
|
||||||
import request2 from '@/sheep/request2';
|
|
||||||
import request from '@/sheep/request';
|
import request from '@/sheep/request';
|
||||||
|
|
||||||
const TradeConfigApi = {
|
const TradeConfigApi = {
|
||||||
// 获得交易配置
|
// 获得交易配置
|
||||||
getTradeConfig: () => {
|
getTradeConfig: () => {
|
||||||
return request2({
|
return request({
|
||||||
url: `/app-api/trade/config/get`,
|
url: `/app-api/trade/config/get`,
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
});
|
});
|
||||||
|
|
|
@ -130,8 +130,8 @@ http.interceptors.response.use(
|
||||||
(response.data.msg !== '' || response.config.custom.successMsg !== '') &&
|
(response.data.msg !== '' || response.config.custom.successMsg !== '') &&
|
||||||
response.config.custom.showSuccess
|
response.config.custom.showSuccess
|
||||||
) {
|
) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: response.config.custom.successMsg || response.data.msg,
|
title: response.config.custom.successMsg,
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue