@@ -639,6 +639,15 @@ | |||
android:name=".project.ui.activity.after.EquipmentLossReportActivity" | |||
android:launchMode="singleTop" | |||
android:screenOrientation="portrait" /> | |||
<!--增补OBU--> | |||
<activity | |||
android:name=".project.ui.activity.after.AddObuStep1Activity" | |||
android:launchMode="singleTop" | |||
android:screenOrientation="portrait" /> | |||
<activity | |||
android:name=".project.ui.activity.after.AddObuStep2Activity" | |||
android:launchMode="singleTop" | |||
android:screenOrientation="portrait" /> | |||
</application> | |||
</manifest> |
@@ -176,4 +176,6 @@ public class IFCode { | |||
public static final String IFCODE_TRANSFER_CONFIRM = "b1e66d22fb6f400f915458f5c50c7118"; //操作接口 | |||
public static final String IFCODE_ACTIVE_OBUIMG = "4a95e1d90e824ee8a50aa9826617e736"; //设备激活照片上传 | |||
public static final String IFCODE_ADD_OBU = "837c22e80fa34506a0855306d9cbb6f7"; //增补OBU | |||
} |
@@ -6,7 +6,7 @@ package com.huntersun.vkyes.etcopencard.project.api.bean; | |||
import java.util.List; | |||
/** | |||
* TODO<json数据源> | |||
* <json数据源> | |||
* | |||
* @author: 小嵩 | |||
* @date: 2017/3/16 15:36 |
@@ -693,7 +693,7 @@ public class DateUtils { | |||
try { | |||
date = sdfSecond.parse(dateStr); | |||
} catch (ParseException e) { | |||
// TODO Auto-generated catch block | |||
// Auto-generated catch block | |||
e.printStackTrace(); | |||
} | |||
return date; |
@@ -122,10 +122,10 @@ public class QRCode { | |||
int length = in.read(bytes); | |||
base64 = Base64.encodeToString(bytes, 0, length, Base64.DEFAULT); | |||
} catch (FileNotFoundException e) { | |||
// TODO Auto-generated catch block | |||
// Auto-generated catch block | |||
e.printStackTrace(); | |||
} catch (IOException e) { | |||
// TODO Auto-generated catch block | |||
// Auto-generated catch block | |||
e.printStackTrace(); | |||
} finally { | |||
try { |
@@ -34,6 +34,7 @@ import com.huntersun.vkyes.etcopencard.src.action.StatusAction; | |||
import com.huntersun.vkyes.etcopencard.src.aop.SingleClick; | |||
import com.huntersun.vkyes.etcopencard.src.app.AppActivity; | |||
import com.huntersun.vkyes.etcopencard.src.widget.StatusLayout; | |||
import com.parkingwang.keyboard.PopupKeyboard; | |||
import com.scwang.smart.refresh.layout.api.RefreshLayout; | |||
import com.scwang.smart.refresh.layout.listener.OnRefreshLoadMoreListener; | |||
@@ -47,6 +48,8 @@ import retrofit2.Response; | |||
*/ | |||
public class BusinessDetectionActivity extends AppActivity | |||
implements OnRefreshLoadMoreListener, StatusAction { | |||
private PopupKeyboard popupKeyboard; | |||
private ActivityBusinessDetectionBinding binding; | |||
private int page = 1; | |||
private int orderStep = 0; | |||
@@ -68,9 +71,10 @@ public class BusinessDetectionActivity extends AppActivity | |||
binding.rlStatusRefresh.setOnRefreshListener(this); | |||
SearchCarInfoUtils searchUtils = new SearchCarInfoUtils(this, new SearchCarInfoUtils.OnCustomReqCallback() { | |||
@Override | |||
public void request(String vehicle, int vehicleColor) { | |||
public void request(String vehicle, int vehicleColor, PopupKeyboard mPopupKeyboard) { | |||
licensePlate = vehicle; | |||
licensePlateColor = vehicleColor; | |||
popupKeyboard = mPopupKeyboard; | |||
} | |||
}); | |||
searchUtils.setExpandParams(true,true); | |||
@@ -114,6 +118,10 @@ public class BusinessDetectionActivity extends AppActivity | |||
@SuppressLint("NotifyDataSetChanged") | |||
@Override | |||
protected void onSuccess(ResultBean resultBean, ResultBean.BizContent bizContent1) { | |||
if (popupKeyboard != null){ | |||
popupKeyboard.dismiss(BusinessDetectionActivity.this); | |||
} | |||
int totalSize = Integer.parseInt(bizContent1.getTotalCount()); // 获取总的数据条数 | |||
if (page == 1) { | |||
adapter.replaceData(bizContent1.getData()); | |||
@@ -133,6 +141,9 @@ public class BusinessDetectionActivity extends AppActivity | |||
@Override | |||
public void onError(String err, Response<Result> resp) { | |||
super.onError(err, resp); | |||
if (popupKeyboard != null){ | |||
popupKeyboard.dismiss(BusinessDetectionActivity.this); | |||
} | |||
showError(new StatusLayout.OnRetryListener() { | |||
@Override | |||
public void onRetry(StatusLayout layout) { |
@@ -0,0 +1,95 @@ | |||
package com.huntersun.vkyes.etcopencard.project.ui.activity.after; | |||
import android.os.Bundle; | |||
import android.view.View; | |||
import com.alibaba.fastjson.JSON; | |||
import com.huntersun.vkyes.etcopencard.databinding.ActivityAddObuStep1Binding; | |||
import com.huntersun.vkyes.etcopencard.project.api.Result; | |||
import com.huntersun.vkyes.etcopencard.project.api.bean.ResultBean; | |||
import com.huntersun.vkyes.etcopencard.project.utils.FunHelper; | |||
import com.huntersun.vkyes.etcopencard.project.utils.SearchCarInfoUtils; | |||
import com.huntersun.vkyes.etcopencard.src.aop.SingleClick; | |||
import com.huntersun.vkyes.etcopencard.src.app.AppActivity; | |||
/** | |||
* Date :2023-03-28 | |||
* Description:增补OBU 第一步 | |||
*/ | |||
public class AddObuStep1Activity extends AppActivity { | |||
private ActivityAddObuStep1Binding binding; | |||
private ResultBean.BizContent curBizContent; | |||
@Override | |||
protected View getLayoutView() { | |||
binding = ActivityAddObuStep1Binding.inflate(getLayoutInflater()); | |||
return binding.getRoot(); | |||
} | |||
@Override | |||
protected void initView() { | |||
binding.LLSearchResult.setVisibility(View.GONE); | |||
binding.LLBottom.setVisibility(View.GONE); | |||
new SearchCarInfoUtils(this, new SearchCarInfoUtils.OnSearchResultClick() { | |||
@Override | |||
public void onSearchResultSuccess(ResultBean.BizContent bizContent) { | |||
curBizContent = bizContent; | |||
setDataToView(); | |||
} | |||
@Override | |||
public void onSearchResultFail(Result result) { | |||
binding.LLSearchResult.setVisibility(View.GONE); | |||
binding.LLBottom.setVisibility(View.GONE); | |||
} | |||
}); | |||
binding.btnNext.setOnClickListener(new View.OnClickListener() { | |||
@Override | |||
@SingleClick | |||
public void onClick(View view) { | |||
Bundle bundle = new Bundle(); | |||
bundle.putString("dataJson", JSON.toJSONString(curBizContent)); | |||
jumpToPage(AddObuStep2Activity.class,bundle); | |||
finish(); | |||
} | |||
}); | |||
} | |||
private void setDataToView() { | |||
if (curBizContent == null) return; | |||
binding.LLSearchResult.setVisibility(View.VISIBLE); | |||
binding.LLBottom.setVisibility(View.VISIBLE); | |||
binding.LLCardInfo.setVisibility(View.GONE); | |||
binding.LLObuInfo.setVisibility(View.GONE); | |||
binding.tvOrderId.setText(curBizContent.getOrderId()); | |||
binding.tvUserName.setText(FunHelper.isEmpty(curBizContent.getCustomerName()) ? "" : curBizContent.getCustomerName()); | |||
binding.tvCardType.setText(FunHelper.isEmpty(curBizContent.getCustomerIdtype()) ? "" : curBizContent.getCustomerIdtype()); | |||
binding.tvCardNum.setText(FunHelper.isEmpty(curBizContent.getCustomerIdnum()) ? "" : curBizContent.getCustomerIdnum()); | |||
binding.tvVehiclePlate.setText(FunHelper.isEmpty(curBizContent.getVehiclePlate()) ? "" : curBizContent.getVehiclePlate()); | |||
binding.tvColor.setText(FunHelper.isEmpty(curBizContent.getVehiclePlateColorStr()) ? "" : curBizContent.getVehiclePlateColorStr()); | |||
binding.tvCarType.setText(FunHelper.isEmpty(curBizContent.getType()) ? "" : FunHelper.getCarTypeName(curBizContent.getType())); | |||
//显示卡信息 | |||
if (!FunHelper.isEmpty(curBizContent.getCardId())) { | |||
binding.LLCardInfo.setVisibility(View.VISIBLE); | |||
binding.tvCardIdInfo.setText(FunHelper.isEmpty(curBizContent.getCardId()) ? "卡号:" : "卡号:" + curBizContent.getCardId()); | |||
binding.tvCardTypeInfo.setText(FunHelper.isEmpty(curBizContent.getIsValueCard()) ? "卡类型:" : "卡类型:" + (curBizContent.getIsValueCard().equals("1") ? "记账卡" : "储值卡")); | |||
binding.tvCardStatusInfo.setText(FunHelper.isEmpty(curBizContent.getCardStatus()) ? "卡状态:" : "卡状态:" + FunHelper.getETCStatusName(Integer.parseInt(curBizContent.getCardStatus()))); | |||
} | |||
//显示签信息 | |||
if (!FunHelper.isEmpty(curBizContent.getObuId())) { | |||
binding.LLObuInfo.setVisibility(View.VISIBLE); | |||
binding.tvOBUIdInfo.setText(FunHelper.isEmpty(curBizContent.getObuId()) ? "OBU:" : "OBU:" + curBizContent.getObuId()); | |||
binding.tvOBUTypeInfo.setText(FunHelper.isEmpty(curBizContent.getObuStatus()) ? "OBU状态:" : "OBU状态:" + FunHelper.getOBUStatusName(Integer.parseInt(curBizContent.getObuStatus()))); | |||
} | |||
} | |||
@Override | |||
protected void initData() { | |||
} | |||
} |
@@ -0,0 +1,241 @@ | |||
package com.huntersun.vkyes.etcopencard.project.ui.activity.after; | |||
import android.os.Bundle; | |||
import android.view.View; | |||
import android.widget.RadioGroup; | |||
import com.alibaba.fastjson.JSON; | |||
import com.huntersun.vkyes.etcopencard.R; | |||
import com.huntersun.vkyes.etcopencard.databinding.ActivityAddObuStep2Binding; | |||
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.ConfirmDialog; | |||
import com.huntersun.vkyes.etcopencard.project.tool.MyShared; | |||
import com.huntersun.vkyes.etcopencard.project.utils.Constants; | |||
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.other.CodeCountDown; | |||
import com.huntersun.vkyes.etcopencard.src.ui.dialog.AddressDialog; | |||
import java.util.HashMap; | |||
import java.util.Map; | |||
import retrofit2.Response; | |||
/** | |||
* Date :2023-03-28 | |||
* Description:增补OBU 第2步 | |||
*/ | |||
public class AddObuStep2Activity extends AppActivity { | |||
private ActivityAddObuStep2Binding binding; | |||
private ResultBean.BizContent curBizContent; | |||
private CodeCountDown mCountDownTimerUtils; | |||
//邮寄方式 0-不邮寄 1-邮寄 | |||
private int sendStatus = 0; | |||
@Override | |||
protected View getLayoutView() { | |||
binding = ActivityAddObuStep2Binding.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.LLMailInfo.setVisibility(View.GONE); | |||
binding.LLArea.setOnClickListener(this::initClick); | |||
binding.btnNext.setOnClickListener(this::initClick); | |||
binding.mGetCodeBtn.setOnClickListener(this::initClick); | |||
binding.rgMail.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() { | |||
@Override | |||
public void onCheckedChanged(RadioGroup radioGroup, int i) { | |||
setViewByRbChange(); | |||
} | |||
}); | |||
if (curBizContent == null) return; | |||
initDefaultDataToView(); | |||
} | |||
/* | |||
* 设置默认值显示 | |||
*/ | |||
private void initDefaultDataToView(){ | |||
binding.etUserName.setText(FunHelper.isEmpty(curBizContent.getCustomerName()) ? "" : curBizContent.getCustomerName()); | |||
binding.etPhone.setText(FunHelper.isEmpty(curBizContent.getCustomerTel()) ? "" : curBizContent.getCustomerTel()); | |||
binding.tvArea.setText(FunHelper.isEmpty(curBizContent.area) ? "" : curBizContent.area); | |||
binding.etAddr.setText(FunHelper.isEmpty(curBizContent.address) ? "" : curBizContent.address); | |||
binding.etPostCard.setText(FunHelper.isEmpty(curBizContent.postCode) ? "" : curBizContent.postCode); | |||
binding.tvMobile.setText(FunHelper.isEmpty(curBizContent.getCustomerTel()) ? "" : curBizContent.getCustomerTel()); | |||
binding.rbNoMail.setChecked(true); | |||
binding.rbMail.setChecked(false); | |||
setViewByRbChange(); | |||
} | |||
private void setViewByRbChange(){ | |||
binding.LLMailInfo.setVisibility(binding.rbMail.isChecked() ? View.VISIBLE : View.GONE); | |||
sendStatus = binding.rbMail.isChecked() ? 1 : 0; | |||
} | |||
private void checkParams(){ | |||
if (!binding.rbMail.isChecked() && !binding.rbNoMail.isChecked()){ | |||
toast("请选择邮寄方式"); | |||
return; | |||
} | |||
if (sendStatus == 1){ | |||
if (FunHelper.isEmpty(FunHelper.getText(binding.etUserName))){ | |||
toast("请输入姓名"); | |||
return; | |||
} | |||
if (FunHelper.isEmpty(FunHelper.getText(binding.etPhone))){ | |||
toast("请输入电话"); | |||
return; | |||
} | |||
if (FunHelper.isEmpty(FunHelper.getText(binding.tvArea))){ | |||
toast("请选择地区"); | |||
return; | |||
} | |||
if (FunHelper.isEmpty(FunHelper.getText(binding.etAddr))){ | |||
toast("请输入详细地址"); | |||
return; | |||
} | |||
} | |||
if (FunHelper.isEmpty(FunHelper.getText(binding.etCode))){ | |||
toast("请输入验证码!"); | |||
return; | |||
} | |||
checkUser(); | |||
} | |||
/** | |||
* 校验用户 | |||
*/ | |||
private void checkUser() { | |||
showDialog("校验用户信息中..."); | |||
Map<String, String> params = new HashMap<>(); | |||
params.put("mobile", curBizContent.getCustomerTel()); | |||
params.put("code", FunHelper.getText(binding.etCode)); | |||
MyRetrofit.newInstance(IFCode.IFCODE966, params, new MyRetrofit.ReturnResult() { | |||
@Override | |||
public void onSuccess(ResultBean resultBean, ResultBean.BizContent bizContent) { | |||
submit(); | |||
} | |||
@Override | |||
public void onError() { | |||
MyRetrofit.ReturnResult.super.onError(); | |||
hideDialog(); | |||
//TODO 测试 绕过短信验证码校验 | |||
//submit(); | |||
} | |||
}); | |||
} | |||
/** | |||
* 发送验证码 | |||
*/ | |||
private void sendCode() { | |||
showDialog("发送中..."); | |||
Map<String, String> params = new HashMap<>(); | |||
params.put("mobile", curBizContent.getCustomerTel()); | |||
MyRetrofit.newInstance(IFCode.IFCODE2, params, new MyRetrofit.ReturnResult() { | |||
@Override | |||
public void onSuccess(ResultBean resultBean, ResultBean.BizContent bizContent) { | |||
hideDialog(); | |||
toast("验证码发送成功!"); | |||
mCountDownTimerUtils = new CodeCountDown(AddObuStep2Activity.this, binding.mGetCodeBtn, 60000, 1000); | |||
mCountDownTimerUtils.start(); | |||
} | |||
@Override | |||
public void onError() { | |||
MyRetrofit.ReturnResult.super.onError(); | |||
hideDialog(); | |||
} | |||
}); | |||
} | |||
private void submit(){ | |||
Map<String, String> params = new HashMap<>(); | |||
params.put("orderId", FunHelper.isEmpty(curBizContent.getOrderId()) ? "" : curBizContent.getOrderId()); | |||
params.put("openId", (String) MyShared.getInstance().get(MyShared.OPENID, "")); | |||
params.put("configId",Constants.PAY_CONFIG_ID); | |||
params.put("receiveMethod", String.valueOf(sendStatus)); | |||
params.put("customerName", FunHelper.getText(binding.etUserName)); | |||
params.put("customerTel", FunHelper.getText(binding.etPhone)); | |||
params.put("address", FunHelper.getText(binding.etAddr)); | |||
params.put("area", FunHelper.getText(binding.tvArea)); | |||
params.put("postCode", FunHelper.getText(binding.etPostCard)); | |||
MyRetrofit.newInstance(IFCode.IFCODE_ADD_OBU, params, new MyRetrofit.ReturnResult() { | |||
@Override | |||
public void onSuccess(ResultBean resultBean, ResultBean.BizContent bizContent) { | |||
hideDialog(); | |||
Bundle bundle = new Bundle(); | |||
bundle.putString("from","14"); | |||
jumpToPage(CommonDealSuccessActivity.class,bundle); | |||
finish(); | |||
} | |||
@Override | |||
public void onError(Response<Result> resp) { | |||
hideDialog(); | |||
showErrorMsg(resp.body().errorMsg); | |||
} | |||
}); | |||
} | |||
private void showErrorMsg(String errorMsg){ | |||
new ConfirmDialog.Builder(AddObuStep2Activity.this).setMsg(errorMsg, "无法增补OBU","确定","", R.mipmap.icon_lotgout_etc_hint, 0,true) | |||
.onClick(new ConfirmDialog.Result() { | |||
@Override | |||
public void confirm() { } | |||
}).show(); | |||
} | |||
@SingleClick | |||
private void initClick(View view){ | |||
if (view == binding.LLArea){//选择地区 | |||
new AddressDialog.Builder(AddObuStep2Activity.this) | |||
.setProvince("贵州省") | |||
.setCity("贵阳市") | |||
.setListener((dialog, province, city, area) -> { | |||
String address = province + "/" + city + "/" + area; | |||
binding.tvArea.setText(address); | |||
}).show(); | |||
}else if (view == binding.btnNext){//提交 | |||
checkParams(); | |||
}else if (view == binding.mGetCodeBtn){//发送验证码 | |||
sendCode(); | |||
} | |||
} | |||
@Override | |||
protected void onDestroy() { | |||
super.onDestroy(); | |||
if (mCountDownTimerUtils != null){ | |||
mCountDownTimerUtils.cancel(); | |||
mCountDownTimerUtils = null; | |||
} | |||
} | |||
@Override | |||
protected void initData() { | |||
} | |||
} |
@@ -16,6 +16,7 @@ import com.huntersun.vkyes.etcopencard.project.utils.SearchCarInfoUtils; | |||
import com.huntersun.vkyes.etcopencard.src.action.StatusAction; | |||
import com.huntersun.vkyes.etcopencard.src.app.AppActivity; | |||
import com.huntersun.vkyes.etcopencard.src.widget.StatusLayout; | |||
import com.parkingwang.keyboard.PopupKeyboard; | |||
import com.scwang.smart.refresh.layout.api.RefreshLayout; | |||
import com.scwang.smart.refresh.layout.listener.OnRefreshLoadMoreListener; | |||
@@ -36,7 +37,7 @@ public class CheckRunningWaterStep1Activity extends AppActivity implements OnRef | |||
private CheckRunningCardListAdapter adapter; | |||
private String curVehicleId; | |||
private EditText etSearch; | |||
private PopupKeyboard popupKeyboard; | |||
@Override | |||
protected View getLayoutView() { | |||
@@ -67,10 +68,10 @@ public class CheckRunningWaterStep1Activity extends AppActivity implements OnRef | |||
new SearchCarInfoUtils(this,new SearchCarInfoUtils.OnCustomReqCallback() { | |||
@Override | |||
public void request(String vehicleId) { | |||
public void request(String vehicleId, PopupKeyboard mPopupKeyboard) { | |||
binding.rlStatusRefresh.setVisibility(View.VISIBLE); | |||
curVehicleId = vehicleId; | |||
//etSearch = et; | |||
popupKeyboard = mPopupKeyboard; | |||
getList(); | |||
} | |||
}); | |||
@@ -82,7 +83,8 @@ public class CheckRunningWaterStep1Activity extends AppActivity implements OnRef | |||
MyRetrofit.newInstance(IFCode.IFCODE152, params, new MyRetrofit.ReturnResult() { | |||
@Override | |||
public void onSuccess(ResultBean resultBean, ResultBean.BizContent bizContent) { | |||
FunHelper.closeKeyboard(etSearch); | |||
//FunHelper.closeKeyboard(etSearch); | |||
if (popupKeyboard != null) popupKeyboard.dismiss(CheckRunningWaterStep1Activity.this); | |||
if (FunHelper.isEmpty(bizContent.cards)) { | |||
postDelayed(CheckRunningWaterStep1Activity.this::showEmpty, 300); | |||
return; | |||
@@ -93,6 +95,7 @@ public class CheckRunningWaterStep1Activity extends AppActivity implements OnRef | |||
@Override | |||
public void onError(Response<Result> resp) { | |||
if (popupKeyboard != null) popupKeyboard.dismiss(CheckRunningWaterStep1Activity.this); | |||
showError(new StatusLayout.OnRetryListener() { | |||
@Override | |||
public void onRetry(StatusLayout layout) { |
@@ -85,7 +85,7 @@ public class CheckRunningWaterStep2Activity extends AppActivity { | |||
MyRetrofit.ReturnResult.super.onError(); | |||
hideDialog(); | |||
//TODO 测试 | |||
//TODO 测试 绕过短信验证码校验 | |||
/*Bundle bundle = new Bundle(); | |||
bundle.putString("dataJson", JSON.toJSONString(curBizContent)); | |||
jumpToPage(CheckRunningWaterStep3Activity.class, bundle);*/ |
@@ -104,11 +104,12 @@ public class CheckRunningWaterStep3Activity extends AppActivity implements OnRef | |||
days = DateUtils.daysBetween(FunHelper.getText(binding.tvStartTime),time); | |||
} | |||
//TODO 测试 | |||
//TODO 测试 为了测试数据,暂时注销 | |||
/*if (days > 62){ | |||
toast("最大查询月份只能为2个月"); | |||
return; | |||
}*/ | |||
textView.setText(time); | |||
}).show(); |
@@ -17,7 +17,7 @@ public class CommonDealSuccessActivity extends AppActivity { | |||
//0-注销成功 1-欠费补缴 2-余额补领 3-Pin码锁解锁成功 4-更换ETC设备成功 5-停用成功 | |||
//6-启用成功 7-卡签续期 8-储值卡转记账卡 9-设备升级 10-过户成功 11-用户信息变更成功 | |||
// 12- 单位信息变更成功 13-车辆用户信息变更成功 | |||
// 12- 单位信息变更成功 13-车辆用户信息变更成功 14-增补OBU成功 | |||
private String from; | |||
//传递的订单ID | |||
@@ -91,8 +91,11 @@ public class CommonDealSuccessActivity extends AppActivity { | |||
}else if (from.equals("13")){ | |||
setTitle("车辆信息变更"); | |||
binding.tvHint.setText("车辆信息变更成功"); | |||
} | |||
}else if (from.equals("14")){ | |||
setTitle("增补OBU成功"); | |||
binding.tvHint.setText("增补OBU已提交申请"); | |||
} | |||
binding.btnHome.setOnClickListener(new View.OnClickListener() { | |||
@Override |
@@ -16,6 +16,7 @@ import com.huntersun.vkyes.etcopencard.project.utils.SearchCarInfoUtils; | |||
import com.huntersun.vkyes.etcopencard.src.aop.SingleClick; | |||
import com.huntersun.vkyes.etcopencard.src.app.AppActivity; | |||
import com.huntersun.vkyes.etcopencard.src.other.CodeCountDown; | |||
import com.parkingwang.keyboard.PopupKeyboard; | |||
import java.util.HashMap; | |||
import java.util.Map; | |||
@@ -29,12 +30,13 @@ import retrofit2.Response; | |||
public class EditCarInfoStep1Activity extends AppActivity { | |||
private ActivityEditCarInfoStep1Binding binding; | |||
private EditText etSearch; | |||
private PopupKeyboard popupKeyboard; | |||
private String curVehicleId; | |||
private ResultBean.BizContent curBizContent; | |||
private CodeCountDown mCountDownTimerUtils; | |||
@Override | |||
protected View getLayoutView() { | |||
binding = ActivityEditCarInfoStep1Binding.inflate(getLayoutInflater()); | |||
@@ -46,8 +48,8 @@ public class EditCarInfoStep1Activity extends AppActivity { | |||
binding.LLUserInfo.setVisibility(View.GONE); | |||
new SearchCarInfoUtils(this, new SearchCarInfoUtils.OnCustomReqCallback() { | |||
@Override | |||
public void request(String vehicleId) { | |||
//etSearch = et; | |||
public void request(String vehicleId, PopupKeyboard mPopupKeyboard) { | |||
popupKeyboard = mPopupKeyboard; | |||
curVehicleId = vehicleId; | |||
getCarInfo(); | |||
} | |||
@@ -77,7 +79,8 @@ public class EditCarInfoStep1Activity extends AppActivity { | |||
MyRetrofit.newInstance(IFCode.IFCODE154, params, new MyRetrofit.ReturnResult() { | |||
@Override | |||
public void onSuccess(ResultBean resultBean, ResultBean.BizContent bizContent) { | |||
FunHelper.closeKeyboard(etSearch); | |||
//FunHelper.closeKeyboard(etSearch); | |||
if (popupKeyboard != null) popupKeyboard.dismiss(EditCarInfoStep1Activity.this); | |||
if (bizContent == null || FunHelper.isEmpty(bizContent.vehicles)) { | |||
toast("车俩信息不存在"); | |||
return; | |||
@@ -89,6 +92,7 @@ public class EditCarInfoStep1Activity extends AppActivity { | |||
@Override | |||
public void onError(Response<Result> resp) { | |||
if (popupKeyboard != null) popupKeyboard.dismiss(EditCarInfoStep1Activity.this); | |||
binding.LLUserInfo.setVisibility(View.GONE); | |||
} | |||
}); |
@@ -40,9 +40,6 @@ public class EditUserInfoStep1Activity extends AppActivity { | |||
binding.LLIdType.setOnClickListener(this::initClick); | |||
binding.tvIdType.setOnClickListener(this::initClick); | |||
binding.btnCheck.setOnClickListener(this::initClick); | |||
//TODO 测试 | |||
//binding.etSearch.setText("522225198805108157"); | |||
} | |||
private void getUserInfoById() { |
@@ -152,8 +152,8 @@ public class EquipmentLossReportActivity extends AppActivity { | |||
public void onError(Response<Result> resp) { | |||
hideDialog(); | |||
//TODO 测试 | |||
cardReportTheLoss(); | |||
//TODO 测试 绕过短信验证码校验 | |||
//cardReportTheLoss(); | |||
} | |||
}); | |||
} |
@@ -237,7 +237,7 @@ public class ReplaceEtcStep4Activity extends AppActivity { | |||
public void onError(Response<Result> resp) { | |||
hideDialog(); | |||
//TODO 测试 | |||
//TODO 测试 绕过短信验证码校验 | |||
/*if (cancel){//取消申请 | |||
cancelApply(); | |||
return; |
@@ -40,7 +40,7 @@ public class ExtraCreditAdapter extends BaseQuickAdapter<ResultBean.BizContent, | |||
if (bizContent.refundType.equals(Constants.BALANCE_TYPE_GLYQR) || bizContent.refundType.equals(Constants.BALANCE_TYPE_BALSUP)){ | |||
holder.setGone(R.id.btn,true ); | |||
holder.setGone(R.id.tvStatus,false); | |||
holder.setText(R.id.btn,bizContent.refundType.equals(Constants.BALANCE_TYPE_GLYQR) ? "余额补领" : "圈存"); | |||
holder.setText(R.id.btn,bizContent.refundType.equals(Constants.BALANCE_TYPE_GLYQR) ? "补卡额" : "补卡额"); | |||
}else{ | |||
holder.setGone(R.id.btn,false ); | |||
holder.setGone(R.id.tvStatus,true ); |
@@ -15,6 +15,7 @@ import com.huntersun.vkyes.etcopencard.project.api.bean.TestBean; | |||
import com.huntersun.vkyes.etcopencard.project.tool.Utils; | |||
import com.huntersun.vkyes.etcopencard.project.ui.activity.BusinessDetectionActivity; | |||
import com.huntersun.vkyes.etcopencard.project.ui.activity.MainActivity; | |||
import com.huntersun.vkyes.etcopencard.project.ui.activity.after.AddObuStep1Activity; | |||
import com.huntersun.vkyes.etcopencard.project.ui.activity.after.BalanceReplacementStep1Activity; | |||
import com.huntersun.vkyes.etcopencard.project.ui.activity.after.CardUnlockPinActivity; | |||
import com.huntersun.vkyes.etcopencard.project.ui.activity.after.CheckRunningWaterStep1Activity; | |||
@@ -72,12 +73,11 @@ public class FragmentHomeTow extends TitleBarFragment<MainActivity> { | |||
{R.mipmap.card11, "卡Pin码解锁"}, | |||
{R.mipmap.card10, "欠费补缴"}, | |||
{R.mipmap.card10, "余额补领"}, | |||
//未完成的 | |||
{R.mipmap.card16, "ETC过户"}, | |||
{R.mipmap.card6, "用户信息变更"}, | |||
{R.mipmap.card7, "车辆信息变更"}, | |||
{R.mipmap.card5, "通行流水查询"}, | |||
{R.mipmap.card17, "增补OBU"}, | |||
{R.mipmap.card2, "补卡额申请"}, | |||
//下面暂时隐藏 | |||
@@ -269,6 +269,9 @@ public class FragmentHomeTow extends TitleBarFragment<MainActivity> { | |||
case "车辆信息变更": | |||
jumpToPage(EditCarInfoStep1Activity.class); | |||
break; | |||
case "增补OBU": | |||
jumpToPage(AddObuStep1Activity.class); | |||
break; | |||
default: | |||
new Utils().showMessDialog(getActivity(), "功能正在开发中..."); | |||
break; |
@@ -12,6 +12,7 @@ import android.os.Environment; | |||
import android.provider.DocumentsContract; | |||
import com.blankj.utilcode.util.LogUtils; | |||
import com.hjq.base.util.FileHelper; | |||
import com.hjq.http.EasyHttp; | |||
import com.hjq.http.listener.OnDownloadListener; | |||
import com.hjq.http.model.HttpMethod; | |||
@@ -40,15 +41,14 @@ public class FileUtils { | |||
/* | |||
* 打开文件所在目录 | |||
*/ | |||
private static void openFolder(AppActivity mContext,String path) { | |||
// Uri uri = Uri.parse("content://com.android.externalstorage.documents/document/primary:Download"); | |||
// Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT); | |||
// intent.addCategory(Intent.CATEGORY_OPENABLE); | |||
// intent.setType("*/*"); | |||
// intent.putExtra(DocumentsContract.EXTRA_INITIAL_URI, uri); | |||
// mContext.startActivityForResult(intent, 1); | |||
} | |||
private static void openFolder(AppActivity activity,String path) { | |||
/*try { | |||
Intent intent = FileHelper.openFile(activity,path); | |||
activity.startActivity(intent); | |||
}catch (Exception e){ | |||
}*/ | |||
} | |||
/* | |||
* 下载 文件(不在通知栏展示) | |||
@@ -81,7 +81,7 @@ public class FileUtils { | |||
LogUtils.e("下载完成>>>>>>", file.getAbsolutePath()); | |||
mDownloadComplete = true; | |||
new ConfirmDialog.Builder(activity).setMsg("文件所在路径:" + file.getAbsolutePath(), "下载完成", "立即查看", "知道了", R.mipmap.icon_finish_order, 0, false) | |||
new ConfirmDialog.Builder(activity).setMsg("文件所在路径:" + file.getAbsolutePath(), "下载完成", "知道了", "", R.mipmap.icon_finish_order, 0, true) | |||
.onClick(new ConfirmDialog.Result() { | |||
@Override | |||
public void confirm() { |
@@ -270,8 +270,8 @@ public class SearchCarInfoUtils { | |||
} | |||
if (reqCallback != null) { | |||
reqCallback.request(inputView.getNumber() + "_" + vehiclePlateColor); | |||
reqCallback.request(inputView.getNumber(), vehiclePlateColor); | |||
reqCallback.request(inputView.getNumber() + "_" + vehiclePlateColor,mPopupKeyboard); | |||
reqCallback.request(inputView.getNumber() , vehiclePlateColor,mPopupKeyboard); | |||
return; | |||
} | |||
@@ -284,6 +284,7 @@ public class SearchCarInfoUtils { | |||
@Override | |||
public void onSuccess(ResultBean resultBean, ResultBean.BizContent bizContent) { | |||
//FunHelper.closeKeyboard(etSearch); | |||
mPopupKeyboard.dismiss(mContext); | |||
mContext.hideDialog(); | |||
//设置车牌颜色文字 | |||
bizContent.setVehiclePlateColorStr(EnumBean.backValue(bizContent.getVehiclePlateColor(), EnumBean.VehicleColorArray)); | |||
@@ -314,14 +315,7 @@ public class SearchCarInfoUtils { | |||
//自定义请求 | |||
public interface OnCustomReqCallback { | |||
default void request(String vehicleId) { | |||
} | |||
; | |||
default void request(String vehicle, int vehicleColor) { | |||
} | |||
; | |||
default void request(String vehicleId,PopupKeyboard mPopupKeyboard){}; | |||
default void request(String vehicle,int vehicleColor,PopupKeyboard mPopupKeyboard){}; | |||
} | |||
} |
@@ -0,0 +1,386 @@ | |||
<?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="增补OBU" | |||
app:titleColor="@color/black" /> | |||
<androidx.core.widget.NestedScrollView style="@style/MatchWrap"> | |||
<LinearLayout style="@style/MatchWrap.Vertical"> | |||
<TextView | |||
style="@style/WrapWrap" | |||
android:paddingLeft="@dimen/dp_15" | |||
android:paddingTop="@dimen/dp_20" | |||
android:paddingRight="@dimen/dp_15" | |||
android:text="收货方式" | |||
android:textColor="@color/color_333333" | |||
android:textSize="@dimen/sp_16" | |||
android:textStyle="bold" /> | |||
<com.ruffian.library.widget.RLinearLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:layout_below="@+id/title" | |||
android:layout_marginStart="@dimen/dp_15" | |||
android:layout_marginTop="@dimen/dp_15" | |||
android:layout_marginEnd="@dimen/dp_15" | |||
android:layout_marginBottom="@dimen/dp_15" | |||
android:orientation="vertical" | |||
app:background_normal="@color/white" | |||
app:corner_radius="@dimen/dp_10"> | |||
<LinearLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:gravity="center_vertical" | |||
android:orientation="horizontal" | |||
android:padding="@dimen/dp_15"> | |||
<TextView | |||
style="@style/redStar" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" /> | |||
<TextView | |||
style="@style/blackTextStyle14" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:layout_weight="1" | |||
android:text="是否需要邮寄" /> | |||
<RadioGroup | |||
android:id="@+id/rgMail" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:layout_marginRight="@dimen/dp_25" | |||
android:orientation="horizontal"> | |||
<RadioButton | |||
android:id="@+id/rbMail" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:background="@color/white" | |||
android:button="@null" | |||
android:drawableLeft="@drawable/radio_btn_1" | |||
android:drawablePadding="@dimen/dp_12" | |||
android:text="邮寄" /> | |||
<RadioButton | |||
android:id="@+id/rbNoMail" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:layout_marginLeft="@dimen/dp_20" | |||
android:background="@color/white" | |||
android:button="@null" | |||
android:drawableLeft="@drawable/radio_btn_1" | |||
android:drawablePadding="@dimen/dp_12" | |||
android:text="不邮寄" /> | |||
</RadioGroup> | |||
</LinearLayout> | |||
<View | |||
android:layout_width="match_parent" | |||
android:layout_height="@dimen/dp_0_5" | |||
android:layout_marginLeft="@dimen/dp_10" | |||
android:layout_marginRight="@dimen/dp_10" | |||
android:background="@color/common_line_color" /> | |||
<!--填写邮寄信息--> | |||
<LinearLayout | |||
android:id="@+id/LLMailInfo" | |||
android:visibility="visible" | |||
style="@style/MatchWrap.Vertical"> | |||
<LinearLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:orientation="horizontal" | |||
android:padding="@dimen/dp_15"> | |||
<TextView | |||
style="@style/redStar" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" /> | |||
<TextView | |||
style="@style/blackTextStyle14" | |||
android:layout_width="@dimen/dp_127" | |||
android:layout_height="wrap_content" | |||
android:text="姓名" /> | |||
<EditText | |||
android:id="@+id/etUserName" | |||
style="@style/blackTextStyle14" | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:background="@color/white" | |||
android:hint="请输入" | |||
android:textColorHint="@color/gray07" /> | |||
</LinearLayout> | |||
<View | |||
android:layout_width="match_parent" | |||
android:layout_height="@dimen/dp_0_5" | |||
android:layout_marginLeft="@dimen/dp_10" | |||
android:layout_marginRight="@dimen/dp_10" | |||
android:background="@color/common_line_color" /> | |||
<LinearLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:orientation="horizontal" | |||
android:padding="@dimen/dp_15"> | |||
<TextView | |||
style="@style/redStar" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" /> | |||
<TextView | |||
style="@style/blackTextStyle14" | |||
android:layout_width="@dimen/dp_127" | |||
android:layout_height="wrap_content" | |||
android:text="电话" /> | |||
<EditText | |||
android:id="@+id/etPhone" | |||
style="@style/blackTextStyle14" | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:background="@color/white" | |||
android:hint="请输入" | |||
android:inputType="number" | |||
android:textColorHint="@color/gray07" /> | |||
</LinearLayout> | |||
<View | |||
android:layout_width="match_parent" | |||
android:layout_height="@dimen/dp_0_5" | |||
android:layout_marginLeft="@dimen/dp_10" | |||
android:layout_marginRight="@dimen/dp_10" | |||
android:background="@color/common_line_color" /> | |||
<LinearLayout | |||
android:id="@+id/LLArea" | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:gravity="center_vertical" | |||
android:orientation="horizontal" | |||
android:padding="@dimen/dp_15"> | |||
<TextView | |||
style="@style/redStar" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" /> | |||
<TextView | |||
style="@style/blackTextStyle14" | |||
android:layout_width="@dimen/dp_127" | |||
android:layout_height="wrap_content" | |||
android:text="地区" /> | |||
<TextView | |||
android:id="@+id/tvArea" | |||
style="@style/gray07TextStyle14" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:layout_weight="1" | |||
android:gravity="center_vertical" | |||
android:textColor="@color/color_333333" | |||
android:textColorHint="@color/color_999999" | |||
android:hint="请选择" /> | |||
<ImageView | |||
android:layout_width="wrap_content" | |||
android:layout_height="@dimen/dp_13" | |||
android:src="@mipmap/the_right" /> | |||
</LinearLayout> | |||
<View | |||
android:layout_width="match_parent" | |||
android:layout_height="@dimen/dp_0_5" | |||
android:layout_marginLeft="@dimen/dp_10" | |||
android:layout_marginRight="@dimen/dp_10" | |||
android:background="@color/common_line_color" /> | |||
<LinearLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:orientation="horizontal" | |||
android:padding="@dimen/dp_15"> | |||
<TextView | |||
style="@style/redStar" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" /> | |||
<TextView | |||
style="@style/blackTextStyle14" | |||
android:layout_width="@dimen/dp_127" | |||
android:layout_height="wrap_content" | |||
android:text="详细地址" /> | |||
<EditText | |||
android:id="@+id/etAddr" | |||
style="@style/blackTextStyle14" | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:background="@color/white" | |||
android:hint="请输入" | |||
android:textColorHint="@color/gray07" /> | |||
</LinearLayout> | |||
<View | |||
android:layout_width="match_parent" | |||
android:layout_height="@dimen/dp_0_5" | |||
android:layout_marginLeft="@dimen/dp_10" | |||
android:layout_marginRight="@dimen/dp_10" | |||
android:background="@color/common_line_color" /> | |||
<LinearLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:orientation="horizontal" | |||
android:padding="@dimen/dp_15"> | |||
<TextView | |||
style="@style/redStar" | |||
android:visibility="invisible" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" /> | |||
<TextView | |||
style="@style/blackTextStyle14" | |||
android:layout_width="@dimen/dp_127" | |||
android:layout_height="wrap_content" | |||
android:text="邮政编码" /> | |||
<EditText | |||
android:id="@+id/etPostCard" | |||
style="@style/blackTextStyle14" | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:background="@color/white" | |||
android:hint="请输入" | |||
android:inputType="number" | |||
android:textColorHint="@color/gray07" /> | |||
</LinearLayout> | |||
<View | |||
android:layout_width="match_parent" | |||
android:layout_height="@dimen/dp_0_5" | |||
android:layout_marginLeft="@dimen/dp_10" | |||
android:layout_marginRight="@dimen/dp_10" | |||
android:background="@color/common_line_color" /> | |||
</LinearLayout> | |||
</com.ruffian.library.widget.RLinearLayout> | |||
<TextView | |||
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" /> | |||
<TextView | |||
style="@style/MatchWrap" | |||
android:layout_marginTop="@dimen/dp_10" | |||
android:paddingLeft="@dimen/dp_15" | |||
android:text="请在下方输入验证码" | |||
android:textSize="@dimen/sp_13" /> | |||
<LinearLayout | |||
style="@style/MatchWrap.Vertical" | |||
android:layout_margin="@dimen/dp_15" | |||
android:background="@drawable/bg_white_radius" | |||
android:paddingVertical="@dimen/dp_10" | |||
android:paddingHorizontal="@dimen/dp_15"> | |||
<LinearLayout | |||
style="@style/MatchWrap.Horizontal" | |||
android:gravity="center_vertical" | |||
android:layout_height="@dimen/dp_30"> | |||
<TextView | |||
style="@style/WrapWrap" | |||
android:text="手机号码" | |||
android:textSize="@dimen/sp_14" | |||
android:textColor="@color/color_666666"/> | |||
<TextView | |||
android:id="@+id/tvMobile" | |||
style="@style/AutoWrap" | |||
android:paddingLeft="@dimen/dp_50" | |||
android:text="反显手机号,不可修改" | |||
android:textColor="#B3B3B3"/> | |||
</LinearLayout> | |||
<TextView | |||
style="@style/MatchOne.HorLine" | |||
android:layout_marginVertical="@dimen/dp_8"/> | |||
<LinearLayout | |||
style="@style/MatchWrap.Horizontal" | |||
android:gravity="center_vertical" | |||
android:layout_height="@dimen/dp_30"> | |||
<TextView | |||
style="@style/WrapWrap" | |||
android:text="验证码 " | |||
android:textSize="@dimen/sp_14" | |||
android:textColor="@color/color_666666"/> | |||
<com.hjq.widget.view.RegexEditText | |||
android:id="@+id/etCode" | |||
style="@style/EditTextStyle" | |||
android:layout_width="0dp" | |||
android:layout_weight="1" | |||
android:paddingLeft="@dimen/dp_50" | |||
android:layout_height="match_parent" | |||
android:hint="请输入验证码" | |||
android:inputType="number" | |||
android:maxLength="6" | |||
android:singleLine="true" | |||
android:paddingVertical="0dp" | |||
android:textSize="@dimen/sp_14" | |||
android:textColorHint="#B3B3B3" /> | |||
<Button | |||
android:id="@+id/mGetCodeBtn" | |||
style="@style/WrapWrap" | |||
android:layout_height="@dimen/dp_25" | |||
android:paddingLeft="@dimen/dp_8" | |||
android:paddingRight="@dimen/dp_8" | |||
android:layout_gravity="right|center" | |||
android:background="@drawable/bg_green_radius" | |||
android:enabled="true" | |||
android:foreground="?attr/selectableItemBackground" | |||
android:text="获取验证码" | |||
android:textColor="@color/white" | |||
android:textSize="@dimen/sp_12" /> | |||
</LinearLayout> | |||
</LinearLayout> | |||
<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:layout_marginBottom="@dimen/dp_30" | |||
android:text="提交" | |||
android:textSize="@dimen/sp_14" /> | |||
</LinearLayout> | |||
</androidx.core.widget.NestedScrollView> | |||
</LinearLayout> |
@@ -0,0 +1,333 @@ | |||
<?xml version="1.0" encoding="utf-8"?> | |||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" | |||
xmlns:app="http://schemas.android.com/apk/res-auto" | |||
style="@style/MatchMatch.Vertical" | |||
android:background="@color/background_color"> | |||
<com.hjq.bar.TitleBar | |||
android:id="@+id/title" | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:background="@color/white" | |||
app:leftIcon="@mipmap/back_black" | |||
app:lineVisible="false" | |||
app:title="增补OBU" | |||
app:titleColor="@color/black" /> | |||
<androidx.core.widget.NestedScrollView | |||
android:layout_below="@+id/title" | |||
style="@style/MatchWrap"> | |||
<LinearLayout style="@style/MatchWrap.Vertical" | |||
android:paddingBottom="@dimen/dp_80"> | |||
<include layout="@layout/layout_vehicleplate"/> | |||
<!--搜索结果--> | |||
<LinearLayout | |||
android:id="@+id/LLSearchResult" | |||
android:visibility="gone" | |||
style="@style/MatchWrap.Vertical"> | |||
<TextView | |||
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_marginHorizontal="@dimen/dp_15" | |||
android:layout_marginTop="@dimen/dp_10" | |||
android:background="@drawable/bg_white_radius" | |||
android:padding="@dimen/dp_15"> | |||
<LinearLayout style="@style/MatchWrap.Horizontal"> | |||
<TextView | |||
style="@style/black02TextStyle14" | |||
android:layout_width="0dp" | |||
android:layout_height="wrap_content" | |||
android:layout_weight="1" | |||
android:text="订单编号" /> | |||
<TextView | |||
android:id="@+id/tvOrderId" | |||
style="@style/blackTextStyle14" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:text="" /> | |||
</LinearLayout> | |||
<LinearLayout | |||
style="@style/MatchWrap.Horizontal" | |||
android:layout_marginTop="@dimen/dp_12"> | |||
<TextView | |||
style="@style/black02TextStyle14" | |||
android:layout_width="0dp" | |||
android:layout_height="wrap_content" | |||
android:layout_weight="1" | |||
android:text="用户名称" /> | |||
<TextView | |||
android:id="@+id/tvUserName" | |||
style="@style/blackTextStyle14" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:text="" /> | |||
</LinearLayout> | |||
<LinearLayout | |||
style="@style/MatchWrap.Horizontal" | |||
android:layout_marginTop="@dimen/dp_12"> | |||
<TextView | |||
style="@style/black02TextStyle14" | |||
android:layout_width="0dp" | |||
android:layout_height="wrap_content" | |||
android:layout_weight="1" | |||
android:text="用户证件类型" /> | |||
<TextView | |||
android:id="@+id/tvCardType" | |||
style="@style/blackTextStyle14" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:text="" /> | |||
</LinearLayout> | |||
<LinearLayout | |||
style="@style/MatchWrap.Horizontal" | |||
android:layout_marginTop="@dimen/dp_12"> | |||
<TextView | |||
style="@style/black02TextStyle14" | |||
android:layout_width="0dp" | |||
android:layout_height="wrap_content" | |||
android:layout_weight="1" | |||
android:text="用户证件号" /> | |||
<TextView | |||
android:id="@+id/tvCardNum" | |||
style="@style/blackTextStyle14" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:text="" /> | |||
</LinearLayout> | |||
<LinearLayout | |||
style="@style/MatchWrap.Horizontal" | |||
android:layout_marginTop="@dimen/dp_12"> | |||
<TextView | |||
style="@style/black02TextStyle14" | |||
android:layout_width="0dp" | |||
android:layout_height="wrap_content" | |||
android:layout_weight="1" | |||
android:text="订单车牌号" /> | |||
<TextView | |||
android:id="@+id/tvVehiclePlate" | |||
style="@style/blackTextStyle14" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:text="" /> | |||
</LinearLayout> | |||
<LinearLayout | |||
style="@style/MatchWrap.Horizontal" | |||
android:layout_marginTop="@dimen/dp_12"> | |||
<TextView | |||
style="@style/black02TextStyle14" | |||
android:layout_width="0dp" | |||
android:layout_height="wrap_content" | |||
android:layout_weight="1" | |||
android:text="车牌颜色" /> | |||
<TextView | |||
android:id="@+id/tv_color" | |||
style="@style/blackTextStyle14" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:text="" /> | |||
</LinearLayout> | |||
<LinearLayout | |||
style="@style/MatchWrap.Horizontal" | |||
android:layout_marginTop="@dimen/dp_12"> | |||
<TextView | |||
style="@style/black02TextStyle14" | |||
android:layout_width="0dp" | |||
android:layout_height="wrap_content" | |||
android:layout_weight="1" | |||
android:text="收费车型" /> | |||
<TextView | |||
android:id="@+id/tvCarType" | |||
style="@style/blackTextStyle14" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" /> | |||
</LinearLayout> | |||
</LinearLayout> | |||
<!--卡信息--> | |||
<LinearLayout | |||
android:id="@+id/LLCardInfo" | |||
android:visibility="gone" | |||
style="@style/MatchWrap.Vertical"> | |||
<TextView | |||
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_marginHorizontal="@dimen/dp_15" | |||
android:layout_marginVertical="@dimen/dp_10" | |||
android:background="@drawable/bg_white_radius" | |||
android:paddingHorizontal="@dimen/dp_20" | |||
android:paddingVertical="@dimen/dp_15"> | |||
<LinearLayout | |||
style="@style/MatchWrap.Horizontal" | |||
android:background="@drawable/bg_card_obu_info" | |||
android:gravity="center_vertical" | |||
android:paddingTop="@dimen/dp_15" | |||
android:paddingLeft="@dimen/dp_15" | |||
android:paddingBottom="@dimen/dp_15" | |||
android:paddingRight="@dimen/dp_5"> | |||
<ImageView | |||
style="@style/WrapWrap" | |||
android:layout_width="@dimen/dp_67" | |||
android:layout_height="@dimen/dp_46" | |||
android:src="@mipmap/icon_card" /> | |||
<LinearLayout | |||
style="@style/MatchWrap.Vertical" | |||
android:layout_marginLeft="@dimen/dp_15"> | |||
<TextView | |||
android:id="@+id/tvCardIdInfo" | |||
style="@style/MatchWrap" | |||
android:text="卡号:" | |||
android:textColor="@color/common_accent_color" | |||
android:textSize="@dimen/sp_13" /> | |||
<TextView | |||
android:id="@+id/tvCardTypeInfo" | |||
style="@style/MatchWrap" | |||
android:layout_marginTop="@dimen/dp_2" | |||
android:text="卡类型:" | |||
android:textColor="@color/common_accent_color" | |||
android:textSize="@dimen/sp_13" /> | |||
<TextView | |||
android:id="@+id/tvCardStatusInfo" | |||
style="@style/MatchWrap" | |||
android:layout_marginTop="@dimen/dp_2" | |||
android:text="卡状态:" | |||
android:textColor="@color/common_accent_color" | |||
android:textSize="@dimen/sp_13" /> | |||
</LinearLayout> | |||
</LinearLayout> | |||
</LinearLayout> | |||
</LinearLayout> | |||
<!--OBU设备信息--> | |||
<LinearLayout | |||
android:id="@+id/LLObuInfo" | |||
android:visibility="gone" | |||
style="@style/MatchWrap.Vertical"> | |||
<TextView | |||
style="@style/WrapWrap" | |||
android:paddingLeft="@dimen/dp_15" | |||
android:paddingTop="@dimen/dp_15" | |||
android:paddingRight="@dimen/dp_15" | |||
android:text="OBU设备信息" | |||
android:textColor="@color/color_333333" | |||
android:textSize="@dimen/sp_16" | |||
android:textStyle="bold" /> | |||
<LinearLayout | |||
style="@style/MatchWrap.Vertical" | |||
android:layout_marginHorizontal="@dimen/dp_15" | |||
android:layout_marginVertical="@dimen/dp_10" | |||
android:background="@drawable/bg_white_radius" | |||
android:paddingHorizontal="@dimen/dp_20" | |||
android:paddingVertical="@dimen/dp_15"> | |||
<LinearLayout | |||
style="@style/MatchWrap.Horizontal" | |||
android:background="@drawable/bg_card_obu_info" | |||
android:gravity="center_vertical" | |||
android:padding="@dimen/dp_15"> | |||
<ImageView | |||
style="@style/WrapWrap" | |||
android:layout_width="@dimen/dp_67" | |||
android:layout_height="@dimen/dp_46" | |||
android:src="@mipmap/icon_obu" /> | |||
<LinearLayout | |||
style="@style/MatchWrap.Vertical" | |||
android:layout_marginLeft="@dimen/dp_15"> | |||
<TextView | |||
android:id="@+id/tvOBUIdInfo" | |||
style="@style/MatchWrap" | |||
android:text="OBU:" | |||
android:textColor="@color/common_accent_color" | |||
android:textSize="@dimen/sp_13" /> | |||
<TextView | |||
android:id="@+id/tvOBUTypeInfo" | |||
style="@style/MatchWrap" | |||
android:layout_marginTop="@dimen/dp_2" | |||
android:text="OBU状态:" | |||
android:textColor="@color/common_accent_color" | |||
android:textSize="@dimen/sp_13" /> | |||
</LinearLayout> | |||
</LinearLayout> | |||
</LinearLayout> | |||
</LinearLayout> | |||
</LinearLayout> | |||
</LinearLayout> | |||
</androidx.core.widget.NestedScrollView> | |||
<LinearLayout | |||
android:id="@+id/LLBottom" | |||
style="@style/MatchWrap.Horizontal" | |||
android:gravity="center" | |||
android:layout_alignParentBottom="true" | |||
android:layout_gravity="bottom" | |||
android:paddingVertical="@dimen/dp_10" | |||
android:background="@color/background_color" | |||
android:paddingHorizontal="@dimen/dp_15"> | |||
<Button | |||
android:id="@+id/btnNext" | |||
style="@style/BtnShortStyle" | |||
android:layout_width="0dp" | |||
android:layout_weight="1" | |||
android:layout_height="@dimen/dp_40" | |||
android:layout_alignParentBottom="true" | |||
android:layout_centerHorizontal="true" | |||
android:layout_gravity="center" | |||
android:text="下一步" | |||
android:textSize="@dimen/sp_15" /> | |||
</LinearLayout> | |||
</RelativeLayout> |
@@ -241,7 +241,7 @@ | |||
</LinearLayout> | |||
</LinearLayout> | |||
<RelativeLayout | |||
<LinearLayout | |||
style="@style/MatchWrap.Horizontal" | |||
android:layout_marginTop="@dimen/dp_10" | |||
android:gravity="center_vertical"> | |||
@@ -256,14 +256,15 @@ | |||
<Button | |||
android:id="@+id/btnSearch" | |||
style="@style/BtnShortStyle" | |||
android:layout_width="match_parent" | |||
android:layout_height="@dimen/dp_30" | |||
android:layout_width="0dp" | |||
android:layout_weight="1" | |||
android:layout_height="@dimen/dp_35" | |||
android:layout_gravity="center_vertical|right" | |||
android:text="搜索" | |||
android:layout_centerVertical="true" | |||
android:layout_alignParentRight="true" | |||
android:layout_marginLeft="@dimen/dp_5" | |||
android:textSize="@dimen/sp_12" /> | |||
</RelativeLayout> | |||
</LinearLayout> | |||
</LinearLayout> | |||
</LinearLayout> |
@@ -264,7 +264,7 @@ | |||
<string name="clear_number">清除车牌</string> | |||
<string name="hide_ok_key">隐藏/显示“确定”键</string> | |||
<string name="popup_keyboard">弹出/隐藏键盘</string> | |||
<!-- TODO: Remove or change this placeholder text --> | |||
<!-- Remove or change this placeholder text --> | |||
<string name="hello_blank_fragment">Hello blank fragment</string> | |||
<string name="obu_warm_tips">ETC设备蓝牙打开方式分为两种:\n\n①查看设备上是否有蓝牙按钮,若有蓝牙按钮,轻按按钮,设备显示“蓝牙已打开”。\n\n②若设备无蓝牙按钮,对设备两次插拔卡方式,详情“操作手册”,打开蓝牙后设备显示“蓝牙已打开”。</string> |
@@ -12,4 +12,5 @@ | |||
<external-cache-path name="name" path="path" /> | |||
<!-- Environment.getExternalStorageDirectory() --> | |||
<external-path name="external" path="." /> | |||
<external-path name="external_storage_root" path="." /> | |||
</paths> |
@@ -0,0 +1,120 @@ | |||
package com.hjq.base.util; | |||
import android.content.Context; | |||
import android.content.Intent; | |||
import android.net.Uri; | |||
import android.os.Build; | |||
import java.io.File; | |||
import androidx.core.content.FileProvider; | |||
/** | |||
* Date :2023-03-28 | |||
* Description: | |||
*/ | |||
public class FileHelper { | |||
//打开类型的文件 | |||
public static Intent openFile(Context context, String filePath) { | |||
if (filePath == null) { | |||
return null; | |||
} | |||
File file = new File(filePath); | |||
if (!file.exists()) | |||
return null; | |||
/* 取得扩展名 */ | |||
String end = file | |||
.getName() | |||
.substring(file.getName().lastIndexOf(".") + 1, | |||
file.getName().length()).toLowerCase(); | |||
end = end.trim().toLowerCase(); | |||
/* 依扩展名的类型决定MimeType */ | |||
if (end.equals("apk")) { | |||
return getApkFileIntent(context,filePath); | |||
} else if (end.equals("ppt")) { | |||
return getPptFileIntent(context,filePath); | |||
} else if (end.equals("xls") || end.equals("xlsx")) { | |||
return getExcelFileIntent(context,filePath); | |||
} else if (end.equals("doc")) { | |||
return getWordFileIntent(context,filePath); | |||
} else if (end.equals("pdf")) { | |||
return getPdfFileIntent(context,filePath); | |||
} else if (end.equals("txt")) { | |||
return getTextFileIntent(context,filePath, false); | |||
} else { | |||
return getAllIntent(context,filePath); | |||
} | |||
} | |||
// Android获取一个用于打开APK文件的intent | |||
public static Intent getApkFileIntent(Context context,String param) { | |||
Intent intent = new Intent(Intent.ACTION_VIEW); | |||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { | |||
intent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); | |||
Uri contentUri = FileProvider.getUriForFile(context, "com.huntersun.vkyes.etcopencard.provider", new File(param)); | |||
intent.setDataAndType(contentUri, "application/vnd.android.package-archive"); | |||
} else { | |||
intent.setDataAndType(Uri.fromFile(new File(param)), "application/vnd.android.package-archive"); | |||
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); | |||
} | |||
return intent; | |||
} | |||
// Android获取一个用于打开PPT文件的intent | |||
public static Intent getPptFileIntent(Context context,String param) { | |||
Intent intent = new Intent("android.intent.action.VIEW"); | |||
intent.addCategory("android.intent.category.DEFAULT"); | |||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); | |||
Uri uri = FileProvider.getUriForFile(context, "com.huntersun.vkyes.etcopencard.provider", new File(param)); | |||
intent.setDataAndType(uri, "application/vnd.ms-powerpoint"); | |||
return intent; | |||
} | |||
// Android获取一个用于打开Excel文件的intent | |||
public static Intent getExcelFileIntent(Context context,String param) { | |||
Intent intent = new Intent("android.intent.action.VIEW"); | |||
intent.addCategory("android.intent.category.DEFAULT"); | |||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); | |||
Uri uri = FileProvider.getUriForFile(context, "com.huntersun.vkyes.etcopencard.provider", new File(param)); | |||
intent.setDataAndType(uri, "application/vnd.ms-excel"); | |||
return intent; | |||
} | |||
// Android获取一个用于打开Word文件的intent | |||
public static Intent getWordFileIntent(Context context,String param) { | |||
Intent intent = new Intent("android.intent.action.VIEW"); | |||
intent.addCategory("android.intent.category.DEFAULT"); | |||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); | |||
Uri uri = FileProvider.getUriForFile(context, "com.huntersun.vkyes.etcopencard.provider", new File(param)); | |||
intent.setDataAndType(uri, "application/msword"); | |||
return intent; | |||
} | |||
// Android获取一个用于打开PDF文件的intent | |||
public static Intent getPdfFileIntent(Context context,String param) { | |||
Intent intent = new Intent("android.intent.action.VIEW"); | |||
intent.addCategory("android.intent.category.DEFAULT"); | |||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); | |||
Uri uri = FileProvider.getUriForFile(context, "com.huntersun.vkyes.etcopencard.provider", new File(param)); | |||
intent.setDataAndType(uri, "application/pdf"); | |||
return intent; | |||
} | |||
// Android获取一个用于打开文本文件的intent | |||
public static Intent getTextFileIntent(Context context,String param, boolean paramBoolean) { | |||
Intent intent = new Intent("android.intent.action.VIEW"); | |||
intent.addCategory("android.intent.category.DEFAULT"); | |||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); | |||
if (paramBoolean) { | |||
Uri uri1 = Uri.parse(param); | |||
intent.setDataAndType(uri1, "text/plain"); | |||
} else { | |||
Uri uri2 = FileProvider.getUriForFile(context, "com.huntersun.vkyes.etcopencard.provider", new File(param)); | |||
intent.setDataAndType(uri2, "text/plain"); | |||
} | |||
return intent; | |||
} | |||
// Android获取一个用于打开APK文件的intent | |||
public static Intent getAllIntent(Context context,String param) { | |||
Intent intent = new Intent(); | |||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); | |||
intent.setAction(android.content.Intent.ACTION_VIEW); | |||
Uri uri = FileProvider.getUriForFile(context, "com.huntersun.vkyes.etcopencard.provider", new File(param)); | |||
intent.setDataAndType(uri, "*/*"); | |||
return intent; | |||
} | |||
} |