Quellcode durchsuchen

Merge branch 'sheep2.0' of http://10.8.230.114:3000/kemllor/small_sheep_android into sheep2.0

zhanghai vor 8 Jahren
Ursprung
Commit
e55a2b48f3

+ 3 - 1
app/src/main/AndroidManifest.xml

@@ -391,10 +391,12 @@
                 <!--<category android:name="android.intent.category.LAUNCHER"/>-->
             <!--</intent-filter>-->
         </activity>
-        <activity android:name="com.sheep.groups.creditcard.CITICBackOtherInfoActivity"
+        <activity android:name="com.sheep.groups.creditcard.CITICBankOtherInfoActivity"
             android:screenOrientation="portrait">
         </activity>
 
+        <activity android:name="com.sheep.groups.creditcard.zx.ZhongXinCreditStep1Activity" android:screenOrientation="portrait"/>
+        <activity android:name="com.sheep.groups.creditcard.ms.MinShengCreditActivity" android:screenOrientation="portrait"/>
         <!--友盟start-->
 
 

+ 7 - 3
app/src/main/java/com/sheep/groups/creditcard/CITICBackOtherInfoActivity.java

@@ -3,7 +3,6 @@ package com.sheep.groups.creditcard;
 import android.support.v4.app.FragmentTabHost;
 import android.view.LayoutInflater;
 import android.view.View;
-import android.widget.ImageView;
 import android.widget.TabHost;
 import android.widget.TextView;
 
@@ -19,7 +18,7 @@ import java.util.Locale;
  * Created by realicing on 2018/4/4.
  * realicing@sina.com
  */
