@@ -39,6 +39,7 @@ import com.huntersun.vkyes.etcopencard.project.ui.activity.after.CommonDealSucce | |||
import com.huntersun.vkyes.etcopencard.project.ui.activity.after.TopEntrapmentActivity; | |||
import com.huntersun.vkyes.etcopencard.project.ui.activity.after.TransferOwnershipStep3Activity; | |||
import com.huntersun.vkyes.etcopencard.project.utils.Constants; | |||
import com.huntersun.vkyes.etcopencard.project.utils.FileUtils; | |||
import com.huntersun.vkyes.etcopencard.project.utils.FunHelper; | |||
import com.huntersun.vkyes.etcopencard.src.aop.SingleClick; | |||
import com.huntersun.vkyes.etcopencard.src.app.AppActivity; | |||
@@ -429,6 +430,20 @@ public class VehicleInformationActivity extends AppActivity { | |||
@SuppressLint({"NewApi", "LogNotTimber"}) | |||
@SingleClick | |||
public void onImage(View view) { | |||
/*if (view != binding.image3){//车头照 | |||
HashMap<String,String> params = new HashMap<>(); | |||
params.put("filename","CSMSN_OCR_VEHICLE_REQ_"); | |||
params.put("source","1"); | |||
params.put("agencyId","52010106004"); | |||
params.put("imageType", view == binding.image1 ? "1" : "2");//1正,2反 | |||
params.put("fileName", System.currentTimeMillis() + ".png"); | |||
FileUtils.uploadOcrDrivingLicense(this, true, params, new FileUtils.OnOcrUploadCallback() { | |||
@Override | |||
public void onSuccess(ResultBean.BizContent bizContent) { | |||
} | |||
}); | |||
}*/ | |||
ImageSelectActivity.start(this, data -> { | |||
file = new File(data.get(0)); | |||
if (view != binding.image3) { |
@@ -2,9 +2,6 @@ package com.huntersun.vkyes.etcopencard.project.ui.activity.after; | |||
import android.annotation.SuppressLint; | |||
import android.os.Bundle; | |||
import android.text.TextUtils; | |||
import android.util.Log; | |||
import android.view.Gravity; | |||
import android.view.View; | |||
import android.view.animation.AnimationUtils; | |||
import android.widget.EditText; | |||
@@ -12,42 +9,27 @@ import android.widget.ImageView; | |||
import android.widget.TextView; | |||
import com.alibaba.fastjson.JSON; | |||
import com.google.gson.Gson; | |||
import com.huntersun.vkyes.etcopencard.R; | |||
import com.huntersun.vkyes.etcopencard.databinding.ActivityEditCarInfoStep2Binding; | |||
import com.huntersun.vkyes.etcopencard.project.api.Api; | |||
import com.huntersun.vkyes.etcopencard.project.api.Converter; | |||
import com.huntersun.vkyes.etcopencard.project.api.FatherBean; | |||
import com.huntersun.vkyes.etcopencard.project.api.MyRetrofit; | |||
import com.huntersun.vkyes.etcopencard.project.api.RequestParameters; | |||
import com.huntersun.vkyes.etcopencard.project.api.Result; | |||
import com.huntersun.vkyes.etcopencard.project.api.bean.EnumBean; | |||
import com.huntersun.vkyes.etcopencard.project.api.bean.IFCode; | |||
import com.huntersun.vkyes.etcopencard.project.api.bean.ResultBean; | |||
import com.huntersun.vkyes.etcopencard.project.api.bean.SendTheVerificationCodeBean; | |||
import com.huntersun.vkyes.etcopencard.project.dialog.ConfirmDialog; | |||
import com.huntersun.vkyes.etcopencard.project.dialog.IDTypeDialog; | |||
import com.huntersun.vkyes.etcopencard.project.tool.FileSizeUtil; | |||
import com.huntersun.vkyes.etcopencard.project.tool.MyShared; | |||
import com.huntersun.vkyes.etcopencard.project.tool.QRCode; | |||
import com.huntersun.vkyes.etcopencard.project.utils.FileUtils; | |||
import com.huntersun.vkyes.etcopencard.project.utils.FunHelper; | |||
import com.huntersun.vkyes.etcopencard.src.aop.SingleClick; | |||
import com.huntersun.vkyes.etcopencard.src.app.AppActivity; | |||
import com.huntersun.vkyes.etcopencard.src.http.glide.GlideApp; | |||
import com.huntersun.vkyes.etcopencard.src.ui.activity.ImageSelectActivity; | |||
import com.huntersun.vkyes.etcopencard.src.ui.dialog.DateDialog; | |||
import com.huntersun.vkyes.etcopencard.src.ui.dialog.MenuDialog; | |||
import java.io.File; | |||
import java.time.format.DateTimeFormatter; | |||
import java.util.Arrays; | |||
import java.util.HashMap; | |||
import java.util.List; | |||
import java.util.Map; | |||
import retrofit2.Response; | |||
import top.zibin.luban.Luban; | |||
import top.zibin.luban.OnCompressListener; | |||
/** | |||
* Date :2023-03-25 | |||
@@ -203,7 +185,27 @@ public class EditCarInfoStep2Activity extends AppActivity { | |||
@SuppressLint({"NewApi", "LogNotTimber"}) | |||
@SingleClick | |||
private void onOCRImg(int type, ImageView imageView) { | |||
ImageSelectActivity.start(this, data -> { | |||
HashMap<String,String> params = new HashMap<>(); | |||
params.put("source","1"); | |||
params.put("agencyId","52010106004"); | |||
params.put("imageType",String.valueOf(type));//1正,2反 | |||
params.put("fileName",System.currentTimeMillis() + ".png");//1正,2反 | |||
FileUtils.uploadOcrIDCard(this, false, params, new FileUtils.OnOcrUploadCallback() { | |||
@Override | |||
public void onSuccess(ResultBean.BizContent bizContent) { | |||
GlideApp.with(getActivity()).load(bizContent.getImageUrl()).into(imageView); | |||
if (type == 1) {//用户正面 | |||
carImg1 = bizContent.getImageUrl(); | |||
binding.et2.setText(bizContent.getName()); | |||
binding.et4.setText(bizContent.getIdno()); | |||
} else if (type == 2) {//用户反面-过期时间 | |||
carImg2 = bizContent.getImageUrl(); | |||
} | |||
} | |||
}); | |||
/* ImageSelectActivity.start(this, data -> { | |||
file = new File(data.get(0)); | |||
Luban.with(this).load(file).ignoreBy(100).setCompressListener(new OnCompressListener() { | |||
@Override | |||
@@ -220,12 +222,12 @@ public class EditCarInfoStep2Activity extends AppActivity { | |||
public void onError(Throwable e) { | |||
} | |||
}).launch(); | |||
}); | |||
});*/ | |||
} | |||
@SuppressLint({"LogNotTimber", "NewApi"}) | |||
public void OCRspot(int type, String base64, ImageView imageView, String mAvatarUrl, File outputFile) { | |||
FatherBean<SendTheVerificationCodeBean> fatherBean = new FatherBean<>(); | |||
/*FatherBean<SendTheVerificationCodeBean> fatherBean = new FatherBean<>(); | |||
fatherBean.bizContent = new SendTheVerificationCodeBean(); | |||
fatherBean.bizContent.setSource("1"); | |||
fatherBean.bizContent.setAgencyId("52010106004"); | |||
@@ -268,7 +270,7 @@ public class EditCarInfoStep2Activity extends AppActivity { | |||
}, 500); | |||
} | |||
} | |||
}); | |||
});*/ | |||
} | |||
@Override |
@@ -10,29 +10,22 @@ import android.widget.ImageView; | |||
import android.widget.TextView; | |||
import com.alibaba.fastjson.JSON; | |||
import com.google.gson.Gson; | |||
import com.huntersun.vkyes.etcopencard.R; | |||
import com.huntersun.vkyes.etcopencard.databinding.ActivityEditUserInfoStep2Binding; | |||
import com.huntersun.vkyes.etcopencard.project.api.Api; | |||
import com.huntersun.vkyes.etcopencard.project.api.Converter; | |||
import com.huntersun.vkyes.etcopencard.project.api.FatherBean; | |||
import com.huntersun.vkyes.etcopencard.project.api.MyRetrofit; | |||
import com.huntersun.vkyes.etcopencard.project.api.RequestParameters; | |||
import com.huntersun.vkyes.etcopencard.project.api.Result; | |||
import com.huntersun.vkyes.etcopencard.project.api.bean.EnumBean; | |||
import com.huntersun.vkyes.etcopencard.project.api.bean.IFCode; | |||
import com.huntersun.vkyes.etcopencard.project.api.bean.ResultBean; | |||
import com.huntersun.vkyes.etcopencard.project.api.bean.SendTheVerificationCodeBean; | |||
import com.huntersun.vkyes.etcopencard.project.dialog.ConfirmDialog; | |||
import com.huntersun.vkyes.etcopencard.project.dialog.IDTypeDialog; | |||
import com.huntersun.vkyes.etcopencard.project.tool.MyShared; | |||
import com.huntersun.vkyes.etcopencard.project.tool.QRCode; | |||
import com.huntersun.vkyes.etcopencard.project.utils.FileUtils; | |||
import com.huntersun.vkyes.etcopencard.project.utils.FunHelper; | |||
import com.huntersun.vkyes.etcopencard.src.aop.SingleClick; | |||
import com.huntersun.vkyes.etcopencard.src.app.AppActivity; | |||
import com.huntersun.vkyes.etcopencard.src.http.glide.GlideApp; | |||
import com.huntersun.vkyes.etcopencard.src.other.CodeCountDown; | |||
import com.huntersun.vkyes.etcopencard.src.ui.activity.ImageSelectActivity; | |||
import com.huntersun.vkyes.etcopencard.src.ui.dialog.DateDialog; | |||
import java.io.File; | |||
@@ -40,8 +33,6 @@ import java.util.HashMap; | |||
import java.util.Map; | |||
import retrofit2.Response; | |||
import top.zibin.luban.Luban; | |||
import top.zibin.luban.OnCompressListener; | |||
/** | |||
* Date :2023-03-25 | |||
@@ -359,33 +350,17 @@ public class EditUserInfoStep2Activity extends AppActivity { | |||
* @param type 3-营业执照 | |||
*/ | |||
public void onImage(int type, ImageView imageView) { | |||
ImageSelectActivity.start(this, data -> { | |||
FatherBean<SendTheVerificationCodeBean> fatherBean = new FatherBean<>(); | |||
fatherBean.bizContent = new SendTheVerificationCodeBean(); | |||
fatherBean.bizContent.setFileBase64(QRCode.imageToBase64(data.get(0))); | |||
showDialog("图片文件上传中..."); | |||
RequestParameters parameters1 = new RequestParameters(IFCode.IFCODE17, new Gson().toJson(fatherBean.bizContent)); | |||
new MyRetrofit().getRetrofit().create(Api.class).message2(parameters1).enqueue(new Converter<Result>(true) { | |||
@Override | |||
protected void onSuccess(ResultBean resultBean, ResultBean.BizContent bizContent1) { | |||
ResultBean.ProductInfo decVehInfo = Gson().fromJson(String.valueOf(resultBean.getBizContent()), ResultBean.ProductInfo.class); | |||
hideDialog(); | |||
GlideApp.with(getActivity()).load(data.get(0)).into(imageView); | |||
if (!TextUtils.isEmpty(decVehInfo.data.getUrl())) { | |||
String img = decVehInfo.data.getUrl(); | |||
if (type == 3) { | |||
unitImg1 = img; | |||
} | |||
FileUtils.uploadGeneralImage(this, false, null, new FileUtils.OnUploadCallback() { | |||
@Override | |||
public void onSuccess(ResultBean.ProductInfo bizContent) { | |||
if (!TextUtils.isEmpty(bizContent.data.getUrl())) { | |||
GlideApp.with(getActivity()).load(bizContent.data.getUrl()).into(imageView); | |||
String img = bizContent.data.getUrl(); | |||
if (type == 3) { | |||
unitImg1 = img; | |||
} | |||
} | |||
@Override | |||
public void onError(String err, Response<Result> resp) { | |||
super.onError(err, resp); | |||
hideDialog(); | |||
} | |||
}); | |||
} | |||
}); | |||
} | |||
@@ -398,7 +373,47 @@ public class EditUserInfoStep2Activity extends AppActivity { | |||
@SuppressLint({"NewApi", "LogNotTimber"}) | |||
@SingleClick | |||
private void onOCRImg(int type, ImageView imageView) { | |||
ImageSelectActivity.start(this, data -> { | |||
HashMap<String,String> params = new HashMap<>(); | |||
params.put("source","1"); | |||
params.put("agencyId","52010106004"); | |||
params.put("fileName",System.currentTimeMillis() + ".png"); | |||
if (type == 3 || type == 4){ | |||
params.put("imageType","1");//1正,2反 | |||
}else{ | |||
params.put("imageType",String.valueOf(type));//1正,2反 | |||
} | |||
FileUtils.uploadOcrIDCard(this, false, params, new FileUtils.OnOcrUploadCallback() { | |||
@Override | |||
public void onSuccess(ResultBean.BizContent bizContent1) { | |||
GlideApp.with(getActivity()).load(bizContent1.getImageUrl()).into(imageView); | |||
if (type == 1) {//用户正面 | |||
userImg1 = bizContent1.getImageUrl(); | |||
binding.etUserName.setText(bizContent1.getName()); | |||
binding.etUserIDCard.setText(bizContent1.getIdno()); | |||
binding.etUserSex.setText(bizContent1.getGender()); | |||
binding.etAddr.setText(bizContent1.getAddress()); | |||
} else if (type == 2) {//用户反面-过期时间 | |||
userImg2 = bizContent1.getImageUrl(); | |||
if (bizContent1.getEnddate().length() == 8) { | |||
binding.tvUserIdTime.setText(bizContent1.getEnddate().substring(0, 4) + "-" + bizContent1.getEnddate().substring(4, 6) | |||
+ "-" + bizContent1.getEnddate().substring(6, 8)); | |||
} | |||
}else if (type == 3){//营业执照\经办人正面 | |||
unitImg1 = bizContent1.getImageUrl(); | |||
/*binding.etUnitName.setText(bizContent1.getName()); | |||
binding.etUnitNumber.setText(bizContent1.getIdno());*/ | |||
binding.etUnitUserName.setText(bizContent1.getName()); | |||
binding.etUnitUserIds.setText(bizContent1.getIdno()); | |||
}else if (type == 4) {//国徽面 | |||
unitImg2 = bizContent1.getImageUrl(); | |||
/* binding.etUnitUserName.setText(bizContent1.getName()); | |||
binding.etUnitUserIds.setText(bizContent1.getIdno());*/ | |||
} | |||
} | |||
}); | |||
/*ImageSelectActivity.start(this, data -> { | |||
file = new File(data.get(0)); | |||
Luban.with(this).load(file).ignoreBy(100).setCompressListener(new OnCompressListener() { | |||
@Override | |||
@@ -416,14 +431,14 @@ public class EditUserInfoStep2Activity extends AppActivity { | |||
public void onError(Throwable e) { | |||
} | |||
}).launch(); | |||
}); | |||
});*/ | |||
} | |||
private File file = null; | |||
@SuppressLint({"LogNotTimber", "NewApi"}) | |||
public void OCRspot(int type, String base64, ImageView imageView, String mAvatarUrl, File outputFile) { | |||
FatherBean<SendTheVerificationCodeBean> fatherBean = new FatherBean<>(); | |||
/*FatherBean<SendTheVerificationCodeBean> fatherBean = new FatherBean<>(); | |||
fatherBean.bizContent = new SendTheVerificationCodeBean(); | |||
fatherBean.bizContent.setSource("1"); | |||
fatherBean.bizContent.setAgencyId("52010106004"); | |||
@@ -457,15 +472,15 @@ public class EditUserInfoStep2Activity extends AppActivity { | |||
} | |||
}else if (type == 3){//营业执照\经办人正面 | |||
unitImg1 = bizContent1.getImageUrl(); | |||
/*binding.etUnitName.setText(bizContent1.getName()); | |||
binding.etUnitNumber.setText(bizContent1.getIdno());*/ | |||
*//*binding.etUnitName.setText(bizContent1.getName()); | |||
binding.etUnitNumber.setText(bizContent1.getIdno());*//* | |||
binding.etUnitUserName.setText(bizContent1.getName()); | |||
binding.etUnitUserIds.setText(bizContent1.getIdno()); | |||
}else if (type == 4) {//国徽面 | |||
unitImg2 = bizContent1.getImageUrl(); | |||
/* binding.etUnitUserName.setText(bizContent1.getName()); | |||
binding.etUnitUserIds.setText(bizContent1.getIdno());*/ | |||
*//* binding.etUnitUserName.setText(bizContent1.getName()); | |||
binding.etUnitUserIds.setText(bizContent1.getIdno());*//* | |||
} | |||
if (outputFile != null) { | |||
postDelayed(() -> { | |||
@@ -488,7 +503,7 @@ public class EditUserInfoStep2Activity extends AppActivity { | |||
}, 500); | |||
} | |||
} | |||
}); | |||
});*/ | |||
} | |||
@Override |
@@ -6,11 +6,9 @@ import android.view.View; | |||
import com.alibaba.fastjson.JSON; | |||
import com.google.gson.Gson; | |||
import com.huntersun.vky.obublelib.box.BoxManagers; | |||
import com.huntersun.vkyes.etcopencard.databinding.ActivityLogoutEtcStep2Binding; | |||
import com.huntersun.vkyes.etcopencard.project.api.Api; | |||
import com.huntersun.vkyes.etcopencard.project.api.Converter; | |||
import com.huntersun.vkyes.etcopencard.project.api.FatherBean; | |||
import com.huntersun.vkyes.etcopencard.project.api.MyRetrofit; | |||
import com.huntersun.vkyes.etcopencard.project.api.RequestParameters; | |||
import com.huntersun.vkyes.etcopencard.project.api.Result; | |||
@@ -21,13 +19,12 @@ import com.huntersun.vkyes.etcopencard.project.api.bean.SendTheVerificationCodeB | |||
import com.huntersun.vkyes.etcopencard.project.bluetooth.BluetoothWriteCardWriteTab; | |||
import com.huntersun.vkyes.etcopencard.project.dialog.ReasonListDialog; | |||
import com.huntersun.vkyes.etcopencard.project.tool.MyShared; | |||
import com.huntersun.vkyes.etcopencard.project.tool.QRCode; | |||
import com.huntersun.vkyes.etcopencard.project.utils.FileUtils; | |||
import com.huntersun.vkyes.etcopencard.project.utils.FunHelper; | |||
import com.huntersun.vkyes.etcopencard.src.aop.SingleClick; | |||
import com.huntersun.vkyes.etcopencard.src.app.AppActivity; | |||
import com.huntersun.vkyes.etcopencard.src.http.glide.GlideApp; | |||
import com.huntersun.vkyes.etcopencard.src.other.CodeCountDown; | |||
import com.huntersun.vkyes.etcopencard.src.ui.activity.ImageSelectActivity; | |||
import java.util.HashMap; | |||
import java.util.Map; | |||
@@ -416,30 +413,15 @@ public class LogoutEtcStep2Activity extends AppActivity { | |||
* 选择上传剪裁图片 | |||
*/ | |||
public void onImage() { | |||
ImageSelectActivity.start(this, data -> { | |||
FatherBean<SendTheVerificationCodeBean> fatherBean = new FatherBean<>(); | |||
fatherBean.bizContent = new SendTheVerificationCodeBean(); | |||
fatherBean.bizContent.setFileBase64(QRCode.imageToBase64(data.get(0))); | |||
showDialog("图片文件上传中..."); | |||
RequestParameters parameters1 = new RequestParameters(IFCode.IFCODE17, new Gson().toJson(fatherBean.bizContent)); | |||
new MyRetrofit().getRetrofit().create(Api.class).message2(parameters1).enqueue(new Converter<Result>(true) { | |||
@Override | |||
protected void onSuccess(ResultBean resultBean, ResultBean.BizContent bizContent1) { | |||
ResultBean.ProductInfo decVehInfo = Gson().fromJson(String.valueOf(resultBean.getBizContent()), ResultBean.ProductInfo.class); | |||
hideDialog(); | |||
GlideApp.with(getActivity()).load(data.get(0)) .into(binding.ivClipImg); | |||
if (!TextUtils.isEmpty(decVehInfo.data.getUrl())) { | |||
ivClipImg = decVehInfo.data.getUrl(); | |||
} | |||
} | |||
@Override | |||
public void onError(String err, Response<Result> resp) { | |||
super.onError(err, resp); | |||
hideDialog(); | |||
FileUtils.uploadGeneralImage(this, true, null, new FileUtils.OnUploadCallback() { | |||
@Override | |||
public void onSuccess(ResultBean.ProductInfo bizContent) { | |||
String url = bizContent.data.getUrl(); | |||
if (!TextUtils.isEmpty(url)) { | |||
GlideApp.with(getActivity()).load(url) .into(binding.ivClipImg); | |||
ivClipImg = url; | |||
} | |||
}); | |||
} | |||
}); | |||
} | |||
@@ -5,6 +5,8 @@ import android.text.TextUtils; | |||
import android.view.View; | |||
import android.widget.ImageView; | |||
import com.alibaba.fastjson.JSON; | |||
import com.blankj.utilcode.util.LogUtils; | |||
import com.google.gson.Gson; | |||
import com.huntersun.vky.obublelib.box.BoxManagers; | |||
import com.huntersun.vkyes.etcopencard.databinding.ActivityObuActivationUploadBinding; | |||
@@ -22,6 +24,7 @@ import com.huntersun.vkyes.etcopencard.project.copapply.ObuActivation; | |||
import com.huntersun.vkyes.etcopencard.project.tool.MyShared; | |||
import com.huntersun.vkyes.etcopencard.project.tool.QRCode; | |||
import com.huntersun.vkyes.etcopencard.project.utils.Constants; | |||
import com.huntersun.vkyes.etcopencard.project.utils.FileUtils; | |||
import com.huntersun.vkyes.etcopencard.project.utils.FunHelper; | |||
import com.huntersun.vkyes.etcopencard.src.app.AppActivity; | |||
import com.huntersun.vkyes.etcopencard.src.http.glide.GlideApp; | |||
@@ -141,37 +144,21 @@ public class ObuActivationUploadActivity extends AppActivity { | |||
* @param type 1-车头照 2-车身45° 3-安装照 | |||
*/ | |||
public void onImage(ImageView imageView,int type) { | |||
ImageSelectActivity.start(this, data -> { | |||
FatherBean<SendTheVerificationCodeBean> fatherBean = new FatherBean<>(); | |||
fatherBean.bizContent = new SendTheVerificationCodeBean(); | |||
fatherBean.bizContent.setFileBase64(QRCode.imageToBase64(data.get(0))); | |||
showDialog("图片文件上传中..."); | |||
RequestParameters parameters1 = new RequestParameters(IFCode.IFCODE17, new Gson().toJson(fatherBean.bizContent)); | |||
new MyRetrofit().getRetrofit().create(Api.class).message2(parameters1).enqueue(new Converter<Result>(true) { | |||
@Override | |||
protected void onSuccess(ResultBean resultBean, ResultBean.BizContent bizContent1) { | |||
ResultBean.ProductInfo decVehInfo = Gson().fromJson(String.valueOf(resultBean.getBizContent()), ResultBean.ProductInfo.class); | |||
hideDialog(); | |||
GlideApp.with(getActivity()).load(data.get(0)).into(imageView); | |||
if (!TextUtils.isEmpty(decVehInfo.data.getUrl())) { | |||
String url = decVehInfo.data.getUrl(); | |||
if (type == 1){ | |||
ivImg1 = url; | |||
}else if (type == 2){ | |||
ivImg2 = url; | |||
}else if (type == 3){ | |||
ivImg3 = url; | |||
} | |||
FileUtils.uploadGeneralImage(ObuActivationUploadActivity.this, false,null,new FileUtils.OnUploadCallback() { | |||
@Override | |||
public void onSuccess(ResultBean.ProductInfo productInfo) { | |||
if (!TextUtils.isEmpty(productInfo.data.getUrl())) { | |||
String url = productInfo.data.getUrl(); | |||
GlideApp.with(getActivity()).load(url).into(imageView); | |||
if (type == 1){//车头照 | |||
ivImg1 = url; | |||
}else if (type == 2){//车身45° | |||
ivImg2 = url; | |||
}else if (type == 3){//安装照 | |||
ivImg3 = url; | |||
} | |||
} | |||
@Override | |||
public void onError(String err, Response<Result> resp) { | |||
super.onError(err, resp); | |||
hideDialog(); | |||
} | |||
}); | |||
} | |||
}); | |||
} | |||
} |
@@ -7,6 +7,7 @@ import android.graphics.BitmapFactory; | |||
import android.os.Build; | |||
import android.os.Environment; | |||
import android.text.TextUtils; | |||
import android.widget.ImageView; | |||
import com.alibaba.fastjson.JSON; | |||
import com.blankj.utilcode.util.LogUtils; | |||
@@ -75,7 +76,6 @@ public class FileUtils { | |||
new MyRetrofit().getRetrofit().create(Api.class).message2(parameters1).enqueue(new Converter<Result>(true) { | |||
@Override | |||
protected void onSuccess(ResultBean resultBean, ResultBean.BizContent bizContent1) { | |||
if (mDialog != null) { | |||
mDialog.dismiss(); | |||
} | |||
@@ -114,7 +114,6 @@ public class FileUtils { | |||
public void onCompressResult(String fileBase64, File file) { | |||
BaseDialog mDialog = new WaitDialog.Builder(mContext).setCancelable(false).setMessage("证件信息识别中...").create(); | |||
mDialog.show(); | |||
finalParams.put("imageBase64", fileBase64); | |||
MyRetrofit.newInstance(IFCode.IFCODE15, finalParams, new MyRetrofit.ReturnResult() { | |||
@Override | |||
@@ -240,7 +239,7 @@ public class FileUtils { | |||
File file = new File(data.get(0)); | |||
if (!comPress){//不压缩 | |||
if (callback != null) { | |||
callback.onCompressResult(QRCode.imageToBase64(file.getPath()), file); | |||
mContext.postDelayed(() -> callback.onCompressResult(QRCode.imageToBase64(file.getPath()), file), 200); | |||
} | |||
return; | |||
} | |||
@@ -258,7 +257,7 @@ public class FileUtils { | |||
//压缩成功后调用,返回压缩后的图片文件 | |||
LogUtils.i("压缩后:", "onStart: =============" + FileSizeUtil.getFileOrFilesSize(file.getPath(), 2)); | |||
if (callback != null) { | |||
callback.onCompressResult(QRCode.imageToBase64(file.getPath()), file); | |||
mContext.postDelayed(() -> callback.onCompressResult(QRCode.imageToBase64(file.getPath()), file), 200); | |||
} | |||
} | |||