zengjiebin лет назад: 8
Родитель
Сommit
8012704e32

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

@@ -48,8 +48,11 @@ import com.sheep.gamegroup.view.activity.WebviewAct;
 import com.sheep.gamegroup.view.activity.WithdrawalAct;
 import com.sheep.gamegroup.view.activity.WithdrawalListAct;
 import com.sheep.gamegroup.view.activity.WithdrawalResultAct;
+import com.sheep.jiuyan.samllsheep.utils.G;
 import com.sheep.jiuyan.samllsheep.utils.SpUtils;
 
+import org.xutils.ex.DbException;
+
 /**
  * Created by ljy on 2018/3/18.
  */
@@ -71,10 +74,24 @@ public class Jump2View {
      * @param o
      */
     public void goWithdrawal(Context context, Object o){
+        UserEntity userEntity = null;
+        try {
+            userEntity = MyDbManager.getInstance().dbFindUser();
+        } catch (DbException e) {
+            e.printStackTrace();
+        }
+        if(userEntity == null){
+            G.showToast("数据正在加载中,请稍候重试");
+            return;
+        }
         if(!isBindWeixin(context)){
             goBindOrChangeWeixinView(context, false);
             return;
         }
+        if(TextUtils.isEmpty(userEntity.getReal_name()) || TextUtils.isEmpty(userEntity.getId_number())){//没有实名认证
+            goRealNameAuther(context, userEntity);
+            return;
+        }
         Intent intent = new Intent(context, WithdrawalAct.class);
         context.startActivity(intent);
         UMConfigUtils.onEvent(UMConfigUtils.Event.SHEEP_TIXIAN);

+ 25 - 21
app/src/main/java/com/sheep/gamegroup/view/activity/RealNameAuthenAct.java

@@ -4,6 +4,7 @@ import android.content.Intent;
 import android.widget.EditText;
 import android.widget.TextView;
 
+import com.googlecode.protobuf.format.util.TextUtils;
 import com.sheep.gamegroup.absBase.BaseActivity;
 import com.sheep.gamegroup.di.components.DaggerRealNameAutherComponent;
 import com.sheep.gamegroup.di.modules.RealNameAutherModule;
@@ -139,31 +140,34 @@ public class RealNameAuthenAct extends BaseActivity implements RealNameAutherCon
 
     @OnClick(R.id.tv_submit)
     public void onClick() {
-        if(android.text.TextUtils.isEmpty(etName.getText().toString())){
+        String realName;
+        String idNumber;
+        if(android.text.TextUtils.isEmpty((realName = etName.getText().toString()))){
            showToast("姓名不能为空");
            return;
+        } else if(android.text.TextUtils.isEmpty((idNumber = etIdCard.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 ;
-
-                     }
-                 }
-             }
+        map.put("real_name", realName);
+        String str=StringUtils.IDCardValidate(idNumber);
+         if(!str.equals("YES")){
+             showToast(str+":请填写正确的身份证信息哈!");
+             return ;
+
+         }else{
+             map.put("id_number", idNumber);
+//             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);

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

@@ -92,11 +92,13 @@
             android:layout_height="1px"
             android:layout_marginLeft="15dp"
             android:layout_marginRight="15dp"
+            android:visibility="gone"
             android:background="@color/white_bg_line" />
 
         <RelativeLayout
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
+            android:visibility="gone"
             android:padding="15dp">
 
             <TextView