xiongxiaohe %!s(int64=8) %!d(string=hai) anos
pai
achega
d8a13f2a5d

+ 1 - 1
app/src/main/AndroidManifest.xml

@@ -330,7 +330,7 @@
         <activity android:name="com.sheep.gamegroup.view.activity.ActGuideDeblocked" />
         <activity android:name="com.sheep.gamegroup.view.activity.ReNameActivity" />
 
-
+        <activity android:name="com.sheep.gamegroup.view.activity.RealNameAuthenAct" />
         <!--友盟start-->
         <meta-data
             android:name="UMENG_APPKEY"

+ 18 - 0
app/src/main/java/com/sheep/gamegroup/di/components/RealNameAutherComponent.java

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

+ 23 - 0
app/src/main/java/com/sheep/gamegroup/di/modules/RealNameAutherModule.java

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

+ 11 - 0
app/src/main/java/com/sheep/gamegroup/event/MoneyChange.java

@@ -0,0 +1,11 @@
+package com.sheep.gamegroup.event;
+
+/**
+ * Created by Administrator on 2018/3/27.
+ */
+
+public class MoneyChange {
+
+
+
+}

+ 35 - 0
app/src/main/java/com/sheep/gamegroup/event/RealNameAutehrChange.java

@@ -0,0 +1,35 @@
+package com.sheep.gamegroup.event;
+
+/**
+ * Created by Administrator on 2018/3/26.
+ */
+
+public class RealNameAutehrChange {
+    private  String  realName;
+    private  String  idCard;
+    private  String  banck;
+
+    public String getRealName() {
+        return realName;
+    }
+
+    public void setRealName(String realName) {
+        this.realName = realName;
+    }
+
+    public String getIdCard() {
+        return idCard;
+    }
+
+    public void setIdCard(String idCard) {
+        this.idCard = idCard;
+    }
+
+    public String getBanck() {
+        return banck;
+    }
+
+    public void setBanck(String banck) {
+        this.banck = banck;
+    }
+}

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

@@ -193,4 +193,10 @@ public interface ApiService {
     Observable<BaseMessage> switchPhone(@Body JSONObject jsonObject);
 
 
+
+    /**
+     * 更换手机号
+     */
+    @PUT(V1 + "/app/user/bind_all_real_info")
+    Observable<BaseMessage> bindALl(@Body JSONObject jsonObject);
 }

+ 19 - 0
app/src/main/java/com/sheep/gamegroup/presenter/RealNameAutherContract.java

@@ -0,0 +1,19 @@
+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 RealNameAutherContract {
+
+    interface Presenter extends IBasePresenter{
+
+    }
+
+    interface View extends IBaseView{
+           void  showGoProgress();
+    }
+}

+ 70 - 0
app/src/main/java/com/sheep/gamegroup/presenter/RealNameAutherPresenter.java

@@ -0,0 +1,70 @@
+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 com.sheep.gamegroup.model.entity.UserInfoEntity;
+import com.sheep.gamegroup.util.FastJsonUtils;
+
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+
+import javax.inject.Inject;
+
+import rx.Observer;
+import rx.android.schedulers.AndroidSchedulers;
+import rx.schedulers.Schedulers;
+
+/**
+ * Created by Administrator on 2018/3/10.
+ */
+
+public class RealNameAutherPresenter implements  RealNameAutherContract.Presenter  {
+
+    private RealNameAutherContract.View view;
+    private ApiService apiService;
+
+    @Inject
+    public RealNameAutherPresenter(RealNameAutherContract.View view, ApiService apiService) {
+        this.view = view;
+        this.apiService = apiService;
+    }
+
+    @Override
+    public void getTask(HashMap<String, String> map) {
+       JSONObject  jsonObject=new JSONObject();
+        Iterator map1it=map.entrySet().iterator();
+        for(String key:map.keySet())
+        {
+            jsonObject.put(key,map.get(key));
+        }
+        view.showGoProgress();
+        apiService.bindALl(jsonObject).subscribeOn(Schedulers.io())
+                .observeOn(AndroidSchedulers.mainThread())
+                .subscribe(new Observer<BaseMessage>() {
+                    @Override
+                    public void onCompleted() {
+
+                    }
+
+                    @Override
+                    public void onError(Throwable throwable) {
+
+                        view.NetError(-1,"绑定信息失败");
+                    }
+
+                    @Override
+                    public void onNext(BaseMessage baseMessage) {
+                         view.NetSuccess(0,"修改成功");
+                    }
+                });
+
+
+
+
+    }
+}

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

@@ -6,8 +6,8 @@ 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.5: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 V1 = "/v1/";

+ 14 - 0
app/src/main/java/com/sheep/gamegroup/util/Jump2View.java

@@ -25,6 +25,7 @@ import com.sheep.gamegroup.view.activity.LoginAct;
 import com.sheep.gamegroup.view.activity.PersionInfoAct;
 import com.sheep.gamegroup.view.activity.PersonalCenterAct;
 import com.sheep.gamegroup.view.activity.PhoneAct;
+import com.sheep.gamegroup.view.activity.RealNameAuthenAct;
 import com.sheep.gamegroup.view.activity.TaskListAct;
 import com.sheep.gamegroup.view.activity.TryMakeMoneyact;
 import com.sheep.gamegroup.view.activity.WithdrawalAct;
