Commit 33d53e1f by 罗翻

处理工单前增加活体检测

parent d46bcf9d
Showing with 583 additions and 98 deletions
...@@ -379,7 +379,7 @@ public class LivenessActivity extends Activity ...@@ -379,7 +379,7 @@ public class LivenessActivity extends Activity
/** /**
* 跳转Activity传递信息 * 跳转Activity传递信息
*/ */
private void handleResult(final int resID, String delta, Map<String, byte[]> images) { public void handleResult(final int resID, String delta, Map<String, byte[]> images) {
String resultString = getResources().getString(resID); String resultString = getResources().getString(resID);
try { try {
jsonObject.put("result", resultString); jsonObject.put("result", resultString);
......
...@@ -38,8 +38,8 @@ public class IDetection { ...@@ -38,8 +38,8 @@ public class IDetection {
} }
public void animationInit() { public void animationInit() {
int[] reses = { R.drawable.liveness_head_pitch, R.drawable.liveness_head_yaw, int[] reses = {R.drawable.liveness_head_pitch, R.drawable.liveness_head_yaw,
R.drawable.liveness_mouth_open_closed, R.drawable.liveness_eye_open_closed }; R.drawable.liveness_mouth_open_closed, R.drawable.liveness_eye_open_closed};
for (int oneRes : reses) { for (int oneRes : reses) {
mDrawableCache.put(oneRes, (mContext.getResources().getDrawable(oneRes))); mDrawableCache.put(oneRes, (mContext.getResources().getDrawable(oneRes)));
} }
...@@ -90,7 +90,7 @@ public class IDetection { ...@@ -90,7 +90,7 @@ public class IDetection {
if (detectionNameStr != null && detectionNameText != null) { if (detectionNameStr != null && detectionNameText != null) {
if (isLarge && !detectionNameText.getText().toString().equals(mContext.getString(R.string.face_too_large))) { if (isLarge && !detectionNameText.getText().toString().equals(mContext.getString(R.string.face_too_large))) {
detectionNameText.setText(R.string.face_too_large); detectionNameText.setText(R.string.face_too_large);
} else if(!isLarge && detectionNameText.getText().toString().equals(mContext.getString(R.string.face_too_large))){ } else if (!isLarge && detectionNameText.getText().toString().equals(mContext.getString(R.string.face_too_large))) {
detectionNameText.setText(detectionNameStr); detectionNameText.setText(detectionNameStr);
} }
} }
...@@ -151,17 +151,21 @@ public class IDetection { ...@@ -151,17 +151,21 @@ public class IDetection {
return detectionName; return detectionName;
} }
public void setNum(int n) {
num = n;
}
/** /**
* 初始化检测动作 * 初始化检测动作
*/ */
public void detectionTypeInit() { public void detectionTypeInit() {
ArrayList<DetectionType> tmpTypes = new ArrayList<Detector.DetectionType>(); ArrayList<DetectionType> tmpTypes = new ArrayList<>();
tmpTypes.add(Detector.DetectionType.BLINK);// 眨眼 tmpTypes.add(Detector.DetectionType.BLINK);// 眨眼
tmpTypes.add(Detector.DetectionType.MOUTH);// 张嘴 tmpTypes.add(Detector.DetectionType.MOUTH);// 张嘴
tmpTypes.add(Detector.DetectionType.POS_PITCH);// 缓慢点头 tmpTypes.add(Detector.DetectionType.POS_PITCH);// 缓慢点头
tmpTypes.add(Detector.DetectionType.POS_YAW);// 左右摇头 tmpTypes.add(Detector.DetectionType.POS_YAW);// 左右摇头
Collections.shuffle(tmpTypes);// 打乱顺序 Collections.shuffle(tmpTypes);// 打乱顺序
mDetectionSteps = new ArrayList<DetectionType>(num); mDetectionSteps = new ArrayList<>(num);
for (int i = 0; i < num; i++) { for (int i = 0; i < num; i++) {
mDetectionSteps.add(tmpTypes.get(i)); mDetectionSteps.add(tmpTypes.get(i));
} }
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" <layout>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/liveness_layout_rootRel" android:id="@+id/liveness_layout_rootRel"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical" > android:orientation="vertical">
<TextureView <TextureView
android:id="@+id/liveness_layout_textureview" android:id="@+id/liveness_layout_textureview"
...@@ -32,33 +34,34 @@ ...@@ -32,33 +34,34 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_below="@id/liveness_layout_head_mask" android:layout_below="@id/liveness_layout_head_mask"
android:background="#F6F5F4" > android:background="#F6F5F4">
<include <include
android:id="@+id/activity_main_bottomTitle" android:id="@+id/activity_main_bottomTitle"
layout="@layout/bottom_title_layout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="40dip" android:layout_height="40dip"
android:layout_alignParentBottom="true" android:layout_alignParentBottom="true"
layout="@layout/bottom_title_layout" /> android:visibility="gone" />
<include <include
android:id="@+id/liveness_layout_first_layout" android:id="@+id/liveness_layout_first_layout"
layout="@layout/liveness_detection_step"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_above="@+id/activity_main_bottomTitle" android:layout_above="@+id/activity_main_bottomTitle"
android:layout_marginBottom="15dip" android:layout_marginBottom="15dip"
android:layout_marginTop="15dip" android:layout_marginTop="15dip"
layout="@layout/liveness_detection_step"
android:visibility="invisible" /> android:visibility="invisible" />
<include <include
android:id="@+id/liveness_layout_second_layout" android:id="@+id/liveness_layout_second_layout"
layout="@layout/liveness_detection_step"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_above="@+id/activity_main_bottomTitle" android:layout_above="@+id/activity_main_bottomTitle"
android:layout_marginBottom="15dip" android:layout_marginBottom="15dip"
android:layout_marginTop="15dip" android:layout_marginTop="15dip"
layout="@layout/liveness_detection_step"
android:visibility="gone" /> android:visibility="gone" />
<LinearLayout <LinearLayout
...@@ -69,7 +72,7 @@ ...@@ -69,7 +72,7 @@
android:layout_centerHorizontal="true" android:layout_centerHorizontal="true"
android:gravity="center" android:gravity="center"
android:orientation="vertical" android:orientation="vertical"
android:visibility="visible" > android:visibility="visible">
<TextView <TextView
android:id="@+id/liveness_layout_promptText" android:id="@+id/liveness_layout_promptText"
...@@ -93,7 +96,7 @@ ...@@ -93,7 +96,7 @@
android:layout_height="35dip" android:layout_height="35dip"
android:layout_alignParentRight="true" android:layout_alignParentRight="true"
android:layout_margin="5dip" android:layout_margin="5dip"
android:visibility="invisible" > android:visibility="invisible">
<TextView <TextView
android:id="@+id/detection_step_timeout_garden" android:id="@+id/detection_step_timeout_garden"
...@@ -119,7 +122,8 @@ ...@@ -119,7 +122,8 @@
android:layout_alignParentTop="true" android:layout_alignParentTop="true"
android:layout_marginRight="20dp" android:layout_marginRight="20dp"
android:scaleType="centerInside" android:scaleType="centerInside"
android:src="@drawable/liveness_faceppinside" /> android:src="@drawable/liveness_faceppinside"
android:visibility="gone" />
<ProgressBar <ProgressBar
android:id="@+id/liveness_layout_progressbar" android:id="@+id/liveness_layout_progressbar"
...@@ -128,4 +132,5 @@ ...@@ -128,4 +132,5 @@
android:layout_centerInParent="true" android:layout_centerInParent="true"
android:visibility="invisible" /> android:visibility="invisible" />
</RelativeLayout> </RelativeLayout>
\ No newline at end of file </layout>
\ No newline at end of file
package com.dayu.common;
import android.text.Editable;
import android.text.TextWatcher;
/**
* Created by luofan
* on 2018/6/20.
*/
public class MyTextWatcher implements TextWatcher {
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
}
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
}
@Override
public void afterTextChanged(Editable s) {
}
}
...@@ -31,8 +31,8 @@ public class UserManager { ...@@ -31,8 +31,8 @@ public class UserManager {
} }
} }
public void saveUserForJson(String json){ public void saveUserForJson(String json) {
SPUtils.put("USER_INFO",json); SPUtils.put("USER_INFO", json);
} }
public UserInfo getUser() { public UserInfo getUser() {
...@@ -63,8 +63,9 @@ public class UserManager { ...@@ -63,8 +63,9 @@ public class UserManager {
UserInfo userInfo = getUser(); UserInfo userInfo = getUser();
if (userInfo != null) { if (userInfo != null) {
//有数据 //有数据
//TODO
if (!TextUtils.isEmpty(userInfo.getAccountId()) && !TextUtils.isEmpty(userInfo.getSiteId()) if (!TextUtils.isEmpty(userInfo.getAccountId()) && !TextUtils.isEmpty(userInfo.getSiteId())
&& !TextUtils.isEmpty(userInfo.getAccountName()) && userInfo.getDetectStatus() == 1) { && !TextUtils.isEmpty(userInfo.getAccountName()) && userInfo.getDetectStatus() == 1 && !TextUtils.isEmpty((String) SPUtils.get("USER_IDENTITY", ""))) {
return true; return true;
} else { } else {
return false; return false;
......
...@@ -274,7 +274,8 @@ ...@@ -274,7 +274,8 @@
<string name="send_already">已发货</string> <string name="send_already">已发货</string>
<string name="modify_part_info">修改信息</string> <string name="modify_part_info">修改信息</string>
<string name="customer_acceptance">客户验收</string> <string name="customer_acceptance">客户验收</string>
<string name="scan_code_for_appointment">请扫描二维码验收</string> <string name="scan_code_for_appointment">请扫描二维码关注大鱼服务公众号</string>
<string name="scan_code_for_appointment_two">点击-我的服务-进行绑定登录后,选择工单付款</string>
<string name="order_record">工单记录</string> <string name="order_record">工单记录</string>
<string name="order_num">工单编号</string> <string name="order_num">工单编号</string>
<string name="order_state">工单状态</string> <string name="order_state">工单状态</string>
...@@ -311,8 +312,8 @@ ...@@ -311,8 +312,8 @@
<string name="order_select_payer_notice">修改费用承担方可能会导致费用争议,请一定要确认清楚之后再操作</string> <string name="order_select_payer_notice">修改费用承担方可能会导致费用争议,请一定要确认清楚之后再操作</string>
<string name="order_payer_prove">费用承担证明</string> <string name="order_payer_prove">费用承担证明</string>
<string name="server_info">服务信息</string> <string name="server_info">服务信息</string>
<string name="payer_baonei">派单方承担(保内)</string> <string name="payer_baonei">派单方承担</string>
<string name="payer_baowai">用户承担(保外)</string> <string name="payer_baowai">用户承担</string>
<string name="payer_dialog_content">您还没有选择费用承担方,请选择后再提交验收</string> <string name="payer_dialog_content">您还没有选择费用承担方,请选择后再提交验收</string>
<string name="payer_dialog_title">未选择费用承担方</string> <string name="payer_dialog_title">未选择费用承担方</string>
<string name="payer_select_title">确认操作</string> <string name="payer_select_title">确认操作</string>
......
...@@ -68,4 +68,5 @@ dependencies { ...@@ -68,4 +68,5 @@ dependencies {
//ARouter //ARouter
annotationProcessor "com.alibaba:arouter-compiler:$arouter_compiler_version" annotationProcessor "com.alibaba:arouter-compiler:$arouter_compiler_version"
compile project(':provider') compile project(':provider')
compile project(':IDCardLib')
} }
...@@ -137,4 +137,8 @@ public class OrderApiFactory { ...@@ -137,4 +137,8 @@ public class OrderApiFactory {
public static Observable<companyManager> getManagerMobile(int companyId, int managerType) { public static Observable<companyManager> getManagerMobile(int companyId, int managerType) {
return Api.getService(OrderService.class).getManagerMobile(companyId,managerType).compose(Api.applySchedulers()); return Api.getService(OrderService.class).getManagerMobile(companyId,managerType).compose(Api.applySchedulers());
} }
public static Observable<Boolean> certificationLive(RequestBody body) {
return Api.getService(OrderService.class).certificationLive(body).compose(Api.applySchedulers());
}
} }
...@@ -284,6 +284,7 @@ interface OrderService { ...@@ -284,6 +284,7 @@ interface OrderService {
/** /**
* 单任务多数量提交工单. * 单任务多数量提交工单.
*
* @param body * @param body
* @return * @return
*/ */
...@@ -292,6 +293,7 @@ interface OrderService { ...@@ -292,6 +293,7 @@ interface OrderService {
/** /**
* 查看多任务处理工单信息. * 查看多任务处理工单信息.
*
* @param id * @param id
* @return * @return
*/ */
...@@ -300,8 +302,17 @@ interface OrderService { ...@@ -300,8 +302,17 @@ interface OrderService {
/** /**
* 获取技术支持电话 * 获取技术支持电话
*
* @return * @return
*/ */
@GET(OrderConstant.COMPAY_MANAGER_MOBILE) @GET(OrderConstant.COMPAY_MANAGER_MOBILE)
Observable<BaseResponse<companyManager>> getManagerMobile(@Query("companyId") int companyId, @Query("managerType") int managerType); Observable<BaseResponse<companyManager>> getManagerMobile(@Query("companyId") int companyId, @Query("managerType") int managerType);
/**
* 接单活体检测.
*
* @return
*/
@GET(OrderConstant.FACE_CERTIFICAITON)
Observable<BaseResponse<Boolean>> certificationLive(@Body RequestBody body);
} }
package com.dayu.order.api.protocol; package com.dayu.order.api.protocol;
import java.io.Serializable;
import java.util.List; import java.util.List;
/** /**
* 工单列表,异常单列表,工单记录列表的bean * 工单列表,异常单列表,工单记录列表的bean
* Created by luofan on 2017/11/14. * Created by luofan on 2017/11/14.
*/ */
public class Order { public class Order implements Serializable{
/** /**
* id : 20 * id : 20
* orderNum : 201709249030024287834 接单数 * orderNum : 201709249030024287834 接单数
...@@ -53,6 +54,15 @@ public class Order { ...@@ -53,6 +54,15 @@ public class Order {
private List<Spu> spus; private List<Spu> spus;
private Integer commited; private Integer commited;
private Integer kaCompanyId; private Integer kaCompanyId;
private Integer faceSwitch ;//0:关闭;1:打开
public Integer getFaceSwitch() {
return faceSwitch;
}
public void setFaceSwitch(Integer faceSwitch) {
this.faceSwitch = faceSwitch;
}
public Integer getKaCompanyId() { public Integer getKaCompanyId() {
return kaCompanyId; return kaCompanyId;
......
...@@ -47,15 +47,15 @@ public class OrderDetail implements Serializable { ...@@ -47,15 +47,15 @@ public class OrderDetail implements Serializable {
private Object customerCheckComment; private Object customerCheckComment;
private Integer isPay; private Integer isPay;
private Object payType; private Object payType;
private Integer doorPrice; private Double doorPrice;
private String doorPriceComment; private String doorPriceComment;
private Integer servicePrice; private Double servicePrice;
private Object servicePriceComment; private Object servicePriceComment;
private Integer materialCost; private Integer materialCost;
private Object materialCostComment; private Object materialCostComment;
private Integer otherPrice; private double otherPrice;
private Object otherPriceComment; private Object otherPriceComment;
private Integer totalPrice; private Double totalPrice;
private Object cancelOrderReason; private Object cancelOrderReason;
private Object closePhase; private Object closePhase;
private int siteId; private int siteId;
...@@ -428,11 +428,11 @@ public class OrderDetail implements Serializable { ...@@ -428,11 +428,11 @@ public class OrderDetail implements Serializable {
this.payType = payType; this.payType = payType;
} }
public Integer getDoorPrice() { public Double getDoorPrice() {
return doorPrice; return doorPrice;
} }
public void setDoorPrice(Integer doorPrice) { public void setDoorPrice(Double doorPrice) {
this.doorPrice = doorPrice; this.doorPrice = doorPrice;
} }
...@@ -444,11 +444,11 @@ public class OrderDetail implements Serializable { ...@@ -444,11 +444,11 @@ public class OrderDetail implements Serializable {
this.doorPriceComment = doorPriceComment; this.doorPriceComment = doorPriceComment;
} }
public Integer getServicePrice() { public Double getServicePrice() {
return servicePrice; return servicePrice;
} }
public void setServicePrice(Integer servicePrice) { public void setServicePrice(Double servicePrice) {
this.servicePrice = servicePrice; this.servicePrice = servicePrice;
} }
...@@ -476,11 +476,11 @@ public class OrderDetail implements Serializable { ...@@ -476,11 +476,11 @@ public class OrderDetail implements Serializable {
this.materialCostComment = materialCostComment; this.materialCostComment = materialCostComment;
} }
public Integer getOtherPrice() { public Double getOtherPrice() {
return otherPrice; return otherPrice;
} }
public void setOtherPrice(Integer otherPrice) { public void setOtherPrice(Double otherPrice) {
this.otherPrice = otherPrice; this.otherPrice = otherPrice;
} }
...@@ -492,11 +492,11 @@ public class OrderDetail implements Serializable { ...@@ -492,11 +492,11 @@ public class OrderDetail implements Serializable {
this.otherPriceComment = otherPriceComment; this.otherPriceComment = otherPriceComment;
} }
public Integer getTotalPrice() { public Double getTotalPrice() {
return totalPrice; return totalPrice;
} }
public void setTotalPrice(Integer totalPrice) { public void setTotalPrice(Double totalPrice) {
this.totalPrice = totalPrice; this.totalPrice = totalPrice;
} }
......
...@@ -152,4 +152,8 @@ public class OrderConstant { ...@@ -152,4 +152,8 @@ public class OrderConstant {
*/ */
public final static String COMPAY_MANAGER_MOBILE = "/api-ka-user/" + "companyManager/findCompanyManagerBy"; public final static String COMPAY_MANAGER_MOBILE = "/api-ka-user/" + "companyManager/findCompanyManagerBy";
/**
* 接单活体检测校验.
*/
public final static String FACE_CERTIFICAITON = "/api-third/" +"detect/receiptOrderVerify";
} }
...@@ -3,6 +3,7 @@ package com.dayu.order.presenter.multipleprocess; ...@@ -3,6 +3,7 @@ package com.dayu.order.presenter.multipleprocess;
import com.dayu.base.ui.presenter.BaseListPresenter; import com.dayu.base.ui.presenter.BaseListPresenter;
import com.dayu.common.BaseView; import com.dayu.common.BaseView;
import com.dayu.widgets.listener.OnCloseListener;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
...@@ -27,6 +28,12 @@ public interface MultipleProcessContract { ...@@ -27,6 +28,12 @@ public interface MultipleProcessContract {
void showSignature(); void showSignature();
void setPayStatus(); void setPayStatus();
void showSelectPayerDialog(OnCloseListener listener);
void showNoPayerDialog();
boolean getSelectPayer();
} }
abstract class Presenter extends BaseListPresenter<View> { abstract class Presenter extends BaseListPresenter<View> {
......
package com.dayu.order.presenter.multipleprocess; package com.dayu.order.presenter.multipleprocess;
import android.databinding.ObservableField; import android.databinding.ObservableField;
import android.os.Bundle;
import com.alibaba.android.arouter.launcher.ARouter; import com.alibaba.android.arouter.launcher.ARouter;
import com.dayu.base.api.BaseApiFactory; import com.dayu.base.api.BaseApiFactory;
import com.dayu.common.Constants;
import com.dayu.order.R; import com.dayu.order.R;
import com.dayu.order.api.OrderApiFactory; import com.dayu.order.api.OrderApiFactory;
import com.dayu.order.api.protocol.Spu; import com.dayu.order.api.protocol.Spu;
import com.dayu.order.common.OrderConstant; import com.dayu.order.common.OrderConstant;
import com.dayu.order.ui.activity.QrCodeActivity;
import com.dayu.order.ui.activity.SignatureActivity; import com.dayu.order.ui.activity.SignatureActivity;
import com.dayu.provider.event.RefreshServe; import com.dayu.provider.event.RefreshServe;
import com.dayu.provider.router.RouterPath; import com.dayu.provider.router.RouterPath;
...@@ -41,7 +44,6 @@ public class MultipleProcessPresenter extends MultipleProcessContract.Presenter ...@@ -41,7 +44,6 @@ public class MultipleProcessPresenter extends MultipleProcessContract.Presenter
private ArrayList<String> mImages = new ArrayList<>(); private ArrayList<String> mImages = new ArrayList<>();
private Integer mNeedEsignature; private Integer mNeedEsignature;
private String mSignatureUrl; private String mSignatureUrl;
private boolean canPay;
@Override @Override
public void onAttached() { public void onAttached() {
...@@ -67,12 +69,20 @@ public class MultipleProcessPresenter extends MultipleProcessContract.Presenter ...@@ -67,12 +69,20 @@ public class MultipleProcessPresenter extends MultipleProcessContract.Presenter
public void process() { public void process() {
File file = new File(SignatureActivity.path); File file = new File(SignatureActivity.path);
if (!file.exists()) { if (mNeedEsignature == 1 && !file.exists()) {
ToastUtils.showShortToast("请让客户签名!"); ToastUtils.showShortToast("请让客户签名!");
return; return;
} }
if (mView.getSelectPayer()) {
mView.showNoPayerDialog();
} else {
mView.showSelectPayerDialog((dialog, confirm) -> {
if (confirm) {
commitePhoto(); commitePhoto();
} }
});
}
}
private void commitePhoto() { private void commitePhoto() {
MultipartBody.Part[] parts; MultipartBody.Part[] parts;
...@@ -154,8 +164,14 @@ public class MultipleProcessPresenter extends MultipleProcessContract.Presenter ...@@ -154,8 +164,14 @@ public class MultipleProcessPresenter extends MultipleProcessContract.Presenter
RequestBody body = RequestBody.create(MediaType.parse("application/json"), jsonObject.toString()); RequestBody body = RequestBody.create(MediaType.parse("application/json"), jsonObject.toString());
OrderApiFactory.commitOrder(body).subscribe(baseObserver(integer -> { OrderApiFactory.commitOrder(body).subscribe(baseObserver(integer -> {
ToastUtils.showShortToast("提交验收成功"); ToastUtils.showShortToast("提交验收成功");
if (integer == 6) {
Bundle bundle = new Bundle();
bundle.putInt(Constants.TYPE, 1);
mView.startActivity(QrCodeActivity.class, bundle);
} else {
ARouter.getInstance().build(RouterPath.PATH_MAIN).navigation(); ARouter.getInstance().build(RouterPath.PATH_MAIN).navigation();
EventBus.getDefault().post(new RefreshServe(1)); EventBus.getDefault().post(new RefreshServe(1));
}
})); }));
} }
...@@ -175,7 +191,7 @@ public class MultipleProcessPresenter extends MultipleProcessContract.Presenter ...@@ -175,7 +191,7 @@ public class MultipleProcessPresenter extends MultipleProcessContract.Presenter
} }
Integer isPay = detail.getIsPay(); Integer isPay = detail.getIsPay();
Integer payState = detail.getPayStatus(); Integer payState = detail.getPayStatus();
if (isPay == 2 && payState == 3) { if (isPay == 2 && (payState == 3 || payState == 2)) {
mView.setPayStatus(); mView.setPayStatus();
} }
})); }));
......
...@@ -5,12 +5,18 @@ import android.os.Bundle; ...@@ -5,12 +5,18 @@ import android.os.Bundle;
import com.dayu.common.BaseApplication; import com.dayu.common.BaseApplication;
import com.dayu.common.Constants; import com.dayu.common.Constants;
import com.dayu.provider.event.RefreshTab;
import com.dayu.event.UserInfo; import com.dayu.event.UserInfo;
import com.dayu.order.R;
import com.dayu.order.api.OrderApiFactory; import com.dayu.order.api.OrderApiFactory;
import com.dayu.order.api.protocol.Order;
import com.dayu.order.common.OrderConstant;
import com.dayu.order.ui.activity.OrderDetailsActivity; import com.dayu.order.ui.activity.OrderDetailsActivity;
import com.dayu.order.ui.activity.OrderLivenessActivity;
import com.dayu.order.ui.fragment.OrderThreeTabFragment; import com.dayu.order.ui.fragment.OrderThreeTabFragment;
import com.dayu.provider.event.RefreshTab;
import com.dayu.utils.AppManager;
import com.dayu.utils.UserManager; import com.dayu.utils.UserManager;
import com.dayu.widgets.CustomDialog;
import com.umeng.analytics.MobclickAgent; import com.umeng.analytics.MobclickAgent;
import org.greenrobot.eventbus.EventBus; import org.greenrobot.eventbus.EventBus;
...@@ -22,12 +28,15 @@ import io.reactivex.Observable; ...@@ -22,12 +28,15 @@ import io.reactivex.Observable;
import okhttp3.MediaType; import okhttp3.MediaType;
import okhttp3.RequestBody; import okhttp3.RequestBody;
import static com.dayu.utils.UIUtils.getString;
/** /**
* Created by luofan * Created by luofan
* on 2017/11/8. * on 2017/11/8.
*/ */
public class OrderDoingPresenter extends orderDoingContract.Presenter { public class OrderDoingPresenter extends orderDoingContract.Presenter {
private ObservableField<Object> datas = new ObservableField<>(); private ObservableField<Object> datas = new ObservableField<>();
private static final int PAGE_INTO_LIVENESS = 100;
private int mUserId; private int mUserId;
private int mSiteId; private int mSiteId;
private int mState; private int mState;
...@@ -75,7 +84,7 @@ public class OrderDoingPresenter extends orderDoingContract.Presenter { ...@@ -75,7 +84,7 @@ public class OrderDoingPresenter extends orderDoingContract.Presenter {
@Override @Override
public void getErrorOrder() { public void getErrorOrder() {
OrderApiFactory.getErrorOrders(mUserId, mSiteId).subscribe( OrderApiFactory.getErrorOrders(mUserId, mSiteId).subscribe(
baseObserver( errorOrder -> { baseObserver(errorOrder -> {
datas.set(errorOrder); datas.set(errorOrder);
EventBus.getDefault().post(new RefreshTab(-1)); EventBus.getDefault().post(new RefreshTab(-1));
}, responeThrowable -> datas.set(Constants.FAILED))); }, responeThrowable -> datas.set(Constants.FAILED)));
...@@ -104,10 +113,27 @@ public class OrderDoingPresenter extends orderDoingContract.Presenter { ...@@ -104,10 +113,27 @@ public class OrderDoingPresenter extends orderDoingContract.Presenter {
} }
@Override @Override
public void dumpToFaceCert(Order order) {
CustomDialog customDialog = new CustomDialog(AppManager.getInstance().currentActivity(), R.style.CustomDialog, "为了保证您的账号安全和用户安全,请您本人进行人脸识别操作",
(dialog, confirm) -> {
if (confirm) {
Bundle bundle = new Bundle();
bundle.putSerializable(OrderConstant.ORDERS,order);
mView.startActivity(OrderLivenessActivity.class, bundle);
}
});
customDialog.setTitle("人脸识别")
.setNegativeButton(getString(R.string.cancle))
.setPositiveButton("去认证");
customDialog.show();
}
@Override
public void dumpDetail(int orderId) { public void dumpDetail(int orderId) {
Bundle bundle = new Bundle(); Bundle bundle = new Bundle();
bundle.putInt(Constants.ORDER_ID,orderId); bundle.putInt(Constants.ORDER_ID, orderId);
mView.startActivity(OrderDetailsActivity.class,bundle); mView.startActivity(OrderDetailsActivity.class, bundle);
MobclickAgent.onEvent(BaseApplication.getContext(), "check_order_detail"); MobclickAgent.onEvent(BaseApplication.getContext(), "check_order_detail");
} }
} }
...@@ -2,6 +2,7 @@ package com.dayu.order.presenter.orderdoing; ...@@ -2,6 +2,7 @@ package com.dayu.order.presenter.orderdoing;
import com.dayu.common.BaseView; import com.dayu.common.BaseView;
import com.dayu.order.api.protocol.Order;
import com.dayu.order.presenter.BaseOrderPresenter; import com.dayu.order.presenter.BaseOrderPresenter;
import io.reactivex.Observable; import io.reactivex.Observable;
...@@ -45,5 +46,7 @@ public interface orderDoingContract { ...@@ -45,5 +46,7 @@ public interface orderDoingContract {
*/ */
public abstract Observable<Integer> startServer(int orderId, double latitude, double longitude); public abstract Observable<Integer> startServer(int orderId, double latitude, double longitude);
public abstract void dumpToFaceCert(Order order);
} }
} }
package com.dayu.order.presenter.orderliveness;
import com.dayu.base.ui.presenter.BasePresenter;
import com.dayu.common.BaseView;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
/**
* Created by luo
* on 2016/8/4.
*/
public interface OrderLivenessContract {
interface View extends BaseView {
}
abstract class Presenter extends BasePresenter<View> {
public abstract void verifyIdentity(List<String> list);
public abstract void commitePhoto(ArrayList<File> list, String delta);
}
}
package com.dayu.order.presenter.orderliveness;
import android.os.Bundle;
import com.dayu.base.api.BaseApiFactory;
import com.dayu.common.Constants;
import com.dayu.order.R;
import com.dayu.order.api.OrderApiFactory;
import com.dayu.order.api.protocol.Order;
import com.dayu.order.common.OrderConstant;
import com.dayu.order.ui.activity.ServerInfoActivity;
import com.dayu.order.ui.activity.ServerListActivity;
import com.dayu.utils.SPUtils;
import com.dayu.utils.ToastUtils;
import com.dayu.utils.UserManager;
import org.json.JSONObject;
import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import okhttp3.MediaType;
import okhttp3.MultipartBody;
import okhttp3.RequestBody;
/**
* Created by luofan
* on 2017/11/8.
*/
public class OrderLivenessPresenter extends OrderLivenessContract.Presenter {
private String mDelta;
private Order mOrder;
private String mName;
private String mCardNum;
@Override
public void onAttached() {
Bundle bundle = mView.getBundle();
mOrder = (Order) bundle.getSerializable(OrderConstant.ORDERS);
mName = UserManager.getInstance().getUser().getAccountName();
mCardNum = (String) SPUtils.get("USER_IDENTITY", "");
}
@Override
public void commitePhoto(ArrayList<File> list, String delta) {
mDelta = delta;
BaseApiFactory.uploadPhoto(packPhoto(list), "nowatermark").subscribe(baseObserver(this::verifyIdentity));
}
private MultipartBody.Part[] packPhoto(List<File> files) {
MultipartBody.Part[] part = new MultipartBody.Part[files.size()];
for (int i = 0; i < files.size(); i++) {
RequestBody requestFile =
RequestBody.create(MediaType.parse("multipart/form-data"), files.get(i));
MultipartBody.Part body =
MultipartBody.Part.createFormData("fileUpload", files.get(i).getName(), requestFile);
part[i] = body;
}
return part;
}
@Override
public void verifyIdentity(List<String> list) {
HashMap<String, Object> params = new HashMap<>();
params.put("name", mName);
params.put("cardNumber", mCardNum);
params.put("checkDelta", 0);
params.put("comparisonType", 1);
params.put("delta", mDelta);
params.put("imageAction1Url", list.get(2));
params.put("imageBestUrl", list.get(0));
params.put("imageEnvUrl", list.get(1));
params.put("multiOrientedDetection", 1);
JSONObject jsonObject = new JSONObject(params);
RequestBody body = RequestBody.create(MediaType.parse("application/json"), jsonObject.toString());
mView.showDialog();
Bundle bundle = new Bundle();
OrderApiFactory.certificationLive(body).subscribe(baseObserver(aBoolean -> {
if (aBoolean) {
SPUtils.put(Constants.ORDER_ID+mOrder.getId(),true);
if (mOrder.getKaCompanyId() != null) {
bundle.putInt(OrderConstant.KAADDRESSID, mOrder.getKaCompanyId());
}
if (mOrder.getSpus().size() > 1) {
bundle.putInt(Constants.ID, mOrder.getId());
mView.startActivity(ServerInfoActivity.class, bundle);
} else if (mOrder.getSpus().size() == 1) {
bundle.putInt(Constants.ID, mOrder.getSpus().get(0).getId());
mView.startActivity(ServerListActivity.class, bundle);
}
}
}, responeThrowable -> {
if ("DETECT_ERROR00001".equals(responeThrowable.subCode)) {
ToastUtils.showShortToast(R.string.please_upload_cleare_identity);
} else if ("DETECT_ERROR00003".equals(responeThrowable.subCode)) {
ToastUtils.showShortToast(R.string.please_upload_yourself_face);
} else if ("DETECT_ERROR00003".equals(responeThrowable.subCode)) {
ToastUtils.showShortToast(R.string.server_error);
} else if ("DETECT_ERROR00003".equals(responeThrowable.subCode)) {
ToastUtils.showShortToast(R.string.please_upload_identity_front);
} else {
ToastUtils.showShortToast(R.string.certification_not_pass);
}
mView.dumpBack();
}));
}
}
...@@ -23,12 +23,14 @@ public interface ProcessOrderContract { ...@@ -23,12 +23,14 @@ public interface ProcessOrderContract {
/** /**
* 初始化图片. * 初始化图片.
*
* @param list * @param list
*/ */
void initPhotoView(ArrayList<String> list); void initPhotoView(ArrayList<String> list);
/** /**
* 初始化费用承担证明图片. * 初始化费用承担证明图片.
*
* @param list * @param list
*/ */
void initPayerPhotoView(ArrayList<String> list); void initPayerPhotoView(ArrayList<String> list);
...@@ -59,7 +61,6 @@ public interface ProcessOrderContract { ...@@ -59,7 +61,6 @@ public interface ProcessOrderContract {
public abstract void getOrderInfo(int orderId); public abstract void getOrderInfo(int orderId);
/** /**
*
* @param imageUrl * @param imageUrl
* @param orderId * @param orderId
* @param editText * @param editText
...@@ -79,9 +80,9 @@ public interface ProcessOrderContract { ...@@ -79,9 +80,9 @@ public interface ProcessOrderContract {
public abstract void commitOrder(List<String> imageUrl, int orderId, String editText, int engineerId, public abstract void commitOrder(List<String> imageUrl, int orderId, String editText, int engineerId,
int isPay, String doorPrice, String doorPriceComment, int isPay, String doorPrice, String doorPriceComment,
String servicePrice, String materialCost, String otherPrice, String servicePrice, String materialCost, String otherPrice,
String brandName,String productModel,String sn,int repairType,List<String> picsCost); String brandName, String productModel, String sn, int repairType, List<String> picsCost);
public abstract void commitPhoto(List<String> imageUrl,List<String> payerUrl); public abstract void commitPhoto(List<String> imageUrl, List<String> payerUrl);
/** /**
* 保存订单. * 保存订单.
...@@ -107,6 +108,5 @@ public interface ProcessOrderContract { ...@@ -107,6 +108,5 @@ public interface ProcessOrderContract {
* 显示费用承担方. * 显示费用承担方.
*/ */
public abstract void showPayerDialog(); public abstract void showPayerDialog();
} }
} }
...@@ -2,6 +2,8 @@ package com.dayu.order.ui.activity; ...@@ -2,6 +2,8 @@ package com.dayu.order.ui.activity;
import android.content.Intent; import android.content.Intent;
import android.os.Environment; import android.os.Environment;
import android.text.Editable;
import android.text.TextUtils;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
...@@ -15,6 +17,7 @@ import com.bigkoo.pickerview.builder.OptionsPickerBuilder; ...@@ -15,6 +17,7 @@ import com.bigkoo.pickerview.builder.OptionsPickerBuilder;
import com.bigkoo.pickerview.view.OptionsPickerView; import com.bigkoo.pickerview.view.OptionsPickerView;
import com.dayu.base.ui.activity.BaseActivity; import com.dayu.base.ui.activity.BaseActivity;
import com.dayu.common.Constants; import com.dayu.common.Constants;
import com.dayu.common.MyTextWatcher;
import com.dayu.order.R; import com.dayu.order.R;
import com.dayu.order.databinding.ActivityMultipleProcessBinding; import com.dayu.order.databinding.ActivityMultipleProcessBinding;
import com.dayu.order.presenter.multipleprocess.MultipleProcessContract; import com.dayu.order.presenter.multipleprocess.MultipleProcessContract;
...@@ -23,7 +26,9 @@ import com.dayu.utils.GlideImageLoader; ...@@ -23,7 +26,9 @@ import com.dayu.utils.GlideImageLoader;
import com.dayu.utils.ToastUtils; import com.dayu.utils.ToastUtils;
import com.dayu.utils.UIUtils; import com.dayu.utils.UIUtils;
import com.dayu.utils.UtilsScreen; import com.dayu.utils.UtilsScreen;
import com.dayu.widgets.CustomDialog;
import com.dayu.widgets.SwitchImage; import com.dayu.widgets.SwitchImage;
import com.dayu.widgets.listener.OnCloseListener;
import com.luck.picture.lib.PictureSelectionModel; import com.luck.picture.lib.PictureSelectionModel;
import com.luck.picture.lib.PictureSelector; import com.luck.picture.lib.PictureSelector;
import com.luck.picture.lib.config.PictureConfig; import com.luck.picture.lib.config.PictureConfig;
...@@ -31,6 +36,7 @@ import com.luck.picture.lib.config.PictureMimeType; ...@@ -31,6 +36,7 @@ import com.luck.picture.lib.config.PictureMimeType;
import com.luck.picture.lib.entity.LocalMedia; import com.luck.picture.lib.entity.LocalMedia;
import java.io.File; import java.io.File;
import java.text.DecimalFormat;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
...@@ -63,6 +69,7 @@ public class MultipleProcessActivity extends BaseActivity<MultipleProcessPresent ...@@ -63,6 +69,7 @@ public class MultipleProcessActivity extends BaseActivity<MultipleProcessPresent
private boolean isShowSignature; private boolean isShowSignature;
private SwitchImage swtich; private SwitchImage swtich;
private boolean canPay; private boolean canPay;
private TextView mTotalMoney;
@Override @Override
public void setPresenter() { public void setPresenter() {
...@@ -105,6 +112,7 @@ public class MultipleProcessActivity extends BaseActivity<MultipleProcessPresent ...@@ -105,6 +112,7 @@ public class MultipleProcessActivity extends BaseActivity<MultipleProcessPresent
mServerPrice = view.findViewById(R.id.et_serve_price); mServerPrice = view.findViewById(R.id.et_serve_price);
mMaterialsPrice = view.findViewById(R.id.et_materials_price); mMaterialsPrice = view.findViewById(R.id.et_materials_price);
mOtherPrice = view.findViewById(R.id.et_other_price); mOtherPrice = view.findViewById(R.id.et_other_price);
mTotalMoney = view.findViewById(R.id.tv_total_money);
mDoorInfo = view.findViewById(R.id.et_door_info); mDoorInfo = view.findViewById(R.id.et_door_info);
mRepairType = view.findViewById(R.id.tv_payer); mRepairType = view.findViewById(R.id.tv_payer);
mArrow = view.findViewById(R.id.iv_payer); mArrow = view.findViewById(R.id.iv_payer);
...@@ -114,7 +122,7 @@ public class MultipleProcessActivity extends BaseActivity<MultipleProcessPresent ...@@ -114,7 +122,7 @@ public class MultipleProcessActivity extends BaseActivity<MultipleProcessPresent
mIcon = view.findViewById(R.id.tv_icon); mIcon = view.findViewById(R.id.tv_icon);
swtich.setOnClickListener(v -> { swtich.setOnClickListener(v -> {
if (true) { if (canPay) {
ToastUtils.showShortToast("您上次已经收取过客户费用,请勿重新收取!"); ToastUtils.showShortToast("您上次已经收取过客户费用,请勿重新收取!");
} else { } else {
if (swtich.getSwitchButton()) { if (swtich.getSwitchButton()) {
...@@ -146,12 +154,50 @@ public class MultipleProcessActivity extends BaseActivity<MultipleProcessPresent ...@@ -146,12 +154,50 @@ public class MultipleProcessActivity extends BaseActivity<MultipleProcessPresent
mArrow.setVisibility(View.GONE); mArrow.setVisibility(View.GONE);
mPayerNotice.setVisibility(View.GONE); mPayerNotice.setVisibility(View.GONE);
} }
mSignature.setOnClickListener(v -> { mSignature.setOnClickListener(v -> startActivityForReult(SignatureActivity.class, 100));
startActivityForReult(SignatureActivity.class, 100);
});
if (isShowSignature) { if (isShowSignature) {
mAllSignature.setVisibility(View.VISIBLE); mAllSignature.setVisibility(View.VISIBLE);
} }
initTotal();
}
private void initTotal() {
mDoorPrice.addTextChangedListener(new MyTextWatcher() {
@Override
public void afterTextChanged(Editable s) {
mTotalMoney.setText(getSum());
}
});
mServerPrice.addTextChangedListener(new MyTextWatcher() {
@Override
public void afterTextChanged(Editable s) {
mTotalMoney.setText(getSum());
}
});
mMaterialsPrice.addTextChangedListener(new MyTextWatcher() {
@Override
public void afterTextChanged(Editable s) {
mTotalMoney.setText(getSum());
}
});
mOtherPrice.addTextChangedListener(new MyTextWatcher() {
@Override
public void afterTextChanged(Editable s) {
mTotalMoney.setText(getSum());
}
});
}
public String getSum() {
return new DecimalFormat("0.00").format(parseDb(mDoorPrice.getText().toString()) + parseDb(mServerPrice.getText().toString()) + parseDb(mMaterialsPrice.getText().toString()) + parseDb(mOtherPrice.getText().toString()));
}
public Double parseDb(String str) {
if (TextUtils.isEmpty(str)) {
return 0.0;
} else {
return Double.parseDouble(str);
}
} }
@Override @Override
...@@ -298,6 +344,32 @@ public class MultipleProcessActivity extends BaseActivity<MultipleProcessPresent ...@@ -298,6 +344,32 @@ public class MultipleProcessActivity extends BaseActivity<MultipleProcessPresent
} }
@Override @Override
public void showNoPayerDialog() {
CustomDialog customDialog = new CustomDialog(mActivity, R.style.CustomDialog, getString(R.string.payer_dialog_content)
, (dialog, confirm) -> dialog.dismiss());
customDialog.setTitle(getString(R.string.payer_dialog_title))
.setPositiveButton(getString(R.string.comfirm))
.setOneButton(true);
customDialog.show();
}
@Override
public boolean getSelectPayer() {
return TextUtils.isEmpty(mRepairType.getText().toString());
}
@Override
public void showSelectPayerDialog(OnCloseListener listener) {
CustomDialog customDialog = new CustomDialog(mActivity, R.style.CustomDialog, getString(R.string.payer_select_content)
, listener);
customDialog.setTitle(getString(R.string.payer_select_title))
.setNegativeButton(getString(R.string.cancle))
.setPositiveButton(getString(R.string.submit))
.setPositiveButtonColor(UIUtils.getColor(R.color.common_red));
customDialog.show();
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) { protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data); super.onActivityResult(requestCode, resultCode, data);
if (resultCode == RESULT_OK) { if (resultCode == RESULT_OK) {
......
...@@ -2,6 +2,8 @@ package com.dayu.order.ui.activity; ...@@ -2,6 +2,8 @@ package com.dayu.order.ui.activity;
import android.content.Intent; import android.content.Intent;
import android.os.Environment; import android.os.Environment;
import android.text.Editable;
import android.text.TextUtils;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
...@@ -14,6 +16,7 @@ import com.bigkoo.pickerview.listener.OnOptionsSelectListener; ...@@ -14,6 +16,7 @@ import com.bigkoo.pickerview.listener.OnOptionsSelectListener;
import com.bigkoo.pickerview.view.OptionsPickerView; import com.bigkoo.pickerview.view.OptionsPickerView;
import com.dayu.base.ui.activity.BaseActivity; import com.dayu.base.ui.activity.BaseActivity;
import com.dayu.common.Constants; import com.dayu.common.Constants;
import com.dayu.common.MyTextWatcher;
import com.dayu.order.R; import com.dayu.order.R;
import com.dayu.order.databinding.ActivityProcessOrderBinding; import com.dayu.order.databinding.ActivityProcessOrderBinding;
import com.dayu.order.presenter.processorder.ProcessOrderContract; import com.dayu.order.presenter.processorder.ProcessOrderContract;
...@@ -32,6 +35,7 @@ import com.luck.picture.lib.entity.LocalMedia; ...@@ -32,6 +35,7 @@ import com.luck.picture.lib.entity.LocalMedia;
import com.umeng.analytics.MobclickAgent; import com.umeng.analytics.MobclickAgent;
import java.io.File; import java.io.File;
import java.text.DecimalFormat;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
...@@ -80,6 +84,46 @@ public class ProcessOrderActivity extends BaseActivity<ProcessOrderPresenter, Ac ...@@ -80,6 +84,46 @@ public class ProcessOrderActivity extends BaseActivity<ProcessOrderPresenter, Ac
mBind.ivDelete.setVisibility(View.GONE); mBind.ivDelete.setVisibility(View.GONE);
mSnImages.clear(); mSnImages.clear();
}); });
initTotal();
}
private void initTotal() {
mBind.etDoorPrice.addTextChangedListener(new MyTextWatcher() {
@Override
public void afterTextChanged(Editable s) {
mBind.tvTotalMoney.setText(getSum());
}
});
mBind.etServePrice.addTextChangedListener(new MyTextWatcher() {
@Override
public void afterTextChanged(Editable s) {
mBind.tvTotalMoney.setText(getSum());
}
});
mBind.etMaterialsPrice.addTextChangedListener(new MyTextWatcher() {
@Override
public void afterTextChanged(Editable s) {
mBind.tvTotalMoney.setText(getSum());
}
});
mBind.etOtherPrice.addTextChangedListener(new MyTextWatcher() {
@Override
public void afterTextChanged(Editable s) {
mBind.tvTotalMoney.setText(getSum());
}
});
}
public String getSum() {
return new DecimalFormat("0.00").format(parseDb(mBind.etDoorPrice.getText().toString()) + parseDb(mBind.etServePrice.getText().toString()) + parseDb(mBind.etMaterialsPrice.getText().toString()) + parseDb(mBind.etOtherPrice.getText().toString()));
}
public Double parseDb(String str) {
if (TextUtils.isEmpty(str)) {
return 0.0;
} else {
return Double.parseDouble(str);
}
} }
@Override @Override
...@@ -206,8 +250,10 @@ public class ProcessOrderActivity extends BaseActivity<ProcessOrderPresenter, Ac ...@@ -206,8 +250,10 @@ public class ProcessOrderActivity extends BaseActivity<ProcessOrderPresenter, Ac
info.setProductModel(mBind.etVersion.getText().toString()); info.setProductModel(mBind.etVersion.getText().toString());
info.setSn(mBind.etSerialNum.getText().toString()); info.setSn(mBind.etSerialNum.getText().toString());
mPresenter.mOrderField.set(info); mPresenter.mOrderField.set(info);
} }
private void dumpPic(ArrayList<String> list) { private void dumpPic(ArrayList<String> list) {
Intent intent = new Intent(this, PreviewActivty.class); Intent intent = new Intent(this, PreviewActivty.class);
intent.putStringArrayListExtra(Constants.BUNDLE_KEY_ID, list); intent.putStringArrayListExtra(Constants.BUNDLE_KEY_ID, list);
......
package com.dayu.order.ui.activity; package com.dayu.order.ui.activity;
import android.os.Bundle;
import com.alibaba.android.arouter.launcher.ARouter;
import com.dayu.base.ui.activity.DataBindingActivity; import com.dayu.base.ui.activity.DataBindingActivity;
import com.dayu.common.Constants;
import com.dayu.order.R; import com.dayu.order.R;
import com.dayu.order.databinding.QrCodeLayoutBinding; import com.dayu.order.databinding.QrCodeLayoutBinding;
import com.dayu.provider.event.RefreshServe;
import com.dayu.provider.router.RouterPath;
import org.greenrobot.eventbus.EventBus;
/** /**
* Created by luofan * Created by luofan
...@@ -17,6 +25,15 @@ public class QrCodeActivity extends DataBindingActivity<QrCodeLayoutBinding> { ...@@ -17,6 +25,15 @@ public class QrCodeActivity extends DataBindingActivity<QrCodeLayoutBinding> {
@Override @Override
public void initView() { public void initView() {
mBind.titleBack.setOnClickListener(v -> finish()); Bundle bundle = getIntent().getBundleExtra(Constants.BUNDLE);
int type = bundle.getInt(Constants.TYPE, 0);
mBind.titleBack.setOnClickListener(v -> {
if (type == 0) {
finish();
} else {
ARouter.getInstance().build(RouterPath.PATH_MAIN).navigation();
EventBus.getDefault().post(new RefreshServe(1));
}
});
} }
} }
...@@ -24,6 +24,7 @@ import com.dayu.order.ui.activity.SubcribeTimeActivity; ...@@ -24,6 +24,7 @@ import com.dayu.order.ui.activity.SubcribeTimeActivity;
import com.dayu.provider.event.RefreshServe; import com.dayu.provider.event.RefreshServe;
import com.dayu.provider.event.RefreshTab; import com.dayu.provider.event.RefreshTab;
import com.dayu.utils.ProgressUtil; import com.dayu.utils.ProgressUtil;
import com.dayu.utils.SPUtils;
import com.dayu.utils.UIUtils; import com.dayu.utils.UIUtils;
import com.dayu.utils.UtilsDate; import com.dayu.utils.UtilsDate;
import com.umeng.analytics.MobclickAgent; import com.umeng.analytics.MobclickAgent;
...@@ -269,7 +270,7 @@ public class OrderAdapter extends CoreAdapter<Order, FragmentOrderdoingItemBindi ...@@ -269,7 +270,7 @@ public class OrderAdapter extends CoreAdapter<Order, FragmentOrderdoingItemBindi
mItem = it; mItem = it;
mBind = h; mBind = h;
if ((mItem.getCreatedSource() == 2 || mItem.getCreatedSource() == 3 || mItem.getCreatedSource() == 4) && mItem.getStatus() == 4) { if ((mItem.getCreatedSource() == 2 || mItem.getCreatedSource() == 3 || mItem.getCreatedSource() == 4) && mItem.getStatus() == 4) {
dumpServerActivity(mItem, posiiton); dumpServerActivity(mItem);
} else if (mItem.getStatus() == 4 && mItem.getSubStatus() == 3) { } else if (mItem.getStatus() == 4 && mItem.getSubStatus() == 3) {
dumpProcessActivity(mItem, posiiton); dumpProcessActivity(mItem, posiiton);
} else if (mItem.getStatus() == 4 && mItem.getSubStatus() == 4) { } else if (mItem.getStatus() == 4 && mItem.getSubStatus() == 4) {
...@@ -354,9 +355,13 @@ public class OrderAdapter extends CoreAdapter<Order, FragmentOrderdoingItemBindi ...@@ -354,9 +355,13 @@ public class OrderAdapter extends CoreAdapter<Order, FragmentOrderdoingItemBindi
MobclickAgent.onEvent(mContext, "process_order"); MobclickAgent.onEvent(mContext, "process_order");
} }
private void dumpServerActivity(Order order, int adapterPosition) { private void dumpServerActivity(Order order) {
Intent intent; Intent intent;
Bundle bundle = new Bundle(); Bundle bundle = new Bundle();
boolean flag = (boolean) SPUtils.get(Constants.ORDER_ID + order.getId(), false);
if (!flag && order.getFaceSwitch() != null && order.getFaceSwitch() == 1) {
mPresenter.dumpToFaceCert(order);
} else {
if (order.getSpus().size() > 1) { if (order.getSpus().size() > 1) {
intent = new Intent(mContext, ServerInfoActivity.class); intent = new Intent(mContext, ServerInfoActivity.class);
bundle.putInt(Constants.ID, order.getId()); bundle.putInt(Constants.ID, order.getId());
...@@ -372,6 +377,7 @@ public class OrderAdapter extends CoreAdapter<Order, FragmentOrderdoingItemBindi ...@@ -372,6 +377,7 @@ public class OrderAdapter extends CoreAdapter<Order, FragmentOrderdoingItemBindi
intent.putExtra(Constants.BUNDLE, bundle); intent.putExtra(Constants.BUNDLE, bundle);
mContext.startActivity(intent); mContext.startActivity(intent);
} }
}
private void dumpSOPActivity(int id, int adapterPosition) { private void dumpSOPActivity(int id, int adapterPosition) {
Intent intent = new Intent(mContext, SopWebViewActivity.class); Intent intent = new Intent(mContext, SopWebViewActivity.class);
......
...@@ -74,5 +74,8 @@ ...@@ -74,5 +74,8 @@
<activity <activity
android:name=".ui.activity.SignatureActivity" android:name=".ui.activity.SignatureActivity"
android:screenOrientation="landscape" /> android:screenOrientation="landscape" />
<activity
android:name=".ui.activity.OrderLivenessActivity"
android:screenOrientation="portrait" />
</application> </application>
</manifest> </manifest>
...@@ -676,6 +676,7 @@ ...@@ -676,6 +676,7 @@
android:textSize="@dimen/sp_13.3" /> android:textSize="@dimen/sp_13.3" />
<TextView <TextView
android:id="@+id/test"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentRight="true" android:layout_alignParentRight="true"
...@@ -691,42 +692,24 @@ ...@@ -691,42 +692,24 @@
style="@style/line" style="@style/line"
android:layout_below="@id/up_other" /> android:layout_below="@id/up_other" />
<EditText
android:id="@+id/et_door_info"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_163"
android:layout_below="@id/up_other"
android:layout_centerHorizontal="true"
android:layout_marginLeft="@dimen/dp_13.3"
android:layout_marginRight="@dimen/dp_13.3"
android:layout_marginTop="@dimen/dp_17"
android:background="@drawable/subscribe_time_shape"
android:gravity="top"
android:hint="@string/tv_order_other"
android:paddingTop="@dimen/dp_11"
android:text="@{presenter.mOrderField.otherInfo}"
android:textColor="@color/cl_home_title_text_color"
android:textColorHint="@color/cl_selector_hui"
android:textSize="@dimen/sp_13.3" />
</RelativeLayout>
<RelativeLayout <RelativeLayout
android:id="@+id/ll_all_money" android:id="@+id/ll_all_money"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_below="@+id/rl_pay" android:layout_below="@+id/image_two_four_lin"
android:layout_marginLeft="@dimen/dp_13.3" android:layout_marginLeft="@dimen/dp_13.3"
android:layout_marginRight="@dimen/dp_13.3" android:layout_marginRight="@dimen/dp_13.3"
android:layout_marginTop="15.7dp" android:layout_marginTop="15.7dp"
android:orientation="horizontal" android:layout_marginBottom="15dp"
android:visibility="gone"> android:orientation="horizontal">
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentRight="true" android:layout_alignParentLeft="true"
android:text="总金额" android:text="总金额"
android:textStyle="bold" /> android:textColor="@color/cl_tab_line"
android:textSize="@dimen/sp_13.3" />
<TextView <TextView
android:id="@+id/tv_total_money" android:id="@+id/tv_total_money"
...@@ -734,14 +717,40 @@ ...@@ -734,14 +717,40 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_centerInParent="true" android:layout_centerInParent="true"
android:layout_gravity="center" android:layout_gravity="center"
android:textStyle="bold" /> android:textColor="@color/cl_home_title_text_color"
android:textSize="@dimen/sp_13.3" />
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentLeft="true" android:layout_alignParentRight="true"
android:text="元" android:text="@string/tv_order_yuan"
android:textStyle="bold" /> android:textColor="@color/cl_tab_line"
android:textSize="@dimen/sp_13.3" />
</RelativeLayout>
<ImageView
android:id="@+id/iv_line_total"
style="@style/line"
android:layout_below="@id/ll_all_money" />
<EditText
android:id="@+id/et_door_info"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_163"
android:layout_below="@id/iv_line_total"
android:layout_centerHorizontal="true"
android:layout_marginLeft="@dimen/dp_13.3"
android:layout_marginRight="@dimen/dp_13.3"
android:layout_marginTop="@dimen/dp_17"
android:background="@drawable/subscribe_time_shape"
android:gravity="top"
android:hint="@string/tv_order_other"
android:paddingTop="@dimen/dp_11"
android:text="@{presenter.mOrderField.otherInfo}"
android:textColor="@color/cl_home_title_text_color"
android:textColorHint="@color/cl_selector_hui"
android:textSize="@dimen/sp_13.3" />
</RelativeLayout> </RelativeLayout>
<Button <Button
...@@ -749,7 +758,7 @@ ...@@ -749,7 +758,7 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentLeft="true" android:layout_alignParentLeft="true"
android:layout_below="@id/ll_all_money" android:layout_below="@id/rl_pay"
android:layout_marginLeft="@dimen/dp_14" android:layout_marginLeft="@dimen/dp_14"
android:layout_marginTop="@dimen/dp_33" android:layout_marginTop="@dimen/dp_33"
android:background="@drawable/save_back" android:background="@drawable/save_back"
...@@ -763,7 +772,7 @@ ...@@ -763,7 +772,7 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentRight="true" android:layout_alignParentRight="true"
android:layout_below="@id/ll_all_money" android:layout_below="@id/rl_pay"
android:layout_marginRight="@dimen/dp_16" android:layout_marginRight="@dimen/dp_16"
android:layout_marginTop="@dimen/dp_33" android:layout_marginTop="@dimen/dp_33"
android:background="@drawable/save_submit" android:background="@drawable/save_submit"
......
...@@ -126,15 +126,6 @@ ...@@ -126,15 +126,6 @@
android:orientation="horizontal" /> android:orientation="horizontal" />
</LinearLayout> </LinearLayout>
<TextView
android:layout_width="match_parent"
android:layout_height="43dp"
android:paddingLeft="@dimen/dp_15"
android:paddingTop="@dimen/dp_17"
android:text="收取费用"
android:textColor="@color/tv_cl"
android:textSize="14sp" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="51dp" android:layout_height="51dp"
...@@ -250,6 +241,19 @@ ...@@ -250,6 +241,19 @@
android:text="@string/tv_order_yuan" android:text="@string/tv_order_yuan"
android:textColor="@color/cl_tab_line" android:textColor="@color/cl_tab_line"
android:textSize="@dimen/sp_13.3" /> android:textSize="@dimen/sp_13.3" />
<TextView
android:layout_width="match_parent"
android:layout_height="43dp"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_marginBottom="104dp"
android:paddingLeft="@dimen/dp_15"
android:paddingTop="@dimen/dp_17"
android:text="收取费用"
android:textColor="@color/tv_cl"
android:textSize="14sp" />
</RelativeLayout> </RelativeLayout>
<ImageView <ImageView
...@@ -345,11 +349,53 @@ ...@@ -345,11 +349,53 @@
style="@style/line" style="@style/line"
android:layout_below="@id/up_other" /> android:layout_below="@id/up_other" />
<RelativeLayout
android:id="@+id/ll_all_money"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/image_two_four_lin"
android:layout_marginBottom="15dp"
android:layout_marginLeft="@dimen/dp_13.3"
android:layout_marginRight="@dimen/dp_13.3"
android:layout_marginTop="15.7dp"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:text="总金额"
android:textColor="@color/cl_tab_line"
android:textSize="@dimen/sp_13.3" />
<TextView
android:id="@+id/tv_total_money"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:layout_gravity="center"
android:textColor="@color/cl_home_title_text_color"
android:textSize="@dimen/sp_13.3" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:text="@string/tv_order_yuan"
android:textColor="@color/cl_tab_line"
android:textSize="@dimen/sp_13.3" />
</RelativeLayout>
<ImageView
android:id="@+id/iv_line_total"
style="@style/line"
android:layout_below="@id/ll_all_money" />
<EditText <EditText
android:id="@+id/et_door_info" android:id="@+id/et_door_info"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/dp_163" android:layout_height="@dimen/dp_163"
android:layout_below="@id/up_other" android:layout_below="@id/iv_line_total"
android:layout_centerHorizontal="true" android:layout_centerHorizontal="true"
android:layout_marginLeft="@dimen/dp_13.3" android:layout_marginLeft="@dimen/dp_13.3"
android:layout_marginRight="@dimen/dp_13.3" android:layout_marginRight="@dimen/dp_13.3"
......
...@@ -25,13 +25,13 @@ ...@@ -25,13 +25,13 @@
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:gravity="center" android:gravity="center_horizontal"
android:orientation="vertical"> android:orientation="vertical">
<ImageView <ImageView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center" android:layout_marginTop="100dp"
android:src="@drawable/icon_appointment_code" /> android:src="@drawable/icon_appointment_code" />
<TextView <TextView
...@@ -42,6 +42,14 @@ ...@@ -42,6 +42,14 @@
android:text="@string/scan_code_for_appointment" android:text="@string/scan_code_for_appointment"
android:textSize="14sp" /> android:textSize="14sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="@dimen/dp_15"
android:text="@string/scan_code_for_appointment_two"
android:textSize="14sp" />
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
</layout> </layout>
\ No newline at end of file
...@@ -20,4 +20,8 @@ public class RouterPath { ...@@ -20,4 +20,8 @@ public class RouterPath {
public final static String PATH_ORDER_HISTORY = "/order/history"; public final static String PATH_ORDER_HISTORY = "/order/history";
/**
* 用户模块.
*/
public final static String PATH_USER_FACE = "/user/face";
} }
...@@ -62,5 +62,4 @@ dependencies { ...@@ -62,5 +62,4 @@ dependencies {
annotationProcessor "com.alibaba:arouter-compiler:$arouter_compiler_version" annotationProcessor "com.alibaba:arouter-compiler:$arouter_compiler_version"
compile project(':provider') compile project(':provider')
compile project(':IDCardLib') compile project(':IDCardLib')
// compile project(':livenesslib')
} }
...@@ -60,5 +60,7 @@ public interface LoginContract { ...@@ -60,5 +60,7 @@ public interface LoginContract {
*/ */
public abstract void dumpAndSave(UserInfo info); public abstract void dumpAndSave(UserInfo info);
public abstract void getUserInfo(int accountId);
} }
} }
...@@ -9,9 +9,11 @@ import com.dayu.event.UserInfo; ...@@ -9,9 +9,11 @@ import com.dayu.event.UserInfo;
import com.dayu.provider.router.RouterPath; import com.dayu.provider.router.RouterPath;
import com.dayu.usercenter.R; import com.dayu.usercenter.R;
import com.dayu.usercenter.api.UserApiFactory; import com.dayu.usercenter.api.UserApiFactory;
import com.dayu.usercenter.data.protocol.EngineerInfo;
import com.dayu.usercenter.ui.activity.AgreementActivity; import com.dayu.usercenter.ui.activity.AgreementActivity;
import com.dayu.usercenter.ui.activity.IdentityCertificationActivity; import com.dayu.usercenter.ui.activity.IdentityCertificationActivity;
import com.dayu.utils.LogUtils; import com.dayu.utils.LogUtils;
import com.dayu.utils.SPUtils;
import com.dayu.utils.ToastUtils; import com.dayu.utils.ToastUtils;
import com.dayu.utils.UIUtils; import com.dayu.utils.UIUtils;
import com.dayu.utils.UserManager; import com.dayu.utils.UserManager;
...@@ -20,6 +22,8 @@ import com.hyphenate.EMCallBack; ...@@ -20,6 +22,8 @@ import com.hyphenate.EMCallBack;
import com.hyphenate.chat.EMClient; import com.hyphenate.chat.EMClient;
import com.umeng.analytics.MobclickAgent; import com.umeng.analytics.MobclickAgent;
import io.reactivex.functions.Consumer;
/** /**
* Created by luofan * Created by luofan
* on 2017/11/8. * on 2017/11/8.
...@@ -72,6 +76,7 @@ public class LoginPresenter extends LoginContract.Presenter { ...@@ -72,6 +76,7 @@ public class LoginPresenter extends LoginContract.Presenter {
UserApiFactory.login(userName.get(), password.get()).subscribe(baseObserver(userInfo -> { UserApiFactory.login(userName.get(), password.get()).subscribe(baseObserver(userInfo -> {
if (userInfo.getDetectStatus() == 1) { if (userInfo.getDetectStatus() == 1) {
loginHx(userInfo.getHxAccount(), userInfo.getHxPwd()); loginHx(userInfo.getHxAccount(), userInfo.getHxPwd());
getUserInfo(Integer.parseInt(userInfo.getAccountId()));
dumpAndSave(userInfo); dumpAndSave(userInfo);
} }
// else if (userInfo.getDetectStatus() == 2) { // else if (userInfo.getDetectStatus() == 2) {
...@@ -125,6 +130,16 @@ public class LoginPresenter extends LoginContract.Presenter { ...@@ -125,6 +130,16 @@ public class LoginPresenter extends LoginContract.Presenter {
} }
@Override @Override
public void getUserInfo(int accountId) {
UserApiFactory.getEngineerInfo(accountId).subscribe(baseObserver(new Consumer<EngineerInfo>() {
@Override
public void accept(EngineerInfo engineerInfo) throws Exception {
SPUtils.put("USER_IDENTITY", engineerInfo.getIdentity());
}
}));
}
@Override
public void dumpAgreement() { public void dumpAgreement() {
mView.startActivity(AgreementActivity.class); mView.startActivity(AgreementActivity.class);
MobclickAgent.onEvent(BaseApplication.getContext(), "customer_agreement"); MobclickAgent.onEvent(BaseApplication.getContext(), "customer_agreement");
......
...@@ -7,8 +7,10 @@ import android.os.Bundle; ...@@ -7,8 +7,10 @@ import android.os.Bundle;
import android.support.v4.app.ActivityCompat; import android.support.v4.app.ActivityCompat;
import android.support.v4.content.ContextCompat; import android.support.v4.content.ContextCompat;
import com.alibaba.android.arouter.facade.annotation.Route;
import com.dayu.base.ui.activity.BaseActivity; import com.dayu.base.ui.activity.BaseActivity;
import com.dayu.common.Constants; import com.dayu.common.Constants;
import com.dayu.provider.router.RouterPath;
import com.dayu.usercenter.R; import com.dayu.usercenter.R;
import com.dayu.usercenter.common.UserConstant; import com.dayu.usercenter.common.UserConstant;
import com.dayu.usercenter.databinding.ActivityFaceCertificationBinding; import com.dayu.usercenter.databinding.ActivityFaceCertificationBinding;
...@@ -33,7 +35,7 @@ import static android.os.Build.VERSION_CODES.M; ...@@ -33,7 +35,7 @@ import static android.os.Build.VERSION_CODES.M;
* Created by luofan * Created by luofan
* on 2018/5/10. * on 2018/5/10.
*/ */
@Route(path = RouterPath.PATH_USER_FACE)
public class FaceCertificationActivity extends BaseActivity<FaceCertificaitonPresenter, ActivityFaceCertificationBinding> public class FaceCertificationActivity extends BaseActivity<FaceCertificaitonPresenter, ActivityFaceCertificationBinding>
implements FaceCertificaitonContract.View { implements FaceCertificaitonContract.View {
private String uuid; private String uuid;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment