3.2.7人车认证优化
This commit is contained in:
parent
9345621309
commit
c39513ce13
@ -35,8 +35,8 @@ android {
|
||||
applicationId "com.arpa.hndahesudintocctmsdriver"
|
||||
minSdkVersion 23
|
||||
targetSdkVersion 30
|
||||
versionCode 54
|
||||
versionName "3.2.3"
|
||||
versionCode 57
|
||||
versionName "3.2.7"
|
||||
flavorDimensions "CHANNEL_VALUE"
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
javaCompileOptions {
|
||||
@ -112,9 +112,9 @@ android {
|
||||
|
||||
productFlavors {
|
||||
qa {
|
||||
manifestPlaceholders = [CHANNEL_VALUE: "大河好运司机"]
|
||||
manifestPlaceholders = [CHANNEL_VALUE: "好运司机测试"]
|
||||
buildConfigField("String", "OPEN_API_URL", "\"http://192.168.111.244:4009\"")
|
||||
buildConfigField("String", "BASE_URL", "\"http://app.dahehuoyun.com/api/\"")
|
||||
buildConfigField("String", "BASE_URL", "\"http://app.test.dahehuoyun.com/api/\"")
|
||||
}
|
||||
product {
|
||||
manifestPlaceholders = [CHANNEL_VALUE: "大河好运司机"]
|
||||
|
@ -341,6 +341,27 @@
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
|
||||
<activity
|
||||
android:name=".H5Activity"
|
||||
android:screenOrientation="portrait"
|
||||
android:launchMode="singleTask">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<category android:name="android.intent.category.BROWSABLE" />
|
||||
|
||||
<data
|
||||
android:host="demo"
|
||||
android:path="/signBack"
|
||||
android:scheme="esign" />
|
||||
<data
|
||||
android:host="demo"
|
||||
android:path="/realBack"
|
||||
android:scheme="esign" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
<service
|
||||
android:name="com.arpa.hndahesudintocctmsdriver.push.XService"
|
||||
android:enabled="true"
|
||||
|
@ -0,0 +1,496 @@
|
||||
package com.arpa.hndahesudintocctmsdriver;
|
||||
|
||||
import android.Manifest;
|
||||
import android.annotation.TargetApi;
|
||||
import android.app.Activity;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Bitmap;
|
||||
import android.net.Uri;
|
||||
import android.net.http.SslError;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.provider.MediaStore;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.View;
|
||||
import android.webkit.ConsoleMessage;
|
||||
import android.webkit.CookieManager;
|
||||
import android.webkit.CookieSyncManager;
|
||||
import android.webkit.JsPromptResult;
|
||||
import android.webkit.JsResult;
|
||||
import android.webkit.PermissionRequest;
|
||||
import android.webkit.SslErrorHandler;
|
||||
import android.webkit.ValueCallback;
|
||||
import android.webkit.WebChromeClient;
|
||||
import android.webkit.WebResourceError;
|
||||
import android.webkit.WebResourceRequest;
|
||||
import android.webkit.WebSettings;
|
||||
import android.webkit.WebView;
|
||||
import android.webkit.WebViewClient;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import com.arpa.hndahesudintocctmsdriver.cuspop.SimCenterPop;
|
||||
import com.arpa.hndahesudintocctmsdriver.event.FaceEvent;
|
||||
import com.arpa.hndahesudintocctmsdriver.event.HomeEvent;
|
||||
import com.arpa.hndahesudintocctmsdriver.ui.UiAuxiliary;
|
||||
import com.arpa.hndahesudintocctmsdriver.ui.auth.CertificatesActivity;
|
||||
import com.arpa.hndahesudintocctmsdriver.ui.home.StartYunDanActivity;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.MessageUtils;
|
||||
import com.dahe.mylibrary.utils.ToastUtils;
|
||||
import com.esign.esignsdk.EsignSdk;
|
||||
import com.esign.esignsdk.h5.base.WBH5FaceVerifySDK;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLDecoder;
|
||||
|
||||
import pub.devrel.easypermissions.EasyPermissions;
|
||||
|
||||
import static android.webkit.WebSettings.LOAD_NO_CACHE;
|
||||
|
||||
/**
|
||||
* @author xingtian on 2019/3/25
|
||||
*/
|
||||
public class H5Activity extends AppCompatActivity {
|
||||
|
||||
public static final int REQUEST_PERMISSION_STORAGE = 0x00;
|
||||
public static final int REQUEST_PERMISSION_CAMERA = 0x01;
|
||||
|
||||
public final static String SCHEMA_REAL = "esign://demo/realBack";
|
||||
|
||||
public final static String SCHEMA_SIGN = "esign://demo/signBack";
|
||||
|
||||
private WebView mWebView;
|
||||
|
||||
String curUrl = null;
|
||||
boolean viewFile = false;
|
||||
|
||||
long time = System.currentTimeMillis();
|
||||
|
||||
ValueCallback<Uri> uploadMessage;
|
||||
private ValueCallback<Uri[]> uploadMessageAboveL;
|
||||
private final static int FILE_CHOOSER_RESULT_CODE = 10000;
|
||||
|
||||
@Override
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
super.setContentView(R.layout.activity_h5);
|
||||
|
||||
|
||||
mWebView = findViewById(R.id.webview);
|
||||
ImageView back = findViewById(R.id.back);
|
||||
TextView close = findViewById(R.id.close);
|
||||
WebSettings webSetting = mWebView.getSettings();
|
||||
|
||||
back.setOnClickListener(v -> {
|
||||
if (mWebView.canGoBack()) {
|
||||
mWebView.goBack();
|
||||
} else {
|
||||
finish();
|
||||
}
|
||||
});
|
||||
|
||||
close.setOnClickListener(v -> {
|
||||
if (mWebView.canGoBack()) {
|
||||
mWebView.goBack();
|
||||
} else {
|
||||
finish();
|
||||
}
|
||||
});
|
||||
|
||||
webSetting.setJavaScriptEnabled(true);
|
||||
webSetting.setDomStorageEnabled(true);
|
||||
webSetting.setAppCacheMaxSize(1024 * 1024 * 8);
|
||||
webSetting.setUseWideViewPort(true);
|
||||
webSetting.setLoadWithOverviewMode(true);
|
||||
webSetting.setAllowFileAccess(true);
|
||||
webSetting.setAppCacheEnabled(true);
|
||||
String appCachePath = getApplication().getCacheDir().getAbsolutePath();
|
||||
webSetting.setAppCachePath(appCachePath);
|
||||
webSetting.setDatabaseEnabled(true);
|
||||
webSetting.setCacheMode(LOAD_NO_CACHE);
|
||||
webSetting.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.SINGLE_COLUMN);
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
|
||||
WebView.setWebContentsDebuggingEnabled(true);
|
||||
}
|
||||
|
||||
CookieSyncManager.createInstance(this);
|
||||
CookieManager cookieManager = CookieManager.getInstance();
|
||||
if (Build.VERSION.SDK_INT >= 21) {
|
||||
cookieManager.setAcceptThirdPartyCookies(mWebView, true);
|
||||
}
|
||||
cookieManager.setAcceptCookie(true);
|
||||
|
||||
|
||||
mWebView.setWebViewClient(new MyWebViewClient());
|
||||
mWebView.setWebChromeClient(new H5FaceWebChromeClient(this));
|
||||
|
||||
WBH5FaceVerifySDK.getInstance().setWebViewSettings(mWebView, getApplicationContext());
|
||||
|
||||
processExtraData();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPause() {
|
||||
super.onPause();
|
||||
mWebView.onPause();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
mWebView.onResume();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onStop() {
|
||||
super.onStop();
|
||||
mWebView.stopLoading();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
try {
|
||||
if (mWebView != null) {
|
||||
mWebView.removeAllViews();
|
||||
mWebView.destroy();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onNewIntent(Intent intent) {
|
||||
super.onNewIntent(intent);
|
||||
setIntent(intent);
|
||||
processExtraData();
|
||||
}
|
||||
|
||||
private void processExtraData() {
|
||||
|
||||
Intent intent = getIntent();
|
||||
Uri uri = intent.getData();
|
||||
Log.e("test", "===" + uri);
|
||||
if (uri != null) {
|
||||
// 芝麻认证刷脸结束返回获取后续操作页面地址
|
||||
// String callbackUrl = uri.getQueryParameter("callback");
|
||||
|
||||
String callbackUrl = uri.getQueryParameter("realnameUrl");
|
||||
if (!TextUtils.isEmpty(callbackUrl)) {
|
||||
try {
|
||||
mWebView.loadUrl(URLDecoder.decode(callbackUrl, "utf-8"));
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
String url = intent.getStringExtra("url");
|
||||
viewFile = intent.getBooleanExtra("view_file", false);
|
||||
if (url.startsWith("alipay")) {
|
||||
|
||||
try {
|
||||
Intent intent2 = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
|
||||
startActivity(intent2);
|
||||
return;
|
||||
} catch (Exception e) {
|
||||
}
|
||||
}
|
||||
if (curUrl == null) {
|
||||
curUrl = url;
|
||||
}
|
||||
mWebView.loadUrl(url);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private class MyWebViewClient extends WebViewClient {
|
||||
@Override
|
||||
public boolean shouldOverrideUrlLoading(WebView view, String url) {
|
||||
if (url == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Uri uri = Uri.parse(url);
|
||||
Log.e("test", "要加载的地址:" + uri.getScheme() + " " + url + " ");
|
||||
|
||||
|
||||
if (url.contains("callback")) {
|
||||
// 实名认证结束 返回按钮/倒计时返回/暂不认证
|
||||
boolean status = uri.getBooleanQueryParameter("passed", false);
|
||||
if (status) {
|
||||
|
||||
new Handler().postDelayed(() -> {
|
||||
FaceEvent he = new FaceEvent("刷脸成功");
|
||||
EventBus.getDefault().post(he);
|
||||
finish();
|
||||
}, 4000);
|
||||
}else{
|
||||
if (mWebView.canGoBack()) {
|
||||
mWebView.goBack();
|
||||
}
|
||||
Toast.makeText(H5Activity.this, "认证失败,请重新刷脸认证", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
if (uri.getScheme().equals("http") || uri.getScheme().equals("https")) {
|
||||
view.loadUrl(url);
|
||||
return true;
|
||||
} else if (uri.getScheme().equals("js") || uri.getScheme().equals("jsbridge")) {
|
||||
|
||||
// js://signCallback?signResult=true 签署结果
|
||||
if (uri.getAuthority().equals("signCallback")) {
|
||||
if (viewFile) {
|
||||
view.loadUrl(curUrl);
|
||||
return true;
|
||||
} else {
|
||||
if (url.contains("signResult")) {
|
||||
boolean signResult = uri.getBooleanQueryParameter("signResult", false);
|
||||
Toast.makeText(H5Activity.this, "签署结果: " + " signResult = " + signResult, Toast.LENGTH_LONG).show();
|
||||
} else {
|
||||
String tsignCode = uri.getQueryParameter("tsignCode");
|
||||
if ("0".equals(tsignCode)) {
|
||||
tsignCode = "签署成功";
|
||||
} else {
|
||||
tsignCode = "签署失败";
|
||||
}
|
||||
Toast.makeText(H5Activity.this, "签署结果: " + tsignCode, Toast.LENGTH_LONG).show();
|
||||
}
|
||||
}
|
||||
finish();
|
||||
}
|
||||
|
||||
//js://tsignRealBack?esignAppScheme=esign://app/callback&serviceId=854677892133554052&verifycode=4a52e2af0d0abfb7b285c4f05b5af133&status=true&passed=true
|
||||
//实名结果
|
||||
if (uri.getAuthority().equals("tsignRealBack")) {
|
||||
//实名结果字段
|
||||
if (uri.getQueryParameter("verifycode") != null) {
|
||||
String realVerifyCode = uri.getQueryParameter("verifycode");
|
||||
}
|
||||
// 实名认证结束 返回按钮/倒计时返回/暂不认证
|
||||
boolean status = uri.getBooleanQueryParameter("status", false);
|
||||
if (status) {
|
||||
//认证成功返回
|
||||
Toast.makeText(H5Activity.this, "认证成功", Toast.LENGTH_LONG).show();
|
||||
finish();
|
||||
}
|
||||
}
|
||||
return true;
|
||||
} else if (url.startsWith(SCHEMA_REAL)) {
|
||||
//esign://app/realBack&serviceId=854677892133554052&verifycode=4a52e2af0d0abfb7b285c4f05b5af133&status=true&passed=true
|
||||
|
||||
//实名结果
|
||||
if (uri.getQueryParameter("verifycode") != null) {
|
||||
String realVerifyCode = uri.getQueryParameter("verifycode");
|
||||
}
|
||||
// 实名认证结束 返回按钮/倒计时返回/暂不认证
|
||||
boolean status = uri.getBooleanQueryParameter("status", false);
|
||||
if (status) {
|
||||
//认证成功返回
|
||||
Toast.makeText(H5Activity.this, "认证成功", Toast.LENGTH_LONG).show();
|
||||
finish();
|
||||
}
|
||||
|
||||
return true;
|
||||
} else if (url.startsWith(SCHEMA_SIGN)) {
|
||||
// js://signCallback?signResult=true 签署结果
|
||||
if (url.contains("signResult")) {
|
||||
boolean signResult = uri.getBooleanQueryParameter("signResult", false);
|
||||
Toast.makeText(H5Activity.this, "签署结果: " + " signResult = " + signResult, Toast.LENGTH_LONG).show();
|
||||
} else {
|
||||
String tsignCode = uri.getQueryParameter("tsignCode");
|
||||
if ("0".equals(tsignCode)) {
|
||||
tsignCode = "签署成功";
|
||||
} else {
|
||||
tsignCode = "签署失败";
|
||||
}
|
||||
Toast.makeText(H5Activity.this, "签署结果: " + tsignCode, Toast.LENGTH_LONG).show();
|
||||
}
|
||||
finish();
|
||||
return true;
|
||||
} else if (uri.getScheme().equals("alipays")) {
|
||||
// 跳转到支付宝刷脸
|
||||
// alipays://platformapi/startapp?appId=20000067&pd=NO&url=https%3A%2F%2Fzmcustprod.zmxy.com.cn%2Fcertify%2Fbegin.htm%3Ftoken%3DZM201811133000000050500431389414
|
||||
try {
|
||||
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
|
||||
startActivity(intent);
|
||||
return true;
|
||||
} catch (Exception e) {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onReceivedError(WebView view, WebResourceRequest request, WebResourceError error) {
|
||||
super.onReceivedError(view, request, error);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error) {
|
||||
// super.onReceivedSslError(view, handler, error);
|
||||
handler.proceed();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPageStarted(WebView view, String url, Bitmap favicon) {
|
||||
super.onPageStarted(view, url, favicon);
|
||||
time = System.currentTimeMillis();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPageFinished(WebView view, String url) {
|
||||
super.onPageFinished(view, url);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadResource(WebView view, String url) {
|
||||
super.onLoadResource(view, url);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public class H5FaceWebChromeClient extends WebChromeClient {
|
||||
private Activity activity;
|
||||
|
||||
public H5FaceWebChromeClient(Activity mActivity) {
|
||||
this.activity = mActivity;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onReceivedTitle(WebView view, String title) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onJsPrompt(WebView view, String url, String message, String defaultValue, JsPromptResult result) {
|
||||
return super.onJsPrompt(view, url, message, defaultValue, result);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onJsConfirm(WebView view, String url, String message, JsResult result) {
|
||||
return super.onJsConfirm(view, url, message, result);
|
||||
}
|
||||
|
||||
@TargetApi(8)
|
||||
@Override
|
||||
public boolean onConsoleMessage(ConsoleMessage consoleMessage) {
|
||||
return super.onConsoleMessage(consoleMessage);
|
||||
}
|
||||
|
||||
public void openFileChooser(ValueCallback<Uri> uploadMsg, String acceptType) {
|
||||
if (WBH5FaceVerifySDK.getInstance().recordVideoForApiBelow21(uploadMsg, acceptType, activity)) {
|
||||
return;
|
||||
}
|
||||
uploadMessage = uploadMsg;
|
||||
}
|
||||
|
||||
public void openFileChooser(ValueCallback<Uri> uploadMsg, String acceptType, String capture) {
|
||||
if (WBH5FaceVerifySDK.getInstance().recordVideoForApiBelow21(uploadMsg, acceptType, activity)) {
|
||||
return;
|
||||
}
|
||||
uploadMessage = uploadMessage;
|
||||
}
|
||||
|
||||
@TargetApi(21)
|
||||
@Override
|
||||
public boolean onShowFileChooser(WebView webView, ValueCallback<Uri[]> filePathCallback, FileChooserParams fileChooserParams) {
|
||||
if (WBH5FaceVerifySDK.getInstance().recordVideoForApi21(webView, filePathCallback, activity, fileChooserParams)) {
|
||||
return true;
|
||||
}
|
||||
uploadMessageAboveL = filePathCallback;
|
||||
recordVideo(H5Activity.this);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPermissionRequest(PermissionRequest request) {
|
||||
request.grant(request.getResources());
|
||||
request.getOrigin();
|
||||
}
|
||||
}
|
||||
|
||||
public void recordVideo(Activity activity) {
|
||||
if (EasyPermissions.hasPermissions(activity, Manifest.permission.CAMERA)) {
|
||||
try {
|
||||
Intent intent = new Intent(MediaStore.ACTION_VIDEO_CAPTURE);
|
||||
intent.putExtra(MediaStore.EXTRA_VIDEO_QUALITY, 1);
|
||||
intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
|
||||
intent.putExtra("android.intent.extras.CAMERA_FACING", 1); // 调用前置摄像头
|
||||
activity.startActivityForResult(intent, FILE_CHOOSER_RESULT_CODE);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
} else {
|
||||
EasyPermissions.requestPermissions(activity, "请同意使用相机功能", REQUEST_PERMISSION_CAMERA, Manifest.permission.CAMERA);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onKeyDown(int keyCode, KeyEvent event) {
|
||||
if (keyCode == KeyEvent.KEYCODE_BACK) {
|
||||
if (mWebView.canGoBack()) {
|
||||
mWebView.goBack();
|
||||
} else {
|
||||
finish();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return super.onKeyDown(keyCode, event);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
|
||||
if (WBH5FaceVerifySDK.getInstance().receiveH5FaceVerifyResult(requestCode, resultCode, data)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (requestCode == FILE_CHOOSER_RESULT_CODE) {
|
||||
if (null == uploadMessage && null == uploadMessageAboveL) {
|
||||
return;
|
||||
}
|
||||
Uri result = data == null || resultCode != RESULT_OK ? null : data.getData();
|
||||
if (uploadMessageAboveL != null) {
|
||||
if (resultCode == RESULT_OK) {
|
||||
uploadMessageAboveL.onReceiveValue(new Uri[]{result});
|
||||
uploadMessageAboveL = null;
|
||||
} else {
|
||||
uploadMessageAboveL.onReceiveValue(new Uri[]{});
|
||||
uploadMessageAboveL = null;
|
||||
}
|
||||
} else if (uploadMessage != null) {
|
||||
if (resultCode == RESULT_OK) {
|
||||
uploadMessage.onReceiveValue(result);
|
||||
uploadMessage = null;
|
||||
} else {
|
||||
uploadMessage.onReceiveValue(Uri.EMPTY);
|
||||
uploadMessage = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
|
||||
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
|
||||
WBH5FaceVerifySDK.getInstance().recordVideo(this);
|
||||
}
|
||||
}
|
@ -77,6 +77,15 @@ public class CarDelBean {
|
||||
private String registerNo;
|
||||
private String carEnergyTypValue;
|
||||
private String carPlateColorValue;
|
||||
private String needUpQCPhoto;
|
||||
|
||||
public String getNeedUpQCPhoto() {
|
||||
return needUpQCPhoto;
|
||||
}
|
||||
|
||||
public void setNeedUpQCPhoto(String needUpQCPhoto) {
|
||||
this.needUpQCPhoto = needUpQCPhoto;
|
||||
}
|
||||
|
||||
public String getCarPlateColorValue() {
|
||||
return carPlateColorValue;
|
||||
|
@ -0,0 +1,150 @@
|
||||
package com.arpa.hndahesudintocctmsdriver.bean;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName CarInfoBean
|
||||
* @Author 用户
|
||||
* @Date 2023/8/17 15:35
|
||||
* @Description TODO
|
||||
*/
|
||||
public class CarInfoBean {
|
||||
|
||||
|
||||
private int code;
|
||||
private DataDTO data;
|
||||
private String msg;
|
||||
private int res;
|
||||
private Boolean success;
|
||||
|
||||
public int getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public void setCode(int code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public DataDTO getData() {
|
||||
return data;
|
||||
}
|
||||
|
||||
public void setData(DataDTO data) {
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
public String getMsg() {
|
||||
return msg;
|
||||
}
|
||||
|
||||
public void setMsg(String msg) {
|
||||
this.msg = msg;
|
||||
}
|
||||
|
||||
public int getRes() {
|
||||
return res;
|
||||
}
|
||||
|
||||
public void setRes(int res) {
|
||||
this.res = res;
|
||||
}
|
||||
|
||||
public Boolean getSuccess() {
|
||||
return success;
|
||||
}
|
||||
|
||||
public void setSuccess(Boolean success) {
|
||||
this.success = success;
|
||||
}
|
||||
|
||||
public static class DataDTO {
|
||||
private Object code;
|
||||
private DataDTO.DataDTO2 data;
|
||||
private Object message;
|
||||
private String forceMatching;
|
||||
|
||||
|
||||
public String getForceMatching() {
|
||||
return forceMatching;
|
||||
}
|
||||
|
||||
public void setForceMatching(String forceMatching) {
|
||||
this.forceMatching = forceMatching;
|
||||
}
|
||||
|
||||
public Object getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public void setCode(Object code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public DataDTO2 getData() {
|
||||
return data;
|
||||
}
|
||||
|
||||
public void setData(DataDTO2 data) {
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
public Object getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
public void setMessage(Object message) {
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
public static class DataDTO2 {
|
||||
private List<DataDTO.DataDTO2.PrismKeyValueInfoDTO> prism_keyValueInfo;
|
||||
|
||||
public List<DataDTO.DataDTO2.PrismKeyValueInfoDTO> getPrism_keyValueInfo() {
|
||||
return prism_keyValueInfo;
|
||||
}
|
||||
|
||||
public void setPrism_keyValueInfo(List<DataDTO.DataDTO2.PrismKeyValueInfoDTO> prism_keyValueInfo) {
|
||||
this.prism_keyValueInfo = prism_keyValueInfo;
|
||||
}
|
||||
|
||||
public static class PrismKeyValueInfoDTO {
|
||||
private int keyProb;
|
||||
private int valueProb;
|
||||
private String value;
|
||||
private String key;
|
||||
|
||||
public int getKeyProb() {
|
||||
return keyProb;
|
||||
}
|
||||
|
||||
public void setKeyProb(int keyProb) {
|
||||
this.keyProb = keyProb;
|
||||
}
|
||||
|
||||
public int getValueProb() {
|
||||
return valueProb;
|
||||
}
|
||||
|
||||
public void setValueProb(int valueProb) {
|
||||
this.valueProb = valueProb;
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public void setValue(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public String getKey() {
|
||||
return key;
|
||||
}
|
||||
|
||||
public void setKey(String key) {
|
||||
this.key = key;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -56,6 +56,33 @@ public class CarZhengBean {
|
||||
|
||||
public static class DataDTO {
|
||||
private int carId;
|
||||
private String needUpQCPhoto;
|
||||
private String isTrailer;
|
||||
private String needUpRLPhoto;
|
||||
|
||||
public String getNeedUpRLPhoto() {
|
||||
return needUpRLPhoto;
|
||||
}
|
||||
|
||||
public void setNeedUpRLPhoto(String needUpRLPhoto) {
|
||||
this.needUpRLPhoto = needUpRLPhoto;
|
||||
}
|
||||
|
||||
public String getIsTrailer() {
|
||||
return isTrailer;
|
||||
}
|
||||
|
||||
public void setIsTrailer(String isTrailer) {
|
||||
this.isTrailer = isTrailer;
|
||||
}
|
||||
|
||||
public String getNeedUpQCPhoto() {
|
||||
return needUpQCPhoto;
|
||||
}
|
||||
|
||||
public void setNeedUpQCPhoto(String needUpQCPhoto) {
|
||||
this.needUpQCPhoto = needUpQCPhoto;
|
||||
}
|
||||
|
||||
public int getCarId() {
|
||||
return carId;
|
||||
|
@ -22,11 +22,17 @@ import kotlinx.android.synthetic.main.pop_message_center.view.*
|
||||
class MessagePop(context: Context) : CenterPopupView(context), View.OnClickListener {
|
||||
|
||||
lateinit var content :String
|
||||
var secMessage :String? = ""
|
||||
|
||||
constructor(context: Context,message : String) :this(context) {
|
||||
content = message
|
||||
}
|
||||
|
||||
constructor(context: Context,message : String,message2 : String) :this(context) {
|
||||
content = message
|
||||
secMessage = message2
|
||||
}
|
||||
|
||||
override fun getImplLayoutId() = R.layout.pop_message_center
|
||||
|
||||
override fun onCreate() {
|
||||
@ -35,6 +41,7 @@ class MessagePop(context: Context) : CenterPopupView(context), View.OnClickListe
|
||||
tvOk.setOnClickListener(this)
|
||||
tvPhone.setOnClickListener(this)
|
||||
tvContent.text = "$content"
|
||||
tvMessage2.text =secMessage
|
||||
}
|
||||
|
||||
override fun onClick(v: View?) {
|
||||
|
@ -0,0 +1,60 @@
|
||||
package com.arpa.hndahesudintocctmsdriver.cuspop
|
||||
|
||||
import android.content.Context
|
||||
import android.view.View
|
||||
import com.arpa.hndahesudintocctmsdriver.R
|
||||
import com.arpa.hndahesudintocctmsdriver.ui.auth.CertificatesActivity
|
||||
import com.lxj.xpopup.core.CenterPopupView
|
||||
import kotlinx.android.synthetic.main.pop_sim_center.view.*
|
||||
|
||||
|
||||
/**
|
||||
* @ClassName MessagePop
|
||||
* @Author 用户
|
||||
* @Date 2023/8/14 18:01
|
||||
* @Description TODO
|
||||
*/
|
||||
class SimCenterPop(context: Context) : CenterPopupView(context), View.OnClickListener {
|
||||
|
||||
lateinit var content: String
|
||||
lateinit var secMessage: String
|
||||
|
||||
constructor(context: Context, message: String) : this(context) {
|
||||
content = message
|
||||
}
|
||||
|
||||
|
||||
override fun getImplLayoutId() = R.layout.pop_sim_center
|
||||
|
||||
override fun onCreate() {
|
||||
super.onCreate()
|
||||
tvCancel.setOnClickListener(this)
|
||||
tvOk.setOnClickListener(this)
|
||||
tvContent.text = "$content"
|
||||
|
||||
}
|
||||
|
||||
override fun onClick(v: View?) {
|
||||
when (v?.id) {
|
||||
R.id.tvCancel -> {
|
||||
dismiss()
|
||||
}
|
||||
R.id.tvOk -> {
|
||||
dismiss()
|
||||
listener?.onItemClick()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private var listener: OnMyItemClickListener? = null
|
||||
fun setOnMyItemClickListener(listener: OnMyItemClickListener): SimCenterPop {
|
||||
this.listener = listener
|
||||
return this
|
||||
}
|
||||
|
||||
interface OnMyItemClickListener {
|
||||
fun onItemClick()
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
package com.arpa.hndahesudintocctmsdriver.event;
|
||||
|
||||
/**
|
||||
* @author hlh
|
||||
* @version 1.0.0
|
||||
* @date 2021/10/20 14:43
|
||||
* @description:
|
||||
*/
|
||||
public class FaceEvent {
|
||||
|
||||
private String message;
|
||||
|
||||
public FaceEvent(String message) {
|
||||
this.message = message;
|
||||
}
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
public void setMessage(String message) {
|
||||
this.message = message;
|
||||
}
|
||||
}
|
@ -59,4 +59,9 @@ public class OCRRequest {
|
||||
RequestUtil.start(12, "carName",re,con,hd);
|
||||
}
|
||||
|
||||
|
||||
public void OCRCarPlateLicense(Context con, Handler hd, File file){
|
||||
Request re = OkHttpUtil.postFile(new OkDate(RequestConstant.getPlateLicense2()),getToken(con),file);
|
||||
RequestUtil.start(12, "carNum",re,con,hd);
|
||||
}
|
||||
}
|
||||
|
@ -1,10 +1,12 @@
|
||||
package com.arpa.hndahesudintocctmsdriver.request;
|
||||
|
||||
import com.arpa.hndahesudintocctmsdriver.BuildConfig;
|
||||
|
||||
public class RequestConstant {
|
||||
|
||||
public static String TOKEN="eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE2MzA0MDE3OTIsInVzZXJJZCI6ODAsImlhdCI6MTYyNzcyMzM5Mn0.f9Q-UZVduW6nt1s0L-3vYsrOJJ8iuSCSlJ9uu8yIxBI";
|
||||
//域名地址http://request.one-clouds.com/api https://huoyun.mzxd56.com/api http://app.dahehuoyun.com/api
|
||||
public static String BASE_URL ="http://app.dahehuoyun.com/api";
|
||||
public static String BASE_URL = BuildConfig.BASE_URL;
|
||||
//版本更新/app/check/version
|
||||
public static String VERSION ="/app/check/version";
|
||||
//全部代码
|
||||
@ -133,6 +135,9 @@ public class RequestConstant {
|
||||
//车牌号
|
||||
private static final String PLATE_LICENSE="/common/ocr/plateLicense";
|
||||
|
||||
//车牌号2
|
||||
private static final String PLATE_LICENSE2="/common/aliyun/ocr/RecognizeCarNumber";
|
||||
|
||||
//添加挂车
|
||||
private static final String SAVE_DRAW_CAR="/app/carDriver/saveDrawCar";
|
||||
//提现记录
|
||||
@ -390,6 +395,10 @@ public class RequestConstant {
|
||||
return BASE_URL+PLATE_LICENSE;
|
||||
}
|
||||
|
||||
public static String getPlateLicense2() {
|
||||
return BASE_URL+PLATE_LICENSE2;
|
||||
}
|
||||
|
||||
public static String getGetImage() {
|
||||
return BASE_URL+GET_IMAGE;
|
||||
}
|
||||
|
@ -23,8 +23,8 @@ public interface Api {
|
||||
//获取版本
|
||||
String VERSION = BASE_URL + "app/version";
|
||||
|
||||
@POST(BASE_URL+"/common/register")
|
||||
Observable<CommonResponseBean> log(@Body LoginRegInputBean bean);
|
||||
// @POST(BASE_URL+"/common/register")
|
||||
// Observable<CommonResponseBean> log(@Body LoginRegInputBean bean);
|
||||
|
||||
}
|
||||
|
||||
|
@ -23,6 +23,7 @@ import com.arpa.hndahesudintocctmsdriver.util.view.PanDuanUtil
|
||||
import com.google.gson.Gson
|
||||
import com.gyf.cactus.ext.cactusUpdateNotification
|
||||
import com.permissionx.guolindev.PermissionX
|
||||
|
||||
@Suppress("DIVISION_BY_ZERO")
|
||||
@SuppressLint("SetTextI18n")
|
||||
class MainActivity : BaseAppCompatActivity() {
|
||||
@ -40,7 +41,8 @@ class MainActivity : BaseAppCompatActivity() {
|
||||
1 -> {
|
||||
isExit = false;
|
||||
}
|
||||
RequsetCodeConstants.SUCCESS -> {}
|
||||
RequsetCodeConstants.SUCCESS -> {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -134,6 +136,9 @@ class MainActivity : BaseAppCompatActivity() {
|
||||
.permissions(Manifest.permission.ACCESS_FINE_LOCATION,
|
||||
Manifest.permission.ACCESS_COARSE_LOCATION,
|
||||
Manifest.permission.ACCESS_BACKGROUND_LOCATION,
|
||||
Manifest.permission.WRITE_EXTERNAL_STORAGE,
|
||||
Manifest.permission.READ_EXTERNAL_STORAGE,
|
||||
Manifest.permission.RECORD_AUDIO,
|
||||
Manifest.permission.CAMERA)
|
||||
.request { allGranted, grantedList, deniedList ->
|
||||
if (allGranted) {
|
||||
|
@ -60,7 +60,7 @@ public class AuthQualificationActivity extends BaseAppCompatActivity {
|
||||
private RelativeLayout up_img, cow1;
|
||||
private LinearLayout data_view;
|
||||
private ImageView img;
|
||||
private TextView zjimg_name, upload_img, name2, title1, title2, tvSkip,tvTips;
|
||||
private TextView zjimg_name, upload_img, name2, title1, title2, tvSkip, tvTips;
|
||||
private View vs;
|
||||
private EditText value1;
|
||||
private Button submit;
|
||||
@ -101,16 +101,32 @@ public class AuthQualificationActivity extends BaseAppCompatActivity {
|
||||
BaseBean bb = gson.fromJson(CacheGroup.cacheList.get("driverAuthQualification"), BaseBean.class);
|
||||
if (bb.getCode() == 200) {
|
||||
// initAuth();
|
||||
//从业资格证->实名认证
|
||||
// finish();
|
||||
if (key) {
|
||||
key = false;
|
||||
new AuthRequest().getAuthUrl(con, hd);
|
||||
new Handler().postDelayed(() -> {
|
||||
key = true;
|
||||
}, 3000);
|
||||
//判断是否从车辆进来 carId为空从个人认证进来需跳转实名认证,不为空车辆信息进入,需跳转车辆照片
|
||||
if (TextUtils.isEmpty(carId)) {
|
||||
//从业资格证->实名认证
|
||||
if (key) {
|
||||
key = false;
|
||||
new AuthRequest().getAuthUrl(con, hd);
|
||||
new Handler().postDelayed(() -> {
|
||||
key = true;
|
||||
}, 3000);
|
||||
}
|
||||
} else {
|
||||
finish();
|
||||
if (isOverCar){//从业资格证=》道路运输许可证
|
||||
Intent in = new Intent(con, PhotoCarActivity.class);
|
||||
in.putExtra("type", 3);
|
||||
in.putExtra("carId", carId);
|
||||
startActivity(in);
|
||||
}else{//资料传完 补传情况
|
||||
Intent in = new Intent(con, AddCarSuccActivity.class);
|
||||
in.putExtra("type", 3);
|
||||
con.startActivity(in);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Toast.makeText(con, "资格证上传成功", Toast.LENGTH_SHORT).show();
|
||||
} else {
|
||||
Toast.makeText(con, bb.getMsg(), Toast.LENGTH_SHORT).show();
|
||||
@ -136,7 +152,7 @@ public class AuthQualificationActivity extends BaseAppCompatActivity {
|
||||
Log.e("url", CacheGroup.cacheList.get("authUrl"));
|
||||
BaseBean bb = gson.fromJson(CacheGroup.cacheList.get("authUrl"), BaseBean.class);
|
||||
if (bb.getCode() == 200) {
|
||||
finish();
|
||||
// finish();
|
||||
EsignSdk.getInstance().startH5Activity(act, StringUtil.isNull(String.valueOf(bb.getData()), ""));
|
||||
} else {
|
||||
Toast.makeText(con, bb.getMsg(), Toast.LENGTH_LONG).show();
|
||||
@ -154,6 +170,8 @@ public class AuthQualificationActivity extends BaseAppCompatActivity {
|
||||
}
|
||||
|
||||
private String type = "0";
|
||||
private String carId = "";
|
||||
private boolean isOverCar = false;
|
||||
private UserBean userBean;
|
||||
|
||||
@Override
|
||||
@ -162,7 +180,7 @@ public class AuthQualificationActivity extends BaseAppCompatActivity {
|
||||
StateStyleUtil.stateTextColor(this);
|
||||
setContentView(R.layout.activity_auth_qualification);
|
||||
con = this;
|
||||
act=this;
|
||||
act = this;
|
||||
img = findViewById(R.id.img);
|
||||
zjimg_name = findViewById(R.id.zjimg_name);
|
||||
upload_img = findViewById(R.id.upload_img);
|
||||
@ -179,6 +197,8 @@ public class AuthQualificationActivity extends BaseAppCompatActivity {
|
||||
vs = findViewById(R.id.vs);
|
||||
data_view = findViewById(R.id.data_view);
|
||||
type = getIntent().getExtras().getString("type");
|
||||
carId = getIntent().getExtras().getString("carId", "");
|
||||
isOverCar = getIntent().getExtras().getBoolean("isOverCar",false);
|
||||
ur = new UserRequset(con, hd);
|
||||
initView(null);
|
||||
if ("0".equals(type)) {
|
||||
@ -190,6 +210,11 @@ public class AuthQualificationActivity extends BaseAppCompatActivity {
|
||||
}
|
||||
//new RZRequest().isDriverAuthQualification(con,hd);
|
||||
}
|
||||
if (TextUtils.isEmpty(carId)){//carId不为空 从添加车辆进入 该操作不能跳过
|
||||
tvSkip.setVisibility(View.VISIBLE);
|
||||
}else{
|
||||
tvSkip.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
|
||||
private boolean key = true;
|
||||
@ -206,7 +231,7 @@ public class AuthQualificationActivity extends BaseAppCompatActivity {
|
||||
});
|
||||
img.setOnClickListener(v -> {
|
||||
if (!"".equals(url)) {
|
||||
new XPopup.Builder(con).asImageViewer(img, url,new SmartGlideImageLoader(R.mipmap.ic_launcher_round)).show();
|
||||
new XPopup.Builder(con).asImageViewer(img, url, new SmartGlideImageLoader(R.mipmap.ic_launcher_round)).show();
|
||||
// new XPopup.Builder(con)
|
||||
// .asImageViewer(img, url, true, -1, -1, 50, false, new CertificatesActivity.ImageLoader())
|
||||
// .show();
|
||||
@ -259,6 +284,9 @@ public class AuthQualificationActivity extends BaseAppCompatActivity {
|
||||
});
|
||||
|
||||
tvSkip.setOnClickListener(v -> {
|
||||
|
||||
|
||||
|
||||
if (type.equals("0")) {
|
||||
// finish();
|
||||
if (key) {
|
||||
@ -292,7 +320,7 @@ public class AuthQualificationActivity extends BaseAppCompatActivity {
|
||||
zjimg_name.setText("党员证照片");
|
||||
data_view.setVisibility(View.GONE);
|
||||
title2.setVisibility(View.GONE);
|
||||
}else{
|
||||
} else {
|
||||
tvTips.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
|
@ -4,6 +4,7 @@ import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Message;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
@ -20,17 +21,24 @@ import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.cardview.widget.CardView;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.arpa.hndahesudintocctmsdriver.bean.DicBean;
|
||||
import com.arpa.hndahesudintocctmsdriver.bean.SinglePickBean;
|
||||
import com.arpa.hndahesudintocctmsdriver.cuspop.SimCenterPop;
|
||||
import com.arpa.hndahesudintocctmsdriver.event.HomeEvent;
|
||||
import com.arpa.hndahesudintocctmsdriver.event.PersonEvent;
|
||||
import com.arpa.hndahesudintocctmsdriver.event.VehicleEvent;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.MessageUtils;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.PickerUtils;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.alert.ToastUtil;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.map.MapUtil;
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.bumptech.glide.request.RequestOptions;
|
||||
import com.bumptech.glide.request.target.Target;
|
||||
import com.dahe.mylibrary.utils.ActivityUtils;
|
||||
import com.esign.esignsdk.EsignSdk;
|
||||
import com.esign.esignsdk.data.AuthEvent;
|
||||
import com.github.gzuliyujiang.wheelpicker.contract.OnOptionPickedListener;
|
||||
import com.google.gson.Gson;
|
||||
import com.luck.picture.lib.PictureSelector;
|
||||
@ -71,6 +79,7 @@ import com.lxj.xpopup.photoview.PhotoView;
|
||||
import com.lxj.xpopup.util.SmartGlideImageLoader;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
@ -100,14 +109,14 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
||||
private int[] typeImgOne = {R.mipmap.id, R.mipmap.license, R.mipmap.vehicle_license, R.mipmap.vehicle_license};
|
||||
private int[] typeImgTwo = {R.mipmap.id_back, R.mipmap.license_back, R.mipmap.vehicle_license_back, R.mipmap.vehicle_license_back};
|
||||
private int index = 0;
|
||||
private DicBean.DataDTO curColor,curEnergy;
|
||||
private DicBean.DataDTO curColor, curEnergy;
|
||||
private TextView zj_name, zjimg_name, zjimg2_name, zj_name2, zj_name3;
|
||||
private TextView name1, name2, name3, name4, value5, value6;
|
||||
private EditText value1, value2, value3, value4,value7;
|
||||
private EditText value1, value2, value3, value4, value7;
|
||||
private Button submit;
|
||||
private ImageView img1, img2, img3, type_img;
|
||||
private TextView u_img, u_img2, u_img3;
|
||||
private LinearLayout llColor, llType,llCarName;
|
||||
private LinearLayout llColor, llType, llCarName;
|
||||
private CardView there_div;
|
||||
private BaseRecyclerView brv;
|
||||
//
|
||||
@ -122,6 +131,7 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
||||
private String url2 = "";
|
||||
private String url3 = "";
|
||||
private boolean[] keys = {false, false, false};
|
||||
private boolean key = true;
|
||||
|
||||
public void FalseKeys() {
|
||||
for (int i = 0; i < keys.length; i++) {
|
||||
@ -144,7 +154,8 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
||||
break;
|
||||
case RequsetCodeConstants.SUCCESS:
|
||||
if (CacheGroup.cacheList.get("driverAuthIdCard") != null || CacheGroup.cacheList.get("driverAuthLicense") != null
|
||||
|| CacheGroup.cacheList.get("saveVehicleLicense") != null || CacheGroup.cacheList.get("saveDrawCar") != null) {
|
||||
|| CacheGroup.cacheList.get("saveVehicleLicense") != null || CacheGroup.cacheList.get("authUrl") != null
|
||||
|| CacheGroup.cacheList.get("saveDrawCar") != null) {
|
||||
if (CacheGroup.cacheList.get("driverAuthIdCard") != null) {
|
||||
BaseBean bb = gson.fromJson(CacheGroup.cacheList.get("driverAuthIdCard"), BaseBean.class);
|
||||
if (bb.getCode() == 200) {
|
||||
@ -166,12 +177,16 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
||||
BaseBean bb = gson.fromJson(CacheGroup.cacheList.get("driverAuthLicense"), BaseBean.class);
|
||||
if (bb.getCode() == 200) {
|
||||
Toast.makeText(con, "保存成功", Toast.LENGTH_SHORT).show();
|
||||
finish();
|
||||
|
||||
//上传驾驶证信息页面 跳转资格证信息页面
|
||||
Intent in = new Intent(con, AuthQualificationActivity.class);
|
||||
in.putExtra("type", "0");
|
||||
startActivity(in);
|
||||
//上传驾驶证信息页面 进行实名认证操作
|
||||
if (key) {
|
||||
key = false;
|
||||
new AuthRequest().getAuthUrl(con, hd);
|
||||
new Handler().postDelayed(() -> {
|
||||
key = true;
|
||||
}, 3000);
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
Toast.makeText(con, bb.getMsg(), Toast.LENGTH_SHORT).show();
|
||||
@ -179,19 +194,69 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
||||
CacheGroup.cacheList.remove("driverAuthLicense");
|
||||
}
|
||||
|
||||
if (CacheGroup.cacheList.get("authUrl") != null) {
|
||||
Log.e("url", CacheGroup.cacheList.get("authUrl"));
|
||||
BaseBean bb = gson.fromJson(CacheGroup.cacheList.get("authUrl"), BaseBean.class);
|
||||
if (bb.getCode() == 200) {
|
||||
EsignSdk.getInstance().startH5Activity(act, StringUtil.isNull(String.valueOf(bb.getData()), ""));
|
||||
} else {
|
||||
Toast.makeText(con, bb.getMsg(), Toast.LENGTH_LONG).show();
|
||||
}//Log.e("url",CacheGroup.cacheList.get("authUrl"));
|
||||
CacheGroup.cacheList.remove("authUrl");
|
||||
}
|
||||
|
||||
if (CacheGroup.cacheList.get("saveVehicleLicense") != null) {
|
||||
CarZhengBean czb = gson.fromJson(CacheGroup.cacheList.get("saveVehicleLicense"), CarZhengBean.class);
|
||||
if (czb.getCode() == 200) {
|
||||
String needUpQCPhoto = czb.getData().getNeedUpQCPhoto();//是否需要上传从业资格证
|
||||
String isTrailer = czb.getData().getIsTrailer();//是否需要上传挂车
|
||||
String needUpRLPhoto = czb.getData().getNeedUpRLPhoto();//是否需要上传道路运输证到
|
||||
Toast.makeText(con, "车辆行驶证保存成功", Toast.LENGTH_SHORT).show();
|
||||
finish();
|
||||
|
||||
VehicleEvent ve = new VehicleEvent(String.valueOf(czb.getData().getCarId()));
|
||||
EventBus.getDefault().post(ve);
|
||||
|
||||
//上传行驶证信息后 跳转车辆照片页面
|
||||
Intent in = new Intent(con, PhotoCarActivity.class);
|
||||
in.putExtra("type", 0);
|
||||
in.putExtra("carId", String.valueOf(czb.getData().getCarId()));
|
||||
con.startActivity(in);
|
||||
// TODO: 2023/8/23
|
||||
if ("1".equals(isTrailer)) {//判断是否跳转挂车行驶证
|
||||
Intent in = new Intent(con, CertificatesActivity.class);
|
||||
in.putExtra("index", 3);
|
||||
in.putExtra("carId", String.valueOf(czb.getData().getCarId()));
|
||||
startActivity(in);
|
||||
} else if ("1".equals(needUpQCPhoto)) {//判断是否跳转从业资格证
|
||||
Intent in = new Intent(con, AuthQualificationActivity.class);
|
||||
in.putExtra("type", "0");
|
||||
in.putExtra("isOverCar", true);
|
||||
in.putExtra("carId", String.valueOf(czb.getData().getCarId()));
|
||||
startActivity(in);
|
||||
} else if ("1".equals(needUpRLPhoto)) {//判断是否跳转道路运输许可证
|
||||
Intent in = new Intent(con, PhotoCarActivity.class);
|
||||
in.putExtra("type", 3);
|
||||
in.putExtra("carId", String.valueOf(czb.getData().getCarId()));
|
||||
startActivity(in);
|
||||
} else {
|
||||
//跳转成功页面
|
||||
Intent in = new Intent(con, AddCarSuccActivity.class);
|
||||
in.putExtra("type", 3);
|
||||
in.putExtra("carId", String.valueOf(czb.getData().getCarId()));
|
||||
con.startActivity(in);
|
||||
}
|
||||
finish();
|
||||
// if ("1".equals(needUpQCPhoto)) {
|
||||
// //现逻辑:上传行驶证信息后 判断是否跳转从业资格证
|
||||
// Intent in = new Intent(con, AuthQualificationActivity.class);
|
||||
// in.putExtra("type", "0");
|
||||
// in.putExtra("isOverCar", false);
|
||||
// in.putExtra("carId", String.valueOf(czb.getData().getCarId()));
|
||||
// startActivity(in);
|
||||
// } else {
|
||||
// //原逻辑:上传行驶证信息后 跳转车辆照片页面
|
||||
// Intent in = new Intent(con, PhotoCarActivity.class);
|
||||
// in.putExtra("type", 0);
|
||||
// in.putExtra("carId", String.valueOf(czb.getData().getCarId()));
|
||||
// con.startActivity(in);
|
||||
// }
|
||||
|
||||
|
||||
} else {
|
||||
Toast.makeText(con, czb.getMsg(), Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
@ -199,20 +264,34 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
||||
}
|
||||
if (CacheGroup.cacheList.get("saveDrawCar") != null) {
|
||||
Log.e("-saveDrawCar-", CacheGroup.cacheList.get("saveDrawCar"));
|
||||
BaseBean bb = gson.fromJson(CacheGroup.cacheList.get("saveDrawCar"), BaseBean.class);
|
||||
CarZhengBean bb = gson.fromJson(CacheGroup.cacheList.get("saveDrawCar"), CarZhengBean.class);
|
||||
if (bb.getCode() == 200) {
|
||||
String needUpQCPhoto = bb.getData().getNeedUpQCPhoto();
|
||||
String needUpRLPhoto = bb.getData().getNeedUpRLPhoto();//是否需要上传道路运输证到
|
||||
Toast.makeText(con, "挂车信息保存成功", Toast.LENGTH_SHORT).show();
|
||||
finish();
|
||||
VehicleEvent ve = new VehicleEvent("挂");
|
||||
EventBus.getDefault().post(ve);
|
||||
|
||||
//挂车信息保存成功跳转成功页面
|
||||
Intent in = new Intent(con, AddCarSuccActivity.class);
|
||||
in.putExtra("type", 3);
|
||||
in.putExtra("carId", carId);
|
||||
con.startActivity(in);
|
||||
|
||||
|
||||
if ("1".equals(needUpQCPhoto)) {
|
||||
//现逻辑:上传挂车保信息后 判断是否跳转从业资格证
|
||||
Intent in = new Intent(con, AuthQualificationActivity.class);
|
||||
in.putExtra("type", "0");
|
||||
in.putExtra("carId", carId);
|
||||
in.putExtra("isOverCar", true);
|
||||
startActivity(in);
|
||||
} else if ("1".equals(needUpRLPhoto)) {//现判断是否跳转道路运输许可证
|
||||
Intent in = new Intent(con, PhotoCarActivity.class);
|
||||
in.putExtra("type", 3);
|
||||
in.putExtra("carId", carId);
|
||||
startActivity(in);
|
||||
} else {
|
||||
//原逻辑:挂车信息保存成功跳转成功页面
|
||||
Intent in = new Intent(con, AddCarSuccActivity.class);
|
||||
in.putExtra("type", 3);
|
||||
in.putExtra("carId", carId);
|
||||
con.startActivity(in);
|
||||
}
|
||||
} else {
|
||||
Toast.makeText(con, "挂车信息保存失败", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
@ -220,7 +299,7 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
||||
}
|
||||
} else if (CacheGroup.cacheList.get(CAR_COLOR) != null) {
|
||||
DicBean bb = gson.fromJson(CacheGroup.cacheList.get(CAR_COLOR), DicBean.class);
|
||||
if (bb.getCode()==200){
|
||||
if (bb.getCode() == 200) {
|
||||
PickerUtils.getInstance().pickSingle(this, "车牌颜色", bb.getData(), new OnOptionPickedListener() {
|
||||
@Override
|
||||
public void onOptionPicked(int position, Object item) {
|
||||
@ -234,7 +313,7 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
||||
CacheGroup.cacheList.remove(CAR_COLOR);
|
||||
} else if (CacheGroup.cacheList.get(CAR_ENERGY_TYPE) != null) {
|
||||
DicBean bb = gson.fromJson(CacheGroup.cacheList.get(CAR_ENERGY_TYPE), DicBean.class);
|
||||
if (bb.getCode()==200){
|
||||
if (bb.getCode() == 200) {
|
||||
PickerUtils.getInstance().pickSingle(this, "燃油类型", bb.getData(), new OnOptionPickedListener() {
|
||||
@Override
|
||||
public void onOptionPicked(int position, Object item) {
|
||||
@ -246,6 +325,16 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
||||
});
|
||||
}
|
||||
CacheGroup.cacheList.remove(CAR_ENERGY_TYPE);
|
||||
} else if (CacheGroup.cacheList.get("authUrl") != null) {
|
||||
//实名认证校验
|
||||
Log.e("url", CacheGroup.cacheList.get("authUrl"));
|
||||
BaseBean bb = gson.fromJson(CacheGroup.cacheList.get("authUrl"), BaseBean.class);
|
||||
if (bb.getCode() == 200) {
|
||||
EsignSdk.getInstance().startH5Activity(act, StringUtil.isNull(String.valueOf(bb.getData()), ""));
|
||||
} else {
|
||||
Toast.makeText(con, bb.getMsg(), Toast.LENGTH_LONG).show();
|
||||
}//Log.e("url",CacheGroup.cacheList.get("authUrl"));
|
||||
CacheGroup.cacheList.remove("authUrl");
|
||||
} else {
|
||||
initView(null);
|
||||
initData();
|
||||
@ -266,6 +355,7 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
||||
super.onCreate(savedInstanceState);
|
||||
StateStyleUtil.stateTextColor(this);
|
||||
setContentView(R.layout.activity_shangchuan_xsz);
|
||||
EventBus.getDefault().register(this);
|
||||
llColor = findViewById(R.id.llColor);
|
||||
llCarName = findViewById(R.id.llCarName);
|
||||
llType = findViewById(R.id.llType);
|
||||
@ -333,8 +423,8 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
||||
break;
|
||||
case 2:
|
||||
llCarName.setVisibility(View.GONE);
|
||||
llColor.setVisibility(View.VISIBLE);
|
||||
llType.setVisibility(View.VISIBLE);
|
||||
// llColor.setVisibility(View.VISIBLE);
|
||||
// llType.setVisibility(View.VISIBLE);
|
||||
type_img.setImageResource(R.mipmap.auth_icon_3);
|
||||
// there_div.setVisibility(View.VISIBLE);
|
||||
if (c_str != null && !c_str.equals("")) {
|
||||
@ -378,7 +468,7 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
||||
// new XPopup.Builder(con)
|
||||
// .asImageViewer(img1, url1, true, -1, -1, 50, false, new ImageLoader())
|
||||
// .show();
|
||||
}else{
|
||||
} else {
|
||||
if (!isAuth) {
|
||||
FalseKeys();
|
||||
keys[0] = true;
|
||||
@ -395,7 +485,7 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
||||
// new XPopup.Builder(con)
|
||||
// .asImageViewer(img2, url2, true, -1, -1, 50, false, new ImageLoader())
|
||||
// .show();
|
||||
}else{
|
||||
} else {
|
||||
if (!isAuth) {
|
||||
FalseKeys();
|
||||
keys[1] = true;
|
||||
@ -469,11 +559,21 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
||||
startActivity(in1);
|
||||
break;
|
||||
case 1:
|
||||
finish();
|
||||
//传驾驶证信息页面 跳转实名认证
|
||||
// finish();
|
||||
if (key) {
|
||||
key = false;
|
||||
new AuthRequest().getAuthUrl(con, hd);
|
||||
new Handler().postDelayed(() -> {
|
||||
key = true;
|
||||
}, 3000);
|
||||
}
|
||||
|
||||
//上传驾驶证信息页面 跳转资格证信息页面
|
||||
Intent in2 = new Intent(con, AuthQualificationActivity.class);
|
||||
in2.putExtra("type", "0");
|
||||
startActivity(in2);
|
||||
// finish();
|
||||
// Intent in2 = new Intent(con, AuthQualificationActivity.class);
|
||||
// in2.putExtra("type", "0");
|
||||
// startActivity(in2);
|
||||
break;
|
||||
case 2:
|
||||
finish();
|
||||
@ -488,6 +588,12 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
EventBus.getDefault().unregister(this);
|
||||
}
|
||||
|
||||
boolean isAuth = false;
|
||||
|
||||
public void initData() {
|
||||
@ -645,6 +751,9 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
||||
Glide.with(con).load(url2).into(img2);
|
||||
startTime = ocbb.getData().getStartTime();
|
||||
backId = ocbb.getData().getId();
|
||||
|
||||
//自动调取提交功能,实现页面自动跳转
|
||||
subimt();
|
||||
} else {
|
||||
Toast.makeText(con, "识别失败", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
@ -676,6 +785,8 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
||||
url2 = odlb.getData().getUrl();
|
||||
backId = odlb.getData().getId();
|
||||
Glide.with(con).load(url2).into(img2);
|
||||
//自动调取提交功能,实现页面自动跳转
|
||||
subimt();
|
||||
} else {
|
||||
Toast.makeText(con, "识别失败", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
@ -709,6 +820,8 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
||||
url2 = oblb.getData().getUrl();
|
||||
backId = oblb.getData().getId();
|
||||
Glide.with(con).load(url2).into(img2);
|
||||
//自动调取提交功能,实现页面自动跳转
|
||||
subimt();
|
||||
} else {
|
||||
Toast.makeText(con, oblb.getMsg(), Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
@ -841,10 +954,10 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
||||
break;
|
||||
case 2:
|
||||
if (olb != null && oblb != null) {
|
||||
if (curColor==null||curEnergy==null){
|
||||
Toast.makeText(con,"请完善内容",Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
// if (curColor == null || curEnergy == null) {
|
||||
// Toast.makeText(con, "请完善内容", Toast.LENGTH_SHORT).show();
|
||||
// return;
|
||||
// }
|
||||
HashMap<String, Object> map = new HashMap<>();
|
||||
if ("".equals(url3)) {
|
||||
map.put("imgId", fid);
|
||||
@ -854,8 +967,8 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
||||
map.put("type", str2);
|
||||
map.put("owner", str3);
|
||||
map.put("vehicleNumber", str4);
|
||||
map.put("carPlateColor", curColor.getValue());
|
||||
map.put("carEnergyTyp", curEnergy.getValue());
|
||||
// map.put("carPlateColor", curColor.getValue());
|
||||
// map.put("carEnergyTyp", curEnergy.getValue());
|
||||
new AuthRequest().saveVehicleLicense(con, hd, MapUtil.mapJson(map));
|
||||
} else {
|
||||
Toast.makeText(con, "请先上传资料", Toast.LENGTH_SHORT).show();
|
||||
@ -888,11 +1001,45 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
||||
}
|
||||
}
|
||||
|
||||
public static void personEvent(String msg){
|
||||
PersonEvent he=new PersonEvent(msg);
|
||||
public static void personEvent(String msg) {
|
||||
PersonEvent he = new PersonEvent(msg);
|
||||
EventBus.getDefault().post(he);
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void processResult(AuthEvent auth) {
|
||||
//添加实名/意愿/签署完成之后的逻辑
|
||||
Log.e("-回调信息-", auth.result);
|
||||
JSONObject jsonObject = JSON.parseObject(auth.result);
|
||||
if ("success".equalsIgnoreCase(jsonObject.getString("res"))) {
|
||||
EsignSdk.getInstance().finishH5Activity();
|
||||
new MessageUtils().showSimCenPop(con, "个人信息上传成功,请添加车辆信息!", () -> {
|
||||
finish();
|
||||
Intent in = new Intent(con, CertificatesActivity.class);
|
||||
in.putExtra("index", 2);
|
||||
startActivity(in);
|
||||
|
||||
});
|
||||
if ("sign".equalsIgnoreCase(jsonObject.getString("key"))) {
|
||||
Toast.makeText(con, "签署场景成功", Toast.LENGTH_SHORT).show();
|
||||
} else if ("realName".equalsIgnoreCase(jsonObject.getString("key"))) {
|
||||
Toast.makeText(con, "实名认证成功", Toast.LENGTH_SHORT).show();
|
||||
} else {
|
||||
Toast.makeText(con, "意愿认证成功", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
} else {
|
||||
if ("sign".equalsIgnoreCase(jsonObject.getString("key"))) {
|
||||
Toast.makeText(con, "签署场景失败", Toast.LENGTH_SHORT).show();
|
||||
} else if ("realName".equalsIgnoreCase(jsonObject.getString("key"))) {
|
||||
Toast.makeText(con, "实名认证失败", Toast.LENGTH_SHORT).show();
|
||||
} else {
|
||||
Toast.makeText(con, "意愿认证失败", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
EsignSdk.getInstance().finishH5Activity();
|
||||
finish();
|
||||
}
|
||||
}
|
||||
|
||||
// public static class ImageLoader implements XPopupImageLoader {
|
||||
// @Override
|
||||
// public void loadImage(int position, @NonNull Object url, @NonNull ImageView imageView) {
|
||||
|
@ -15,6 +15,7 @@ import androidx.annotation.Nullable;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.arpa.hndahesudintocctmsdriver.H5Activity;
|
||||
import com.arpa.hndahesudintocctmsdriver.event.HomeEvent;
|
||||
import com.arpa.hndahesudintocctmsdriver.event.PersonEvent;
|
||||
import com.bumptech.glide.Glide;
|
||||
@ -96,6 +97,11 @@ public class PersonalAuthActivity extends BaseAppCompatActivity {
|
||||
Log.e("url", CacheGroup.cacheList.get("authUrl"));
|
||||
BaseBean bb = gson.fromJson(CacheGroup.cacheList.get("authUrl"), BaseBean.class);
|
||||
if (bb.getCode() == 200) {
|
||||
|
||||
// Intent intent = new Intent(this, H5Activity.class);
|
||||
// intent.putExtra("url", (String) bb.getData());
|
||||
// intent.putExtra("view_file", false);
|
||||
// startActivity(intent);
|
||||
EsignSdk.getInstance().startH5Activity(act, StringUtil.isNull(String.valueOf(bb.getData()), ""));
|
||||
} else {
|
||||
Toast.makeText(con, bb.getMsg(), Toast.LENGTH_LONG).show();
|
||||
@ -162,6 +168,8 @@ public class PersonalAuthActivity extends BaseAppCompatActivity {
|
||||
// startActivityForResult(in, 12);
|
||||
//EsignSdk.getInstance().startH5Activity(act,"https://smlh5.esign.cn/usercenterFront/oemAuth/v3/realName/index?contextKey=b7b103b15b866ec4c72beef1dfe20828&appId=7438873235");
|
||||
if (key) {
|
||||
// EsignSdk.getInstance().startH5Activity(act, "");
|
||||
|
||||
key = false;
|
||||
new AuthRequest().getAuthUrl(con, hd);
|
||||
new Handler().postDelayed(() -> {
|
||||
|
@ -53,7 +53,7 @@ public class PhotoCarActivity extends BaseAppCompatActivity implements View.OnCl
|
||||
private String[] name1 = {"车辆照片", "NFC照片", "车辆登记证书照片", "道路运输许可证照片"};
|
||||
private String[] name2 = {"请上传车辆照片", "请上传NFC照片", "请上传车辆登记证书照片", "请上传道路运输许可证照片"};
|
||||
private Boolean[] isShowEdit = {false, false, true, true};
|
||||
private Boolean[] isShowSkip = {true, false, false, false};
|
||||
private Boolean[] isShowSkip = {true, false, false, true};
|
||||
private String[] tips = {
|
||||
"",
|
||||
"*注意: 没有粘贴NFC芯片的车辆无需上传,可直接跳过",
|
||||
@ -158,8 +158,13 @@ public class PhotoCarActivity extends BaseAppCompatActivity implements View.OnCl
|
||||
IsAuthDriverAuthQualificationBean ib = gson.fromJson(CacheGroup.cacheList.get("saveCarRoadLicenseNo"), IsAuthDriverAuthQualificationBean.class);
|
||||
if (ib.getCode() == 200) {
|
||||
//判断是否需要跳转挂车行驶证页面
|
||||
if (!"".equals(carId) && cdb.getData().getIsTrailer() == 1) {
|
||||
if (!"".equals(carId)) {
|
||||
if (!"".equals(carId) ){
|
||||
if (cdb.getData().getIsTrailer() == 1&&!TextUtils.isEmpty(cdb.getData().getTrailerResVo().getCarNumber())){//需要挂车,并且传过挂车直接结束
|
||||
finish();
|
||||
Intent in = new Intent(con, AddCarSuccActivity.class);
|
||||
in.putExtra("type", 3);
|
||||
con.startActivity(in);
|
||||
}else if(cdb.getData().getIsTrailer() == 1&&TextUtils.isEmpty(cdb.getData().getTrailerResVo().getCarNumber())){//需要挂车,没传过挂车,到挂车页面
|
||||
finish();
|
||||
Intent in = new Intent(con, CertificatesActivity.class);
|
||||
in.putExtra("index", 3);
|
||||
@ -168,15 +173,41 @@ public class PhotoCarActivity extends BaseAppCompatActivity implements View.OnCl
|
||||
in.putExtra("cheData", new Gson().toJson(cdb));
|
||||
}
|
||||
startActivity(in);
|
||||
} else {
|
||||
Toast.makeText(con, "请先绑定行驶证", Toast.LENGTH_SHORT).show();
|
||||
}else if(cdb.getData().getIsTrailer() == 0){//不需要挂车
|
||||
if ("1".equals(cdb.getData().getNeedUpQCPhoto())){//需要从业资格证
|
||||
Intent in = new Intent(con, AuthQualificationActivity.class);
|
||||
in.putExtra("type", "0");
|
||||
in.putExtra("carId", carId);
|
||||
in.putExtra("isOverCar", false);
|
||||
startActivity(in);
|
||||
}else{
|
||||
finish();
|
||||
Intent in = new Intent(con, AddCarSuccActivity.class);
|
||||
in.putExtra("type", 3);
|
||||
con.startActivity(in);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
finish();
|
||||
Intent in = new Intent(con, AddCarSuccActivity.class);
|
||||
in.putExtra("type", 3);
|
||||
con.startActivity(in);
|
||||
}
|
||||
|
||||
// if (!"".equals(carId) && cdb.getData().getIsTrailer() == 1) {
|
||||
// if (!"".equals(carId)) {
|
||||
// finish();
|
||||
// Intent in = new Intent(con, CertificatesActivity.class);
|
||||
// in.putExtra("index", 3);
|
||||
// in.putExtra("carId", carId);
|
||||
// if (cdb != null) {
|
||||
// in.putExtra("cheData", new Gson().toJson(cdb));
|
||||
// }
|
||||
// startActivity(in);
|
||||
// } else {
|
||||
// Toast.makeText(con, "请先绑定行驶证", Toast.LENGTH_SHORT).show();
|
||||
// }
|
||||
// } else {
|
||||
// finish();
|
||||
// Intent in = new Intent(con, AddCarSuccActivity.class);
|
||||
// in.putExtra("type", 3);
|
||||
// con.startActivity(in);
|
||||
// }
|
||||
} else {
|
||||
Toast.makeText(con, ib.getMsg(), Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
@ -7,6 +7,7 @@ import android.graphics.Outline;
|
||||
import android.location.Location;
|
||||
import android.os.Bundle;
|
||||
import android.os.Message;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.view.Gravity;
|
||||
import android.view.LayoutInflater;
|
||||
@ -42,7 +43,9 @@ import com.arpa.hndahesudintocctmsdriver.constant.JTTConstant;
|
||||
import com.arpa.hndahesudintocctmsdriver.event.HomeEvent;
|
||||
import com.arpa.hndahesudintocctmsdriver.parts.StartOrderParts;
|
||||
import com.arpa.hndahesudintocctmsdriver.report.JTTProcess;
|
||||
import com.arpa.hndahesudintocctmsdriver.ui.auth.CertificatesActivity;
|
||||
import com.arpa.hndahesudintocctmsdriver.ui.news.NewActivity;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.MessageUtils;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.string.StringUtil;
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.google.gson.Gson;
|
||||
@ -141,6 +144,15 @@ public class HomeFragment extends BaseFragment {
|
||||
if (ub.getCode() == 200) {
|
||||
SPUtil.insSP(con, "data", "userdata", CacheGroup.cacheList.get("userdata"));
|
||||
MsgUtil.addHdMsgWat(hd, 33);
|
||||
|
||||
//新用户注册,需弹窗提示注册
|
||||
if ("0".equals(ub.getData().getRealAuthentication())){
|
||||
new MessageUtils().showSimCenPop(con, "该司机还未认证,未认证无法接单。是否去注册!", () -> {
|
||||
Intent in=new Intent(con, CertificatesActivity.class);
|
||||
in.putExtra("index",0);
|
||||
startActivity(in);
|
||||
});
|
||||
}
|
||||
} else {
|
||||
Toast.makeText(con, ub.getMsg(), Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
@ -531,6 +543,9 @@ public class HomeFragment extends BaseFragment {
|
||||
ur.upApp();
|
||||
hyr.getHuoYuan(1, 100);
|
||||
ur.getImage(1);
|
||||
|
||||
|
||||
|
||||
if (UiAuxiliary.isLogin(con)) {
|
||||
ur.User();
|
||||
ur.getDriverExpire();
|
||||
|
@ -1,6 +1,7 @@
|
||||
package com.arpa.hndahesudintocctmsdriver.ui.home;
|
||||
|
||||
import android.Manifest;
|
||||
import android.app.Activity;
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
@ -18,7 +19,10 @@ import androidx.annotation.Nullable;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.arpa.hndahesudintocctmsdriver.H5Activity;
|
||||
import com.arpa.hndahesudintocctmsdriver.bean.JTT;
|
||||
import com.arpa.hndahesudintocctmsdriver.event.FaceEvent;
|
||||
import com.arpa.hndahesudintocctmsdriver.event.HomeEvent;
|
||||
import com.arpa.hndahesudintocctmsdriver.parts.ConfigParts;
|
||||
import com.arpa.hndahesudintocctmsdriver.parts.UserParts;
|
||||
import com.arpa.hndahesudintocctmsdriver.report.ALProcess;
|
||||
@ -29,6 +33,7 @@ import com.arpa.hndahesudintocctmsdriver.util.img.ImageGetUtil;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.sp.SPUtil;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.string.StringUtil;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.view.BaseAppCompatActivity;
|
||||
import com.dahe.mylibrary.utils.ActivityUtils;
|
||||
import com.esign.esignsdk.EsignSdk;
|
||||
import com.esign.esignsdk.data.AuthEvent;
|
||||
import com.google.gson.Gson;
|
||||
@ -96,7 +101,15 @@ public class HuoYunDelActivity extends BaseAppCompatActivity {
|
||||
if (bb.getCode() == 200) {
|
||||
//Toast.makeText(con,"接单成功",Toast.LENGTH_SHORT).show();
|
||||
customDialog.dismiss();
|
||||
EsignSdk.getInstance().startH5Activity(act, (String) bb.getData());
|
||||
// EsignSdk.getInstance().startH5Activity(act, (String) bb.getData());
|
||||
|
||||
|
||||
Intent intent = new Intent(this, H5Activity.class);
|
||||
intent.putExtra("url", (String) bb.getData());
|
||||
intent.putExtra("view_file", false);
|
||||
startActivity(intent);
|
||||
|
||||
|
||||
//finish();
|
||||
} else {
|
||||
Toast.makeText(con, bb.getMsg(), Toast.LENGTH_SHORT).show();
|
||||
@ -321,6 +334,51 @@ public class HuoYunDelActivity extends BaseAppCompatActivity {
|
||||
});
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void faceResult(FaceEvent home) {
|
||||
Log.e("-res-", home.getMessage());
|
||||
|
||||
UiAuxiliary.homeRequest("接单");
|
||||
Intent in = new Intent(con, StartYunDanActivity.class);
|
||||
in.putExtra("id", "0");
|
||||
startActivity(in);
|
||||
finish();
|
||||
|
||||
// new Handler().postDelayed(() -> {
|
||||
// UiAuxiliary.homeRequest("接单");
|
||||
// Intent in = new Intent(con, StartYunDanActivity.class);
|
||||
// in.putExtra("id", "0");
|
||||
// startActivity(in);
|
||||
// finish();
|
||||
// }, 2500);
|
||||
|
||||
|
||||
|
||||
// new Handler().postDelayed(() -> {
|
||||
//
|
||||
//
|
||||
// UiAuxiliary.homeRequest("接单");
|
||||
//// //ur.getJtt(hyd.getData().getId());
|
||||
//
|
||||
// Intent in = new Intent(con, StartYunDanActivity.class);
|
||||
// in.putExtra("id", "0");
|
||||
// startActivity(in);
|
||||
//
|
||||
// ActivityUtils.finishActivity(H5Activity.class);
|
||||
// finish();
|
||||
//
|
||||
//
|
||||
// }, 1500);
|
||||
|
||||
// UiAuxiliary.homeRequest("接单");
|
||||
|
||||
// Intent in = new Intent(con, StartYunDanActivity.class);
|
||||
// in.putExtra("id", "0");
|
||||
// startActivity(in);
|
||||
// finish();
|
||||
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void processResult(AuthEvent auth) {
|
||||
//添加实名/意愿/签署完成之后的逻辑
|
||||
|
@ -19,8 +19,11 @@ import com.alct.mdp.callback.OnResultListener;
|
||||
import com.alct.mdp.model.Goods;
|
||||
import com.alct.mdp.model.Image;
|
||||
import com.alct.mdp.model.Location;
|
||||
import com.arpa.hndahesudintocctmsdriver.H5Activity;
|
||||
import com.arpa.hndahesudintocctmsdriver.bean.CarInfoBean;
|
||||
import com.arpa.hndahesudintocctmsdriver.report.ALProcess;
|
||||
import com.arpa.hndahesudintocctmsdriver.report.JTTProcess;
|
||||
import com.arpa.hndahesudintocctmsdriver.request.OCRRequest;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.BitmapUtil;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.MessageUtils;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.NfcUtils;
|
||||
@ -128,6 +131,32 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
||||
}
|
||||
CacheGroup.cacheList.remove("carName");
|
||||
}
|
||||
|
||||
if (CacheGroup.cacheList.get("carNum") != null) {
|
||||
Log.e("upload", CacheGroup.cacheList.get("carNum"));
|
||||
CarInfoBean ub = gson.fromJson(CacheGroup.cacheList.remove("carNum"), CarInfoBean.class);
|
||||
if (ub.getCode() == 200 && ub.getData().getData().getPrism_keyValueInfo().size() > 0) {
|
||||
String value = ub.getData().getData().getPrism_keyValueInfo().get(0).getValue();
|
||||
String forceMatching = ub.getData().getForceMatching();
|
||||
if ("1".equals(forceMatching)) {//是否强校验车牌号 1:强校验
|
||||
if (sob.getData().getCarNumber().equals(value)) {
|
||||
hyr.uploadFile(new File(path));
|
||||
} else {
|
||||
new MessageUtils().showCenMessage(ShangChuangImgActivity.this, "车牌号不匹配!", "请重新拍照或联系管理员");
|
||||
}
|
||||
} else {
|
||||
hyr.uploadFile(new File(path));
|
||||
}
|
||||
} else {//识别失败后返回code500
|
||||
if (index == 0) {//装卸货车辆需要识别车牌号){
|
||||
Toast.makeText(con, "装货照片包含车牌号、三分之二车身或者装卸货场景。", Toast.LENGTH_SHORT).show();
|
||||
} else if (index == 1) {
|
||||
Toast.makeText(con, "卸货照片包含车牌号、三分之二车身或者装卸货场景。", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
}
|
||||
CacheGroup.cacheList.remove("carNum");
|
||||
}
|
||||
break;
|
||||
case 14://定位成功
|
||||
locationKey = true;
|
||||
@ -156,7 +185,14 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
||||
// if(index==1 || index==2){
|
||||
// new OCRRequest().OCRPlateLicense(con,hd,new File(path));
|
||||
// }
|
||||
hyr.uploadFile(new File(path));
|
||||
|
||||
// TODO: 2023/8/17 临时注释,处理车牌号识别
|
||||
// hyr.uploadFile(new File(path));
|
||||
if (index == 0 || index == 1) {//装卸货车辆需要识别车牌号
|
||||
new OCRRequest().OCRCarPlateLicense(con, hd, new File(path));
|
||||
} else {
|
||||
hyr.uploadFile(new File(path));
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
@ -1,8 +1,10 @@
|
||||
package com.arpa.hndahesudintocctmsdriver.util
|
||||
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import com.arpa.hndahesudintocctmsdriver.cuspop.MessagePop
|
||||
import com.ct.auth.communication.request.Content
|
||||
import com.arpa.hndahesudintocctmsdriver.cuspop.SimCenterPop
|
||||
import com.arpa.hndahesudintocctmsdriver.ui.auth.CertificatesActivity
|
||||
import com.lxj.xpopup.XPopup
|
||||
|
||||
/**
|
||||
@ -32,4 +34,37 @@ class MessageUtils {
|
||||
.show()
|
||||
}
|
||||
|
||||
fun showCenMessage(ctx: Context, message: String, message2: String) {
|
||||
XPopup.Builder(ctx) //
|
||||
.hasNavigationBar(false)
|
||||
.isDestroyOnDismiss(true) //对于只使用一次的弹窗对象,推荐设置这个
|
||||
.asCustom(MessagePop(ctx, message,message2).setOnMyItemClickListener(object : MessagePop.OnMyItemClickListener{
|
||||
override fun onItemClick(startTime: String, endTime: String) {
|
||||
}
|
||||
}))
|
||||
.show()
|
||||
}
|
||||
|
||||
fun showSimCenPop(ctx: Context, message: String,onMyItemClickListener: SimCenterPop.OnMyItemClickListener){
|
||||
|
||||
// XPopup.Builder(ctx) //
|
||||
// .hasNavigationBar(false)
|
||||
// .isDestroyOnDismiss(true) //对于只使用一次的弹窗对象,推荐设置这个
|
||||
// .asCustom(SimCenterPop(ctx,message).setOnMyItemClickListener(object : SimCenterPop.OnMyItemClickListener{
|
||||
// override fun onItemClick() {
|
||||
// val intent = Intent(ctx, CertificatesActivity::class.java)
|
||||
// intent.putExtra("index", type)
|
||||
// ctx.startActivity(intent)
|
||||
// }
|
||||
// }))
|
||||
// .show()
|
||||
|
||||
XPopup.Builder(ctx) //
|
||||
.hasNavigationBar(false)
|
||||
.isDestroyOnDismiss(true) //对于只使用一次的弹窗对象,推荐设置这个
|
||||
.asCustom(SimCenterPop(ctx,message).setOnMyItemClickListener(onMyItemClickListener))
|
||||
.show()
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -231,44 +231,7 @@
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_centerVertical="true"/>
|
||||
</RelativeLayout>
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_2"
|
||||
android:background="#F6F6F9"/>
|
||||
<RelativeLayout
|
||||
android:id="@+id/r3"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
<LinearLayout
|
||||
android:layout_marginTop="@dimen/dp_20"
|
||||
android:layout_marginBottom="@dimen/dp_20"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="道路运输证信息"
|
||||
android:textColor="#ff000000"
|
||||
android:textSize="@dimen/sp_15"
|
||||
/>
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="(4.5吨以上车辆需提交)"
|
||||
android:textColor="#C4C4CE"
|
||||
android:textSize="@dimen/sp_13"
|
||||
/>
|
||||
</LinearLayout>
|
||||
<ImageView
|
||||
android:layout_width="@dimen/dp_6"
|
||||
android:layout_height="@dimen/dp_10"
|
||||
android:src="@mipmap/chevron"
|
||||
android:scaleType="fitXY"
|
||||
android:background="@null"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_centerVertical="true"/>
|
||||
</RelativeLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_2"
|
||||
@ -307,6 +270,45 @@
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_centerVertical="true"/>
|
||||
</RelativeLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_2"
|
||||
android:background="#F6F6F9"/>
|
||||
<RelativeLayout
|
||||
android:id="@+id/r3"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
<LinearLayout
|
||||
android:layout_marginTop="@dimen/dp_20"
|
||||
android:layout_marginBottom="@dimen/dp_20"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="道路运输证信息"
|
||||
android:textColor="#ff000000"
|
||||
android:textSize="@dimen/sp_15"
|
||||
/>
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="(4.5吨以上车辆需提交)"
|
||||
android:textColor="#C4C4CE"
|
||||
android:textSize="@dimen/sp_13"
|
||||
/>
|
||||
</LinearLayout>
|
||||
<ImageView
|
||||
android:layout_width="@dimen/dp_6"
|
||||
android:layout_height="@dimen/dp_10"
|
||||
android:src="@mipmap/chevron"
|
||||
android:scaleType="fitXY"
|
||||
android:background="@null"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_centerVertical="true"/>
|
||||
</RelativeLayout>
|
||||
<View
|
||||
android:id="@+id/vs1"
|
||||
android:layout_width="match_parent"
|
||||
|
@ -477,7 +477,7 @@
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_102"/>
|
||||
android:layout_height="@dimen/dp_40"/>
|
||||
|
||||
<Button
|
||||
android:id="@+id/submit"
|
||||
|
@ -36,6 +36,7 @@
|
||||
android:textSize="@dimen/sp_14"
|
||||
tools:text="提示"></TextView>
|
||||
<TextView
|
||||
android:id="@+id/tvMessage2"
|
||||
android:lineSpacingExtra="@dimen/dp_6"
|
||||
android:gravity="center"
|
||||
android:layout_width="wrap_content"
|
||||
|
71
app/src/main/res/layout/pop_sim_center.xml
Normal file
71
app/src/main/res/layout/pop_sim_center.xml
Normal file
@ -0,0 +1,71 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="@dimen/dp_16"
|
||||
android:background="@color/white"
|
||||
android:elevation="@dimen/dp_5"
|
||||
|
||||
app:cardCornerRadius="@dimen/dp_10">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_horizontal"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_marginTop="@dimen/dp_10"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="提示"
|
||||
android:textStyle="bold"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="@dimen/sp_20"></TextView>
|
||||
|
||||
<TextView
|
||||
android:paddingLeft="@dimen/dp_10"
|
||||
android:paddingRight="@dimen/dp_10"
|
||||
android:lineSpacingExtra="@dimen/dp_6"
|
||||
android:gravity="center"
|
||||
android:id="@+id/tvContent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_14"
|
||||
android:textColor="#333"
|
||||
android:textSize="@dimen/sp_14"
|
||||
tools:text="提示"></TextView>
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_10"
|
||||
android:orientation="horizontal"
|
||||
android:paddingTop="@dimen/dp_10"
|
||||
android:paddingBottom="@dimen/dp_10">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvCancel"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:text="取消"
|
||||
android:textSize="@dimen/sp_16"></TextView>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvOk"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:text="去注册"
|
||||
android:textColor="@color/colorPrimary"
|
||||
android:textSize="@dimen/sp_16"></TextView>
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
</androidx.cardview.widget.CardView>
|
Loading…
Reference in New Issue
Block a user