添加‘我的’页面的实名认证接口 完善能力测评的提交功能接口
This commit is contained in:
parent
ffa24988c3
commit
af5d7da58c
@ -3,7 +3,7 @@ apply plugin: 'com.android.application'
|
||||
android {
|
||||
compileSdkVersion 29
|
||||
buildToolsVersion '29.0.2'
|
||||
//ndkVersion '23.0.7123448'
|
||||
ndkVersion '23.0.7123448'
|
||||
|
||||
defaultConfig {
|
||||
applicationId "com.navinfo.outdoor"
|
||||
|
@ -109,13 +109,13 @@ public class CapacityMeasureAdapter extends RecyclerView.Adapter<CapacityMeasure
|
||||
}
|
||||
});
|
||||
|
||||
ImageView ivOption = optionLayer.findViewById(R.id.iv_option_img);
|
||||
// ImageView ivOption = optionLayer.findViewById(R.id.iv_option_img);
|
||||
|
||||
TextView tvOptionContent = optionLayer.findViewById(R.id.tv_option_content);
|
||||
|
||||
if (option != null) {
|
||||
if (option.startsWith("http")) {
|
||||
Glide.with(context).load(option).into(ivOption);
|
||||
// Glide.with(context).load(option).into(ivOption);
|
||||
} else {
|
||||
tvOptionContent.setText(option);
|
||||
}
|
||||
|
@ -1,27 +1,24 @@
|
||||
package com.navinfo.outdoor.bean;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ExamBean {
|
||||
private String examId;
|
||||
private String answer;
|
||||
private String id;
|
||||
private List<String> answer;
|
||||
|
||||
public ExamBean(String examId, String answer) {
|
||||
this.examId = examId;
|
||||
this.answer = answer;
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public String getExamId() {
|
||||
return examId;
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public void setExamId(String examId) {
|
||||
this.examId = examId;
|
||||
}
|
||||
|
||||
public String getAnswer() {
|
||||
public List<String> getAnswer() {
|
||||
return answer;
|
||||
}
|
||||
|
||||
public void setAnswer(String answer) {
|
||||
public void setAnswer(List<String> answer) {
|
||||
this.answer = answer;
|
||||
}
|
||||
}
|
||||
|
@ -83,6 +83,15 @@ public class MeasureBean {
|
||||
private String id;
|
||||
private String question;
|
||||
private List<?> option;
|
||||
private String examId;
|
||||
|
||||
public String getExamId() {
|
||||
return examId;
|
||||
}
|
||||
|
||||
public void setExamId(String examId) {
|
||||
this.examId = examId;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
@ -111,9 +120,10 @@ public class MeasureBean {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "SingleChoiceBean{" +
|
||||
"id=" + id +
|
||||
"id='" + id + '\'' +
|
||||
", question='" + question + '\'' +
|
||||
", option=" + option +
|
||||
", examId='" + examId + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@ -128,6 +138,26 @@ public class MeasureBean {
|
||||
private String id;
|
||||
private String question;
|
||||
private List<?> option;
|
||||
private String examId;
|
||||
|
||||
public String getExamId() {
|
||||
return examId;
|
||||
}
|
||||
|
||||
public void setExamId(String examId) {
|
||||
this.examId = examId;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "MultiChoiceBean{" +
|
||||
"id='" + id + '\'' +
|
||||
", question='" + question + '\'' +
|
||||
", option=" + option +
|
||||
", examId='" + examId + '\'' +
|
||||
'}';
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
@ -153,14 +183,7 @@ public class MeasureBean {
|
||||
this.option = option;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "MultiChoiceBean{" +
|
||||
"id=" + id +
|
||||
", question='" + question + '\'' +
|
||||
", option=" + option +
|
||||
'}';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -0,0 +1,32 @@
|
||||
package com.navinfo.outdoor.bean;
|
||||
|
||||
public class NameAuthenticationBean {
|
||||
|
||||
private Integer code;
|
||||
private String message;
|
||||
private Integer body;
|
||||
|
||||
public Integer getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public void setCode(Integer code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
public void setMessage(String message) {
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
public Integer getBody() {
|
||||
return body;
|
||||
}
|
||||
|
||||
public void setBody(Integer body) {
|
||||
this.body = body;
|
||||
}
|
||||
}
|
@ -89,7 +89,6 @@ public class CapacityEvaluationFragment2 extends BaseFragment implements View.On
|
||||
.url(HttpInterface.MSG_LISt)
|
||||
.method(OkGoBuilder.GET)
|
||||
.cls(TaskPrefectureBean.class)
|
||||
.json(new JSONObject())
|
||||
.callback(new Callback<TaskPrefectureBean>() {
|
||||
@Override
|
||||
public void onSuccess(TaskPrefectureBean response, int id) {
|
||||
|
@ -11,7 +11,10 @@ import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.lzy.okgo.OkGo;
|
||||
import com.lzy.okgo.model.HttpParams;
|
||||
import com.lzy.okgo.model.Response;
|
||||
import com.navinfo.outdoor.R;
|
||||
import com.navinfo.outdoor.adapter.CapacityMeasureAdapter;
|
||||
import com.navinfo.outdoor.base.BaseFragment;
|
||||
@ -20,21 +23,22 @@ import com.navinfo.outdoor.bean.ExamBean;
|
||||
import com.navinfo.outdoor.bean.ExamSubmitBean;
|
||||
import com.navinfo.outdoor.bean.MeasureBean;
|
||||
import com.navinfo.outdoor.http.Callback;
|
||||
import com.navinfo.outdoor.http.DialogCallback;
|
||||
import com.navinfo.outdoor.http.HttpInterface;
|
||||
import com.navinfo.outdoor.http.OkGoBuilder;
|
||||
import com.kongzue.dialog.interfaces.OnDialogButtonClickListener;
|
||||
import com.kongzue.dialog.util.BaseDialog;
|
||||
import com.kongzue.dialog.v3.MessageDialog;
|
||||
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import okhttp3.MediaType;
|
||||
|
||||
/**
|
||||
* 发现-能力测评条目点击进入测试页面
|
||||
*/
|
||||
@ -46,6 +50,9 @@ public class CapacityMeasurementFragment extends BaseFragment implements View.On
|
||||
private Button btn;
|
||||
private ArrayList<ExamBean> examBeans;
|
||||
|
||||
private String examId;
|
||||
private Gson gson;
|
||||
|
||||
public static CapacityMeasurementFragment newInstance(Bundle bundle) {
|
||||
CapacityMeasurementFragment fragment = new CapacityMeasurementFragment();
|
||||
fragment.setArguments(bundle);
|
||||
@ -68,7 +75,7 @@ public class CapacityMeasurementFragment extends BaseFragment implements View.On
|
||||
capacityMeasurementRel.setAdapter(capacityMeasureAdapter);
|
||||
btn = findViewById(R.id.btn);
|
||||
btn.setOnClickListener(this::onClick);
|
||||
|
||||
gson = new Gson();
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -76,6 +83,7 @@ public class CapacityMeasurementFragment extends BaseFragment implements View.On
|
||||
super.initData();
|
||||
bolbean = new ArrayList<>();
|
||||
examBeans = new ArrayList<>();
|
||||
|
||||
initNetWorks(true);
|
||||
}
|
||||
|
||||
@ -96,14 +104,18 @@ public class CapacityMeasurementFragment extends BaseFragment implements View.On
|
||||
List<MeasureBean.BodyBean.MultiChoiceBean> multiChoice = response.getBody().getMultiChoice();
|
||||
//多选
|
||||
List<MeasureBean.BodyBean.SingleChoiceBean> singleChoice1 = response.getBody().getSingleChoice();
|
||||
|
||||
if (multiChoice != null) {
|
||||
for (int i = 0; i < multiChoice.size(); i++) {
|
||||
bolbean.add(new BolBean(multiChoice.get(i).getId(), multiChoice.get(i).getQuestion(), multiChoice.get(i).getOption(), true));
|
||||
examId = multiChoice.get(i).getExamId();
|
||||
}
|
||||
}
|
||||
|
||||
if (singleChoice1 != null) {
|
||||
for (int i = 0; i < singleChoice1.size(); i++) {
|
||||
bolbean.add(new BolBean(singleChoice1.get(i).getId(), singleChoice1.get(i).getQuestion(), singleChoice1.get(i).getOption(), false));
|
||||
examId = singleChoice1.get(i).getExamId();
|
||||
}
|
||||
}
|
||||
|
||||
@ -142,7 +154,21 @@ public class CapacityMeasurementFragment extends BaseFragment implements View.On
|
||||
}
|
||||
}
|
||||
for (Map.Entry<String, String> entry : checkedMap.entrySet()) {
|
||||
examBeans.add(new ExamBean(entry.getKey(), entry.getValue()));
|
||||
ExamBean examBean = new ExamBean();
|
||||
examBean.setId(entry.getKey());
|
||||
String value = entry.getValue();
|
||||
String[] valus = value.split(",");
|
||||
List<String> answerList = new ArrayList<>();
|
||||
if (valus!=null) {
|
||||
for (int i = 0; i < valus.length; i++) {
|
||||
if (valus[i]!=null&&!valus[i].equals("")) {
|
||||
answerList.add(valus[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
examBean.setAnswer(answerList);
|
||||
examBeans.add(examBean);
|
||||
}
|
||||
initExamSubmit();
|
||||
}
|
||||
@ -154,27 +180,25 @@ public class CapacityMeasurementFragment extends BaseFragment implements View.On
|
||||
}
|
||||
|
||||
private void initExamSubmit() throws JSONException {
|
||||
JSONArray jsonArray = new JSONArray();
|
||||
for (int i = 0; i < examBeans.size(); i++) {
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("examId", examBeans.get(i).getExamId());
|
||||
json.put("answer", examBeans.get(i).getAnswer());
|
||||
jsonArray.put(json);
|
||||
}
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("examId",examId);
|
||||
map.put("answerList",examBeans);
|
||||
|
||||
String json = gson.toJson(map);
|
||||
examBeans.clear();
|
||||
Log.d("TAG", "initExamSubmit: " + jsonArray.toString());
|
||||
OkGoBuilder.getInstance()
|
||||
.Builder(getActivity())
|
||||
.url(HttpInterface.EXAM_SUBMIT)
|
||||
.method(OkGoBuilder.POST)
|
||||
.cls(ExamSubmitBean.class)
|
||||
.jsonArray(jsonArray)
|
||||
.callback(new Callback<ExamSubmitBean>() {
|
||||
// Log.d("TAG", "initExamSubmit: " + jsonArray.toString());
|
||||
OkGo
|
||||
// 请求方式和请求url
|
||||
.<ExamSubmitBean>post(HttpInterface.EXAM_SUBMIT)
|
||||
.upString(json, MediaType.parse("application/json"))
|
||||
// 请求的 tag, 主要用于取消对应的请求
|
||||
.tag(this)
|
||||
.execute(new DialogCallback<ExamSubmitBean>(ExamSubmitBean.class) {
|
||||
@Override
|
||||
public void onSuccess(ExamSubmitBean response, int id) {
|
||||
public void onSuccess(Response<ExamSubmitBean> response) {
|
||||
dismissLoadingDialog();
|
||||
Log.d("TAG", "onSuccess: " + response.toString() + "sssssssssssss");
|
||||
if (response.getBody().equals("0")) {
|
||||
if (response.body().equals("0")) {
|
||||
MessageDialog.show((AppCompatActivity) getActivity(), "提示", "不通过", "确定", "取消").setOkButton(new OnDialogButtonClickListener() {
|
||||
@Override
|
||||
public boolean onClick(BaseDialog baseDialog, View v) {
|
||||
@ -191,16 +215,55 @@ public class CapacityMeasurementFragment extends BaseFragment implements View.On
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//Toast.makeText(getActivity(), response.getMsg() + "", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e, int id) {
|
||||
public void onError(Response<ExamSubmitBean> response) {
|
||||
super.onError(response);
|
||||
dismissLoadingDialog();
|
||||
Toast.makeText(getActivity(), e.getMessage(), Toast.LENGTH_SHORT).show();
|
||||
Log.d("TAG", "onError: " + e.getMessage());
|
||||
Toast.makeText(getActivity(), response.message(), Toast.LENGTH_SHORT).show();
|
||||
Log.d("TAG", "onError: " + response.message());
|
||||
}
|
||||
}).build();
|
||||
});
|
||||
|
||||
// OkGoBuilder.getInstance()
|
||||
// .Builder(getActivity())
|
||||
// .url(HttpInterface.EXAM_SUBMIT)
|
||||
// .method(OkGoBuilder.POST)
|
||||
// .cls(ExamSubmitBean.class)
|
||||
// .json(json)
|
||||
// .callback(new Callback<ExamSubmitBean>() {
|
||||
// @Override
|
||||
// public void onSuccess(ExamSubmitBean response, int id) {
|
||||
// dismissLoadingDialog();
|
||||
// Log.d("TAG", "onSuccess: " + response.toString() + "sssssssssssss");
|
||||
// if (response.getBody().equals("0")) {
|
||||
// MessageDialog.show((AppCompatActivity) getActivity(), "提示", "不通过", "确定", "取消").setOkButton(new OnDialogButtonClickListener() {
|
||||
// @Override
|
||||
// public boolean onClick(BaseDialog baseDialog, View v) {
|
||||
// // Toast.makeText(getContext(), "点击了确定", Toast.LENGTH_SHORT).show();
|
||||
// return false;
|
||||
// }
|
||||
// });
|
||||
// } else {
|
||||
// MessageDialog.show((AppCompatActivity) getActivity(), "提示", "通过", "确定", "取消").setOkButton(new OnDialogButtonClickListener() {
|
||||
// @Override
|
||||
// public boolean onClick(BaseDialog baseDialog, View v) {
|
||||
// // Toast.makeText(getContext(), "点击了确定", Toast.LENGTH_SHORT).show();
|
||||
// return false;
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
//
|
||||
// //Toast.makeText(getActivity(), response.getMsg() + "", Toast.LENGTH_SHORT).show();
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onError(Throwable e, int id) {
|
||||
// dismissLoadingDialog();
|
||||
// Toast.makeText(getActivity(), e.getMessage(), Toast.LENGTH_SHORT).show();
|
||||
// Log.d("TAG", "onError: " + e.getMessage());
|
||||
// }
|
||||
// }).build();
|
||||
}
|
||||
}
|
@ -61,7 +61,6 @@ public class IssueFragment extends BaseFragment implements View.OnClickListener
|
||||
.url(HttpInterface.listTaskExplain)
|
||||
.method(OkGoBuilder.GET)
|
||||
.cls(TaskExplainInfo.class)
|
||||
.json(new JSONObject())
|
||||
.callback(new Callback<TaskExplainInfo>() {
|
||||
@Override
|
||||
public void onSuccess(TaskExplainInfo taskExplainInfo, int id) {
|
||||
|
@ -98,7 +98,6 @@ public class TaskExplainFragment2 extends BaseFragment implements View.OnClickLi
|
||||
.url(HttpInterface.listTaskExplain)
|
||||
.method(OkGoBuilder.GET)
|
||||
.cls(TaskExplainInfo.class)
|
||||
.json(new JSONObject())
|
||||
.callback(new Callback<TaskExplainInfo>() {
|
||||
@Override
|
||||
public void onSuccess(TaskExplainInfo response, int id) {
|
||||
|
@ -1,16 +1,32 @@
|
||||
package com.navinfo.outdoor.fragment;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Bitmap;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import com.kongzue.dialog.interfaces.OnDialogButtonClickListener;
|
||||
import com.kongzue.dialog.util.BaseDialog;
|
||||
import com.kongzue.dialog.v3.MessageDialog;
|
||||
import com.lzy.okgo.OkGo;
|
||||
import com.lzy.okgo.model.Response;
|
||||
import com.navinfo.outdoor.R;
|
||||
import com.navinfo.outdoor.base.BaseFragment;
|
||||
import com.navinfo.outdoor.bean.NameAuthenticationBean;
|
||||
import com.navinfo.outdoor.http.DialogCallback;
|
||||
import com.navinfo.outdoor.http.HttpInterface;
|
||||
import com.navinfo.outdoor.util.PhotoPathUtil;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import static android.app.Activity.RESULT_OK;
|
||||
|
||||
@ -22,12 +38,20 @@ public class UserAttestationFragment extends BaseFragment implements View.OnClic
|
||||
private ImageView ivAttestation2;
|
||||
private ImageView ivAttestation1;
|
||||
private ImageView ivAttestation;
|
||||
private Button btnAttestation;
|
||||
private ArrayList<NameAuthenticationBean> authenticationBeans;
|
||||
private EditText etAttestationName;
|
||||
private EditText etNamePhone;
|
||||
private String takePhotoPath1;//身份证正面照片路径
|
||||
private String takePhotoPath2;//身份证反面照片路径
|
||||
|
||||
|
||||
public static UserAttestationFragment newInstance(Bundle bundle) {
|
||||
UserAttestationFragment fragment = new UserAttestationFragment();
|
||||
fragment.setArguments(bundle);
|
||||
return fragment;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getLayout() {
|
||||
return R.layout.user_attestation_fragment;
|
||||
@ -36,6 +60,9 @@ public class UserAttestationFragment extends BaseFragment implements View.OnClic
|
||||
@Override
|
||||
protected void initData() {
|
||||
super.initData();
|
||||
authenticationBeans = new ArrayList<>();
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -47,6 +74,10 @@ public class UserAttestationFragment extends BaseFragment implements View.OnClic
|
||||
ivAttestation1.setOnClickListener(this);
|
||||
ivAttestation2 = findViewById(R.id.iv_attestation2);
|
||||
ivAttestation2.setOnClickListener(this);
|
||||
btnAttestation = (Button) findViewById(R.id.btn_attestation);
|
||||
btnAttestation.setOnClickListener(this::onClick);
|
||||
etAttestationName = (EditText) findViewById(R.id.et_attestationName);
|
||||
etNamePhone = (EditText) findViewById(R.id.et_namePhone);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -63,19 +94,90 @@ public class UserAttestationFragment extends BaseFragment implements View.OnClic
|
||||
Intent ivAttestation2 = new Intent("android.media.action.IMAGE_CAPTURE");
|
||||
startActivityForResult(ivAttestation2, 200);
|
||||
break;
|
||||
case R.id.btn_attestation:
|
||||
|
||||
if (etAttestationName == null || etAttestationName.equals("")) {
|
||||
Toast.makeText(getContext(), "姓名不能为空,请输入姓名", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
if (etNamePhone == null || etNamePhone.equals("")) {
|
||||
Toast.makeText(getContext(), "身份证号不能为空,请输入身份证号", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
nameAuthentication();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void nameAuthentication() {
|
||||
ArrayList<File> takePhoneList = new ArrayList<>();
|
||||
|
||||
File takePhotoFile1 = new File(takePhotoPath1);
|
||||
File takePhotoFile2 = new File(takePhotoPath2);
|
||||
if (!takePhotoFile1.exists() || !takePhotoFile2.exists()) {
|
||||
Toast.makeText(getContext(), "身份证照片不能为空", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
takePhoneList.add(takePhotoFile1);
|
||||
takePhoneList.add(takePhotoFile2);
|
||||
takePhoneList.add(takePhotoFile2);
|
||||
OkGo
|
||||
// 请求方式和请求url
|
||||
.<NameAuthenticationBean>post(HttpInterface.USER_AUTH_ADD)
|
||||
// 请求的 tag, 主要用于取消对应的请求
|
||||
.params("userid", "1")
|
||||
.params("name", "李心榕")
|
||||
.params("idnum", "123456")
|
||||
.addFileParams("file",takePhoneList)
|
||||
.tag(this)
|
||||
.execute(new DialogCallback<NameAuthenticationBean>(NameAuthenticationBean.class) {
|
||||
@Override
|
||||
public void onSuccess(Response<NameAuthenticationBean> response) {
|
||||
dismissLoadingDialog();
|
||||
Log.d("TAG", "onSuccess: " + response.toString() + "sssssssssssss");
|
||||
if (response.body().equals("0")) {
|
||||
MessageDialog.show((AppCompatActivity) getActivity(), "提示", "不通过", "确定", "取消").setOkButton(new OnDialogButtonClickListener() {
|
||||
@Override
|
||||
public boolean onClick(BaseDialog baseDialog, View v) {
|
||||
// Toast.makeText(getContext(), "点击了确定", Toast.LENGTH_SHORT).show();
|
||||
return false;
|
||||
}
|
||||
});
|
||||
} else {
|
||||
MessageDialog.show((AppCompatActivity) getActivity(), "提示", "通过", "确定", "取消").setOkButton(new OnDialogButtonClickListener() {
|
||||
@Override
|
||||
public boolean onClick(BaseDialog baseDialog, View v) {
|
||||
// Toast.makeText(getContext(), "点击了确定", Toast.LENGTH_SHORT).show();
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Response<NameAuthenticationBean> response) {
|
||||
super.onError(response);
|
||||
dismissLoadingDialog();
|
||||
Toast.makeText(getActivity(), response.message(), Toast.LENGTH_SHORT).show();
|
||||
Log.d("TAG", "onError: " + response.message());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
if (requestCode == 100 && resultCode == RESULT_OK) {
|
||||
takePhotoPath1 = PhotoPathUtil.getTakePhotoPath(data);
|
||||
Bundle extras = data.getExtras();//从Intent中获取附加值
|
||||
Bitmap bitmap = (Bitmap) extras.get("data");//从附加值中获取返回的图像
|
||||
//从附加值中获取返回的图像
|
||||
Bitmap bitmap = (Bitmap) extras.get("data");
|
||||
ivAttestation1.setImageBitmap(bitmap);//显示图像
|
||||
} else if (requestCode == 200 && resultCode == RESULT_OK) {
|
||||
takePhotoPath2 = PhotoPathUtil.getTakePhotoPath(data);
|
||||
Bundle extras = data.getExtras();//从Intent中获取附加值
|
||||
Bitmap bitmap = (Bitmap) extras.get("data");//从附加值中获取返回的图像
|
||||
//从附加值中获取返回的图像
|
||||
Bitmap bitmap = (Bitmap) extras.get("data");
|
||||
ivAttestation2.setImageBitmap(bitmap);//显示图像
|
||||
}
|
||||
}
|
||||
|
@ -1,23 +1,30 @@
|
||||
package com.navinfo.outdoor.http;
|
||||
|
||||
public class HttpInterface {
|
||||
|
||||
//http://172.21.91.160:8000/api/user/list
|
||||
//发现接口
|
||||
//http://172.23.139.4:8002/m4/findAndMessage/1/msg_list?fid=1&pageNum=1&pageSize=2
|
||||
//能力测评接口
|
||||
//http://172.23.139.4:8002/m4/findAndMessage/1/exam_content?id=11
|
||||
//http://172.23.139.4:8002/m4/findAndMessage/1/submitExam
|
||||
|
||||
public static final String IP1 = "http://172.23.139.4:8002/m4/findAndMessage/1/";
|
||||
public static final String IPm4 = "https://mockapi.eolinker.com/m5LxPbRb58eec57f4943420b1eb3b4e95b93968619a2973/m4/1/";
|
||||
//发现:测试接口
|
||||
|
||||
public static final String listTask = IP1 + "msg_list";//任务专区
|
||||
public static final String listEvent = IP1 + "msg_list";//活动专区
|
||||
public static final String listTaskExplain = IP1 + "msg_list";//任务说明
|
||||
public static final String MSG_LISt = IP1 + "msg_list";//发现查询接口
|
||||
public static final String MSG_CONTENT = IPm4 + "msg_content";//发现 -富文本详情页请求
|
||||
public static final String EXAM_CONTENT = IP1 + "exam_content";//发现 -能力测评获取试题接口
|
||||
public static final String EXAM_SUBMIT = IP1 + "submitExam";//发现 -能力测评提交试卷 post
|
||||
|
||||
|
||||
public static final String IPm4 = "http://172.23.139.4:8001/m4";
|
||||
public static final String MSG_CONTENT = IPm4 + "/1/msg_content";//发现 -富文本详情页请求
|
||||
|
||||
//172.23.139.4:8001/m4/userAuth/add
|
||||
public static final String USER_AUTH_ADD = IPm4 + "/userAuth/add"; //实名认证
|
||||
|
||||
|
||||
}
|
||||
|
@ -26,8 +26,7 @@ public class OkGoBuilder<T> {
|
||||
/**
|
||||
* post请求
|
||||
*/
|
||||
public static final int PSOT = 2;
|
||||
public static final int POST = 5;
|
||||
public static final int POST = 2;
|
||||
/**
|
||||
* post请求
|
||||
*/
|
||||
@ -46,9 +45,7 @@ public class OkGoBuilder<T> {
|
||||
* 参数
|
||||
*/
|
||||
private HttpParams params;
|
||||
private String jsonstr;
|
||||
private JSONObject json;
|
||||
private JSONArray jsonArray;
|
||||
private String json;
|
||||
/**
|
||||
* 实体类
|
||||
*/
|
||||
@ -122,19 +119,11 @@ public class OkGoBuilder<T> {
|
||||
}
|
||||
|
||||
|
||||
public OkGoBuilder jsonstr(String jsonstr) {
|
||||
this.jsonstr = jsonstr;
|
||||
return this;
|
||||
}
|
||||
|
||||
public OkGoBuilder json(JSONObject json) {
|
||||
public OkGoBuilder json(String json) {
|
||||
this.json = json;
|
||||
return this;
|
||||
}
|
||||
public OkGoBuilder jsonArray(JSONArray json) {
|
||||
this.jsonArray = json;
|
||||
return this;
|
||||
}
|
||||
public OkGoBuilder cls(Class<T> clazz) {
|
||||
this.clazz = clazz;
|
||||
return this;
|
||||
@ -152,7 +141,7 @@ public class OkGoBuilder<T> {
|
||||
getRequest();
|
||||
break;
|
||||
case 2:
|
||||
postRequest();
|
||||
postRequest(json);
|
||||
break;
|
||||
case 3:
|
||||
postRequestFile();
|
||||
@ -160,9 +149,6 @@ public class OkGoBuilder<T> {
|
||||
case 4:
|
||||
postRequestAloneFile();
|
||||
break;
|
||||
case 5:
|
||||
postsRequest();
|
||||
break;
|
||||
}
|
||||
return this;
|
||||
}
|
||||
@ -170,11 +156,11 @@ public class OkGoBuilder<T> {
|
||||
/**
|
||||
* post请求
|
||||
*/
|
||||
private void postRequest() {
|
||||
private void postRequest(String json) {
|
||||
OkGo
|
||||
// 请求方式和请求url
|
||||
.<T>post(url)
|
||||
.params("param", json.toString())
|
||||
.params("param", json)
|
||||
// .upJson(json)
|
||||
// 请求的 tag, 主要用于取消对应的请求
|
||||
.tag(this)
|
||||
@ -204,38 +190,6 @@ public class OkGoBuilder<T> {
|
||||
}
|
||||
});
|
||||
}
|
||||
/**
|
||||
* post请求
|
||||
*/
|
||||
private void postsRequest() {
|
||||
OkGo
|
||||
// 请求方式和请求url
|
||||
.<T>post(url)
|
||||
.params("param", jsonArray.toString())
|
||||
// .upJson(json)
|
||||
// 请求的 tag, 主要用于取消对应的请求
|
||||
.tag(this)
|
||||
// 设置当前请求的缓存key,建议每个不同功能的请求设置一个
|
||||
// .cacheKey("cacheKey")
|
||||
// 缓存模式,详细请看缓存介绍
|
||||
// .cacheMode(CacheMode.DEFAULT)
|
||||
.execute(new DialogCallback<T>(clazz) {
|
||||
@Override
|
||||
public void onSuccess(Response<T> response) {
|
||||
callback.onSuccess(response.body(), 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Response<T> response) {
|
||||
super.onError(response);
|
||||
Throwable throwable = response.getException();
|
||||
if (throwable != null) {
|
||||
throwable.printStackTrace();
|
||||
callback.onError(throwable, 2);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* get请求
|
||||
|
BIN
app/src/main/res/drawable/card_fanmian.png
Normal file
BIN
app/src/main/res/drawable/card_fanmian.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 338 B |
BIN
app/src/main/res/drawable/card_shouchi.png
Normal file
BIN
app/src/main/res/drawable/card_shouchi.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 408 B |
BIN
app/src/main/res/drawable/card_zhengmian.png
Normal file
BIN
app/src/main/res/drawable/card_zhengmian.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 317 B |
@ -3,7 +3,10 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
>
|
||||
<RadioButton
|
||||
android:id="@+id/tv_option_layer_index"
|
||||
android:layout_width="wrap_content"
|
||||
@ -19,12 +22,14 @@
|
||||
android:id="@+id/tv_option_content"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
</LinearLayout>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_option_img"
|
||||
android:layout_width="200dp"
|
||||
android:layout_height="100dp"
|
||||
android:src="@mipmap/top_bg" />
|
||||
|
||||
<!-- <ImageView-->
|
||||
<!-- android:id="@+id/iv_option_img"-->
|
||||
<!-- android:layout_width="200dp"-->
|
||||
<!-- android:layout_height="100dp"-->
|
||||
<!-- android:src="@mipmap/top_bg" />-->
|
||||
|
||||
|
||||
</LinearLayout>
|
@ -64,6 +64,7 @@
|
||||
android:textSize="18sp" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/et_attestationName"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@null"
|
||||
@ -91,6 +92,7 @@
|
||||
android:textSize="18sp" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/et_namePhone"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@null"
|
||||
@ -108,20 +110,57 @@
|
||||
android:layout_height="150dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="wrap_content"
|
||||
>
|
||||
<ImageView
|
||||
android:id="@+id/iv_attestation1"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="100dp"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_margin="10dp"
|
||||
android:layout_weight="1"
|
||||
android:background="@mipmap/checkbox" />
|
||||
android:background="@color/colorPrimaryBlue"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
/>
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
android:orientation="vertical">
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/card_zhengmian"
|
||||
android:layout_gravity="center"/>
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="*身份证人像面"
|
||||
android:textColor="@color/white"/>
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_attestation2"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_height="100dp"
|
||||
android:layout_margin="10dp"
|
||||
android:layout_weight="1"
|
||||
android:background="@mipmap/checkbox" />
|
||||
<ImageView
|
||||
android:id="@+id/iv_attestation3"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="100dp"
|
||||
android:layout_margin="10dp"
|
||||
android:layout_weight="1"
|
||||
android:background="@mipmap/checkbox" />
|
||||
|
Loading…
x
Reference in New Issue
Block a user