Commit bff1c82284c7a18b275f01723edf8fc98c85cd9e

Authored by hhh
1 parent d39ea1cf

添加认证结果参数判断页面跳转逻辑

Showing 24 changed files with 465 additions and 2 deletions
.idea/misc.xml
... ... @@ -39,7 +39,7 @@
39 39 </value>
40 40 </option>
41 41 </component>
42   - <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK">
  42 + <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="JDK" project-jdk-type="JavaSDK">
43 43 <output url="file://$PROJECT_DIR$/build/classes" />
44 44 </component>
45 45 <component name="ProjectType">
... ...
core/dentity_verfication/build.gradle
... ... @@ -8,6 +8,7 @@ dependencies {
8 8 implementation fileTree(include: ['*.jar'], dir: 'libs')
9 9 implementation 'androidx.appcompat:appcompat:1.0.2'
10 10 implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
  11 + implementation 'androidx.legacy:legacy-support-v4:1.0.0'
11 12 testImplementation 'junit:junit:4.12'
12 13 androidTestImplementation 'androidx.test.ext:junit:1.1.1'
13 14 androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
... ...
core/dentity_verfication/src/main/AndroidManifest.xml
... ... @@ -12,7 +12,9 @@
12 12 <uses-feature android:name="android.hardware.camera.autofocus" />
13 13  
14 14 <application>
15   - <activity android:name="com.cnlive.core.company_verfication.ui.activity.FillInCompanyDataActivity"></activity>
  15 + <activity android:name=".activity.PersonCheckActivity"></activity>
  16 + <activity android:name=".activity.CheckResultActivity" />
  17 + <activity android:name="com.cnlive.core.company_verfication.ui.activity.FillInCompanyDataActivity" />
16 18 <activity android:name=".activity.TakeIdentityPictureActivity" />
17 19 <activity
18 20 android:name="com.cnlive.core.ocr.ui.camera.CameraActivity"
... ...
core/dentity_verfication/src/main/java/com/cnlive/core/people_verfication/activity/CheckResultActivity.java 0 → 100644
  1 +package com.cnlive.core.people_verfication.activity;
  2 +
  3 +import android.os.Bundle;
  4 +
  5 +import com.cnlive.core.people_verfication.R;
  6 +import com.cnlive.core.people_verfication.fragment.CheckResultFragment;
  7 +import com.cnlive.core.people_verfication.fragment.CompanyCheckSuccessFragment;
  8 +import com.cnlive.core.people_verfication.fragment.PersonCheckSuccessFragment;
  9 +
  10 +import androidx.appcompat.app.AppCompatActivity;
  11 +import androidx.fragment.app.Fragment;
  12 +
  13 +public class CheckResultActivity extends AppCompatActivity {
  14 +
  15 + private String userId,code,type;
  16 + private Fragment fragment;
  17 + @Override
  18 + protected void onCreate(Bundle savedInstanceState) {
  19 + super.onCreate(savedInstanceState);
  20 + setContentView(R.layout.activity_check_result);
  21 + userId = getIntent().getStringExtra("userId");
  22 + code = getIntent().getStringExtra("code");
  23 + type = getIntent().getStringExtra("type");
  24 + if(type.equals("person")){//个人
  25 + if(code.equals("-1")){//未认证 加载个人认证页面
  26 +
  27 + }else if(code.equals("0") || code.equals("2")){//审核中或者认证失败
  28 + fragment = CheckResultFragment.newInstance(userId,code,type);
  29 + }else if(code.equals("1")){//认证成功 加载个人检测成功页面
  30 + fragment = new PersonCheckSuccessFragment();
  31 + }
  32 + }else if(type.equals("company")){//机构
  33 + if(code.equals("-1")){//未认证加载机构认证fragment
  34 +
  35 + }else if(code.equals("0") || code.equals("2")){//审核中或者认证失败
  36 + fragment = CheckResultFragment.newInstance(userId,code,type);
  37 + }else if(code.equals("1")){//认证成功 加载机构检测成功页面
  38 + fragment = new CompanyCheckSuccessFragment();
  39 + }
  40 + }
  41 + getSupportFragmentManager().beginTransaction().add(R.id.container, fragment).commit();
  42 + }
  43 +}
... ...
core/dentity_verfication/src/main/java/com/cnlive/core/people_verfication/activity/PersonCheckActivity.java 0 → 100644
  1 +package com.cnlive.core.people_verfication.activity;
  2 +
  3 +import android.os.Bundle;
  4 +
  5 +import com.cnlive.core.people_verfication.R;
  6 +
  7 +import androidx.appcompat.app.AppCompatActivity;
  8 +
  9 +public class PersonCheckActivity extends AppCompatActivity {
  10 +
  11 + private String code;
  12 + @Override
  13 + protected void onCreate(Bundle savedInstanceState) {
  14 + super.onCreate(savedInstanceState);
  15 + setContentView(R.layout.activity_person_check);
  16 + code = getIntent().getStringExtra("code");
  17 + if(code.equals("1")){//认证成功--->跳转个人检测成功页面
  18 +
  19 + }else {
  20 + //personCheckFragment页面
  21 + }
  22 + }
  23 +}
... ...
core/dentity_verfication/src/main/java/com/cnlive/core/people_verfication/fragment/CheckResultFragment.java 0 → 100644
  1 +package com.cnlive.core.people_verfication.fragment;
  2 +
  3 +import android.os.Bundle;
  4 +import android.view.LayoutInflater;
  5 +import android.view.View;
  6 +import android.view.ViewGroup;
  7 +import android.widget.ImageView;
  8 +import android.widget.TextView;
  9 +
  10 +import com.cnlive.core.people_verfication.R;
  11 +
  12 +import androidx.annotation.NonNull;
  13 +import androidx.annotation.Nullable;
  14 +import androidx.fragment.app.Fragment;
  15 +
  16 +/**
  17 + * A simple {@link Fragment} subclass.
  18 + */
  19 +public class CheckResultFragment extends Fragment {
  20 +
  21 + private String code;
  22 + private String type;
  23 + private String userId;
  24 + private ImageView result_img;
  25 + private TextView result_tx;
  26 + private TextView result_btn;
  27 + public CheckResultFragment() {
  28 + // Required empty public constructor
  29 + }
  30 + public static CheckResultFragment newInstance(String userId,String code,String type) {
  31 + CheckResultFragment fragment = new CheckResultFragment();
  32 + Bundle args = new Bundle();
  33 + args.putString("userId", userId);
  34 + args.putString("code", code);
  35 + args.putString("type", type);
  36 + fragment.setArguments(args);
  37 + return fragment;
  38 + }
  39 +
  40 +
  41 + @Override
  42 + public View onCreateView(LayoutInflater inflater, ViewGroup container,
  43 + Bundle savedInstanceState) {
  44 + // Inflate the layout for this fragment
  45 + return inflater.inflate(R.layout.fragment_check_result, container, false);
  46 + }
  47 +
  48 + @Override
  49 + public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
  50 + super.onViewCreated(view, savedInstanceState);
  51 + result_img = view.findViewById(R.id.result_img);
  52 + result_tx = view.findViewById(R.id.result_tx);
  53 + result_btn = view.findViewById(R.id.resule_btn);
  54 +
  55 + userId = getArguments().getString("userId");
  56 + code = getArguments().getString("code");
  57 + type = getArguments().getString("type");
  58 + if(type.equals("company")){//0和2都是一个页面
  59 + result_img.setImageResource(R.drawable.check_icon);
  60 + result_tx.setText("审核进度以及结果请您去pc端查看");
  61 + result_btn.setText("返回");
  62 + result_btn.setOnClickListener(view1 -> getActivity().finish());
  63 + }else if(type.equals("person")){
  64 + if(code.equals("0")){//审核中
  65 + result_img.setImageResource(R.drawable.check_icon);
  66 + result_tx.setText(getString(R.string.checking));
  67 + result_btn.setText("返回");
  68 + result_btn.setOnClickListener(view1 -> getActivity().finish());
  69 + }else if(code.equals("2")){//审核失败
  70 + result_img.setImageResource(R.drawable.check_icon);
  71 + result_tx.setText("审核失败");
  72 + result_btn.setText("继续认证");
  73 + result_btn.setOnClickListener(view1 -> {
  74 + //跳转个人认证页面
  75 + });
  76 + }
  77 + }
  78 + }
  79 +}
