从业资格证重复上传优化
This commit is contained in:
parent
fb164ccb15
commit
109a713850
@ -18,10 +18,13 @@ import android.widget.Toast;
|
|||||||
|
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.arpa.hndahesudintocctmsdriver.parts.UserParts;
|
import com.arpa.hndahesudintocctmsdriver.parts.UserParts;
|
||||||
import com.arpa.hndahesudintocctmsdriver.util.string.StringUtil;
|
import com.arpa.hndahesudintocctmsdriver.util.string.StringUtil;
|
||||||
import com.bumptech.glide.Glide;
|
import com.bumptech.glide.Glide;
|
||||||
import com.esign.esignsdk.EsignSdk;
|
import com.esign.esignsdk.EsignSdk;
|
||||||
|
import com.esign.esignsdk.data.AuthEvent;
|
||||||
import com.github.gzuliyujiang.wheelpicker.DatePicker;
|
import com.github.gzuliyujiang.wheelpicker.DatePicker;
|
||||||
import com.github.gzuliyujiang.wheelpicker.annotation.DateMode;
|
import com.github.gzuliyujiang.wheelpicker.annotation.DateMode;
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
@ -45,6 +48,8 @@ import com.arpa.hndahesudintocctmsdriver.util.statusbar.StateStyleUtil;
|
|||||||
import com.arpa.hndahesudintocctmsdriver.util.view.BaseAppCompatActivity;
|
import com.arpa.hndahesudintocctmsdriver.util.view.BaseAppCompatActivity;
|
||||||
import com.lxj.xpopup.util.SmartGlideImageLoader;
|
import com.lxj.xpopup.util.SmartGlideImageLoader;
|
||||||
|
|
||||||
|
import org.greenrobot.eventbus.Subscribe;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ -101,6 +106,7 @@ public class AuthQualificationActivity extends BaseAppCompatActivity {
|
|||||||
BaseBean bb = gson.fromJson(CacheGroup.cacheList.get("driverAuthQualification"), BaseBean.class);
|
BaseBean bb = gson.fromJson(CacheGroup.cacheList.get("driverAuthQualification"), BaseBean.class);
|
||||||
if (bb.getCode() == 200) {
|
if (bb.getCode() == 200) {
|
||||||
// initAuth();
|
// initAuth();
|
||||||
|
isAuth = true;
|
||||||
//判断是否从车辆进来 carId为空从个人认证进来需跳转实名认证,不为空车辆信息进入,需跳转车辆照片
|
//判断是否从车辆进来 carId为空从个人认证进来需跳转实名认证,不为空车辆信息进入,需跳转车辆照片
|
||||||
if (TextUtils.isEmpty(carId)) {
|
if (TextUtils.isEmpty(carId)) {
|
||||||
//从业资格证->实名认证
|
//从业资格证->实名认证
|
||||||
@ -155,6 +161,7 @@ public class AuthQualificationActivity extends BaseAppCompatActivity {
|
|||||||
// finish();
|
// finish();
|
||||||
EsignSdk.getInstance().startH5Activity(act, StringUtil.isNull(String.valueOf(bb.getData()), ""));
|
EsignSdk.getInstance().startH5Activity(act, StringUtil.isNull(String.valueOf(bb.getData()), ""));
|
||||||
} else {
|
} else {
|
||||||
|
finish();
|
||||||
Toast.makeText(con, bb.getMsg(), Toast.LENGTH_LONG).show();
|
Toast.makeText(con, bb.getMsg(), Toast.LENGTH_LONG).show();
|
||||||
}//Log.e("url",CacheGroup.cacheList.get("authUrl"));
|
}//Log.e("url",CacheGroup.cacheList.get("authUrl"));
|
||||||
CacheGroup.cacheList.remove("authUrl");
|
CacheGroup.cacheList.remove("authUrl");
|
||||||
@ -243,12 +250,14 @@ public class AuthQualificationActivity extends BaseAppCompatActivity {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
value2.setOnClickListener(v -> {
|
value2.setOnClickListener(v -> {
|
||||||
DatePicker picker = new DatePicker(this);
|
if (!isAuth) {
|
||||||
picker.setBodyWidth(300);
|
DatePicker picker = new DatePicker(this);
|
||||||
picker.setOnDatePickedListener((year, month, day) -> value2.setText(year + "-" + month + "-" + day));
|
picker.setBodyWidth(300);
|
||||||
picker.getWheelLayout().setDateMode(DateMode.YEAR_MONTH_DAY);
|
picker.setOnDatePickedListener((year, month, day) -> value2.setText(year + "-" + month + "-" + day));
|
||||||
picker.getWheelLayout().setDateLabel("年", "月", "日");
|
picker.getWheelLayout().setDateMode(DateMode.YEAR_MONTH_DAY);
|
||||||
picker.show();
|
picker.getWheelLayout().setDateLabel("年", "月", "日");
|
||||||
|
picker.show();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
submit.setOnClickListener(v -> {
|
submit.setOnClickListener(v -> {
|
||||||
if (!isAuth) {
|
if (!isAuth) {
|
||||||
@ -379,4 +388,31 @@ public class AuthQualificationActivity extends BaseAppCompatActivity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Subscribe
|
||||||
|
public void processResult(AuthEvent auth) {
|
||||||
|
//添加实名/意愿/签署完成之后的逻辑
|
||||||
|
Log.e("-回调信息-", auth.result);
|
||||||
|
JSONObject jsonObject = JSON.parseObject(auth.result);
|
||||||
|
if ("success".equalsIgnoreCase(jsonObject.getString("res"))) {
|
||||||
|
if ("sign".equalsIgnoreCase(jsonObject.getString("key"))) {
|
||||||
|
Toast.makeText(con, "签署场景成功", Toast.LENGTH_SHORT).show();
|
||||||
|
} else if ("realName".equalsIgnoreCase(jsonObject.getString("key"))) {
|
||||||
|
Toast.makeText(con, "实名认证成功", Toast.LENGTH_SHORT).show();
|
||||||
|
} else {
|
||||||
|
Toast.makeText(con, "意愿认证成功", Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
finish();
|
||||||
|
} else {
|
||||||
|
if ("sign".equalsIgnoreCase(jsonObject.getString("key"))) {
|
||||||
|
Toast.makeText(con, "签署场景失败", Toast.LENGTH_SHORT).show();
|
||||||
|
} else if ("realName".equalsIgnoreCase(jsonObject.getString("key"))) {
|
||||||
|
Toast.makeText(con, "实名认证失败", Toast.LENGTH_SHORT).show();
|
||||||
|
} else {
|
||||||
|
Toast.makeText(con, "意愿认证失败", Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
EsignSdk.getInstance().finishH5Activity();
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -9,6 +9,8 @@ import android.provider.MediaStore;
|
|||||||
|
|
||||||
import androidx.core.content.FileProvider;
|
import androidx.core.content.FileProvider;
|
||||||
|
|
||||||
|
import com.dahe.mylibrary.utils.AppUtils;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
@ -39,7 +41,7 @@ public class ImageGetUtil {
|
|||||||
if(imageFile!=null){
|
if(imageFile!=null){
|
||||||
if(Build.VERSION.SDK_INT>= Build.VERSION_CODES.N){
|
if(Build.VERSION.SDK_INT>= Build.VERSION_CODES.N){
|
||||||
/*7.0以上要通过FileProvider将File转化为Uri*/
|
/*7.0以上要通过FileProvider将File转化为Uri*/
|
||||||
uri = FileProvider.getUriForFile(act.getApplicationContext(),"com.arpa.hndahesudintocctmsdriver.fileprovider",imageFile);
|
uri = FileProvider.getUriForFile(act.getApplicationContext(), AppUtils.getAppPackageName()+".fileprovider",imageFile);
|
||||||
}else {
|
}else {
|
||||||
/*7.0以下则直接使用Uri的fromFile方法将File转化为Uri*/
|
/*7.0以下则直接使用Uri的fromFile方法将File转化为Uri*/
|
||||||
uri = Uri.fromFile(imageFile);
|
uri = Uri.fromFile(imageFile);
|
||||||
|
@ -163,20 +163,20 @@
|
|||||||
android:textColor="#ffc4c4ce"
|
android:textColor="#ffc4c4ce"
|
||||||
android:textSize="@dimen/sp_13"
|
android:textSize="@dimen/sp_13"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/value2"
|
android:id="@+id/value2"
|
||||||
android:layout_alignParentRight="true"
|
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:textColor="#ff999999"
|
android:layout_alignParentRight="true"
|
||||||
android:textSize="@dimen/sp_13"
|
|
||||||
android:maxLines="1"
|
|
||||||
android:hint="点击进行手动输入"
|
|
||||||
android:ellipsize="end"
|
|
||||||
android:gravity="right"
|
|
||||||
android:layout_marginLeft="@dimen/dp_30"
|
android:layout_marginLeft="@dimen/dp_30"
|
||||||
android:background="@null"
|
android:background="@null"
|
||||||
/>
|
android:ellipsize="end"
|
||||||
|
android:gravity="right"
|
||||||
|
android:hint="点击进行手动输入"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:textColor="#ff999999"
|
||||||
|
android:textSize="@dimen/sp_13" />
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
<TextView
|
<TextView
|
||||||
|
Loading…
Reference in New Issue
Block a user