连续礼包优化
parent
257a5afaf8
commit
0cf8bb430b
|
@ -125,9 +125,9 @@ public class ContinuousGiftActivity extends AbstractActivity {
|
|||
result = 8;
|
||||
}else {
|
||||
// 未购买, 是否解锁
|
||||
if (days >= theme.getUnlockDay()){
|
||||
if (judgeDays(days,theme.getUnlockDay(),theme.getType())){
|
||||
// 已解锁, 可买天数
|
||||
if (days >= theme.getBuyDay()){
|
||||
if (judgeDays(days,theme.getBuyDay(),theme.getType())){
|
||||
// 可买, 是否购买前置礼包
|
||||
if (checkBuyAgo(user,theme.getId())){
|
||||
// 可买
|
||||
|
@ -142,9 +142,9 @@ public class ContinuousGiftActivity extends AbstractActivity {
|
|||
}
|
||||
}else {
|
||||
// 未解锁, 是否可见
|
||||
if (days >= theme.getVisibleDay()){
|
||||
if (judgeDays(days,theme.getVisibleDay(),theme.getType())){
|
||||
// 可见, 是否可预览
|
||||
result = days >= theme.getViewDay()?6:7;
|
||||
result = judgeDays(days,theme.getViewDay(),theme.getType())?6:7;
|
||||
}else {
|
||||
// 不可见
|
||||
result = 5;
|
||||
|
@ -156,6 +156,19 @@ public class ContinuousGiftActivity extends AbstractActivity {
|
|||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断天数
|
||||
* @param condition
|
||||
* @param value
|
||||
* @param type
|
||||
* @return
|
||||
*/
|
||||
private boolean judgeDays(int value,int condition,int type){
|
||||
if (type == 2){
|
||||
return value == condition;
|
||||
}
|
||||
return value >= condition;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CommonProto.ActivityInfo.MissionInfo> getAllMissInfo(User user,ActivityMission activityMission, Set<Integer> filter) {
|
||||
|
|
Loading…
Reference in New Issue