56
uniapp/sheep/api/activity.js
普通文件
56
uniapp/sheep/api/activity.js
普通文件
@@ -0,0 +1,56 @@
|
||||
import request from '@/sheep/request';
|
||||
|
||||
export default {
|
||||
//活动详情
|
||||
activity: (id) =>
|
||||
request({
|
||||
url: 'activity.activity/detail',
|
||||
method: 'GET',
|
||||
params: {
|
||||
id: id,
|
||||
},
|
||||
}),
|
||||
//我的拼团列表
|
||||
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/detail',
|
||||
method: 'GET',
|
||||
params: {
|
||||
id: id,
|
||||
},
|
||||
}),
|
||||
//签到日历
|
||||
signList: (params) =>
|
||||
request({
|
||||
url: 'activity.signin',
|
||||
method: 'GET',
|
||||
params,
|
||||
}),
|
||||
//签到
|
||||
signAdd: () =>
|
||||
request({
|
||||
url: 'activity.signin/signin',
|
||||
method: 'POST',
|
||||
}),
|
||||
replenish: (data) =>
|
||||
request({
|
||||
url: 'activity.signin/replenish',
|
||||
method: 'POST',
|
||||
data,
|
||||
}),
|
||||
|
||||
};
|
||||
137
uniapp/sheep/api/app.js
普通文件
137
uniapp/sheep/api/app.js
普通文件
@@ -0,0 +1,137 @@
|
||||
import request from '@/sheep/request';
|
||||
import { baseUrl } from '@/sheep/config';
|
||||
|
||||
export default {
|
||||
// 系统初始化
|
||||
init: (templateId) =>
|
||||
request({
|
||||
url: 'index/init',
|
||||
params: {
|
||||
templateId,
|
||||
},
|
||||
custom: {
|
||||
showError: false,
|
||||
showLoading: false,
|
||||
},
|
||||
}),
|
||||
// 同步客户端页面到后端
|
||||
pageSync: (pages) =>
|
||||
request({
|
||||
url: 'index/pageSync',
|
||||
method: 'POST',
|
||||
data: {
|
||||
pages,
|
||||
},
|
||||
custom: {
|
||||
showError: false,
|
||||
showLoading: false,
|
||||
},
|
||||
}),
|
||||
// 发送短信
|
||||
sendSms: (data) =>
|
||||
request({
|
||||
url: 'index/send',
|
||||
method: 'POST',
|
||||
data,
|
||||
custom: {
|
||||
showSuccess: true,
|
||||
loadingMsg: '发送中',
|
||||
},
|
||||
}),
|
||||
//意见反馈
|
||||
feedback: (data) =>
|
||||
request({
|
||||
url: 'index/feedback',
|
||||
method: 'POST',
|
||||
data,
|
||||
}),
|
||||
// 自定义页面
|
||||
page: (id) =>
|
||||
request({
|
||||
url: 'index/page',
|
||||
method: 'GET',
|
||||
params: {
|
||||
id: id,
|
||||
},
|
||||
}),
|
||||
//积分商城
|
||||
scoreShop: {
|
||||
list: (params) =>
|
||||
request({
|
||||
url: 'app.score_shop',
|
||||
method: 'GET',
|
||||
params,
|
||||
}),
|
||||
ids: (params = {}) =>
|
||||
request({
|
||||
url: 'app.score_shop/ids',
|
||||
method: 'GET',
|
||||
params,
|
||||
}),
|
||||
detail: (id) =>
|
||||
request({
|
||||
url: 'app.score_shop/detail',
|
||||
method: 'GET',
|
||||
params: {
|
||||
id: id,
|
||||
},
|
||||
}),
|
||||
},
|
||||
//小程序直播
|
||||
mplive: {
|
||||
getMpLink: () =>
|
||||
request({
|
||||
url: 'app.mplive/getMpLink',
|
||||
method: 'GET',
|
||||
}),
|
||||
getRoomList: (ids) =>
|
||||
request({
|
||||
url: 'app.mplive/getRoomList',
|
||||
method: 'GET',
|
||||
params: {
|
||||
ids: ids.join(','),
|
||||
}
|
||||
}),
|
||||
},
|
||||
|
||||
//上传
|
||||
upload: (file, group = 'ugc', callback) => {
|
||||
const token = uni.getStorageSync('token');
|
||||
uni.showLoading({
|
||||
title: '上传中',
|
||||
});
|
||||
return new Promise((resolve, reject) => {
|
||||
uni.uploadFile({
|
||||
url: baseUrl + '/api/common/upload',
|
||||
filePath: file,
|
||||
name: 'file',
|
||||
formData: {
|
||||
group,
|
||||
},
|
||||
header: {
|
||||
Accept: 'text/json',
|
||||
// Authorization: token,
|
||||
token: token
|
||||
},
|
||||
success: (uploadFileRes) => {
|
||||
let result = JSON.parse(uploadFileRes.data);
|
||||
if (result.code === 0) {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: result.msg,
|
||||
});
|
||||
} else {
|
||||
return resolve(result.data);
|
||||
}
|
||||
},
|
||||
fail: (error) => {
|
||||
console.log('上传失败:', error);
|
||||
return resolve(false);
|
||||
},
|
||||
complete: () => {
|
||||
uni.hideLoading();
|
||||
},
|
||||
});
|
||||
});
|
||||
},
|
||||
};
|
||||
44
uniapp/sheep/api/cart.js
普通文件
44
uniapp/sheep/api/cart.js
普通文件
@@ -0,0 +1,44 @@
|
||||
import request from '@/sheep/request';
|
||||
|
||||
export default {
|
||||
list: (data) =>
|
||||
request({
|
||||
url: 'cart',
|
||||
method: 'GET',
|
||||
custom: {
|
||||
showLoading: false,
|
||||
auth: true,
|
||||
},
|
||||
}),
|
||||
append: (data) =>
|
||||
request({
|
||||
url: 'cart/update',
|
||||
method: 'POST',
|
||||
custom: {
|
||||
showSuccess: true,
|
||||
successMsg: '已添加到购物车~',
|
||||
},
|
||||
data: {
|
||||
...data,
|
||||
type: 'inc',
|
||||
},
|
||||
}),
|
||||
// 删除购物车
|
||||
delete: (ids) =>
|
||||
request({
|
||||
url: 'cart/delete',
|
||||
method: 'DELETE',
|
||||
params: {
|
||||
id: ids.toString(),
|
||||
},
|
||||
}),
|
||||
update: (data) =>
|
||||
request({
|
||||
url: 'cart/update',
|
||||
method: 'POST',
|
||||
data: {
|
||||
...data,
|
||||
type: 'cover',
|
||||
},
|
||||
}),
|
||||
};
|
||||
10
uniapp/sheep/api/category.js
普通文件
10
uniapp/sheep/api/category.js
普通文件
@@ -0,0 +1,10 @@
|
||||
import request from '@/sheep/request';
|
||||
|
||||
export default {
|
||||
list: (params) =>
|
||||
request({
|
||||
url: 'category',
|
||||
method: 'GET',
|
||||
params,
|
||||
}),
|
||||
};
|
||||
13
uniapp/sheep/api/chat.js
普通文件
13
uniapp/sheep/api/chat.js
普通文件
@@ -0,0 +1,13 @@
|
||||
import request from '@/sheep/request';
|
||||
|
||||
export default {
|
||||
// 获取聊天token
|
||||
unifiedToken: () =>
|
||||
request({
|
||||
url: 'index/unifiedToken',
|
||||
custom: {
|
||||
showError: false,
|
||||
showLoading: false,
|
||||
},
|
||||
}),
|
||||
};
|
||||
65
uniapp/sheep/api/commission.js
普通文件
65
uniapp/sheep/api/commission.js
普通文件
@@ -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,
|
||||
}),
|
||||
};
|
||||
45
uniapp/sheep/api/coupon.js
普通文件
45
uniapp/sheep/api/coupon.js
普通文件
@@ -0,0 +1,45 @@
|
||||
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/detail',
|
||||
method: 'GET',
|
||||
params: {
|
||||
id: id,
|
||||
user_coupon_id,
|
||||
},
|
||||
}),
|
||||
get: (id) =>
|
||||
request({
|
||||
url: 'coupon/get',
|
||||
method: 'POST',
|
||||
params: {
|
||||
id: id,
|
||||
},
|
||||
}),
|
||||
listByGoods: (id) =>
|
||||
request({
|
||||
url: 'coupon/listByGoods',
|
||||
method: 'GET',
|
||||
params: {
|
||||
goods_id: id,
|
||||
},
|
||||
}),
|
||||
};
|
||||
25
uniapp/sheep/api/data.js
普通文件
25
uniapp/sheep/api/data.js
普通文件
@@ -0,0 +1,25 @@
|
||||
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',
|
||||
method: 'GET',
|
||||
params: {
|
||||
id: id,
|
||||
},
|
||||
}),
|
||||
};
|
||||
88
uniapp/sheep/api/goods.js
普通文件
88
uniapp/sheep/api/goods.js
普通文件
@@ -0,0 +1,88 @@
|
||||
import request from '@/sheep/request';
|
||||
|
||||
export default {
|
||||
// 商品详情
|
||||
detail: (id, params) =>
|
||||
request({
|
||||
url: 'goods.goods/detail',
|
||||
method: 'GET',
|
||||
params: {
|
||||
id: id,
|
||||
...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',
|
||||
method: 'GET',
|
||||
params: {
|
||||
goods_id: id,
|
||||
...params,
|
||||
},
|
||||
custom: {
|
||||
showLoading: false,
|
||||
showError: false,
|
||||
},
|
||||
}),
|
||||
// 商品评价类型
|
||||
getType: (id) =>
|
||||
request({
|
||||
url: 'goods.comment/getType',
|
||||
method: 'GET',
|
||||
params: {
|
||||
goods_id: id,
|
||||
},
|
||||
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,
|
||||
}),
|
||||
};
|
||||
34
uniapp/sheep/api/index.js
普通文件
34
uniapp/sheep/api/index.js
普通文件
@@ -0,0 +1,34 @@
|
||||
import activity from "./activity"
|
||||
import app from "./app"
|
||||
import cart from "./cart"
|
||||
import category from "./category"
|
||||
import chat from "./chat"
|
||||
import commission from "./commission"
|
||||
import coupon from "./coupon"
|
||||
import data from "./data"
|
||||
import goods from "./goods"
|
||||
import order from "./order"
|
||||
import partner from "./partner"
|
||||
import pay from "./pay"
|
||||
import third from "./third"
|
||||
import trade from "./trade"
|
||||
import user from "./user"
|
||||
|
||||
export default {
|
||||
activity,
|
||||
app,
|
||||
cart,
|
||||
category,
|
||||
chat,
|
||||
commission,
|
||||
coupon,
|
||||
data,
|
||||
goods,
|
||||
order,
|
||||
partner,
|
||||
pay,
|
||||
third,
|
||||
trade,
|
||||
user,
|
||||
}
|
||||
|
||||
209
uniapp/sheep/api/order.js
普通文件
209
uniapp/sheep/api/order.js
普通文件
@@ -0,0 +1,209 @@
|
||||
import request from '@/sheep/request';
|
||||
|
||||
export default {
|
||||
// 订单详情
|
||||
detail: (id) =>
|
||||
request({
|
||||
url: 'order.order/detail',
|
||||
method: 'GET',
|
||||
params: {
|
||||
id: id,
|
||||
},
|
||||
}),
|
||||
// 发货通知跳转详情
|
||||
merchant: (params) =>
|
||||
request({
|
||||
url: 'order.order/detail',
|
||||
method: 'GET',
|
||||
params,
|
||||
}),
|
||||
// 发票详情
|
||||
invoice: (id) =>
|
||||
request({
|
||||
url: 'order.invoice/detail',
|
||||
method: 'GET',
|
||||
params: {
|
||||
id: id,
|
||||
},
|
||||
}),
|
||||
// 获取支付结果
|
||||
// payResult: (id) =>
|
||||
// request({
|
||||
// url: 'order/order/' + id,
|
||||
// method: 'GET',
|
||||
// custom: {
|
||||
// showLoading: false,
|
||||
// },
|
||||
// }),
|
||||
// 订单item详情
|
||||
itemDetail: (params) =>
|
||||
request({
|
||||
url: 'order.order/itemDetail',
|
||||
method: 'GET',
|
||||
params,
|
||||
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',
|
||||
method: 'POST',
|
||||
params: {
|
||||
id: id,
|
||||
},
|
||||
}),
|
||||
// 评价订单
|
||||
comment: (id, data) =>
|
||||
request({
|
||||
url: 'order.order/comment',
|
||||
method: 'POST',
|
||||
params: {
|
||||
id: id,
|
||||
},
|
||||
data,
|
||||
}),
|
||||
// 申请退款
|
||||
applyRefund: (id) =>
|
||||
request({
|
||||
url: 'order.order/applyRefund',
|
||||
method: 'POST',
|
||||
params: {
|
||||
id: id,
|
||||
},
|
||||
}),
|
||||
// 取消订单
|
||||
cancel: (id) =>
|
||||
request({
|
||||
url: 'order.order/cancel',
|
||||
method: 'POST',
|
||||
params: {
|
||||
id: id,
|
||||
},
|
||||
}),
|
||||
// 删除订单
|
||||
delete: (id) =>
|
||||
request({
|
||||
url: 'order.order/delete',
|
||||
method: 'DELETE',
|
||||
params: {
|
||||
id: id,
|
||||
},
|
||||
}),
|
||||
// 售后
|
||||
aftersale: {
|
||||
// 申请售后
|
||||
apply: (data) =>
|
||||
request({
|
||||
url: 'order.aftersale/add',
|
||||
method: 'POST',
|
||||
data,
|
||||
}),
|
||||
list: (params) =>
|
||||
request({
|
||||
url: 'order.aftersale',
|
||||
method: 'GET',
|
||||
params,
|
||||
custom: {
|
||||
showLoading: false,
|
||||
},
|
||||
}),
|
||||
//取消售后
|
||||
cancel: (id) =>
|
||||
request({
|
||||
url: 'order.aftersale/cancel',
|
||||
method: 'POST',
|
||||
params: {
|
||||
id: id,
|
||||
},
|
||||
}),
|
||||
//删除售后单
|
||||
delete: (id) =>
|
||||
request({
|
||||
url: 'order.aftersale/delete',
|
||||
method: 'DELETE',
|
||||
params: {
|
||||
id: id,
|
||||
},
|
||||
}),
|
||||
// 售后详情
|
||||
detail: (id) =>
|
||||
request({
|
||||
url: 'order.aftersale/detail',
|
||||
method: 'GET',
|
||||
params: {
|
||||
id: id,
|
||||
},
|
||||
}),
|
||||
// 用户回复
|
||||
addLog: (data) =>
|
||||
request({
|
||||
url: 'order.aftersale/addLog',
|
||||
method: 'POST',
|
||||
data,
|
||||
}),
|
||||
},
|
||||
//订单包裹
|
||||
express: {
|
||||
detail: (id, orderId) =>
|
||||
request({
|
||||
url: 'order.express/detail',
|
||||
method: 'GET',
|
||||
params: {
|
||||
id: id,
|
||||
order_id: orderId,
|
||||
},
|
||||
}),
|
||||
list: (orderId) =>
|
||||
request({
|
||||
url: 'order.express',
|
||||
method: 'GET',
|
||||
params: {
|
||||
order_id: orderId,
|
||||
},
|
||||
custom: {
|
||||
showLoading: false,
|
||||
},
|
||||
}),
|
||||
},
|
||||
|
||||
// 申请开票
|
||||
applyInvoice: (data) =>
|
||||
request({
|
||||
url: 'order.order/applyInvoice',
|
||||
method: 'POST',
|
||||
data,
|
||||
}),
|
||||
};
|
||||
44
uniapp/sheep/api/partner.js
普通文件
44
uniapp/sheep/api/partner.js
普通文件
@@ -0,0 +1,44 @@
|
||||
import request from '@/sheep/request';
|
||||
|
||||
export default {
|
||||
// 收益中心概览
|
||||
overview: () =>
|
||||
request({
|
||||
url: 'partner.index',
|
||||
method: 'GET',
|
||||
custom: {
|
||||
showLoading: false,
|
||||
showError: false,
|
||||
},
|
||||
}),
|
||||
// 收益明细
|
||||
rewards: (params) =>
|
||||
request({
|
||||
url: 'partner.index/rewards',
|
||||
method: 'GET',
|
||||
params,
|
||||
custom: {
|
||||
showError: false,
|
||||
},
|
||||
}),
|
||||
// 我的马豆
|
||||
madow: (params) =>
|
||||
request({
|
||||
url: 'partner.index/madow',
|
||||
method: 'GET',
|
||||
params,
|
||||
custom: {
|
||||
showError: false,
|
||||
},
|
||||
}),
|
||||
// 兑换券
|
||||
voucher: (params) =>
|
||||
request({
|
||||
url: 'partner.index/voucher',
|
||||
method: 'GET',
|
||||
params,
|
||||
custom: {
|
||||
showError: false,
|
||||
},
|
||||
}),
|
||||
};
|
||||
64
uniapp/sheep/api/pay.js
普通文件
64
uniapp/sheep/api/pay.js
普通文件
@@ -0,0 +1,64 @@
|
||||
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,
|
||||
},
|
||||
}),
|
||||
cancel: (data) =>
|
||||
request({
|
||||
url: 'withdraw/cancel',
|
||||
method: 'POST',
|
||||
data,
|
||||
custom: {
|
||||
loadingMsg: '取消中',
|
||||
auth: true,
|
||||
},
|
||||
}),
|
||||
retry: (data) =>
|
||||
request({
|
||||
url: 'withdraw/retry',
|
||||
method: 'POST',
|
||||
data,
|
||||
custom: {
|
||||
loadingMsg: '提现中',
|
||||
auth: true,
|
||||
},
|
||||
}),
|
||||
},
|
||||
};
|
||||
129
uniapp/sheep/api/third.js
普通文件
129
uniapp/sheep/api/third.js
普通文件
@@ -0,0 +1,129 @@
|
||||
import request from '@/sheep/request';
|
||||
import { baseUrl, apiPath } from '@/sheep/config';
|
||||
|
||||
export default {
|
||||
// 微信相关
|
||||
wechat: {
|
||||
// 第三方登录
|
||||
login: (params, data) =>
|
||||
request({
|
||||
url: 'third.wechat/login',
|
||||
method: 'POST',
|
||||
params,
|
||||
data,
|
||||
custom: {
|
||||
showSuccess: true,
|
||||
loadingMsg: '登陆中',
|
||||
},
|
||||
}),
|
||||
|
||||
// 绑定微信
|
||||
bind: (params, data) =>
|
||||
request({
|
||||
url: 'third.wechat/bind',
|
||||
method: 'POST',
|
||||
params,
|
||||
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: '登陆中',
|
||||
},
|
||||
}),
|
||||
},
|
||||
};
|
||||
40
uniapp/sheep/api/trade.js
普通文件
40
uniapp/sheep/api/trade.js
普通文件
@@ -0,0 +1,40 @@
|
||||
import request from '@/sheep/request';
|
||||
|
||||
export default {
|
||||
order: (id) =>
|
||||
request({
|
||||
url: 'trade.order/detail',
|
||||
method: 'GET',
|
||||
params:{
|
||||
id:id
|
||||
},
|
||||
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,
|
||||
}),
|
||||
};
|
||||
340
uniapp/sheep/api/user.js
普通文件
340
uniapp/sheep/api/user.js
普通文件
@@ -0,0 +1,340 @@
|
||||
import request from '@/sheep/request';
|
||||
import $platform from '@/sheep/platform';
|
||||
|
||||
export default {
|
||||
profile: () =>
|
||||
request({
|
||||
url: 'user.user/profile',
|
||||
method: 'GET',
|
||||
custom: {
|
||||
showLoading: false,
|
||||
auth: true,
|
||||
},
|
||||
}),
|
||||
update: (data) =>
|
||||
request({
|
||||
url: 'user.user/update',
|
||||
method: 'POST',
|
||||
custom: {
|
||||
showSuccess: true,
|
||||
auth: true,
|
||||
},
|
||||
data,
|
||||
}),
|
||||
// 账号登录
|
||||
accountLogin: (data) =>
|
||||
request({
|
||||
url: 'user.user/accountLogin',
|
||||
method: 'POST',
|
||||
data,
|
||||
custom: {
|
||||
showSuccess: true,
|
||||
loadingMsg: '登录中',
|
||||
},
|
||||
}),
|
||||
// 短信登录
|
||||
smsLogin: (data) =>
|
||||
request({
|
||||
url: 'user.user/smsLogin',
|
||||
method: 'POST',
|
||||
data,
|
||||
custom: {
|
||||
showSuccess: true,
|
||||
loadingMsg: '登录中',
|
||||
},
|
||||
}),
|
||||
// 短信注册
|
||||
smsRegister: (data) =>
|
||||
request({
|
||||
url: 'user.user/smsRegister',
|
||||
method: 'POST',
|
||||
data,
|
||||
custom: {
|
||||
showSuccess: true,
|
||||
loadingMsg: '正在注册',
|
||||
},
|
||||
}),
|
||||
// 重置密码
|
||||
resetPassword: (data) =>
|
||||
request({
|
||||
url: 'user.user/resetPassword',
|
||||
method: 'POST',
|
||||
data,
|
||||
custom: {
|
||||
showSuccess: true,
|
||||
loadingMsg: '验证中',
|
||||
},
|
||||
}),
|
||||
// 修改密码
|
||||
changePassword: (data) =>
|
||||
request({
|
||||
url: 'user.user/changePassword',
|
||||
method: 'POST',
|
||||
data,
|
||||
custom: {
|
||||
showSuccess: true,
|
||||
loadingMsg: '验证中',
|
||||
},
|
||||
}),
|
||||
// 绑定、更换手机号
|
||||
changeMobile: (data) =>
|
||||
request({
|
||||
url: 'user.user/changeMobile',
|
||||
method: 'POST',
|
||||
data,
|
||||
custom: {
|
||||
showSuccess: true,
|
||||
loadingMsg: '验证中',
|
||||
},
|
||||
}),
|
||||
// 修改用户名
|
||||
changeUsername: (data) =>
|
||||
request({
|
||||
url: 'user.user/changeUsername',
|
||||
method: 'POST',
|
||||
data,
|
||||
custom: {
|
||||
showSuccess: true,
|
||||
loadingMsg: '验证中',
|
||||
},
|
||||
}),
|
||||
// 更新小程序信息
|
||||
updateMpUserInfo: (data) =>
|
||||
request({
|
||||
url: 'user.user/updateMpUserInfo',
|
||||
method: 'POST',
|
||||
data,
|
||||
}),
|
||||
|
||||
// 第三方授权信息
|
||||
thirdOauthInfo: () =>
|
||||
request({
|
||||
url: 'user.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',
|
||||
method: 'GET',
|
||||
params,
|
||||
}),
|
||||
},
|
||||
// 账号登出
|
||||
logout: (data) =>
|
||||
request({
|
||||
url: 'user.user/logout',
|
||||
method: 'POST',
|
||||
data,
|
||||
}),
|
||||
// 账号注销
|
||||
logoff: (data) =>
|
||||
request({
|
||||
url: 'user.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/add',
|
||||
method: 'POST',
|
||||
data,
|
||||
custom: {
|
||||
showSuccess: true,
|
||||
},
|
||||
}),
|
||||
update: (id, data) =>
|
||||
request({
|
||||
url: 'user.address/edit',
|
||||
method: 'POST',
|
||||
params: {
|
||||
id: id,
|
||||
},
|
||||
data,
|
||||
custom: {
|
||||
showSuccess: true,
|
||||
},
|
||||
}),
|
||||
detail: (id) =>
|
||||
request({
|
||||
url: 'user.address/detail',
|
||||
method: 'GET',
|
||||
params: {
|
||||
id: id,
|
||||
},
|
||||
}),
|
||||
delete: (id) =>
|
||||
request({
|
||||
url: 'user.address/delete',
|
||||
method: 'DELETE',
|
||||
params: {
|
||||
id: id,
|
||||
},
|
||||
}),
|
||||
},
|
||||
invoice: {
|
||||
list: () =>
|
||||
request({
|
||||
url: 'user.invoice',
|
||||
method: 'GET',
|
||||
custom: {},
|
||||
}),
|
||||
create: (data) =>
|
||||
request({
|
||||
url: 'user.invoice/add',
|
||||
method: 'POST',
|
||||
data,
|
||||
custom: {
|
||||
showSuccess: true,
|
||||
},
|
||||
}),
|
||||
update: (id, data) =>
|
||||
request({
|
||||
url: 'user.invoice/edit',
|
||||
method: 'POST',
|
||||
params: {
|
||||
id: id,
|
||||
},
|
||||
data,
|
||||
custom: {
|
||||
showSuccess: true,
|
||||
},
|
||||
}),
|
||||
detail: (id) =>
|
||||
request({
|
||||
url: 'user.invoice/detail',
|
||||
method: 'GET',
|
||||
params: {
|
||||
id: id,
|
||||
},
|
||||
}),
|
||||
delete: (id) =>
|
||||
request({
|
||||
url: 'user.invoice/delete',
|
||||
method: 'DELETE',
|
||||
params: {
|
||||
id: id,
|
||||
},
|
||||
}),
|
||||
},
|
||||
goodsLog: {
|
||||
list: (params) =>
|
||||
request({
|
||||
url: 'user.goods_log',
|
||||
method: 'GET',
|
||||
params,
|
||||
}),
|
||||
},
|
||||
favorite: {
|
||||
do: (id) =>
|
||||
request({
|
||||
url: 'user.goods_log/favorite',
|
||||
method: 'POST',
|
||||
data: {
|
||||
goods_id: id,
|
||||
},
|
||||
custom: {
|
||||
showSuccess: true,
|
||||
auth: true,
|
||||
},
|
||||
}),
|
||||
cancel: (id) =>
|
||||
request({
|
||||
url: 'user.goods_log/favorite',
|
||||
method: 'POST',
|
||||
data: {
|
||||
goods_ids: id,
|
||||
},
|
||||
custom: {
|
||||
showSuccess: true,
|
||||
auth: true,
|
||||
},
|
||||
}),
|
||||
},
|
||||
view: {
|
||||
delete: (data) =>
|
||||
request({
|
||||
url: 'user.goods_log/viewDel',
|
||||
method: 'DELETE',
|
||||
data,
|
||||
custom: {
|
||||
showSuccess: true,
|
||||
},
|
||||
}),
|
||||
},
|
||||
wallet: {
|
||||
log: (params) =>
|
||||
request({
|
||||
url: 'user.wallet_log',
|
||||
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/save',
|
||||
method: 'POST',
|
||||
data,
|
||||
custom: {
|
||||
showSuccess: true,
|
||||
auth: true,
|
||||
},
|
||||
}),
|
||||
},
|
||||
//数量接口
|
||||
data: () =>
|
||||
request({
|
||||
url: 'user.user/data',
|
||||
method: 'GET',
|
||||
custom: {
|
||||
showLoading: false,
|
||||
auth: true,
|
||||
},
|
||||
}),
|
||||
};
|
||||
在新工单中引用
屏蔽一个用户