|
|
@@ -25,6 +25,11 @@ 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.api.bean.SendTheVerificationCodeBean; |
|
|
|
import com.huntersun.vkyes.etcopencard.project.dialog.ConfirmDialog; |
|
|
|
import com.huntersun.vkyes.etcopencard.project.tool.MyShared; |
|
|
|
import com.huntersun.vkyes.etcopencard.project.ui.activity.after.CommonDealSuccessActivity; |
|
|
|
import com.huntersun.vkyes.etcopencard.project.ui.activity.after.TransferOwnershipStep3Activity; |
|
|
|
import com.huntersun.vkyes.etcopencard.project.utils.Constants; |
|
|
|
import com.huntersun.vkyes.etcopencard.src.action.StatusAction; |
|
|
|
import com.huntersun.vkyes.etcopencard.src.aop.SingleClick; |
|
|
|
import com.huntersun.vkyes.etcopencard.src.app.AppActivity; |
|
|
@@ -32,7 +37,9 @@ import com.huntersun.vkyes.etcopencard.src.widget.StatusLayout; |
|
|
|
import com.scwang.smart.refresh.layout.api.RefreshLayout; |
|
|
|
import com.scwang.smart.refresh.layout.listener.OnRefreshLoadMoreListener; |
|
|
|
|
|
|
|
import java.util.HashMap; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Map; |
|
|
|
|
|
|
|
import androidx.annotation.NonNull; |
|
|
|
import retrofit2.Response; |
|
|
@@ -45,6 +52,8 @@ import retrofit2.Response; |
|
|
|
public class ETCHandleActivity extends AppActivity implements OnRefreshLoadMoreListener, StatusAction { |
|
|
|
private ActivityEtchandleBinding binding; |
|
|
|
|
|
|
|
private String orderId; |
|
|
|
|
|
|
|
@Override |
|
|
|
protected View getLayoutView() { |
|
|
|
binding = ActivityEtchandleBinding.inflate(getLayoutInflater()); |
|
|
@@ -53,6 +62,8 @@ public class ETCHandleActivity extends AppActivity implements OnRefreshLoadMoreL |
|
|
|
|
|
|
|
@Override |
|
|
|
protected void initView() { |
|
|
|
orderId = getIntent().getStringExtra("orderId"); |
|
|
|
|
|
|
|
setTitle("订单支付"); |
|
|
|
binding.recycler.setAdapter(adapter); |
|
|
|
binding.rlStatusRefresh.setOnRefreshListener(this); |
|
|
@@ -65,7 +76,7 @@ public class ETCHandleActivity extends AppActivity implements OnRefreshLoadMoreL |
|
|
|
//5.35.CSMSN-根据订单编号获取可选择产品信息 |
|
|
|
FatherBean<SendTheVerificationCodeBean> fatherBean = new FatherBean<>(); |
|
|
|
fatherBean.bizContent = new SendTheVerificationCodeBean(); |
|
|
|
fatherBean.bizContent.setOrderId(getIntent().getStringExtra("orderId") + ""); |
|
|
|
fatherBean.bizContent.setOrderId(orderId); |
|
|
|
Log.e("okhttp", "打印标题:" + new Gson().toJson(fatherBean)); |
|
|
|
RequestParameters parameters1 = new RequestParameters(IFCode.IFCODE48, new Gson().toJson(fatherBean.bizContent)); |
|
|
|
new MyRetrofit().getRetrofit().create(Api.class).message2(parameters1).enqueue(new Converter<Result>(true) { |
|
|
@@ -109,20 +120,50 @@ public class ETCHandleActivity extends AppActivity implements OnRefreshLoadMoreL |
|
|
|
toast("无法获取卡类型"); |
|
|
|
return; |
|
|
|
} |
|
|
|
Bundle bundle = new Bundle(); |
|
|
|
bundle.putString("bizContent", JSON.toJSONString(items)); |
|
|
|
bundle.putString("orderId", getIntent().getStringExtra("orderId") + ""); |
|
|
|
if ("2".equals(items.getIsValueCard())){//储值卡-无需签约 |
|
|
|
jumpToPage(ETCHandleSonActivity.class,bundle); |
|
|
|
}else if ("1".equals(items.getIsValueCard())){//记账卡-需要签约 |
|
|
|
jumpToPage(ContractActivity.class,bundle); |
|
|
|
} |
|
|
|
chooseProduct(items); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
* 订单产品选择接口 |
|
|
|
*/ |
|
|
|
private void chooseProduct(ResultBean.BizContent items){ |
|
|
|
showDialog("请稍后..."); |
|
|
|
Map<String, String> params = new HashMap<>(); |
|
|
|
params.put("orderId", orderId); |
|
|
|
params.put("productId", items.getId()); |
|
|
|
MyRetrofit.newInstance(IFCode.IFCODE914, params, new MyRetrofit.ReturnResult() { |
|
|
|
@Override |
|
|
|
public void onSuccess(ResultBean resultBean, ResultBean.BizContent bizContent) { |
|
|
|
hideDialog(); |
|
|
|
gotoNextPage(items); |
|
|
|
} |
|
|
|
@Override |
|
|
|
public void onError(Response<Result> resp) { |
|
|
|
hideDialog(); |
|
|
|
new ConfirmDialog.Builder(ETCHandleActivity.this).setMsg(resp.body().errorMsg, "无法选择产品","确定","", R.mipmap.icon_lotgout_etc_hint, 0,true) |
|
|
|
.onClick(new ConfirmDialog.Result() { |
|
|
|
@Override |
|
|
|
public void confirm() { } |
|
|
|
}).show(); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
private void gotoNextPage(ResultBean.BizContent items){ |
|
|
|
Bundle bundle = new Bundle(); |
|
|
|
bundle.putString("bizContent", JSON.toJSONString(items)); |
|
|
|
bundle.putString("orderId", orderId); |
|
|
|
if ("2".equals(items.getIsValueCard())){//储值卡-无需签约 |
|
|
|
jumpToPage(ETCHandleSonActivity.class,bundle); |
|
|
|
}else if ("1".equals(items.getIsValueCard())){//记账卡-需要签约 |
|
|
|
jumpToPage(ContractActivity.class,bundle); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public StatusLayout getStatusLayout() { |
|
|
|
return binding.hlStatusHint; |