@@ -308,4 +309,17 @@ public class Jump2View {
     }
 
 
+    /**
+     * 跳转到个人中心界面
+     * @param context
+     * @param o
+     */
+    public void goRealNameAuther(Context context, UserInfoEntity o){
+        Intent i = new Intent(context, RealNameAuthenAct.class);
+        i.putExtra("info", o);
+        context.startActivity(i);
+    }
+
+
+
 }

+ 220 - 0
app/src/main/java/com/sheep/gamegroup/util/StringUtils.java

@@ -3,6 +3,14 @@ package com.sheep.gamegroup.util;
 import android.content.Context;
 import android.text.ClipboardManager;
 
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Calendar;
+import java.util.GregorianCalendar;
+import java.util.Hashtable;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
 /**
  * Created by Administrator on 2018/3/19.
  */
@@ -18,6 +26,218 @@ public class StringUtils {
         cm.setText(text);
     }
 
+    /**
+     * 校验银行卡卡号
+     * @param cardId
+     * @return
+     */
+    public static boolean checkBankCard(String cardId) {
+        char bit = getBankCardCheckCode(cardId.substring(0, cardId.length() - 1));
+        if(bit == 'N'){
+            return false;
+        }
+        return cardId.charAt(cardId.length() - 1) == bit;
+    }
+
+    /**
+     * 从不含校验位的银行卡卡号采用 Luhm 校验算法获得校验位
+     * @param nonCheckCodeCardId
+     * @return
+     */
+    public static char getBankCardCheckCode(String nonCheckCodeCardId){
+        if(nonCheckCodeCardId == null || nonCheckCodeCardId.trim().length() == 0
+                || !nonCheckCodeCardId.matches("\\d+")) {
+            //如果传的不是数据返回N
+            return 'N';
+        }
+        char[] chs = nonCheckCodeCardId.trim().toCharArray();
+        int luhmSum = 0;
+        for(int i = chs.length - 1, j = 0; i >= 0; i--, j++) {
+            int k = chs[i] - '0';
+            if(j % 2 == 0) {
+                k *= 2;
+                k = k / 10 + k % 10;
+            }
+            luhmSum += k;
+        }
+        return (luhmSum % 10 == 0) ? '0' : (char)((10 - luhmSum % 10) + '0');
+    }
+
+
+
+    /**
+     * 验证身份证
+     * @param IDStr
+     * @return "YES" 代表合法的身份证 ,其他值代表错误信息
+     * @throws ParseException
+     */
+    public static String IDCardValidate(String IDStr) {
+        String tipInfo = "YES";// 记录错误信息
+        String Ai = "";
+
+        if(null == IDStr || IDStr.trim().isEmpty())
+            return "身份证号码长度应该为15位或18位。";
+
+        // 判断号码的长度 15位或18位
+        if (IDStr.length() != 15 && IDStr.length() != 18) {
+            tipInfo = "身份证号码长度应该为15位或18位。";
+            return tipInfo;
+        }
+        // 18位身份证前17位位数字,如果是15位的身份证则所有号码都为数字
+        if (IDStr.length() == 18) {
+            Ai = IDStr.substring(0, 17);
+        } else if (IDStr.length() == 15) {
+            Ai = IDStr.substring(0, 6) + "19" + IDStr.substring(6, 15);
+        }
+        if (isNumeric(Ai) == false) {
+            tipInfo = "身份证15位号码都应为数字 ; 18位号码除最后一位外,都应为数字。";
+            return tipInfo;
+        }
+        // 判断出生年月是否有效
+        String strYear = Ai.substring(6, 10);// 年份
+        String strMonth = Ai.substring(10, 12);// 月份
+        String strDay = Ai.substring(12, 14);// 日期
+        if (isDate(strYear + "-" + strMonth + "-" + strDay) == false) {
+            tipInfo = "身份证出生日期无效。";
+            return tipInfo;
+        }
+        GregorianCalendar gc = new GregorianCalendar();
+        SimpleDateFormat s = new SimpleDateFormat("yyyy-MM-dd");
+        try {
+            if ((gc.get(Calendar.YEAR) - Integer.parseInt(strYear)) > 150
+                    || (gc.getTime().getTime() - s.parse(strYear + "-" + strMonth + "-" + strDay).getTime()) < 0) {
+                tipInfo = "身份证生日不在有效范围。";
+                return tipInfo;
+            }
+        } catch (NumberFormatException e) {
+            e.printStackTrace();
+        } catch (java.text.ParseException e) {
+            e.printStackTrace();
+        }
+        if (Integer.parseInt(strMonth) > 12 || Integer.parseInt(strMonth) == 0) {
+            tipInfo = "身份证月份无效";
+            return tipInfo;
+        }
+        if (Integer.parseInt(strDay) > 31 || Integer.parseInt(strDay) == 0) {
+            tipInfo = "身份证日期无效";
+            return tipInfo;
+        }
+        // 判断地区码是否有效
+        Hashtable areacode = GetAreaCode();
+        // 如果身份证前两位的地区码不在Hashtable,则地区码有误
+        if (areacode.get(Ai.substring(0, 2)) == null) {
+            tipInfo = "身份证地区编码错误。";
+            return tipInfo;
+        }
+        if (isVarifyCode(Ai, IDStr) == false) {
+            tipInfo = "身份证校验码无效,不是合法的身份证号码";
+            return tipInfo;
+        }
+        return tipInfo;
+    }
+
+    /*
+     * 判断第18位校验码是否正确 第18位校验码的计算方式: 1. 对前17位数字本体码加权求和 公式为:S = Sum(Ai * Wi), i =
+     * 0, ... , 16 其中Ai表示第i个位置上的身份证号码数字值,Wi表示第i位置上的加权因子,其各位对应的值依次为: 7 9 10 5 8 4
+     * 2 1 6 3 7 9 10 5 8 4 2 2. 用11对计算结果取模 Y = mod(S, 11) 3. 根据模的值得到对应的校验码
+     * 对应关系为: Y值: 0 1 2 3 4 5 6 7 8 9 10 校验码: 1 0 X 9 8 7 6 5 4 3 2
+     */
+    private static boolean isVarifyCode(String Ai, String IDStr) {
+        String[] VarifyCode = { "1", "0", "X", "9", "8", "7", "6", "5", "4", "3", "2" };
+        String[] Wi = { "7", "9", "10", "5", "8", "4", "2", "1", "6", "3", "7", "9", "10", "5", "8", "4", "2" };
+        int sum = 0;
+        for (int i = 0; i < 17; i++) {
+            sum = sum + Integer.parseInt(String.valueOf(Ai.charAt(i))) * Integer.parseInt(Wi[i]);
+        }
+        int modValue = sum % 11;
+        String strVerifyCode = VarifyCode[modValue];
+        Ai = Ai + strVerifyCode;
+        if (IDStr.length() == 18) {
+            if (Ai.equals(IDStr) == false) {
+                return false;
+            }
+        }
+        return true;
+    }
+
+    /**
+     * 将所有地址编码保存在一个Hashtable中
+     *
+     * @return Hashtable 对象
+     */
+    private static Hashtable GetAreaCode() {
+        Hashtable hashtable = new Hashtable();
+        hashtable.put("11", "北京");
+        hashtable.put("12", "天津");
+        hashtable.put("13", "河北");
+        hashtable.put("14", "山西");
+        hashtable.put("15", "内蒙古");
+        hashtable.put("21", "辽宁");
+        hashtable.put("22", "吉林");
+        hashtable.put("23", "黑龙江");
+        hashtable.put("31", "上海");
+        hashtable.put("32", "江苏");
+        hashtable.put("33", "浙江");
+        hashtable.put("34", "安徽");
+        hashtable.put("35", "福建");
+        hashtable.put("36", "江西");
+        hashtable.put("37", "山东");
+        hashtable.put("41", "河南");
+        hashtable.put("42", "湖北");
+        hashtable.put("43", "湖南");
+        hashtable.put("44", "广东");
+        hashtable.put("45", "广西");
+        hashtable.put("46", "海南");
+        hashtable.put("50", "重庆");
+        hashtable.put("51", "四川");
+        hashtable.put("52", "贵州");
+        hashtable.put("53", "云南");
+        hashtable.put("54", "西藏");
+        hashtable.put("61", "陕西");
+        hashtable.put("62", "甘肃");
+        hashtable.put("63", "青海");
+        hashtable.put("64", "宁夏");
+        hashtable.put("65", "新疆");
+        hashtable.put("71", "台湾");
+        hashtable.put("81", "香港");
+        hashtable.put("82", "澳门");
+        hashtable.put("91", "国外");
+        return hashtable;
+    }
+
+    /**
+     * 判断字符串是否为数字,0-9重复0次或者多次
+     *
+     * @param strnum
+     * @return
+     */
+    private static boolean isNumeric(String strnum) {
+        Pattern pattern = Pattern.compile("[0-9]*");
+        Matcher isNum = pattern.matcher(strnum);
+        if (isNum.matches()) {
+            return true;
+        } else {
+            return false;
+        }
+    }
+
+    /**
+     * 功能:判断字符串出生日期是否符合正则表达式:包括年月日,闰年、平年和每月31天、30天和闰月的28天或者29天
+     *
+     * @param string
+     * @return
+     */
+    public static boolean isDate(String strDate) {
+        Pattern pattern = Pattern.compile(
+                "^((\\d{2}(([02468][048])|([13579][26]))[\\-\\/\\s]?((((0?[13578])|(1[02]))[\\-\\/\\s]?((0?[1-9])|([1-2][0-9])|(3[01])))|(((0?[469])|(11))[\\-\\/\\s]?((0?[1-9])|([1-2][0-9])|(30)))|(0?2[\\-\\/\\s]?((0?[1-9])|([1-2][0-9])))))|(\\d{2}(([02468][1235679])|([13579][01345789]))[\\-\\/\\s]?((((0?[13578])|(1[02]))[\\-\\/\\s]?((0?[1-9])|([1-2][0-9])|(3[01])))|(((0?[469])|(11))[\\-\\/\\s]?((0?[1-9])|([1-2][0-9])|(30)))|(0?2[\\-\\/\\s]?((0?[1-9])|(1[0-9])|(2[0-8]))))))?$");
+        Matcher m = pattern.matcher(strDate);
+        if (m.matches()) {
+            return true;
+        } else {
+            return false;
+        }
+    }
+
 
 
 

