linee 4 horas atrás
pai
commit
ac2ae63798
20 arquivos alterados com 754 adições e 713 exclusões
  1. 1 1
      entry/src/main/java/com/fujica/abk/api/auth.java
  2. 69 0
      entry/src/main/java/com/fujica/abk/api/pay.java
  3. 1 1
      entry/src/main/java/com/fujica/abk/component/OrderDetailComponent.java
  4. 1 1
      entry/src/main/java/com/fujica/abk/component/OrderItemComponent.java
  5. 1 1
      entry/src/main/java/com/fujica/abk/component/ParkDetailComponent.java
  6. 1 1
      entry/src/main/java/com/fujica/abk/component/ParkItemComponent.java
  7. 25 24
      entry/src/main/java/com/fujica/abk/component/nav/ChargeComponent.java
  8. 2 7
      entry/src/main/java/com/fujica/abk/component/nav/OrderComponent.java
  9. 2 2
      entry/src/main/java/com/fujica/abk/component/nav/ParkComponent.java
  10. 36 0
      entry/src/main/java/com/fujica/abk/model/in/ChargeQuery.java
  11. 55 0
      entry/src/main/java/com/fujica/abk/model/out/ArrearageOrder.java
  12. 1 1
      entry/src/main/java/com/fujica/abk/model/response/LoginRes.java
  13. 1 1
      entry/src/main/java/com/fujica/abk/model/response/OrderRes.java
  14. 1 1
      entry/src/main/java/com/fujica/abk/model/response/Page.java
  15. 1 1
      entry/src/main/java/com/fujica/abk/model/response/ParkNearRes.java
  16. 174 0
      entry/src/main/java/com/fujica/abk/model/out/ParkingFeeInfo.java
  17. 100 132
      entry/src/main/java/com/fujica/abk/slice/MainAbilitySlice.java
  18. 70 336
      entry/src/main/java/com/fujica/abk/utils/api.java
  19. 1 0
      entry/src/main/resources/base/graphic/background_circle_8.xml
  20. 211 203
      entry/src/main/resources/base/layout/ability_main.xml

+ 1 - 1
entry/src/main/java/com/fujica/abk/api/auth.java

@@ -1,7 +1,7 @@
 package com.fujica.abk.api;
 
 import com.fujica.abk.common.EventBus;
-import com.fujica.abk.model.response.LoginRes;
+import com.fujica.abk.model.out.LoginRes;
 import com.fujica.abk.utils.Log;
 import com.fujica.abk.utils.R;
 import com.fujica.abk.utils.Toast;

+ 69 - 0
entry/src/main/java/com/fujica/abk/api/pay.java

@@ -0,0 +1,69 @@
+package com.fujica.abk.api;
+
+import com.fujica.abk.model.in.ChargeQuery;
+import com.fujica.abk.model.out.ParkingFeeInfo;
+import com.fujica.abk.utils.*;
+import com.google.gson.reflect.TypeToken;
+import ohos.app.Context;
+
+import java.util.concurrent.CompletableFuture;
+
+/**
+ * 认证工具类
+ */
+public class pay {
+
+    /**
+     * 查询停车费用API (真实接口)
+     * 参考 TypeScript 版本的 pay.getChargeData 实现
+     *
+     * @param context      上下文
+     * @param licensePlate 车牌号
+     * @return 停车费用信息
+     */
+    public static CompletableFuture<R<ParkingFeeInfo>> queryParkingFee(Context context, ChargeQuery query) {
+        return CompletableFuture.supplyAsync(() -> {
+            try {
+                // 第一步: 调用 /cg/chargeByUnify 接口
+                ApiOption option = new ApiOption("/cg/chargeByUnify", query);
+                option.setMethod(ApiOption.POST);
+                option.setToast(false); // 不显示错误提示
+
+                TypeToken<R<ParkingFeeInfo>> typeToken = new TypeToken<R<ParkingFeeInfo>>() {
+                };
+                R<ParkingFeeInfo> result = api.http(context, option, typeToken).get();
+
+                // 判断是否需要轮询
+                if (result.isSuccess() && result.getData() != null) {
+                    String resultKey = result.getData().getResultKey();
+
+                    if (resultKey != null && !resultKey.isEmpty()) {
+                        // 第二步: 有 resultKey,需要轮询 /cg/getChargeResult
+                        java.util.HashMap<String, Object> params = new java.util.HashMap<>();
+                        params.put("resultKey", resultKey);
+
+                        ApiOption pollOption = new ApiOption("/cg/getChargeResult", params);
+                        pollOption.setMethod(ApiOption.GET);
+                        pollOption.setToast(false);
+
+                        // 使用默认轮询配置(10次,每次500ms)
+                        // 如需自定义轮询参数,可使用:
+                        // api.PollConfig pollConfig = new api.PollConfig(20, 1000); // 20次,每次1000ms
+                        // return api.poll(context, pollOption, typeToken, pollConfig);
+                        return api.poll(context, pollOption, typeToken, new api.PollConfig(), res -> res.getData() != null);
+
+                    } else {
+                        // 直接返回结果
+                        return result;
+                    }
+                } else {
+                    return result;
+                }
+            } catch (Exception e) {
+                Log.error("查询停车费用失败: " + e.getMessage());
+                return new R<>("查询失败: " + e.getMessage());
+            }
+        });
+    }
+
+}

+ 1 - 1
entry/src/main/java/com/fujica/abk/component/OrderDetailComponent.java

@@ -1,7 +1,7 @@
 package com.fujica.abk.component;
 
 import com.fujica.abk.ResourceTable;
-import com.fujica.abk.model.response.OrderRes;
+import com.fujica.abk.model.out.OrderRes;
 import com.fujica.abk.utils.Log;
 import ohos.agp.components.*;
 import ohos.app.Context;

+ 1 - 1
entry/src/main/java/com/fujica/abk/component/OrderItemComponent.java

@@ -1,7 +1,7 @@
 package com.fujica.abk.component;
 
 import com.fujica.abk.ResourceTable;
-import com.fujica.abk.model.response.OrderRes;
+import com.fujica.abk.model.out.OrderRes;
 import com.fujica.abk.utils.Log;
 import ohos.agp.components.*;
 import ohos.agp.components.element.Element;

+ 1 - 1
entry/src/main/java/com/fujica/abk/component/ParkDetailComponent.java

@@ -1,7 +1,7 @@
 package com.fujica.abk.component;
 
 import com.fujica.abk.ResourceTable;
-import com.fujica.abk.model.response.ParkNearRes;
+import com.fujica.abk.model.out.ParkNearRes;
 import com.fujica.abk.utils.Log;
 import ohos.agp.components.*;
 import ohos.app.Context;

+ 1 - 1
entry/src/main/java/com/fujica/abk/component/ParkItemComponent.java

@@ -1,7 +1,7 @@
 package com.fujica.abk.component;
 
 import com.fujica.abk.ResourceTable;
-import com.fujica.abk.model.response.ParkNearRes;
+import com.fujica.abk.model.out.ParkNearRes;
 import com.fujica.abk.utils.Log;
 import com.fujica.abk.utils.ScreenUtil;
 import ohos.agp.colors.RgbColor;

+ 25 - 24
entry/src/main/java/com/fujica/abk/component/nav/ChargeComponent.java

@@ -2,16 +2,13 @@ package com.fujica.abk.component.nav;
 
 import com.fujica.abk.ResourceTable;
 import com.fujica.abk.api.cache;
+import com.fujica.abk.api.pay;
 import com.fujica.abk.component.LoadingComponent;
+import com.fujica.abk.model.in.ChargeQuery;
+import com.fujica.abk.model.out.ParkingFeeInfo;
 import com.fujica.abk.utils.*;
-import com.google.gson.Gson;
-import com.google.gson.reflect.TypeToken;
 import ohos.agp.components.*;
-import ohos.agp.components.ComponentContainer;
-import ohos.agp.components.DirectionalLayout;
-import ohos.agp.components.LayoutScatter;
 import ohos.app.Context;
-import ohos.eventhandler.EventHandler;
 import ohos.eventhandler.EventRunner;
 
 import java.util.concurrent.CompletableFuture;
