|
|
// const MODULE = '/activity/zerobuy';
|
|
|
const serviceAPI = global.yoho.ServiceAPI;
|
|
|
|
|
|
/* 旧的api
|
|
|
const yoLuckApi = new global.yoho.ApiBase(global.yoho.config.domains.yoLuck, {
|
|
|
name: 'yoLuck',
|
|
|
cache: global.yoho.cache,
|
|
|
useCache: false
|
|
|
});
|
|
|
*/
|
|
|
|
|
|
function productTime(p) {
|
|
|
if (p.status === 1) {
|
|
|
p.end_time = 0;
|
...
|
...
|
@@ -103,15 +94,6 @@ class YoLuckApi extends global.yoho.BaseModel { |
|
|
* @returns {Promise}
|
|
|
*/
|
|
|
getDetail({actPrizeId, uid}) {
|
|
|
/* return yoLuckApi.get(MODULE + '/content', {actPrizeId, uid}).then(result => {
|
|
|
if (result.code === 200) {
|
|
|
productTime(result.data);
|
|
|
result.data.countdown = formatCountDown(result.data.end_time);
|
|
|
}
|
|
|
|
|
|
return result;
|
|
|
});*/
|
|
|
|
|
|
return this.get({
|
|
|
data: {
|
|
|
method: 'app.yoluck.getContent',
|
...
|
...
|
@@ -119,7 +101,6 @@ class YoLuckApi extends global.yoho.BaseModel { |
|
|
actPrizeId
|
|
|
}
|
|
|
}).then(result => {
|
|
|
// console.log('detail:', result);
|
|
|
if (result.code === 200) {
|
|
|
productTime(result.data);
|
|
|
result.data.countdown = formatCountDown(result.data.endTime);
|
...
|
...
|
@@ -135,26 +116,6 @@ class YoLuckApi extends global.yoho.BaseModel { |
|
|
* @returns {Promise}
|
|
|
*/
|
|
|
getRecommend({actPrizeId}) {
|
|
|
/* return yoLuckApi.get(MODULE + '/list/recommend', {
|
|
|
actPrizeId,
|
|
|
channel: 0
|
|
|
}).then(result => {
|
|
|
if (result.code === 200) {
|
|
|
const products = result.data;
|
|
|
const newProducts = products.map((p) => {
|
|
|
p = productTime(p);
|
|
|
p.countdown = formatCountDown(p.end_time);
|
|
|
|
|
|
return p;
|
|
|
});
|
|
|
|
|
|
result.data = newProducts;
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
return result;
|
|
|
});*/
|
|
|
|
|
|
return this.get({
|
|
|
data: {
|
|
|
method: 'app.yoluck.recommendList',
|
...
|
...
|
@@ -163,7 +124,6 @@ class YoLuckApi extends global.yoho.BaseModel { |
|
|
}
|
|
|
}).then(result => {
|
|
|
if (result.code === 200) {
|
|
|
// console.log('recomment=', result);
|
|
|
const products = result.data;
|
|
|
const newProducts = products.map((p) => {
|
|
|
p = productTime(p);
|
...
|
...
|
@@ -186,7 +146,6 @@ class YoLuckApi extends global.yoho.BaseModel { |
|
|
* @returns {Promise}
|
|
|
*/
|
|
|
getRecentAvatars({actPrizeId}) {
|
|
|
// return yoLuckApi.get(MODULE + '/code/recent', {actPrizeId});
|
|
|
return this.get({
|
|
|
data: {
|
|
|
method: 'app.yoluck.recent',
|
...
|
...
|
@@ -202,7 +161,6 @@ class YoLuckApi extends global.yoho.BaseModel { |
|
|
* @returns {Promise}
|
|
|
*/
|
|
|
getMyList({page, type, limit, uid}) {
|
|
|
// return yoLuckApi.get(MODULE + '/list/mine', {type, page, uid, limit, channel: 0});
|
|
|
return this.get({
|
|
|
data: {
|
|
|
method: 'app.yoluck.participationList',
|
...
|
...
|
@@ -222,7 +180,6 @@ class YoLuckApi extends global.yoho.BaseModel { |
|
|
* @returns {Promise}
|
|
|
*/
|
|
|
getMyListWithActid(uid, actPrizeId) {
|
|
|
// return yoLuckApi.get(MODULE + '/code/mine', {uid, actPrizeId});
|
|
|
return this.get({
|
|
|
data: {
|
|
|
method: 'app.yoluck.userCode',
|
...
|
...
|
@@ -242,14 +199,6 @@ class YoLuckApi extends global.yoho.BaseModel { |
|
|
* @returns {Promise}
|
|
|
*/
|
|
|
fetchCode({shareUid, uid, actPrizeId, userThumb, userName}) {
|
|
|
/* return yoLuckApi.post(MODULE + '/code/gain', {
|
|
|
shareUid,
|
|
|
uid,
|
|
|
actPrizeId,
|
|
|
userThumb,
|
|
|
userName
|
|
|
});*/
|
|
|
|
|
|
return this.get({
|
|
|
data: {
|
|
|
method: 'app.yoluck.getCode',
|
...
|
...
|
|