From fbfa859ff0fe312cbb49a3345b6e3d67d574a946 Mon Sep 17 00:00:00 2001
From: zuoxiao <470321431@qq.com>
Date: 星期四, 28 十一月 2024 16:33:37 +0800
Subject: [PATCH] 1.工单列表界面 2.工单详情界面 3.处理工单界面选择图片相关

---
 app/src/main/java/com/dayu/pipirrapp/fragment/MapFragment.java |   30 ++++++++++++++++++++----------
 1 files changed, 20 insertions(+), 10 deletions(-)

diff --git a/app/src/main/java/com/dayu/pipirrapp/fragment/MapFragment.java b/app/src/main/java/com/dayu/pipirrapp/fragment/MapFragment.java
index d5a7925..e8e1f24 100644
--- a/app/src/main/java/com/dayu/pipirrapp/fragment/MapFragment.java
+++ b/app/src/main/java/com/dayu/pipirrapp/fragment/MapFragment.java
@@ -41,6 +41,7 @@
 import com.dayu.pipirrapp.utils.SharedPreferencesHelper;
 import com.dayu.pipirrapp.utils.ToastUtil;
 import com.dayu.pipirrapp.utils.WebViewUtils;
+import com.dayu.pipirrapp.view.ConfirmDialog;
 import com.jeremyliao.liveeventbus.LiveEventBus;
 
 import java.io.File;
@@ -105,8 +106,10 @@
             LiveEventBus.get(CommonKeyName.locationData).observeForever(new Observer<Object>() {
                 @Override
                 public void onChanged(Object o) {
+
                     LatLonBean latLonBean = (LatLonBean) o;
-                    mWebView.evaluateJavascript("javascript:locationOverLay(\"" + latLonBean.getLongitude() + "\",\"" + latLonBean.getLatitude() + "\")", value -> {
+                    Log.i("chageInspecState", "lat:" + latLonBean.getLatitude() + ",log:" + latLonBean.getLongitude());
+                    mWebView.evaluateJavascript("javascript:updateLocation(\"" + latLonBean.getLatitude() + "\",\"" + latLonBean.getLongitude() + "\")", value -> {
                     });
                 }
             });
@@ -199,7 +202,7 @@
      * 鑾峰彇鍙栨按鍙e垪琛�
      */
     private void getMarkerData() {
-        ApiManager.getInstance().requestGetHideLoading(this.getContext(), Constants.BASE_URL + ":8085/project/intake/all", MarkerResult.class, null, new SubscriberListener<BaseResponse<MarkerResult>>() {
+        ApiManager.getInstance().requestGetHideLoading(this.getContext(), Constants.BASE_URL + "/project/intake/all", MarkerResult.class, null, new SubscriberListener<BaseResponse<MarkerResult>>() {
             @Override
             public void onNext(BaseResponse<MarkerResult> t) {
                 if (t.isSuccess()) {
@@ -283,11 +286,7 @@
 
 
     void initView() {
-        //璺宠浆鍒版寚瀹氫綅缃�
-        binding.flyBtn.setOnClickListener(v -> {
-            mWebView.evaluateJavascript("javascript:locationOverLay(116.399565,39.89432)", value -> {
-            });
-        });
+
         mWebView.setWebViewClient(new WebViewClient() {
             @Override
             public WebResourceResponse shouldInterceptRequest(WebView view, WebResourceRequest request) {
@@ -345,8 +344,19 @@
         });
         //宸℃鎸夐挳
         binding.inspectButton.setOnClickListener(v -> {
-            isStartInspec = !isStartInspec;
-            chageInspecState();
+            if (isStartInspec) {
+                ConfirmDialog confirmDialog = new ConfirmDialog(MapFragment.this.getActivity(), "鎻愮ず", "纭鍏抽棴宸℃鍚楋紵", new View.OnClickListener() {
+                    @Override
+                    public void onClick(View v) {
+                        isStartInspec = !isStartInspec;
+                        chageInspecState();
+                    }
+                });
+            } else {
+                isStartInspec = !isStartInspec;
+                chageInspecState();
+            }
+
         });
     }
 
@@ -362,7 +372,7 @@
      */
     private void getCenterPoint() {
 
-        ApiManager.getInstance().requestGet(this.getContext(), Constants.BASE_URL + ":8080/base/dict_item/map_center", CenterPointResult.class, null, new SubscriberListener<BaseResponse<CenterPointResult>>() {
+        ApiManager.getInstance().requestGet(this.getContext(), Constants.BASE_URL + "/base/dict_item/map_center", CenterPointResult.class, null, new SubscriberListener<BaseResponse<CenterPointResult>>() {
             @Override
             public void onNext(BaseResponse<CenterPointResult> t) {
                 if (t.isSuccess()) {

--
Gitblit v1.8.0