@@ -66,7 +63,7 @@ public class ChargeComponent extends DirectionalLayout {
     private Button btnInputLicensePlate;
 
     // 当前停车费信息
-    private api.ParkingFeeInfo currentFeeInfo;
+    private ParkingFeeInfo currentFeeInfo;
 
     private LoadingComponent loadingComponent; // Loading组件
 
@@ -268,27 +265,32 @@ public class ChargeComponent extends DirectionalLayout {
      * 参考 index.vue 中的 getCharge 方法实现
      */
     private void queryParkingFee(String licensePlate) {
-        CompletableFuture<R<api.ParkingFeeInfo>> future = api.queryParkingFee(context, licensePlate);
+        // 构建请求参数
+        ChargeQuery query = new ChargeQuery();
+        query.setChargeScene(2);  // 计费场景: 2
+        query.setPlateNo(licensePlate);
+
+        CompletableFuture<R<ParkingFeeInfo>> future = pay.queryParkingFee(getContext(), query);
         if (loadingComponent != null) {
             loadingComponent.show();
         }
         future.thenAccept(result1 -> {
             // 在主线程更新UI
             DialogUtil.postTask(() -> {
-                String json = "{\"code\":0,\"data\":{\"actualAmount\":1400,\"discountAmount\":110,\"feeType\":12,\"followList\":[],\"parkId\":\"559581682204741\",\"parkName\":\"车场0818\",\"parkingDays\":0,\"parkingHours\":0,\"parkingMinutes\":0,\"plateColor\":\"6\",\"plateNo\":\"粤B11111\",\"rzStatus\":false,\"stayTime\":\"0天6小时39分\",\"totalFee\":0},\"success\":true}";
-                R<api.ParkingFeeInfo> result = new Gson().fromJson(json, new TypeToken<R<api.ParkingFeeInfo>>() {
-                });
-
+//                String json = "{\"code\":0,\"data\":{\"actualAmount\":1400,\"discountAmount\":110,\"feeType\":12,\"followList\":[],\"parkId\":\"559581682204741\",\"parkName\":\"车场0818\",\"parkingDays\":0,\"parkingHours\":0,\"parkingMinutes\":0,\"plateColor\":\"6\",\"plateNo\":\"粤B11111\",\"rzStatus\":false,\"stayTime\":\"0天6小时39分\",\"totalFee\":0},\"success\":true}";
+//                R<ParkingFeeInfo> result = new Gson().fromJson(json, new TypeToken<R<ParkingFeeInfo>>() {
+//                });
 
+                R<ParkingFeeInfo> result = result1;
                 if (result == null || "timeout".equals(result.getMsg())) {
                     // 查询结果为空或超时:按照未入场处理(feeType=10)
                     // 参考 Charge.ets 第467行的实现
-                    api.ParkingFeeInfo emptyFeeInfo = new api.ParkingFeeInfo();
+                    ParkingFeeInfo emptyFeeInfo = new ParkingFeeInfo();
                     emptyFeeInfo.setFeeType(10);
                     emptyFeeInfo.setPlateNo(licensePlate);
                     updateParkingInfo(emptyFeeInfo);
                 } else if (result.isSuccess() && result.getData() != null) {
-                    api.ParkingFeeInfo feeInfo = result.getData();
+                    ParkingFeeInfo feeInfo = result.getData();
                     currentFeeInfo = feeInfo;
 
                     // 更新停车信息显示
@@ -325,10 +327,9 @@ public class ChargeComponent extends DirectionalLayout {
         }).exceptionally(throwable -> {
             // 异常处理(包括超时)
             // 参考 Vue 中的实现:计费超时按照未入场处理(feeType=10)
-            EventRunner mainRunner = EventRunner.getMainEventRunner();
             DialogUtil.postTask(() -> {
                 // 异常按照未入场处理
-                api.ParkingFeeInfo errorFeeInfo = new api.ParkingFeeInfo();
+                ParkingFeeInfo errorFeeInfo = new ParkingFeeInfo();
                 errorFeeInfo.setFeeType(10);
                 errorFeeInfo.setPlateNo(licensePlate);
                 updateParkingInfo(errorFeeInfo);
@@ -348,7 +349,7 @@ public class ChargeComponent extends DirectionalLayout {
      * 显示欠费订单提示对话框
      * 参考 Vue 中的 uni.showModal 实现
      */
-    private void showArrearageDialog(String message, api.ParkingFeeInfo feeInfo, String confirmText) {
+    private void showArrearageDialog(String message, ParkingFeeInfo feeInfo, String confirmText) {
         com.fujica.abk.utils.ConfirmDialog dialog = new com.fujica.abk.utils.ConfirmDialog(context);
         dialog.setTitle("温馨提示")
                 .setMessage(message)
@@ -369,7 +370,7 @@ public class ChargeComponent extends DirectionalLayout {
      * 处理欠费补缴
      * 根据欠费订单数量跳转到不同页面
      */
-    private void handleArrearagePayment(api.ParkingFeeInfo feeInfo) {
+    private void handleArrearagePayment(ParkingFeeInfo feeInfo) {
         if (feeInfo.getFollowList() == null || feeInfo.getFollowList().isEmpty()) {
             return;
         }
@@ -392,7 +393,7 @@ public class ChargeComponent extends DirectionalLayout {
      * 更新停车信息显示
      * 根据 feeType 显示不同的界面,参考 index.vue 的实现
      */
-    private void updateParkingInfo(api.ParkingFeeInfo feeInfo) {
+    private void updateParkingInfo(ParkingFeeInfo feeInfo) {
         hideAllCards();
 
         int feeType = feeInfo.getFeeType();
@@ -437,7 +438,7 @@ public class ChargeComponent extends DirectionalLayout {
     /**
      * 显示正常缴费卡片 (feeType 0或16)
      */
-    private void showNormalFeeCard(api.ParkingFeeInfo feeInfo) {
+    private void showNormalFeeCard(ParkingFeeInfo feeInfo) {
         if (cardNormalFee == null) return;
 
         cardNormalFee.setVisibility(VISIBLE);
@@ -482,7 +483,7 @@ public class ChargeComponent extends DirectionalLayout {
     /**
      * 显示黑名单卡片 (feeType 14)
      */
-    private void showBlacklistCard(api.ParkingFeeInfo feeInfo) {
+    private void showBlacklistCard(ParkingFeeInfo feeInfo) {
         if (cardBlacklist == null) return;
 
         cardBlacklist.setVisibility(VISIBLE);
@@ -501,7 +502,7 @@ public class ChargeComponent extends DirectionalLayout {
     /**
      * 显示月卡卡片 (feeType 3)
      */
-    private void showMonthlyCard(api.ParkingFeeInfo feeInfo) {
+    private void showMonthlyCard(ParkingFeeInfo feeInfo) {
         if (cardMonthly == null) return;
 
         cardMonthly.setVisibility(VISIBLE);
@@ -520,7 +521,7 @@ public class ChargeComponent extends DirectionalLayout {
     /**
      * 显示无需缴费卡片 (feeType 1/2/4/5/13)
      */
-    private void showNoFeeCard(api.ParkingFeeInfo feeInfo) {
+    private void showNoFeeCard(ParkingFeeInfo feeInfo) {
         if (cardNoFee == null) return;
 
         cardNoFee.setVisibility(VISIBLE);
@@ -539,7 +540,7 @@ public class ChargeComponent extends DirectionalLayout {
     /**
      * 显示全额优惠卡片 (feeType 6)
      */
-    private void showFullDiscountCard(api.ParkingFeeInfo feeInfo) {
+    private void showFullDiscountCard(ParkingFeeInfo feeInfo) {
         if (cardFullDiscount == null) return;
 
         cardFullDiscount.setVisibility(VISIBLE);

+ 2 - 7
entry/src/main/java/com/fujica/abk/component/nav/OrderComponent.java

@@ -3,21 +3,16 @@ package com.fujica.abk.component.nav;
 import com.fujica.abk.ResourceTable;
 import com.fujica.abk.component.LoadingComponent;
 import com.fujica.abk.component.OrderItemComponent;
-import com.fujica.abk.model.response.OrderRes;
-import com.fujica.abk.model.response.Page;
+import com.fujica.abk.model.out.OrderRes;
+import com.fujica.abk.model.out.Page;
 import com.fujica.abk.utils.*;
-import com.google.gson.Gson;
 import com.google.gson.reflect.TypeToken;
 import ohos.agp.components.*;
-import ohos.agp.components.element.ShapeElement;
-import ohos.agp.utils.Color;
 import com.fujica.abk.utils.CustomListDialog;
 import ohos.app.Context;
 import ohos.eventhandler.EventHandler;
 import ohos.eventhandler.EventRunner;
 
-import java.lang.reflect.Type;
-import java.text.DecimalFormat;
 import java.util.ArrayList;
 import java.util.Calendar;
 import java.util.HashMap;

+ 2 - 2
entry/src/main/java/com/fujica/abk/component/nav/ParkComponent.java

@@ -3,8 +3,8 @@ package com.fujica.abk.component.nav;
 import com.fujica.abk.ResourceTable;
 import com.fujica.abk.component.LoadingComponent;
 import com.fujica.abk.component.ParkItemComponent;
-import com.fujica.abk.model.response.ParkNearRes;
-import com.fujica.abk.model.response.Page;
+import com.fujica.abk.model.out.ParkNearRes;
+import com.fujica.abk.model.out.Page;
 import com.fujica.abk.utils.*;
 import com.google.gson.Gson;
 import com.google.gson.reflect.TypeToken;

+ 36 - 0
entry/src/main/java/com/fujica/abk/model/in/ChargeQuery.java

@@ -0,0 +1,36 @@
+package com.fujica.abk.model.in;
+
+
+/**
+ * 计费查询请求参数类
+ * 对应 TypeScript 的 ChargeQuery
+ */
+public class ChargeQuery {
+    private int chargeScene;  // 计费场景: 2-临停缴费
+    private String plateNo;   // 车牌号
+    private String parkId;    // 车场ID (可选)
+
+    public int getChargeScene() {
+        return chargeScene;
+    }
+
+    public void setChargeScene(int chargeScene) {
+        this.chargeScene = chargeScene;
+    }
+
+    public String getPlateNo() {
+        return plateNo;
+    }
+
+    public void setPlateNo(String plateNo) {
+        this.plateNo = plateNo;
+    }
+
+    public String getParkId() {
+        return parkId;
+    }
+
+    public void setParkId(String parkId) {
+        this.parkId = parkId;
+    }
+}

+ 55 - 0
entry/src/main/java/com/fujica/abk/model/out/ArrearageOrder.java

@@ -0,0 +1,55 @@
+package com.fujica.abk.model.out;
+
+import com.fujica.abk.utils.api;
+
+
+/**
+ * 欠费订单信息类
+ */
+public class ArrearageOrder {
+    private String orderId;        // 订单ID
+    private String parkName;       // 车场名称
+    private int amount;            // 欠费金额(分)
+    private String createTime;     // 创建时间
+    private String plateNo;        // 车牌号
+
+    public String getOrderId() {
+        return orderId;
+    }
+
+    public void setOrderId(String orderId) {
+        this.orderId = orderId;
+    }
+
+    public String getParkName() {
+        return parkName;
+    }
+
+    public void setParkName(String parkName) {
+        this.parkName = parkName;
+    }
+
+    public int getAmount() {
+        return amount;
+    }
+
+    public void setAmount(int amount) {
+        this.amount = amount;
+    }
+
+    public String getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(String createTime) {
+        this.createTime = createTime;
+    }
+
+    public String getPlateNo() {
+        return plateNo;
+    }
+
+    public void setPlateNo(String plateNo) {
+        this.plateNo = plateNo;
+    }
+}

+ 1 - 1
entry/src/main/java/com/fujica/abk/model/response/LoginRes.java

@@ -1,4 +1,4 @@
-package com.fujica.abk.model.response;
+package com.fujica.abk.model.out;
 
 /**
  * 登录响应数据

+ 1 - 1
entry/src/main/java/com/fujica/abk/model/response/OrderRes.java

@@ -1,4 +1,4 @@
-package com.fujica.abk.model.response;
+package com.fujica.abk.model.out;
 
 /**
  * 订单响应数据

+ 1 - 1
entry/src/main/java/com/fujica/abk/model/response/Page.java

@@ -1,4 +1,4 @@
-package com.fujica.abk.model.response;
+package com.fujica.abk.model.out;
 
 import java.util.List;
 

+ 1 - 1
entry/src/main/java/com/fujica/abk/model/response/ParkNearRes.java

@@ -1,4 +1,4 @@
-package com.fujica.abk.model.response;
+package com.fujica.abk.model.out;
 
 /**
  * 附近停车场响应数据

+ 174 - 0
entry/src/main/java/com/fujica/abk/model/out/ParkingFeeInfo.java

@@ -0,0 +1,174 @@
+package com.fujica.abk.model.out;
+
+import com.fujica.abk.utils.api;
+
+/**
+ * 停车费用信息类
+ */
+public class ParkingFeeInfo {
+    private String licensePlate;
+    private String parkingLotName;
+    private int parkingDays;
+    private int parkingHours;
+    private int parkingMinutes;
+    private int totalFee;
+
+    // 新增字段,参考 index.vue 中的 chargeData
+    private int feeType; // 费用类型: 0-正常缴费, 1-无需缴费, 2-已缴费免费离场时间内, 3-月卡车辆, 4-免费时间内, 5-无需缴费, 6-全额优惠, 10-未入场, 12-场外月卡, 13-欠费补缴, 14-黑名单, 16-临停加欠费补缴
+    private String parkName; // 车场名称
+    private String stayTime; // 停车时长(格式化后的字符串)
+    private int actualAmount; // 实际金额(分)
+    private int discountAmount; // 减免金额(分)
+    private String plateNo; // 车牌号
+    private String plateColor; // 车牌颜色
+    private String parkId; // 车场ID
+    private String cardId; // 月卡ID
+    private boolean rzStatus; // 认证状态
+    private java.util.List<ArrearageOrder> followList; // 历史欠费订单列表
+    private String resultKey; // 计费结果key (用于轮询)
+
+    public String getLicensePlate() {
+        return licensePlate;
+    }
+
+    public void setLicensePlate(String licensePlate) {
+        this.licensePlate = licensePlate;
+    }
+
+    public String getParkingLotName() {
+        return parkingLotName;
+    }
+
+    public void setParkingLotName(String parkingLotName) {
+        this.parkingLotName = parkingLotName;
+    }
+
+    public int getParkingDays() {
+        return parkingDays;
+    }
+
+    public void setParkingDays(int parkingDays) {
+        this.parkingDays = parkingDays;
+    }
+
+    public int getParkingHours() {
+        return parkingHours;
+    }
+
+    public void setParkingHours(int parkingHours) {
+        this.parkingHours = parkingHours;
+    }
+
+    public int getParkingMinutes() {
+        return parkingMinutes;
+    }
+
+    public void setParkingMinutes(int parkingMinutes) {
+        this.parkingMinutes = parkingMinutes;
+    }
+
+    public int getTotalFee() {
+        return totalFee;
+    }
+
+    public void setTotalFee(int totalFee) {
+        this.totalFee = totalFee;
+    }
+
+    public int getFeeType() {
+        return feeType;
+    }
+
+    public void setFeeType(int feeType) {
+        this.feeType = feeType;
+    }
+
+    public String getParkName() {
+        return parkName;
+    }
+
+    public void setParkName(String parkName) {
+        this.parkName = parkName;
+    }
+
+    public String getStayTime() {
+        return stayTime;
+    }
+
+    public void setStayTime(String stayTime) {
+        this.stayTime = stayTime;
+    }
+
+    public int getActualAmount() {
+        return actualAmount;
+    }
+
+    public void setActualAmount(int actualAmount) {
+        this.actualAmount = actualAmount;
+    }
+
+    public int getDiscountAmount() {
+        return discountAmount;
+    }
+
+    public void setDiscountAmount(int discountAmount) {
+        this.discountAmount = discountAmount;
+    }
+
+    public String getPlateNo() {
+        return plateNo;
+    }
+
+    public void setPlateNo(String plateNo) {
+        this.plateNo = plateNo;
+    }
+
+    public String getPlateColor() {
+        return plateColor;
+    }
+
+    public void setPlateColor(String plateColor) {
+        this.plateColor = plateColor;
+    }
+
+    public String getParkId() {
+        return parkId;
+    }
+
+    public void setParkId(String parkId) {
+        this.parkId = parkId;
+    }
+
+    public String getCardId() {
+        return cardId;
+    }
+
+    public void setCardId(String cardId) {
+        this.cardId = cardId;
+    }
+
+    public boolean isRzStatus() {
+        return rzStatus;
+    }
+
+    public void setRzStatus(boolean rzStatus) {
+        this.rzStatus = rzStatus;
+    }
+
+    public java.util.List<ArrearageOrder> getFollowList() {
+        return followList;
+    }
+
+    public void setFollowList(java.util.List<ArrearageOrder> followList) {
+        this.followList = followList;
+    }
+
+    public String getResultKey() {
+        return resultKey;
+    }
+
+    public void setResultKey(String resultKey) {
+        this.resultKey = resultKey;
+    }
+}
+

+ 100 - 132
entry/src/main/java/com/fujica/abk/slice/MainAbilitySlice.java

@@ -7,12 +7,14 @@ import com.fujica.abk.common.EventBus;
 import com.fujica.abk.component.LoadingComponent;
 import com.fujica.abk.component.OrderDetailComponent;
 import com.fujica.abk.component.ParkDetailComponent;
-import com.fujica.abk.model.response.OrderRes;
-import com.fujica.abk.model.response.ParkNearRes;
-import com.fujica.abk.utils.*;
-import com.fujica.abk.component.nav.ParkComponent;
 import com.fujica.abk.component.nav.ChargeComponent;
 import com.fujica.abk.component.nav.OrderComponent;
+import com.fujica.abk.component.nav.ParkComponent;
+import com.fujica.abk.model.out.OrderRes;
+import com.fujica.abk.model.out.ParkNearRes;
+import com.fujica.abk.utils.DialogUtil;
+import com.fujica.abk.utils.Log;
+import com.fujica.abk.utils.Toast;
 import com.huawei.hms.accountsdk.constant.CommonConstant;
 import com.huawei.hms.accountsdk.exception.ApiException;
 import com.huawei.hms.accountsdk.support.account.AccountAuthManager;
@@ -38,16 +40,10 @@ import ohos.location.LocatorCallback;
 import ohos.location.RequestParam;
 import ohos.rpc.RemoteException;
 import ohos.sysappcomponents.settings.SystemSettings;
-import ohos.eventhandler.EventHandler;
-import ohos.eventhandler.EventRunner;
-
-import java.util.ArrayList;
-import java.util.List;
 
 public class MainAbilitySlice extends AbilitySlice {
-    // PageSlider相关
-    private PageSlider pageSlider;
-    private PageSliderProvider pageSliderProvider;
+    // 页面容器
+    private StackLayout pageContainer;
 
     // 底部导航栏组件
     private DirectionalLayout navCharge;
@@ -276,132 +272,62 @@ public class MainAbilitySlice extends AbilitySlice {
      * 初始化组件
      */
     private void initComponents() {
-        // 初始化PageSlider
-        pageSlider = findComponentById(ResourceTable.Id_page_slider);
-        pageSlider.setSlidingPossible(false);
-        if (pageSlider != null) {
-            // 创建PageSliderProvider
-            pageSliderProvider = new PageSliderProvider() {
-                private List<Component> pages = new ArrayList<>();
-
-                @Override
-                public int getCount() {
-                    return 3; // 三个页面:我的、找车位、缴费记录
-                }
+        // 初始化页面容器
+        pageContainer = findComponentById(ResourceTable.Id_page_container);
 
-                @Override
-                public Object createPageInContainer(ComponentContainer componentContainer, int position) {
-                    Component page = null;
-                    try {
-                        switch (position) {
-                            case 0: // 我的
-                                chargeComponent = new ChargeComponent(MainAbilitySlice.this);
-                                chargeComponent.setLoadingComponent(loadingComponent);
-                                page = chargeComponent;
-                                break;
-                            case 1: // 找车位
-                                parkComponent = new ParkComponent(MainAbilitySlice.this);
-                                parkComponent.setLoadingComponent(loadingComponent);
-                                // 如果已有定位信息,设置到组件中
-                                if (currentLocation != null) {
-                                    parkComponent.setCurrentLocation(currentLocation);
-                                }
-                                // 设置停车场选中监听器
-                                parkComponent.setOnParkSelectedListener(new ParkComponent.OnParkSelectedListener() {
-                                    @Override
-                                    public void onParkSelected(ParkNearRes park) {
-                                        showParkDetail(park);
-                                    }
-
-                                    @Override
-                                    public void onParkDeselected() {
-                                        hideDetail();
-                                    }
-                                });
-                                page = parkComponent;
-                                break;
-                            case 2: // 缴费记录
-                                orderComponent = new OrderComponent(MainAbilitySlice.this);
-                                orderComponent.setLoadingComponent(loadingComponent);
-                                // 设置订单选中监听器
-                                orderComponent.setOnOrderSelectedListener(new OrderComponent.OnOrderSelectedListener() {
-                                    @Override
-                                    public void onOrderSelected(OrderRes order) {
-                                        showOrderDetail(order);
-                                    }
-
-                                    @Override
-                                    public void onOrderDeselected() {
-                                        hideDetail();
-                                    }
-                                });
-                                page = orderComponent;
-                                break;
-                        }
-                        if (page != null) {
-                            componentContainer.addComponent(page);
-                            pages.add(page);
-                        }
-                    } catch (Exception e) {
-                        Log.error("创建页面失败: " + e.getMessage());
-                        e.printStackTrace();
-                    }
-                    return page;
+        if (pageContainer != null) {
+            try {
+                // 创建我的页面(缴费)
+                chargeComponent = new ChargeComponent(MainAbilitySlice.this);
+                chargeComponent.setLoadingComponent(loadingComponent);
+                chargeComponent.setVisibility(Component.HIDE);
+                pageContainer.addComponent(chargeComponent);
+
+                // 创建找车位页面
+                parkComponent = new ParkComponent(MainAbilitySlice.this);
+                parkComponent.setLoadingComponent(loadingComponent);
+                // 如果已有定位信息,设置到组件中
+                if (currentLocation != null) {
+                    parkComponent.setCurrentLocation(currentLocation);
                 }
-
-                @Override
-                public void destroyPageFromContainer(ComponentContainer componentContainer, int position, Object object) {
-                    if (object instanceof Component) {
-                        componentContainer.removeComponent((Component) object);
-                        pages.remove(object);
+                // 设置停车场选中监听器
+                parkComponent.setOnParkSelectedListener(new ParkComponent.OnParkSelectedListener() {
+                    @Override
+                    public void onParkSelected(ParkNearRes park) {
+                        showParkDetail(park);
                     }
-                }
-
-                @Override
-                public boolean isPageMatchToObject(Component component, Object object) {
-                    return component == object;
-                }
-            };
-
-            pageSlider.setProvider(pageSliderProvider);
-            // 默认显示找车位页面(索引1)
-//            pageSlider.setCurrentPage(1);
-            pageSlider.setCurrentPage(3);
 
-            // 添加页面切换监听
-            pageSlider.addPageChangedListener(new PageSlider.PageChangedListener() {
-                @Override
-                public void onPageChosen(int index) {
-                    // 页面切换完成
-                    currentTab = index;
-                    updateBottomNavState(index);
-                    Log.info("切换到页面: " + index);
-                    // 切换页面时隐藏详情
-                    hideDetail();
-                    // 如果切换到我的页面,刷新数据
-                    if (index == 0 && chargeComponent != null) {
-                        chargeComponent.refresh();
-                    }
-                    // 如果切换到找车位页面,刷新数据
-                    if (index == 1 && parkComponent != null) {
-                        parkComponent.refresh();
+                    @Override
+                    public void onParkDeselected() {
+                        hideDetail();
                     }
-                    // 如果切换到缴费记录页面,刷新数据(从第一页开始)
-                    if (index == 2 && orderComponent != null) {
-                        orderComponent.reset();
+                });
+                parkComponent.setVisibility(Component.VISIBLE); // 默认显示找车位页面
+                pageContainer.addComponent(parkComponent);
+
+                // 创建缴费记录页面
+                orderComponent = new OrderComponent(MainAbilitySlice.this);
+                orderComponent.setLoadingComponent(loadingComponent);
+                // 设置订单选中监听器
+                orderComponent.setOnOrderSelectedListener(new OrderComponent.OnOrderSelectedListener() {
+                    @Override
+                    public void onOrderSelected(OrderRes order) {
+                        showOrderDetail(order);
                     }
-                }
 
-                @Override
-                public void onPageSliding(int state, float v, int index) {
-
-                }
+                    @Override
+                    public void onOrderDeselected() {
+                        hideDetail();
+                    }
+                });
+                orderComponent.setVisibility(Component.HIDE);
+                pageContainer.addComponent(orderComponent);
 
-                @Override
-                public void onPageSlideStateChanged(int state) {
-                    // 滑动状态变化
-                }
-            });
+                Log.info("页面组件初始化完成");
+            } catch (Exception e) {
+                Log.error("创建页面组件失败: " + e.getMessage());
+                e.printStackTrace();
+            }
         }
 
         // 初始化底部导航栏
@@ -475,9 +401,51 @@ public class MainAbilitySlice extends AbilitySlice {
      * 切换到指定页面
      */
     private void switchToPage(int index) {
-        if (pageSlider != null && index >= 0 && index < 3) {
-            pageSlider.setCurrentPage(index);
+        if (index < 0 || index > 2) {
+            return;
+        }
+
+        // 隐藏所有页面
+        if (chargeComponent != null) {
+            chargeComponent.setVisibility(Component.HIDE);
+        }
+        if (parkComponent != null) {
+            parkComponent.setVisibility(Component.HIDE);
+        }
+        if (orderComponent != null) {
+            orderComponent.setVisibility(Component.HIDE);
+        }
+
+        // 显示目标页面
+        switch (index) {
+            case 0: // 我的
+                if (chargeComponent != null) {
+                    chargeComponent.setVisibility(Component.VISIBLE);
+                    chargeComponent.refresh();
+                }
+                break;
+            case 1: // 找车位
+                if (parkComponent != null) {
+                    parkComponent.setVisibility(Component.VISIBLE);
+                    parkComponent.refresh();
+                }
+                break;
+            case 2: // 缴费记录
+                if (orderComponent != null) {
+                    orderComponent.setVisibility(Component.VISIBLE);
+                    orderComponent.reset();
+                }
+                break;
         }
+
+        // 更新当前tab状态
+        currentTab = index;
+        updateBottomNavState(index);
+
+        // 切换页面时隐藏详情
+        hideDetail();
+
+        Log.info("切换到页面: " + index);
     }
 
     /**

+ 70 - 336
entry/src/main/java/com/fujica/abk/utils/api.java

@@ -21,6 +21,38 @@ public class api {
     // Gson 实例,用于 JSON 序列化和反序列化
     private static final Gson gson = new Gson();
 
+    /**
+     * 轮询配置类
+     */
+    public static class PollConfig {
+        private int maxAttempts = 10;      // 最多轮询次数,默认10次
+        private int pollInterval = 500;    // 每次间隔毫秒数,默认500ms
+
+        public PollConfig() {
+        }
+
+        public PollConfig(int maxAttempts, int pollInterval) {
+            this.maxAttempts = maxAttempts;
+            this.pollInterval = pollInterval;
+        }
+
+        public int getMaxAttempts() {
+            return maxAttempts;
+        }
+
+        public void setMaxAttempts(int maxAttempts) {
+            this.maxAttempts = maxAttempts;
+        }
+
+        public int getPollInterval() {
+            return pollInterval;
+        }
+
+        public void setPollInterval(int pollInterval) {
+            this.pollInterval = pollInterval;
+        }
+    }
+
     // 后端gateway连接
     // private static String host = "http://192.168.12.139:10004/mobile";   //中台服务
     // private static String host = "http://192.168.12.139:10001/transfer/mobile";  //本机网关
@@ -199,105 +231,62 @@ public class api {
     }
 
     /**
-     * 查询停车费用API (真实接口)
-     * 参考 TypeScript 版本的 pay.getChargeData 实现
-     *
-     * @param context      上下文
-     * @param licensePlate 车牌号
-     * @return 停车费用信息
+     * 判断轮询是否完成的函数式接口
      */
-    public static CompletableFuture<R<ParkingFeeInfo>> queryParkingFee(Context context, String licensePlate) {
-        return CompletableFuture.supplyAsync(() -> {
-            try {
-                // 构建请求参数
-                ChargeQuery query = new ChargeQuery();
-                query.setChargeScene(2);  // 计费场景: 2
-                query.setPlateNo(licensePlate);
-
-                // 第一步: 调用 /cg/chargeByUnify 接口
-                ApiOption option = new ApiOption("/cg/chargeByUnify", query);
-                option.setMethod(ApiOption.POST);
-                option.setToast(false);  // 不显示错误提示
-
-                TypeToken<R<ParkingFeeInfo>> typeToken = new TypeToken<R<ParkingFeeInfo>>() {};
-                R<ParkingFeeInfo> result = http(context, option, typeToken).get();
-
-                // 判断是否需要轮询
-                if (result != null && result.isSuccess() && result.getData() != null) {
-                    String resultKey = result.getData().getResultKey();
-                    
-                    if (resultKey != null && !resultKey.isEmpty()) {
-                        // 第二步: 有 resultKey,需要轮询 /cg/getChargeResult
-                        return pollChargeResult(context, resultKey);
-                    } else {
-                        // 直接返回结果
-                        return result;
-                    }
-                } else {
-                    return result;
-                }
-            } catch (Exception e) {
-                Log.error("查询停车费用失败: " + e.getMessage());
-                return new R<>("查询失败: " + e.getMessage());
-            }
-        });
+    public interface PollCompletionChecker<T> {
+        /**
+         * 判断轮询是否已完成(是否应该停止轮询并返回结果)
+         * @param result 当前轮询的结果
+         * @return true表示已完成,停止轮询;false表示继续轮询
+         */
+        boolean isCompleted(R<T> result);
     }
 
     /**
-     * 轮询获取计费结果
-     * 参考 TypeScript 版本的 getLocalCharge 实现
+     * 通用轮询方法
+     * 用于轮询获取结果,直到有数据或超时
      *
-     * @param context   上下文
-     * @param resultKey 结果key
-     * @return 停车费用信息
+     * @param context           上下文
+     * @param option            API 请求选项
+     * @param dataClass         返回数据类型
+     * @param pollConfig        轮询配置(可为null,使用默认配置)
+     * @param completionChecker 轮询完成判断器,用于自定义停止轮询的条件(可为null,默认判断getData()!=null)
+     * @param <T>               泛型类型
+     * @return 轮询结果
      */
-    private static R<ParkingFeeInfo> pollChargeResult(Context context, String resultKey) {
-        int maxAttempts = 10;  // 最多轮询10次
-        int pollInterval = 500;  // 每次间隔500ms
+    public static <T> R<T> poll(Context context, ApiOption option, TypeToken<R<T>> dataClass, PollConfig pollConfig, PollCompletionChecker<T> completionChecker) {
+        int maxAttempts = pollConfig.getMaxAttempts();
+        int pollInterval = pollConfig.getPollInterval();
 
         for (int count = 0; count < maxAttempts; count++) {
             try {
-                // 延迟
+                // 延迟(第一次不延迟)
                 if (count > 0) {
                     Thread.sleep(pollInterval);
                 }
 
-                // 构建请求参数
-                java.util.HashMap<String, Object> params = new java.util.HashMap<>();
-                params.put("resultKey", resultKey);
+                // 执行HTTP请求
+                R<T> result = http(context, option, dataClass).get();
 
-                ApiOption option = new ApiOption("/cg/getChargeResult", params);
-                option.setMethod(ApiOption.GET);
-                option.setToast(false);
-
-                TypeToken<R<ParkingFeeInfo>> typeToken = new TypeToken<R<ParkingFeeInfo>>() {};
-                R<ParkingFeeInfo> result = http(context, option, typeToken).get();
+                if (!result.isSuccess()) {
+                    return result;
+                }
 
-                if (result != null) {
-                    if (!result.isSuccess()) {
-                        // 请求失败但有数据,返回结果
-                        if (result.getData() != null) {
-                            return result;
-                        } else {
-                            return new R<>("计费信息为空");
-                        }
-                    } else {
-                        // 请求成功
-                        if (result.getData() != null) {
-                            // 有数据,返回结果
-                            return result;
-                        } else {
-                            // 没有数据,继续轮询
-                            if (count >= maxAttempts - 1) {
-                                // 已达到最大轮询次数,超时
-                                return new R<>("timeout");
-                            }
-                            // 继续下一次轮询
-                        }
+                // 请求成功,使用自定义判断条件
+                if (completionChecker.isCompleted(result)) {
+                    // 满足完成条件,返回结果
+                    return result;
+                }
+                else {
+                    // 不满足完成条件,继续轮询
+                    if (count >= maxAttempts - 1) {
+                        // 已达到最大轮询次数,超时
+                        return new R<>("timeout");
                     }
+                    // 继续下一次轮询
                 }
             } catch (Exception e) {
-                Log.error("轮询计费结果失败: " + e.getMessage());
+                Log.error("轮询失败: " + e.getMessage());
                 return new R<>("轮询失败: " + e.getMessage());
             }
         }
@@ -305,259 +294,4 @@ public class api {
         // 超时
         return new R<>("timeout");
     }
-
-    /**
-     * 停车费用信息类
-     */
-    public static class ParkingFeeInfo {
-        private String licensePlate;
-        private String parkingLotName;
-        private int parkingDays;
-        private int parkingHours;
-        private int parkingMinutes;
-        private int totalFee;
-        
-        // 新增字段,参考 index.vue 中的 chargeData
-        private int feeType; // 费用类型: 0-正常缴费, 1-无需缴费, 2-已缴费免费离场时间内, 3-月卡车辆, 4-免费时间内, 5-无需缴费, 6-全额优惠, 10-未入场, 12-场外月卡, 13-欠费补缴, 14-黑名单, 16-临停加欠费补缴
-        private String parkName; // 车场名称
-        private String stayTime; // 停车时长(格式化后的字符串)
-        private int actualAmount; // 实际金额(分)
-        private int discountAmount; // 减免金额(分)
-        private String plateNo; // 车牌号
-        private String plateColor; // 车牌颜色
-        private String parkId; // 车场ID
-        private String cardId; // 月卡ID
-        private boolean rzStatus; // 认证状态
-        private java.util.List<ArrearageOrder> followList; // 历史欠费订单列表
-        private String resultKey; // 计费结果key (用于轮询)
-
-        public String getLicensePlate() {
-            return licensePlate;
-        }
-
-        public void setLicensePlate(String licensePlate) {
-            this.licensePlate = licensePlate;
-        }
-
-        public String getParkingLotName() {
-            return parkingLotName;
-        }
-
-        public void setParkingLotName(String parkingLotName) {
-            this.parkingLotName = parkingLotName;
-        }
-
-        public int getParkingDays() {
-            return parkingDays;
-        }
-
-        public void setParkingDays(int parkingDays) {
-            this.parkingDays = parkingDays;
-        }
-
-        public int getParkingHours() {
-            return parkingHours;
-        }
-
-        public void setParkingHours(int parkingHours) {
-            this.parkingHours = parkingHours;
-        }
-
-        public int getParkingMinutes() {
-            return parkingMinutes;
-        }
-
-        public void setParkingMinutes(int parkingMinutes) {
-            this.parkingMinutes = parkingMinutes;
-        }
-
-        public int getTotalFee() {
-            return totalFee;
-        }
-
-        public void setTotalFee(int totalFee) {
-            this.totalFee = totalFee;
-        }
-
-        public int getFeeType() {
-            return feeType;
-        }
-
-        public void setFeeType(int feeType) {
-            this.feeType = feeType;
-        }
-
-        public String getParkName() {
-            return parkName;
-        }
-
-        public void setParkName(String parkName) {
-            this.parkName = parkName;
-        }
-
-        public String getStayTime() {
-            return stayTime;
-        }
-
-        public void setStayTime(String stayTime) {
-            this.stayTime = stayTime;
-        }
-
-        public int getActualAmount() {
-            return actualAmount;
-        }
-
-        public void setActualAmount(int actualAmount) {
-            this.actualAmount = actualAmount;
-        }
-
-        public int getDiscountAmount() {
-            return discountAmount;
-        }
-
-        public void setDiscountAmount(int discountAmount) {
-            this.discountAmount = discountAmount;
-        }
-
-        public String getPlateNo() {
-            return plateNo;
-        }
-
-        public void setPlateNo(String plateNo) {
-            this.plateNo = plateNo;
-        }
-
-        public String getPlateColor() {
-            return plateColor;
-        }
-
-        public void setPlateColor(String plateColor) {
-            this.plateColor = plateColor;
-        }
-
-        public String getParkId() {
-            return parkId;
-        }
-
-        public void setParkId(String parkId) {
-            this.parkId = parkId;
-        }
-
-        public String getCardId() {
-            return cardId;
-        }
-
-        public void setCardId(String cardId) {
-            this.cardId = cardId;
-        }
-
-        public boolean isRzStatus() {
-            return rzStatus;
-        }
-
-        public void setRzStatus(boolean rzStatus) {
-            this.rzStatus = rzStatus;
-        }
-
-        public java.util.List<ArrearageOrder> getFollowList() {
-            return followList;
-        }
-
-        public void setFollowList(java.util.List<ArrearageOrder> followList) {
-            this.followList = followList;
-        }
-
-        public String getResultKey() {
-            return resultKey;
-        }
-
-        public void setResultKey(String resultKey) {
-            this.resultKey = resultKey;
-        }
-    }
-
-    /**
-     * 欠费订单信息类
-     */
-    public static class ArrearageOrder {
-        private String orderId;        // 订单ID
-        private String parkName;       // 车场名称
-        private int amount;            // 欠费金额(分)
-        private String createTime;     // 创建时间
-        private String plateNo;        // 车牌号
-
-        public String getOrderId() {
-            return orderId;
-        }
-
-        public void setOrderId(String orderId) {
-            this.orderId = orderId;
-        }
-
-        public String getParkName() {
-            return parkName;
-        }
-
-        public void setParkName(String parkName) {
-            this.parkName = parkName;
-        }
-
-        public int getAmount() {
-            return amount;
-        }
-
-        public void setAmount(int amount) {
-            this.amount = amount;
-        }
-
-        public String getCreateTime() {
-            return createTime;
-        }
-
-        public void setCreateTime(String createTime) {
-            this.createTime = createTime;
-        }
-
-        public String getPlateNo() {
-            return plateNo;
-        }
-
-        public void setPlateNo(String plateNo) {
-            this.plateNo = plateNo;
-        }
-    }
-
-    /**
-     * 计费查询请求参数类
-     * 对应 TypeScript 的 ChargeQuery
-     */
-    public static class ChargeQuery {
-        private int chargeScene;  // 计费场景: 2-临停缴费
-        private String plateNo;   // 车牌号
-        private String parkId;    // 车场ID (可选)
-
-        public int getChargeScene() {
-            return chargeScene;
-        }
-
-        public void setChargeScene(int chargeScene) {
-            this.chargeScene = chargeScene;
-        }
-
-        public String getPlateNo() {
-            return plateNo;
-        }
-
-        public void setPlateNo(String plateNo) {
-            this.plateNo = plateNo;
-        }
-
-        public String getParkId() {
-            return parkId;
-        }
-
-        public void setParkId(String parkId) {
-            this.parkId = parkId;
-        }
-    }
 }

+ 1 - 0
entry/src/main/resources/base/graphic/background_circle_8.xml

@@ -6,5 +6,6 @@
         ohos:radius="8vp"/>
     <solid
         ohos:color="#FFFFFFFF"/>
+
 </shape>
 

+ 211 - 203
entry/src/main/resources/base/layout/ability_main.xml

@@ -15,246 +15,254 @@
     <DirectionalLayout
         ohos:height="match_parent"
         ohos:width="match_parent"
-        ohos:orientation="horizontal"
-        ohos:margin="10vp">
+        ohos:margin="10vp"
+        ohos:orientation="horizontal">
 
         <!-- 左侧内容区域 - 垂直布局 -->
+
+
+        <StackLayout
+            xmlns:ohos="http://schemas.huawei.com/res/ohos"
+            ohos:height="match_parent"
+            ohos:width="match_content"
+            ohos:orientation="horizontal">
+
         <DirectionalLayout
             ohos:id="$+id:main_left"
             ohos:height="match_parent"
             ohos:width="400vp"
             ohos:orientation="vertical">
 
-        <DirectionalLayout
-            ohos:height="40vp"
-            ohos:width="match_parent"
-            ohos:alignment="left"
-            ohos:background_element="$graphic:container_top"
-            ohos:end_padding="16vp"
-            ohos:orientation="horizontal"
-            ohos:start_padding="16vp">
-
             <DirectionalLayout
-                ohos:height="match_content"
+                ohos:height="40vp"
                 ohos:width="match_parent"
                 ohos:alignment="left"
-                ohos:layout_alignment="center"
-                ohos:orientation="horizontal">
-
-                <Image
-                    ohos:height="25vp"
-                    ohos:width="25vp"
-                    ohos:image_src="$media:logo_white"
-                    ohos:right_margin="10vp"
-                    ohos:scale_mode="stretch"
-                    ></Image>
-
-                <!-- 标题文字 -->
-                <Text
-                    ohos:id="$+id:title_text"
+                ohos:background_element="$graphic:container_top"
+                ohos:end_padding="16vp"
+                ohos:orientation="horizontal"
+                ohos:start_padding="16vp">
+
+                <DirectionalLayout
                     ohos:height="match_content"
-                    ohos:width="0"
-                    ohos:weight="1"
-                    ohos:layout_alignment="vertical_center"
-                    ohos:text="爱泊客.停车缴费"
-                    ohos:text_color="#FFFFFFFF"
-                    ohos:text_size="14fp"
-                    ohos:text_weight="600"/>
-                <Image
-                    ohos:id="$+id:quit"
-                    ohos:height="25vp"
-                    ohos:width="25vp"
-                    ohos:image_src="$media:logout"
-                    ohos:scale_mode="stretch"
-
-                    ></Image>
+                    ohos:width="match_parent"
+                    ohos:alignment="left"
+                    ohos:layout_alignment="center"
+                    ohos:orientation="horizontal">
 
-            </DirectionalLayout>
-        </DirectionalLayout>
+                    <Image
+                        ohos:height="25vp"
+                        ohos:width="25vp"
+                        ohos:image_src="$media:logo_white"
+                        ohos:right_margin="10vp"
+                        ohos:scale_mode="stretch"
+                        ></Image>
 
-        <!-- 页面滑动容器 -->
-        <DirectionalLayout
-            ohos:bottom_padding="10vp"
-            ohos:height="0vp"
-            ohos:width="match_parent"
-            ohos:background_element="$graphic:container_body"
-            ohos:left_padding="1vp"
-            ohos:right_padding="1vp"
-            ohos:weight="1">
+                    <!-- 标题文字 -->
+                    <Text
+                        ohos:id="$+id:title_text"
+                        ohos:height="match_content"
+                        ohos:width="0"
+                        ohos:layout_alignment="vertical_center"
+                        ohos:text="爱泊客.停车缴费"
+                        ohos:text_color="#FFFFFFFF"
+                        ohos:text_size="14fp"
+                        ohos:text_weight="600"
+                        ohos:weight="1"/>
 
-            <PageSlider
-                ohos:id="$+id:page_slider"
-                ohos:height="match_parent"
-                ohos:width="match_parent"/>
-        </DirectionalLayout>
+                    <Image
+                        ohos:id="$+id:quit"
+                        ohos:height="25vp"
+                        ohos:width="25vp"
+                        ohos:image_src="$media:logout"
+                        ohos:scale_mode="stretch"
 
-        <!-- 底部导航栏 -->
-        <DirectionalLayout
-            ohos:height="64vp"
-            ohos:width="match_parent"
-            ohos:background_element="$graphic:container_bottom"
-            ohos:bottom_padding="8vp"
-            ohos:orientation="horizontal"
-            ohos:top_margin="8vp"
-            ohos:top_padding="8vp">
-
-            <!-- 找车位 -->
-            <DirectionalLayout
-                ohos:id="$+id:nav_find_parking"
-                ohos:height="match_parent"
-                ohos:width="0vp"
-                ohos:alignment="center"
-                ohos:orientation="vertical"
-                ohos:weight="1">
+                        ></Image>
 
-                <Image
-                    ohos:id="$+id:icon_park"
-                    ohos:height="24vp"
-                    ohos:width="24vp"
-                    ohos:bottom_margin="4vp"
-                    ohos:image_src="$media:park"
-                    ohos:scale_mode="stretch"
-                    ohos:visibility="hide"/>
-
-                <Image
-                    ohos:id="$+id:icon_park_1"
-                    ohos:height="24vp"
-                    ohos:width="24vp"
-                    ohos:bottom_margin="4vp"
-                    ohos:image_src="$media:park_1"
-                    ohos:scale_mode="stretch"/>
-
-                <Text
-                    ohos:id="$+id:text_park"
-                    ohos:height="match_content"
-                    ohos:width="match_content"
-                    ohos:text="找车位"
-                    ohos:text_color="#FA6332"
-                    ohos:text_size="12fp"/>
+                </DirectionalLayout>
             </DirectionalLayout>
 
-            <!-- 我的 -->
-            <DirectionalLayout
-                ohos:id="$+id:nav_charge"
-                ohos:height="match_parent"
-                ohos:width="0vp"
-                ohos:alignment="center"
-                ohos:orientation="vertical"
+            <!-- 页面容器 - 使用StackLayout堆叠显示 -->
+            <StackLayout
+                ohos:id="$+id:page_container"
+                ohos:height="0vp"
+                ohos:width="match_parent"
+                ohos:background_element="$graphic:container_body"
+                ohos:bottom_padding="10vp"
+                ohos:left_padding="1vp"
+                ohos:right_padding="1vp"
                 ohos:weight="1">
+                <!-- 三个页面组件将动态添加到这里 -->
+            </StackLayout>
 
-                <Image
-                    ohos:id="$+id:icon_charge"
-                    ohos:height="24vp"
-                    ohos:width="24vp"
-                    ohos:bottom_margin="4vp"
-                    ohos:image_src="$media:charge"
-                    ohos:scale_mode="stretch"/>
-
-                <Image
-                    ohos:id="$+id:icon_charge_1"
-                    ohos:height="24vp"
-                    ohos:width="24vp"
-                    ohos:bottom_margin="4vp"
-                    ohos:image_src="$media:charge_1"
-                    ohos:scale_mode="stretch"
-                    ohos:visibility="hide"/>
-
-                <Text
-                    ohos:id="$+id:text_charge"
-                    ohos:height="match_content"
-                    ohos:width="match_content"
-                    ohos:text="缴费"
-                    ohos:text_color="#FF666666"
-                    ohos:text_size="12fp"/>
-            </DirectionalLayout>
-
-            <!-- 缴费记录 -->
+            <!-- 底部导航栏 -->
             <DirectionalLayout
-                ohos:id="$+id:nav_order"
-                ohos:height="match_parent"
-                ohos:width="0vp"
-                ohos:alignment="center"
-                ohos:orientation="vertical"
-                ohos:weight="1">
+                ohos:height="64vp"
+                ohos:width="match_parent"
+                ohos:background_element="$graphic:container_bottom"
+                ohos:bottom_padding="8vp"
+                ohos:orientation="horizontal"
+                ohos:top_margin="8vp"
+                ohos:top_padding="8vp">
 
-                <Image
-                    ohos:id="$+id:icon_order"
-                    ohos:height="24vp"
-                    ohos:width="24vp"
-                    ohos:bottom_margin="4vp"
-                    ohos:image_src="$media:order"
-                    ohos:scale_mode="stretch"/>
-
-                <Image
-                    ohos:id="$+id:icon_order_1"
-                    ohos:height="24vp"
-                    ohos:width="24vp"
-                    ohos:bottom_margin="4vp"
-                    ohos:image_src="$media:order_1"
-                    ohos:scale_mode="stretch"
-                    ohos:visibility="hide"/>
-
-                <Text
-                    ohos:id="$+id:text_order"
-                    ohos:height="match_content"
-                    ohos:width="match_content"
-                    ohos:text="缴费记录"
-                    ohos:text_color="#FF666666"
-                    ohos:text_size="12fp"/>
-            </DirectionalLayout>
+                <!-- 找车位 -->
+                <DirectionalLayout
+                    ohos:id="$+id:nav_find_parking"
+                    ohos:height="match_parent"
+                    ohos:width="0vp"
+                    ohos:alignment="center"
+                    ohos:orientation="vertical"
+                    ohos:weight="1">
 
-            <!-- 当前位置 -->
-            <DirectionalLayout
-                ohos:id="$+id:nav_current_location"
-                ohos:height="match_parent"
-                ohos:width="0vp"
-                ohos:alignment="center"
-                ohos:orientation="vertical"
-                ohos:weight="1">
+                    <Image
+                        ohos:id="$+id:icon_park"
+                        ohos:height="24vp"
+                        ohos:width="24vp"
+                        ohos:bottom_margin="4vp"
+                        ohos:image_src="$media:park"
+                        ohos:scale_mode="stretch"
+                        ohos:visibility="hide"/>
 
-                <Image
-                    ohos:id="$+id:icon_current_location"
-                    ohos:height="24vp"
-                    ohos:width="24vp"
-                    ohos:bottom_margin="4vp"
-                    ohos:image_src="$media:location"
-                    ohos:scale_mode="stretch"/>
+                    <Image
+                        ohos:id="$+id:icon_park_1"
+                        ohos:height="24vp"
+                        ohos:width="24vp"
+                        ohos:bottom_margin="4vp"
+                        ohos:image_src="$media:park_1"
+                        ohos:scale_mode="stretch"/>
 
-                <Text
-                    ohos:id="$+id:text_current_location"
-                    ohos:height="match_content"
-                    ohos:width="match_content"
-                    ohos:text="当前位置"
-                    ohos:text_color="#FF666666"
-                    ohos:text_size="12fp"/>
+                    <Text
+                        ohos:id="$+id:text_park"
+                        ohos:height="match_content"
+                        ohos:width="match_content"
+                        ohos:text="找车位"
+                        ohos:text_color="#FA6332"
+                        ohos:text_size="12fp"/>
+                </DirectionalLayout>
+
+                <!-- 我的 -->
+                <DirectionalLayout
+                    ohos:id="$+id:nav_charge"
+                    ohos:height="match_parent"
+                    ohos:width="0vp"
+                    ohos:alignment="center"
+                    ohos:orientation="vertical"
+                    ohos:weight="1">
+
+                    <Image
+                        ohos:id="$+id:icon_charge"
+                        ohos:height="24vp"
+                        ohos:width="24vp"
+                        ohos:bottom_margin="4vp"
+                        ohos:image_src="$media:charge"
+                        ohos:scale_mode="stretch"/>
+
+                    <Image
+                        ohos:id="$+id:icon_charge_1"
+                        ohos:height="24vp"
+                        ohos:width="24vp"
+                        ohos:bottom_margin="4vp"
+                        ohos:image_src="$media:charge_1"
+                        ohos:scale_mode="stretch"
+                        ohos:visibility="hide"/>
+
+                    <Text
+                        ohos:id="$+id:text_charge"
+                        ohos:height="match_content"
+                        ohos:width="match_content"
+                        ohos:text="缴费"
+                        ohos:text_color="#FF666666"
+                        ohos:text_size="12fp"/>
+                </DirectionalLayout>
+
+                <!-- 缴费记录 -->
+                <DirectionalLayout
+                    ohos:id="$+id:nav_order"
+                    ohos:height="match_parent"
+                    ohos:width="0vp"
+                    ohos:alignment="center"
+                    ohos:orientation="vertical"
+                    ohos:weight="1">
+
+                    <Image
+                        ohos:id="$+id:icon_order"
+                        ohos:height="24vp"
+                        ohos:width="24vp"
+                        ohos:bottom_margin="4vp"
+                        ohos:image_src="$media:order"
+                        ohos:scale_mode="stretch"/>
+
+                    <Image
+                        ohos:id="$+id:icon_order_1"
+                        ohos:height="24vp"
+                        ohos:width="24vp"
+                        ohos:bottom_margin="4vp"
+                        ohos:image_src="$media:order_1"
+                        ohos:scale_mode="stretch"
+                        ohos:visibility="hide"/>
+
+                    <Text
+                        ohos:id="$+id:text_order"
+                        ohos:height="match_content"
+                        ohos:width="match_content"
+                        ohos:text="缴费记录"
+                        ohos:text_color="#FF666666"
+                        ohos:text_size="12fp"/>
+                </DirectionalLayout>
+
+                <!-- 当前位置 -->
+                <DirectionalLayout
+                    ohos:id="$+id:nav_current_location"
+                    ohos:height="match_parent"
+                    ohos:width="0vp"
+                    ohos:alignment="center"
+                    ohos:orientation="vertical"
+                    ohos:weight="1">
+
+                    <Image
+                        ohos:id="$+id:icon_current_location"
+                        ohos:height="24vp"
+                        ohos:width="24vp"
+                        ohos:bottom_margin="4vp"
+                        ohos:image_src="$media:location"
+                        ohos:scale_mode="stretch"/>
+
+                    <Text
+                        ohos:id="$+id:text_current_location"
+                        ohos:height="match_content"
+                        ohos:width="match_content"
+                        ohos:text="当前位置"
+                        ohos:text_color="#FF666666"
+                        ohos:text_size="12fp"/>
+                </DirectionalLayout>
             </DirectionalLayout>
-        </DirectionalLayout>
 
-        <Button
-            ohos:id="$+id:btn_hwid_sign_in"
-            ohos:height="60vp"
-            ohos:width="match_parent"
-            ohos:layout_alignment="right|horizontal_center"
-            ohos:text="华为账号登录"
-            ohos:visibility="hide"></Button>
+            <Button
+                ohos:id="$+id:btn_hwid_sign_in"
+                ohos:height="60vp"
+                ohos:width="match_parent"
+                ohos:layout_alignment="right|horizontal_center"
+                ohos:text="华为账号登录"
+                ohos:visibility="hide"></Button>
         </DirectionalLayout>
 
+
+            <!-- Loading组件放在最后,确保在最上层显示 -->
+            <com.fujica.abk.component.LoadingComponent
+                ohos:id="$+id:loading_component"
+                ohos:height="match_parent"
+                ohos:width="match_parent"/>
+        </StackLayout>
+
         <!-- 右侧详情区域 -->
         <DirectionalLayout
             ohos:id="$+id:main_right"
             ohos:height="match_parent"
             ohos:width="0vp"
-            ohos:weight="1"
-            ohos:left_margin="10vp"
             ohos:background_element="#FFFFFFFF"
-            ohos:visibility="hide">
+            ohos:left_margin="10vp"
+            ohos:visibility="hide"
+            ohos:weight="1">
             <!-- 详情组件将动态添加到这里 -->
         </DirectionalLayout>
     </DirectionalLayout>
-
-    <!-- Loading组件放在最后,确保在最上层显示 -->
-    <com.fujica.abk.component.LoadingComponent
-        ohos:id="$+id:loading_component"
-        ohos:height="match_parent"
-        ohos:width="match_parent"/>
 </StackLayout>