Authored by 邱骏

yoluck接口及显示状态修改

@@ -163,7 +163,7 @@ class YoLuckApi extends global.yoho.BaseModel { @@ -163,7 +163,7 @@ class YoLuckApi extends global.yoho.BaseModel {
163 } 163 }
164 }).then(result => { 164 }).then(result => {
165 if (result.code === 200) { 165 if (result.code === 200) {
166 - console.log('recomment=', result); 166 + // console.log('recomment=', result);
167 const products = result.data; 167 const products = result.data;
168 const newProducts = products.map((p) => { 168 const newProducts = products.map((p) => {
169 p = productTime(p); 169 p = productTime(p);
@@ -155,7 +155,8 @@ class YoLuckService extends global.yoho.BaseModel { @@ -155,7 +155,8 @@ class YoLuckService extends global.yoho.BaseModel {
155 } else { 155 } else {
156 result.push(resFinished); 156 result.push(resFinished);
157 } 157 }
158 - console.log('已参加:', result); 158 +
  159 + // console.log('已参加:', result);
159 return result; 160 return result;
160 } else { 161 } else {
161 result = await this.api.getList({page, type}); 162 result = await this.api.getList({page, type});
@@ -175,7 +176,7 @@ class YoLuckService extends global.yoho.BaseModel { @@ -175,7 +176,7 @@ class YoLuckService extends global.yoho.BaseModel {
175 } 176 }
176 177
177 async _getDetail(actPrizeId, uid) { 178 async _getDetail(actPrizeId, uid) {
178 - console.log('uid', uid); 179 + // console.log('uid', uid);
179 try { 180 try {
180 const result = await this.api.getDetail({actPrizeId, uid}); 181 const result = await this.api.getDetail({actPrizeId, uid});
181 182
@@ -445,6 +446,8 @@ class YoLuckService extends global.yoho.BaseModel { @@ -445,6 +446,8 @@ class YoLuckService extends global.yoho.BaseModel {
445 try { 446 try {
446 let userInfo = await this.api._getUsreInfo(uid); 447 let userInfo = await this.api._getUsreInfo(uid);
447 448
  449 + console.log('获取抽奖码用户信息:', userInfo);
  450 +
448 let userName = _.get(userInfo, 'data.nickname', ''); 451 let userName = _.get(userInfo, 'data.nickname', '');
449 let userThumb = _.get(userInfo, 'data.head_ico', ''); 452 let userThumb = _.get(userInfo, 'data.head_ico', '');
450 453
@@ -456,6 +459,8 @@ class YoLuckService extends global.yoho.BaseModel { @@ -456,6 +459,8 @@ class YoLuckService extends global.yoho.BaseModel {
456 userName 459 userName
457 }); 460 });
458 461
  462 + console.log('获取抽奖码接口返回:', result);
  463 +
459 if (result.code !== 200) { 464 if (result.code !== 200) {
460 logger.error(result); 465 logger.error(result);
461 466
@@ -487,23 +492,24 @@ class YoLuckService extends global.yoho.BaseModel { @@ -487,23 +492,24 @@ class YoLuckService extends global.yoho.BaseModel {
487 let nearAvatar = '//img10.static.yhbimg.com/headimg/2013/11/28/09/01cae078abe5fe320c88cdf4c220212688.gif?imageView/2/w/100/h/100'; // eslint-disable-line 492 let nearAvatar = '//img10.static.yhbimg.com/headimg/2013/11/28/09/01cae078abe5fe320c88cdf4c220212688.gif?imageView/2/w/100/h/100'; // eslint-disable-line
488 493
489 _.forEach(_.get(result, 'data', []), value => { 494 _.forEach(_.get(result, 'data', []), value => {
490 - if (value.prize_code) {  
491 - if (value.user_thumb.indexOf('headimg') > 0) {  
492 - value.user_thumb = nearAvatar; 495 + if (value.prizeCode) {
  496 + if (value.userThumb.indexOf('headimg') > 0) {
  497 + value.userThumb = nearAvatar;
493 } else { 498 } else {
494 - if (value.user_thumb.indexOf('?') > 0) {  
495 - value.user_thumb = _.split(value.user_thumb, '?')[0] + '?imageView2/2/w/70/h/70/q/60'; 499 + if (value.userThumb.indexOf('?') > 0) {
  500 + value.userThumb = _.split(value.userThumb, '?')[0] + '?imageView2/2/w/70/h/70/q/60';
496 } 501 }
497 - nearAvatar = value.user_thumb; 502 + nearAvatar = value.userThumb;
498 } 503 }
499 504
500 codeList.push({ 505 codeList.push({
501 - prizeCode: value.prize_code,  
502 - userThumb: value.user_thumb 506 + prizeCode: value.prizeCode,
  507 + userThumb: value.userThumb
503 }); 508 });
504 } 509 }
505 }); 510 });
506 - console.log('mycode:', codeList); 511 +
  512 + // console.log('mycode:', codeList);
507 return codeList; 513 return codeList;
508 } 514 }
509 } 515 }
@@ -21,7 +21,7 @@ @@ -21,7 +21,7 @@
21 {{/isEqualOr}} 21 {{/isEqualOr}}
22 22
23 {{#isEqualOr status 3}} 23 {{#isEqualOr status 3}}
24 - <div class="counter-num" > 等待开奖 </div> 24 + <div class="counter-num" > 等待开奖 </div>
25 {{/isEqualOr}} 25 {{/isEqualOr}}
26 26
27 {{#isEqualOr status 4}} 27 {{#isEqualOr status 4}}
@@ -7,7 +7,6 @@ @@ -7,7 +7,6 @@
7 <text style="color: black;">{{prizeCode}}</text> 7 <text style="color: black;">{{prizeCode}}</text>
8 </div> 8 </div>
9 <div class="product-name">{{name}}</div> 9 <div class="product-name">{{name}}</div>
10 -  
11 {{#ifcond status '===' 0}} 10 {{#ifcond status '===' 0}}
12 <div class="btn">活动结束</div> 11 <div class="btn">活动结束</div>
13 {{/ifcond}} 12 {{/ifcond}}
@@ -21,7 +20,7 @@ @@ -21,7 +20,7 @@
21 {{/ifcond}} 20 {{/ifcond}}
22 21
23 {{#ifcond status '===' 5}} 22 {{#ifcond status '===' 5}}
24 - <div class="btn">人数不足 活动结束</div> 23 + <div class="btn">等待开奖</div>
25 {{/ifcond}} 24 {{/ifcond}}
26 25
27 {{#isEqualOr status 1 2 6}} 26 {{#isEqualOr status 1 2 6}}
@@ -4,7 +4,6 @@ @@ -4,7 +4,6 @@
4 <span class="title">进行中</span> 4 <span class="title">进行中</span>
5 </div> 5 </div>
6 </div> 6 </div>
7 -{{log .}}  
8 {{#ifcond running.data.list.length '>' 0}} 7 {{#ifcond running.data.list.length '>' 0}}
9 {{#each running.data.list}} 8 {{#each running.data.list}}
10 {{> yoluck/prize-item .}} 9 {{> yoluck/prize-item .}}
1 1
2 -  
3 <div class="product-status"> 2 <div class="product-status">
4 {{#isEqualOr status 0}} 3 {{#isEqualOr status 0}}
5 <div class="btn cancel" >活动结束</div> 4 <div class="btn cancel" >活动结束</div>
@@ -12,12 +11,14 @@ @@ -12,12 +11,14 @@
12 {{#isEqualOr status 2}} 11 {{#isEqualOr status 2}}
13 <a class="btn ok js-join" data-id="{{id}}">参加抽奖</a> 12 <a class="btn ok js-join" data-id="{{id}}">参加抽奖</a>
14 {{/isEqualOr}} 13 {{/isEqualOr}}
15 -  
16 -{{#isEqualOr status 3 4}} 14 + {{#isEqualOr status 3}}
  15 + <div class="btn cancel">等待开奖</div>
  16 + {{/isEqualOr}}
  17 +{{#isEqualOr status 4}}
17 <div class="btn cancel">活动结束</div> 18 <div class="btn cancel">活动结束</div>
18 {{/isEqualOr}} 19 {{/isEqualOr}}
19 20
20 {{#isEqualOr status 5}} 21 {{#isEqualOr status 5}}
21 - <div class="btn cancel">待开奖</div> 22 + <div class="btn cancel">待开奖</div>
22 {{/isEqualOr}} 23 {{/isEqualOr}}
23 </div> 24 </div>
1 <div class="prize-item-comp"> 1 <div class="prize-item-comp">
2 <div class="prize-item js-prizeitem" data-id="{{id}}"> 2 <div class="prize-item js-prizeitem" data-id="{{id}}">
3 <img class="product-image" src="{{coverImg}}" alt=""> 3 <img class="product-image" src="{{coverImg}}" alt="">
4 -  
5 <div class="content"> 4 <div class="content">
6 <div class="code">抽奖码 5 <div class="code">抽奖码
7 <text style="color: black;">{{prizeCode}}</text> 6 <text style="color: black;">{{prizeCode}}</text>
@@ -5,7 +5,6 @@ @@ -5,7 +5,6 @@
5 </div> 5 </div>
6 </div> 6 </div>
7 7
8 -{{log .}}  
9 {{#ifcond running.data.list.length '>' 0}} 8 {{#ifcond running.data.list.length '>' 0}}
10 {{#each running.data.list}} 9 {{#each running.data.list}}
11 {{> ./prize-item .}} 10 {{> ./prize-item .}}
1 1
2 -  
3 <div class="product-status"> 2 <div class="product-status">
4 {{#is-equal-or status 0}} 3 {{#is-equal-or status 0}}
5 <div class="btn cancel" >活动结束</div> 4 <div class="btn cancel" >活动结束</div>
@@ -12,8 +11,10 @@ @@ -12,8 +11,10 @@
12 {{#is-equal-or status 2}} 11 {{#is-equal-or status 2}}
13 <a class="btn ok js-join" data-id="{{id}}">参加抽奖</a> 12 <a class="btn ok js-join" data-id="{{id}}">参加抽奖</a>
14 {{/is-equal-or}} 13 {{/is-equal-or}}
15 -  
16 -{{#is-equal-or status 3 4}} 14 +{{#is-equal-or status 3}}
  15 + <div class="btn cancel">等待开奖</div>
  16 +{{/is-equal-or}}
  17 +{{#is-equal-or status 4}}
17 <div class="btn cancel">活动结束</div> 18 <div class="btn cancel">活动结束</div>
18 {{/is-equal-or}} 19 {{/is-equal-or}}
19 20
@@ -106,6 +106,7 @@ getUser(); @@ -106,6 +106,7 @@ getUser();
106 } 106 }
107 107
108 api.getDetailMyCode({id}).then(res => { 108 api.getDetailMyCode({id}).then(res => {
  109 + console.log(res);
109 if (res.code !== 200) { 110 if (res.code !== 200) {
110 return; 111 return;
111 } 112 }