Bladeren bron

修改定位逻辑

316044749 7 jaren geleden
bovenliggende
commit
d76117e56d
1 gewijzigde bestanden met toevoegingen van 35 en 11 verwijderingen
  1. 35 11
      app/src/main/java/com/ynstkz/shitu/android/activity/ApplyInfoPreviewActivity.java

+ 35 - 11
app/src/main/java/com/ynstkz/shitu/android/activity/ApplyInfoPreviewActivity.java

@@ -2,6 +2,7 @@ package com.ynstkz.shitu.android.activity;
 
 import android.os.Bundle;
 import android.support.annotation.Nullable;
+import android.text.TextUtils;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.widget.Button;
@@ -16,7 +17,7 @@ import com.google.gson.Gson;
 import com.ynstkz.shitu.android.R;
 import com.ynstkz.shitu.android.adapter.ApplyInfoPreviewPhotoAdapter;
 import com.ynstkz.shitu.android.application.STSign;
-import com.ynstkz.shitu.android.base.BaseActivity;
+import com.ynstkz.shitu.android.base.TitleBarActivity;
 import com.ynstkz.shitu.android.bean.ApplyInfoPreviewBean;
 import com.ynstkz.shitu.android.bean.LocalCityBean;
 import com.ynstkz.shitu.android.data.RequestGroup;
@@ -33,7 +34,7 @@ import okhttp3.Response;
  * 作者:fuchangle on 2018/4/29 17:01
  */
 
-public class ApplyInfoPreviewActivity extends BaseActivity {
+public class ApplyInfoPreviewActivity extends TitleBarActivity {
 
     @Bind(R.id.tv_title)
     TextView tvTitle;
@@ -73,10 +74,6 @@ public class ApplyInfoPreviewActivity extends BaseActivity {
     TextView tvLivingRegionId;
     @Bind(R.id.edit_livingAddress)
     EditText editLivingAddress;
-    @Bind(R.id.textView)
-    TextView textView;
-    @Bind(R.id.edit_contactAddress)
-    EditText editContactAddress;
     @Bind(R.id.edit_zipCode)
     EditText editZipCode;
     @Bind(R.id.edit_preSchoolEducation)
@@ -95,19 +92,31 @@ public class ApplyInfoPreviewActivity extends BaseActivity {
     EditText editResidenceAddress;
     @Bind(R.id.sv_main)
     ScrollView svMain;
+    @Bind(R.id.tv_contactProvinceId)
+    TextView tvContactProvinceId;
+    @Bind(R.id.tv_contactCityId)
+    TextView tvContactCityId;
+    @Bind(R.id.tv_contactAddressRegionId)
+    TextView tvContactAddressRegionId;
+    @Bind(R.id.edit_contactAddress)
+    EditText editContactAddress;
 
     private int applyId;
 
     @Override
     protected void onCreate(@Nullable Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
-        setContentView(R.layout.activity_applyinfo_preview);
         ButterKnife.bind(this);
         initView();
         initData();
         setListener();
     }
 
+    @Override
+    protected int getLayoutId() {
+        return R.layout.activity_applyinfo_preview;
+    }
+
     private void initView() {
         tvTitle.setText("报名信息预览");
     }
@@ -177,18 +186,24 @@ public class ApplyInfoPreviewActivity extends BaseActivity {
         }
         editUsername.setText(studentInfoBean.getStudentName());
         tvBirthday.setText(studentInfoBean.getBirthday());
-        tvSex.setText(getResources().getStringArray(R.array.choose_sex)[studentInfoBean.getSex()]);
+        if (studentInfoBean.getSex() != 0) {
+            tvSex.setText(studentInfoBean.getSex() == 1 ? "男" : "女");
+        }
         editNation.setText(studentInfoBean.getEthnic());
         editNativePlace.setText(studentInfoBean.getNativePlace());
         searchCityById("", studentInfoBean.getResidenceProvinceId() + "", tvProvinceId);
         searchCityById(studentInfoBean.getResidenceProvinceId() + "", studentInfoBean.getResidenceCityId() + "", tvResidenceCityId);
         searchCityById(studentInfoBean.getResidenceCityId() + "", studentInfoBean.getResidenceRegionId() + "", tvResidenceRegionId);
         editResidenceAddress.setText(studentInfoBean.getResidenceAddress());
-        editResidenceType.setText(studentInfoBean.getResidenceType() == 1 ? "城镇" : "农村");
+        if (studentInfoBean.getResidenceType() != 0) {
+            editResidenceType.setText(studentInfoBean.getResidenceType() == 1 ? "城镇" : "非城镇");
+        }
         editHeight.setText(studentInfoBean.getHeight());
         editWeight.setText(studentInfoBean.getWeight());
         editBloodType.setText(studentInfoBean.getBloodType());
-        editPhysicalExamination.setText(studentInfoBean.getPhysicalExamination() == 0 ? "不合格" : "合格");
+        if (!TextUtils.isEmpty(studentInfoBean.getPhysicalExamination())) {
+            editPhysicalExamination.setText("0".equals(studentInfoBean.getPhysicalExamination()) ? "不合格" : "合格");
+        }
         editIdcode.setText(studentInfoBean.getIdCardNum());
 
         searchCityById("", studentInfoBean.getLivingProvinceId() + "", tvLivingProvinceId);
@@ -198,6 +213,12 @@ public class ApplyInfoPreviewActivity extends BaseActivity {
         editZipCode.setText(studentInfoBean.getZipCode());
         editPreSchoolEducation.setText(studentInfoBean.getPreSchoolEducation());
         editHobby.setText(studentInfoBean.getHobby());
+
+        searchCityById("", studentInfoBean.getContactProvinceId() + "", tvContactProvinceId);
+        searchCityById(studentInfoBean.getContactProvinceId() + "", studentInfoBean.getContactCityId() + "", tvContactCityId);
+        searchCityById(studentInfoBean.getContactCityId() + "", studentInfoBean.getContactAddressRegionId() + "", tvContactAddressRegionId);
+
+        editContactAddress.setText(studentInfoBean.getContactAddress());
     }
 
     private void initFamilyInfo(List<ApplyInfoPreviewBean.DataBean.FamilyInfoBean> familyInfoBeans) {
@@ -213,6 +234,9 @@ public class ApplyInfoPreviewActivity extends BaseActivity {
             ((TextView) familyView.findViewById(R.id.edit_relation)).setText(familyListItem.getRelationShip());
             ((TextView) familyView.findViewById(R.id.tv_familyName)).setText(familyListItem.getFamilyName());
             ((TextView) familyView.findViewById(R.id.edit_familyPhone)).setText(familyListItem.getFamilyPhone());
+            ((TextView) familyView.findViewById(R.id.tv_familyjobAddress)).setText(familyListItem.getJobAddress());
+            ((TextView) familyView.findViewById(R.id.tv_familyjob)).setText(familyListItem.getJob());
+            ((TextView) familyView.findViewById(R.id.tv_familyremark)).setText(familyListItem.getRemark());
             llMemberFamily.addView(familyView);
 
         }
@@ -236,7 +260,7 @@ public class ApplyInfoPreviewActivity extends BaseActivity {
         ApplyInfoPreviewPhotoAdapter applyInfoPreviewPhotoAdapter = new ApplyInfoPreviewPhotoAdapter(ApplyInfoPreviewActivity.this, applyPhotoBeans);
         gvImages.setAdapter(applyInfoPreviewPhotoAdapter);
         applyInfoPreviewPhotoAdapter.notifyDataSetChanged();
-        svMain.smoothScrollTo(0,0);
+        svMain.smoothScrollTo(0, 0);
     }
 
     /**