|
|
@@ -17,7 +17,10 @@ import com.sheep.gamegroup.presenter.BindOrChangeWeixinContract;
|
|
|
import com.sheep.gamegroup.presenter.BindOrChangeWeixinPresenter;
|
|
|
import com.sheep.gamegroup.util.ActivityManager;
|
|
|
import com.sheep.gamegroup.util.CommonUtil;
|
|
|
+import com.sheep.gamegroup.util.Jump2View;
|
|
|
import com.sheep.gamegroup.util.MyDbManager;
|
|
|
+import com.sheep.gamegroup.util.TestUtil;
|
|
|
+import com.sheep.jiuyan.samllsheep.BuildConfig;
|
|
|
import com.sheep.jiuyan.samllsheep.R;
|
|
|
import com.sheep.jiuyan.samllsheep.SheepApp;
|
|
|
import com.sheep.gamegroup.absBase.BaseActivity;
|
|
|
@@ -26,6 +29,7 @@ import com.sheep.jiuyan.samllsheep.utils.SpUtils;
|
|
|
import com.sheep.jiuyan.samllsheep.utils.TitleBarUtils;
|
|
|
|
|
|
import org.greenrobot.eventbus.EventBus;
|
|
|
+import org.xutils.ex.DbException;
|
|
|
|
|
|
import javax.inject.Inject;
|
|
|
|
|
|
@@ -49,6 +53,7 @@ public class BindOrChangeWeixinAct extends BaseActivity implements BindOrChangeW
|
|
|
|
|
|
private String code;
|
|
|
private boolean isBindOrChange;
|
|
|
+ private int from;
|
|
|
private String isBindOrChangeStr;
|
|
|
|
|
|
|
|
|
@@ -61,6 +66,7 @@ public class BindOrChangeWeixinAct extends BaseActivity implements BindOrChangeW
|
|
|
public void initView() {
|
|
|
activity = this;
|
|
|
isBindOrChange = getIntent().getBooleanExtra("type", false);
|
|
|
+ from = getIntent().getIntExtra("from", ChangeWxOrTelAct.TYPE_NORMAL);
|
|
|
if(isBindOrChange){
|
|
|
isBindOrChangeStr = "更换微信号";
|
|
|
}else {
|
|
|
@@ -68,14 +74,20 @@ public class BindOrChangeWeixinAct extends BaseActivity implements BindOrChangeW
|
|
|
}
|
|
|
TitleBarUtils
|
|
|
.getInstance()
|
|
|
- .setTitle(activity, "绑定微信号")
|
|
|
+ .setTitle(activity, isBindOrChangeStr)
|
|
|
.setTitleFinish(activity);
|
|
|
DaggerBindOrChangeWeixinComponent.builder()
|
|
|
.netComponent(SheepApp.get(this).getNetComponent())
|
|
|
.bindOrChangeWeixinModule(new BindOrChangeWeixinModule(this))
|
|
|
.build()
|
|
|
.inject(this);
|
|
|
+ try {
|
|
|
+ mEntity = MyDbManager.getInstance().dbFindUser();
|
|
|
+ } catch (DbException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
}
|
|
|
+ private UserEntity mEntity;
|
|
|
|
|
|
@Override
|
|
|
public void initListener() {
|
|
|
@@ -93,6 +105,10 @@ public class BindOrChangeWeixinAct extends BaseActivity implements BindOrChangeW
|
|
|
case R.id.bindweixin_sure_text:
|
|
|
code = weinxinEtAccount.getText().toString();
|
|
|
if(TextUtils.isEmpty(code)){
|
|
|
+ if(TestUtil.isTestRecharge()){
|
|
|
+ updateView(null);
|
|
|
+ return;
|
|
|
+ }
|
|
|
G.showToast("请输入验证码");
|
|
|
return;
|
|
|
}
|
|
|
@@ -109,24 +125,18 @@ public class BindOrChangeWeixinAct extends BaseActivity implements BindOrChangeW
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public void updateView(Object o) {
|
|
|
+ public void updateView(Object object) {
|
|
|
hideProgress();
|
|
|
G.showToast("提交成功");
|
|
|
- try {
|
|
|
- UserEntity userEntity = MyDbManager.getInstance().dbFindUser();
|
|
|
- if(userEntity == null){
|
|
|
- userEntity.setWx_openid("succes");
|
|
|
- MyDbManager.getInstance().saveOrUpdateUser(userEntity);
|
|
|
- SpUtils.saveWeixin(activity, "succes");
|
|
|
-
|
|
|
- }
|
|
|
- } catch (Exception e) {
|
|
|
- e.printStackTrace();
|
|
|
- }
|
|
|
CommonUtil.getInstance()
|
|
|
.getUserInfo(SheepApp.mContext);
|
|
|
- ActivityManager.getInstance()
|
|
|
- .endActivity(ChangeWxOrTelAct.class);
|
|
|
+ if(from == ChangeWxOrTelAct.TYPE_RECHARGE){//来自充值功能,需要检查并跳转到绑定身份与银行卡信息界面
|
|
|
+ if(
|
|
|
+ TestUtil.isTestRecharge() ||
|
|
|
+ mEntity != null && mEntity.notCertification()){//没有实名认证
|
|
|
+ Jump2View.getInstance().goRealNameAuther(this, mEntity, 1);
|
|
|
+ }
|
|
|
+ }
|
|
|
finish();
|
|
|
EventBus.getDefault().post(new BigEvent().setEventTypes(EventTypes.ONFRESH_FGT_FAMLLSHEEP));
|
|
|
EventBus.getDefault().post(new BigEvent().setEventTypes(EventTypes.REFRESH_DATA_PHONE));
|