@@ -263,49 +263,63 @@ | |||
android:launchMode="singleTop" | |||
android:screenOrientation="portrait"> <!-- 业务员服务评价 --> | |||
</activity> | |||
<!-- obu温馨提示 --> | |||
<activity | |||
android:name=".project.ui.activity.obu.ObuActivationHintCheckOrderActivity" | |||
android:launchMode="singleTop" | |||
android:screenOrientation="portrait"/> | |||
<!-- obu温馨提示 --> | |||
<activity | |||
android:name=".project.ui.activity.obu.ObuActivationHintActivity" | |||
android:launchMode="singleTop" | |||
android:screenOrientation="portrait"> <!-- obu温馨提示 --> | |||
android:screenOrientation="portrait"> | |||
</activity> | |||
<!-- obu图片上传 --> | |||
<activity | |||
android:name=".project.ui.activity.obu.ObuActivationUploadActivity" | |||
android:launchMode="singleTop" | |||
android:screenOrientation="portrait"> <!-- obu图片上传 --> | |||
android:screenOrientation="portrait"> | |||
</activity> | |||
<!-- obu蓝牙搜索 --> | |||
<activity | |||
android:name=".project.ui.activity.obu.ObuActivationBLESearchActivity" | |||
android:launchMode="singleTop" | |||
android:screenOrientation="portrait"> <!-- obu蓝牙搜索 --> | |||
android:screenOrientation="portrait"> | |||
</activity> | |||
<!-- obu蓝牙设备选择 --> | |||
<activity | |||
android:name=".project.ui.activity.obu.ObuActivationChooseActivity" | |||
android:launchMode="singleTop" | |||
android:screenOrientation="portrait"> <!-- obu蓝牙设备选择 --> | |||
android:screenOrientation="portrait"> | |||
</activity> | |||
<!-- obu激活成功或失败 --> | |||
<activity | |||
android:name=".project.ui.activity.obu.ObuActivationSuccessOrFailActivity" | |||
android:launchMode="singleTop" | |||
android:screenOrientation="portrait"> <!-- obu激活成功或失败 --> | |||
android:screenOrientation="portrait"> | |||
</activity> | |||
<activity | |||
android:name=".project.ui.activity.obu.SendGoodInfoActivity" | |||
android:launchMode="singleTop" | |||
android:screenOrientation="portrait"> <!-- 发货信息 --> | |||
android:screenOrientation="portrait"> | |||
<!-- 发货信息 --> | |||
</activity> | |||
<activity | |||
android:name=".project.ui.activity.obu.SendGoodSuccessActivity" | |||
android:launchMode="singleTop" | |||
android:screenOrientation="portrait"> <!-- 发货成功 --> | |||
android:screenOrientation="portrait"> | |||
<!-- 发货成功 --> | |||
</activity> | |||
<activity | |||
android:name=".project.ui.activity.evaluate.UserEvaluateActivity" | |||
android:launchMode="singleTop" | |||
android:screenOrientation="portrait" /> <!-- 发布评价 --> | |||
android:screenOrientation="portrait" /> | |||
<!-- 发布评价 --> | |||
<activity | |||
android:name=".project.ui.activity.evaluate.ProductPublishPJActivity" | |||
android:launchMode="singleTop" | |||
android:screenOrientation="portrait" /> <!-- 问题建议 --> | |||
android:screenOrientation="portrait" /> | |||
<!-- 问题建议 --> | |||
<activity | |||
android:name=".project.ui.activity.evaluate.QuestionAndSuggestionActivity" | |||
android:launchMode="singleTop" | |||
@@ -323,23 +337,28 @@ | |||
<activity | |||
android:name=".project.ui.activity.DefrayActivity" | |||
android:launchMode="singleTop" | |||
android:screenOrientation="portrait" /> <!-- 签名 --> | |||
android:screenOrientation="portrait" /> | |||
<!-- 签名 --> | |||
<activity | |||
android:name=".project.ui.activity.SignActivity" | |||
android:launchMode="singleTop" | |||
android:screenOrientation="portrait" /> <!-- 车牌信息 --> | |||
android:screenOrientation="portrait" /> | |||
<!-- 车牌信息 --> | |||
<activity | |||
android:name=".project.ui.activity.VehicleInformationActivity" | |||
android:launchMode="singleTop" | |||
android:screenOrientation="portrait" /> <!-- 首页信息查询 --> | |||
android:screenOrientation="portrait" /> | |||
<!-- 首页信息查询 --> | |||
<activity | |||
android:name=".project.ui.activity.order.OrderDetailsActivity" | |||
android:launchMode="singleTop" | |||
android:screenOrientation="portrait" /> <!-- 信息确认 --> | |||
android:screenOrientation="portrait" /> | |||
<!-- 信息确认 --> | |||
<activity | |||
android:name=".project.ui.activity.InformationConfirmedActivity" | |||
android:launchMode="singleTop" | |||
android:screenOrientation="portrait" /> <!-- 卡签版本查询 --> | |||
android:screenOrientation="portrait" /> | |||
<!-- 卡签版本查询 --> | |||
<activity | |||
android:name=".project.ui.activity.CardSignQueryActivity" | |||
android:launchMode="singleTop" |
@@ -326,6 +326,7 @@ public class BluetoothDialog { | |||
case BluetoothDevice.BOND_NONE: | |||
Log.e("log", "取消配对"); | |||
mDialog.dismiss(); | |||
unReceiver(); | |||
default: | |||
break; | |||
} |
@@ -0,0 +1,205 @@ | |||
package com.huntersun.vkyes.etcopencard.project.bluetooth; | |||
import com.blankj.utilcode.util.LogUtils; | |||
import com.google.gson.Gson; | |||
import com.huntersun.vky.obublelib.bean.CardInfoBean; | |||
import com.huntersun.vky.obublelib.bean.DecryptVehicleApduBean; | |||
import com.huntersun.vky.obublelib.box.BoxManagers; | |||
import com.huntersun.vky.obublelib.util.UtilTool; | |||
import com.huntersun.vkyes.etcopencard.project.api.Api; | |||
import com.huntersun.vkyes.etcopencard.project.api.Converter; | |||
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.tool.Utils; | |||
import com.huntersun.vkyes.etcopencard.src.app.AppActivity; | |||
import com.huntersun.vkyes.etcopencard.src.manager.ActivityManager; | |||
import com.huntersun.vkyes.etcopencard.src.ui.activity.LoginActivity; | |||
import java.io.UnsupportedEncodingException; | |||
import java.nio.charset.Charset; | |||
import java.util.HashMap; | |||
import java.util.Map; | |||
/** | |||
* Date :2023-03-27 | |||
* Description:卡签信息读取工具类 | |||
*/ | |||
public class BluetoothReadUtils { | |||
/** | |||
* 读取卡签信息(需链接蓝牙) | |||
* @param activity | |||
* @param callback | |||
*/ | |||
public static void readCardAndObuInfo(AppActivity activity,INReadResultCallback callback){ | |||
activity.bluetoothLink(new AppActivity.Currency() { | |||
@Override | |||
public void success() { | |||
CardObuIfoBean cardObuIfoBean = new CardObuIfoBean(); | |||
CardInfoBean card = BoxManagers.mCardInfoBean; | |||
cardObuIfoBean.cardId = card.getCard_No(); | |||
cardObuIfoBean.cardPlate = card.getLicense_plate_ID(); | |||
cardObuIfoBean.cardPlateColor = EnumBean.backValue(String.valueOf(Integer.valueOf(card.getLicense_plate_color())), EnumBean.VehicleColorArray); | |||
cardObuIfoBean.cardPlateId = card.getLicense_plate_ID() + "_" + (Integer.parseInt(card.getLicense_plate_color())); | |||
//卡信息 | |||
//"卡内余额", card.getMoney() * 100 + "元") | |||
//"卡号", card.getCard_No()) | |||
//"发卡方标识", card.getIssuer()) | |||
// 储值卡22 记账卡23 | |||
//"卡片类型", Long.valueOf(BoxManagers.mCardInfoBean.getCard_type(), 16) == 23 ? "记账卡" : "储值卡") | |||
//"卡版本号", card.getCard_version() + "") | |||
//"卡表面编号", card.getCard_surface_number() + "") | |||
//"有效起始日期", card.getBegin_time() + "") | |||
//"有效截止日期", card.getEnd_time() + "") | |||
//"车牌号", card.getLicense_plate_ID() + "") | |||
//"车牌颜色", EnumBean.backValue(String.valueOf(Integer.valueOf(card.getLicense_plate_color())), EnumBean.VehicleColorArray)) | |||
//"用户类型", card.getUser_type() + "") | |||
//"车型", card.getCar_type() + "") | |||
Map<String, String> params = new HashMap<>(); | |||
params.put("fileData", BoxManagers.mDecryptVehicleApduBean.getEncryptData()); | |||
params.put("obuSerailNo", BoxManagers.mDecryptVehicleApduBean.getContractNo()); | |||
RequestParameters parameters = new RequestParameters(IFCode.IFCODE90, new Gson().toJson(params)); | |||
new MyRetrofit().getRetrofit().create(Api.class).message2(parameters).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); | |||
ResultBean.BizContent data = Gson().fromJson(Gson().toJson(decVehInfo.data), ResultBean.BizContent.class); | |||
ResultBean.BizContent bizContent = DecVehInfo(data.getFileData()); | |||
/*"OBU设备号", BoxManagers.mDecryptVehicleApduBean.getContractNo())); | |||
"车牌号码", bizContent.getVehiclePlate()) | |||
"车牌颜色", EnumBean.backValue(bizContent.getVehiclePlateColor(), EnumBean.VehicleColorArray)) | |||
"收费车类型", "0".equals(bizContent.getType()) ? "客车" : "货车") | |||
"用户类型", "1".equals(bizContent.getUserType()) ? "个人用户" : "单位用户") | |||
"座位数", bizContent.getApprovedCount()) | |||
"车轮数", bizContent.getWheelCount()) | |||
"车轴数", bizContent.getAxleCount()) | |||
"发动机号码", bizContent.getEngineNum())*/ | |||
cardObuIfoBean.obuId = BoxManagers.mDecryptVehicleApduBean.getContractNo(); | |||
cardObuIfoBean.obuPlate = bizContent.getVehiclePlate(); | |||
cardObuIfoBean.obuPlateColor = EnumBean.backValue(bizContent.getVehiclePlateColor(), EnumBean.VehicleColorArray); | |||
cardObuIfoBean.obuPlateId = bizContent.getVehiclePlate() + "_" + (Integer.parseInt(bizContent.getVehiclePlateColor())); | |||
//判断卡和obu是否是配套的 | |||
if (!cardObuIfoBean.cardPlateId.equals(cardObuIfoBean.obuPlateId)){ | |||
String errorMsg = "卡中读出的车牌编号和obu中车牌编号不一致,请更换匹配的卡或者obu设备"; | |||
if (callback != null){ | |||
callback.readResultFail(errorMsg); | |||
} | |||
new Utils().showMessDialog(activity, errorMsg, dialog -> { }); | |||
return; | |||
} | |||
if (callback != null){ | |||
LogUtils.e("查询卡签信息成功>>>>",cardObuIfoBean.cardPlateId + ":" + cardObuIfoBean.obuPlateId); | |||
callback.readResultSuccess(cardObuIfoBean); | |||
} | |||
} | |||
}); | |||
} | |||
@Override | |||
public void close() { | |||
//activity.toast("蓝牙已关闭"); | |||
} | |||
}); | |||
} | |||
public static String guessEncoding(byte[] bytes) { | |||
String[] encodings = {"UTF-8", "GBK", "ISO-8859-1", "GB2312", "UTF-16BE", "UTF-16LE", "UTF-32BE", "UTF-32LE"}; | |||
for (String encoding : encodings) { | |||
try { | |||
String str = new String(bytes, Charset.forName(encoding)); | |||
byte[] bytes2 = str.getBytes(Charset.forName(encoding)); | |||
if (bytes.length == bytes2.length) { | |||
return encoding; | |||
} | |||
} catch (Exception e) { | |||
} | |||
} | |||
return null; | |||
} | |||
public static ResultBean.BizContent DecVehInfo(String data) { | |||
ResultBean.BizContent ocb = new ResultBean.BizContent(); | |||
ocb.setVehiclePlate(HexToStrig(data.substring(0, 24))); | |||
ocb.setVehiclePlateColor(HexToInt(data.substring(24, 28))); | |||
ocb.setType(HexToInt(data.substring(28, 30))); | |||
ocb.setUserType(HexToInt(data.substring(30, 32))); | |||
ocb.setWheelCount(HexToInt(data.substring(40, 42))); | |||
ocb.setAxleCount(HexToInt(data.substring(42, 44))); | |||
ocb.setApprovedCount(HexToInt(data.substring(48, 54))); | |||
ocb.setVin(HexToStrig(data.substring(54, 86))); | |||
ocb.setEngineNum(HexToStrig(data.substring(86, 118))); | |||
return ocb; | |||
} | |||
/** | |||
* 十六进制转十进制 | |||
* | |||
* @param data | |||
* @return | |||
* @author tianweihong | |||
* @date 2018-9-10 上午9:19:37 | |||
*/ | |||
public static String HexToInt(String data) { | |||
int num = -1; | |||
try { | |||
num = Integer.parseInt(data, 16); | |||
} catch (Exception e) { | |||
e.printStackTrace(); | |||
} | |||
return num + ""; | |||
} | |||
/** | |||
* 十六进制转汉字 | |||
* | |||
* @param data | |||
* @return | |||
*/ | |||
public static String HexToStrig(String data) { | |||
String str = data.substring(data.length() - 2); | |||
while ("00".equals(str)) { | |||
data = data.substring(0, data.length() - 2); | |||
if (data.length() == 0) { | |||
return ""; | |||
} | |||
str = data.substring(data.length() - 2); | |||
} | |||
byte[] asd = UtilTool.hexStringToByteArray(data); | |||
try { | |||
str = new String(asd, guessEncoding(asd)); | |||
} catch (UnsupportedEncodingException e) { | |||
e.printStackTrace(); | |||
} | |||
return str; | |||
} | |||
/** | |||
* 卡和obu信息实体添加 | |||
*/ | |||
public static class CardObuIfoBean{ | |||
public String cardId; //卡号 | |||
public String cardPlate; //卡车牌号 | |||
public String cardPlateColor; //卡车牌颜色(汉字显示) | |||
public String cardPlateId; //卡车牌编号 (车牌号_车牌颜色) | |||
public String obuId; //obu设备号 | |||
public String obuPlate; //obu读出的车牌号 | |||
public String obuPlateColor; //obu读出的车牌颜色(汉字显示) | |||
public String obuPlateId; //obu车牌编号(车牌号_车牌颜色) | |||
//需要其他参数可自己添加 | |||
} | |||
public interface INReadResultCallback{ | |||
void readResultSuccess(CardObuIfoBean cardObuIfoBean); | |||
default void readResultFail(String msg){}; | |||
} | |||
} |
@@ -8,6 +8,8 @@ import android.content.Context; | |||
import android.content.Intent; | |||
import android.util.Log; | |||
import com.jeremyliao.liveeventbus.LiveEventBus; | |||
import java.util.ArrayList; | |||
import java.util.List; | |||
@@ -31,13 +33,14 @@ public class BluetoothReceiver extends BroadcastReceiver { | |||
switch (device.getBondState()) { | |||
case BluetoothDevice.BOND_BONDING: | |||
Log.d("BlueToothTestActivity", "正在配对......"); | |||
break; | |||
case BluetoothDevice.BOND_BONDED: | |||
Log.d("BlueToothTestActivity", "完成配对"); | |||
LiveEventBus.get("bluetoothConnectStatus").post(true); | |||
break; | |||
case BluetoothDevice.BOND_NONE: | |||
Log.d("BlueToothTestActivity", "取消配对"); | |||
LiveEventBus.get("bluetoothConnectStatus").post(false); | |||
default: | |||
break; | |||
} |
@@ -49,6 +49,7 @@ public class ObuActivateRequester implements ToastAction { | |||
public int cuPageType = 0; | |||
private String vehiclePlate; | |||
private Context context; | |||
private ActivateResultCallBack activateResultCallBack; //安装回调 | |||
public void start(ResultBean.BizContent obuDetailInfoBean, Context context) { | |||
this.obuDetailInfoBean = obuDetailInfoBean; | |||
@@ -59,6 +60,16 @@ public class ObuActivateRequester implements ToastAction { | |||
obuSetRequest(); | |||
} | |||
public void start(ResultBean.BizContent obuDetailInfoBean, Context context,ActivateResultCallBack callBack) { | |||
this.obuDetailInfoBean = obuDetailInfoBean; | |||
this.activateResultCallBack = callBack; | |||
this.context = context; | |||
String vehicleId = obuDetailInfoBean.getVehicleId(); | |||
//vehicleId | |||
vehiclePlate = vehicleId.substring(0, vehicleId.indexOf("_")); | |||
obuSetRequest(); | |||
} | |||
public Gson Gson() { | |||
GsonBuilder gsonBuilder = new GsonBuilder(); | |||
gsonBuilder.registerTypeAdapter(new TypeToken<Map<String, Object>>() { | |||
@@ -92,6 +103,14 @@ public class ObuActivateRequester implements ToastAction { | |||
//写激活信息(普通车) | |||
activeObuVfj(); | |||
} | |||
@Override | |||
public void onError(String err, Response<Result> resp) { | |||
super.onError(err, resp); | |||
if (activateResultCallBack != null){ | |||
activateResultCallBack.onException(resp.body().errorMsg); | |||
} | |||
} | |||
}); | |||
} | |||
@@ -121,6 +140,14 @@ public class ObuActivateRequester implements ToastAction { | |||
Gson().fromJson(resultBean.getBizContent() + "", ResultBean.BizRemarks.class); | |||
sendApduEsam(data.getData()); | |||
} | |||
@Override | |||
public void onError(String err, Response<Result> resp) { | |||
super.onError(err, resp); | |||
if (activateResultCallBack != null){ | |||
activateResultCallBack.onException(resp.body().errorMsg); | |||
} | |||
} | |||
}); | |||
} | |||
} | |||
@@ -152,7 +179,19 @@ public class ObuActivateRequester implements ToastAction { | |||
.enqueue(new Converter<Result>(context, "安装确认中...") { | |||
@Override | |||
protected void onSuccess(ResultBean resultBean, ResultBean.BizContent bizContent1) { | |||
toast("安装成功"); | |||
if (activateResultCallBack != null){ | |||
activateResultCallBack.onSuccess(); | |||
}else{ | |||
toast("安装成功"); | |||
} | |||
} | |||
@Override | |||
public void onError(String err, Response<Result> resp) { | |||
super.onError(err, resp); | |||
if (activateResultCallBack != null){ | |||
activateResultCallBack.onException(resp.body().errorMsg); | |||
} | |||
} | |||
}); | |||
} | |||
@@ -176,6 +215,9 @@ public class ObuActivateRequester implements ToastAction { | |||
emitter.onComplete(); | |||
} else { | |||
toast("APDU为空"); | |||
if (activateResultCallBack != null){ | |||
activateResultCallBack.onException("APDU为空"); | |||
} | |||
} | |||
}).observeOn(AndroidSchedulers.mainThread()).subscribeOn(Schedulers.io()).subscribe(ss -> { | |||
if (0 == ss.getServiceCode() && checkApdu(ss)) { | |||
@@ -186,9 +228,11 @@ public class ObuActivateRequester implements ToastAction { | |||
public interface ActivateResultCallBack { | |||
void onSuccess(ObuDetailInfoBean obuDetailInfoBean); | |||
default void onSuccess(ObuDetailInfoBean obuDetailInfoBean){}; | |||
default void onSuccess(){}; | |||
void onException(Exception e); | |||
default void onException(Exception e){}; | |||
default void onException(String msg){}; | |||
} | |||
public boolean checkApdu(ServiceStatus resp_string) { |
@@ -1,19 +1,35 @@ | |||
package com.huntersun.vkyes.etcopencard.project.ui.activity.obu; | |||
import android.os.Bundle; | |||
import android.view.View; | |||
import com.huntersun.vky.obublelib.box.BoxManagers; | |||
import com.huntersun.vkyes.etcopencard.R; | |||
import com.huntersun.vkyes.etcopencard.databinding.ActivityObuActivationBlesearchBinding; | |||
import com.huntersun.vkyes.etcopencard.project.bluetooth.BluetoothReadUtils; | |||
import com.huntersun.vkyes.etcopencard.project.copapply.ObuActivateRequester; | |||
import com.huntersun.vkyes.etcopencard.project.copapply.ObuActivation; | |||
import com.huntersun.vkyes.etcopencard.project.dialog.ConfirmDialog; | |||
import com.huntersun.vkyes.etcopencard.project.ui.activity.after.PetCardToAccountCardStep4Activity; | |||
import com.huntersun.vkyes.etcopencard.src.app.AppActivity; | |||
/** | |||
* | |||
* @ClassName: ObuActivationBLESearchActivity | |||
* @Description: OBU搜索页面 | |||
* @Author: lujin | |||
* @CreateDate: 2023/3/15 14:43 | |||
*/ | |||
import com.jeremyliao.liveeventbus.LiveEventBus; | |||
/** | |||
* @ClassName: ObuActivationBLESearchActivity | |||
* @Description: OBU搜索页面 | |||
* @Author: lujin | |||
* @CreateDate: 2023/3/15 14:43 | |||
*/ | |||
public class ObuActivationBLESearchActivity extends AppActivity { | |||
private ActivityObuActivationBlesearchBinding binding; | |||
private String vehicleId; //车牌编号 | |||
private String orderId; //订单ID | |||
//蓝牙链接状态 | |||
private boolean isConnect; | |||
@Override | |||
protected View getLayoutView() { | |||
binding = ActivityObuActivationBlesearchBinding.inflate(getLayoutInflater()); | |||
@@ -24,6 +40,19 @@ public class ObuActivationBLESearchActivity extends AppActivity { | |||
protected void initView() { | |||
setTitle("激活设备"); | |||
binding.btnSearch.setOnClickListener(this); | |||
vehicleId = getIntent().getStringExtra("vehicleId"); | |||
orderId = getIntent().getStringExtra("orderId"); | |||
LiveEventBus.get("closeActiveSearchBluetooth", Boolean.class) .observe(this, s -> { | |||
finish(); | |||
}); | |||
LiveEventBus.get("bluetoothConnectStatus", Boolean.class) .observe(this, s -> { | |||
isConnect = s; | |||
if (!isConnect){ | |||
toast("设备链接已断开!"); | |||
} | |||
}); | |||
} | |||
@Override | |||
@@ -31,10 +60,49 @@ public class ObuActivationBLESearchActivity extends AppActivity { | |||
} | |||
@Override | |||
public void onClick(View view) { | |||
if (view==binding.btnSearch){ | |||
startActivity(ObuActivationChooseActivity.class); | |||
} | |||
} | |||
} | |||
private void toActive(){ | |||
//设备激活 | |||
new ObuActivation(BoxManagers.mDecryptVehicleApduBean, getContext()).start(bizContent -> { | |||
bizContent.setOrderId(orderId); | |||
//激活步骤 | |||
new ObuActivateRequester().start(bizContent, getContext(), new ObuActivateRequester.ActivateResultCallBack() { | |||
@Override | |||
public void onSuccess() { | |||
gotoNext(true); | |||
} | |||
@Override | |||
public void onException(String msg) { | |||
gotoNext(false); | |||
} | |||
}); | |||
}); | |||
} | |||
private void gotoNext(boolean isSuccess){ | |||
Bundle bundle = new Bundle(); | |||
bundle.putBoolean("isSuccess",isSuccess); | |||
jumpToPage(ObuActivationSuccessOrFailActivity.class); | |||
} | |||
@Override | |||
public void onClick(View view) { | |||
if (view == binding.btnSearch) { | |||
BluetoothReadUtils.readCardAndObuInfo(this, new BluetoothReadUtils.INReadResultCallback() { | |||
@Override | |||
public void readResultSuccess(BluetoothReadUtils.CardObuIfoBean cardObuIfoBean) {//读取成功 | |||
if (isConnect){ | |||
toActive(); | |||
}else{ | |||
bluetoothLink(new Currency() { | |||
@Override | |||
public void success() { | |||
toActive(); | |||
} | |||
}); | |||
} | |||
} | |||
}); | |||
} | |||
} | |||
} |
@@ -8,7 +8,7 @@ import com.huntersun.vkyes.etcopencard.src.app.AppActivity; | |||
/** | |||
* | |||
* @ClassName: ObuActivationChooseActivity | |||
* @Description: OBU设备选择页面 | |||
* @Description: OBU设备选择页面 (该页面与蓝牙链接弹窗页面重复,这里不使用了) | |||
* @Author: lujin | |||
* @CreateDate: 2023/3/15 14:42 | |||
*/ |
@@ -1,8 +1,12 @@ | |||
package com.huntersun.vkyes.etcopencard.project.ui.activity.obu; | |||
import android.os.Bundle; | |||
import android.view.View; | |||
import com.alibaba.fastjson.JSON; | |||
import com.huntersun.vkyes.etcopencard.databinding.ActivityObuActivationHintBinding; | |||
import com.huntersun.vkyes.etcopencard.project.api.bean.ResultBean; | |||
import com.huntersun.vkyes.etcopencard.project.utils.FunHelper; | |||
import com.huntersun.vkyes.etcopencard.src.app.AppActivity; | |||
/** | |||
@@ -15,6 +19,9 @@ import com.huntersun.vkyes.etcopencard.src.app.AppActivity; | |||
public class ObuActivationHintActivity extends AppActivity { | |||
private ActivityObuActivationHintBinding binding; | |||
private String orderId; | |||
private String curVehicleId; | |||
@Override | |||
protected View getLayoutView() { | |||
binding = ActivityObuActivationHintBinding.inflate(getLayoutInflater()); | |||
@@ -25,6 +32,9 @@ public class ObuActivationHintActivity extends AppActivity { | |||
protected void initView() { | |||
setTitle("设备激活"); | |||
binding.btnNext.setOnClickListener(this); | |||
curVehicleId = getIntent().getStringExtra("vehicleId"); | |||
orderId = getIntent().getStringExtra("orderId"); | |||
} | |||
@Override | |||
@@ -35,8 +45,11 @@ public class ObuActivationHintActivity extends AppActivity { | |||
@Override | |||
public void onClick(View view) { | |||
if (view == binding.btnNext) { | |||
startActivity(ObuActivationUploadActivity.class); | |||
Bundle bundle = new Bundle(); | |||
bundle.putString("vehicleId",curVehicleId); | |||
bundle.putString("orderId",orderId); | |||
jumpToPage(ObuActivationUploadActivity.class,bundle); | |||
finish(); | |||
} | |||
} | |||
} |
@@ -0,0 +1,102 @@ | |||
package com.huntersun.vkyes.etcopencard.project.ui.activity.obu; | |||
import android.os.Bundle; | |||
import android.view.View; | |||
import com.alibaba.fastjson.JSON; | |||
import com.huntersun.vkyes.etcopencard.databinding.ActivityObuActivationHintCheckOrderBinding; | |||
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-27 | |||
* Description:设备激活查询订单 | |||
*/ | |||
public class ObuActivationHintCheckOrderActivity extends AppActivity { | |||
private ActivityObuActivationHintCheckOrderBinding binding; | |||
private ResultBean.BizContent curBizContent; | |||
private String curVehicleId; | |||
@Override | |||
protected View getLayoutView() { | |||
binding = ActivityObuActivationHintCheckOrderBinding.inflate(getLayoutInflater()); | |||
return binding.getRoot(); | |||
} | |||
@Override | |||
protected void initView() { | |||
binding.LLSearchResult.setVisibility(View.GONE); | |||
binding.LLBottom.setVisibility(View.GONE); | |||
SearchCarInfoUtils utils = 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); | |||
} | |||
@Override | |||
public void onVehicleId(String vehicleId) { | |||
curVehicleId = vehicleId; | |||
} | |||
}); | |||
utils.setParams("10"); | |||
binding.btnNext.setOnClickListener(new View.OnClickListener() { | |||
@Override | |||
@SingleClick | |||
public void onClick(View view) { | |||
Bundle bundle = new Bundle(); | |||
bundle.putString("orderId", curBizContent.getOrderId()); | |||
bundle.putString("vehicleId", curVehicleId); | |||
jumpToPage(ObuActivationHintActivity.class, bundle); | |||
} | |||
}); | |||
} | |||
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() { | |||
} | |||
} |
@@ -2,8 +2,10 @@ package com.huntersun.vkyes.etcopencard.project.ui.activity.obu; | |||
import android.view.View; | |||
import com.huntersun.vkyes.etcopencard.R; | |||
import com.huntersun.vkyes.etcopencard.databinding.ActivityObuActivationSuccessOrFailBinding; | |||
import com.huntersun.vkyes.etcopencard.src.app.AppActivity; | |||
import com.jeremyliao.liveeventbus.LiveEventBus; | |||
/** | |||
* | |||
@@ -15,6 +17,8 @@ import com.huntersun.vkyes.etcopencard.src.app.AppActivity; | |||
public class ObuActivationSuccessOrFailActivity extends AppActivity { | |||
private ActivityObuActivationSuccessOrFailBinding binding; | |||
private boolean isSuccess; //是否成功 | |||
@Override | |||
protected View getLayoutView() { | |||
binding = ActivityObuActivationSuccessOrFailBinding.inflate(getLayoutInflater()); | |||
@@ -24,9 +28,22 @@ public class ObuActivationSuccessOrFailActivity extends AppActivity { | |||
@Override | |||
protected void initView() { | |||
setTitle("激活设备"); | |||
isSuccess = getIntent().getBooleanExtra("isSuccess",true); | |||
binding.btnJjjh.setOnClickListener(this); | |||
binding.btnBack2.setOnClickListener(this);//激活失败返回 | |||
binding.btnBack.setOnClickListener(this);//激活成功返回 | |||
binding.btnBack2.setOnClickListener(this); | |||
if (isSuccess){ | |||
binding.tvStated.setText("激活成功"); | |||
binding.tvContent.setText("您的ETC已激活"); | |||
binding.btnJjjh.setVisibility(View.GONE); | |||
binding.imgState.setImageResource(R.mipmap.ic_obu_6); | |||
}else{ | |||
binding.tvStated.setText("激活失败"); | |||
binding.tvContent.setText("您可以选择重新激活"); | |||
binding.btnJjjh.setVisibility(View.VISIBLE); | |||
binding.imgState.setImageResource(R.mipmap.ic_obu_5); | |||
} | |||
} | |||
@Override | |||
@@ -36,10 +53,11 @@ public class ObuActivationSuccessOrFailActivity extends AppActivity { | |||
@Override | |||
public void onClick(View view) { | |||
if (view==binding.btnJjjh){ | |||
startActivity(SendGoodInfoActivity.class); | |||
}else if(view== binding.btnBack2||view==binding.btnBack){ | |||
if (view==binding.btnJjjh){//继续激活 | |||
finish(); | |||
}else if(view== binding.btnBack2){//返回首页 | |||
LiveEventBus.get("closeActiveSearchBluetooth").post(true); //关闭搜索蓝牙界面 | |||
finish(); | |||
} | |||
} | |||
} |
@@ -1,12 +1,16 @@ | |||
package com.huntersun.vkyes.etcopencard.project.ui.activity.obu; | |||
import android.os.Bundle; | |||
import android.text.TextUtils; | |||
import android.view.View; | |||
import android.widget.ImageView; | |||
import com.google.gson.Gson; | |||
import com.huntersun.vky.obublelib.box.BoxManagers; | |||
import com.huntersun.vkyes.etcopencard.databinding.ActivityObuActivationUploadBinding; | |||
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; | |||
@@ -16,10 +20,14 @@ import com.huntersun.vkyes.etcopencard.project.api.bean.SendTheVerificationCodeB | |||
import com.huntersun.vkyes.etcopencard.project.copapply.ObuActivateRequester; | |||
import com.huntersun.vkyes.etcopencard.project.copapply.ObuActivation; | |||
import com.huntersun.vkyes.etcopencard.project.tool.QRCode; | |||
import com.huntersun.vkyes.etcopencard.project.utils.FunHelper; | |||
import com.huntersun.vkyes.etcopencard.src.app.AppActivity; | |||
import com.huntersun.vkyes.etcopencard.src.http.glide.GlideApp; | |||
import com.huntersun.vkyes.etcopencard.src.ui.activity.ImageSelectActivity; | |||
import java.util.HashMap; | |||
import java.util.List; | |||
import java.util.Map; | |||
import retrofit2.Response; | |||
@@ -33,6 +41,12 @@ import retrofit2.Response; | |||
public class ObuActivationUploadActivity extends AppActivity { | |||
private ActivityObuActivationUploadBinding binding; | |||
private String vehicleId; //车牌编号 | |||
private String orderId; //订单ID | |||
private String ivImg1; | |||
private String ivImg2; | |||
private String ivImg3; | |||
@Override | |||
protected View getLayoutView() { | |||
@@ -43,10 +57,13 @@ public class ObuActivationUploadActivity extends AppActivity { | |||
@Override | |||
protected void initView() { | |||
setTitle("激活设备"); | |||
vehicleId = getIntent().getStringExtra("vehicleId"); | |||
orderId = getIntent().getStringExtra("orderId"); | |||
binding.btnNext.setOnClickListener(this); | |||
binding.rcly.setOnClickListener(this); | |||
binding.rcly2.setOnClickListener(this); | |||
binding.rcly3.setOnClickListener(this); | |||
binding.ivImg1.setOnClickListener(this); | |||
binding.ivImg2.setOnClickListener(this); | |||
binding.ivImg3.setOnClickListener(this); | |||
} | |||
@Override | |||
@@ -54,43 +71,103 @@ public class ObuActivationUploadActivity extends AppActivity { | |||
} | |||
private boolean empty(String data,String hint){ | |||
if (FunHelper.isEmpty(data)){ | |||
toast("请上传" + hint + "图片"); | |||
return true; | |||
} | |||
return false; | |||
} | |||
@Override | |||
public void onClick(View view) { | |||
if (view == binding.btnNext) { | |||
// startActivity(ObuActivationBLESearchActivity.class); | |||
if (empty(ivImg1, "车头") || empty(ivImg2,"车身45°") || empty(ivImg3,"安装")){ | |||
return; | |||
} | |||
toSubmitData(); | |||
} else if (view == binding.ivImg1) { | |||
onImage(binding.ivImg1,1); | |||
}else if (view == binding.ivImg2){ | |||
onImage(binding.ivImg2,2); | |||
}else if (view == binding.ivImg3){ | |||
onImage(binding.ivImg3,3); | |||
} | |||
} | |||
/** | |||
* 上传图片信息 | |||
*/ | |||
private void toSubmitData(){ | |||
showDialog("图片上传中..."); | |||
Map<String, String> params = new HashMap<>(); | |||
params.put("img1", ivImg1); | |||
params.put("img2", ivImg2); | |||
params.put("img3", ivImg3); | |||
params.put("orderId", orderId); | |||
//TODO 暂时没有这个接口 | |||
/*MyRetrofit.newInstance(IFCode.IFCODE966, params, new MyRetrofit.ReturnResult() { | |||
@Override | |||
public void onSuccess(ResultBean resultBean, ResultBean.BizContent bizContent) { | |||
hideDialog(); | |||
Bundle bundle = new Bundle(); | |||
bundle.putString("vehicleId",vehicleId); | |||
bundle.putString("orderId",orderId); | |||
jumpToPage(ObuActivationBLESearchActivity.class,bundle); | |||
finish(); | |||
} | |||
@Override | |||
public void onError(Response<Result> resp) { | |||
hideDialog(); | |||
} | |||
});*/ | |||
Bundle bundle = new Bundle(); | |||
bundle.putString("vehicleId",vehicleId); | |||
bundle.putString("orderId",orderId); | |||
jumpToPage(ObuActivationBLESearchActivity.class,bundle); | |||
finish(); | |||
} | |||
bluetoothLink(new Currency() { | |||
/** | |||
* 选择图片 | |||
* | |||
* @param imageView | |||
* @param type 1-车头照 2-车身45° 3-安装照 | |||
*/ | |||
public void onImage(ImageView imageView,int type) { | |||
ImageSelectActivity.start(this, data -> { | |||
FatherBean<SendTheVerificationCodeBean> fatherBean = new FatherBean<>(); | |||
fatherBean.bizContent = new SendTheVerificationCodeBean(); | |||
fatherBean.bizContent.setFileBase64(QRCode.imageToBase64(data.get(0))); | |||
showDialog("图片文件上传中..."); | |||
RequestParameters parameters1 = new RequestParameters(IFCode.IFCODE17, new Gson().toJson(fatherBean.bizContent)); | |||
new MyRetrofit().getRetrofit().create(Api.class).message2(parameters1).enqueue(new Converter<Result>(true) { | |||
@Override | |||
public void success() { | |||
//设备激活 | |||
new ObuActivation(BoxManagers.mDecryptVehicleApduBean, getContext()).start(bizContent -> { | |||
//激活步骤 | |||
new ObuActivateRequester().start(bizContent, getContext()); | |||
}); | |||
protected void onSuccess(ResultBean resultBean, ResultBean.BizContent bizContent1) { | |||
ResultBean.ProductInfo decVehInfo = Gson().fromJson(String.valueOf(resultBean.getBizContent()), ResultBean.ProductInfo.class); | |||
hideDialog(); | |||
GlideApp.with(getActivity()).load(data.get(0)).into(imageView); | |||
if (!TextUtils.isEmpty(decVehInfo.data.getUrl())) { | |||
String url = decVehInfo.data.getUrl(); | |||
if (type == 1){ | |||
ivImg1 = url; | |||
}else if (type == 2){ | |||
ivImg2 = url; | |||
}else if (type == 3){ | |||
ivImg3 = url; | |||
} | |||
} | |||
} | |||
}); | |||
} else if (view == binding.rcly || view == binding.rcly2 || view == binding.rcly3) { | |||
ImageSelectActivity.start(this, new ImageSelectActivity.OnPhotoSelectListener() { | |||
@Override | |||
public void onSelected(List<String> data) { | |||
SendTheVerificationCodeBean bean = new SendTheVerificationCodeBean(); | |||
bean.setFileBase64(QRCode.imageToBase64(data.get(0))); | |||
/** | |||
* 文件资源上传 | |||
*/ | |||
MyRetrofit.newInstance(getActivity(), true, IFCode.IFCODE17, bean, new MyRetrofit.ReturnResult() { | |||
@Override | |||
public void onSuccess(ResultBean resultBean, ResultBean.BizContent bizContent) { | |||
ResultBean.ProductInfo decVehInfo = | |||
Gson().fromJson(String.valueOf(resultBean.getBizContent()), ResultBean.ProductInfo.class); | |||
} | |||
}); | |||
public void onError(String err, Response<Result> resp) { | |||
super.onError(err, resp); | |||
hideDialog(); | |||
} | |||
}); | |||
} | |||
}); | |||
} | |||
} |
@@ -36,6 +36,7 @@ import com.huntersun.vkyes.etcopencard.project.ui.activity.mail.InfoTabActivity; | |||
import com.huntersun.vkyes.etcopencard.project.ui.activity.mail.ListDeliveryActivity; | |||
import com.huntersun.vkyes.etcopencard.project.ui.activity.my.RemoveLicensePlateOccupation; | |||
import com.huntersun.vkyes.etcopencard.project.ui.activity.obu.ObuActivationHintActivity; | |||
import com.huntersun.vkyes.etcopencard.project.ui.activity.obu.ObuActivationHintCheckOrderActivity; | |||
import com.huntersun.vkyes.etcopencard.src.aop.SingleClick; | |||
import com.huntersun.vkyes.etcopencard.src.app.AppFragment; | |||
import com.huntersun.vkyes.etcopencard.src.app.TitleBarFragment; | |||
@@ -73,11 +74,12 @@ public class FragmentHomeTow extends TitleBarFragment<MainActivity> { | |||
{R.mipmap.card6, "用户信息变更"}, | |||
{R.mipmap.card7, "车辆信息变更"}, | |||
{R.mipmap.card20, "圈存退费"}, | |||
{R.mipmap.card17, "签约账户变更"}, //待定 | |||
//下面暂时隐藏 | |||
/*{R.mipmap.card15, "审核管理"}, | |||
/* | |||
{R.mipmap.card20, "圈存退费"}, | |||
{R.mipmap.card17, "签约账户变更"}, //待定 | |||
{R.mipmap.card15, "审核管理"}, | |||
{R.mipmap.card7, "满意度评价"}, | |||
{R.mipmap.card18, "发票管理"}, | |||
{R.mipmap.card3, "卡签版本查询"}, | |||
@@ -209,7 +211,7 @@ public class FragmentHomeTow extends TitleBarFragment<MainActivity> { | |||
startActivity(UserEvaluateActivity.class); | |||
break; | |||
case "设备激活": | |||
startActivity(ObuActivationHintActivity.class); | |||
jumpToPage(ObuActivationHintCheckOrderActivity.class); | |||
break; | |||
case "ETC过户": | |||
jumpToPage(TransferOwnershipStep1Activity.class); |
@@ -13,6 +13,7 @@ import com.hjq.widget.view.ClearEditText; | |||
import com.huntersun.vkyes.etcopencard.R; | |||
import com.huntersun.vkyes.etcopencard.project.api.MyRetrofit; | |||
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.src.app.AppActivity; | |||
@@ -41,8 +42,33 @@ public class SearchCarInfoUtils { | |||
private int vehiclePlateColor = 0; | |||
//请求code | |||
private String reqCode = IFCode.IFCODE500; | |||
//是否隐藏搜索按钮 | |||
private boolean hideSearchBtn; | |||
//查询订单步骤 | |||
//1-完成填写基本信息, | |||
//2-完成个人/单位信息上传, | |||
//3-完成车辆信息上传 , | |||
//4-完成签约, | |||
//5-完成订单支付, | |||
//6-待审核, | |||
//7-审核不通过, | |||
//8-待发货, | |||
//9-待收货, | |||
//10-待激活, | |||
//11-已完成, | |||
//12-已申请-换货, | |||
//13-已申请-退货, | |||
//14-已结束, | |||
//15-退款中, | |||
//16-退款成功, | |||
//17-退货成功, | |||
//18-换货-设备已回收, | |||
//19-审核中, | |||
//20-换卡签-卡, | |||
//21-换卡签-签, | |||
//22-换卡签-卡签, | |||
//23-换货-卡, | |||
//24-换货-签, | |||
//25-换货-卡签, | |||
private String orderStep = "11"; | |||
public SearchCarInfoUtils(AppActivity mContext, OnSearchResultClick callback) { | |||
this.mContext = mContext; | |||
@@ -54,12 +80,15 @@ public class SearchCarInfoUtils { | |||
this.reqCallback = reqCallback; | |||
initId(); | |||
} | |||
public SearchCarInfoUtils(AppActivity mContext,String code, OnSearchResultClick callback) { | |||
public SearchCarInfoUtils(AppActivity mContext,String code,OnSearchResultClick callback) { | |||
this.mContext = mContext; | |||
this.callback = callback; | |||
this.reqCode = code; | |||
initId(); | |||
} | |||
public void setParams(String orderStep){ | |||
this.orderStep = orderStep; | |||
} | |||
private void initId() { | |||
etSearch = mContext.findViewById(R.id.etSearch); | |||
@@ -144,13 +173,16 @@ public class SearchCarInfoUtils { | |||
mContext.showDialog("订单信息查询中..."); | |||
Map<String, String> params = new HashMap<>(); | |||
params.put("vehicleId", FunHelper.getText(etSearch) + "_" + vehiclePlateColor); | |||
params.put("orderStep", "11"); | |||
params.put("orderStep", orderStep); | |||
params.put("orderStatus", "0"); | |||
MyRetrofit.newInstance(reqCode, params, new MyRetrofit.ReturnResult() { | |||
@Override | |||
public void onSuccess(ResultBean resultBean, ResultBean.BizContent bizContent) { | |||
FunHelper.closeKeyboard(etSearch); | |||
mContext.hideDialog(); | |||
//设置车牌颜色文字 | |||
bizContent.setVehiclePlateColorStr(EnumBean.backValue(bizContent.getVehiclePlateColor(), EnumBean.VehicleColorArray)); | |||
if (callback != null) { | |||
callback.onSearchResultSuccess(bizContent); | |||
} |
@@ -313,7 +313,6 @@ public abstract class AppActivity extends BaseActivity | |||
currency.success(); | |||
} | |||
} | |||
/** | |||
* 关闭蓝牙页面 | |||
*/ |
@@ -0,0 +1,337 @@ | |||
<?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="设备激活" | |||
app:titleColor="@color/black" /> | |||
<androidx.core.widget.NestedScrollView | |||
style="@style/MatchWrap" | |||
android:layout_below="@+id/title"> | |||
<LinearLayout | |||
style="@style/MatchWrap.Vertical" | |||
android:paddingBottom="@dimen/dp_80"> | |||
<include layout="@layout/layout_vehicleplate" /> | |||
<!--搜索结果--> | |||
<LinearLayout | |||
android:id="@+id/LLSearchResult" | |||
style="@style/MatchWrap.Vertical" | |||
android:visibility="gone"> | |||
<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" | |||
style="@style/MatchWrap.Vertical" | |||
android:visibility="gone"> | |||
<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:paddingLeft="@dimen/dp_15" | |||
android:paddingTop="@dimen/dp_15" | |||
android:paddingRight="@dimen/dp_5" | |||
android:paddingBottom="@dimen/dp_15"> | |||
<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" | |||
style="@style/MatchWrap.Vertical" | |||
android:visibility="gone"> | |||
<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:layout_alignParentBottom="true" | |||
android:layout_gravity="bottom" | |||
android:background="@color/background_color" | |||
android:gravity="center" | |||
android:paddingHorizontal="@dimen/dp_15" | |||
android:paddingVertical="@dimen/dp_10"> | |||
<Button | |||
android:id="@+id/btnNext" | |||
style="@style/BtnShortStyle" | |||
android:layout_width="0dp" | |||
android:layout_height="@dimen/dp_40" | |||
android:layout_alignParentBottom="true" | |||
android:layout_centerHorizontal="true" | |||
android:layout_gravity="center" | |||
android:layout_weight="1" | |||
android:text="下一步" | |||
android:textSize="@dimen/sp_15" /> | |||
</LinearLayout> | |||
</RelativeLayout> |
@@ -72,7 +72,7 @@ | |||
app:corner_radius="@dimen/dp_20" | |||
android:layout_marginLeft="@dimen/dp_20" | |||
android:layout_marginRight="@dimen/dp_20" | |||
android:text="点击重新搜索蓝牙" | |||
android:text="点击搜索蓝牙" | |||
android:gravity="center" | |||
android:layout_marginBottom="@dimen/dp_37"/> | |||
</androidx.constraintlayout.widget.ConstraintLayout> |
@@ -20,7 +20,7 @@ | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:src="@mipmap/ic_obu_6" | |||
android:layout_centerHorizontal="true" | |||
android:layout_marginLeft="@dimen/dp_110" | |||
android:layout_below="@+id/title" | |||
android:layout_marginTop="@dimen/dp_48" | |||
android:id="@+id/img_state"/> | |||
@@ -42,24 +42,13 @@ | |||
android:layout_below="@+id/tv_stated" | |||
android:layout_marginTop="@dimen/dp_20" | |||
android:id="@+id/tv_content"/> | |||
<com.ruffian.library.widget.RTextView | |||
android:layout_width="@dimen/dp_150" | |||
android:layout_height="@dimen/dp_40" | |||
android:layout_below="@+id/tv_content" | |||
android:layout_centerHorizontal="true" | |||
app:background_normal="@color/green01" | |||
app:corner_radius="@dimen/dp_20" | |||
android:id="@+id/btn_back" | |||
android:visibility="invisible" | |||
android:text="返回订单" | |||
android:gravity="center" | |||
style="@style/whiteTextStyle15" | |||
android:layout_marginTop="@dimen/dp_36"/> | |||
<LinearLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:layout_alignTop="@+id/btn_back" | |||
android:layout_below="@+id/tv_content" | |||
android:id="@+id/linear" | |||
android:layout_marginTop="@dimen/dp_20" | |||
android:gravity="center_horizontal" | |||
android:orientation="horizontal"> | |||
<com.ruffian.library.widget.RTextView | |||
@@ -72,6 +61,8 @@ | |||
android:id="@+id/btn_jjjh" | |||
android:text="继续激活" | |||
android:gravity="center" | |||
android:visibility="gone" | |||
android:layout_marginRight="@dimen/dp_40" | |||
style="@style/whiteTextStyle15" /> | |||
<com.ruffian.library.widget.RTextView | |||
android:layout_width="@dimen/dp_130" | |||
@@ -80,9 +71,8 @@ | |||
android:layout_centerHorizontal="true" | |||
app:background_normal="@color/transparent" | |||
app:corner_radius="@dimen/dp_20" | |||
android:layout_marginLeft="@dimen/dp_45" | |||
android:id="@+id/btn_back2" | |||
android:text="返回订单" | |||
android:text="返回首页" | |||
android:gravity="center" | |||
app:border_color_normal="@color/green01" | |||
app:border_width_normal="@dimen/dp_0_5" |
@@ -82,7 +82,7 @@ | |||
app:layout_constraintBottom_toBottomOf="@+id/tv_bg_1" | |||
app:layout_constraintLeft_toLeftOf="@+id/tv_bg_1" | |||
app:layout_constraintRight_toRightOf="@+id/tv_bg_1" | |||
android:id="@+id/img_real_up"/> | |||
android:id="@+id/ivImg1"/> | |||
<com.ruffian.library.widget.RTextView | |||
android:layout_width="match_parent" | |||
@@ -143,7 +143,7 @@ | |||
app:layout_constraintBottom_toBottomOf="@+id/tv_bg_2" | |||
app:layout_constraintLeft_toLeftOf="@+id/tv_bg_2" | |||
app:layout_constraintRight_toRightOf="@+id/tv_bg_2" | |||
android:id="@+id/img_real_up_2"/> | |||
android:id="@+id/ivImg2"/> | |||
<com.ruffian.library.widget.RTextView | |||
android:layout_width="match_parent" | |||
android:layout_height="0dp" | |||
@@ -203,7 +203,7 @@ | |||
app:layout_constraintBottom_toBottomOf="@+id/tv_bg_3" | |||
app:layout_constraintLeft_toLeftOf="@+id/tv_bg_3" | |||
app:layout_constraintRight_toRightOf="@+id/tv_bg_3" | |||
android:id="@+id/img_real_up_3"/> | |||
android:id="@+id/ivImg3"/> | |||
<com.ruffian.library.widget.RTextView | |||
android:layout_width="match_parent" | |||
android:layout_height="0dp" |