合并初始化
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
import request from '@/sheep/request';
|
||||
|
||||
export default {
|
||||
myGroupon: (params) =>
|
||||
request({
|
||||
url: 'activity/groupon/myGroupons',
|
||||
method: 'GET',
|
||||
params,
|
||||
}),
|
||||
getGrouponList: (params) =>
|
||||
request({
|
||||
url: 'activity/groupon',
|
||||
method: 'GET',
|
||||
params,
|
||||
}),
|
||||
grouponDetail: (id) =>
|
||||
request({
|
||||
url: 'activity/groupon/' + id,
|
||||
method: 'GET',
|
||||
}),
|
||||
signList: (params) =>
|
||||
request({
|
||||
url: 'activity/signin',
|
||||
method: 'GET',
|
||||
params,
|
||||
}),
|
||||
signAdd: () =>
|
||||
request({
|
||||
url: 'activity/signin',
|
||||
method: 'POST',
|
||||
}),
|
||||
replenish: (data) =>
|
||||
request({
|
||||
url: 'activity/signin/replenish',
|
||||
method: 'POST',
|
||||
data,
|
||||
}),
|
||||
activity: (id) =>
|
||||
request({
|
||||
url: 'activity/activity/' + id,
|
||||
method: 'GET',
|
||||
}),
|
||||
};
|
||||
@@ -0,0 +1,146 @@
|
||||
import request from '@/sheep/request';
|
||||
import { baseUrl } from '@/sheep/config';
|
||||
|
||||
export default {
|
||||
// TODO 芋艿:测试
|
||||
test: () =>
|
||||
request({
|
||||
url: '/app-api/promotion/decorate/list',
|
||||
params: {
|
||||
page: 1
|
||||
},
|
||||
custom: {
|
||||
showError: false,
|
||||
showLoading: false,
|
||||
},
|
||||
}),
|
||||
// 系统初始化
|
||||
init: (templateId) =>
|
||||
request({
|
||||
url: 'init',
|
||||
params: {
|
||||
templateId,
|
||||
},
|
||||
custom: {
|
||||
showError: false,
|
||||
showLoading: false,
|
||||
},
|
||||
}),
|
||||
// 同步客户端页面到后端
|
||||
pageSync: (pages) =>
|
||||
request({
|
||||
url: 'pageSync',
|
||||
method: 'POST',
|
||||
data: {
|
||||
pages,
|
||||
},
|
||||
custom: {
|
||||
showError: false,
|
||||
showLoading: false,
|
||||
},
|
||||
}),
|
||||
// 发送短信
|
||||
sendSms: (data) =>
|
||||
request({
|
||||
url: 'sendSms',
|
||||
method: 'POST',
|
||||
data,
|
||||
custom: {
|
||||
showSuccess: true,
|
||||
loadingMsg: '发送中',
|
||||
},
|
||||
}),
|
||||
//意见反馈
|
||||
feedback: (data) =>
|
||||
request({
|
||||
url: 'feedback',
|
||||
method: 'POST',
|
||||
data,
|
||||
}),
|
||||
// 自定义页面
|
||||
page: (id) =>
|
||||
request({
|
||||
url: 'page/' + id,
|
||||
method: 'GET',
|
||||
}),
|
||||
//积分商城
|
||||
scoreShop: {
|
||||
list: (params) =>
|
||||
request({
|
||||
url: 'app/scoreShop',
|
||||
method: 'GET',
|
||||
params,
|
||||
}),
|
||||
ids: (params = {}) =>
|
||||
request({
|
||||
url: 'app/scoreShop/ids',
|
||||
method: 'GET',
|
||||
params,
|
||||
}),
|
||||
detail: (id) =>
|
||||
request({
|
||||
url: 'app/scoreShop/' + id,
|
||||
method: 'GET',
|
||||
}),
|
||||
},
|
||||
//小程序直播
|
||||
mplive: {
|
||||
getRoomList: (ids) =>
|
||||
request({
|
||||
url: 'app/mplive/getRoomList',
|
||||
method: 'GET',
|
||||
params: {
|
||||
ids: ids.join(','),
|
||||
}
|
||||
}),
|
||||
getMpLink: () =>
|
||||
request({
|
||||
url: 'app/mplive/getMpLink',
|
||||
method: 'GET'
|
||||
}),
|
||||
},
|
||||
|
||||
//上传
|
||||
upload: (file, group = 'ugc', callback) => {
|
||||
const token = uni.getStorageSync('token');
|
||||
uni.showLoading({
|
||||
title: '上传中',
|
||||
});
|
||||
return new Promise((resolve, reject) => {
|
||||
// 此处先换成yudao
|
||||
uni.uploadFile({
|
||||
url: 'http://api-dashboard.yudao.iocoder.cn' + '/app-api/infra/file/upload',
|
||||
filePath: file,
|
||||
name: 'file',
|
||||
formData: {
|
||||
group,
|
||||
},
|
||||
header: {
|
||||
// Accept: 'text/json',
|
||||
// Authorization: token,
|
||||
Accept : '*/*',
|
||||
'tenant-id' :'1',
|
||||
Authorization: 'Bearer test247',
|
||||
},
|
||||
success: (uploadFileRes) => {
|
||||
let result = JSON.parse(uploadFileRes.data);
|
||||
if (result.error === 1) {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: result.msg,
|
||||
});
|
||||
} else {
|
||||
return resolve(result.data);
|
||||
}
|
||||
},
|
||||
fail: (error) => {
|
||||
console.log('上传失败:', error);
|
||||
return resolve(false);
|
||||
},
|
||||
complete: () => {
|
||||
uni.hideLoading();
|
||||
},
|
||||
});
|
||||
});
|
||||
},
|
||||
};
|
||||
@@ -0,0 +1,42 @@
|
||||
import request from '@/sheep/request';
|
||||
import request2 from '@/sheep/request2';
|
||||
|
||||
export default {
|
||||
list: (data) =>
|
||||
request2({
|
||||
url: 'trade/cart/list',
|
||||
method: 'GET',
|
||||
custom: {
|
||||
showLoading: false,
|
||||
auth: true,
|
||||
},
|
||||
}),
|
||||
append: (data) =>
|
||||
request({
|
||||
url: 'cart',
|
||||
method: 'POST',
|
||||
custom: {
|
||||
showSuccess: true,
|
||||
successMsg: '已添加到购物车~',
|
||||
},
|
||||
data: {
|
||||
...data,
|
||||
type: 'inc',
|
||||
},
|
||||
}),
|
||||
// 删除购物车
|
||||
delete: (ids) =>
|
||||
request2({
|
||||
url: 'trade/cart/delete?ids=' + ids,
|
||||
method: 'DELETE',
|
||||
}),
|
||||
update: (data) =>
|
||||
request2({
|
||||
url: 'trade/cart/update-count',
|
||||
method: 'PUT',
|
||||
data: {
|
||||
...data,
|
||||
type: 'cover',
|
||||
},
|
||||
}),
|
||||
};
|
||||
@@ -0,0 +1,10 @@
|
||||
import request2 from '@/sheep/request2';
|
||||
|
||||
export default {
|
||||
list: (params) =>
|
||||
request2({
|
||||
url: 'product/category/list',
|
||||
method: 'GET',
|
||||
params,
|
||||
}),
|
||||
};
|
||||
@@ -0,0 +1,13 @@
|
||||
import request from '@/sheep/request';
|
||||
|
||||
export default {
|
||||
// 获取聊天token
|
||||
unifiedToken: () =>
|
||||
request({
|
||||
url: 'unifiedToken',
|
||||
custom: {
|
||||
showError: false,
|
||||
showLoading: false,
|
||||
},
|
||||
}),
|
||||
};
|
||||
@@ -0,0 +1,65 @@
|
||||
import request from '@/sheep/request';
|
||||
|
||||
export default {
|
||||
// 分销商详情
|
||||
agent: () =>
|
||||
request({
|
||||
url: 'commission/agent',
|
||||
method: 'GET',
|
||||
custom: {
|
||||
showLoading: false,
|
||||
showError: false,
|
||||
},
|
||||
}),
|
||||
// 分销表单
|
||||
form: () =>
|
||||
request({
|
||||
url: 'commission/agent/form',
|
||||
method: 'GET',
|
||||
}),
|
||||
// 申请分销商
|
||||
apply: (data) =>
|
||||
request({
|
||||
url: 'commission/agent/apply',
|
||||
method: 'POST',
|
||||
data,
|
||||
custom: {
|
||||
showSuccess: true,
|
||||
},
|
||||
}),
|
||||
// 分销动态
|
||||
log: (params) =>
|
||||
request({
|
||||
url: 'commission/log',
|
||||
method: 'GET',
|
||||
params,
|
||||
}),
|
||||
// 分销订单
|
||||
order: (params) =>
|
||||
request({
|
||||
url: 'commission/order',
|
||||
method: 'GET',
|
||||
params,
|
||||
}),
|
||||
// 分销商品
|
||||
goods: (params) =>
|
||||
request({
|
||||
url: 'commission/goods',
|
||||
method: 'GET',
|
||||
params,
|
||||
}),
|
||||
// 我的团队
|
||||
team: (params) =>
|
||||
request({
|
||||
url: 'commission/agent/team',
|
||||
method: 'GET',
|
||||
params,
|
||||
}),
|
||||
// 佣金转余额
|
||||
transfer: (data) =>
|
||||
request({
|
||||
url: 'commission/agent/transfer',
|
||||
method: 'POST',
|
||||
data,
|
||||
}),
|
||||
};
|
||||
@@ -0,0 +1,45 @@
|
||||
import request from '@/sheep/request';
|
||||
import request2 from '@/sheep/request2';
|
||||
|
||||
export default {
|
||||
// 我的拼团
|
||||
list: (params) =>
|
||||
request({
|
||||
url: 'coupon',
|
||||
method: 'GET',
|
||||
params,
|
||||
custom: {
|
||||
showLoading: false,
|
||||
},
|
||||
}),
|
||||
userCoupon: (params) =>
|
||||
request2({
|
||||
url: 'promotion/coupon/page',
|
||||
method: 'GET',
|
||||
params,
|
||||
}),
|
||||
// userCoupon: (params) =>
|
||||
// request({
|
||||
// url: 'user/coupon',
|
||||
// method: 'GET',
|
||||
// params,
|
||||
// }),
|
||||
detail: (id, user_coupon_id) =>
|
||||
request({
|
||||
url: 'coupon/' + id,
|
||||
method: 'GET',
|
||||
params: {
|
||||
user_coupon_id,
|
||||
},
|
||||
}),
|
||||
get: (id) =>
|
||||
request({
|
||||
url: 'coupon/get/' + id,
|
||||
method: 'POST',
|
||||
}),
|
||||
listByGoods: (id) =>
|
||||
request({
|
||||
url: 'coupon/listByGoods/' + id,
|
||||
method: 'GET',
|
||||
}),
|
||||
};
|
||||
@@ -0,0 +1,25 @@
|
||||
import request from '@/sheep/request';
|
||||
import request2 from '@/sheep/request2';
|
||||
|
||||
export default {
|
||||
area: () =>
|
||||
request2({
|
||||
url: 'system/area/tree',
|
||||
method: 'GET',
|
||||
}),
|
||||
// area: () =>
|
||||
// request({
|
||||
// url: 'data/area',
|
||||
// method: 'GET',
|
||||
// }),
|
||||
faq: () =>
|
||||
request({
|
||||
url: 'data/faq',
|
||||
method: 'GET',
|
||||
}),
|
||||
richtext: (id) =>
|
||||
request({
|
||||
url: 'data/richtext/' + id,
|
||||
method: 'GET',
|
||||
}),
|
||||
};
|
||||
@@ -0,0 +1,80 @@
|
||||
import request from '@/sheep/request';
|
||||
import request2 from '@/sheep/request2';
|
||||
|
||||
export default {
|
||||
// 商品详情
|
||||
detail: (id, params = {}) =>
|
||||
request2({
|
||||
url: 'product/spu/get-detail?id=' + id,
|
||||
method: 'GET',
|
||||
params,
|
||||
custom: {
|
||||
showLoading: false,
|
||||
showError: false,
|
||||
},
|
||||
}),
|
||||
|
||||
// 商品列表
|
||||
list: (params) =>
|
||||
request2({
|
||||
url: 'product/spu/page',
|
||||
method: 'GET',
|
||||
params,
|
||||
custom: {
|
||||
showLoading: false,
|
||||
showError: false,
|
||||
},
|
||||
}),
|
||||
|
||||
// 商品查询
|
||||
ids: (params = {}) =>
|
||||
request({
|
||||
url: 'goods/goods/ids',
|
||||
method: 'GET',
|
||||
params,
|
||||
custom: {
|
||||
showLoading: false,
|
||||
showError: false,
|
||||
},
|
||||
}),
|
||||
|
||||
// 商品评价列表
|
||||
comment: (id, params = {}) =>
|
||||
request2({
|
||||
url: 'product/comment/list?spuId=' + id,
|
||||
method: 'GET',
|
||||
params,
|
||||
custom: {
|
||||
showLoading: false,
|
||||
showError: false,
|
||||
},
|
||||
}),
|
||||
// 商品评价类型
|
||||
getType: (id) =>
|
||||
request({
|
||||
url: 'goods/comment/getType/' + id,
|
||||
method: 'GET',
|
||||
custom: {
|
||||
showLoading: false,
|
||||
showError: false,
|
||||
},
|
||||
}),
|
||||
// 活动商品查询
|
||||
// 商品查询
|
||||
activity: (params = {}) =>
|
||||
request({
|
||||
url: 'goods/goods/activity',
|
||||
method: 'GET',
|
||||
params,
|
||||
custom: {
|
||||
showLoading: false,
|
||||
showError: false,
|
||||
},
|
||||
}),
|
||||
activityList: (params = {}) =>
|
||||
request({
|
||||
url: 'goods/goods/activityList',
|
||||
method: 'GET',
|
||||
params,
|
||||
}),
|
||||
};
|
||||
@@ -0,0 +1,10 @@
|
||||
const files = import.meta.globEager('./*.js');
|
||||
let api = {};
|
||||
Object.keys(files).forEach((key) => {
|
||||
api = {
|
||||
...api,
|
||||
[key.replace(/(.*\/)*([^.]+).*/gi, '$2')]: files[key].default,
|
||||
};
|
||||
});
|
||||
|
||||
export default api;
|
||||
@@ -0,0 +1,14 @@
|
||||
import request2 from '@/sheep/request2';
|
||||
|
||||
export default {
|
||||
decorate: () =>
|
||||
request2({
|
||||
url: 'promotion/decorate/list?page=1',
|
||||
method: 'GET',
|
||||
}),
|
||||
spids: () =>
|
||||
request2({
|
||||
url: 'product/spu/page?recommendType=best&pageNo=1&pageSize=10',
|
||||
method: 'GET',
|
||||
}),
|
||||
};
|
||||
@@ -0,0 +1,192 @@
|
||||
import request from '@/sheep/request';
|
||||
import request2 from '@/sheep/request2';
|
||||
|
||||
export default {
|
||||
// 订单详情
|
||||
detail: (id, params) =>
|
||||
request2({
|
||||
url: 'trade/order/get-detail?id=' + id,
|
||||
method: 'GET',
|
||||
params,
|
||||
}),
|
||||
// detail: (id, params) =>
|
||||
// request({
|
||||
// url: 'order/order/' + id,
|
||||
// method: 'GET',
|
||||
// params,
|
||||
// }),
|
||||
// 发票详情
|
||||
invoice: (id) =>
|
||||
request({
|
||||
url: 'order/invoice/' + id,
|
||||
method: 'GET',
|
||||
}),
|
||||
// 获取支付结果
|
||||
payResult: (id) =>
|
||||
request({
|
||||
url: 'order/order/' + id,
|
||||
method: 'GET',
|
||||
custom: {
|
||||
showLoading: false,
|
||||
},
|
||||
}),
|
||||
itemDetail: (id, itemId) =>
|
||||
request({
|
||||
url: 'order/order/itemDetail/' + id + '/' + itemId,
|
||||
method: 'GET',
|
||||
custom: {
|
||||
showLoading: false,
|
||||
},
|
||||
}),
|
||||
// 订单列表
|
||||
list: (params) =>
|
||||
request2({
|
||||
url: 'trade/order/page',
|
||||
method: 'GET',
|
||||
params,
|
||||
custom: {
|
||||
showLoading: false,
|
||||
},
|
||||
}),
|
||||
// list: (params) =>
|
||||
// request({
|
||||
// url: 'order/order',
|
||||
// method: 'GET',
|
||||
// params,
|
||||
// custom: {
|
||||
// showLoading: false,
|
||||
// },
|
||||
// }),
|
||||
// 计算订单信息
|
||||
calc: (data) => {
|
||||
const data2 = {
|
||||
...data,
|
||||
}
|
||||
// 解决 SpringMVC 接受 List<Item> 参数的问题
|
||||
delete data2.items
|
||||
for (let i = 0; i < data.items.length; i++) {
|
||||
// data2['items[' + i + '' + '].skuId'] = data.items[i].skuId + '';
|
||||
// data2['items[' + i + '' + '].count'] = data.items[i].count + '';
|
||||
// data2['items[' + i + '' + '].cartId'] = data.items[i].cartId + '';
|
||||
data2['items' + `%5B${i}%5D` + '.skuId'] = data.items[i].skuId + '';
|
||||
data2['items' + `%5B${i}%5D` + '.count'] = data.items[i].count + '';
|
||||
data2['items' + `%5B${i}%5D` + '.cartId'] = data.items[i].cartId + '';
|
||||
}
|
||||
console.log(data2, '对比数据')
|
||||
return request2({
|
||||
url: 'trade/order/settlement',
|
||||
method: 'GET',
|
||||
// data,
|
||||
params: data2
|
||||
})
|
||||
},
|
||||
// calc: (data) =>
|
||||
// request({
|
||||
// url: 'order/order/calc',
|
||||
// method: 'POST',
|
||||
// data,
|
||||
// }),
|
||||
// 创建订单
|
||||
create: (data) =>
|
||||
request({
|
||||
url: 'order/order/create',
|
||||
method: 'POST',
|
||||
data,
|
||||
}),
|
||||
//订单可用优惠券
|
||||
coupons: (data) =>
|
||||
request({
|
||||
url: 'order/order/coupons',
|
||||
method: 'POST',
|
||||
data,
|
||||
}),
|
||||
// 确认收货
|
||||
confirm: (id) =>
|
||||
request({
|
||||
url: 'order/order/confirm/' + id,
|
||||
method: 'PUT',
|
||||
}),
|
||||
// 评价订单
|
||||
comment: (data) =>
|
||||
request2({
|
||||
url: 'trade/order/item/create-comment',
|
||||
method: 'POST',
|
||||
data,
|
||||
}),
|
||||
// comment: (id, data) =>
|
||||
// request({
|
||||
// url: 'order/order/comment/' + id,
|
||||
// method: 'POST',
|
||||
// data,
|
||||
// }),
|
||||
// 申请退款
|
||||
applyRefund: (id) =>
|
||||
request({
|
||||
url: 'order/order/applyRefund/' + id,
|
||||
method: 'PUT',
|
||||
}),
|
||||
// 取消订单
|
||||
cancel: (id) =>
|
||||
request({
|
||||
url: 'order/order/cancel/' + id,
|
||||
method: 'PUT',
|
||||
}),
|
||||
// 删除订单
|
||||
delete: (id) =>
|
||||
request({
|
||||
url: 'order/order/' + id,
|
||||
method: 'DELETE',
|
||||
}),
|
||||
// 售后
|
||||
aftersale: {
|
||||
// 申请售后
|
||||
apply: (data) =>
|
||||
request({
|
||||
url: 'order/aftersale',
|
||||
method: 'POST',
|
||||
data,
|
||||
}),
|
||||
list: (params) =>
|
||||
request2({
|
||||
url: 'trade/after-sale/page',
|
||||
method: 'GET',
|
||||
params,
|
||||
custom: {
|
||||
showLoading: false,
|
||||
},
|
||||
}),
|
||||
// list: (params) =>
|
||||
// request({
|
||||
// url: 'order/aftersale',
|
||||
// method: 'GET',
|
||||
// params,
|
||||
// custom: {
|
||||
// showLoading: false,
|
||||
// },
|
||||
// }),
|
||||
//取消售后
|
||||
cancel: (id) =>
|
||||
request({
|
||||
url: 'order/aftersale/cancel/' + id,
|
||||
method: 'PUT',
|
||||
}),
|
||||
//删除售后单
|
||||
delete: (id) =>
|
||||
request({
|
||||
url: 'order/aftersale/' + id,
|
||||
method: 'DELETE',
|
||||
}),
|
||||
// 售后详情
|
||||
detail: (id) =>
|
||||
request2({
|
||||
url: 'trade/after-sale/get?id=' + id,
|
||||
method: 'GET',
|
||||
}),
|
||||
},
|
||||
//订单包裹
|
||||
express: (id, orderId) =>
|
||||
request({
|
||||
url: 'order/express/' + id + `${orderId ? '/' + orderId : ''}`,
|
||||
method: 'GET',
|
||||
}),
|
||||
};
|
||||
@@ -0,0 +1,44 @@
|
||||
import request from '@/sheep/request';
|
||||
|
||||
export default {
|
||||
// 预支付
|
||||
prepay: (data) =>
|
||||
request({
|
||||
url: 'pay/prepay',
|
||||
method: 'POST',
|
||||
data,
|
||||
custom: {
|
||||
loadingMsg: '支付中',
|
||||
},
|
||||
}),
|
||||
// 发起提现
|
||||
withdraw: {
|
||||
list: (params) =>
|
||||
request({
|
||||
url: 'withdraw',
|
||||
method: 'GET',
|
||||
params,
|
||||
custom: {
|
||||
auth: true,
|
||||
},
|
||||
}),
|
||||
rules: () =>
|
||||
request({
|
||||
url: 'withdraw/rules',
|
||||
method: 'GET',
|
||||
custom: {
|
||||
auth: true,
|
||||
},
|
||||
}),
|
||||
apply: (data) =>
|
||||
request({
|
||||
url: 'withdraw/apply',
|
||||
method: 'POST',
|
||||
data,
|
||||
custom: {
|
||||
loadingMsg: '申请中',
|
||||
auth: true,
|
||||
},
|
||||
}),
|
||||
},
|
||||
};
|
||||
@@ -0,0 +1,12 @@
|
||||
import request from '@/sheep/request';
|
||||
|
||||
const CategoryApi = {
|
||||
// 查询分类列表
|
||||
getCategoryList: () => {
|
||||
return request({
|
||||
url: '/app-api/product/category/list',
|
||||
method: 'GET'
|
||||
});
|
||||
}
|
||||
};
|
||||
export default CategoryApi;
|
||||
@@ -0,0 +1,18 @@
|
||||
import request from '@/sheep/request';
|
||||
|
||||
const CommentApi = {
|
||||
// 获得商品评价分页
|
||||
getCommentPage: (spuId, pageNo, pageSize, type) => {
|
||||
return request({
|
||||
url: '/app-api/product/comment/page',
|
||||
method: 'GET',
|
||||
params: {
|
||||
spuId,
|
||||
pageNo,
|
||||
pageSize,
|
||||
type
|
||||
},
|
||||
});
|
||||
},
|
||||
};
|
||||
export default CommentApi;
|
||||
@@ -0,0 +1,37 @@
|
||||
import request from '@/sheep/request';
|
||||
|
||||
const SpuApi = {
|
||||
// 获得商品 SPU 列表
|
||||
getSpuList: (recommendType) => {
|
||||
return request({
|
||||
url: '/app-api/product/spu/list',
|
||||
method: 'GET',
|
||||
params: {recommendType},
|
||||
});
|
||||
},
|
||||
// 获得商品 SPU 列表
|
||||
getSpuListByIds: (ids) => {
|
||||
return request({
|
||||
url: '/app-api/product/spu/list-by-ids',
|
||||
method: 'GET',
|
||||
params: {ids},
|
||||
});
|
||||
},
|
||||
// 获得商品 SPU 分页
|
||||
getSpuPage: (data) => {
|
||||
return request({
|
||||
url: '/app-api/product/spu/page',
|
||||
method: 'GET',
|
||||
data
|
||||
});
|
||||
},
|
||||
// 查询商品
|
||||
getSpuDetail: (id) => {
|
||||
return request({
|
||||
url: '/app-api/product/spu/get-detail',
|
||||
method: 'GET',
|
||||
params: { id },
|
||||
});
|
||||
}
|
||||
};
|
||||
export default SpuApi;
|
||||
@@ -0,0 +1,16 @@
|
||||
import request2 from '@/sheep/request2';
|
||||
|
||||
const ActivityApi = {
|
||||
// 获得单个商品,近期参与的每个活动
|
||||
getActivityListBySpuId: (spuId) => {
|
||||
return request2({
|
||||
url: '/app-api/promotion/activity/list-by-spu-id',
|
||||
method: 'GET',
|
||||
params: {
|
||||
spuId,
|
||||
},
|
||||
});
|
||||
},
|
||||
};
|
||||
|
||||
export default ActivityApi;
|
||||
@@ -0,0 +1,12 @@
|
||||
import request from '@/sheep/request';
|
||||
|
||||
export default {
|
||||
// 获得文章详情
|
||||
getArticle: (id) => {
|
||||
return request({
|
||||
url: '/app-api/promotion/article/get',
|
||||
method: 'GET',
|
||||
params: { id }
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
import request2 from "@/sheep/request2";
|
||||
|
||||
// 拼团 API
|
||||
const CombinationApi = {
|
||||
// 获得拼团活动列表
|
||||
getCombinationActivityList: (count) => {
|
||||
return request2({
|
||||
url: "promotion/combination-activity/list",
|
||||
method: 'GET',
|
||||
params: {count}
|
||||
});
|
||||
},
|
||||
|
||||
// 获得拼团活动分页
|
||||
getCombinationActivityPage: (params) => {
|
||||
return request2({
|
||||
url: "promotion/combination-activity/page",
|
||||
method: 'GET',
|
||||
params
|
||||
});
|
||||
},
|
||||
|
||||
// 获得拼团活动明细
|
||||
getCombinationActivity: (id) => {
|
||||
return request2({
|
||||
url: "promotion/combination-activity/get-detail",
|
||||
method: 'GET',
|
||||
params: {
|
||||
id
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
// 获得最近 n 条拼团记录(团长发起的)
|
||||
getHeadCombinationRecordList: (activityId, status, count) => {
|
||||
return request2({
|
||||
url: "promotion/combination-record/get-head-list",
|
||||
method: 'GET',
|
||||
params: {
|
||||
activityId,
|
||||
status,
|
||||
count
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
// 获得拼团记录明细
|
||||
getCombinationRecordDetail: (id) => {
|
||||
return request2({
|
||||
url: "promotion/combination-record/get-detail",
|
||||
method: 'GET',
|
||||
params: {
|
||||
id
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
// 获得拼团记录的概要信息
|
||||
getCombinationRecordSummary: () => {
|
||||
return request2({
|
||||
url: "promotion/combination-record/get-summary",
|
||||
method: 'GET',
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
export default CombinationApi
|
||||
@@ -0,0 +1,20 @@
|
||||
import request from '@/sheep/request';
|
||||
|
||||
export default {
|
||||
// 获得优惠劵模板列表
|
||||
getCouponTemplateListByIds: (ids) => {
|
||||
return request({
|
||||
url: '/app-api/promotion/coupon-template/list-by-ids',
|
||||
method: 'GET',
|
||||
params: { ids },
|
||||
});
|
||||
},
|
||||
// 获得优惠劵模版列表
|
||||
getCouponTemplateList: (spuId, productScope, count) => {
|
||||
return request({
|
||||
url: '/app-api/promotion/coupon-template/list',
|
||||
method: 'GET',
|
||||
params: { spuId, productScope, count },
|
||||
});
|
||||
},
|
||||
};
|
||||
@@ -0,0 +1,20 @@
|
||||
import request from '@/sheep/request';
|
||||
|
||||
const DiyTemplateApi = {
|
||||
// TODO 芋艿:测试
|
||||
getUsedDiyTemplate: () => {
|
||||
return request({
|
||||
url: '/app-api/promotion/diy-template/used',
|
||||
method: 'GET',
|
||||
});
|
||||
},
|
||||
getDiyTemplate: (id) => {
|
||||
return request({
|
||||
url: '/app-api/promotion/diy-template/get',
|
||||
method: 'GET',
|
||||
params: { id }
|
||||
});
|
||||
},
|
||||
};
|
||||
|
||||
export default DiyTemplateApi;
|
||||
@@ -0,0 +1,33 @@
|
||||
import request2 from "@/sheep/request2";
|
||||
|
||||
const SeckillApi = {
|
||||
// 获得秒杀时间段列表
|
||||
getSeckillConfigList: () => {
|
||||
return request2({ url: 'promotion/seckill-config/list', method: 'GET' });
|
||||
},
|
||||
|
||||
// 获得当前秒杀活动
|
||||
getNowSeckillActivity: () => {
|
||||
return request2({ url: 'promotion/seckill-activity/get-now', method: 'GET' });
|
||||
},
|
||||
|
||||
// 获得秒杀活动分页
|
||||
getSeckillActivityPage: () => {
|
||||
return request2({ url: 'promotion/seckill-activity/page', method: 'GET' });
|
||||
},
|
||||
|
||||
/**
|
||||
* 获得秒杀活动明细
|
||||
* @param {number} id 秒杀活动编号
|
||||
* @return {*}
|
||||
*/
|
||||
getSeckillActivity: (id) => {
|
||||
return request2({
|
||||
url: 'promotion/seckill-activity/get-detail',
|
||||
method: 'GET',
|
||||
params: { id }
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
export default SeckillApi;
|
||||
@@ -0,0 +1,127 @@
|
||||
import request from '@/sheep/request';
|
||||
import { baseUrl, apiPath } from '@/sheep/config';
|
||||
|
||||
export default {
|
||||
// 微信相关
|
||||
wechat: {
|
||||
// 第三方登录
|
||||
login: (data) =>
|
||||
request({
|
||||
url: 'third/wechat/login',
|
||||
method: 'POST',
|
||||
data,
|
||||
custom: {
|
||||
showSuccess: true,
|
||||
loadingMsg: '登陆中',
|
||||
},
|
||||
}),
|
||||
|
||||
// 绑定微信
|
||||
bind: (data) =>
|
||||
request({
|
||||
url: 'third/wechat/bind',
|
||||
method: 'POST',
|
||||
data,
|
||||
custom: {
|
||||
showSuccess: true,
|
||||
loadingMsg: '绑定中',
|
||||
},
|
||||
}),
|
||||
|
||||
// 解除绑定微信
|
||||
unbind: (data) =>
|
||||
request({
|
||||
url: 'third/wechat/unbind',
|
||||
method: 'POST',
|
||||
data,
|
||||
custom: {
|
||||
showSuccess: true,
|
||||
loadingMsg: '解除绑定',
|
||||
},
|
||||
}),
|
||||
|
||||
// 公众号授权
|
||||
oauthLogin: (data) =>
|
||||
request({
|
||||
url: 'third/wechat/oauthLogin',
|
||||
method: 'GET',
|
||||
data,
|
||||
custom: {
|
||||
showSuccess: true,
|
||||
loadingMsg: '登陆中',
|
||||
},
|
||||
}),
|
||||
|
||||
// 获取小程序sessionKey(后端不会给前端返回真实的sessionKey)
|
||||
getSessionId: (data) =>
|
||||
request({
|
||||
url: 'third/wechat/getSessionId',
|
||||
method: 'POST',
|
||||
data,
|
||||
custom: {
|
||||
showLoading: false,
|
||||
},
|
||||
}),
|
||||
|
||||
// 微信小程序 绑定一键获取的手机号
|
||||
bindUserPhoneNumber: (data) =>
|
||||
request({
|
||||
url: 'third/wechat/bindUserPhoneNumber',
|
||||
method: 'POST',
|
||||
data,
|
||||
custom: {
|
||||
showSuccess: true,
|
||||
loadingMsg: '获取中',
|
||||
},
|
||||
}),
|
||||
|
||||
// 网页jssdk
|
||||
jssdk: (data) =>
|
||||
request({
|
||||
url: 'third/wechat/jssdk',
|
||||
method: 'GET',
|
||||
data,
|
||||
custom: {
|
||||
showError: false,
|
||||
showLoading: false,
|
||||
},
|
||||
}),
|
||||
|
||||
// 小程序订阅消息
|
||||
subscribeTemplate: (params) =>
|
||||
request({
|
||||
url: 'third/wechat/subscribeTemplate',
|
||||
method: 'GET',
|
||||
params: {
|
||||
platform: 'miniProgram',
|
||||
},
|
||||
custom: {
|
||||
showError: false,
|
||||
showLoading: false,
|
||||
},
|
||||
}),
|
||||
|
||||
// 获取微信小程序码
|
||||
getWxacode: (path) =>
|
||||
`${baseUrl}${apiPath}third/wechat/wxacode?platform=miniProgram&payload=${encodeURIComponent(
|
||||
JSON.stringify({
|
||||
path,
|
||||
}),
|
||||
)}`,
|
||||
},
|
||||
|
||||
// 苹果相关
|
||||
apple: {
|
||||
// 第三方登录
|
||||
login: (data) =>
|
||||
request({
|
||||
url: 'third/apple/login',
|
||||
method: 'POST',
|
||||
data,
|
||||
custom: {
|
||||
showSuccess: true,
|
||||
loadingMsg: '登陆中',
|
||||
},
|
||||
}),
|
||||
},
|
||||
};
|
||||
@@ -0,0 +1,37 @@
|
||||
import request from '@/sheep/request';
|
||||
|
||||
export default {
|
||||
order: (id) =>
|
||||
request({
|
||||
url: 'trade/order/' + id,
|
||||
method: 'GET',
|
||||
custom: {
|
||||
showLoading: false,
|
||||
},
|
||||
}),
|
||||
orderLog: (params) =>
|
||||
request({
|
||||
url: 'trade/order',
|
||||
method: 'GET',
|
||||
params,
|
||||
custom: {
|
||||
showLoading: false,
|
||||
},
|
||||
}),
|
||||
|
||||
rechargeRules: () =>
|
||||
request({
|
||||
url: 'trade/order/rechargeRules',
|
||||
method: 'GET',
|
||||
custom: {
|
||||
showError: false,
|
||||
showLoading: false,
|
||||
},
|
||||
}),
|
||||
recharge: (data) =>
|
||||
request({
|
||||
url: 'trade/order/recharge',
|
||||
method: 'POST',
|
||||
data,
|
||||
}),
|
||||
};
|
||||
@@ -0,0 +1,459 @@
|
||||
import request from '@/sheep/request';
|
||||
import request2 from '@/sheep/request2';
|
||||
import $platform from '@/sheep/platform';
|
||||
|
||||
export default {
|
||||
getUnused: () =>
|
||||
request2({
|
||||
url: 'promotion/coupon/get-unused-count',
|
||||
method: 'GET',
|
||||
custom: {
|
||||
showLoading: false,
|
||||
auth: true,
|
||||
},
|
||||
}),
|
||||
profile: () =>
|
||||
request2({
|
||||
url: 'member/user/get',
|
||||
method: 'GET',
|
||||
custom: {
|
||||
showLoading: false,
|
||||
auth: true,
|
||||
},
|
||||
}),
|
||||
balance: () =>
|
||||
request2({
|
||||
url: '/app-api/pay/wallet/get',
|
||||
method: 'GET',
|
||||
custom: {
|
||||
showLoading: false,
|
||||
auth: true,
|
||||
},
|
||||
}),
|
||||
// profile: () =>
|
||||
// request({
|
||||
// url: '/user/api/user/profile',
|
||||
// method: 'GET',
|
||||
// custom: {
|
||||
// showLoading: false,
|
||||
// auth: true,
|
||||
// },
|
||||
// }),
|
||||
// update: (data) =>
|
||||
// request({
|
||||
// url: '/user/api/user/update',
|
||||
// method: 'POST',
|
||||
// custom: {
|
||||
// showSuccess: true,
|
||||
// auth: true,
|
||||
// },
|
||||
// data,
|
||||
// }),
|
||||
update: (data) =>
|
||||
request2({
|
||||
url: 'member/user/update',
|
||||
method: 'PUT',
|
||||
custom: {
|
||||
showSuccess: true,
|
||||
auth: true,
|
||||
},
|
||||
data,
|
||||
}),
|
||||
// 账号登录
|
||||
accountLogin: (data) =>
|
||||
request({
|
||||
url: '/user/api/user/accountLogin',
|
||||
method: 'POST',
|
||||
data,
|
||||
custom: {
|
||||
showSuccess: true,
|
||||
loadingMsg: '登录中',
|
||||
},
|
||||
}),
|
||||
// 短信登录
|
||||
smsLogin: (data) =>
|
||||
request({
|
||||
url: '/user/api/user/smsLogin',
|
||||
method: 'POST',
|
||||
data,
|
||||
custom: {
|
||||
showSuccess: true,
|
||||
loadingMsg: '登录中',
|
||||
},
|
||||
}),
|
||||
// 短信注册
|
||||
smsRegister: (data) =>
|
||||
request({
|
||||
url: '/user/api/user/smsRegister',
|
||||
method: 'POST',
|
||||
data,
|
||||
custom: {
|
||||
showSuccess: true,
|
||||
loadingMsg: '正在注册',
|
||||
},
|
||||
}),
|
||||
// 重置密码
|
||||
resetPassword: (data) =>
|
||||
request({
|
||||
url: '/user/api/user/resetPassword',
|
||||
method: 'POST',
|
||||
data,
|
||||
custom: {
|
||||
showSuccess: true,
|
||||
loadingMsg: '验证中',
|
||||
},
|
||||
}),
|
||||
|
||||
// 修改密码
|
||||
changePassword: (data) =>
|
||||
request({
|
||||
url: '/user/api/user/changePassword',
|
||||
method: 'POST',
|
||||
data,
|
||||
custom: {
|
||||
showSuccess: true,
|
||||
loadingMsg: '验证中',
|
||||
},
|
||||
}),
|
||||
|
||||
// 绑定、更换手机号
|
||||
changeMobile: (data) =>
|
||||
request({
|
||||
url: '/user/api/user/changeMobile',
|
||||
method: 'POST',
|
||||
data,
|
||||
custom: {
|
||||
showSuccess: true,
|
||||
loadingMsg: '验证中',
|
||||
},
|
||||
}),
|
||||
|
||||
// 修改用户名
|
||||
changeUsername: (data) =>
|
||||
request({
|
||||
url: '/user/api/user/changeUsername',
|
||||
method: 'POST',
|
||||
data,
|
||||
custom: {
|
||||
showSuccess: true,
|
||||
loadingMsg: '验证中',
|
||||
},
|
||||
}),
|
||||
|
||||
// 更新小程序信息
|
||||
updateMpUserInfo: (data) =>
|
||||
request({
|
||||
url: '/user/api/user/updateMpUserInfo',
|
||||
method: 'POST',
|
||||
data,
|
||||
}),
|
||||
|
||||
// 第三方授权信息
|
||||
thirdOauthInfo: () =>
|
||||
request({
|
||||
url: '/user/api/user/thirdOauth',
|
||||
method: 'GET',
|
||||
params: {
|
||||
provider: $platform.provider,
|
||||
platform: $platform.platform,
|
||||
},
|
||||
custom: {
|
||||
showLoading: false,
|
||||
},
|
||||
}),
|
||||
|
||||
// 添加分享记录
|
||||
addShareLog: (data) =>
|
||||
request({
|
||||
url: 'share/add',
|
||||
method: 'POST',
|
||||
data,
|
||||
custom: {
|
||||
showError: false,
|
||||
},
|
||||
}),
|
||||
share: {
|
||||
list: (params) =>
|
||||
request({
|
||||
url: 'share/list',
|
||||
method: 'GET',
|
||||
params,
|
||||
}),
|
||||
},
|
||||
// 账号登出
|
||||
logout: (data) =>
|
||||
request({
|
||||
url: '/user/api/user/logout',
|
||||
method: 'POST',
|
||||
data,
|
||||
}),
|
||||
// 账号注销
|
||||
logoff: (data) =>
|
||||
request({
|
||||
url: '/user/api/user/logoff',
|
||||
method: 'POST',
|
||||
data,
|
||||
}),
|
||||
|
||||
address: {
|
||||
// default: () =>
|
||||
// request({
|
||||
// url: 'user/address/default',
|
||||
// method: 'GET',
|
||||
// custom: {
|
||||
// showError: false,
|
||||
// },
|
||||
// }),
|
||||
default: () =>
|
||||
request2({
|
||||
url: 'member/address/get-default',
|
||||
method: 'GET',
|
||||
custom: {
|
||||
showError: false,
|
||||
},
|
||||
}),
|
||||
list: () =>
|
||||
request2({
|
||||
url: 'member/address/list',
|
||||
method: 'GET',
|
||||
custom: {},
|
||||
}),
|
||||
// list: () =>
|
||||
// request({
|
||||
// url: 'user/address',
|
||||
// method: 'GET',
|
||||
// custom: {},
|
||||
// }),
|
||||
create: (data) =>
|
||||
request2({
|
||||
url: 'member/address/create',
|
||||
method: 'POST',
|
||||
data,
|
||||
custom: {
|
||||
showSuccess: true,
|
||||
},
|
||||
}),
|
||||
// create: (data) =>
|
||||
// request({
|
||||
// url: 'user/address',
|
||||
// method: 'POST',
|
||||
// data,
|
||||
// custom: {
|
||||
// showSuccess: true,
|
||||
// },
|
||||
// }),
|
||||
update: (data) =>
|
||||
request2({
|
||||
url: 'member/address/update',
|
||||
method: 'PUT',
|
||||
data,
|
||||
custom: {
|
||||
showSuccess: true,
|
||||
},
|
||||
}),
|
||||
// update: (id, data) =>
|
||||
// request({
|
||||
// url: 'user/address/' + id,
|
||||
// method: 'PUT',
|
||||
// data,
|
||||
// custom: {
|
||||
// showSuccess: true,
|
||||
// },
|
||||
// }),
|
||||
detail: (id) =>
|
||||
request2({
|
||||
url: 'member/address/get?id=' + id,
|
||||
method: 'GET',
|
||||
}),
|
||||
// detail: (id) =>
|
||||
// request({
|
||||
// url: 'user/address/' + id,
|
||||
// method: 'GET',
|
||||
// }),
|
||||
delete: (id) =>
|
||||
request2({
|
||||
url: 'member/address/delete?id=' + id,
|
||||
method: 'DELETE',
|
||||
}),
|
||||
// delete: (id) =>
|
||||
// request({
|
||||
// url: 'user/address/' + id,
|
||||
// method: 'DELETE',
|
||||
// }),
|
||||
},
|
||||
invoice: {
|
||||
list: () =>
|
||||
request({
|
||||
url: 'user/invoice',
|
||||
method: 'GET',
|
||||
custom: {},
|
||||
}),
|
||||
create: (data) =>
|
||||
request({
|
||||
url: 'user/invoice',
|
||||
method: 'POST',
|
||||
data,
|
||||
custom: {
|
||||
showSuccess: true,
|
||||
},
|
||||
}),
|
||||
update: (id, data) =>
|
||||
request({
|
||||
url: 'user/invoice/' + id,
|
||||
method: 'PUT',
|
||||
data,
|
||||
custom: {
|
||||
showSuccess: true,
|
||||
},
|
||||
}),
|
||||
detail: (id) =>
|
||||
request({
|
||||
url: 'user/invoice/' + id,
|
||||
method: 'GET',
|
||||
}),
|
||||
delete: (id) =>
|
||||
request({
|
||||
url: 'user/invoice/' + id,
|
||||
method: 'DELETE',
|
||||
}),
|
||||
},
|
||||
favorite: {
|
||||
list: (params) =>
|
||||
request2({
|
||||
url: 'product/favorite/page',
|
||||
method: 'GET',
|
||||
params,
|
||||
}),
|
||||
do: (id) =>
|
||||
request({
|
||||
url: 'user/goodsLog/favorite',
|
||||
method: 'POST',
|
||||
data: {
|
||||
goods_id: id,
|
||||
},
|
||||
custom: {
|
||||
showSuccess: true,
|
||||
auth: true,
|
||||
},
|
||||
}),
|
||||
// 取消收藏
|
||||
cancel: (id) =>
|
||||
request2({
|
||||
url: 'product/favorite/delete-list',
|
||||
method: 'DELETE',
|
||||
data: {
|
||||
spuIds: id.split(',').map(item => item * 1),
|
||||
// spuIds: id.split(',').join(','),
|
||||
},
|
||||
custom: {
|
||||
showSuccess: true,
|
||||
auth: true,
|
||||
},
|
||||
}),
|
||||
// cancel: (id) =>
|
||||
// request({
|
||||
// url: 'user/goodsLog/favorite',
|
||||
// method: 'POST',
|
||||
// data: {
|
||||
// goods_ids: id,
|
||||
// },
|
||||
// custom: {
|
||||
// showSuccess: true,
|
||||
// auth: true,
|
||||
// },
|
||||
// }),
|
||||
},
|
||||
view: {
|
||||
list: (params) =>
|
||||
request({
|
||||
url: 'user/goodsLog/views',
|
||||
method: 'GET',
|
||||
params,
|
||||
custom: {},
|
||||
}),
|
||||
delete: (data) =>
|
||||
request({
|
||||
url: 'user/goodsLog/viewDel',
|
||||
method: 'DELETE',
|
||||
data,
|
||||
custom: {
|
||||
showSuccess: true,
|
||||
},
|
||||
}),
|
||||
},
|
||||
wallet: {
|
||||
log: (params) =>
|
||||
request2({
|
||||
// url: 'member/point/record/page',
|
||||
url: 'pay/wallet-transaction/page',
|
||||
method: 'GET',
|
||||
params,
|
||||
custom: {},
|
||||
}),
|
||||
log2: (params) =>
|
||||
request2({
|
||||
url: 'member/point/record/page',
|
||||
// url: 'pay/wallet-transaction/page',
|
||||
method: 'GET',
|
||||
params,
|
||||
custom: {},
|
||||
}),
|
||||
// log: (params) =>
|
||||
// request({
|
||||
// url: '/user/api/walletLog',
|
||||
// method: 'GET',
|
||||
// params,
|
||||
// custom: {},
|
||||
// }),
|
||||
},
|
||||
account: {
|
||||
info: (params) =>
|
||||
request({
|
||||
url: 'user/account',
|
||||
method: 'GET',
|
||||
params,
|
||||
custom: {
|
||||
showError: false,
|
||||
auth: true,
|
||||
},
|
||||
}),
|
||||
save: (data) =>
|
||||
request({
|
||||
url: 'user/account',
|
||||
method: 'POST',
|
||||
data,
|
||||
custom: {
|
||||
showSuccess: true,
|
||||
auth: true,
|
||||
},
|
||||
}),
|
||||
},
|
||||
//数量接口
|
||||
// data: () =>
|
||||
// request({
|
||||
// url: 'user/user/data',
|
||||
// method: 'GET',
|
||||
// custom: {
|
||||
// showLoading: false,
|
||||
// auth: true,
|
||||
// },
|
||||
// }),
|
||||
data: () =>
|
||||
request2({
|
||||
url: 'trade/order/get-count',
|
||||
method: 'GET',
|
||||
custom: {
|
||||
showLoading: false,
|
||||
auth: true,
|
||||
},
|
||||
}),
|
||||
data2: () =>
|
||||
request2({
|
||||
url: 'trade/after-sale/get-applying-count',
|
||||
method: 'GET',
|
||||
custom: {
|
||||
showLoading: false,
|
||||
auth: true,
|
||||
},
|
||||
}),
|
||||
};
|
||||
Reference in New Issue
Block a user