|
|
@@ -1,6 +1,7 @@
|
|
|
package com.datarecovery.master.module.order;
|
|
|
|
|
|
import android.accounts.NetworkErrorException;
|
|
|
+import android.annotation.SuppressLint;
|
|
|
|
|
|
import androidx.lifecycle.LiveData;
|
|
|
import androidx.lifecycle.MutableLiveData;
|
|
|
@@ -13,11 +14,18 @@ import com.datarecovery.master.data.api.bean.OrderBean;
|
|
|
import com.datarecovery.master.data.api.bean.PayOptions;
|
|
|
import com.datarecovery.master.data.api.response.OrderPageResponse;
|
|
|
import com.datarecovery.master.data.consts.ErrorCode;
|
|
|
+import com.datarecovery.master.data.consts.EventId;
|
|
|
import com.datarecovery.master.data.repositories.MemberRepository;
|
|
|
import com.datarecovery.master.data.repositories.PayRepository;
|
|
|
+import com.datarecovery.master.handler.EventHelper;
|
|
|
+import com.datarecovery.master.utils.Maps;
|
|
|
+import com.datarecovery.master.utils.ReportUtil;
|
|
|
import com.datarecovery.master.utils.ToastUtil;
|
|
|
+import com.umeng.vt.diff.V;
|
|
|
|
|
|
+import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
|
|
|
import javax.inject.Inject;
|
|
|
|
|
|
@@ -93,10 +101,12 @@ public class OrderViewModel extends BaseViewModel {
|
|
|
}
|
|
|
|
|
|
|
|
|
+ @SuppressLint("WrongConstant")
|
|
|
public void cancelOrder(OrderBean orderBean) {
|
|
|
if (orderBean == null) {
|
|
|
return;
|
|
|
}
|
|
|
+ EventHelper.report(EventId.hf1001131, Maps.asMap(EventId.EVENT_ID, ReportUtil.getReportId(orderBean.getAuths())));
|
|
|
payRepository.cancelOrder(orderBean.getId()).subscribe(new SingleObserver<Object>() {
|
|
|
@Override
|
|
|
public void onSubscribe(@NonNull Disposable d) {
|
|
|
@@ -131,6 +141,7 @@ public class OrderViewModel extends BaseViewModel {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
+ @SuppressLint("WrongConstant")
|
|
|
public void payOrder(OrderBean orderBean) {
|
|
|
if (orderBean == null) {
|
|
|
return;
|
|
|
@@ -138,6 +149,18 @@ public class OrderViewModel extends BaseViewModel {
|
|
|
int payPlatform = orderBean.getPayPlatform();
|
|
|
int payMethod = orderBean.getPayMethod();
|
|
|
int goodsId = orderBean.getItemId();
|
|
|
+ HashMap<String, Object> map = new HashMap<>(2);
|
|
|
+ map.put(EventId.EVENT_ID, ReportUtil.getReportId(orderBean.getAuths()));
|
|
|
+ if (orderBean.getPayPlatform() == 1 && orderBean.getPayMethod() == 2) {
|
|
|
+
|
|
|
+ } else if (orderBean.getPayPlatform() == 4 && orderBean.getPayMethod() == 2) {
|
|
|
+
|
|
|
+ } else if (orderBean.getPayPlatform() == 1 && orderBean.getPayMethod() == 1) {//支付宝
|
|
|
+ map.put(EventId.EVENT_TYPE1, "hf11023");
|
|
|
+ } else if (orderBean.getPayPlatform() == 4 && orderBean.getPayMethod() == 1) {//支付宝扫码
|
|
|
+ map.put(EventId.EVENT_TYPE1, "hf11024");
|
|
|
+ }
|
|
|
+ EventHelper.report(EventId.hf1001132, map);
|
|
|
memberRepository.payOrder(new PayOptions(
|
|
|
this::addDisposable,
|
|
|
goodsId,
|