Bläddra i källkod

默认值 祛除

xiongxiaohe 8 år sedan
förälder
incheckning
9900c9b757
19 ändrade filer med 898 tillägg och 74 borttagningar
  1. 0 2
      app/build.gradle
  2. 16 0
      app/src/main/java/com/sheep/gamegroup/di/components/AccountAndSercuritComponent.java
  3. 16 0
      app/src/main/java/com/sheep/gamegroup/di/components/ReNameComponent.java
  4. 22 0
      app/src/main/java/com/sheep/gamegroup/di/modules/AccountAndSercuritModule.java
  5. 22 0
      app/src/main/java/com/sheep/gamegroup/di/modules/ReNameModule.java
  6. 6 0
      app/src/main/java/com/sheep/gamegroup/model/api/ApiService.java
  7. 303 0
      app/src/main/java/com/sheep/gamegroup/model/entity/UserInfoEntity.java
  8. 22 0
      app/src/main/java/com/sheep/gamegroup/presenter/AccountAndSecuritContract.java
  9. 65 0
      app/src/main/java/com/sheep/gamegroup/presenter/AccountAndSecuritPresenter.java
  10. 20 0
      app/src/main/java/com/sheep/gamegroup/presenter/ReNameContract.java
  11. 68 0
      app/src/main/java/com/sheep/gamegroup/presenter/ReNamePresenter.java
  12. 2 2
      app/src/main/java/com/sheep/gamegroup/util/ConnectAddress.java
  13. 94 40
      app/src/main/java/com/sheep/gamegroup/view/activity/AccountAndSecurityAct.java
  14. 103 1
      app/src/main/java/com/sheep/gamegroup/view/activity/PersionInfoAct.java
  15. 8 17
      app/src/main/java/com/sheep/gamegroup/view/activity/PersonalCenterAct.java
  16. 91 0
      app/src/main/java/com/sheep/gamegroup/view/activity/ReNameActivity.java
  17. 1 0
      app/src/main/res/layout/x_account_security_layout.xml
  18. 35 0
      app/src/main/res/layout/x_rename_act_layout.xml
  19. 4 12
      app/src/main/res/layout/xpersion_info_act_layout.xml

+ 0 - 2
app/build.gradle

@@ -1,7 +1,5 @@
 apply plugin: 'com.android.application'
 apply plugin: 'com.jakewharton.butterknife'
