@@ -358,6 +358,14 @@ | |||
<activity android:name=".project.ui.activity.order.ApplyExGoodsStep2Activity" | |||
android:launchMode="singleTop" | |||
android:screenOrientation="portrait"/> | |||
<!--取消订单第一步--> | |||
<activity android:name=".project.ui.activity.order.CancelOrderStep1Activity" | |||
android:launchMode="singleTop" | |||
android:screenOrientation="portrait"/> | |||
<!--取消订单第二步--> | |||
<activity android:name=".project.ui.activity.order.CancelOrderStep2Activity" | |||
android:launchMode="singleTop" | |||
android:screenOrientation="portrait"/> | |||
</application> | |||
</manifest> |
@@ -30,6 +30,7 @@ import com.huntersun.vkyes.etcopencard.project.copapply.ObuActivation; | |||
import com.huntersun.vkyes.etcopencard.project.tool.Utils; | |||
import com.huntersun.vkyes.etcopencard.project.ui.activity.mail.FormDeliveryActivity; | |||
import com.huntersun.vkyes.etcopencard.project.ui.activity.order.ApplyExGoodsStep1Activity; | |||
import com.huntersun.vkyes.etcopencard.project.ui.activity.order.CancelOrderStep1Activity; | |||
import com.huntersun.vkyes.etcopencard.project.utils.FunHelper; | |||
import com.huntersun.vkyes.etcopencard.src.action.StatusAction; | |||
import com.huntersun.vkyes.etcopencard.src.aop.SingleClick; | |||
@@ -150,15 +151,6 @@ public class HomeListInfo extends AppActivity implements StatusAction { | |||
@Override | |||
@SingleClick | |||
public void onClick(View v) { | |||
//TODO 做测试 需要删除 | |||
Bundle bundle = new Bundle(); | |||
bundle.putString("id",bizContent1.getId()); | |||
bundle.putString("orderId",bizContent1.getOrderId()); | |||
bundle.putString("vehiclePlate",bizContent1.getVehiclePlate()); | |||
bundle.putString("amount",bizContent1.getAmount()); | |||
bundle.putString("orderStep",bizContent1.getOrderStep()); | |||
jumpToPage(ApplyExGoodsStep1Activity.class,bundle); | |||
/*new Utils().showMessDialog(getActivity(), "是否确认取消订单?", dialog -> { | |||
FatherBean<SendTheVerificationCodeBean> fatherBean2 = new FatherBean<>(); | |||
fatherBean2.bizContent = new SendTheVerificationCodeBean(); | |||
@@ -177,6 +169,20 @@ public class HomeListInfo extends AppActivity implements StatusAction { | |||
} | |||
}); | |||
});*/ | |||
//TODO 订单功能入口测试 | |||
Bundle bundle = new Bundle(); | |||
bundle.putString("id",FunHelper.isEmpty(bizContent1.getId()) ? "" : bizContent1.getId()); | |||
bundle.putString("orderId",FunHelper.isEmpty(bizContent1.getOrderId()) ? "" : bizContent1.getOrderId()); | |||
bundle.putString("vehiclePlate",FunHelper.isEmpty(bizContent1.getVehiclePlate()) ? "" : bizContent1.getVehiclePlate()); | |||
bundle.putString("amount",FunHelper.isEmpty(bizContent1.getAmount()) ? "0" : bizContent1.getAmount()); | |||
bundle.putString("orderStep",FunHelper.isEmpty(bizContent1.getOrderStep()) ? "" : bizContent1.getOrderStep()); | |||
//换货 | |||
//jumpToPage(ApplyExGoodsStep1Activity.class,bundle); | |||
//取消订单 | |||
jumpToPage(CancelOrderStep1Activity.class,bundle); | |||
} | |||
}); | |||
//下一步按钮 |
@@ -3,20 +3,16 @@ package com.huntersun.vkyes.etcopencard.project.ui.activity.order; | |||
import android.os.Bundle; | |||
import android.view.View; | |||
import com.blankj.utilcode.util.LogUtils; | |||
import com.huntersun.vkyes.etcopencard.databinding.ActivityApplyExGoodsStep1Binding; | |||
import com.huntersun.vkyes.etcopencard.project.api.MyRetrofit; | |||
import com.huntersun.vkyes.etcopencard.project.api.bean.DotBean; | |||
import com.huntersun.vkyes.etcopencard.project.api.bean.IFCode; | |||
import com.huntersun.vkyes.etcopencard.project.api.bean.ResultBean; | |||
import com.huntersun.vkyes.etcopencard.project.dialog.DotListDialog; | |||
import com.huntersun.vkyes.etcopencard.project.dialog.MenuMailDialog; | |||
import com.huntersun.vkyes.etcopencard.project.tool.MyShared; | |||
import com.huntersun.vkyes.etcopencard.project.tool.Utils; | |||
import com.huntersun.vkyes.etcopencard.project.utils.FunHelper; | |||
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 com.jeremyliao.liveeventbus.LiveEventBus; | |||
import java.util.HashMap; | |||
@@ -142,6 +138,9 @@ public class ApplyExGoodsStep1Activity extends AppActivity { | |||
@Override | |||
public void onSuccess(ResultBean resultBean, ResultBean.BizContent bizContent) { | |||
hideDialog(); | |||
LiveEventBus.get("homeOneUpdateData").post(""); | |||
Bundle bundle = new Bundle(); | |||
bundle.putString("id",id); | |||
jumpToPage(ApplyExGoodsStep2Activity.class,bundle); |
@@ -1,6 +1,5 @@ | |||
package com.huntersun.vkyes.etcopencard.project.ui.activity.order; | |||
import android.content.Intent; | |||
import android.os.Bundle; | |||
import android.view.View; | |||
@@ -1,16 +1,132 @@ | |||
package com.huntersun.vkyes.etcopencard.project.ui.activity.order; | |||
import android.os.Bundle; | |||
import android.view.View; | |||
import com.google.gson.Gson; | |||
import com.huntersun.vkyes.etcopencard.databinding.ActivityCancelOrderStep1Binding; | |||
import com.huntersun.vkyes.etcopencard.project.api.Api; | |||
import com.huntersun.vkyes.etcopencard.project.api.Converter; | |||
import com.huntersun.vkyes.etcopencard.project.api.FatherBean; | |||
import com.huntersun.vkyes.etcopencard.project.api.MyRetrofit; | |||
import com.huntersun.vkyes.etcopencard.project.api.RequestParameters; | |||
import com.huntersun.vkyes.etcopencard.project.api.Result; | |||
import com.huntersun.vkyes.etcopencard.project.api.bean.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.tool.MyShared; | |||
import com.huntersun.vkyes.etcopencard.project.tool.Utils; | |||
import com.huntersun.vkyes.etcopencard.project.utils.FunHelper; | |||
import com.huntersun.vkyes.etcopencard.src.app.AppActivity; | |||
import com.jeremyliao.liveeventbus.LiveEventBus; | |||
import retrofit2.Response; | |||
/** | |||
* Date :2023-03-14 | |||
* Description:取消订单第一步 | |||
*/ | |||
public class CancelOrderStep1Activity extends AppActivity { | |||
private ActivityCancelOrderStep1Binding binding; | |||
private String id; //订单id | |||
private String orderId;//订单编号 | |||
private String vehiclePlate; //订单车牌 | |||
private String amount; //订单金额 | |||
private String orderStep; //订单状态 | |||
@Override | |||
protected View getLayoutView() { | |||
binding = ActivityCancelOrderStep1Binding.inflate(getLayoutInflater()); | |||
return binding.getRoot(); | |||
} | |||
@Override | |||
protected void initView() { | |||
getParams(); | |||
setDataToView(); | |||
binding.btnApply.setOnClickListener(new View.OnClickListener() { | |||
@Override | |||
public void onClick(View view) { | |||
checkParams(); | |||
} | |||
}); | |||
} | |||
/* | |||
* 获取参数 | |||
*/ | |||
private void getParams() { | |||
id = getIntent().getStringExtra("id"); | |||
orderId = getIntent().getStringExtra("orderId"); | |||
vehiclePlate = getIntent().getStringExtra("vehiclePlate"); | |||
amount = getIntent().getStringExtra("amount"); | |||
orderStep = getIntent().getStringExtra("orderStep"); | |||
} | |||
/* | |||
* 设置界面数据 | |||
*/ | |||
private void setDataToView() { | |||
binding.tvOrderId.setText(orderId); | |||
binding.tvVehiclePlate.setText(vehiclePlate); | |||
binding.tvAmount.setText("¥ " + (Integer.parseInt(amount) * 0.01)); | |||
binding.tvOrderStep.setText(FunHelper.getOrderStatusName(Integer.parseInt(orderStep))); | |||
} | |||
/* | |||
* 提交参数校验 | |||
*/ | |||
private void checkParams() { | |||
if (FunHelper.isEmpty(FunHelper.getText(binding.etReason))) { | |||
toast("请输入取消原因"); | |||
return; | |||
} | |||
if (FunHelper.isEmpty(id)) { | |||
toast("订单id为空,请返回重试"); | |||
return; | |||
} | |||
new Utils().showMessDialog(getActivity(), "是否确认取消订单?", dialog -> { | |||
doCancelOrder(); | |||
}); | |||
} | |||
/* | |||
* 执行取消订单 | |||
*/ | |||
private void doCancelOrder() { | |||
showDialog("取消订单中..."); | |||
FatherBean<SendTheVerificationCodeBean> fatherBean2 = new FatherBean<>(); | |||
fatherBean2.bizContent = new SendTheVerificationCodeBean(); | |||
fatherBean2.bizContent.setId(id); | |||
fatherBean2.bizContent.setOrderId(orderId); | |||
fatherBean2.bizContent.setSource("SERVICE_HALL"); //线上营业厅 | |||
fatherBean2.bizContent.setOpId((String) MyShared.getInstance().get(MyShared.OPENID,"")); | |||
fatherBean2.bizContent.setReason(FunHelper.getText(binding.etReason)); | |||
RequestParameters parameters1 = new RequestParameters(IFCode.IFCODE7, new Gson().toJson(fatherBean2.bizContent)); | |||
new MyRetrofit().getRetrofit().create(Api.class).message2(parameters1) | |||
.enqueue(new Converter<Result>() { | |||
@Override | |||
protected void onSuccess(ResultBean resultBean1, ResultBean.BizContent bizContent) { | |||
hideDialog(); | |||
LiveEventBus.get("homeOneUpdateData").post(""); | |||
Bundle bundle = new Bundle(); | |||
bundle.putString("id", id); | |||
jumpToPage(CancelOrderStep2Activity.class, bundle); | |||
finish(); | |||
} | |||
@Override | |||
public void onError(String err, Response<Result> resp) { | |||
super.onError(err, resp); | |||
hideDialog(); | |||
} | |||
}); | |||
} | |||
@Override |
@@ -1,5 +1,10 @@ | |||
package com.huntersun.vkyes.etcopencard.project.ui.activity.order; | |||
import android.os.Bundle; | |||
import android.view.View; | |||
import com.huntersun.vkyes.etcopencard.databinding.ActivityCancelOrderStep2Binding; | |||
import com.huntersun.vkyes.etcopencard.project.ui.activity.HomeListInfo; | |||
import com.huntersun.vkyes.etcopencard.src.app.AppActivity; | |||
/** | |||
@@ -7,10 +12,29 @@ import com.huntersun.vkyes.etcopencard.src.app.AppActivity; | |||
* Description:取消订单第2步 | |||
*/ | |||
public class CancelOrderStep2Activity extends AppActivity { | |||
private ActivityCancelOrderStep2Binding binding; | |||
//订单id | |||
private String id; | |||
@Override | |||
protected void initView() { | |||
protected View getLayoutView() { | |||
binding = ActivityCancelOrderStep2Binding.inflate(getLayoutInflater()); | |||
return binding.getRoot(); | |||
} | |||
@Override | |||
protected void initView() { | |||
id = getIntent().getStringExtra("id"); | |||
binding.btnCheckOrder.setOnClickListener(new View.OnClickListener() { | |||
@Override | |||
public void onClick(View view) { | |||
Bundle bundle = new Bundle(); | |||
bundle.putString("id", id); | |||
jumpToPage(HomeListInfo.class,bundle); | |||
finish(); | |||
} | |||
}); | |||
} | |||
@Override |
@@ -0,0 +1,43 @@ | |||
<?xml version="1.0" encoding="utf-8"?> | |||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | |||
xmlns:app="http://schemas.android.com/apk/res-auto" | |||
android:layout_width="match_parent" | |||
android:orientation="vertical" | |||
android:gravity="center_horizontal" | |||
android:background="@color/background_color" | |||
android:layout_height="match_parent"> | |||
<com.hjq.bar.TitleBar | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:background="@color/transparent" | |||
app:leftIcon="@mipmap/back_black" | |||
android:id="@+id/title" | |||
app:lineVisible="false" | |||
app:title="取消订单" | |||
app:titleColor="@color/black" /> | |||
<ImageView | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:layout_marginTop="@dimen/dp_48" | |||
android:layout_marginLeft="-15dp" | |||
android:scaleType="centerCrop" | |||
android:src="@mipmap/accomplish"/> | |||
<TextView | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
style="@style/blackTextStyleBold17" | |||
android:layout_marginTop="@dimen/dp_21" | |||
android:text="取消成功"/> | |||
<Button | |||
android:id="@+id/btnCheckOrder" | |||
style="@style/BtnShortStyle" | |||
android:layout_width="@dimen/dp_150" | |||
android:layout_height="@dimen/dp_40" | |||
android:layout_gravity="center" | |||
android:layout_marginTop="@dimen/dp_70" | |||
android:text="查看订单" | |||
android:textSize="@dimen/sp_14" | |||
android:layout_marginBottom="@dimen/dp_37" | |||
android:layout_alignParentBottom="true" | |||
android:layout_centerHorizontal="true"/> | |||
</LinearLayout> |
@@ -0,0 +1,197 @@ | |||
<?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" | |||
android:layout_width="match_parent" | |||
android:background="@color/background_color" | |||
android:layout_height="match_parent"> | |||
<com.hjq.bar.TitleBar | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:background="@color/transparent" | |||
app:leftIcon="@mipmap/back_black" | |||
android:id="@+id/title" | |||
app:lineVisible="false" | |||
app:title="取消订单" | |||
app:titleColor="@color/black" /> | |||
<com.huntersun.vkyes.etcopencard.src.widget.StatusLayout | |||
android:id="@+id/hl_status_hint" | |||
android:layout_width="match_parent" | |||
android:layout_below="@+id/title" | |||
android:layout_height="match_parent"> | |||
<LinearLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent" | |||
android:padding="@dimen/dp_15" | |||
android:orientation="vertical"> | |||
<TextView | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:text="订单详情" | |||
style="@style/blackTextStyleBold16"/> | |||
<com.ruffian.library.widget.RLinearLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
app:corner_radius="@dimen/dp_10" | |||
app:background_normal="@color/white" | |||
android:paddingLeft="@dimen/dp_15" | |||
android:paddingTop="@dimen/dp_15" | |||
android:paddingBottom="@dimen/dp_15" | |||
android:paddingRight="@dimen/dp_20" | |||
android:orientation="vertical" | |||
android:layout_marginTop="@dimen/dp_12"> | |||
<LinearLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:orientation="horizontal"> | |||
<TextView | |||
style="@style/black02TextStyle14" | |||
android:layout_width="wrap_content" | |||
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" | |||
/> | |||
</LinearLayout> | |||
<LinearLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:layout_marginTop="@dimen/dp_15" | |||
android:orientation="horizontal"> | |||
<TextView | |||
style="@style/black02TextStyle14" | |||
android:layout_width="wrap_content" | |||
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" | |||
/> | |||
</LinearLayout> | |||
<LinearLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:layout_marginTop="@dimen/dp_15" | |||
android:orientation="horizontal"> | |||
<TextView | |||
style="@style/black02TextStyle14" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:layout_weight="1" | |||
android:text="订单金额" /> | |||
<TextView | |||
android:id="@+id/tvAmount" | |||
style="@style/greenTextStyle14" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:text="" /> | |||
</LinearLayout> | |||
<LinearLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:layout_marginTop="@dimen/dp_15" | |||
android:orientation="horizontal"> | |||
<TextView | |||
style="@style/black02TextStyle14" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:layout_weight="1" | |||
android:text="订单状态" /> | |||
<TextView | |||
android:id="@+id/tvOrderStep" | |||
style="@style/redTextStyle14" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:text="" /> | |||
</LinearLayout> | |||
</com.ruffian.library.widget.RLinearLayout> | |||
<TextView | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:layout_marginTop="@dimen/dp_15" | |||
android:text="取消填写" | |||
style="@style/blackTextStyleBold16"/> | |||
<com.ruffian.library.widget.RLinearLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
app:corner_radius="@dimen/dp_10" | |||
app:background_normal="@color/white" | |||
android:paddingLeft="@dimen/dp_15" | |||
android:paddingBottom="@dimen/dp_15" | |||
android:paddingRight="@dimen/dp_20" | |||
android:orientation="vertical" | |||
android:layout_marginTop="@dimen/dp_12"> | |||
<RelativeLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:layout_marginTop="@dimen/dp_15" | |||
android:orientation="horizontal"> | |||
<TextView | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:id="@+id/red_star" | |||
style="@style/redStar"/> | |||
<TextView | |||
style="@style/black02TextStyle14" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:id="@+id/tv_hhyy_title" | |||
android:layout_toRightOf="@+id/red_star" | |||
android:layout_weight="1" | |||
android:text="取消原因" /> | |||
<EditText | |||
android:id="@+id/etReason" | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:background="@color/white" | |||
android:layout_below="@+id/tv_hhyy_title" | |||
android:paddingTop="@dimen/dp_15" | |||
android:paddingLeft="@dimen/dp_7" | |||
android:gravity="left" | |||
android:maxLength="50" | |||
android:hint="请输入取消原因,限制50字以内" | |||
android:textColorHint="@color/text98" | |||
android:minHeight="@dimen/dp_100" | |||
style="@style/black02TextStyle14"/> | |||
</RelativeLayout> | |||
</com.ruffian.library.widget.RLinearLayout> | |||
<TextView | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:text="请核对实收物与上述货物编号是否一致" | |||
android:drawableLeft="@mipmap/tips" | |||
android:layout_marginTop="@dimen/dp_12" | |||
android:drawablePadding="@dimen/dp_10" | |||
android:visibility="gone" | |||
style="@style/orangeTextStyle10"/> | |||
</LinearLayout> | |||
</com.huntersun.vkyes.etcopencard.src.widget.StatusLayout> | |||
<Button | |||
android:id="@+id/btnApply" | |||
style="@style/BtnShortStyle" | |||
android:layout_width="@dimen/dp_150" | |||
android:layout_height="@dimen/dp_40" | |||
android:layout_gravity="center" | |||
android:layout_marginTop="@dimen/dp_200" | |||
android:text="确认取消" | |||
android:textSize="@dimen/sp_14" | |||
android:layout_marginBottom="@dimen/dp_37" | |||
android:layout_alignParentBottom="true" | |||
android:layout_centerHorizontal="true"/> | |||
</RelativeLayout> |