Compare commits

...
24 Commits
Author SHA1 Message Date
lijia 2c3b570dad 定位数据本地化保存 2024-07-16 11:02:49 +08:00
lijia b29e3eaf03 修复上传位置00问题 2024-07-16 08:57:03 +08:00
lijia 1009561bde 高德企业账号key替换 2024-07-15 17:20:29 +08:00
lijia 0d3e35d6f7 新增司机,车辆显示错乱修复 2024-07-15 11:29:21 +08:00
lijia c1355629eb 页面显示bug修复 2024-07-10 17:24:36 +08:00
lijia 06cc3ba9db 修复软键盘与输入框联动以及提交添加loading 2024-07-10 15:05:19 +08:00
lijia 9202ba437c 车辆详情偶发不刷新问题处理 2024-07-09 10:18:07 +08:00
lijia 93b36a59b3 新增牵引车后转挂车报错优化 2024-07-08 10:29:25 +08:00
lijia 9600c213d4 删除车辆刷新列表奔溃处理 2024-07-08 09:49:52 +08:00
lijia bc86fdf444 补充VersionCode请求头 2024-07-05 10:34:09 +08:00
lijia bc135b9e98 车头,挂车,道路运输证新增绑定逻辑,优化车辆解绑逻辑 2024-07-04 16:50:35 +08:00
lijia 141c38182f 协议网址替换 2024-06-21 10:38:03 +08:00
lijia 491c9b8c84 装卸货,回单添加loading 2024-06-21 08:53:53 +08:00
lijia ce1356509b 整改优化 2024-06-17 11:19:25 +08:00
lijia 7e40fef702 隐私协议统一替换 2024-05-22 15:09:14 +08:00
lijia 6071e05014 协议临时性替换 2024-05-20 16:43:45 +08:00
lijia dba86a51e9 添加备案号 2024-04-27 09:49:05 +08:00
lijia 4e38376f74 上传银行卡防抖处理 2024-04-22 15:33:55 +08:00
lijia 2842812fb0 图标修复 2024-04-17 14:29:08 +08:00
lijia 4dddcc5d96 拍照bug修复 2024-01-04 15:29:33 +08:00
lijia f352932fa9 3.3.3版本 2023-11-09 14:54:09 +08:00
lijia b6645b7d1f 3.3.2版本 2023-11-08 15:31:58 +08:00
lijia 109a713850 从业资格证重复上传优化 2023-11-02 16:26:40 +08:00
lijia fb164ccb15 更换极光推送key 2023-10-19 14:45:30 +08:00
41 changed files with 2616 additions and 256 deletions
+6 -6
View File
@@ -35,10 +35,10 @@ android {
defaultConfig {
applicationId "com.arpa.hndahesudintocctmsdriver"
minSdkVersion 23
minSdkVersion 24
targetSdkVersion 30
versionCode 60
versionName "3.3.0"
versionCode 65
versionName "3.3.5"
flavorDimensions "CHANNEL_VALUE"
flavorDimensions "app_icon"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
@@ -101,7 +101,7 @@ android {
app_icon : "@drawable/diver_logo_text",
GAODEKEY : "6791d69f6221a0841b521763af86eb01",
JPUSH_PKGNAME: applicationId,
JPUSH_APPKEY : "571d93ae5117da6dee848c92", //JPush 上注册的包名对应的 Appkey.
JPUSH_APPKEY : "fba6f55621c670d8c1fe9191", //JPush 上注册的包名对应的 Appkey.
JPUSH_CHANNEL: "developer-default"//暂时填写默认值即可.
]
buildConfigField("String", "OPEN_AL_URL", "\"https://oapi-staging.alct56.com\"")
@@ -114,9 +114,9 @@ android {
applicationId "com.arpa.hndahesudintocctmsdriver"
manifestPlaceholders = [CHANNEL_VALUE: "大河好运司机",
app_icon : "@drawable/diver_logo",
GAODEKEY : "78019612271411eca3af34db91930620",
GAODEKEY : "c68051b43e79e47a1556fc695371c902",
JPUSH_PKGNAME: applicationId,
JPUSH_APPKEY : "571d93ae5117da6dee848c92", //JPush 上注册的包名对应的 Appkey.
JPUSH_APPKEY : "fba6f55621c670d8c1fe9191", //JPush 上注册的包名对应的 Appkey.
JPUSH_CHANNEL: "developer-default"//暂时填写默认值即可.
]
buildConfigField("String", "OPEN_AL_URL", "\"https://oapi.alct56.com\"")
+8 -3
View File
@@ -11,6 +11,7 @@
<!-- 录音 -->
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />
<!--播音-->
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
@@ -53,7 +54,7 @@
android:name="com.arpa.hndahesudintocctmsdriver.App"
android:allowBackup="true"
android:excludeFromRecents="true"
android:icon="${app_icon}"
android:icon="@mipmap/diver_logo"
android:label="@string/appName"
android:largeHeap="true"
android:requestLegacyExternalStorage="true"
@@ -93,6 +94,7 @@
android:screenOrientation="portrait" />
<activity
android:name="com.arpa.hndahesudintocctmsdriver.ui.auth.PhotoCarActivity"
android:windowSoftInputMode="adjustPan|stateHidden"
android:screenOrientation="portrait" />
<activity
android:name="com.arpa.hndahesudintocctmsdriver.ui.auth.VehicleAuthActivity"
@@ -160,6 +162,7 @@
</activity>
<activity
android:name="com.arpa.hndahesudintocctmsdriver.ui.auth.CertificatesActivity"
android:windowSoftInputMode="adjustPan|stateHidden"
android:screenOrientation="portrait"/>
<activity
android:name="com.arpa.hndahesudintocctmsdriver.ui.auth.AddCarSuccActivity"
@@ -169,6 +172,7 @@
android:screenOrientation="portrait"/>
<activity
android:name="com.arpa.hndahesudintocctmsdriver.ui.login.WelcomeActivity"
android:exported="true"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
@@ -265,7 +269,8 @@
android:value="${GAODEKEY}" />
<!-- android:value="702eaa84675618b8eb69298d9fd42ca3" />-->
<service android:name="com.amap.api.location.APSService"></service>
<service android:name="com.amap.api.location.APSService"
android:foregroundServiceType="location"></service>
<!--百度地图-->
<meta-data
@@ -274,7 +279,7 @@
<!-- 极光-->
<meta-data
android:name="JPUSH_APPKEY"
android:value="571d93ae5117da6dee848c92" /> <!-- </>值来自开发者平台取得的AppKey -->
android:value="fba6f55621c670d8c1fe9191" /> <!-- </>值来自开发者平台取得的AppKey -->
<meta-data
android:name="JPUSH_CHANNEL"
@@ -78,29 +78,30 @@ public class App extends Application {
}
}
// PendingIntent pendingIntent =
// PendingIntent.getActivity(this, 0, new Intent(this, MainActivity.class), PendingIntent.FLAG_UPDATE_CURRENT);
// Cactus.getInstance()
// .isDebug(true)
// //可选,设置通知栏点击事件
// .setPendingIntent(pendingIntent)
//// .setBackgroundMusicEnabled(true)//可选,退到后台是否可以播放音乐
//// .setMusicId(R.raw.main) //可选,设置音乐
//// .setPendingIntent(pendingIntent)//可选,设置通知栏点击事件
//// .addCallback(new CactusCallback())//可选,运行时回调
// .setCrashRestartUIEnabled(true) //可选,设置奔溃可以重启,google原生rom android 10以下可以正常重启
// .setCrashRestartUIEnabled(true)//可选,设置奔溃可以重启,google原生rom android 10以下可以正常重启
// .setTitle("大河好运")
// .setSmallIcon(R.drawable.diver_logo)
// .addBackgroundCallback(new CactusBackgroundCallback() {
// @Override
// public void onBackground(boolean b) {
// if (b){
// getBillLocation();
// }
// }
// })
// .register(this);
PendingIntent pendingIntent =
PendingIntent.getActivity(this, 0, new Intent(this, MainActivity.class), PendingIntent.FLAG_UPDATE_CURRENT);
Cactus.getInstance()
.isDebug(true)
//可选,设置通知栏点击事件
.setPendingIntent(pendingIntent)
.setBackgroundMusicEnabled(true)//可选,退到后台是否可以播放音乐
.setMusicId(R.raw.main) //可选,设置音乐
// .setPendingIntent(pendingIntent)//可选,设置通知栏点击事件
// .addCallback(new CactusCallback())//可选,运行时回调
.setCrashRestartUIEnabled(true) //可选,设置奔溃可以重启,google原生rom android 10以下可以正常重启
.setCrashRestartUIEnabled(true)//可选,设置奔溃可以重启,google原生rom android 10以下可以正常重启
.setTitle("大河好运")
.setContent("大河好运司机端为您提供服务")
.setSmallIcon(R.drawable.diver_logo)
.addBackgroundCallback(new CactusBackgroundCallback() {
@Override
public void onBackground(boolean b) {
if (b){
getBillLocation();
}
}
})
.register(this);
}
public static App getApp() {
File diff suppressed because it is too large Load Diff
@@ -66,6 +66,11 @@ public class CarDelBean {
private String owner;
private String roadLicense;
private String roadLicensePhoto;
private String trailerLicenseId;
private String policyPhotoUrl;
private String insuranceCompany;
private String insuranceEndDay;
private String roadLicenseSend;
private String roadLicenseValidity;
private String threeImage;
@@ -79,6 +84,14 @@ public class CarDelBean {
private String carPlateColorValue;
private String needUpQCPhoto;
public String getTrailerLicenseId() {
return trailerLicenseId;
}
public void setTrailerLicenseId(String trailerLicenseId) {
this.trailerLicenseId = trailerLicenseId;
}
public String getNeedUpQCPhoto() {
return needUpQCPhoto;
}
@@ -95,6 +108,30 @@ public class CarDelBean {
this.carPlateColorValue = carPlateColorValue;
}
public String getPolicyPhotoUrl() {
return policyPhotoUrl == null ? "" : policyPhotoUrl;
}
public void setPolicyPhotoUrl(String policyPhotoUrl) {
this.policyPhotoUrl = policyPhotoUrl;
}
public String getInsuranceCompany() {
return insuranceCompany == null ? "" : insuranceCompany;
}
public void setInsuranceCompany(String insuranceCompany) {
this.insuranceCompany = insuranceCompany;
}
public String getInsuranceEndDay() {
return insuranceEndDay == null ? "" : insuranceEndDay;
}
public void setInsuranceEndDay(String insuranceEndDay) {
this.insuranceEndDay = insuranceEndDay;
}
public String getCarEnergyTypValue() {
return carEnergyTypValue;
}
@@ -271,6 +308,15 @@ public class CarDelBean {
private String threeImage;
private String type;
private String vehicleNumber;
private String trailerLicenseId;
public String getTrailerLicenseId() {
return trailerLicenseId;
}
public void setTrailerLicenseId(String trailerLicenseId) {
this.trailerLicenseId = trailerLicenseId;
}
public String getBackImage() {
return backImage == null ? "" : backImage;
@@ -48,6 +48,33 @@ public class DriverExpireBean {
public static class DataDTO {
private String driverLicenseUpdateUrl;
private String idCardUpdateUrl;
private String qualificationUpdateUrl;
private String roadLicenseUpdateUrl;
private String insuranceUpdateUrl;
public String getRoadLicenseUpdateUrl() {
return roadLicenseUpdateUrl;
}
public void setRoadLicenseUpdateUrl(String roadLicenseUpdateUrl) {
this.roadLicenseUpdateUrl = roadLicenseUpdateUrl;
}
public String getInsuranceUpdateUrl() {
return insuranceUpdateUrl;
}
public void setInsuranceUpdateUrl(String insuranceUpdateUrl) {
this.insuranceUpdateUrl = insuranceUpdateUrl;
}
public String getQualificationUpdateUrl() {
return qualificationUpdateUrl;
}
public void setQualificationUpdateUrl(String qualificationUpdateUrl) {
this.qualificationUpdateUrl = qualificationUpdateUrl;
}
public String getDriverLicenseUpdateUrl() {
return driverLicenseUpdateUrl;
@@ -59,6 +59,7 @@ public class OCRVehicleBackLicenseBean {
private int id;
private String url;
private String checkRecord;
private String isSave;
private String approvedCapacity;
private String allCapacity;
private String size;
@@ -71,6 +72,14 @@ public class OCRVehicleBackLicenseBean {
private String carNumber;
private int licenseId;
public String getIsSave() {
return isSave;
}
public void setIsSave(String isSave) {
this.isSave = isSave;
}
public int getLicenseId() {
return licenseId;
}
@@ -49,7 +49,9 @@ public class OCRVehicleLicenseBean {
private String address;
private int carId;
private String carNumber;
private boolean carExist;
private String dateIssue;
private String backImage;
private String engineNumber;
private int id;
private String model;
@@ -60,6 +62,41 @@ public class OCRVehicleLicenseBean {
private String type;
private String url;
private String vehicleNumber;
private String licenseId;
public String getLicenseId() {
return licenseId;
}
public void setLicenseId(String licenseId) {
this.licenseId = licenseId;
}
private DataDto2 existCarInfo;
public DataDto2 getExistCarInfo() {
return existCarInfo;
}
public void setExistCarInfo(DataDto2 existCarInfo) {
this.existCarInfo = existCarInfo;
}
public boolean isCarExist() {
return carExist;
}
public String getBackImage() {
return backImage;
}
public void setBackImage(String backImage) {
this.backImage = backImage;
}
public void setCarExist(boolean carExist) {
this.carExist = carExist;
}
public String getAddress() {
return address == null ? "" : address;
@@ -173,4 +210,44 @@ public class OCRVehicleLicenseBean {
this.vehicleNumber = vehicleNumber;
}
}
public static class DataDto2 {
private String backImage;
private String carId;
private String licenseId;
private CarDelBean.DataDTO trailerResVo;
public CarDelBean.DataDTO getTrailerResVo() {
return trailerResVo;
}
public void setTrailerResVo(CarDelBean.DataDTO trailerResVo) {
this.trailerResVo = trailerResVo;
}
public String getLicenseId() {
return licenseId;
}
public void setLicenseId(String licenseId) {
this.licenseId = licenseId;
}
public String getBackImage() {
return backImage == null ? "" : backImage;
}
public void setBackImage(String backImage) {
this.backImage = backImage;
}
public String getCarId() {
return carId;
}
public void setCarId(String carId) {
this.carId = carId;
}
}
}
@@ -0,0 +1,21 @@
package com.arpa.hndahesudintocctmsdriver.event;
/**
* @author hlh
* @version 1.0.0
* @date 2021/11/2 18:51
* @description:
*/
public class RefreshCarListEvent {
private String message;
public RefreshCarListEvent(String message) {
this.message = message;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
}
@@ -124,6 +124,17 @@ public class AuthRequest {
RequestUtil.start(1, "saveCarRoadLicenseNo", re, con, hd);
}
//车辆交强保险
public void saveTrafficInsurance(Context con, Handler hd, String id, String insuranceEndDay, String insuranceCompany) {
String mt = "{\n" +
"\t\"carId\": \"" + id + "\",\n" +
"\t\"insuranceEndDay\": \"" + insuranceEndDay + "\",\n" +
"\t\"insuranceCompany\": \"" + insuranceCompany + "\",\n" +
"}";
Request re = OkHttpUtil.posts(new OkDate(RequestConstant.getTrafficInsurance(), mt), getToken(con), con);
RequestUtil.start(1, "saveTrafficInsurance", re, con, hd);
}
//获取资格证认证信息
public void isDriverAuthQualification(Context con, Handler hd) {
Request re = OkHttpUtil.posts(new OkDate(RequestConstant.getIsAuthDriverAuthQualification(), ""), getToken(con), con);
@@ -49,8 +49,8 @@ public class OCRRequest {
RequestUtil.start(12, CertificatesActivity.TYPE_NAME[2],re,con,hd);
}
//行驶证背面识别
public void OCRVehicleLicenseBack(Context con, Handler hd, File file,String carId,String carNum){
Request re = OkHttpUtil.postFiles(new OkDate(RequestConstant.getVehicleLicenseBack()),file,getToken(con),carId,carNum);
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);
RequestUtil.start(12, CertificatesActivity.TYPE_NAME_BANK[2],re,con,hd);
}
@@ -86,7 +86,7 @@ public class RequestConstant {
//车辆详情
private static final String GET_CAR_DEL = "/app/carDriver/getCarInfo";
//删除车辆
private static final String DEL_CAR = "/app/carDriver/removeCar";
private static final String DEL_CAR = "/app/carDriver/unBindCar";
//上传车辆照片
private static final String SAVECARIMG = "/app/carDriver/saveCarImg";
//上传头像保存
@@ -130,6 +130,9 @@ public class RequestConstant {
private static final String DRIVER_AUTH_SAVECARREGISTERNO = "/app/carDriver/saveCarRegisterNo";
//道路运输信息
private static final String DRIVER_AUTH_SAVECARROADLICENSENO = "/app/carDriver/saveCarRoadLicenseNo";
//交强险
private static final String DRIVER_TRAFFIC_INSU = "/app/carDriver/saveCarInsurace";
//党员认证
private static final String PARTY_MEMBER = "/app/user/partyMember";
//实名认证
@@ -375,6 +378,10 @@ public class RequestConstant {
return BASE_URL + DRIVER_AUTH_SAVECARROADLICENSENO;
}
public static String getTrafficInsurance() {
return BASE_URL + DRIVER_TRAFFIC_INSU;
}
public static String getSaveDrawCar() {
return BASE_URL + SAVE_DRAW_CAR;
}
@@ -10,6 +10,7 @@ import android.util.Log;
import androidx.annotation.Nullable;
import com.arpa.hndahesudintocctmsdriver.R;
import com.arpa.hndahesudintocctmsdriver.request.HuoYuanRequset;
import com.arpa.hndahesudintocctmsdriver.util.cache.CacheGroup;
import com.arpa.hndahesudintocctmsdriver.util.http.RequsetCodeConstants;
@@ -27,11 +28,14 @@ public class MakeUpService extends Service {
public void palyMp3(){
Log.e("开始播放","-----");
try {
AssetFileDescriptor fd =getAssets().openFd("kujp9scu.mp3");
mediaPlayer.setDataSource(fd);
mediaPlayer.setLooping(false);//设置为循环播放
mediaPlayer.prepare();//初始化播放器MediaPlayer
mediaPlayer.start();
MediaPlayer mediaPlayer = MediaPlayer.create(this, R.raw.kujp9scu);
mediaPlayer.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {
@Override
public void onPrepared(MediaPlayer mediaPlayer) {
mediaPlayer.start();
}
});
mediaPlayer.prepareAsync();
Log.e("播放成功","-----");
} catch (Exception e) {
e.printStackTrace();
@@ -3,12 +3,15 @@ package com.arpa.hndahesudintocctmsdriver.service;
import android.app.Service;
import android.content.Context;
import android.content.Intent;
import android.os.Environment;
import android.os.Handler;
import android.os.IBinder;
import android.util.Log;
import androidx.annotation.Nullable;
import com.amap.api.location.AMapLocation;
import com.arpa.hndahesudintocctmsdriver.util.FileIOUtils;
import com.google.gson.Gson;
import com.arpa.hndahesudintocctmsdriver.bean.BaseBean;
import com.arpa.hndahesudintocctmsdriver.request.HuoYuanRequset;
@@ -18,8 +21,13 @@ import com.arpa.hndahesudintocctmsdriver.util.sp.SPUtil;
import com.arpa.hndahesudintocctmsdriver.util.cache.CacheGroup;
import com.arpa.hndahesudintocctmsdriver.util.http.RequsetCodeConstants;
import java.io.File;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Timer;
import java.util.TimerTask;
import java.util.logging.Filter;
/**
* @author hlh
@@ -32,7 +40,7 @@ public class TrackService extends Service {
private Context con;
private TrackInputBean tib=new TrackInputBean();
private LocationGDUtil l;
private int timeSum=1000*60*3;
private int timeSum=1000*60;
private String snn="";
private Gson gson=new Gson();
private HuoYuanRequset hyr;
@@ -51,7 +59,30 @@ public class TrackService extends Service {
}
break;
case LocationGDUtil.RES:
genzong();
if(CacheGroup.cacheList.get("getLocation")!=null){
AMapLocation location = gson.fromJson(CacheGroup.cacheList.get("getLocation"), AMapLocation.class);
String time2 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date());
String time = new SimpleDateFormat("yyyy-MM-dd").format(new Date());
// 当前时间:${time2},经纬度:${it.latitude}:${it.longitude}
FileIOUtils.writeFileFromString(
Environment.getExternalStorageDirectory()
.toString() + "/crashinfo/" + "crash-"+time+".txt",
"当前时间:"+time2+",经纬度:"+location.getLatitude()+":"+location.getLongitude(),
true
);
// genzong(location);
CacheGroup.cacheList.remove("getLocation");
}
break;
case 16:
String time2 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date());
String time = new SimpleDateFormat("yyyy-MM-dd").format(new Date());
FileIOUtils.writeFileFromString(
Environment.getExternalStorageDirectory()
.toString() + "/crashinfo/" + "crash-"+time+".txt",
"当前时间:"+time2+",定位失败",
true
);
break;
}
return false;
@@ -94,13 +125,13 @@ public class TrackService extends Service {
super.onDestroy();
}
public void genzong(){
public void genzong(AMapLocation location){
//经度
tib.setLatitude(l.getLatitude()+"");
tib.setLatitude(location.getLatitude()+"");
//纬度
tib.setLongitude(l.getLongitude()+"");
Log.e("经度",l.getLatitude()+"");
Log.e("维度",l.getLongitude()+"");
tib.setLongitude(location.getLongitude()+"");
Log.e("经度",location.getLatitude()+"");
Log.e("维度",location.getLongitude()+"");
//单号
tib.setShippingNoteNumber(snn);
hyr.trackTracking(tib);
@@ -18,10 +18,13 @@ import android.widget.Toast;
import androidx.annotation.Nullable;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.arpa.hndahesudintocctmsdriver.parts.UserParts;
import com.arpa.hndahesudintocctmsdriver.util.string.StringUtil;
import com.bumptech.glide.Glide;
import com.esign.esignsdk.EsignSdk;
import com.esign.esignsdk.data.AuthEvent;
import com.github.gzuliyujiang.wheelpicker.DatePicker;
import com.github.gzuliyujiang.wheelpicker.annotation.DateMode;
import com.google.gson.Gson;
@@ -45,6 +48,8 @@ import com.arpa.hndahesudintocctmsdriver.util.statusbar.StateStyleUtil;
import com.arpa.hndahesudintocctmsdriver.util.view.BaseAppCompatActivity;
import com.lxj.xpopup.util.SmartGlideImageLoader;
import org.greenrobot.eventbus.Subscribe;
import java.io.File;
import java.util.List;
@@ -101,6 +106,7 @@ public class AuthQualificationActivity extends BaseAppCompatActivity {
BaseBean bb = gson.fromJson(CacheGroup.cacheList.get("driverAuthQualification"), BaseBean.class);
if (bb.getCode() == 200) {
// initAuth();
isAuth = true;
//判断是否从车辆进来 carId为空从个人认证进来需跳转实名认证,不为空车辆信息进入,需跳转车辆照片
if (TextUtils.isEmpty(carId)) {
//从业资格证->实名认证
@@ -155,6 +161,7 @@ public class AuthQualificationActivity extends BaseAppCompatActivity {
// finish();
EsignSdk.getInstance().startH5Activity(act, StringUtil.isNull(String.valueOf(bb.getData()), ""));
} else {
finish();
Toast.makeText(con, bb.getMsg(), Toast.LENGTH_LONG).show();
}//Log.e("url",CacheGroup.cacheList.get("authUrl"));
CacheGroup.cacheList.remove("authUrl");
@@ -243,12 +250,14 @@ public class AuthQualificationActivity extends BaseAppCompatActivity {
}
});
value2.setOnClickListener(v -> {
DatePicker picker = new DatePicker(this);
picker.setBodyWidth(300);
picker.setOnDatePickedListener((year, month, day) -> value2.setText(year + "-" + month + "-" + day));
picker.getWheelLayout().setDateMode(DateMode.YEAR_MONTH_DAY);
picker.getWheelLayout().setDateLabel("", "", "");
picker.show();
if (!isAuth) {
DatePicker picker = new DatePicker(this);
picker.setBodyWidth(300);
picker.setOnDatePickedListener((year, month, day) -> value2.setText(year + "-" + month + "-" + day));
picker.getWheelLayout().setDateMode(DateMode.YEAR_MONTH_DAY);
picker.getWheelLayout().setDateLabel("", "", "");
picker.show();
}
});
submit.setOnClickListener(v -> {
if (!isAuth) {
@@ -379,4 +388,31 @@ public class AuthQualificationActivity extends BaseAppCompatActivity {
}
}
@Subscribe
public void processResult(AuthEvent auth) {
//添加实名/意愿/签署完成之后的逻辑
Log.e("-回调信息-", auth.result);
JSONObject jsonObject = JSON.parseObject(auth.result);
if ("success".equalsIgnoreCase(jsonObject.getString("res"))) {
if ("sign".equalsIgnoreCase(jsonObject.getString("key"))) {
Toast.makeText(con, "签署场景成功", Toast.LENGTH_SHORT).show();
} else if ("realName".equalsIgnoreCase(jsonObject.getString("key"))) {
Toast.makeText(con, "实名认证成功", Toast.LENGTH_SHORT).show();
} else {
Toast.makeText(con, "意愿认证成功", Toast.LENGTH_SHORT).show();
}
finish();
} else {
if ("sign".equalsIgnoreCase(jsonObject.getString("key"))) {
Toast.makeText(con, "签署场景失败", Toast.LENGTH_SHORT).show();
} else if ("realName".equalsIgnoreCase(jsonObject.getString("key"))) {
Toast.makeText(con, "实名认证失败", Toast.LENGTH_SHORT).show();
} else {
Toast.makeText(con, "意愿认证失败", Toast.LENGTH_SHORT).show();
}
EsignSdk.getInstance().finishH5Activity();
finish();
}
}
}
@@ -37,6 +37,7 @@ import com.bumptech.glide.Glide;
import com.bumptech.glide.request.RequestOptions;
import com.bumptech.glide.request.target.Target;
import com.dahe.mylibrary.utils.ActivityUtils;
import com.dahe.mylibrary.utils.ToastUtils;
import com.esign.esignsdk.EsignSdk;
import com.esign.esignsdk.data.AuthEvent;
import com.github.gzuliyujiang.wheelpicker.contract.OnOptionPickedListener;
@@ -157,6 +158,9 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|| CacheGroup.cacheList.get("saveVehicleLicense") != null || CacheGroup.cacheList.get("authUrl") != null
|| CacheGroup.cacheList.get("saveDrawCar") != null) {
if (CacheGroup.cacheList.get("driverAuthIdCard") != null) {
if (customDialog != null) {
customDialog.dismiss();
}
BaseBean bb = gson.fromJson(CacheGroup.cacheList.get("driverAuthIdCard"), BaseBean.class);
if (bb.getCode() == 200) {
Toast.makeText(con, "保存成功", Toast.LENGTH_SHORT).show();
@@ -174,6 +178,9 @@ public class CertificatesActivity extends BaseAppCompatActivity {
}
if (CacheGroup.cacheList.get("driverAuthLicense") != null) {
if (customDialog != null) {
customDialog.dismiss();
}
BaseBean bb = gson.fromJson(CacheGroup.cacheList.get("driverAuthLicense"), BaseBean.class);
if (bb.getCode() == 200) {
Toast.makeText(con, "保存成功", Toast.LENGTH_SHORT).show();
@@ -206,6 +213,9 @@ public class CertificatesActivity extends BaseAppCompatActivity {
}
if (CacheGroup.cacheList.get("saveVehicleLicense") != null) {
if (customDialog != null) {
customDialog.dismiss();
}
CarZhengBean czb = gson.fromJson(CacheGroup.cacheList.get("saveVehicleLicense"), CarZhengBean.class);
if (czb.getCode() == 200) {
String needUpQCPhoto = czb.getData().getNeedUpQCPhoto();//是否需要上传从业资格证
@@ -214,13 +224,19 @@ public class CertificatesActivity extends BaseAppCompatActivity {
Toast.makeText(con, "车辆行驶证保存成功", Toast.LENGTH_SHORT).show();
VehicleEvent ve = new VehicleEvent(String.valueOf(czb.getData().getCarId()));
EventBus.getDefault().post(ve);
EventBus.getDefault().postSticky(ve);
// TODO: 2023/8/23
if ("1".equals(isTrailer)) {//判断是否跳转挂车行驶证
Intent in = new Intent(con, CertificatesActivity.class);
in.putExtra("index", 3);
in.putExtra("carId", String.valueOf(czb.getData().getCarId()));
if (olb != null && olb.getData() != null && olb.getData().isCarExist()) {
CarDelBean carDelBean = new CarDelBean();
carDelBean.setRes(1);//保留字段 1:为绑定车辆,可以进行修改挂车信息
carDelBean.setData(gson.fromJson(gson.toJson(olb.getData().getExistCarInfo()), CarDelBean.DataDTO.class));
in.putExtra("cheData", gson.toJson(carDelBean));
}
startActivity(in);
} else if ("1".equals(needUpQCPhoto)) {//判断是否跳转从业资格证
Intent in = new Intent(con, AuthQualificationActivity.class);
@@ -231,6 +247,7 @@ public class CertificatesActivity extends BaseAppCompatActivity {
} else if ("1".equals(needUpRLPhoto)) {//判断是否跳转道路运输许可证
Intent in = new Intent(con, PhotoCarActivity.class);
in.putExtra("type", 3);
in.putExtra("carExist", true);
in.putExtra("carId", String.valueOf(czb.getData().getCarId()));
startActivity(in);
} else {
@@ -263,6 +280,9 @@ public class CertificatesActivity extends BaseAppCompatActivity {
CacheGroup.cacheList.remove("saveVehicleLicense");
}
if (CacheGroup.cacheList.get("saveDrawCar") != null) {
if (customDialog != null) {
customDialog.dismiss();
}
Log.e("-saveDrawCar-", CacheGroup.cacheList.get("saveDrawCar"));
CarZhengBean bb = gson.fromJson(CacheGroup.cacheList.get("saveDrawCar"), CarZhengBean.class);
if (bb.getCode() == 200) {
@@ -283,6 +303,7 @@ public class CertificatesActivity extends BaseAppCompatActivity {
} else if ("1".equals(needUpRLPhoto)) {//现判断是否跳转道路运输许可证
Intent in = new Intent(con, PhotoCarActivity.class);
in.putExtra("type", 3);
in.putExtra("carExist", true);
in.putExtra("carId", carId);
startActivity(in);
} else {
@@ -336,8 +357,11 @@ public class CertificatesActivity extends BaseAppCompatActivity {
}//Log.e("url",CacheGroup.cacheList.get("authUrl"));
CacheGroup.cacheList.remove("authUrl");
} else {
//重复代码?
initView(null);
initData();
if (!(CacheGroup.cacheList.get(TYPE_NAME_BANK[2]) != null || CacheGroup.cacheList.get(TYPE_NAME_BANK[3]) != null)) {
initData();
}
pathOrcRes();
}
break;
@@ -415,6 +439,7 @@ public class CertificatesActivity extends BaseAppCompatActivity {
// there_div.setVisibility(View.VISIBLE);
if (c_str != null && !c_str.equals("")) {
cdb = gson.fromJson(c_str, CarDelBean.class);
oCrcarId = cdb.getData().getTrailerResVo().getTrailerLicenseId() + "";
initView(null);
initData();
} else {
@@ -671,14 +696,16 @@ public class CertificatesActivity extends BaseAppCompatActivity {
value3.setText(StringUtil.isNull(cdb.getData().getTrailerResVo().getOwner(), "空数据"));
value4.setText(StringUtil.isNull(cdb.getData().getTrailerResVo().getVehicleNumber(), "空数据"));
value6.setText(StringUtil.isNull(cdb.getData().getCarEnergyTypValue(), "空数据"));
submit.setBackgroundResource(R.drawable.bg_btn_grey);
Glide.with(con).load(url1).into(img1);
Glide.with(con).load(url2).into(img2);
Glide.with(con).load(url3).into(img3);
u_img.setText("已上传");
u_img2.setText("已上传");
u_img3.setText("点击查看");
isAuth = true;
if (cdb.getRes() != 1) {
submit.setBackgroundResource(R.drawable.bg_btn_grey);
u_img.setText("已上传");
u_img2.setText("已上传");
u_img3.setText("点击查看");
isAuth = true;
}
}
break;
default:
@@ -738,7 +765,8 @@ public class CertificatesActivity extends BaseAppCompatActivity {
value1.setText(ocb.getData().getName());
value2.setText(ocb.getData().getCardId());
value3.setText(ocb.getData().getAddress());
Glide.with(con).load(url1).into(img1);
// Glide.with(con).load(url1).into(img1);
Glide.with(con).load(path).into(img1);
fontId = ocb.getData().getId();
} else {
Toast.makeText(con, "识别失败", Toast.LENGTH_SHORT).show();
@@ -750,7 +778,8 @@ public class CertificatesActivity extends BaseAppCompatActivity {
if (ocbb.getCode() == 200) {
url2 = ocbb.getData().getUrl();
value4.setText(ocbb.getData().getEndTime());
Glide.with(con).load(url2).into(img2);
// Glide.with(con).load(url2).into(img2);
Glide.with(con).load(path).into(img2);
startTime = ocbb.getData().getStartTime();
backId = ocbb.getData().getId();
@@ -774,7 +803,8 @@ public class CertificatesActivity extends BaseAppCompatActivity {
value2.setText(StringUtil.isNull(od.getStartTime(), "识别异常"));
value3.setText(StringUtil.isNull(od.getAllowType(), "识别异常"));
value4.setText(StringUtil.isNull(od.getEndTime(), "识别异常"));
Glide.with(con).load(url1).into(img1);
// Glide.with(con).load(url1).into(img1);
Glide.with(con).load(path).into(img1);
fontId = od.getId();
} else {
Toast.makeText(con, "识别失败", Toast.LENGTH_SHORT).show();
@@ -786,7 +816,8 @@ public class CertificatesActivity extends BaseAppCompatActivity {
if (odlb.getCode() == 200) {
url2 = odlb.getData().getUrl();
backId = odlb.getData().getId();
Glide.with(con).load(url2).into(img2);
// Glide.with(con).load(url2).into(img2);
Glide.with(con).load(path).into(img2);
//自动调取提交功能,实现页面自动跳转
subimt();
} else {
@@ -802,13 +833,22 @@ public class CertificatesActivity extends BaseAppCompatActivity {
Log.e("olb", CacheGroup.cacheList.get(TYPE_NAME[2]));
olb = gson.fromJson(CacheGroup.cacheList.get(TYPE_NAME[2]), OCRVehicleLicenseBean.class);
if (olb.getCode() == 200) {
if (olb.getData().isCarExist()) {
value1.setEnabled(false);
Glide.with(con).load(olb.getData().getExistCarInfo().getBackImage()).into(img2);
url2 = olb.getData().getExistCarInfo().getBackImage();
ToastUtils.showLongToast(con, "该车辆已存在,请仔细核对相关信息");
} else {
value1.setEnabled(true);
}
url1 = olb.getData().getUrl();
value1.setText(olb.getData().getCarNumber());
value2.setText(olb.getData().getType());
value3.setText(olb.getData().getOwner());
value4.setText(olb.getData().getVehicleNumber());
fontId = olb.getData().getId();
Glide.with(con).load(url1).into(img1);
// Glide.with(con).load(url1).into(img1);
Glide.with(con).load(path).into(img1);
oCrcarId = olb.getData().getCarId() + "";
Log.e("-cardId-", oCrcarId);
} else {
@@ -821,8 +861,9 @@ public class CertificatesActivity extends BaseAppCompatActivity {
if (oblb.getCode() == 200) {
url2 = oblb.getData().getUrl();
backId = oblb.getData().getId();
Glide.with(con).load(url2).into(img2);
//自动调取提交功能,实现页面自动跳转
// Glide.with(con).load(url2).into(img2);
Glide.with(con).load(path).into(img2);
//自动调取提交功能,实现页面自动跳转实现页面自动跳转
subimt();
} else {
Toast.makeText(con, oblb.getMsg(), Toast.LENGTH_SHORT).show();
@@ -834,7 +875,8 @@ public class CertificatesActivity extends BaseAppCompatActivity {
if (ub.getCode() == 200) {
url3 = ub.getData().getUrl();
fid = ub.getData().getId();
Glide.with(con).load(url3).into(img3);
// Glide.with(con).load(url3).into(img3);
Glide.with(con).load(path).into(img3);
} else {
Toast.makeText(con, ub.getMsg(), Toast.LENGTH_SHORT).show();
}
@@ -878,7 +920,7 @@ public class CertificatesActivity extends BaseAppCompatActivity {
customDialog.dismiss();
return;
}
new OCRRequest().OCRVehicleLicenseBack(con, hd, new File(path), oCrcarId, carNum);
new OCRRequest().OCRVehicleLicenseBack(con, hd, new File(path), oCrcarId, carNum, olb.getData().isCarExist());
} else {
new AuthRequest().upload(con, hd, new File(path));
@@ -894,7 +936,16 @@ public class CertificatesActivity extends BaseAppCompatActivity {
customDialog.dismiss();
return;
}
new OCRRequest().OCRVehicleLicenseBack(con, hd, new File(path), oCrcarId, carNum);
// if (cdb != null && cdb.getData().getTrailerResVo() &&cdb.getRes() == 1)
boolean isExist = false;
if (olb != null) {//主页识别成功后获取
isExist = olb.getData().isCarExist();
} else {
if (cdb != null && cdb.getData().getTrailerResVo() != null && cdb.getRes() == 1) {//上个页面带来数据
isExist = true;
}
}
new OCRRequest().OCRVehicleLicenseBack(con, hd, new File(path), oCrcarId, carNum, isExist);
} else {
new AuthRequest().upload(con, hd, new File(path));
}
@@ -917,6 +968,8 @@ public class CertificatesActivity extends BaseAppCompatActivity {
switch (index) {
case 0:
if (ocb != null && ocbb != null) {
customDialog = new CustomDialog(con, "网络请求中...");
customDialog.show();
IDInputBean ib = new IDInputBean();
ib.setIdcarName(str1);
ib.setIdcard(str2);
@@ -939,6 +992,8 @@ public class CertificatesActivity extends BaseAppCompatActivity {
//olb
//{"档案编号","初次领证日期","准驾车型","有效期限(止)"},
if (odl != null && odlb != null) {
customDialog = new CustomDialog(con, "网络请求中...");
customDialog.show();
Log.e("ocr", new Gson().toJson(odl));
LicenseInputBean iib = new LicenseInputBean();
iib.setArchivesName(str1);
@@ -955,20 +1010,25 @@ public class CertificatesActivity extends BaseAppCompatActivity {
}
break;
case 2:
if (olb != null && oblb != null) {
if ((olb != null && !olb.getData().isCarExist() && oblb != null) || (olb != null && olb.getData().isCarExist())) {
// if (curColor == null || curEnergy == null) {
// Toast.makeText(con, "请完善内容", Toast.LENGTH_SHORT).show();
// return;
// }
customDialog = new CustomDialog(con, "网络请求中...");
customDialog.show();
HashMap<String, Object> map = new HashMap<>();
if ("".equals(url3)) {
map.put("imgId", fid);
}
map.put("licenseId", oblb.getData().getLicenseId());
map.put("licenseId", olb.getData().isCarExist() ? olb.getData().getExistCarInfo().getLicenseId() : oblb.getData().getLicenseId());
map.put("carNumber", str1);
map.put("type", str2);
map.put("owner", str3);
map.put("vehicleNumber", str4);
// if (olb.getData().isCarExist()) {
// map.put("carId", olb.getData().getCarId());
// }
// map.put("carPlateColor", curColor.getValue());
// map.put("carEnergyTyp", curEnergy.getValue());
new AuthRequest().saveVehicleLicense(con, hd, MapUtil.mapJson(map));
@@ -977,22 +1037,27 @@ public class CertificatesActivity extends BaseAppCompatActivity {
}
break;
case 3:
if (olb != null && oblb != null) {
if (olb != null || (cdb != null && cdb.getRes() == 1)) {
// if (curEnergy==null){
// Toast.makeText(con,"请完善内容",Toast.LENGTH_SHORT).show();
// return;
// }
customDialog = new CustomDialog(con, "网络请求中...");
customDialog.show();
Map<String, Object> map = new HashMap<>();
if ("".equals(url3)) {
map.put("imgId", fid);
}
map.put("licenseId", oblb.getData().getLicenseId());
// map.put("licenseId", oblb.getData().getLicenseId());
map.put("carId", carId);
map.put("carNumberDraw", str1);
map.put("type", str2);
map.put("owner", str3);
// map.put("carEnergyTyp", curEnergy.getValue());
map.put("vehicleNumber", str4);
if (cdb != null && cdb.getRes() == 1 && cdb.getData() != null && cdb.getData().getTrailerResVo() != null) {
map.put("oldTrailerNumber", cdb.getData().getTrailerResVo().getCarNumber());
}
new AuthRequest().saveDrawCar(con, hd, MapUtil.mapJson(map));
} else {
Toast.makeText(con, "请先上传资料", Toast.LENGTH_SHORT).show();
@@ -24,6 +24,7 @@ import com.arpa.hndahesudintocctmsdriver.bean.UploadBean;
import com.arpa.hndahesudintocctmsdriver.request.AuthRequest;
import com.arpa.hndahesudintocctmsdriver.request.UserRequset;
import com.arpa.hndahesudintocctmsdriver.ui.my.WoDeFragment;
import com.arpa.hndahesudintocctmsdriver.util.alert.CustomDialog;
import com.arpa.hndahesudintocctmsdriver.util.cache.CacheGroup;
import com.arpa.hndahesudintocctmsdriver.util.file.ImageFileCompressUtil;
import com.arpa.hndahesudintocctmsdriver.util.img.GetImageAlert;
@@ -31,6 +32,8 @@ import com.arpa.hndahesudintocctmsdriver.util.statusbar.StateStyleUtil;
import com.arpa.hndahesudintocctmsdriver.util.view.BaseAppCompatActivity;
import com.arpa.hndahesudintocctmsdriver.util.view.BaseRecyclerView;
import com.bumptech.glide.Glide;
import com.github.gzuliyujiang.wheelpicker.DatePicker;
import com.github.gzuliyujiang.wheelpicker.annotation.DateMode;
import com.google.gson.Gson;
import com.luck.picture.lib.PictureSelector;
import com.luck.picture.lib.config.PictureConfig;
@@ -49,23 +52,24 @@ import java.util.List;
*/
public class PhotoCarActivity extends BaseAppCompatActivity implements View.OnClickListener {
private String[] titles = {"车辆照片", "NFC照片", "车辆登记证书", "道路运输许可证"};
private String[] name1 = {"车辆照片", "NFC照片", "车辆登记证书照片", "道路运输许可证照片"};
private String[] name2 = {"请上传车辆照片", "请上传NFC照片", "请上传车辆登记证书照片", "请上传道路运输许可证照片"};
private Boolean[] isShowEdit = {false, false, true, true};
private Boolean[] isShowSkip = {true, false, false, true};
private String[] titles = {"车辆照片", "NFC照片", "车辆登记证书", "道路运输许可证", "车辆交强险"};
private String[] name1 = {"车辆照片", "NFC照片", "车辆登记证书照片", "道路运输许可证照片", "车辆交强险照片"};
private String[] name2 = {"请上传车辆照片", "请上传NFC照片", "请上传车辆登记证书照片", "请上传道路运输许可证照片", "请上传车辆交强险照片"};
private Boolean[] isShowEdit = {false, false, true, true, true};
private Boolean[] isShowSkip = {true, false, false, true, true};
private String[] tips = {
"",
"*注意: 没有粘贴NFC芯片的车辆无需上传,可直接跳过",
"*注意: 没有可直接跳过,等候下次上传",
"*注意: 4.5吨以下车辆不需要上传,可直接跳过"};
"*注意: 4.5吨以下车辆不需要上传,可直接跳过",
""};
private BaseRecyclerView brv;
private ImageView img;
private TextView title1, title2, title3, zjimg_name, upload_img, tvTips, tvSkip;
private TextView title1, title2, title3, zjimg_name, upload_img, tvTips, tvSkip, value2;
private EditText value1;
private LinearLayout llInfo;
private LinearLayout llInfo, llDate;
private RelativeLayout up_img;
private Button submit;
@@ -75,7 +79,9 @@ public class PhotoCarActivity extends BaseAppCompatActivity implements View.OnCl
private int type;//页面类型
private String path, carId, url;//图片路径
private boolean carExist = false;
private GetImageAlert gia = new GetImageAlert();
private CustomDialog customDialog;
@Override
public void msgMethod(Message m) {
@@ -109,10 +115,16 @@ public class PhotoCarActivity extends BaseAppCompatActivity implements View.OnCl
case 3:
new AuthRequest().saveCarImg(con, hd, carId, ub.getData().getId(), 2);
break;
case 4:
new AuthRequest().saveCarImg(con, hd, carId, ub.getData().getId(), 7);
break;
}
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);
if (customDialog != null && customDialog.isShowing())
customDialog.dismiss();
CacheGroup.cacheList.remove("upload");
}
@@ -132,6 +144,9 @@ public class PhotoCarActivity extends BaseAppCompatActivity implements View.OnCl
case 3:
Toast.makeText(con, "上传道路运输证成功", Toast.LENGTH_SHORT).show();
break;
case 4:
Toast.makeText(con, "交强险证件上传成功", Toast.LENGTH_SHORT).show();
break;
}
} else {
Toast.makeText(con, bb.getMsg(), Toast.LENGTH_SHORT).show();
@@ -158,7 +173,7 @@ public class PhotoCarActivity extends BaseAppCompatActivity implements View.OnCl
IsAuthDriverAuthQualificationBean ib = gson.fromJson(CacheGroup.cacheList.get("saveCarRoadLicenseNo"), IsAuthDriverAuthQualificationBean.class);
if (ib.getCode() == 200) {
//判断是否需要跳转挂车行驶证页面
if (!"".equals(carId)) {
if (!"".equals(carId) && cdb.getData() != null) {
if (cdb.getData().getIsTrailer() == 1 && cdb.getData().getTrailerResVo() != null && !TextUtils.isEmpty(cdb.getData().getTrailerResVo().getCarNumber())) {//需要挂车,并且传过挂车直接结束
finish();
Intent in = new Intent(con, AddCarSuccActivity.class);
@@ -187,8 +202,11 @@ public class PhotoCarActivity extends BaseAppCompatActivity implements View.OnCl
con.startActivity(in);
}
}
} else {
finish();
}
// if (!"".equals(carId) && cdb.getData().getIsTrailer() == 1) {
// if (!"".equals(carId)) {
// finish();
@@ -213,8 +231,23 @@ public class PhotoCarActivity extends BaseAppCompatActivity implements View.OnCl
}
CacheGroup.cacheList.remove("saveCarRoadLicenseNo");
}
if (CacheGroup.cacheList.get("saveTrafficInsurance") != null) {
Log.e("is", CacheGroup.cacheList.get("saveTrafficInsurance"));
IsAuthDriverAuthQualificationBean ddb = gson.fromJson(CacheGroup.cacheList.get("saveTrafficInsurance"), IsAuthDriverAuthQualificationBean.class);
if (ddb.getCode() == 200) {
Toast.makeText(con, "保存成功", Toast.LENGTH_SHORT).show();
finish();
} else {
Toast.makeText(con, ddb.getMsg(), Toast.LENGTH_SHORT).show();
}
CacheGroup.cacheList.remove("saveTrafficInsurance");
}
break;
case ImageFileCompressUtil.COMPRESS_SUCCESS:
customDialog = new CustomDialog(con, "加载中...");
customDialog.show();
path = (String) m.obj;
new AuthRequest().upload(con, hd, new File(path));
break;
@@ -233,6 +266,7 @@ public class PhotoCarActivity extends BaseAppCompatActivity implements View.OnCl
title1 = findViewById(R.id.title1);
title2 = findViewById(R.id.title2);
title3 = findViewById(R.id.name1);
value2 = findViewById(R.id.value2);
up_img = findViewById(R.id.up_img);
img = findViewById(R.id.img);
zjimg_name = findViewById(R.id.zjimg_name);
@@ -240,6 +274,7 @@ public class PhotoCarActivity extends BaseAppCompatActivity implements View.OnCl
tvTips = findViewById(R.id.tvTips);
value1 = findViewById(R.id.value1);
llInfo = findViewById(R.id.llInfo);
llDate = findViewById(R.id.llDate);
tvSkip = findViewById(R.id.tvSkip);
submit = findViewById(R.id.submit);
@@ -247,10 +282,12 @@ public class PhotoCarActivity extends BaseAppCompatActivity implements View.OnCl
submit.setOnClickListener(this);
upload_img.setOnClickListener(this);
img.setOnClickListener(this);
value2.setOnClickListener(this);
type = getIntent().getExtras().getInt("type");
carId = getIntent().getExtras().getString("carId", "");
carExist = getIntent().getExtras().getBoolean("carExist", false);
changeViewByType(type);
ur = new UserRequset(con, hd);
@@ -307,6 +344,14 @@ public class PhotoCarActivity extends BaseAppCompatActivity implements View.OnCl
case R.id.img:
showBigImg();
break;
case R.id.value2:
DatePicker picker = new DatePicker(this);
picker.setBodyWidth(300);
picker.setOnDatePickedListener((year, month, day) -> value2.setText(year + "-" + month + "-" + day));
picker.getWheelLayout().setDateMode(DateMode.YEAR_MONTH_DAY);
picker.getWheelLayout().setDateLabel("", "", "");
picker.show();
break;
}
}
@@ -315,7 +360,7 @@ public class PhotoCarActivity extends BaseAppCompatActivity implements View.OnCl
* 展示大图片
*/
private void showBigImg() {
if (TextUtils.isEmpty(cdb.getData().getRoadLicensePhoto())) {
if ((type == 0 && TextUtils.isEmpty(cdb.getData().getRoadLicensePhoto())) || (type == 4 && TextUtils.isEmpty(cdb.getData().getPolicyPhotoUrl()))) {
choicePhoto();
return;
}
@@ -358,6 +403,19 @@ public class PhotoCarActivity extends BaseAppCompatActivity implements View.OnCl
.show();
// new XPopup.Builder(con)
// .asImageViewer(img, cdb.getData().getRoadLicensePhoto(), true, -1, -1, 50, false, new CertificatesActivity.ImageLoader())
// .show();
break;
}
case 4:
if (cdb.getData().getPolicyPhotoUrl() != null && !"".equals(cdb.getData().getPolicyPhotoUrl())) {
//roadLicensePhoto
new XPopup.Builder(con)
.asImageViewer(img, cdb.getData().getPolicyPhotoUrl(), new SmartGlideImageLoader(R.mipmap.ic_launcher))
.show();
// new XPopup.Builder(con)
// .asImageViewer(img, cdb.getData().getRoadLicensePhoto(), true, -1, -1, 50, false, new CertificatesActivity.ImageLoader())
// .show();
break;
@@ -411,6 +469,15 @@ public class PhotoCarActivity extends BaseAppCompatActivity implements View.OnCl
}
new AuthRequest().saveCarRoadLicenseNo(con, hd, carId, s1);
break;
case 4:
String s2 = value1.getText().toString();
String v2 = value2.getText().toString();
if (TextUtils.isEmpty(s2) || TextUtils.isEmpty(v2)) {
Toast.makeText(this, "请补充证件信息", Toast.LENGTH_SHORT).show();
return;
}
new AuthRequest().saveTrafficInsurance(con, hd, carId, v2, s2);
break;
}
}
@@ -442,6 +509,17 @@ public class PhotoCarActivity extends BaseAppCompatActivity implements View.OnCl
if (!TextUtils.isEmpty(cdb.getData().getRoadLicensePhoto())) {
Glide.with(con).load(cdb.getData().getRoadLicensePhoto()).into(img);
value1.setText(cdb.getData().getRoadLicense());
if (!carExist) {
submit.setBackgroundResource(R.drawable.bg_btn_grey);
upload_img.setText("已上传");
}
}
} else if (4 == type) {
if (!TextUtils.isEmpty(cdb.getData().getPolicyPhotoUrl())) {
Glide.with(con).load(cdb.getData().getPolicyPhotoUrl()).into(img);
value1.setText(cdb.getData().getInsuranceCompany());
value2.setText(cdb.getData().getInsuranceEndDay());
submit.setBackgroundResource(R.drawable.bg_btn_grey);
upload_img.setText("已上传");
}
@@ -527,6 +605,10 @@ public class PhotoCarActivity extends BaseAppCompatActivity implements View.OnCl
tvTips.setText(tips[type]);
tvSkip.setVisibility(isShowSkip[type] ? View.GONE : View.VISIBLE);
llInfo.setVisibility(isShowEdit[type] ? View.VISIBLE : View.GONE);
if (type == 4) {
llDate.setVisibility(View.VISIBLE);
title3.setText("保险公司");
}
}
@@ -14,7 +14,10 @@ import android.widget.Toast;
import androidx.annotation.Nullable;
import com.arpa.hndahesudintocctmsdriver.event.RefreshCarListEvent;
import com.arpa.hndahesudintocctmsdriver.event.VehicleEvent;
import com.arpa.hndahesudintocctmsdriver.util.alert.ToastUtil;
import com.dahe.mylibrary.utils.ToastUtils;
import com.google.gson.Gson;
import com.luck.picture.lib.PictureSelector;
import com.luck.picture.lib.config.PictureConfig;
@@ -38,6 +41,7 @@ import com.scwang.smart.refresh.layout.SmartRefreshLayout;
import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;
import java.io.File;
import java.util.ArrayList;
@@ -65,7 +69,7 @@ public class VehicleAuthActivity extends BaseAppCompatActivity {
CacheGroup.cacheList.remove(CAR_AUDIO);
}
if(CacheGroup.cacheList.get(WoDeFragment.VEHICLE_DEL)!=null){
Log.e("--res--",CacheGroup.cacheList.get(WoDeFragment.VEHICLE_DEL));
Log.e("--res--lijia",CacheGroup.cacheList.get(WoDeFragment.VEHICLE_DEL));
cdb=gson.fromJson(CacheGroup.cacheList.get(WoDeFragment.VEHICLE_DEL), CarDelBean.class);
if(cdb.getCode()==200){
initView(null);
@@ -79,6 +83,8 @@ public class VehicleAuthActivity extends BaseAppCompatActivity {
bb=gson.fromJson(CacheGroup.cacheList.get(DEL_CAR),BaseBean.class);
if (bb.getCode()==200) {
Toast.makeText(con,"删除成功",Toast.LENGTH_SHORT).show();
RefreshCarListEvent ve = new RefreshCarListEvent("");
EventBus.getDefault().post(ve);
finish();
}else{
Toast.makeText(con,"删除失败:"+bb.getMsg(),Toast.LENGTH_SHORT).show();
@@ -166,6 +172,13 @@ public class VehicleAuthActivity extends BaseAppCompatActivity {
private GetImageAlert gia=new GetImageAlert();
private boolean key1,key2,key3=false;
@Override
protected void onDestroy() {
super.onDestroy();
EventBus.getDefault().unregister(this);
}
@Override
public void initView(Object obj) {
super.initView(obj);
@@ -207,11 +220,12 @@ public class VehicleAuthActivity extends BaseAppCompatActivity {
RelativeLayout r5=v.findViewById(R.id.r5);
RelativeLayout r6=v.findViewById(R.id.r6);
RelativeLayout r7=v.findViewById(R.id.r7);
RelativeLayout r8=v.findViewById(R.id.r8);
View vs1=v.findViewById(R.id.vs1);
View vs2=v.findViewById(R.id.vs2);
r4.setVisibility(View.GONE);
r5.setVisibility(View.GONE);
vs1.setVisibility(View.GONE);
// vs1.setVisibility(View.GONE);
vs2.setVisibility(View.GONE);
if(!"".equals(carId) && cdb.getData().getIsTrailer()==1){
r4.setVisibility(View.VISIBLE);
@@ -301,6 +315,17 @@ public class VehicleAuthActivity extends BaseAppCompatActivity {
Toast.makeText(con,"请先绑定挂车",Toast.LENGTH_SHORT).show();
}
});
r8.setOnClickListener(v1->{
if(!"".equals(carId)){
Intent in = new Intent(con, PhotoCarActivity.class);
in.putExtra("type", 4);
in.putExtra("carId", carId);
con.startActivity(in);
}else{
Toast.makeText(con,"请先绑定行驶证",Toast.LENGTH_SHORT).show();
}
});
del.setOnClickListener(v13 -> {
new XPopup.Builder(con)
.isDestroyOnDismiss(true) //对于只使用一次的弹窗,推荐设置这个
@@ -384,7 +409,7 @@ public class VehicleAuthActivity extends BaseAppCompatActivity {
super.onResume();
}
@Subscribe
@Subscribe(threadMode = ThreadMode.MAIN, sticky = true)
public void processResult(VehicleEvent event) {
Log.e("-msg-",event.getMessage());
if(!"".equals(event.getMessage())) {
@@ -7,6 +7,7 @@ import android.graphics.Outline;
import android.location.Location;
import android.os.Bundle;
import android.os.Message;
import android.text.TextUtils;
import android.util.Log;
import android.view.Gravity;
import android.view.LayoutInflater;
@@ -240,7 +241,9 @@ public class HomeFragment extends BaseFragment {
in.putExtra("url", deb.getData().getIdCardUpdateUrl());
}
}
if (!"".equals(deb.getData().getDriverLicenseUpdateUrl()) || !"".equals(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().getInsuranceUpdateUrl())) {
new XToast<>(act)
.setContentView(R.layout.view_bc)
// 设置成可拖拽的
@@ -8,6 +8,7 @@ import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.text.Html;
import android.text.TextUtils;
import android.util.Log;
import android.widget.Button;
import android.widget.ImageButton;
@@ -102,14 +103,18 @@ public class HuoYunDelActivity extends BaseAppCompatActivity {
//Toast.makeText(con,"接单成功",Toast.LENGTH_SHORT).show();
customDialog.dismiss();
// EsignSdk.getInstance().startH5Activity(act, (String) bb.getData());
Intent intent = new Intent(this, H5Activity.class);
intent.putExtra("url", (String) bb.getData());
intent.putExtra("view_file", false);
startActivity(intent);
if (null==bb.getData()){
UiAuxiliary.homeRequest("接单");
Intent in = new Intent(con, StartYunDanActivity.class);
in.putExtra("id", "0");
startActivity(in);
finish();
}else{
Intent intent = new Intent(this, H5Activity.class);
intent.putExtra("url", (String) bb.getData());
intent.putExtra("view_file", false);
startActivity(intent);
}
//finish();
} else {
Toast.makeText(con, bb.getMsg(), Toast.LENGTH_SHORT).show();
@@ -19,6 +19,7 @@ import com.alct.mdp.callback.OnResultListener;
import com.alct.mdp.model.Goods;
import com.alct.mdp.model.Image;
import com.alct.mdp.model.Location;
import com.arpa.hndahesudintocctmsdriver.BuildConfig;
import com.arpa.hndahesudintocctmsdriver.bean.CarInfoBean;
import com.arpa.hndahesudintocctmsdriver.report.ALProcess;
import com.arpa.hndahesudintocctmsdriver.report.JTTProcess;
@@ -93,11 +94,15 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
switch (m.what) {
case RequsetCodeConstants.SUCCESS:
if (CacheGroup.cacheList.get("upload") != null) {
if (!isFinishing()&&customDialog!=null&&customDialog.isShowing()){
customDialog.dismiss();
}
Log.e("upload", CacheGroup.cacheList.get("upload"));
ub = gson.fromJson(CacheGroup.cacheList.remove("upload"), UploadBean.class);
if (ub.getCode() == 200) {
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);
res_img.setVisibility(View.VISIBLE);
img_delete.setVisibility(View.VISIBLE);
img_icon.setVisibility(View.GONE);
@@ -110,6 +115,9 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
for (int i = 0; i < TYPE_NAME.length; i++) {
if (CacheGroup.cacheList.get(TYPE_NAME[i]) != null) {
BaseBean bb = gson.fromJson(CacheGroup.cacheList.get(TYPE_NAME[i]), BaseBean.class);
if (!isFinishing()&&customDialog!=null&&customDialog.isShowing()){
customDialog.dismiss();
}
if (bb.getCode() == 200) {
if (index == 2) {
if (!keys){//装货回单
@@ -148,6 +156,9 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
hyr.uploadFile(new File(path));
}
} else {//识别失败后返回code500
if (!isFinishing()&&customDialog!=null&&customDialog.isShowing()){
customDialog.dismiss();
}
if (index == 0) {//装卸货车辆需要识别车牌号){
Toast.makeText(con, "装货照片包含车牌号、三分之二车身或者装卸货场景。", Toast.LENGTH_SHORT).show();
} else if (index == 1) {
@@ -190,7 +201,7 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
// if(index==1 || index==2){
// new OCRRequest().OCRPlateLicense(con,hd,new File(path));
// }
if (index == 0 || index == 1) {//装卸货车辆需要识别车牌号
if ((index == 0 || index == 1) && !BuildConfig.isTest) {//装卸货车辆需要识别车牌号,测试环境不校验车牌号
new OCRRequest().OCRCarPlateLicense(con, hd, new File(path));
} else {
hyr.uploadFile(new File(path));
@@ -327,6 +338,12 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
path = gia.getFile().getPath();
Log.e("图片地址:", path);
gia.dis();
if (customDialog!=null&&!customDialog.isShowing()){
customDialog = new CustomDialog(con, "网络请求中...");
customDialog.show();
}
ImageFileCompressUtil.imageFileCompress(con, new File(path), hd);
} else if (requestCode == PictureConfig.CHOOSE_REQUEST && resultCode == RESULT_OK) {
List<LocalMedia> imgs = PictureSelector.obtainMultipleResult(data);
@@ -340,6 +357,12 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
path = paths;
Log.e("图片地址:", path);
gia.dis();
if (customDialog!=null&&!customDialog.isShowing()){
customDialog = new CustomDialog(con, "网络请求中...");
customDialog.show();
}
ImageFileCompressUtil.imageFileCompress(con, new File(path), hd);
}
}
@@ -355,6 +378,10 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
// }
switch (index) {
case 0:
if (customDialog!=null&&!customDialog.isShowing()){
customDialog = new CustomDialog(con, "网络请求中...");
customDialog.show();
}
//装货
if (imgIds != null && imgIds.size() > 0) {
lub.setLatitude(lgdu.getLatitude() + "");
@@ -536,6 +563,9 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
@Override
public void onSuccess() {
if (!isFinishing()&&customDialog!=null&&customDialog.isShowing()){
customDialog.dismiss();
}
Log.e("上报安联", "装货照片上传成功");
Toast.makeText(con, "上传成功", Toast.LENGTH_SHORT).show();
finish();
@@ -568,6 +598,9 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
@Override
public void onSuccess() {
if (!isFinishing()&&customDialog!=null&&customDialog.isShowing()){
customDialog.dismiss();
}
Log.e("上报安联", "卸货照片上传成功");
Toast.makeText(con, "上传成功", Toast.LENGTH_SHORT).show();
finish();
@@ -601,6 +634,9 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
@Override
public void onSuccess() {
if (!isFinishing()&&customDialog!=null&&customDialog.isShowing()){
customDialog.dismiss();
}
Log.e("上报安联", "回单照片上传成功");
Toast.makeText(con, "上传成功", Toast.LENGTH_SHORT).show();
finish();
@@ -678,6 +714,9 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
@Override
public void onFailure(String s, String s1) {
Log.e("上报安联失败(装货):", s + s1);
if (!isFinishing()&&customDialog!=null&&customDialog.isShowing()){
customDialog.dismiss();
}
new MessageUtils().showCenMessage(con, s1);
}
});
@@ -715,6 +754,9 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
@Override
public void onFailure(String s, String s1) {
Log.e("上报安联失败(卸货):", s + s1);
if (!isFinishing()&&customDialog!=null&&customDialog.isShowing()){
customDialog.dismiss();
}
new MessageUtils().showCenMessage(con, s1);
}
});
@@ -1,8 +1,14 @@
package com.arpa.hndahesudintocctmsdriver.ui.login;
import android.content.Context;
import android.content.Intent;
import android.net.wifi.WifiManager;
import android.os.Build;
import android.os.Bundle;
import android.os.Message;
import android.provider.Settings;
import android.telecom.TelecomManager;
import android.telephony.TelephonyManager;
import android.text.SpannableStringBuilder;
import android.text.TextPaint;
import android.text.method.LinkMovementMethod;
@@ -38,6 +44,7 @@ import com.arpa.hndahesudintocctmsdriver.util.http.RequsetCodeConstants;
import com.arpa.hndahesudintocctmsdriver.util.statusbar.StatusBarUtil;
import com.arpa.hndahesudintocctmsdriver.util.view.BaseActivity;
import java.util.Locale;
import java.util.TimerTask;
import cn.jiguang.verifysdk.api.AuthPageEventListener;
@@ -146,7 +153,7 @@ public class LoginActivity extends BaseActivity {
ConfigBean cb = ConfigParts.getConfigParts(con);
if (cb != null) {
url1 = cb.getData().getUserUrl();
url2 = "https://agreement.dahehuoyun.com/huawei/#/private";
url2 = "http://agreement.dahehuoyun.com/currency/#/";
}
TextView tv_content = findViewById(R.id.tv_content);
String str = "我已阅读并同意相关服务条款和隐私政策《用户服务协议》和《隐私政策》";
@@ -138,8 +138,8 @@ public class WelcomeActivity extends BaseAppCompatActivity {
new XPopup.Builder(con)
.dismissOnBackPressed(false)
.dismissOnTouchOutside(false)
.asCustom(new AgreementAlert(con, "https://agreement.dahehuoyun.com/huawei/#/private",
"http://agreement.dahehuoyun.com/#/user", hd))
.asCustom(new AgreementAlert(con, "http://agreement.dahehuoyun.com/currency/#/",
"http://agreement.dahehuoyun.com/rule/serviceAgreement/dist/index.html#/", hd))
.show();
}
Glide.with(con)
@@ -18,6 +18,7 @@ import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.arpa.hndahesudintocctmsdriver.event.PersonEvent;
import com.arpa.hndahesudintocctmsdriver.event.RefreshCarListEvent;
import com.arpa.hndahesudintocctmsdriver.event.VehicleEvent;
import com.arpa.hndahesudintocctmsdriver.parts.ConfigParts;
import com.arpa.hndahesudintocctmsdriver.parts.StartOrderParts;
@@ -63,32 +64,32 @@ public class MyFragment extends BaseFragment {
private UserBean userBean;
private StartOrderBean sob;
private CarListBean clb;
private Gson gson=new Gson();
private Gson gson = new Gson();
private UserRequset ur;
@Override
public void msgMethod(Message m) {
super.msgMethod(m);
switch (m.what){
switch (m.what) {
case 200:
refreshLayout.finishRefresh();
if(CacheGroup.cacheList.get(WoDeFragment.VEHICLE_LIST)!=null){
clb=gson.fromJson(CacheGroup.cacheList.get(WoDeFragment.VEHICLE_LIST),CarListBean.class);
if(clb.getCode()==200){
if (CacheGroup.cacheList.get(WoDeFragment.VEHICLE_LIST) != null) {
clb = gson.fromJson(CacheGroup.cacheList.get(WoDeFragment.VEHICLE_LIST), CarListBean.class);
if (clb.getCode() == 200) {
initVehicleList(true);
}else{
Toast.makeText(con,clb.getRes(),Toast.LENGTH_LONG).show();
} else {
Toast.makeText(con, clb.getRes(), Toast.LENGTH_LONG).show();
initVehicleList(false);
}
CacheGroup.cacheList.remove(WoDeFragment.VEHICLE_LIST);
}
if (CacheGroup.cacheList.get("userdata")!=null){
userBean=gson.fromJson(CacheGroup.cacheList.get("userdata"), UserBean.class);
if(userBean.getCode()==200 ){
SPUtil.insSP(con,"data","userdata",CacheGroup.cacheList.get("userdata"));
if (CacheGroup.cacheList.get("userdata") != null) {
userBean = gson.fromJson(CacheGroup.cacheList.get("userdata"), UserBean.class);
if (userBean.getCode() == 200) {
SPUtil.insSP(con, "data", "userdata", CacheGroup.cacheList.get("userdata"));
initAuth();
}else{
Toast.makeText(con,userBean.getMsg(),Toast.LENGTH_SHORT).show();
} else {
Toast.makeText(con, userBean.getMsg(), Toast.LENGTH_SHORT).show();
}
CacheGroup.cacheList.remove("userdata");
}
@@ -100,12 +101,12 @@ public class MyFragment extends BaseFragment {
@org.jetbrains.annotations.Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable @org.jetbrains.annotations.Nullable ViewGroup container, @Nullable @org.jetbrains.annotations.Nullable Bundle savedInstanceState) {
root=inflater.inflate(R.layout.fragment_my,container,false);
con=root.getContext();
brv=root.findViewById(R.id.rv);
root = inflater.inflate(R.layout.fragment_my, container, false);
con = root.getContext();
brv = root.findViewById(R.id.rv);
EventBus.getDefault().register(this);
userBean= UserParts.getUser(con);
ur=new UserRequset(con,hd);
userBean = UserParts.getUser(con);
ur = new UserRequset(con, hd);
getRequest();
initId();
initRefreshLoad();
@@ -114,7 +115,7 @@ public class MyFragment extends BaseFragment {
}
public void initRefreshLoad() {
refreshLayout =root.findViewById(R.id.srl);
refreshLayout = root.findViewById(R.id.srl);
refreshLayout.setOnRefreshListener(refreshLayout -> {
getRequest();
});
@@ -123,7 +124,7 @@ public class MyFragment extends BaseFragment {
@Override
public void initView(Object obj) {
super.initView(obj);
brv_vehicle=root.findViewById(R.id.brv_vehicle);
brv_vehicle = root.findViewById(R.id.brv_vehicle);
ur.vehicleList("1");
}
@@ -131,83 +132,85 @@ public class MyFragment extends BaseFragment {
//执行中订单
//车辆信息
public void initVehicleList(boolean isSuccess){
public void initVehicleList(boolean isSuccess) {
//车辆信息
List<ManyBean> list_vehicle=new ArrayList<>();
List<ManyBean> list_vehicle = new ArrayList<>();
for (CarListBean.DataDTO datum : clb.getData()) {
list_vehicle.add(new ManyBean(datum,R.layout.my_item_vehicle));
list_vehicle.add(new ManyBean(datum, R.layout.my_item_vehicle));
}
if(list_vehicle.size()==0){
list_vehicle.add(new ManyBean(new Model(),R.layout.my_item_vehicle_null));
if (list_vehicle.size() == 0) {
list_vehicle.add(new ManyBean(new Model(), R.layout.my_item_vehicle_null));
}
brv_vehicle.creates(con,list_vehicle).setOnItemViewListener((position, o, v, layout) -> {
switch (layout){
brv_vehicle.creates(con, list_vehicle).setOnItemViewListener((position, o, v, layout) -> {
switch (layout) {
case R.layout.my_item_vehicle:
CarListBean.DataDTO cd= (CarListBean.DataDTO) o;
View br=v.findViewById(R.id.br);
if(position==(clb.getData().size()-1) && position!=2){
LinearLayout add_box=v.findViewById(R.id.add_box);
TextView add_no=v.findViewById(R.id.add_no);
CarListBean.DataDTO cd = (CarListBean.DataDTO) o;
View br = v.findViewById(R.id.br);
if (position == (clb.getData().size() - 1) && position != 2) {
LinearLayout add_box = v.findViewById(R.id.add_box);
TextView add_no = v.findViewById(R.id.add_no);
add_no.setVisibility(View.GONE);
add_box.setVisibility(View.VISIBLE);
br.setVisibility(View.GONE);
add_box.setOnClickListener(v1 -> {
Intent in=new Intent(con, VehicleAuthActivity.class);
in.putExtra("carId","");
Intent in = new Intent(con, VehicleAuthActivity.class);
in.putExtra("carId", "");
startActivity(in);
});
}
v.setOnClickListener(v1 -> {
Intent in=new Intent(con, VehicleAuthActivity.class);
in.putExtra("carId",cd.getCarId());
Intent in = new Intent(con, VehicleAuthActivity.class);
in.putExtra("carId", cd.getCarId());
startActivity(in);
});
break;
case R.layout.my_item_vehicle_null:
v.setOnClickListener(v12 -> {
Intent in=new Intent(con, VehicleAuthActivity.class);
in.putExtra("carId","");
Intent in = new Intent(con, VehicleAuthActivity.class);
in.putExtra("carId", "");
startActivity(in);
});
break;
default:break;
default:
break;
}
});
}
class Model{ }
class Model {
}
public void getRequest(){
sob= StartOrderParts.getStartOrder(con);
public void getRequest() {
sob = StartOrderParts.getStartOrder(con);
ur.User();
ur.vehicleList("1");
}
private LinearLayout onGetUser,onAllOrder,onAuth,onDriverHome;
private ImageView onContact,onOpinion,onUpdate,onSetUp;
private TextView name,phone;
private ImageView dang_auth,no_auth,name_auth;
private LinearLayout onGetUser, onAllOrder, onAuth, onDriverHome;
private ImageView onContact, onOpinion, onUpdate, onSetUp;
private TextView name, phone;
private ImageView dang_auth, no_auth, name_auth;
private LinearLayout auth_box;
private ImageView img_head;
public void initId(){
public void initId() {
//
name=root.findViewById(R.id.name);
phone=root.findViewById(R.id.phone);
dang_auth=root.findViewById(R.id.dang_auth);
no_auth=root.findViewById(R.id.no_auth);
name_auth=root.findViewById(R.id.name_auth);
auth_box=root.findViewById(R.id.auth_box);
name = root.findViewById(R.id.name);
phone = root.findViewById(R.id.phone);
dang_auth = root.findViewById(R.id.dang_auth);
no_auth = root.findViewById(R.id.no_auth);
name_auth = root.findViewById(R.id.name_auth);
auth_box = root.findViewById(R.id.auth_box);
//
onGetUser=root.findViewById(R.id.onGetUser);
onAllOrder=root.findViewById(R.id.onAllOrder);
onAuth=root.findViewById(R.id.onAuth);
onDriverHome=root.findViewById(R.id.onDriverHome);
onContact=root.findViewById(R.id.onContact);
onOpinion=root.findViewById(R.id.onOpinion);
onUpdate=root.findViewById(R.id.onUpdate);
onSetUp=root.findViewById(R.id.onSetUp);
img_head=root.findViewById(R.id.img_head);
onGetUser = root.findViewById(R.id.onGetUser);
onAllOrder = root.findViewById(R.id.onAllOrder);
onAuth = root.findViewById(R.id.onAuth);
onDriverHome = root.findViewById(R.id.onDriverHome);
onContact = root.findViewById(R.id.onContact);
onOpinion = root.findViewById(R.id.onOpinion);
onUpdate = root.findViewById(R.id.onUpdate);
onSetUp = root.findViewById(R.id.onSetUp);
img_head = root.findViewById(R.id.img_head);
//认证
no_auth.setOnClickListener(v -> startActivity(new Intent(con, PersonalAuthActivity.class)));
//用户信息
@@ -222,27 +225,27 @@ public class MyFragment extends BaseFragment {
.permissions(Manifest.permission.ACCESS_BACKGROUND_LOCATION)
.request((allGranted, grantedList, deniedList) -> {
if (allGranted) {
Intent in=new Intent(con, BusinessActivity.class);
in.putExtra("type","餐饮");
Intent in = new Intent(con, BusinessActivity.class);
in.putExtra("type", "餐饮");
startActivity(in);
} else {
Toast.makeText(getContext(),"请先开启定位权限",Toast.LENGTH_LONG).show();
Toast.makeText(getContext(), "请先开启定位权限", Toast.LENGTH_LONG).show();
}
});
});
//联系我们
onContact.setOnClickListener(v -> {
String serviceMobile="";
if(ConfigParts.getConfigParts(con)!=null){
serviceMobile=ConfigParts.getConfigParts(con).getData().getServiceMobile();
serviceMobile=StringUtil.isNull(serviceMobile,"");
String serviceMobile = "";
if (ConfigParts.getConfigParts(con) != null) {
serviceMobile = ConfigParts.getConfigParts(con).getData().getServiceMobile();
serviceMobile = StringUtil.isNull(serviceMobile, "");
}
String[] title={"平台客服:"+serviceMobile};
String[] value={serviceMobile};
String[] title = {"平台客服:" + serviceMobile};
String[] value = {serviceMobile};
new XPopup.Builder(con)
.isDarkTheme(false)
.isDestroyOnDismiss(true) //对于只使用一次的弹窗,推荐设置这个
.asCenterList("请选择",title,
.asCenterList("请选择", title,
(position1, text) -> {
Intent intent = new Intent(Intent.ACTION_DIAL);
Uri data = Uri.parse("tel:" + value[position1]);
@@ -253,36 +256,36 @@ public class MyFragment extends BaseFragment {
});
//咨询建议
onOpinion.setOnClickListener(v -> {
Intent in=new Intent(con, WebActivity.class);
in.putExtra("title","咨询建议");
in.putExtra("url","");
Intent in = new Intent(con, WebActivity.class);
in.putExtra("title", "咨询建议");
in.putExtra("url", "");
startActivity(in);
});
//检查更新
onUpdate.setOnClickListener(v -> Toast.makeText(con,"当前已经是最新版本",Toast.LENGTH_LONG).show());
onUpdate.setOnClickListener(v -> Toast.makeText(con, "当前已经是最新版本", Toast.LENGTH_LONG).show());
//系统设置
onSetUp.setOnClickListener(v -> startActivity(new Intent(con, SetupActivity.class)));
}
public void initAuth(){
if(userBean.getData()!=null){
name.setText(StringUtil.isNull(userBean.getData().getUname(),"未实名"));
phone.setText(StringUtil.isNull(userBean.getData().getRname(),""));
if(2==userBean.getData().getPartyMemberStatus()){
public void initAuth() {
if (userBean.getData() != null) {
name.setText(StringUtil.isNull(userBean.getData().getUname(), "未实名"));
phone.setText(StringUtil.isNull(userBean.getData().getRname(), ""));
if (2 == userBean.getData().getPartyMemberStatus()) {
}
if("1".equals(userBean.getData().getRealAuthentication())){
if ("1".equals(userBean.getData().getRealAuthentication())) {
}else{
} else {
}
if (!"".equals(userBean.getData().getHeadportraitUrl())){
if (!"".equals(userBean.getData().getHeadportraitUrl())) {
Glide.with(con).load(userBean.getData().getHeadportraitUrl()).into(img_head);
}
if(userBean!=null && 100003==userBean.getData().getAuditStatus()){
if (userBean != null && 100003 == userBean.getData().getAuditStatus()) {
auth_box.setVisibility(View.GONE);
no_auth.setVisibility(View.GONE);
}else{
} else {
auth_box.setVisibility(View.GONE);
no_auth.setVisibility(View.VISIBLE);
}
@@ -290,12 +293,19 @@ public class MyFragment extends BaseFragment {
}
@Subscribe
public void processResult(VehicleEvent event) {
Log.e("-msg-",event.getMessage());
if(!"".equals(event.getMessage())) {
public void processResult(VehicleEvent event) {
Log.e("-msg-", event.getMessage());
if (!"".equals(event.getMessage())) {
ur.vehicleList("1");
}
}
@Subscribe
public void refreshCarListEvent(RefreshCarListEvent event) {
Log.e("-msg-", event.getMessage());
ur.vehicleList("1");
}
@Subscribe
public void personResult(PersonEvent home) {
Log.e("-res-", home.getMessage());
@@ -35,7 +35,7 @@ public class SetupActivity extends BaseActivity {
String url2="";
String url3="";
String kefu="";
private RelativeLayout r1,r2,r3,r4,r5,r6,r7;
private RelativeLayout r1,r2,r3,r4,r5,r6,r7,r8;
@Override
public void msgMethod(Message m) {
@@ -73,8 +73,9 @@ public class SetupActivity extends BaseActivity {
ConfigBean cb= ConfigParts.getConfigParts(con);
if(cb!=null){
// url1=cb.getData().getUserUrl();
url1="https://agreement.dahehuoyun.com/huawei/#/private";
url2=cb.getData().getPrivateUrl();
url1="http://agreement.dahehuoyun.com/rule/serviceAgreement/dist/index.html#/";
// url2=cb.getData().getPrivateUrl();
url2="http://agreement.dahehuoyun.com/currency/#/";
kefu=cb.getData().getServiceMobile();
url3=cb.getData().getSecurityUrl();
}
@@ -85,6 +86,7 @@ public class SetupActivity extends BaseActivity {
r5=findViewById(R.id.r5);
r6=findViewById(R.id.r6);
r7=findViewById(R.id.r7);
r8=findViewById(R.id.r8);
ur=new UserRequset(con,hd);
initView(null);
}
@@ -118,6 +120,12 @@ public class SetupActivity extends BaseActivity {
in.putExtra("url","https://smlt.esign.cn/hmfbZoeeGQqv");
startActivity(in);
});
r8.setOnClickListener(v12 -> {
Intent in=new Intent(con,WebActivity.class);
in.putExtra("title","交易规则");
in.putExtra("url","http://agreement.dahehuoyun.com/rule/transactionRules/dist/index.html#/");
startActivity(in);
});
r6.setOnClickListener(v12 -> {
String[] title={"平台客服:"+kefu,"银行客服:95528","技术咨询:13460042961"};
String[] value={kefu,"95528","13460042961"};
@@ -5,6 +5,7 @@ import android.os.Bundle;
import android.os.Message;
import android.text.TextUtils;
import android.util.Log;
import android.view.View;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.TextView;
@@ -12,6 +13,8 @@ import android.widget.Toast;
import androidx.annotation.Nullable;
import com.arpa.hndahesudintocctmsdriver.weight.OnLimitClickHelper;
import com.arpa.hndahesudintocctmsdriver.weight.OnLimitClickListener;
import com.bumptech.glide.Glide;
import com.google.gson.Gson;
import com.arpa.hndahesudintocctmsdriver.R;
@@ -40,13 +43,13 @@ import java.util.List;
* @date 2021/8/26 19:06
* @description:
*/
public class UpBankActivity extends BaseAppCompatActivity {
public class UpBankActivity extends BaseAppCompatActivity implements OnLimitClickListener {
private ImageView up_bank_img;
private EditText bank_name,bank_number;
private EditText bank_name, bank_number;
private TextView submit;
private ImageView return_btn;
public GetImageAlert gia=new GetImageAlert();
public GetImageAlert gia = new GetImageAlert();
String path;
private OCRBankBean ib;
private WalletRequest qr;
@@ -55,35 +58,36 @@ public class UpBankActivity extends BaseAppCompatActivity {
@Override
public void msgMethod(Message m) {
super.msgMethod(m);
switch (m.what){
switch (m.what) {
case RequsetCodeConstants.SUCCESS:
if (CacheGroup.cacheList.get("OCR_BANK")!=null) {
ib=new Gson().fromJson(CacheGroup.cacheList.get("OCR_BANK"),OCRBankBean.class);
if(ib.getCode()==200){
if (CacheGroup.cacheList.get("OCR_BANK") != null) {
ib = new Gson().fromJson(CacheGroup.cacheList.get("OCR_BANK"), OCRBankBean.class);
if (ib.getCode() == 200) {
initView(null);
customDialog.dismiss();
WalletFragment.isInsBank=true;
}else{
Toast.makeText(con,ib.getMsg(),Toast.LENGTH_SHORT).show();
WalletFragment.isInsBank = true;
} else {
Toast.makeText(con, ib.getMsg(), Toast.LENGTH_SHORT).show();
}
CacheGroup.cacheList.remove("OCR_BANK");
}
if(CacheGroup.cacheList.get("insBank")!=null){
BaseBean bb=new Gson().fromJson(CacheGroup.cacheList.get("insBank"),BaseBean.class);
if(bb.getCode()==200){
Toast.makeText(con,"绑定成功",Toast.LENGTH_SHORT).show();
if (CacheGroup.cacheList.get("insBank") != null) {
BaseBean bb = new Gson().fromJson(CacheGroup.cacheList.get("insBank"), BaseBean.class);
if (bb.getCode() == 200) {
customDialog.dismiss();
Toast.makeText(con, "绑定成功", Toast.LENGTH_SHORT).show();
finish();
}else{
Toast.makeText(con,bb.getMsg(),Toast.LENGTH_SHORT).show();
} else {
Toast.makeText(con, bb.getMsg(), Toast.LENGTH_SHORT).show();
}
CacheGroup.cacheList.remove("insBank");
}
break;
case ImageFileCompressUtil.COMPRESS_SUCCESS:
customDialog=new CustomDialog(con, "上传识别中...");
customDialog = new CustomDialog(con, "上传识别中...");
customDialog.show();
path = (String) m.obj;
new OCRRequest().ORCBank(con,hd,new File(path));
new OCRRequest().ORCBank(con, hd, new File(path));
break;
}
}
@@ -95,24 +99,18 @@ public class UpBankActivity extends BaseAppCompatActivity {
super.onCreate(savedInstanceState);
StateStyleUtil.stateTextColor(this);
setContentView(R.layout.activity_bank_auth);
act=this;
con=this;
up_bank_img=findViewById(R.id.up_bank_img);
bank_name=findViewById(R.id.bank_name);
bank_number=findViewById(R.id.bank_number);
submit=findViewById(R.id.submit);
return_btn=findViewById(R.id.return_btn);
qr=new WalletRequest(con,hd);
act = this;
con = this;
up_bank_img = findViewById(R.id.up_bank_img);
bank_name = findViewById(R.id.bank_name);
bank_number = findViewById(R.id.bank_number);
submit = findViewById(R.id.submit);
return_btn = findViewById(R.id.return_btn);
qr = new WalletRequest(con, hd);
up_bank_img.setOnClickListener(v -> {
gia.showPopueWindow(this);
});
submit.setOnClickListener(v -> {
if(ib!=null){
submit();
}else{
Toast.makeText(con,"请先上传图片",Toast.LENGTH_SHORT).show();
}
});
submit.setOnClickListener(new OnLimitClickHelper(this));
return_btn.setOnClickListener(v -> {
finish();
});
@@ -129,11 +127,11 @@ public class UpBankActivity extends BaseAppCompatActivity {
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == 12 && resultCode == RESULT_OK) {
path=gia.getFile().getPath();
Log.e("图片地址:",path);
if (requestCode == 12 && resultCode == RESULT_OK) {
path = gia.getFile().getPath();
Log.e("图片地址:", path);
gia.dis();
ImageFileCompressUtil.imageFileCompress(con,new File(path),hd);
ImageFileCompressUtil.imageFileCompress(con, new File(path), hd);
} else if (requestCode == PictureConfig.CHOOSE_REQUEST && resultCode == RESULT_OK) {
List<LocalMedia> imgs = PictureSelector.obtainMultipleResult(data);
if (imgs != null && imgs.size() > 0) {
@@ -143,29 +141,43 @@ public class UpBankActivity extends BaseAppCompatActivity {
if (TextUtils.isEmpty(paths)) {
paths = image.getPath();
}
path=paths;
Log.e("图片地址:",path);
path = paths;
Log.e("图片地址:", path);
gia.dis();
ImageFileCompressUtil.imageFileCompress(con,new File(path),hd);
ImageFileCompressUtil.imageFileCompress(con, new File(path), hd);
}
}
}
public void submit(){
String bankName=bank_name.getText().toString().trim();
String bankNumber=bank_number.getText().toString().trim();
if("".equals(bankName) || "".equals(bankNumber)){
Toast.makeText(con,"请先补充完整的银行卡信息",Toast.LENGTH_LONG).show();
public void submit() {
customDialog = new CustomDialog(con, "上传中,请稍后...");
customDialog.show();
String bankName = bank_name.getText().toString().trim();
String bankNumber = bank_number.getText().toString().trim();
if ("".equals(bankName) || "".equals(bankNumber)) {
Toast.makeText(con, "请先补充完整的银行卡信息", Toast.LENGTH_LONG).show();
return;
}
InsBankInputBean ibib =new InsBankInputBean();
InsBankInputBean ibib = new InsBankInputBean();
ibib.setCardNo(bankNumber);
ibib.setCardType(Integer.parseInt(ib.getData().getBankCardType()));
ibib.setBankName(bankName);
ibib.setCardUserType(1);
ibib.setImageId(ib.getData().getId());
Log.e("-res-",new Gson().toJson(ibib));
Log.e("-res-", new Gson().toJson(ibib));
qr.insBankCard(ibib);
}
@Override
public void onClick(View view) {
switch (view.getId()) {
case R.id.submit:
if (ib != null) {
submit();
} else {
Toast.makeText(con, "请先上传图片", Toast.LENGTH_SHORT).show();
}
break;
}
}
}
@@ -0,0 +1,240 @@
package com.arpa.hndahesudintocctmsdriver.util;
import com.arpa.hndahesudintocctmsdriver.FileUtils;
import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
/**
* @ClassName FileIOUtils
* @Author john
* @Date 2024/3/29 09:50
* @Description TODO
*/
public class FileIOUtils {
private FileIOUtils() {
throw new UnsupportedOperationException("u can't instantiate me...");
}
private static final String LINE_SEP = System.getProperty("line.separator");
/**
* 将输入流写入文件
*
* @param filePath 路径
* @param is 输入流
* @return {@code true}: 写入成功<br>{@code false}: 写入失败
*/
public static boolean writeFileFromIS(String filePath, final InputStream is) {
return writeFileFromIS(FileUtils.getFileByPath(filePath), is, false);
}
/**
* 将输入流写入文件
*
* @param filePath 路径
* @param is 输入流
* @param append 是否追加在文件末
* @return {@code true}: 写入成功<br>{@code false}: 写入失败
*/
public static boolean writeFileFromIS(String filePath, final InputStream is, boolean append) {
return writeFileFromIS(FileUtils.getFileByPath(filePath), is, append);
}
/**
* 将输入流写入文件
*
* @param file 文件
* @param is 输入流
* @return {@code true}: 写入成功<br>{@code false}: 写入失败
*/
public static boolean writeFileFromIS(File file, final InputStream is) {
return writeFileFromIS(file, is, false);
}
/**
* 将输入流写入文件
*
* @param file 文件
* @param is 输入流
* @param append 是否追加在文件末
* @return {@code true}: 写入成功<br>{@code false}: 写入失败
*/
public static boolean writeFileFromIS(File file, final InputStream is, boolean append) {
if (!FileUtils.createOrExistsFile(file) || is == null) return false;
OutputStream os = null;
try {
os = new BufferedOutputStream(new FileOutputStream(file, append));
byte data[] = new byte[1024];
int len;
while ((len = is.read(data, 0, 1024)) != -1) {
os.write(data, 0, len);
}
return true;
} catch (IOException e) {
e.printStackTrace();
return false;
} finally {
try {
is.close();
os.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
/**
* 将字符串写入文件
*
* @param filePath 文件路径
* @param content 写入内容
* @return {@code true}: 写入成功<br>{@code false}: 写入失败
*/
public static boolean writeFileFromString(String filePath, String content) {
return writeFileFromString(FileUtils.getFileByPath(filePath), content, false);
}
/**
* 将字符串写入文件
*
* @param filePath 文件路径
* @param content 写入内容
* @param append 是否追加在文件末
* @return {@code true}: 写入成功<br>{@code false}: 写入失败
*/
public static boolean writeFileFromString(String filePath, String content, boolean append) {
return writeFileFromString(FileUtils.getFileByPath(filePath), content, append);
}
/**
* 将字符串写入文件
*
* @param file 文件
* @param content 写入内容
* @return {@code true}: 写入成功<br>{@code false}: 写入失败
*/
public static boolean writeFileFromString(File file, String content) {
return writeFileFromString(file, content, false);
}
/**
* 将字符串写入文件
*
* @param file 文件
* @param content 写入内容
* @param append 是否追加在文件末
* @return {@code true}: 写入成功<br>{@code false}: 写入失败
*/
public static boolean writeFileFromString(File file, String content, boolean append) {
if (file == null || content == null) return false;
if (!FileUtils.createOrExistsFile(file)) return false;
BufferedWriter bw = null;
try {
bw = new BufferedWriter(new FileWriter(file, append));
bw.write(content);
bw.newLine();
return true;
} catch (IOException e) {
e.printStackTrace();
return false;
} finally {
try {
bw.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
/**
* 读取文件到字符串中
*
* @param filePath 文件路径
* @return 字符串
*/
public static String readFile2String(String filePath) {
return readFile2String(FileUtils.getFileByPath(filePath), null);
}
/**
* 读取文件到字符串中
*
* @param filePath 文件路径
* @param charsetName 编码格式
* @return 字符串
*/
public static String readFile2String(String filePath, String charsetName) {
return readFile2String(FileUtils.getFileByPath(filePath), charsetName);
}
/**
* 读取文件到字符串中
*
* @param file 文件
* @return 字符串
*/
public static String readFile2String(File file) {
return readFile2String(file, null);
}
/**
* 读取文件到字符串中
*
* @param file 文件
* @param charsetName 编码格式
* @return 字符串
*/
public static String readFile2String(File file, String charsetName) {
if (!FileUtils.isFileExists(file)) return null;
BufferedReader reader = null;
try {
StringBuilder sb = new StringBuilder();
if (isSpace(charsetName)) {
reader = new BufferedReader(new InputStreamReader(new FileInputStream(file)));
} else {
reader = new BufferedReader(new InputStreamReader(new FileInputStream(file), charsetName));
}
String line;
while ((line = reader.readLine()) != null) {
sb.append(line).append(LINE_SEP);
}
// delete the last line separator
return sb.delete(sb.length() - LINE_SEP.length(), sb.length()).toString();
} catch (IOException e) {
e.printStackTrace();
return null;
} finally {
try {
reader.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
private static boolean isSpace(String s) {
if (s == null) return true;
for (int i = 0, len = s.length(); i < len; ++i) {
if (!Character.isWhitespace(s.charAt(i))) {
return false;
}
}
return true;
}
}
@@ -3,6 +3,7 @@ package com.arpa.hndahesudintocctmsdriver.util.http;
import android.content.Context;
import com.arpa.hndahesudintocctmsdriver.util.app.VersionUtil;
import com.dahe.mylibrary.utils.AppUtils;
import java.io.File;
@@ -41,6 +42,7 @@ public class OkHttpUtil {
.post(body)
.headers(hb.build())
.addHeader("Version", VersionUtil.getVersion(con))
.addHeader("VersionCode",String.valueOf(AppUtils.getAppVersionCode()))
//.addHeader("sign",sign)
.removeHeader("User-Agent")
.addHeader("User-Agent",GetUtil.getUserAgent(con))
@@ -71,6 +73,7 @@ public class OkHttpUtil {
.addHeader("Authorization", token)
.addHeader("Content-Type", "application/json")
.addHeader("Version", VersionUtil.getVersion(con))
.addHeader("VersionCode",String.valueOf(AppUtils.getAppVersionCode()))
//.addHeader("sign",sign)
.removeHeader("User-Agent")
.addHeader("User-Agent",GetUtil.getUserAgent(con))
@@ -86,6 +89,7 @@ public class OkHttpUtil {
.url(od.getUrl())
.get()
.headers(hb.build())
.addHeader("VersionCode",String.valueOf(AppUtils.getAppVersionCode()))
.build();
return request;
}
@@ -99,6 +103,7 @@ public class OkHttpUtil {
Request request = new Request.Builder()
.url(od.getUrl())
.addHeader("Authorization", token)
.addHeader("VersionCode",String.valueOf(AppUtils.getAppVersionCode()))
.get()
.headers(hb.build())
.build();
@@ -129,6 +134,7 @@ public class OkHttpUtil {
.url(od.getUrl())
.method("POST", body)
.addHeader("Authorization", token)
.addHeader("VersionCode",String.valueOf(AppUtils.getAppVersionCode()))
.addHeader("Cookie", "JSESSIONID=NqpqKQstwceQurcNK5hjl4GnTgiF4eSzZSo5a1rz")
.build();
return request;
@@ -145,23 +151,26 @@ public class OkHttpUtil {
.url(od.getUrl())
.method("POST", body)
.addHeader("Authorization", token)
.addHeader("VersionCode",String.valueOf(AppUtils.getAppVersionCode()))
.addHeader("Cookie", "JSESSIONID=NqpqKQstwceQurcNK5hjl4GnTgiF4eSzZSo5a1rz")
.build();
return request;
}
public static Request postFiles(OkDate od,File file,String token,String carId,String carNum) {
public static Request postFiles(OkDate od,File file,String token,String carId,String carNum,boolean isSave) {
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder()
.setType(MultipartBody.FORM)
.addFormDataPart("file",file.getPath(),RequestBody.create(MediaType.parse("application/octet-stream"), file))
.addFormDataPart("carId",carId)
.addFormDataPart("carNum",carNum)
.addFormDataPart("isSave",isSave?"0":"1")
.build();
Request request = new Request.Builder()
.url(od.getUrl())
.method("POST", body)
.addHeader("Authorization", token)
.addHeader("VersionCode",String.valueOf(AppUtils.getAppVersionCode()))
.addHeader("Cookie", "JSESSIONID=NqpqKQstwceQurcNK5hjl4GnTgiF4eSzZSo5a1rz")
.build();
return request;
@@ -9,6 +9,8 @@ import android.provider.MediaStore;
import androidx.core.content.FileProvider;
import com.dahe.mylibrary.utils.AppUtils;
import java.io.File;
import java.io.IOException;
import java.text.SimpleDateFormat;
@@ -39,7 +41,7 @@ public class ImageGetUtil {
if(imageFile!=null){
if(Build.VERSION.SDK_INT>= Build.VERSION_CODES.N){
/*7.0以上要通过FileProvider将File转化为Uri*/
uri = FileProvider.getUriForFile(act.getApplicationContext(),"com.arpa.hndahesudintocctmsdriver.fileprovider",imageFile);
uri = FileProvider.getUriForFile(act.getApplicationContext(), AppUtils.getAppPackageName()+".fileprovider",imageFile);
}else {
/*7.0以下则直接使用Uri的fromFile方法将File转化为Uri*/
uri = Uri.fromFile(imageFile);
@@ -8,7 +8,9 @@ import com.amap.api.location.AMapLocation;
import com.amap.api.location.AMapLocationClient;
import com.amap.api.location.AMapLocationClientOption;
import com.amap.api.location.AMapLocationListener;
import com.arpa.hndahesudintocctmsdriver.util.cache.CacheGroup;
import com.arpa.hndahesudintocctmsdriver.util.msg.MsgUtil;
import com.google.gson.Gson;
import java.text.SimpleDateFormat;
import java.util.Date;
@@ -74,6 +76,7 @@ public class LocationGDUtil {
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date date = new Date(aMapLocation.getTime());
df.format(date);
CacheGroup.cacheList.put("getLocation",new Gson().toJson(aMapLocation));
MsgUtil.addHdMsgWat(hd,RES);
if (mLocationClient!=null) {
mLocationClient.onDestroy();
@@ -0,0 +1,38 @@
package com.arpa.hndahesudintocctmsdriver.weight;
import android.view.View;
import android.widget.Toast;
import com.arpa.hndahesudintocctmsdriver.util.alert.ToastUtil;
import com.dahe.mylibrary.utils.ToastUtils;
import java.util.Calendar;
/**
* @ClassName OnLimitClickHelper
* @Author john
* @Date 2024/4/22 14:28
* @Description TODO
*/
public class OnLimitClickHelper implements View.OnClickListener {
public static final int LIMIT_TIME = 2000;
private long lastClickTime = 0;
private OnLimitClickListener onLimitClickListener = null;
public OnLimitClickHelper(OnLimitClickListener onLimitClickListener){
this.onLimitClickListener = onLimitClickListener;
}
@Override
public void onClick(View v) {
long curTime = Calendar.getInstance().getTimeInMillis();
if (curTime - lastClickTime > LIMIT_TIME) {
lastClickTime = curTime;
if(onLimitClickListener != null){
onLimitClickListener.onClick(v);
}
}else{
ToastUtils.showToast(v.getContext(),"点击速度过快,请稍后重试");
}
}
}
@@ -0,0 +1,17 @@
package com.arpa.hndahesudintocctmsdriver.weight;
import android.view.View;
/**
* @ClassName OnLimitClickListener
* @Author john
* @Date 2024/4/22 14:28
* @Description TODO
*/
public interface OnLimitClickListener {
/**
* 按钮点击事件
* @param view
*/
void onClick(View view);
}
@@ -163,20 +163,20 @@
android:textColor="#ffc4c4ce"
android:textSize="@dimen/sp_13"
/>
<TextView
android:id="@+id/value2"
android:layout_alignParentRight="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#ff999999"
android:textSize="@dimen/sp_13"
android:maxLines="1"
android:hint="点击进行手动输入"
android:ellipsize="end"
android:gravity="right"
android:layout_alignParentRight="true"
android:layout_marginLeft="@dimen/dp_30"
android:background="@null"
/>
android:ellipsize="end"
android:gravity="right"
android:hint="点击进行手动输入"
android:maxLines="1"
android:textColor="#ff999999"
android:textSize="@dimen/sp_13" />
</RelativeLayout>
</LinearLayout>
<TextView
@@ -382,5 +382,38 @@
/>
</LinearLayout>
<RelativeLayout
android:id="@+id/r8"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:layout_marginTop="@dimen/dp_20"
android:layout_marginBottom="@dimen/dp_20"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="交强险保单"
android:textColor="#ff000000"
android:textSize="@dimen/sp_15"
/>
</LinearLayout>
<ImageView
android:layout_width="@dimen/dp_6"
android:layout_height="@dimen/dp_10"
android:src="@mipmap/chevron"
android:scaleType="fitXY"
android:background="@null"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"/>
</RelativeLayout>
<View
android:layout_width="match_parent"
android:layout_height="@dimen/dp_2"
android:background="#F6F6F9"/>
</LinearLayout>
</RelativeLayout>
+50 -3
View File
@@ -81,7 +81,7 @@
android:id="@+id/zjimg_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_19"
android:layout_marginTop="@dimen/dp_16"
android:text="从业资格证照片"
android:textColor="#ff333333"
android:textSize="@dimen/sp_15" />
@@ -91,7 +91,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginBottom="@dimen/dp_19"
android:layout_marginBottom="@dimen/dp_16"
android:text="点击上传图片"
android:textColor="@color/theme_color"
android:textSize="@dimen/sp_15" />
@@ -100,7 +100,7 @@
</androidx.cardview.widget.CardView>
<LinearLayout
android:visibility="gone"
android:id="@+id/llInfo"
android:layout_width="match_parent"
android:layout_height="wrap_content"
@@ -137,6 +137,8 @@
android:orientation="vertical"
android:padding="@dimen/dp_14">
<RelativeLayout
android:id="@+id/cow1"
@@ -162,10 +164,55 @@
android:gravity="right"
android:hint="点击进行手动输入"
android:maxLines="1"
android:singleLine="true"
android:textColor="#ff999999"
android:textSize="@dimen/sp_13" />
</RelativeLayout>
<LinearLayout
android:id="@+id/llDate"
android:visibility="gone"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
>
<View
android:layout_marginTop="@dimen/dp_10"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_1"
android:background="@drawable/bottom_xu"/>
<RelativeLayout
android:id="@+id/rlDate"
android:layout_marginTop="@dimen/dp_10"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/name2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="截止日期"
android:textColor="#ffc4c4ce"
android:textSize="@dimen/sp_13"
/>
<TextView
android:layout_toRightOf="@+id/name2"
android:id="@+id/value2"
android:layout_alignParentRight="true"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="#ff999999"
android:textSize="@dimen/sp_13"
android:maxLines="1"
android:hint="请选择截止日期"
android:gravity="right"
android:ellipsize="end"
android:layout_marginLeft="@dimen/dp_10"
/>
</RelativeLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>
@@ -103,6 +103,7 @@
</LinearLayout>
<LinearLayout
android:visibility="gone"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_30"
@@ -131,6 +132,7 @@
</LinearLayout>
<LinearLayout
android:visibility="gone"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_30"
+38 -1
View File
@@ -146,6 +146,35 @@
android:src="@mipmap/chevron" />
</RelativeLayout>
<View
android:layout_width="match_parent"
android:layout_height="@dimen/dp_2"
android:background="#F6F6F9" />
<RelativeLayout
android:id="@+id/r8"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="@dimen/dp_20"
android:paddingBottom="@dimen/dp_20">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="交易规则"
android:textColor="#ff000000"
android:textSize="@dimen/sp_15" />
<ImageView
android:layout_width="@dimen/dp_4"
android:layout_height="@dimen/dp_8"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:background="@null"
android:scaleType="fitXY"
android:src="@mipmap/chevron" />
</RelativeLayout>
<View
android:layout_width="match_parent"
android:layout_height="@dimen/dp_2"
@@ -275,11 +304,19 @@
android:scaleType="fitXY"
android:src="@mipmap/chevron" />
</RelativeLayout>
<View
android:layout_width="match_parent"
android:layout_height="@dimen/dp_2"
android:background="#F6F6F9" />
<TextView
android:layout_marginTop="@dimen/dp_20"
android:gravity="center"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="ICP备案号:豫ICP备09025418号-24A"
/>
</LinearLayout>
</androidx.core.widget.NestedScrollView>
Binary file not shown.

After

Width:  |  Height:  |  Size: 606 KiB

+1 -1
View File
@@ -1,6 +1,6 @@
#Mon Jul 12 10:16:49 CST 2021
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-bin.zip
distributionUrl=https\://mirrors.cloud.tencent.com/gradle/gradle-6.7.1-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
@@ -29,6 +29,24 @@ public class ToastUtils {
}
}
public static void showLongToast(Context mContext, String message) {
if (!TextUtils.isEmpty(message)) {
// if ( mToast != null) {
// mToast.cancel();
// }
// mToast = Toast.makeText(mContext, message, Toast.LENGTH_SHORT);
// mToast.show();
if (mToast == null) {
mToast = Toast.makeText(mContext, message, Toast.LENGTH_LONG);
} else {
mToast.setText(message);
}
mToast.show();
}
}
public static void cancelToast(){
if (mToast!=null)
mToast.cancel();