Browse Source

1.岗位详情增加确认弹窗

zhangxinyu 5 years ago
parent
commit
b6ecda1366

+ 0 - 3
app/src/main/java/com/tongyu/luck/happywork/ui/base/BaseActivity.java

@@ -16,10 +16,7 @@ import com.tongyu.luck.happywork.baselibrary.EventConstant;
 import com.tongyu.luck.happywork.baselibrary.IntentConstant;
 import com.tongyu.luck.happywork.callback.OnActionBarMenuClickListener;
 import com.tongyu.luck.happywork.event.BaseEvent;
-import com.tongyu.luck.happywork.event.StringEvent;
-import com.tongyu.luck.happywork.ui.activity.LoginActivity;
 import com.tongyu.luck.happywork.ui.activity.cclient.CMainActivity;
-import com.tongyu.luck.happywork.ui.widget.dialog.ProgressDialog;
 import com.tongyu.luck.happywork.ui.widget.dialog.SureDialog;
 import com.trello.rxlifecycle2.components.support.RxAppCompatActivity;
 

+ 18 - 10
app/src/main/java/com/tongyu/luck/happywork/ui/mvp/cclient/presenter/AssembleJobDetailPresenter.java

@@ -22,6 +22,7 @@ import com.tongyu.luck.happywork.ui.activity.cclient.job.ShuttleBusLineActivity;
 import com.tongyu.luck.happywork.ui.base.BasePresenter;
 import com.tongyu.luck.happywork.ui.mvp.cclient.contacts.AssembleJobDetailContacts;
 import com.tongyu.luck.happywork.ui.mvp.cclient.model.AssembleJobDetailModel;
+import com.tongyu.luck.happywork.ui.widget.dialog.SureDialog;
 
 import java.util.ArrayList;
 import java.util.List;
