Commit dd9b51105d86ac89a8c6940c32bb9c19a54d98d4
1 parent
98bf9525
处理认证跳转逻辑,修改审核失败页面
Showing
11 changed files
with
117 additions
and
16 deletions
core/dentity_verfication/src/main/java/com/cnlive/core/company_verfication/ui/activity/FillInCompanyDataActivity.java
| 1 | package com.cnlive.core.company_verfication.ui.activity; | 1 | package com.cnlive.core.company_verfication.ui.activity; |
| 2 | 2 | ||
| 3 | +import android.content.Context; | ||
| 4 | +import android.content.Intent; | ||
| 5 | + | ||
| 3 | import com.cnlive.core.company_verfication.ui.fragment.FillInCompanyDataFragment; | 6 | import com.cnlive.core.company_verfication.ui.fragment.FillInCompanyDataFragment; |
| 4 | import com.cnlive.core.libs.base.frame.activity.BaseActivity; | 7 | import com.cnlive.core.libs.base.frame.activity.BaseActivity; |
| 5 | import com.cnlive.core.people_verfication.R; | 8 | import com.cnlive.core.people_verfication.R; |
| 9 | +import com.cnlive.core.people_verfication.activity.CheckResultActivity; | ||
| 6 | 10 | ||
| 7 | public class FillInCompanyDataActivity extends BaseActivity { | 11 | public class FillInCompanyDataActivity extends BaseActivity { |
| 8 | 12 | ||
| 13 | + public static void startActivity(Context context, String userId){ | ||
| 14 | + Intent intent = new Intent(context, FillInCompanyDataActivity.class); | ||
| 15 | + intent.putExtra("userId",userId); | ||
| 16 | + context.startActivity(intent); | ||
| 17 | + } | ||
| 9 | @Override | 18 | @Override |
| 10 | protected void initView() { | 19 | protected void initView() { |
| 11 | loadRootFragment(new FillInCompanyDataFragment()); | 20 | loadRootFragment(new FillInCompanyDataFragment()); |
core/dentity_verfication/src/main/java/com/cnlive/core/company_verfication/ui/fragment/SelectCompanyDataFragment.java
| 1 | package com.cnlive.core.company_verfication.ui.fragment; | 1 | package com.cnlive.core.company_verfication.ui.fragment; |
| 2 | 2 | ||
| 3 | -import android.view.Gravity; | 3 | +import android.os.Bundle; |
| 4 | import android.view.View; | 4 | import android.view.View; |
| 5 | -import android.view.ViewGroup; | ||
| 6 | -import android.widget.LinearLayout; | ||
| 7 | -import android.widget.RelativeLayout; | ||
| 8 | import android.widget.TextView; | 5 | import android.widget.TextView; |
| 9 | 6 | ||
| 10 | -import com.cnlive.core.company_verfication.ui.adapter.CompanyDataAdapter; | ||
| 11 | import com.cnlive.core.company_verfication.ui.adapter.CompanyItemDataAdapter; | 7 | import com.cnlive.core.company_verfication.ui.adapter.CompanyItemDataAdapter; |
| 12 | import com.cnlive.core.company_verfication.ui.model.CompanyItemData; | 8 | import com.cnlive.core.company_verfication.ui.model.CompanyItemData; |
| 13 | import com.cnlive.core.libs.base.frame.fragment.BaseFragment; | 9 | import com.cnlive.core.libs.base.frame.fragment.BaseFragment; |
| 14 | -import com.cnlive.core.libs.base.util.StatusBarUtil; | ||
| 15 | import com.cnlive.core.people_verfication.R; | 10 | import com.cnlive.core.people_verfication.R; |
| 16 | import com.cnlive.core.people_verfication.databinding.FragmentSelectInCompanyDataBinding; | 11 | import com.cnlive.core.people_verfication.databinding.FragmentSelectInCompanyDataBinding; |
| 17 | import com.google.android.material.bottomsheet.BottomSheetBehavior; | 12 | import com.google.android.material.bottomsheet.BottomSheetBehavior; |
| @@ -20,7 +15,6 @@ import java.util.ArrayList; | @@ -20,7 +15,6 @@ import java.util.ArrayList; | ||
| 20 | import java.util.List; | 15 | import java.util.List; |
| 21 | 16 | ||
| 22 | import androidx.annotation.NonNull; | 17 | import androidx.annotation.NonNull; |
| 23 | -import androidx.coordinatorlayout.widget.CoordinatorLayout; | ||
| 24 | import androidx.databinding.ViewDataBinding; | 18 | import androidx.databinding.ViewDataBinding; |
| 25 | import androidx.recyclerview.widget.LinearLayoutManager; | 19 | import androidx.recyclerview.widget.LinearLayoutManager; |
| 26 | 20 | ||
| @@ -33,6 +27,13 @@ import androidx.recyclerview.widget.LinearLayoutManager; | @@ -33,6 +27,13 @@ import androidx.recyclerview.widget.LinearLayoutManager; | ||
| 33 | private CompanyItemDataAdapter itemDataAdapter; | 27 | private CompanyItemDataAdapter itemDataAdapter; |
| 34 | private BottomSheetBehavior behavior; | 28 | private BottomSheetBehavior behavior; |
| 35 | 29 | ||
| 30 | + public static SelectCompanyDataFragment newInstance(String userId) { | ||
| 31 | + SelectCompanyDataFragment fragment = new SelectCompanyDataFragment(); | ||
| 32 | + Bundle args = new Bundle(); | ||
| 33 | + args.putString("userId", userId); | ||
| 34 | + fragment.setArguments(args); | ||
| 35 | + return fragment; | ||
| 36 | + } | ||
| 36 | @Override | 37 | @Override |
| 37 | protected int getBindLayoutId() { | 38 | protected int getBindLayoutId() { |
| 38 | return R.layout.fragment_select_in_company_data; | 39 | return R.layout.fragment_select_in_company_data; |
core/dentity_verfication/src/main/java/com/cnlive/core/people_verfication/activity/CheckResultActivity.java
| @@ -4,6 +4,7 @@ import android.content.Context; | @@ -4,6 +4,7 @@ import android.content.Context; | ||
| 4 | import android.content.Intent; | 4 | import android.content.Intent; |
| 5 | 5 | ||
| 6 | import com.cnlive.core.company_verfication.ui.fragment.FillInCompanyDataFragment; | 6 | import com.cnlive.core.company_verfication.ui.fragment.FillInCompanyDataFragment; |
| 7 | +import com.cnlive.core.company_verfication.ui.fragment.SelectCompanyDataFragment; | ||
| 7 | import com.cnlive.core.libs.base.frame.activity.BaseActivity; | 8 | import com.cnlive.core.libs.base.frame.activity.BaseActivity; |
| 8 | import com.cnlive.core.libs.base.frame.fragment.BaseFragment; | 9 | import com.cnlive.core.libs.base.frame.fragment.BaseFragment; |
| 9 | import com.cnlive.core.people_verfication.fragment.CheckResultFragment; | 10 | import com.cnlive.core.people_verfication.fragment.CheckResultFragment; |
| @@ -47,7 +48,7 @@ public class CheckResultActivity extends BaseActivity { | @@ -47,7 +48,7 @@ public class CheckResultActivity extends BaseActivity { | ||
| 47 | } | 48 | } |
| 48 | }else if(type.equals("company")){//机构 | 49 | }else if(type.equals("company")){//机构 |
| 49 | if(code.equals("-1")){//未认证加载机构认证fragment | 50 | if(code.equals("-1")){//未认证加载机构认证fragment |
| 50 | - fragment = FillInCompanyDataFragment.newInstance(userId); | 51 | + fragment = SelectCompanyDataFragment.newInstance(userId); |
| 51 | }else if(code.equals("0") || code.equals("2")){//审核中或者认证失败 | 52 | }else if(code.equals("0") || code.equals("2")){//审核中或者认证失败 |
| 52 | fragment = CheckResultFragment.newInstance(userId,code,type); | 53 | fragment = CheckResultFragment.newInstance(userId,code,type); |
| 53 | }else if(code.equals("1")){//认证成功 加载机构检测成功页面 | 54 | }else if(code.equals("1")){//认证成功 加载机构检测成功页面 |
core/dentity_verfication/src/main/java/com/cnlive/core/people_verfication/fragment/CheckResultFragment.java
| @@ -70,9 +70,9 @@ public class CheckResultFragment extends BaseFragment { | @@ -70,9 +70,9 @@ public class CheckResultFragment extends BaseFragment { | ||
| 70 | binding.resuleBtn.setText("返回"); | 70 | binding.resuleBtn.setText("返回"); |
| 71 | binding.resuleBtn.setOnClickListener(view1 -> getActivity().finish()); | 71 | binding.resuleBtn.setOnClickListener(view1 -> getActivity().finish()); |
| 72 | } else if (code.equals("2")) {//审核失败 | 72 | } else if (code.equals("2")) {//审核失败 |
| 73 | - binding.resultImg.setImageResource(R.drawable.check_icon); | ||
| 74 | - binding.resultTx.setText("审核失败"); | ||
| 75 | - binding.resuleBtn.setText("继续认证"); | 73 | + binding.resultImg.setImageResource(R.drawable.fail_icon); |
| 74 | + binding.resultTx.setText("您申请的个人认证审核未通过\n原因:您提交的公司信息有误,请重新申请"); | ||
| 75 | + binding.resuleBtn.setText("重新申请"); | ||
| 76 | binding.resuleBtn.setOnClickListener(view1 -> { | 76 | binding.resuleBtn.setOnClickListener(view1 -> { |
| 77 | //跳转个人认证页面 | 77 | //跳转个人认证页面 |
| 78 | TakeIdentityPictureActivity.startActivity(getActivity(),userId); | 78 | TakeIdentityPictureActivity.startActivity(getActivity(),userId); |
core/dentity_verfication/src/main/java/com/cnlive/core/people_verfication/fragment/PersonCheckFragment.java
| @@ -72,9 +72,9 @@ public class PersonCheckFragment extends BaseFragment { | @@ -72,9 +72,9 @@ public class PersonCheckFragment extends BaseFragment { | ||
| 72 | getActivity().finish(); | 72 | getActivity().finish(); |
| 73 | } ); | 73 | } ); |
| 74 | }else if(code.endsWith("2")){//审核失败 | 74 | }else if(code.endsWith("2")){//审核失败 |
| 75 | - binding.checkImg.setImageResource(R.drawable.check_icon); | ||
| 76 | - binding.checkTx.setText("审核失败"); | ||
| 77 | - binding.checkBtn.setText("继续认证"); | 75 | + binding.checkImg.setImageResource(R.drawable.fail_icon); |
| 76 | + binding.checkTx.setText("您申请的个人认证审核未通过\n原因:您提交的公司信息有误,请重新申请"); | ||
| 77 | + binding.checkBtn.setText("重新申请"); | ||
| 78 | binding.checkBtn.setOnClickListener(view1 -> { | 78 | binding.checkBtn.setOnClickListener(view1 -> { |
| 79 | TakeIdentityPictureActivity.startActivity(getActivity(),userId); | 79 | TakeIdentityPictureActivity.startActivity(getActivity(),userId); |
| 80 | }); | 80 | }); |
core/dentity_verfication/src/main/java/com/cnlive/core/people_verfication/fragment/TakeIdentityPictureFragment.java
| @@ -7,6 +7,7 @@ import android.text.TextUtils; | @@ -7,6 +7,7 @@ import android.text.TextUtils; | ||
| 7 | import android.view.View; | 7 | import android.view.View; |
| 8 | 8 | ||
| 9 | import com.baidu.ocr.sdk.model.IDCardParams; | 9 | import com.baidu.ocr.sdk.model.IDCardParams; |
| 10 | +import com.cnlive.core.company_verfication.ui.activity.FillInCompanyDataActivity; | ||
| 10 | import com.cnlive.core.libs.base.frame.fragment.BaseFragment; | 11 | import com.cnlive.core.libs.base.frame.fragment.BaseFragment; |
| 11 | import com.cnlive.core.libs.base.util.AlertUtil; | 12 | import com.cnlive.core.libs.base.util.AlertUtil; |
| 12 | import com.cnlive.core.libs.base.util.FileUtils; | 13 | import com.cnlive.core.libs.base.util.FileUtils; |
| @@ -40,6 +41,7 @@ public class TakeIdentityPictureFragment extends BaseFragment<TakeIdentityPictur | @@ -40,6 +41,7 @@ public class TakeIdentityPictureFragment extends BaseFragment<TakeIdentityPictur | ||
| 40 | private static int CAMERA_WRITE_FR_PERMISSION = 1001; | 41 | private static int CAMERA_WRITE_FR_PERMISSION = 1001; |
| 41 | private static int CAMERA_WRITE_BA_PERMISSION = 1002; | 42 | private static int CAMERA_WRITE_BA_PERMISSION = 1002; |
| 42 | private static int CAMERA_WRITE_PI_PERMISSION = 1003; | 43 | private static int CAMERA_WRITE_PI_PERMISSION = 1003; |
| 44 | + private String userId; | ||
| 43 | 45 | ||
| 44 | public static TakeIdentityPictureFragment newInstance(String userId) { | 46 | public static TakeIdentityPictureFragment newInstance(String userId) { |
| 45 | TakeIdentityPictureFragment fragment = new TakeIdentityPictureFragment(); | 47 | TakeIdentityPictureFragment fragment = new TakeIdentityPictureFragment(); |
| @@ -62,6 +64,7 @@ public class TakeIdentityPictureFragment extends BaseFragment<TakeIdentityPictur | @@ -62,6 +64,7 @@ public class TakeIdentityPictureFragment extends BaseFragment<TakeIdentityPictur | ||
| 62 | @Override | 64 | @Override |
| 63 | protected void initView() { | 65 | protected void initView() { |
| 64 | showDefaultWhiteStatusBar(); | 66 | showDefaultWhiteStatusBar(); |
| 67 | + userId = getArguments().getString("userId"); | ||
| 65 | binding.topbar.setTitle("拍摄照片"); | 68 | binding.topbar.setTitle("拍摄照片"); |
| 66 | binding.topbar.addLeftImageButton(R.drawable.top_back_black, R.id.fragment_back).setOnClickListener(v -> { | 69 | binding.topbar.addLeftImageButton(R.drawable.top_back_black, R.id.fragment_back).setOnClickListener(v -> { |
| 67 | finish(); | 70 | finish(); |
| @@ -94,7 +97,7 @@ public class TakeIdentityPictureFragment extends BaseFragment<TakeIdentityPictur | @@ -94,7 +97,7 @@ public class TakeIdentityPictureFragment extends BaseFragment<TakeIdentityPictur | ||
| 94 | }else if(id == R.id.next){ | 97 | }else if(id == R.id.next){ |
| 95 | if (binding.frontTx.getVisibility() == View.VISIBLE && binding.backTx.getVisibility() == View.VISIBLE | 98 | if (binding.frontTx.getVisibility() == View.VISIBLE && binding.backTx.getVisibility() == View.VISIBLE |
| 96 | && binding.picTx.getVisibility() == View.VISIBLE) { | 99 | && binding.picTx.getVisibility() == View.VISIBLE) { |
| 97 | - | 100 | + FillInCompanyDataActivity.startActivity(getActivity(),userId); |
| 98 | } | 101 | } |
| 99 | } | 102 | } |
| 100 | } | 103 | } |
core/dentity_verfication/src/main/java/com/cnlive/core/people_verfication/presenter/TakeIdentityPicturePresenter.java
| 1 | package com.cnlive.core.people_verfication.presenter; | 1 | package com.cnlive.core.people_verfication.presenter; |
| 2 | 2 | ||
| 3 | +import android.content.Context; | ||
| 4 | +import android.graphics.Bitmap; | ||
| 5 | +import android.graphics.BitmapFactory; | ||
| 6 | + | ||
| 3 | import com.cnlive.core.libs.base.frame.presenter.BasePresenter; | 7 | import com.cnlive.core.libs.base.frame.presenter.BasePresenter; |
| 4 | import com.cnlive.core.people_verfication.view.TakeIdentityPictureView; | 8 | import com.cnlive.core.people_verfication.view.TakeIdentityPictureView; |
| 5 | 9 | ||
| 6 | -public class TakeIdentityPicturePresenter extends BasePresenter<TakeIdentityPictureView> { | 10 | +import org.json.JSONException; |
| 11 | +import org.json.JSONObject; | ||
| 12 | + | ||
| 13 | +import java.io.File; | ||
| 14 | +import java.util.ArrayList; | ||
| 15 | +import java.util.HashMap; | ||
| 16 | +import java.util.List; | ||
| 17 | +import java.util.Map; | ||
| 7 | 18 | ||
| 19 | +import io.reactivex.disposables.Disposable; | ||
| 20 | +import okhttp3.MediaType; | ||
| 21 | +import okhttp3.MultipartBody; | ||
| 22 | +import okhttp3.RequestBody; | ||
| 23 | + | ||
| 24 | +public class TakeIdentityPicturePresenter extends BasePresenter<TakeIdentityPictureView> { | ||
| 25 | +// /** | ||
| 26 | +// * 身份认证 | ||
| 27 | +// */ | ||
| 28 | +// public static Disposable addApplyWitness(Context context, String userId, String mobile, String realName, String idCardNo, File idCardObv, File idCardRev, DataCallback<BaseInfo<DarenApplyModel>> callback) { | ||
| 29 | +// Map<String, String> params = new HashMap<>(); | ||
| 30 | +// params.put("sid", userId); | ||
| 31 | +// params.put("realName", realName); | ||
| 32 | +// params.put("idCardNo", idCardNo); | ||
| 33 | +// params.put("mobile", mobile); | ||
| 34 | +// | ||
| 35 | +// List<MultipartBody.Part> parts = new ArrayList<>(); | ||
| 36 | +// | ||
| 37 | +// if (idCardObv.exists() && idCardRev.exists()) { | ||
| 38 | +// BitmapFactory.Options optionsObv = new BitmapFactory.Options(); | ||
| 39 | +// optionsObv.inJustDecodeBounds = true; | ||
| 40 | +// Bitmap bitmapObv = BitmapFactory.decodeFile(idCardObv.getAbsolutePath(), optionsObv); // 此时返回的bitmap为null | ||
| 41 | +// | ||
| 42 | +// BitmapFactory.Options optionsRev = new BitmapFactory.Options(); | ||
| 43 | +// optionsRev.inJustDecodeBounds = true; | ||
| 44 | +// Bitmap bitmapRev = BitmapFactory.decodeFile(idCardRev.getAbsolutePath(), optionsRev); // 此时返回的bitmap为null | ||
| 45 | +// | ||
| 46 | +// JSONObject picobjObv = new JSONObject(); | ||
| 47 | +// JSONObject picobjRev = new JSONObject(); | ||
| 48 | +// try { | ||
| 49 | +// picobjObv.put("height", optionsObv.outHeight); | ||
| 50 | +// picobjObv.put("with", optionsObv.outWidth); | ||
| 51 | +// picobjRev.put("height", optionsRev.outHeight); | ||
| 52 | +// picobjRev.put("with", optionsRev.outWidth); | ||
| 53 | +// } catch (JSONException e) { | ||
| 54 | +// e.printStackTrace(); | ||
| 55 | +// } | ||
| 56 | +// | ||
| 57 | +// params.put("idCardObvInfo", (picobjObv.toString())); | ||
| 58 | +// params.put("idCardRevInfo", (picobjRev.toString())); | ||
| 59 | +// | ||
| 60 | +// RequestBody requestIdCardObv = RequestBody.create(MediaType.parse("multipart/form-data"), idCardObv); | ||
| 61 | +// MultipartBody.Part idCardObvBody = | ||
| 62 | +// MultipartBody.Part.createFormData("idCardObv", idCardObv.getName(), requestIdCardObv); | ||
| 63 | +// | ||
| 64 | +// RequestBody requestIdCardRev = RequestBody.create(MediaType.parse("multipart/form-data"), idCardRev); | ||
| 65 | +// MultipartBody.Part idCardRevBody = | ||
| 66 | +// MultipartBody.Part.createFormData("idCardRev", idCardRev.getName(), requestIdCardRev); | ||
| 67 | +// | ||
| 68 | +// parts.add(idCardObvBody); | ||
| 69 | +// parts.add(idCardRevBody); | ||
| 70 | +// } | ||
| 71 | +// Map<String, String> map1 = SignUtil.getOpenSignMap(params, false); | ||
| 72 | +// Map<String, RequestBody> map2 = SignUtil.orderRequestBody(map1); | ||
| 73 | +// return ApiRequest.subscribe(ApiRequest.service(ApiServiceDaren.class).applyWitness(map2, parts), | ||
| 74 | +// new Subscriber<DarenApplyModel>(context, ApiSubscriber.subscriberBuild) { | ||
| 75 | +// @Override | ||
| 76 | +// public void onCompleted(String s, String s1, DarenApplyModel darenApplyModel) { | ||
| 77 | +// if (callback == null) return; | ||
| 78 | +// callback.callback(SUCCESS, "", darenApplyModel); | ||
| 79 | +// } | ||
| 80 | +// | ||
| 81 | +// @Override | ||
| 82 | +// public void onError(String code, String message) { | ||
| 83 | +// if (callback == null) return; | ||
| 84 | +// int errorCode = -1; | ||
| 85 | +// try { | ||
| 86 | +// errorCode = Integer.valueOf(code); | ||
| 87 | +// } catch (Exception ignored) { | ||
| 88 | +// } finally { | ||
| 89 | +// callback.callback(errorCode, message, null); | ||
| 90 | +// } | ||
| 91 | +// } | ||
| 92 | +// }); | ||
| 93 | +// } | ||
| 8 | } | 94 | } |
core/dentity_verfication/src/main/res/drawable-hdpi/fail_icon.png
0 → 100644
17.4 KB
core/dentity_verfication/src/main/res/drawable-xhdpi/fail_icon.png
0 → 100644
20.2 KB
core/dentity_verfication/src/main/res/drawable-xxhdpi/fail_icon.png
0 → 100644
40.3 KB
core/dentity_verfication/src/main/res/layout/fragment_check_result.xml
| @@ -28,6 +28,7 @@ | @@ -28,6 +28,7 @@ | ||
| 28 | android:layout_width="wrap_content" | 28 | android:layout_width="wrap_content" |
| 29 | android:layout_height="wrap_content" | 29 | android:layout_height="wrap_content" |
| 30 | android:layout_gravity="center_horizontal" | 30 | android:layout_gravity="center_horizontal" |
| 31 | + android:gravity="center_horizontal" | ||
| 31 | android:layout_marginTop="20dp" | 32 | android:layout_marginTop="20dp" |
| 32 | android:textColor="@color/color_999999" | 33 | android:textColor="@color/color_999999" |
| 33 | android:textSize="15sp" | 34 | android:textSize="15sp" |