|
@@ -19,6 +19,7 @@ import com.webrain.happywork.ui.mvp.presenter.DemandDetailPresenter;
|
|
|
import com.webrain.happywork.ui.widget.dialog.MineLightDialog;
|
|
import com.webrain.happywork.ui.widget.dialog.MineLightDialog;
|
|
|
import com.webrain.happywork.ui.widget.dialog.SureDialog;
|
|
import com.webrain.happywork.ui.widget.dialog.SureDialog;
|
|
|
|
|
|
|
|
|
|
+import org.greenrobot.eventbus.EventBus;
|
|
|
import org.greenrobot.eventbus.Subscribe;
|
|
import org.greenrobot.eventbus.Subscribe;
|
|
|
|
|
|
|
|
import butterknife.BindView;
|
|
import butterknife.BindView;
|
|
@@ -67,6 +68,7 @@ public class DemandDetailActivity extends BaseActivity<DemandDetailPresenter> im
|
|
|
@Override
|
|
@Override
|
|
|
protected void onCreate(Bundle savedInstanceState) {
|
|
protected void onCreate(Bundle savedInstanceState) {
|
|
|
super.onCreate(savedInstanceState);
|
|
super.onCreate(savedInstanceState);
|
|
|
|
|
+ EventBus.getDefault().register(this);
|
|
|
setTitle(R.string.demand_detail);
|
|
setTitle(R.string.demand_detail);
|
|
|
setLoadingVisible(true);
|
|
setLoadingVisible(true);
|
|
|
mvpPresenter.init();
|
|
mvpPresenter.init();
|
|
@@ -123,17 +125,22 @@ public class DemandDetailActivity extends BaseActivity<DemandDetailPresenter> im
|
|
|
} else {
|
|
} else {
|
|
|
tvDown.setVisibility(View.GONE);
|
|
tvDown.setVisibility(View.GONE);
|
|
|
}
|
|
}
|
|
|
- if (displayCancel) {
|
|
|
|
|
- btnApply.setEnabled(true);
|
|
|
|
|
- btnApply.setText(R.string.cancel_apply);
|
|
|
|
|
- } else {
|
|
|
|
|
- if (!isNeedEnrollment) {//是否可以报名
|
|
|
|
|
- btnApply.setEnabled(false);
|
|
|
|
|
- btnApply.setText(R.string.mine_has_apply);
|
|
|
|
|
- } else {
|
|
|
|
|
|
|
+ if (AppCacheManager.getInstance().isLogin()) {
|
|
|
|
|
+ if (displayCancel) {
|
|
|
btnApply.setEnabled(true);
|
|
btnApply.setEnabled(true);
|
|
|
- btnApply.setText(R.string.demand_need_apply);
|
|
|
|
|
|
|
+ btnApply.setText(R.string.cancel_apply);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ if (!isNeedEnrollment) {//是否可以报名
|
|
|
|
|
+ btnApply.setEnabled(false);
|
|
|
|
|
+ btnApply.setText(R.string.mine_has_apply);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ btnApply.setEnabled(true);
|
|
|
|
|
+ btnApply.setText(R.string.demand_need_apply);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
+ } else {//未登录全部按需要登录处理
|
|
|
|
|
+ btnApply.setEnabled(true);
|
|
|
|
|
+ btnApply.setText(R.string.demand_need_apply);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -198,6 +205,11 @@ public class DemandDetailActivity extends BaseActivity<DemandDetailPresenter> im
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
|
+ protected void onDestroy() {
|
|
|
|
|
+ super.onDestroy();
|
|
|
|
|
+ EventBus.getDefault().unregister(this);
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 错误页面刷新按钮
|
|
* 错误页面刷新按钮
|