Authored by 李奇

人数导致的活动结束显示为待开奖

@@ -40,6 +40,10 @@ @@ -40,6 +40,10 @@
40 <block wx:elif="{{status === 6}}"> 40 <block wx:elif="{{status === 6}}">
41 <view class="action-item over">活动已结束</view> 41 <view class="action-item over">活动已结束</view>
42 </block> 42 </block>
  43 +
  44 + <block wx:elif="{{status === 7}}">
  45 + <view class="action-item over">等待开奖中</view>
  46 + </block>
43 </view> 47 </view>
44 48
45 <new-lucky-alert wx:if="{{show}}" bindhiddenalert="hiddenAlert"> 49 <new-lucky-alert wx:if="{{show}}" bindhiddenalert="hiddenAlert">
@@ -54,16 +58,6 @@ @@ -54,16 +58,6 @@
54 </form> 58 </form>
55 <view class="share-desc">1个好友参加=1个抽奖码=中奖几率UP!</view> 59 <view class="share-desc">1个好友参加=1个抽奖码=中奖几率UP!</view>
56 </view> 60 </view>
57 -  
58 - <!-- <form bindsubmit='submitFormId' report-submit='true'>  
59 - <view class="foot">  
60 - <button class="foot-item info" plain="true" hover-class="none" form-type="submit" bindtap="goShare">去分享</button>  
61 - <button class="foot-item" plain="true" hover-class="none" form-type="submit" bindtap="cancelAlert">取消</button>  
62 - </view>  
63 - </form> -->  
64 -  
65 - <!-- <view class="foot-item info" bindtap="goShare">去分享</view>  
66 - <view class="foot-item" bindtap="cancelAlert">取消</view> -->  
67 </new-lucky-alert> 61 </new-lucky-alert>
68 62
69 <zero-alert wx:if="{{error}}"> 63 <zero-alert wx:if="{{error}}">
@@ -17,7 +17,7 @@ @@ -17,7 +17,7 @@
17 </block> 17 </block>
18 18
19 <block wx:elif="{{item.status === 5}}"> 19 <block wx:elif="{{item.status === 5}}">
20 - <view class="btn">人数不足 活动结束</view> 20 + <view class="btn">等待开奖中</view>
21 </block> 21 </block>
22 22
23 <block wx:else> 23 <block wx:else>
@@ -11,12 +11,16 @@ @@ -11,12 +11,16 @@
11 <view class="btn ok" catchtap="onClick">参加抽奖</view> 11 <view class="btn ok" catchtap="onClick">参加抽奖</view>
12 </block> 12 </block>
13 13
14 - <block wx:elif="{{product.status === 3 || product.status === 4}}"> 14 + <block wx:elif="{{product.status === 3}}">
  15 + <view class="btn cancel">等待开奖中</view>
  16 + </block>
  17 +
  18 + <block wx:elif="{{product.status === 4}}">
