|
|
@@ -10,6 +10,7 @@ import androidx.lifecycle.ViewModelProvider;
|
|
10
|
10
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
|
11
|
11
|
|
|
12
|
12
|
import com.alibaba.fastjson.JSON;
|
|
|
13
|
+import com.blankj.utilcode.util.GsonUtils;
|
|
13
|
14
|
import com.blankj.utilcode.util.ToastUtils;
|
|
14
|
15
|
import com.yihucha.hbyhc.R;
|
|
15
|
16
|
import com.yihucha.hbyhc.base.ViewBindingTitleBaseActivity;
|
|
|
@@ -22,6 +23,7 @@ import com.yihucha.hbyhc.presentation.order.view_model.OrderViewModel;
|
|
22
|
23
|
import com.yihucha.hbyhc.presentation.pay.PayActivity;
|
|
23
|
24
|
import com.yihucha.hbyhc.presentation.product.ProductDetailsActivity;
|
|
24
|
25
|
import com.yihucha.hbyhc.utils.CopyUtils;
|
|
|
26
|
+import com.yihucha.hbyhc.utils.EmptyCheckUtils;
|
|
25
|
27
|
import com.yihucha.hbyhc.utils.GlideUtils;
|
|
26
|
28
|
import com.yihucha.hbyhc.utils.StringsUtil;
|
|
27
|
29
|
|
|
|
@@ -41,25 +43,48 @@ public class OrderDetailsActivity extends ViewBindingTitleBaseActivity<ActivityO
|
|
41
|
43
|
public static final String INTENT_ORDER_BEAN = "intentOrderBean";
|
|
42
|
44
|
public static final String INTENT_ORDER_OBLIGATION_BEAN = "intentOrderObligationBean";
|
|
43
|
45
|
public static final String INTENT_ORDER_STATUS = "intentOrderStatus";
|
|
|
46
|
+
|
|
|
47
|
+ public static final String ORDER_ID = "order_id";
|
|
|
48
|
+
|
|
|
49
|
+ private String orderId = null;
|
|
44
|
50
|
private OrderListBean.ListBean orderBean;
|
|
45
|
51
|
private OrderListObligationBean.ObligationBeanList obligationBeanList;
|
|
46
|
52
|
private String status;
|
|
47
|
53
|
private OrderViewModel mOrderViewModel;
|
|
|
54
|
+
|
|
|
55
|
+
|
|
48
|
56
|
@Override
|
|
49
|
57
|
protected void onCreate(Bundle savedInstanceState) {
|
|
50
|
58
|
super.onCreate(savedInstanceState);
|
|
51
|
59
|
orderBean = (OrderListBean.ListBean) getIntent().getSerializableExtra(INTENT_ORDER_BEAN);
|
|
52
|
60
|
obligationBeanList = (OrderListObligationBean.ObligationBeanList) getIntent().getSerializableExtra(INTENT_ORDER_OBLIGATION_BEAN);
|
|
53
|
61
|
status = getIntent().getStringExtra(INTENT_ORDER_STATUS);
|
|
|
62
|
+ orderId = getIntent().getStringExtra(ORDER_ID);
|
|
54
|
63
|
|
|
55
|
64
|
mOrderViewModel =
|
|
56
|
65
|
new ViewModelProvider(this).get(OrderViewModel.class);
|
|
57
|
|
- initView();
|
|
|
66
|
+ if (EmptyCheckUtils.isNotEmpty(orderId)) {
|
|
|
67
|
+ mOrderViewModel.getOrderDetail(orderId);
|
|
|
68
|
+ } else {
|
|
|
69
|
+ initView();
|
|
|
70
|
+ }
|
|
|
71
|
+
|
|
58
|
72
|
initClick();
|
|
59
|
73
|
initData();
|
|
60
|
74
|
}
|
|
61
|
75
|
|
|
62
|
76
|
private void initData() {
|
|
|
77
|
+ mOrderViewModel.orderDetail.observe(this, bean -> {
|
|
|
78
|
+ orderBean = bean;
|
|
|
79
|
+ obligationBeanList = GsonUtils.fromJson(GsonUtils.toJson(bean), OrderListObligationBean.ObligationBeanList.class);
|
|
|
80
|
+ status = "5".equals(bean.getStatus())?"99":bean.getStatus();
|
|
|
81
|
+ if ("5".equals(bean.getStatus())){
|
|
|
82
|
+ OrderDetailsDaifukuanActivity.launch(context, obligationBeanList, status);
|
|
|
83
|
+ finish();
|
|
|
84
|
+ return;
|
|
|
85
|
+ }
|
|
|
86
|
+ initView();
|
|
|
87
|
+ });
|
|
63
|
88
|
//取消订单成功
|
|
64
|
89
|
mOrderViewModel.cancelOrderSucceed.observe(this, new Observer<String>() {
|
|
65
|
90
|
@Override
|
|
|
@@ -127,46 +152,32 @@ public class OrderDetailsActivity extends ViewBindingTitleBaseActivity<ActivityO
|
|
127
|
152
|
|
|
128
|
153
|
GlideUtils.loadImage(context, obligationBeanList.getMerchant().getMer_avatar(), mViewBinding.ivShopLogo);
|
|
129
|
154
|
mViewBinding.btvMerName.setText(obligationBeanList.getMerchant().getMer_name());
|
|
130
|
|
- if ("5".equals(obligationBeanList.getPay_type())){
|
|
131
|
|
- mViewBinding.tvTotalPrice.setText("积分"+obligationBeanList.getTotal_price());
|
|
132
|
|
- }else {
|
|
|
155
|
+ if ("5".equals(obligationBeanList.getPay_type())) {
|
|
|
156
|
+ mViewBinding.tvTotalPrice.setText("积分" + obligationBeanList.getTotal_price());
|
|
|
157
|
+ } else {
|
|
133
|
158
|
mViewBinding.tvTotalPrice.setText(obligationBeanList.getTotal_price());
|
|
134
|
159
|
}
|
|
135
|
|
- if ("5".equals(obligationBeanList.getPay_type())){
|
|
136
|
|
- mViewBinding.tvCouponPrice.setText("积分"+obligationBeanList.getCoupon_price());
|
|
137
|
|
- }else {
|
|
|
160
|
+ if ("5".equals(obligationBeanList.getPay_type())) {
|
|
|
161
|
+ mViewBinding.tvCouponPrice.setText("积分" + obligationBeanList.getCoupon_price());
|
|
|
162
|
+ } else {
|
|
138
|
163
|
mViewBinding.tvCouponPrice.setText(obligationBeanList.getCoupon_price());
|
|
139
|
164
|
}
|
|
140
|
|
- if ("5".equals(obligationBeanList.getPay_type())){
|
|
141
|
|
- mViewBinding.tvPayPostage.setText("积分"+obligationBeanList.getPay_postage());
|
|
142
|
|
- }else {
|
|
|
165
|
+ if ("5".equals(obligationBeanList.getPay_type())) {
|
|
|
166
|
+ mViewBinding.tvPayPostage.setText("积分" + obligationBeanList.getPay_postage());
|
|
|
167
|
+ } else {
|
|
143
|
168
|
mViewBinding.tvPayPostage.setText(obligationBeanList.getPay_postage());
|
|
144
|
169
|
}
|
|
145
|
|
- if ("5".equals(obligationBeanList.getPay_type())){
|
|
|
170
|
+ if ("5".equals(obligationBeanList.getPay_type())) {
|
|
146
|
171
|
mViewBinding.btvPayPrice.setText("积分" + obligationBeanList.getPay_price());
|
|
147
|
|
- }else {
|
|
|
172
|
+ } else {
|
|
148
|
173
|
mViewBinding.btvPayPrice.setText("¥" + obligationBeanList.getPay_price());
|
|
149
|
174
|
}
|
|
150
|
175
|
|
|
151
|
176
|
mViewBinding.tvGroupOrderSn.setText(obligationBeanList.getGroup_order_sn());
|
|
152
|
|
- //支付方式 0=余额 1=微信 2=小程序 3=h5 4=支付宝
|
|
153
|
|
- /* if ("0".equals(obligationBeanList.getPay_type())) {
|
|
154
|
|
- mViewBinding.tvPayType.setText("余额");
|
|
155
|
|
- } else if ("1".equals(obligationBeanList.getPay_type())) {
|
|
156
|
|
- mViewBinding.tvPayType.setText("微信");
|
|
157
|
|
- } else if ("2".equals(obligationBeanList.getPay_type())) {
|
|
158
|
|
- mViewBinding.tvPayType.setText("小程序");
|
|
159
|
|
- } else if ("3".equals(obligationBeanList.getPay_type())) {
|
|
160
|
|
- mViewBinding.tvPayType.setText("h5");
|
|
161
|
|
- } else if ("4".equals(obligationBeanList.getPay_type())) {
|
|
162
|
|
- mViewBinding.tvPayType.setText("支付宝");
|
|
163
|
|
- }else if ("5".equals(obligationBeanList.getPay_type())){
|
|
164
|
|
- mViewBinding.tvPayType.setText("积分兑换");
|
|
165
|
|
- }*/
|
|
166
|
177
|
if ("5".equals(obligationBeanList.getPay_type())) {
|
|
167
|
178
|
mViewBinding.tvPayType.setText("微信支付");
|
|
168
|
179
|
|
|
169
|
|
- }else{
|
|
|
180
|
+ } else {
|
|
170
|
181
|
mViewBinding.tvPayType.setText("微信支付");
|
|
171
|
182
|
}
|
|
172
|
183
|
mViewBinding.tvCreateTime.setText(obligationBeanList.getCreate_time());
|
|
|
@@ -190,7 +201,7 @@ public class OrderDetailsActivity extends ViewBindingTitleBaseActivity<ActivityO
|
|
190
|
201
|
|
|
191
|
202
|
GlideUtils.loadImage(context, orderBean.getMerchant().getMer_avatar(), mViewBinding.ivShopLogo);
|
|
192
|
203
|
mViewBinding.btvMerName.setText(orderBean.getMerchant().getMer_name());
|
|
193
|
|
- // 订单状态(0:待发货;1:待收货;2:待评价;3:已完成;4已申请退款;-1:已退款)5未支付
|
|
|
204
|
+ // 订单状态(0:待发货;1:待收货;2:待评价;3:已完成;4已申请退款;-1:已退款)5未支付
|
|
194
|
205
|
// System.out.println(orderBean.getStatus());
|
|
195
|
206
|
if ("0".equals(orderBean.getStatus())) {
|
|
196
|
207
|
mViewBinding.tvRemindTheDelivery.setVisibility(View.VISIBLE);
|
|
|
@@ -246,8 +257,7 @@ public class OrderDetailsActivity extends ViewBindingTitleBaseActivity<ActivityO
|
|
246
|
257
|
|
|
247
|
258
|
setTitle(R.string.completed);
|
|
248
|
259
|
mViewBinding.llBottom.setVisibility(View.VISIBLE);
|
|
249
|
|
- }
|
|
250
|
|
- else if ("4".equals(orderBean.getStatus())) {
|
|
|
260
|
+ } else if ("4".equals(orderBean.getStatus())) {
|
|
251
|
261
|
mViewBinding.tvCheckTheLogistics.setVisibility(View.GONE);
|
|
252
|
262
|
mViewBinding.tvApplyForAfterSales.setVisibility(View.GONE);
|
|
253
|
263
|
mViewBinding.tvConfirmReceipt.setVisibility(View.GONE);
|
|
|
@@ -258,8 +268,7 @@ public class OrderDetailsActivity extends ViewBindingTitleBaseActivity<ActivityO
|
|
258
|
268
|
mViewBinding.tvToEvaluate.setVisibility(View.GONE);
|
|
259
|
269
|
|
|
260
|
270
|
setTitle("已申请退款");
|
|
261
|
|
- }
|
|
262
|
|
- else if ("-1".equals(orderBean.getStatus())) {
|
|
|
271
|
+ } else if ("-1".equals(orderBean.getStatus())) {
|
|
263
|
272
|
mViewBinding.tvCheckTheLogistics.setVisibility(View.GONE);
|
|
264
|
273
|
mViewBinding.tvApplyForAfterSales.setVisibility(View.GONE);
|
|
265
|
274
|
mViewBinding.tvConfirmReceipt.setVisibility(View.GONE);
|
|
|
@@ -269,8 +278,7 @@ public class OrderDetailsActivity extends ViewBindingTitleBaseActivity<ActivityO
|
|
269
|
278
|
mViewBinding.tvBuyAgain.setVisibility(View.GONE);
|
|
270
|
279
|
mViewBinding.tvToEvaluate.setVisibility(View.GONE);
|
|
271
|
280
|
setTitle("已退款");
|
|
272
|
|
- }
|
|
273
|
|
- else if ("5".equals(orderBean.getStatus())) {
|
|
|
281
|
+ } else if ("5".equals(orderBean.getStatus())) {
|
|
274
|
282
|
mViewBinding.tvCancellationOfOrder.setVisibility(View.VISIBLE);
|
|
275
|
283
|
mViewBinding.tvImmediatePayment.setVisibility(View.VISIBLE);
|
|
276
|
284
|
|
|
|
@@ -282,8 +290,7 @@ public class OrderDetailsActivity extends ViewBindingTitleBaseActivity<ActivityO
|
|
282
|
290
|
mViewBinding.tvConfirmReceipt.setVisibility(View.GONE);
|
|
283
|
291
|
setTitle("待付款");
|
|
284
|
292
|
mViewBinding.llBottom.setVisibility(View.VISIBLE);
|
|
285
|
|
- }
|
|
286
|
|
- else {
|
|
|
293
|
+ } else {
|
|
287
|
294
|
mViewBinding.tvBuyAgain.setVisibility(View.VISIBLE);
|
|
288
|
295
|
mViewBinding.tvApplyForAfterSales.setVisibility(View.VISIBLE);
|
|
289
|
296
|
|
|
|
@@ -298,12 +305,12 @@ public class OrderDetailsActivity extends ViewBindingTitleBaseActivity<ActivityO
|
|
298
|
305
|
mViewBinding.llBottom.setVisibility(View.GONE);
|
|
299
|
306
|
}
|
|
300
|
307
|
|
|
301
|
|
- if ("5".equals(orderBean.getPay_type())){
|
|
302
|
|
- mViewBinding.tvTotalPrice.setText("积分"+orderBean.getTotal_price());
|
|
303
|
|
- mViewBinding.tvCouponPrice.setText("积分"+orderBean.getCoupon_price());
|
|
304
|
|
- mViewBinding.tvPayPostage.setText("积分"+orderBean.getPay_postage());
|
|
305
|
|
- mViewBinding.btvPayPrice.setText("积分"+ orderBean.getPay_price());
|
|
306
|
|
- }else {
|
|
|
308
|
+ if ("5".equals(orderBean.getPay_type())) {
|
|
|
309
|
+ mViewBinding.tvTotalPrice.setText("积分" + orderBean.getTotal_price());
|
|
|
310
|
+ mViewBinding.tvCouponPrice.setText("积分" + orderBean.getCoupon_price());
|
|
|
311
|
+ mViewBinding.tvPayPostage.setText("积分" + orderBean.getPay_postage());
|
|
|
312
|
+ mViewBinding.btvPayPrice.setText("积分" + orderBean.getPay_price());
|
|
|
313
|
+ } else {
|
|
307
|
314
|
mViewBinding.tvTotalPrice.setText(orderBean.getTotal_price());
|
|
308
|
315
|
mViewBinding.tvCouponPrice.setText(orderBean.getCoupon_price());
|
|
309
|
316
|
mViewBinding.tvPayPostage.setText(orderBean.getPay_postage());
|
|
|
@@ -314,7 +321,7 @@ public class OrderDetailsActivity extends ViewBindingTitleBaseActivity<ActivityO
|
|
314
|
321
|
if (StringUtil.isBlank(orderBean.getPay_time())) {
|
|
315
|
322
|
mViewBinding.layoutPaytime.setVisibility(View.GONE);
|
|
316
|
323
|
mViewBinding.tvPayType.setText("微信支付");
|
|
317
|
|
- }else {
|
|
|
324
|
+ } else {
|
|
318
|
325
|
mViewBinding.tvTimeOfPayment.setText(orderBean.getPay_time());
|
|
319
|
326
|
mViewBinding.layoutPaytime.setVisibility(View.VISIBLE);
|
|
320
|
327
|
//支付方式 0=余额 1=微信 2=小程序 3=h5 4=支付宝
|
|
|
@@ -328,7 +335,7 @@ public class OrderDetailsActivity extends ViewBindingTitleBaseActivity<ActivityO
|
|
328
|
335
|
mViewBinding.tvPayType.setText("h5");
|
|
329
|
336
|
} else if ("4".equals(orderBean.getPay_type())) {
|
|
330
|
337
|
mViewBinding.tvPayType.setText("支付宝");
|
|
331
|
|
- }else if ("5".equals(orderBean.getPay_type())){
|
|
|
338
|
+ } else if ("5".equals(orderBean.getPay_type())) {
|
|
332
|
339
|
mViewBinding.tvPayType.setText("积分兑换");
|
|
333
|
340
|
}
|
|
334
|
341
|
}
|
|
|
@@ -362,7 +369,7 @@ public class OrderDetailsActivity extends ViewBindingTitleBaseActivity<ActivityO
|
|
362
|
369
|
|
|
363
|
370
|
}
|
|
364
|
371
|
|
|
365
|
|
- if (!StringsUtil.isEmpty(orderBean.getRefund_order_id())){
|
|
|
372
|
+ if (!StringsUtil.isEmpty(orderBean.getRefund_order_id())) {
|
|
366
|
373
|
// setTitle("已申请售后");
|
|
367
|
374
|
mViewBinding.tvIsRefund.setVisibility(View.VISIBLE);
|
|
368
|
375
|
mViewBinding.tvApplyForAfterSales.setVisibility(View.GONE);
|
|
|
@@ -376,81 +383,81 @@ public class OrderDetailsActivity extends ViewBindingTitleBaseActivity<ActivityO
|
|
376
|
383
|
if (v == mViewBinding.tvRemindTheDelivery) {
|
|
377
|
384
|
ToastUtils.showLong("已告知商家尽快发货");
|
|
378
|
385
|
} else if (v == mViewBinding.tvImmediatePayment) {
|
|
379
|
|
- if (status.equals("-2")){
|
|
|
386
|
+ if (status.equals("-2")) {
|
|
380
|
387
|
//去支付
|
|
381
|
|
- Map<String,Object> map=new HashMap<>();
|
|
382
|
|
- map.put("cost",orderBean.getCost());
|
|
383
|
|
- map.put("coupon_price",orderBean.getCoupon_price());
|
|
384
|
|
- map.put("create_time",orderBean.getCreate_time());
|
|
|
388
|
+ Map<String, Object> map = new HashMap<>();
|
|
|
389
|
+ map.put("cost", orderBean.getCost());
|
|
|
390
|
+ map.put("coupon_price", orderBean.getCoupon_price());
|
|
|
391
|
+ map.put("create_time", orderBean.getCreate_time());
|
|
385
|
392
|
map.put("give_coupon_ids", Collections.emptyList());
|
|
386
|
|
- map.put("group_order_id",orderBean.getGroup_order_id());
|
|
387
|
|
- map.put("group_order_sn",orderBean.getGroup_order_sn());
|
|
388
|
|
- map.put("pay_postage",orderBean.getPay_postage());
|
|
389
|
|
- map.put("pay_price",orderBean.getPay_price());
|
|
390
|
|
- map.put("pay_type",orderBean.getPay_type());
|
|
391
|
|
- map.put("real_name",orderBean.getReal_name());
|
|
392
|
|
- map.put("total_num",orderBean.getTotal_num());
|
|
393
|
|
- map.put("total_postage",orderBean.getTotal_postage());
|
|
394
|
|
- map.put("total_price",orderBean.getTotal_price());
|
|
395
|
|
- map.put("uid",orderBean.getUid());
|
|
396
|
|
- map.put("user_address",orderBean.getUser_address());
|
|
397
|
|
- map.put("user_phone",orderBean.getUser_phone());
|
|
398
|
|
- PayActivity.launch(context,"1", JSON.toJSONString(map), orderBean.getGroup_order_id(), orderBean.getPay_price());
|
|
399
|
|
-
|
|
400
|
|
- }else {
|
|
|
393
|
+ map.put("group_order_id", orderBean.getGroup_order_id());
|
|
|
394
|
+ map.put("group_order_sn", orderBean.getGroup_order_sn());
|
|
|
395
|
+ map.put("pay_postage", orderBean.getPay_postage());
|
|
|
396
|
+ map.put("pay_price", orderBean.getPay_price());
|
|
|
397
|
+ map.put("pay_type", orderBean.getPay_type());
|
|
|
398
|
+ map.put("real_name", orderBean.getReal_name());
|
|
|
399
|
+ map.put("total_num", orderBean.getTotal_num());
|
|
|
400
|
+ map.put("total_postage", orderBean.getTotal_postage());
|
|
|
401
|
+ map.put("total_price", orderBean.getTotal_price());
|
|
|
402
|
+ map.put("uid", orderBean.getUid());
|
|
|
403
|
+ map.put("user_address", orderBean.getUser_address());
|
|
|
404
|
+ map.put("user_phone", orderBean.getUser_phone());
|
|
|
405
|
+ PayActivity.launch(context, "1", JSON.toJSONString(map), orderBean.getGroup_order_id(), orderBean.getPay_price());
|
|
|
406
|
+
|
|
|
407
|
+ } else {
|
|
401
|
408
|
//去支付
|
|
402
|
|
- Map<String,Object> map=new HashMap<>();
|
|
403
|
|
- map.put("cost",obligationBeanList.getCost());
|
|
404
|
|
- map.put("coupon_price",obligationBeanList.getCoupon_price());
|
|
405
|
|
- map.put("create_time",obligationBeanList.getCreate_time());
|
|
|
409
|
+ Map<String, Object> map = new HashMap<>();
|
|
|
410
|
+ map.put("cost", obligationBeanList.getCost());
|
|
|
411
|
+ map.put("coupon_price", obligationBeanList.getCoupon_price());
|
|
|
412
|
+ map.put("create_time", obligationBeanList.getCreate_time());
|
|
406
|
413
|
map.put("give_coupon_ids", Collections.emptyList());
|
|
407
|
|
- map.put("group_order_id",obligationBeanList.getGroup_order_id());
|
|
408
|
|
- map.put("group_order_sn",obligationBeanList.getGroup_order_sn());
|
|
409
|
|
- map.put("pay_postage",obligationBeanList.getPay_postage());
|
|
410
|
|
- map.put("pay_price",obligationBeanList.getPay_price());
|
|
411
|
|
- map.put("pay_type",obligationBeanList.getPay_type());
|
|
412
|
|
- map.put("real_name",obligationBeanList.getReal_name());
|
|
413
|
|
- map.put("total_num",obligationBeanList.getTotal_num());
|
|
414
|
|
- map.put("total_postage",obligationBeanList.getTotal_postage());
|
|
415
|
|
- map.put("total_price",obligationBeanList.getTotal_price());
|
|
416
|
|
- map.put("uid",obligationBeanList.getUid());
|
|
417
|
|
- map.put("user_address",obligationBeanList.getUser_address());
|
|
418
|
|
- map.put("user_phone",obligationBeanList.getUser_phone());
|
|
419
|
|
- PayActivity.launch(context,"1", JSON.toJSONString(map), obligationBeanList.getGroup_order_id(), obligationBeanList.getPay_price());
|
|
|
414
|
+ map.put("group_order_id", obligationBeanList.getGroup_order_id());
|
|
|
415
|
+ map.put("group_order_sn", obligationBeanList.getGroup_order_sn());
|
|
|
416
|
+ map.put("pay_postage", obligationBeanList.getPay_postage());
|
|
|
417
|
+ map.put("pay_price", obligationBeanList.getPay_price());
|
|
|
418
|
+ map.put("pay_type", obligationBeanList.getPay_type());
|
|
|
419
|
+ map.put("real_name", obligationBeanList.getReal_name());
|
|
|
420
|
+ map.put("total_num", obligationBeanList.getTotal_num());
|
|
|
421
|
+ map.put("total_postage", obligationBeanList.getTotal_postage());
|
|
|
422
|
+ map.put("total_price", obligationBeanList.getTotal_price());
|
|
|
423
|
+ map.put("uid", obligationBeanList.getUid());
|
|
|
424
|
+ map.put("user_address", obligationBeanList.getUser_address());
|
|
|
425
|
+ map.put("user_phone", obligationBeanList.getUser_phone());
|
|
|
426
|
+ PayActivity.launch(context, "1", JSON.toJSONString(map), obligationBeanList.getGroup_order_id(), obligationBeanList.getPay_price());
|
|
420
|
427
|
}
|
|
421
|
|
- }else if (v == mViewBinding.tvCancellationOfOrder){
|
|
422
|
|
- if (status.equals("-2")){
|
|
|
428
|
+ } else if (v == mViewBinding.tvCancellationOfOrder) {
|
|
|
429
|
+ if (status.equals("-2")) {
|
|
423
|
430
|
mOrderViewModel.getCancelOrder(orderBean.getGroup_order_id());
|
|
424
|
|
- }else {
|
|
|
431
|
+ } else {
|
|
425
|
432
|
//取消订单
|
|
426
|
433
|
mOrderViewModel.getCancelOrder(obligationBeanList.getGroup_order_id());
|
|
427
|
434
|
}
|
|
428
|
|
- }else if (v ==mViewBinding.tvCopy){
|
|
429
|
|
- if (status.equals("99")){
|
|
430
|
|
- CopyUtils.copy(context,obligationBeanList.getGroup_order_sn());
|
|
|
435
|
+ } else if (v == mViewBinding.tvCopy) {
|
|
|
436
|
+ if (status.equals("99")) {
|
|
|
437
|
+ CopyUtils.copy(context, obligationBeanList.getGroup_order_sn());
|
|
431
|
438
|
ToastUtils.showLong("复制成功");
|
|
432
|
|
- }else {
|
|
433
|
|
- CopyUtils.copy(context,orderBean.getOrder_sn());
|
|
|
439
|
+ } else {
|
|
|
440
|
+ CopyUtils.copy(context, orderBean.getOrder_sn());
|
|
434
|
441
|
ToastUtils.showLong("复制成功");
|
|
435
|
442
|
}
|
|
436
|
|
- }else if (v ==mViewBinding.tvCheckTheLogistics){
|
|
|
443
|
+ } else if (v == mViewBinding.tvCheckTheLogistics) {
|
|
437
|
444
|
//查看物流
|
|
438
|
|
- LogisticsActivity.launch(context,orderBean);
|
|
439
|
|
- }else if (v == mViewBinding.tvConfirmReceipt){
|
|
|
445
|
+ LogisticsActivity.launch(context, orderBean);
|
|
|
446
|
+ } else if (v == mViewBinding.tvConfirmReceipt) {
|
|
440
|
447
|
//确认收货
|
|
441
|
448
|
mOrderViewModel.getTakeDeliveryOfGoods(orderBean.getOrder_id());
|
|
442
|
|
- }else if (v == mViewBinding.tvBuyAgain){
|
|
|
449
|
+ } else if (v == mViewBinding.tvBuyAgain) {
|
|
443
|
450
|
//再次购买
|
|
444
|
|
- ProductDetailsActivity.launch(context,orderBean.getOrderProduct().get(0).getCart_info().getProduct().getProduct_id());
|
|
445
|
|
- }else if (v ==mViewBinding.tvToEvaluate){
|
|
|
451
|
+ ProductDetailsActivity.launch(context, orderBean.getOrderProduct().get(0).getCart_info().getProduct().getProduct_id());
|
|
|
452
|
+ } else if (v == mViewBinding.tvToEvaluate) {
|
|
446
|
453
|
//去评价
|
|
447
|
|
- EvaluateActivity.launch(context,orderBean);
|
|
448
|
|
- }else if (v == mViewBinding.tvApplyForAfterSales){
|
|
|
454
|
+ EvaluateActivity.launch(context, orderBean);
|
|
|
455
|
+ } else if (v == mViewBinding.tvApplyForAfterSales) {
|
|
449
|
456
|
//申请售后
|
|
450
|
457
|
ApplyForRefundOptionPageActivity.launch(context, orderBean);
|
|
451
|
|
- }else if (v == mViewBinding.tvIsRefund){
|
|
|
458
|
+ } else if (v == mViewBinding.tvIsRefund) {
|
|
452
|
459
|
//售后详情
|
|
453
|
|
- AfterSalesOrderDateilsActivity.launch(this,orderBean.getRefund_order_id());
|
|
|
460
|
+ AfterSalesOrderDateilsActivity.launch(this, orderBean.getRefund_order_id());
|
|
454
|
461
|
}
|
|
455
|
462
|
|
|
456
|
463
|
}
|
|
|
@@ -469,4 +476,10 @@ public class OrderDetailsActivity extends ViewBindingTitleBaseActivity<ActivityO
|
|
469
|
476
|
intent.putExtra(INTENT_ORDER_STATUS, status);
|
|
470
|
477
|
context.startActivity(intent);
|
|
471
|
478
|
}
|
|
|
479
|
+
|
|
|
480
|
+ public static void launch(Context context, String orderId) {
|
|
|
481
|
+ Intent intent = new Intent(context, OrderDetailsActivity.class);
|
|
|
482
|
+ intent.putExtra(ORDER_ID, orderId);
|
|
|
483
|
+ context.startActivity(intent);
|
|
|
484
|
+ }
|
|
472
|
485
|
}
|