@@ -648,5 +648,23 @@ | |||
android:name=".project.ui.activity.after.CheckRunningWaterStep3Activity" | |||
android:launchMode="singleTop" | |||
android:screenOrientation="portrait" /> | |||
<!--用户信息修改--> | |||
<activity | |||
android:name=".project.ui.activity.after.EditUserInfoStep1Activity" | |||
android:launchMode="singleTop" | |||
android:screenOrientation="portrait" /> | |||
<activity | |||
android:name=".project.ui.activity.after.EditUserInfoStep2Activity" | |||
android:launchMode="singleTop" | |||
android:screenOrientation="portrait" /> | |||
<!--车辆信息修改--> | |||
<activity | |||
android:name=".project.ui.activity.after.EditCarInfoStep1Activity" | |||
android:launchMode="singleTop" | |||
android:screenOrientation="portrait" /> | |||
<activity | |||
android:name=".project.ui.activity.after.EditCarInfoStep2Activity" | |||
android:launchMode="singleTop" | |||
android:screenOrientation="portrait" /> | |||
</application> | |||
</manifest> |
@@ -8,6 +8,26 @@ import com.umeng.commonsdk.debug.E; | |||
* @author admin | |||
*/ | |||
public class EnumBean { | |||
//用户证件类型枚举 | |||
public static EnumBean[] ID_TYPE = { | |||
Add("101", "身份证(含临时身份证)"), | |||
Add("102", "护照(限外籍人士)"), | |||
Add("103", "港澳居民来往内地通行证"), | |||
Add("104", "台湾居民来往大陆通行证"), | |||
Add("105", "军官证"), | |||
Add("106", "武警警察身份证"), | |||
Add("113", "澳门永久/非永久居民身份证"), | |||
Add("114", "香港永久/非永久居民身份证"), | |||
Add("201", "统一社会信用代码证书"), | |||
Add("202", "组织机构代码证"), | |||
Add("203", "营业执照"), | |||
Add("204", "事业单位法人证书"), | |||
Add("205", "社会团体法人登记证书"), | |||
Add("206", "律师事务所执业许可证"), | |||
Add("217", "公司商业登记副本(3个月内)"), | |||
Add("219", "公司营业税开业/更改M1副本"), | |||
}; | |||
//车辆颜色枚举类 | |||
public static EnumBean[] VehicleColorArray = { | |||
Add("0", "蓝色"), |
@@ -63,6 +63,8 @@ public class IFCode { | |||
LoadingMsgMap.put(IFCode.IFCODE78, "VFJ-修改车辆信息中..."); | |||
LoadingMsgMap.put(IFCode.IFCODE168, "网点信息查询中..."); | |||
LoadingMsgMap.put(IFCode.IFCODE167, "申请换货中..."); | |||
LoadingMsgMap.put(IFCode.IFCODE151, "用户信息查询中..."); | |||
LoadingMsgMap.put(IFCode.IFCODE520, "用户信息更改中..."); | |||
} | |||
public static final String IFCODE2 = "2"; //统一会员平台发送验证码接口 | |||
@@ -161,6 +163,7 @@ public class IFCode { | |||
public static final String IFCODEXX3 = "XX3"; //用户通行流水记录下载(等待提供) | |||
public static final String IFCODE925 = "925"; //车辆通行流水分页查询接口 | |||
public static final String IFCODE151 = "151"; //通过证件号 + 证件类型查询用户信息 | |||
public static final String IFCODE520 = "520"; //个人用户信息变更 | |||
public static final String IFCODE34 = "34"; //车辆信息变更 | |||
} |
@@ -246,7 +246,11 @@ public class ResultBean<T> { | |||
public String applyType; //申请单类型 | |||
public String damageMode; //0-人为损坏 1-自然损坏 | |||
public List<BizContent> list; //申请单列表(更换ETC时使用) | |||
public List<BizContent> customers; //用户信息查询列表 | |||
private String customerIdnum; | |||
private String customerIdtype; | |||
public String pinType; //卡pin码类型 只能是1-pin为123456,2-pin为313233343536 | |||
public String cardBalance; //卡内余额 | |||
public String refundType; //退款状态 | |||
@@ -263,6 +267,15 @@ public class ResultBean<T> { | |||
public String enTime; //入口站时间 | |||
public String extolllaneName; //出口站站名 | |||
public String exTime; //出口站时间 | |||
public String customerPosImgUrl; //开户人正面图片地址、营业执照 | |||
public String customerNegImgUrl; //开户人反面图片地址 | |||
public String agentNegImgUrl; //经办人反面图片地址 | |||
public String customerAddress; //开户人地址 | |||
public String customerVid; //用户证件过期时间 | |||
public String agentIdType; //指定经办人证件类型 | |||
public String custoemrName; //公司名称 | |||
public String customerIdNum; //用户证件ID | |||
public String customerIdType; //公司证件类型 | |||
private String appId = "52030131"; | |||
private String openId = (String) MyShared.getInstance().get(MyShared.OPENID,""); | |||
@@ -342,13 +355,11 @@ public class ResultBean<T> { | |||
private String vehicleType; | |||
private String vehicleTotalMass; | |||
private String customerName; | |||
private String customerIdnum; | |||
private String vehicleClass; | |||
private String vehicleClassStr; | |||
private String vehicleApprovedCount; | |||
private String vehiclePermittedWeight; | |||
private String vehicleDimensions; | |||
private String customerIdtype; | |||
private String vehicleAxleCount; | |||
private String customerIdVld; | |||
private String customerTel; | |||
@@ -371,7 +382,6 @@ public class ResultBean<T> { | |||
private String agentName; | |||
private String agentIdnum; | |||
private String agentPosImgUrl; | |||
private String agentNegImgUrl; | |||
private String proxyUrl; | |||
private String ownerName; | |||
private String ownerIdnum; |
@@ -0,0 +1,57 @@ | |||
package com.huntersun.vkyes.etcopencard.project.dialog; | |||
import android.content.Context; | |||
import android.view.Gravity; | |||
import android.widget.TextView; | |||
import com.huntersun.vkyes.etcopencard.project.api.bean.EnumBean; | |||
import com.huntersun.vkyes.etcopencard.src.ui.dialog.MenuDialog; | |||
import java.util.ArrayList; | |||
import java.util.List; | |||
/** | |||
* Date :2023-03-25 | |||
* Description:证件类型dialog | |||
*/ | |||
public class IDTypeDialog { | |||
public static void showIDTypeDialog(Context mContext, OnUserTypeCallbcak callbcak) { | |||
List<EnumBean> list = new ArrayList<>(); | |||
list.add(new EnumBean("101", "身份证(含临时身份证)")); | |||
list.add(new EnumBean("102", "护照(限外籍人士)")); | |||
list.add(new EnumBean("103", "港澳居民来往内地通行证")); | |||
list.add(new EnumBean("104", "台湾居民来往大陆通行证")); | |||
list.add(new EnumBean("105", "军官证")); | |||
list.add(new EnumBean("106", "武警警察身份证")); | |||
list.add(new EnumBean("113", "澳门永久/非永久居民身份证")); | |||
list.add(new EnumBean("114", "香港永久/非永久居民身份证")); | |||
list.add(new EnumBean("201", "统一社会信用代码证书")); | |||
list.add(new EnumBean("202", "组织机构代码证")); | |||
list.add(new EnumBean("203", "营业执照")); | |||
list.add(new EnumBean("204", "事业单位法人证书")); | |||
list.add(new EnumBean("205", "社会团体法人登记证书")); | |||
list.add(new EnumBean("206", "律师事务所执业许可证")); | |||
list.add(new EnumBean("217", "公司商业登记副本(3个月内)")); | |||
list.add(new EnumBean("219", "公司营业税开业/更改M1副本")); | |||
List<String> valueList = new ArrayList<>(); | |||
for (EnumBean item : list) { | |||
valueList.add(item.getValue()); | |||
} | |||
// 车辆用户类型 | |||
new MenuDialog.Builder(mContext) | |||
.setGravity(Gravity.CENTER) | |||
.setList(valueList) | |||
.setListener((MenuDialog.OnListener<String>) (dialog, position, string) -> { | |||
String userType = list.get(position).getKey(); | |||
if (callbcak != null){ | |||
callbcak.onUserType(string,userType); | |||
} | |||
}) | |||
.show(); | |||
} | |||
public interface OnUserTypeCallbcak{ | |||
void onUserType(String userType,String userTypeValue); | |||
} | |||
} |
@@ -16,7 +16,8 @@ public class CommonDealSuccessActivity extends AppActivity { | |||
private ActivityCommonDealSuccessBinding binding; | |||
//0-注销成功 1-欠费补缴 2-余额补领 3-Pin码锁解锁成功 4-更换ETC设备成功 5-停用成功 | |||
//6-启用成功 7-卡签续期 8-储值卡转记账卡 9-设备升级 10-过户成功 | |||
//6-启用成功 7-卡签续期 8-储值卡转记账卡 9-设备升级 10-过户成功 11-用户信息变更成功 | |||
// 12- 车辆信息变更成功 | |||
private String from; | |||
//传递的订单ID | |||
@@ -78,6 +79,14 @@ public class CommonDealSuccessActivity extends AppActivity { | |||
}else if (from.equals("10")){ | |||
setTitle("ETC过户"); | |||
binding.tvHint.setText("已申请过户"); | |||
}else if (from.equals("11")){ | |||
setTitle("用户信息变更"); | |||
binding.tvHint.setText("用户信息变更成功"); | |||
}else if (from.equals("12")){ | |||
setTitle("车辆信息变更"); | |||
binding.tvHint.setText("车辆信息变更成功"); | |||
} | |||
binding.btnHome.setOnClickListener(new View.OnClickListener() { |
@@ -0,0 +1,30 @@ | |||
package com.huntersun.vkyes.etcopencard.project.ui.activity.after; | |||
import android.view.View; | |||
import com.huntersun.vkyes.etcopencard.databinding.ActivityEditCarInfoStep1Binding; | |||
import com.huntersun.vkyes.etcopencard.src.app.AppActivity; | |||
/** | |||
* Date :2023-03-25 | |||
* Description:车辆信息更改 第一步 查询车辆信息 | |||
*/ | |||
public class EditCarInfoStep1Activity extends AppActivity { | |||
private ActivityEditCarInfoStep1Binding binding; | |||
@Override | |||
protected View getLayoutView() { | |||
binding = ActivityEditCarInfoStep1Binding.inflate(getLayoutInflater()); | |||
return binding.getRoot(); | |||
} | |||
@Override | |||
protected void initView() { | |||
} | |||
@Override | |||
protected void initData() { | |||
} | |||
} |
@@ -0,0 +1,33 @@ | |||
package com.huntersun.vkyes.etcopencard.project.ui.activity.after; | |||
import android.view.View; | |||
import com.huntersun.vkyes.etcopencard.databinding.ActivityEditCarInfoStep2Binding; | |||
import com.huntersun.vkyes.etcopencard.project.api.bean.ResultBean; | |||
import com.huntersun.vkyes.etcopencard.src.app.AppActivity; | |||
/** | |||
* Date :2023-03-25 | |||
* Description:车辆信息更改 第2步 修改车辆信息 | |||
*/ | |||
public class EditCarInfoStep2Activity extends AppActivity { | |||
private ActivityEditCarInfoStep2Binding binding; | |||
//用户信息 | |||
private ResultBean.BizContent curBizContent; | |||
@Override | |||
protected View getLayoutView() { | |||
binding = ActivityEditCarInfoStep2Binding.inflate(getLayoutInflater()); | |||
return binding.getRoot(); | |||
} | |||
@Override | |||
protected void initView() { | |||
} | |||
@Override | |||
protected void initData() { | |||
} | |||
} |
@@ -0,0 +1,107 @@ | |||
package com.huntersun.vkyes.etcopencard.project.ui.activity.after; | |||
import android.os.Bundle; | |||
import android.view.View; | |||
import com.alibaba.fastjson.JSON; | |||
import com.blankj.utilcode.util.LogUtils; | |||
import com.huntersun.vkyes.etcopencard.databinding.ActivityEditUserInfoStep1Binding; | |||
import com.huntersun.vkyes.etcopencard.project.api.MyRetrofit; | |||
import com.huntersun.vkyes.etcopencard.project.api.Result; | |||
import com.huntersun.vkyes.etcopencard.project.api.bean.IFCode; | |||
import com.huntersun.vkyes.etcopencard.project.api.bean.ResultBean; | |||
import com.huntersun.vkyes.etcopencard.project.dialog.IDTypeDialog; | |||
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 java.util.HashMap; | |||
import java.util.Map; | |||
import retrofit2.Response; | |||
/** | |||
* Date :2023-03-25 | |||
* Description:用户信息更改 第一步 查询用户信息 | |||
*/ | |||
public class EditUserInfoStep1Activity extends AppActivity { | |||
private ActivityEditUserInfoStep1Binding binding; | |||
//选择的证件类型 | |||
private String curUserType; | |||
@Override | |||
protected View getLayoutView() { | |||
binding = ActivityEditUserInfoStep1Binding.inflate(getLayoutInflater()); | |||
return binding.getRoot(); | |||
} | |||
@Override | |||
protected void initView() { | |||
binding.LLIdType.setOnClickListener(this::initClick); | |||
binding.tvIdType.setOnClickListener(this::initClick); | |||
binding.btnCheck.setOnClickListener(this::initClick); | |||
//TODO 测试 | |||
binding.etSearch.setText("522225198805108157"); | |||
} | |||
private void getUserInfoById() { | |||
showDialog("用户信息查询中..."); | |||
Map<String, String> params = new HashMap<>(); | |||
params.put("customerIdType", curUserType); | |||
params.put("customerIdNum", FunHelper.getText(binding.etSearch)); | |||
MyRetrofit.newInstance(IFCode.IFCODE151, params, new MyRetrofit.ReturnResult() { | |||
@Override | |||
public void onSuccess(ResultBean resultBean, ResultBean.BizContent bizContent) { | |||
hideDialog(); | |||
FunHelper.closeKeyboard(binding.etSearch); | |||
if (bizContent == null || FunHelper.isEmpty(bizContent.customers)){ | |||
toast("未查询到用户信息"); | |||
return; | |||
} | |||
Bundle bundle = new Bundle(); | |||
bundle.putString("dataJson", JSON.toJSONString(bizContent.customers.get(0))); | |||
jumpToPage(EditUserInfoStep2Activity.class, bundle); | |||
finish(); | |||
} | |||
@Override | |||
public void onError(Response<Result> resp) { | |||
hideDialog(); | |||
FunHelper.closeKeyboard(binding.etSearch); | |||
} | |||
}); | |||
} | |||
@SingleClick | |||
private void initClick(View view) { | |||
if (view == binding.btnCheck) { | |||
if (FunHelper.isEmpty(curUserType)) { | |||
toast("请选择证件类型"); | |||
return; | |||
} | |||
if (FunHelper.isEmpty(FunHelper.getText(binding.etSearch))) { | |||
toast("请输入证件号!"); | |||
return; | |||
} | |||
getUserInfoById(); | |||
} else if (view == binding.tvIdType || view == binding.LLIdType) { | |||
IDTypeDialog.showIDTypeDialog(this, new IDTypeDialog.OnUserTypeCallbcak() { | |||
@Override | |||
public void onUserType(String userType, String userTypeValue) { | |||
binding.tvIdType.setText(userType); | |||
curUserType = userTypeValue; | |||
} | |||
}); | |||
} | |||
} | |||
@Override | |||
protected void initData() { | |||
} | |||
} |
@@ -0,0 +1,427 @@ | |||
package com.huntersun.vkyes.etcopencard.project.ui.activity.after; | |||
import android.annotation.SuppressLint; | |||
import android.os.Bundle; | |||
import android.text.TextUtils; | |||
import android.view.View; | |||
import android.widget.EditText; | |||
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.IDTypeDialog; | |||
import com.huntersun.vkyes.etcopencard.project.tool.QRCode; | |||
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; | |||
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 | |||
* Description:用户信息更改 第一步 修改信息 | |||
*/ | |||
public class EditUserInfoStep2Activity extends AppActivity { | |||
private ActivityEditUserInfoStep2Binding binding; | |||
private CodeCountDown mCountDownTimerUtils; | |||
//用户信息 | |||
private ResultBean.BizContent curBizContent; | |||
//用户证件类型 | |||
private String curUserType; | |||
//用户身份证照 | |||
private String userImg1; | |||
private String userImg2; | |||
//公司营业执照和证件照 | |||
private String unitImg1; | |||
private String unitImg2; | |||
@Override | |||
protected View getLayoutView() { | |||
binding = ActivityEditUserInfoStep2Binding.inflate(getLayoutInflater()); | |||
return binding.getRoot(); | |||
} | |||
@Override | |||
protected void initView() { | |||
String json = getIntent().getStringExtra("dataJson"); | |||
if (!FunHelper.isEmpty(json)) { | |||
curBizContent = JSON.parseObject(json, ResultBean.BizContent.class); | |||
} | |||
binding.ivUser1.setOnClickListener(this::initClick); | |||
binding.ivUser2.setOnClickListener(this::initClick); | |||
binding.ivUnit1.setOnClickListener(this::initClick); | |||
binding.ivUnit2.setOnClickListener(this::initClick); | |||
binding.etAddr.setOnClickListener(this::initClick); | |||
binding.tvUserIdTime.setOnClickListener(this::initClick); | |||
binding.etUnitUserType.setOnClickListener(this::initClick); | |||
binding.btnNext.setOnClickListener(this::initClick); | |||
binding.mUserGetCodeBtn.setOnClickListener(this::initClick); | |||
binding.mUnitGetCodeBtn.setOnClickListener(this::initClick); | |||
if (curBizContent == null) return; | |||
setDataToView(); | |||
} | |||
private void setDataToView() { | |||
binding.LLUnitInfo.setVisibility(View.GONE); | |||
binding.LLUserInfo.setVisibility(View.GONE); | |||
if (curBizContent == null) return; | |||
//个人 | |||
if (curBizContent.getUserType().equals("1")) { | |||
binding.tvTitle.setText("用户信息更改"); | |||
binding.LLUserInfo.setVisibility(View.VISIBLE); | |||
if (!FunHelper.isEmpty(curBizContent.customerPosImgUrl)) { | |||
userImg1 = curBizContent.customerPosImgUrl; | |||
GlideApp.with(this).load(curBizContent.customerPosImgUrl).into(binding.ivUser1); | |||
} | |||
if (!FunHelper.isEmpty(curBizContent.customerNegImgUrl)) { | |||
userImg2 = curBizContent.customerNegImgUrl; | |||
GlideApp.with(this).load(curBizContent.customerNegImgUrl).into(binding.ivUser2); | |||
} | |||
binding.etUserName.setText(FunHelper.isEmpty(curBizContent.custoemrName) ? "" : curBizContent.custoemrName); | |||
binding.etCardId.setText(FunHelper.isEmpty(curBizContent.customerIdNum) ? "" : curBizContent.customerIdNum); | |||
binding.etAddr.setText(FunHelper.isEmpty(curBizContent.customerAddress) ? "" : curBizContent.customerAddress); | |||
binding.tvUserIdTime.setText(FunHelper.isEmpty(curBizContent.customerVid) ? "" : curBizContent.customerVid); | |||
binding.etUserPhone.setText(FunHelper.isEmpty(curBizContent.getCustomerTel()) ? "" : curBizContent.getCustomerTel()); | |||
} | |||
//单位 | |||
else { | |||
binding.tvTitle.setText("单位信息更改"); | |||
binding.LLUnitInfo.setVisibility(View.VISIBLE); | |||
if (!FunHelper.isEmpty(curBizContent.customerPosImgUrl)) { | |||
unitImg1 = curBizContent.customerPosImgUrl; | |||
GlideApp.with(this).load(curBizContent.customerPosImgUrl).into(binding.ivUnit1); | |||
} | |||
if (!FunHelper.isEmpty(curBizContent.agentNegImgUrl)) { | |||
unitImg2 = curBizContent.agentNegImgUrl; | |||
GlideApp.with(this).load(curBizContent.agentNegImgUrl).into(binding.ivUnit2); | |||
} | |||
curUserType = curBizContent.agentIdType; | |||
binding.etUnitName.setText(FunHelper.isEmpty(curBizContent.custoemrName) ? "" : curBizContent.custoemrName); | |||
binding.etUnitType.setText(FunHelper.isEmpty(curBizContent.customerIdType) ? "" : EnumBean.backValue(curBizContent.customerIdType, EnumBean.ID_TYPE)); | |||
binding.etUnitNumber.setText(FunHelper.isEmpty(curBizContent.customerIdNum) ? "" : curBizContent.customerIdNum); | |||
binding.etUnitUserPhone.setText(FunHelper.isEmpty(curBizContent.getCustomerTel()) ? "" : curBizContent.getCustomerTel()); | |||
binding.etUnitUserName.setText(FunHelper.isEmpty(curBizContent.getAgentName()) ? "" : curBizContent.getAgentName()); | |||
binding.etUnitUserIds.setText(FunHelper.isEmpty(curBizContent.getAgentIdnum()) ? "" : curBizContent.getAgentIdnum()); | |||
binding.etUnitUserType.setText(FunHelper.isEmpty(curBizContent.agentIdType) ? "" : EnumBean.backValue(curBizContent.agentIdType, EnumBean.ID_TYPE)); | |||
} | |||
} | |||
/** | |||
* 检测参数 | |||
*/ | |||
private void checkParams() { | |||
if (curBizContent.getUserType().equals("1") && userInfoInputIsEmpty()) {//用户 | |||
toast("必填项字段不能为空!"); | |||
return; | |||
} | |||
if (!curBizContent.getUserType().equals("1") && unitInfoInputIsEmpty()) {//单位 | |||
toast("必填项字段不能为空!"); | |||
return; | |||
} | |||
toSubmitInfo(); | |||
} | |||
/** | |||
* 用户信息是否为空 | |||
*/ | |||
private boolean userInfoInputIsEmpty() { | |||
if (FunHelper.isEmpty(userImg1) || FunHelper.isEmpty(userImg2) || | |||
empty(binding.etUserName) || empty(binding.etCardId) || | |||
empty(binding.etAddr) || empty(binding.tvUserIdTime) | |||
|| empty(binding.etUserPhone) || empty(binding.etUserCode)) { | |||
return true; | |||
} | |||
return false; | |||
} | |||
/** | |||
* 单位信息是否为空 | |||
*/ | |||
private boolean unitInfoInputIsEmpty() { | |||
if (FunHelper.isEmpty(unitImg1) || FunHelper.isEmpty(unitImg2) || | |||
empty(binding.etUnitName) || empty(binding.etUnitType) || | |||
empty(binding.etUnitNumber) || empty(binding.etUnitUserName) | |||
|| empty(binding.etUnitUserType) || empty(binding.etUnitUserIds) | |||
|| empty(binding.etUnitUserPhone) || empty(binding.etUnitCode)) { | |||
return true; | |||
} | |||
return false; | |||
} | |||
private boolean empty(View view) { | |||
if (view instanceof EditText) { | |||
return FunHelper.isEmpty(FunHelper.getText((EditText) view)); | |||
} else { | |||
return FunHelper.isEmpty(FunHelper.getText((TextView) view)); | |||
} | |||
} | |||
@SingleClick | |||
private void initClick(View view) { | |||
if (view == binding.mUserGetCodeBtn || view == binding.mUnitGetCodeBtn){//发送验证码 | |||
if (view == binding.mUserGetCodeBtn){ | |||
sendCode(FunHelper.getText(binding.etUserPhone)); | |||
}else if (view == binding.mUnitGetCodeBtn){ | |||
sendCode(FunHelper.getText(binding.etUnitUserPhone)); | |||
} | |||
} | |||
else if (view == binding.etAddr) {//选择用户地址 | |||
} else if (view == binding.tvUserIdTime) {//用户证件有效期 | |||
new DateDialog.Builder(this) | |||
.setTitle(getString(R.string.date_title)) | |||
.setConfirm(getString(R.string.common_confirm)) | |||
.setCancel(getString(R.string.common_cancel)) | |||
.setListener((dialog, year, month, day) -> { | |||
binding.tvUserIdTime.setText(year + "-" + month + "-" + day); | |||
}).show(); | |||
} else if (view == binding.btnNext) {//变更用户信息 | |||
checkParams(); | |||
} else if (view == binding.etUnitUserType) {//经办人证件类型 | |||
IDTypeDialog.showIDTypeDialog(this, new IDTypeDialog.OnUserTypeCallbcak() { | |||
@Override | |||
public void onUserType(String userType, String userTypeValue) { | |||
binding.etUnitUserType.setText(userType); | |||
curUserType = userTypeValue; | |||
} | |||
}); | |||
} else if (view == binding.ivUser1) {//用户正面照 | |||
onOCRImg(1, binding.ivUser1); | |||
} else if (view == binding.ivUser2) {//用户反面照 | |||
onOCRImg(2, binding.ivUser2); | |||
} else if (view == binding.ivUnit1) {//营业执照 | |||
onImage(3, binding.ivUnit1); | |||
} else if (view == binding.ivUnit2) {//用户证件照 | |||
onOCRImg(4, binding.ivUnit2); | |||
} | |||
} | |||
private void toSubmitInfo() { | |||
showDialog("用户信息变更中..."); | |||
Map<String, String> params = new HashMap<>(); | |||
params.put("customerId", curUserType); | |||
params.put("customerName", curUserType); | |||
params.put("openId", curUserType); | |||
params.put("userPosImgUrl", curUserType); | |||
params.put("userNegImgUrl", curUserType); | |||
params.put("tel", curUserType); | |||
params.put("address", curUserType); | |||
params.put("sceneType", curUserType); | |||
params.put("newMobileCode", curUserType); | |||
MyRetrofit.newInstance(IFCode.IFCODE520, params, new MyRetrofit.ReturnResult() { | |||
@Override | |||
public void onSuccess(ResultBean resultBean, ResultBean.BizContent bizContent) { | |||
hideDialog(); | |||
Bundle bundle = new Bundle(); | |||
bundle.putString("from", "11"); | |||
jumpToPage(CommonDealSuccessActivity.class, bundle); | |||
finish(); | |||
} | |||
@Override | |||
public void onError(Response<Result> resp) { | |||
hideDialog(); | |||
} | |||
}); | |||
} | |||
/** | |||
* 发送验证码 | |||
*/ | |||
private void sendCode(String phone) { | |||
showDialog("发送中..."); | |||
Map<String, String> params = new HashMap<>(); | |||
params.put("mobile", phone); | |||
MyRetrofit.newInstance(IFCode.IFCODE2, params, new MyRetrofit.ReturnResult() { | |||
@Override | |||
public void onSuccess(ResultBean resultBean, ResultBean.BizContent bizContent) { | |||
hideDialog(); | |||
toast("验证码发送成功!"); | |||
if (curBizContent.getUserType().equals("1")) { | |||
mCountDownTimerUtils = new CodeCountDown(EditUserInfoStep2Activity.this, binding.mUserGetCodeBtn, 60000, 1000); | |||
}else{ | |||
mCountDownTimerUtils = new CodeCountDown(EditUserInfoStep2Activity.this, binding.mUnitGetCodeBtn, 60000, 1000); | |||
} | |||
mCountDownTimerUtils.start(); | |||
} | |||
@Override | |||
public void onError() { | |||
MyRetrofit.ReturnResult.super.onError(); | |||
hideDialog(); | |||
} | |||
}); | |||
} | |||
@Override | |||
protected void onDestroy() { | |||
super.onDestroy(); | |||
if (mCountDownTimerUtils != null) { | |||
mCountDownTimerUtils.cancel(); | |||
mCountDownTimerUtils = null; | |||
} | |||
} | |||
/** | |||
* 图片上传 | |||
* | |||
* @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; | |||
} | |||
} | |||
} | |||
@Override | |||
public void onError(String err, Response<Result> resp) { | |||
super.onError(err, resp); | |||
hideDialog(); | |||
} | |||
}); | |||
}); | |||
} | |||
/** | |||
* 需要识别的图片 | |||
* | |||
* @param type 1-用户正面照 2-用户反面照 3-经办人正面照 | |||
* @param imageView | |||
*/ | |||
@SuppressLint({"NewApi", "LogNotTimber"}) | |||
@SingleClick | |||
private void onOCRImg(int type, ImageView imageView) { | |||
ImageSelectActivity.start(this, data -> { | |||
file = new File(data.get(0)); | |||
Luban.with(this) .load(file).ignoreBy(100).setCompressListener(new OnCompressListener() { | |||
@Override | |||
public void onStart() { | |||
} | |||
@Override | |||
public void onSuccess(File file) { | |||
//压缩成功后调用,返回压缩后的图片文件 | |||
postDelayed(() -> OCRspot(type,QRCode.imageToBase64(file.getPath()), | |||
imageView, file.getPath(), file), 200); | |||
} | |||
@Override | |||
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.bizContent = new SendTheVerificationCodeBean(); | |||
fatherBean.bizContent.setSource("1"); | |||
fatherBean.bizContent.setAgencyId("52010106004"); | |||
fatherBean.bizContent.setImageType(String.valueOf(type == 3 ? 1 : type)); //1正,2反 | |||
fatherBean.bizContent.setFileName(System.currentTimeMillis() + ".png"); | |||
fatherBean.bizContent.setImageBase64(base64); | |||
destroy(); | |||
showDialog("证件信息识别中..."); | |||
RequestParameters parameters1 = new RequestParameters(IFCode.IFCODE15, new Gson().toJson(fatherBean.bizContent)); | |||
new MyRetrofit().getRetrofit().create(Api.class).message2(parameters1).enqueue(new Converter<Result>() { | |||
@Override | |||
protected void onSuccess(ResultBean resultBean, ResultBean.BizContent bizContent1) { | |||
hideDialog(); | |||
GlideApp.with(getActivity()).load(mAvatarUrl).into(imageView); | |||
if (type == 1) {//用户正面 | |||
userImg1 = bizContent1.getImageUrl(); | |||
binding.etUserName.setText(bizContent1.getName()); | |||
binding.etCardId.setText(bizContent1.getIdno()); | |||
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 == 4) {//经办人正面 | |||
unitImg2 = bizContent1.getImageUrl(); | |||
binding.etUnitUserName.setText(bizContent1.getName()); | |||
binding.etUnitUserIds.setText(bizContent1.getIdno()); | |||
} | |||
if (outputFile != null) { | |||
postDelayed(() -> { | |||
if (outputFile.exists()) { | |||
outputFile.delete(); | |||
} | |||
}, 500); | |||
} | |||
} | |||
@Override | |||
public void onError(String err, Response<Result> resp) { | |||
super.onError(err, resp); | |||
hideDialog(); | |||
if (outputFile != null) { | |||
postDelayed(() -> { | |||
if (outputFile.exists()) { | |||
outputFile.delete(); | |||
} | |||
}, 500); | |||
} | |||
} | |||
}); | |||
} | |||
@Override | |||
protected void initData() { | |||
} | |||
} |
@@ -92,7 +92,7 @@ public class OrderDetailsActivity extends AppActivity implements StatusAction { | |||
addItemView(binding.LLBaseInfoContent,"订单编号",FunHelper.isEmpty(orderData.getOrderId()) ? "" : orderData.getOrderId(),1,false); | |||
addItemView(binding.LLBaseInfoContent,"业务类型",FunHelper.getOrderTypeName(FunHelper.isEmpty(orderData.orderType) ? "" : orderData.orderType),1,false); | |||
addItemView(binding.LLBaseInfoContent,"订单车牌号",FunHelper.isEmpty(orderData.getVehiclePlate()) ? "" : orderData.getVehiclePlate(),1,false); | |||
addItemView(binding.LLBaseInfoContent,"用户类型",orderData.getUserType().equals("UNIT_USER") ? "单位" : "个人",1,false); | |||
addItemView(binding.LLBaseInfoContent,"用户类型",(orderData.getUserType().equals("PERSONAL_USER") || orderData.getUserType().equals("1")) ? "个人" : "单位",1,false); | |||
addItemView(binding.LLBaseInfoContent,"车辆类型",FunHelper.getCarTypeName(FunHelper.isEmpty(orderData.getType()) ? "":orderData.getType()),1,false); | |||
addItemView(binding.LLBaseInfoContent,"订单金额","¥ " + (Integer.parseInt(FunHelper.isEmpty(orderData.getAmount()) ? "0" : orderData.getAmount()) * 0.01),2,false); | |||
addItemView(binding.LLBaseInfoContent,"订单状态",FunHelper.getOrderStatusName(Integer.parseInt(FunHelper.isEmpty(orderData.getOrderStep()) ? "" : orderData.getOrderStep())),1,false); |
@@ -18,6 +18,8 @@ import com.huntersun.vkyes.etcopencard.project.ui.activity.after.BalanceReplacem | |||
import com.huntersun.vkyes.etcopencard.project.ui.activity.after.CardUnlockPinActivity; | |||
import com.huntersun.vkyes.etcopencard.project.ui.activity.after.CheckRunningWaterStep1Activity; | |||
import com.huntersun.vkyes.etcopencard.project.ui.activity.after.DevicePendingActivity; | |||
import com.huntersun.vkyes.etcopencard.project.ui.activity.after.EditUserInfoStep1Activity; | |||
import com.huntersun.vkyes.etcopencard.project.ui.activity.after.EditUserInfoStep2Activity; | |||
import com.huntersun.vkyes.etcopencard.project.ui.activity.after.EquipmentLossReportActivity; | |||
import com.huntersun.vkyes.etcopencard.project.ui.activity.after.EquipmentUpgradeActivity; | |||
import com.huntersun.vkyes.etcopencard.project.ui.activity.after.ExtraCreditStep1Activity; | |||
@@ -219,6 +221,12 @@ public class FragmentHomeTow extends TitleBarFragment<MainActivity> { | |||
case "通行流水查询": | |||
jumpToPage(CheckRunningWaterStep1Activity.class); | |||
break; | |||
case "用户信息变更": | |||
jumpToPage(EditUserInfoStep1Activity.class); | |||
break; | |||
case "车辆信息变更": | |||
jumpToPage(EditUserInfoStep2Activity.class); | |||
break; | |||
default: | |||
new Utils().showMessDialog(getActivity(), "功能正在开发中..."); | |||
break; |
@@ -0,0 +1,55 @@ | |||
<?xml version="1.0" encoding="utf-8"?> | |||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | |||
xmlns:app="http://schemas.android.com/apk/res-auto" | |||
style="@style/MatchMatch.Vertical" | |||
android:background="@color/background_color"> | |||
<com.hjq.bar.TitleBar | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:background="@color/white" | |||
app:leftIcon="@mipmap/back_black" | |||
app:lineVisible="false" | |||
app:title="用户信息变更" | |||
app:titleColor="@color/black" /> | |||
<androidx.core.widget.NestedScrollView | |||
style="@style/MatchWrap"> | |||
<LinearLayout | |||
style="@style/MatchWrap.Vertical"> | |||
<TextView | |||
android:id="@+id/tvTitle" | |||
style="@style/WrapWrap" | |||
android:paddingLeft="@dimen/dp_15" | |||
android:paddingTop="@dimen/dp_15" | |||
android:paddingRight="@dimen/dp_15" | |||
android:text="用户信息" | |||
android:textColor="@color/color_333333" | |||
android:textSize="@dimen/sp_16" | |||
android:textStyle="bold" /> | |||
<LinearLayout | |||
android:id="@+id/LLContent" | |||
style="@style/MatchWrap.Vertical" | |||
android:paddingHorizontal="@dimen/dp_15" | |||
android:paddingVertical="@dimen/dp_10" | |||
android:layout_marginVertical="@dimen/dp_15" | |||
android:background="@drawable/bg_white_radius" | |||
android:layout_marginHorizontal="@dimen/dp_15"/> | |||
<Button | |||
android:id="@+id/btnNext" | |||
style="@style/BtnShortStyle" | |||
android:layout_width="@dimen/dp_150" | |||
android:layout_height="@dimen/dp_40" | |||
android:layout_alignParentBottom="true" | |||
android:layout_centerHorizontal="true" | |||
android:layout_gravity="center" | |||
android:layout_marginTop="@dimen/dp_30" | |||
android:gravity="center" | |||
android:text="变更用户信息" | |||
android:textSize="@dimen/sp_14" /> | |||
</LinearLayout> | |||
</androidx.core.widget.NestedScrollView> | |||
</LinearLayout> |
@@ -0,0 +1,51 @@ | |||
<?xml version="1.0" encoding="utf-8"?> | |||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | |||
xmlns:app="http://schemas.android.com/apk/res-auto" | |||
xmlns:tools="http://schemas.android.com/tools" | |||
style="@style/MatchMatch.Vertical" | |||
android:background="@color/background_color"> | |||
<com.hjq.bar.TitleBar | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:background="@color/white" | |||
app:leftIcon="@mipmap/back_black" | |||
app:lineVisible="false" | |||
app:title="车辆信息变更" | |||
app:titleColor="@color/black" /> | |||
<androidx.core.widget.NestedScrollView style="@style/MatchWrap"> | |||
<LinearLayout | |||
android:id="@+id/LLSearchResult" | |||
style="@style/MatchWrap.Vertical"> | |||
<TextView | |||
android:id="@+id/tvTitle" | |||
style="@style/WrapWrap" | |||
android:paddingLeft="@dimen/dp_15" | |||
android:paddingTop="@dimen/dp_15" | |||
android:paddingRight="@dimen/dp_15" | |||
android:text="车辆信息更改" | |||
android:textColor="@color/color_333333" | |||
android:textSize="@dimen/sp_16" | |||
android:textStyle="bold" /> | |||
<Button | |||
android:id="@+id/btnNext" | |||
style="@style/BtnShortStyle" | |||
android:layout_width="wrap_content" | |||
android:layout_height="@dimen/dp_40" | |||
android:layout_alignParentBottom="true" | |||
android:layout_centerHorizontal="true" | |||
android:layout_gravity="center" | |||
android:layout_marginTop="@dimen/dp_30" | |||
android:layout_marginBottom="@dimen/dp_35" | |||
android:gravity="center" | |||
android:paddingHorizontal="@dimen/dp_30" | |||
android:text="确认变更信息" | |||
android:textSize="@dimen/sp_14" /> | |||
</LinearLayout> | |||
</androidx.core.widget.NestedScrollView> | |||
</LinearLayout> |
@@ -73,7 +73,6 @@ | |||
<LinearLayout | |||
android:id="@+id/LLStartTime" | |||
style="@style/AutoWrap.Horizontal" | |||
android:layout_height="@dimen/dp_35" | |||
android:background="@drawable/item_home_frame3" | |||
android:gravity="center_vertical" |
@@ -0,0 +1,112 @@ | |||
<?xml version="1.0" encoding="utf-8"?> | |||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | |||
xmlns:app="http://schemas.android.com/apk/res-auto" | |||
xmlns:tools="http://schemas.android.com/tools" | |||
style="@style/MatchMatch.Vertical" | |||
android:background="@color/background_color"> | |||
<com.hjq.bar.TitleBar | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:background="@color/white" | |||
app:leftIcon="@mipmap/back_black" | |||
app:lineVisible="false" | |||
app:title="用户信息变更" | |||
app:titleColor="@color/black" /> | |||
<TextView | |||
android:id="@+id/tvTitle" | |||
style="@style/WrapWrap" | |||
android:paddingLeft="@dimen/dp_15" | |||
android:paddingTop="@dimen/dp_15" | |||
android:paddingRight="@dimen/dp_15" | |||
android:text="通过证件号和证件类型搜索用户信息" | |||
android:textColor="@color/color_333333" | |||
android:textSize="@dimen/sp_16" | |||
android:textStyle="bold" /> | |||
<LinearLayout | |||
style="@style/MatchWrap.Vertical" | |||
android:layout_marginTop="@dimen/dp_15" | |||
android:layout_marginHorizontal="@dimen/dp_15" | |||
android:padding="@dimen/dp_8" | |||
android:background="@drawable/bg_white_radius"> | |||
<LinearLayout | |||
style="@style/MatchWrap.Horizontal" | |||
android:minHeight="@dimen/dp_45" | |||
android:background="#FFFFFF"> | |||
<TextView | |||
android:layout_width="@dimen/dp_80" | |||
android:layout_height="match_parent" | |||
android:drawableLeft="@mipmap/must" | |||
android:gravity="center_vertical" | |||
android:text="证件号" | |||
android:textSize="@dimen/sp_14" | |||
tools:ignore="UseCompatTextViewDrawableXml" /> | |||
<com.hjq.widget.view.ClearEditText | |||
android:id="@+id/etSearch" | |||
style="@style/EditTextStyle" | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:minHeight="@dimen/dp_45" | |||
android:background="@color/white" | |||
android:drawablePadding="@dimen/dp_15" | |||
android:hint="请输入发动机号码" | |||
android:paddingHorizontal="@dimen/dp_20" | |||
android:singleLine="false" /> | |||
</LinearLayout> | |||
<TextView style="@style/MatchOne.HorLine" /> | |||
<LinearLayout | |||
android:id="@+id/LLIdType" | |||
style="@style/MatchWrap.Horizontal" | |||
android:minHeight="@dimen/dp_45" | |||
android:background="#FFFFFF" | |||
android:gravity="center_vertical"> | |||
<TextView | |||
android:layout_width="@dimen/dp_80" | |||
android:layout_height="match_parent" | |||
android:drawableLeft="@mipmap/must" | |||
android:gravity="center_vertical" | |||
android:text="注册日期" | |||
android:textSize="@dimen/sp_14" | |||
tools:ignore="UseCompatTextViewDrawableXml" /> | |||
<androidx.appcompat.widget.AppCompatTextView | |||
android:id="@+id/tvIdType" | |||
style="@style/EditTextStyle" | |||
android:layout_width="0dp" | |||
android:layout_height="wrap_content" | |||
android:minWidth="@dimen/dp_45" | |||
android:layout_weight="1" | |||
android:background="@color/white" | |||
android:drawablePadding="@dimen/dp_15" | |||
android:gravity="center_vertical" | |||
android:hint="请选择用户证件类型" | |||
android:paddingHorizontal="@dimen/dp_20" | |||
android:singleLine="false" /> | |||
<ImageView | |||
android:layout_width="@dimen/dp_20" | |||
android:layout_height="@dimen/dp_20" | |||
android:src="@drawable/arrows_right_ic" /> | |||
</LinearLayout> | |||
</LinearLayout> | |||
<Button | |||
android:id="@+id/btnCheck" | |||
style="@style/BtnShortStyle" | |||
android:layout_width="@dimen/dp_150" | |||
android:layout_height="@dimen/dp_40" | |||
android:layout_alignParentBottom="true" | |||
android:layout_centerHorizontal="true" | |||
android:layout_gravity="center" | |||
android:layout_marginTop="@dimen/dp_30" | |||
android:gravity="center" | |||
android:text="变更用户信息" | |||
android:textSize="@dimen/sp_14" /> | |||
</LinearLayout> |