+ 35 - 12
app/src/main/java/com/sheep/gamegroup/view/activity/AccountAndSecurityAct.java

@@ -12,6 +12,7 @@ import com.bumptech.glide.Glide;
 import com.sheep.gamegroup.absBase.BaseActivity;
 import com.sheep.gamegroup.di.components.DaggerAccountAndSercuritComponent;
 import com.sheep.gamegroup.di.modules.AccountAndSercuritModule;
+import com.sheep.gamegroup.event.RealNameAutehrChange;
 import com.sheep.gamegroup.event.UserNameChange;
 import com.sheep.gamegroup.model.entity.UserInfoEntity;
 import com.sheep.gamegroup.presenter.AccountAndSecuritContract;
@@ -122,6 +123,19 @@ public class AccountAndSecurityAct extends BaseActivity implements AccountAndSec
     }
 
 
+    @Subscribe(threadMode = ThreadMode.MAIN)
+    public void onMessageEvent(RealNameAutehrChange done) {
+
+        UserInfoEntity entiy=mEntity;
+        entiy.setReal_name(done.getRealName());
+        entiy.setId_number(done.getIdCard());
+        entiy.setBank_card(done.getBanck());
+        mEntity=entiy;
+        refalshAuther(mEntity);
+
+    }
+
+
 
 
     @OnClick({R.id.rl_phone, R.id.rl_wx, R.id.rl_auther, R.id.rl_top,R.id.tv_submit})
