Compare commits
66 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| e3b6ba4f1c | |||
| 58a3f502da | |||
| 80a257273b | |||
| 5a846d220d | |||
| 01bd0e03ff | |||
| 82b1413429 | |||
| 8b2007a11d | |||
| d181d819b0 | |||
| 1042fbd283 | |||
| f1ffdd31af | |||
| 3b7a77c45b | |||
| 7fdb48817f | |||
| 496319c04b | |||
| 86d3599110 | |||
| 23ca8f1411 | |||
| cfc32bfe66 | |||
| ab59be9f94 | |||
| e59e2d0fa4 | |||
| 041bcaf2ec | |||
| 291578cd72 | |||
| 1ef4f3b9ca | |||
| ab34920c8f | |||
| 63026819f8 | |||
| 83fc537c8d | |||
| 7a02706b75 | |||
| d78ec09c04 | |||
| 40d344e245 | |||
| 866a46a7cb | |||
| e4bdf1384f | |||
| cabbe363a9 | |||
| 6fc87c0d2e | |||
| 61c22800f7 | |||
| deb11d4d99 | |||
| 77481c73f6 | |||
| 2da410bcd4 | |||
| c6005ee9a1 | |||
| 65994b8eda | |||
| df7a29e54b | |||
| 7c63bb1d39 | |||
| 8bbae1cf92 | |||
| 97e0c5f629 | |||
| 95667723e9 | |||
| 1fd37db329 | |||
| 51075e72c8 | |||
| 5bc0a041de | |||
| c11974e9c1 | |||
| ccf70796a3 | |||
| 7b3abfeafc | |||
| 9dc92a1bc7 | |||
| 5fdaa0b213 | |||
| 446aed1574 | |||
| 6f573aee98 | |||
| 15bec78cb8 | |||
| 3a44129b03 | |||
| 96819e08b4 | |||
| db9990eec0 | |||
| a2be579ae9 | |||
| 873e0b81cf | |||
| 4cba8a8246 | |||
| ba86cfb234 | |||
| 6d2656a1f7 | |||
| d9ec95fbc8 | |||
| 3c65d1f691 | |||
| c8b6e75d7d | |||
| 0e8ea7147f | |||
| 9364706365 |
@ -33,12 +33,13 @@ android {
|
|||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId "com.arpa.hndahesudintocctmsdriver"
|
applicationId "com.arpa.hndahesudintocctmsdriver"
|
||||||
minSdkVersion 24
|
minSdkVersion 24
|
||||||
targetSdkVersion 30
|
targetSdkVersion 30
|
||||||
versionCode 68
|
versionCode 76
|
||||||
versionName "3.3.8"
|
versionName "3.4.6"
|
||||||
flavorDimensions "CHANNEL_VALUE"
|
flavorDimensions "CHANNEL_VALUE"
|
||||||
flavorDimensions "app_icon"
|
flavorDimensions "app_icon"
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
@ -105,7 +106,8 @@ android {
|
|||||||
JPUSH_CHANNEL: "developer-default"//暂时填写默认值即可.
|
JPUSH_CHANNEL: "developer-default"//暂时填写默认值即可.
|
||||||
]
|
]
|
||||||
buildConfigField("String", "OPEN_AL_URL", "\"https://oapi-staging.alct56.com\"")
|
buildConfigField("String", "OPEN_AL_URL", "\"https://oapi-staging.alct56.com\"")
|
||||||
buildConfigField("String", "BASE_URL", "\"https://app.test.dahehuoyun.com/api/\"")
|
buildConfigField("String", "BASE_URL", "\"http://192.168.1.118:8080/api/\"")
|
||||||
|
// buildConfigField("String", "BASE_URL", "\"http://linux.local:8080/api/\"")
|
||||||
buildConfigField "boolean", "isTest", "true"
|
buildConfigField "boolean", "isTest", "true"
|
||||||
//APP名称,可以在androidMainfest中引用
|
//APP名称,可以在androidMainfest中引用
|
||||||
resValue "string", "appName", "司机测试"
|
resValue "string", "appName", "司机测试"
|
||||||
|
|||||||
@ -2,6 +2,7 @@
|
|||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
package="com.arpa.hndahesudintocctmsdriver">
|
package="com.arpa.hndahesudintocctmsdriver">
|
||||||
|
|
||||||
<uses-permission android:name="android.permission.CALL_PHONE" />
|
<uses-permission android:name="android.permission.CALL_PHONE" />
|
||||||
<!-- 白名单 -->
|
<!-- 白名单 -->
|
||||||
<uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS" />
|
<uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS" />
|
||||||
@ -93,8 +94,8 @@
|
|||||||
android:screenOrientation="portrait" />
|
android:screenOrientation="portrait" />
|
||||||
<activity
|
<activity
|
||||||
android:name="com.arpa.hndahesudintocctmsdriver.ui.auth.PhotoCarActivity"
|
android:name="com.arpa.hndahesudintocctmsdriver.ui.auth.PhotoCarActivity"
|
||||||
android:windowSoftInputMode="adjustPan|stateHidden"
|
android:screenOrientation="portrait"
|
||||||
android:screenOrientation="portrait" />
|
android:windowSoftInputMode="adjustPan|stateHidden" />
|
||||||
<activity
|
<activity
|
||||||
android:name="com.arpa.hndahesudintocctmsdriver.ui.auth.VehicleAuthActivity"
|
android:name="com.arpa.hndahesudintocctmsdriver.ui.auth.VehicleAuthActivity"
|
||||||
android:screenOrientation="portrait" />
|
android:screenOrientation="portrait" />
|
||||||
@ -161,11 +162,16 @@
|
|||||||
</activity>
|
</activity>
|
||||||
<activity
|
<activity
|
||||||
android:name="com.arpa.hndahesudintocctmsdriver.ui.auth.CertificatesActivity"
|
android:name="com.arpa.hndahesudintocctmsdriver.ui.auth.CertificatesActivity"
|
||||||
android:windowSoftInputMode="adjustPan|stateHidden"
|
android:screenOrientation="portrait"
|
||||||
android:screenOrientation="portrait"/>
|
android:windowSoftInputMode="adjustPan|stateHidden" />
|
||||||
<activity
|
<activity
|
||||||
android:name="com.arpa.hndahesudintocctmsdriver.ui.auth.AddCarSuccActivity"
|
android:name="com.arpa.hndahesudintocctmsdriver.ui.auth.AddCarSuccActivity"
|
||||||
android:screenOrientation="portrait" />
|
android:screenOrientation="portrait" />
|
||||||
|
<activity
|
||||||
|
android:name="com.arpa.hndahesudintocctmsdriver.ui.auth.FaceSuccActivity"
|
||||||
|
android:exported="true"
|
||||||
|
android:screenOrientation="portrait" />
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name="com.arpa.hndahesudintocctmsdriver.ui.login.LoginActivity"
|
android:name="com.arpa.hndahesudintocctmsdriver.ui.login.LoginActivity"
|
||||||
android:screenOrientation="portrait" />
|
android:screenOrientation="portrait" />
|
||||||
@ -198,6 +204,7 @@
|
|||||||
android:screenOrientation="portrait" />
|
android:screenOrientation="portrait" />
|
||||||
<activity
|
<activity
|
||||||
android:name="com.arpa.hndahesudintocctmsdriver.ui.home.StartYunDanActivity"
|
android:name="com.arpa.hndahesudintocctmsdriver.ui.home.StartYunDanActivity"
|
||||||
|
android:launchMode="singleTop"
|
||||||
android:screenOrientation="portrait">
|
android:screenOrientation="portrait">
|
||||||
|
|
||||||
</activity>
|
</activity>
|
||||||
@ -214,6 +221,10 @@
|
|||||||
android:name="com.arpa.hndahesudintocctmsdriver.ui.web.WebActivity"
|
android:name="com.arpa.hndahesudintocctmsdriver.ui.web.WebActivity"
|
||||||
android:screenOrientation="portrait"
|
android:screenOrientation="portrait"
|
||||||
android:windowSoftInputMode="stateAlwaysHidden" />
|
android:windowSoftInputMode="stateAlwaysHidden" />
|
||||||
|
<activity
|
||||||
|
android:name="com.arpa.hndahesudintocctmsdriver.ui.web.WebOnlyOneActivity"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
|
android:windowSoftInputMode="stateAlwaysHidden" />
|
||||||
<activity
|
<activity
|
||||||
android:name="com.arpa.hndahesudintocctmsdriver.ui.web.WebKfActivity"
|
android:name="com.arpa.hndahesudintocctmsdriver.ui.web.WebKfActivity"
|
||||||
android:screenOrientation="portrait"
|
android:screenOrientation="portrait"
|
||||||
@ -362,10 +373,39 @@
|
|||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name=".H5Activity"
|
android:name=".H5Activity"
|
||||||
android:screenOrientation="portrait"
|
android:launchMode="singleTask"
|
||||||
android:launchMode="singleTask">
|
android:screenOrientation="portrait">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.VIEW" />
|
<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" />
|
||||||
|
|
||||||
|
<data
|
||||||
|
android:host="driver"
|
||||||
|
android:path="/realBack"
|
||||||
|
android:port="8088"
|
||||||
|
android:scheme="dahe" />
|
||||||
|
</intent-filter>
|
||||||
|
</activity>
|
||||||
|
|
||||||
|
|
||||||
|
<activity
|
||||||
|
android:name=".H5Activity2"
|
||||||
|
android:launchMode="singleTask"
|
||||||
|
android:screenOrientation="portrait">
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.intent.action.VIEW" />
|
||||||
|
|
||||||
<category android:name="android.intent.category.DEFAULT" />
|
<category android:name="android.intent.category.DEFAULT" />
|
||||||
<category android:name="android.intent.category.BROWSABLE" />
|
<category android:name="android.intent.category.BROWSABLE" />
|
||||||
|
|
||||||
|
|||||||
@ -63,8 +63,8 @@ public class App extends Application {
|
|||||||
}
|
}
|
||||||
//在使用SDK各组件之前初始化context信息,传入ApplicationContext
|
//在使用SDK各组件之前初始化context信息,传入ApplicationContext
|
||||||
// 路由初始化
|
// 路由初始化
|
||||||
JVerificationInterface.setDebugMode(true);
|
// JVerificationInterface.setDebugMode(true);
|
||||||
JVerificationInterface.init(this, 5000, (code, msg) -> Log.d("tag", "code = " + code + " msg = " + msg));
|
// JVerificationInterface.init(this, 5000, (code, msg) -> Log.d("tag", "code = " + code + " msg = " + msg));
|
||||||
//友盟
|
//友盟
|
||||||
//设置非debug版本开启
|
//设置非debug版本开启
|
||||||
if (!isDebugVersion(con)) {
|
if (!isDebugVersion(con)) {
|
||||||
|
|||||||
@ -3,6 +3,7 @@ package com.arpa.hndahesudintocctmsdriver;
|
|||||||
import android.Manifest;
|
import android.Manifest;
|
||||||
import android.annotation.TargetApi;
|
import android.annotation.TargetApi;
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.graphics.Bitmap;
|
import android.graphics.Bitmap;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
@ -40,10 +41,14 @@ import androidx.appcompat.app.AppCompatActivity;
|
|||||||
import com.arpa.hndahesudintocctmsdriver.cuspop.SimCenterPop;
|
import com.arpa.hndahesudintocctmsdriver.cuspop.SimCenterPop;
|
||||||
import com.arpa.hndahesudintocctmsdriver.event.FaceEvent;
|
import com.arpa.hndahesudintocctmsdriver.event.FaceEvent;
|
||||||
import com.arpa.hndahesudintocctmsdriver.event.HomeEvent;
|
import com.arpa.hndahesudintocctmsdriver.event.HomeEvent;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.request.UserRequset;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.ui.MainActivity;
|
||||||
import com.arpa.hndahesudintocctmsdriver.ui.UiAuxiliary;
|
import com.arpa.hndahesudintocctmsdriver.ui.UiAuxiliary;
|
||||||
import com.arpa.hndahesudintocctmsdriver.ui.auth.CertificatesActivity;
|
import com.arpa.hndahesudintocctmsdriver.ui.auth.CertificatesActivity;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.ui.auth.FaceSuccActivity;
|
||||||
import com.arpa.hndahesudintocctmsdriver.ui.home.StartYunDanActivity;
|
import com.arpa.hndahesudintocctmsdriver.ui.home.StartYunDanActivity;
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.MessageUtils;
|
import com.arpa.hndahesudintocctmsdriver.util.MessageUtils;
|
||||||
|
import com.dahe.mylibrary.utils.ActivityUtils;
|
||||||
import com.dahe.mylibrary.utils.ToastUtils;
|
import com.dahe.mylibrary.utils.ToastUtils;
|
||||||
import com.esign.esignsdk.EsignSdk;
|
import com.esign.esignsdk.EsignSdk;
|
||||||
import com.esign.esignsdk.h5.base.WBH5FaceVerifySDK;
|
import com.esign.esignsdk.h5.base.WBH5FaceVerifySDK;
|
||||||
@ -73,25 +78,38 @@ public class H5Activity extends AppCompatActivity {
|
|||||||
|
|
||||||
String curUrl = null;
|
String curUrl = null;
|
||||||
boolean viewFile = false;
|
boolean viewFile = false;
|
||||||
|
boolean isGoCar = false;
|
||||||
|
|
||||||
long time = System.currentTimeMillis();
|
long time = System.currentTimeMillis();
|
||||||
|
|
||||||
ValueCallback<Uri> uploadMessage;
|
ValueCallback<Uri> uploadMessage;
|
||||||
private ValueCallback<Uri[]> uploadMessageAboveL;
|
private ValueCallback<Uri[]> uploadMessageAboveL;
|
||||||
private final static int FILE_CHOOSER_RESULT_CODE = 10000;
|
private final static int FILE_CHOOSER_RESULT_CODE = 10000;
|
||||||
|
private Context ctx;
|
||||||
|
private boolean isOk = false;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
super.setContentView(R.layout.activity_h5);
|
super.setContentView(R.layout.activity_h5);
|
||||||
|
ctx = this;
|
||||||
|
|
||||||
mWebView = findViewById(R.id.webview);
|
mWebView = findViewById(R.id.webview);
|
||||||
ImageView back = findViewById(R.id.back);
|
ImageView back = findViewById(R.id.back);
|
||||||
TextView close = findViewById(R.id.close);
|
TextView close = findViewById(R.id.close);
|
||||||
|
TextView tvTitle = findViewById(R.id.tv_title);
|
||||||
WebSettings webSetting = mWebView.getSettings();
|
WebSettings webSetting = mWebView.getSettings();
|
||||||
|
|
||||||
|
String title = getIntent().getStringExtra("title");
|
||||||
|
if (!TextUtils.isEmpty(title)) {
|
||||||
|
tvTitle.setText(title);
|
||||||
|
}
|
||||||
|
|
||||||
back.setOnClickListener(v -> {
|
back.setOnClickListener(v -> {
|
||||||
|
if (isOk) {
|
||||||
|
ActivityUtils.finishToActivity(MainActivity.class, false);
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (mWebView.canGoBack()) {
|
if (mWebView.canGoBack()) {
|
||||||
mWebView.goBack();
|
mWebView.goBack();
|
||||||
} else {
|
} else {
|
||||||
@ -100,6 +118,10 @@ public class H5Activity extends AppCompatActivity {
|
|||||||
});
|
});
|
||||||
|
|
||||||
close.setOnClickListener(v -> {
|
close.setOnClickListener(v -> {
|
||||||
|
if (isOk) {
|
||||||
|
ActivityUtils.finishToActivity(MainActivity.class, false);
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (mWebView.canGoBack()) {
|
if (mWebView.canGoBack()) {
|
||||||
mWebView.goBack();
|
mWebView.goBack();
|
||||||
} else {
|
} else {
|
||||||
@ -114,6 +136,9 @@ public class H5Activity extends AppCompatActivity {
|
|||||||
webSetting.setLoadWithOverviewMode(true);
|
webSetting.setLoadWithOverviewMode(true);
|
||||||
webSetting.setAllowFileAccess(true);
|
webSetting.setAllowFileAccess(true);
|
||||||
webSetting.setAppCacheEnabled(true);
|
webSetting.setAppCacheEnabled(true);
|
||||||
|
webSetting.setAllowContentAccess(true);
|
||||||
|
webSetting.setLoadsImagesAutomatically(true);
|
||||||
|
webSetting.setMediaPlaybackRequiresUserGesture(true);
|
||||||
String appCachePath = getApplication().getCacheDir().getAbsolutePath();
|
String appCachePath = getApplication().getCacheDir().getAbsolutePath();
|
||||||
webSetting.setAppCachePath(appCachePath);
|
webSetting.setAppCachePath(appCachePath);
|
||||||
webSetting.setDatabaseEnabled(true);
|
webSetting.setDatabaseEnabled(true);
|
||||||
@ -180,11 +205,21 @@ public class H5Activity extends AppCompatActivity {
|
|||||||
private void processExtraData() {
|
private void processExtraData() {
|
||||||
|
|
||||||
Intent intent = getIntent();
|
Intent intent = getIntent();
|
||||||
|
isGoCar = intent.getBooleanExtra("isGoCar", false);
|
||||||
Uri uri = intent.getData();
|
Uri uri = intent.getData();
|
||||||
Log.e("test", "===" + uri);
|
Log.e("test", "===" + uri);
|
||||||
if (uri != null) {
|
if (uri != null) {
|
||||||
// 芝麻认证刷脸结束返回获取后续操作页面地址
|
// 芝麻认证刷脸结束返回获取后续操作页面地址
|
||||||
// String callbackUrl = uri.getQueryParameter("callback");
|
// String callbackUrl = uri.getQueryParameter("callback");
|
||||||
|
String urlString = uri.toString();
|
||||||
|
if ("dahe://driver:8088/realBack".equals(urlString)) {
|
||||||
|
Intent in = new Intent(ctx, FaceSuccActivity.class);
|
||||||
|
in.putExtra("isGoCar", true);
|
||||||
|
startActivity(in);
|
||||||
|
ActivityUtils.finishToActivity(MainActivity.class, false);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
String callbackUrl = uri.getQueryParameter("realnameUrl");
|
String callbackUrl = uri.getQueryParameter("realnameUrl");
|
||||||
if (!TextUtils.isEmpty(callbackUrl)) {
|
if (!TextUtils.isEmpty(callbackUrl)) {
|
||||||
@ -197,15 +232,29 @@ public class H5Activity extends AppCompatActivity {
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
String url = intent.getStringExtra("url");
|
String url = intent.getStringExtra("url");
|
||||||
|
if (TextUtils.isEmpty(url)) {
|
||||||
|
ActivityUtils.finishToActivity(MainActivity.class, false);
|
||||||
|
return;
|
||||||
|
}
|
||||||
viewFile = intent.getBooleanExtra("view_file", false);
|
viewFile = intent.getBooleanExtra("view_file", false);
|
||||||
if (url.startsWith("alipay")) {
|
if (url.startsWith("alipay")) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Intent intent2 = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
|
Intent intent2 = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
|
||||||
|
intent2.putExtra("isGoCar", isGoCar);
|
||||||
startActivity(intent2);
|
startActivity(intent2);
|
||||||
return;
|
return;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
}
|
}
|
||||||
|
// }else if (url.startsWith("https://agreement.dahehuoyun.com/#/1ba5c216/912f4c9587/5eb5184653/6ef9")) {
|
||||||
|
} else if (url.startsWith("https://agreement.dahehuoyun.com")) {
|
||||||
|
Intent in = new Intent(ctx, FaceSuccActivity.class);
|
||||||
|
startActivity(in);
|
||||||
|
if (isGoCar) {
|
||||||
|
ActivityUtils.finishToActivity(MainActivity.class, false);
|
||||||
|
} else {
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
if (curUrl == null) {
|
if (curUrl == null) {
|
||||||
curUrl = url;
|
curUrl = url;
|
||||||
@ -225,6 +274,30 @@ public class H5Activity extends AppCompatActivity {
|
|||||||
Uri uri = Uri.parse(url);
|
Uri uri = Uri.parse(url);
|
||||||
Log.e("test", "要加载的地址:" + uri.getScheme() + " " + url + " ");
|
Log.e("test", "要加载的地址:" + uri.getScheme() + " " + url + " ");
|
||||||
if (uri.getScheme().equals("http") || uri.getScheme().equals("https")) {
|
if (uri.getScheme().equals("http") || uri.getScheme().equals("https")) {
|
||||||
|
// if (url.startsWith("https://agreement.dahehuoyun.com/#/1ba5c216/912f4c9587/5eb5184653/6ef9")) {
|
||||||
|
if (url.startsWith("https://agreement.dahehuoyun.com")) {
|
||||||
|
Intent in = new Intent(ctx, FaceSuccActivity.class);
|
||||||
|
in.putExtra("isGoCar", isGoCar);
|
||||||
|
startActivity(in);
|
||||||
|
if (isGoCar) {
|
||||||
|
ActivityUtils.finishToActivity(MainActivity.class, false);
|
||||||
|
} else {
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// if (isGoCar&&url.startsWith("https://agreement.dahehuoyun.com/#/1ba5c216/912f4c9587/5eb5184653/6ef9")){
|
||||||
|
// isOk = true;
|
||||||
|
// view.loadUrl(url);
|
||||||
|
// new MessageUtils().showSimCenPop(ctx, "个人信息上传成功,请添加车辆信息!", "去添加",() -> {
|
||||||
|
// Intent in = new Intent(ctx, CertificatesActivity.class);
|
||||||
|
// in.putExtra("index", 2);
|
||||||
|
// startActivity(in);
|
||||||
|
// ActivityUtils.finishToActivity(MainActivity.class,false);
|
||||||
|
// });
|
||||||
|
// return true;
|
||||||
|
// }
|
||||||
view.loadUrl(url);
|
view.loadUrl(url);
|
||||||
return true;
|
return true;
|
||||||
} else if (uri.getScheme().equals("js") || uri.getScheme().equals("jsbridge")) {
|
} else if (uri.getScheme().equals("js") || uri.getScheme().equals("jsbridge")) {
|
||||||
@ -261,6 +334,12 @@ public class H5Activity extends AppCompatActivity {
|
|||||||
// 实名认证结束 返回按钮/倒计时返回/暂不认证
|
// 实名认证结束 返回按钮/倒计时返回/暂不认证
|
||||||
boolean status = uri.getBooleanQueryParameter("status", false);
|
boolean status = uri.getBooleanQueryParameter("status", false);
|
||||||
if (status) {
|
if (status) {
|
||||||
|
//认证成功返回
|
||||||
|
new Handler().postDelayed(() -> {
|
||||||
|
FaceEvent he = new FaceEvent("刷脸成功");
|
||||||
|
EventBus.getDefault().post(he);
|
||||||
|
finish();
|
||||||
|
}, 800);
|
||||||
//认证成功返回
|
//认证成功返回
|
||||||
Toast.makeText(H5Activity.this, "认证成功", Toast.LENGTH_LONG).show();
|
Toast.makeText(H5Activity.this, "认证成功", Toast.LENGTH_LONG).show();
|
||||||
finish();
|
finish();
|
||||||
@ -278,6 +357,12 @@ public class H5Activity extends AppCompatActivity {
|
|||||||
boolean status = uri.getBooleanQueryParameter("status", false);
|
boolean status = uri.getBooleanQueryParameter("status", false);
|
||||||
if (status) {
|
if (status) {
|
||||||
//认证成功返回
|
//认证成功返回
|
||||||
|
//认证成功返回
|
||||||
|
// new Handler().postDelayed(() -> {
|
||||||
|
// FaceEvent he = new FaceEvent("刷脸成功");
|
||||||
|
// EventBus.getDefault().post(he);
|
||||||
|
// finish();
|
||||||
|
// }, 800);
|
||||||
Toast.makeText(H5Activity.this, "认证成功", Toast.LENGTH_LONG).show();
|
Toast.makeText(H5Activity.this, "认证成功", Toast.LENGTH_LONG).show();
|
||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,485 @@
|
|||||||
|
package com.arpa.hndahesudintocctmsdriver;
|
||||||
|
|
||||||
|
import static android.webkit.WebSettings.LOAD_NO_CACHE;
|
||||||
|
|
||||||
|
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.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.Toast;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.annotation.Nullable;
|
||||||
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
import androidx.core.content.ContextCompat;
|
||||||
|
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.event.FaceEvent;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.statusbar.StatusBar;
|
||||||
|
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 qiu.niorgai.StatusBarCompat;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author xingtian on 2019/3/25
|
||||||
|
*/
|
||||||
|
public class H5Activity2 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);
|
||||||
|
StatusBarCompat.setStatusBarColor(this, ContextCompat.getColor(this, R.color.white), 0);
|
||||||
|
StatusBar.changeToLightStatusBar(this); //黑色 下边白色
|
||||||
|
|
||||||
|
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 (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(H5Activity2.this, "签署结果: " + " signResult = " + signResult, Toast.LENGTH_LONG).show();
|
||||||
|
} else {
|
||||||
|
String tsignCode = uri.getQueryParameter("tsignCode");
|
||||||
|
if ("0".equals(tsignCode)) {
|
||||||
|
tsignCode = "签署成功";
|
||||||
|
} else {
|
||||||
|
tsignCode = "签署失败";
|
||||||
|
}
|
||||||
|
Toast.makeText(H5Activity2.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) {
|
||||||
|
//认证成功返回
|
||||||
|
new Handler().postDelayed(() -> {
|
||||||
|
FaceEvent he = new FaceEvent("刷脸成功");
|
||||||
|
EventBus.getDefault().post(he);
|
||||||
|
finish();
|
||||||
|
}, 800);
|
||||||
|
Toast.makeText(H5Activity2.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) {
|
||||||
|
//认证成功返回
|
||||||
|
new Handler().postDelayed(() -> {
|
||||||
|
FaceEvent he = new FaceEvent("刷脸成功");
|
||||||
|
EventBus.getDefault().post(he);
|
||||||
|
finish();
|
||||||
|
}, 800);
|
||||||
|
Toast.makeText(H5Activity2.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(H5Activity2.this, "签署结果: " + " signResult = " + signResult, Toast.LENGTH_LONG).show();
|
||||||
|
} else {
|
||||||
|
String tsignCode = uri.getQueryParameter("tsignCode");
|
||||||
|
if ("0".equals(tsignCode)) {
|
||||||
|
//延时1.5秒跳转运单详情页面
|
||||||
|
// new Handler().postDelayed(() -> {
|
||||||
|
// FaceEvent he = new FaceEvent("刷脸成功");
|
||||||
|
// EventBus.getDefault().post(he);
|
||||||
|
// finish();
|
||||||
|
// }, 800);
|
||||||
|
tsignCode = "签署成功";
|
||||||
|
} else {
|
||||||
|
tsignCode = "签署失败";
|
||||||
|
}
|
||||||
|
Toast.makeText(H5Activity2.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(H5Activity2.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);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,395 @@
|
|||||||
|
package com.arpa.hndahesudintocctmsdriver.bean;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName CarInfoBean2
|
||||||
|
* @Author john
|
||||||
|
* @Date 2024/11/20 15:43
|
||||||
|
* @Description TODO
|
||||||
|
*/
|
||||||
|
public class CarInfoBean2 implements Serializable {
|
||||||
|
|
||||||
|
|
||||||
|
private int code;
|
||||||
|
private DataDTO data;
|
||||||
|
private String msg;
|
||||||
|
private String remark;
|
||||||
|
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 String getRemark() {
|
||||||
|
return remark;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRemark(String remark) {
|
||||||
|
this.remark = remark;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getRes() {
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRes(int res) {
|
||||||
|
this.res = res;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isSuccess() {
|
||||||
|
return success;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSuccess(boolean success) {
|
||||||
|
this.success = success;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class DataDTO {
|
||||||
|
private String allAuality;
|
||||||
|
private String allCapacity;
|
||||||
|
private String approvedCapacity;
|
||||||
|
private String auditStatus;
|
||||||
|
private String auditTime;
|
||||||
|
private String backImage;
|
||||||
|
private String backStatus;
|
||||||
|
private String backTime;
|
||||||
|
private String carId;
|
||||||
|
private String carNumber;
|
||||||
|
private String checkRecord;
|
||||||
|
private String createTime;
|
||||||
|
private String dateIssue;
|
||||||
|
private String engineNumber;
|
||||||
|
private String fileNumber;
|
||||||
|
private String frontImage;
|
||||||
|
private String frontStatus;
|
||||||
|
private String frontTime;
|
||||||
|
private String fuelType;
|
||||||
|
private String id;
|
||||||
|
private String model;
|
||||||
|
private String nature;
|
||||||
|
private String organizationName;
|
||||||
|
private String owner;
|
||||||
|
private String personCapacity;
|
||||||
|
private String registerDate;
|
||||||
|
private String remark;
|
||||||
|
private String size;
|
||||||
|
private String threeImage;
|
||||||
|
private String threeImageStatus;
|
||||||
|
private String towAuality;
|
||||||
|
private String trailer;
|
||||||
|
private String trailerId;
|
||||||
|
private String type;
|
||||||
|
private String vehicleAxis;
|
||||||
|
private String vehicleNumber;
|
||||||
|
|
||||||
|
public String getTrailerId() {
|
||||||
|
return trailerId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTrailerId(String trailerId) {
|
||||||
|
this.trailerId = trailerId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAllAuality() {
|
||||||
|
return allAuality;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAllAuality(String allAuality) {
|
||||||
|
this.allAuality = allAuality;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAllCapacity() {
|
||||||
|
return allCapacity;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAllCapacity(String allCapacity) {
|
||||||
|
this.allCapacity = allCapacity;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getApprovedCapacity() {
|
||||||
|
return approvedCapacity;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setApprovedCapacity(String approvedCapacity) {
|
||||||
|
this.approvedCapacity = approvedCapacity;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAuditStatus() {
|
||||||
|
return auditStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAuditStatus(String auditStatus) {
|
||||||
|
this.auditStatus = auditStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAuditTime() {
|
||||||
|
return auditTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAuditTime(String auditTime) {
|
||||||
|
this.auditTime = auditTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getBackImage() {
|
||||||
|
return backImage;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBackImage(String backImage) {
|
||||||
|
this.backImage = backImage;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getBackStatus() {
|
||||||
|
return backStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBackStatus(String backStatus) {
|
||||||
|
this.backStatus = backStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getBackTime() {
|
||||||
|
return backTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBackTime(String backTime) {
|
||||||
|
this.backTime = backTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCarId() {
|
||||||
|
return carId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCarId(String carId) {
|
||||||
|
this.carId = carId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCarNumber() {
|
||||||
|
return carNumber;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCarNumber(String carNumber) {
|
||||||
|
this.carNumber = carNumber;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCheckRecord() {
|
||||||
|
return checkRecord;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCheckRecord(String checkRecord) {
|
||||||
|
this.checkRecord = checkRecord;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCreateTime() {
|
||||||
|
return createTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCreateTime(String createTime) {
|
||||||
|
this.createTime = createTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDateIssue() {
|
||||||
|
return dateIssue;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDateIssue(String dateIssue) {
|
||||||
|
this.dateIssue = dateIssue;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getEngineNumber() {
|
||||||
|
return engineNumber;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEngineNumber(String engineNumber) {
|
||||||
|
this.engineNumber = engineNumber;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFileNumber() {
|
||||||
|
return fileNumber;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFileNumber(String fileNumber) {
|
||||||
|
this.fileNumber = fileNumber;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFrontImage() {
|
||||||
|
return frontImage;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFrontImage(String frontImage) {
|
||||||
|
this.frontImage = frontImage;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFrontStatus() {
|
||||||
|
return frontStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFrontStatus(String frontStatus) {
|
||||||
|
this.frontStatus = frontStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFrontTime() {
|
||||||
|
return frontTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFrontTime(String frontTime) {
|
||||||
|
this.frontTime = frontTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFuelType() {
|
||||||
|
return fuelType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFuelType(String fuelType) {
|
||||||
|
this.fuelType = fuelType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(String id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getModel() {
|
||||||
|
return model;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setModel(String model) {
|
||||||
|
this.model = model;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getNature() {
|
||||||
|
return nature;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNature(String nature) {
|
||||||
|
this.nature = nature;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getOrganizationName() {
|
||||||
|
return organizationName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOrganizationName(String organizationName) {
|
||||||
|
this.organizationName = organizationName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getOwner() {
|
||||||
|
return owner;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOwner(String owner) {
|
||||||
|
this.owner = owner;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPersonCapacity() {
|
||||||
|
return personCapacity;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPersonCapacity(String personCapacity) {
|
||||||
|
this.personCapacity = personCapacity;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRegisterDate() {
|
||||||
|
return registerDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRegisterDate(String registerDate) {
|
||||||
|
this.registerDate = registerDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRemark() {
|
||||||
|
return remark;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRemark(String remark) {
|
||||||
|
this.remark = remark;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSize() {
|
||||||
|
return size;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSize(String size) {
|
||||||
|
this.size = size;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getThreeImage() {
|
||||||
|
return threeImage;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setThreeImage(String threeImage) {
|
||||||
|
this.threeImage = threeImage;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getThreeImageStatus() {
|
||||||
|
return threeImageStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setThreeImageStatus(String threeImageStatus) {
|
||||||
|
this.threeImageStatus = threeImageStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTowAuality() {
|
||||||
|
return towAuality;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTowAuality(String towAuality) {
|
||||||
|
this.towAuality = towAuality;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTrailer() {
|
||||||
|
return trailer;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTrailer(String trailer) {
|
||||||
|
this.trailer = trailer;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getType() {
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setType(String type) {
|
||||||
|
this.type = type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getVehicleAxis() {
|
||||||
|
return vehicleAxis;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setVehicleAxis(String vehicleAxis) {
|
||||||
|
this.vehicleAxis = vehicleAxis;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getVehicleNumber() {
|
||||||
|
return vehicleNumber;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setVehicleNumber(String vehicleNumber) {
|
||||||
|
this.vehicleNumber = vehicleNumber;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -57,12 +57,15 @@ public class DriverAuthDataBean {
|
|||||||
private String idcardValidity;
|
private String idcardValidity;
|
||||||
private String dirverAllowType;
|
private String dirverAllowType;
|
||||||
private int idcardPhoto;
|
private int idcardPhoto;
|
||||||
|
private String bankImgUrl;
|
||||||
|
private String bankName;
|
||||||
|
private String cardNo;
|
||||||
private int idcardBackPhoto;
|
private int idcardBackPhoto;
|
||||||
private Object idcardPhotoHold;
|
private Object idcardPhotoHold;
|
||||||
private String idcardAddress;
|
private String idcardAddress;
|
||||||
private String idcardName;
|
private String idcardName;
|
||||||
private int idcardSex;
|
private int idcardSex;
|
||||||
private int idCardStatus;
|
private int idCardStatus;//身份证认证状态;-1未提交 0待认证 1认证通过 2认证失败
|
||||||
private int driverLicenseStatus;
|
private int driverLicenseStatus;
|
||||||
private int qualificationCertificateStatus;
|
private int qualificationCertificateStatus;
|
||||||
private String idCardReason;
|
private String idCardReason;
|
||||||
@ -141,6 +144,30 @@ public class DriverAuthDataBean {
|
|||||||
private Object mbindStatus;
|
private Object mbindStatus;
|
||||||
private Object mreason;
|
private Object mreason;
|
||||||
|
|
||||||
|
public String getBankImgUrl() {
|
||||||
|
return bankImgUrl;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBankImgUrl(String bankImgUrl) {
|
||||||
|
this.bankImgUrl = bankImgUrl;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getBankName() {
|
||||||
|
return bankName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBankName(String bankName) {
|
||||||
|
this.bankName = bankName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCardNo() {
|
||||||
|
return cardNo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCardNo(String cardNo) {
|
||||||
|
this.cardNo = cardNo;
|
||||||
|
}
|
||||||
|
|
||||||
public int getId() {
|
public int getId() {
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,328 @@
|
|||||||
|
package com.arpa.hndahesudintocctmsdriver.bean;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName DriverUpBean
|
||||||
|
* @Author john
|
||||||
|
* @Date 2024/11/20 09:20
|
||||||
|
* @Description TODO
|
||||||
|
*/
|
||||||
|
public class DriverUpBean implements Serializable {
|
||||||
|
|
||||||
|
private String frontImageUrl;
|
||||||
|
private String backImageUrl;
|
||||||
|
private String carNumber;
|
||||||
|
private String type;
|
||||||
|
private String owner;
|
||||||
|
private String vehicleNumber;
|
||||||
|
private String carLong;
|
||||||
|
private String carWidth;
|
||||||
|
private String carHeight;
|
||||||
|
private String carId;
|
||||||
|
private String carPlateColor;
|
||||||
|
private String carEnergyTyp;
|
||||||
|
|
||||||
|
private DataDTO zjObj;
|
||||||
|
|
||||||
|
public String getCarId() {
|
||||||
|
return carId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCarId(String carId) {
|
||||||
|
this.carId = carId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFrontImageUrl() {
|
||||||
|
return frontImageUrl;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFrontImageUrl(String frontImageUrl) {
|
||||||
|
this.frontImageUrl = frontImageUrl;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getBackImageUrl() {
|
||||||
|
return backImageUrl;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBackImageUrl(String backImageUrl) {
|
||||||
|
this.backImageUrl = backImageUrl;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCarNumber() {
|
||||||
|
return carNumber;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCarNumber(String carNumber) {
|
||||||
|
this.carNumber = carNumber;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getType() {
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setType(String type) {
|
||||||
|
this.type = type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getOwner() {
|
||||||
|
return owner;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOwner(String owner) {
|
||||||
|
this.owner = owner;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getVehicleNumber() {
|
||||||
|
return vehicleNumber;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setVehicleNumber(String vehicleNumber) {
|
||||||
|
this.vehicleNumber = vehicleNumber;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCarLong() {
|
||||||
|
return carLong;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCarLong(String carLong) {
|
||||||
|
this.carLong = carLong;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCarWidth() {
|
||||||
|
return carWidth;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCarWidth(String carWidth) {
|
||||||
|
this.carWidth = carWidth;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCarHeight() {
|
||||||
|
return carHeight;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCarHeight(String carHeight) {
|
||||||
|
this.carHeight = carHeight;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCarPlateColor() {
|
||||||
|
return carPlateColor;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCarPlateColor(String carPlateColor) {
|
||||||
|
this.carPlateColor = carPlateColor;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCarEnergyTyp() {
|
||||||
|
return carEnergyTyp;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCarEnergyTyp(String carEnergyTyp) {
|
||||||
|
this.carEnergyTyp = carEnergyTyp;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DataDTO getZjObj() {
|
||||||
|
return zjObj;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setZjObj(DataDTO zjObj) {
|
||||||
|
this.zjObj = zjObj;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class DataDTO {
|
||||||
|
|
||||||
|
private String approveTon;
|
||||||
|
private String recordId;
|
||||||
|
private String note;
|
||||||
|
private String passengers;
|
||||||
|
private String vclDrwTn;
|
||||||
|
private String overallDimen;
|
||||||
|
private String vclN;
|
||||||
|
private String enTn;
|
||||||
|
private String loadTon;
|
||||||
|
private String inspectionRecord;
|
||||||
|
private String barCode;
|
||||||
|
private String issuingAuthority;
|
||||||
|
private String regTime;
|
||||||
|
private String address;
|
||||||
|
private String ownerName;
|
||||||
|
private String engine;
|
||||||
|
private String vin;
|
||||||
|
private String licensedateOfissue;
|
||||||
|
private String vcltype;
|
||||||
|
private String vclBrand;
|
||||||
|
private String natureOfUsage;
|
||||||
|
|
||||||
|
public String getApproveTon() {
|
||||||
|
return approveTon;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setApproveTon(String approveTon) {
|
||||||
|
this.approveTon = approveTon;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRecordId() {
|
||||||
|
return recordId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRecordId(String recordId) {
|
||||||
|
this.recordId = recordId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getNote() {
|
||||||
|
return note;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNote(String note) {
|
||||||
|
this.note = note;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPassengers() {
|
||||||
|
return passengers;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPassengers(String passengers) {
|
||||||
|
this.passengers = passengers;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getVclDrwTn() {
|
||||||
|
return vclDrwTn;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setVclDrwTn(String vclDrwTn) {
|
||||||
|
this.vclDrwTn = vclDrwTn;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getOverallDimen() {
|
||||||
|
return overallDimen;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOverallDimen(String overallDimen) {
|
||||||
|
this.overallDimen = overallDimen;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getVclN() {
|
||||||
|
return vclN;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setVclN(String vclN) {
|
||||||
|
this.vclN = vclN;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getEnTn() {
|
||||||
|
return enTn;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEnTn(String enTn) {
|
||||||
|
this.enTn = enTn;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLoadTon() {
|
||||||
|
return loadTon;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLoadTon(String loadTon) {
|
||||||
|
this.loadTon = loadTon;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getInspectionRecord() {
|
||||||
|
return inspectionRecord;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInspectionRecord(String inspectionRecord) {
|
||||||
|
this.inspectionRecord = inspectionRecord;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getBarCode() {
|
||||||
|
return barCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBarCode(String barCode) {
|
||||||
|
this.barCode = barCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getIssuingAuthority() {
|
||||||
|
return issuingAuthority;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIssuingAuthority(String issuingAuthority) {
|
||||||
|
this.issuingAuthority = issuingAuthority;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRegTime() {
|
||||||
|
return regTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRegTime(String regTime) {
|
||||||
|
this.regTime = regTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAddress() {
|
||||||
|
return address;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAddress(String address) {
|
||||||
|
this.address = address;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getOwnerName() {
|
||||||
|
return ownerName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOwnerName(String ownerName) {
|
||||||
|
this.ownerName = ownerName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getEngine() {
|
||||||
|
return engine;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEngine(String engine) {
|
||||||
|
this.engine = engine;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getVin() {
|
||||||
|
return vin;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setVin(String vin) {
|
||||||
|
this.vin = vin;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLicensedateOfissue() {
|
||||||
|
return licensedateOfissue;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLicensedateOfissue(String licensedateOfissue) {
|
||||||
|
this.licensedateOfissue = licensedateOfissue;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getVcltype() {
|
||||||
|
return vcltype;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setVcltype(String vcltype) {
|
||||||
|
this.vcltype = vcltype;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getVclBrand() {
|
||||||
|
return vclBrand;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setVclBrand(String vclBrand) {
|
||||||
|
this.vclBrand = vclBrand;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getNatureOfUsage() {
|
||||||
|
return natureOfUsage;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNatureOfUsage(String natureOfUsage) {
|
||||||
|
this.natureOfUsage = natureOfUsage;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -83,6 +83,8 @@ public class HuoYuanDelBean {
|
|||||||
private String vehicleTypeName;
|
private String vehicleTypeName;
|
||||||
private int vehicleLength;
|
private int vehicleLength;
|
||||||
private String vehicleLengthName;
|
private String vehicleLengthName;
|
||||||
|
private String carNumber;
|
||||||
|
private String carId;
|
||||||
private String namedDrivers;
|
private String namedDrivers;
|
||||||
private String requirement;
|
private String requirement;
|
||||||
private String totalFreight;
|
private String totalFreight;
|
||||||
@ -97,6 +99,23 @@ public class HuoYuanDelBean {
|
|||||||
private Object contactName;
|
private Object contactName;
|
||||||
private Object contactPhone;
|
private Object contactPhone;
|
||||||
|
|
||||||
|
|
||||||
|
public String getCarNumber() {
|
||||||
|
return carNumber == null ? "" : carNumber;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCarNumber(String carNumber) {
|
||||||
|
this.carNumber = carNumber;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCarId() {
|
||||||
|
return carId == null ? "" : carId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCarId(String carId) {
|
||||||
|
this.carId = carId;
|
||||||
|
}
|
||||||
|
|
||||||
public int getId() {
|
public int getId() {
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -55,6 +55,33 @@ public class OCRBankBean {
|
|||||||
private String validDate;
|
private String validDate;
|
||||||
private String bankCardType;
|
private String bankCardType;
|
||||||
private String bankName;
|
private String bankName;
|
||||||
|
private String expiryDate;
|
||||||
|
private String type;
|
||||||
|
private String cardNumber;
|
||||||
|
|
||||||
|
public String getExpiryDate() {
|
||||||
|
return expiryDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setExpiryDate(String expiryDate) {
|
||||||
|
this.expiryDate = expiryDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getType() {
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setType(String type) {
|
||||||
|
this.type = type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCardNumber() {
|
||||||
|
return cardNumber;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCardNumber(String cardNumber) {
|
||||||
|
this.cardNumber = cardNumber;
|
||||||
|
}
|
||||||
|
|
||||||
public int getId() {
|
public int getId() {
|
||||||
return id;
|
return id;
|
||||||
|
|||||||
@ -60,6 +60,33 @@ public class OCRCardBackBean {
|
|||||||
private String startTime;
|
private String startTime;
|
||||||
private String endTime;
|
private String endTime;
|
||||||
private String organizationName;
|
private String organizationName;
|
||||||
|
private String validFrom;
|
||||||
|
private String validTo;
|
||||||
|
private String issue;
|
||||||
|
|
||||||
|
public String getIssue() {
|
||||||
|
return issue;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIssue(String issue) {
|
||||||
|
this.issue = issue;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getValidFrom() {
|
||||||
|
return validFrom;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setValidFrom(String validFrom) {
|
||||||
|
this.validFrom = validFrom;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getValidTo() {
|
||||||
|
return validTo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setValidTo(String validTo) {
|
||||||
|
this.validTo = validTo;
|
||||||
|
}
|
||||||
|
|
||||||
public int getId() {
|
public int getId() {
|
||||||
return id;
|
return id;
|
||||||
|
|||||||
@ -63,6 +63,51 @@ public class OCRCardBean {
|
|||||||
private String cardId;
|
private String cardId;
|
||||||
private String birthday;
|
private String birthday;
|
||||||
private String sex;
|
private String sex;
|
||||||
|
private String ethnicity;
|
||||||
|
private String idcard;
|
||||||
|
private String birth;
|
||||||
|
private String validFrom;
|
||||||
|
private String validTo;
|
||||||
|
|
||||||
|
public String getEthnicity() {
|
||||||
|
return ethnicity;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEthnicity(String ethnicity) {
|
||||||
|
this.ethnicity = ethnicity;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getIdcard() {
|
||||||
|
return idcard;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIdcard(String idcard) {
|
||||||
|
this.idcard = idcard;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getBirth() {
|
||||||
|
return birth;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBirth(String birth) {
|
||||||
|
this.birth = birth;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getValidFrom() {
|
||||||
|
return validFrom;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setValidFrom(String validFrom) {
|
||||||
|
this.validFrom = validFrom;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getValidTo() {
|
||||||
|
return validTo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setValidTo(String validTo) {
|
||||||
|
this.validTo = validTo;
|
||||||
|
}
|
||||||
|
|
||||||
public int getId() {
|
public int getId() {
|
||||||
return id;
|
return id;
|
||||||
|
|||||||
@ -58,6 +58,42 @@ public class OCRDrivingLicenseBackBean {
|
|||||||
private int id;
|
private int id;
|
||||||
private String url;
|
private String url;
|
||||||
private String archivesName;
|
private String archivesName;
|
||||||
|
private String fileNumber;
|
||||||
|
private String record;
|
||||||
|
private String name;
|
||||||
|
private String issuingAuthority;
|
||||||
|
|
||||||
|
public String getFileNumber() {
|
||||||
|
return fileNumber;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFileNumber(String fileNumber) {
|
||||||
|
this.fileNumber = fileNumber;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRecord() {
|
||||||
|
return record;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRecord(String record) {
|
||||||
|
this.record = record;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setName(String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getIssuingAuthority() {
|
||||||
|
return issuingAuthority;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIssuingAuthority(String issuingAuthority) {
|
||||||
|
this.issuingAuthority = issuingAuthority;
|
||||||
|
}
|
||||||
|
|
||||||
public int getId() {
|
public int getId() {
|
||||||
return id;
|
return id;
|
||||||
|
|||||||
@ -68,6 +68,70 @@ public class OCRDrivingLicenseBean {
|
|||||||
private String allowType;
|
private String allowType;
|
||||||
private String sex;
|
private String sex;
|
||||||
private String startTime;
|
private String startTime;
|
||||||
|
private String beginDate;
|
||||||
|
private String endDate;
|
||||||
|
private String firstGetDocDate;
|
||||||
|
private String idcard;
|
||||||
|
private String quasiDriveType;
|
||||||
|
private String issuingAuthority;
|
||||||
|
private String nationality;
|
||||||
|
|
||||||
|
|
||||||
|
public String getBeginDate() {
|
||||||
|
return beginDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBeginDate(String beginDate) {
|
||||||
|
this.beginDate = beginDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getEndDate() {
|
||||||
|
return endDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEndDate(String endDate) {
|
||||||
|
this.endDate = endDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFirstGetDocDate() {
|
||||||
|
return firstGetDocDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFirstGetDocDate(String firstGetDocDate) {
|
||||||
|
this.firstGetDocDate = firstGetDocDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getIdcard() {
|
||||||
|
return idcard;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIdcard(String idcard) {
|
||||||
|
this.idcard = idcard;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getQuasiDriveType() {
|
||||||
|
return quasiDriveType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setQuasiDriveType(String quasiDriveType) {
|
||||||
|
this.quasiDriveType = quasiDriveType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getIssuingAuthority() {
|
||||||
|
return issuingAuthority;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIssuingAuthority(String issuingAuthority) {
|
||||||
|
this.issuingAuthority = issuingAuthority;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getNationality() {
|
||||||
|
return nationality;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNationality(String nationality) {
|
||||||
|
this.nationality = nationality;
|
||||||
|
}
|
||||||
|
|
||||||
public int getId() {
|
public int getId() {
|
||||||
return id;
|
return id;
|
||||||
|
|||||||
@ -0,0 +1,200 @@
|
|||||||
|
package com.arpa.hndahesudintocctmsdriver.bean;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName OCRQualiBean
|
||||||
|
* @Author john
|
||||||
|
* @Date 2024/11/19 15:53
|
||||||
|
* @Description TODO
|
||||||
|
*/
|
||||||
|
public class OCRQualiBean {
|
||||||
|
|
||||||
|
|
||||||
|
private int code;
|
||||||
|
private DataDTO data;
|
||||||
|
private String msg;
|
||||||
|
private String remark;
|
||||||
|
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 String getRemark() {
|
||||||
|
return remark;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRemark(String remark) {
|
||||||
|
this.remark = remark;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getRes() {
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRes(int res) {
|
||||||
|
this.res = res;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isSuccess() {
|
||||||
|
return success;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSuccess(boolean success) {
|
||||||
|
this.success = success;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class DataDTO {
|
||||||
|
private String address;
|
||||||
|
private List<QualificationCategoryListDTO> qualification_category_list;
|
||||||
|
private String nationality;
|
||||||
|
private String issuing_authority;
|
||||||
|
private String sex;
|
||||||
|
private String birth_date;
|
||||||
|
private String integrity_assessment_info;
|
||||||
|
private String name;
|
||||||
|
private String driving_class;
|
||||||
|
private String certificate_number;
|
||||||
|
private String continuing_education_info;
|
||||||
|
|
||||||
|
public String getAddress() {
|
||||||
|
return address;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAddress(String address) {
|
||||||
|
this.address = address;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<QualificationCategoryListDTO> getQualification_category_list() {
|
||||||
|
return qualification_category_list;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setQualification_category_list(List<QualificationCategoryListDTO> qualification_category_list) {
|
||||||
|
this.qualification_category_list = qualification_category_list;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getNationality() {
|
||||||
|
return nationality;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNationality(String nationality) {
|
||||||
|
this.nationality = nationality;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getIssuing_authority() {
|
||||||
|
return issuing_authority;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIssuing_authority(String issuing_authority) {
|
||||||
|
this.issuing_authority = issuing_authority;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSex() {
|
||||||
|
return sex;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSex(String sex) {
|
||||||
|
this.sex = sex;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getBirth_date() {
|
||||||
|
return birth_date;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBirth_date(String birth_date) {
|
||||||
|
this.birth_date = birth_date;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getIntegrity_assessment_info() {
|
||||||
|
return integrity_assessment_info;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIntegrity_assessment_info(String integrity_assessment_info) {
|
||||||
|
this.integrity_assessment_info = integrity_assessment_info;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setName(String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDriving_class() {
|
||||||
|
return driving_class;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDriving_class(String driving_class) {
|
||||||
|
this.driving_class = driving_class;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCertificate_number() {
|
||||||
|
return certificate_number;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCertificate_number(String certificate_number) {
|
||||||
|
this.certificate_number = certificate_number;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getContinuing_education_info() {
|
||||||
|
return continuing_education_info;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setContinuing_education_info(String continuing_education_info) {
|
||||||
|
this.continuing_education_info = continuing_education_info;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class QualificationCategoryListDTO {
|
||||||
|
private String issue_date;
|
||||||
|
private String expiry_date;
|
||||||
|
private String category;
|
||||||
|
|
||||||
|
public String getIssue_date() {
|
||||||
|
return issue_date;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIssue_date(String issue_date) {
|
||||||
|
this.issue_date = issue_date;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getExpiry_date() {
|
||||||
|
return expiry_date;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setExpiry_date(String expiry_date) {
|
||||||
|
this.expiry_date = expiry_date;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCategory() {
|
||||||
|
return category;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCategory(String category) {
|
||||||
|
this.category = category;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,177 @@
|
|||||||
|
package com.arpa.hndahesudintocctmsdriver.bean;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName OCRRoadBean
|
||||||
|
* @Author john
|
||||||
|
* @Date 2024/11/19 17:05
|
||||||
|
* @Description TODO
|
||||||
|
*/
|
||||||
|
public class OCRRoadBean {
|
||||||
|
|
||||||
|
|
||||||
|
private int code;
|
||||||
|
private DataDTO data;
|
||||||
|
private String msg;
|
||||||
|
private String remark;
|
||||||
|
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 String getRemark() {
|
||||||
|
return remark;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRemark(String remark) {
|
||||||
|
this.remark = remark;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getRes() {
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRes(int res) {
|
||||||
|
this.res = res;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isSuccess() {
|
||||||
|
return success;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSuccess(boolean success) {
|
||||||
|
this.success = success;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class DataDTO {
|
||||||
|
private String vehicleWeight;
|
||||||
|
private String issuingAuthority;
|
||||||
|
private String ownerName;
|
||||||
|
private String businessCertificate;
|
||||||
|
private String economicType;
|
||||||
|
private String businessScope;
|
||||||
|
private String vehicleNumber;
|
||||||
|
private String licenseNumber;
|
||||||
|
private String vehicleSize;
|
||||||
|
private String ownerAddress;
|
||||||
|
private String issueDate;
|
||||||
|
private String vehicleType;
|
||||||
|
|
||||||
|
public String getVehicleWeight() {
|
||||||
|
return vehicleWeight;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setVehicleWeight(String vehicleWeight) {
|
||||||
|
this.vehicleWeight = vehicleWeight;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getIssuingAuthority() {
|
||||||
|
return issuingAuthority;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIssuingAuthority(String issuingAuthority) {
|
||||||
|
this.issuingAuthority = issuingAuthority;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getOwnerName() {
|
||||||
|
return ownerName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOwnerName(String ownerName) {
|
||||||
|
this.ownerName = ownerName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getBusinessCertificate() {
|
||||||
|
return businessCertificate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBusinessCertificate(String businessCertificate) {
|
||||||
|
this.businessCertificate = businessCertificate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getEconomicType() {
|
||||||
|
return economicType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEconomicType(String economicType) {
|
||||||
|
this.economicType = economicType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getBusinessScope() {
|
||||||
|
return businessScope;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBusinessScope(String businessScope) {
|
||||||
|
this.businessScope = businessScope;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getVehicleNumber() {
|
||||||
|
return vehicleNumber;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setVehicleNumber(String vehicleNumber) {
|
||||||
|
this.vehicleNumber = vehicleNumber;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLicenseNumber() {
|
||||||
|
return licenseNumber;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLicenseNumber(String licenseNumber) {
|
||||||
|
this.licenseNumber = licenseNumber;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getVehicleSize() {
|
||||||
|
return vehicleSize;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setVehicleSize(String vehicleSize) {
|
||||||
|
this.vehicleSize = vehicleSize;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getOwnerAddress() {
|
||||||
|
return ownerAddress;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOwnerAddress(String ownerAddress) {
|
||||||
|
this.ownerAddress = ownerAddress;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getIssueDate() {
|
||||||
|
return issueDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIssueDate(String issueDate) {
|
||||||
|
this.issueDate = issueDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getVehicleType() {
|
||||||
|
return vehicleType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setVehicleType(String vehicleType) {
|
||||||
|
this.vehicleType = vehicleType;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -71,6 +71,114 @@ public class OCRVehicleBackLicenseBean {
|
|||||||
private String fileNumber;
|
private String fileNumber;
|
||||||
private String carNumber;
|
private String carNumber;
|
||||||
private int licenseId;
|
private int licenseId;
|
||||||
|
private String note;
|
||||||
|
private String passengers;
|
||||||
|
private String vclDrwTn;
|
||||||
|
private String overallDimen;
|
||||||
|
private String vclN;
|
||||||
|
private String enTn;
|
||||||
|
private String loadTon;
|
||||||
|
private String inspectionRecord;
|
||||||
|
private String barCode;
|
||||||
|
private String approveTon;
|
||||||
|
private String recordId;
|
||||||
|
private String issuingAuthority;
|
||||||
|
|
||||||
|
public String getNote() {
|
||||||
|
return note;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNote(String note) {
|
||||||
|
this.note = note;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPassengers() {
|
||||||
|
return passengers;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPassengers(String passengers) {
|
||||||
|
this.passengers = passengers;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getVclDrwTn() {
|
||||||
|
return vclDrwTn;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setVclDrwTn(String vclDrwTn) {
|
||||||
|
this.vclDrwTn = vclDrwTn;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getOverallDimen() {
|
||||||
|
return overallDimen;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOverallDimen(String overallDimen) {
|
||||||
|
this.overallDimen = overallDimen;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getVclN() {
|
||||||
|
return vclN;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setVclN(String vclN) {
|
||||||
|
this.vclN = vclN;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getEnTn() {
|
||||||
|
return enTn;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEnTn(String enTn) {
|
||||||
|
this.enTn = enTn;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLoadTon() {
|
||||||
|
return loadTon;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLoadTon(String loadTon) {
|
||||||
|
this.loadTon = loadTon;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getInspectionRecord() {
|
||||||
|
return inspectionRecord;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInspectionRecord(String inspectionRecord) {
|
||||||
|
this.inspectionRecord = inspectionRecord;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getBarCode() {
|
||||||
|
return barCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBarCode(String barCode) {
|
||||||
|
this.barCode = barCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getApproveTon() {
|
||||||
|
return approveTon;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setApproveTon(String approveTon) {
|
||||||
|
this.approveTon = approveTon;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRecordId() {
|
||||||
|
return recordId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRecordId(String recordId) {
|
||||||
|
this.recordId = recordId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getIssuingAuthority() {
|
||||||
|
return issuingAuthority;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIssuingAuthority(String issuingAuthority) {
|
||||||
|
this.issuingAuthority = issuingAuthority;
|
||||||
|
}
|
||||||
|
|
||||||
public String getIsSave() {
|
public String getIsSave() {
|
||||||
return isSave;
|
return isSave;
|
||||||
|
|||||||
@ -63,6 +63,96 @@ public class OCRVehicleLicenseBean {
|
|||||||
private String url;
|
private String url;
|
||||||
private String vehicleNumber;
|
private String vehicleNumber;
|
||||||
private String licenseId;
|
private String licenseId;
|
||||||
|
private String ownerName;
|
||||||
|
private String regTime;
|
||||||
|
private String issuingAuthority;
|
||||||
|
private String engine;
|
||||||
|
private String vclN;
|
||||||
|
private String licensedateOfissue;
|
||||||
|
private String vin;
|
||||||
|
private String vcltype;
|
||||||
|
private String vclBrand;
|
||||||
|
private String natureOfUsage;
|
||||||
|
|
||||||
|
public String getOwnerName() {
|
||||||
|
return ownerName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOwnerName(String ownerName) {
|
||||||
|
this.ownerName = ownerName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRegTime() {
|
||||||
|
return regTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRegTime(String regTime) {
|
||||||
|
this.regTime = regTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getIssuingAuthority() {
|
||||||
|
return issuingAuthority;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIssuingAuthority(String issuingAuthority) {
|
||||||
|
this.issuingAuthority = issuingAuthority;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getEngine() {
|
||||||
|
return engine;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEngine(String engine) {
|
||||||
|
this.engine = engine;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getVclN() {
|
||||||
|
return vclN;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setVclN(String vclN) {
|
||||||
|
this.vclN = vclN;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLicensedateOfissue() {
|
||||||
|
return licensedateOfissue;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLicensedateOfissue(String licensedateOfissue) {
|
||||||
|
this.licensedateOfissue = licensedateOfissue;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getVin() {
|
||||||
|
return vin;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setVin(String vin) {
|
||||||
|
this.vin = vin;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getVcltype() {
|
||||||
|
return vcltype;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setVcltype(String vcltype) {
|
||||||
|
this.vcltype = vcltype;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getVclBrand() {
|
||||||
|
return vclBrand;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setVclBrand(String vclBrand) {
|
||||||
|
this.vclBrand = vclBrand;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getNatureOfUsage() {
|
||||||
|
return natureOfUsage;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNatureOfUsage(String natureOfUsage) {
|
||||||
|
this.natureOfUsage = natureOfUsage;
|
||||||
|
}
|
||||||
|
|
||||||
public String getLicenseId() {
|
public String getLicenseId() {
|
||||||
return licenseId;
|
return licenseId;
|
||||||
|
|||||||
@ -1,41 +0,0 @@
|
|||||||
package com.arpa.hndahesudintocctmsdriver.bean;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ClassName ToH5Bean
|
|
||||||
* @Author john
|
|
||||||
* @Date 2024/9/9 10:01
|
|
||||||
* @Description TODO
|
|
||||||
*/
|
|
||||||
public class ToH5Bean implements Serializable {
|
|
||||||
|
|
||||||
private int id;
|
|
||||||
private String carNumber;
|
|
||||||
private String carId;
|
|
||||||
|
|
||||||
|
|
||||||
public int getId() {
|
|
||||||
return id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setId(int id) {
|
|
||||||
this.id = id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getCarNumber() {
|
|
||||||
return carNumber;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setCarNumber(String carNumber) {
|
|
||||||
this.carNumber = carNumber;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getCarId() {
|
|
||||||
return carId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setCarId(String carId) {
|
|
||||||
this.carId = carId;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -0,0 +1,56 @@
|
|||||||
|
package com.arpa.hndahesudintocctmsdriver.bean;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName WaybillStatusBean
|
||||||
|
* @Author john
|
||||||
|
* @Date 2024/10/14 15:40
|
||||||
|
* @Description TODO
|
||||||
|
*/
|
||||||
|
public class WaybillStatusBean {
|
||||||
|
|
||||||
|
private int res;
|
||||||
|
private int code;
|
||||||
|
private boolean success;
|
||||||
|
private String msg;
|
||||||
|
private String data;
|
||||||
|
|
||||||
|
public int getRes() {
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRes(int res) {
|
||||||
|
this.res = res;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getCode() {
|
||||||
|
return code;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCode(int code) {
|
||||||
|
this.code = code;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isSuccess() {
|
||||||
|
return success;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSuccess(boolean success) {
|
||||||
|
this.success = success;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMsg() {
|
||||||
|
return msg;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMsg(String msg) {
|
||||||
|
this.msg = msg;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getData() {
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setData(String data) {
|
||||||
|
this.data = data;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,11 @@
|
|||||||
|
package com.arpa.hndahesudintocctmsdriver.cuspop
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName MyRequestCallback
|
||||||
|
* @Author john
|
||||||
|
* @Date 2024/10/28 17:19
|
||||||
|
* @Description TODO
|
||||||
|
*/
|
||||||
|
interface MyRequestCallback{
|
||||||
|
fun onResult(allGranted: Boolean, grantedList: List<String?>, deniedList: List<String?>)
|
||||||
|
}
|
||||||
@ -0,0 +1,36 @@
|
|||||||
|
package com.arpa.hndahesudintocctmsdriver.cuspop
|
||||||
|
|
||||||
|
import android.content.Context
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.R
|
||||||
|
import com.lxj.xpopup.core.PositionPopupView
|
||||||
|
import com.lxj.xpopup.enums.DragOrientation
|
||||||
|
import kotlinx.android.synthetic.main.popup_qq_msg.view.tvMessage
|
||||||
|
import kotlinx.android.synthetic.main.popup_qq_msg.view.tvTitle
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Description: 自定义自由定位Position弹窗
|
||||||
|
* Create by dance, at 2019/6/14
|
||||||
|
*/
|
||||||
|
class TopMsgPopup(context: Context,title:String, message: String) : PositionPopupView(context) {
|
||||||
|
|
||||||
|
private var message: String
|
||||||
|
private var title: String
|
||||||
|
|
||||||
|
init {
|
||||||
|
this.message = message
|
||||||
|
this.title = title
|
||||||
|
}
|
||||||
|
override fun getImplLayoutId(): Int {
|
||||||
|
return R.layout.popup_qq_msg
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun getDragOrientation(): DragOrientation {
|
||||||
|
return DragOrientation.DragToLeft
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onCreate() {
|
||||||
|
super.onCreate()
|
||||||
|
tvMessage.text = message
|
||||||
|
tvTitle.text = title
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -8,9 +8,26 @@ package com.arpa.hndahesudintocctmsdriver.event;
|
|||||||
*/
|
*/
|
||||||
public class HomeWaybillEvent {
|
public class HomeWaybillEvent {
|
||||||
|
|
||||||
|
private int message;
|
||||||
|
|
||||||
|
|
||||||
|
public int getMessage() {
|
||||||
|
return message;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMessage(int message) {
|
||||||
|
this.message = message;
|
||||||
|
}
|
||||||
|
|
||||||
public HomeWaybillEvent() {
|
public HomeWaybillEvent() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param message 1:刷新运单列表
|
||||||
|
*/
|
||||||
|
public HomeWaybillEvent(int message) {
|
||||||
|
this.message = message;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -6,11 +6,11 @@ package com.arpa.hndahesudintocctmsdriver.event;
|
|||||||
* @date 2021/10/20 14:43
|
* @date 2021/10/20 14:43
|
||||||
* @description:
|
* @description:
|
||||||
*/
|
*/
|
||||||
public class PdfResEvent {
|
public class WalletEvent {
|
||||||
|
|
||||||
private String message;
|
private String message;
|
||||||
|
|
||||||
public PdfResEvent(String message) {
|
public WalletEvent(String message) {
|
||||||
this.message = message;
|
this.message = message;
|
||||||
}
|
}
|
||||||
public String getMessage() {
|
public String getMessage() {
|
||||||
@ -13,6 +13,7 @@ import com.arpa.hndahesudintocctmsdriver.BuildConfig;
|
|||||||
import com.arpa.hndahesudintocctmsdriver.parts.AuthParts;
|
import com.arpa.hndahesudintocctmsdriver.parts.AuthParts;
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.MessageUtils;
|
import com.arpa.hndahesudintocctmsdriver.util.MessageUtils;
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.msg.MsgUtil;
|
import com.arpa.hndahesudintocctmsdriver.util.msg.MsgUtil;
|
||||||
|
import com.dahe.mylibrary.utils.ToastUtils;
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.arpa.hndahesudintocctmsdriver.bean.DriverAuthDataBean;
|
import com.arpa.hndahesudintocctmsdriver.bean.DriverAuthDataBean;
|
||||||
import com.arpa.hndahesudintocctmsdriver.bean.FqBean;
|
import com.arpa.hndahesudintocctmsdriver.bean.FqBean;
|
||||||
@ -42,6 +43,10 @@ public class ALProcess {
|
|||||||
|
|
||||||
public static void verification(Context con){
|
public static void verification(Context con){
|
||||||
DriverAuthDataBean auth= AuthParts.getAuth(con);
|
DriverAuthDataBean auth= AuthParts.getAuth(con);
|
||||||
|
if (auth==null){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
Identity idy=new Identity();
|
Identity idy=new Identity();
|
||||||
//企业代码
|
//企业代码
|
||||||
idy.setEnterpriseCode(BuildConfig.isTest?ENTERPRISE_CODE_TEXT:ENTERPRISE_CODE);
|
idy.setEnterpriseCode(BuildConfig.isTest?ENTERPRISE_CODE_TEXT:ENTERPRISE_CODE);
|
||||||
|
|||||||
@ -3,6 +3,7 @@ package com.arpa.hndahesudintocctmsdriver.report;
|
|||||||
import android.app.Application;
|
import android.app.Application;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
|
import android.text.TextUtils;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
import com.amap.api.location.AMapLocationClient;
|
import com.amap.api.location.AMapLocationClient;
|
||||||
@ -78,6 +79,9 @@ public class JTTProcess {
|
|||||||
ShippingNoteInfo sni=new ShippingNoteInfo();
|
ShippingNoteInfo sni=new ShippingNoteInfo();
|
||||||
StartOrderBean.DataDTO.WayChildrenDTO startWay=sob.getData().getWayChildren().get(0);
|
StartOrderBean.DataDTO.WayChildrenDTO startWay=sob.getData().getWayChildren().get(0);
|
||||||
StartOrderBean.DataDTO.WayChildrenDTO endWay=sob.getData().getWayChildren().get(sob.getData().getWayChildren().size()-1);
|
StartOrderBean.DataDTO.WayChildrenDTO endWay=sob.getData().getWayChildren().get(sob.getData().getWayChildren().size()-1);
|
||||||
|
if (TextUtils.isEmpty(endWay.getLatitude())||TextUtils.isEmpty(endWay.getLongitude())){
|
||||||
|
return;
|
||||||
|
}
|
||||||
sni.setShippingNoteNumber(sob.getData().getShippingNoteNumber());
|
sni.setShippingNoteNumber(sob.getData().getShippingNoteNumber());
|
||||||
sni.setSerialNumber("0000");
|
sni.setSerialNumber("0000");
|
||||||
sni.setStartLatitude(Double.parseDouble(startWay.getLatitude()));
|
sni.setStartLatitude(Double.parseDouble(startWay.getLatitude()));
|
||||||
@ -115,6 +119,9 @@ public class JTTProcess {
|
|||||||
//参数 ShippingNoteInfo 和 start 接口中的参数 ShippingNoteInfo 相
|
//参数 ShippingNoteInfo 和 start 接口中的参数 ShippingNoteInfo 相
|
||||||
//同,这里 shippingNoteInfo 信息只需传入运单号和分单号即可
|
//同,这里 shippingNoteInfo 信息只需传入运单号和分单号即可
|
||||||
public static void send(Context con,StartOrderBean sob,String remark){
|
public static void send(Context con,StartOrderBean sob,String remark){
|
||||||
|
if (sob.getData()==null){
|
||||||
|
return;
|
||||||
|
}
|
||||||
ShippingNoteInfo[] snis=new ShippingNoteInfo[1];
|
ShippingNoteInfo[] snis=new ShippingNoteInfo[1];
|
||||||
ShippingNoteInfo sni=new ShippingNoteInfo();
|
ShippingNoteInfo sni=new ShippingNoteInfo();
|
||||||
sni.setShippingNoteNumber(sob.getData().getShippingNoteNumber());
|
sni.setShippingNoteNumber(sob.getData().getShippingNoteNumber());
|
||||||
@ -143,6 +150,9 @@ public class JTTProcess {
|
|||||||
ShippingNoteInfo sni=new ShippingNoteInfo();
|
ShippingNoteInfo sni=new ShippingNoteInfo();
|
||||||
StartOrderBean.DataDTO.WayChildrenDTO startWay=sob.getData().getWayChildren().get(0);
|
StartOrderBean.DataDTO.WayChildrenDTO startWay=sob.getData().getWayChildren().get(0);
|
||||||
StartOrderBean.DataDTO.WayChildrenDTO endWay=sob.getData().getWayChildren().get(sob.getData().getWayChildren().size()-1);
|
StartOrderBean.DataDTO.WayChildrenDTO endWay=sob.getData().getWayChildren().get(sob.getData().getWayChildren().size()-1);
|
||||||
|
if (TextUtils.isEmpty(endWay.getLatitude())||TextUtils.isEmpty(endWay.getLongitude())){
|
||||||
|
return;
|
||||||
|
}
|
||||||
sni.setShippingNoteNumber(sob.getData().getShippingNoteNumber());
|
sni.setShippingNoteNumber(sob.getData().getShippingNoteNumber());
|
||||||
sni.setSerialNumber("0000");
|
sni.setSerialNumber("0000");
|
||||||
sni.setStartLatitude(Double.parseDouble(startWay.getLatitude()));
|
sni.setStartLatitude(Double.parseDouble(startWay.getLatitude()));
|
||||||
@ -176,6 +186,9 @@ public class JTTProcess {
|
|||||||
ShippingNoteInfo sni=new ShippingNoteInfo();
|
ShippingNoteInfo sni=new ShippingNoteInfo();
|
||||||
StartOrderBean.DataDTO.WayChildrenDTO startWay=sob.getData().getWayChildren().get(0);
|
StartOrderBean.DataDTO.WayChildrenDTO startWay=sob.getData().getWayChildren().get(0);
|
||||||
StartOrderBean.DataDTO.WayChildrenDTO endWay=sob.getData().getWayChildren().get(sob.getData().getWayChildren().size()-1);
|
StartOrderBean.DataDTO.WayChildrenDTO endWay=sob.getData().getWayChildren().get(sob.getData().getWayChildren().size()-1);
|
||||||
|
if (TextUtils.isEmpty(endWay.getLatitude())||TextUtils.isEmpty(endWay.getLongitude())){
|
||||||
|
return;
|
||||||
|
}
|
||||||
sni.setShippingNoteNumber(sob.getData().getShippingNoteNumber());
|
sni.setShippingNoteNumber(sob.getData().getShippingNoteNumber());
|
||||||
sni.setSerialNumber("0000");
|
sni.setSerialNumber("0000");
|
||||||
sni.setStartLatitude(Double.parseDouble(startWay.getLatitude()));
|
sni.setStartLatitude(Double.parseDouble(startWay.getLatitude()));
|
||||||
@ -208,6 +221,9 @@ public class JTTProcess {
|
|||||||
ShippingNoteInfo sni=new ShippingNoteInfo();
|
ShippingNoteInfo sni=new ShippingNoteInfo();
|
||||||
StartOrderBean.DataDTO.WayChildrenDTO startWay=sob.getData().getWayChildren().get(0);
|
StartOrderBean.DataDTO.WayChildrenDTO startWay=sob.getData().getWayChildren().get(0);
|
||||||
StartOrderBean.DataDTO.WayChildrenDTO endWay=sob.getData().getWayChildren().get(sob.getData().getWayChildren().size()-1);
|
StartOrderBean.DataDTO.WayChildrenDTO endWay=sob.getData().getWayChildren().get(sob.getData().getWayChildren().size()-1);
|
||||||
|
if (TextUtils.isEmpty(endWay.getLatitude())||TextUtils.isEmpty(endWay.getLongitude())){
|
||||||
|
return;
|
||||||
|
}
|
||||||
sni.setShippingNoteNumber(sob.getData().getShippingNoteNumber());
|
sni.setShippingNoteNumber(sob.getData().getShippingNoteNumber());
|
||||||
sni.setSerialNumber("0000");
|
sni.setSerialNumber("0000");
|
||||||
sni.setStartLatitude(Double.parseDouble(startWay.getLatitude()));
|
sni.setStartLatitude(Double.parseDouble(startWay.getLatitude()));
|
||||||
|
|||||||
@ -4,6 +4,7 @@ import android.content.Context;
|
|||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.BuildConfig;
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.map.MapUtil;
|
import com.arpa.hndahesudintocctmsdriver.util.map.MapUtil;
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.arpa.hndahesudintocctmsdriver.request.bean.IDInputBean;
|
import com.arpa.hndahesudintocctmsdriver.request.bean.IDInputBean;
|
||||||
@ -74,6 +75,22 @@ public class AuthRequest {
|
|||||||
RequestUtil.start(1, "saveVehicleLicense", re, con, hd);
|
RequestUtil.start(1, "saveVehicleLicense", re, con, hd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//查询车辆信息-行驶证/app/carDriver/saveVehicleLicense
|
||||||
|
public void getCarInfo(Context con, Handler hd, String carNum) {
|
||||||
|
Map<String,Object> map=new HashMap<>();
|
||||||
|
map.put("carNum",carNum);
|
||||||
|
Request re = OkHttpUtil.posts(new OkDate(BuildConfig.BASE_URL+"app/carDriver/onlyGetVehicleLicense", MapUtil.mapJson(map)), getToken(con), con);
|
||||||
|
RequestUtil.start(1, "getCarInfo", re, con, hd);
|
||||||
|
}
|
||||||
|
|
||||||
|
//绑定车辆信息-行驶证/app/carDriver/saveVehicleLicense
|
||||||
|
public void bindCar(Context con, Handler hd, String carId) {
|
||||||
|
Map<String,Object> map=new HashMap<>();
|
||||||
|
map.put("carId",carId);
|
||||||
|
Request re = OkHttpUtil.posts(new OkDate(BuildConfig.BASE_URL+"app/carDriver/bindCar", MapUtil.mapJson(map)), getToken(con), con);
|
||||||
|
RequestUtil.start(1, "bindCarInfo", re, con, hd);
|
||||||
|
}
|
||||||
|
|
||||||
//上传头像
|
//上传头像
|
||||||
public void upHeadImg(Context con, Handler hd, String imgUrl) {
|
public void upHeadImg(Context con, Handler hd, String imgUrl) {
|
||||||
String mt = "{\"headportrait\": \"" + imgUrl + "\"}";
|
String mt = "{\"headportrait\": \"" + imgUrl + "\"}";
|
||||||
@ -152,6 +169,7 @@ public class AuthRequest {
|
|||||||
Request re = OkHttpUtil.posts(new OkDate(RequestConstant.getAuthUrl(), ""), getToken(con), con);
|
Request re = OkHttpUtil.posts(new OkDate(RequestConstant.getAuthUrl(), ""), getToken(con), con);
|
||||||
RequestUtil.start(1, "authUrl", re, con, hd);
|
RequestUtil.start(1, "authUrl", re, con, hd);
|
||||||
}
|
}
|
||||||
|
|
||||||
//获取车牌颜色
|
//获取车牌颜色
|
||||||
public void getCarColor(Context con, Handler hd) {
|
public void getCarColor(Context con, Handler hd) {
|
||||||
// Map<String, Object> map = new HashMap<>();
|
// Map<String, Object> map = new HashMap<>();
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
package com.arpa.hndahesudintocctmsdriver.request;
|
package com.arpa.hndahesudintocctmsdriver.request;
|
||||||
|
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.BuildConfig;
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.arpa.hndahesudintocctmsdriver.request.bean.LUInputBean;
|
import com.arpa.hndahesudintocctmsdriver.request.bean.LUInputBean;
|
||||||
import com.arpa.hndahesudintocctmsdriver.request.bean.TrackInputBean;
|
import com.arpa.hndahesudintocctmsdriver.request.bean.TrackInputBean;
|
||||||
@ -73,14 +74,16 @@ public class HuoYuanRequset{
|
|||||||
RequestUtil.start(1, HuoYunDelActivity.END,re,con,hd);
|
RequestUtil.start(1, HuoYunDelActivity.END,re,con,hd);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void confirm(String cid,String contractUrl,int wid){
|
// public void confirm2(String cid,int wid){
|
||||||
Map<String,Object> map=new HashMap<>();
|
// Map<String,Object> map=new HashMap<>();
|
||||||
map.put("carId",cid);
|
// map.put("carId",cid);
|
||||||
map.put("orderId",wid);
|
// map.put("orderId",wid);
|
||||||
map.put("contractUrl",contractUrl);
|
// map.put("status",2);
|
||||||
Request re = OkHttpUtil.posts(new OkDate(RequestConstant.getAgreeOrder(),MapUtil.mapJson(map)),getToken(con),con);
|
// map.put("imgUrl","");
|
||||||
RequestUtil.start(1, HuoYunDelActivity.END,re,con,hd);
|
// Request re = OkHttpUtil.posts(new OkDate(BuildConfig.BASE_URL+"/app/driver/waybill/grab",MapUtil.mapJson(map)),getToken(con),con);
|
||||||
}
|
// RequestUtil.start(1, "jfaklsdjfklasjdflk",re,con,hd);
|
||||||
|
// }
|
||||||
|
|
||||||
//获取执行中的运单
|
//获取执行中的运单
|
||||||
public void startOrder(int id){
|
public void startOrder(int id){
|
||||||
Map<String,Object> map=new HashMap<>();
|
Map<String,Object> map=new HashMap<>();
|
||||||
@ -88,6 +91,13 @@ public class HuoYuanRequset{
|
|||||||
Request re = OkHttpUtil.posts(new OkDate(RequestConstant.getGetStartOrder(),MapUtil.mapJson(map)),getToken(con),con);
|
Request re = OkHttpUtil.posts(new OkDate(RequestConstant.getGetStartOrder(),MapUtil.mapJson(map)),getToken(con),con);
|
||||||
RequestUtil.start(1, HuoYuanFragmengt.START_ORDER,re,con,hd);
|
RequestUtil.start(1, HuoYuanFragmengt.START_ORDER,re,con,hd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void startOrder2(int id){
|
||||||
|
Map<String,Object> map=new HashMap<>();
|
||||||
|
map.put("waybillId",id);
|
||||||
|
Request re = OkHttpUtil.posts(new OkDate(RequestConstant.getGetStartOrder(),MapUtil.mapJson(map)),getToken(con),con);
|
||||||
|
RequestUtil.start(1, "refreshorderDetail",re,con,hd);
|
||||||
|
}
|
||||||
//装货
|
//装货
|
||||||
public void loading(LUInputBean lub){
|
public void loading(LUInputBean lub){
|
||||||
Request re = OkHttpUtil.posts(new OkDate(RequestConstant.getLOADING(), gson.toJson(lub)),getToken(con),con);
|
Request re = OkHttpUtil.posts(new OkDate(RequestConstant.getLOADING(), gson.toJson(lub)),getToken(con),con);
|
||||||
@ -151,6 +161,32 @@ public class HuoYuanRequset{
|
|||||||
Request re = OkHttpUtil.posts(new OkDate(RequestConstant.getEvaluationV2(),MapUtil.mapJson(map)),getToken(con),con);
|
Request re = OkHttpUtil.posts(new OkDate(RequestConstant.getEvaluationV2(),MapUtil.mapJson(map)),getToken(con),con);
|
||||||
RequestUtil.start(1, StartYunDanActivity.KEEP_EVALUTE,re,con,hd);
|
RequestUtil.start(1, StartYunDanActivity.KEEP_EVALUTE,re,con,hd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取运单状态
|
||||||
|
* @param waybillId
|
||||||
|
*/
|
||||||
|
public void getWaybillStatus(int waybillId){
|
||||||
|
// Map<String,Object> map=new HashMap<>();
|
||||||
|
// map.put("waybillId",waybillId);
|
||||||
|
Request re = OkHttpUtil.posts(new OkDate(RequestConstant.getGetWaybillStatus()+"?waybillId="+waybillId,""),getToken(con),con);
|
||||||
|
RequestUtil.start(1, "waybillStatus",re,con,hd);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取货源状态
|
||||||
|
* @param orderId
|
||||||
|
*/
|
||||||
|
public void getOrderStatus(int orderId){
|
||||||
|
// Map<String,Object> map=new HashMap<>();
|
||||||
|
// map.put("waybillId",waybillId);
|
||||||
|
Request re = OkHttpUtil.posts(new OkDate(RequestConstant.getGetOrderStatus()+"?orderId="+orderId,""),getToken(con),con);
|
||||||
|
RequestUtil.start(1, "orderStatus",re,con,hd);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public final static String ASYMMETRYWAYBILL="waybill_getAsymmetryWaybill";
|
public final static String ASYMMETRYWAYBILL="waybill_getAsymmetryWaybill";
|
||||||
|
|
||||||
//获取装货失败信息
|
//获取装货失败信息
|
||||||
|
|||||||
@ -3,13 +3,16 @@ package com.arpa.hndahesudintocctmsdriver.request;
|
|||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
|
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.BuildConfig;
|
||||||
import com.arpa.hndahesudintocctmsdriver.ui.login.LoginActivity;
|
import com.arpa.hndahesudintocctmsdriver.ui.login.LoginActivity;
|
||||||
import com.arpa.hndahesudintocctmsdriver.ui.auth.CertificatesActivity;
|
import com.arpa.hndahesudintocctmsdriver.ui.auth.CertificatesActivity;
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.sp.SPUtil;
|
import com.arpa.hndahesudintocctmsdriver.util.sp.SPUtil;
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.http.OkDate;
|
import com.arpa.hndahesudintocctmsdriver.util.http.OkDate;
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.http.OkHttpUtil;
|
import com.arpa.hndahesudintocctmsdriver.util.http.OkHttpUtil;
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.http.RequestUtil;
|
import com.arpa.hndahesudintocctmsdriver.util.http.RequestUtil;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
|
||||||
import okhttp3.Request;
|
import okhttp3.Request;
|
||||||
|
|
||||||
public class OCRRequest {
|
public class OCRRequest {
|
||||||
@ -23,37 +26,101 @@ public class OCRRequest {
|
|||||||
Request re = OkHttpUtil.postFile(new OkDate(RequestConstant.getOrcBank()), getToken(con), file);
|
Request re = OkHttpUtil.postFile(new OkDate(RequestConstant.getOrcBank()), getToken(con), file);
|
||||||
RequestUtil.start(12, "OCR_BANK", re, con, hd);
|
RequestUtil.start(12, "OCR_BANK", re, con, hd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//银行卡识别-中交
|
||||||
|
public void ORCBankZj(Context con, Handler hd, String imgUrl) {
|
||||||
|
Request re = OkHttpUtil.posts(new OkDate(RequestConstant.getOrcBank() + "?imgurl=" + imgUrl, ""), getToken(con), con);
|
||||||
|
RequestUtil.start(1, "OCR_BANK", re, con, hd);
|
||||||
|
}
|
||||||
|
|
||||||
|
//从业资格证-中交
|
||||||
|
public void ORCQualificaZj(Context con, Handler hd, String imgUrl) {
|
||||||
|
Request re = OkHttpUtil.posts(new OkDate(BuildConfig.BASE_URL+"sinoiov/ocr/getTransQualificationCertOCR" + "?imgurl=" + imgUrl, ""), getToken(con), con);
|
||||||
|
RequestUtil.start(1, "ORCQualificaZj", re, con, hd);
|
||||||
|
}
|
||||||
|
|
||||||
|
//道路运输许可证-中交
|
||||||
|
public void ORCRoadLicZj(Context con, Handler hd, String imgUrl) {
|
||||||
|
Request re = OkHttpUtil.posts(new OkDate(BuildConfig.BASE_URL+"sinoiov/ocr/getVehicleRoadLicenseOCR" + "?faceDataUrl=" + imgUrl, ""), getToken(con), con);
|
||||||
|
RequestUtil.start(1, "ORCRoadLicZj", re, con, hd);
|
||||||
|
}
|
||||||
|
|
||||||
//身份证正面识别
|
//身份证正面识别
|
||||||
public void OCRCard(Context con, Handler hd, File file) {
|
public void OCRCard(Context con, Handler hd, File file) {
|
||||||
Request re = OkHttpUtil.postFile(new OkDate(RequestConstant.getIdCardFront()), getToken(con), file);
|
Request re = OkHttpUtil.postFile(new OkDate(RequestConstant.getIdCardFront()), getToken(con), file);
|
||||||
RequestUtil.start(12, CertificatesActivity.TYPE_NAME[0], re, con, hd);
|
RequestUtil.start(12, CertificatesActivity.TYPE_NAME[0], re, con, hd);
|
||||||
}
|
}
|
||||||
|
|
||||||
//身份证背面识别
|
//身份证背面识别
|
||||||
public void OCRCardBack(Context con, Handler hd, File file) {
|
public void OCRCardBack(Context con, Handler hd, File file) {
|
||||||
Request re = OkHttpUtil.postFile(new OkDate(RequestConstant.getIdCardBack()), getToken(con), file);
|
Request re = OkHttpUtil.postFile(new OkDate(RequestConstant.getIdCardBack()), getToken(con), file);
|
||||||
RequestUtil.start(12, CertificatesActivity.TYPE_NAME_BANK[0], re, con, hd);
|
RequestUtil.start(12, CertificatesActivity.TYPE_NAME_BANK[0], re, con, hd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//身份证正面识别-中交
|
||||||
|
public void OCRZjCard(Context con, Handler hd, String imgUrl) {
|
||||||
|
Request re = OkHttpUtil.posts(new OkDate(RequestConstant.getIdCardFront() + "?faceDataUrl=" + imgUrl, ""), getToken(con), con);
|
||||||
|
RequestUtil.start(1, CertificatesActivity.TYPE_NAME[0], re, con, hd);
|
||||||
|
}
|
||||||
|
|
||||||
|
//身份证背面识别-中交
|
||||||
|
public void OCRZjCardBack(Context con, Handler hd, String imgUrl) {
|
||||||
|
Request re = OkHttpUtil.posts(new OkDate(RequestConstant.getIdCardFront() + "?backDataUrl=" + imgUrl, ""), getToken(con), con);
|
||||||
|
RequestUtil.start(1, CertificatesActivity.TYPE_NAME_BANK[0], re, con, hd);
|
||||||
|
}
|
||||||
|
|
||||||
//驾驶证正面识别
|
//驾驶证正面识别
|
||||||
public void OCRDrivingLicense(Context con, Handler hd, File file) {
|
public void OCRDrivingLicense(Context con, Handler hd, File file) {
|
||||||
Request re = OkHttpUtil.postFile(new OkDate(RequestConstant.getDrivingLicense()), getToken(con), file);
|
Request re = OkHttpUtil.postFile(new OkDate(RequestConstant.getDrivingLicense()), getToken(con), file);
|
||||||
RequestUtil.start(12, CertificatesActivity.TYPE_NAME[1], re, con, hd);
|
RequestUtil.start(12, CertificatesActivity.TYPE_NAME[1], re, con, hd);
|
||||||
}
|
}
|
||||||
|
|
||||||
//驾驶证背面识别
|
//驾驶证背面识别
|
||||||
public void OCRDrivingLicenseBack(Context con, Handler hd, File file) {
|
public void OCRDrivingLicenseBack(Context con, Handler hd, File file) {
|
||||||
Request re = OkHttpUtil.postFile(new OkDate(RequestConstant.getDrivingLicenseBack()), getToken(con), file);
|
Request re = OkHttpUtil.postFile(new OkDate(RequestConstant.getDrivingLicenseBack()), getToken(con), file);
|
||||||
RequestUtil.start(12, CertificatesActivity.TYPE_NAME_BANK[1], re, con, hd);
|
RequestUtil.start(12, CertificatesActivity.TYPE_NAME_BANK[1], re, con, hd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//驾驶证正面识别-中交
|
||||||
|
public void OCRDrivingLicenseZj(Context con, Handler hd, String imgUrl){
|
||||||
|
Request re = OkHttpUtil.posts(new OkDate(RequestConstant.getDrivingLicense()+"?faceDataUrl="+imgUrl,""),getToken(con),con);
|
||||||
|
RequestUtil.start(1, CertificatesActivity.TYPE_NAME[1],re,con,hd);
|
||||||
|
}
|
||||||
|
|
||||||
|
//驾驶证背面识别-中交
|
||||||
|
public void OCRDrivingLicenseBackZj(Context con, Handler hd, String imgUrl){
|
||||||
|
Request re = OkHttpUtil.posts(new OkDate(RequestConstant.getDrivingLicense()+"?backDataUrl="+imgUrl,""),getToken(con),con);
|
||||||
|
RequestUtil.start(1, CertificatesActivity.TYPE_NAME_BANK[1],re,con,hd);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//行驶证正面识别
|
//行驶证正面识别
|
||||||
public void OCRVehicleLicense(Context con, Handler hd, File file) {
|
public void OCRVehicleLicense(Context con, Handler hd, File file) {
|
||||||
Request re = OkHttpUtil.postFile(new OkDate(RequestConstant.getVehicleLicense()), getToken(con), file);
|
Request re = OkHttpUtil.postFile(new OkDate(RequestConstant.getVehicleLicense()), getToken(con), file);
|
||||||
RequestUtil.start(12, CertificatesActivity.TYPE_NAME[2], re, con, hd);
|
RequestUtil.start(12, CertificatesActivity.TYPE_NAME[2], re, con, hd);
|
||||||
}
|
}
|
||||||
|
|
||||||
//行驶证背面识别
|
//行驶证背面识别
|
||||||
public void OCRVehicleLicenseBack(Context con, Handler hd, File file, String carId, String carNum, boolean isSave) {
|
public void OCRVehicleLicenseBack(Context con, Handler hd, File file, String carId, String carNum, boolean isSave) {
|
||||||
Request re = OkHttpUtil.postFiles(new OkDate(RequestConstant.getVehicleLicenseBack()), file, getToken(con), carId, carNum, isSave);
|
Request re = OkHttpUtil.postFiles(new OkDate(RequestConstant.getVehicleLicenseBack()), file, getToken(con), carId, carNum, isSave);
|
||||||
RequestUtil.start(12, CertificatesActivity.TYPE_NAME_BANK[2], re, con, hd);
|
RequestUtil.start(12, CertificatesActivity.TYPE_NAME_BANK[2], re, con, hd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//行驶证正面识别-中交
|
||||||
|
public void OCRVehicleLicenseZj(Context con, Handler hd, String imgUrl) {
|
||||||
|
Request re = OkHttpUtil.posts(new OkDate(RequestConstant.getVehicleLicense() + "?faceDataUrl=" + imgUrl, ""), getToken(con), con);
|
||||||
|
RequestUtil.start(1, CertificatesActivity.TYPE_NAME[2], re, con, hd);
|
||||||
|
}
|
||||||
|
|
||||||
|
//行驶证背面识别-中交
|
||||||
|
public void OCRVehicleLicenseBackZj(Context con, Handler hd, String imgUrl) {
|
||||||
|
Request re = OkHttpUtil.posts(new OkDate(RequestConstant.getVehicleLicense() + "?backDataUrl=" + imgUrl, ""), getToken(con), con);
|
||||||
|
RequestUtil.start(1, CertificatesActivity.TYPE_NAME_BANK[2], re, con, hd);
|
||||||
|
}
|
||||||
|
|
||||||
public void OCRPlateLicense(Context con, Handler hd, File file) {
|
public void OCRPlateLicense(Context con, Handler hd, File file) {
|
||||||
Request re = OkHttpUtil.postFile(new OkDate(RequestConstant.getPlateLicense()), getToken(con), file);
|
Request re = OkHttpUtil.postFile(new OkDate(RequestConstant.getPlateLicense()), getToken(con), file);
|
||||||
RequestUtil.start(12, "carName", re, con, hd);
|
RequestUtil.start(12, "carName", re, con, hd);
|
||||||
|
|||||||
@ -56,7 +56,7 @@ public class RequestConstant {
|
|||||||
//运单列表
|
//运单列表
|
||||||
private static final String ORDER_LIST = "/app/driver/waybill/listV2";
|
private static final String ORDER_LIST = "/app/driver/waybill/listV2";
|
||||||
//抢单
|
//抢单
|
||||||
private static final String AGREE_ORDER = "/app/driver/waybill/grabDriverOrdersContruct";
|
private static final String AGREE_ORDER = "/app/driver/waybill/grabDriverOrdersContructV2";
|
||||||
//获取正在执行的运单/运单详情
|
//获取正在执行的运单/运单详情
|
||||||
private static final String GET_START_ORDER = "/app/driver/waybill/getExecuteWaybill";
|
private static final String GET_START_ORDER = "/app/driver/waybill/getExecuteWaybill";
|
||||||
//查看承运合同
|
//查看承运合同
|
||||||
@ -81,6 +81,8 @@ public class RequestConstant {
|
|||||||
private static final String COMPLAINT = "/app/driver/waybill/complaintV2";
|
private static final String COMPLAINT = "/app/driver/waybill/complaintV2";
|
||||||
//保存评价信息
|
//保存评价信息
|
||||||
private static final String EVALUATION_V2 = "/app/driver/waybill/evaluationV2";
|
private static final String EVALUATION_V2 = "/app/driver/waybill/evaluationV2";
|
||||||
|
private static final String GET_WAYBILL_STATUS = "/app/driver/waybill/getWaybillStatus";
|
||||||
|
private static final String GET_ORDER_STATUS = "/app/driver/order/getOrderStatus";
|
||||||
//车辆列表
|
//车辆列表
|
||||||
private static final String GET_CAR_LIST = "/app/carDriver/getCarList";
|
private static final String GET_CAR_LIST = "/app/carDriver/getCarList";
|
||||||
//车辆详情
|
//车辆详情
|
||||||
@ -98,17 +100,21 @@ public class RequestConstant {
|
|||||||
//--ORC识别--
|
//--ORC识别--
|
||||||
|
|
||||||
//银行卡识别
|
//银行卡识别
|
||||||
private static final String ORC_BANK = "/common/ocr/bank";
|
// private static final String ORC_BANK = "/common/ocr/bank";
|
||||||
|
private static final String ORC_BANK = "sinoiov/ocr/getBankcardOCR";
|
||||||
//身份证正面
|
//身份证正面
|
||||||
private static final String ID_CARD_FRONT = "/common/ocr/idCardFront";
|
// private static final String ID_CARD_FRONT = "/common/ocr/idCardFront";
|
||||||
|
private static final String ID_CARD_FRONT = "sinoiov/ocr/getIdCardLicenseV2";
|
||||||
//身份证识别反面
|
//身份证识别反面
|
||||||
private static final String ID_CARD_BACK = "/common/ocr/idCardBack";
|
private static final String ID_CARD_BACK = "/common/ocr/idCardBack";
|
||||||
//驾驶证正面
|
//驾驶证正面
|
||||||
private static final String DRIVING_LICENSE = "/common/ocr/drivingLicense";
|
// private static final String DRIVING_LICENSE = "/common/ocr/drivingLicense";
|
||||||
|
private static final String DRIVING_LICENSE = "sinoiov/ocr/getDrivingLicenseOCRV2";
|
||||||
//驾驶证副页
|
//驾驶证副页
|
||||||
private static final String DRIVING_LICENSE_BACK = "/common/ocr/drivingLicenseBack";
|
private static final String DRIVING_LICENSE_BACK = "/common/ocr/drivingLicenseBack";
|
||||||
//行驶证正面
|
//行驶证正面
|
||||||
private static final String VEHICLE_LICENSE = "/common/ocr/vehicleLicense";
|
// private static final String VEHICLE_LICENSE = "/common/ocr/vehicleLicense";
|
||||||
|
private static final String VEHICLE_LICENSE = "sinoiov/ocr/getVehicleLicenseOCRV2";
|
||||||
//行驶证副页
|
//行驶证副页
|
||||||
private static final String VEHICLE_LICENSE_BACK = "/common/ocr/v2/vehicleBackLicenseV3";
|
private static final String VEHICLE_LICENSE_BACK = "/common/ocr/v2/vehicleBackLicenseV3";
|
||||||
//身份证认证信息
|
//身份证认证信息
|
||||||
@ -124,6 +130,7 @@ public class RequestConstant {
|
|||||||
private static final String DRIVERAUTHLICENSE = "/app/driver/auth/driverAuthLicense";
|
private static final String DRIVERAUTHLICENSE = "/app/driver/auth/driverAuthLicense";
|
||||||
//行驶证认证
|
//行驶证认证
|
||||||
private static final String SAVEVEHICLELICENSE = "/app/carDriver/saveVehicleLicense";
|
private static final String SAVEVEHICLELICENSE = "/app/carDriver/saveVehicleLicense";
|
||||||
|
// private static final String SAVEVEHICLELICENSE = "app/carDriver/save";
|
||||||
//从业资格证认证
|
//从业资格证认证
|
||||||
private static final String DRIVER_AUTH_QUALIFICATION = "/app/driver/auth/driverAuthQualification";
|
private static final String DRIVER_AUTH_QUALIFICATION = "/app/driver/auth/driverAuthQualification";
|
||||||
//车辆等级证书
|
//车辆等级证书
|
||||||
@ -331,6 +338,14 @@ public class RequestConstant {
|
|||||||
return BASE_URL + EVALUATION_V2;
|
return BASE_URL + EVALUATION_V2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static String getGetWaybillStatus() {
|
||||||
|
return BASE_URL + GET_WAYBILL_STATUS;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getGetOrderStatus() {
|
||||||
|
return BASE_URL + GET_ORDER_STATUS;
|
||||||
|
}
|
||||||
|
|
||||||
public static String getDRIVERAUTHIDCARD() {
|
public static String getDRIVERAUTHIDCARD() {
|
||||||
return BASE_URL + DRIVERAUTHIDCARD;
|
return BASE_URL + DRIVERAUTHIDCARD;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -80,6 +80,12 @@ public class UserRequset {
|
|||||||
RequestUtil.start(1, "userdata", re, con, hd);
|
RequestUtil.start(1, "userdata", re, con, hd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//账户信息
|
||||||
|
public void User2() {
|
||||||
|
Request re = OkHttpUtil.posts(new OkDate(RequestConstant.getUserUrl(), ""), getToken(con), con);
|
||||||
|
RequestUtil.start(1, "userdata2", re, con, hd);
|
||||||
|
}
|
||||||
|
|
||||||
//司机认证信息
|
//司机认证信息
|
||||||
public void driverAuthData() {
|
public void driverAuthData() {
|
||||||
String mt = "{}";
|
String mt = "{}";
|
||||||
|
|||||||
@ -16,8 +16,123 @@ public class LicenseInputBean {
|
|||||||
private int driverLicensePhoto;
|
private int driverLicensePhoto;
|
||||||
private String endTime;
|
private String endTime;
|
||||||
private String firstTime;
|
private String firstTime;
|
||||||
|
private String address;
|
||||||
|
private String quasiDriveType;
|
||||||
|
private String beginDate;
|
||||||
|
private String endDate;
|
||||||
|
private String fileNumber;
|
||||||
|
private String issuingAuthority;
|
||||||
|
private String sex;
|
||||||
|
private String name;
|
||||||
|
private String idcard;
|
||||||
|
private String organizationName;
|
||||||
|
private String startTime;
|
||||||
|
private String birthday;
|
||||||
|
private String country;
|
||||||
|
|
||||||
|
public String getBirthday() {
|
||||||
|
return birthday;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBirthday(String birthday) {
|
||||||
|
this.birthday = birthday;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCountry() {
|
||||||
|
return country;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCountry(String country) {
|
||||||
|
this.country = country;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getStartTime() {
|
||||||
|
return startTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStartTime(String startTime) {
|
||||||
|
this.startTime = startTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getOrganizationName() {
|
||||||
|
return organizationName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOrganizationName(String organizationName) {
|
||||||
|
this.organizationName = organizationName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAddress() {
|
||||||
|
return address;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAddress(String address) {
|
||||||
|
this.address = address;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getQuasiDriveType() {
|
||||||
|
return quasiDriveType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setQuasiDriveType(String quasiDriveType) {
|
||||||
|
this.quasiDriveType = quasiDriveType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getBeginDate() {
|
||||||
|
return beginDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBeginDate(String beginDate) {
|
||||||
|
this.beginDate = beginDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getEndDate() {
|
||||||
|
return endDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEndDate(String endDate) {
|
||||||
|
this.endDate = endDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFileNumber() {
|
||||||
|
return fileNumber;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFileNumber(String fileNumber) {
|
||||||
|
this.fileNumber = fileNumber;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getIssuingAuthority() {
|
||||||
|
return issuingAuthority;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIssuingAuthority(String issuingAuthority) {
|
||||||
|
this.issuingAuthority = issuingAuthority;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSex() {
|
||||||
|
return sex;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSex(String sex) {
|
||||||
|
this.sex = sex;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setName(String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getIdcard() {
|
||||||
|
return idcard;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIdcard(String idcard) {
|
||||||
|
this.idcard = idcard;
|
||||||
|
}
|
||||||
|
|
||||||
public String getAllowType() {
|
public String getAllowType() {
|
||||||
return allowType;
|
return allowType;
|
||||||
|
|||||||
@ -62,14 +62,14 @@ public class MakeUpService extends Service {
|
|||||||
@Override
|
@Override
|
||||||
public void onCreate() {
|
public void onCreate() {
|
||||||
super.onCreate();
|
super.onCreate();
|
||||||
palyMp3();
|
// palyMp3();
|
||||||
}
|
}
|
||||||
|
|
||||||
//开始
|
//开始
|
||||||
@Override
|
@Override
|
||||||
public int onStartCommand(Intent intent, int flags, int startId) {
|
public int onStartCommand(Intent intent, int flags, int startId) {
|
||||||
Log.e("服务开启","-----");
|
Log.e("服务开启","-----");
|
||||||
|
palyMp3();
|
||||||
return START_STICKY;
|
return START_STICKY;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -59,7 +59,9 @@ public class TrackService extends Service {
|
|||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
@Override
|
@Override
|
||||||
public IBinder onBind(Intent intent) {return null; }
|
public IBinder onBind(Intent intent) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreate() {
|
public void onCreate() {
|
||||||
@ -95,6 +97,9 @@ public class TrackService extends Service {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void genzong() {
|
public void genzong() {
|
||||||
|
if (l == null || l.getLatitude() == 0d) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
//经度
|
//经度
|
||||||
tib.setLatitude(l.getLatitude() + "");
|
tib.setLatitude(l.getLatitude() + "");
|
||||||
//纬度
|
//纬度
|
||||||
|
|||||||
@ -10,6 +10,7 @@ import android.view.KeyEvent
|
|||||||
import android.widget.*
|
import android.widget.*
|
||||||
import androidx.fragment.app.Fragment
|
import androidx.fragment.app.Fragment
|
||||||
import com.arpa.hndahesudintocctmsdriver.R
|
import com.arpa.hndahesudintocctmsdriver.R
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.event.WalletEvent
|
||||||
import com.arpa.hndahesudintocctmsdriver.ui.home.HomeFragment
|
import com.arpa.hndahesudintocctmsdriver.ui.home.HomeFragment
|
||||||
import com.arpa.hndahesudintocctmsdriver.ui.login.LoginActivity
|
import com.arpa.hndahesudintocctmsdriver.ui.login.LoginActivity
|
||||||
import com.arpa.hndahesudintocctmsdriver.ui.my.MyFragment
|
import com.arpa.hndahesudintocctmsdriver.ui.my.MyFragment
|
||||||
@ -23,6 +24,7 @@ import com.arpa.hndahesudintocctmsdriver.util.view.PanDuanUtil
|
|||||||
import com.google.gson.Gson
|
import com.google.gson.Gson
|
||||||
import com.gyf.cactus.ext.cactusUpdateNotification
|
import com.gyf.cactus.ext.cactusUpdateNotification
|
||||||
import com.permissionx.guolindev.PermissionX
|
import com.permissionx.guolindev.PermissionX
|
||||||
|
import org.greenrobot.eventbus.EventBus
|
||||||
|
|
||||||
@Suppress("DIVISION_BY_ZERO")
|
@Suppress("DIVISION_BY_ZERO")
|
||||||
@SuppressLint("SetTextI18n")
|
@SuppressLint("SetTextI18n")
|
||||||
@ -93,6 +95,7 @@ class MainActivity : BaseAppCompatActivity() {
|
|||||||
bt.hide(fs[bt.index])
|
bt.hide(fs[bt.index])
|
||||||
bt.selectItem(fs[1])
|
bt.selectItem(fs[1])
|
||||||
} else {
|
} else {
|
||||||
|
EventBus.getDefault().post(WalletEvent("refresh"))
|
||||||
bt.setDefaultFragment(fs[1])
|
bt.setDefaultFragment(fs[1])
|
||||||
}
|
}
|
||||||
bt.index = 1
|
bt.index = 1
|
||||||
@ -126,9 +129,9 @@ class MainActivity : BaseAppCompatActivity() {
|
|||||||
bt.index = 3
|
bt.index = 3
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
|
// if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
|
||||||
getPression()
|
// getPression()
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
fun getPression() {
|
fun getPression() {
|
||||||
|
|||||||
@ -4,6 +4,7 @@ import android.content.Context;
|
|||||||
|
|
||||||
import com.arpa.hndahesudintocctmsdriver.event.HomeEvent;
|
import com.arpa.hndahesudintocctmsdriver.event.HomeEvent;
|
||||||
import com.arpa.hndahesudintocctmsdriver.ui.login.LoginActivity;
|
import com.arpa.hndahesudintocctmsdriver.ui.login.LoginActivity;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.SPUtils;
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.sp.SPUtil;
|
import com.arpa.hndahesudintocctmsdriver.util.sp.SPUtil;
|
||||||
|
|
||||||
import org.greenrobot.eventbus.EventBus;
|
import org.greenrobot.eventbus.EventBus;
|
||||||
@ -38,7 +39,8 @@ public class UiAuxiliary {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void delLogin(Context con){
|
public static void delLogin(Context con){
|
||||||
JPushInterface.deleteAlias(con,0);
|
// JPushInterface.deleteAlias(con,0);
|
||||||
|
SPUtils.remove(con,"curWaybillId");
|
||||||
SPUtil.insSP(con,LoginActivity.USER,LoginActivity.USER_TOKEN,"");
|
SPUtil.insSP(con,LoginActivity.USER,LoginActivity.USER_TOKEN,"");
|
||||||
SPUtil.insSP(con,LoginActivity.USER,LoginActivity.USER_UNAME,"");
|
SPUtil.insSP(con,LoginActivity.USER,LoginActivity.USER_UNAME,"");
|
||||||
SPUtil.insSP(con,LoginActivity.USER,LoginActivity.USER_RNAME,"");
|
SPUtil.insSP(con,LoginActivity.USER,LoginActivity.USER_RNAME,"");
|
||||||
|
|||||||
@ -14,6 +14,7 @@ import android.widget.TextView;
|
|||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
|
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.ui.web.WebOnlyOneActivity;
|
||||||
import com.lxj.xpopup.core.CenterPopupView;
|
import com.lxj.xpopup.core.CenterPopupView;
|
||||||
import com.arpa.hndahesudintocctmsdriver.R;
|
import com.arpa.hndahesudintocctmsdriver.R;
|
||||||
import com.arpa.hndahesudintocctmsdriver.ui.web.WebActivity;
|
import com.arpa.hndahesudintocctmsdriver.ui.web.WebActivity;
|
||||||
@ -68,7 +69,7 @@ public class AgreementAlert extends CenterPopupView {
|
|||||||
@Override
|
@Override
|
||||||
public void onClick(View widget) {
|
public void onClick(View widget) {
|
||||||
//用户服务协议点击事件
|
//用户服务协议点击事件
|
||||||
Intent in=new Intent(getContext(), WebActivity.class);
|
Intent in=new Intent(getContext(), WebOnlyOneActivity.class);
|
||||||
in.putExtra("url",url2);
|
in.putExtra("url",url2);
|
||||||
in.putExtra("title","用户服务协议");
|
in.putExtra("title","用户服务协议");
|
||||||
getContext().startActivity(in);
|
getContext().startActivity(in);
|
||||||
@ -87,7 +88,7 @@ public class AgreementAlert extends CenterPopupView {
|
|||||||
@Override
|
@Override
|
||||||
public void onClick(View widget) {
|
public void onClick(View widget) {
|
||||||
//用户服务协议点击事件
|
//用户服务协议点击事件
|
||||||
Intent in=new Intent(getContext(), WebActivity.class);
|
Intent in=new Intent(getContext(), WebOnlyOneActivity.class);
|
||||||
in.putExtra("url",url);
|
in.putExtra("url",url);
|
||||||
in.putExtra("title","隐私政策");
|
in.putExtra("title","隐私政策");
|
||||||
getContext().startActivity(in);
|
getContext().startActivity(in);
|
||||||
|
|||||||
@ -20,9 +20,13 @@ import androidx.annotation.Nullable;
|
|||||||
|
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.bean.OCRQualiBean;
|
||||||
import com.arpa.hndahesudintocctmsdriver.parts.UserParts;
|
import com.arpa.hndahesudintocctmsdriver.parts.UserParts;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.request.OCRRequest;
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.string.StringUtil;
|
import com.arpa.hndahesudintocctmsdriver.util.string.StringUtil;
|
||||||
import com.bumptech.glide.Glide;
|
import com.bumptech.glide.Glide;
|
||||||
|
import com.dahe.mylibrary.utils.ImageLoader;
|
||||||
|
import com.dahe.mylibrary.utils.TimeUtil;
|
||||||
import com.esign.esignsdk.EsignSdk;
|
import com.esign.esignsdk.EsignSdk;
|
||||||
import com.esign.esignsdk.data.AuthEvent;
|
import com.esign.esignsdk.data.AuthEvent;
|
||||||
import com.github.gzuliyujiang.wheelpicker.DatePicker;
|
import com.github.gzuliyujiang.wheelpicker.DatePicker;
|
||||||
@ -83,13 +87,35 @@ public class AuthQualificationActivity extends BaseAppCompatActivity {
|
|||||||
if (CacheGroup.cacheList.get("upload") != null) {
|
if (CacheGroup.cacheList.get("upload") != null) {
|
||||||
ub = gson.fromJson(CacheGroup.cacheList.get("upload"), UploadBean.class);
|
ub = gson.fromJson(CacheGroup.cacheList.get("upload"), UploadBean.class);
|
||||||
if (ub.getCode() == 200) {
|
if (ub.getCode() == 200) {
|
||||||
|
if ("0".equals(type)) {//从业资格识别,党员认证不识别
|
||||||
|
new OCRRequest().ORCQualificaZj(con, hd, ub.getData().getUrl());
|
||||||
|
}
|
||||||
|
|
||||||
url = ub.getData().getUrl();
|
url = ub.getData().getUrl();
|
||||||
Glide.with(con).load(url).into(img);
|
ImageLoader.getInstance().loadImage(con,url,img);
|
||||||
up_img.setVisibility(View.GONE);
|
up_img.setVisibility(View.GONE);
|
||||||
img.setVisibility(View.VISIBLE);
|
img.setVisibility(View.VISIBLE);
|
||||||
}
|
}
|
||||||
CacheGroup.cacheList.remove("upload");
|
CacheGroup.cacheList.remove("upload");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (CacheGroup.cacheList.get("ORCQualificaZj") != null) {
|
||||||
|
OCRQualiBean ocrQualiBean = gson.fromJson(CacheGroup.cacheList.get("ORCQualificaZj"), OCRQualiBean.class);
|
||||||
|
if (ocrQualiBean.getCode() == 200 && ocrQualiBean.getData() != null) {
|
||||||
|
List<OCRQualiBean.DataDTO.QualificationCategoryListDTO> qualificationCategoryList = ocrQualiBean.getData().getQualification_category_list();
|
||||||
|
if (qualificationCategoryList != null && qualificationCategoryList.size() > 0) {
|
||||||
|
String expiryDate = qualificationCategoryList.get(0).getExpiry_date();
|
||||||
|
if (!TextUtils.isEmpty(expiryDate)&&expiryDate.contains("-")){
|
||||||
|
value2.setText(expiryDate);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Toast.makeText(con, "识别失败", Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
CacheGroup.cacheList.remove("ORCQualificaZj");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if (CacheGroup.cacheList.get("isAuthDriverAuthQualification") != null) {
|
if (CacheGroup.cacheList.get("isAuthDriverAuthQualification") != null) {
|
||||||
Log.e("is", CacheGroup.cacheList.get("isAuthDriverAuthQualification"));
|
Log.e("is", CacheGroup.cacheList.get("isAuthDriverAuthQualification"));
|
||||||
ib = gson.fromJson(CacheGroup.cacheList.get("isAuthDriverAuthQualification"), IsAuthDriverAuthQualificationBean.class);
|
ib = gson.fromJson(CacheGroup.cacheList.get("isAuthDriverAuthQualification"), IsAuthDriverAuthQualificationBean.class);
|
||||||
@ -118,7 +144,6 @@ public class AuthQualificationActivity extends BaseAppCompatActivity {
|
|||||||
}, 3000);
|
}, 3000);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
finish();
|
|
||||||
if (isOverCar) {//从业资格证=》道路运输许可证
|
if (isOverCar) {//从业资格证=》道路运输许可证
|
||||||
Intent in = new Intent(con, PhotoCarActivity.class);
|
Intent in = new Intent(con, PhotoCarActivity.class);
|
||||||
in.putExtra("type", 3);
|
in.putExtra("type", 3);
|
||||||
@ -129,10 +154,10 @@ public class AuthQualificationActivity extends BaseAppCompatActivity {
|
|||||||
in.putExtra("type", 3);
|
in.putExtra("type", 3);
|
||||||
con.startActivity(in);
|
con.startActivity(in);
|
||||||
}
|
}
|
||||||
|
finish();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Toast.makeText(con, "资格证上传成功", Toast.LENGTH_SHORT).show();
|
Toast.makeText(con, "资格证上传成功", Toast.LENGTH_SHORT).show();
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(con, bb.getMsg(), Toast.LENGTH_SHORT).show();
|
Toast.makeText(con, bb.getMsg(), Toast.LENGTH_SHORT).show();
|
||||||
@ -300,7 +325,6 @@ public class AuthQualificationActivity extends BaseAppCompatActivity {
|
|||||||
tvSkip.setOnClickListener(v -> {
|
tvSkip.setOnClickListener(v -> {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (type.equals("0")) {
|
if (type.equals("0")) {
|
||||||
// finish();
|
// finish();
|
||||||
if (key) {
|
if (key) {
|
||||||
@ -348,13 +372,13 @@ public class AuthQualificationActivity extends BaseAppCompatActivity {
|
|||||||
value2.setText(ib.getData().getQualificationCertificateValidity());
|
value2.setText(ib.getData().getQualificationCertificateValidity());
|
||||||
up_img.setVisibility(View.GONE);
|
up_img.setVisibility(View.GONE);
|
||||||
img.setVisibility(View.VISIBLE);
|
img.setVisibility(View.VISIBLE);
|
||||||
Glide.with(con).load(url).into(img);
|
ImageLoader.getInstance().loadImage(con,url,img);
|
||||||
upload_img.setText("已上传");
|
upload_img.setText("已上传");
|
||||||
} else {
|
} else {
|
||||||
submit.setBackgroundResource(R.drawable.bg_btn_grey);
|
submit.setBackgroundResource(R.drawable.bg_btn_grey);
|
||||||
isAuth = true;
|
isAuth = true;
|
||||||
url = userBean.getData().getPartyMemberUrl();
|
url = userBean.getData().getPartyMemberUrl();
|
||||||
Glide.with(con).load(url).into(img);
|
ImageLoader.getInstance().loadImage(con,url,img);
|
||||||
up_img.setVisibility(View.GONE);
|
up_img.setVisibility(View.GONE);
|
||||||
img.setVisibility(View.VISIBLE);
|
img.setVisibility(View.VISIBLE);
|
||||||
upload_img.setText("已上传");
|
upload_img.setText("已上传");
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,62 @@
|
|||||||
|
package com.arpa.hndahesudintocctmsdriver.ui.auth;
|
||||||
|
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.view.View;
|
||||||
|
import android.widget.Button;
|
||||||
|
|
||||||
|
import androidx.annotation.Nullable;
|
||||||
|
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.R;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.event.PersonEvent;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.ui.MainActivity;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.statusbar.StateStyleUtil;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.view.BaseAppCompatActivity;
|
||||||
|
import com.dahe.mylibrary.utils.ActivityUtils;
|
||||||
|
|
||||||
|
import org.greenrobot.eventbus.EventBus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName FaceSuccActivity
|
||||||
|
* @Author john
|
||||||
|
* @Date 2024/12/2 10:27
|
||||||
|
* @Description TODO
|
||||||
|
*/
|
||||||
|
public class FaceSuccActivity extends BaseAppCompatActivity {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
StateStyleUtil.stateTextColor(this);
|
||||||
|
setContentView(R.layout.activity_face_succ_result);
|
||||||
|
con = this;
|
||||||
|
initView(null);
|
||||||
|
Button btnHome = findViewById(R.id.btnHome);
|
||||||
|
Button btnAddCar = findViewById(R.id.btnAddCar);
|
||||||
|
boolean isGoCar = getIntent().getBooleanExtra("isGoCar", false);
|
||||||
|
if (isGoCar) {
|
||||||
|
btnHome.setText("返回首页");
|
||||||
|
btnAddCar.setVisibility(View.VISIBLE);
|
||||||
|
} else {
|
||||||
|
btnHome.setText("返回");
|
||||||
|
btnAddCar.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
|
|
||||||
|
btnHome.setOnClickListener(v -> {
|
||||||
|
finish();
|
||||||
|
});
|
||||||
|
btnAddCar.setOnClickListener(v -> {
|
||||||
|
Intent in = new Intent(con, CertificatesActivity.class);
|
||||||
|
in.putExtra("index", 2);
|
||||||
|
startActivity(in);
|
||||||
|
finish();
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onPause() {
|
||||||
|
super.onPause();
|
||||||
|
EventBus.getDefault().post(new PersonEvent("刷脸成功"));
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,9 +1,14 @@
|
|||||||
package com.arpa.hndahesudintocctmsdriver.ui.auth;
|
package com.arpa.hndahesudintocctmsdriver.ui.auth;
|
||||||
|
|
||||||
|
import static com.sdk.base.framework.utils.app.AppUtils.getPackageName;
|
||||||
|
|
||||||
|
import android.Manifest;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
|
import android.net.Uri;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.os.Message;
|
import android.os.Message;
|
||||||
|
import android.provider.Settings;
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
@ -16,9 +21,15 @@ import androidx.annotation.Nullable;
|
|||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.arpa.hndahesudintocctmsdriver.H5Activity;
|
import com.arpa.hndahesudintocctmsdriver.H5Activity;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.H5Activity2;
|
||||||
import com.arpa.hndahesudintocctmsdriver.event.HomeEvent;
|
import com.arpa.hndahesudintocctmsdriver.event.HomeEvent;
|
||||||
import com.arpa.hndahesudintocctmsdriver.event.PersonEvent;
|
import com.arpa.hndahesudintocctmsdriver.event.PersonEvent;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.ui.business.BusinessActivity;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.MessageUtils;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.PermissionUtils;
|
||||||
import com.bumptech.glide.Glide;
|
import com.bumptech.glide.Glide;
|
||||||
|
import com.dahe.mylibrary.utils.ActivityUtils;
|
||||||
|
import com.dahe.mylibrary.utils.ImageLoader;
|
||||||
import com.esign.esignsdk.EsignSdk;
|
import com.esign.esignsdk.EsignSdk;
|
||||||
import com.esign.esignsdk.data.AuthEvent;
|
import com.esign.esignsdk.data.AuthEvent;
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
@ -42,6 +53,7 @@ import com.arpa.hndahesudintocctmsdriver.util.http.RequsetCodeConstants;
|
|||||||
import com.arpa.hndahesudintocctmsdriver.util.statusbar.StateStyleUtil;
|
import com.arpa.hndahesudintocctmsdriver.util.statusbar.StateStyleUtil;
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.view.BaseAppCompatActivity;
|
import com.arpa.hndahesudintocctmsdriver.util.view.BaseAppCompatActivity;
|
||||||
import com.lxj.xpopup.util.SmartGlideImageLoader;
|
import com.lxj.xpopup.util.SmartGlideImageLoader;
|
||||||
|
import com.permissionx.guolindev.PermissionX;
|
||||||
|
|
||||||
import org.greenrobot.eventbus.EventBus;
|
import org.greenrobot.eventbus.EventBus;
|
||||||
import org.greenrobot.eventbus.Subscribe;
|
import org.greenrobot.eventbus.Subscribe;
|
||||||
@ -65,15 +77,15 @@ public class PersonalAuthActivity extends BaseAppCompatActivity {
|
|||||||
super.msgMethod(m);
|
super.msgMethod(m);
|
||||||
switch (m.what) {
|
switch (m.what) {
|
||||||
case RequsetCodeConstants.SUCCESS:
|
case RequsetCodeConstants.SUCCESS:
|
||||||
if (CacheGroup.cacheList.get("userdata") != null) {
|
if (CacheGroup.cacheList.get("userdata2") != null) {
|
||||||
ub = gson.fromJson(CacheGroup.cacheList.get("userdata"), UserBean.class);
|
ub = gson.fromJson(CacheGroup.cacheList.get("userdata2"), UserBean.class);
|
||||||
if (ub.getCode() == 200) {
|
if (ub.getCode() == 200) {
|
||||||
initView(ub);
|
initView(ub);
|
||||||
SPUtil.insSP(con, "data", "userdata", CacheGroup.cacheList.get("userdata"));
|
SPUtil.insSP(con, "data", "userdata", CacheGroup.cacheList.get("userdata2"));
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(con, ub.getMsg(), Toast.LENGTH_SHORT).show();
|
Toast.makeText(con, ub.getMsg(), Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
CacheGroup.cacheList.remove("userdata");
|
CacheGroup.cacheList.remove("userdata2");
|
||||||
}
|
}
|
||||||
if (CacheGroup.cacheList.get("upload") != null) {
|
if (CacheGroup.cacheList.get("upload") != null) {
|
||||||
upb = gson.fromJson(CacheGroup.cacheList.get("upload"), UploadBean.class);
|
upb = gson.fromJson(CacheGroup.cacheList.get("upload"), UploadBean.class);
|
||||||
@ -98,11 +110,18 @@ public class PersonalAuthActivity extends BaseAppCompatActivity {
|
|||||||
BaseBean bb = gson.fromJson(CacheGroup.cacheList.get("authUrl"), BaseBean.class);
|
BaseBean bb = gson.fromJson(CacheGroup.cacheList.get("authUrl"), BaseBean.class);
|
||||||
if (bb.getCode() == 200) {
|
if (bb.getCode() == 200) {
|
||||||
|
|
||||||
// Intent intent = new Intent(this, H5Activity.class);
|
Intent intent = new Intent(this, H5Activity.class);
|
||||||
// intent.putExtra("url", (String) bb.getData());
|
intent.putExtra("url", (String) bb.getData());
|
||||||
// intent.putExtra("view_file", false);
|
intent.putExtra("view_file", false);
|
||||||
// startActivity(intent);
|
// intent.putExtra("isGoCar", true);
|
||||||
EsignSdk.getInstance().startH5Activity(act, StringUtil.isNull(String.valueOf(bb.getData()), ""));
|
startActivity(intent);
|
||||||
|
|
||||||
|
// Bundle t = new Bundle();
|
||||||
|
// t.putString("url",(String) bb.getData());
|
||||||
|
// t.putBoolean("view_file", false);
|
||||||
|
// ActivityUtils.startActivity(con, H5Activity2.class,t);
|
||||||
|
|
||||||
|
// EsignSdk.getInstance().startH5Activity(act, StringUtil.isNull(String.valueOf(bb.getData()), ""));
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(con, bb.getMsg(), Toast.LENGTH_LONG).show();
|
Toast.makeText(con, bb.getMsg(), Toast.LENGTH_LONG).show();
|
||||||
}//Log.e("url",CacheGroup.cacheList.get("authUrl"));
|
}//Log.e("url",CacheGroup.cacheList.get("authUrl"));
|
||||||
@ -168,18 +187,45 @@ public class PersonalAuthActivity extends BaseAppCompatActivity {
|
|||||||
// startActivityForResult(in, 12);
|
// startActivityForResult(in, 12);
|
||||||
//EsignSdk.getInstance().startH5Activity(act,"https://smlh5.esign.cn/usercenterFront/oemAuth/v3/realName/index?contextKey=b7b103b15b866ec4c72beef1dfe20828&appId=7438873235");
|
//EsignSdk.getInstance().startH5Activity(act,"https://smlh5.esign.cn/usercenterFront/oemAuth/v3/realName/index?contextKey=b7b103b15b866ec4c72beef1dfe20828&appId=7438873235");
|
||||||
if (key) {
|
if (key) {
|
||||||
// EsignSdk.getInstance().startH5Activity(act, "");
|
PermissionX.init(this)
|
||||||
|
.permissions(Manifest.permission.CAMERA)
|
||||||
|
.request((allGranted, grantedList, deniedList) -> {
|
||||||
|
if(allGranted) {
|
||||||
key = false;
|
key = false;
|
||||||
new AuthRequest().getAuthUrl(con, hd);
|
new AuthRequest().getAuthUrl(con, hd);
|
||||||
new Handler().postDelayed(() -> {
|
new Handler().postDelayed(() -> {
|
||||||
key = true;
|
key = true;
|
||||||
}, 3000);
|
}, 3000);
|
||||||
|
} else{
|
||||||
|
new MessageUtils().showSimCenPop(con, "缺少相机权限,将无法为您提供服务,去开启!", "取消", "确认", () -> {
|
||||||
|
Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
|
||||||
|
Uri uri = Uri.fromParts("package", getPackageName(), null);
|
||||||
|
intent.setData(uri);
|
||||||
|
startActivity(intent);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
//头像
|
//头像
|
||||||
up_img.setOnClickListener(v -> {
|
up_img.setOnClickListener(v -> {
|
||||||
|
PermissionUtils.Companion.getInstance().showPermissionMessage(this, "拍摄,媒体查询权限使用说明", "用于拍照或者选择图片用于上传头像功能",
|
||||||
|
new String[]{Manifest.permission.READ_EXTERNAL_STORAGE,Manifest.permission.WRITE_EXTERNAL_STORAGE,Manifest.permission.CAMERA},
|
||||||
|
(allGranted, grantedList, deniedList) -> {
|
||||||
|
if (allGranted) {
|
||||||
gia.showPopueWindow(this);
|
gia.showPopueWindow(this);
|
||||||
|
} else {
|
||||||
|
new MessageUtils().showSimCenPop(con, "缺少拍摄,媒体查询权限,将无法为您提供服务,去开启!", "取消", "确认", () -> {
|
||||||
|
Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
|
||||||
|
Uri uri = Uri.fromParts("package", getPackageName(), null);
|
||||||
|
intent.setData(uri);
|
||||||
|
startActivity(intent);
|
||||||
|
});
|
||||||
|
// Toast.makeText(act.getBaseContext(), "请先开启定位权限", Toast.LENGTH_LONG).show();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
up_head.setOnClickListener(v -> {
|
up_head.setOnClickListener(v -> {
|
||||||
if (ub.getData().getHeadportraitUrl() != null && !ub.getData().getHeadportraitUrl().equals("")) {
|
if (ub.getData().getHeadportraitUrl() != null && !ub.getData().getHeadportraitUrl().equals("")) {
|
||||||
@ -193,10 +239,15 @@ public class PersonalAuthActivity extends BaseAppCompatActivity {
|
|||||||
});
|
});
|
||||||
hyr = new HuoYuanRequset(con, hd);
|
hyr = new HuoYuanRequset(con, hd);
|
||||||
ur = new UserRequset(con, hd);
|
ur = new UserRequset(con, hd);
|
||||||
ur.User();
|
|
||||||
EventBus.getDefault().register(this);
|
EventBus.getDefault().register(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onStart() {
|
||||||
|
super.onStart();
|
||||||
|
ur.User2();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onDestroy() {
|
protected void onDestroy() {
|
||||||
super.onDestroy();
|
super.onDestroy();
|
||||||
@ -212,7 +263,7 @@ public class PersonalAuthActivity extends BaseAppCompatActivity {
|
|||||||
TextView name = findViewById(R.id.rname);
|
TextView name = findViewById(R.id.rname);
|
||||||
name.setText(StringUtil.isNull(ub.getData().getRname(), "未实名"));
|
name.setText(StringUtil.isNull(ub.getData().getRname(), "未实名"));
|
||||||
if (ub.getData().getHeadportraitUrl() != null && !ub.getData().getHeadportraitUrl().equals("")) {
|
if (ub.getData().getHeadportraitUrl() != null && !ub.getData().getHeadportraitUrl().equals("")) {
|
||||||
Glide.with(con).load(ub.getData().getHeadportraitUrl()).into(up_head);
|
ImageLoader.getInstance().loadImage(con,ub.getData().getHeadportraitUrl(),up_head);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -220,7 +271,7 @@ public class PersonalAuthActivity extends BaseAppCompatActivity {
|
|||||||
public void personResult(PersonEvent home) {
|
public void personResult(PersonEvent home) {
|
||||||
Log.e("-res-", home.getMessage());
|
Log.e("-res-", home.getMessage());
|
||||||
if (ur != null) {
|
if (ur != null) {
|
||||||
ur.User();
|
ur.User2();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -276,6 +327,8 @@ public class PersonalAuthActivity extends BaseAppCompatActivity {
|
|||||||
Toast.makeText(con, "签署场景成功", Toast.LENGTH_SHORT).show();
|
Toast.makeText(con, "签署场景成功", Toast.LENGTH_SHORT).show();
|
||||||
} else if ("realName".equalsIgnoreCase(jsonObject.getString("key"))) {
|
} else if ("realName".equalsIgnoreCase(jsonObject.getString("key"))) {
|
||||||
Toast.makeText(con, "实名认证成功", Toast.LENGTH_SHORT).show();
|
Toast.makeText(con, "实名认证成功", Toast.LENGTH_SHORT).show();
|
||||||
|
EsignSdk.getInstance().finishH5Activity();
|
||||||
|
finish();
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(con, "意愿认证成功", Toast.LENGTH_SHORT).show();
|
Toast.makeText(con, "意愿认证成功", Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,6 +3,7 @@ package com.arpa.hndahesudintocctmsdriver.ui.auth;
|
|||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.Message;
|
import android.os.Message;
|
||||||
|
import android.text.InputType;
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
@ -20,10 +21,14 @@ import com.arpa.hndahesudintocctmsdriver.R;
|
|||||||
import com.arpa.hndahesudintocctmsdriver.bean.BaseBean;
|
import com.arpa.hndahesudintocctmsdriver.bean.BaseBean;
|
||||||
import com.arpa.hndahesudintocctmsdriver.bean.CarDelBean;
|
import com.arpa.hndahesudintocctmsdriver.bean.CarDelBean;
|
||||||
import com.arpa.hndahesudintocctmsdriver.bean.IsAuthDriverAuthQualificationBean;
|
import com.arpa.hndahesudintocctmsdriver.bean.IsAuthDriverAuthQualificationBean;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.bean.OCRBankBean;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.bean.OCRRoadBean;
|
||||||
import com.arpa.hndahesudintocctmsdriver.bean.UploadBean;
|
import com.arpa.hndahesudintocctmsdriver.bean.UploadBean;
|
||||||
import com.arpa.hndahesudintocctmsdriver.request.AuthRequest;
|
import com.arpa.hndahesudintocctmsdriver.request.AuthRequest;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.request.OCRRequest;
|
||||||
import com.arpa.hndahesudintocctmsdriver.request.UserRequset;
|
import com.arpa.hndahesudintocctmsdriver.request.UserRequset;
|
||||||
import com.arpa.hndahesudintocctmsdriver.ui.my.WoDeFragment;
|
import com.arpa.hndahesudintocctmsdriver.ui.my.WoDeFragment;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.ui.wallet.WalletFragment;
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.alert.CustomDialog;
|
import com.arpa.hndahesudintocctmsdriver.util.alert.CustomDialog;
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.cache.CacheGroup;
|
import com.arpa.hndahesudintocctmsdriver.util.cache.CacheGroup;
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.file.ImageFileCompressUtil;
|
import com.arpa.hndahesudintocctmsdriver.util.file.ImageFileCompressUtil;
|
||||||
@ -31,7 +36,8 @@ import com.arpa.hndahesudintocctmsdriver.util.img.GetImageAlert;
|
|||||||
import com.arpa.hndahesudintocctmsdriver.util.statusbar.StateStyleUtil;
|
import com.arpa.hndahesudintocctmsdriver.util.statusbar.StateStyleUtil;
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.view.BaseAppCompatActivity;
|
import com.arpa.hndahesudintocctmsdriver.util.view.BaseAppCompatActivity;
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.view.BaseRecyclerView;
|
import com.arpa.hndahesudintocctmsdriver.util.view.BaseRecyclerView;
|
||||||
import com.bumptech.glide.Glide;
|
import com.dahe.mylibrary.utils.ImageLoader;
|
||||||
|
import com.dahe.mylibrary.utils.PatternUtils;
|
||||||
import com.github.gzuliyujiang.wheelpicker.DatePicker;
|
import com.github.gzuliyujiang.wheelpicker.DatePicker;
|
||||||
import com.github.gzuliyujiang.wheelpicker.annotation.DateMode;
|
import com.github.gzuliyujiang.wheelpicker.annotation.DateMode;
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
@ -104,6 +110,18 @@ public class PhotoCarActivity extends BaseAppCompatActivity implements View.OnCl
|
|||||||
CacheGroup.cacheList.remove("onlyGetDetail");
|
CacheGroup.cacheList.remove("onlyGetDetail");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (CacheGroup.cacheList.get("ORCRoadLicZj") != null) {
|
||||||
|
if (customDialog != null && customDialog.isShowing())
|
||||||
|
customDialog.dismiss();
|
||||||
|
OCRRoadBean ib = new Gson().fromJson(CacheGroup.cacheList.get("ORCRoadLicZj"), OCRRoadBean.class);
|
||||||
|
if (ib.getCode() == 200 && ib.getData() != null&&!TextUtils.isEmpty(ib.getData().getLicenseNumber())) {
|
||||||
|
value1.setText(PatternUtils.getNumByStr(ib.getData().getLicenseNumber()));
|
||||||
|
} else {
|
||||||
|
Toast.makeText(con, "识别失败", Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
CacheGroup.cacheList.remove("ORCRoadLicZj");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if (CacheGroup.cacheList.get("upload") != null) {
|
if (CacheGroup.cacheList.get("upload") != null) {
|
||||||
UploadBean ub = gson.fromJson(CacheGroup.cacheList.get("upload"), UploadBean.class);
|
UploadBean ub = gson.fromJson(CacheGroup.cacheList.get("upload"), UploadBean.class);
|
||||||
@ -118,22 +136,31 @@ public class PhotoCarActivity extends BaseAppCompatActivity implements View.OnCl
|
|||||||
new AuthRequest().saveCarImg(con, hd, carId, ub.getData().getId(), 5);
|
new AuthRequest().saveCarImg(con, hd, carId, ub.getData().getId(), 5);
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
|
//道路运输证ocr识别
|
||||||
|
new OCRRequest().ORCRoadLicZj(con, hd, ub.getData().getUrl());
|
||||||
new AuthRequest().saveCarImg(con, hd, carId, ub.getData().getId(), 2);
|
new AuthRequest().saveCarImg(con, hd, carId, ub.getData().getId(), 2);
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
new AuthRequest().saveCarImg(con, hd, carId, ub.getData().getId(), 7);
|
new AuthRequest().saveCarImg(con, hd, carId, ub.getData().getId(), 7);
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
if (customDialog != null && customDialog.isShowing())
|
||||||
|
customDialog.dismiss();
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
url = ub.getData().getUrl();
|
url = ub.getData().getUrl();
|
||||||
// Glide.with(con).load(url).into(img);
|
// Glide.with(con).load(url).into(img);
|
||||||
Glide.with(con).load(path).into(img);
|
ImageLoader.getInstance().loadImage(con,path,img);
|
||||||
|
|
||||||
|
|
||||||
if (customDialog != null && customDialog.isShowing())
|
|
||||||
customDialog.dismiss();
|
|
||||||
CacheGroup.cacheList.remove("upload");
|
CacheGroup.cacheList.remove("upload");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (CacheGroup.cacheList.get("saveCarImg") != null) {
|
if (CacheGroup.cacheList.get("saveCarImg") != null) {
|
||||||
|
if (type!=3){
|
||||||
|
if (customDialog != null && customDialog.isShowing())
|
||||||
|
customDialog.dismiss();
|
||||||
|
}
|
||||||
BaseBean bb = gson.fromJson(CacheGroup.cacheList.get("saveCarImg"), BaseBean.class);
|
BaseBean bb = gson.fromJson(CacheGroup.cacheList.get("saveCarImg"), BaseBean.class);
|
||||||
if (bb.getCode() == 200) {
|
if (bb.getCode() == 200) {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
@ -148,7 +175,7 @@ public class PhotoCarActivity extends BaseAppCompatActivity implements View.OnCl
|
|||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
ur.vehicleDelTwo(carId);
|
ur.vehicleDelTwo(carId);
|
||||||
Toast.makeText(con, "上传道路运输证成功", Toast.LENGTH_SHORT).show();
|
// Toast.makeText(con, "上传道路运输证成功", Toast.LENGTH_SHORT).show();
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
Toast.makeText(con, "交强险证件上传成功", Toast.LENGTH_SHORT).show();
|
Toast.makeText(con, "交强险证件上传成功", Toast.LENGTH_SHORT).show();
|
||||||
@ -163,11 +190,11 @@ public class PhotoCarActivity extends BaseAppCompatActivity implements View.OnCl
|
|||||||
Log.e("is", CacheGroup.cacheList.get("saveCarRegisterNo"));
|
Log.e("is", CacheGroup.cacheList.get("saveCarRegisterNo"));
|
||||||
IsAuthDriverAuthQualificationBean ib = gson.fromJson(CacheGroup.cacheList.get("saveCarRegisterNo"), IsAuthDriverAuthQualificationBean.class);
|
IsAuthDriverAuthQualificationBean ib = gson.fromJson(CacheGroup.cacheList.get("saveCarRegisterNo"), IsAuthDriverAuthQualificationBean.class);
|
||||||
if (ib.getCode() == 200) {
|
if (ib.getCode() == 200) {
|
||||||
finish();
|
|
||||||
Intent in = new Intent(con, PhotoCarActivity.class);
|
Intent in = new Intent(con, PhotoCarActivity.class);
|
||||||
in.putExtra("type", 3);
|
in.putExtra("type", 3);
|
||||||
in.putExtra("carId", carId);
|
in.putExtra("carId", carId);
|
||||||
con.startActivity(in);
|
con.startActivity(in);
|
||||||
|
finish();
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(con, ib.getMsg(), Toast.LENGTH_SHORT).show();
|
Toast.makeText(con, ib.getMsg(), Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
@ -181,12 +208,11 @@ public class PhotoCarActivity extends BaseAppCompatActivity implements View.OnCl
|
|||||||
//判断是否需要跳转挂车行驶证页面
|
//判断是否需要跳转挂车行驶证页面
|
||||||
if (!"".equals(carId) && cdb.getData() != null) {
|
if (!"".equals(carId) && cdb.getData() != null) {
|
||||||
if (cdb.getData().getIsTrailer() == 1 && cdb.getData().getTrailerResVo() != null && !TextUtils.isEmpty(cdb.getData().getTrailerResVo().getCarNumber())) {//需要挂车,并且传过挂车直接结束
|
if (cdb.getData().getIsTrailer() == 1 && cdb.getData().getTrailerResVo() != null && !TextUtils.isEmpty(cdb.getData().getTrailerResVo().getCarNumber())) {//需要挂车,并且传过挂车直接结束
|
||||||
finish();
|
|
||||||
Intent in = new Intent(con, AddCarSuccActivity.class);
|
Intent in = new Intent(con, AddCarSuccActivity.class);
|
||||||
in.putExtra("type", 3);
|
in.putExtra("type", 3);
|
||||||
con.startActivity(in);
|
con.startActivity(in);
|
||||||
} else if (cdb.getData().getIsTrailer() == 1 && cdb.getData().getTrailerResVo() != null && TextUtils.isEmpty(cdb.getData().getTrailerResVo().getCarNumber())) {//需要挂车,没传过挂车,到挂车页面
|
|
||||||
finish();
|
finish();
|
||||||
|
} else if (cdb.getData().getIsTrailer() == 1 && cdb.getData().getTrailerResVo() != null && TextUtils.isEmpty(cdb.getData().getTrailerResVo().getCarNumber())) {//需要挂车,没传过挂车,到挂车页面
|
||||||
Intent in = new Intent(con, CertificatesActivity.class);
|
Intent in = new Intent(con, CertificatesActivity.class);
|
||||||
in.putExtra("index", 3);
|
in.putExtra("index", 3);
|
||||||
in.putExtra("carId", carId);
|
in.putExtra("carId", carId);
|
||||||
@ -194,6 +220,7 @@ public class PhotoCarActivity extends BaseAppCompatActivity implements View.OnCl
|
|||||||
in.putExtra("cheData", new Gson().toJson(cdb));
|
in.putExtra("cheData", new Gson().toJson(cdb));
|
||||||
}
|
}
|
||||||
startActivity(in);
|
startActivity(in);
|
||||||
|
finish();
|
||||||
} else if (cdb.getData().getIsTrailer() == 0) {//不需要挂车
|
} else if (cdb.getData().getIsTrailer() == 0) {//不需要挂车
|
||||||
if ("1".equals(cdb.getData().getNeedUpQCPhoto())) {//需要从业资格证
|
if ("1".equals(cdb.getData().getNeedUpQCPhoto())) {//需要从业资格证
|
||||||
Intent in = new Intent(con, AuthQualificationActivity.class);
|
Intent in = new Intent(con, AuthQualificationActivity.class);
|
||||||
@ -202,10 +229,10 @@ public class PhotoCarActivity extends BaseAppCompatActivity implements View.OnCl
|
|||||||
in.putExtra("isOverCar", false);
|
in.putExtra("isOverCar", false);
|
||||||
startActivity(in);
|
startActivity(in);
|
||||||
} else {
|
} else {
|
||||||
finish();
|
|
||||||
Intent in = new Intent(con, AddCarSuccActivity.class);
|
Intent in = new Intent(con, AddCarSuccActivity.class);
|
||||||
in.putExtra("type", 3);
|
in.putExtra("type", 3);
|
||||||
con.startActivity(in);
|
con.startActivity(in);
|
||||||
|
finish();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -494,26 +521,26 @@ public class PhotoCarActivity extends BaseAppCompatActivity implements View.OnCl
|
|||||||
if (null != cdb) {
|
if (null != cdb) {
|
||||||
if (0 == type) {
|
if (0 == type) {
|
||||||
if (!TextUtils.isEmpty(cdb.getData().getCarImage())) {
|
if (!TextUtils.isEmpty(cdb.getData().getCarImage())) {
|
||||||
Glide.with(con).load(cdb.getData().getCarImage()).into(img);
|
ImageLoader.getInstance().loadImage(con,cdb.getData().getCarImage(),img);
|
||||||
submit.setBackgroundResource(R.drawable.bg_btn_grey);
|
submit.setBackgroundResource(R.drawable.bg_btn_grey);
|
||||||
upload_img.setText("已上传");
|
upload_img.setText("已上传");
|
||||||
}
|
}
|
||||||
} else if (1 == type) {
|
} else if (1 == type) {
|
||||||
if (!TextUtils.isEmpty(cdb.getData().getNfcImage())) {
|
if (!TextUtils.isEmpty(cdb.getData().getNfcImage())) {
|
||||||
Glide.with(con).load(cdb.getData().getNfcImage()).into(img);
|
ImageLoader.getInstance().loadImage(con,cdb.getData().getNfcImage(),img);
|
||||||
submit.setBackgroundResource(R.drawable.bg_btn_grey);
|
submit.setBackgroundResource(R.drawable.bg_btn_grey);
|
||||||
upload_img.setText("已上传");
|
upload_img.setText("已上传");
|
||||||
}
|
}
|
||||||
} else if (2 == type) {
|
} else if (2 == type) {
|
||||||
if (!TextUtils.isEmpty(cdb.getData().getRegisterImage())) {
|
if (!TextUtils.isEmpty(cdb.getData().getRegisterImage())) {
|
||||||
Glide.with(con).load(cdb.getData().getRegisterImage()).into(img);
|
ImageLoader.getInstance().loadImage(con,cdb.getData().getRegisterImage(),img);
|
||||||
value1.setText(cdb.getData().getRegisterNo());
|
value1.setText(cdb.getData().getRegisterNo());
|
||||||
submit.setBackgroundResource(R.drawable.bg_btn_grey);
|
submit.setBackgroundResource(R.drawable.bg_btn_grey);
|
||||||
upload_img.setText("已上传");
|
upload_img.setText("已上传");
|
||||||
}
|
}
|
||||||
} else if (3 == type) {
|
} else if (3 == type) {
|
||||||
if (!TextUtils.isEmpty(cdb.getData().getRoadLicensePhoto())) {
|
if (!TextUtils.isEmpty(cdb.getData().getRoadLicensePhoto())) {
|
||||||
Glide.with(con).load(cdb.getData().getRoadLicensePhoto()).into(img);
|
ImageLoader.getInstance().loadImage(con,cdb.getData().getRoadLicensePhoto(),img);
|
||||||
value1.setText(cdb.getData().getRoadLicense());
|
value1.setText(cdb.getData().getRoadLicense());
|
||||||
if (!carExist) {
|
if (!carExist) {
|
||||||
submit.setBackgroundResource(R.drawable.bg_btn_grey);
|
submit.setBackgroundResource(R.drawable.bg_btn_grey);
|
||||||
@ -523,7 +550,7 @@ public class PhotoCarActivity extends BaseAppCompatActivity implements View.OnCl
|
|||||||
}
|
}
|
||||||
} else if (4 == type) {
|
} else if (4 == type) {
|
||||||
if (!TextUtils.isEmpty(cdb.getData().getPolicyPhotoUrl())) {
|
if (!TextUtils.isEmpty(cdb.getData().getPolicyPhotoUrl())) {
|
||||||
Glide.with(con).load(cdb.getData().getPolicyPhotoUrl()).into(img);
|
ImageLoader.getInstance().loadImage(con,cdb.getData().getPolicyPhotoUrl(),img);
|
||||||
value1.setText(cdb.getData().getInsuranceCompany());
|
value1.setText(cdb.getData().getInsuranceCompany());
|
||||||
value2.setText(cdb.getData().getInsuranceEndDay());
|
value2.setText(cdb.getData().getInsuranceEndDay());
|
||||||
submit.setBackgroundResource(R.drawable.bg_btn_grey);
|
submit.setBackgroundResource(R.drawable.bg_btn_grey);
|
||||||
@ -612,8 +639,11 @@ public class PhotoCarActivity extends BaseAppCompatActivity implements View.OnCl
|
|||||||
tvSkip.setVisibility(isShowSkip[type] ? View.GONE : View.VISIBLE);
|
tvSkip.setVisibility(isShowSkip[type] ? View.GONE : View.VISIBLE);
|
||||||
llInfo.setVisibility(isShowEdit[type] ? View.VISIBLE : View.GONE);
|
llInfo.setVisibility(isShowEdit[type] ? View.VISIBLE : View.GONE);
|
||||||
if (type == 4) {
|
if (type == 4) {
|
||||||
|
value1.setInputType(InputType.TYPE_CLASS_TEXT);
|
||||||
llDate.setVisibility(View.VISIBLE);
|
llDate.setVisibility(View.VISIBLE);
|
||||||
title3.setText("保险公司");
|
title3.setText("保险公司");
|
||||||
|
}else {
|
||||||
|
value1.setInputType(InputType.TYPE_CLASS_NUMBER);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,12 +1,17 @@
|
|||||||
package com.arpa.hndahesudintocctmsdriver.ui.home;
|
package com.arpa.hndahesudintocctmsdriver.ui.home;
|
||||||
|
|
||||||
|
import static com.sdk.base.framework.utils.app.AppUtils.getPackageName;
|
||||||
|
|
||||||
import android.Manifest;
|
import android.Manifest;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.graphics.Outline;
|
import android.graphics.Outline;
|
||||||
import android.location.Location;
|
import android.location.Location;
|
||||||
|
import android.net.Uri;
|
||||||
|
import android.os.Build;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.Message;
|
import android.os.Message;
|
||||||
|
import android.provider.Settings;
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.Gravity;
|
import android.view.Gravity;
|
||||||
@ -23,6 +28,7 @@ import android.widget.Toast;
|
|||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
import androidx.cardview.widget.CardView;
|
import androidx.cardview.widget.CardView;
|
||||||
|
import androidx.fragment.app.FragmentActivity;
|
||||||
|
|
||||||
import com.alct.mdp.MDPLocationCollectionManager;
|
import com.alct.mdp.MDPLocationCollectionManager;
|
||||||
import com.alct.mdp.callback.OnDownloadResultListener;
|
import com.alct.mdp.callback.OnDownloadResultListener;
|
||||||
@ -50,7 +56,10 @@ import com.arpa.hndahesudintocctmsdriver.ui.auth.CertificatesActivity;
|
|||||||
import com.arpa.hndahesudintocctmsdriver.ui.home.shangchuan.ShangChuangImgActivity;
|
import com.arpa.hndahesudintocctmsdriver.ui.home.shangchuan.ShangChuangImgActivity;
|
||||||
import com.arpa.hndahesudintocctmsdriver.ui.news.NewActivity;
|
import com.arpa.hndahesudintocctmsdriver.ui.news.NewActivity;
|
||||||
import com.arpa.hndahesudintocctmsdriver.ui.wallet.UpBankActivity;
|
import com.arpa.hndahesudintocctmsdriver.ui.wallet.UpBankActivity;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.ui.web.WebOnlyOneActivity;
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.MessageUtils;
|
import com.arpa.hndahesudintocctmsdriver.util.MessageUtils;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.OneDayShowUtils;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.PermissionUtils;
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.SPUtils;
|
import com.arpa.hndahesudintocctmsdriver.util.SPUtils;
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.string.StringUtil;
|
import com.arpa.hndahesudintocctmsdriver.util.string.StringUtil;
|
||||||
import com.bumptech.glide.Glide;
|
import com.bumptech.glide.Glide;
|
||||||
@ -60,6 +69,7 @@ import com.google.gson.Gson;
|
|||||||
import com.gyf.cactus.Cactus;
|
import com.gyf.cactus.Cactus;
|
||||||
import com.hjq.xtoast.XToast;
|
import com.hjq.xtoast.XToast;
|
||||||
import com.lxj.xpopup.XPopup;
|
import com.lxj.xpopup.XPopup;
|
||||||
|
import com.lxj.xpopup.core.BasePopupView;
|
||||||
import com.lxj.xpopup.interfaces.OnConfirmListener;
|
import com.lxj.xpopup.interfaces.OnConfirmListener;
|
||||||
import com.arpa.hndahesudintocctmsdriver.R;
|
import com.arpa.hndahesudintocctmsdriver.R;
|
||||||
import com.arpa.hndahesudintocctmsdriver.report.ALProcess;
|
import com.arpa.hndahesudintocctmsdriver.report.ALProcess;
|
||||||
@ -93,6 +103,7 @@ import com.arpa.hndahesudintocctmsdriver.util.http.RequsetCodeConstants;
|
|||||||
import com.arpa.hndahesudintocctmsdriver.util.time.Timer;
|
import com.arpa.hndahesudintocctmsdriver.util.time.Timer;
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.view.BaseFragment;
|
import com.arpa.hndahesudintocctmsdriver.util.view.BaseFragment;
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.view.BaseRecyclerView;
|
import com.arpa.hndahesudintocctmsdriver.util.view.BaseRecyclerView;
|
||||||
|
import com.lxj.xpopup.interfaces.SimpleCallback;
|
||||||
import com.permissionx.guolindev.PermissionX;
|
import com.permissionx.guolindev.PermissionX;
|
||||||
import com.youth.banner.Banner;
|
import com.youth.banner.Banner;
|
||||||
import com.youth.banner.BannerConfig;
|
import com.youth.banner.BannerConfig;
|
||||||
@ -103,8 +114,11 @@ import org.greenrobot.eventbus.EventBus;
|
|||||||
import org.greenrobot.eventbus.Subscribe;
|
import org.greenrobot.eventbus.Subscribe;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import pub.devrel.easypermissions.EasyPermissions;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author hlh
|
* @author hlh
|
||||||
* @version 1.0.0
|
* @version 1.0.0
|
||||||
@ -138,6 +152,10 @@ public class HomeFragment extends BaseFragment {
|
|||||||
private ImageConfig ic;
|
private ImageConfig ic;
|
||||||
private DriverExpireBean deb;
|
private DriverExpireBean deb;
|
||||||
|
|
||||||
|
private XToast xToast;
|
||||||
|
|
||||||
|
private boolean isUpAppShow = false;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void msgMethod(Message m) {
|
public void msgMethod(Message m) {
|
||||||
@ -175,13 +193,13 @@ public class HomeFragment extends BaseFragment {
|
|||||||
MsgUtil.addHdMsgWat(hd, 33);
|
MsgUtil.addHdMsgWat(hd, 33);
|
||||||
|
|
||||||
//新用户注册,需弹窗提示注册
|
//新用户注册,需弹窗提示注册
|
||||||
if ("0".equals(ub.getData().getRealAuthentication())) {
|
// if ("0".equals(ub.getData().getRealAuthentication())) {
|
||||||
new MessageUtils().showSimCenPop(con, "该司机还未认证,未认证无法接单。是否去注册!", () -> {
|
// new MessageUtils().showSimCenPop(con, "该司机还未认证,未认证无法接单。是否去注册!", () -> {
|
||||||
Intent in = new Intent(con, CertificatesActivity.class);
|
// Intent in = new Intent(con, CertificatesActivity.class);
|
||||||
in.putExtra("index", 0);
|
// in.putExtra("index", 0);
|
||||||
startActivity(in);
|
// startActivity(in);
|
||||||
});
|
// });
|
||||||
}
|
// }
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(con, ub.getMsg(), Toast.LENGTH_SHORT).show();
|
Toast.makeText(con, ub.getMsg(), Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
@ -195,8 +213,20 @@ public class HomeFragment extends BaseFragment {
|
|||||||
initStart();
|
initStart();
|
||||||
StartOrderParts.setStartOrder(con, sob);
|
StartOrderParts.setStartOrder(con, sob);
|
||||||
if (sob.getData() != null && !sob.getData().getWaybillStatus().equals("已取消")) {
|
if (sob.getData() != null && !sob.getData().getWaybillStatus().equals("已取消")) {
|
||||||
|
StartOrderBean.DataDTO.WayChildrenDTO xData = null;
|
||||||
|
for (int i = 0; i < sob.getData().getWayChildren().size(); i++) {
|
||||||
|
if (2 == sob.getData().getWayChildren().get(i).getType()) {
|
||||||
|
xData = sob.getData().getWayChildren().get(i);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (xData != null && xData.getStatus() == 3) {
|
||||||
|
SPUtils.remove(con, "curWaybillId");
|
||||||
|
llCurWay.setVisibility(View.GONE);
|
||||||
|
} else {
|
||||||
dealCurWay(sob.getData());
|
dealCurWay(sob.getData());
|
||||||
ur.getJtts(sob.getData().getShippingNoteNumber());
|
ur.getJtts(sob.getData().getShippingNoteNumber());
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
SPUtils.remove(con, "curWaybillId");
|
SPUtils.remove(con, "curWaybillId");
|
||||||
llCurWay.setVisibility(View.GONE);
|
llCurWay.setVisibility(View.GONE);
|
||||||
@ -214,6 +244,19 @@ public class HomeFragment extends BaseFragment {
|
|||||||
new XPopup.Builder(con)
|
new XPopup.Builder(con)
|
||||||
.dismissOnBackPressed(false)
|
.dismissOnBackPressed(false)
|
||||||
.dismissOnTouchOutside(false)
|
.dismissOnTouchOutside(false)
|
||||||
|
.setPopupCallback(new SimpleCallback() {
|
||||||
|
@Override
|
||||||
|
public void onShow(BasePopupView popupView) {
|
||||||
|
super.onShow(popupView);
|
||||||
|
isUpAppShow = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onDismiss(BasePopupView popupView) {
|
||||||
|
super.onDismiss(popupView);
|
||||||
|
isUpAppShow = false;
|
||||||
|
}
|
||||||
|
})
|
||||||
.asCustom(new UpAppAlert(con, uab.getData().getDownloadUrl(), uab.getData().getContent(), uab.getData().getVersion(), uab.getData().getForce()))
|
.asCustom(new UpAppAlert(con, uab.getData().getDownloadUrl(), uab.getData().getContent(), uab.getData().getVersion(), uab.getData().getForce()))
|
||||||
.show();
|
.show();
|
||||||
}
|
}
|
||||||
@ -233,6 +276,40 @@ public class HomeFragment extends BaseFragment {
|
|||||||
if (CacheGroup.cacheList.get(WoDeFragment.AUTH_DATA) != null) {
|
if (CacheGroup.cacheList.get(WoDeFragment.AUTH_DATA) != null) {
|
||||||
DriverAuthDataBean dad = gson.fromJson(CacheGroup.cacheList.get(WoDeFragment.AUTH_DATA), DriverAuthDataBean.class);
|
DriverAuthDataBean dad = gson.fromJson(CacheGroup.cacheList.get(WoDeFragment.AUTH_DATA), DriverAuthDataBean.class);
|
||||||
if (dad.getCode() == 200) {
|
if (dad.getCode() == 200) {
|
||||||
|
if (isUpAppShow) {
|
||||||
|
CacheGroup.cacheList.remove(WoDeFragment.AUTH_DATA);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (dad.getData() == null) {
|
||||||
|
new MessageUtils().showSimCenPop(con, "该司机缺少身份证,未认证无法接单。是否去添加!", "去添加", () -> {
|
||||||
|
Intent in = new Intent(con, CertificatesActivity.class);
|
||||||
|
in.putExtra("index", 0);
|
||||||
|
startActivity(in);
|
||||||
|
});
|
||||||
|
CacheGroup.cacheList.remove(WoDeFragment.AUTH_DATA);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (dad.getData() != null && TextUtils.isEmpty(dad.getData().getIdcard())) {
|
||||||
|
new MessageUtils().showSimCenPop(con, "该司机缺少身份证,未认证无法接单。是否去添加!", "去添加", () -> {
|
||||||
|
Intent in = new Intent(con, CertificatesActivity.class);
|
||||||
|
in.putExtra("index", 0);
|
||||||
|
startActivity(in);
|
||||||
|
});
|
||||||
|
} else if (dad.getData() != null && TextUtils.isEmpty(dad.getData().getCardNo())) {
|
||||||
|
new MessageUtils().showSimCenPop(con, "该司机缺少银行卡,未认证无法接单。是否去添加!", "去添加", () -> {
|
||||||
|
Intent in333 = new Intent(con, UpBankActivity.class);
|
||||||
|
in333.putExtra("type", 1);
|
||||||
|
startActivity(in333);
|
||||||
|
});
|
||||||
|
} else if (dad.getData() != null && TextUtils.isEmpty(dad.getData().getDriverLicense())) {
|
||||||
|
new MessageUtils().showSimCenPop(con, "该司机缺少驾驶证,未认证无法接单。是否去添加!", "去添加", () -> {
|
||||||
|
Intent in = new Intent(con, CertificatesActivity.class);
|
||||||
|
in.putExtra("index", 0);
|
||||||
|
startActivity(in);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
SPUtil.insSP(con, "data", "authdata", CacheGroup.cacheList.get(WoDeFragment.AUTH_DATA));
|
SPUtil.insSP(con, "data", "authdata", CacheGroup.cacheList.get(WoDeFragment.AUTH_DATA));
|
||||||
if (dad.getData() != null && 100003 == dad.getData().getAuditStatus()) {
|
if (dad.getData() != null && 100003 == dad.getData().getAuditStatus()) {
|
||||||
initAlct();
|
initAlct();
|
||||||
@ -277,8 +354,12 @@ public class HomeFragment extends BaseFragment {
|
|||||||
if (!TextUtils.isEmpty(deb.getData().getDriverLicenseUpdateUrl()) || !TextUtils.isEmpty(deb.getData().getIdCardUpdateUrl()) ||
|
if (!TextUtils.isEmpty(deb.getData().getDriverLicenseUpdateUrl()) || !TextUtils.isEmpty(deb.getData().getIdCardUpdateUrl()) ||
|
||||||
!TextUtils.isEmpty(deb.getData().getQualificationUpdateUrl()) || !TextUtils.isEmpty(deb.getData().getRoadLicenseUpdateUrl()) ||
|
!TextUtils.isEmpty(deb.getData().getQualificationUpdateUrl()) || !TextUtils.isEmpty(deb.getData().getRoadLicenseUpdateUrl()) ||
|
||||||
!TextUtils.isEmpty(deb.getData().getInsuranceUpdateUrl())) {
|
!TextUtils.isEmpty(deb.getData().getInsuranceUpdateUrl())) {
|
||||||
new XToast<>(act)
|
if (xToast == null) {
|
||||||
.setContentView(R.layout.view_bc)
|
xToast = new XToast(act);
|
||||||
|
} else if (xToast != null && xToast.isShow()) {
|
||||||
|
xToast.cancel();
|
||||||
|
}
|
||||||
|
xToast.setContentView(R.layout.view_bc)
|
||||||
// 设置成可拖拽的
|
// 设置成可拖拽的
|
||||||
.setDraggable()
|
.setDraggable()
|
||||||
// 设置显示时长
|
// 设置显示时长
|
||||||
@ -293,6 +374,22 @@ public class HomeFragment extends BaseFragment {
|
|||||||
// 设置窗口背景阴影强度
|
// 设置窗口背景阴影强度
|
||||||
//.setBackgroundDimAmount(0.5f)
|
//.setBackgroundDimAmount(0.5f)
|
||||||
.showAsDropDown(home_top, Gravity.BOTTOM, 1200, 1000);
|
.showAsDropDown(home_top, Gravity.BOTTOM, 1200, 1000);
|
||||||
|
// new XToast<>(act)
|
||||||
|
// .setContentView(R.layout.view_bc)
|
||||||
|
// // 设置成可拖拽的
|
||||||
|
// .setDraggable()
|
||||||
|
// // 设置显示时长
|
||||||
|
// .setDuration(1000 * 60 * 60 * 12)
|
||||||
|
// .setOnClickListener(R.id.img_kf, (toast, view) -> {
|
||||||
|
// toast.startActivity(in);
|
||||||
|
// Log.e("-is-", view.isInTouchMode() + "");
|
||||||
|
// })
|
||||||
|
// // 设置动画样式
|
||||||
|
// //.setAnimStyle(android.R.style.Animation_Translucent)
|
||||||
|
// // 设置外层是否能被触摸
|
||||||
|
// // 设置窗口背景阴影强度
|
||||||
|
// //.setBackgroundDimAmount(0.5f)
|
||||||
|
// .showAsDropDown(home_top, Gravity.BOTTOM, 1200, 1000);
|
||||||
}
|
}
|
||||||
CacheGroup.cacheList.remove("driverExpire");
|
CacheGroup.cacheList.remove("driverExpire");
|
||||||
}
|
}
|
||||||
@ -521,18 +618,35 @@ public class HomeFragment extends BaseFragment {
|
|||||||
v1.setOnClickListener(v2 -> {
|
v1.setOnClickListener(v2 -> {
|
||||||
switch (position) {
|
switch (position) {
|
||||||
case 0:
|
case 0:
|
||||||
//startActivity(new Intent(con, OrderListActivity.class));
|
PermissionUtils.Companion.getInstance().showPermissionMessage(getActivity(), "位置权限使用说明", "用于向您推荐可能感兴趣的住宿、饮食、加油站、汽车维修等",
|
||||||
PermissionX.init(getActivity())
|
new String[]{Manifest.permission.ACCESS_FINE_LOCATION},
|
||||||
.permissions(Manifest.permission.ACCESS_FINE_LOCATION)
|
(allGranted, grantedList, deniedList) -> {
|
||||||
.request((allGranted, grantedList, deniedList) -> {
|
|
||||||
if (allGranted) {
|
if (allGranted) {
|
||||||
Intent in = new Intent(con, BusinessActivity.class);
|
Intent in = new Intent(con, BusinessActivity.class);
|
||||||
in.putExtra("type", "餐饮");
|
in.putExtra("type", "餐饮");
|
||||||
startActivity(in);
|
startActivity(in);
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(act.getBaseContext(), "请先开启定位权限", Toast.LENGTH_LONG).show();
|
new MessageUtils().showSimCenPop(con, "缺少定位权限,将无法为您提供服务,去开启!", "取消", "确认", () -> {
|
||||||
|
Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
|
||||||
|
Uri uri = Uri.fromParts("package", getPackageName(), null);
|
||||||
|
intent.setData(uri);
|
||||||
|
startActivity(intent);
|
||||||
|
});
|
||||||
|
// Toast.makeText(act.getBaseContext(), "请先开启定位权限", Toast.LENGTH_LONG).show();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
//startActivity(new Intent(con, OrderListActivity.class));
|
||||||
|
// PermissionX.init(getActivity())
|
||||||
|
// .permissions(Manifest.permission.ACCESS_FINE_LOCATION)
|
||||||
|
// .request((allGranted, grantedList, deniedList) -> {
|
||||||
|
// if (allGranted) {
|
||||||
|
// Intent in = new Intent(con, BusinessActivity.class);
|
||||||
|
// in.putExtra("type", "餐饮");
|
||||||
|
// startActivity(in);
|
||||||
|
// } else {
|
||||||
|
// Toast.makeText(act.getBaseContext(), "请先开启定位权限", Toast.LENGTH_LONG).show();
|
||||||
|
// }
|
||||||
|
// });
|
||||||
//Toast.makeText(con,"定位开启失败,请检查配置项",Toast.LENGTH_LONG).show();
|
//Toast.makeText(con,"定位开启失败,请检查配置项",Toast.LENGTH_LONG).show();
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
@ -556,6 +670,11 @@ public class HomeFragment extends BaseFragment {
|
|||||||
in5.putExtra("url", "https://ks.wjx.top/vm/h6Jqu8A.aspx");
|
in5.putExtra("url", "https://ks.wjx.top/vm/h6Jqu8A.aspx");
|
||||||
in5.putExtra("title", "知识竞猜");
|
in5.putExtra("title", "知识竞猜");
|
||||||
startActivity(in5);
|
startActivity(in5);
|
||||||
|
|
||||||
|
// Intent in = new Intent(getContext(), WebActivity.class);
|
||||||
|
// in.putExtra("url", "http://192.168.1.152:8080");
|
||||||
|
// in.putExtra("title", "隐私政策");
|
||||||
|
// getContext().startActivity(in);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -684,9 +803,13 @@ public class HomeFragment extends BaseFragment {
|
|||||||
if (UiAuxiliary.isLogin(con)) {
|
if (UiAuxiliary.isLogin(con)) {
|
||||||
int curWaybillId = (int) SPUtils.get(con, "curWaybillId", -1);
|
int curWaybillId = (int) SPUtils.get(con, "curWaybillId", -1);
|
||||||
ur.User();
|
ur.User();
|
||||||
qr.getBankCardList();
|
// if (!OneDayShowUtils.getInstance().todayIsShow(con)) {
|
||||||
|
// qr.getBankCardList();
|
||||||
|
// }
|
||||||
ur.getDriverExpire();
|
ur.getDriverExpire();
|
||||||
hyr.startOrder(curWaybillId == -1 ? 0 : curWaybillId);
|
hyr.startOrder(curWaybillId == -1 ? 0 : curWaybillId);
|
||||||
|
// hyr.startOrder(0);
|
||||||
|
//获取权限 应用市场审核不通过
|
||||||
ur.driverAuthData();
|
ur.driverAuthData();
|
||||||
}
|
}
|
||||||
// oldTime= Calendar.getInstance().getTimeInMillis();
|
// oldTime= Calendar.getInstance().getTimeInMillis();
|
||||||
@ -745,8 +868,13 @@ public class HomeFragment extends BaseFragment {
|
|||||||
Log.e("开始轨迹上传服务", "-----");
|
Log.e("开始轨迹上传服务", "-----");
|
||||||
orderNum.setText("运单号:" + sob.getData().getShippingNoteNumber());
|
orderNum.setText("运单号:" + sob.getData().getShippingNoteNumber());
|
||||||
order_state.setText("" + sob.getData().getWaybillStatus());
|
order_state.setText("" + sob.getData().getWaybillStatus());
|
||||||
|
try {
|
||||||
Intent serviceIn = new Intent(con, TrackService.class);
|
Intent serviceIn = new Intent(con, TrackService.class);
|
||||||
getActivity().startService(serviceIn);
|
getActivity().startService(serviceIn);
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
SPUtil.insSP(con, "order", "ShippingNoteNumber", "");
|
SPUtil.insSP(con, "order", "ShippingNoteNumber", "");
|
||||||
order_start.setVisibility(View.GONE);
|
order_start.setVisibility(View.GONE);
|
||||||
@ -917,7 +1045,7 @@ public class HomeFragment extends BaseFragment {
|
|||||||
banner.isAutoPlay(true);
|
banner.isAutoPlay(true);
|
||||||
banner.setIndicatorGravity(BannerConfig.CENTER);
|
banner.setIndicatorGravity(BannerConfig.CENTER);
|
||||||
banner.setOnBannerListener(position -> {//System.out.println("跳转");
|
banner.setOnBannerListener(position -> {//System.out.println("跳转");
|
||||||
Intent in = new Intent(con, WebActivity.class);
|
Intent in = new Intent(con, WebOnlyOneActivity.class);
|
||||||
Intent inL = new Intent(con, LoginActivity.class);
|
Intent inL = new Intent(con, LoginActivity.class);
|
||||||
in.putExtra("url", ic.getData().get(position).getJumpUrl());
|
in.putExtra("url", ic.getData().get(position).getJumpUrl());
|
||||||
in.putExtra("title", ic.getData().get(position).getTitle());
|
in.putExtra("title", ic.getData().get(position).getTitle());
|
||||||
@ -938,7 +1066,7 @@ public class HomeFragment extends BaseFragment {
|
|||||||
@Override
|
@Override
|
||||||
public void displayImage(Context context, Object path, ImageView imageView) {
|
public void displayImage(Context context, Object path, ImageView imageView) {
|
||||||
if (HomeFragment.this != null && getActivity() != null && !getActivity().isDestroyed()) {
|
if (HomeFragment.this != null && getActivity() != null && !getActivity().isDestroyed()) {
|
||||||
Glide.with(con).load(path).into(imageView);
|
com.dahe.mylibrary.utils.ImageLoader.getInstance().loadImage(con,path,imageView);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1036,29 +1164,64 @@ public class HomeFragment extends BaseFragment {
|
|||||||
// }
|
// }
|
||||||
|
|
||||||
public void initAlct() {
|
public void initAlct() {
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||||
|
// if (!OneDayShowUtils.getInstance().todayIsShowQx(con)){
|
||||||
|
// boolean b = EasyPermissions.hasPermissions(getActivity(), Manifest.permission.WRITE_EXTERNAL_STORAGE,
|
||||||
|
// Manifest.permission.READ_EXTERNAL_STORAGE,
|
||||||
|
// Manifest.permission.ACCESS_FINE_LOCATION,
|
||||||
|
// Manifest.permission.ACCESS_COARSE_LOCATION);
|
||||||
|
// if (b) {
|
||||||
|
// ALProcess.verification(con);
|
||||||
|
// }
|
||||||
PermissionX.init(getActivity())
|
PermissionX.init(getActivity())
|
||||||
.permissions(Manifest.permission.WRITE_EXTERNAL_STORAGE,
|
.permissions(Manifest.permission.WRITE_EXTERNAL_STORAGE,
|
||||||
Manifest.permission.READ_EXTERNAL_STORAGE,
|
Manifest.permission.READ_EXTERNAL_STORAGE,
|
||||||
Manifest.permission.RECORD_AUDIO)
|
Manifest.permission.ACCESS_FINE_LOCATION,
|
||||||
|
Manifest.permission.CAMERA,
|
||||||
|
Manifest.permission.ACCESS_COARSE_LOCATION)
|
||||||
.request((allGranted, grantedList, deniedList) -> {
|
.request((allGranted, grantedList, deniedList) -> {
|
||||||
if (allGranted) {
|
if (allGranted) {
|
||||||
|
ALProcess.verification(con);
|
||||||
|
} else {
|
||||||
|
boolean accessCoarseLocation = deniedList.contains("android.permission.ACCESS_FINE_LOCATION");
|
||||||
|
boolean contains = deniedList.contains("android.permission.WRITE_EXTERNAL_STORAGE");
|
||||||
|
boolean camear = deniedList.contains("android.permission.CAMERA");
|
||||||
|
if (accessCoarseLocation | contains) {
|
||||||
|
new MessageUtils().showSimCenPop(con, "缺少定位权限或媒体和文件权限,会导致无法结算运费,去开启!", "取消", "确认", () -> {
|
||||||
|
Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
|
||||||
|
Uri uri = Uri.fromParts("package", getPackageName(), null);
|
||||||
|
intent.setData(uri);
|
||||||
|
startActivity(intent);
|
||||||
|
});
|
||||||
|
} else if (camear) {
|
||||||
|
new MessageUtils().showSimCenPop(con, "缺少相机权限,会导致无法实名认证,去开启!", "取消", "确认", () -> {
|
||||||
|
Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
|
||||||
|
Uri uri = Uri.fromParts("package", getPackageName(), null);
|
||||||
|
intent.setData(uri);
|
||||||
|
startActivity(intent);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
// }
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
}
|
|
||||||
});
|
|
||||||
ALProcess.verification(con);
|
ALProcess.verification(con);
|
||||||
MDPLocationCollectionManager.getInvoices(con, 10, 1, new OnDownloadResultListener() {
|
|
||||||
@Override
|
|
||||||
public void onSuccess(Object o) {
|
|
||||||
Log.e("--成功信息--", new Gson().toJson(o));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
// ALProcess.verification(con);
|
||||||
public void onFailure(String s, String s1) {
|
// MDPLocationCollectionManager.getInvoices(con, 10, 1, new OnDownloadResultListener() {
|
||||||
Log.e("--失败信息--", s + s1);
|
// @Override
|
||||||
}
|
// public void onSuccess(Object o) {
|
||||||
});
|
// Log.e("--成功信息--", new Gson().toJson(o));
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public void onFailure(String s, String s1) {
|
||||||
|
// Log.e("--失败信息--", s + s1);
|
||||||
|
// }
|
||||||
|
// });
|
||||||
}
|
}
|
||||||
|
|
||||||
private MyLocationStyle myLocationStyle;//地图定位样式
|
private MyLocationStyle myLocationStyle;//地图定位样式
|
||||||
@ -1134,10 +1297,31 @@ public class HomeFragment extends BaseFragment {
|
|||||||
initView(null);
|
initView(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onStart() {
|
||||||
|
super.onStart();
|
||||||
|
refreshWaybills();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void refreshWaybills() {
|
||||||
|
// if (UiAuxiliary.isLogin(con)) {
|
||||||
|
// int curWaybillId = (int) SPUtils.get(con, "curWaybillId", -1);
|
||||||
|
// hyr.startOrder(curWaybillId == -1 ? 0 : curWaybillId);
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
|
||||||
@Subscribe
|
@Subscribe
|
||||||
public void processResult(HomeWaybillEvent home) {
|
public void processResult(HomeWaybillEvent home) {
|
||||||
|
if (home.getMessage() == 1) {
|
||||||
int curWaybillId = (int) SPUtils.get(con, "curWaybillId", -1);
|
int curWaybillId = (int) SPUtils.get(con, "curWaybillId", -1);
|
||||||
hyr.startOrder(curWaybillId == -1 ? 0 : curWaybillId);
|
hyr.startOrder(curWaybillId == -1 ? 0 : curWaybillId);
|
||||||
|
hyr.getHuoYuan(1, 100);
|
||||||
|
} else {
|
||||||
|
int curWaybillId = (int) SPUtils.get(con, "curWaybillId", -1);
|
||||||
|
hyr.startOrder(curWaybillId == -1 ? 0 : curWaybillId);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class Model {
|
class Model {
|
||||||
|
|||||||
@ -1,5 +1,7 @@
|
|||||||
package com.arpa.hndahesudintocctmsdriver.ui.home;
|
package com.arpa.hndahesudintocctmsdriver.ui.home;
|
||||||
|
|
||||||
|
import static com.sdk.base.framework.utils.app.AppUtils.getPackageName;
|
||||||
|
|
||||||
import android.Manifest;
|
import android.Manifest;
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
@ -8,6 +10,7 @@ import android.os.Build;
|
|||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.os.Message;
|
import android.os.Message;
|
||||||
|
import android.provider.Settings;
|
||||||
import android.text.Html;
|
import android.text.Html;
|
||||||
import android.text.Layout;
|
import android.text.Layout;
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
@ -29,16 +32,18 @@ import com.alibaba.fastjson.JSON;
|
|||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.arpa.hndahesudintocctmsdriver.H5Activity;
|
import com.arpa.hndahesudintocctmsdriver.H5Activity;
|
||||||
import com.arpa.hndahesudintocctmsdriver.bean.JTT;
|
import com.arpa.hndahesudintocctmsdriver.bean.JTT;
|
||||||
import com.arpa.hndahesudintocctmsdriver.bean.ToH5Bean;
|
import com.arpa.hndahesudintocctmsdriver.bean.WaybillStatusBean;
|
||||||
import com.arpa.hndahesudintocctmsdriver.event.FaceEvent;
|
import com.arpa.hndahesudintocctmsdriver.event.FaceEvent;
|
||||||
import com.arpa.hndahesudintocctmsdriver.event.HomeEvent;
|
import com.arpa.hndahesudintocctmsdriver.event.HomeEvent;
|
||||||
import com.arpa.hndahesudintocctmsdriver.event.PdfResEvent;
|
import com.arpa.hndahesudintocctmsdriver.event.HomeWaybillEvent;
|
||||||
import com.arpa.hndahesudintocctmsdriver.parts.ConfigParts;
|
import com.arpa.hndahesudintocctmsdriver.parts.ConfigParts;
|
||||||
import com.arpa.hndahesudintocctmsdriver.parts.UserParts;
|
import com.arpa.hndahesudintocctmsdriver.parts.UserParts;
|
||||||
import com.arpa.hndahesudintocctmsdriver.report.ALProcess;
|
import com.arpa.hndahesudintocctmsdriver.report.ALProcess;
|
||||||
import com.arpa.hndahesudintocctmsdriver.report.JTTProcess;
|
import com.arpa.hndahesudintocctmsdriver.report.JTTProcess;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.ui.MainActivity;
|
||||||
import com.arpa.hndahesudintocctmsdriver.ui.auth.PersonalAuthActivity;
|
import com.arpa.hndahesudintocctmsdriver.ui.auth.PersonalAuthActivity;
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.MessageUtils;
|
import com.arpa.hndahesudintocctmsdriver.util.MessageUtils;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.SPUtils;
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.img.ImageGetUtil;
|
import com.arpa.hndahesudintocctmsdriver.util.img.ImageGetUtil;
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.sp.SPUtil;
|
import com.arpa.hndahesudintocctmsdriver.util.sp.SPUtil;
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.string.StringUtil;
|
import com.arpa.hndahesudintocctmsdriver.util.string.StringUtil;
|
||||||
@ -69,6 +74,7 @@ import com.arpa.hndahesudintocctmsdriver.util.time.Timer;
|
|||||||
import com.arpa.hndahesudintocctmsdriver.util.statusbar.StateStyleUtil;
|
import com.arpa.hndahesudintocctmsdriver.util.statusbar.StateStyleUtil;
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.view.BaseActivity;
|
import com.arpa.hndahesudintocctmsdriver.util.view.BaseActivity;
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.view.BaseRecyclerView;
|
import com.arpa.hndahesudintocctmsdriver.util.view.BaseRecyclerView;
|
||||||
|
import com.permissionx.guolindev.PermissionX;
|
||||||
|
|
||||||
import org.greenrobot.eventbus.EventBus;
|
import org.greenrobot.eventbus.EventBus;
|
||||||
import org.greenrobot.eventbus.Subscribe;
|
import org.greenrobot.eventbus.Subscribe;
|
||||||
@ -122,10 +128,13 @@ public class HuoYunDelActivity extends BaseAppCompatActivity {
|
|||||||
Intent intent = new Intent(this, H5Activity.class);
|
Intent intent = new Intent(this, H5Activity.class);
|
||||||
intent.putExtra("url", (String) bb.getData());
|
intent.putExtra("url", (String) bb.getData());
|
||||||
intent.putExtra("view_file", false);
|
intent.putExtra("view_file", false);
|
||||||
|
intent.putExtra("title", "合同签署");
|
||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
}
|
}
|
||||||
//finish();
|
//finish();
|
||||||
} else {
|
} else {
|
||||||
|
EventBus.getDefault().post(new HomeWaybillEvent(1));
|
||||||
|
finish();
|
||||||
Toast.makeText(con, bb.getMsg(), Toast.LENGTH_SHORT).show();
|
Toast.makeText(con, bb.getMsg(), Toast.LENGTH_SHORT).show();
|
||||||
customDialog.dismiss();
|
customDialog.dismiss();
|
||||||
}
|
}
|
||||||
@ -143,6 +152,38 @@ public class HuoYunDelActivity extends BaseAppCompatActivity {
|
|||||||
}
|
}
|
||||||
CacheGroup.cacheList.remove("jttRes");
|
CacheGroup.cacheList.remove("jttRes");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (CacheGroup.cacheList.get("orderStatus") != null) {
|
||||||
|
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||||
|
customDialog.dismiss();
|
||||||
|
}
|
||||||
|
Log.e("orderStatus", CacheGroup.cacheList.get("orderStatus"));
|
||||||
|
WaybillStatusBean status = gson.fromJson(CacheGroup.cacheList.get("orderStatus"), WaybillStatusBean.class);
|
||||||
|
if (status.getCode() == 200) {
|
||||||
|
if (status.getData() != null) {
|
||||||
|
//执行运单下一步操作
|
||||||
|
new XPopup.Builder(con)
|
||||||
|
.isDestroyOnDismiss(true) //对于只使用一次的弹窗,推荐设置这个
|
||||||
|
.asConfirm("请确认接单", "是否确定承运此运单?",
|
||||||
|
"取消", "确认",
|
||||||
|
() -> {
|
||||||
|
Log.e("--id--", "cid:" + cid + "---wid:" + id);
|
||||||
|
hyr.confirm(cid, id);
|
||||||
|
}, () -> customDialog.dismiss(), false, R.layout.alert_ok_cancel) //最后一个参数绑定已有布局
|
||||||
|
.show();
|
||||||
|
} else {//订单已取消
|
||||||
|
new MessageUtils().showSimCenPop(con, "运单异常将无法进行下步操作,请返回首页", "取消", "确定", () -> {
|
||||||
|
SPUtils.remove(con, "curWaybillId");
|
||||||
|
EventBus.getDefault().post(new HomeWaybillEvent(1));
|
||||||
|
ActivityUtils.finishToActivity(MainActivity.class, false);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Toast.makeText(con, status.getMsg(), Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
CacheGroup.cacheList.remove("orderStatus");
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case 13:
|
case 13:
|
||||||
int index = Integer.valueOf((String) m.obj);
|
int index = Integer.valueOf((String) m.obj);
|
||||||
@ -150,28 +191,18 @@ public class HuoYunDelActivity extends BaseAppCompatActivity {
|
|||||||
car.setText("选择车辆:" + clb.getData().get(index).getCarNumber());
|
car.setText("选择车辆:" + clb.getData().get(index).getCarNumber());
|
||||||
cid = clb.getData().get(index).getCarId();
|
cid = clb.getData().get(index).getCarId();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 1111://安联用户验证通过,接单
|
case 1111://安联用户验证通过,接单
|
||||||
new XPopup.Builder(con)
|
hyr.getOrderStatus(id);
|
||||||
.isDestroyOnDismiss(true) //对于只使用一次的弹窗,推荐设置这个
|
// new XPopup.Builder(con)
|
||||||
.asConfirm("请确认接单", "是否确定承运此运单?",
|
// .isDestroyOnDismiss(true) //对于只使用一次的弹窗,推荐设置这个
|
||||||
"取消", "确认",
|
// .asConfirm("请确认接单", "是否确定承运此运单?",
|
||||||
() -> {
|
// "取消", "确认",
|
||||||
ToH5Bean toH5Bean = new ToH5Bean();
|
// () -> {
|
||||||
toH5Bean.setId(id);
|
// Log.e("--id--", "cid:" + cid + "---wid:" + id);
|
||||||
toH5Bean.setCarNumber(car.getText().toString().substring("选择车辆:".length()));
|
// hyr.confirm(cid, id);
|
||||||
toH5Bean.setCarId(cid);
|
// }, () -> customDialog.dismiss(), false, R.layout.alert_ok_cancel) //最后一个参数绑定已有布局
|
||||||
Log.e("--id--", "cid:" + cid + "---wid:" + id);
|
// .show();
|
||||||
Intent in = new Intent(con, WebActivity.class);
|
|
||||||
in.putExtra("url", "https://platform.test.dahehuoyun.com/contract/dist/#/contracttemplate");
|
|
||||||
in.putExtra("id", id);
|
|
||||||
in.putExtra("ToH5Bean",toH5Bean);
|
|
||||||
in.putExtra("title", "合同签署");
|
|
||||||
// startActivity(in);
|
|
||||||
|
|
||||||
startActivityForResult(in,1);
|
|
||||||
|
|
||||||
}, () -> customDialog.dismiss(), false, R.layout.alert_ok_cancel) //最后一个参数绑定已有布局
|
|
||||||
.show();
|
|
||||||
break;
|
break;
|
||||||
case 2222://安联用户验证不通过
|
case 2222://安联用户验证不通过
|
||||||
customDialog.dismiss();
|
customDialog.dismiss();
|
||||||
@ -284,7 +315,11 @@ public class HuoYunDelActivity extends BaseAppCompatActivity {
|
|||||||
});
|
});
|
||||||
//
|
//
|
||||||
ImageButton xuanze = v.findViewById(R.id.xuanze);
|
ImageButton xuanze = v.findViewById(R.id.xuanze);
|
||||||
if (clb != null && clb.getData().size() == 1) {
|
|
||||||
|
if (hyd!=null&&hyd.getData()!=null&& !TextUtils.isEmpty(hyd.getData().getCarNumber())){
|
||||||
|
cid = hyd.getData().getCarId();
|
||||||
|
car.setText("选择车辆:" + hyd.getData().getCarNumber());
|
||||||
|
}else if (clb != null && clb.getData().size() == 1) {
|
||||||
cid = clb.getData().get(0).getCarId();
|
cid = clb.getData().get(0).getCarId();
|
||||||
car.setText("选择车辆:" + clb.getData().get(0).getCarNumber());
|
car.setText("选择车辆:" + clb.getData().get(0).getCarNumber());
|
||||||
}
|
}
|
||||||
@ -377,6 +412,7 @@ public class HuoYunDelActivity extends BaseAppCompatActivity {
|
|||||||
|
|
||||||
UiAuxiliary.homeRequest("接单");
|
UiAuxiliary.homeRequest("接单");
|
||||||
Intent in = new Intent(con, StartYunDanActivity.class);
|
Intent in = new Intent(con, StartYunDanActivity.class);
|
||||||
|
in.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP|Intent.FLAG_ACTIVITY_SINGLE_TOP);
|
||||||
in.putExtra("id", "0");
|
in.putExtra("id", "0");
|
||||||
startActivity(in);
|
startActivity(in);
|
||||||
finish();
|
finish();
|
||||||
@ -390,7 +426,6 @@ public class HuoYunDelActivity extends BaseAppCompatActivity {
|
|||||||
// }, 2500);
|
// }, 2500);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// new Handler().postDelayed(() -> {
|
// new Handler().postDelayed(() -> {
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
@ -450,31 +485,63 @@ public class HuoYunDelActivity extends BaseAppCompatActivity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
|
|
||||||
super.onActivityResult(requestCode, resultCode, data);
|
|
||||||
if (resultCode == RESULT_OK&&requestCode==1){
|
|
||||||
//签合同后接单
|
|
||||||
// String pdfUrl = data.getStringExtra("pdfUrl");
|
|
||||||
// hyr.confirm(cid,pdfUrl, id);
|
|
||||||
|
|
||||||
UiAuxiliary.homeRequest("接单");
|
|
||||||
Intent in = new Intent(con, StartYunDanActivity.class);
|
|
||||||
in.putExtra("id", "0");
|
|
||||||
startActivity(in);
|
|
||||||
finish();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 接单
|
* 接单
|
||||||
* 先判断安联用户信息验证,随后接单
|
* 先判断安联用户信息验证,随后接单
|
||||||
*/
|
*/
|
||||||
private void reOrder() {
|
private void reOrder() {
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||||
|
try {
|
||||||
|
PermissionX.init(this)
|
||||||
|
.permissions(Manifest.permission.WRITE_EXTERNAL_STORAGE,
|
||||||
|
Manifest.permission.READ_EXTERNAL_STORAGE,
|
||||||
|
Manifest.permission.ACCESS_FINE_LOCATION,
|
||||||
|
Manifest.permission.ACCESS_COARSE_LOCATION)
|
||||||
|
.request((allGranted, grantedList, deniedList) -> {
|
||||||
|
if (allGranted) {
|
||||||
|
customDialog = new CustomDialog(con, "正在接单...");
|
||||||
|
customDialog.show();
|
||||||
|
//验证安联用户是否通过
|
||||||
|
ALProcess.verification(con, hd);
|
||||||
|
} else {
|
||||||
|
boolean accessCoarseLocation = deniedList.contains("android.permission.ACCESS_FINE_LOCATION");
|
||||||
|
boolean contains = deniedList.contains("android.permission.WRITE_EXTERNAL_STORAGE");
|
||||||
|
if (accessCoarseLocation | contains) {
|
||||||
|
new MessageUtils().showSimCenPop(con, "缺少定位权限或媒体和文件权限,会导致无法接单,去开启!", "取消", "确认", () -> {
|
||||||
|
Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
|
||||||
|
Uri uri = Uri.fromParts("package", getPackageName(), null);
|
||||||
|
intent.setData(uri);
|
||||||
|
startActivity(intent);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
customDialog = new CustomDialog(con, "正在接单...");
|
customDialog = new CustomDialog(con, "正在接单...");
|
||||||
customDialog.show();
|
customDialog.show();
|
||||||
//验证安联用户是否通过
|
//验证安联用户是否通过
|
||||||
ALProcess.verification(con, hd);
|
ALProcess.verification(con, hd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
customDialog = new CustomDialog(con, "正在接单...");
|
||||||
|
customDialog.show();
|
||||||
|
//验证安联用户是否通过
|
||||||
|
ALProcess.verification(con, hd);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// customDialog = new CustomDialog(con, "正在接单...");
|
||||||
|
// customDialog.show();
|
||||||
|
// //验证安联用户是否通过
|
||||||
|
// ALProcess.verification(con, hd);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onDestroy() {
|
||||||
|
super.onDestroy();
|
||||||
|
EventBus.getDefault().unregister(this);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -186,9 +186,11 @@ public class OrderAllActivity extends BaseActivity {
|
|||||||
case 200006:
|
case 200006:
|
||||||
state4.setTextColor(getResources().getColor(R.color.blue));
|
state4.setTextColor(getResources().getColor(R.color.blue));
|
||||||
state4.setText(" 已评价");
|
state4.setText(" 已评价");
|
||||||
case 200005:
|
|
||||||
state3.setTextColor(getResources().getColor(R.color.blue));
|
state3.setTextColor(getResources().getColor(R.color.blue));
|
||||||
state3.setText(" 已结算");
|
state3.setText(" 已结算");
|
||||||
|
case 200005:
|
||||||
|
// state3.setTextColor(getResources().getColor(R.color.blue));
|
||||||
|
// state3.setText(" 已结算");
|
||||||
case 200004:
|
case 200004:
|
||||||
state2.setTextColor(getResources().getColor(R.color.blue));
|
state2.setTextColor(getResources().getColor(R.color.blue));
|
||||||
state2.setText(" 已卸货");
|
state2.setText(" 已卸货");
|
||||||
|
|||||||
@ -3,6 +3,7 @@ package com.arpa.hndahesudintocctmsdriver.ui.home;
|
|||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.Message;
|
import android.os.Message;
|
||||||
|
import android.text.TextUtils;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.animation.AlphaAnimation;
|
import android.view.animation.AlphaAnimation;
|
||||||
@ -43,6 +44,7 @@ import com.amap.api.services.route.WalkRouteResult;
|
|||||||
import com.arpa.hndahesudintocctmsdriver.util.alert.CustomDialog;
|
import com.arpa.hndahesudintocctmsdriver.util.alert.CustomDialog;
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.alert.ToastUtil;
|
import com.arpa.hndahesudintocctmsdriver.util.alert.ToastUtil;
|
||||||
import com.bumptech.glide.Glide;
|
import com.bumptech.glide.Glide;
|
||||||
|
import com.dahe.mylibrary.utils.ImageLoader;
|
||||||
import com.dahe.mylibrary.utils.TimeUtil;
|
import com.dahe.mylibrary.utils.TimeUtil;
|
||||||
import com.dahe.mylibrary.utils.ToastUtils;
|
import com.dahe.mylibrary.utils.ToastUtils;
|
||||||
import com.google.android.material.bottomsheet.BottomSheetBehavior;
|
import com.google.android.material.bottomsheet.BottomSheetBehavior;
|
||||||
@ -106,10 +108,10 @@ public class StartYunDanActivity extends BaseActivity {
|
|||||||
switch (m.what) {
|
switch (m.what) {
|
||||||
case RequsetCodeConstants.SUCCESS:
|
case RequsetCodeConstants.SUCCESS:
|
||||||
//获取页面数据
|
//获取页面数据
|
||||||
if (CacheGroup.cacheList.get(HuoYuanFragmengt.START_ORDER) != null && CacheGroup.cacheList.get(GET_EVALUTE) != null) {
|
if (CacheGroup.cacheList.get("refreshorderDetail") != null && CacheGroup.cacheList.get(GET_EVALUTE) != null) {
|
||||||
Log.e("-评论-", CacheGroup.cacheList.get(GET_EVALUTE));
|
Log.e("-评论-", CacheGroup.cacheList.get(GET_EVALUTE));
|
||||||
Log.e("-运单-", CacheGroup.cacheList.get(HuoYuanFragmengt.START_ORDER));
|
Log.e("-运单-", CacheGroup.cacheList.get("refreshorderDetail"));
|
||||||
sob = gson.fromJson(CacheGroup.cacheList.get(HuoYuanFragmengt.START_ORDER), StartOrderBean.class);
|
sob = gson.fromJson(CacheGroup.cacheList.get("refreshorderDetail"), StartOrderBean.class);
|
||||||
wnb = gson.fromJson(CacheGroup.cacheList.get(GET_EVALUTE), WNewsBean.class);
|
wnb = gson.fromJson(CacheGroup.cacheList.get(GET_EVALUTE), WNewsBean.class);
|
||||||
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||||
customDialog.dismiss();
|
customDialog.dismiss();
|
||||||
@ -125,7 +127,7 @@ public class StartYunDanActivity extends BaseActivity {
|
|||||||
} else {
|
} else {
|
||||||
Toast.makeText(con, sob.getMsg(), Toast.LENGTH_SHORT).show();
|
Toast.makeText(con, sob.getMsg(), Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
CacheGroup.cacheList.remove(HuoYuanFragmengt.START_ORDER);
|
CacheGroup.cacheList.remove("refreshorderDetail");
|
||||||
CacheGroup.cacheList.remove(GET_EVALUTE);
|
CacheGroup.cacheList.remove(GET_EVALUTE);
|
||||||
}
|
}
|
||||||
//保存评价
|
//保存评价
|
||||||
@ -233,7 +235,7 @@ public class StartYunDanActivity extends BaseActivity {
|
|||||||
}
|
}
|
||||||
ImageView head_img = v.findViewById(R.id.head_img);
|
ImageView head_img = v.findViewById(R.id.head_img);
|
||||||
if (ub != null && ub.getData() != null && !ub.getData().getHeadportraitUrl().equals("")) {
|
if (ub != null && ub.getData() != null && !ub.getData().getHeadportraitUrl().equals("")) {
|
||||||
Glide.with(con).load(ub.getData().getHeadportraitUrl()).into(head_img);
|
ImageLoader.getInstance().loadImage(con,ub.getData().getHeadportraitUrl(),head_img);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@ -483,9 +485,15 @@ public class StartYunDanActivity extends BaseActivity {
|
|||||||
if (map != null) {
|
if (map != null) {
|
||||||
map.onResume();
|
map.onResume();
|
||||||
}
|
}
|
||||||
|
if (customDialog==null){
|
||||||
customDialog = new CustomDialog(con, "网络请求中...");
|
customDialog = new CustomDialog(con, "网络请求中...");
|
||||||
customDialog.show();
|
customDialog.show();
|
||||||
hyr.startOrder(id);
|
}else{
|
||||||
|
if (!customDialog.isShowing()){
|
||||||
|
customDialog.show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
hyr.startOrder2(id);
|
||||||
hyr.getEvaluate(id);
|
hyr.getEvaluate(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -596,6 +604,10 @@ public class StartYunDanActivity extends BaseActivity {
|
|||||||
|
|
||||||
|
|
||||||
public void search() {
|
public void search() {
|
||||||
|
String latitude = sob.getData().getWayChildren().get((sob.getData().getWayChildren().size() - 1)).getLatitude();
|
||||||
|
if (TextUtils.isEmpty(latitude)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
// try {
|
// try {
|
||||||
// AMapLocationClient.updatePrivacyShow(con,true,true);
|
// AMapLocationClient.updatePrivacyShow(con,true,true);
|
||||||
// AMapLocationClient.updatePrivacyAgree(con,true);
|
// AMapLocationClient.updatePrivacyAgree(con,true);
|
||||||
|
|||||||
@ -21,6 +21,7 @@ import com.bumptech.glide.Glide;
|
|||||||
import com.arpa.hndahesudintocctmsdriver.R;
|
import com.arpa.hndahesudintocctmsdriver.R;
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.statusbar.StateStyleUtil;
|
import com.arpa.hndahesudintocctmsdriver.util.statusbar.StateStyleUtil;
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.view.BaseActivity;
|
import com.arpa.hndahesudintocctmsdriver.util.view.BaseActivity;
|
||||||
|
import com.dahe.mylibrary.utils.ImageLoader;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileOutputStream;
|
import java.io.FileOutputStream;
|
||||||
@ -58,7 +59,7 @@ public class VideoReleaseActivity extends BaseActivity {
|
|||||||
public void initView(Object obj) {
|
public void initView(Object obj) {
|
||||||
super.initView(obj);
|
super.initView(obj);
|
||||||
getFirstframe(videoPath);
|
getFirstframe(videoPath);
|
||||||
Glide.with(con).load(new File(coverPath)).into(video_cover);
|
ImageLoader.getInstance().loadImage(con,new File(coverPath),video_cover);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void submit(View v){
|
public void submit(View v){
|
||||||
|
|||||||
@ -8,6 +8,7 @@ import android.widget.TextView;
|
|||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
|
|
||||||
import com.bumptech.glide.Glide;
|
import com.bumptech.glide.Glide;
|
||||||
|
import com.dahe.mylibrary.utils.ImageLoader;
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.lxj.xpopup.XPopup;
|
import com.lxj.xpopup.XPopup;
|
||||||
import com.arpa.hndahesudintocctmsdriver.R;
|
import com.arpa.hndahesudintocctmsdriver.R;
|
||||||
@ -72,7 +73,7 @@ public class GetShangChuanActivity extends BaseActivity {
|
|||||||
//coordinate.setText(StringUtil.isNull(sdw.getLongitude(),"")+","+StringUtil.isNull(sdw.getLatitude(),""));
|
//coordinate.setText(StringUtil.isNull(sdw.getLongitude(),"")+","+StringUtil.isNull(sdw.getLatitude(),""));
|
||||||
//coordinate2.setText(StringUtil.isNull(sdw.getReceiptLongitude(),"")+","+StringUtil.isNull(sdw.getReceiptLatitude(),""));
|
//coordinate2.setText(StringUtil.isNull(sdw.getReceiptLongitude(),"")+","+StringUtil.isNull(sdw.getReceiptLatitude(),""));
|
||||||
if(sdw.getSendPutImagesUrl()!=null && sdw.getSendPutImagesUrl().size()>=1){
|
if(sdw.getSendPutImagesUrl()!=null && sdw.getSendPutImagesUrl().size()>=1){
|
||||||
Glide.with(con).load(sdw.getSendPutImagesUrl().get(0)).into(img1);
|
ImageLoader.getInstance().loadImage(con,sdw.getSendPutImagesUrl().get(0),img1);
|
||||||
img1.setOnClickListener(v -> {
|
img1.setOnClickListener(v -> {
|
||||||
new XPopup.Builder(con)
|
new XPopup.Builder(con)
|
||||||
.asImageViewer(img1,sdw.getSendPutImagesUrl().get(0), new SmartGlideImageLoader(R.mipmap.ic_launcher))
|
.asImageViewer(img1,sdw.getSendPutImagesUrl().get(0), new SmartGlideImageLoader(R.mipmap.ic_launcher))
|
||||||
@ -83,7 +84,7 @@ public class GetShangChuanActivity extends BaseActivity {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
if(sdw.getReceiptUrl()!=null && sdw.getReceiptUrl().size()>=1){
|
if(sdw.getReceiptUrl()!=null && sdw.getReceiptUrl().size()>=1){
|
||||||
Glide.with(con).load(sdw.getReceiptUrl().get(0)).into(img2);
|
ImageLoader.getInstance().loadImage(con,sdw.getReceiptUrl().get(0),img2);
|
||||||
img2.setOnClickListener(v -> {
|
img2.setOnClickListener(v -> {
|
||||||
new XPopup.Builder(con)
|
new XPopup.Builder(con)
|
||||||
.asImageViewer(img2,sdw.getReceiptUrl().get(0), new SmartGlideImageLoader(R.mipmap.ic_launcher))
|
.asImageViewer(img2,sdw.getReceiptUrl().get(0), new SmartGlideImageLoader(R.mipmap.ic_launcher))
|
||||||
|
|||||||
@ -1,8 +1,12 @@
|
|||||||
package com.arpa.hndahesudintocctmsdriver.ui.home.shangchuan;
|
package com.arpa.hndahesudintocctmsdriver.ui.home.shangchuan;
|
||||||
|
|
||||||
|
import static com.sdk.base.framework.utils.app.AppUtils.getPackageName;
|
||||||
|
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
|
import android.net.Uri;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.Message;
|
import android.os.Message;
|
||||||
|
import android.provider.Settings;
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.Gravity;
|
import android.view.Gravity;
|
||||||
@ -15,16 +19,20 @@ import android.widget.Toast;
|
|||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
|
|
||||||
import com.alct.mdp.MDPLocationCollectionManager;
|
import com.alct.mdp.MDPLocationCollectionManager;
|
||||||
|
import com.alct.mdp.callback.OnDownloadResultListener;
|
||||||
import com.alct.mdp.callback.OnResultListener;
|
import com.alct.mdp.callback.OnResultListener;
|
||||||
import com.alct.mdp.model.Goods;
|
import com.alct.mdp.model.Goods;
|
||||||
import com.alct.mdp.model.Image;
|
import com.alct.mdp.model.Image;
|
||||||
import com.alct.mdp.model.Location;
|
import com.alct.mdp.model.Location;
|
||||||
|
import com.alct.mdp.model.ShipmentStatusEnum;
|
||||||
import com.arpa.hndahesudintocctmsdriver.BuildConfig;
|
import com.arpa.hndahesudintocctmsdriver.BuildConfig;
|
||||||
import com.arpa.hndahesudintocctmsdriver.bean.CarInfoBean;
|
import com.arpa.hndahesudintocctmsdriver.bean.CarInfoBean;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.bean.WaybillStatusBean;
|
||||||
import com.arpa.hndahesudintocctmsdriver.event.HomeWaybillEvent;
|
import com.arpa.hndahesudintocctmsdriver.event.HomeWaybillEvent;
|
||||||
import com.arpa.hndahesudintocctmsdriver.report.ALProcess;
|
|
||||||
import com.arpa.hndahesudintocctmsdriver.report.JTTProcess;
|
import com.arpa.hndahesudintocctmsdriver.report.JTTProcess;
|
||||||
import com.arpa.hndahesudintocctmsdriver.request.OCRRequest;
|
import com.arpa.hndahesudintocctmsdriver.request.OCRRequest;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.request.bean.TrackInputBean;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.ui.MainActivity;
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.BitmapUtil;
|
import com.arpa.hndahesudintocctmsdriver.util.BitmapUtil;
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.MessageUtils;
|
import com.arpa.hndahesudintocctmsdriver.util.MessageUtils;
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.NfcUtils;
|
import com.arpa.hndahesudintocctmsdriver.util.NfcUtils;
|
||||||
@ -35,6 +43,9 @@ import com.arpa.hndahesudintocctmsdriver.util.location.LocationUtil;
|
|||||||
import com.baidu.mapapi.model.LatLng;
|
import com.baidu.mapapi.model.LatLng;
|
||||||
import com.baidu.mapapi.utils.CoordinateConverter;
|
import com.baidu.mapapi.utils.CoordinateConverter;
|
||||||
import com.bumptech.glide.Glide;
|
import com.bumptech.glide.Glide;
|
||||||
|
import com.dahe.mylibrary.utils.ActivityUtils;
|
||||||
|
import com.dahe.mylibrary.utils.ImageLoader;
|
||||||
|
import com.dahe.mylibrary.utils.ToastUtils;
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.luck.picture.lib.PictureSelector;
|
import com.luck.picture.lib.PictureSelector;
|
||||||
import com.luck.picture.lib.config.PictureConfig;
|
import com.luck.picture.lib.config.PictureConfig;
|
||||||
@ -92,10 +103,17 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
|||||||
private boolean locationKey = false;
|
private boolean locationKey = false;
|
||||||
private TextView tv_loaction;
|
private TextView tv_loaction;
|
||||||
|
|
||||||
|
private boolean isFinish = false;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void msgMethod(Message m) {
|
public void msgMethod(Message m) {
|
||||||
super.msgMethod(m);
|
super.msgMethod(m);
|
||||||
switch (m.what) {
|
switch (m.what) {
|
||||||
|
case RequsetCodeConstants.ERROR:
|
||||||
|
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||||
|
customDialog.dismiss();
|
||||||
|
}
|
||||||
|
break;
|
||||||
case RequsetCodeConstants.SUCCESS:
|
case RequsetCodeConstants.SUCCESS:
|
||||||
if (CacheGroup.cacheList.get("upload") != null) {
|
if (CacheGroup.cacheList.get("upload") != null) {
|
||||||
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||||
@ -106,7 +124,7 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
|||||||
if (ub.getCode() == 200) {
|
if (ub.getCode() == 200) {
|
||||||
imgIds.add(ub.getData().getId());
|
imgIds.add(ub.getData().getId());
|
||||||
// Glide.with(con).load(ub.getData().getUrl()).into(res_img);
|
// Glide.with(con).load(ub.getData().getUrl()).into(res_img);
|
||||||
Glide.with(con).load(path).into(res_img);
|
ImageLoader.getInstance().loadImage(con,path,res_img);
|
||||||
res_img.setVisibility(View.VISIBLE);
|
res_img.setVisibility(View.VISIBLE);
|
||||||
img_delete.setVisibility(View.VISIBLE);
|
img_delete.setVisibility(View.VISIBLE);
|
||||||
img_icon.setVisibility(View.GONE);
|
img_icon.setVisibility(View.GONE);
|
||||||
@ -116,6 +134,37 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
|||||||
}
|
}
|
||||||
CacheGroup.cacheList.remove("upload");
|
CacheGroup.cacheList.remove("upload");
|
||||||
}
|
}
|
||||||
|
if (CacheGroup.cacheList.get("genzong") != null) {
|
||||||
|
BaseBean bb = gson.fromJson(CacheGroup.cacheList.get("genzong"), BaseBean.class);
|
||||||
|
if (bb.getCode() == 200) {
|
||||||
|
Log.e("--轨迹上传--", "成功");
|
||||||
|
} else {
|
||||||
|
Log.e("--轨迹上传失败:--", bb.getMsg());
|
||||||
|
}
|
||||||
|
CacheGroup.cacheList.remove("genzong");
|
||||||
|
}
|
||||||
|
if (CacheGroup.cacheList.get("waybillStatus") != null) {
|
||||||
|
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||||
|
customDialog.dismiss();
|
||||||
|
}
|
||||||
|
Log.e("waybillStatus", CacheGroup.cacheList.get("waybillStatus"));
|
||||||
|
WaybillStatusBean status = gson.fromJson(CacheGroup.cacheList.get("waybillStatus"), WaybillStatusBean.class);
|
||||||
|
if (status.getCode() == 200) {
|
||||||
|
if (status.getData() != null) {
|
||||||
|
//执行运单下一步操作
|
||||||
|
typeRequest();
|
||||||
|
} else {//订单已取消
|
||||||
|
new MessageUtils().showSimCenPop(con, "运单异常将无法进行下步操作,请返回首页", "取消", "确定", () -> {
|
||||||
|
SPUtils.remove(con, "curWaybillId");
|
||||||
|
EventBus.getDefault().post(new HomeWaybillEvent());
|
||||||
|
ActivityUtils.finishToActivity(MainActivity.class, false);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Toast.makeText(con, status.getMsg(), Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
CacheGroup.cacheList.remove("waybillStatus");
|
||||||
|
}
|
||||||
for (int i = 0; i < TYPE_NAME.length; i++) {
|
for (int i = 0; i < TYPE_NAME.length; i++) {
|
||||||
if (CacheGroup.cacheList.get(TYPE_NAME[i]) != null) {
|
if (CacheGroup.cacheList.get(TYPE_NAME[i]) != null) {
|
||||||
BaseBean bb = gson.fromJson(CacheGroup.cacheList.get(TYPE_NAME[i]), BaseBean.class);
|
BaseBean bb = gson.fromJson(CacheGroup.cacheList.get(TYPE_NAME[i]), BaseBean.class);
|
||||||
@ -129,8 +178,20 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
|||||||
Toast.makeText(con, "上传成功", Toast.LENGTH_SHORT).show();
|
Toast.makeText(con, "上传成功", Toast.LENGTH_SHORT).show();
|
||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
|
} else if ((0 == index || 1 == index) && isFinish) {
|
||||||
|
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||||
|
customDialog.dismiss();
|
||||||
|
}
|
||||||
|
EventBus.getDefault().post(new HomeWaybillEvent());
|
||||||
|
Toast.makeText(con, "上传成功", Toast.LENGTH_SHORT).show();
|
||||||
|
finish();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||||
|
customDialog.dismiss();
|
||||||
|
}
|
||||||
|
EventBus.getDefault().post(new HomeWaybillEvent());
|
||||||
|
finish();
|
||||||
Toast.makeText(con, bb.getMsg(), Toast.LENGTH_SHORT).show();
|
Toast.makeText(con, bb.getMsg(), Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
CacheGroup.cacheList.remove(TYPE_NAME[i]);
|
CacheGroup.cacheList.remove(TYPE_NAME[i]);
|
||||||
@ -155,6 +216,9 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
|||||||
if (sob.getData().getCarNumber().equals(value)) {
|
if (sob.getData().getCarNumber().equals(value)) {
|
||||||
hyr.uploadFile(new File(path));
|
hyr.uploadFile(new File(path));
|
||||||
} else {
|
} else {
|
||||||
|
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||||
|
customDialog.dismiss();
|
||||||
|
}
|
||||||
new MessageUtils().showCenMessage(ShangChuangImgActivity.this, "车牌号不匹配!", "请重新拍照或联系管理员");
|
new MessageUtils().showCenMessage(ShangChuangImgActivity.this, "车牌号不匹配!", "请重新拍照或联系管理员");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -191,7 +255,16 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
|||||||
}
|
}
|
||||||
tv_loaction.setText("定位失败,点击重试");
|
tv_loaction.setText("定位失败,点击重试");
|
||||||
tv_loaction.setTextColor(getResources().getColor(R.color.loaction_no_color, null));
|
tv_loaction.setTextColor(getResources().getColor(R.color.loaction_no_color, null));
|
||||||
Toast.makeText(con, "定位失败,请确认开启定位后重试!", Toast.LENGTH_LONG).show();
|
|
||||||
|
new MessageUtils().showSimCenPop(con, "缺少定位权限,去开启精确定位权限!", "取消", "确认", () -> {
|
||||||
|
Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
|
||||||
|
Uri uri = Uri.fromParts("package", getPackageName(), null);
|
||||||
|
intent.setData(uri);
|
||||||
|
startActivity(intent);
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
// Toast.makeText(con, "定位失败,请确认开启定位后重试!", Toast.LENGTH_LONG).show();
|
||||||
//定位结果接收
|
//定位结果接收
|
||||||
//finish();
|
//finish();
|
||||||
break;
|
break;
|
||||||
@ -255,6 +328,7 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
|||||||
sobStr = getIntent().getExtras().getString("sob");
|
sobStr = getIntent().getExtras().getString("sob");
|
||||||
//Log.e("---sdwStr--",sdwStr);
|
//Log.e("---sdwStr--",sdwStr);
|
||||||
sob = new Gson().fromJson(sobStr, StartOrderBean.class);
|
sob = new Gson().fromJson(sobStr, StartOrderBean.class);
|
||||||
|
|
||||||
initView(null);
|
initView(null);
|
||||||
customDialog = new CustomDialog(con, "正在定位当前位置...");
|
customDialog = new CustomDialog(con, "正在定位当前位置...");
|
||||||
customDialog.show();
|
customDialog.show();
|
||||||
@ -299,7 +373,9 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
|||||||
}
|
}
|
||||||
submit.setOnClickListener(v -> {
|
submit.setOnClickListener(v -> {
|
||||||
if (imgIds.size() != 0) {
|
if (imgIds.size() != 0) {
|
||||||
typeRequest();
|
//判断运单是否已取消
|
||||||
|
hyr.getWaybillStatus(sob.getData().getWaybillId());
|
||||||
|
// typeRequest();
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(con, "请先上传一张图片", Toast.LENGTH_SHORT).show();
|
Toast.makeText(con, "请先上传一张图片", Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
@ -398,16 +474,48 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
|||||||
Log.e("--装货信息", gson.toJson(lub));
|
Log.e("--装货信息", gson.toJson(lub));
|
||||||
if (locationKey) {//高德定位
|
if (locationKey) {//高德定位
|
||||||
if (keys) {
|
if (keys) {
|
||||||
|
MDPLocationCollectionManager.getShipmentStatus(con, sob.getData().getShippingNoteNumber(), new OnDownloadResultListener() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(Object o) {
|
||||||
|
|
||||||
|
String string = o.toString();
|
||||||
|
if (string.equals("PICKUPED")) {//安联装货,单平台未装货
|
||||||
|
isFinish = true;
|
||||||
|
//平台确认装货
|
||||||
|
hyr.loading(lub);
|
||||||
|
} else {
|
||||||
nfc();
|
nfc();
|
||||||
loadInfo();
|
loadInfo();
|
||||||
|
}
|
||||||
|
upLocation(lgdu.getLatitude()+"",lgdu.getLongitude()+"",sob.getData().getShippingNoteNumber());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(String s, String s1) {
|
||||||
|
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||||
|
customDialog.dismiss();
|
||||||
|
}
|
||||||
|
ToastUtils.showToast(con, s1);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
// nfc();
|
||||||
|
// loadInfo();
|
||||||
// up_traffic_start();
|
// up_traffic_start();
|
||||||
// up_image_z();
|
// up_image_z();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||||
|
customDialog.dismiss();
|
||||||
|
}
|
||||||
Toast.makeText(con, "定位异常,请重新定位", Toast.LENGTH_SHORT).show();
|
Toast.makeText(con, "定位异常,请重新定位", Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||||
|
customDialog.dismiss();
|
||||||
|
}
|
||||||
Toast.makeText(con, "图片上传异常,请重新上传", Toast.LENGTH_SHORT).show();
|
Toast.makeText(con, "图片上传异常,请重新上传", Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -422,16 +530,46 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
|||||||
Log.e("--卸货信息", gson.toJson(lub));
|
Log.e("--卸货信息", gson.toJson(lub));
|
||||||
if (locationKey) {
|
if (locationKey) {
|
||||||
if (keys) {
|
if (keys) {
|
||||||
|
MDPLocationCollectionManager.getShipmentStatus(con, sob.getData().getShippingNoteNumber(), new OnDownloadResultListener() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(Object o) {
|
||||||
|
if (o.toString().equals("UNLOADED")) {//安联装货,单平台未装货
|
||||||
|
//卸货状态-平台
|
||||||
|
isFinish = true;
|
||||||
|
hyr.dischargeCargo(lub);
|
||||||
|
} else {
|
||||||
nfc();
|
nfc();
|
||||||
uploadInfo();
|
uploadInfo();
|
||||||
|
}
|
||||||
|
upLocation(lgdu.getLatitude()+"",lgdu.getLongitude()+"",sob.getData().getShippingNoteNumber());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(String s, String s1) {
|
||||||
|
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||||
|
customDialog.dismiss();
|
||||||
|
}
|
||||||
|
ToastUtils.showToast(con, s1);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
// nfc();
|
||||||
|
// uploadInfo();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||||
|
customDialog.dismiss();
|
||||||
|
}
|
||||||
Toast.makeText(con, "定位异常,请重新定位", Toast.LENGTH_SHORT).show();
|
Toast.makeText(con, "定位异常,请重新定位", Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||||
|
customDialog.dismiss();
|
||||||
|
}
|
||||||
Toast.makeText(con, "图片上传异常,请重新上传", Toast.LENGTH_SHORT).show();
|
Toast.makeText(con, "图片上传异常,请重新上传", Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -456,9 +594,15 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
|||||||
}
|
}
|
||||||
hyr.receipt(urib);
|
hyr.receipt(urib);
|
||||||
} else {
|
} else {
|
||||||
|
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||||
|
customDialog.dismiss();
|
||||||
|
}
|
||||||
Toast.makeText(con, "定位异常,请重新定位", Toast.LENGTH_SHORT).show();
|
Toast.makeText(con, "定位异常,请重新定位", Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
if (!isFinishing() && customDialog != null && customDialog.isShowing()) {
|
||||||
|
customDialog.dismiss();
|
||||||
|
}
|
||||||
Toast.makeText(con, "图片上传异常,请重新上传", Toast.LENGTH_SHORT).show();
|
Toast.makeText(con, "图片上传异常,请重新上传", Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -776,4 +920,12 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void upLocation(String lat,String lon,String shippingNoteNumber){
|
||||||
|
TrackInputBean tib = new TrackInputBean();
|
||||||
|
tib.setLatitude(lat);
|
||||||
|
tib.setLongitude(lon);
|
||||||
|
tib.setShippingNoteNumber(shippingNoteNumber);
|
||||||
|
hyr.trackTracking(tib);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -58,7 +58,7 @@ public class WebPDFActivity extends BaseActivity {
|
|||||||
protected void onPostExecute(Void aVoid) {
|
protected void onPostExecute(Void aVoid) {
|
||||||
super.onPostExecute(aVoid);
|
super.onPostExecute(aVoid);
|
||||||
pdf_view.fromStream(input[0])
|
pdf_view.fromStream(input[0])
|
||||||
.pages(0,1) // all pages are displayed by default
|
// .pages(0,1,2,3,4,5,6,7) // all pages are displayed by default
|
||||||
.enableAnnotationRendering(true)
|
.enableAnnotationRendering(true)
|
||||||
.load();
|
.load();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -31,6 +31,9 @@ import com.arpa.hndahesudintocctmsdriver.parts.ConfigParts;
|
|||||||
import com.arpa.hndahesudintocctmsdriver.request.net.BaseObserver;
|
import com.arpa.hndahesudintocctmsdriver.request.net.BaseObserver;
|
||||||
import com.arpa.hndahesudintocctmsdriver.request.net.DataManager;
|
import com.arpa.hndahesudintocctmsdriver.request.net.DataManager;
|
||||||
import com.arpa.hndahesudintocctmsdriver.request.net.RxHttpCallBack;
|
import com.arpa.hndahesudintocctmsdriver.request.net.RxHttpCallBack;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.ui.web.WebOnlyOneActivity;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.alert.CustomDialog;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.weight.OnLimitClickHelper;
|
||||||
import com.dahe.mylibrary.net.CommonResponseBean;
|
import com.dahe.mylibrary.net.CommonResponseBean;
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.arpa.hndahesudintocctmsdriver.R;
|
import com.arpa.hndahesudintocctmsdriver.R;
|
||||||
@ -76,6 +79,7 @@ public class LoginActivity extends BaseActivity {
|
|||||||
private int timer_sum = 60;
|
private int timer_sum = 60;
|
||||||
private CheckBox cb;
|
private CheckBox cb;
|
||||||
private UserRequset ur;
|
private UserRequset ur;
|
||||||
|
private CustomDialog customDialog;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void msgMethod(Message m) {
|
public void msgMethod(Message m) {
|
||||||
@ -94,6 +98,11 @@ public class LoginActivity extends BaseActivity {
|
|||||||
Log.e("--短信发送res--", "短信发送成功");
|
Log.e("--短信发送res--", "短信发送成功");
|
||||||
}
|
}
|
||||||
if (CacheGroup.cacheList.get(LOGIN_RESULT) != null) {
|
if (CacheGroup.cacheList.get(LOGIN_RESULT) != null) {
|
||||||
|
if (customDialog != null && customDialog.isShowing())
|
||||||
|
customDialog.dismiss();
|
||||||
|
|
||||||
|
btn_login.setEnabled(true);
|
||||||
|
btn_login.setBackgroundResource(R.drawable.bg_btn);
|
||||||
//存储登录记录
|
//存储登录记录
|
||||||
loginBean = new Gson().fromJson(CacheGroup.cacheList.get(LOGIN_RESULT), LoginBean.class);
|
loginBean = new Gson().fromJson(CacheGroup.cacheList.get(LOGIN_RESULT), LoginBean.class);
|
||||||
Log.e("--登录信息--", new Gson().toJson(loginBean));
|
Log.e("--登录信息--", new Gson().toJson(loginBean));
|
||||||
@ -103,7 +112,7 @@ public class LoginActivity extends BaseActivity {
|
|||||||
SPUtil.insSP(con, USER, USER_UNAME, loginBean.getData().getUname());
|
SPUtil.insSP(con, USER, USER_UNAME, loginBean.getData().getUname());
|
||||||
SPUtil.insSP(con, USER, USER_RNAME, loginBean.getData().getRname());
|
SPUtil.insSP(con, USER, USER_RNAME, loginBean.getData().getRname());
|
||||||
SPUtil.insSP(con, USER, USER_ID, loginBean.getData().getId() + "");
|
SPUtil.insSP(con, USER, USER_ID, loginBean.getData().getId() + "");
|
||||||
JPushInterface.setAlias(con, 0, loginBean.getData().getUname());
|
// JPushInterface.setAlias(con, 0, loginBean.getData().getUname());
|
||||||
appInfoBean.setStatus("0");
|
appInfoBean.setStatus("0");
|
||||||
appInfoBean.setUserPhone(String.valueOf(input_phone.getText()));
|
appInfoBean.setUserPhone(String.valueOf(input_phone.getText()));
|
||||||
ur.postAppInfo(appInfoBean, "post");
|
ur.postAppInfo(appInfoBean, "post");
|
||||||
@ -118,6 +127,13 @@ public class LoginActivity extends BaseActivity {
|
|||||||
CacheGroup.cacheList.remove(LOGIN_RESULT);
|
CacheGroup.cacheList.remove(LOGIN_RESULT);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case RequsetCodeConstants.ERROR:
|
||||||
|
if (customDialog != null && customDialog.isShowing())
|
||||||
|
customDialog.dismiss();
|
||||||
|
btn_login.setEnabled(true);
|
||||||
|
btn_login.setBackgroundResource(R.drawable.bg_btn);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -157,7 +173,7 @@ public class LoginActivity extends BaseActivity {
|
|||||||
|
|
||||||
ConfigBean cb = ConfigParts.getConfigParts(con);
|
ConfigBean cb = ConfigParts.getConfigParts(con);
|
||||||
if (cb != null) {
|
if (cb != null) {
|
||||||
url1 = cb.getData().getUserUrl();
|
url1 = "https://agreement.dahehuoyun.com/#/user";
|
||||||
url2 = "https://agreement.dahehuoyun.com/currency/#/";
|
url2 = "https://agreement.dahehuoyun.com/currency/#/";
|
||||||
}
|
}
|
||||||
TextView tv_content = findViewById(R.id.tv_content);
|
TextView tv_content = findViewById(R.id.tv_content);
|
||||||
@ -171,7 +187,7 @@ public class LoginActivity extends BaseActivity {
|
|||||||
public void onClick(View widget) {
|
public void onClick(View widget) {
|
||||||
Log.e("-用户服务协议-", url1);
|
Log.e("-用户服务协议-", url1);
|
||||||
//用户服务协议点击事件
|
//用户服务协议点击事件
|
||||||
Intent in = new Intent(con, WebActivity.class);
|
Intent in = new Intent(con, WebOnlyOneActivity.class);
|
||||||
in.putExtra("title", "用户服务协议");
|
in.putExtra("title", "用户服务协议");
|
||||||
in.putExtra("url", url1);
|
in.putExtra("url", url1);
|
||||||
startActivity(in);
|
startActivity(in);
|
||||||
@ -191,7 +207,7 @@ public class LoginActivity extends BaseActivity {
|
|||||||
@Override
|
@Override
|
||||||
public void onClick(View widget) {
|
public void onClick(View widget) {
|
||||||
//隐私协议点击事件
|
//隐私协议点击事件
|
||||||
Intent in = new Intent(con, WebActivity.class);
|
Intent in = new Intent(con, WebOnlyOneActivity.class);
|
||||||
in.putExtra("title", "隐私政策");
|
in.putExtra("title", "隐私政策");
|
||||||
in.putExtra("url", url2);
|
in.putExtra("url", url2);
|
||||||
startActivity(in);
|
startActivity(in);
|
||||||
@ -226,12 +242,16 @@ public class LoginActivity extends BaseActivity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
btn_login.setOnClickListener(v -> {
|
btn_login.setOnClickListener(new OnLimitClickHelper(v -> {
|
||||||
String phone = String.valueOf(input_phone.getText());
|
String phone = String.valueOf(input_phone.getText());
|
||||||
String code = String.valueOf(input_code.getText());
|
String code = String.valueOf(input_code.getText());
|
||||||
Log.e("--code--", code);
|
Log.e("--code--", code);
|
||||||
if (judgeFormat(phone, code)) {
|
if (judgeFormat(phone, code)) {
|
||||||
if (key) {
|
if (key) {
|
||||||
|
btn_login.setEnabled(false);
|
||||||
|
btn_login.setBackgroundResource(R.drawable.bg_btn_gray);
|
||||||
|
customDialog = new CustomDialog(con, "登陆中...");
|
||||||
|
customDialog.show();
|
||||||
LoginRegInputBean lb = new LoginRegInputBean();
|
LoginRegInputBean lb = new LoginRegInputBean();
|
||||||
lb.setRoleId(4);
|
lb.setRoleId(4);
|
||||||
lb.setUname(phone);
|
lb.setUname(phone);
|
||||||
@ -243,7 +263,7 @@ public class LoginActivity extends BaseActivity {
|
|||||||
Toast.makeText(con, "请先同意用户协议和隐私政策", Toast.LENGTH_SHORT).show();
|
Toast.makeText(con, "请先同意用户协议和隐私政策", Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
}));
|
||||||
auto_login.setOnClickListener(v -> {
|
auto_login.setOnClickListener(v -> {
|
||||||
JVerificationInterface.getToken(con, 20000, (i, s, s1) -> {
|
JVerificationInterface.getToken(con, 20000, (i, s, s1) -> {
|
||||||
JVerifyUIConfig uiConfig = new JVerifyUIConfig.Builder()
|
JVerifyUIConfig uiConfig = new JVerifyUIConfig.Builder()
|
||||||
|
|||||||
@ -140,16 +140,17 @@ public class WelcomeActivity extends BaseAppCompatActivity {
|
|||||||
new XPopup.Builder(con)
|
new XPopup.Builder(con)
|
||||||
.dismissOnBackPressed(false)
|
.dismissOnBackPressed(false)
|
||||||
.dismissOnTouchOutside(false)
|
.dismissOnTouchOutside(false)
|
||||||
.asCustom(new AgreementAlert(con, "http://agreement.dahehuoyun.com/currency/#/",
|
.asCustom(new AgreementAlert(con, "https://agreement.dahehuoyun.com/currency/#/",
|
||||||
"http://agreement.dahehuoyun.com/rule/serviceAgreement/dist/index.html#/", hd))
|
"https://agreement.dahehuoyun.com/#/user", hd))
|
||||||
.show();
|
.show();
|
||||||
}
|
}
|
||||||
|
if (WelcomeActivity.this!=null&&!WelcomeActivity.this.isFinishing()){
|
||||||
Glide.with(con)
|
Glide.with(con)
|
||||||
.load(SPUtils.getPreWelPic(this))
|
.load(SPUtils.getPreWelPic(this))
|
||||||
.placeholder(startImageUrl.getDrawable())
|
.placeholder(startImageUrl.getDrawable())
|
||||||
.error(R.drawable.welcome_bg_default)
|
.error(R.drawable.welcome_bg_default)
|
||||||
.into(startImageUrl);
|
.into(startImageUrl);
|
||||||
|
}
|
||||||
//SystemUtil.get
|
//SystemUtil.get
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -292,11 +293,13 @@ public class WelcomeActivity extends BaseAppCompatActivity {
|
|||||||
|
|
||||||
public void cdWelcome(String url) {
|
public void cdWelcome(String url) {
|
||||||
if (!"".equals(url)) {
|
if (!"".equals(url)) {
|
||||||
|
if (WelcomeActivity.this!=null&&!WelcomeActivity.this.isFinishing()){
|
||||||
Glide.with(con).load(url)
|
Glide.with(con).load(url)
|
||||||
.placeholder(startImageUrl.getDrawable())
|
.placeholder(startImageUrl.getDrawable())
|
||||||
.error(R.drawable.welcome_bg_default)
|
.error(R.drawable.welcome_bg_default)
|
||||||
.into(startImageUrl);
|
.into(startImageUrl);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
SPUtils.setPreWelPic(this, url);
|
SPUtils.setPreWelPic(this, url);
|
||||||
cd_view.setVisibility(View.VISIBLE);
|
cd_view.setVisibility(View.VISIBLE);
|
||||||
new CountDownTimer(cd * 1000, 1000) {
|
new CountDownTimer(cd * 1000, 1000) {
|
||||||
@ -343,8 +346,8 @@ public class WelcomeActivity extends BaseAppCompatActivity {
|
|||||||
}
|
}
|
||||||
//在使用SDK各组件之前初始化context信息,传入ApplicationContext
|
//在使用SDK各组件之前初始化context信息,传入ApplicationContext
|
||||||
// 路由初始化
|
// 路由初始化
|
||||||
JVerificationInterface.setDebugMode(true);
|
// JVerificationInterface.setDebugMode(true);
|
||||||
JVerificationInterface.init(con, 5000, (code, msg) -> Log.d("tag", "code = " + code + " msg = " + msg));
|
// JVerificationInterface.init(con, 5000, (code, msg) -> Log.d("tag", "code = " + code + " msg = " + msg));
|
||||||
//友盟
|
//友盟
|
||||||
//设置非debug版本开启
|
//设置非debug版本开启
|
||||||
if (!isDebugVersion(con)) {
|
if (!isDebugVersion(con)) {
|
||||||
|
|||||||
@ -17,15 +17,19 @@ import android.widget.Toast;
|
|||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
|
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.bean.UpAppBean;
|
||||||
import com.arpa.hndahesudintocctmsdriver.event.PersonEvent;
|
import com.arpa.hndahesudintocctmsdriver.event.PersonEvent;
|
||||||
import com.arpa.hndahesudintocctmsdriver.event.RefreshCarListEvent;
|
import com.arpa.hndahesudintocctmsdriver.event.RefreshCarListEvent;
|
||||||
import com.arpa.hndahesudintocctmsdriver.event.VehicleEvent;
|
import com.arpa.hndahesudintocctmsdriver.event.VehicleEvent;
|
||||||
import com.arpa.hndahesudintocctmsdriver.parts.ConfigParts;
|
import com.arpa.hndahesudintocctmsdriver.parts.ConfigParts;
|
||||||
import com.arpa.hndahesudintocctmsdriver.parts.StartOrderParts;
|
import com.arpa.hndahesudintocctmsdriver.parts.StartOrderParts;
|
||||||
import com.arpa.hndahesudintocctmsdriver.parts.UserParts;
|
import com.arpa.hndahesudintocctmsdriver.parts.UserParts;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.ui.alert.UpAppAlert;
|
||||||
import com.arpa.hndahesudintocctmsdriver.ui.business.BusinessActivity;
|
import com.arpa.hndahesudintocctmsdriver.ui.business.BusinessActivity;
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.PicturlUtil;
|
import com.arpa.hndahesudintocctmsdriver.util.PicturlUtil;
|
||||||
import com.bumptech.glide.Glide;
|
import com.bumptech.glide.Glide;
|
||||||
|
import com.dahe.mylibrary.utils.ImageLoader;
|
||||||
|
import com.dahe.mylibrary.utils.ToastUtils;
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.lxj.xpopup.XPopup;
|
import com.lxj.xpopup.XPopup;
|
||||||
|
|
||||||
@ -48,6 +52,7 @@ import com.permissionx.guolindev.PermissionX;
|
|||||||
|
|
||||||
import org.greenrobot.eventbus.EventBus;
|
import org.greenrobot.eventbus.EventBus;
|
||||||
import org.greenrobot.eventbus.Subscribe;
|
import org.greenrobot.eventbus.Subscribe;
|
||||||
|
import org.greenrobot.eventbus.ThreadMode;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -93,6 +98,25 @@ public class MyFragment extends BaseFragment {
|
|||||||
}
|
}
|
||||||
CacheGroup.cacheList.remove("userdata");
|
CacheGroup.cacheList.remove("userdata");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (CacheGroup.cacheList.get("up_app") != null) {
|
||||||
|
Log.e("up_app", CacheGroup.cacheList.get("up_app"));
|
||||||
|
UpAppBean uab = new Gson().fromJson(CacheGroup.cacheList.get("up_app"), UpAppBean.class);
|
||||||
|
if (uab.getCode() == 200) {
|
||||||
|
if (uab.getData() != null) {
|
||||||
|
new XPopup.Builder(con)
|
||||||
|
.dismissOnBackPressed(false)
|
||||||
|
.dismissOnTouchOutside(false)
|
||||||
|
.asCustom(new UpAppAlert(con, uab.getData().getDownloadUrl(), uab.getData().getContent(), uab.getData().getVersion(), uab.getData().getForce()))
|
||||||
|
.show();
|
||||||
|
}else{
|
||||||
|
Toast.makeText(con, "当前已经是最新版本", Toast.LENGTH_LONG).show();
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
Toast.makeText(con, uab.getMsg(), Toast.LENGTH_LONG).show();
|
||||||
|
}
|
||||||
|
CacheGroup.cacheList.remove("up_app");
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -262,7 +286,10 @@ public class MyFragment extends BaseFragment {
|
|||||||
startActivity(in);
|
startActivity(in);
|
||||||
});
|
});
|
||||||
//检查更新
|
//检查更新
|
||||||
onUpdate.setOnClickListener(v -> Toast.makeText(con, "当前已经是最新版本", Toast.LENGTH_LONG).show());
|
onUpdate.setOnClickListener(v -> {
|
||||||
|
ur.upApp();
|
||||||
|
}
|
||||||
|
);
|
||||||
//系统设置
|
//系统设置
|
||||||
onSetUp.setOnClickListener(v -> startActivity(new Intent(con, SetupActivity.class)));
|
onSetUp.setOnClickListener(v -> startActivity(new Intent(con, SetupActivity.class)));
|
||||||
}
|
}
|
||||||
@ -280,18 +307,31 @@ public class MyFragment extends BaseFragment {
|
|||||||
|
|
||||||
}
|
}
|
||||||
if (!"".equals(userBean.getData().getHeadportraitUrl())) {
|
if (!"".equals(userBean.getData().getHeadportraitUrl())) {
|
||||||
Glide.with(con).load(userBean.getData().getHeadportraitUrl()).into(img_head);
|
ImageLoader.getInstance().loadImage(con,userBean.getData().getHeadportraitUrl(),img_head);
|
||||||
}
|
}
|
||||||
if (userBean != null && 100003 == userBean.getData().getAuditStatus()) {
|
|
||||||
auth_box.setVisibility(View.GONE);
|
if (userBean != null) {
|
||||||
|
if ("0".equals(userBean.getData().getRealAuthentication())) {
|
||||||
|
no_auth.setVisibility(View.VISIBLE);
|
||||||
|
} else {
|
||||||
|
if (100003 == userBean.getData().getAuditStatus()) {
|
||||||
no_auth.setVisibility(View.GONE);
|
no_auth.setVisibility(View.GONE);
|
||||||
} else {
|
} else {
|
||||||
auth_box.setVisibility(View.GONE);
|
no_auth.setBackgroundResource(R.mipmap.icon_auth_wsh);
|
||||||
no_auth.setVisibility(View.VISIBLE);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// if (userBean != null && 100003 == userBean.getData().getAuditStatus()) {
|
||||||
|
// auth_box.setVisibility(View.GONE);
|
||||||
|
// no_auth.setVisibility(View.GONE);
|
||||||
|
// } else {
|
||||||
|
// auth_box.setVisibility(View.GONE);
|
||||||
|
// no_auth.setVisibility(View.VISIBLE);
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Subscribe
|
@Subscribe
|
||||||
public void processResult(VehicleEvent event) {
|
public void processResult(VehicleEvent event) {
|
||||||
Log.e("-msg-", event.getMessage());
|
Log.e("-msg-", event.getMessage());
|
||||||
@ -306,11 +346,19 @@ public class MyFragment extends BaseFragment {
|
|||||||
ur.vehicleList("1");
|
ur.vehicleList("1");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Subscribe
|
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||||
public void personResult(PersonEvent home) {
|
public void personResult(PersonEvent home) {
|
||||||
Log.e("-res-", home.getMessage());
|
Log.e("-res-", home.getMessage());
|
||||||
if (ur != null) {
|
if (ur != null) {
|
||||||
ur.User();
|
ur.User();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onStart() {
|
||||||
|
super.onStart();
|
||||||
|
if (ur != null) {
|
||||||
|
ur.User();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -13,6 +13,7 @@ import android.widget.Toast;
|
|||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
|
|
||||||
import com.arpa.hndahesudintocctmsdriver.parts.ConfigParts;
|
import com.arpa.hndahesudintocctmsdriver.parts.ConfigParts;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.ui.web.WebOnlyOneActivity;
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.lxj.xpopup.XPopup;
|
import com.lxj.xpopup.XPopup;
|
||||||
import com.arpa.hndahesudintocctmsdriver.R;
|
import com.arpa.hndahesudintocctmsdriver.R;
|
||||||
@ -73,9 +74,9 @@ public class SetupActivity extends BaseActivity {
|
|||||||
ConfigBean cb= ConfigParts.getConfigParts(con);
|
ConfigBean cb= ConfigParts.getConfigParts(con);
|
||||||
if(cb!=null){
|
if(cb!=null){
|
||||||
// url1=cb.getData().getUserUrl();
|
// url1=cb.getData().getUserUrl();
|
||||||
url1="http://agreement.dahehuoyun.com/rule/serviceAgreement/dist/index.html#/";
|
url1="https://agreement.dahehuoyun.com/rule/serviceAgreement/dist/index.html#/";
|
||||||
// url2=cb.getData().getPrivateUrl();
|
// url2=cb.getData().getPrivateUrl();
|
||||||
url2="http://agreement.dahehuoyun.com/currency/#/";
|
url2="https://agreement.dahehuoyun.com/currency/#/";
|
||||||
kefu=cb.getData().getServiceMobile();
|
kefu=cb.getData().getServiceMobile();
|
||||||
url3=cb.getData().getSecurityUrl();
|
url3=cb.getData().getSecurityUrl();
|
||||||
}
|
}
|
||||||
@ -94,19 +95,19 @@ public class SetupActivity extends BaseActivity {
|
|||||||
public void initView(Object obj) {
|
public void initView(Object obj) {
|
||||||
super.initView(obj);
|
super.initView(obj);
|
||||||
r1.setOnClickListener(v12 -> {
|
r1.setOnClickListener(v12 -> {
|
||||||
Intent in=new Intent(con,WebActivity.class);
|
Intent in=new Intent(con, WebOnlyOneActivity.class);
|
||||||
in.putExtra("title","隐私政策");
|
in.putExtra("title","隐私政策");
|
||||||
in.putExtra("url",url2);
|
in.putExtra("url",url2);
|
||||||
startActivity(in);
|
startActivity(in);
|
||||||
});
|
});
|
||||||
r2.setOnClickListener(v12 -> {
|
r2.setOnClickListener(v12 -> {
|
||||||
Intent in=new Intent(con,WebActivity.class);
|
Intent in=new Intent(con,WebOnlyOneActivity.class);
|
||||||
in.putExtra("title","用户协议");
|
in.putExtra("title","用户协议");
|
||||||
in.putExtra("url",url1);
|
in.putExtra("url",url1);
|
||||||
startActivity(in);
|
startActivity(in);
|
||||||
});
|
});
|
||||||
r3.setOnClickListener(v12 -> {
|
r3.setOnClickListener(v12 -> {
|
||||||
Intent in=new Intent(con,WebActivity.class);
|
Intent in=new Intent(con,WebOnlyOneActivity.class);
|
||||||
in.putExtra("title","运输安全责任书");
|
in.putExtra("title","运输安全责任书");
|
||||||
in.putExtra("url",url3);
|
in.putExtra("url",url3);
|
||||||
startActivity(in);
|
startActivity(in);
|
||||||
@ -121,7 +122,7 @@ public class SetupActivity extends BaseActivity {
|
|||||||
startActivity(in);
|
startActivity(in);
|
||||||
});
|
});
|
||||||
r8.setOnClickListener(v12 -> {
|
r8.setOnClickListener(v12 -> {
|
||||||
Intent in=new Intent(con,WebActivity.class);
|
Intent in=new Intent(con,WebOnlyOneActivity.class);
|
||||||
in.putExtra("title","交易规则");
|
in.putExtra("title","交易规则");
|
||||||
in.putExtra("url","http://agreement.dahehuoyun.com/rule/transactionRules/dist/index.html#/");
|
in.putExtra("url","http://agreement.dahehuoyun.com/rule/transactionRules/dist/index.html#/");
|
||||||
startActivity(in);
|
startActivity(in);
|
||||||
|
|||||||
@ -13,11 +13,18 @@ import android.widget.Toast;
|
|||||||
|
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
|
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.bean.DriverAuthDataBean;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.bean.UploadBean;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.request.AuthRequest;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.request.UserRequset;
|
||||||
import com.arpa.hndahesudintocctmsdriver.ui.auth.CertificatesActivity;
|
import com.arpa.hndahesudintocctmsdriver.ui.auth.CertificatesActivity;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.ui.my.WoDeFragment;
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.MessageUtils;
|
import com.arpa.hndahesudintocctmsdriver.util.MessageUtils;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.sp.SPUtil;
|
||||||
import com.arpa.hndahesudintocctmsdriver.weight.OnLimitClickHelper;
|
import com.arpa.hndahesudintocctmsdriver.weight.OnLimitClickHelper;
|
||||||
import com.arpa.hndahesudintocctmsdriver.weight.OnLimitClickListener;
|
import com.arpa.hndahesudintocctmsdriver.weight.OnLimitClickListener;
|
||||||
import com.bumptech.glide.Glide;
|
import com.bumptech.glide.Glide;
|
||||||
|
import com.dahe.mylibrary.utils.ImageLoader;
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.arpa.hndahesudintocctmsdriver.R;
|
import com.arpa.hndahesudintocctmsdriver.R;
|
||||||
import com.arpa.hndahesudintocctmsdriver.bean.BaseBean;
|
import com.arpa.hndahesudintocctmsdriver.bean.BaseBean;
|
||||||
@ -35,6 +42,8 @@ import com.arpa.hndahesudintocctmsdriver.util.view.BaseAppCompatActivity;
|
|||||||
import com.luck.picture.lib.PictureSelector;
|
import com.luck.picture.lib.PictureSelector;
|
||||||
import com.luck.picture.lib.config.PictureConfig;
|
import com.luck.picture.lib.config.PictureConfig;
|
||||||
import com.luck.picture.lib.entity.LocalMedia;
|
import com.luck.picture.lib.entity.LocalMedia;
|
||||||
|
import com.lxj.xpopup.XPopup;
|
||||||
|
import com.lxj.xpopup.util.SmartGlideImageLoader;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -54,8 +63,12 @@ public class UpBankActivity extends BaseAppCompatActivity implements OnLimitClic
|
|||||||
public GetImageAlert gia = new GetImageAlert();
|
public GetImageAlert gia = new GetImageAlert();
|
||||||
String path;
|
String path;
|
||||||
private OCRBankBean ib;
|
private OCRBankBean ib;
|
||||||
|
DriverAuthDataBean dad;
|
||||||
|
|
||||||
|
boolean isAuth = false;
|
||||||
private WalletRequest qr;
|
private WalletRequest qr;
|
||||||
private TextView tp;
|
private TextView tp;
|
||||||
|
private String imageId;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void msgMethod(Message m) {
|
public void msgMethod(Message m) {
|
||||||
@ -65,15 +78,37 @@ public class UpBankActivity extends BaseAppCompatActivity implements OnLimitClic
|
|||||||
if (CacheGroup.cacheList.get("OCR_BANK") != null) {
|
if (CacheGroup.cacheList.get("OCR_BANK") != null) {
|
||||||
ib = new Gson().fromJson(CacheGroup.cacheList.get("OCR_BANK"), OCRBankBean.class);
|
ib = new Gson().fromJson(CacheGroup.cacheList.get("OCR_BANK"), OCRBankBean.class);
|
||||||
customDialog.dismiss();
|
customDialog.dismiss();
|
||||||
if (ib.getCode() == 200) {
|
if (ib.getCode() == 200&&ib.getData()!=null) {
|
||||||
initView(null);
|
initView(null);
|
||||||
WalletFragment.isInsBank = true;
|
WalletFragment.isInsBank = true;
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(con, ib.getMsg(), Toast.LENGTH_SHORT).show();
|
Toast.makeText(con, "识别失败", Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
CacheGroup.cacheList.remove("OCR_BANK");
|
CacheGroup.cacheList.remove("OCR_BANK");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (CacheGroup.cacheList.get(WoDeFragment.AUTH_DATA) != null) {
|
||||||
|
dad = new Gson().fromJson(CacheGroup.cacheList.get(WoDeFragment.AUTH_DATA), DriverAuthDataBean.class);
|
||||||
|
if (dad.getCode() == 200) {
|
||||||
|
if (dad.getData() != null && !TextUtils.isEmpty(dad.getData().getCardNo())) {
|
||||||
|
isAuth = true;
|
||||||
|
skip.setVisibility(View.GONE);
|
||||||
|
submit.setBackgroundResource(R.drawable.bg_btn_grey);
|
||||||
|
bank_name.setText(dad.getData().getBankName());
|
||||||
|
bank_number.setText(dad.getData().getCardNo());
|
||||||
|
ImageLoader.getInstance().loadImage(con,dad.getData().getBankImgUrl(),up_bank_img);
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
Toast.makeText(con, dad.getMsg(), Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
CacheGroup.cacheList.remove(WoDeFragment.AUTH_DATA);
|
||||||
|
}
|
||||||
|
|
||||||
if (CacheGroup.cacheList.get("insBank") != null) {
|
if (CacheGroup.cacheList.get("insBank") != null) {
|
||||||
|
if (customDialog != null && customDialog.isShowing()) {
|
||||||
|
customDialog.dismiss();
|
||||||
|
}
|
||||||
BaseBean bb = new Gson().fromJson(CacheGroup.cacheList.get("insBank"), BaseBean.class);
|
BaseBean bb = new Gson().fromJson(CacheGroup.cacheList.get("insBank"), BaseBean.class);
|
||||||
if (bb.getCode() == 200) {
|
if (bb.getCode() == 200) {
|
||||||
if (type == 1) {
|
if (type == 1) {
|
||||||
@ -81,7 +116,6 @@ public class UpBankActivity extends BaseAppCompatActivity implements OnLimitClic
|
|||||||
in.putExtra("index", 1);
|
in.putExtra("index", 1);
|
||||||
startActivity(in);
|
startActivity(in);
|
||||||
}
|
}
|
||||||
customDialog.dismiss();
|
|
||||||
Toast.makeText(con, "绑定成功", Toast.LENGTH_SHORT).show();
|
Toast.makeText(con, "绑定成功", Toast.LENGTH_SHORT).show();
|
||||||
finish();
|
finish();
|
||||||
} else {
|
} else {
|
||||||
@ -89,12 +123,26 @@ public class UpBankActivity extends BaseAppCompatActivity implements OnLimitClic
|
|||||||
}
|
}
|
||||||
CacheGroup.cacheList.remove("insBank");
|
CacheGroup.cacheList.remove("insBank");
|
||||||
}
|
}
|
||||||
|
if (CacheGroup.cacheList.get("upload") != null) {
|
||||||
|
UploadBean ub = new Gson().fromJson(CacheGroup.cacheList.get("upload"), UploadBean.class);
|
||||||
|
if (ub.getCode() == 200) {
|
||||||
|
imageId = ub.getData().getId()+"";
|
||||||
|
new OCRRequest().ORCBankZj(con, hd, ub.getData().getUrl());
|
||||||
|
|
||||||
|
} else {
|
||||||
|
Toast.makeText(con, ub.getMsg(), Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
CacheGroup.cacheList.remove("upload");
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case ImageFileCompressUtil.COMPRESS_SUCCESS:
|
case ImageFileCompressUtil.COMPRESS_SUCCESS:
|
||||||
customDialog = new CustomDialog(con, "上传识别中...");
|
customDialog = new CustomDialog(con, "上传识别中...");
|
||||||
customDialog.show();
|
customDialog.show();
|
||||||
path = (String) m.obj;
|
path = (String) m.obj;
|
||||||
new OCRRequest().ORCBank(con, hd, new File(path));
|
|
||||||
|
new AuthRequest().upload(con, hd, new File(path));
|
||||||
|
|
||||||
|
// new OCRRequest().ORCBank(con, hd, new File(path));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -127,7 +175,13 @@ public class UpBankActivity extends BaseAppCompatActivity implements OnLimitClic
|
|||||||
return_btn = findViewById(R.id.return_btn);
|
return_btn = findViewById(R.id.return_btn);
|
||||||
qr = new WalletRequest(con, hd);
|
qr = new WalletRequest(con, hd);
|
||||||
up_bank_img.setOnClickListener(v -> {
|
up_bank_img.setOnClickListener(v -> {
|
||||||
|
if (isAuth) {
|
||||||
|
new XPopup.Builder(con)
|
||||||
|
.asImageViewer(up_bank_img, dad.getData().getBankImgUrl(), new SmartGlideImageLoader(R.mipmap.ic_launcher_round))
|
||||||
|
.show();
|
||||||
|
} else {
|
||||||
gia.showPopueWindow(this);
|
gia.showPopueWindow(this);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
submit.setOnClickListener(new OnLimitClickHelper(this));
|
submit.setOnClickListener(new OnLimitClickHelper(this));
|
||||||
skip.setOnClickListener(new OnLimitClickHelper(this));
|
skip.setOnClickListener(new OnLimitClickHelper(this));
|
||||||
@ -140,14 +194,16 @@ public class UpBankActivity extends BaseAppCompatActivity implements OnLimitClic
|
|||||||
} else {
|
} else {
|
||||||
skip.setVisibility(View.GONE);
|
skip.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
|
UserRequset ur = new UserRequset(con, hd);
|
||||||
|
ur.driverAuthData();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void initView(Object obj) {
|
public void initView(Object obj) {
|
||||||
super.initView(obj);
|
super.initView(obj);
|
||||||
bank_name.setText(ib.getData().getBankName());
|
bank_name.setText(ib.getData().getBankName());
|
||||||
bank_number.setText(ib.getData().getBankCardNumber());
|
bank_number.setText(ib.getData().getCardNumber());
|
||||||
Glide.with(con).load(ib.getData().getUrl()).into(up_bank_img);
|
ImageLoader.getInstance().loadImage(con,path,up_bank_img);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -186,10 +242,11 @@ public class UpBankActivity extends BaseAppCompatActivity implements OnLimitClic
|
|||||||
}
|
}
|
||||||
InsBankInputBean ibib = new InsBankInputBean();
|
InsBankInputBean ibib = new InsBankInputBean();
|
||||||
ibib.setCardNo(bankNumber);
|
ibib.setCardNo(bankNumber);
|
||||||
ibib.setCardType(Integer.parseInt(ib.getData().getBankCardType()));
|
// ibib.setCardType(Integer.parseInt(ib.getData().getType()));
|
||||||
|
ibib.setCardType(1);
|
||||||
ibib.setBankName(bankName);
|
ibib.setBankName(bankName);
|
||||||
ibib.setCardUserType(1);
|
ibib.setCardUserType(1);
|
||||||
ibib.setImageId(ib.getData().getId());
|
ibib.setImageId(Integer.parseInt(imageId));
|
||||||
Log.e("-res-", new Gson().toJson(ibib));
|
Log.e("-res-", new Gson().toJson(ibib));
|
||||||
qr.insBankCard(ibib);
|
qr.insBankCard(ibib);
|
||||||
}
|
}
|
||||||
@ -198,6 +255,13 @@ public class UpBankActivity extends BaseAppCompatActivity implements OnLimitClic
|
|||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
switch (view.getId()) {
|
switch (view.getId()) {
|
||||||
case R.id.submit:
|
case R.id.submit:
|
||||||
|
if (isAuth) {
|
||||||
|
Intent in = new Intent(con, CertificatesActivity.class);
|
||||||
|
in.putExtra("index", 1);
|
||||||
|
startActivity(in);
|
||||||
|
finish();
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (ib != null) {
|
if (ib != null) {
|
||||||
submit();
|
submit();
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -15,6 +15,8 @@ import android.widget.Toast;
|
|||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
|
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.event.VehicleEvent;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.event.WalletEvent;
|
||||||
import com.arpa.hndahesudintocctmsdriver.parts.UserParts;
|
import com.arpa.hndahesudintocctmsdriver.parts.UserParts;
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.lxj.xpopup.XPopup;
|
import com.lxj.xpopup.XPopup;
|
||||||
@ -32,6 +34,8 @@ import com.arpa.hndahesudintocctmsdriver.util.http.RequsetCodeConstants;
|
|||||||
import com.arpa.hndahesudintocctmsdriver.util.view.BaseFragment;
|
import com.arpa.hndahesudintocctmsdriver.util.view.BaseFragment;
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.view.BaseRecyclerView;
|
import com.arpa.hndahesudintocctmsdriver.util.view.BaseRecyclerView;
|
||||||
|
|
||||||
|
import org.greenrobot.eventbus.EventBus;
|
||||||
|
import org.greenrobot.eventbus.Subscribe;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
|
|
||||||
@ -123,6 +127,7 @@ public class WalletFragment extends BaseFragment{
|
|||||||
@Override
|
@Override
|
||||||
public View onCreateView(@NonNull @NotNull LayoutInflater inflater, @Nullable @org.jetbrains.annotations.Nullable ViewGroup container, @Nullable @org.jetbrains.annotations.Nullable Bundle savedInstanceState) {
|
public View onCreateView(@NonNull @NotNull LayoutInflater inflater, @Nullable @org.jetbrains.annotations.Nullable ViewGroup container, @Nullable @org.jetbrains.annotations.Nullable Bundle savedInstanceState) {
|
||||||
root=inflater.inflate(R.layout.fragmengt_qianbao,container,false);
|
root=inflater.inflate(R.layout.fragmengt_qianbao,container,false);
|
||||||
|
EventBus.getDefault().register(this);
|
||||||
dataName2="bcb";
|
dataName2="bcb";
|
||||||
con=root.getContext();
|
con=root.getContext();
|
||||||
rv=root.findViewById(R.id.rv);
|
rv=root.findViewById(R.id.rv);
|
||||||
@ -317,5 +322,14 @@ public class WalletFragment extends BaseFragment{
|
|||||||
// .show();
|
// .show();
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
@Subscribe
|
||||||
|
public void processResult(WalletEvent event) {
|
||||||
|
Log.e("-msg-", event.getMessage());
|
||||||
|
refreshLayout.autoRefresh();
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public void onDestroy() {
|
||||||
|
super.onDestroy();
|
||||||
|
EventBus.getDefault().unregister(this);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -15,26 +15,18 @@ import android.webkit.WebResourceRequest;
|
|||||||
import android.webkit.WebSettings;
|
import android.webkit.WebSettings;
|
||||||
import android.webkit.WebView;
|
import android.webkit.WebView;
|
||||||
import android.webkit.WebViewClient;
|
import android.webkit.WebViewClient;
|
||||||
import android.widget.ProgressBar;
|
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
|
|
||||||
import com.arpa.hndahesudintocctmsdriver.R;
|
import com.arpa.hndahesudintocctmsdriver.R;
|
||||||
import com.arpa.hndahesudintocctmsdriver.bean.ToH5Bean;
|
|
||||||
import com.arpa.hndahesudintocctmsdriver.bean.UserBean;
|
import com.arpa.hndahesudintocctmsdriver.bean.UserBean;
|
||||||
import com.arpa.hndahesudintocctmsdriver.event.PdfResEvent;
|
|
||||||
import com.arpa.hndahesudintocctmsdriver.parts.UserParts;
|
import com.arpa.hndahesudintocctmsdriver.parts.UserParts;
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.PaxWebChromeClient;
|
import com.arpa.hndahesudintocctmsdriver.util.PaxWebChromeClient;
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.string.StringUtil;
|
import com.arpa.hndahesudintocctmsdriver.util.string.StringUtil;
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.statusbar.StateStyleUtil;
|
import com.arpa.hndahesudintocctmsdriver.util.statusbar.StateStyleUtil;
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.view.BaseActivity;
|
import com.arpa.hndahesudintocctmsdriver.util.view.BaseActivity;
|
||||||
import com.google.gson.Gson;
|
|
||||||
|
|
||||||
import org.greenrobot.eventbus.EventBus;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author hlh
|
* @author hlh
|
||||||
@ -46,12 +38,9 @@ public class WebActivity extends BaseActivity {
|
|||||||
|
|
||||||
private String url = "";
|
private String url = "";
|
||||||
private String title = "";
|
private String title = "";
|
||||||
private int id = -1;
|
|
||||||
private WebView wv;
|
private WebView wv;
|
||||||
private TextView title_tv;
|
private TextView title_tv;
|
||||||
private ProgressBar progressBar;
|
|
||||||
private PaxWebChromeClient chromeClient;
|
private PaxWebChromeClient chromeClient;
|
||||||
private ToH5Bean toH5Bean;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||||
@ -61,15 +50,11 @@ public class WebActivity extends BaseActivity {
|
|||||||
con=this;
|
con=this;
|
||||||
initHardwareAccelerate();
|
initHardwareAccelerate();
|
||||||
wv = findViewById(R.id.wv);
|
wv = findViewById(R.id.wv);
|
||||||
progressBar = findViewById(R.id.progressBar);
|
|
||||||
title_tv = findViewById(R.id.title);
|
title_tv = findViewById(R.id.title);
|
||||||
Intent in = getIntent();
|
Intent in = getIntent();
|
||||||
url = in.getExtras().getString("url");
|
url = in.getExtras().getString("url");
|
||||||
title = in.getExtras().getString("title");
|
title = in.getExtras().getString("title");
|
||||||
toH5Bean = (ToH5Bean)in.getSerializableExtra("ToH5Bean");
|
chromeClient = new PaxWebChromeClient(this,null,null);
|
||||||
String carNumber = toH5Bean.getCarNumber();
|
|
||||||
id = in.getExtras().getInt("id");
|
|
||||||
chromeClient = new PaxWebChromeClient(this,progressBar,null);
|
|
||||||
if ("咨询建议".equals(title)) {
|
if ("咨询建议".equals(title)) {
|
||||||
initOpinion();
|
initOpinion();
|
||||||
} else {
|
} else {
|
||||||
@ -223,32 +208,13 @@ public class WebActivity extends BaseActivity {
|
|||||||
return UserParts.getUser(con).getData().getToken();
|
return UserParts.getUser(con).getData().getToken();
|
||||||
}
|
}
|
||||||
|
|
||||||
@JavascriptInterface
|
|
||||||
public int getOrderId(){
|
|
||||||
return id;
|
|
||||||
}
|
|
||||||
|
|
||||||
@JavascriptInterface
|
|
||||||
public String getOrderinfo(){
|
|
||||||
return new Gson().toJson(toH5Bean);
|
|
||||||
}
|
|
||||||
|
|
||||||
@JavascriptInterface
|
@JavascriptInterface
|
||||||
public void isSuccess(){
|
public void isSuccess(){
|
||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
@JavascriptInterface
|
@JavascriptInterface
|
||||||
public void isPdfSuccess(String pdfUrl){
|
public void isPdfSuccess(){
|
||||||
// Toast.makeText(con, "签署成功", Toast.LENGTH_SHORT).show();
|
Toast.makeText(con, "签署成功", Toast.LENGTH_SHORT).show();
|
||||||
// EventBus.getDefault().post(new PdfResEvent(pdfUrl));
|
|
||||||
Intent intent = new Intent();
|
|
||||||
intent.putExtra("pdfUrl",pdfUrl);
|
|
||||||
setResult(RESULT_OK,intent);
|
|
||||||
finish();
|
|
||||||
}
|
|
||||||
|
|
||||||
@JavascriptInterface
|
|
||||||
public void isFail(){
|
|
||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,227 @@
|
|||||||
|
package com.arpa.hndahesudintocctmsdriver.ui.web;
|
||||||
|
|
||||||
|
import android.annotation.SuppressLint;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.content.pm.PackageManager;
|
||||||
|
import android.net.Uri;
|
||||||
|
import android.net.http.SslError;
|
||||||
|
import android.os.Build;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.util.Log;
|
||||||
|
import android.webkit.JavascriptInterface;
|
||||||
|
import android.webkit.SslErrorHandler;
|
||||||
|
import android.webkit.WebResourceRequest;
|
||||||
|
import android.webkit.WebSettings;
|
||||||
|
import android.webkit.WebView;
|
||||||
|
import android.webkit.WebViewClient;
|
||||||
|
import android.widget.TextView;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
import androidx.annotation.Nullable;
|
||||||
|
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.R;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.bean.UserBean;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.parts.UserParts;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.PaxWebChromeClient;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.statusbar.StateStyleUtil;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.string.StringUtil;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.view.BaseActivity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author hlh
|
||||||
|
* @version 1.0.0
|
||||||
|
* @date 2021/8/6 16:48
|
||||||
|
* @description:访问webview的activity
|
||||||
|
*/
|
||||||
|
public class WebOnlyOneActivity extends BaseActivity {
|
||||||
|
|
||||||
|
private String url = "";
|
||||||
|
private String title = "";
|
||||||
|
private WebView wv;
|
||||||
|
private TextView title_tv;
|
||||||
|
private PaxWebChromeClient chromeClient;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
StateStyleUtil.stateTextColor(this);
|
||||||
|
setContentView(R.layout.activity_web);
|
||||||
|
con = this;
|
||||||
|
initHardwareAccelerate();
|
||||||
|
wv = findViewById(R.id.wv);
|
||||||
|
title_tv = findViewById(R.id.title);
|
||||||
|
Intent in = getIntent();
|
||||||
|
url = in.getExtras().getString("url");
|
||||||
|
title = in.getExtras().getString("title");
|
||||||
|
chromeClient = new PaxWebChromeClient(this, null, null);
|
||||||
|
if ("咨询建议".equals(title)) {
|
||||||
|
initOpinion();
|
||||||
|
} else {
|
||||||
|
initView(null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void initHardwareAccelerate() {
|
||||||
|
try {
|
||||||
|
if (Integer.parseInt(Build.VERSION.SDK) >= 11) {
|
||||||
|
getWindow()
|
||||||
|
.setFlags(
|
||||||
|
android.view.WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED,
|
||||||
|
android.view.WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED);
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressLint({"JavascriptInterface", "SetJavaScriptEnabled"})
|
||||||
|
@Override
|
||||||
|
public void initView(Object obj) {
|
||||||
|
super.initView(obj);
|
||||||
|
WebSettings webSettings = wv.getSettings();
|
||||||
|
//设置网页有缓存的时候也继续读取新的地址
|
||||||
|
webSettings.setCacheMode(WebSettings.LOAD_NO_CACHE);
|
||||||
|
webSettings.setJavaScriptEnabled(true);
|
||||||
|
webSettings.setDomStorageEnabled(true);
|
||||||
|
webSettings.setDefaultTextEncodingName("utf-8");
|
||||||
|
// 特别注意:5.1以上默认禁止了https和http混用,以下方式是开启
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||||
|
webSettings.setMixedContentMode(WebSettings.MIXED_CONTENT_ALWAYS_ALLOW);
|
||||||
|
}
|
||||||
|
|
||||||
|
wv.addJavascriptInterface(new JavaScriptObject(con), "webObj");
|
||||||
|
//PaxWebChromeClient chromeClient=new PaxWebChromeClient();
|
||||||
|
//WebView加载web资源
|
||||||
|
//覆盖WebView默认使用第三方或系统默认浏览器打开网页的行为,使网页用WebView打开
|
||||||
|
wv.setWebViewClient(new WebViewClient() {
|
||||||
|
@Override
|
||||||
|
public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request) {
|
||||||
|
return super.shouldOverrideUrlLoading(view, request);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean shouldOverrideUrlLoading(WebView view, String url1) {
|
||||||
|
//返回值是true的时候控制去WebView打开,为false调用系统浏览器或第三方浏览器
|
||||||
|
Log.d("test", "webactivity..url:" + url);
|
||||||
|
// if(!url.startsWith("http"))
|
||||||
|
// {
|
||||||
|
// Log.d("test","非http开头..url:"+url);
|
||||||
|
// Intent intent = new Intent(Intent.ACTION_VIEW,Uri.parse(url));
|
||||||
|
// boolean isInstall = getPackageManager().queryIntentActivities(intent, PackageManager.MATCH_DEFAULT_ONLY).size()>0;
|
||||||
|
// Log.d("test","是否安装要跳转的app:"+isInstall);
|
||||||
|
// if(isInstall)
|
||||||
|
// {
|
||||||
|
// startActivity(intent);
|
||||||
|
// finish();
|
||||||
|
// }
|
||||||
|
// return true;
|
||||||
|
// }
|
||||||
|
if (!url1.equals(url))
|
||||||
|
return true;
|
||||||
|
wv.loadUrl(url1);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error) {
|
||||||
|
super.onReceivedSslError(view, handler, error);
|
||||||
|
handler.proceed();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
wv.setWebChromeClient(chromeClient);
|
||||||
|
wv.loadUrl(url);
|
||||||
|
title_tv.setText(title);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void initOpinion() {
|
||||||
|
if (findViewById(R.id.return_btn) != null) {
|
||||||
|
findViewById(R.id.return_btn).setOnClickListener(v -> {
|
||||||
|
finish();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
title_tv.setText(title);
|
||||||
|
UserBean ub = UserParts.getUser(con);
|
||||||
|
wv.getSettings().setJavaScriptEnabled(true);
|
||||||
|
wv.getSettings().setDomStorageEnabled(true); // 这个要加上
|
||||||
|
String openid = ub.getData().getUname(); // 用户的openid
|
||||||
|
String nickname = StringUtil.isNull(ub.getData().getRname(), "游客"); // 用户的nickname
|
||||||
|
String headimgurl = StringUtil.isNull(ub.getData().getHeadportraitUrl(), ""); // 用户的头像url
|
||||||
|
|
||||||
|
/* 获得 webview url,请注意url单词是product而不是products,products是旧版本的参数,用错地址将不能成功提交 */
|
||||||
|
String url = "https://support.qq.com/products/335639"; // 把1221数字换成你的产品ID,否则会不成功
|
||||||
|
/* 准备post参数 */
|
||||||
|
String postData = "nickname=" + nickname + "&avatar=" + headimgurl + "&openid=" + openid;
|
||||||
|
wv.postUrl(url, postData.getBytes());
|
||||||
|
wv.setWebChromeClient(chromeClient);
|
||||||
|
wv.setWebViewClient(new WebViewClient() {
|
||||||
|
@Override
|
||||||
|
public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request) {
|
||||||
|
return super.shouldOverrideUrlLoading(view, request);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean shouldOverrideUrlLoading(WebView view, String url) {
|
||||||
|
//返回值是true的时候控制去WebView打开,为false调用系统浏览器或第三方浏览器
|
||||||
|
view.loadUrl(url);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error) {
|
||||||
|
super.onReceivedSslError(view, handler, error);
|
||||||
|
handler.proceed();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||||
|
|
||||||
|
chromeClient.onActivityResult(requestCode, resultCode, data);
|
||||||
|
|
||||||
|
super.onActivityResult(requestCode, resultCode, data);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onDestroy() {
|
||||||
|
super.onDestroy();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public class JavaScriptObject {
|
||||||
|
|
||||||
|
Context mContxt;
|
||||||
|
|
||||||
|
public JavaScriptObject(Context mContxt) {
|
||||||
|
this.mContxt = mContxt;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@JavascriptInterface
|
||||||
|
public void getName() {
|
||||||
|
Log.e("eeee-", "name");
|
||||||
|
Toast.makeText(con, "hello", Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
|
||||||
|
@JavascriptInterface
|
||||||
|
public String getUserToken() {
|
||||||
|
// Log.e("-token-",UserParts.getUser(con).getData().getToken());
|
||||||
|
// return "woshitoken-androidfasdf";
|
||||||
|
return UserParts.getUser(con).getData().getToken();
|
||||||
|
}
|
||||||
|
|
||||||
|
@JavascriptInterface
|
||||||
|
public void isSuccess() {
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
|
||||||
|
@JavascriptInterface
|
||||||
|
public void isPdfSuccess() {
|
||||||
|
Toast.makeText(con, "签署成功", Toast.LENGTH_SHORT).show();
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@ -50,6 +50,7 @@ class MessageUtils {
|
|||||||
fun showSimCenPop(
|
fun showSimCenPop(
|
||||||
ctx: Context,
|
ctx: Context,
|
||||||
message: String,
|
message: String,
|
||||||
|
titleRight:String = "去注册",
|
||||||
onMyItemClickListener: SimCenterPop.OnMyItemClickListener
|
onMyItemClickListener: SimCenterPop.OnMyItemClickListener
|
||||||
) {
|
) {
|
||||||
|
|
||||||
@ -68,7 +69,7 @@ class MessageUtils {
|
|||||||
XPopup.Builder(ctx) //
|
XPopup.Builder(ctx) //
|
||||||
.hasNavigationBar(false)
|
.hasNavigationBar(false)
|
||||||
.isDestroyOnDismiss(true) //对于只使用一次的弹窗对象,推荐设置这个
|
.isDestroyOnDismiss(true) //对于只使用一次的弹窗对象,推荐设置这个
|
||||||
.asCustom(SimCenterPop(ctx, message).setOnMyItemClickListener(onMyItemClickListener))
|
.asCustom(SimCenterPop(ctx, message, titleRight = titleRight).setOnMyItemClickListener(onMyItemClickListener))
|
||||||
.show()
|
.show()
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -96,6 +97,7 @@ class MessageUtils {
|
|||||||
XPopup.Builder(ctx) //
|
XPopup.Builder(ctx) //
|
||||||
.hasNavigationBar(false)
|
.hasNavigationBar(false)
|
||||||
.isDestroyOnDismiss(true) //对于只使用一次的弹窗对象,推荐设置这个
|
.isDestroyOnDismiss(true) //对于只使用一次的弹窗对象,推荐设置这个
|
||||||
|
.dismissOnTouchOutside(false)
|
||||||
.asCustom(SimCenterPop(ctx, message,left,right).setOnMyItemClickListener(onMyItemClickListener))
|
.asCustom(SimCenterPop(ctx, message,left,right).setOnMyItemClickListener(onMyItemClickListener))
|
||||||
.show()
|
.show()
|
||||||
|
|
||||||
|
|||||||
@ -0,0 +1,76 @@
|
|||||||
|
package com.arpa.hndahesudintocctmsdriver.util;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.text.TextUtils;
|
||||||
|
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.sp.SPUtil;
|
||||||
|
import com.dahe.mylibrary.utils.TimeUtil;
|
||||||
|
import com.dahe.mylibrary.utils.ToastUtils;
|
||||||
|
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.Locale;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName OneDayShowUtils
|
||||||
|
* @Author john
|
||||||
|
* @Date 2024/9/11 15:33
|
||||||
|
* @Description TODO
|
||||||
|
*/
|
||||||
|
public class OneDayShowUtils {
|
||||||
|
|
||||||
|
private static class SingletonHolder {
|
||||||
|
private static final OneDayShowUtils INSTANCE = new OneDayShowUtils();
|
||||||
|
}
|
||||||
|
|
||||||
|
private OneDayShowUtils() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final OneDayShowUtils getInstance() {
|
||||||
|
return OneDayShowUtils.SingletonHolder.INSTANCE;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param ctx
|
||||||
|
* @return true:当天已弹出 false:当天未弹出
|
||||||
|
*/
|
||||||
|
public boolean todayIsShow(Context ctx) {
|
||||||
|
String preday = (String) SPUtils.get(ctx, "PREDAY", "");
|
||||||
|
if (TextUtils.isEmpty(preday)) {
|
||||||
|
String nowString = TimeUtil.getNowString("yyyy-MM-dd");
|
||||||
|
SPUtils.put(ctx, "PREDAY", nowString);
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
boolean today = TimeUtil.isToday(preday, new SimpleDateFormat("yyyy-MM-dd", Locale.getDefault()));
|
||||||
|
if (!today) {
|
||||||
|
String nowString = TimeUtil.getNowString("yyyy-MM-dd");
|
||||||
|
SPUtils.put(ctx, "PREDAY", nowString);
|
||||||
|
}
|
||||||
|
return today;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param ctx
|
||||||
|
* @return true:当天已弹出 false:当天未弹出
|
||||||
|
*/
|
||||||
|
public boolean todayIsShowQx(Context ctx) {
|
||||||
|
String preday = (String) SPUtils.get(ctx, "permission", "");
|
||||||
|
if (TextUtils.isEmpty(preday)) {
|
||||||
|
String nowString = TimeUtil.getNowString("yyyy-MM-dd");
|
||||||
|
SPUtils.put(ctx, "permission", nowString);
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
boolean today = TimeUtil.isToday(preday, new SimpleDateFormat("yyyy-MM-dd", Locale.getDefault()));
|
||||||
|
if (!today) {
|
||||||
|
String nowString = TimeUtil.getNowString("yyyy-MM-dd");
|
||||||
|
SPUtils.put(ctx, "permission", nowString);
|
||||||
|
}
|
||||||
|
return today;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -5,7 +5,6 @@ import android.app.Activity;
|
|||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.view.View;
|
|
||||||
import android.webkit.PermissionRequest;
|
import android.webkit.PermissionRequest;
|
||||||
import android.webkit.ValueCallback;
|
import android.webkit.ValueCallback;
|
||||||
import android.webkit.WebChromeClient;
|
import android.webkit.WebChromeClient;
|
||||||
@ -39,12 +38,12 @@ public class PaxWebChromeClient extends WebChromeClient {
|
|||||||
@Override
|
@Override
|
||||||
public void onProgressChanged(WebView view, int newProgress) {
|
public void onProgressChanged(WebView view, int newProgress) {
|
||||||
if (newProgress == 100) {
|
if (newProgress == 100) {
|
||||||
bar.setVisibility(View.INVISIBLE);
|
//bar.setVisibility(View.INVISIBLE);
|
||||||
} else {
|
} else {
|
||||||
if (View.INVISIBLE == bar.getVisibility()) {
|
// if (View.INVISIBLE == bar.getVisibility()) {
|
||||||
bar.setVisibility(View.VISIBLE);
|
// bar.setVisibility(View.VISIBLE);
|
||||||
}
|
// }
|
||||||
bar.setProgress(newProgress);
|
// bar.setProgress(newProgress);
|
||||||
}
|
}
|
||||||
super.onProgressChanged(view, newProgress);
|
super.onProgressChanged(view, newProgress);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,137 @@
|
|||||||
|
package com.arpa.hndahesudintocctmsdriver.util
|
||||||
|
|
||||||
|
import android.app.Activity
|
||||||
|
import android.content.Context
|
||||||
|
import androidx.annotation.NonNull
|
||||||
|
import androidx.appcompat.app.AppCompatActivity
|
||||||
|
import androidx.fragment.app.FragmentActivity
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.cuspop.MessagePop
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.cuspop.MyRequestCallback
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.cuspop.TopMsgPopup
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.cuspop.SimCenterPop
|
||||||
|
import com.lxj.xpopup.XPopup
|
||||||
|
import com.lxj.xpopup.core.BasePopupView
|
||||||
|
import com.permissionx.guolindev.PermissionX
|
||||||
|
import com.permissionx.guolindev.callback.RequestCallback
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName MessageUtils
|
||||||
|
* @Author 用户
|
||||||
|
* @Date 2023/8/15 09:51
|
||||||
|
* @Description TODO
|
||||||
|
*/
|
||||||
|
class PermissionUtils {
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
fun getInstance() = InstanceHelper.sSingle
|
||||||
|
}
|
||||||
|
|
||||||
|
object InstanceHelper {
|
||||||
|
val sSingle = PermissionUtils()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 显示权限申请
|
||||||
|
* @param activity AppCompatActivity
|
||||||
|
* @param message String
|
||||||
|
* @param permission List<String>
|
||||||
|
* @param callback RequestCallback
|
||||||
|
* @return BasePopupView?
|
||||||
|
*/
|
||||||
|
fun showPermissionMessage(activity: FragmentActivity,title:String, message: String,vararg permission:String,callback: MyRequestCallback){
|
||||||
|
val show = XPopup.Builder(activity)
|
||||||
|
.hasShadowBg(false)
|
||||||
|
.hasBlurBg(false)
|
||||||
|
.isTouchThrough(true)
|
||||||
|
.isCenterHorizontal(true)
|
||||||
|
.offsetY(140)
|
||||||
|
.asCustom(
|
||||||
|
TopMsgPopup(
|
||||||
|
activity,
|
||||||
|
title,
|
||||||
|
message
|
||||||
|
)
|
||||||
|
)
|
||||||
|
.show()
|
||||||
|
|
||||||
|
PermissionX.init(activity)
|
||||||
|
.permissions(listOf(*permission))
|
||||||
|
.request { allGranted, grantedList, deniedList ->
|
||||||
|
show.dismiss()
|
||||||
|
if (callback!=null){
|
||||||
|
callback.onResult(allGranted,grantedList,deniedList)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
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()
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
fun showSimCenPop(
|
||||||
|
ctx: Context,
|
||||||
|
message: String,
|
||||||
|
left: String,
|
||||||
|
right: 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, left, right).setOnMyItemClickListener(
|
||||||
|
onMyItemClickListener
|
||||||
|
)
|
||||||
|
)
|
||||||
|
.show()
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -1,6 +1,11 @@
|
|||||||
package com.arpa.hndahesudintocctmsdriver.util.img;
|
package com.arpa.hndahesudintocctmsdriver.util.img;
|
||||||
|
|
||||||
|
import static com.sdk.base.framework.utils.app.AppUtils.getPackageName;
|
||||||
|
|
||||||
import android.Manifest;
|
import android.Manifest;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.net.Uri;
|
||||||
|
import android.provider.Settings;
|
||||||
import android.view.Gravity;
|
import android.view.Gravity;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.WindowManager;
|
import android.view.WindowManager;
|
||||||
@ -13,6 +18,7 @@ import android.widget.Toast;
|
|||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
|
||||||
import com.arpa.hndahesudintocctmsdriver.R;
|
import com.arpa.hndahesudintocctmsdriver.R;
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.MessageUtils;
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.PicturlUtil;
|
import com.arpa.hndahesudintocctmsdriver.util.PicturlUtil;
|
||||||
import com.permissionx.guolindev.PermissionX;
|
import com.permissionx.guolindev.PermissionX;
|
||||||
|
|
||||||
@ -56,12 +62,17 @@ public class GetCarImageAlert {
|
|||||||
}
|
}
|
||||||
btn_xiangce.setOnClickListener(v -> {
|
btn_xiangce.setOnClickListener(v -> {
|
||||||
PermissionX.init(act)
|
PermissionX.init(act)
|
||||||
.permissions(Manifest.permission.READ_EXTERNAL_STORAGE)
|
.permissions(Manifest.permission.READ_EXTERNAL_STORAGE,Manifest.permission.WRITE_EXTERNAL_STORAGE)
|
||||||
.request((allGranted, grantedList, deniedList) -> {
|
.request((allGranted, grantedList, deniedList) -> {
|
||||||
if (allGranted) {
|
if (allGranted) {
|
||||||
PicturlUtil.selectPicter(act, new ArrayList<>(), 1);
|
PicturlUtil.selectPicter(act, new ArrayList<>(), 1);
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(act.getBaseContext(), "开启权限失败,请手动开启权限", Toast.LENGTH_LONG).show();
|
new MessageUtils().showSimCenPop(act, "缺少媒体和文件权限,将无法选择照片,去开启!", "取消", "确认", () -> {
|
||||||
|
Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
|
||||||
|
Uri uri = Uri.fromParts("package", getPackageName(), null);
|
||||||
|
intent.setData(uri);
|
||||||
|
act.startActivity(intent);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@ -74,7 +85,12 @@ public class GetCarImageAlert {
|
|||||||
// file=ImageGetUtil.createImageFile(act);
|
// file=ImageGetUtil.createImageFile(act);
|
||||||
// ImageGetUtil.cameraAlbumGetImage(act,file);
|
// ImageGetUtil.cameraAlbumGetImage(act,file);
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(act.getBaseContext(), "开启权限失败,请手动开启权限", Toast.LENGTH_LONG).show();
|
new MessageUtils().showSimCenPop(act, "缺少相机权限,将无法进行拍照或选择照片,去开启!", "取消", "确认", () -> {
|
||||||
|
Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
|
||||||
|
Uri uri = Uri.fromParts("package", getPackageName(), null);
|
||||||
|
intent.setData(uri);
|
||||||
|
act.startActivity(intent);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@ -86,7 +102,12 @@ public class GetCarImageAlert {
|
|||||||
if (allGranted) {
|
if (allGranted) {
|
||||||
openCam(act);
|
openCam(act);
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(act.getBaseContext(), "开启权限失败,请手动开启权限", Toast.LENGTH_LONG).show();
|
new MessageUtils().showSimCenPop(act, "缺少相机权限,将无法进行拍照或选择照片,去开启!", "取消", "确认", () -> {
|
||||||
|
Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
|
||||||
|
Uri uri = Uri.fromParts("package", getPackageName(), null);
|
||||||
|
intent.setData(uri);
|
||||||
|
act.startActivity(intent);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,11 @@
|
|||||||
package com.arpa.hndahesudintocctmsdriver.util.img;
|
package com.arpa.hndahesudintocctmsdriver.util.img;
|
||||||
|
|
||||||
|
import static com.sdk.base.framework.utils.app.AppUtils.getPackageName;
|
||||||
|
|
||||||
import android.Manifest;
|
import android.Manifest;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.net.Uri;
|
||||||
|
import android.provider.Settings;
|
||||||
import android.view.Gravity;
|
import android.view.Gravity;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.WindowManager;
|
import android.view.WindowManager;
|
||||||
@ -10,6 +15,7 @@ import android.widget.Toast;
|
|||||||
|
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
|
||||||
|
import com.arpa.hndahesudintocctmsdriver.util.MessageUtils;
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.PicturlUtil;
|
import com.arpa.hndahesudintocctmsdriver.util.PicturlUtil;
|
||||||
import com.arpa.hndahesudintocctmsdriver.R;
|
import com.arpa.hndahesudintocctmsdriver.R;
|
||||||
import com.permissionx.guolindev.PermissionX;
|
import com.permissionx.guolindev.PermissionX;
|
||||||
@ -45,25 +51,37 @@ public class GetImageAlert {
|
|||||||
|
|
||||||
btn_xiangce.setOnClickListener(v -> {
|
btn_xiangce.setOnClickListener(v -> {
|
||||||
PermissionX.init(act)
|
PermissionX.init(act)
|
||||||
.permissions(Manifest.permission.READ_EXTERNAL_STORAGE)
|
.permissions(Manifest.permission.READ_EXTERNAL_STORAGE,Manifest.permission.WRITE_EXTERNAL_STORAGE,Manifest.permission.CAMERA)
|
||||||
.request((allGranted, grantedList, deniedList) -> {
|
.request((allGranted, grantedList, deniedList) -> {
|
||||||
if (allGranted) {
|
if (allGranted) {
|
||||||
PicturlUtil.selectPicter(act, new ArrayList<>(), 1);
|
PicturlUtil.selectPicter(act, new ArrayList<>(), 1);
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(act.getBaseContext(), "开启权限失败,请手动开启权限", Toast.LENGTH_LONG).show();
|
new MessageUtils().showSimCenPop(act, "缺少相机,媒体权限,将无法为您提供服务,去开启!", "取消", "确认", () -> {
|
||||||
|
Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
|
||||||
|
Uri uri = Uri.fromParts("package", getPackageName(), null);
|
||||||
|
intent.setData(uri);
|
||||||
|
act.startActivity(intent);
|
||||||
|
});
|
||||||
|
// Toast.makeText(act.getBaseContext(), "开启权限失败,请手动开启权限", Toast.LENGTH_LONG).show();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
btn_paizhao.setOnClickListener(v -> {
|
btn_paizhao.setOnClickListener(v -> {
|
||||||
|
|
||||||
PermissionX.init(act)
|
PermissionX.init(act)
|
||||||
.permissions(Manifest.permission.CAMERA)
|
.permissions(Manifest.permission.READ_EXTERNAL_STORAGE,Manifest.permission.WRITE_EXTERNAL_STORAGE,Manifest.permission.CAMERA)
|
||||||
.request((allGranted, grantedList, deniedList) -> {
|
.request((allGranted, grantedList, deniedList) -> {
|
||||||
if (allGranted) {
|
if (allGranted) {
|
||||||
file = ImageGetUtil.createImageFile(act);
|
file = ImageGetUtil.createImageFile(act);
|
||||||
ImageGetUtil.cameraAlbumGetImage(act, file);
|
ImageGetUtil.cameraAlbumGetImage(act, file);
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(act.getBaseContext(), "开启权限失败,请手动开启权限", Toast.LENGTH_LONG).show();
|
new MessageUtils().showSimCenPop(act, "缺少相机,媒体权限,将无法为您提供服务,去开启!", "取消", "确认", () -> {
|
||||||
|
Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
|
||||||
|
Uri uri = Uri.fromParts("package", getPackageName(), null);
|
||||||
|
intent.setData(uri);
|
||||||
|
act.startActivity(intent);
|
||||||
|
});
|
||||||
|
// Toast.makeText(act.getBaseContext(), "开启权限失败,请手动开启权限", Toast.LENGTH_LONG).show();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@ -28,6 +28,8 @@ public abstract class BaseActivity extends Activity {
|
|||||||
private String title_text="空白标题";
|
private String title_text="空白标题";
|
||||||
|
|
||||||
public Handler hd=new Handler(msg -> {
|
public Handler hd=new Handler(msg -> {
|
||||||
|
if (this==null||this.isFinishing())
|
||||||
|
return true;
|
||||||
msgMethod(msg);
|
msgMethod(msg);
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|||||||
@ -25,6 +25,8 @@ public class BaseAppCompatActivity extends AppCompatActivity {
|
|||||||
public static String dataName,dataName2,dataName3="";
|
public static String dataName,dataName2,dataName3="";
|
||||||
public View root;
|
public View root;
|
||||||
public Handler hd=new Handler(msg -> {
|
public Handler hd=new Handler(msg -> {
|
||||||
|
if (this==null||this.isFinishing())
|
||||||
|
return true;
|
||||||
msgMethod(msg);
|
msgMethod(msg);
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|||||||
@ -105,6 +105,8 @@ public class BaseRecyclerView extends RecyclerView {
|
|||||||
ra.addItem(mb);
|
ra.addItem(mb);
|
||||||
}
|
}
|
||||||
public void adds(List<ManyBean> list){
|
public void adds(List<ManyBean> list){
|
||||||
|
if (ra==null)
|
||||||
|
return;
|
||||||
ra.add(list);
|
ra.add(list);
|
||||||
}
|
}
|
||||||
public AdapterAlls createsH(Context con, List<ManyBean> list){
|
public AdapterAlls createsH(Context con, List<ManyBean> list){
|
||||||
|
|||||||
BIN
app/src/main/res/drawable-xxhdpi/face_success.png
Normal file
BIN
app/src/main/res/drawable-xxhdpi/face_success.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 43 KiB |
13
app/src/main/res/drawable/bg_btn_deepgreen16.xml
Normal file
13
app/src/main/res/drawable/bg_btn_deepgreen16.xml
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<item>
|
||||||
|
<shape android:shape="rectangle">
|
||||||
|
<gradient android:angle="0" android:useLevel="true"
|
||||||
|
android:startColor="#0b64f6 " android:endColor="#5cb3fd"
|
||||||
|
android:centerX="0" android:centerY="0"
|
||||||
|
android:gradientRadius="@dimen/dp_63" />
|
||||||
|
<corners android:radius="@dimen/dp_19" />
|
||||||
|
</shape>
|
||||||
|
|
||||||
|
</item>
|
||||||
|
</selector>
|
||||||
10
app/src/main/res/drawable/bg_btn_gray.xml
Normal file
10
app/src/main/res/drawable/bg_btn_gray.xml
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<item>
|
||||||
|
<shape android:shape="rectangle">
|
||||||
|
<solid android:color="#AAAAAA" />
|
||||||
|
<corners android:topLeftRadius="@dimen/dp_29" android:topRightRadius="@dimen/dp_29"
|
||||||
|
android:bottomLeftRadius="@dimen/dp_29" android:bottomRightRadius="@dimen/dp_29" />
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
</selector>
|
||||||
9
app/src/main/res/drawable/bg_btn_green16.xml
Normal file
9
app/src/main/res/drawable/bg_btn_green16.xml
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<item>
|
||||||
|
<shape android:shape="rectangle">
|
||||||
|
<solid android:color="#E1ECFF" />
|
||||||
|
<corners android:radius="@dimen/dp_19" />
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
</selector>
|
||||||
5
app/src/main/res/drawable/bg_round2.xml
Normal file
5
app/src/main/res/drawable/bg_round2.xml
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
||||||
|
<corners android:radius="@dimen/dp_10"/>
|
||||||
|
<solid android:color="#fff"/>
|
||||||
|
</shape>
|
||||||
73
app/src/main/res/layout/activity_face_succ_result.xml
Normal file
73
app/src/main/res/layout/activity_face_succ_result.xml
Normal file
@ -0,0 +1,73 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<RelativeLayout 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="match_parent"
|
||||||
|
android:background="@color/white"
|
||||||
|
tools:context=".ui.auth.CertificatesActivity">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/return_btn"
|
||||||
|
android:layout_width="@dimen/dp_40"
|
||||||
|
android:layout_height="@dimen/dp_31"
|
||||||
|
android:layout_marginLeft="@dimen/dp_28"
|
||||||
|
android:layout_marginTop="@dimen/dp_58"
|
||||||
|
android:padding="@dimen/dp_10"
|
||||||
|
android:scaleType="fitXY"
|
||||||
|
android:src="@mipmap/return_lefts" />
|
||||||
|
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_marginTop="@dimen/dp_210"
|
||||||
|
android:id="@+id/img"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_centerHorizontal="true"
|
||||||
|
android:background="@drawable/face_success"></ImageView>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tvTitle"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_below="@+id/img"
|
||||||
|
android:layout_centerHorizontal="true"
|
||||||
|
android:text="恭喜您! 实名认证成功"
|
||||||
|
android:textColor="@color/black"
|
||||||
|
android:textSize="@dimen/sp_16" />
|
||||||
|
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_marginTop="@dimen/dp_10"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="@dimen/dp_46"
|
||||||
|
android:layout_below="@+id/tvTitle"
|
||||||
|
android:gravity="center"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/btnHome"
|
||||||
|
android:layout_width="@dimen/dp_110"
|
||||||
|
android:layout_height="@dimen/dp_38"
|
||||||
|
android:background="@drawable/bg_btn_green16"
|
||||||
|
android:text="返回首页"
|
||||||
|
android:textColor="#0966FF" />
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:layout_marginLeft="@dimen/dp_20"
|
||||||
|
android:id="@+id/btnAddCar"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:layout_width="@dimen/dp_110"
|
||||||
|
android:layout_height="@dimen/dp_38"
|
||||||
|
android:background="@drawable/bg_btn_deepgreen16"
|
||||||
|
android:text="添加车辆" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
@ -47,6 +47,7 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:hint="请输入手机号码"
|
android:hint="请输入手机号码"
|
||||||
|
android:inputType="phone"
|
||||||
android:textColor="#ff000000"
|
android:textColor="#ff000000"
|
||||||
android:textSize="@dimen/sp_14"
|
android:textSize="@dimen/sp_14"
|
||||||
android:maxLength="11"
|
android:maxLength="11"
|
||||||
@ -65,6 +66,7 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content">
|
||||||
<EditText
|
<EditText
|
||||||
|
android:inputType="number"
|
||||||
android:id="@+id/input_code"
|
android:id="@+id/input_code"
|
||||||
android:paddingTop="@dimen/dp_12"
|
android:paddingTop="@dimen/dp_12"
|
||||||
android:paddingBottom="@dimen/dp_12"
|
android:paddingBottom="@dimen/dp_12"
|
||||||
|
|||||||
@ -3,24 +3,11 @@
|
|||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
<RelativeLayout
|
|
||||||
android:layout_marginTop="@dimen/dp_88"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent">
|
|
||||||
<WebView
|
<WebView
|
||||||
|
android:layout_marginTop="@dimen/dp_88"
|
||||||
android:id="@+id/wv"
|
android:id="@+id/wv"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent" />
|
android:layout_height="match_parent" />
|
||||||
<ProgressBar
|
|
||||||
android:id="@+id/progressBar"
|
|
||||||
style="?android:attr/progressBarStyleHorizontal"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="5dp"
|
|
||||||
android:visibility="invisible"
|
|
||||||
android:layout_alignParentTop="true" />
|
|
||||||
</RelativeLayout>
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
|||||||
@ -80,7 +80,7 @@
|
|||||||
android:layout_marginLeft="@dimen/dp_14"
|
android:layout_marginLeft="@dimen/dp_14"
|
||||||
android:layout_width="@dimen/dp_143"
|
android:layout_width="@dimen/dp_143"
|
||||||
android:layout_height="@dimen/dp_36"
|
android:layout_height="@dimen/dp_36"
|
||||||
android:src="@mipmap/icon_auth_new"/>
|
android:background="@mipmap/icon_auth_new"/>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
|||||||
26
app/src/main/res/layout/popup_qq_msg.xml
Normal file
26
app/src/main/res/layout/popup_qq_msg.xml
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:orientation="vertical" android:layout_width="match_parent"
|
||||||
|
android:background="@drawable/bg_round2"
|
||||||
|
android:layout_marginLeft="@dimen/dp_16"
|
||||||
|
android:layout_marginRight="@dimen/dp_16"
|
||||||
|
android:padding="20dp"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tvTitle"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="提示"
|
||||||
|
android:textColor="@color/black"
|
||||||
|
android:textSize="@dimen/sp_16"
|
||||||
|
android:textStyle="bold"
|
||||||
|
/>
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tvMessage"
|
||||||
|
android:textColor="@color/black"
|
||||||
|
android:textSize="@dimen/sp_14"
|
||||||
|
android:text=""
|
||||||
|
android:layout_marginTop="@dimen/dp_4"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content" />
|
||||||
|
</LinearLayout>
|
||||||
BIN
app/src/main/res/mipmap-hdpi/icon_auth_wsh.png
Normal file
BIN
app/src/main/res/mipmap-hdpi/icon_auth_wsh.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 49 KiB |
@ -1,14 +0,0 @@
|
|||||||
package com.arpa.hndahesudintocctmsdriver
|
|
||||||
|
|
||||||
import org.junit.Test
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Example local unit test, which will execute on the development machine (host).
|
|
||||||
*
|
|
||||||
* See [testing documentation](http://d.android.com/tools/testing).
|
|
||||||
*/
|
|
||||||
class ExampleUnitTest {
|
|
||||||
@Test
|
|
||||||
fun addition_isCorrect() {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -4,6 +4,9 @@ buildscript {
|
|||||||
// ext.kotlin_version = "1.5.0"
|
// ext.kotlin_version = "1.5.0"
|
||||||
ext.kotlin_version = "1.6.10"
|
ext.kotlin_version = "1.6.10"
|
||||||
repositories {
|
repositories {
|
||||||
|
maven { url 'https://maven.aliyun.com/repository/google' }
|
||||||
|
maven { url 'https://maven.aliyun.com/repository/jcenter' }
|
||||||
|
maven { url 'https://maven.aliyun.com/nexus/content/groups/public' }
|
||||||
google()
|
google()
|
||||||
jcenter() // 这个
|
jcenter() // 这个
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
@ -22,6 +25,9 @@ buildscript {
|
|||||||
|
|
||||||
allprojects {
|
allprojects {
|
||||||
repositories {
|
repositories {
|
||||||
|
maven { url 'https://maven.aliyun.com/repository/google' }
|
||||||
|
maven { url 'https://maven.aliyun.com/repository/jcenter' }
|
||||||
|
maven { url 'https://maven.aliyun.com/nexus/content/groups/public' }
|
||||||
google()
|
google()
|
||||||
jcenter() // Warning: this repository is going to shut down soon
|
jcenter() // Warning: this repository is going to shut down soon
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
|
|||||||
33
mylibrary/src/main/java/com/dahe/mylibrary/utils/Gps.java
Normal file
33
mylibrary/src/main/java/com/dahe/mylibrary/utils/Gps.java
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
package com.dahe.mylibrary.utils;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName Gps
|
||||||
|
* @Author john
|
||||||
|
* @Date 2024/12/13 17:25
|
||||||
|
* @Description TODO
|
||||||
|
*/
|
||||||
|
public class Gps {
|
||||||
|
private double wgLon;
|
||||||
|
private double wgLat;
|
||||||
|
|
||||||
|
public Gps(double wgLat,double wgLon) {
|
||||||
|
this.wgLat = wgLat;
|
||||||
|
this.wgLon = wgLon;
|
||||||
|
}
|
||||||
|
|
||||||
|
public double getWgLon() {
|
||||||
|
return wgLon;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setWgLon(double wgLon) {
|
||||||
|
this.wgLon = wgLon;
|
||||||
|
}
|
||||||
|
|
||||||
|
public double getWgLat() {
|
||||||
|
return wgLat;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setWgLat(double wgLat) {
|
||||||
|
this.wgLat = wgLat;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,9 +1,12 @@
|
|||||||
package com.dahe.mylibrary.utils;
|
package com.dahe.mylibrary.utils;
|
||||||
|
|
||||||
|
import android.app.Activity;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
|
|
||||||
import androidx.core.content.ContextCompat;
|
import androidx.core.content.ContextCompat;
|
||||||
|
import androidx.fragment.app.Fragment;
|
||||||
|
import androidx.fragment.app.FragmentActivity;
|
||||||
|
|
||||||
import com.bumptech.glide.Glide;
|
import com.bumptech.glide.Glide;
|
||||||
import com.bumptech.glide.load.MultiTransformation;
|
import com.bumptech.glide.load.MultiTransformation;
|
||||||
@ -70,10 +73,20 @@ public class ImageLoader {
|
|||||||
*/
|
*/
|
||||||
public void loadImage(Context context, final Object url, final ImageView imageView, RequestOptions requestOptions, int placeholder) {
|
public void loadImage(Context context, final Object url, final ImageView imageView, RequestOptions requestOptions, int placeholder) {
|
||||||
if (null != context) {
|
if (null != context) {
|
||||||
|
if (context instanceof Activity) {
|
||||||
|
Activity activity = (Activity) context;
|
||||||
|
if (activity != null && !activity.isFinishing()) {
|
||||||
if (placeholder != -1)
|
if (placeholder != -1)
|
||||||
requestOptions = requestOptions.placeholder(placeholder).error(placeholder);
|
requestOptions = requestOptions.placeholder(placeholder).error(placeholder);
|
||||||
Glide.with(context).load(url).centerCrop().apply(requestOptions).into(imageView);
|
Glide.with(context).load(url).centerCrop().apply(requestOptions).into(imageView);
|
||||||
}
|
}
|
||||||
|
}else {
|
||||||
|
if (placeholder != -1)
|
||||||
|
requestOptions = requestOptions.placeholder(placeholder).error(placeholder);
|
||||||
|
Glide.with(context).load(url).centerCrop().apply(requestOptions).into(imageView);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
package com.dahe.mylibrary.utils;
|
package com.dahe.mylibrary.utils;
|
||||||
|
|
||||||
|
import java.util.regex.Matcher;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
public class PatternUtils {
|
public class PatternUtils {
|
||||||
@ -25,4 +26,13 @@ public class PatternUtils {
|
|||||||
public static boolean isLetter(String password){
|
public static boolean isLetter(String password){
|
||||||
return Pattern.matches(REGEX_WORD, password);
|
return Pattern.matches(REGEX_WORD, password);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static String getNumByStr(String str){
|
||||||
|
Pattern compile = Pattern.compile("\\d+");
|
||||||
|
Matcher matcher = compile.matcher(str);
|
||||||
|
while (matcher.find()) {
|
||||||
|
return matcher.group();
|
||||||
|
}
|
||||||
|
return "";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,112 @@
|
|||||||
|
package com.dahe.mylibrary.utils;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.net.Uri;
|
||||||
|
import android.os.Build;
|
||||||
|
import android.provider.Settings;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName PermissionUtils
|
||||||
|
* @Author john
|
||||||
|
* @Date 2024/12/19 14:59
|
||||||
|
* @Description TODO
|
||||||
|
*/
|
||||||
|
public class PermissionUtils {
|
||||||
|
|
||||||
|
// 私有静态实例,防止被外部实例化
|
||||||
|
private static PermissionUtils instance;
|
||||||
|
|
||||||
|
// 私有构造方法,防止通过 new 关键字创建实例
|
||||||
|
private PermissionUtils() {
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取单例实例
|
||||||
|
public static PermissionUtils getInstance() {
|
||||||
|
if (instance == null) {
|
||||||
|
synchronized (PermissionUtils.class) {
|
||||||
|
if (instance == null) {
|
||||||
|
instance = new PermissionUtils();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return instance;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据不同手机机型跳转到权限设置页面
|
||||||
|
*
|
||||||
|
* @param context 上下文
|
||||||
|
*/
|
||||||
|
public void goToAppPermissionSettings(Context context) {
|
||||||
|
Intent intent = new Intent();
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||||
|
if (Build.FINGERPRINT.startsWith("Huawei") || Build.BRAND.startsWith("Huawei")) {
|
||||||
|
// 华为手机
|
||||||
|
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||||
|
intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
|
||||||
|
Uri uri = Uri.fromParts("package", context.getPackageName(), null);
|
||||||
|
intent.setData(uri);
|
||||||
|
} else if (Build.FINGERPRINT.startsWith("Xiaomi") || Build.BRAND.startsWith("Xiaomi")) {
|
||||||
|
// 小米手机
|
||||||
|
intent.setAction(Settings.ACTION_MANAGE_APP_ALL_FILES_ACCESS_PERMISSION);
|
||||||
|
Uri uri = Uri.parse("package:" + context.getPackageName());
|
||||||
|
intent.setData(uri);
|
||||||
|
} else if (Build.BRAND.equals("Meizu")) {
|
||||||
|
// 魅族手机
|
||||||
|
intent.setAction("com.meizu.safe.security.SHOW_APPSEC");
|
||||||
|
intent.addCategory(Intent.CATEGORY_DEFAULT);
|
||||||
|
intent.putExtra("packageName", context.getPackageName());
|
||||||
|
} else if (Build.FINGERPRINT.startsWith("OPPO") || Build.BRAND.startsWith("OPPO")) {
|
||||||
|
// OPPO手机
|
||||||
|
try {
|
||||||
|
String pkgName = context.getPackageName();
|
||||||
|
String className = "com.coloros.safecenter.permission.PermissionManagerActivity";
|
||||||
|
intent.setClassName("com.coloros.safecenter", className);
|
||||||
|
intent.putExtra("packageName", pkgName);
|
||||||
|
intent.putExtra("appName", context.getResources().getString(context.getApplicationInfo().labelRes));
|
||||||
|
intent.putExtra("opType", "4"); // 4 表示权限管理页面
|
||||||
|
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||||
|
} catch (Exception e) {
|
||||||
|
// 如果找不到OPPO的特定页面,则使用通用页面
|
||||||
|
intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
|
||||||
|
Uri uri = Uri.fromParts("package", context.getPackageName(), null);
|
||||||
|
intent.setData(uri);
|
||||||
|
}
|
||||||
|
} else if (Build.FINGERPRINT.startsWith("vivo") || Build.BRAND.startsWith("vivo")) {
|
||||||
|
// vivo手机
|
||||||
|
intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
|
||||||
|
Uri uri = Uri.fromParts("package", context.getPackageName(), null);
|
||||||
|
intent.setData(uri);
|
||||||
|
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||||
|
intent.putExtra(Settings.EXTRA_APP_PACKAGE, context.getPackageName());
|
||||||
|
} else if (Build.BRAND.equals("samsung")) {
|
||||||
|
// 三星手机
|
||||||
|
try {
|
||||||
|
String pkgName = context.getPackageName();
|
||||||
|
Intent intent2 = new Intent("android.settings.APPLICATION_DETAILS_SETTINGS");
|
||||||
|
intent2.addCategory(Intent.CATEGORY_DEFAULT);
|
||||||
|
intent2.setData(Uri.parse("package:" + pkgName));
|
||||||
|
intent2.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||||
|
intent2.putExtra("com.android.providers.media.EXTRA_APP_PACKAGE", pkgName);
|
||||||
|
context.startActivity(intent2);
|
||||||
|
return; // 使用三星特定的页面,不需要继续执行通用代码
|
||||||
|
} catch (Exception e) {
|
||||||
|
// 如果三星特定页面失败,则使用通用页面
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// 其他手机使用通用页面
|
||||||
|
intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
|
||||||
|
Uri uri = Uri.fromParts("package", context.getPackageName(), null);
|
||||||
|
intent.setData(uri);
|
||||||
|
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||||
|
intent.putExtra(Settings.EXTRA_APP_PACKAGE, context.getPackageName());
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// 低于Android 6.0(M)的版本,使用通用页面
|
||||||
|
intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
|
||||||
|
Uri uri = Uri.fromParts("package", context.getPackageName(), null);
|
||||||
|
intent.setData(uri);
|
||||||
|
}
|
||||||
|
context.startActivity(intent);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,539 @@
|
|||||||
|
package com.dahe.mylibrary.utils;
|
||||||
|
|
||||||
|
|
||||||
|
import android.Manifest;
|
||||||
|
import android.app.Activity;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.content.pm.PackageManager;
|
||||||
|
import android.location.Address;
|
||||||
|
import android.location.Criteria;
|
||||||
|
import android.location.Geocoder;
|
||||||
|
import android.location.Location;
|
||||||
|
import android.location.LocationListener;
|
||||||
|
import android.location.LocationManager;
|
||||||
|
import android.location.LocationProvider;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.provider.Settings;
|
||||||
|
import android.util.Log;
|
||||||
|
|
||||||
|
import androidx.core.app.ActivityCompat;
|
||||||
|
import androidx.core.content.ContextCompat;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.text.DecimalFormat;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Locale;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author ondear
|
||||||
|
* time : 16/11/13
|
||||||
|
* desc : 定位相关工具类
|
||||||
|
*/
|
||||||
|
public class RxLocationUtils {
|
||||||
|
|
||||||
|
public static double pi = 3.1415926535897932384626;
|
||||||
|
public static double a = 6378245.0;
|
||||||
|
public static double ee = 0.00669342162296594323;
|
||||||
|
private static OnLocationChangeListener mListener;
|
||||||
|
private static MyLocationListener myLocationListener;
|
||||||
|
private static LocationManager mLocationManager;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 判断Gps是否可用
|
||||||
|
*
|
||||||
|
* @return {@code true}: 是<br>{@code false}: 否
|
||||||
|
*/
|
||||||
|
public static boolean isGpsEnabled(Context context) {
|
||||||
|
LocationManager lm = (LocationManager) context.getSystemService(Context.LOCATION_SERVICE);
|
||||||
|
return lm.isProviderEnabled(LocationManager.GPS_PROVIDER);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 判断定位是否可用
|
||||||
|
*
|
||||||
|
* @return {@code true}: 是<br>{@code false}: 否
|
||||||
|
*/
|
||||||
|
public static boolean isLocationEnabled(Context context) {
|
||||||
|
LocationManager lm = (LocationManager) context.getSystemService(Context.LOCATION_SERVICE);
|
||||||
|
return lm.isProviderEnabled(LocationManager.NETWORK_PROVIDER) || lm.isProviderEnabled(LocationManager.GPS_PROVIDER);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 打开Gps设置界面
|
||||||
|
*/
|
||||||
|
public static void openGpsSettings(Context context) {
|
||||||
|
Intent intent = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS);
|
||||||
|
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||||
|
context.startActivity(intent);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 注册
|
||||||
|
* <p>使用完记得调用{@link #unregister()}</p>
|
||||||
|
* <p>需添加权限 {@code <uses-permission android:name="android.permission.INTERNET"/>}</p>
|
||||||
|
* <p>需添加权限 {@code <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>}</p>
|
||||||
|
* <p>需添加权限 {@code <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>}</p>
|
||||||
|
* <p>如果{@code minDistance}为0,则通过{@code minTime}来定时更新;</p>
|
||||||
|
* <p>{@code minDistance}不为0,则以{@code minDistance}为准;</p>
|
||||||
|
* <p>两者都为0,则随时刷新。</p>
|
||||||
|
*
|
||||||
|
* @param minTime 位置信息更新周期(单位:毫秒)
|
||||||
|
* @param minDistance 位置变化最小距离:当位置距离变化超过此值时,将更新位置信息(单位:米)
|
||||||
|
* @param listener 位置刷新的回调接口
|
||||||
|
* @return {@code true}: 初始化成功<br>{@code false}: 初始化失败
|
||||||
|
*/
|
||||||
|
public static boolean register(Context context, long minTime, long minDistance, OnLocationChangeListener listener) {
|
||||||
|
if (listener == null) return false;
|
||||||
|
if (ContextCompat.checkSelfPermission(context, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(context, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
|
||||||
|
ActivityCompat.requestPermissions((Activity) context, new String[]{Manifest.permission.ACCESS_FINE_LOCATION}, 1);
|
||||||
|
ActivityCompat.requestPermissions((Activity) context, new String[]{Manifest.permission.ACCESS_COARSE_LOCATION}, 1);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
mLocationManager = (LocationManager) context.getSystemService(Context.LOCATION_SERVICE);
|
||||||
|
mListener = listener;
|
||||||
|
if (!isLocationEnabled(context)) {
|
||||||
|
ToastUtils.showToast(context, "无法定位,请打开定位服务");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
String provider = mLocationManager.getBestProvider(getCriteria(), true);
|
||||||
|
|
||||||
|
Location location = mLocationManager.getLastKnownLocation(provider);
|
||||||
|
if (location != null) listener.getLastKnownLocation(location);
|
||||||
|
if (myLocationListener == null) myLocationListener = new MyLocationListener();
|
||||||
|
mLocationManager.requestLocationUpdates(provider, minTime, minDistance, myLocationListener);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 注销
|
||||||
|
*/
|
||||||
|
public static void unregister() {
|
||||||
|
if (mLocationManager != null) {
|
||||||
|
if (myLocationListener != null) {
|
||||||
|
mLocationManager.removeUpdates(myLocationListener);
|
||||||
|
myLocationListener = null;
|
||||||
|
}
|
||||||
|
mLocationManager = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置定位参数
|
||||||
|
*
|
||||||
|
* @return {@link Criteria}
|
||||||
|
*/
|
||||||
|
private static Criteria getCriteria() {
|
||||||
|
Criteria criteria = new Criteria();
|
||||||
|
//设置定位精确度 Criteria.ACCURACY_COARSE比较粗略,Criteria.ACCURACY_FINE则比较精细
|
||||||
|
criteria.setAccuracy(Criteria.ACCURACY_FINE);
|
||||||
|
//设置是否要求速度
|
||||||
|
criteria.setSpeedRequired(false);
|
||||||
|
// 设置是否允许运营商收费
|
||||||
|
criteria.setCostAllowed(false);
|
||||||
|
//设置是否需要方位信息
|
||||||
|
criteria.setBearingRequired(false);
|
||||||
|
//设置是否需要海拔信息
|
||||||
|
criteria.setAltitudeRequired(false);
|
||||||
|
// 设置对电源的需求
|
||||||
|
criteria.setPowerRequirement(Criteria.POWER_LOW);
|
||||||
|
return criteria;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据经纬度获取地理位置
|
||||||
|
*
|
||||||
|
* @param context 上下文
|
||||||
|
* @param latitude 纬度
|
||||||
|
* @param longitude 经度
|
||||||
|
* @return {@link Address}
|
||||||
|
*/
|
||||||
|
public static Address getAddress(Context context, double latitude, double longitude) {
|
||||||
|
Geocoder geocoder = new Geocoder(context, Locale.getDefault());
|
||||||
|
try {
|
||||||
|
List<Address> addresses = geocoder.getFromLocation(latitude, longitude, 1);
|
||||||
|
if (addresses.size() > 0) return addresses.get(0);
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据经纬度获取所在国家
|
||||||
|
*
|
||||||
|
* @param context 上下文
|
||||||
|
* @param latitude 纬度
|
||||||
|
* @param longitude 经度
|
||||||
|
* @return 所在国家
|
||||||
|
*/
|
||||||
|
public static String getCountryName(Context context, double latitude, double longitude) {
|
||||||
|
Address address = getAddress(context, latitude, longitude);
|
||||||
|
return address == null ? "unknown" : address.getCountryName();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据经纬度获取所在地
|
||||||
|
*
|
||||||
|
* @param context 上下文
|
||||||
|
* @param latitude 纬度
|
||||||
|
* @param longitude 经度
|
||||||
|
* @return 所在地
|
||||||
|
*/
|
||||||
|
public static String getLocality(Context context, double latitude, double longitude) {
|
||||||
|
Address address = getAddress(context, latitude, longitude);
|
||||||
|
return address == null ? "unknown" : address.getLocality();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据经纬度获取所在街道
|
||||||
|
*
|
||||||
|
* @param context 上下文
|
||||||
|
* @param latitude 纬度
|
||||||
|
* @param longitude 经度
|
||||||
|
* @return 所在街道
|
||||||
|
*/
|
||||||
|
public static String getStreet(Context context, double latitude, double longitude) {
|
||||||
|
Address address = getAddress(context, latitude, longitude);
|
||||||
|
return address == null ? "unknown" : address.getAddressLine(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据经纬度获取详细地址
|
||||||
|
*
|
||||||
|
* @param context 上下文
|
||||||
|
* @param latitude 纬度
|
||||||
|
* @param longitude 经度
|
||||||
|
* @return 所在街道
|
||||||
|
*/
|
||||||
|
public static String getFeature(Context context, double latitude, double longitude) {
|
||||||
|
Address address = getAddress(context, latitude, longitude);
|
||||||
|
return address == null ? "未知地点" : address.getFeatureName();
|
||||||
|
}
|
||||||
|
|
||||||
|
//------------------------------------------坐标转换工具start--------------------------------------
|
||||||
|
|
||||||
|
/**
|
||||||
|
* GPS坐标 转换成 角度
|
||||||
|
* 例如 113.202222 转换成 113°12′8″
|
||||||
|
*
|
||||||
|
* @param location
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static String gpsToDegree(double location) {
|
||||||
|
double degree = Math.floor(location);
|
||||||
|
double minute_temp = (location - degree) * 60;
|
||||||
|
double minute = Math.floor(minute_temp);
|
||||||
|
// double second = Math.floor((minute_temp - minute)*60);
|
||||||
|
String second = new DecimalFormat("#.##").format((minute_temp - minute) * 60);
|
||||||
|
return (int) degree + "°" + (int) minute + "′" + second + "″";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 国际 GPS84 坐标系
|
||||||
|
* 转换成
|
||||||
|
* [国测局坐标系] 火星坐标系 (GCJ-02)
|
||||||
|
* <p>
|
||||||
|
* World Geodetic System ==> Mars Geodetic System
|
||||||
|
*
|
||||||
|
* @param lon 经度
|
||||||
|
* @param lat 纬度
|
||||||
|
* @return GPS实体类
|
||||||
|
*/
|
||||||
|
public static Gps GPS84ToGCJ02(double lat, double lon) {
|
||||||
|
if (outOfChina(lat, lon)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
double dLat = transformLat(lon - 105.0, lat - 35.0);
|
||||||
|
double dLon = transformLon(lon - 105.0, lat - 35.0);
|
||||||
|
double radLat = lat / 180.0 * pi;
|
||||||
|
double magic = Math.sin(radLat);
|
||||||
|
magic = 1 - ee * magic * magic;
|
||||||
|
double sqrtMagic = Math.sqrt(magic);
|
||||||
|
dLat = (dLat * 180.0) / ((a * (1 - ee)) / (magic * sqrtMagic) * pi);
|
||||||
|
dLon = (dLon * 180.0) / (a / sqrtMagic * Math.cos(radLat) * pi);
|
||||||
|
double mgLat = lat + dLat;
|
||||||
|
double mgLon = lon + dLon;
|
||||||
|
return new Gps(mgLat, mgLon);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* [国测局坐标系] 火星坐标系 (GCJ-02)
|
||||||
|
* 转换成
|
||||||
|
* 国际 GPS84 坐标系
|
||||||
|
*
|
||||||
|
* @param lon 火星经度
|
||||||
|
* @param lat 火星纬度
|
||||||
|
*/
|
||||||
|
public static Gps GCJ02ToGPS84(double lat, double lon) {
|
||||||
|
Gps gps = transform(lat, lon);
|
||||||
|
double lontitude = lon * 2 - gps.getWgLon();
|
||||||
|
double latitude = lat * 2 - gps.getWgLat();
|
||||||
|
return new Gps(latitude, lontitude);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 火星坐标系 (GCJ-02)
|
||||||
|
* 转换成
|
||||||
|
* 百度坐标系 (BD-09)
|
||||||
|
*
|
||||||
|
* @param gg_lon 经度
|
||||||
|
* @param gg_lat 纬度
|
||||||
|
*/
|
||||||
|
public static Gps GCJ02ToBD09(double gg_lat, double gg_lon) {
|
||||||
|
double x = gg_lon, y = gg_lat;
|
||||||
|
double z = Math.sqrt(x * x + y * y) + 0.00002 * Math.sin(y * pi);
|
||||||
|
double theta = Math.atan2(y, x) + 0.000003 * Math.cos(x * pi);
|
||||||
|
double bd_lon = z * Math.cos(theta) + 0.0065;
|
||||||
|
double bd_lat = z * Math.sin(theta) + 0.006;
|
||||||
|
return new Gps(bd_lat, bd_lon);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 国际 GPS84 坐标系
|
||||||
|
* 转换成
|
||||||
|
* 百度坐标系 (BD-09)
|
||||||
|
*
|
||||||
|
* @param lon 经度
|
||||||
|
* @param lat 纬度
|
||||||
|
*/
|
||||||
|
public static Gps GPS84ToBD09(double lat, double lon) {
|
||||||
|
Gps gps = GPS84ToGCJ02(lat,lon);
|
||||||
|
if (gps == null) {
|
||||||
|
return new Gps(lat,lon);
|
||||||
|
}
|
||||||
|
//GCJ-02 转 BD-09
|
||||||
|
return GCJ02ToBD09(gps.getWgLat(), gps.getWgLon());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 百度坐标系 (BD-09)
|
||||||
|
* 转换成
|
||||||
|
* 火星坐标系 (GCJ-02)
|
||||||
|
*
|
||||||
|
* @param bd_lon 百度*经度
|
||||||
|
* @param bd_lat 百度*纬度
|
||||||
|
* @return GPS实体类
|
||||||
|
*/
|
||||||
|
public static Gps BD09ToGCJ02(double bd_lat, double bd_lon) {
|
||||||
|
double x = bd_lon - 0.0065, y = bd_lat - 0.006;
|
||||||
|
double z = Math.sqrt(x * x + y * y) - 0.00002 * Math.sin(y * pi);
|
||||||
|
double theta = Math.atan2(y, x) - 0.000003 * Math.cos(x * pi);
|
||||||
|
double gg_lon = z * Math.cos(theta);
|
||||||
|
double gg_lat = z * Math.sin(theta);
|
||||||
|
return new Gps(gg_lat, gg_lon);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 百度坐标系 (BD-09)
|
||||||
|
* 转换成
|
||||||
|
* 国际 GPS84 坐标系
|
||||||
|
*
|
||||||
|
* @param bd_lon 百度*经度
|
||||||
|
* @param bd_lat 百度*纬度
|
||||||
|
* @return GPS实体类
|
||||||
|
*/
|
||||||
|
public static Gps BD09ToGPS84(double bd_lat, double bd_lon) {
|
||||||
|
Gps gcj02 = BD09ToGCJ02(bd_lat, bd_lon);
|
||||||
|
Gps map84 = GCJ02ToGPS84(gcj02.getWgLat(),
|
||||||
|
gcj02.getWgLon());
|
||||||
|
return map84;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 不在中国范围内
|
||||||
|
*
|
||||||
|
* @param lon 经度
|
||||||
|
* @param lat 纬度
|
||||||
|
* @return boolean值
|
||||||
|
*/
|
||||||
|
public static boolean outOfChina(double lat, double lon) {
|
||||||
|
if (lon < 72.004 || lon > 137.8347)
|
||||||
|
return true;
|
||||||
|
return lat < 0.8293 || lat > 55.8271;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 转化算法
|
||||||
|
*
|
||||||
|
* @param lon
|
||||||
|
* @param lat
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static Gps transform(double lat, double lon) {
|
||||||
|
if (outOfChina(lat, lon)) {
|
||||||
|
return new Gps(lat, lon);
|
||||||
|
}
|
||||||
|
double dLat = transformLat(lon - 105.0, lat - 35.0);
|
||||||
|
double dLon = transformLon(lon - 105.0, lat - 35.0);
|
||||||
|
double radLat = lat / 180.0 * pi;
|
||||||
|
double magic = Math.sin(radLat);
|
||||||
|
magic = 1 - ee * magic * magic;
|
||||||
|
double sqrtMagic = Math.sqrt(magic);
|
||||||
|
dLat = (dLat * 180.0) / ((a * (1 - ee)) / (magic * sqrtMagic) * pi);
|
||||||
|
dLon = (dLon * 180.0) / (a / sqrtMagic * Math.cos(radLat) * pi);
|
||||||
|
double mgLat = lat + dLat;
|
||||||
|
double mgLon = lon + dLon;
|
||||||
|
return new Gps(mgLat, mgLon);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 纬度转化算法
|
||||||
|
*
|
||||||
|
* @param x
|
||||||
|
* @param y
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static double transformLat(double x, double y) {
|
||||||
|
double ret = -100.0 + 2.0 * x + 3.0 * y + 0.2 * y * y + 0.1 * x * y
|
||||||
|
+ 0.2 * Math.sqrt(Math.abs(x));
|
||||||
|
ret += (20.0 * Math.sin(6.0 * x * pi) + 20.0 * Math.sin(2.0 * x * pi)) * 2.0 / 3.0;
|
||||||
|
ret += (20.0 * Math.sin(y * pi) + 40.0 * Math.sin(y / 3.0 * pi)) * 2.0 / 3.0;
|
||||||
|
ret += (160.0 * Math.sin(y / 12.0 * pi) + 320 * Math.sin(y * pi / 30.0)) * 2.0 / 3.0;
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 经度转化算法
|
||||||
|
*
|
||||||
|
* @param x
|
||||||
|
* @param y
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static double transformLon(double x, double y) {
|
||||||
|
double ret = 300.0 + x + 2.0 * y + 0.1 * x * x + 0.1 * x * y + 0.1
|
||||||
|
* Math.sqrt(Math.abs(x));
|
||||||
|
ret += (20.0 * Math.sin(6.0 * x * pi) + 20.0 * Math.sin(2.0 * x * pi)) * 2.0 / 3.0;
|
||||||
|
ret += (20.0 * Math.sin(x * pi) + 40.0 * Math.sin(x / 3.0 * pi)) * 2.0 / 3.0;
|
||||||
|
ret += (150.0 * Math.sin(x / 12.0 * pi) + 300.0 * Math.sin(x / 30.0
|
||||||
|
* pi)) * 2.0 / 3.0;
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface OnLocationChangeListener {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取最后一次保留的坐标
|
||||||
|
*
|
||||||
|
* @param location 坐标
|
||||||
|
*/
|
||||||
|
void getLastKnownLocation(Location location);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 当坐标改变时触发此函数,如果Provider传进相同的坐标,它就不会被触发
|
||||||
|
*
|
||||||
|
* @param location 坐标
|
||||||
|
*/
|
||||||
|
void onLocationChanged(Location location);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* provider的在可用、暂时不可用和无服务三个状态直接切换时触发此函数
|
||||||
|
*
|
||||||
|
* @param provider 提供者
|
||||||
|
* @param status 状态
|
||||||
|
* @param extras provider可选包
|
||||||
|
*/
|
||||||
|
void onStatusChanged(String provider, int status, Bundle extras);//位置状态发生改变
|
||||||
|
|
||||||
|
void onProviderEnabled(String provider);
|
||||||
|
|
||||||
|
void onProviderDisabled(String provider);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static class MyLocationListener
|
||||||
|
implements LocationListener {
|
||||||
|
/**
|
||||||
|
* 当坐标改变时触发此函数,如果Provider传进相同的坐标,它就不会被触发
|
||||||
|
*
|
||||||
|
* @param location 坐标
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void onLocationChanged(Location location) {
|
||||||
|
if (mListener != null) {
|
||||||
|
mListener.onLocationChanged(location);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* provider的在可用、暂时不可用和无服务三个状态直接切换时触发此函数
|
||||||
|
*
|
||||||
|
* @param provider 提供者
|
||||||
|
* @param status 状态
|
||||||
|
* @param extras provider可选包
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void onStatusChanged(String provider, int status, Bundle extras) {
|
||||||
|
if (mListener != null) {
|
||||||
|
mListener.onStatusChanged(provider, status, extras);
|
||||||
|
}
|
||||||
|
switch (status) {
|
||||||
|
case LocationProvider.AVAILABLE:
|
||||||
|
Log.d("onStatusChanged", "当前GPS状态为可见状态");
|
||||||
|
break;
|
||||||
|
case LocationProvider.OUT_OF_SERVICE:
|
||||||
|
Log.d("onStatusChanged", "当前GPS状态为服务区外状态");
|
||||||
|
break;
|
||||||
|
case LocationProvider.TEMPORARILY_UNAVAILABLE:
|
||||||
|
Log.d("onStatusChanged", "当前GPS状态为暂停服务状态");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* provider被enable时触发此函数,比如GPS被打开
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void onProviderEnabled(String provider) {
|
||||||
|
if (mListener != null) {
|
||||||
|
mListener.onProviderEnabled(provider);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* provider被disable时触发此函数,比如GPS被关闭
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void onProviderDisabled(String provider) {
|
||||||
|
if (mListener != null) {
|
||||||
|
mListener.onProviderDisabled(provider);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//===========================================坐标转换工具end====================================
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private static final double EARTH_RADIUS = 6378137.0; //地球半径
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计算两个经纬度之间的距离
|
||||||
|
*
|
||||||
|
* @param longitude
|
||||||
|
* @param latitude
|
||||||
|
* @param longitude2
|
||||||
|
* @param latitude2
|
||||||
|
* @return 单位米
|
||||||
|
*/
|
||||||
|
public static double getDistance(double longitude, double latitude, double longitude2, double latitude2) {
|
||||||
|
double lat1 = rad(latitude);
|
||||||
|
double lat2 = rad(latitude2);
|
||||||
|
double a = lat1 - lat2;
|
||||||
|
double b = rad(longitude) - rad(longitude2);
|
||||||
|
double s = 2 * Math.asin(Math.sqrt(Math.pow(Math.sin(a / 2), 2) + Math.cos(lat1) * Math.cos(lat2) * Math.pow(Math.sin(b / 2), 2)));
|
||||||
|
s = s * EARTH_RADIUS;
|
||||||
|
s = Math.round(s * 10000) / 10000; //四舍五入
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 弧度换为角度
|
||||||
|
* @param d
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
private static double rad(double d) {
|
||||||
|
return d * Math.PI / 180.0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Loading…
Reference in New Issue
Block a user