Authored by 邱骏

yoluck接口及显示状态修改

... ... @@ -163,7 +163,7 @@ class YoLuckApi extends global.yoho.BaseModel {
}
}).then(result => {
if (result.code === 200) {
console.log('recomment=', result);
// console.log('recomment=', result);
const products = result.data;
const newProducts = products.map((p) => {
p = productTime(p);
... ...
... ... @@ -155,7 +155,8 @@ class YoLuckService extends global.yoho.BaseModel {
} else {
result.push(resFinished);
}
console.log('已参加:', result);
// console.log('已参加:', result);
return result;
} else {
result = await this.api.getList({page, type});
... ... @@ -175,7 +176,7 @@ class YoLuckService extends global.yoho.BaseModel {
}
async _getDetail(actPrizeId, uid) {
console.log('uid', uid);
// console.log('uid', uid);
try {
const result = await this.api.getDetail({actPrizeId, uid});
... ... @@ -445,6 +446,8 @@ class YoLuckService extends global.yoho.BaseModel {
try {
let userInfo = await this.api._getUsreInfo(uid);
console.log('获取抽奖码用户信息:', userInfo);
let userName = _.get(userInfo, 'data.nickname', '');
let userThumb = _.get(userInfo, 'data.head_ico', '');
... ... @@ -456,6 +459,8 @@ class YoLuckService extends global.yoho.BaseModel {
userName
});
console.log('获取抽奖码接口返回:', result);
if (result.code !== 200) {
logger.error(result);
... ... @@ -487,23 +492,24 @@ class YoLuckService extends global.yoho.BaseModel {
let nearAvatar = '//img10.static.yhbimg.com/headimg/2013/11/28/09/01cae078abe5fe320c88cdf4c220212688.gif?imageView/2/w/100/h/100'; // eslint-disable-line
_.forEach(_.get(result, 'data', []), value => {
if (value.prize_code) {
if (value.user_thumb.indexOf('headimg') > 0) {
value.user_thumb = nearAvatar;
if (value.prizeCode) {
if (value.userThumb.indexOf('headimg') > 0) {
value.userThumb = nearAvatar;
} else {
if (value.user_thumb.indexOf('?') > 0) {
value.user_thumb = _.split(value.user_thumb, '?')[0] + '?imageView2/2/w/70/h/70/q/60';
if (value.userThumb.indexOf('?') > 0) {
value.userThumb = _.split(value.userThumb, '?')[0] + '?imageView2/2/w/70/h/70/q/60';
}
nearAvatar = value.user_thumb;
nearAvatar = value.userThumb;
}
codeList.push({
prizeCode: value.prize_code,
userThumb: value.user_thumb
prizeCode: value.prizeCode,
userThumb: value.userThumb
});
}
});
console.log('mycode:', codeList);
// console.log('mycode:', codeList);
return codeList;
}
}
... ...
... ... @@ -21,7 +21,7 @@
{{/isEqualOr}}
{{#isEqualOr status 3}}
<div class="counter-num" > 等待开奖 </div>
<div class="counter-num" > 等待开奖 </div>
{{/isEqualOr}}
{{#isEqualOr status 4}}
... ...
... ... @@ -7,7 +7,6 @@
<text style="color: black;">{{prizeCode}}</text>
</div>
<div class="product-name">{{name}}</div>
{{#ifcond status '===' 0}}
<div class="btn">活动结束</div>
{{/ifcond}}
... ... @@ -21,7 +20,7 @@
{{/ifcond}}
{{#ifcond status '===' 5}}
<div class="btn">人数不足 活动结束</div>
<div class="btn">等待开奖</div>
{{/ifcond}}
{{#isEqualOr status 1 2 6}}
... ...
... ... @@ -4,7 +4,6 @@
<span class="title">进行中</span>
</div>
</div>
{{log .}}
{{#ifcond running.data.list.length '>' 0}}
{{#each running.data.list}}
{{> yoluck/prize-item .}}
... ...
<div class="product-status">
{{#isEqualOr status 0}}
<div class="btn cancel" >活动结束</div>
... ... @@ -12,12 +11,14 @@
{{#isEqualOr status 2}}
<a class="btn ok js-join" data-id="{{id}}">参加抽奖</a>
{{/isEqualOr}}
{{#isEqualOr status 3 4}}
{{#isEqualOr status 3}}
<div class="btn cancel">等待开奖</div>
{{/isEqualOr}}
{{#isEqualOr status 4}}
<div class="btn cancel">活动结束</div>
{{/isEqualOr}}
{{#isEqualOr status 5}}
<div class="btn cancel">待开奖</div>
<div class="btn cancel">待开奖</div>
{{/isEqualOr}}
</div>
... ...
<div class="prize-item-comp">
<div class="prize-item js-prizeitem" data-id="{{id}}">
<img class="product-image" src="{{coverImg}}" alt="">
<div class="content">
<div class="code">抽奖码
<text style="color: black;">{{prizeCode}}</text>
... ...
... ... @@ -5,7 +5,6 @@
</div>
</div>
{{log .}}
{{#ifcond running.data.list.length '>' 0}}
{{#each running.data.list}}
{{> ./prize-item .}}
... ...
<div class="product-status">
{{#is-equal-or status 0}}
<div class="btn cancel" >活动结束</div>
... ... @@ -12,8 +11,10 @@
{{#is-equal-or status 2}}
<a class="btn ok js-join" data-id="{{id}}">参加抽奖</a>
{{/is-equal-or}}
{{#is-equal-or status 3 4}}
{{#is-equal-or status 3}}
<div class="btn cancel">等待开奖</div>
{{/is-equal-or}}
{{#is-equal-or status 4}}
<div class="btn cancel">活动结束</div>
{{/is-equal-or}}
... ...
... ... @@ -106,6 +106,7 @@ getUser();
}
api.getDetailMyCode({id}).then(res => {
console.log(res);
if (res.code !== 200) {
return;
}
... ...