|
|
@@ -12,19 +12,23 @@ import android.widget.TextView;
|
|
|
|
|
|
import com.kfzs.duanduan.event.BigEvent;
|
|
|
import com.kfzs.duanduan.event.EventTypes;
|
|
|
+import com.kfzs.duanduan.utils.NumberFormatUtils;
|
|
|
import com.sheep.gamegroup.absBase.BaseActivity;
|
|
|
import com.sheep.gamegroup.di.components.DaggerSignCardComponent;
|
|
|
import com.sheep.gamegroup.di.modules.SignCardModule;
|
|
|
import com.sheep.gamegroup.model.entity.BaseMessage;
|
|
|
import com.sheep.gamegroup.model.entity.DialogEntity;
|
|
|
import com.sheep.gamegroup.model.entity.PunchAndSign;
|
|
|
+import com.sheep.gamegroup.model.entity.UserEntity;
|
|
|
import com.sheep.gamegroup.presenter.SignCardContract;
|
|
|
import com.sheep.gamegroup.presenter.SignCardPresenter;
|
|
|
import com.sheep.gamegroup.util.Jump2View;
|
|
|
+import com.sheep.gamegroup.util.MyDbManager;
|
|
|
import com.sheep.gamegroup.util.UMConfigUtils;
|
|
|
import com.sheep.gamegroup.util.ViewUtil;
|
|
|
import com.sheep.jiuyan.samllsheep.R;
|
|
|
import com.sheep.jiuyan.samllsheep.SheepApp;
|
|
|
+import com.sheep.jiuyan.samllsheep.utils.G;
|
|
|
import com.sheep.jiuyan.samllsheep.utils.TitleBarUtils;
|
|
|
|
|
|
import org.greenrobot.eventbus.EventBus;
|
|
|
@@ -63,7 +67,6 @@ public class SignCardAct extends BaseActivity implements SignCardContract.View {
|
|
|
@BindView(R.id.sign_tv_kf)
|
|
|
TextView signTvKf;
|
|
|
|
|
|
- String balance;
|
|
|
private int punchType = 0;//打卡状态 //1未报名 2已打卡 3可以打卡 4已经过了时间 5活动暂未开始
|
|
|
|
|
|
|
|
|
@@ -75,7 +78,6 @@ public class SignCardAct extends BaseActivity implements SignCardContract.View {
|
|
|
@Override
|
|
|
public void initView() {
|
|
|
activity = this;
|
|
|
- balance = getIntent().getStringExtra("balance");
|
|
|
TitleBarUtils
|
|
|
.getInstance()
|
|
|
.setTitle(activity, "每日打卡")
|
|
|
@@ -237,8 +239,18 @@ public class SignCardAct extends BaseActivity implements SignCardContract.View {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ private UserEntity userEntity;
|
|
|
private void trySignUp() {
|
|
|
- if(Float.valueOf(balance) >= 1){
|
|
|
+ if(userEntity == null) {
|
|
|
+ try {
|
|
|
+ userEntity = MyDbManager.getInstance().dbFindUser();
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(userEntity == null || TextUtils.isEmpty(userEntity.getBalance())){
|
|
|
+ G.showToast(R.string.unknown_error);
|
|
|
+ } else if(NumberFormatUtils.parseFloat(userEntity.getBalance()) >= 1){
|
|
|
UMConfigUtils.Event.PUNCH_PUNCH.onEvent();
|
|
|
presenter.goSignUp();
|
|
|
}else {
|