-public class CITICBackOtherInfoActivity extends BaseActivity {
+public class CITICBankOtherInfoActivity extends BaseActivity {
     @Override
     protected int getLayoutId() {
         return R.layout.activity_citic_bank_other_info;
@@ -40,7 +39,12 @@ public class CITICBackOtherInfoActivity extends BaseActivity {
 
     }
     private FragmentTabHost mFragmentTabHost;
-    private Class tabFragmentContentArray[] = {CITICBackOtherInfoFragment1.class, ZhongXinStep22Fragment.class, CiticStepThreeFragment.class};
+
+    public FragmentTabHost getmFragmentTabHost() {
+        return mFragmentTabHost;
+    }
+
+    private Class tabFragmentContentArray[] = {CITICBankOtherInfoFragment1.class, ZhongXinStep22Fragment.class, CiticStepThreeFragment.class};
     /**
      * 初始化的FragmentTabHost
      */

+ 1 - 1
app/src/main/java/com/sheep/groups/creditcard/CITICBackOtherInfoFragment1.java

@@ -14,7 +14,7 @@ import com.sheep.jiuyan.samllsheep.base.BaseFragment;
  * Created by realicing on 2018/4/4.
  * realicing@sina.com
  */
-public class CITICBackOtherInfoFragment1 extends BaseFragment {
+public class CITICBankOtherInfoFragment1 extends BaseFragment {
     @Override
     public int getLayoutId() {
         return R.layout.fragment_citic_bank_other_info1;

+ 1 - 1
app/src/main/java/com/sheep/groups/creditcard/zx/ZXStep1Contact.java

@@ -17,7 +17,7 @@ import java.util.Map;
     interface View extends IView {
         void showProgress(String msg);
         void goNext();
-        void showImageCode(Bitmap bitmap);
+        void showImageCode(String bitmap);
     }
 
     interface Presenter extends IPresenter {

+ 11 - 1
app/src/main/java/com/sheep/groups/creditcard/zx/ZXStep1Presenter.java

@@ -145,7 +145,17 @@ public class ZXStep1Presenter implements ZXStep1Contact.Presenter {
                     @Override
                     public void onNext(String str) {
                         byte[] bytes = str.getBytes();
-                        view.showImageCode(BitmapFactory.decodeByteArray(bytes,0,bytes.length));
+                        try {
+                            JSONObject object = new JSONObject(str);
+                           if( object.getBoolean("success")){
+                               view.showImageCode(object.getJSONObject("data").getString("img"));
+                           }
+                           else {
+                               view.showProgress(object.getString("errors"));
+                           }
+                        } catch (JSONException e) {
+                            e.printStackTrace();
+                        }
                         Log.e(TAG, "onNext: "+ str );
                     }
                 });

+ 6 - 7
app/src/main/java/com/sheep/groups/creditcard/zx/ZhongXinCreditStep1Activity.java

@@ -2,8 +2,6 @@ package com.sheep.groups.creditcard.zx;
 
 import android.app.DatePickerDialog;
 import android.content.Intent;
-import android.graphics.Bitmap;
-import android.support.v7.app.AppCompatActivity;
 import android.os.Bundle;
 import android.support.v7.widget.AppCompatSpinner;
 import android.text.TextUtils;
@@ -24,14 +22,14 @@ import com.bumptech.glide.Glide;
 import com.kfzs.libs.DaggerActivity;
 import com.kfzs.libs.IPresenter;
 import com.kfzs.libs.IView;
-import com.kfzs.libs.di.http.HttpModule;
 import com.kfzs.libs.widget.CompleteCommitEditText;
 import com.kfzs.libs.widget.navigation.NavigationBar;
-import com.sheep.groups.creditcard.CITICBackOtherInfoActivity;
+import com.sheep.groups.creditcard.CITICBankOtherInfoActivity;
 import com.sheep.groups.creditcard.CountDownUtil;
 import com.sheep.groups.creditcard.RegexUtils;
 import com.sheep.jiuyan.samllsheep.R;
 import com.sheep.jiuyan.samllsheep.SheepApp;
+import com.sheep.jiuyan.samllsheep.utils.SpUtils;
 
 import java.util.Calendar;
 import java.util.HashMap;
@@ -194,6 +192,7 @@ public class ZhongXinCreditStep1Activity extends DaggerActivity implements ZXSte
         map.put("mobile",etMobile.getText().toString());
         map.put("id_card",etIdNo.getText().toString());
         map.put("code",etSms.getText().toString());
+        map.put("token", SpUtils.getOpenId(SheepApp.mContext));
 
         map.put("is_invite",is_invite);
 
@@ -347,13 +346,13 @@ public class ZhongXinCreditStep1Activity extends DaggerActivity implements ZXSte
     @Override
     public void goNext() {
 
-        startActivity(new Intent(ZhongXinCreditStep1Activity.this,CITICBackOtherInfoActivity.class));
+        startActivity(new Intent(ZhongXinCreditStep1Activity.this,CITICBankOtherInfoActivity.class));
 
     }
 
     @Override
-    public void showImageCode(Bitmap bitmap) {
-        ivImage.setImageBitmap(bitmap);
+    public void showImageCode(String bitmap) {
+        Glide.with(this).download(bitmap).into(ivImage);
     }
 
     private void setOnCompleteEdit(final CompleteCommitEditText et, final String key){

+ 59 - 26
app/src/main/java/com/sheep/groups/creditcard/zx/ZhongXinStep22Fragment.java

@@ -2,6 +2,7 @@ package com.sheep.groups.creditcard.zx;
 
 import android.os.Bundle;
 import android.support.annotation.Nullable;
+import android.support.v4.app.FragmentTabHost;
 import android.support.v7.widget.AppCompatSpinner;
 import android.text.TextUtils;
 import android.view.View;
@@ -14,7 +15,10 @@ import com.kfzs.libs.DaggerFragment;
 import com.kfzs.libs.IPresenter;
 import com.kfzs.libs.IView;
 import com.kfzs.libs.widget.CompleteCommitEditText;
+import com.sheep.groups.creditcard.CITICBankOtherInfoActivity;
 import com.sheep.jiuyan.samllsheep.R;
+import com.sheep.jiuyan.samllsheep.SheepApp;
+import com.sheep.jiuyan.samllsheep.utils.SpUtils;
 
 import java.util.HashMap;
 import java.util.Map;
@@ -41,6 +45,8 @@ public class ZhongXinStep22Fragment extends DaggerFragment implements ZXStep22Co
     CompleteCommitEditText etTelNo;
     @BindView(R.id.et_tel_q)
     CompleteCommitEditText etTelQ;
+    @BindView(R.id.et_company_address)
+    CompleteCommitEditText etAddress;
 
     @BindView(R.id.sp_gwxz)
     AppCompatSpinner spGwxz;
@@ -54,6 +60,7 @@ public class ZhongXinStep22Fragment extends DaggerFragment implements ZXStep22Co
 
     @Inject
     ZXStep22Presenter presenter;
+    private String dwxz;
 
     @Override
     public void setupDaggerComponent() {
@@ -84,6 +91,7 @@ public class ZhongXinStep22Fragment extends DaggerFragment implements ZXStep22Co
             @Override
             public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
                 String value = (String) dwxzAdapter.getItem(position);
+                dwxz= value;
             }
 
             @Override
@@ -112,36 +120,59 @@ public class ZhongXinStep22Fragment extends DaggerFragment implements ZXStep22Co
             }
         });
 
+        dwxz = dwxzAdapter.getItem(0).toString();
+
     }
 
     private void zxCompany(){
 
-//        if(TextUtils.isEmpty(etName.getText().toString())){
-//            Toast.makeText(this,"请输入姓名",Toast.LENGTH_SHORT).show();
-//            return;
-//        }
-//
-//
-//        if(TextUtils.isEmpty(etMobile.getText().toString())){
-//            Toast.makeText(this,"请输入手机号",Toast.LENGTH_SHORT).show();
-//            return;
-//        }
-//        if(TextUtils.isEmpty(etIdNo.getText().toString())){
-//            Toast.makeText(this,"请输入身份证号",Toast.LENGTH_SHORT).show();
-//            return;
-//        }
-//        if(TextUtils.isEmpty(etSms.getText().toString())){
-//            Toast.makeText(this,"请输入验证码",Toast.LENGTH_SHORT).show();
-//            return;
-//        }
-
-
-
-//        Map<String,String> map = new HashMap<>();
-//        map.put("name",etName.getText().toString());
-//        map.put("mobile",etMobile.getText().toString());
-//        map.put("id_card",etIdNo.getText().toString());
-//        map.put("code",etSms.getText().toString());
+        if(TextUtils.isEmpty(etName.getText().toString())){
+            Toast.makeText(getActivity(),"请输入单位名称",Toast.LENGTH_SHORT).show();
+            return;
+        }
+        if(TextUtils.isEmpty(etProvence.getText().toString())){
+            Toast.makeText(getActivity(),"请输入省份",Toast.LENGTH_SHORT).show();
+            return;
+        }
+        if(TextUtils.isEmpty(etCity.getText().toString())){
+            Toast.makeText(getActivity(),"请输入城市",Toast.LENGTH_SHORT).show();
+            return;
+        }
+        if(TextUtils.isEmpty(etArea.getText().toString())){
+            Toast.makeText(getActivity(),"请输入区/县",Toast.LENGTH_SHORT).show();
+            return;
+        }
+
+        if(TextUtils.isEmpty(etAddress.getText().toString())){
+            Toast.makeText(getActivity(),"请输入单位地址",Toast.LENGTH_SHORT).show();
+            return;
+        }
+
+        if(TextUtils.isEmpty(etTelQ.getText().toString())){
+            Toast.makeText(getActivity(),"请输入单位电话区号",Toast.LENGTH_SHORT).show();
+            return;
+        }
+
+        if(TextUtils.isEmpty(etTelNo.getText().toString())){
+            Toast.makeText(getActivity(),"请输入单位电话号码",Toast.LENGTH_SHORT).show();
+            return;
+        }
+
+
+
+        Map<String,String> map = new HashMap<>();
+
+        map.put("job_type",dwxz);
+        map.put("com_name",etName.getText().toString());
+        map.put("com_province",etProvence.getText().toString());
+        map.put("com_city",etCity.getText().toString());
+        map.put("com_address",etAddress.getText().toString());
+        map.put("com_tel_1",etTelQ.getText().toString());
+        map.put("com_tel_2",etTelNo.getText().toString());
+        map.put("card_method","柜台激活");
+        map.put("token", SpUtils.getOpenId(SheepApp.mContext));
+
+        presenter.zxCompany(map);
 
 
     }
@@ -158,6 +189,8 @@ public class ZhongXinStep22Fragment extends DaggerFragment implements ZXStep22Co
 
     @Override
     public void goNext() {
+        FragmentTabHost fragmentTabHost = ((CITICBankOtherInfoActivity)getActivity()).getmFragmentTabHost();
+        fragmentTabHost.setCurrentTab(2);
 
     }
 }

+ 0 - 111
app/src/main/res/layout-sw550dp-large/activity_citic_bank_contact_information.xml

@@ -1,111 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    android:fitsSystemWindows="true">
-
-    <LinearLayout
-        android:id="@+id/other_container"
-        android:layout_width="match_parent"
-        android:layout_height="match_parent"
-        android:layout_marginBottom="@dimen/bottom_height"
-        android:clipToPadding="true"
-        android:fitsSystemWindows="true"
-        android:orientation="vertical">
-
-        <com.kfzs.duanduan.view.NoScrollViewPager
-            android:id="@+id/view_pager_container"
-            android:layout_width="match_parent"
-            android:layout_height="0dp"
-            android:layout_weight="1"/>
-
-    </LinearLayout>
-
-    <include
-        android:id="@+id/layout_main_activity_toolbar"
-        layout="@layout/toolbar_main_activity"
-        android:layout_width="match_parent"
-        android:layout_height="@dimen/app_nav_toolbar_height"
-        android:layout_alignParentTop="true"
-        android:visibility="gone"/>
-
-    <RelativeLayout
-        android:id="@+id/layout_bottom"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:layout_alignParentBottom="true"
-        android:background="@color/white">
-
-        <LinearLayout
-            android:id="@+id/tab_container"
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:paddingTop="4dp"
-            android:orientation="horizontal">
-            <View android:layout_weight="1"
-                android:layout_width="0dp"
-                android:layout_height="@dimen/tab_height"/>
-            <TextView
-                android:layout_width="@dimen/tab_width"
-                android:layout_height="@dimen/tab_height"
-                android:drawableTop="@drawable/drawable_selector_game"
-                android:textSize="12sp"
-                android:gravity="center"
-                android:textColor="@color/selector_color_main_tab"
-                android:text="@string/tab_viewpager_gamestore"/>
-            <View android:layout_weight="2"
-                android:layout_width="0dp"
-                android:layout_height="@dimen/tab_height"/>
-            <TextView
-                android:layout_width="@dimen/tab_width"
-                android:layout_height="@dimen/tab_height"
-                android:drawableTop="@drawable/drawable_selector_class"
-                android:textSize="12sp"
-                android:gravity="center"
-                android:textColor="@color/selector_color_main_tab"
-                android:text="@string/tab_viewpager_classification"/>
-            <View android:layout_weight="2"
-                android:layout_width="0dp"
-                android:layout_height="@dimen/tab_height"/>
-            <TextView
-                android:layout_width="@dimen/tab_width"
-                android:layout_height="@dimen/tab_height"
-                android:drawableTop="@drawable/drawable_selector_task"
-                android:textSize="12sp"
-                android:gravity="center"
-                android:textColor="@color/selector_color_main_tab"
-                android:text="@string/mine_hoggerel"/>
-            <View android:layout_weight="2"
-                android:layout_width="0dp"
-                android:layout_height="@dimen/tab_height"/>
-            <!--<TextView
-                android:layout_width="@dimen/tab_width"
-                android:layout_height="@dimen/tab_height"
-                android:drawableTop="@drawable/drawable_selector_bp"
-                android:textSize="12sp"
-                android:gravity="center"
-                android:textColor="@color/selector_color_main_tab"
-                android:text="@string/tab_viewpager_borrowplay"/>
-            <View android:layout_weight="2"
-                android:layout_width="0dp"
-                android:layout_height="@dimen/tab_height"/>-->
-            <TextView
-                android:layout_width="@dimen/tab_width"
-                android:layout_height="@dimen/tab_height"
-                android:drawableTop="@drawable/drawable_selector_credit"
-                android:textSize="12sp"
-                android:gravity="center"
-                android:textColor="@color/selector_color_main_tab"
-                android:text="@string/tab_viewpager_credit_card"/>
-            <View android:layout_weight="1"
-                android:layout_width="0dp"
-                android:layout_height="@dimen/tab_height"/>
-        </LinearLayout>
-
-        <View
-            android:id="@+id/tab_line"
-            android:layout_width="match_parent"
-            android:layout_height="1px"
-            android:background="@color/divider_gray" />
-    </RelativeLayout>
-</RelativeLayout>

+ 0 - 31
app/src/main/res/layout-sw550dp-large/activity_citic_bank_other_info_tab.xml

@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    android:orientation="vertical">
-    <include layout="@layout/title"/>
-
-    <android.support.v4.app.FragmentTabHost
-        android:id="@android:id/tabhost"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:background="@color/white">
-
-        <View
-            android:layout_width="match_parent"
-            android:layout_height="1dip"
-            android:background="@color/gray" />
-
-        <FrameLayout
-            android:id="@android:id/tabcontent"
-            android:layout_width="0dp"
-            android:layout_height="0dp"
-            android:layout_weight="0" />
-    </android.support.v4.app.FragmentTabHost>
-
-    <FrameLayout
-        android:id="@+id/realtabcontent"
-        android:layout_width="match_parent"
-        android:layout_height="0dp"
-        android:layout_weight="1" />
-</LinearLayout>

+ 0 - 13
app/src/main/res/layout-sw550dp-large/fragment_citic_bank_other_info1.xml

@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="wrap_content"
-    android:layout_height="wrap_content"
-    android:gravity="center"
-    android:orientation="vertical">
-
-    <TextView
-        android:id="@+id/activity_citic_bank_other_info_tab_tv"
-        android:layout_width="match_parent"
-        android:layout_height="0dp"
-        android:layout_weight="1" />
-</LinearLayout>