private void loadImage(IdentifyLicense entity) { if (!UIUtils.isEmpty(entity.getIdentifyImage())) { Glide.with(context) .load(Uri.parse(entity.getIdentifyImage())) .placeholder(R.mipmap.icon_pic_loading) .error(R.mipmap.icon_pic_load_fail) .listener(new ImageLoaderListener(context, Uri.parse(entity.getIdentifyImage()))) .into((ImageView) identity_card_verify_view.findViewById(R.id.iv_identity_card_face)); ((TextView) identity_card_verify_view.findViewById(R.id.tv_face_2)).setText("上传成功,点击图片可重新上传"); } else { Glide.with(context) .load(R.mipmap.identity_card_face) .listener(new ImageLoaderListener(context, null)) .into((ImageView) identity_card_verify_view.findViewById(R.id.iv_identity_card_face)); ((TextView) identity_card_verify_view.findViewById(R.id.tv_face_2)).setText("点击上传"); } if (!UIUtils.isEmpty(entity.getIdentifyBackImage())) { Glide.with(context) .load(Uri.parse(entity.getIdentifyBackImage())) .placeholder(R.mipmap.icon_pic_loading) .error(R.mipmap.icon_pic_load_fail) .listener(new ImageLoaderListener(context, Uri.parse(entity.getIdentifyBackImage()))) .into((ImageView) identity_card_verify_view.findViewById(R.id.iv_identity_card_back)); ((TextView) identity_card_verify_view.findViewById(R.id.tv_back_2)).setText("上传成功,点击图片可重新上传"); } else { Glide.with(context) .load(R.mipmap.identity_card_back) .listener(new ImageLoaderListener(context, null)) .into((ImageView) identity_card_verify_view.findViewById(R.id.iv_identity_card_back)); ((TextView) identity_card_verify_view.findViewById(R.id.tv_back_2)).setText("点击上传"); } }
@Override public void onClick(View v) { IdentifyLicense entity = context.task_detail_entity.getLicense().getIdentifyLicense(); if (UIUtils.isEmpty(entity.getIdentifyImage())) { ToastUtils.showToast("未上传身份证正面照片"); return; } if (UIUtils.isEmpty(entity.getIdentifyBackImage())) { ToastUtils.showToast("未上传身份证背面照片"); return; } if (!"3".equals(entity.getIdentityNumberStatus())) { ToastUtils.showToast("未完成身份信息验证"); return; } if (UIUtils.isEmpty( ((TextView) identity_card_verify_view.findViewById(R.id.tv_date_out_line)) .getText() .toString() .trim())) { ToastUtils.showToast("请选择有效期"); return; } String date_str = ((TextView) identity_card_verify_view.findViewById(R.id.tv_date_out_line)) .getText() .toString() .trim(); if (!UIUtils.checkDateValidity(date_str)) { ToastUtils.showToast("身份证已过有效期"); return; } if (UIUtils.isEmpty( ((TextView) identity_card_verify_view.findViewById(R.id.tv_address)) .getText() .toString() .trim())) { ToastUtils.showToast("请选择地址"); return; } requestPass(); }