JM-MiniApp/unpackage/dist/dev/mp-weixin/api/index.js
2023-10-19 23:23:22 +08:00

475 lines
21 KiB
JavaScript

"use strict";
const common_vendor = require("../common/vendor.js");
const api_request = require("./request.js");
const API = {
//微信登录
getToken: (data) => api_request.net.POST("/login/token", data),
// 获取token
wx_login: (data, userId) => api_request.net.POST("/user/binding/wechat", data, true, { "userId": userId }),
// 微信登录
// upload: (data) => net.POST('/user/upload',data), // 文件上传
userinfoUpdae: (data) => api_request.net.PUT("/user/info", data),
// 更新用户信息
// 首页
getHospitalList: (data) => api_request.net.GET("/hospital/list", data),
// 获取医院信息
// 百科
getArticleList: (data) => api_request.net.GET("/article/list", data),
// 百科列表
getArticleDetail: (data) => api_request.net.GET("/article/" + data.id),
// 百科列表
/*
首页信息
*/
getIndexInfo: (data) => api_request.net.GET("/api/index/index"),
// 首页信息
getIndexBanner: (data) => api_request.net.GET("/api/banner/index", data),
// 轮播图
getIndexNotice: (data) => api_request.net.GET("/api/news/notice"),
// 公告
getGoodsDetail: (data) => api_request.net.GET("/api/goods/detail", data),
// 商品详情(普通商品)
getSeckillGoodsDetail: (data) => api_request.net.GET("/api/seckill_goods/detail", data),
// 商品详情(秒杀)
getGroupGoodsDetail: (data) => api_request.net.GET("/api/group_goods/detail", data),
// 商品详情(团购)
getGoodsList: (data) => api_request.net.GET("/api/goods/lists", data),
// 商品列表(普通商品)
getSeckillGoodsList: (data) => api_request.net.GET("/api/seckill_goods/lists", data),
// 商品列表(限时)
getGroupGoodsList: (data) => api_request.net.GET("/api/group_goods/lists?page=&keyword=", data),
// 商品列表(团购)
getNewinfo: (data) => api_request.net.GET("/api/goods/getGoodsSpec", data),
// 根据商品规格更新数据
getCategoryList: (data) => api_request.net.GET("/api/goods_category/lists"),
// 获取商品分类
getCategory: (data) => api_request.net.GET("/api/goods/category", data),
// 根据分类Id获取分类商品
getCartList: (data) => api_request.net.GET("/api/cart/lists", data),
// 获取购物车列表
addCart: (data) => api_request.net.POST("/api/cart/add", data),
// 加入购物车
delCart: (data) => api_request.net.POST("/api/cart/delete", data),
// 删除购物车
updateCart: (data) => api_request.net.POST("/api/cart/edit", data),
// 更新购物车
login: (data) => api_request.net.POST("/api/user/wechatLogin", data),
// 登录
login_test: (data) => api_request.net.GET("/api/user/testLogin?id=1"),
// 登录 测试专用
zhuce: (data) => api_request.net.POST("/api/user/profile", data),
// 注册
getOrderList: (data) => api_request.net.GET("/api/order/lists", data),
//订单列表
getOrderGroupList: (data) => api_request.net.GET("/api/group_order/lists", data),
//订单列表(团购)
getOrderSeckillList: (data) => api_request.net.GET("/api/seckill_order/lists", data),
//订单列表(秒杀)
pay: (data) => api_request.net.POST("/api/order/pay", data),
//支付
payGroup: (data) => api_request.net.POST("/api/group_order/pay", data),
//支付(团购)
paySeckill: (data) => api_request.net.POST("/api/seckill_order/pay", data),
//支付(秒杀)
refund: (data) => api_request.net.POST("/api/order/refund", data),
//退款
getOrderInviteList: (data) => api_request.net.GET("/api/invite/order", data),
//分销订单
getOrderBaseinfo: (data) => api_request.net.POST("/api/order/preview", data),
//获取订单提交页面的基本信息
getOrderGroupBaseinfo: (data) => api_request.net.POST("/api/group_order/preview", data),
//获取订单提交页面的基本信息(团购)
getOrderSeckillBaseinfo: (data) => api_request.net.POST("/api/seckill_order/preview", data),
//获取订单提交页面的基本信息(秒杀)
getOrderCartinfo: (data) => api_request.net.POST("/api/order/cartPreview", data),
//获取订单提交页面的基本信息(购物车来的)
getDelivery: (data) => api_request.net.GET("/api/index/delivery", data),
//获取配送相关的选项(普通商品)
staffApply: (data) => api_request.net.POST("/api/invite/apply", data),
//业务员申请
deliveryApply: (data) => api_request.net.POST("/api/staff/apply", data),
//配送员申请
getDeliveryArea: (data) => api_request.net.GET("/api/staff/getDeliveryArea"),
//获取配送区域
getAddressList: (data) => api_request.net.GET("/api/address/lists"),
//地址列表
getAddDetail: (data) => api_request.net.GET("/api/address/detail", data),
//地址详情
addAddress: (data) => api_request.net.POST("/api/address/add", data),
//新增地址
editAddress: (data) => api_request.net.POST("/api/address/edit", data),
//修改地址
delAddress: (data) => api_request.net.GET("/api/address/delete", data),
//删除地址
getDefaultAddress: (data) => api_request.net.GET("/api/address/getDefault"),
//获取默认地址
orderSubmitFunc: (data) => api_request.net.POST("/api/order/order", data),
//提交订单(普通订单)
orderSubmitCartFunc: (data) => api_request.net.POST("/api/order/cartOrder", data),
//提交订单(购物车)
orderSubmitGroupFunc: (data) => api_request.net.POST("/api/group_order/order", data),
//提交订单(团购订单)
orderSubmitSeckillFunc: (data) => api_request.net.POST("/api/seckill_order/order", data),
//提交订单(秒杀订单)
orderDetail: (data) => api_request.net.GET("/api/order/detail", data),
//订单详情-普通订单 (顾客)
orderGroupDetail: (data) => api_request.net.GET("/api/group_order/detail", data),
//订单详情-团购订单
orderSeckillDetail: (data) => api_request.net.GET("/api/seckill_order/detail", data),
//订单详情-秒杀订单
orderStaffDetail: (data) => api_request.net.GET("/api/staff/orderDetail", data),
//订单详情-配送订单
orderLeaderDetail: (data) => api_request.net.GET("/api/leader/orderDetail", data),
//订单详情-管理员订单
orderCancel: (data) => api_request.net.POST("/api/order/cancle", data),
//取消订单
orderCancelGroup: (data) => api_request.net.POST("/api/group_order/cancle", data),
//取消订单 (团购)
orderCancelSeckill: (data) => api_request.net.POST("/api/seckill_order/cancle", data),
//取消订单 (秒杀)
/*
用户相关
*/
getUserInfo: (data) => api_request.net.GET("/api/user/userInfo", data),
//获取用户信息
updateUserInfo: (data) => api_request.net.POST("/api/user/profile", data),
//更新用户信息
rechargeFunc: (data) => api_request.net.POST("/api/recharge/recharge", data),
//充值
withdrawalFunc: (data) => api_request.net.POST("/api/withdrawl/submit", data),
//提现
vipBuy: (data) => api_request.net.POST("/api/vip/order", data),
//购买VIP
vipConfig: (data) => api_request.net.GET("/api/vip/config"),
//会员说明
/*
优惠券
*/
getCouponsList: (data) => api_request.net.GET("/api/coupon/userCoupons", data),
//优惠券
getCouponsCenterList: (data) => api_request.net.GET("/api/coupon/lists", data),
//领券中心
couponsCenterReceive: (data) => api_request.net.POST("/api/coupon/receive", data),
//领取优惠
getMyStars: (data) => api_request.net.GET("/api/collect/lists", data),
//我的收藏
/*
推广中心
*/
inviteCenter: (data) => api_request.net.GET("/api/invite/index", data),
//首页
inviteCenterwithdrawl: (data) => api_request.net.POST("/api/withdrawl/submit", data),
//提现
inviteCenterwithdrawlDetail: (data) => api_request.net.GET("/api/invite/withdrawlDetail", data),
//提现明细
inviteCenterwithdrawlRecodes: (data) => api_request.net.GET("/api/invite/record", data),
//提现明细(佣金)
getShareQrcode: (data) => api_request.net.GET("/api/user/getShareQrcode"),
//用户分销二维码
/*
配置相关
*/
getConfig: (data) => api_request.net.GET("/api/index/config"),
setDeliveryTime: (data) => api_request.net.POST("/api/staff/setDeliveryTime", data),
// 设置配送时间
getDeliveryTime: (data) => api_request.net.GET("/api/staff/getDeliveryTime"),
// 获取配送时间
getStaffOrder: (data) => api_request.net.GET("/api/staff/orderLists", data),
// 获取订单管理列表(配送员)
getManageOrder: (data) => api_request.net.GET("/api/leader/orderLists", data),
// 获取订单管理列表(团长)
deliveryPhoto: (data) => api_request.net.POST("/api/staff/deliveryPhoto", data),
// 送达拍照
reveiceOrder: (data) => api_request.net.POST("/api/staff/reveiceOrder", data),
// 接单
reveiceOrderOk: (data) => api_request.net.POST("/api/leader/assignOrder", data),
// 派单
getStaffList: (data) => api_request.net.GET("/api/leader/staffList"),
// 配送员列表
goodsBuyFunc: (data) => api_request.net.POST("/api/leader/goodsBuy", data),
// 商品申购
getRecordList: (data) => api_request.net.GET("/api/leader/recordList", data),
// 货物入库
/**
*
* 登录类信息
*
*/
// 检查更新
getUpdateVersion: (data) => api_request.net.GET("/api/v1/index/version"),
// 获取定位
getLocationInfo: (data) => api_request.net.GET("/api/v1/index/ip", data),
// 验证码登陆
codeLogin: (data) => api_request.net.POST("/code/login", data),
// H5扫码登录邀请接口
inviteLogin: (data) => api_request.net.POST("/api/v1/invite/login", data),
// 发送手机验证码接口
sendVerifyCode: (data) => api_request.net.POST("/api/v1/sms/send", { send_type: "student", ...data }),
// 注销账号
unRegister: (data) => api_request.net.POST("/api/v1/student/delete", data),
// 授权登录
accessLogin: (data, t = "wx") => api_request.net.POST(`/api/v1/${t}/login`, data),
// 退出登录
logOut: (data) => api_request.net.POST("/api/v1/code/logout", data),
// 获取省份
getProvince: (data) => api_request.net.GET("/api/v1/colleges/getProvince", data),
// 根据学员所选择的教学点获取院校列表接口
collegesList: (data) => api_request.net.GET("/api/v1/colleges/list", data),
// 通过市反查省/自治区/直辖市
getProvinceByCity: (data) => api_request.net.GET("/api/v1/region/getProvinceByCity", data),
/**
*
* 用户信息
*
*/
// 学员个人信息接口
selectUserInfo: (data) => api_request.net.GET("/api/v1/student/info", data),
// 登录成功后填写学员信息接口
userUpdate: (data) => api_request.net.POST("/api/v1/student/update", data),
// 邀请二维码
qrcode: (data) => api_request.net.POST("/api/v1/student/invite/qrcode", data),
uploadBase64: (data) => api_request.net.POST("/api/v1/student/uploadBase64", data),
// 获取被邀请人列表接口
inviteList: (data) => api_request.net.GET("/api/v1/student/invite/list", data),
// 积分列表
scoreList: (data) => api_request.net.GET("/point", data),
// 余额明细
balanceList: (data) => api_request.net.POST("/api/v1/balance/detail/get/list", data),
// 模拟测试记录
recordList: (data) => api_request.net.GET("/api/v1/test-record/mock/examination/record", data),
// 练习题错误集详情
practiceList: (data) => api_request.net.GET("/api/v1/test-record/practice/list", data),
/**
*
* 首页数据
*
*/
// 首页配置获取
indexConfig: (data) => api_request.net.GET("/api/v1/index/config", data),
// 轮播
// indexBanner: data => net.GET('/app/banner', data),
indexBanner: (data) => api_request.net.POST("/api/v1/index/lbt", data),
// 获取咨询文章列表
// wzList: data => net.GET('/app/consult-wz', data),
wzList: (data) => api_request.net.POST("/api/v1/index/wz/list", data),
// 获取咨询文章
// wzInfo: id => net.GET(`/app/consult-wz/${id}`),
wzInfo: (id) => api_request.net.GET(`/api/v1/index/wz/${id}`),
// 获取课程分页
getCourseList: (data) => api_request.net.GET(`/app/course/page`, data),
// 获取推荐院校列表
// recommendwzList: data => net.GET('/app/academy', data),
recommendwzList: (data) => api_request.net.POST("/api/v1/index/academy/list", data),
// 获取推荐院校文章
// recommendwzInfo: id => net.GET(`/app/academy/${id}`),
recommendwzInfo: (id) => api_request.net.GET(`/api/v1/index/academy/${id}`),
// 推荐院校文章阅读量累计
// recomendaddReadNumber: data => net.PUT('/app/academy/num',data),
recomendaddReadNumber: (data) => api_request.net.POST("/api/v1/index/academy/add/num", data),
//获取考试大纲列表
syllabusList: (data) => api_request.net.POST("/api/v1/index/syllabus/list", data),
// 搜索
search: (data) => api_request.net.POST("/api/v1/index/search", data),
// 阅读量累计
addReadNumber: (data) => api_request.net.PUT("/app/consult-wz/num", data),
// 师资团队列表
lecturerList: (data) => api_request.net.GET("/api/v1/index/lecturer", data),
// 师资详情
lecturerDetail: (id) => api_request.net.GET(`/api/v1/index/lecturer/${id}`),
// 获取资料列表
indexMaterial: (data) => api_request.net.GET("/api/v1/index/material", data),
// indexMaterial: data => net.GET('/app/material', data),
// 获取资料详情
materialDetail: (data) => api_request.net.GET(`/api/v1/index/material/${data.id}`, { buyer_id: data.buyer_id }),
// 获取精品课程
indexBoutiqueCourse: (data) => api_request.net.GET("/api/v1/index/boutique/course", data),
// 获取精品课程详情
boutiqueCourseDetail: (id) => api_request.net.GET(`/api/v1/index/boutique/course/${id}`),
// 获取课程
courseList: (data) => api_request.net.POST("/api/v1/course/get", data),
// 获取套餐
comboList: (data) => api_request.net.POST("/api/v1/combo/course/get", data),
// courseList: data => net.GET('/app/course/page', data),
// 获取课程详情
courseDetail: (id, data) => api_request.net.GET(`/api/v1/course/${id}`, data),
// courseDetail: (id, data) => net.GET(`/app/course`, {id}),
// 获取线下课程
offlineCourseList: (data) => api_request.net.POST("/api/v1/offline/course/get", data),
// 获取线下课程详情
offlineCourseDetail: (id) => api_request.net.GET(`/api/v1/offline/course/${id}`),
// 获取套餐课程详情
getComboDetail: (data) => api_request.net.GET(`/api/v1/combo/course/${data.id}`, { buyer_id: data.buyer_id }),
// 获取直播课列表
// liveCourseList: data => net.GET('/api/v1/sys-course-live', data),
liveCourseList: (data) => api_request.net.GET("/api/v1/api-live-course", data),
// 直播课详情
viewCourse: (id, data) => api_request.net.GET("/api/v1/sys-course-live/" + id, { buyer_id: data.buyer_id }),
// 直播课详情 测试
viewCourse_test: (id, data) => api_request.net.GET("/api/v1/api-live-course/" + id, { buyer_id: data.buyer_id }),
/*题库 管理*/
//题库
getQuestionExercise: (data) => api_request.net.GET("/exercises", data),
// 科目
subjectList: (data) => api_request.net.GET("/api/v1/public/subject", data),
// subjectList: data => net.GET('/app/subject/list', data),
// 获取学员学习列表接口
learningList: (data) => api_request.net.GET("/api/v1/learning", data),
// 学习课程详情
learningDetail: (data) => api_request.net.GET(`/api/v1/learning/course/${data}`),
// 学习直播课程详情
learningLiveDetail: (data) => api_request.net.GET(`/api/v1/learning/course/live/${data}`),
// 学员学习计时接口
// "time_type": "stop" //计时类型 start-开始计时 stop-停止计时
studyDuration: (data) => api_request.net.POST("/api/v1/learning/course/duration", data),
// 学习统计API
courseStatistics: (data) => api_request.net.POST("/api/v1/learning/course/statistics", data),
// 题型分类
questionBankType: (data) => api_request.net.GET("/api/v1/questionBank/type", data),
// 网课、测试、题库详情
exercisesDetails: (data) => api_request.net.GET(`/api/v1/exercises/detail/${data}`),
// 测试练习题列表
testList: (data) => api_request.net.GET("/api/v1/exercises/test/list", data),
// 模拟试卷列表
examinationList: (data) => api_request.net.GET("/api/v1/examination/list", data),
// 获取题库、网课题目列表接口
exerciseSubjectList: (data) => api_request.net.GET("/api/v1/exercise/subject/list", data),
// 试题分类
exercisesType: (data) => api_request.net.GET("/api/v1/exercises/type", data),
// 模拟题详情
examinationDetail: (id) => api_request.net.GET(`/api/v1/examination/detail/${id}`),
// 开始答题
startTest: (data) => api_request.net.POST("/api/v1/exercises/start/answer", data),
// question_bank_id
// 交卷
submitTest: (data) => api_request.net.POST("/api/v1/exercises/submit", data),
// 下一题
nextSubject: (data) => api_request.net.POST("/api/v1/exercises/next", data),
// 重新答题
againAnswer: (data) => api_request.net.POST("/api/v1/exercises/againAnswer", data),
// 答题成绩报告
scoreReport: (data) => api_request.net.GET("/api/v1/exercises/achievement/report", data),
// 获取团购列表
getGroupList: (data) => api_request.net.GET("/api/v1/group/page", data),
// 获取团购详情
getGroupPurchaseData: (data) => api_request.net.GET("/api/v1/group", data),
//发起拼团
starGroupPurchase: (data) => api_request.net.POST("/api/v1/group", data),
//加入拼团
joinGroupPurchase: (data) => api_request.net.POST("/api/v1/group/join", data),
/**
*
* 支付接口
*
*/
// 支付接口
wxOrAlipay: (data) => api_request.net.POST("/api/v1/pay", data),
// 获取openid
getOpenID: (data) => {
return common_vendor.index.request({
url: "https://api.weixin.qq.com/sns/oauth2/access_token",
method: "GET",
// header: {
// ...header,
// ...headers
// },
data
});
},
// 余额支付
yuePay: (data) => api_request.net.POST("/api/v1/student/pay/balance", data),
//H5下单API
// v3_pay:data => net.POST('https://api.mch.weixin.qq.com/v3/pay/transactions/h5',data)
v3_pay: (data) => {
return common_vendor.index.request({
url: "https://api.mch.weixin.qq.com/v3/pay/transactions/h5",
method: "POST",
header: {
"Content-Type": "application/json"
},
data
});
},
//测试
pay_check: (data) => api_request.net.POST("/api/v1/wxpay/check", data),
pay_callback: (data) => api_request.net.POST("/api/v1/wxpay/callback", data),
/**
*
* 地址接口
*
*/
// 列表
addressList: (data) => api_request.net.POST("/api/v1/address", data),
// student_id
// 新增/编辑
addressAction: (data) => api_request.net.POST(`/api/v1/address/add`, data),
editaddressAction: (data) => api_request.net.PUT(`/api/v1/address`, data),
// 删除
addressDelete: (data) => api_request.net.DELETE("/api/v1/address", data),
// id
/**
*
* 购物车接口
*
*/
// 列表
cartList: (data) => api_request.net.POST("/api/v1/shopping/cart", data),
// 添加
cartAdd: (data) => api_request.net.POST("/api/v1/shopping/cart/add", data),
// 编辑
cartUpdate: (data) => api_request.net.POST("/api/v1/shopping/cart/update", data),
// 删除
cartDelete: (data) => api_request.net.POST("/api/v1/shopping/cart/delete", data),
// id
/**
*
* 订单接口
*
*/
// 订单查询
orderList: (data) => api_request.net.POST("/api/v1/api-order/get/my/order/list", data),
// 确认收货
orderUpdate: (data) => api_request.net.POST("/api/v1/api-order/update/material/order", data),
// 删除
orderDelete: (data) => api_request.net.POST("/api/v1/api-order/delete/order", data),
/**
* 商品价格合计
* @param { order_count_list: [{ id: '', order_type: '', num: ''}] }
*
*/
orderCount: (data) => api_request.net.POST("/api/v1/api-order/order/count", data),
/**
* 资料,在线课程的立即购买/购物车
* @param { goods: [{ id: '', order_type: '', num: ''}], student_id: '' }
*
*/
orderBuynow: (data) => api_request.net.POST("/api/v1/api-order/order/buynow", data),
// 新增资料订单
orderMaterialAdd: (data) => api_request.net.POST("/api/v1/api-order/add/material/order", data),
// 新增在线课程订单
orderOnlineAdd: (data) => api_request.net.POST("/api/v1/api-order/add/online/order", data),
// 直播课订单
orderLiveAdd: (data) => api_request.net.POST("/api/v1/api-order/add/live/order", data),
// 新增套餐课程订单
orderComboAdd: (data) => api_request.net.POST("/api/v1/api-order/add/combo/order", data),
// 新增线下订单==报名
orderOfflineAdd: (data) => api_request.net.POST("/api/v1/api-order/add/offline/order", data),
// 新增团购订单
orderGroupAdd: (data) => api_request.net.POST("/api/v1/api-order/add/group/order", data),
// 分享平台
shareProvider: () => api_request.net.getShareProvider(),
// 支付方式
paymentProvider: () => api_request.net.getPaymentProvider(),
// 物流查询
queryKuaidi: (data) => api_request.net.POST("/api/v1/kuaidi/poll/query", data),
// SHARE: () => net.SHARE(),
// 提现
transfer: (data) => api_request.net.POST("/api/v1/wxpay/transfer", data),
// 获取我的收藏分页列表
getStarList: (data) => api_request.net.POST("/api/v1/favorite/get", data),
// 取消收藏
cancelStar: (data) => api_request.net.DELETE("/api/v1/favorite", data),
//添加收藏
addStar: (data) => api_request.net.POST("/api/v1/favorite", data)
};
exports.API = API;