|
|
@@ -1,666 +0,0 @@
|
|
|
-package com.sheep.groups.creditcard;
|
|
|
-
|
|
|
-import android.app.DatePickerDialog;
|
|
|
-import android.content.Context;
|
|
|
-import android.os.Bundle;
|
|
|
-import android.support.annotation.Nullable;
|
|
|
-import android.support.v7.widget.AppCompatSpinner;
|
|
|
-import android.text.TextUtils;
|
|
|
-import android.view.View;
|
|
|
-import android.widget.AdapterView;
|
|
|
-import android.widget.ArrayAdapter;
|
|
|
-import android.widget.Button;
|
|
|
-import android.widget.CheckBox;
|
|
|
-import android.widget.CompoundButton;
|
|
|
-import android.widget.DatePicker;
|
|
|
-import android.widget.RadioButton;
|
|
|
-import android.widget.RadioGroup;
|
|
|
-import android.widget.Spinner;
|
|
|
-import android.widget.TextView;
|
|
|
-import android.widget.Toast;
|
|
|
-
|
|
|
-import com.kfzs.duanduan.react.ReactUtil;
|
|
|
-import com.kfzs.libs.DaggerFragment;
|
|
|
-import com.kfzs.libs.IPresenter;
|
|
|
-import com.kfzs.libs.IView;
|
|
|
-import com.kfzs.libs.widget.CompleteCommitEditText;
|
|
|
-import com.kfzs.libs.widget.TimeEditText;
|
|
|
-import com.kfzs.libs.widget.alpha.AlphaButton;
|
|
|
-import com.sheep.jiuyan.samllsheep.BuildConfig;
|
|
|
-import com.sheep.jiuyan.samllsheep.R;
|
|
|
-import com.sheep.jiuyan.samllsheep.SheepApp;
|
|
|
-import com.sheep.jiuyan.samllsheep.utils.SpUtils;
|
|
|
-
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.Calendar;
|
|
|
-import java.util.HashMap;
|
|
|
-import java.util.List;
|
|
|
-import java.util.Map;
|
|
|
-
|
|
|
-import javax.inject.Inject;
|
|
|
-
|
|
|
-import butterknife.BindView;
|
|
|
-import butterknife.OnClick;
|
|
|
-
|
|
|
-/**
|
|
|
- * Created by guoxin on 2018/4/2.
|
|
|
- */
|
|
|
-
|
|
|
-public class ApplyForCreditCardDetailsFragment extends DaggerFragment implements DetailsContact.View{
|
|
|
-
|
|
|
-
|
|
|
- @BindView(R.id.et_city)
|
|
|
- CompleteCommitEditText etCity;
|
|
|
- @BindView(R.id.et_address)
|
|
|
- CompleteCommitEditText etAddress;
|
|
|
- @BindView(R.id.et_email)
|
|
|
- CompleteCommitEditText etEmail;
|
|
|
- @BindView(R.id.et_education)
|
|
|
- CompleteCommitEditText etEducation;
|
|
|
- @BindView(R.id.et_company_name)
|
|
|
- TimeEditText etCompanyName;
|
|
|
- @BindView(R.id.et_company_city)
|
|
|
- CompleteCommitEditText etCompanyCity;
|
|
|
- @BindView(R.id.et_company_address)
|
|
|
- TimeEditText etCompanyAddress;
|
|
|
- @BindView(R.id.et_company_phone_no)
|
|
|
- TimeEditText etCompanyPhoneNo;
|
|
|
- @BindView(R.id.et_company_phone_q)
|
|
|
- TimeEditText etCompanyPhoneQ;
|
|
|
- @BindView(R.id.et_company_phone_f)
|
|
|
- TimeEditText etCompanyPhoneF;
|
|
|
- @BindView(R.id.et_work_year)
|
|
|
- CompleteCommitEditText etWorkYear;
|
|
|
- @BindView(R.id.et_ir_name)
|
|
|
- CompleteCommitEditText etIRName;
|
|
|
- @BindView(R.id.et_ir_mobile)
|
|
|
- CompleteCommitEditText etIRMobile;
|
|
|
- @BindView(R.id.et_other_r_name)
|
|
|
- CompleteCommitEditText etOtherName;
|
|
|
- @BindView(R.id.et_other_r_mobile)
|
|
|
- CompleteCommitEditText etOtherMobile;
|
|
|
- @BindView(R.id.tv_id_no_expire)
|
|
|
- TextView tvIdCardExpire;
|
|
|
- @BindView(R.id.et_car_no)
|
|
|
- CompleteCommitEditText etCarNo;
|
|
|
- @BindView(R.id.et_home_q)
|
|
|
- CompleteCommitEditText etHomeQ;
|
|
|
- @BindView(R.id.et_home_phone)
|
|
|
- CompleteCommitEditText etHomePhone;
|
|
|
- @BindView(R.id.et_qq)
|
|
|
- CompleteCommitEditText etQQ;
|
|
|
-
|
|
|
- @BindView(R.id.rg_marray)
|
|
|
- RadioGroup rgMarray;
|
|
|
- @BindView(R.id.rb_marray_y)
|
|
|
- RadioButton rbY;
|
|
|
- @BindView(R.id.rb_marray_n)
|
|
|
- RadioButton rbN;
|
|
|
- @BindView(R.id.rb_marray_o)
|
|
|
- RadioButton rbO;
|
|
|
- @BindView(R.id.cb_agreement)
|
|
|
- CheckBox cbAgreement;
|
|
|
- @BindView(R.id.sp_relationship_immediate_relatives)
|
|
|
- AppCompatSpinner spImmediateRelationship;
|
|
|
- @BindView(R.id.sp_relationship_other)
|
|
|
- AppCompatSpinner spOtherRelationship;
|
|
|
- @BindView(R.id.cb_expire)
|
|
|
- CheckBox cbExpire;
|
|
|
-
|
|
|
- @BindView(R.id.btn_next)
|
|
|
- AlphaButton btnNext;
|
|
|
-
|
|
|
- @Inject
|
|
|
- DetailsPresenter presenter;
|
|
|
- OnNextStepCallback onNextStepCallback;
|
|
|
- private ArrayAdapter<CharSequence> adapterImmediateRelatives;
|
|
|
- private ArrayAdapter<CharSequence> adapterOther;
|
|
|
-
|
|
|
-// @Override
|
|
|
-// public void onAttach(Context context) {
|
|
|
-// super.onAttach(context);
|
|
|
-// try {
|
|
|
-// onNextStepCallback = (OnNextStepCallback) context;
|
|
|
-// }
|
|
|
-// catch (ClassCastException e){
|
|
|
-// }
|
|
|
-// }
|
|
|
-
|
|
|
-
|
|
|
- public void setOnNextStepCallback(OnNextStepCallback onNextStepCallback) {
|
|
|
- this.onNextStepCallback = onNextStepCallback;
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public void setupDaggerComponent() {
|
|
|
- DaggerDetailsComponent.builder().httpComponent(SheepApp.getInstance().getHttpComponent()).build().inject(this);
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public IPresenter currentPresenter() {
|
|
|
- return presenter;
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public IView currentIView() {
|
|
|
- return this;
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public int layoutResId() {
|
|
|
- return R.layout.fragment_apply_for_credit_card_details;
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public void setupViews(@Nullable Bundle savedInstanceState) {
|
|
|
- test();
|
|
|
-
|
|
|
- adapterImmediateRelatives = ArrayAdapter.createFromResource(activity, R.array.credit_card_relationship_immediate_relatives_type, R.layout.spinner_text_item);
|
|
|
- spImmediateRelationship.setAdapter(adapterImmediateRelatives);
|
|
|
-
|
|
|
- adapterOther = ArrayAdapter.createFromResource(activity, R.array.credit_card_relationship_other_type, R.layout.spinner_text_item);
|
|
|
- spOtherRelationship.setAdapter(adapterOther);
|
|
|
-
|
|
|
- //
|
|
|
- setOnCompleteEdit(etCity,"p_city");
|
|
|
- setOnCompleteEdit(etAddress,"p_address");
|
|
|
- setOnCompleteEdit(etEmail,"p_email");
|
|
|
- rbY.setTag(CreditCardInfosManager.MARRY_Y);
|
|
|
- rbN.setTag(CreditCardInfosManager.MARRY_N);
|
|
|
- rbO.setTag(CreditCardInfosManager.MARRY_O);
|
|
|
- //p_marray
|
|
|
- rgMarray.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
|
|
|
- @Override
|
|
|
- public void onCheckedChanged(RadioGroup group, int checkedId) {
|
|
|
- String value = "";
|
|
|
- if(checkedId == R.id.rb_marray_n){
|
|
|
- value = (String) rbN.getTag();
|
|
|
- }
|
|
|
- else if(checkedId == R.id.rb_marray_y){
|
|
|
- value = (String) rbY.getTag();
|
|
|
- }
|
|
|
- else if(checkedId == R.id.rb_marray_o){
|
|
|
- value = (String) rbO.getTag();
|
|
|
- }
|
|
|
- presenter.commitFormData("p_marray",value,CreditCardInfosManager.getInstance().card_id);
|
|
|
- CreditCardInfosManager.getInstance().p_marray = value;
|
|
|
- }
|
|
|
- });
|
|
|
-// -1:请选择教育程度 6:博士及以上 5:硕士 4:本科 3:大专 2:高中/中专 1:初中及以下
|
|
|
- List<String> stringList = new ArrayList<>();
|
|
|
- stringList.add("请选择教育程度");
|
|
|
- stringList.add("博士及以上");
|
|
|
- stringList.add("硕士");
|
|
|
- stringList.add("本科");
|
|
|
- stringList.add("大专");
|
|
|
- stringList.add("高中/中专");
|
|
|
- stringList.add("初中及以下");
|
|
|
- final List<String> idList = new ArrayList<>();
|
|
|
- idList.add("-1");
|
|
|
- idList.add("6");
|
|
|
- idList.add("5");
|
|
|
- idList.add("4");
|
|
|
- idList.add("3");
|
|
|
- idList.add("2");
|
|
|
- idList.add("1");
|
|
|
- ArrayAdapter arrayAdapter = new ArrayAdapter<>(getContext(), android.R.layout.simple_list_item_1, stringList);
|
|
|
- etEducation.setAdapter(arrayAdapter);
|
|
|
- etEducation.setFocusable(false);
|
|
|
- etEducation.setOnClickListener(new View.OnClickListener() {
|
|
|
- @Override
|
|
|
- public void onClick(View view) {
|
|
|
- etEducation.showDropDown();
|
|
|
- }
|
|
|
- });
|
|
|
- etEducation.setOnItemClickListener(new AdapterView.OnItemClickListener() {
|
|
|
- @Override
|
|
|
- public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
|
|
|
- presenter.commitFormData("p_edu",idList.get(position),CreditCardInfosManager.getInstance().card_id);
|
|
|
- }
|
|
|
- });
|
|
|
-
|
|
|
-// setOnCompleteEdit(etEducation,"p_edu");
|
|
|
- setOnCompleteEdit(etCompanyName,"w_name");
|
|
|
- setOnCompleteEdit(etCompanyCity,"w_city");
|
|
|
- setOnCompleteEdit(etCompanyAddress,"w_address");
|
|
|
- setOnCompleteEditDouble(etCompanyPhoneNo,etCompanyPhoneQ,"w_tel");//要取得两个值,所以单独设置
|
|
|
-// setOnCompleteEdit(etCompanyPhoneQ,"p_city");
|
|
|
- setOnCompleteEdit(etWorkYear,"w_age");
|
|
|
- setOnCompleteEdit(etIRName,"c_d_name");
|
|
|
- setOnCompleteEdit(etIRMobile,"c_d_mobile");
|
|
|
- CreditCardInfosManager.getInstance().c_d_relation = adapterImmediateRelatives.getItem(0).toString();
|
|
|
- //c_d_relation
|
|
|
- spImmediateRelationship.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
|
|
- @Override
|
|
|
- public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
|
|
- String value = (String) adapterImmediateRelatives.getItem(position);
|
|
|
- CreditCardInfosManager.getInstance().c_d_relation = value;
|
|
|
- presenter.commitFormData("c_d_relation",value,CreditCardInfosManager.getInstance().card_id);
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public void onNothingSelected(AdapterView<?> parent) {
|
|
|
-
|
|
|
- }
|
|
|
- });
|
|
|
- CreditCardInfosManager.getInstance().c_o_relation = adapterOther.getItem(0).toString();
|
|
|
- //c_o_relation
|
|
|
- spOtherRelationship.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
|
|
- @Override
|
|
|
- public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
|
|
- String value = adapterOther.getItem(position).toString();
|
|
|
- CreditCardInfosManager.getInstance().c_d_relation = value;
|
|
|
- presenter.commitFormData("c_o_relation",value,CreditCardInfosManager.getInstance().card_id);
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public void onNothingSelected(AdapterView<?> parent) {
|
|
|
-
|
|
|
- }
|
|
|
- });
|
|
|
-
|
|
|
- setOnCompleteEdit(etOtherName,"c_o_name");
|
|
|
- setOnCompleteEdit(etOtherMobile,"c_o_mobile");
|
|
|
- tvIdCardExpire.setOnClickListener(new View.OnClickListener() {
|
|
|
- @Override
|
|
|
- public void onClick(View v) {
|
|
|
- //显示日历,key为o_id_expire
|
|
|
- showDatePicker();
|
|
|
- }
|
|
|
- });
|
|
|
- //o_id_expire
|
|
|
- cbExpire.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
|
|
- @Override
|
|
|
- public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
|
|
- tvIdCardExpire.setVisibility(isChecked ? View.GONE : View.VISIBLE);
|
|
|
- if(isChecked){
|
|
|
- CreditCardInfosManager.getInstance().o_id_expire = CreditCardInfosManager.EXPIRE_LONG;
|
|
|
- presenter.commitFormData("o_id_expire",CreditCardInfosManager.EXPIRE_LONG,CreditCardInfosManager.getInstance().card_id);
|
|
|
- }
|
|
|
- else CreditCardInfosManager.getInstance().o_id_expire = tvIdCardExpire.getText().toString();
|
|
|
-
|
|
|
- }
|
|
|
- });
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- setOnCompleteEdit(etCarNo,"o_p_number");
|
|
|
-// setOnCompleteEdit(etHomeQ,"p_city");
|
|
|
- setOnCompleteEditDouble(etHomePhone,etHomeQ,"o_tel");//要取得两个值,所以单独设置
|
|
|
- etQQ.setAfterTextChangedCanComplete(true);
|
|
|
- setOnCompleteEdit(etQQ,"o_qq");
|
|
|
- //is_agree
|
|
|
- cbAgreement.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
|
|
- @Override
|
|
|
- public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
|
|
- CreditCardInfosManager.getInstance().is_agree = isChecked;
|
|
|
- presenter.commitFormData("is_agree",String.valueOf(isChecked),CreditCardInfosManager.getInstance().card_id);
|
|
|
- }
|
|
|
- });
|
|
|
-
|
|
|
- //页面进入时统计
|
|
|
- Map<String,String> map = new HashMap<>();
|
|
|
- map.put("token", SpUtils.getOpenId(SheepApp.mContext));
|
|
|
- map.put("key","second_enter");
|
|
|
- map.put("card_id",CreditCardInfosManager.getInstance().card_id);
|
|
|
- presenter.statisticsDetails(map);
|
|
|
-
|
|
|
-
|
|
|
-// test();
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- private void test(){
|
|
|
- if(BuildConfig.DEBUG){
|
|
|
- etCompanyName.setText("成都云端助手有限公司");
|
|
|
- etCompanyAddress.setText("成都市高新区天府二街蜀都中心");
|
|
|
- }
|
|
|
-
|
|
|
-// etCity.setText("成都");
|
|
|
-// etAddress.setText("成都市高新区天府二街软件园");
|
|
|
-// etEmail.setText("506578835@qq.com");
|
|
|
-// rgMarray.check(R.id.rb_marray_n);
|
|
|
-// etEducation.setText("大学");
|
|
|
-// etCompanyCity.setText("成都");
|
|
|
-// etCompanyName.setText("成都云端助手有限公司");
|
|
|
-// etCompanyAddress.setText("成都市高新区天府二街蜀都中心");
|
|
|
-// etCompanyPhoneQ.setText("028");
|
|
|
-// etCompanyPhoneNo.setText("84074658");
|
|
|
-// etWorkYear.setText("7");
|
|
|
-// etIRName.setText("郭伟伟");
|
|
|
-// etIRMobile.setText("18608004678");
|
|
|
-// etOtherName.setText("黄明明");
|
|
|
-// etOtherMobile.setText("15946587456");
|
|
|
-// cbExpire.setChecked(true);
|
|
|
-//// tvIdCardExpire.setText("2087/12/11");
|
|
|
-//// etCarNo.setText("川A4554DH");
|
|
|
-//// etHomeQ.setText("028");
|
|
|
-//// etHomePhone.setText("84074663");
|
|
|
-//// etQQ.setText("506578835");
|
|
|
-// cbAgreement.setChecked(true);
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- private void showDatePicker(){
|
|
|
- // 获得日历对象
|
|
|
- Calendar c = Calendar.getInstance();
|
|
|
- // 获取当前年份
|
|
|
- int year = c.get(Calendar.YEAR);
|
|
|
- // 获取当前月份
|
|
|
- int monthOfYear = c.get(Calendar.MONTH);
|
|
|
- // 获取当前月份的天数
|
|
|
- int dayOfMonth = c.get(Calendar.DAY_OF_MONTH);
|
|
|
-
|
|
|
- new DatePickerDialog(activity, new DatePickerDialog.OnDateSetListener() {
|
|
|
- @Override
|
|
|
- public void onDateSet(DatePicker view, int year, int month, int dayOfMonth) {
|
|
|
- String expire = year + "/" + month + "/" + dayOfMonth;
|
|
|
- tvIdCardExpire.setText(expire);
|
|
|
- CreditCardInfosManager.getInstance().o_id_expire = expire;
|
|
|
- presenter.commitFormData("o_id_expire",expire,CreditCardInfosManager.getInstance().card_id);
|
|
|
- }
|
|
|
- },year,monthOfYear,dayOfMonth).show();
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- private void setOnCompleteEdit(final CompleteCommitEditText et, final String key){
|
|
|
- et.setOnCompleteEditListener(new CompleteCommitEditText.OnCompleteEditListener() {
|
|
|
- @Override
|
|
|
- public void onCompleteEdit(String text) {
|
|
|
- presenter.commitFormData(key,et.getText().toString(),CreditCardInfosManager.getInstance().card_id);
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
-
|
|
|
- private void setOnCompleteEditDouble(final CompleteCommitEditText et,final CompleteCommitEditText etQ, final String key){
|
|
|
- et.setOnCompleteEditListener(new CompleteCommitEditText.OnCompleteEditListener() {
|
|
|
- @Override
|
|
|
- public void onCompleteEdit(String text) {
|
|
|
- presenter.commitFormData(key,etQ.getText().toString()+et.getText().toString(),CreditCardInfosManager.getInstance().card_id);
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- @OnClick(R.id.btn_next)
|
|
|
- public void btnClick(View view){
|
|
|
-
|
|
|
- if(TextUtils.isEmpty(etCity.getText().toString())){
|
|
|
- Toast.makeText(activity,"请填写住宅城市",Toast.LENGTH_SHORT).show();
|
|
|
- return;
|
|
|
- }
|
|
|
- if(TextUtils.isEmpty(etAddress.getText().toString())){
|
|
|
- Toast.makeText(activity,"请填写住宅地址",Toast.LENGTH_SHORT).show();
|
|
|
- return;
|
|
|
- }
|
|
|
- if(TextUtils.isEmpty(etEmail.getText().toString())){
|
|
|
- Toast.makeText(activity,"请填写电子邮箱",Toast.LENGTH_SHORT).show();
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
- if(!RegexUtils.isEmail(etEmail.getText().toString())){
|
|
|
- Toast.makeText(activity,"电子邮箱格式不正确",Toast.LENGTH_SHORT).show();
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- if(TextUtils.isEmpty(CreditCardInfosManager.getInstance().p_marray)){
|
|
|
- Toast.makeText(activity,"请选择婚姻状况",Toast.LENGTH_SHORT).show();
|
|
|
- return;
|
|
|
- }
|
|
|
- if(TextUtils.isEmpty(etEducation.getText().toString())){
|
|
|
- Toast.makeText(activity,"请填写教育程度",Toast.LENGTH_SHORT).show();
|
|
|
- return;
|
|
|
- }
|
|
|
- if(TextUtils.isEmpty(etCompanyName.getText().toString())){
|
|
|
- Toast.makeText(activity,"请填写单位名称",Toast.LENGTH_SHORT).show();
|
|
|
- return;
|
|
|
- }
|
|
|
- if(TextUtils.isEmpty(etCompanyAddress.getText().toString())){
|
|
|
- Toast.makeText(activity,"请填写单位地址",Toast.LENGTH_SHORT).show();
|
|
|
- return;
|
|
|
- }
|
|
|
- if(TextUtils.isEmpty(etCompanyPhoneNo.getText().toString()) || TextUtils.isEmpty(etCompanyPhoneQ.getText().toString())){
|
|
|
- Toast.makeText(activity,"请填写单位电话",Toast.LENGTH_SHORT).show();
|
|
|
- return;
|
|
|
- }
|
|
|
-// if(RegexUtils.isTel(etCompanyPhoneNo.getText().toString() +"- "+ etCompanyPhoneQ.getText().toString())){
|
|
|
-// Toast.makeText(activity,"单位电话格式不正确",Toast.LENGTH_SHORT).show();
|
|
|
-// return;
|
|
|
-// }
|
|
|
-
|
|
|
- if(TextUtils.isEmpty(etWorkYear.getText().toString())){
|
|
|
- Toast.makeText(activity,"请填写工作年限",Toast.LENGTH_SHORT).show();
|
|
|
- return;
|
|
|
- }
|
|
|
- try{
|
|
|
- int workY = Integer.parseInt(etWorkYear.getText().toString());
|
|
|
- if(50 <= workY){
|
|
|
- Toast.makeText(activity,"工作年限不能大于50",Toast.LENGTH_SHORT).show();
|
|
|
- return;
|
|
|
- }
|
|
|
- }
|
|
|
- catch (Exception e){
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- if(TextUtils.isEmpty(etIRName.getText().toString())){
|
|
|
- Toast.makeText(activity,"请填写直属亲属姓名",Toast.LENGTH_SHORT).show();
|
|
|
- return;
|
|
|
- }
|
|
|
- if(TextUtils.isEmpty(etIRMobile.getText().toString())){
|
|
|
- Toast.makeText(activity,"请填写直属亲属手机号",Toast.LENGTH_SHORT).show();
|
|
|
- return;
|
|
|
- }
|
|
|
- if(!RegexUtils.isMobileSimple(etIRMobile.getText().toString())){
|
|
|
- Toast.makeText(activity,"直属亲属手机号不正确",Toast.LENGTH_SHORT).show();
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
- if(TextUtils.isEmpty(CreditCardInfosManager.getInstance().c_d_relation)){
|
|
|
- Toast.makeText(activity,"请选择直属亲属关系",Toast.LENGTH_SHORT).show();
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
- if(TextUtils.isEmpty(etOtherName.getText().toString())){
|
|
|
- Toast.makeText(activity,"请填写其他联系人姓名",Toast.LENGTH_SHORT).show();
|
|
|
- return;
|
|
|
- }
|
|
|
- if(TextUtils.isEmpty(etOtherMobile.getText().toString())){
|
|
|
- Toast.makeText(activity,"请填写其他联系人手机号",Toast.LENGTH_SHORT).show();
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
- if(!RegexUtils.isMobileSimple(etOtherMobile.getText().toString())){
|
|
|
- Toast.makeText(activity,"其他联系人手机号不正确",Toast.LENGTH_SHORT).show();
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
- if(TextUtils.isEmpty(CreditCardInfosManager.getInstance().c_o_relation)){
|
|
|
- Toast.makeText(activity,"请选择其他联系人关系",Toast.LENGTH_SHORT).show();
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
- //有效期
|
|
|
- if(!cbExpire.isChecked() && TextUtils.isEmpty(tvIdCardExpire.getText().toString())){
|
|
|
- Toast.makeText(activity,"请选择证件有效期",Toast.LENGTH_SHORT).show();
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
-// if(!RegexUtils.isTel(etHomePhone.getText().toString() +"- "+ etHomeQ.getText().toString())){
|
|
|
-// Toast.makeText(activity,"住宅电话格式不正确",Toast.LENGTH_SHORT).show();
|
|
|
-// return;
|
|
|
-// }
|
|
|
-
|
|
|
- //不是必填的
|
|
|
-// if(TextUtils.isEmpty(etQQ.getText().toString())){
|
|
|
-// Toast.makeText(activity,"请填写常用QQ号码",Toast.LENGTH_SHORT).show();
|
|
|
-// return;
|
|
|
-// }
|
|
|
-//
|
|
|
-// //不是必填
|
|
|
-// if(TextUtils.isEmpty(etCarNo.getText().toString())){
|
|
|
-// Toast.makeText(activity,"请填写车牌号码",Toast.LENGTH_SHORT).show();
|
|
|
-// return;
|
|
|
-// }
|
|
|
-//
|
|
|
-// //不是必填的
|
|
|
-// if(TextUtils.isEmpty(etHomePhone.getText().toString()) || TextUtils.isEmpty(etHomeQ.getText().toString())){
|
|
|
-// Toast.makeText(activity,"请填写住宅电话",Toast.LENGTH_SHORT).show();
|
|
|
-// return;
|
|
|
-// }
|
|
|
- CreditCardInfosManager manager = CreditCardInfosManager.getInstance();
|
|
|
-
|
|
|
- Map<String,String> map = new HashMap<>();
|
|
|
- String p_city = etCity.getText().toString();
|
|
|
- map.put("p_city",p_city);
|
|
|
- manager.p_city = p_city;
|
|
|
-
|
|
|
- String p_address = etAddress.getText().toString();
|
|
|
- map.put("p_address",p_address);
|
|
|
- manager.p_address = p_address;
|
|
|
-
|
|
|
- String p_email = etEmail.getText().toString();
|
|
|
- map.put("p_email",p_email);
|
|
|
- manager.p_email = p_email;
|
|
|
-
|
|
|
- String p_marray = CreditCardInfosManager.getInstance().p_marray;
|
|
|
- map.put("p_marray",p_marray);
|
|
|
- manager.p_marray = p_marray;
|
|
|
-
|
|
|
- String p_edu = etEducation.getText().toString();
|
|
|
- map.put("p_edu",p_edu);
|
|
|
- manager.p_edu =p_edu;
|
|
|
-
|
|
|
- String w_name = etCompanyName.getText().toString();
|
|
|
- map.put("w_name",w_name);
|
|
|
- manager.w_name = w_name;
|
|
|
-
|
|
|
- String w_city = etCompanyCity.getText().toString();
|
|
|
- map.put("w_city",w_city);
|
|
|
- manager.w_city = w_city;
|
|
|
-
|
|
|
- String w_address = etCompanyAddress.getText().toString();
|
|
|
- map.put("w_address",w_address);
|
|
|
- manager.w_address = w_address;
|
|
|
-
|
|
|
- String w_tel_1 = etCompanyPhoneQ.getText().toString();
|
|
|
- map.put("w_tel_1",w_tel_1);
|
|
|
- manager.w_tel_1 = w_tel_1;
|
|
|
-
|
|
|
- String w_tel_2 = etCompanyPhoneNo.getText().toString();
|
|
|
- map.put("w_tel_2",w_tel_2);
|
|
|
- manager.w_tel_2 = w_tel_2;
|
|
|
-
|
|
|
- String w_tel_3 = etCompanyPhoneF.getText().toString();
|
|
|
- if(!TextUtils.isEmpty(w_tel_3)){
|
|
|
- map.put("w_tel_3",w_tel_3);
|
|
|
- manager.w_tel_3 = w_tel_3;
|
|
|
- }
|
|
|
-
|
|
|
- String w_age = etWorkYear.getText().toString();
|
|
|
- map.put("w_age",w_age);
|
|
|
- manager.w_age = w_age;
|
|
|
-
|
|
|
- String c_d_name = etIRName.getText().toString();
|
|
|
- map.put("c_d_name",c_d_name);
|
|
|
- manager.c_d_name = c_d_name;
|
|
|
-
|
|
|
- String c_d_mobile = etIRMobile.getText().toString();
|
|
|
- map.put("c_d_mobile",c_d_mobile);
|
|
|
- manager.c_d_mobile = c_d_mobile;
|
|
|
-
|
|
|
- map.put("c_d_relation",CreditCardInfosManager.getInstance().c_d_relation);
|
|
|
-
|
|
|
- String c_o_name = etOtherName.getText().toString();
|
|
|
- map.put("c_o_name",c_o_name);
|
|
|
- manager.c_o_name =c_o_name;
|
|
|
-
|
|
|
- String c_o_mobile = etOtherMobile.getText().toString();
|
|
|
- map.put("c_o_mobile",c_o_mobile);
|
|
|
- manager.c_o_mobile = c_o_mobile;
|
|
|
-
|
|
|
- map.put("c_o_relation",CreditCardInfosManager.getInstance().c_o_relation);
|
|
|
-
|
|
|
- if(cbExpire.isChecked()){
|
|
|
- map.put("o_id_expire",CreditCardInfosManager.getInstance().o_id_expire);
|
|
|
- }
|
|
|
- else {
|
|
|
- String o_id_expire = tvIdCardExpire.getText().toString();
|
|
|
- map.put("o_id_expire",o_id_expire);
|
|
|
- manager.o_id_expire = o_id_expire;
|
|
|
- }
|
|
|
-
|
|
|
- String o_p_number = etCarNo.getText().toString();
|
|
|
- if(!TextUtils.isEmpty(o_p_number)){
|
|
|
- map.put("o_p_number",o_p_number);
|
|
|
- manager.o_p_number = o_p_number;
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- String o_tel_1 = etHomeQ.getText().toString();
|
|
|
- if(!TextUtils.isEmpty(o_tel_1)){
|
|
|
- map.put("o_tel_1",o_tel_1);
|
|
|
- manager.o_tel_1 = o_tel_1;
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- String o_tel_2 = etHomePhone.getText().toString();
|
|
|
- if(!TextUtils.isEmpty(o_tel_2)){
|
|
|
- map.put("o_tel_2",o_tel_2);
|
|
|
- manager.o_tel_2 = o_tel_2;
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- String o_qq = etQQ.getText().toString();
|
|
|
- if(!TextUtils.isEmpty(o_qq)){
|
|
|
- map.put("o_qq",o_qq);
|
|
|
- manager.o_qq = o_qq;
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- boolean isAgree = CreditCardInfosManager.getInstance().is_agree;
|
|
|
- map.put("is_agree",isAgree ? "1" : "0");
|
|
|
-
|
|
|
- map.put("token", SpUtils.getOpenId(SheepApp.mContext));
|
|
|
- map.put("card_id",manager.card_id);
|
|
|
-
|
|
|
-// map.put("w_tel_3","876");
|
|
|
-// map.put("o_tel_3","522");
|
|
|
-
|
|
|
- //判断下没有用日历选择有效期,然后直接选择长期有效,会提示没有填有效期。
|
|
|
- presenter.commitDetails(map);
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- @Override
|
|
|
- public boolean isViewActive() {
|
|
|
- return isAdded();
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public void showProgress(String msg) {
|
|
|
- Toast.makeText(activity,msg,Toast.LENGTH_SHORT).show();
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public void goNext() {
|
|
|
- //记录信息
|
|
|
- CreditCardInfosManager manager = CreditCardInfosManager.getInstance();
|
|
|
- manager.comDetail = etCompanyAddress.getTotalFocusTime();
|
|
|
- manager.companyName = etCompanyName.getTotalFocusTime();
|
|
|
- manager.comDetail = etCompanyPhoneNo.getTotalFocusTime()+etCompanyPhoneF.getTotalFocusTime()+etCompanyPhoneQ.getTotalFocusTime();
|
|
|
- manager.secondSumLong = System.currentTimeMillis() - startTime;
|
|
|
-
|
|
|
-// public float comDetail;//停留在单位地址上的时间
|
|
|
-// public float comTel;//停留在单位电话上的时间
|
|
|
-// public float companyName;//停留在公司名字上的时间
|
|
|
-// public float secondSumLong;//停留在页面2上的时间
|
|
|
- onNextStepCallback.onNextStep(ApplyForCardTabFragment.STEP_DETAILS);
|
|
|
- }
|
|
|
-}
|