@@ -133,6 +147,7 @@ public class AccountAndSecurityAct extends BaseActivity implements AccountAndSec
             case R.id.rl_wx:  ////跳转到微信
                 break;
             case R.id.rl_auther: ////跳转授权
+                Jump2View.getInstance().goRealNameAuther(AccountAndSecurityAct.this,mEntity);
                 break;
 
             case R.id.rl_top:
@@ -221,30 +236,38 @@ public class AccountAndSecurityAct extends BaseActivity implements AccountAndSec
 
                 Glide.with(AccountAndSecurityAct.this)
                         .load(mEntity.getAvatar())
-                        .placeholder(R.mipmap.ic_launcher)
+                        .placeholder(R.mipmap.x_ic_def_head)
                         .into(ivHead);
                 if (TextUtils.isEmpty(entity.getWx_nickname())) {
                     tvWx.setText("未绑定");
                 } else {
                     tvWx.setText(entity.getWx_nickname());
                 }
-                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("认证中");
-                }
+
+                refalshAuther(entity);
+
             }
         });
 
 
     }
 
+    private  void  refalshAuther(UserInfoEntity entity ){
+        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("认证中");
+        }
+
+    }
+
+
+
     @Override
     protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);

+ 194 - 0
app/src/main/java/com/sheep/gamegroup/view/activity/RealNameAuthenAct.java