... ...
core/dentity_verfication/src/main/java/com/cnlive/core/people_verfication/fragment/CompanyCheckSuccessFragment.java 0 → 100644
  1 +package com.cnlive.core.people_verfication.fragment;
  2 +
  3 +import android.os.Bundle;
  4 +import android.view.LayoutInflater;
  5 +import android.view.View;
  6 +import android.view.ViewGroup;
  7 +
  8 +import com.cnlive.core.people_verfication.R;
  9 +
  10 +import androidx.fragment.app.Fragment;
  11 +
  12 +/**
  13 + * A simple {@link Fragment} subclass.
  14 + */
  15 +public class CompanyCheckSuccessFragment extends Fragment {
  16 +
  17 + public CompanyCheckSuccessFragment() {
  18 + // Required empty public constructor
  19 + }
  20 +
  21 +
  22 + @Override
  23 + public View onCreateView(LayoutInflater inflater, ViewGroup container,
  24 + Bundle savedInstanceState) {
  25 + // Inflate the layout for this fragment
  26 + return inflater.inflate(R.layout.fragment_company_check_success, container, false);
  27 + }
  28 +}
... ...
core/dentity_verfication/src/main/java/com/cnlive/core/people_verfication/fragment/PersonCheckFragment.java 0 → 100644
  1 +package com.cnlive.core.people_verfication.fragment;
  2 +
  3 +import android.os.Bundle;
  4 +import android.view.LayoutInflater;
  5 +import android.view.View;
  6 +import android.view.ViewGroup;
  7 +import android.widget.ImageView;
  8 +import android.widget.TextView;
  9 +
  10 +import com.cnlive.core.people_verfication.R;
  11 +
  12 +import androidx.annotation.NonNull;
  13 +import androidx.annotation.Nullable;
  14 +import androidx.fragment.app.Fragment;
  15 +
  16 +/**
  17 + * A simple {@link Fragment} subclass.
  18 + */
  19 +public class PersonCheckFragment extends Fragment {
  20 +
  21 + private String code;
  22 + private ImageView check_img;
  23 + private TextView check_tx,check_btn;
  24 +
  25 + public PersonCheckFragment() {
  26 + // Required empty public constructor
  27 + }
  28 +
  29 +
  30 + @Override
  31 + public View onCreateView(LayoutInflater inflater, ViewGroup container,
  32 + Bundle savedInstanceState) {
  33 + // Inflate the layout for this fragment
  34 + return inflater.inflate(R.layout.fragment_person_check, container, false);
  35 + }
  36 +
  37 + @Override
  38 + public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
  39 + super.onViewCreated(view, savedInstanceState);
  40 + check_img = view.findViewById(R.id.check_img);
  41 + check_tx = view.findViewById(R.id.check_tx);
  42 + check_btn = view.findViewById(R.id.check_btn);
  43 +
  44 + code = getArguments().getString("code");
  45 + if(code.equals("-1")){//未认证
  46 + check_img.setImageResource(R.drawable.p_icon);
  47 + check_tx.setText("亲,您未申请个人认证");
  48 + check_btn.setText("去认证");
  49 + check_btn.setOnClickListener(view1 -> {
  50 + //跳转个人认证页面
  51 + });
  52 + }else if(code.equals("0")){//审核中
  53 + check_img.setImageResource(R.drawable.check_icon);
  54 + check_tx.setText("请您耐心等待,后台正在提交审核中");
  55 + check_btn.setText("返回");
  56 + check_btn.setOnClickListener(view1 ->{
  57 + getActivity().finish();
  58 + } );
  59 + }
  60 + }
  61 +}
