Browse Source

快递柜改造 处理启动报错的问题

wcq 1 year ago
parent
commit
928e48c66a

+ 1 - 1
app/build.gradle

@@ -45,7 +45,7 @@ android {
             shrinkResources true
             proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
             buildConfigField "String", "EMQX_HOST", "\"tcp://183.3.221.143:1883\""
-            buildConfigField "String", "ICSP_HOST", "\"http://icsp-testend.ds-bay.com\""
+            buildConfigField "String", "ICSP_HOST", "\"http://icsp-test.ds-bay.com\""
             //buildConfigField "String", "ICSP_HOST", "\"http://vz2x2s.natappfree.cc\""
             signingConfig signingConfigs.debug
         }

+ 7 - 1
app/src/main/java/com/emato/ich/fragment/ChooseCabinetFragment.java

@@ -314,7 +314,13 @@ public class ChooseCabinetFragment extends Fragment {
                     timer.cancel();
                 }
                 activity.getBundleMap().put(ChooseCabinetFragment.class.getName(), bundle);
-                NavUtils.navigate(this, R.id.action_chooseCabinetFragment_to_InputInfoKeyBoardFragment, bundle);
+                String pageType = activity.getBundleMap().get(MainFragment.class.getName()).getString("pageType");
+                if(!StringUtils.isNullOrEmpty(pageType) && "expressDelivery".equals(pageType)){
+                    NavUtils.navigate(this, R.id.action_chooseCabinetFragment_to_expressDeliveryFragment, bundle);
+                }else {
+                    NavUtils.navigate(this, R.id.action_chooseCabinetFragment_to_InputInfoKeyBoardFragment, bundle);
+                }
+
             }
 
         } catch (RuntimeException | JsonProcessingException e) {

+ 1 - 0
app/src/main/java/com/emato/ich/fragment/ExpressDeliveryFragment.java

@@ -81,6 +81,7 @@ public class ExpressDeliveryFragment extends Fragment {
         MainActivity activity = (MainActivity) getActivity();
         String url = activity.getConfigMap().get(SystemConfigConstant.cabinet_take_object_qrcode_url);
         arguments = activity.getBundleMap().get(ChooseCabinetFragment.class.getName());
+        // 需要先跳转选柜子的页面后才能走这里
         sectionType = arguments.getString("section_type");
 /*        if (getActivity() != null && activity.getConfigMap().size() > 0 && !StringUtils.isNullOrEmpty(url)) {
             // todo:这里可改为从后端获取寄件二维码图片 

+ 8 - 2
app/src/main/java/com/emato/ich/fragment/MainFragment.java

@@ -87,13 +87,17 @@ public class MainFragment extends Fragment {
                 }
             });*/
         }
-
+        Bundle bundle = new Bundle();
         // 我要寄快递页面跳转
         binding.sendBtn.setOnClickListener(view12 -> {
             if (ButtonUtils.isFastClick()) {
                 return;
             }
-            NavUtils.navigate(this, R.id.action_mainFragment_to_express_delivery_fragment);
+
+
+            bundle.putString("pageType","expressDelivery");
+            activity.getBundleMap().put(MainFragment.class.getName(), bundle);
+            NavUtils.navigate(this, R.id.action_mainFragment_to_chooseCabinetFragment);
         });
         // 取件页面跳转 德合隐藏
 //        binding.takeBtn.setOnClickListener(view1 -> {
@@ -107,6 +111,8 @@ public class MainFragment extends Fragment {
             if (ButtonUtils.isFastClick()) {
                 return;
             }
+            bundle.putString("pageType","collectMaterials");
+            activity.getBundleMap().put(MainFragment.class.getName(), bundle);
             NavUtils.navigate(this, R.id.action_mainFragment_to_courier_fragment);
         });
     }

+ 10 - 2
app/src/main/res/navigation/nav_graph.xml

@@ -18,7 +18,7 @@
 
         <action
             android:id="@+id/action_mainFragment_to_express_delivery_fragment"
-            app:destination="@id/ExpressDelivery" />
+            app:destination="@id/ExpressDeliveryFragment" />
         <action
             android:id="@+id/action_mainFragment_to_courier_fragment"
             app:destination="@id/Courier" />
@@ -26,6 +26,9 @@
         <action
             android:id="@+id/action_mainFragment_to_takeFragment"
             app:destination="@id/TakeFragment" />
+        <action
+            android:id="@+id/action_mainFragment_to_chooseCabinetFragment"
+            app:destination="@id/ChooseCabinetFragment" />
     </fragment>
 
     <!--  投递页面:投递员登录页面  -->
@@ -68,7 +71,7 @@
 
     <!--  我要寄快递页面  -->
     <fragment
-        android:id="@+id/ExpressDelivery"
+        android:id="@+id/ExpressDeliveryFragment"
         android:name="com.emato.ich.fragment.ExpressDeliveryFragment"
         android:label="@string/express_Delivery_fragment_label"
         tools:layout="@layout/fragment_express_delivery">
@@ -214,6 +217,11 @@
         <action
             android:id="@+id/action_chooseCabinetFragment_to_sendMainFragment"
             app:destination="@id/SendMainFragment"/>
+
+        <action
+            android:id="@+id/action_chooseCabinetFragment_to_expressDeliveryFragment"
+            app:destination="@id/ExpressDeliveryFragment"/>
+        
         <action
             android:id="@+id/action_chooseCabinetFragment_to_mainFragment"
             app:destination="@id/MainFragment"/>