|
@@ -4,21 +4,27 @@ import android.content.Intent;
|
|
|
import android.widget.EditText;
|
|
import android.widget.EditText;
|
|
|
import android.widget.TextView;
|
|
import android.widget.TextView;
|
|
|
|
|
|
|
|
|
|
+import com.alibaba.fastjson.JSON;
|
|
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
import com.googlecode.protobuf.format.util.TextUtils;
|
|
import com.googlecode.protobuf.format.util.TextUtils;
|
|
|
import com.sheep.gamegroup.absBase.BaseActivity;
|
|
import com.sheep.gamegroup.absBase.BaseActivity;
|
|
|
import com.sheep.gamegroup.di.components.DaggerRealNameAutherComponent;
|
|
import com.sheep.gamegroup.di.components.DaggerRealNameAutherComponent;
|
|
|
import com.sheep.gamegroup.di.modules.RealNameAutherModule;
|
|
import com.sheep.gamegroup.di.modules.RealNameAutherModule;
|
|
|
import com.sheep.gamegroup.event.RealNameAutehrChange;
|
|
import com.sheep.gamegroup.event.RealNameAutehrChange;
|
|
|
|
|
+import com.sheep.gamegroup.model.entity.BaseMessage;
|
|
|
import com.sheep.gamegroup.model.entity.UserEntity;
|
|
import com.sheep.gamegroup.model.entity.UserEntity;
|
|
|
|
|
+import com.sheep.gamegroup.model.util.SheepSubscriber;
|
|
|
import com.sheep.gamegroup.presenter.RealNameAutherContract;
|
|
import com.sheep.gamegroup.presenter.RealNameAutherContract;
|
|
|
import com.sheep.gamegroup.presenter.RealNameAutherPresenter;
|
|
import com.sheep.gamegroup.presenter.RealNameAutherPresenter;
|
|
|
import com.sheep.gamegroup.util.Jump2View;
|
|
import com.sheep.gamegroup.util.Jump2View;
|
|
|
|
|
+import com.sheep.gamegroup.util.MyDbManager;
|
|
|
import com.sheep.gamegroup.util.StringUtils;
|
|
import com.sheep.gamegroup.util.StringUtils;
|
|
|
import com.sheep.gamegroup.util.UMConfigUtils;
|
|
import com.sheep.gamegroup.util.UMConfigUtils;
|
|
|
import com.sheep.gamegroup.view.dialog.DialogRealNameAuther;
|
|
import com.sheep.gamegroup.view.dialog.DialogRealNameAuther;
|
|
|
import com.sheep.jiuyan.samllsheep.R;
|
|
import com.sheep.jiuyan.samllsheep.R;
|
|
|
|
|
|
|
|
import com.sheep.jiuyan.samllsheep.SheepApp;
|
|
import com.sheep.jiuyan.samllsheep.SheepApp;
|
|
|
|
|
+import com.sheep.jiuyan.samllsheep.utils.G;
|
|
|
import com.sheep.jiuyan.samllsheep.utils.TitleBarUtils;
|
|
import com.sheep.jiuyan.samllsheep.utils.TitleBarUtils;
|
|
|
|
|
|
|
|
import org.greenrobot.eventbus.EventBus;
|
|
import org.greenrobot.eventbus.EventBus;
|
|
@@ -29,6 +35,8 @@ import javax.inject.Inject;
|
|
|
|
|
|
|
|
import butterknife.BindView;
|
|
import butterknife.BindView;
|
|
|
import butterknife.OnClick;
|
|
import butterknife.OnClick;
|
|
|
|
|
+import rx.android.schedulers.AndroidSchedulers;
|
|
|
|
|
+import rx.schedulers.Schedulers;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* Created by Administrator on 2018/3/26.
|
|
* Created by Administrator on 2018/3/26.
|
|
@@ -131,10 +139,34 @@ public class RealNameAuthenAct extends BaseActivity implements RealNameAutherCon
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
EventBus.getDefault().post(change);
|
|
EventBus.getDefault().post(change);
|
|
|
- if(whereFrom == 1){
|
|
|
|
|
- Jump2View.getInstance().goWithdrawal(RealNameAuthenAct.this, null);
|
|
|
|
|
- }
|
|
|
|
|
- finish();
|
|
|
|
|
|
|
+ SheepApp.get(RealNameAuthenAct.this)
|
|
|
|
|
+ .getNetComponent()
|
|
|
|
|
+ .getApiService()
|
|
|
|
|
+ .getInfo()
|
|
|
|
|
+ .subscribeOn(Schedulers.io())
|
|
|
|
|
+ .observeOn(AndroidSchedulers.mainThread())
|
|
|
|
|
+ .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.mContext) {
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void onError(BaseMessage baseMessage) {
|
|
|
|
|
+ G.showToast(baseMessage.getMsg() +"");
|
|
|
|
|
+ finish();
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void onNext(BaseMessage baseMessage) {
|
|
|
|
|
+ UserEntity userEntity = JSON.parseObject(JSONObject.toJSONString(baseMessage.getData()), UserEntity.class);
|
|
|
|
|
+ try {
|
|
|
|
|
+ MyDbManager.getInstance().saveOrUpdateUser(userEntity);
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
+ e.printStackTrace();
|
|
|
|
|
+ }
|
|
|
|
|
+ if(whereFrom == 1){
|
|
|
|
|
+ Jump2View.getInstance().goWithdrawal(RealNameAuthenAct.this, 1);
|
|
|
|
|
+ }
|
|
|
|
|
+ finish();
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|