... ...
core/dentity_verfication/src/main/java/com/cnlive/core/people_verfication/fragment/PersonCheckSuccessFragment.java 0 → 100644
  1 +package com.cnlive.core.people_verfication.fragment;
  2 +
  3 +import android.os.Bundle;
  4 +import android.view.LayoutInflater;
  5 +import android.view.View;
  6 +import android.view.ViewGroup;
  7 +
  8 +import com.cnlive.core.people_verfication.R;
  9 +
  10 +import androidx.fragment.app.Fragment;
  11 +
  12 +/**
  13 + * A simple {@link Fragment} subclass.
  14 + */
  15 +public class PersonCheckSuccessFragment extends Fragment {
  16 +
  17 + public PersonCheckSuccessFragment() {
  18 + // Required empty public constructor
  19 + }
  20 +
  21 +
  22 + @Override
  23 + public View onCreateView(LayoutInflater inflater, ViewGroup container,
  24 + Bundle savedInstanceState) {
  25 + // Inflate the layout for this fragment
  26 + return inflater.inflate(R.layout.fragment_person_chech_success, container, false);
  27 + }
  28 +}
... ...
core/dentity_verfication/src/main/java/com/cnlive/core/people_verfication/fragment/TakeIdentityPictureFragment.java 0 → 100644
  1 +package com.cnlive.core.people_verfication.fragment;
  2 +
  3 +import android.os.Bundle;
  4 +import android.view.LayoutInflater;
  5 +import android.view.View;
  6 +import android.view.ViewGroup;
  7 +
  8 +import com.cnlive.core.people_verfication.R;
  9 +
  10 +import androidx.fragment.app.Fragment;
  11 +
  12 +/**
  13 + * A simple {@link Fragment} subclass.
  14 + */
  15 +public class TakeIdentityPictureFragment extends Fragment {
  16 +
  17 + public TakeIdentityPictureFragment() {
  18 + // Required empty public constructor
  19 + }
  20 +
  21 +
  22 + @Override
  23 + public View onCreateView(LayoutInflater inflater, ViewGroup container,
  24 + Bundle savedInstanceState) {
  25 + // Inflate the layout for this fragment
  26 + return inflater.inflate(R.layout.fragment_take_identity_picture, container, false);
  27 + }
  28 +}
