|
@@ -37,7 +37,7 @@ module.exports = {
|
|
}).url(url).send();
|
|
}).url(url).send();
|
|
},
|
|
},
|
|
// 获取全部课本
|
|
// 获取全部课本
|
|
- getAllBooks(pageNo,pageSize) {
|
|
|
|
|
|
+ getAllBooks(pageNo, pageSize) {
|
|
let url = getProductUrl('wx/product');
|
|
let url = getProductUrl('wx/product');
|
|
return request.getInstance().header({
|
|
return request.getInstance().header({
|
|
uid: wx.getStorageSync('uid')
|
|
uid: wx.getStorageSync('uid')
|
|
@@ -47,41 +47,41 @@ module.exports = {
|
|
}).send();
|
|
}).send();
|
|
},
|
|
},
|
|
// 获取课本详情
|
|
// 获取课本详情
|
|
- getBookDetail(uid,id) {
|
|
|
|
|
|
+ getBookDetail(uid, id) {
|
|
let url = getProductUrl(`wx/product/${id}`);
|
|
let url = getProductUrl(`wx/product/${id}`);
|
|
return request.getInstance().header({
|
|
return request.getInstance().header({
|
|
uid
|
|
uid
|
|
}).url(url).send();
|
|
}).url(url).send();
|
|
},
|
|
},
|
|
// 获取单课详情
|
|
// 获取单课详情
|
|
- getClassDetail(uid,id) {
|
|
|
|
|
|
+ getClassDetail(uid, id) {
|
|
let url = getProductUrl(`wx/lesson/${id}`);
|
|
let url = getProductUrl(`wx/lesson/${id}`);
|
|
return request.getInstance().header({
|
|
return request.getInstance().header({
|
|
uid
|
|
uid
|
|
}).url(url).send();
|
|
}).url(url).send();
|
|
},
|
|
},
|
|
// 检查是否收藏过课程
|
|
// 检查是否收藏过课程
|
|
- classIsLike(uid,data){
|
|
|
|
|
|
+ classIsLike(uid, data) {
|
|
let url = getProductUrl(`wx/favorites/isLike`);
|
|
let url = getProductUrl(`wx/favorites/isLike`);
|
|
return request.getInstance().header({
|
|
return request.getInstance().header({
|
|
uid
|
|
uid
|
|
}).url(url).data(data).send();
|
|
}).url(url).data(data).send();
|
|
},
|
|
},
|
|
- getClassDetail(uid,id) {
|
|
|
|
|
|
+ getClassDetail(uid, id) {
|
|
let url = getProductUrl(`wx/lesson/${id}`);
|
|
let url = getProductUrl(`wx/lesson/${id}`);
|
|
return request.getInstance().header({
|
|
return request.getInstance().header({
|
|
uid
|
|
uid
|
|
}).url(url).send();
|
|
}).url(url).send();
|
|
},
|
|
},
|
|
// 获取单课朗读信息
|
|
// 获取单课朗读信息
|
|
- getClassRead(uid,data){
|
|
|
|
|
|
+ getClassRead(uid, data) {
|
|
let url = getBaseUrl(`wx/userRead`);
|
|
let url = getBaseUrl(`wx/userRead`);
|
|
return request.getInstance().header({
|
|
return request.getInstance().header({
|
|
uid
|
|
uid
|
|
}).data(data).url(url).send();
|
|
}).data(data).url(url).send();
|
|
},
|
|
},
|
|
// 作品播放了+1
|
|
// 作品播放了+1
|
|
- playWorks(uid,readId){
|
|
|
|
|
|
+ playWorks(uid, readId) {
|
|
let url = getBaseUrl(`wx/userRead/play/${readId}`);
|
|
let url = getBaseUrl(`wx/userRead/play/${readId}`);
|
|
return request.getInstance().header({
|
|
return request.getInstance().header({
|
|
uid
|
|
uid
|
|
@@ -96,7 +96,7 @@ module.exports = {
|
|
}).url(url).data(data).method('POST').send();
|
|
}).url(url).data(data).method('POST').send();
|
|
},
|
|
},
|
|
// 点赞作品
|
|
// 点赞作品
|
|
- likeWorks(uid,readId){
|
|
|
|
|
|
+ likeWorks(uid, readId) {
|
|
let url = getBaseUrl(`wx/userRead/like/${readId}`);
|
|
let url = getBaseUrl(`wx/userRead/like/${readId}`);
|
|
return request.getInstance().header({
|
|
return request.getInstance().header({
|
|
uid
|
|
uid
|
|
@@ -132,19 +132,19 @@ module.exports = {
|
|
}).send();
|
|
}).send();
|
|
},
|
|
},
|
|
// 搜索
|
|
// 搜索
|
|
- getSearchResult(uid,key,pageNo,pageSize){
|
|
|
|
|
|
+ getSearchResult(uid, key, pageNo, pageSize) {
|
|
let url = getProductUrl(`wx/lesson`);
|
|
let url = getProductUrl(`wx/lesson`);
|
|
return request.getInstance().header({
|
|
return request.getInstance().header({
|
|
uid
|
|
uid
|
|
}).url(url).data({
|
|
}).url(url).data({
|
|
- title:key,
|
|
|
|
|
|
+ title: key,
|
|
productId: '',
|
|
productId: '',
|
|
pageNo: pageNo,
|
|
pageNo: pageNo,
|
|
pageSize: pageSize
|
|
pageSize: pageSize
|
|
}).send();
|
|
}).send();
|
|
},
|
|
},
|
|
// 获取回复信息
|
|
// 获取回复信息
|
|
- getReply(uid, columnId, pageNo, pageSize){
|
|
|
|
|
|
+ getReply(uid, columnId, pageNo, pageSize) {
|
|
let url = getBaseUrl(`wx/posts/reply`);
|
|
let url = getBaseUrl(`wx/posts/reply`);
|
|
return request.getInstance().header({
|
|
return request.getInstance().header({
|
|
uid
|
|
uid
|
|
@@ -155,56 +155,56 @@ module.exports = {
|
|
}).send();
|
|
}).send();
|
|
},
|
|
},
|
|
// 获取回复(楼中楼)
|
|
// 获取回复(楼中楼)
|
|
- getReplyComment(uid, postId){
|
|
|
|
|
|
+ getReplyComment(uid, postId) {
|
|
let url = getBaseUrl(`wx/posts/one/${postId}`);
|
|
let url = getBaseUrl(`wx/posts/one/${postId}`);
|
|
return request.getInstance().header({
|
|
return request.getInstance().header({
|
|
uid
|
|
uid
|
|
}).url(url).send();
|
|
}).url(url).send();
|
|
},
|
|
},
|
|
// 发布回复(楼中楼)
|
|
// 发布回复(楼中楼)
|
|
- postReplyComment(uid, data){
|
|
|
|
|
|
+ postReplyComment(uid, data) {
|
|
let url = getBaseUrl(`wx/reply`);
|
|
let url = getBaseUrl(`wx/reply`);
|
|
return request.getInstance().header({
|
|
return request.getInstance().header({
|
|
uid
|
|
uid
|
|
}).url(url).data(data).method('POST').send();
|
|
}).url(url).data(data).method('POST').send();
|
|
},
|
|
},
|
|
// 点赞评论
|
|
// 点赞评论
|
|
- likeCommend(uid,likeUid){
|
|
|
|
|
|
+ likeCommend(uid, likeUid) {
|
|
let url = getBaseUrl(`wx/posts/attribute/${likeUid}`);
|
|
let url = getBaseUrl(`wx/posts/attribute/${likeUid}`);
|
|
return request.getInstance().header({
|
|
return request.getInstance().header({
|
|
uid
|
|
uid
|
|
}).url(url).method('GET').send();
|
|
}).url(url).method('GET').send();
|
|
},
|
|
},
|
|
// 发布讨论
|
|
// 发布讨论
|
|
- postReply(uid, data){
|
|
|
|
|
|
+ postReply(uid, data) {
|
|
let url = getBaseUrl(`wx/posts`);
|
|
let url = getBaseUrl(`wx/posts`);
|
|
return request.getInstance().header({
|
|
return request.getInstance().header({
|
|
uid
|
|
uid
|
|
}).url(url).data(data).method('POST').send();
|
|
}).url(url).data(data).method('POST').send();
|
|
},
|
|
},
|
|
// 获取推荐团购信息
|
|
// 获取推荐团购信息
|
|
- getGroupList () {
|
|
|
|
|
|
+ getGroupList() {
|
|
let url = getBaseUrl(`wx/groupPurchaseInfo/recommend`);
|
|
let url = getBaseUrl(`wx/groupPurchaseInfo/recommend`);
|
|
return request.getInstance().header({
|
|
return request.getInstance().header({
|
|
uid: wx.getStorageSync('uid')
|
|
uid: wx.getStorageSync('uid')
|
|
}).url(url).send();
|
|
}).url(url).send();
|
|
},
|
|
},
|
|
// 获取课程团购信息
|
|
// 获取课程团购信息
|
|
- getGroupPurchaseInfo (productId) {
|
|
|
|
|
|
+ getGroupPurchaseInfo(productId) {
|
|
let url = getBaseUrl(`wx/groupPurchaseInfo/info/${productId}`);
|
|
let url = getBaseUrl(`wx/groupPurchaseInfo/info/${productId}`);
|
|
return request.getInstance().header({
|
|
return request.getInstance().header({
|
|
uid: wx.getStorageSync('uid')
|
|
uid: wx.getStorageSync('uid')
|
|
}).url(url).send();
|
|
}).url(url).send();
|
|
},
|
|
},
|
|
// 发起团购
|
|
// 发起团购
|
|
- SendGroupPurchas (data) {
|
|
|
|
|
|
+ SendGroupPurchas(data) {
|
|
let url = getBaseUrl(`wx/groupPurchase/create`);
|
|
let url = getBaseUrl(`wx/groupPurchase/create`);
|
|
return request.getInstance().header({
|
|
return request.getInstance().header({
|
|
uid: wx.getStorageSync('uid')
|
|
uid: wx.getStorageSync('uid')
|
|
}).url(url).data(data).method('POST').send();
|
|
}).url(url).data(data).method('POST').send();
|
|
},
|
|
},
|
|
// 参加团购
|
|
// 参加团购
|
|
- JoinGroupPurchas (orderId) {
|
|
|
|
|
|
+ JoinGroupPurchas(orderId) {
|
|
let url = getBaseUrl(`wx/groupPurchase/join`);
|
|
let url = getBaseUrl(`wx/groupPurchase/join`);
|
|
return request.getInstance().header({
|
|
return request.getInstance().header({
|
|
uid: wx.getStorageSync('uid')
|
|
uid: wx.getStorageSync('uid')
|
|
@@ -213,14 +213,14 @@ module.exports = {
|
|
}).method('POST').send();
|
|
}).method('POST').send();
|
|
},
|
|
},
|
|
// 收藏课程
|
|
// 收藏课程
|
|
- collectClass(uid, data){
|
|
|
|
|
|
+ collectClass(uid, data) {
|
|
let url = getProductUrl(`wx/favorites`);
|
|
let url = getProductUrl(`wx/favorites`);
|
|
return request.getInstance().header({
|
|
return request.getInstance().header({
|
|
uid
|
|
uid
|
|
}).url(url).data(data).method('POST').send();
|
|
}).url(url).data(data).method('POST').send();
|
|
},
|
|
},
|
|
//我的团
|
|
//我的团
|
|
- getMygroup () {
|
|
|
|
|
|
+ getMygroup() {
|
|
let url = getBaseUrl(`wx/groupPurchase/my`);
|
|
let url = getBaseUrl(`wx/groupPurchase/my`);
|
|
return request.getInstance().header({
|
|
return request.getInstance().header({
|
|
uid: wx.getStorageSync('uid')
|
|
uid: wx.getStorageSync('uid')
|
|
@@ -230,23 +230,23 @@ module.exports = {
|
|
}).send();
|
|
}).send();
|
|
},
|
|
},
|
|
//获取团购详情
|
|
//获取团购详情
|
|
- getMygroupInfo (orderId) {
|
|
|
|
|
|
+ getMygroupInfo(orderId) {
|
|
let url = getBaseUrl(`wx/groupPurchase/info/${orderId}`);
|
|
let url = getBaseUrl(`wx/groupPurchase/info/${orderId}`);
|
|
return request.getInstance().header({
|
|
return request.getInstance().header({
|
|
uid: wx.getStorageSync('uid')
|
|
uid: wx.getStorageSync('uid')
|
|
}).url(url).send();
|
|
}).url(url).send();
|
|
},
|
|
},
|
|
//团购是否成功
|
|
//团购是否成功
|
|
- groupSuccess (orderId) {
|
|
|
|
|
|
+ groupSuccess(orderId) {
|
|
let url = getBaseUrl(`wx/groupPurchase/joinStatus`);
|
|
let url = getBaseUrl(`wx/groupPurchase/joinStatus`);
|
|
return request.getInstance().header({
|
|
return request.getInstance().header({
|
|
uid: wx.getStorageSync('uid')
|
|
uid: wx.getStorageSync('uid')
|
|
}).url(url).data({
|
|
}).url(url).data({
|
|
orderId
|
|
orderId
|
|
}).send();
|
|
}).send();
|
|
- },
|
|
|
|
|
|
+ },
|
|
// 发起奖励
|
|
// 发起奖励
|
|
- rewardMoney(uid, data){
|
|
|
|
|
|
+ rewardMoney(uid, data) {
|
|
let url = getBaseUrl(`wx/wallet/award`);
|
|
let url = getBaseUrl(`wx/wallet/award`);
|
|
return request.getInstance().header({
|
|
return request.getInstance().header({
|
|
uid
|
|
uid
|
|
@@ -276,5 +276,12 @@ module.exports = {
|
|
}).data({
|
|
}).data({
|
|
uid: wx.getStorageSync('uid')
|
|
uid: wx.getStorageSync('uid')
|
|
}).url(url).send();
|
|
}).url(url).send();
|
|
|
|
+},
|
|
|
|
+ // 生成二维码
|
|
|
|
+ createQRCode(data){
|
|
|
|
+ let url = getBaseUrl(`wx/qrCode`);
|
|
|
|
+ return request.getInstance().header({
|
|
|
|
+ uid: wx.getStorageSync('uid')
|
|
|
|
+ }).data(data).url(url).send();
|
|
}
|
|
}
|
|
}
|
|
}
|