@@ -0,0 +1,194 @@
+package com.sheep.gamegroup.view.activity;
+
+import android.content.Intent;
+import android.graphics.Bitmap;
+import android.os.Bundle;
+import android.widget.EditText;
+import android.widget.TextView;
+
+import com.bumptech.glide.Glide;
+import com.googlecode.protobuf.format.util.TextUtils;
+import com.sheep.gamegroup.absBase.BaseActivity;
+import com.sheep.gamegroup.di.components.DaggerAccountAndSercuritComponent;
+import com.sheep.gamegroup.di.components.DaggerRealNameAutherComponent;
+import com.sheep.gamegroup.di.modules.AccountAndSercuritModule;
+import com.sheep.gamegroup.di.modules.RealNameAutherModule;
+import com.sheep.gamegroup.event.RealNameAutehrChange;
+import com.sheep.gamegroup.model.entity.UserInfoEntity;
+import com.sheep.gamegroup.presenter.RealNameAutherContract;
+import com.sheep.gamegroup.presenter.RealNameAutherPresenter;
+import com.sheep.gamegroup.util.StringUtils;
+import com.sheep.gamegroup.view.dialog.DialogAccountAbnormal;
+import com.sheep.gamegroup.view.dialog.DialogRealNameAuther;
+import com.sheep.jiuyan.samllsheep.R;
+
+import com.sheep.jiuyan.samllsheep.SheepApp;
+import com.sheep.jiuyan.samllsheep.utils.TitleBarUtils;
+import com.uuzuche.lib_zxing.activity.CodeUtils;
+
+import org.greenrobot.eventbus.EventBus;
+
+import java.util.HashMap;
+
+import javax.inject.Inject;
+
+import butterknife.BindView;
+import butterknife.ButterKnife;
+import butterknife.OnClick;
+
+/**
+ * Created by Administrator on 2018/3/26.
+ */
+
+public class RealNameAuthenAct extends BaseActivity implements RealNameAutherContract.View {
+
+    @BindView(R.id.et_id_card)
+    EditText etIdCard;
+    @BindView(R.id.et_bank)
+    EditText etBank;
+    @BindView(R.id.tv_submit)
+    TextView tvSubmit;
+    @BindView(R.id.et_name)
+    EditText etName;
+
+    UserInfoEntity mEntity;
+    @Inject
+    RealNameAutherPresenter  presenter;
+
+    HashMap<String ,String>  map=new HashMap<>();
+
+    private  int  count=0;
+
+    @Override
+    protected int getLayoutId() {
+        return R.layout.x_real_name_auther_layout;
+    }
+
+    @Override
+    public void initView() {
+
+    }
+
+    @Override
+    public void initListener() {
+    }
+    @Override
+    public void initData() {
+       DaggerRealNameAutherComponent.builder().netComponent(SheepApp.get(this).getNetComponent()).realNameAutherModule( new RealNameAutherModule(this)).build().inject(this);
+        TitleBarUtils
+                .getInstance()
+                .setTitle(this, "实名认证")
+                .setTitleFinish(this);
+
+
+        Intent i = getIntent();
+        if (i != null && i.hasExtra("info")) {
+            mEntity = (UserInfoEntity) i.getSerializableExtra("info");
+            if(mEntity!=null) {
+
+                if(!android.text.TextUtils.isEmpty(mEntity.getReal_name())){
+                    etName.setText(mEntity.getReal_name());
+                    count=count+1;
+                    etName.setEnabled(false);
+                }
+                if(!android.text.TextUtils.isEmpty(mEntity.getId_number())){
+                    etIdCard.setText(mEntity.getId_number());
+                    count=count+1;
+                    etIdCard.setEnabled(false);
+                }
+
+                if(!android.text.TextUtils.isEmpty(mEntity.getBank_card())){
+                    etBank.setText(mEntity.getBank_card());
+                    count=count+1;
+                    etBank.setEnabled(false);
+                }
+                if(count>=3){
+                    tvSubmit.setEnabled(false);
+                    tvSubmit.setBackgroundColor(getResources().getColor(R.color.txt_black_9e9c9c));
+                }else{
+                    DialogRealNameAuther.showDialog(this);
+                }
+
+            }
+        }
+
+
+    }
+
+    @Override
+    public void NetSuccess(int code, String msg) {
+          hideProgress();
+          showToast(msg);
+           RealNameAutehrChange  change=new RealNameAutehrChange();
+           for(String key:map.keySet())
+           {
+              if(key.equals("real_name")&& !android.text.TextUtils.isEmpty(map.get(key))){
+                  change.setRealName(map.get(key));
+              }
+               if(key.equals("id_number")&& !android.text.TextUtils.isEmpty(map.get(key))){
+                   change.setIdCard(map.get(key));
+               }
+               if(key.equals("bank_card")&& !android.text.TextUtils.isEmpty(map.get(key))){
+                   change.setBanck(map.get(key));
+               }
+
+         }
+        EventBus.getDefault().post(change);
+          finish();
+    }
+
+    @Override
+    public void NetError(int code, String errorMsg) {
+        hideProgress();
+        showToast(errorMsg);
+    }
+
+
+
+    @OnClick(R.id.tv_submit)
+    public void onClick() {
+        if(android.text.TextUtils.isEmpty(etName.getText().toString())){
+           showToast("姓名不能为空");
+           return;
+        }
+        map.put("real_name",etName.getText().toString());
+        if(!android.text.TextUtils.isEmpty(etIdCard.getText().toString())){
+            String str=StringUtils.IDCardValidate(etIdCard.getText().toString());
+             if(!str.equals("YES")){
+                 showToast(str+":请填写正确的身份证信息哈!");
+                 return ;
+
+             }else{
+                     map.put("id_number",etIdCard.getText().toString());
+                 if(!android.text.TextUtils.isEmpty(etBank.getText().toString())){
+                     if(StringUtils.checkBankCard(etBank.getText().toString())){
+                         map.put("bank_card",etBank.getText().toString());
+                     }else{
+                         showToast("银行卡不合法哈!");
+                         return ;
+
+                     }
+                 }
+             }
+
+        }
+
+        if(map.size()>0){
+            presenter.getTask(map);
+
+        }else{
+            showToast("亲! 请填写修改信息哈");
+        }
+
+
+
+
+
+    }
+
+
+    @Override
+    public void showGoProgress() {
+        showProgress();
+    }
+}

+ 48 - 0
app/src/main/java/com/sheep/gamegroup/view/dialog/DialogRealNameAuther.java