15 <view class="btn cancel">活动结束</view> 19 <view class="btn cancel">活动结束</view>
16 </block> 20 </block>
17 21
18 <block wx:elif="{{product.status === 5}}"> 22 <block wx:elif="{{product.status === 5}}">
19 - <view class="btn cancel">人数不足 活动结束</view> 23 + <view class="btn cancel">等待开奖中</view>
20 </block> 24 </block>
21 25
22 <block wx:else> 26 <block wx:else>
1 -// page/subPackage/pages/zeroSell/detail.js  
2 -  
3 import ZeroSellService from './service/zero-sell' 1 import ZeroSellService from './service/zero-sell'
4 import CommonService from './service/common' 2 import CommonService from './service/common'
5 import { 3 import {
@@ -31,18 +29,10 @@ const ACTIVITY = { @@ -31,18 +29,10 @@ const ACTIVITY = {
31 READY: 1, // 活动未开始 29 READY: 1, // 活动未开始
32 START: 2, // 活动开始 30 START: 2, // 活动开始
33 END: 3, // 活动结束 31 END: 3, // 活动结束
34 - LUCK: 4, // 抽奖结束 32 + LUCK: 4, // 活动已开奖、抽奖结束
35 END_LESS_PEOPLE: 5 // 人数不足 33 END_LESS_PEOPLE: 5 // 人数不足
36 } 34 }
37 35
38 -const STEP = {  
39 - ZERO: 0,  
40 - FIRST: 1,  
41 - SECOND: 2,  
42 - THIRD: 3,  
43 - FOURTH: 4,  
44 -}  
45 -  
46 const ACTION_BAR_STATUS = { 36 const ACTION_BAR_STATUS = {
47 UNKNOWN: 0, 37 UNKNOWN: 0,
48 READY: 1, // 未开始 38 READY: 1, // 未开始
@@ -51,6 +41,7 @@ const ACTION_BAR_STATUS = { @@ -51,6 +41,7 @@ const ACTION_BAR_STATUS = {
51 WAIT: 4, // 等待抽奖中 41 WAIT: 4, // 等待抽奖中
52 LUCK: 5, // 抽奖结束 42 LUCK: 5, // 抽奖结束
53 END: 6, // 活动结束 43 END: 6, // 活动结束
  44 + PEOPLE_LIMIT_WAIT: 7 // 人数达到活动限制、已满员、人数不足统一为待开奖状态
54 } 45 }
55 46
56 let app = getApp(); 47 let app = getApp();
@@ -66,12 +57,10 @@ Page(Object.assign({ @@ -66,12 +57,10 @@ Page(Object.assign({
66 actPrizeId: '', 57 actPrizeId: '',
67 shareUid: 0, 58 shareUid: 0,
68 scene: '', 59 scene: '',
69 - participantCount: 0,  
70 myPrizeCount: 0, 60 myPrizeCount: 0,
71 product: {}, 61 product: {},
72 avatars: [], 62 avatars: [],
73 recommends: [], 63 recommends: [],
74 - step: STEP.ZERO,  
75 actionStatus: ACTION_BAR_STATUS.UNKNOWN, 64 actionStatus: ACTION_BAR_STATUS.UNKNOWN,
76 snapData: {}, 65 snapData: {},
77 hasUnionID: false, 66 hasUnionID: false,
@@ -346,8 +335,6 @@ Page(Object.assign({ @@ -346,8 +335,6 @@ Page(Object.assign({
346 product_qrCode: qrcode 335 product_qrCode: qrcode
347 }; 336 };
348 337
349 - let participantCount = r1.code === 200 ? r1.data.joinNum : 0;  
350 -  
351 this.setData({ 338 this.setData({
352 product: product, 339 product: product,
353 recommends: r2.code === 200 ? r2.data : [], 340 recommends: r2.code === 200 ? r2.data : [],
@@ -358,14 +345,12 @@ Page(Object.assign({ @@ -358,14 +345,12 @@ Page(Object.assign({
358 }), 345 }),
359 346
360 myPrizeCount: r1.code === 200 ? r1.data.myCodeNum : 0, 347 myPrizeCount: r1.code === 200 ? r1.data.myCodeNum : 0,
361 - participantCount,  
362 snapData, 348 snapData,
363 notice: JSON.parse(product.notice || '{}'), 349 notice: JSON.parse(product.notice || '{}'),
364 lottery: JSON.parse(product.lottery_info || '{}') 350 lottery: JSON.parse(product.lottery_info || '{}')
365 }); 351 });
366 352
367 this._setActionStatus(); 353 this._setActionStatus();
368 - this._setStep();  
369 } else { 354 } else {
370 return Promise.reject(); 355 return Promise.reject();
371 } 356 }
@@ -383,58 +368,37 @@ Page(Object.assign({ @@ -383,58 +368,37 @@ Page(Object.assign({
383 }) 368 })
384 }) 369 })
385 }, 370 },
386 -  
387 - _setStep() {  
388 - let step = STEP.ZERO;  
389 - let activityStatus = this.data.product.status;  
390 - let myPrizeCount = this.data.myPrizeCount;  
391 -  
392 - if (myPrizeCount === 0) {  
393 - step = STEP.ZERO  
394 - } else {  
395 - if (activityStatus === ACTIVITY.START) {  
396 - let myPrizeCount = this.data.myPrizeCount;  
397 -  
398 - if (myPrizeCount === 0) {  
399 - step = STEP.ZERO;  
400 - } else if (myPrizeCount === 1) {  
401 - step = STEP.FIRST;  
402 - } else if (myPrizeCount >= 2) {  
403 - step = STEP.SECOND;  
404 - } else {  
405 - step = STEP.ZERO;  
406 - }  
407 - } else if (activityStatus === ACTIVITY.END || activityStatus === ACTIVITY.LUCK) {  
408 - step = STEP.THIRD;  
409 - } else if (activityStatus === ACTIVITY.END_LESS_PEOPLE) {  
410 - step = STEP.FOURTH;  
411 - } else {  
412 - step = STEP.ZERO;  
413 - }  
414 - }  
415 -  
416 - this.setData({  
417 - step: step  
418 - });  
419 - },  
420 _setActionStatus() { 371 _setActionStatus() {
421 let status = ACTION_BAR_STATUS.START; 372 let status = ACTION_BAR_STATUS.START;
422 let activityStatus = this.data.product.status; 373 let activityStatus = this.data.product.status;
423 374
  375 + console.log('hahahaha')
  376 + console.log(activityStatus);
  377 +
424 if (activityStatus === ACTIVITY.UNKNOWN) { 378 if (activityStatus === ACTIVITY.UNKNOWN) {
425 status = ACTION_BAR_STATUS.END; 379 status = ACTION_BAR_STATUS.END;
426 } else if (activityStatus === ACTIVITY.READY) { 380 } else if (activityStatus === ACTIVITY.READY) {
427 status = ACTION_BAR_STATUS.READY; 381 status = ACTION_BAR_STATUS.READY;
428 - } else if (activityStatus >= ACTIVITY.END) { 382 + }
  383 +
  384 + else if (activityStatus >= ACTIVITY.END) {
429 if (this._isInActivity()) { 385 if (this._isInActivity()) {
430 if (activityStatus === ACTIVITY.LUCK) { 386 if (activityStatus === ACTIVITY.LUCK) {
431 status = ACTION_BAR_STATUS.LUCK; 387 status = ACTION_BAR_STATUS.LUCK;
432 - } else { 388 + }
  389 + else if (activityStatus === ACTIVITY.END_LESS_PEOPLE || activityStatus === ACTIVITY.END) {
  390 + status = ACTION_BAR_STATUS.WAIT;
  391 + }
  392 + else {
433 status = ACTION_BAR_STATUS.WAIT; 393 status = ACTION_BAR_STATUS.WAIT;
434 } 394 }
435 } else { 395 } else {
  396 + if (activityStatus === ACTIVITY.END_LESS_PEOPLE || activityStatus === ACTIVITY.END) {
  397 + status = ACTION_BAR_STATUS.PEOPLE_LIMIT_WAIT;
  398 + } else {
436 status = ACTION_BAR_STATUS.END; 399 status = ACTION_BAR_STATUS.END;
437 } 400 }
  401 + }
438 } else { 402 } else {
439 if (this._isInActivity()) { 403 if (this._isInActivity()) {
440 status = ACTION_BAR_STATUS.ALEADY; 404 status = ACTION_BAR_STATUS.ALEADY;
@@ -586,7 +550,6 @@ Page(Object.assign({ @@ -586,7 +550,6 @@ Page(Object.assign({
586 var that = this; 550 var that = this;
587 if (e.detail.errMsg === 'getPhoneNumber:ok') { 551 if (e.detail.errMsg === 'getPhoneNumber:ok') {
588 decodePhoneNumber(e.detail.iv, e.detail.encryptedData, '', function (result) { 552 decodePhoneNumber(e.detail.iv, e.detail.encryptedData, '', function (result) {
589 - // console.log('!!!!result',result)  
590 if (result.code != 200) { 553 if (result.code != 200) {
591 that.wetoast.toast({ 554 that.wetoast.toast({
592 title: result.message, 555 title: result.message,
@@ -2,10 +2,6 @@ @@ -2,10 +2,6 @@
2 2
3 <product-header product="{{product}}" shareFlag="{{shareFlag}}" avatars="{{avatars}}"></product-header> 3 <product-header product="{{product}}" shareFlag="{{shareFlag}}" avatars="{{avatars}}"></product-header>
4 </view> 4 </view>
5 -<block wx:if="{{false}}">  
6 - <counter count="{{participantCount}}" num="{{product.limit}}" status="{{product.status}}"></counter>  
7 - <prize-progress step="{{step}}"></prize-progress>  
8 -</block>  
9 <view class="machine {{shareFlag ? 'machine-t-m' : 'machine-t-l'}}"> 5 <view class="machine {{shareFlag ? 'machine-t-m' : 'machine-t-l'}}">
10 <view class="open-shadow"></view> 6 <view class="open-shadow"></view>
11 <view class="code-list" animation="{{animation}}"> 7 <view class="code-list" animation="{{animation}}">