-
-
 android {
     compileSdkVersion 27
     buildToolsVersion '27.0.2'

+ 16 - 0
app/src/main/java/com/sheep/gamegroup/di/components/AccountAndSercuritComponent.java

@@ -0,0 +1,16 @@
+package com.sheep.gamegroup.di.components;
+
+import com.sheep.gamegroup.di.modules.AccountAndSercuritModule;
+import com.sheep.gamegroup.di.scopes.UserScope;
+import com.sheep.gamegroup.view.activity.AccountAndSecurityAct;
+
+import dagger.Component;
+
+/**
+ * Created by ljy on 2018/3/15.
+ */
+@UserScope
+@Component(modules = AccountAndSercuritModule.class, dependencies = NetComponent.class)
+public interface AccountAndSercuritComponent {
+    void inject(AccountAndSecurityAct phoneAct);
+}

+ 16 - 0
app/src/main/java/com/sheep/gamegroup/di/components/ReNameComponent.java

@@ -0,0 +1,16 @@
+package com.sheep.gamegroup.di.components;
+
+import com.sheep.gamegroup.di.modules.ReNameModule;
+import com.sheep.gamegroup.di.scopes.UserScope;
+import com.sheep.gamegroup.view.activity.ReNameActivity;
+
+import dagger.Component;
+
+/**
+ * Created by ljy on 2018/3/15.
+ */
+@UserScope
+@Component(modules = ReNameModule.class, dependencies = NetComponent.class)
+public interface ReNameComponent {
+    void inject(ReNameActivity phoneAct);
+}

+ 22 - 0
app/src/main/java/com/sheep/gamegroup/di/modules/AccountAndSercuritModule.java

@@ -0,0 +1,22 @@
+package com.sheep.gamegroup.di.modules;
+
+import com.sheep.gamegroup.presenter.AccountAndSecuritContract;
+
+import dagger.Module;
+import dagger.Provides;
+
+/**
+ * Created by Administrator on 2018/3/10.
+ */
+@Module
+public class AccountAndSercuritModule {
+    private AccountAndSecuritContract.View view;
+
+    public AccountAndSercuritModule(AccountAndSecuritContract.View view) {
+        this.view = view;
+    }
+    @Provides
+    public AccountAndSecuritContract.View provideView(){
+        return view;
+    }
+}

+ 22 - 0
app/src/main/java/com/sheep/gamegroup/di/modules/ReNameModule.java

@@ -0,0 +1,22 @@
+package com.sheep.gamegroup.di.modules;
+
+import com.sheep.gamegroup.presenter.ReNameContract;
+
+import dagger.Module;
+import dagger.Provides;
+
+/**
+ * Created by Administrator on 2018/3/10.
+ */
+@Module
+public class ReNameModule {
+    private ReNameContract.View view;
+
+    public ReNameModule(ReNameContract.View view) {
+        this.view = view;
+    }
+    @Provides
+    public ReNameContract.View provideView(){
+        return view;
+    }
+}

+ 6 - 0
app/src/main/java/com/sheep/gamegroup/model/api/ApiService.java

@@ -179,4 +179,10 @@ public interface ApiService {
     @GET(V1 + "/app/task_log/node/{id}")
     Observable<BaseMessage> giveTaskStatue(@Path("id") int id);
 
+
+
+    @PUT(V1+"/app/user/change_base_info")
+    Observable<BaseMessage> changeBaseInfo (@Body com.alibaba.fastjson.JSONObject jsonObject);
+
+
 }

+ 303 - 0
app/src/main/java/com/sheep/gamegroup/model/entity/UserInfoEntity.java

@@ -0,0 +1,303 @@
+package com.sheep.gamegroup.model.entity;
+
+import android.os.Parcel;
+import android.os.Parcelable;
+
+/**
+ * Created by Administrator on 2018/3/24.
+ */
+
+public class UserInfoEntity implements Parcelable{
+
+    private  String   access_token;
+
+    /**
+     * 头像
+     */
+    private  String avatar;
+    private  double   balance;
+    /**
+     *     银行卡号
+     */
+    private   String  bank_card;
+
+    private  int  create_time;
+
+    private  String  id;
+
+    /**
+     * 身份证号码
+     */
+    private  String  id_number;
+
+    /**
+     * 邀请码
+     */
+    private  String   invitation_code;
+
+    private  int  last_login_time;
+
+
+    private String    mobile;
+
+    /**
+     *     昵称
+     */
+    private  String nickname;
+
+    /**
+     * 用户唯一标识
+     */
+  private  String  open_id;
+    /**
+     *     父邀请码
+     */
+    private  String  parent_code;
+
+    /**
+     * 真实姓名
+     */
+    private  String  real_name;
+
+
+    private  String  refresh_token;
+
+
+    private  String  share_link;
+
+
+    private  double   total_asset;
+
+    private  double   total_withdraw;
+
+
+    private  int update_time;
+
+
+    private  String wx_openid;
+
+
+    protected UserInfoEntity(Parcel in) {
+        access_token = in.readString();
+        avatar = in.readString();
+        balance = in.readDouble();
+        bank_card = in.readString();
+        create_time = in.readInt();
+        id = in.readString();
+        id_number = in.readString();
+        invitation_code = in.readString();
+        last_login_time = in.readInt();
+        mobile = in.readString();
+        nickname = in.readString();
+        open_id = in.readString();
+        parent_code = in.readString();
+        real_name = in.readString();
+        refresh_token = in.readString();
+        share_link = in.readString();
+        total_asset = in.readDouble();
+        total_withdraw = in.readDouble();
+        update_time = in.readInt();
+        wx_openid = in.readString();
+    }
+
+    @Override
+    public void writeToParcel(Parcel dest, int flags) {
+        dest.writeString(access_token);
+        dest.writeString(avatar);
+        dest.writeDouble(balance);
+        dest.writeString(bank_card);
+        dest.writeInt(create_time);
+        dest.writeString(id);
+        dest.writeString(id_number);
+        dest.writeString(invitation_code);
+        dest.writeInt(last_login_time);
+        dest.writeString(mobile);
+        dest.writeString(nickname);
+        dest.writeString(open_id);
+        dest.writeString(parent_code);
+        dest.writeString(real_name);
+        dest.writeString(refresh_token);
+        dest.writeString(share_link);
+        dest.writeDouble(total_asset);
+        dest.writeDouble(total_withdraw);
+        dest.writeInt(update_time);
+        dest.writeString(wx_openid);
+    }
+
+    @Override
+    public int describeContents() {
+        return 0;
+    }
+
+    public static final Creator<UserInfoEntity> CREATOR = new Creator<UserInfoEntity>() {
+        @Override
+        public UserInfoEntity createFromParcel(Parcel in) {
+            return new UserInfoEntity(in);
+        }
+
+        @Override
+        public UserInfoEntity[] newArray(int size) {
+            return new UserInfoEntity[size];
+        }
+    };
+
+    public String getAccess_token() {
+        return access_token;
+    }
+
+    public void setAccess_token(String access_token) {
+        this.access_token = access_token;
+    }
+
+    public String getAvatar() {
+        return avatar;
+    }
+
+    public void setAvatar(String avatar) {
+        this.avatar = avatar;
+    }
+
+    public double getBalance() {
+        return balance;
+    }
+
+    public void setBalance(double balance) {
+        this.balance = balance;
+    }
+
+    public String getBank_card() {
+        return bank_card;
+    }
+
+    public void setBank_card(String bank_card) {
+        this.bank_card = bank_card;
+    }
+
+    public int getCreate_time() {
+        return create_time;
+    }
+
+    public void setCreate_time(int create_time) {
+        this.create_time = create_time;
+    }
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public String getId_number() {
+        return id_number;
+    }
+
+    public void setId_number(String id_number) {
+        this.id_number = id_number;
+    }
+
+    public String getInvitation_code() {
+        return invitation_code;
+    }
+
+    public void setInvitation_code(String invitation_code) {
+        this.invitation_code = invitation_code;
+    }
+
+    public int getLast_login_time() {
+        return last_login_time;
+    }
+
+    public void setLast_login_time(int last_login_time) {
+        this.last_login_time = last_login_time;
+    }
+
+    public String getMobile() {
+        return mobile;
+    }
+
+    public void setMobile(String mobile) {
+        this.mobile = mobile;
+    }
+
+    public String getNickname() {
+        return nickname;
+    }
+
+    public void setNickname(String nickname) {
+        this.nickname = nickname;
+    }
+
+    public String getOpen_id() {
+        return open_id;
+    }
+
+    public void setOpen_id(String open_id) {
+        this.open_id = open_id;
+    }
+
+    public String getParent_code() {
+        return parent_code;
+    }
+
+    public void setParent_code(String parent_code) {
+        this.parent_code = parent_code;
+    }
+
+    public String getReal_name() {
+        return real_name;
+    }
+
+    public void setReal_name(String real_name) {
+        this.real_name = real_name;
+    }
+
+    public String getRefresh_token() {
+        return refresh_token;
+    }
+
+    public void setRefresh_token(String refresh_token) {
+        this.refresh_token = refresh_token;
+    }
+
+    public String getShare_link() {
+        return share_link;
+    }
+
+    public void setShare_link(String share_link) {
+        this.share_link = share_link;
+    }
+
+    public double getTotal_asset() {
+        return total_asset;
+    }
+
+    public void setTotal_asset(double total_asset) {
+        this.total_asset = total_asset;
+    }
+
+    public double getTotal_withdraw() {
+        return total_withdraw;
+    }
+
+    public void setTotal_withdraw(double total_withdraw) {
+        this.total_withdraw = total_withdraw;
+    }
+
+    public int getUpdate_time() {
+        return update_time;
+    }
+
+    public void setUpdate_time(int update_time) {
+        this.update_time = update_time;
+    }
+
+    public String getWx_openid() {
+        return wx_openid;
+    }
+
+    public void setWx_openid(String wx_openid) {
+        this.wx_openid = wx_openid;
+    }
+}

+ 22 - 0
app/src/main/java/com/sheep/gamegroup/presenter/AccountAndSecuritContract.java

@@ -0,0 +1,22 @@
+package com.sheep.gamegroup.presenter;
+
+import com.sheep.gamegroup.IBase.IBasePresenter;
+import com.sheep.gamegroup.IBase.IBaseView;
+import com.sheep.gamegroup.model.entity.UserInfoEntity;
+
+/**
+ * Created by Administrator on 2018/3/10.
+ */
+
+public interface AccountAndSecuritContract {
+
+    interface Presenter extends IBasePresenter {
+
+    }
+
+    interface View extends IBaseView {
+       void   showTask(UserInfoEntity entity);
+
+
+    }
+}

+ 65 - 0
app/src/main/java/com/sheep/gamegroup/presenter/AccountAndSecuritPresenter.java

@@ -0,0 +1,65 @@
+package com.sheep.gamegroup.presenter;
+
+import com.alibaba.fastjson.JSONObject;
+import com.sheep.gamegroup.model.api.ApiService;
+import com.sheep.gamegroup.model.entity.BaseMessage;
+import com.sheep.gamegroup.model.entity.UserInfoEntity;
+import com.sheep.gamegroup.util.FastJsonUtils;
+
+import java.util.HashMap;
+
+import javax.inject.Inject;
+
+import rx.Observer;
+import rx.schedulers.Schedulers;
+
+/**
+ * Created by Administrator on 2018/3/10.
+ */
+
+public class AccountAndSecuritPresenter implements  AccountAndSecuritContract.Presenter  {
+
+    private AccountAndSecuritContract.View view;
+    private ApiService apiService;
+
+    @Inject
+    public AccountAndSecuritPresenter(AccountAndSecuritContract.View view, ApiService apiService) {
+        this.view = view;
+        this.apiService = apiService;
+    }
+
+
+    @Override
+    public void getTask(HashMap<String, Object> map) {
+
+
+        apiService.getInfo().subscribeOn(Schedulers.io())
+                .subscribe(new Observer<BaseMessage>() {
+                    @Override
+                    public void onCompleted() {
+
+                    }
+
+                    @Override
+                    public void onError(Throwable throwable) {
+                        view.NetError(-1,"请求网络异常");
+                    }
+
+                    @Override
+                    public void onNext(BaseMessage baseMessage) {
+
+                        if(baseMessage!=null){
+
+
+                            UserInfoEntity loginEty = FastJsonUtils.toBean( JSONObject.toJSONString(baseMessage.getData()),UserInfoEntity.class);
+                            view.showTask(loginEty);
+
+                        }
+
+
+
+                    }
+                });
+
+    }
+}

+ 20 - 0
app/src/main/java/com/sheep/gamegroup/presenter/ReNameContract.java

@@ -0,0 +1,20 @@
+package com.sheep.gamegroup.presenter;
+
+import com.sheep.gamegroup.IBase.IBasePresenter;
+import com.sheep.gamegroup.IBase.IBaseView;
+
+/**
+ * Created by Administrator on 2018/3/10.
+ */
+
+public interface ReNameContract {
+
+    interface Presenter extends IBasePresenter {
+
+    }
+
+    interface View extends IBaseView {
+       void   showTask();
+
+    }
+}

+ 68 - 0
app/src/main/java/com/sheep/gamegroup/presenter/ReNamePresenter.java

@@ -0,0 +1,68 @@
+package com.sheep.gamegroup.presenter;
+
+import android.util.Log;
+
+import com.alibaba.fastjson.JSONObject;
+import com.sheep.gamegroup.exception.ExceptionEngine;
+import com.sheep.gamegroup.model.api.ApiService;
+import com.sheep.gamegroup.model.entity.BaseMessage;
+
+import java.util.HashMap;
+
+import javax.inject.Inject;
+
+import rx.Observer;
+import rx.schedulers.Schedulers;
+
+/**
+ * Created by Administrator on 2018/3/10.
+ */
+
+public class ReNamePresenter implements  ReNameContract.Presenter  {
+
+    private ReNameContract.View view;
+    private ApiService apiService;
+
+    @Inject
+    public ReNamePresenter(ReNameContract.View view, ApiService apiService) {
+        this.view = view;
+        this.apiService = apiService;
+    }
+
+    @Override
+    public void getTask(HashMap<String, Object> map) {
+        JSONObject j = new JSONObject();
+        j.put("nickname",map.get("nickname"));
+
+
+
+        apiService.changeBaseInfo(j)
+                .subscribeOn(Schedulers.io())
+                .subscribe(new Observer<BaseMessage>() {
+                    @Override
+                    public void onCompleted() {
+                        Log.e("onCompleted--------","onCompleted");
+                    }
+
+                    @Override
+                    public void onError(Throwable throwable) {
+                        Log.e("onError--------","onError:"+throwable);
+                        view.NetError(-1, ExceptionEngine.handleException(throwable).getMessage());
+                    }
+
+                    @Override
+                    public void onNext(BaseMessage baseMessage) {
+
+                        if(baseMessage!=null){
+                          view.NetSuccess(1,"修改昵称成功");
+                        }else{
+                            view.NetError(-1,"数据解析出错");
+                        }
+                    }
+                });
+
+
+
+
+    }
+}

+ 2 - 2
app/src/main/java/com/sheep/gamegroup/util/ConnectAddress.java

@@ -6,9 +6,9 @@ package com.sheep.gamegroup.util;
 
 public class ConnectAddress {
 
-   public static final String BASE_HTTP = "http://10.8.220.6:8080/";//何威
+  public static final String BASE_HTTP = "http://10.8.220.6:8080/";//何威
 //     public static final String BASE_HTTP = "http://10.8.220.5:8080/";//张伟
-//    public static final String BASE_HTTP = "http://test.sheep.kfzs.com/";//测试服地址
+//   public static final String BASE_HTTP = "http://test.sheep.kfzs.com/";//测试服地址
 
     public static final String V1 = "/v1/";
 

+ 94 - 40
app/src/main/java/com/sheep/gamegroup/view/activity/AccountAndSecurityAct.java

@@ -1,73 +1,61 @@
 package com.sheep.gamegroup.view.activity;
 
-import android.os.Bundle;
-import android.widget.Button;
-import android.widget.ImageButton;
+import android.content.Intent;
+import android.text.TextUtils;
+import android.view.View;
 import android.widget.ImageView;
-import android.widget.LinearLayout;
 import android.widget.RelativeLayout;
 import android.widget.TextView;
 
+
+import com.sheep.gamegroup.absBase.BaseActivity;
+
+import com.sheep.gamegroup.di.components.DaggerAccountAndSercuritComponent;
+import com.sheep.gamegroup.di.modules.AccountAndSercuritModule;
+import com.sheep.gamegroup.model.entity.UserInfoEntity;
+import com.sheep.gamegroup.presenter.AccountAndSecuritContract;
+import com.sheep.gamegroup.presenter.AccountAndSecuritPresenter;
 import com.sheep.jiuyan.samllsheep.R;
-import com.sheep.jiuyan.samllsheep.base.BaseActivity;
+import com.sheep.jiuyan.samllsheep.SheepApp;
 import com.sheep.jiuyan.samllsheep.utils.TitleBarUtils;
 
+import javax.inject.Inject;
+
 import butterknife.BindView;
-import butterknife.ButterKnife;
+import butterknife.OnClick;
 
 /**
  * Created by Administrator on 2018/3/16.
  */
 
-public class AccountAndSecurityAct extends BaseActivity {
-
-
-    @BindView(R.id.img_baseactivity_title)
-    ImageView imgBaseactivityTitle;
-    @BindView(R.id.txt_baseactivity_title)
-    TextView txtBaseactivityTitle;
-    @BindView(R.id.btn_baseactivity_right)
-    Button btnBaseactivityRight;
-    @BindView(R.id.ibtn_baseactivity_right)
-    ImageButton ibtnBaseactivityRight;
-    @BindView(R.id.tv_guide)
-    TextView tvGuide;
-    @BindView(R.id.tv_linearLayout_baseactivity_right)
-    TextView tvLinearLayoutBaseactivityRight;
-    @BindView(R.id.iv_linearLayout_baseactivity_right)
-    ImageView ivLinearLayoutBaseactivityRight;
-    @BindView(R.id.linearLayout_baseactivity_right)
-    LinearLayout linearLayoutBaseactivityRight;
-    @BindView(R.id.layout_navigationBar)
-    RelativeLayout layoutNavigationBar;
+public class AccountAndSecurityAct extends BaseActivity implements AccountAndSecuritContract.View {
+
+
     @BindView(R.id.iv_head)
     ImageView ivHead;
     @BindView(R.id.tv_name)
     TextView tvName;
     @BindView(R.id.tv_link_content)
     TextView tvLinkContent;
-    @BindView(R.id.tv_more)
-    TextView tvMore;
-    @BindView(R.id.iv_head_right)
-    ImageView ivHeadRight;
-    @BindView(R.id.iv_phone)
-    ImageView ivPhone;
     @BindView(R.id.tv_phone)
     TextView tvPhone;
     @BindView(R.id.rl_phone)
     RelativeLayout rlPhone;
-    @BindView(R.id.iv_wx)
-    ImageView ivWx;
     @BindView(R.id.tv_wx)
     TextView tvWx;
     @BindView(R.id.rl_wx)
     RelativeLayout rlWx;
-    @BindView(R.id.iv_auther)
-    ImageView ivAuther;
     @BindView(R.id.tv_auther)
     TextView tvAuther;
     @BindView(R.id.rl_auther)
     RelativeLayout rlAuther;
+    @BindView(R.id.rl_top)
+    RelativeLayout rlTop;
+
+    @Inject
+    AccountAndSecuritPresenter   presenter;
+    UserInfoEntity   mEntity;
+
 
     @Override
     protected int getLayoutId() {
@@ -76,10 +64,15 @@ public class AccountAndSecurityAct extends BaseActivity {
 
     @Override
     public void initView() {
-        TitleBarUtils.getInstance()
-                .setTitle(this, "账号与安全 ")
-                .setTitleFinish(this);
 
+        DaggerAccountAndSercuritComponent.builder()
+                .netComponent(SheepApp.get(this).getNetComponent())
+                .accountAndSercuritModule(new AccountAndSercuritModule(this))
+                .build().inject(this);
+        TitleBarUtils
+                .getInstance()
+                .setTitle(this, "账号与安全")
+                .setTitleFinish(this);
 
     }
 
@@ -91,12 +84,73 @@ public class AccountAndSecurityAct extends BaseActivity {
     @Override
     public void initData() {
 
+        presenter.getTask(null);
+
     }
 
 
 
+    @OnClick({R.id.rl_phone, R.id.rl_wx, R.id.rl_auther, R.id.rl_top})
+    public void onClick(View view) {
+        switch (view.getId()) {
+            case R.id.rl_phone:   //跳转到绑定手机号
+                break;
+            case R.id.rl_wx:  ////跳转到微信
+                break;
+            case R.id.rl_auther: ////跳转授权
+                break;
+
+            case  R.id.rl_top:
+                Intent i=new  Intent(AccountAndSecurityAct.this,PersionInfoAct.class);
+                i.putExtra("info",mEntity);
+                startActivity(i);
+                break;
+        }
+    }
+
+    @Override
+    public void NetSuccess(int code, String msg) {
 
+    }
 
+    @Override
+    public void NetError(int code, String errorMsg) {
 
 
+
+
+    }
+
+
+    @Override
+    public void showTask(UserInfoEntity entity) {
+
+        this.runOnUiThread(new Runnable() {
+            @Override
+            public void run() {
+                mEntity=entity;
+                tvName.setText(entity.getNickname());
+                tvLinkContent.setText("绵羊号:"+entity.getInvitation_code());
+                tvPhone.setText(entity.getMobile());
+                tvWx.setText(entity.getWx_openid());
+                boolean  isBanck=TextUtils.isEmpty(entity.getBank_card());
+                boolean  isId_number=TextUtils.isEmpty(entity.getId_number());
+                boolean  isRoalName=TextUtils.isEmpty(entity.getReal_name());
+
+                if(isBanck&&isId_number&&isRoalName){
+
+                    tvAuther.setText("未认证");
+                }else if(!isBanck&&!isId_number&&!isRoalName){
+                    tvAuther.setText("已认证");
+                }else{
+                    tvAuther.setText("认证中");
+                }
+            }
+        });
+
+
+
+
+
+    }
 }

+ 103 - 1
app/src/main/java/com/sheep/gamegroup/view/activity/PersionInfoAct.java

@@ -1,7 +1,23 @@
 package com.sheep.gamegroup.view.activity;
 
+import android.app.AlertDialog;
+import android.content.Intent;
+import android.graphics.Bitmap;
+import android.view.View;
+import android.widget.ImageView;
+import android.widget.RelativeLayout;
+import android.widget.TextView;
+
+import com.sheep.gamegroup.absBase.BaseActivity;
+import com.sheep.gamegroup.model.entity.UserInfoEntity;
+
 import com.sheep.jiuyan.samllsheep.R;
-import com.sheep.jiuyan.samllsheep.base.BaseActivity;
+import com.sheep.jiuyan.samllsheep.utils.G;
+import com.uuzuche.lib_zxing.activity.CodeUtils;
+
+import butterknife.BindView;
+import butterknife.OnClick;
+
 
 /**
  * Created by Administrator on 2018/3/16.
@@ -9,6 +25,20 @@ import com.sheep.jiuyan.samllsheep.base.BaseActivity;
 
 public class PersionInfoAct extends BaseActivity {
 
+    UserInfoEntity mEntity;
+    @BindView(R.id.tv_name)
+    TextView tvName;
+    @BindView(R.id.tv_nike)
+    TextView tvNike;
+    @BindView(R.id.tv_sheep_id)
+    TextView tvSheepId;
+    @BindView(R.id.tv_qr)
+    ImageView tvQr;
+    @BindView(R.id.rl_qr)
+    RelativeLayout rlQr;
+    @BindView(R.id.iv_head_right)
+    ImageView ivHeadRight;
+
     @Override
     protected int getLayoutId() {
         return R.layout.xpersion_info_act_layout;
@@ -26,6 +56,78 @@ public class PersionInfoAct extends BaseActivity {
 
     @Override
     public void initData() {
+        Intent i = getIntent();
+        if (i != null && i.hasExtra("info")) {
+            mEntity = i.getParcelableExtra("info");
+            if(mEntity!=null) {
+                tvNike.setText(mEntity.getNickname());
+                tvSheepId.setText(mEntity.getInvitation_code());
+                Bitmap mBitmap = CodeUtils.createImage(mEntity.getShare_link(), 30, 30, null);
+                tvQr.setImageBitmap(mBitmap);
+            }
+        }
+
+    }
+
+    private void showQR() {
+
+        AlertDialog.Builder builder = new AlertDialog.Builder(this);
+        View view = View.inflate(this, R.layout.x_ask_qr_dialog, null);
+        builder.setView(view);
+        final AlertDialog dialog = builder.create();
+        ImageView iv = view.findViewById(R.id.iv_close);
+        ImageView iv_qr = view.findViewById(R.id.iv_qr);
+        Bitmap mBitmap = CodeUtils.createImage(mEntity.getShare_link(), G.WIDTH - 40, G.HEIGHT / 2, null);
+        iv_qr.setImageBitmap(mBitmap);
+        dialog.show();
+        iv.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                dialog.dismiss();
+            }
+        });
+
+
+    }
+
+
+    private void showHead() {
+
+        AlertDialog.Builder builder = new AlertDialog.Builder(this);
+        View view = View.inflate(this, R.layout.x_ask_qr_dialog, null);
+        builder.setView(view);
+        final AlertDialog dialog = builder.create();
+        ImageView iv = view.findViewById(R.id.iv_close);
+        ImageView iv_qr = view.findViewById(R.id.iv_qr);
+        Bitmap mBitmap = CodeUtils.createImage(mEntity.getShare_link(), G.WIDTH - 40, G.HEIGHT / 2, null);
+        iv_qr.setImageBitmap(mBitmap);
+        dialog.show();
+        iv.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                dialog.dismiss();
+            }
+        });
+
+
+    }
+
+
 
+    @OnClick({R.id.iv_head_right, R.id.tv_nike, R.id.rl_qr})
+    public void onClick(View view) {
+        switch (view.getId()) {
+            case R.id.iv_head_right:
+                showHead();
+                break;
+            case R.id.tv_nike:
+                Intent i=new Intent(PersionInfoAct.this,ReNameActivity.class);
+                i.putExtra("name",mEntity.getNickname());
+                startActivity(i);
+                break;
+            case R.id.rl_qr:
+                showQR();
+                break;
+        }
     }
 }

+ 8 - 17
app/src/main/java/com/sheep/gamegroup/view/activity/PersonalCenterAct.java

@@ -1,18 +1,17 @@
 package com.sheep.gamegroup.view.activity;
 
 import android.app.Activity;
-import android.os.Bundle;
+import android.content.Intent;
 import android.os.Handler;
 import android.os.Message;
-import android.preference.PreferenceActivity;
 import android.util.Log;
 import android.view.View;
 import android.widget.RelativeLayout;
 import android.widget.TextView;
-import android.widget.Toast;
 
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
+import com.sheep.gamegroup.absBase.BaseActivity;
 import com.sheep.gamegroup.di.components.DaggerPersonalCenterComponent;
 import com.sheep.gamegroup.di.modules.PersonalCenterModule;
 import com.sheep.gamegroup.model.entity.BaseMessage;
@@ -23,11 +22,6 @@ import com.sheep.gamegroup.util.Jump2View;
 import com.sheep.gamegroup.util.MyDbManager;
 import com.sheep.jiuyan.samllsheep.R;
 import com.sheep.jiuyan.samllsheep.SheepApp;
-import com.sheep.jiuyan.samllsheep.base.BaseActivity;
-import com.sheep.jiuyan.samllsheep.utils.G;
-import com.sheep.jiuyan.samllsheep.utils.TitleBarUtils;
-
-import org.xutils.ex.DbException;
 
 import javax.inject.Inject;
 
@@ -84,9 +78,7 @@ public class PersonalCenterAct extends BaseActivity implements PersonalCenterCon
                 .personalCenterModule(new PersonalCenterModule(this))
                 .build()
                 .inject(this);
-        TitleBarUtils.getInstance()
-                .setTitle(this, "个人中心")
-                .setTitleFinish(this);
+
     }
 
     @Override
@@ -110,13 +102,12 @@ public class PersonalCenterAct extends BaseActivity implements PersonalCenterCon
                 Jump2View.getInstance().goWithdrawal(activity, null);
                 break;
             case R.id.account_safe_layout:
-                Jump2View.getInstance().goAccountAndSecurit(activity, null);
+                Intent i=new  Intent(PersonalCenterAct.this,AccountAndSecurityAct.class);
+                startActivity(i);
                 break;
-            case R.id.account_task_layout://任务记录
-                Jump2View.getInstance().goTaskList2View(activity, null);
+            case R.id.account_task_layout:
                 break;
-            case R.id.account_detail_layout://提现明细
-                Jump2View.getInstance().goWithdrawallistView(activity, null);
+            case R.id.account_detail_layout:
                 break;
         }
     }
@@ -142,6 +133,6 @@ public class PersonalCenterAct extends BaseActivity implements PersonalCenterCon
 
     @Override
     public void failData2View(Object o) {
-        G.showToast("网络错误");
+        showToast("网络错误");
     }
 }

+ 91 - 0
app/src/main/java/com/sheep/gamegroup/view/activity/ReNameActivity.java

@@ -0,0 +1,91 @@
+package com.sheep.gamegroup.view.activity;
+
+import android.content.Intent;
+import android.widget.Button;
+import android.widget.EditText;
+
+import com.sheep.gamegroup.absBase.BaseActivity;
+
+import com.sheep.gamegroup.di.components.DaggerReNameComponent;
+import com.sheep.gamegroup.di.modules.ReNameModule;
+import com.sheep.gamegroup.presenter.ReNameContract;
+import com.sheep.gamegroup.presenter.ReNamePresenter;
+import com.sheep.jiuyan.samllsheep.R;
+import com.sheep.jiuyan.samllsheep.SheepApp;
+import com.sheep.jiuyan.samllsheep.utils.TitleBarUtils;
+
+import javax.inject.Inject;
+
+import butterknife.BindView;
+import butterknife.OnClick;
+
+/**
+ * Created by Administrator on 2018/3/24.
+ */
+
+public class ReNameActivity extends BaseActivity implements ReNameContract.View{
+
+
+    @BindView(R.id.et)
+    EditText et;
+    @BindView(R.id.btn)
+    Button btn;
+    @Inject
+    ReNamePresenter presenter;
+    @Override
+    protected int getLayoutId() {
+        return R.layout.x_rename_act_layout;
+    }
+
+    @Override
+    public void initView() {
+
+        DaggerReNameComponent.builder()
+                .netComponent(SheepApp.get(this).getNetComponent())
+                .reNameModule(new ReNameModule(this))
+                .build().inject(this);
+
+    }
+
+    @Override
+    public void initListener() {
+
+    }
+
+    @Override
+    public void initData() {
+        Intent i = getIntent();
+        if (i != null && i.hasExtra("name")) {
+            et.setText(i.getStringExtra("name"));
+        }
+
+
+        TitleBarUtils
+                .getInstance()
+                .setTitle(this, "修改昵称")
+                .setTitleFinish(this);
+
+    }
+
+
+    @OnClick(R.id.btn)
+    public void onClick() {
+
+
+    }
+
+    @Override
+    public void NetSuccess(int code, String msg) {
+        showToast(msg);
+    }
+
+    @Override
+    public void NetError(int code, String errorMsg) {
+         showToast(errorMsg);
+    }
+
+    @Override
+    public void showTask() {
+
+    }
+}

+ 1 - 0
app/src/main/res/layout/x_account_security_layout.xml

@@ -14,6 +14,7 @@
         android:padding="15dp"
         android:background="@drawable/x_ll_bg"
         android:layout_margin="10dp"
+        android:id="@+id/rl_top"
         >
         <ImageView
             android:id="@+id/iv_head"

+ 35 - 0
app/src/main/res/layout/x_rename_act_layout.xml

@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+              android:layout_width="match_parent"
+              android:layout_height="match_parent"
+              android:orientation="vertical"
+              android:background="@color/bg_gray"
+    android:baselineAligned="false">
+    <include layout="@layout/title"></include>
+
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="50dp"
+        android:background="@drawable/x_ll_bg"
+        android:layout_margin="12dp"
+        android:padding="20dp"
+        android:orientation="vertical"
+        >
+        <EditText
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:background="@null"
+            android:id="@+id/et"
+            />
+
+    </LinearLayout>
+
+    <Button
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:text="修改"
+        android:id="@+id/btn"
+        />
+
+
+</LinearLayout>

+ 4 - 12
app/src/main/res/layout/xpersion_info_act_layout.xml

@@ -3,7 +3,7 @@
     android:layout_width="match_parent"
     android:layout_height="match_parent"
     android:orientation="vertical"
-    android:background="@color/black_light"
+    android:background="@color/white_light"
     >
         <include
             layout="@layout/title"/>
@@ -47,6 +47,7 @@
                     android:layout_toLeftOf="@id/tv_more"
                     android:layout_centerVertical="true"
 
+
                     />
 
         </RelativeLayout>
@@ -130,16 +131,6 @@
                             />
 
 
-                        <TextView
-                            android:layout_width="wrap_content"
-                            android:layout_height="wrap_content"
-                            style="@style/hint_txt_style"
-                            android:layout_centerVertical="true"
-                            android:layout_alignParentRight="true"
-                            android:drawableRight="@mipmap/x_ic_next"
-                            android:drawablePadding="10dp"
-                            android:id="@+id/tv_more2"
-                            />
 
                         <TextView
                             android:id="@+id/tv_sheep_id"
@@ -147,7 +138,7 @@
                             android:layout_height="wrap_content"
                             android:background="@null"
                             android:src="@mipmap/ic_launcher"
-                            android:layout_toLeftOf="@id/tv_more2"
+                            android:layout_alignParentEnd="true"
                             android:layout_centerVertical="true"
 
                             />
@@ -167,6 +158,7 @@
                     android:padding="15dp"
                     android:background="@drawable/x_ll_bg"
                     android:layout_margin="10dp"
+                    android:id="@+id/rl_qr"
                     >
 
                         <TextView