@@ -0,0 +1,48 @@
+package com.sheep.gamegroup.view.dialog;
+
+import android.app.Activity;
+import android.support.v7.app.AlertDialog;
+import android.view.View;
+
+import com.kfzs.duanduan.utils.dlg.HelperUtils;
+import com.kfzs.duanduan.utils.dlg.ViewFindUtils;
+import com.sheep.gamegroup.util.Jump2View;
+import com.sheep.jiuyan.samllsheep.R;
+
+public class DialogRealNameAuther {
+
+    private static AlertDialog mAlertDialog;
+
+    public static AlertDialog showDialog(final Activity activity) {
+        if (mAlertDialog == null) {
+            View view = View.inflate(activity, R.layout.dialog_real_name_auther, null);
+            ViewFindUtils.find(view, R.id.dialog_sure)
+                    .setOnClickListener(new View.OnClickListener() {
+                        @Override
+                        public void onClick(View v) {
+                            mAlertDialog.dismiss();
+                        }
+                    });
+            ViewFindUtils.find(view, R.id.dialog_close)
+                    .setOnClickListener(new View.OnClickListener() {
+                        @Override
+                        public void onClick(View v) {
+                            mAlertDialog.dismiss();
+                        }
+                    });
+            mAlertDialog = new AlertDialog.Builder(activity, R.style.MyDialogActivityTheme)
+                    .setView(view)
+                    .create();
+        }
+        if (!HelperUtils.isActivityOnTop(activity)) {
+            return mAlertDialog;//如果不是顶层窗口,那就不显示了。
+        }
+
+        try {
+            mAlertDialog.show();
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return mAlertDialog;
+    }
+}

+ 58 - 0
app/src/main/res/layout/dialog_real_name_auther.xml

@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="utf-8"?>
+<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent">
+
+    <RelativeLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:orientation="horizontal">
+
+        <LinearLayout
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:orientation="vertical"
+            android:layout_margin="@dimen/content_padding_10"
+            android:padding="@dimen/content_padding_20"
+            android:gravity="center"
+            android:background="@drawable/x_shap_shadow_bg_rectgangle_white">
+
+            <TextView
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_margin="@dimen/content_padding_15"
+                android:lineSpacingExtra="@dimen/content_padding_8"
+                android:text="根据国家相关法律规定,为保障线上交易活动得安全,参与互联网大额提现等资金活动时需要进行实名认证。完成实名认证后,提现将不需要再进行验证。"
+                android:textColor="#404040"
+                android:textSize="@dimen/text_size_12" />
+
+            <LinearLayout
+                android:layout_width="wrap_content"
+                android:layout_height="40dp"
+                android:layout_marginTop="@dimen/content_padding_10"
+                android:orientation="horizontal">
+
+                <TextView
+                    android:id="@+id/dialog_sure"
+                    android:layout_width="200dp"
+                    android:layout_height="40dp"
+                    android:background="@drawable/sp_bg_gradient_rectangle_yellow2"
+                    android:gravity="center"
+                    android:layout_gravity="center"
+                    android:text="确定"
+                    android:textColor="#010101"
+                    android:textSize="@dimen/text_size_15" />
+            </LinearLayout>
+
+        </LinearLayout>
+
+        <ImageView
+            android:id="@+id/dialog_close"
+            android:layout_width="22dp"
+            android:layout_height="22dp"
+            android:padding="2dp"
+            android:layout_alignParentEnd="true"
+            android:src="@mipmap/try_dialog_x"
+            android:background="@drawable/shape_black_ring"/>
+    </RelativeLayout>
+</FrameLayout>

+ 148 - 147
app/src/main/res/layout/x_account_security_layout.xml

@@ -18,10 +18,11 @@
         >
         <ImageView
             android:id="@+id/iv_head"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
+            android:layout_width="30dp"
+            android:layout_height="30dp"
             android:background="@null"
-            android:src="@mipmap/ic_launcher"
+            android:scaleType="centerInside"
+            android:src="@mipmap/x_ic_def_head"
             android:layout_alignParentLeft="true"
             android:layout_centerVertical="true"
             />
@@ -30,7 +31,6 @@
             android:id="@+id/tv_name"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
-            android:text=""
             android:layout_toRightOf="@id/iv_head"
             style="@style/txt_style_15_black"
             android:layout_marginTop="5dp"
@@ -40,7 +40,7 @@
             android:id="@+id/tv_link_content"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
-            android:text=""
+            android:text="@string/share_link_content"
             android:layout_toRightOf="@id/iv_head"
             android:layout_below="@id/tv_name"
             android:layout_marginTop="3dp"
@@ -61,159 +61,160 @@
 
     </RelativeLayout>
 
-<LinearLayout
-    android:layout_width="match_parent"
-    android:layout_height="wrap_content"
-    android:orientation="vertical"
-    android:background="@drawable/x_shap_shadow_bg_rectgangle_white"
-    android:layout_marginLeft="10dp"
-    android:layout_marginRight="10dp"
-    >
-
-    <RelativeLayout
+    <LinearLayout
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
-        android:padding="15dp"
-        android:id="@+id/rl_phone"
+        android:orientation="vertical"
+        android:background="@drawable/x_shap_shadow_bg_rectgangle_white"
+        android:layout_marginLeft="10dp"
+        android:layout_marginRight="10dp"
         >
-        <ImageView
-            android:id="@+id/iv_phone"
-            android:layout_width="40dp"
-            android:layout_height="wrap_content"
-            android:background="@null"
-            android:src="@mipmap/x_ic_phone"
-            android:layout_alignParentLeft="true"
-            android:layout_centerVertical="true"
-            />
-
 
-        <TextView
-            android:id="@+id/tv_phone"
-            android:layout_width="wrap_content"
+        <RelativeLayout
+            android:layout_width="match_parent"
             android:layout_height="wrap_content"
-            style="@style/hint_txt_style"
-            android:layout_marginLeft="5dp"
-            android:layout_centerVertical="true"
-            android:layout_alignParentRight="true"
-            android:drawableRight="@mipmap/x_ic_next"
-            android:drawablePadding="10dp"
+            android:padding="15dp"
+            android:id="@+id/rl_phone"
+            >
+            <ImageView
+                android:id="@+id/iv_phone"
+                android:layout_width="40dp"
+                android:layout_height="wrap_content"
+                android:background="@null"
+                android:src="@mipmap/x_ic_phone"
+                android:layout_alignParentLeft="true"
+                android:layout_centerVertical="true"
+                />
+
+            <TextView
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:text="@string/phone"
+                android:layout_toRightOf="@id/iv_phone"
+                style="@style/txt_style_15"
+                android:layout_marginLeft="5dp"
+                android:layout_centerVertical="true"
+                />
+
+
+            <TextView
+                android:id="@+id/tv_phone"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                style="@style/hint_txt_style"
+                android:layout_marginLeft="5dp"
+                android:layout_centerVertical="true"
+                android:layout_alignParentRight="true"
+                android:drawableRight="@mipmap/x_ic_next"
+                android:drawablePadding="10dp"
+                />
+        </RelativeLayout>
+
+
+
+
+        <View
+            android:layout_width="match_parent"
+            android:layout_height="1px"
+            android:background="@color/white_bg_line"
+            android:layout_marginLeft="15dp"
+            android:layout_marginRight="15dp"
             />
-    </RelativeLayout>
 
-
-
-
-    <View
-        android:layout_width="match_parent"
-        android:layout_height="1px"
-        android:background="@color/white_bg_line"
-        android:layout_marginLeft="15dp"
-        android:layout_marginRight="15dp"
-        />
-
-    <RelativeLayout
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:id="@+id/rl_wx"
-        android:padding="15dp"
-        >
-        <ImageView
-            android:id="@+id/iv_wx"
-            android:layout_width="40dp"
+        <RelativeLayout
+            android:layout_width="match_parent"
             android:layout_height="wrap_content"
-            android:background="@null"
-            android:src="@mipmap/x_ic_weixin"
-            android:layout_alignParentLeft="true"
-            android:layout_centerVertical="true"
+            android:id="@+id/rl_wx"
+            android:padding="15dp"
+            >
+            <ImageView
+                android:id="@+id/iv_wx"
+                android:layout_width="40dp"
+                android:layout_height="wrap_content"
+                android:background="@null"
+                android:src="@mipmap/x_ic_weixin"
+                android:layout_alignParentLeft="true"
+                android:layout_centerVertical="true"
+                />
+
+            <TextView
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:text="@string/bind_wx"
+                android:layout_toRightOf="@id/iv_wx"
+                style="@style/txt_style_15"
+                android:layout_marginLeft="5dp"
+                android:layout_centerVertical="true"
+                />
+
+
+            <TextView
+                android:id="@+id/tv_wx"
+                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"
+                />
+        </RelativeLayout>
+
+
+        <View
+            android:layout_width="match_parent"
+            android:layout_height="1px"
+            android:background="@color/white_bg_line"
+            android:layout_marginLeft="15dp"
+            android:layout_marginRight="15dp"
             />
 
-        <TextView
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:text="@string/bind_wx"
-            android:layout_toRightOf="@id/iv_wx"
-            style="@style/txt_style_15"
-            android:layout_marginLeft="5dp"
-            android:layout_centerVertical="true"
-            android:id="@+id/textView2" />
-
-
-        <TextView
-            android:id="@+id/tv_wx"
-            android:layout_width="wrap_content"
+        <RelativeLayout
+            android:layout_width="match_parent"
             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"
-            />
-
-        <TextView
-            style="@style/txt_style_15"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_alignParentBottom="true"
-            android:layout_alignStart="@+id/textView2"
-            android:layout_marginBottom="40dp"
-            android:text="@string/phone" />
-    </RelativeLayout>
-
-
-    <View
-        android:layout_width="match_parent"
-        android:layout_height="1px"
-        android:background="@color/white_bg_line"
-        android:layout_marginLeft="15dp"
-        android:layout_marginRight="15dp"
-        />
-
-    <RelativeLayout
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:id="@+id/rl_auther"
-        android:padding="15dp"
-        >
-        <ImageView
-            android:id="@+id/iv_auther"
-            android:layout_width="40dp"
-            android:layout_height="wrap_content"
-            android:background="@null"
-            android:src="@mipmap/x_ic_id_card"
-            android:layout_alignParentLeft="true"
-            android:layout_centerVertical="true"
-            />
-
-        <TextView
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:text="@string/auther"
-            android:layout_toRightOf="@id/iv_auther"
-            style="@style/txt_style_15"
-            android:layout_marginLeft="5dp"
-            android:layout_centerVertical="true"
-            />
-
-
-        <TextView
-            android:id="@+id/tv_auther"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:text="未认证"
-            style="@style/hint_txt_style"
-            android:layout_marginLeft="5dp"
-            android:layout_centerVertical="true"
-            android:layout_alignParentRight="true"
-            android:drawableRight="@mipmap/x_ic_next"
-            android:drawablePadding="10dp"
-            />
-    </RelativeLayout>
-
-
-
-
-
-</LinearLayout>
+            android:id="@+id/rl_auther"
+            android:padding="15dp"
+            >
+            <ImageView
+                android:id="@+id/iv_auther"
+                android:layout_width="40dp"
+                android:layout_height="wrap_content"
+                android:background="@null"
+                android:src="@mipmap/x_ic_id_card"
+                android:layout_alignParentLeft="true"
+                android:layout_centerVertical="true"
+                />
+
+            <TextView
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:text="@string/auther"
+                android:layout_toRightOf="@id/iv_auther"
+                style="@style/txt_style_15"
+                android:layout_marginLeft="5dp"
+                android:layout_centerVertical="true"
+                />
+
+
+            <TextView
+                android:id="@+id/tv_auther"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:text="未认证"
+                style="@style/hint_txt_style"
+                android:layout_marginLeft="5dp"
+                android:layout_centerVertical="true"
+                android:layout_alignParentRight="true"
+                android:drawableRight="@mipmap/x_ic_next"
+                android:drawablePadding="10dp"
+                />
+        </RelativeLayout>
+
+
+
+
+
+    </LinearLayout>
 
 
     <TextView

+ 165 - 0
app/src/main/res/layout/x_real_name_auther_layout.xml

@@ -0,0 +1,165 @@
+<?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/white_light"
+    >
+    <include
+        layout="@layout/title"/>
+
+
+
+<LinearLayout
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content"
+    android:orientation="vertical"
+    android:background="@drawable/x_shap_shadow_bg_rectgangle_white"
+    android:layout_marginLeft="10dp"
+    android:layout_marginRight="10dp"
+    >
+
+    <RelativeLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:padding="15dp"
+        android:id="@+id/rl_phone"
+        >
+
+
+        <TextView
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text="姓    名"
+            style="@style/txt_style_15"
+            android:layout_marginLeft="5dp"
+            android:layout_centerVertical="true"
+            />
+
+
+        <EditText
+            android:id="@+id/et_name"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_marginLeft="5dp"
+            android:layout_centerVertical="true"
+            android:layout_alignParentRight="true"
+            android:drawablePadding="10dp"
+            android:background="@null"
+            android:textSize="@dimen/text_size_2"
+            android:hint="请填写姓名"
+            android:textColor="@color/txt_black_9e9c9c"
+            />
+    </RelativeLayout>
+
+
+
+
+    <View
+        android:layout_width="match_parent"
+        android:layout_height="1px"
+        android:background="@color/white_bg_line"
+        android:layout_marginLeft="15dp"
+        android:layout_marginRight="15dp"
+        />
+
+    <RelativeLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:padding="15dp"
+        >
+
+
+        <TextView
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text="身份证"
+            android:layout_toRightOf="@id/iv_phone"
+            style="@style/txt_style_15"
+            android:layout_marginLeft="5dp"
+            android:layout_centerVertical="true"
+            />
+
+
+        <EditText
+            android:id="@+id/et_id_card"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_marginLeft="5dp"
+            android:layout_centerVertical="true"
+            android:layout_alignParentRight="true"
+            android:drawablePadding="10dp"
+            android:background="@null"
+            android:hint="请填写身份证号"
+            android:maxLength="18"
+            android:textSize="@dimen/text_size_2"
+            android:textColor="@color/txt_black_9e9c9c"
+            />
+    </RelativeLayout>
+
+
+    <View
+        android:layout_width="match_parent"
+        android:layout_height="1px"
+        android:background="@color/white_bg_line"
+        android:layout_marginLeft="15dp"
+        android:layout_marginRight="15dp"
+        />
+
+    <RelativeLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:padding="15dp"
+        >
+
+
+        <TextView
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text="银行卡"
+            android:layout_toRightOf="@id/iv_phone"
+            style="@style/txt_style_15"
+            android:layout_marginLeft="5dp"
+            android:layout_centerVertical="true"
+            />
+
+
+        <EditText
+            android:id="@+id/et_bank"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_marginLeft="5dp"
+            android:layout_centerVertical="true"
+            android:layout_alignParentRight="true"
+            android:drawablePadding="10dp"
+            android:background="@null"
+            android:inputType="number"
+            android:maxLength="19"
+            android:hint="请填写银行卡"
+            android:textSize="@dimen/text_size_2"
+            android:textColor="@color/txt_black_9e9c9c"
+            />
+    </RelativeLayout>
+
+
+
+
+
+</LinearLayout>
+
+
+    <TextView
+        android:id="@+id/tv_submit"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_gravity="center_horizontal"
+        android:layout_marginTop="40dp"
+        android:layout_marginLeft="20dp"
+        android:layout_marginRight="20dp"
+        android:background="@drawable/selector_button_full_main"
+        android:gravity="center"
+        android:padding="@dimen/content_padding_10"
+        android:text="提交"
+        android:textColor="@color/txt_black_010101"
+        android:textSize="@dimen/text_size_18" />
+</LinearLayout>

BIN=BIN
app/src/main/res/mipmap-xhdpi/x_ic_def_head.png


BIN=BIN
app/src/main/res/mipmap-xxhdpi/x_ic_def_head.png