@@ -119,18 +120,25 @@ public class AssembleJobDetailPresenter extends BasePresenter<AssembleJobDetailA
                 return;
             }
             if (AppCacheManager.getInstance().getResumeModel() != null && AppCacheManager.getInstance().getResumeModel().isBaseInformation()) {
-                mAssembleJobDetailModel.uploadSaveApply(new MvpDataCallBack<Boolean>() {
+                new SureDialog(mvpReference.get()).initData(R.string.toast_assemble_job_request, R.string.cancel, R.string.sure, new SureDialog.OnClickSureListener() {
                     @Override
-                    public void onData(Boolean data) {
-                        if (isViewAttach()) {
-                            if (data) {
-                                mvpReference.get().onApply(mAssembleJobDetailModel.isApply());
-                                toRequest(null);
-                            } else
-                                mvpReference.get().onInitResume();
-                        }
+                    public void onClick(boolean isSure) {
+                        if (isSure)
+                            mAssembleJobDetailModel.uploadSaveApply(new MvpDataCallBack<Boolean>() {
+                                @Override
+                                public void onData(Boolean data) {
+                                    if (isViewAttach()) {
+                                        if (data) {
+                                            mvpReference.get().onApply(mAssembleJobDetailModel.isApply());
+                                            toRequest(null);
+                                        } else
+                                            mvpReference.get().onInitResume();
+                                    }
+                                }
+                            });
                     }
-                });
+                }).show();
+                ;
             } else {//完善个人简历
                 mvpReference.get().onInitResume();
             }

+ 16 - 9
app/src/main/java/com/tongyu/luck/happywork/ui/mvp/cclient/presenter/AssembleJobRequestPresenter.java

@@ -21,6 +21,7 @@ import com.tongyu.luck.happywork.ui.activity.cclient.job.GenerateSharePicturesAc
 import com.tongyu.luck.happywork.ui.base.BasePresenter;
 import com.tongyu.luck.happywork.ui.mvp.cclient.contacts.AssembleJobRequestContacts;
 import com.tongyu.luck.happywork.ui.mvp.cclient.model.AssembleJobRequestModel;
+import com.tongyu.luck.happywork.ui.widget.dialog.SureDialog;
 import com.tongyu.luck.happywork.utils.BitmapUtils;
 import com.tongyu.luck.happywork.utils.FileUtils;
 import com.tongyu.luck.happywork.wxapi.WXUtils;
@@ -95,17 +96,23 @@ public class AssembleJobRequestPresenter extends BasePresenter<AssembleJobReques
                 return;
             }
             if (AppCacheManager.getInstance().getResumeModel() != null && AppCacheManager.getInstance().getResumeModel().isBaseInformation()) {
-                mAssembleJobRequestModel.uploadSaveApply(new MvpDataCallBack<Boolean>() {
+                new SureDialog(mvpReference.get()).initData(R.string.toast_assemble_job_join, R.string.cancel, R.string.sure, new SureDialog.OnClickSureListener() {
                     @Override
-                    public void onData(Boolean data) {
-                        if (isViewAttach()) {
-                            if (data)
-                                initData(true);//重新拉取拼团信息
-                            else
-                                mvpReference.get().onInitResume();
-                        }
+                    public void onClick(boolean isSure) {
+                        if (isSure)
+                            mAssembleJobRequestModel.uploadSaveApply(new MvpDataCallBack<Boolean>() {
+                                @Override
+                                public void onData(Boolean data) {
+                                    if (isViewAttach()) {
+                                        if (data)
+                                            initData(true);//重新拉取拼团信息
+                                        else
+                                            mvpReference.get().onInitResume();
+                                    }
+                                }
+                            });
                     }
-                });
+                }).show();
             } else {//完善个人简历
                 mvpReference.get().onInitResume();
             }

+ 17 - 9
app/src/main/java/com/tongyu/luck/happywork/ui/mvp/cclient/presenter/FullJobDetailPresenter.java

@@ -4,6 +4,7 @@ import android.content.Intent;
 import android.text.TextUtils;
 
 import com.tongyu.luck.happywork.AppCacheManager;
+import com.tongyu.luck.happywork.R;
 import com.tongyu.luck.happywork.baselibrary.IntentConstant;
 import com.tongyu.luck.happywork.bean.FullPositionBean;
 import com.tongyu.luck.happywork.bean.PositionAddressBean;
@@ -16,6 +17,7 @@ import com.tongyu.luck.happywork.ui.activity.cclient.job.ShuttleBusLineActivity;
 import com.tongyu.luck.happywork.ui.base.BasePresenter;
 import com.tongyu.luck.happywork.ui.mvp.cclient.contacts.FullJobDetailContacts;
 import com.tongyu.luck.happywork.ui.mvp.cclient.model.FullJobDetailModel;
+import com.tongyu.luck.happywork.ui.widget.dialog.SureDialog;
 
 import java.util.ArrayList;
 
@@ -106,17 +108,23 @@ public class FullJobDetailPresenter extends BasePresenter<FullJobDetailActivity>
                 return;
             }
             if (AppCacheManager.getInstance().getResumeModel() != null && AppCacheManager.getInstance().getResumeModel().isBaseInformation()) {
-                mFullJobDetailModel.uploadSaveApply(new MvpDataCallBack<Boolean>() {
+                new SureDialog(mvpReference.get()).initData(R.string.toast_job_request, R.string.cancel, R.string.sure, new SureDialog.OnClickSureListener() {
                     @Override
-                    public void onData(Boolean data) {
-                        if (isViewAttach()) {
-                            if (data)
-                                mvpReference.get().onApply(mFullJobDetailModel.isApply());
-                            else
-                                mvpReference.get().onInitResume();
-                        }
+                    public void onClick(boolean isSure) {
+                        if (isSure)
+                            mFullJobDetailModel.uploadSaveApply(new MvpDataCallBack<Boolean>() {
+                                @Override
+                                public void onData(Boolean data) {
+                                    if (isViewAttach()) {
+                                        if (data)
+                                            mvpReference.get().onApply(mFullJobDetailModel.isApply());
+                                        else
+                                            mvpReference.get().onInitResume();
+                                    }
+                                }
+                            });
                     }
-                });
+                }).show();
             } else {//完善个人简历
                 mvpReference.get().onInitResume();
             }

+ 17 - 9
app/src/main/java/com/tongyu/luck/happywork/ui/mvp/cclient/presenter/PartJobDetailPresenter.java

@@ -4,6 +4,7 @@ import android.content.Intent;
 import android.text.TextUtils;
 
 import com.tongyu.luck.happywork.AppCacheManager;
+import com.tongyu.luck.happywork.R;
 import com.tongyu.luck.happywork.baselibrary.IntentConstant;
 import com.tongyu.luck.happywork.bean.PartPositionBean;
 import com.tongyu.luck.happywork.bean.PositionAddressBean;
@@ -15,6 +16,7 @@ import com.tongyu.luck.happywork.ui.activity.cclient.job.PartJobDetailActivity;
 import com.tongyu.luck.happywork.ui.base.BasePresenter;
 import com.tongyu.luck.happywork.ui.mvp.cclient.contacts.PartJobDetailContacts;
 import com.tongyu.luck.happywork.ui.mvp.cclient.model.PartJobDetailModel;
+import com.tongyu.luck.happywork.ui.widget.dialog.SureDialog;
 
 import java.util.ArrayList;
 
@@ -93,17 +95,23 @@ public class PartJobDetailPresenter extends BasePresenter<PartJobDetailActivity>
                 return;
             }
             if (AppCacheManager.getInstance().getResumeModel() != null && AppCacheManager.getInstance().getResumeModel().isBaseInformation()) {
-                mPartJobDetailModel.uploadSaveApply(new MvpDataCallBack<Boolean>() {
+                new SureDialog(mvpReference.get()).initData(R.string.toast_job_request, R.string.cancel, R.string.sure, new SureDialog.OnClickSureListener() {
                     @Override
-                    public void onData(Boolean data) {
-                        if (isViewAttach()) {
-                            if (data)
-                                mvpReference.get().onApply(mPartJobDetailModel.isApply());
-                            else
-                                mvpReference.get().onInitResume();
-                        }
+                    public void onClick(boolean isSure) {
+                        if (isSure)
+                            mPartJobDetailModel.uploadSaveApply(new MvpDataCallBack<Boolean>() {
+                                @Override
+                                public void onData(Boolean data) {
+                                    if (isViewAttach()) {
+                                        if (data)
+                                            mvpReference.get().onApply(mPartJobDetailModel.isApply());
+                                        else
+                                            mvpReference.get().onInitResume();
+                                    }
+                                }
+                            });
                     }
-                });
+                }).show();
             } else {//完善个人简历
                 mvpReference.get().onInitResume();
             }

+ 17 - 9
app/src/main/java/com/tongyu/luck/happywork/ui/mvp/cclient/presenter/WelfareJobDetailPresenter.java

@@ -1,6 +1,7 @@
 package com.tongyu.luck.happywork.ui.mvp.cclient.presenter;
 
 import com.tongyu.luck.happywork.AppCacheManager;
+import com.tongyu.luck.happywork.R;
 import com.tongyu.luck.happywork.bean.WelfarePositionBean;
 import com.tongyu.luck.happywork.callback.MvpDataCallBack;
 import com.tongyu.luck.happywork.http.exception.ApiException;
@@ -8,6 +9,7 @@ import com.tongyu.luck.happywork.ui.activity.cclient.job.WelfareJobDetailActivit
 import com.tongyu.luck.happywork.ui.base.BasePresenter;
 import com.tongyu.luck.happywork.ui.mvp.cclient.contacts.WelfareJobDetailContacts;
 import com.tongyu.luck.happywork.ui.mvp.cclient.model.WelfareJobDetailModel;
+import com.tongyu.luck.happywork.ui.widget.dialog.SureDialog;
 
 public class WelfareJobDetailPresenter extends BasePresenter<WelfareJobDetailActivity> implements WelfareJobDetailContacts.IWelfareJobDetailPresenter {
     private WelfareJobDetailModel mWelfareJobDetailModel;
@@ -53,17 +55,23 @@ public class WelfareJobDetailPresenter extends BasePresenter<WelfareJobDetailAct
                 return;
             }
             if (AppCacheManager.getInstance().getResumeModel() != null && AppCacheManager.getInstance().getResumeModel().isBaseInformation()) {
-                mWelfareJobDetailModel.uploadSaveApply(new MvpDataCallBack<Boolean>() {
+                new SureDialog(mvpReference.get()).initData(R.string.toast_job_request, R.string.cancel, R.string.sure, new SureDialog.OnClickSureListener() {
                     @Override
-                    public void onData(Boolean data) {
-                        if (isViewAttach()) {
-                            if (data)
-                                mvpReference.get().onApply(mWelfareJobDetailModel.isApply());
-                            else
-                                mvpReference.get().onInitResume();
-                        }
+                    public void onClick(boolean isSure) {
+                        if (isSure)
+                            mWelfareJobDetailModel.uploadSaveApply(new MvpDataCallBack<Boolean>() {
+                                @Override
+                                public void onData(Boolean data) {
+                                    if (isViewAttach()) {
+                                        if (data)
+                                            mvpReference.get().onApply(mWelfareJobDetailModel.isApply());
+                                        else
+                                            mvpReference.get().onInitResume();
+                                    }
+                                }
+                            });
                     }
-                });
+                }).show();
             } else {//完善个人简历
                 mvpReference.get().onInitResume();
             }

+ 3 - 0
app/src/main/res/values/strings.xml

@@ -764,6 +764,9 @@
     <string name="toast_day_task_finish">完成今天全部的每日任务可以获得一次补签机会~</string>
     <string name="toast_sure_success">确认成功</string>
     <string name="toast_assemble_all_success">拼工都已经完成啦,您可以申请开团哦!</string>
+    <string name="toast_job_request">确定投递简历吗?</string>
+    <string name="toast_assemble_job_request">确定提交开团申请吗?</string>
+    <string name="toast_assemble_job_join">确定加入拼工吗?</string>
 
 
     <string name="tab_home">主页</string>

+ 1 - 0
gradle.properties

@@ -12,3 +12,4 @@ org.gradle.jvmargs=-Xmx1536m
 # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
 # org.gradle.parallel=true
 android.useDeprecatedNdk=true
+android.injected.testOnly=false