... ...
core/dentity_verfication/src/main/res/drawable-hdpi/check_icon.png 0 → 100644

17.1 KB

core/dentity_verfication/src/main/res/drawable-hdpi/p_icon.png 0 → 100644

16.5 KB

core/dentity_verfication/src/main/res/drawable-xhdpi/check_icon.png 0 → 100644

20.1 KB

core/dentity_verfication/src/main/res/drawable-xhdpi/p_icon.png 0 → 100644

20.7 KB

core/dentity_verfication/src/main/res/drawable-xxhdpi/check_icon.png 0 → 100644

39.8 KB

core/dentity_verfication/src/main/res/drawable-xxhdpi/p_icon.png 0 → 100644

39.7 KB

core/dentity_verfication/src/main/res/layout/activity_check_result.xml 0 → 100644
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  3 + xmlns:app="http://schemas.android.com/apk/res-auto"
  4 + xmlns:tools="http://schemas.android.com/tools"
  5 + android:layout_width="match_parent"
  6 + android:layout_height="match_parent"
  7 + tools:context=".activity.CheckResultActivity">
  8 +
  9 + <RelativeLayout
  10 + android:id="@+id/container"
  11 + android:layout_width="match_parent"
  12 + android:layout_height="match_parent"/>
  13 +</RelativeLayout>
0 14 \ No newline at end of file
... ...
core/dentity_verfication/src/main/res/layout/activity_person_check.xml 0 → 100644
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
  3 + xmlns:app="http://schemas.android.com/apk/res-auto"
  4 + xmlns:tools="http://schemas.android.com/tools"
  5 + android:layout_width="match_parent"
  6 + android:layout_height="match_parent"
  7 + tools:context=".activity.PersonCheckActivity">
  8 +
  9 +</androidx.constraintlayout.widget.ConstraintLayout>
0 10 \ No newline at end of file
... ...
core/dentity_verfication/src/main/res/layout/fragment_check_result.xml 0 → 100644
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  3 + xmlns:tools="http://schemas.android.com/tools"
  4 + android:layout_width="match_parent"
  5 + android:layout_height="match_parent"
  6 + tools:context=".fragment.CheckResultFragment">
  7 +
  8 + <com.qmuiteam.qmui.widget.QMUITopBar
  9 + android:id="@+id/topbar"
  10 + android:layout_width="match_parent"
  11 + android:layout_height="?attr/qmui_topbar_height" />
  12 +
  13 + <LinearLayout
  14 + android:layout_width="match_parent"
  15 + android:layout_height="wrap_content"
  16 + android:layout_centerInParent="true"
  17 + android:orientation="vertical">
  18 + <ImageView
  19 + android:id="@+id/result_img"
  20 + android:layout_width="wrap_content"
  21 + android:layout_height="wrap_content"
  22 + android:layout_gravity="center_horizontal"
  23 + android:src="@drawable/check_icon"/>
  24 +
  25 + <TextView
  26 + android:id="@+id/result_tx"
  27 + android:layout_width="wrap_content"
  28 + android:layout_height="wrap_content"
  29 + android:layout_gravity="center_horizontal"
  30 + android:layout_marginTop="20dp"
  31 + android:textColor="@color/color_999999"
  32 + android:textSize="15sp"
  33 + android:text="@string/checking"/>
  34 +
  35 + <TextView
  36 + android:id="@+id/resule_btn"
  37 + android:layout_width="match_parent"
  38 + android:layout_height="45dp"
  39 + android:text="@string/backs"
  40 + android:layout_marginLeft="30dp"
  41 + android:layout_marginRight="30dp"
  42 + android:gravity="center"
  43 + android:textColor="@color/white"
  44 + android:textSize="18sp"
  45 + android:background="@drawable/bg_apply_btn"
  46 + android:layout_marginTop="50dp"/>
  47 + </LinearLayout>
  48 +
  49 +</RelativeLayout>
