身份证驾驶证添加查看大图
This commit is contained in:
@@ -238,7 +238,7 @@ public class OssServiceUtil {
|
||||
}
|
||||
|
||||
//初始化
|
||||
number = 1;
|
||||
number = 0;
|
||||
success.clear();
|
||||
failure.clear();
|
||||
for (int i = 0; i < localFiles.size(); i++) {
|
||||
@@ -255,7 +255,7 @@ public class OssServiceUtil {
|
||||
oss.asyncPutObject(put, new OSSCompletedCallback<PutObjectRequest, PutObjectResult>() {
|
||||
@Override
|
||||
public void onSuccess(PutObjectRequest request, final PutObjectResult result) {
|
||||
|
||||
number++;
|
||||
String aliPath = OssConfigBean.BUCKET_BASE_URL + OssConfigBean.BUCKET_OBJECT + name;
|
||||
success.add(aliPath);
|
||||
if (number == localFiles.size()) {
|
||||
@@ -270,7 +270,7 @@ public class OssServiceUtil {
|
||||
//返回 上传路径,以及失败的路径
|
||||
callback.onOssSuccess(success, failure);
|
||||
}
|
||||
number++;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -58,7 +58,7 @@ class HomeActivity : BaseActivity<ActivityHomeBinding>(), OnTabSelectListener,
|
||||
|
||||
override fun initView(savedInstanceState: Bundle?) {
|
||||
|
||||
|
||||
EventBus.getDefault().register(this);
|
||||
|
||||
binding.homeTabLayout.run {
|
||||
setTabData(mTabEntities)
|
||||
@@ -150,19 +150,15 @@ class HomeActivity : BaseActivity<ActivityHomeBinding>(), OnTabSelectListener,
|
||||
override fun onPageScrollStateChanged(state: Int) {
|
||||
}
|
||||
|
||||
override fun onStart() {
|
||||
super.onStart()
|
||||
EventBus.getDefault().register(this);
|
||||
}
|
||||
|
||||
override fun onStop() {
|
||||
super.onStop()
|
||||
EventBus.getDefault().unregister(this);
|
||||
}
|
||||
@Subscribe
|
||||
fun eventStatu(event: GoWaybillEvent) {
|
||||
binding.homeTabLayout.currentTab = event.statu
|
||||
binding.homeNoScrollViewPager.currentItem = event.statu
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
super.onDestroy()
|
||||
EventBus.getDefault().unregister(this);
|
||||
}
|
||||
|
||||
}
|
||||
+55
-36
@@ -1,6 +1,7 @@
|
||||
package com.arpa.hndahesudintocctmsdriver.ui.account.authperson
|
||||
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
import com.arpa.hndahesudintocctmsdriver.R
|
||||
import com.arpa.hndahesudintocctmsdriver.base.AppConfig
|
||||
import com.arpa.hndahesudintocctmsdriver.bean.UpDriverInfoBean
|
||||
@@ -139,56 +140,74 @@ class AuthDriverActivity : BaseActivity<ActivityAuthDriverBinding>() {
|
||||
|
||||
private fun selFrontPic() {
|
||||
|
||||
OcrUtils.getInstance().ocrDriver(mContext, this) { picPath, result ->
|
||||
if (result?.data?.face == null) {
|
||||
ToastUtils.showToast(mContext, "请选择正确证件照片")
|
||||
return@ocrDriver
|
||||
}
|
||||
result?.data?.face?.data.let {
|
||||
ImageLoader.getInstance()
|
||||
.loadRoundImage(mContext, picPath.locPic, 12, binding.ivFront)
|
||||
driverInfoBean.licensePhotoFaceUrl = picPath.picPath
|
||||
it?.run {
|
||||
driverInfoBean.run {
|
||||
licenseFirstGetDate = initialIssueDate
|
||||
licenseApproveOrganization =
|
||||
issueAuthority //发证机关
|
||||
}
|
||||
binding.run {
|
||||
etName.setText(it.name)
|
||||
etId.setText(it.licenseNumber)
|
||||
tvCarType.text = it.approvedType
|
||||
if (validPeriod.contains("至")) {
|
||||
val split = validPeriod.split("至")
|
||||
tvStart.text = split[0]
|
||||
tvEnd.text =
|
||||
if (split.size == 2) split[1] else ""
|
||||
if (driverInfoBean.licensePhotoFaceUrl.isNullOrEmpty()){
|
||||
OcrUtils.getInstance().ocrDriver(mContext, this) { picPath, result ->
|
||||
if (result?.data?.face == null) {
|
||||
ToastUtils.showToast(mContext, "请选择正确证件照片")
|
||||
return@ocrDriver
|
||||
}
|
||||
result?.data?.face?.data.let {
|
||||
ImageLoader.getInstance()
|
||||
.loadRoundImage(mContext, picPath.locPic, 12, binding.ivFront)
|
||||
driverInfoBean.licensePhotoFaceUrl = picPath.picPath
|
||||
binding.tvChangeFront.visibility = View.VISIBLE
|
||||
it?.run {
|
||||
driverInfoBean.run {
|
||||
licenseFirstGetDate = initialIssueDate
|
||||
licenseApproveOrganization =
|
||||
issueAuthority //发证机关
|
||||
}
|
||||
binding.run {
|
||||
etName.setText(it.name)
|
||||
etId.setText(it.licenseNumber)
|
||||
tvCarType.text = it.approvedType
|
||||
if (validPeriod.contains("至")) {
|
||||
val split = validPeriod.split("至")
|
||||
tvStart.text = split[0]
|
||||
tvEnd.text =
|
||||
if (split.size == 2) split[1] else ""
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}else{
|
||||
CommonPopUtils.getInstance().showOnePic(
|
||||
mContext,
|
||||
binding.ivFront, driverInfoBean.licensePhotoFaceUrl
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
private fun selBackPic() {
|
||||
|
||||
OcrUtils.getInstance().ocrDriver(mContext, this) { picPath, result ->
|
||||
if (result?.data?.back == null) {
|
||||
ToastUtils.showToast(mContext, "请选择正确证件照片")
|
||||
return@ocrDriver
|
||||
}
|
||||
result?.data?.back?.data.let {
|
||||
ImageLoader.getInstance()
|
||||
.loadRoundImage(mContext, picPath.locPic, 12, binding.ivBack)
|
||||
driverInfoBean.licensePhotoBackUrl = picPath.picPath
|
||||
it?.run {
|
||||
backLicName = it.name
|
||||
driverInfoBean.licenseRecordNumber = recordNumber
|
||||
if (driverInfoBean.licensePhotoBackUrl.isNullOrEmpty()){
|
||||
OcrUtils.getInstance().ocrDriver(mContext, this) { picPath, result ->
|
||||
if (result?.data?.back == null) {
|
||||
ToastUtils.showToast(mContext, "请选择正确证件照片")
|
||||
return@ocrDriver
|
||||
}
|
||||
result?.data?.back?.data.let {
|
||||
ImageLoader.getInstance()
|
||||
.loadRoundImage(mContext, picPath.locPic, 12, binding.ivBack)
|
||||
driverInfoBean.licensePhotoBackUrl = picPath.picPath
|
||||
binding.tvChangeBack.visibility = View.VISIBLE
|
||||
it?.run {
|
||||
backLicName = it.name
|
||||
driverInfoBean.licenseRecordNumber = recordNumber
|
||||
}
|
||||
}
|
||||
}
|
||||
}else{
|
||||
CommonPopUtils.getInstance().showOnePic(
|
||||
mContext,
|
||||
binding.ivBack, driverInfoBean.licensePhotoBackUrl
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
+70
-50
@@ -1,6 +1,7 @@
|
||||
package com.arpa.hndahesudintocctmsdriver.ui.account.authperson
|
||||
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
import com.alibaba.idst.nui.DateUtil.DEFAULT_FORMAT_DATE
|
||||
import com.arpa.hndahesudintocctmsdriver.R
|
||||
import com.arpa.hndahesudintocctmsdriver.base.AppConfig
|
||||
@@ -10,6 +11,7 @@ import com.arpa.hndahesudintocctmsdriver.net.BaseObserver
|
||||
import com.arpa.hndahesudintocctmsdriver.net.DataManager
|
||||
import com.arpa.hndahesudintocctmsdriver.net.RxHttpCallBack
|
||||
import com.arpa.hndahesudintocctmsdriver.ui.HomeActivity
|
||||
import com.arpa.hndahesudintocctmsdriver.utils.CommonPopUtils
|
||||
import com.arpa.hndahesudintocctmsdriver.utils.OcrUtils
|
||||
import com.arpa.hndahesudintocctmsdriver.utils.SPUtils
|
||||
import com.arpa.mylibrary.base.BaseActivity
|
||||
@@ -103,70 +105,88 @@ class AuthPersonActivity : BaseActivity<ActivityAuthPersonBinding>() {
|
||||
}
|
||||
|
||||
ivFront.setOnClickListener {
|
||||
OcrUtils.getInstance()
|
||||
.ocrPerson(mContext, this@AuthPersonActivity) { picPath, result ->
|
||||
if (result?.data?.face == null) {
|
||||
ToastUtils.showToast(mContext, "请选择正确证件照片")
|
||||
return@ocrPerson
|
||||
}
|
||||
if (perInfoBean.idcardFrontUrl.isNullOrBlank()){
|
||||
OcrUtils.getInstance()
|
||||
.ocrPerson(mContext, this@AuthPersonActivity) { picPath, result ->
|
||||
if (result?.data?.face == null) {
|
||||
ToastUtils.showToast(mContext, "请选择正确证件照片")
|
||||
return@ocrPerson
|
||||
}
|
||||
|
||||
ImageLoader.getInstance()
|
||||
.loadRoundImage(mContext, picPath.locPic, 12, ivFront)
|
||||
perInfoBean.idcardFrontUrl = picPath.picPath
|
||||
result?.data?.face?.data.let {
|
||||
it?.run {
|
||||
perInfoBean.run {
|
||||
idcardNo = idNumber
|
||||
idcardName = name
|
||||
idcardAddress = address
|
||||
idcardEthnicity = ethnicity
|
||||
idcardSex = if (sex == "男") "0" else "1"
|
||||
ImageLoader.getInstance()
|
||||
.loadRoundImage(mContext, picPath.locPic, 12, ivFront)
|
||||
tvFrontSeeBig.visibility = View.VISIBLE
|
||||
perInfoBean.idcardFrontUrl = picPath.picPath
|
||||
result?.data?.face?.data.let {
|
||||
it?.run {
|
||||
perInfoBean.run {
|
||||
idcardNo = idNumber
|
||||
idcardName = name
|
||||
idcardAddress = address
|
||||
idcardEthnicity = ethnicity
|
||||
idcardSex = if (sex == "男") "0" else "1"
|
||||
}
|
||||
}
|
||||
binding.run {
|
||||
etName.setText(it?.name)
|
||||
etId.setText(it?.idNumber)
|
||||
}
|
||||
}
|
||||
binding.run {
|
||||
etName.setText(it?.name)
|
||||
etId.setText(it?.idNumber)
|
||||
}
|
||||
}
|
||||
}
|
||||
}else{
|
||||
CommonPopUtils.getInstance().showOnePic(
|
||||
mContext,
|
||||
ivFront, perInfoBean.idcardFrontUrl
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
ivBack.setOnClickListener {
|
||||
OcrUtils.getInstance()
|
||||
.ocrPerson(mContext, this@AuthPersonActivity) { picPath, result ->
|
||||
if (perInfoBean.idcardBackUrl.isNullOrBlank()){
|
||||
OcrUtils.getInstance()
|
||||
.ocrPerson(mContext, this@AuthPersonActivity) { picPath, result ->
|
||||
|
||||
if (result?.data?.back == null) {
|
||||
ToastUtils.showToast(mContext, "请选择正确证件照片")
|
||||
return@ocrPerson
|
||||
}
|
||||
if (result?.data?.back == null) {
|
||||
ToastUtils.showToast(mContext, "请选择正确证件照片")
|
||||
return@ocrPerson
|
||||
}
|
||||
|
||||
perInfoBean.idcardBackUrl = picPath.picPath
|
||||
ImageLoader.getInstance()
|
||||
.loadRoundImage(mContext, picPath.locPic, 12, ivBack)
|
||||
result?.data?.back?.let {
|
||||
if (it.data.validPeriod?.contains("-") == true) {
|
||||
val split = it.data.validPeriod.split("-")
|
||||
binding.run {
|
||||
tvStart.text =
|
||||
TimeUtil.changeDateFormat(split[0])
|
||||
tvEnd.text =
|
||||
if (split.size == 2) TimeUtil.changeDateFormat(
|
||||
split[1]
|
||||
) else ""
|
||||
perInfoBean.idcardBackUrl = picPath.picPath
|
||||
ImageLoader.getInstance()
|
||||
.loadRoundImage(mContext, picPath.locPic, 12, ivBack)
|
||||
tvBackSeeBig.visibility = View.VISIBLE
|
||||
result?.data?.back?.let {
|
||||
if (it.data.validPeriod?.contains("-") == true) {
|
||||
val split = it.data.validPeriod.split("-")
|
||||
binding.run {
|
||||
tvStart.text =
|
||||
TimeUtil.changeDateFormat(split[0])
|
||||
tvEnd.text =
|
||||
if (split.size == 2) TimeUtil.changeDateFormat(
|
||||
split[1]
|
||||
) else ""
|
||||
}
|
||||
}
|
||||
|
||||
if (it.data.validPeriod?.contains("长期") == true) {
|
||||
val split = it.data.validPeriod.split("长期")
|
||||
binding.run {
|
||||
tvStart.text =
|
||||
TimeUtil.changeDateFormat(split[0])
|
||||
tvEnd.text = "长期"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (it.data.validPeriod?.contains("长期") == true) {
|
||||
val split = it.data.validPeriod.split("长期")
|
||||
binding.run {
|
||||
tvStart.text =
|
||||
TimeUtil.changeDateFormat(split[0])
|
||||
tvEnd.text = "长期"
|
||||
}
|
||||
}
|
||||
}
|
||||
}else{
|
||||
CommonPopUtils.getInstance().showOnePic(
|
||||
mContext,
|
||||
ivBack, perInfoBean.idcardBackUrl
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+29
-3
@@ -2,6 +2,7 @@ package com.arpa.hndahesudintocctmsdriver.ui.account.authperson
|
||||
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
import android.widget.ImageView
|
||||
import com.arpa.hndahesudintocctmsdriver.R
|
||||
import com.arpa.hndahesudintocctmsdriver.base.AppConfig
|
||||
import com.arpa.hndahesudintocctmsdriver.databinding.ActivityAuthDriverBinding
|
||||
@@ -69,10 +70,20 @@ class EditDriverActivity : BaseActivity<ActivityAuthDriverBinding>() {
|
||||
}
|
||||
|
||||
ivFront.setOnClickListener {
|
||||
selFrontPic()
|
||||
|
||||
seeBigPic(binding.ivFront, driverInfoBean.licensePhotoFaceUrl)
|
||||
}
|
||||
|
||||
ivBack.setOnClickListener {
|
||||
|
||||
seeBigPic(binding.ivBack, driverInfoBean.licensePhotoBackUrl)
|
||||
}
|
||||
|
||||
tvChangeFront.setOnClickListener {
|
||||
selFrontPic()
|
||||
}
|
||||
|
||||
tvChangeBack.setOnClickListener {
|
||||
selBackPic()
|
||||
}
|
||||
|
||||
@@ -97,8 +108,8 @@ class EditDriverActivity : BaseActivity<ActivityAuthDriverBinding>() {
|
||||
tvCarType.isEnabled = false
|
||||
tvStart.isEnabled = false
|
||||
tvEnd.isEnabled = false
|
||||
ivFront.isEnabled = false
|
||||
ivBack.isEnabled = false
|
||||
// ivFront.isEnabled = false
|
||||
// ivBack.isEnabled = false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -109,6 +120,12 @@ class EditDriverActivity : BaseActivity<ActivityAuthDriverBinding>() {
|
||||
tvStart.text = driverInfoBean.licenseEffectiveStart
|
||||
tvEnd.text = driverInfoBean.licenseEffectiveEnd
|
||||
tvCarType.text = driverInfoBean.licenseType
|
||||
|
||||
tvChangeFront.visibility =
|
||||
if (driverInfoBean.licensePhotoFaceUrl.isNullOrEmpty() || isOnlyShow) View.GONE else View.VISIBLE
|
||||
tvChangeBack.visibility =
|
||||
if (driverInfoBean.licensePhotoBackUrl.isNullOrEmpty() || isOnlyShow) View.GONE else View.VISIBLE
|
||||
|
||||
ImageLoader.getInstance()
|
||||
.loadRoundImage(
|
||||
mContext,
|
||||
@@ -184,6 +201,7 @@ class EditDriverActivity : BaseActivity<ActivityAuthDriverBinding>() {
|
||||
|
||||
private fun selFrontPic() {
|
||||
|
||||
|
||||
OcrUtils.getInstance().ocrDriver(mContext, this) { picPath, result ->
|
||||
if (result?.data?.face == null) {
|
||||
ToastUtils.showToast(mContext, "请选择正确证件照片")
|
||||
@@ -220,6 +238,7 @@ class EditDriverActivity : BaseActivity<ActivityAuthDriverBinding>() {
|
||||
|
||||
private fun selBackPic() {
|
||||
|
||||
|
||||
OcrUtils.getInstance().ocrDriver(mContext, this) { picPath, result ->
|
||||
if (result?.data?.back == null) {
|
||||
ToastUtils.showToast(mContext, "请选择正确证件照片")
|
||||
@@ -238,6 +257,13 @@ class EditDriverActivity : BaseActivity<ActivityAuthDriverBinding>() {
|
||||
|
||||
}
|
||||
|
||||
private fun seeBigPic(imageView: ImageView,picPath:String){
|
||||
CommonPopUtils.getInstance().showOnePic(
|
||||
mContext,
|
||||
imageView, picPath
|
||||
)
|
||||
}
|
||||
|
||||
override fun onBackPressed() {
|
||||
super.onBackPressed()
|
||||
setResult(RESULT_OK)
|
||||
|
||||
+38
-11
@@ -9,6 +9,7 @@ import com.arpa.hndahesudintocctmsdriver.databinding.ActivityAuthPersonBinding
|
||||
import com.arpa.hndahesudintocctmsdriver.net.BaseObserver
|
||||
import com.arpa.hndahesudintocctmsdriver.net.DataManager
|
||||
import com.arpa.hndahesudintocctmsdriver.net.RxHttpCallBack
|
||||
import com.arpa.hndahesudintocctmsdriver.utils.CommonPopUtils
|
||||
import com.arpa.hndahesudintocctmsdriver.utils.OcrUtils
|
||||
import com.arpa.hndahesudintocctmsdriver.utils.UserUtils
|
||||
import com.arpa.mylibrary.base.BaseActivity
|
||||
@@ -37,7 +38,7 @@ class EditPersonActivity : BaseActivity<ActivityAuthPersonBinding>() {
|
||||
private var firstMissingInfo = -1
|
||||
override fun initView(savedInstanceState: Bundle?) {
|
||||
setStatusBarColor(R.color.white)
|
||||
setTitleBar("实名认证"){
|
||||
setTitleBar("实名认证") {
|
||||
setResult(RESULT_OK)
|
||||
finish()
|
||||
}
|
||||
@@ -68,8 +69,11 @@ class EditPersonActivity : BaseActivity<ActivityAuthPersonBinding>() {
|
||||
}
|
||||
|
||||
if (!tvEnd.text.toString().contains("长期")) {
|
||||
if (TimeUtil.compareDate(tvEnd.text.toString(),
|
||||
SimpleDateFormat("yyyy-MM-dd", Locale.getDefault()))) {
|
||||
if (TimeUtil.compareDate(
|
||||
tvEnd.text.toString(),
|
||||
SimpleDateFormat("yyyy-MM-dd", Locale.getDefault())
|
||||
)
|
||||
) {
|
||||
ToastUtils.showToast(mContext, "身份证已过期,请及时更换最新证件")
|
||||
}
|
||||
}
|
||||
@@ -79,11 +83,11 @@ class EditPersonActivity : BaseActivity<ActivityAuthPersonBinding>() {
|
||||
.subscribe(BaseObserver(mContext, object : RxHttpCallBack<Any>() {
|
||||
override fun onSuccess(t: CommonResponseBean<Any>) {
|
||||
super.onSuccess(t)
|
||||
BaseSPUtils.put(mContext,AppConfig.USER_CARID,perInfoBean.idcardNo)
|
||||
BaseSPUtils.put(mContext, AppConfig.USER_CARID, perInfoBean.idcardNo)
|
||||
showToast("修改成功")
|
||||
val goNextPersonInfo = UserUtils.instance.goNextPersonInfo(perInfoBean)
|
||||
if (goNextPersonInfo != null) {
|
||||
ActivityUtils.startActivity(mContext,goNextPersonInfo)
|
||||
ActivityUtils.startActivity(mContext, goNextPersonInfo)
|
||||
}
|
||||
setResult(RESULT_OK)
|
||||
finish()
|
||||
@@ -108,9 +112,13 @@ class EditPersonActivity : BaseActivity<ActivityAuthPersonBinding>() {
|
||||
}
|
||||
}
|
||||
|
||||
ivFront.setOnClickListener {
|
||||
tvFrontSeeBig.setOnClickListener {
|
||||
OcrUtils.getInstance()
|
||||
.ocrPerson(mContext, this@EditPersonActivity) { picPath, result ->
|
||||
.ocrPerson(
|
||||
mContext,
|
||||
perInfoBean.idcardFrontUrl,
|
||||
this@EditPersonActivity
|
||||
) { picPath, result ->
|
||||
if (result?.data?.face == null) {
|
||||
ToastUtils.showToast(mContext, "请选择正确证件照片")
|
||||
return@ocrPerson
|
||||
@@ -135,8 +143,7 @@ class EditPersonActivity : BaseActivity<ActivityAuthPersonBinding>() {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ivBack.setOnClickListener {
|
||||
tvBackSeeBig.setOnClickListener {
|
||||
OcrUtils.getInstance()
|
||||
.ocrPerson(mContext, this@EditPersonActivity) { picPath, result ->
|
||||
if (result?.data?.back == null) {
|
||||
@@ -173,6 +180,22 @@ class EditPersonActivity : BaseActivity<ActivityAuthPersonBinding>() {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
ivFront.setOnClickListener {
|
||||
CommonPopUtils.getInstance().showOnePic(
|
||||
mContext,
|
||||
ivFront, perInfoBean.idcardFrontUrl
|
||||
)
|
||||
|
||||
}
|
||||
|
||||
ivBack.setOnClickListener {
|
||||
CommonPopUtils.getInstance().showOnePic(
|
||||
mContext,
|
||||
ivBack, perInfoBean.idcardBackUrl
|
||||
)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -196,14 +219,18 @@ class EditPersonActivity : BaseActivity<ActivityAuthPersonBinding>() {
|
||||
etId.isEnabled = false
|
||||
tvStart.isEnabled = false
|
||||
tvEnd.isEnabled = false
|
||||
ivFront.isEnabled = false
|
||||
ivBack.isEnabled = false
|
||||
// ivFront.isEnabled = false
|
||||
// ivBack.isEnabled = false
|
||||
}
|
||||
}
|
||||
binding.run {
|
||||
etName.setText(perInfoBean.idcardName)
|
||||
etId.setText(perInfoBean.idcardNo)
|
||||
tvStart.text = perInfoBean.idcardEffectiveStart
|
||||
tvFrontSeeBig.visibility =
|
||||
if (perInfoBean.idcardFrontUrl.isNullOrEmpty() || isOnlyShow) View.GONE else View.VISIBLE
|
||||
tvBackSeeBig.visibility =
|
||||
if (perInfoBean.idcardBackUrl.isNullOrEmpty() || isOnlyShow) View.GONE else View.VISIBLE
|
||||
tvEnd.text =
|
||||
if (perInfoBean.idcardIsEndless == "1") "长期" else perInfoBean.idcardEffectiveEnd
|
||||
ImageLoader.getInstance()
|
||||
|
||||
-5
@@ -2,17 +2,12 @@ package com.arpa.hndahesudintocctmsdriver.ui.mine.activity
|
||||
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
import cn.jpush.android.api.JPushInterface
|
||||
import cn.jpush.android.ups.JPushUPSManager
|
||||
import cn.jpush.android.ups.TokenResult
|
||||
import cn.jpush.android.ups.UPSTurnCallBack
|
||||
import com.arpa.hndahesudintocctmsdriver.R
|
||||
import com.arpa.hndahesudintocctmsdriver.databinding.ActivitySettingBinding
|
||||
import com.arpa.hndahesudintocctmsdriver.push.PushHelper
|
||||
import com.arpa.hndahesudintocctmsdriver.utils.CommonPopUtils
|
||||
import com.arpa.hndahesudintocctmsdriver.utils.UserUtils
|
||||
import com.arpa.mylibrary.base.BaseActivity
|
||||
import com.arpa.mylibrary.callback.PushAliasListener
|
||||
|
||||
/**
|
||||
* @ClassName SettingActivity
|
||||
|
||||
@@ -13,7 +13,6 @@ import com.arpa.hndahesudintocctmsdriver.net.DataManager
|
||||
import com.arpa.hndahesudintocctmsdriver.net.RxHttpCallBack
|
||||
import com.arpa.hndahesudintocctmsdriver.ui.account.authperson.EditBankCardActivity
|
||||
import com.arpa.hndahesudintocctmsdriver.utils.CommonPopUtils
|
||||
import com.arpa.glex.bean.UserDetail
|
||||
import com.arpa.glex.bean.WalletInfo
|
||||
import com.arpa.glex.bean.WaterInfo
|
||||
import com.arpa.hndahesudintocctmsdriver.base.AppConfig
|
||||
|
||||
+12
-7
@@ -5,6 +5,7 @@ import android.view.View
|
||||
import com.arpa.hndahesudintocctmsdriver.R
|
||||
import com.arpa.hndahesudintocctmsdriver.base.AppConfig
|
||||
import com.arpa.hndahesudintocctmsdriver.databinding.ActivityWaybillSuccBinding
|
||||
import com.arpa.hndahesudintocctmsdriver.event.GoWaybillEvent
|
||||
import com.arpa.hndahesudintocctmsdriver.event.RefreshEvent
|
||||
import com.arpa.hndahesudintocctmsdriver.ui.HomeActivity
|
||||
import com.arpa.mylibrary.base.BaseActivity
|
||||
@@ -88,17 +89,21 @@ class WaybillSuccActivity : BaseActivity<ActivityWaybillSuccBinding>() {
|
||||
private fun goLeftOrRight(type: Int?, isLeft: Boolean) {
|
||||
if (isLeft) {
|
||||
when (type) {
|
||||
0 -> ActivityUtils.finishToActivityAndGoNew(
|
||||
mContext,
|
||||
HomeActivity::class.java,
|
||||
WaybillLoadActivity::class.java,
|
||||
intent.extras,
|
||||
false
|
||||
)
|
||||
0 -> {
|
||||
ActivityUtils.finishToActivityAndGoNew(
|
||||
mContext,
|
||||
HomeActivity::class.java,
|
||||
WaybillLoadActivity::class.java,
|
||||
intent.extras,
|
||||
false
|
||||
)
|
||||
|
||||
}
|
||||
|
||||
1, 2 -> {
|
||||
ActivityUtils.finishToActivity(HomeActivity::class.java, false)
|
||||
EventBus.getDefault().post(RefreshEvent(type))
|
||||
EventBus.getDefault().post(GoWaybillEvent(0))
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
+1
-1
@@ -122,7 +122,7 @@ class WaybillUpPicActivity : BaseActivity<ActivityWaybillUppicBinding>() {
|
||||
)
|
||||
|
||||
var myAdapter = GridImageAdapter(mContext, mData)
|
||||
myAdapter.selectMax = 6
|
||||
myAdapter.selectMax = if (type==2) 6 else 1
|
||||
myAdapter.setOnItemClickListener(object : OnItemClickListener {
|
||||
override fun onItemClick(v: View?, position: Int) {
|
||||
PopsUtils.getInstance()
|
||||
|
||||
@@ -4,17 +4,17 @@ import android.content.Context
|
||||
import android.graphics.Color
|
||||
import android.widget.ImageView
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.arpa.glex.bean.WalletInfo
|
||||
import com.arpa.hndahesudintocctmsdriver.R
|
||||
import com.arpa.hndahesudintocctmsdriver.bean.AppVersion
|
||||
import com.arpa.hndahesudintocctmsdriver.bean.CarBean
|
||||
import com.arpa.hndahesudintocctmsdriver.bean.CashConfig
|
||||
import com.arpa.hndahesudintocctmsdriver.callback.OnResultListener
|
||||
import com.arpa.hndahesudintocctmsdriver.mypop.AgreementAlert
|
||||
import com.arpa.hndahesudintocctmsdriver.mypop.OnCarSelectListener
|
||||
import com.arpa.hndahesudintocctmsdriver.mypop.PopBottomCar
|
||||
import com.arpa.hndahesudintocctmsdriver.weight.pop.UpAppPop
|
||||
import com.arpa.glex.bean.WalletInfo
|
||||
import com.arpa.hndahesudintocctmsdriver.bean.CashConfig
|
||||
import com.arpa.hndahesudintocctmsdriver.weight.pop.InputMoneyPop2
|
||||
import com.arpa.hndahesudintocctmsdriver.weight.pop.UpAppPop
|
||||
import com.arpa.mylibrary.base.SingletonNoPHolder
|
||||
import com.arpa.mylibrary.utils.ConvertUtils
|
||||
import com.lxj.xpopup.XPopup
|
||||
@@ -47,7 +47,7 @@ class CommonPopUtils private constructor() {
|
||||
XPopup.Builder(context)
|
||||
.isViewMode(true)
|
||||
// .isDestroyOnDismiss(true) //对于只使用一次的弹窗,推荐设置这个
|
||||
.asCustom(PopBottomCar(context, cars, isCap,selDriverId,selCarId, listener))
|
||||
.asCustom(PopBottomCar(context, cars, isCap, selDriverId, selCarId, listener))
|
||||
.show()
|
||||
|
||||
|
||||
@@ -154,6 +154,33 @@ class CommonPopUtils private constructor() {
|
||||
.show()
|
||||
}
|
||||
|
||||
/**
|
||||
* 展示一张大图
|
||||
* @param context Context
|
||||
* @param imageView ImageView?
|
||||
* @param picUrl String
|
||||
*/
|
||||
fun showOnePic(
|
||||
context: Context,
|
||||
imageView: ImageView? = null,
|
||||
picUrl: String
|
||||
) {
|
||||
XPopup.Builder(context)
|
||||
.asImageViewer(
|
||||
imageView,
|
||||
picUrl,
|
||||
false,
|
||||
-1,
|
||||
-1,
|
||||
ConvertUtils.dp2px(10F),
|
||||
false,
|
||||
Color.rgb(32, 36, 46),
|
||||
SmartGlideImageLoader(R.mipmap.ic_launcher_round),
|
||||
null
|
||||
)
|
||||
.show()
|
||||
}
|
||||
|
||||
/**
|
||||
* app版本检查
|
||||
* @param context Context
|
||||
@@ -179,13 +206,18 @@ class CommonPopUtils private constructor() {
|
||||
* @param userInfo UserDetail
|
||||
* @param listener OnInputConfirmListener
|
||||
*/
|
||||
fun showPickMoney(context: Context, walletInfo:WalletInfo, cashConfig: CashConfig, listener: OnInputConfirmListener) {
|
||||
fun showPickMoney(
|
||||
context: Context,
|
||||
walletInfo: WalletInfo,
|
||||
cashConfig: CashConfig,
|
||||
listener: OnInputConfirmListener
|
||||
) {
|
||||
XPopup.Builder(context)
|
||||
.dismissOnBackPressed(true)
|
||||
.dismissOnTouchOutside(true)
|
||||
.asCustom(
|
||||
InputMoneyPop2(
|
||||
context,walletInfo, cashConfig, listener
|
||||
context, walletInfo, cashConfig, listener
|
||||
)
|
||||
)
|
||||
.show()
|
||||
|
||||
@@ -30,6 +30,51 @@ class OcrUtils private constructor() {
|
||||
companion object : SingletonNoPHolder<OcrUtils>(::OcrUtils)
|
||||
|
||||
|
||||
/**
|
||||
* 身份证识别
|
||||
* */
|
||||
fun ocrPerson(context: Context,picUrl: String = "", activity: AppCompatActivity, listener: OnOcrPicResultListener) {
|
||||
PopsUtils.getInstance().showSimSelPic2(context,picUrl) { result ->
|
||||
LoadingUtils.instance.showLoading(activity)
|
||||
//上传oss得到图片地址
|
||||
OssServiceUtil.getInstance().run {
|
||||
asyncPutImage(result[0].realPath, null)
|
||||
setResultCallBack { data, oldPath ->
|
||||
DataManager.getInstance().recognizeIdcard(oldPath)
|
||||
.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(BaseObserver(context, object : RxHttpCallBack<OcrPersonBean>() {
|
||||
override fun onSuccess(t: CommonResponseBean<OcrPersonBean>) {
|
||||
super.onSuccess(t)
|
||||
LoadingUtils.instance.dissLoading()
|
||||
t.data?.let {
|
||||
listener.onSuccResult(
|
||||
PicPath(result[0].realPath, oldPath), it
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onCodeError(
|
||||
mContext: Context?,
|
||||
t: CommonResponseBean<OcrPersonBean>
|
||||
) {
|
||||
// super.onCodeError(mContext, t)
|
||||
LoadingUtils.instance.dissLoading()
|
||||
if (t.code == 500) {
|
||||
// if (t.msg.contains("code: 400, The image type does not match the API operation")) {
|
||||
ToastUtils.showToast(mContext, "图片识别失败,请重新上传")
|
||||
// } else {
|
||||
// ToastUtils.showToast(mContext, t.msg)
|
||||
// }
|
||||
}
|
||||
}
|
||||
}))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 身份证识别
|
||||
* */
|
||||
|
||||
@@ -59,24 +59,58 @@
|
||||
android:textSize="@dimen/sp_16"></TextView>
|
||||
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivFront"
|
||||
<RelativeLayout
|
||||
android:layout_width="@dimen/dp_155"
|
||||
android:layout_height="@dimen/dp_97"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_marginLeft="@dimen/dp_8"
|
||||
android:layout_marginBottom="@dimen/dp_22"
|
||||
android:background="@drawable/driver_front" />
|
||||
android:layout_marginBottom="@dimen/dp_22">
|
||||
<ImageView
|
||||
android:id="@+id/ivFront"
|
||||
android:layout_width="@dimen/dp_155"
|
||||
android:layout_height="@dimen/dp_97"
|
||||
android:background="@drawable/driver_front" />
|
||||
<TextView
|
||||
android:id="@+id/tvChangeFront"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:paddingRight="@dimen/dp_4"
|
||||
android:paddingBottom="@dimen/dp_4"
|
||||
android:text="更换图片"
|
||||
android:textColor="@color/main_red"
|
||||
android:textStyle="bold"
|
||||
android:visibility="gone" />
|
||||
</RelativeLayout>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivBack"
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="@dimen/dp_155"
|
||||
android:layout_height="@dimen/dp_97"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_marginRight="@dimen/dp_8"
|
||||
android:layout_marginBottom="@dimen/dp_22"
|
||||
android:background="@drawable/driver_back" />
|
||||
android:layout_marginBottom="@dimen/dp_22">
|
||||
<ImageView
|
||||
android:id="@+id/ivBack"
|
||||
android:layout_width="@dimen/dp_155"
|
||||
android:layout_height="@dimen/dp_97"
|
||||
android:background="@drawable/driver_back" />
|
||||
<TextView
|
||||
android:id="@+id/tvChangeBack"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:paddingRight="@dimen/dp_4"
|
||||
android:paddingBottom="@dimen/dp_4"
|
||||
android:text="更换图片"
|
||||
android:textColor="@color/main_red"
|
||||
android:textStyle="bold"
|
||||
android:visibility="gone" />
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
@@ -50,25 +50,64 @@
|
||||
android:textColor="@color/black"
|
||||
android:textSize="@dimen/sp_16"></TextView>
|
||||
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivFront"
|
||||
<RelativeLayout
|
||||
android:layout_width="@dimen/dp_155"
|
||||
android:layout_height="@dimen/dp_97"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_marginLeft="@dimen/dp_8"
|
||||
android:layout_marginBottom="@dimen/dp_22"
|
||||
android:background="@drawable/person_front"></ImageView>
|
||||
android:layout_marginBottom="@dimen/dp_22">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivBack"
|
||||
<ImageView
|
||||
android:id="@+id/ivFront"
|
||||
android:layout_width="@dimen/dp_155"
|
||||
android:layout_height="@dimen/dp_97"
|
||||
android:background="@drawable/person_front"></ImageView>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvFrontSeeBig"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:paddingRight="@dimen/dp_4"
|
||||
android:paddingBottom="@dimen/dp_4"
|
||||
android:text="更换图片"
|
||||
android:textColor="@color/main_red"
|
||||
android:textStyle="bold"
|
||||
android:visibility="gone" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="@dimen/dp_155"
|
||||
android:layout_height="@dimen/dp_97"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_marginRight="@dimen/dp_8"
|
||||
android:layout_marginBottom="@dimen/dp_22"
|
||||
android:background="@drawable/person_back"></ImageView>
|
||||
|
||||
>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivBack"
|
||||
android:layout_width="@dimen/dp_155"
|
||||
android:layout_height="@dimen/dp_97"
|
||||
android:background="@drawable/person_back"></ImageView>
|
||||
<TextView
|
||||
android:id="@+id/tvBackSeeBig"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:paddingRight="@dimen/dp_4"
|
||||
android:paddingBottom="@dimen/dp_4"
|
||||
android:text="更换图片"
|
||||
android:textColor="@color/main_red"
|
||||
android:textStyle="bold"
|
||||
android:visibility="gone" />
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
@@ -10,15 +10,15 @@
|
||||
android:elevation="3dp"
|
||||
android:id="@+id/home_tabLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_56"
|
||||
android:layout_height="@dimen/dp_60"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:background="@color/colorWhite"
|
||||
app:tl_iconHeight="@dimen/dp_21"
|
||||
app:tl_iconWidth="@dimen/dp_21"
|
||||
app:tl_iconHeight="@dimen/dp_24"
|
||||
app:tl_iconWidth="@dimen/dp_24"
|
||||
app:tl_indicator_height="0dp"
|
||||
app:tl_textSelectColor="#454545"
|
||||
app:tl_textUnselectColor="#A8ABB0"
|
||||
app:tl_textsize="@dimen/sp_12" />
|
||||
app:tl_textsize="@dimen/sp_14" />
|
||||
|
||||
<com.arpa.hndahesudintocctmsdriver.weight.NoScrollViewPager
|
||||
android:id="@+id/home_NoScrollViewPager"
|
||||
|
||||
@@ -491,34 +491,41 @@
|
||||
android:textColor="@color/main_red"
|
||||
android:textSize="@dimen/sp_15" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvGoodsTitle"
|
||||
android:layout_width="wrap_content"
|
||||
<LinearLayout
|
||||
android:id="@+id/llGoods"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:layout_below="@+id/tvCarTitle"
|
||||
android:layout_marginTop="@dimen/dp_18"
|
||||
android:paddingLeft="@dimen/dp_16"
|
||||
android:text="货物"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="@dimen/sp_15" />
|
||||
>
|
||||
<TextView
|
||||
android:id="@+id/tvGoodsTitle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingLeft="@dimen/dp_16"
|
||||
android:text="货物"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="@dimen/sp_15" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvGoods"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignBottom="@+id/tvGoodsTitle"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_marginTop="@dimen/dp_40"
|
||||
android:paddingRight="@dimen/dp_16"
|
||||
android:text="钢铁,1吨,螺纹钢"
|
||||
android:textColor="@color/main_red"
|
||||
android:textSize="@dimen/sp_15" />
|
||||
<TextView
|
||||
android:layout_weight="1"
|
||||
android:gravity="right"
|
||||
android:id="@+id/tvGoods"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingRight="@dimen/dp_16"
|
||||
android:text="钢铁,1吨,螺纹钢"
|
||||
android:textColor="@color/main_red"
|
||||
android:textSize="@dimen/sp_15" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvNotesTitle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/tvGoodsTitle"
|
||||
android:layout_below="@+id/llGoods"
|
||||
android:layout_marginTop="@dimen/dp_18"
|
||||
android:paddingLeft="@dimen/dp_16"
|
||||
android:text="备注"
|
||||
|
||||
@@ -428,35 +428,43 @@
|
||||
android:text="整车 4.2/6.2/6.8 米 高栏/厢式"
|
||||
android:textColor="@color/main_red"
|
||||
android:textSize="@dimen/sp_15" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvGoodsTitle"
|
||||
android:layout_width="wrap_content"
|
||||
<LinearLayout
|
||||
android:id="@+id/llGoods"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:layout_below="@+id/tvCarTitle"
|
||||
android:layout_marginTop="@dimen/dp_18"
|
||||
android:paddingLeft="@dimen/dp_16"
|
||||
android:text="货物"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="@dimen/sp_15" />
|
||||
>
|
||||
<TextView
|
||||
android:id="@+id/tvGoodsTitle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingLeft="@dimen/dp_16"
|
||||
android:text="货物"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="@dimen/sp_15" />
|
||||
|
||||
<TextView
|
||||
android:layout_weight="1"
|
||||
android:gravity="right"
|
||||
android:id="@+id/tvGoods"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingRight="@dimen/dp_16"
|
||||
android:text="钢铁,1吨,螺纹钢"
|
||||
android:textColor="@color/main_red"
|
||||
android:textSize="@dimen/sp_15" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvGoods"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignBottom="@+id/tvGoodsTitle"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_marginTop="@dimen/dp_40"
|
||||
android:paddingRight="@dimen/dp_16"
|
||||
android:text="钢铁,1吨,螺纹钢"
|
||||
android:textColor="@color/main_red"
|
||||
android:textSize="@dimen/sp_15" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvNotesTitle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/tvGoodsTitle"
|
||||
android:layout_below="@+id/llGoods"
|
||||
android:layout_marginTop="@dimen/dp_18"
|
||||
android:paddingLeft="@dimen/dp_16"
|
||||
android:text="备注"
|
||||
|
||||
Reference in New Issue
Block a user