public static final String IFCODE155 = "155"; //订单完成收货 | public static final String IFCODE155 = "155"; //订单完成收货 | ||||
public static final String IFCODE171 = "171"; //根据车辆ID获取正常的状态储值卡 | public static final String IFCODE171 = "171"; //根据车辆ID获取正常的状态储值卡 | ||||
public static final String IFCODE9 = "9"; //根据订单ID查询订单详情 | public static final String IFCODE9 = "9"; //根据订单ID查询订单详情 | ||||
public static final String IFCODE8 = "8"; //根据订单编号orderId查询订单详情 | |||||
public static final String IFCODE50 = "50"; //写卡指令申请 | public static final String IFCODE50 = "50"; //写卡指令申请 | ||||
public static final String IFCODE51 = "51"; //写卡指令返回 | public static final String IFCODE51 = "51"; //写卡指令返回 |
} | } | ||||
} | } | ||||
public static class ReleaseProductInfo{ | |||||
public String remarks; | |||||
} | |||||
public static class ProductInfo{ | public static class ProductInfo{ | ||||
public String id; //产品ID | public String id; //产品ID | ||||
public Long fee; //业务员端-产品价格 | public Long fee; //业务员端-产品价格 | ||||
public String productMsg; //产品描述信息 | public String productMsg; //产品描述信息 | ||||
public BizContent data; | public BizContent data; | ||||
public long oncePrice; | |||||
@Override | @Override | ||||
public String toString() { | public String toString() { | ||||
* \"validityFormat\":1 | * \"validityFormat\":1 | ||||
* */ | * */ | ||||
public static class BizContent<T> { | public static class BizContent<T> { | ||||
public long oncePrice; | |||||
public ReleaseProductInfo releaseProduct; | |||||
public String remarks; | |||||
public String promoteId; | public String promoteId; | ||||
public String productIntro; | public String productIntro; | ||||
private String isSign; | private String isSign; | ||||
public String applyType; //申请单类型 | public String applyType; //申请单类型 | ||||
public String damageMode; //0-人为损坏 1-自然损坏 | public String damageMode; //0-人为损坏 1-自然损坏 | ||||
public List<BizContent> csmsnProducts;//产品选择列表 | public List<BizContent> csmsnProducts;//产品选择列表 | ||||
public List<BizContent> multipleeEquity;//多项权益 | |||||
public List<BizContent> singleEquity;//单项权益 | |||||
public List<BizContent> list; //申请单列表(更换ETC时使用) | public List<BizContent> list; //申请单列表(更换ETC时使用) | ||||
public List<BizContent> customers; //用户信息查询列表 | public List<BizContent> customers; //用户信息查询列表 | ||||
public List<BizContent> vehicles; //车辆信息查询列表 | public List<BizContent> vehicles; //车辆信息查询列表 | ||||
public long aggregateAmount; //总金额 | public long aggregateAmount; //总金额 | ||||
public String ossFilePath; //下载 文件服务地址 | public String ossFilePath; //下载 文件服务地址 | ||||
public String originalFileName; //下载 文件服务地址名称 output.xlsx | public String originalFileName; //下载 文件服务地址名称 output.xlsx | ||||
public String cardType; //卡类型 | |||||
public String[] cardType; //卡类型 | |||||
public String tel; //用户手机 | public String tel; //用户手机 | ||||
public boolean hasMore; //是否有更多数据 | public boolean hasMore; //是否有更多数据 | ||||
} | } | ||||
}); | }); | ||||
LinearLayoutManager layoutManager = new LinearLayoutManager(this, RecyclerView.VERTICAL,false); | LinearLayoutManager layoutManager = new LinearLayoutManager(this, RecyclerView.VERTICAL,false); | ||||
CommonItemDecoration itemDecoration = new CommonItemDecoration(0,40,40,0,40,0); | |||||
CommonItemDecoration itemDecoration = new CommonItemDecoration(0,40,40,0,40,40); | |||||
binding.recycler.setLayoutManager(layoutManager); | binding.recycler.setLayoutManager(layoutManager); | ||||
binding.recycler.addItemDecoration(itemDecoration); | binding.recycler.addItemDecoration(itemDecoration); | ||||
binding.recycler.setAdapter(adapter); | binding.recycler.setAdapter(adapter); |
intent.setClass(ContractActivity.this, ETCHandleActivity.class); | intent.setClass(ContractActivity.this, ETCHandleActivity.class); | ||||
startActivity(intent); | startActivity(intent); | ||||
finish();*/ | finish();*/ | ||||
Bundle bundle = new Bundle(); | |||||
bundle.putString("bizContent", getIntent().getStringExtra("bizContent")); | |||||
bundle.putString("orderId", getIntent().getStringExtra("orderId")); | |||||
bundle.putString("isSign",getIntent().getStringExtra("isSign")); | |||||
jumpToPage(AddPurchaseChooseActivity.class,bundle); | |||||
finish(); | |||||
if (true){ | |||||
return; | |||||
} | |||||
// Bundle bundle = new Bundle(); | |||||
// bundle.putString("bizContent", getIntent().getStringExtra("bizContent")); | |||||
// bundle.putString("orderId", getIntent().getStringExtra("orderId")); | |||||
// bundle.putString("isSign",getIntent().getStringExtra("isSign")); | |||||
// jumpToPage(AddPurchaseChooseActivity.class,bundle); | |||||
// finish(); | |||||
// if (true){ | |||||
// return; | |||||
// } | |||||
//签约检测 | //签约检测 | ||||
FatherBean<SendTheVerificationCodeBean> fatherBean = new FatherBean<>(); | FatherBean<SendTheVerificationCodeBean> fatherBean = new FatherBean<>(); | ||||
fatherBean.bizContent = new SendTheVerificationCodeBean(); | fatherBean.bizContent = new SendTheVerificationCodeBean(); |
import com.huntersun.vkyes.etcopencard.project.tool.QRCode; | import com.huntersun.vkyes.etcopencard.project.tool.QRCode; | ||||
import com.huntersun.vkyes.etcopencard.project.tool.Utils; | import com.huntersun.vkyes.etcopencard.project.tool.Utils; | ||||
import com.huntersun.vkyes.etcopencard.project.utils.Constants; | import com.huntersun.vkyes.etcopencard.project.utils.Constants; | ||||
import com.huntersun.vkyes.etcopencard.project.utils.FunHelper; | |||||
import com.huntersun.vkyes.etcopencard.src.action.StatusAction; | import com.huntersun.vkyes.etcopencard.src.action.StatusAction; | ||||
import com.huntersun.vkyes.etcopencard.src.aop.SingleClick; | import com.huntersun.vkyes.etcopencard.src.aop.SingleClick; | ||||
import com.huntersun.vkyes.etcopencard.src.app.AppActivity; | import com.huntersun.vkyes.etcopencard.src.app.AppActivity; | ||||
Drawable drawable = new BitmapDrawable(bitmap); | Drawable drawable = new BitmapDrawable(bitmap); | ||||
binding.image.setImageDrawable(drawable); | binding.image.setImageDrawable(drawable); | ||||
try { | try { | ||||
binding.text.setText("¥ " + (Double.valueOf(bizContent.getTotalFee()) * 0.01)); | |||||
binding.text.setText("¥ " + (FunHelper.changeF2Y(Long.valueOf(bizContent.getTotalFee())))); | |||||
} catch (Exception ignored) { | } catch (Exception ignored) { | ||||
Log.e("log", "打印标题:" + ignored.getMessage()); | Log.e("log", "打印标题:" + ignored.getMessage()); | ||||
} | } |
@SuppressLint("UseCompatLoadingForDrawables") | @SuppressLint("UseCompatLoadingForDrawables") | ||||
@Override | @Override | ||||
protected void convert(BaseViewHolder helper, ResultBean.BizContent items) { | protected void convert(BaseViewHolder helper, ResultBean.BizContent items) { | ||||
String cardName = ""; | |||||
for (String i : items.cardType){ | |||||
switch (i){ | |||||
case "1": | |||||
if ("".equals(cardName)){ | |||||
cardName = cardName + "记账卡"; | |||||
}else { | |||||
cardName = cardName + ",记账卡"; | |||||
} | |||||
break; | |||||
case "2": | |||||
if ("".equals(cardName)){ | |||||
cardName = cardName + "储值卡"; | |||||
}else { | |||||
cardName = cardName + ",储值卡"; | |||||
} | |||||
break; | |||||
case "3": | |||||
if ("".equals(cardName)){ | |||||
cardName = cardName + "预存卡"; | |||||
}else { | |||||
cardName = cardName + ",预存卡"; | |||||
} | |||||
break; | |||||
} | |||||
} | |||||
helper.setText(R.id.text1, items.promoteName); // 产品名称 | helper.setText(R.id.text1, items.promoteName); // 产品名称 | ||||
helper.setText(R.id.text2, "1".equals(items.cardType) ? "记账卡" : "储值卡"); // 产品介绍 | |||||
helper.setText(R.id.text3, items.getFee() * 0.01 + ""); // 金额 | |||||
helper.setText(R.id.text2, cardName); // 产品介绍 | |||||
helper.setText(R.id.text3, items.oncePrice * 0.01 + ""); // 金额 | |||||
LinearLayout layout = helper.getView(R.id.layout); | LinearLayout layout = helper.getView(R.id.layout); | ||||
if (helper.getPosition() == 1) { | if (helper.getPosition() == 1) { | ||||
layout.setBackground(getResources().getDrawable(R.mipmap.product_bg2)); | layout.setBackground(getResources().getDrawable(R.mipmap.product_bg2)); | ||||
Map<String, String> params = new HashMap<>(); | Map<String, String> params = new HashMap<>(); | ||||
params.put("orderId", getIntent().getStringExtra("orderId")); | params.put("orderId", getIntent().getStringExtra("orderId")); | ||||
params.put("promoteId", items.promoteId); | params.put("promoteId", items.promoteId); | ||||
MyRetrofit.newInstance(IFCode.IFCODE914, params, new MyRetrofit.ReturnResult(){ | |||||
MyRetrofit.newInstance(IFCode.IFCODE_PRODUCT_COMMIT, params, new MyRetrofit.ReturnResult(){ | |||||
@Override | @Override | ||||
public void onSuccess(ResultBean resultBean, ResultBean.BizContent bizContent) { | public void onSuccess(ResultBean resultBean, ResultBean.BizContent bizContent) { | ||||
LiveEventBus.get("homeOneUpdateData").post(""); | LiveEventBus.get("homeOneUpdateData").post(""); | ||||
@Override | @Override | ||||
public void onRefresh(@NonNull RefreshLayout refreshLayout) { | public void onRefresh(@NonNull RefreshLayout refreshLayout) { | ||||
initData(); | initData(); | ||||
refreshLayout.finishRefresh(); | |||||
} | } | ||||
} | } |
import com.alibaba.fastjson.JSONObject; | import com.alibaba.fastjson.JSONObject; | ||||
import com.chad.library.adapter.base.BaseQuickAdapter; | import com.chad.library.adapter.base.BaseQuickAdapter; | ||||
import com.chad.library.adapter.base.BaseViewHolder; | import com.chad.library.adapter.base.BaseViewHolder; | ||||
import com.hjq.base.BaseDialog; | |||||
import com.huntersun.vkyes.etcopencard.R; | import com.huntersun.vkyes.etcopencard.R; | ||||
import com.huntersun.vkyes.etcopencard.databinding.ActivityEtchandleSonBinding; | import com.huntersun.vkyes.etcopencard.databinding.ActivityEtchandleSonBinding; | ||||
import com.huntersun.vkyes.etcopencard.project.api.MyRetrofit; | import com.huntersun.vkyes.etcopencard.project.api.MyRetrofit; | ||||
import com.huntersun.vkyes.etcopencard.src.aop.SingleClick; | import com.huntersun.vkyes.etcopencard.src.aop.SingleClick; | ||||
import com.huntersun.vkyes.etcopencard.src.app.AppActivity; | import com.huntersun.vkyes.etcopencard.src.app.AppActivity; | ||||
import com.huntersun.vkyes.etcopencard.src.http.glide.GlideApp; | import com.huntersun.vkyes.etcopencard.src.http.glide.GlideApp; | ||||
import com.huntersun.vkyes.etcopencard.src.ui.dialog.MessageDialog; | |||||
import java.util.ArrayList; | import java.util.ArrayList; | ||||
import java.util.HashMap; | import java.util.HashMap; | ||||
private EquityChooseAdapter adapter; | private EquityChooseAdapter adapter; | ||||
private ArrayList<ResultBean.BizContent> list = new ArrayList<>(); | private ArrayList<ResultBean.BizContent> list = new ArrayList<>(); | ||||
private ArrayList<String> equityList = new ArrayList<>(); | private ArrayList<String> equityList = new ArrayList<>(); | ||||
private long totalAmountFee = 0; | |||||
private long totalAmountFee = 0;//产品总金额 | |||||
private long equityAllFee = 0;//权益总金额 | |||||
@Override | @Override | ||||
protected void initView() { | protected void initView() { | ||||
setTitle("订单支付"); | setTitle("订单支付"); | ||||
initRecyclerview(); | initRecyclerview(); | ||||
if ("1".equals(getIntent().getStringExtra("isPay"))){ | |||||
if ("1".equals(getIntent().getStringExtra("isPay"))) { | |||||
binding.tvAddPurchase.setVisibility(View.INVISIBLE); | binding.tvAddPurchase.setVisibility(View.INVISIBLE); | ||||
}else { | |||||
} else { | |||||
binding.tvAddPurchase.setVisibility(View.VISIBLE); | binding.tvAddPurchase.setVisibility(View.VISIBLE); | ||||
} | } | ||||
binding.rrelative.getHelper().setBackgroundColorNormalArray(this.getResources().getIntArray(R.array.green_bg_arr)); | binding.rrelative.getHelper().setBackgroundColorNormalArray(this.getResources().getIntArray(R.array.green_bg_arr)); | ||||
ResultBean.BizContent biz = | ResultBean.BizContent biz = | ||||
JSON.parseObject(getIntent().getStringExtra("bizContent"), ResultBean.BizContent.class); | JSON.parseObject(getIntent().getStringExtra("bizContent"), ResultBean.BizContent.class); | ||||
if("0".equals(getIntent().getStringExtra("isSign"))){//0不签约 | |||||
if ("0".equals(getIntent().getStringExtra("isSign"))) {//0不签约 | |||||
binding.lyQiany.setVisibility(View.GONE); | binding.lyQiany.setVisibility(View.GONE); | ||||
}else {//1签约 | |||||
} else {//1签约 | |||||
binding.lyQiany.setVisibility(View.VISIBLE); | binding.lyQiany.setVisibility(View.VISIBLE); | ||||
} | } | ||||
Map<String, String> params = new HashMap<>(); | |||||
params.put("id", biz.getId() + ""); | |||||
MyRetrofit.newInstance(IFCode.IFCODE9, params, new MyRetrofit.ReturnResult() { | |||||
@Override | |||||
public void onSuccess(ResultBean resultBean, ResultBean.BizContent bizContent) { | |||||
binding.text1.setText(bizContent.getProductName()); | |||||
// binding.text2.setText("基础服务"); | |||||
totalAmountFee += bizContent.product.fee; | |||||
binding.text3.setText(bizContent.product.productMsg); | |||||
binding.text4.setText(bizContent.product.fee * 0.01 + ""); | |||||
binding.text6.setText("¥" + totalAmountFee * 0.01); | |||||
binding.text5.setText("¥" + bizContent.product.fee * 0.01); | |||||
} | |||||
@Override | |||||
public void onError() { | |||||
MyRetrofit.ReturnResult.super.onError(); | |||||
} | |||||
}); | |||||
// Map<String, String> params = new HashMap<>(); | |||||
// params.put("id", biz.getId() + ""); | |||||
// MyRetrofit.newInstance(IFCode.IFCODE9, params, new MyRetrofit.ReturnResult() { | |||||
// @Override | |||||
// public void onSuccess(ResultBean resultBean, ResultBean.BizContent bizContent) { | |||||
//// binding.text2.setText("基础服务"); | |||||
// totalAmountFee += bizContent.product.fee; | |||||
// totalAmountFee += equityAllFee; | |||||
// binding.text1.setText(bizContent.getProductName()); | |||||
// binding.text3.setText(bizContent.product.productMsg); | |||||
// binding.text4.setText(bizContent.product.fee * 0.01 + ""); | |||||
// binding.tvMoneyJg.setText("¥" +equityAllFee*0.01); | |||||
// binding.text6.setText("¥" + totalAmountFee * 0.01); | |||||
// binding.text5.setText("¥" + bizContent.product.fee * 0.01); | |||||
// } | |||||
// | |||||
// @Override | |||||
// public void onError() { | |||||
// MyRetrofit.ReturnResult.super.onError(); | |||||
// } | |||||
// }); | |||||
binding.tvAddPurchase.setOnClickListener(new View.OnClickListener() { | binding.tvAddPurchase.setOnClickListener(new View.OnClickListener() { | ||||
@Override | @Override | ||||
public void onClick(View view) { | public void onClick(View view) { | ||||
Intent intent = new Intent(); | Intent intent = new Intent(); | ||||
intent.putExtra("orderId",getIntent().getStringExtra("orderId")); | |||||
intent.putExtra("bizContent",getIntent().getStringExtra("bizContent")); | |||||
intent.putExtra("isSign",getIntent().getStringExtra("isSign")); | |||||
if (list.size()>0){ | |||||
intent.putExtra("purchase", JSON.toJSONString(list)); | |||||
intent.putExtra("orderId", getIntent().getStringExtra("orderId")); | |||||
intent.putExtra("bizContent", getIntent().getStringExtra("bizContent")); | |||||
intent.putExtra("isSign", getIntent().getStringExtra("isSign")); | |||||
if (list.size() > 0) { | |||||
intent.putExtra("purchase", JSON.toJSONString(list)); | |||||
} | } | ||||
intent.setClass(ETCHandleSonActivity.this,AddPurchaseChooseActivity.class); | |||||
intent.setClass(ETCHandleSonActivity.this, AddPurchaseChooseActivity.class); | |||||
ETCHandleSonActivity.this.startActivity(intent); | ETCHandleSonActivity.this.startActivity(intent); | ||||
} | } | ||||
}); | }); | ||||
@Override | @Override | ||||
@SingleClick | @SingleClick | ||||
public void onClick(View v) { | public void onClick(View v) { | ||||
if (equityList.size()>0){ | |||||
HashMap<String,String> params = new HashMap<>(); | |||||
if (equityList.size() > 0) { | |||||
HashMap<String, String> params = new HashMap<>(); | |||||
params.put("orderId", getIntent().getStringExtra("orderId")); | params.put("orderId", getIntent().getStringExtra("orderId")); | ||||
params.put("openId",(String) MyShared.getInstance().get(MyShared.OPENID,"")); | |||||
params.put("equityId", TextUtils.join(",",equityList)); | |||||
params.put("totalAmount",totalAmountFee+""); | |||||
params.put("isRepeatPurchase","0"); | |||||
params.put("openId", (String) MyShared.getInstance().get(MyShared.OPENID, "")); | |||||
params.put("equityId", TextUtils.join(",", equityList)); | |||||
params.put("totalAmount", totalAmountFee + ""); | |||||
params.put("isRepeatPurchase", "0"); | |||||
MyRetrofit.newInstance(IFCode.IFCODE_JGOUCHOOSE, params, new MyRetrofit.ReturnResult() { | MyRetrofit.newInstance(IFCode.IFCODE_JGOUCHOOSE, params, new MyRetrofit.ReturnResult() { | ||||
@Override | @Override | ||||
public void onSuccess(ResultBean resultBean, ResultBean.BizContent bizContent) { | public void onSuccess(ResultBean resultBean, ResultBean.BizContent bizContent) { | ||||
Intent intent = new Intent(); | |||||
intent.putExtra("orderId", getIntent().getStringExtra("orderId")); | |||||
intent.putExtra("id", biz.getId() + ""); | |||||
intent.setClass(ETCHandleSonActivity.this, DefrayActivity.class); | |||||
startActivity(intent); | |||||
ETCHandleSonActivity.this.finish(); | |||||
if ("1".equals(getIntent().getStringExtra("isPay"))) { | |||||
Intent intent = new Intent(); | |||||
intent.putExtra("orderId", getIntent().getStringExtra("orderId")); | |||||
intent.putExtra("id", biz.getId() + ""); | |||||
intent.setClass(ETCHandleSonActivity.this, DefrayActivity.class); | |||||
startActivity(intent); | |||||
ETCHandleSonActivity.this.finish(); | |||||
}else { | |||||
new MessageDialog.Builder(getActivity()) | |||||
// 标题可以不用填写 | |||||
.setTitle("提示") | |||||
// 内容必须要填写 | |||||
.setMessage("是否确认提交信息,生成支付二维码") | |||||
.setListener(new MessageDialog.OnListener() { | |||||
@Override | |||||
public void onConfirm(BaseDialog dialog) { | |||||
Intent intent = new Intent(); | |||||
intent.putExtra("orderId", getIntent().getStringExtra("orderId")); | |||||
intent.putExtra("id", biz.getId() + ""); | |||||
intent.setClass(ETCHandleSonActivity.this, DefrayActivity.class); | |||||
startActivity(intent); | |||||
ETCHandleSonActivity.this.finish(); | |||||
} | |||||
@Override | |||||
public void onCancel(BaseDialog dialog) { | |||||
} | |||||
}) | |||||
.show(); | |||||
} | |||||
} | } | ||||
@Override | @Override | ||||
MyRetrofit.ReturnResult.super.onError(resp); | MyRetrofit.ReturnResult.super.onError(resp); | ||||
} | } | ||||
}); | }); | ||||
}else { | |||||
} else { | |||||
Intent intent = new Intent(); | Intent intent = new Intent(); | ||||
intent.putExtra("orderId", getIntent().getStringExtra("orderId")); | intent.putExtra("orderId", getIntent().getStringExtra("orderId")); | ||||
intent.putExtra("id", biz.getId() + ""); | intent.putExtra("id", biz.getId() + ""); | ||||
adapter = new EquityChooseAdapter(this, R.layout.item_euqity_2, new EquityChooseAdapter.OnDelClickListener() { | adapter = new EquityChooseAdapter(this, R.layout.item_euqity_2, new EquityChooseAdapter.OnDelClickListener() { | ||||
@Override | @Override | ||||
public void onDelClick(View view, int position) { | public void onDelClick(View view, int position) { | ||||
equityList.remove(list.get(position).equityId); | |||||
if (equityList.size() > 0) { | |||||
equityList.remove(list.get(position).equityId); | |||||
} | |||||
totalAmountFee -= list.get(position).discountPrice; | totalAmountFee -= list.get(position).discountPrice; | ||||
equityAllFee -= list.get(position).discountPrice; | |||||
binding.tvMoneyJg.setText("¥" + equityAllFee * 0.01); | |||||
binding.text6.setText("¥" + totalAmountFee * 0.01); | binding.text6.setText("¥" + totalAmountFee * 0.01); | ||||
adapter.remove(position); | adapter.remove(position); | ||||
list.remove(position); | |||||
if (list.size() > 0) { | |||||
list.remove(position); | |||||
} | |||||
} | } | ||||
@Override | @Override | ||||
} | } | ||||
}); | }); | ||||
LinearLayoutManager layoutManager = new LinearLayoutManager(this, RecyclerView.VERTICAL,false); | |||||
CommonItemDecoration itemDecoration = new CommonItemDecoration(0,40,0,0,0,0); | |||||
LinearLayoutManager layoutManager = new LinearLayoutManager(this, RecyclerView.VERTICAL, false); | |||||
CommonItemDecoration itemDecoration = new CommonItemDecoration(0, 40, 0, 0, 0, 0); | |||||
binding.recyclerJg.setLayoutManager(layoutManager); | binding.recyclerJg.setLayoutManager(layoutManager); | ||||
binding.recyclerJg.addItemDecoration(itemDecoration); | binding.recyclerJg.addItemDecoration(itemDecoration); | ||||
binding.recyclerJg.setAdapter(adapter); | binding.recyclerJg.setAdapter(adapter); | ||||
} | } | ||||
private void getData() { | private void getData() { | ||||
if (list.size()>0){ | |||||
if (list.size() > 0) { | |||||
list.clear(); | list.clear(); | ||||
} | } | ||||
if (null!=getIntent().getStringExtra("purchase")){ | |||||
if (null != getIntent().getStringExtra("purchase")) { | |||||
list.addAll(JSONObject.parseArray(getIntent().getStringExtra("purchase"), ResultBean.BizContent.class)); | list.addAll(JSONObject.parseArray(getIntent().getStringExtra("purchase"), ResultBean.BizContent.class)); | ||||
Log.e("listSize",list.size()+""); | |||||
for (ResultBean.BizContent biz : list){ | |||||
totalAmountFee += biz.discountPrice; | |||||
Log.e("listSize", list.size() + ""); | |||||
for (ResultBean.BizContent biz : list) { | |||||
equityAllFee += biz.discountPrice; | |||||
equityList.add(biz.equityId); | equityList.add(biz.equityId); | ||||
} | } | ||||
adapter.replaceData(list); | adapter.replaceData(list); | ||||
} | } | ||||
Map<String, String> params2 = new HashMap<>(); | |||||
params2.put("orderId", getIntent().getStringExtra("orderId")); | |||||
MyRetrofit.newInstance(IFCode.IFCODE8, params2, new MyRetrofit.ReturnResult() { | |||||
@Override | |||||
public void onSuccess(ResultBean resultBean, ResultBean.BizContent bizContent) { | |||||
Log.e("result11111",resultBean.toString()); | |||||
if ("1".equals(getIntent().getStringExtra("isPay"))) { | |||||
if (bizContent.multipleeEquity.size() > 0) { | |||||
list.addAll(bizContent.multipleeEquity); | |||||
} | |||||
if (bizContent.singleEquity.size() > 0) { | |||||
list.addAll(bizContent.singleEquity); | |||||
} | |||||
for (ResultBean.BizContent biz : list) { | |||||
equityAllFee += biz.discountPrice; | |||||
} | |||||
adapter.setCanChanged(false); | |||||
} | |||||
totalAmountFee += bizContent.product.oncePrice; | |||||
totalAmountFee += equityAllFee; | |||||
adapter.replaceData(list); | |||||
binding.text1.setText(bizContent.getProductName()); | |||||
binding.text3.setText(bizContent.releaseProduct.remarks); | |||||
binding.text4.setText(FunHelper.changeF2Y(bizContent.product.oncePrice)); | |||||
binding.tvMoneyJg.setText("¥"+FunHelper.changeF2Y(equityAllFee)); | |||||
binding.text6.setText("¥"+FunHelper.changeF2Y(totalAmountFee)); | |||||
binding.text5.setText("¥"+FunHelper.changeF2Y(bizContent.product.oncePrice)); | |||||
// binding.tvMoneyJg.setText("¥" +equityAllFee*0.01); | |||||
// binding.text6.setText("¥" + totalAmountFee * 0.01); | |||||
} | |||||
@Override | |||||
public void onError() { | |||||
MyRetrofit.ReturnResult.super.onError(); | |||||
} | |||||
}); | |||||
} | } | ||||
} | } |
Log.e("log", "打印标题:" + s); | Log.e("log", "打印标题:" + s); | ||||
initView(); | initView(); | ||||
}); | }); | ||||
if ("1".equals(getIntent().getStringExtra("type"))) { | |||||
if ("2".equals(getIntent().getStringExtra("type"))) { | |||||
binding.lyHzzl.setVisibility(View.VISIBLE);//核载质量 | binding.lyHzzl.setVisibility(View.VISIBLE);//核载质量 | ||||
binding.layoutCzs.setVisibility(View.VISIBLE);//车轴数 | binding.layoutCzs.setVisibility(View.VISIBLE);//车轴数 | ||||
}else { | }else { |
.onClick(new PersonalCompanyDialog.Result() { | .onClick(new PersonalCompanyDialog.Result() { | ||||
@Override | @Override | ||||
public void success() { | public void success() { | ||||
intent.putExtra("type", "1"); //货车 | |||||
intent.putExtra("type", "2"); //货车 | |||||
// intent.setClass(MainActivity.this, FillOutMessage.class); | // intent.setClass(MainActivity.this, FillOutMessage.class); | ||||
intent.setClass(MainActivity.this, ETCHandleActivity.class); | intent.setClass(MainActivity.this, ETCHandleActivity.class); | ||||
startActivity(intent); | startActivity(intent); | ||||
@Override | @Override | ||||
public void fail() { | public void fail() { | ||||
intent.putExtra("type", "0"); //客车 | |||||
intent.putExtra("type", "1"); //客车 | |||||
intent.setClass(MainActivity.this, ETCHandleActivity.class); | intent.setClass(MainActivity.this, ETCHandleActivity.class); | ||||
startActivity(intent); | startActivity(intent); | ||||
} | } |
binding.text14.setOnClickListener(this); | binding.text14.setOnClickListener(this); | ||||
binding.text15.setOnClickListener(this); | binding.text15.setOnClickListener(this); | ||||
binding.text16.setOnClickListener(this); | binding.text16.setOnClickListener(this); | ||||
if ("1".equals(getIntent().getStringExtra("type"))){ | |||||
if ("2".equals(getIntent().getStringExtra("type"))){ | |||||
binding.layout90.setVisibility(View.VISIBLE); | binding.layout90.setVisibility(View.VISIBLE); | ||||
binding.layout3.setVisibility(View.VISIBLE); | binding.layout3.setVisibility(View.VISIBLE); | ||||
binding.layout4.setVisibility(View.VISIBLE); | binding.layout4.setVisibility(View.VISIBLE); | ||||
return; | return; | ||||
} | } | ||||
//货车内容校验 | //货车内容校验 | ||||
if ("1".equals(getIntent().getStringExtra("type"))) { | |||||
if ("2".equals(getIntent().getStringExtra("type"))) { | |||||
if (isSky(binding.text5.getText() + "", "总质量", binding.text5) || | if (isSky(binding.text5.getText() + "", "总质量", binding.text5) || | ||||
isSky(binding.text6.getText() + "", "装备质量", binding.text6) || | isSky(binding.text6.getText() + "", "装备质量", binding.text6) || | ||||
isSky(binding.text11.getText() + "", "核定载质量", binding.text11) || | isSky(binding.text11.getText() + "", "核定载质量", binding.text11) || |
btnCancelOrder.setVisibility(View.VISIBLE); | btnCancelOrder.setVisibility(View.VISIBLE); | ||||
btnConfirmInfo.setVisibility(View.VISIBLE); | btnConfirmInfo.setVisibility(View.VISIBLE); | ||||
break; | break; | ||||
// case Constants.ORDER_STATUS_WAIT_PAY://完成签约。待支付 | |||||
case Constants.ORDER_STATUS_WAIT_PAY://完成签约。待支付 | |||||
case Constants.ORDER_STATUS_ALREADYJGQY_CODE://完成加购。待支付 | |||||
// LLBtns.setVisibility(View.VISIBLE); | // LLBtns.setVisibility(View.VISIBLE); | ||||
// btnPay.setVisibility(View.VISIBLE); | // btnPay.setVisibility(View.VISIBLE); | ||||
// btnCancelOrder.setVisibility(View.VISIBLE); | // btnCancelOrder.setVisibility(View.VISIBLE); | ||||
productBean.setFee(orderData.product.fee); | productBean.setFee(orderData.product.fee); | ||||
productBean.setIsSign(orderData.getIsSign()); | productBean.setIsSign(orderData.getIsSign()); | ||||
} | } | ||||
Bundle bundle = new Bundle(); | |||||
bundle.putString("bizContent", JSON.toJSONString(productBean)); | |||||
bundle.putString("orderId", orderData.getOrderId()); | |||||
bundle.putString("id", orderData.getId() + ""); | |||||
bundle.putString("isPay","1"); | |||||
Intent intent = new Intent(); | Intent intent = new Intent(); | ||||
intent.putExtra("bizContent", JSON.toJSONString(productBean)); | |||||
intent.putExtra("orderId", orderData.getOrderId()); | |||||
intent.putExtra("id", orderData.getId() + ""); | |||||
if(Integer.parseInt(orderData.getOrderStep())==Constants.ORDER_STATUS_WAIT_PAY){ | |||||
//签约完未生成支付二维码,可以更改加购权益 | |||||
intent.putExtra("isPay","0"); | |||||
}else {//已生成支付二维码不能更改 | |||||
intent.putExtra("isPay","1"); | |||||
} | |||||
if (null==orderData.getProductId()||"".equals(orderData.getProductId())){//未绑定成功订单,重新跳转绑定 | if (null==orderData.getProductId()||"".equals(orderData.getProductId())){//未绑定成功订单,重新跳转绑定 | ||||
intent.setClass(context,ETCHandleActivity.class); | intent.setClass(context,ETCHandleActivity.class); | ||||
}else { | }else { | ||||
intent.setClass(context, ETCHandleSonActivity.class); | intent.setClass(context, ETCHandleSonActivity.class); | ||||
} | } | ||||
intent.putExtras(bundle); | |||||
context.startActivity(intent); | context.startActivity(intent); | ||||
} | } | ||||
}); | }); |
} | } | ||||
holder.setText(R.id.tvCardId, FunHelper.isEmpty(bizContent.getCardId()) ? "" : bizContent.getCardId()); | holder.setText(R.id.tvCardId, FunHelper.isEmpty(bizContent.getCardId()) ? "" : bizContent.getCardId()); | ||||
holder.setText(R.id.tvCardType, FunHelper.isEmpty(bizContent.cardType) ? "" : (bizContent.cardType.startsWith("1") ? "记账卡" : "储值卡")); | |||||
holder.setText(R.id.tvCardType, FunHelper.isEmpty(bizContent.cardType[0]) ? "" : ("1".equals(bizContent.cardType[0]) ? "记账卡" : "储值卡")); | |||||
holder.setText(R.id.tvCardStatus, FunHelper.isEmpty(bizContent.getCardStatus()) ? "" : EnumBean.backValue(bizContent.getCardStatus(), EnumBean.ETC_STATUS)); | holder.setText(R.id.tvCardStatus, FunHelper.isEmpty(bizContent.getCardStatus()) ? "" : EnumBean.backValue(bizContent.getCardStatus(), EnumBean.ETC_STATUS)); | ||||
beforeBean = bizContent; | beforeBean = bizContent; | ||||
private OnDelClickListener listener2; | private OnDelClickListener listener2; | ||||
private LeftSlideView mMenu = null; | private LeftSlideView mMenu = null; | ||||
private Activity context; | private Activity context; | ||||
private boolean canChanged = true; | |||||
public void setCanChanged(boolean changed) { | |||||
this.canChanged = changed; | |||||
} | |||||
public boolean getCanChanged() { | |||||
return canChanged; | |||||
} | |||||
public interface OnCBCheckedChangedListener { | public interface OnCBCheckedChangedListener { | ||||
void onCheckChanged(ResultBean.BizContent bean, boolean b); | void onCheckChanged(ResultBean.BizContent bean, boolean b); | ||||
public interface OnDelClickListener { | public interface OnDelClickListener { | ||||
void onDelClick(View view, int position); | void onDelClick(View view, int position); | ||||
void onContentClick(View view, int position); | void onContentClick(View view, int position); | ||||
} | } | ||||
protected void convert(@NonNull BaseViewHolder helper, ResultBean.BizContent item) { | protected void convert(@NonNull BaseViewHolder helper, ResultBean.BizContent item) { | ||||
helper.setText(R.id.equity_title, item.getProductName());//权益 | helper.setText(R.id.equity_title, item.getProductName());//权益 | ||||
helper.setText(R.id.tv_money_num, item.discountPrice * 0.01 + "");//金额 | helper.setText(R.id.tv_money_num, item.discountPrice * 0.01 + "");//金额 | ||||
helper.setText(R.id.tv_productIntro,item.productIntro); | |||||
helper.setText(R.id.tv_productIntro, item.productIntro); | |||||
RecyclerView recyclerView = helper.getView(R.id.recycler); | RecyclerView recyclerView = helper.getView(R.id.recycler); | ||||
ImageView img = helper.getView(R.id.img1); | ImageView img = helper.getView(R.id.img1); | ||||
if (null != item.getChildren()) { | if (null != item.getChildren()) { | ||||
} | } | ||||
} | } | ||||
}); | }); | ||||
}else { | |||||
} else { | |||||
img.setVisibility(View.INVISIBLE); | img.setVisibility(View.INVISIBLE); | ||||
} | } | ||||
RCheckBox rcb = helper.getView(R.id.cb_equity); | RCheckBox rcb = helper.getView(R.id.cb_equity); | ||||
//点击事件处理 | //点击事件处理 | ||||
if (null != tvDelete && null != leftSlideView && null != lyContent) { | if (null != tvDelete && null != leftSlideView && null != lyContent) { | ||||
// leftSlideView.setOnTouchListener(new View.OnTouchListener() { | |||||
// @Override | |||||
// public boolean onTouch(View view, MotionEvent motionEvent) { | |||||
// return true; | |||||
// } | |||||
// }); | |||||
if (!canChanged) { | |||||
leftSlideView.setOnTouchListener(new View.OnTouchListener() { | |||||
@Override | |||||
public boolean onTouch(View view, MotionEvent motionEvent) { | |||||
return true; | |||||
} | |||||
}); | |||||
}else { | |||||
leftSlideView.setOnTouchListener(new View.OnTouchListener() { | |||||
@Override | |||||
public boolean onTouch(View view, MotionEvent motionEvent) { | |||||
return false; | |||||
} | |||||
}); | |||||
} | |||||
RelativeLayout relativeLayout = (RelativeLayout) leftSlideView.findViewById(R.id.rly_relative); | RelativeLayout relativeLayout = (RelativeLayout) leftSlideView.findViewById(R.id.rly_relative); | ||||
RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams) relativeLayout.getLayoutParams(); | RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams) relativeLayout.getLayoutParams(); | ||||
params.width = (int) (getScreenWidth() - dpToPx(30f, context)); | |||||
params.width = (int) (getScreenWidth() - dpToPx(28f, context)); | |||||
params.height = ViewGroup.LayoutParams.WRAP_CONTENT; | params.height = ViewGroup.LayoutParams.WRAP_CONTENT; | ||||
relativeLayout.setLayoutParams(params); | relativeLayout.setLayoutParams(params); | ||||
tvDelete.setOnClickListener(new View.OnClickListener() { | tvDelete.setOnClickListener(new View.OnClickListener() { | ||||
} | } | ||||
@Override | @Override | ||||
public void onDownOrMove(LeftSlideView leftSlideView,RecyclerView recyclerView1) { | |||||
public void onDownOrMove(LeftSlideView leftSlideView, RecyclerView recyclerView1) { | |||||
if (menuIsOpen()) { | if (menuIsOpen()) { | ||||
if (mMenu != leftSlideView) { | if (mMenu != leftSlideView) { | ||||
closeMenu(); | closeMenu(); | ||||
} | } | ||||
}); | }); | ||||
} | } | ||||
if (item.isSelected){ | |||||
if (item.isSelected) { | |||||
rcb.setChecked(true); | rcb.setChecked(true); | ||||
} | } | ||||
rcb.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { | rcb.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { |
helper.setText(R.id.text4, "PERSONAL_USER".equals(item.getUserType()) ? "个人用户" : "单位用户"); | helper.setText(R.id.text4, "PERSONAL_USER".equals(item.getUserType()) ? "个人用户" : "单位用户"); | ||||
helper.setText(R.id.text6, "0".equals(item.getType()) ? "客车办理" : "货车办理"); | helper.setText(R.id.text6, "0".equals(item.getType()) ? "客车办理" : "货车办理"); | ||||
helper.setText(R.id.text7, "0".equals(item.getType()) ? "客车" : "货车"); | helper.setText(R.id.text7, "0".equals(item.getType()) ? "客车" : "货车"); | ||||
helper.setText(R.id.text8, item.getAmount() == null ? "0.00元" : Integer.parseInt(item.getAmount()) * 0.01 + "元"); | |||||
helper.setText(R.id.text8, item.getAmount() == null ? "0.00元" : FunHelper.changeF2Y(Long.valueOf(item.getAmount())) + "元"); | |||||
helper.setGone(R.id.tvLine,helper.getLayoutPosition() == getData().size() - 1 ? true : false); | helper.setGone(R.id.tvLine,helper.getLayoutPosition() == getData().size() - 1 ? true : false); | ||||
new OrderUtils(getActivity(), item, true, helper.getView(R.id.LLBtns), | new OrderUtils(getActivity(), item, true, helper.getView(R.id.LLBtns), |
public static final int ORDER_STATUS_RETURN_GOODS_SUCCESS = 17; //退货成功 | public static final int ORDER_STATUS_RETURN_GOODS_SUCCESS = 17; //退货成功 | ||||
public static final int ORDER_STATUS_EX_RECOVER = 18; //换货-设备已回收 | public static final int ORDER_STATUS_EX_RECOVER = 18; //换货-设备已回收 | ||||
public static final int ORDER_STATUS_ALREADY_CODE = 26; //已经生成二维码但未支付 | public static final int ORDER_STATUS_ALREADY_CODE = 26; //已经生成二维码但未支付 | ||||
public static final int ORDER_STATUS_ALREADYJGQY_CODE = 27; //加购完权益但未支付 | |||||
//******************************欠费补缴类型********************************// | //******************************欠费补缴类型********************************// |
import android.annotation.SuppressLint; | import android.annotation.SuppressLint; | ||||
import android.bluetooth.BluetoothAdapter; | import android.bluetooth.BluetoothAdapter; | ||||
import android.content.Intent; | import android.content.Intent; | ||||
import android.graphics.ColorMatrix; | |||||
import android.graphics.ColorMatrixColorFilter; | |||||
import android.graphics.Paint; | |||||
import android.os.Bundle; | import android.os.Bundle; | ||||
import android.text.TextUtils; | import android.text.TextUtils; | ||||
import android.util.Log; | import android.util.Log; | ||||
protected void onCreate(Bundle savedInstanceState) { | protected void onCreate(Bundle savedInstanceState) { | ||||
super.onCreate(savedInstanceState); | super.onCreate(savedInstanceState); | ||||
Log.e("currentActivity",this.getClass().getName()); | Log.e("currentActivity",this.getClass().getName()); | ||||
// Paint paint = new Paint(); | |||||
// ColorMatrix cm =new ColorMatrix(); | |||||
// cm.setSaturation(0f);//灰度效果 | |||||
// paint.setColorFilter(new ColorMatrixColorFilter(cm)); | |||||
// getWindow().getDecorView().setLayerType(View.LAYER_TYPE_HARDWARE,paint); | |||||
} | } | ||||
/** | /** |