Authored by 邱骏

去掉console.log

// 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',
... ...
... ... @@ -156,7 +156,6 @@ class YoLuckService extends global.yoho.BaseModel {
result.push(resFinished);
}
// console.log('已参加:', result);
return result;
} else {
result = await this.api.getList({page, type});
... ... @@ -176,7 +175,6 @@ class YoLuckService extends global.yoho.BaseModel {
}
async _getDetail(actPrizeId, uid) {
// console.log('uid', uid);
try {
const result = await this.api.getDetail({actPrizeId, uid});
... ... @@ -378,8 +376,6 @@ class YoLuckService extends global.yoho.BaseModel {
try {
const result = await this.api.getMyList({page, type, uid, limit});
// console.log('已参加列表:', result.data.list);
if (result.code !== 200) {
return {
error: '出错了'
... ... @@ -445,9 +441,6 @@ class YoLuckService extends global.yoho.BaseModel {
async getCode({shareUid, uid, actPrizeId}) {
try {
let userInfo = await this.api._getUsreInfo(uid);
console.log('获取抽奖码用户信息:', userInfo);
let userName = _.get(userInfo, 'data.nickname', '');
let userThumb = _.get(userInfo, 'data.head_ico', '');
... ... @@ -459,8 +452,6 @@ class YoLuckService extends global.yoho.BaseModel {
userName
});
console.log('获取抽奖码接口返回:', result);
if (result.code !== 200) {
logger.error(result);
... ... @@ -485,9 +476,6 @@ class YoLuckService extends global.yoho.BaseModel {
async getActivityCodeList(uid, actPrizeId) {
let result = await this.api.getMyListWithActid(uid, actPrizeId);
console.log('myresult:', result);
let codeList = [];
let nearAvatar = '//img10.static.yhbimg.com/headimg/2013/11/28/09/01cae078abe5fe320c88cdf4c220212688.gif?imageView/2/w/100/h/100'; // eslint-disable-line
... ... @@ -509,7 +497,6 @@ class YoLuckService extends global.yoho.BaseModel {
}
});
// console.log('mycode:', codeList);
return codeList;
}
}
... ...
... ... @@ -106,7 +106,6 @@ getUser();
}
api.getDetailMyCode({id}).then(res => {
console.log(res);
if (res.code !== 200) {
return;
}
... ...