发布v1.0.3

This commit is contained in:
kele
2022-11-22 15:45:36 +08:00
commit 01f091fcd8
525 changed files with 80922 additions and 0 deletions
+43
View File
@@ -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',
}),
};
+111
View File
@@ -0,0 +1,111 @@
import request from '@/sheep/request';
import { baseUrl } from '@/sheep/config';
export default {
// 系统初始化
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: (params) =>
request({
url: 'app/scoreShop',
method: 'GET',
params,
}),
scoreShopIds: (params = {}) =>
request({
url: 'app/scoreShop/ids',
method: 'GET',
params,
}),
scoreShopDetail: (id) =>
request({
url: 'app/scoreShop/' + id,
method: 'GET',
}),
//上传
upload: (file, group = 'ugc', callback) => {
const token = uni.getStorageSync('token');
uni.showLoading({
title: '上传中',
});
return new Promise((resolve, reject) => {
uni.uploadFile({
url: baseUrl + '/file/api/upload',
filePath: file,
name: 'file',
formData: {
group,
},
header: {
Accept: 'text/json',
Authorization: token,
},
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();
},
});
});
},
};
+41
View File
@@ -0,0 +1,41 @@
import request from '@/sheep/request';
export default {
list: (data) =>
request({
url: 'cart',
method: 'GET',
custom: {
showLoading: false,
auth: true,
},
}),
append: (data) =>
request({
url: 'cart',
method: 'POST',
custom: {
showSuccess: true,
successMsg: '已添加到购物车~',
},
data: {
...data,
type: 'inc',
},
}),
// 删除购物车
delete: (ids) =>
request({
url: 'cart/' + ids,
method: 'DELETE',
}),
update: (data) =>
request({
url: 'cart',
method: 'POST',
data: {
...data,
type: 'cover',
},
}),
};
+10
View File
@@ -0,0 +1,10 @@
import request from '@/sheep/request';
export default {
list: (params) =>
request({
url: 'category',
method: 'GET',
params,
}),
};
+13
View File
@@ -0,0 +1,13 @@
import request from '@/sheep/request';
export default {
// 获取聊天token
unifiedToken: () =>
request({
url: 'unifiedToken',
custom: {
showError: false,
showLoading: false,
},
}),
};
+65
View File
@@ -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,
}),
};
+38
View File
@@ -0,0 +1,38 @@
import request from '@/sheep/request';
export default {
// 我的拼团
list: (params) =>
request({
url: 'coupon',
method: 'GET',
params,
custom: {
showLoading: false,
},
}),
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',
}),
};
+19
View File
@@ -0,0 +1,19 @@
import request from '@/sheep/request';
export default {
area: () =>
request({
url: 'data/area',
method: 'GET',
}),
faq: () =>
request({
url: 'data/faq',
method: 'GET',
}),
richtext: (id) =>
request({
url: 'data/richtext/' + id,
method: 'GET',
}),
};
+79
View File
@@ -0,0 +1,79 @@
import request from '@/sheep/request';
export default {
// 商品详情
detail: (id, params = {}) =>
request({
url: 'goods/goods/' + id,
method: 'GET',
params,
custom: {
showLoading: false,
showError: false,
},
}),
// 商品列表
list: (params) =>
request({
url: 'goods/goods',
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 = {}) =>
request({
url: 'goods/comment/' + 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,
}),
};
+10
View File
@@ -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;
+130
View File
@@ -0,0 +1,130 @@
import request from '@/sheep/request';
export default {
// 订单详情
detail: (id) =>
request({
url: 'order/order/' + id,
method: 'GET',
}),
// 发票详情
invoice: (id) =>
request({
url: 'order/invoice/' + id,
method: 'GET',
}),
// 获取支付结果
payResult: (id) =>
request({
url: 'order/order/' + id,
method: 'GET',
custom: {
showLoading: false,
},
}),
// 订单列表
list: (params) =>
request({
url: 'order/order',
method: 'GET',
params,
custom: {
showLoading: false,
},
}),
// 计算订单信息
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: (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) =>
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) =>
request({
url: 'order/aftersale/' + id,
method: 'GET',
}),
},
//订单包裹
express: (id, orderId) =>
request({
url: 'order/express/' + id + `${orderId ? '/' + orderId : ''}`,
method: 'GET',
}),
};
+44
View File
@@ -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,
},
}),
},
};
+127
View File
@@ -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: '登陆中',
},
}),
},
};
+37
View File
@@ -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,
}),
};
+323
View File
@@ -0,0 +1,323 @@
import request from '@/sheep/request';
import $platform from '@/sheep/platform';
export default {
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,
}),
// 账号登录
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: '验证中',
},
}),
// 第三方授权信息
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,
},
}),
list: () =>
request({
url: 'user/address',
method: 'GET',
custom: {},
}),
create: (data) =>
request({
url: 'user/address',
method: 'POST',
data,
custom: {
showSuccess: true,
},
}),
update: (id, data) =>
request({
url: 'user/address/' + id,
method: 'PUT',
data,
custom: {
showSuccess: true,
},
}),
detail: (id) =>
request({
url: 'user/address/' + id,
method: 'GET',
}),
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) =>
request({
url: 'user/goodsLog/favorite',
method: 'GET',
params,
}),
do: (id) =>
request({
url: 'user/goodsLog/favorite',
method: 'POST',
data: {
goods_id: id,
},
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) =>
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,
},
}),
};