对能力测评的布局上优化和添加实名认证的姓名赋值绑定银行卡和用户资料
This commit is contained in:
parent
c65a11659d
commit
d3c725ac57
@ -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"
|
||||
|
@ -33,7 +33,9 @@ import com.navinfo.outdoor.http.DialogCallback;
|
||||
import com.navinfo.outdoor.http.HttpInterface;
|
||||
import com.navinfo.outdoor.util.GetJsonDataUtil;
|
||||
import com.navinfo.outdoor.util.RegexUtil;
|
||||
|
||||
import org.json.JSONArray;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.regex.Matcher;
|
||||
@ -51,10 +53,14 @@ public class UserActivity extends BaseActivity implements View.OnClickListener {
|
||||
private ImageView ivUser;
|
||||
private TextView region;
|
||||
private EditText etPhone, etQq, etMailbox;
|
||||
public static Pattern compile = Pattern.compile("/^[_a-z0-9-]+(\\.[_a-z0-9-]+)*@[a-z0-9-]+(\\.[a-z0-9-]+)*(\\.[a-z]{2,})$/");
|
||||
// public static Pattern compile = Pattern.compile("/^[_a-z0-9-]+(\\.[_a-z0-9-]+)*@[a-z0-9-]+(\\.[a-z0-9-]+)*(\\.[a-z]{2,})$/");
|
||||
private Button userSave;
|
||||
private LinearLayout llRegion;
|
||||
private String userqq;
|
||||
private String userphone;
|
||||
private String usermailbox;
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
protected int getLayout() {
|
||||
@ -111,29 +117,32 @@ public class UserActivity extends BaseActivity implements View.OnClickListener {
|
||||
showPickerView();
|
||||
break;
|
||||
case R.id.edit_qq:
|
||||
qq();
|
||||
// qq();
|
||||
break;
|
||||
case R.id.edit_mailbox:
|
||||
if (isEmail(etMailbox.getText().toString().trim()) && etMailbox.getText().toString().trim().length() > 31) {
|
||||
Toast.makeText(this, "邮箱验证成功", Toast.LENGTH_SHORT).show();
|
||||
} else {
|
||||
Toast.makeText(this, "邮箱格式错误", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
break;
|
||||
case R.id.btn_save:
|
||||
final String userphone = etPhone.getText().toString().trim();
|
||||
userphone = etPhone.getText().toString().trim();
|
||||
userqq = etQq.getText().toString().trim();
|
||||
final String usermailbox = etMailbox.getText().toString().trim();
|
||||
if (!RegexUtil.isPhone(userphone)) {
|
||||
Toast.makeText(this, "手机号输入错误", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
if (userqq.length() > 11) {
|
||||
Toast.makeText(this, "QQ号输入错误", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
if (usermailbox.length() > 31) {
|
||||
Toast.makeText(this, "邮箱输入错误", Toast.LENGTH_SHORT).show();
|
||||
usermailbox = etMailbox.getText().toString().trim();
|
||||
boolean isQQNum_matcher = userqq.matches("[1-9]\\d{4,10}");
|
||||
// 邮箱匹配结果
|
||||
boolean isEmail_matcher = usermailbox.matches("^([a-zA-Z0-9_\\-\\.]+)@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.)|(([a-zA-Z0-9\\-]+\\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\\]?)$");
|
||||
//
|
||||
if (TextUtils.isEmpty(userphone) || TextUtils.isEmpty(userqq) || TextUtils.isEmpty(usermailbox)) {
|
||||
if (!RegexUtil.isPhone(userphone)) {
|
||||
Toast.makeText(this, "手机号输入错误", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
if (isQQNum_matcher && userqq.length() < 11 && userqq.length() > 5) {
|
||||
Toast.makeText(this, "QQ号输入错误", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
if (isEmail_matcher) {
|
||||
Toast.makeText(this, "邮箱格式错误", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
}
|
||||
netWork();
|
||||
break;
|
||||
@ -184,24 +193,12 @@ public class UserActivity extends BaseActivity implements View.OnClickListener {
|
||||
});
|
||||
}
|
||||
|
||||
private static String qq() {
|
||||
String qq = "23412312";
|
||||
String regex = "[1-9][0-9]{4,11}";
|
||||
boolean flag = qq.matches(regex);
|
||||
if (flag) {
|
||||
System.out.println("输入正确!!");
|
||||
} else {
|
||||
System.out.println("输入正确!!");
|
||||
}
|
||||
return qq();
|
||||
|
||||
}
|
||||
|
||||
public static boolean isEmail(String email) {
|
||||
if (null == email || "".equals(email)) return false;
|
||||
Matcher m = compile.matcher(email);
|
||||
return m.matches();
|
||||
}
|
||||
// public static boolean isEmail(String email) {
|
||||
// if (null == email || "".equals(email)) return false;
|
||||
// Matcher m = compile.matcher(email);
|
||||
// return m.matches();
|
||||
// }
|
||||
|
||||
private void showPickerView() {// 弹出选择器(省市区三级联动)
|
||||
OptionsPickerView pvOptions = new OptionsPickerBuilder(UserActivity.this, new OnOptionsSelectListener() {
|
||||
@ -320,4 +317,5 @@ public class UserActivity extends BaseActivity implements View.OnClickListener {
|
||||
return detail;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -54,8 +54,9 @@ public class CapacityMeasureAdapter extends RecyclerView.Adapter<CapacityMeasure
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
|
||||
final boolean single = measureList.get(position).isSingle();//是否多选
|
||||
holder.tvMeasure.setText((position + 1) + measureList.get(position).getQuestion());
|
||||
// holder.tvMeasure.setText((position + 1)+"、" + measureList.get(position).getQuestion());
|
||||
if (single) {
|
||||
holder.tvMeasure.setText((position + 1)+"、" + measureList.get(position).getQuestion()+"(单选)");
|
||||
RadioGroup radioGroup = new RadioGroup(context);
|
||||
radioGroup.setOrientation(LinearLayout.VERTICAL);
|
||||
holder.llOption.addView(radioGroup);
|
||||
@ -66,6 +67,7 @@ public class CapacityMeasureAdapter extends RecyclerView.Adapter<CapacityMeasure
|
||||
}
|
||||
}
|
||||
} else {
|
||||
holder.tvMeasure.setText((position + 1)+"、" + measureList.get(position).getQuestion()+"(多选)");
|
||||
List<?> optionList = measureList.get(position).getOption();
|
||||
if (optionList != null && !optionList.isEmpty()) {
|
||||
for (int i = 0; i < optionList.size(); i++) {
|
||||
|
@ -56,6 +56,9 @@ public class Constant {
|
||||
public static final int MAIN_OTHER = 23;//其他的Fragment 对地图页面marker 的一个展示
|
||||
public static final int OTHER_WORD = 25;//地图页面marker 的经纬都回传
|
||||
public static final int CHARGING_STATION_PILE = 26;//跳转到充电桩 传给数据
|
||||
|
||||
|
||||
public static String USER_ATTESTATION_NAME; //实名认证姓名 银行卡
|
||||
/**
|
||||
* 用户当前位置
|
||||
*/
|
||||
|
@ -3,6 +3,7 @@ package com.navinfo.outdoor.fragment;
|
||||
import android.app.Dialog;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.os.Message;
|
||||
import android.util.Log;
|
||||
import android.view.Gravity;
|
||||
import android.view.View;
|
||||
@ -13,11 +14,13 @@ import android.widget.EditText;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.recyclerview.widget.DividerItemDecoration;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.kongzue.dialog.interfaces.OnDialogButtonClickListener;
|
||||
import com.kongzue.dialog.util.BaseDialog;
|
||||
@ -26,6 +29,7 @@ import com.lzy.okgo.OkGo;
|
||||
import com.lzy.okgo.model.Response;
|
||||
import com.navinfo.outdoor.R;
|
||||
import com.navinfo.outdoor.adapter.BankAdapter;
|
||||
import com.navinfo.outdoor.api.Constant;
|
||||
import com.navinfo.outdoor.base.BaseFragment;
|
||||
import com.navinfo.outdoor.bean.BankPathBean;
|
||||
import com.navinfo.outdoor.bean.BankPhoneBean;
|
||||
@ -33,9 +37,14 @@ import com.navinfo.outdoor.http.DialogCallback;
|
||||
import com.navinfo.outdoor.http.HttpInterface;
|
||||
import com.navinfo.outdoor.util.GetJsonDataUtil;
|
||||
import com.navinfo.outdoor.util.PhotoPathUtil;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
import org.json.JSONArray;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import static android.app.Activity.RESULT_OK;
|
||||
|
||||
/**
|
||||
@ -51,6 +60,8 @@ public class GatheringFragment extends BaseFragment implements View.OnClickListe
|
||||
private ImageView gatheringCamera;
|
||||
private String gatheringPath;
|
||||
private ArrayList<File> gatheringList;
|
||||
private ArrayList<BankPathBean> jsonBean;
|
||||
private String value;
|
||||
|
||||
|
||||
public static GatheringFragment newInstance(Bundle bundle) {
|
||||
@ -77,9 +88,13 @@ public class GatheringFragment extends BaseFragment implements View.OnClickListe
|
||||
btnBank = findViewById(R.id.btn_bank);
|
||||
btnBank.setOnClickListener(this::onClick);
|
||||
tvName = (TextView) findViewById(R.id.tv_name);
|
||||
if (Constant.USER_ATTESTATION_NAME!=null){
|
||||
tvName.setText(Constant.USER_ATTESTATION_NAME);
|
||||
}
|
||||
etBankNum = (EditText) findViewById(R.id.et_bank_num);
|
||||
gatheringCamera = (ImageView) findViewById(R.id.gathering_camera);
|
||||
gatheringCamera.setOnClickListener(this::onClick);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -98,7 +113,8 @@ public class GatheringFragment extends BaseFragment implements View.OnClickListe
|
||||
break;
|
||||
case R.id.iv_bank:
|
||||
String bankJson = new GetJsonDataUtil().getJson(getContext(), "bank.json");//获取assets目录下的json文件数据
|
||||
ArrayList<BankPathBean> jsonBean = parseData(bankJson);//用Gson 转成实体
|
||||
//用Gson 转成实体
|
||||
jsonBean = parseData(bankJson);
|
||||
Dialog dialog = new Dialog(getContext());
|
||||
//弹窗点击周围空白处弹出层自动消失弹窗消失(false时为点击周围空白处弹出层不自动消失)
|
||||
dialog.setCanceledOnTouchOutside(true);
|
||||
@ -114,7 +130,7 @@ public class GatheringFragment extends BaseFragment implements View.OnClickListe
|
||||
public void onClick(int pos) {
|
||||
|
||||
tvBank.setText(jsonBean.get(pos).getLabel());
|
||||
|
||||
value = jsonBean.get(pos).getValue();
|
||||
bankAdapter.notifyDataSetChanged();
|
||||
dialog.dismiss();
|
||||
}
|
||||
@ -144,6 +160,7 @@ public class GatheringFragment extends BaseFragment implements View.OnClickListe
|
||||
Toast.makeText(getContext(), "身份证照片不能为空", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
|
||||
gatheringList.add(gatheringFile);
|
||||
String etBankAccount = etBankNum.getText().toString().trim();
|
||||
if (etBankAccount == null || etBankAccount.equals("")) {
|
||||
@ -151,13 +168,12 @@ public class GatheringFragment extends BaseFragment implements View.OnClickListe
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
OkGo
|
||||
// 请求方式和请求url
|
||||
.<BankPhoneBean>post(HttpInterface.USER_BANKCARD_UP_DATA)
|
||||
// 请求的 tag, 主要用于取消对应的请求
|
||||
.params("userid", "1")
|
||||
.params("bankAccount", "123456")//银行id
|
||||
.params("bankAccount", value)//银行id
|
||||
.params("idNumber", etBankAccount)//银行卡号
|
||||
.addFileParams("file", gatheringList)//银行卡拍照
|
||||
.tag(this)
|
||||
@ -219,4 +235,5 @@ public class GatheringFragment extends BaseFragment implements View.OnClickListe
|
||||
}
|
||||
return detail;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -3,6 +3,7 @@ package com.navinfo.outdoor.fragment;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Bitmap;
|
||||
import android.os.Bundle;
|
||||
import android.os.Message;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
@ -19,11 +20,16 @@ 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.activity.FragmentManagement;
|
||||
import com.navinfo.outdoor.api.Constant;
|
||||
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 com.umeng.commonsdk.debug.I;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
@ -47,6 +53,7 @@ public class UserAttestationFragment extends BaseFragment implements View.OnClic
|
||||
private ImageView ivAttestation3;
|
||||
private String takePhotoPath3;
|
||||
private ArrayList<File> takePhoneList;
|
||||
private String attestationName;
|
||||
|
||||
|
||||
public static UserAttestationFragment newInstance(Bundle bundle) {
|
||||
@ -60,6 +67,8 @@ public class UserAttestationFragment extends BaseFragment implements View.OnClic
|
||||
return R.layout.user_attestation_fragment;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
protected void initData() {
|
||||
super.initData();
|
||||
@ -135,26 +144,37 @@ public class UserAttestationFragment extends BaseFragment implements View.OnClic
|
||||
takePhoneList.add(takePhotoFile1);
|
||||
takePhoneList.add(takePhotoFile2);
|
||||
takePhoneList.add(takePhotoFile3);
|
||||
attestationName = etAttestationName.getText().toString().trim();
|
||||
String namePhone = etNamePhone.getText().toString().trim();
|
||||
|
||||
// Message obtain = Message.obtain();
|
||||
// obtain.what = Constant.USER_ATTESTATION_NAME;
|
||||
// obtain.obj = attestationName;
|
||||
// EventBus.getDefault().post(obtain);
|
||||
|
||||
OkGo
|
||||
// 请求方式和请求url
|
||||
.<NameAuthenticationBean>post(HttpInterface.USER_AUTH_ADD)
|
||||
// 请求的 tag, 主要用于取消对应的请求
|
||||
.params("userid", "1")
|
||||
.params("name", etAttestationName.getFreezesText())
|
||||
.params("idnum", etNamePhone.getFreezesText())
|
||||
.params("name", attestationName)
|
||||
.params("idnum", namePhone)
|
||||
.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();
|
||||
Constant.USER_ATTESTATION_NAME=attestationName;
|
||||
return false;
|
||||
}
|
||||
});
|
||||
@ -162,7 +182,7 @@ public class UserAttestationFragment extends BaseFragment implements View.OnClic
|
||||
MessageDialog.show((AppCompatActivity) getActivity(), "提示", "通过", "确定", "取消").setOkButton(new OnDialogButtonClickListener() {
|
||||
@Override
|
||||
public boolean onClick(BaseDialog baseDialog, View v) {
|
||||
// Toast.makeText(getContext(), "点击了确定", Toast.LENGTH_SHORT).show();
|
||||
Constant.USER_ATTESTATION_NAME=attestationName;
|
||||
return false;
|
||||
}
|
||||
});
|
||||
@ -199,7 +219,8 @@ public class UserAttestationFragment extends BaseFragment implements View.OnClic
|
||||
Bundle extras = data.getExtras();//从Intent中获取附加值
|
||||
//从附加值中获取返回的图像
|
||||
Bitmap bitmap = (Bitmap) extras.get("data");
|
||||
ivAttestation2.setImageBitmap(bitmap);//显示图像
|
||||
ivAttestation3.setImageBitmap(bitmap);//显示图像
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -191,7 +191,7 @@
|
||||
android:id="@+id/tv_qq"
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="QQ号码*"
|
||||
android:text="QQ号码"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginLeft="20dp"
|
||||
style="@style/user_text_style"
|
||||
@ -203,6 +203,7 @@
|
||||
android:layout_centerVertical="true"
|
||||
android:hint="请输入QQ号码 "
|
||||
style="@style/user_hint_style"
|
||||
android:digits="0123456789"
|
||||
android:layout_height="wrap_content"
|
||||
/>
|
||||
</RelativeLayout>
|
||||
@ -222,7 +223,7 @@
|
||||
android:id="@+id/tv_mailbox"
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="电子邮箱*"
|
||||
android:text="电子邮箱"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginLeft="20dp"
|
||||
style="@style/user_text_style"
|
||||
|
@ -2,10 +2,12 @@
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
android:orientation="vertical">
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="20dp"
|
||||
>
|
||||
<RadioButton
|
||||
android:id="@+id/tv_option_layer_index"
|
||||
|
@ -2,6 +2,7 @@
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
|
Loading…
x
Reference in New Issue
Block a user