0 50 \ No newline at end of file
... ...
core/dentity_verfication/src/main/res/layout/fragment_company_check_success.xml 0 → 100644
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
  3 + xmlns:tools="http://schemas.android.com/tools"
  4 + android:layout_width="match_parent"
  5 + android:layout_height="match_parent"
  6 + tools:context=".fragment.CompanyCheckSuccessFragment">
  7 +
  8 + <!-- TODO: Update blank fragment layout -->
  9 + <TextView
  10 + android:layout_width="match_parent"
  11 + android:layout_height="match_parent"
  12 + android:text="@string/hello_blank_fragment" />
  13 +
  14 +</FrameLayout>
0 15 \ No newline at end of file
... ...
core/dentity_verfication/src/main/res/layout/fragment_person_chech_success.xml 0 → 100644
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
  3 + xmlns:tools="http://schemas.android.com/tools"
  4 + android:layout_width="match_parent"
  5 + android:layout_height="match_parent"
  6 + tools:context=".fragment.PersonCheckSuccessFragment">
  7 +
  8 + <!-- TODO: Update blank fragment layout -->
  9 + <TextView
  10 + android:layout_width="match_parent"
  11 + android:layout_height="match_parent"
  12 + android:text="@string/hello_blank_fragment" />
  13 +
  14 +</FrameLayout>
0 15 \ No newline at end of file
... ...
core/dentity_verfication/src/main/res/layout/fragment_person_check.xml 0 → 100644
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  3 + xmlns:tools="http://schemas.android.com/tools"
  4 + android:layout_width="match_parent"
  5 + android:layout_height="match_parent"
  6 + tools:context=".fragment.PersonCheckFragment">
  7 +
  8 + <com.qmuiteam.qmui.widget.QMUITopBar
  9 + android:id="@+id/topbar"
  10 + android:layout_width="match_parent"
  11 + android:layout_height="?attr/qmui_topbar_height" />
  12 +
  13 + <LinearLayout
  14 + android:id="@+id/check_ly"
  15 + android:layout_width="match_parent"
  16 + android:layout_height="wrap_content"
  17 + android:layout_centerInParent="true"
  18 + android:orientation="vertical">
  19 + <ImageView
  20 + android:id="@+id/check_img"
  21 + android:layout_width="wrap_content"
  22 + android:layout_height="wrap_content"
  23 + android:layout_gravity="center_horizontal"
  24 + android:src="@drawable/p_icon"/>
  25 +
  26 + <TextView
  27 + android:id="@+id/check_tx"
  28 + android:layout_width="wrap_content"
  29 + android:layout_height="wrap_content"
  30 + android:layout_gravity="center_horizontal"
  31 + android:layout_marginTop="20dp"
  32 + android:textColor="@color/color_999999"
  33 + android:textSize="15sp"
  34 + android:text="@string/no_check"/>
  35 +
  36 + <TextView
  37 + android:id="@+id/check_btn"
  38 + android:layout_width="match_parent"
  39 + android:layout_height="45dp"
  40 + android:text="@string/to_check"
  41 + android:layout_marginLeft="30dp"
  42 + android:layout_marginRight="30dp"
  43 + android:gravity="center"
  44 + android:textColor="@color/white"
  45 + android:textSize="18sp"
  46 + android:background="@drawable/bg_apply_btn"
  47 + android:layout_marginTop="50dp"/>
  48 + </LinearLayout>
  49 +
  50 +</RelativeLayout>
0 51 \ No newline at end of file
... ...
core/dentity_verfication/src/main/res/layout/fragment_take_identity_picture.xml 0 → 100644
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
  3 + xmlns:tools="http://schemas.android.com/tools"
  4 + android:layout_width="match_parent"
  5 + android:layout_height="match_parent"
  6 + tools:context=".fragment.TakeIdentityPictureFragment">
  7 +
  8 + <!-- TODO: Update blank fragment layout -->
  9 + <TextView
  10 + android:layout_width="match_parent"
  11 + android:layout_height="match_parent"
  12 + android:text="@string/hello_blank_fragment" />
  13 +
  14 +</FrameLayout>
0 15 \ No newline at end of file
... ...
core/dentity_verfication/src/main/res/values/strings.xml
... ... @@ -18,4 +18,11 @@
18 18 <string name="cancle">取消</string>
19 19 <string name="next">下一步</string>
20 20 <string name="change">更改</string>
  21 +
  22 + <!-- TODO: Remove or change this placeholder text -->
  23 + <string name="hello_blank_fragment">Hello blank fragment</string>
  24 + <string name="checking">请您耐心等待,后台正在提交审核中</string>
  25 + <string name="backs">返回</string>
  26 + <string name="no_check">亲,您未申请个人认证</string>
  27 + <string name="to_check">去认证</string>
21 28 </resources>
... ...