From 108dd30e3818db9d2b494963872c2f4bbb0869f9 Mon Sep 17 00:00:00 2001 From: tongchenfei Date: Mon, 31 Aug 2020 10:40:18 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20=E4=B8=8A=E6=8A=A5?= =?UTF-8?q?=E5=A4=B1=E8=B4=A5=EF=BC=8C=E6=A3=80=E6=9F=A5=E7=BD=91=E7=BB=9C?= =?UTF-8?q?=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mogo/module/share/manager/UploadHelper.kt | 30 ++++++++++--------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/modules/mogo-module-share/src/main/java/com/mogo/module/share/manager/UploadHelper.kt b/modules/mogo-module-share/src/main/java/com/mogo/module/share/manager/UploadHelper.kt index 770b17831e..9727027167 100644 --- a/modules/mogo-module-share/src/main/java/com/mogo/module/share/manager/UploadHelper.kt +++ b/modules/mogo-module-share/src/main/java/com/mogo/module/share/manager/UploadHelper.kt @@ -9,6 +9,7 @@ import com.mogo.map.location.MogoLocation import com.mogo.module.share.ShareControl import com.mogo.module.share.dialog.LaucherShareDialog import com.mogo.service.tanlu.TanluUploadParams +import com.mogo.utils.NetworkUtils import com.mogo.utils.TipToast import com.mogo.utils.logger.Logger @@ -21,21 +22,22 @@ object UploadHelper { Logger.d("UploadHelper", "正在上报===") TipToast.tip("正在上报,请稍后重试") }else { - ServiceApisManager.serviceApis.statusManagerApi.setUploadingStatus("CARD_TYPE_ROAD_CONDITION", true) - if(DebugConfig.getAIType() == DebugConfig.AI_TYPE_TXZ||forcePlayVoice) { - AIAssist.getInstance(context).speakTTSVoice("感谢分享,正在上传") + // 判断当前网络状态 + if(NetworkUtils.isConnected(context)) { + // 有网就正常上报 + ServiceApisManager.serviceApis.statusManagerApi.setUploadingStatus("CARD_TYPE_ROAD_CONDITION", true) + if (DebugConfig.getAIType() == DebugConfig.AI_TYPE_TXZ || forcePlayVoice) { + AIAssist.getInstance(context).speakTTSVoice("感谢分享,正在上传") + } + val location = ServiceApisManager.serviceApis.mapServiceApi.getSingletonLocationClient(context).lastKnowLocation + val latLon = MogoLatLng(location.latitude, location.longitude) + type.location = latLon + Logger.d("UploadHelper", "upload ----> $type") + ServiceApisManager.serviceApis.tanluApi.uploadRoadCondition(type) + }else{ + // 没网就直接提示失败 + AIAssist.getInstance(context).speakTTSVoice("分享失败,请检查网络") } - val location = ServiceApisManager.serviceApis.mapServiceApi.getSingletonLocationClient(context).lastKnowLocation - val latLon = MogoLatLng(location.latitude, location.longitude) - type.location = latLon - Logger.d("UploadHelper", "upload ----> $type") - ServiceApisManager.serviceApis.tanluApi.uploadRoadCondition(type) -// val intent = Intent() -// intent.action = "com.zhidao.share.roadcondition.action" -// intent.addFlags(Intent.FLAG_RECEIVER_FOREGROUND) -// intent.addFlags(Intent.FLAG_INCLUDE_STOPPED_PACKAGES) -// intent.putExtra("type", type) -// context.sendBroadcast(intent) } } } \ No newline at end of file From 57b4716d9b79e46e89d25d9947040cf1aaeee2c2 Mon Sep 17 00:00:00 2001 From: tongchenfei Date: Mon, 31 Aug 2020 15:27:38 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=88=86=E4=BA=AB=E4=BC=98=E5=8C=96?= =?UTF-8?q?=EF=BC=8C=E7=82=B9=E5=87=BB=E5=8D=B3=E5=88=86=E4=BA=AB=E6=88=90?= =?UTF-8?q?=E5=8A=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .idea/codeStyles/Project.xml | 9 +++++++++ .../com/mogo/module/share/manager/UploadHelper.kt | 12 ++++++++---- .../module/tanlu/fragment/TanluCardViewProvider.java | 12 ++++++++++++ .../mogo/module/tanlu/receiver/MarkerInfoReceiver.kt | 3 ++- .../com/mogo/service/tanlu/IMogoTanluUiProvider.java | 8 ++++++++ 5 files changed, 39 insertions(+), 5 deletions(-) diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml index 681f41ae2a..663459aa50 100644 --- a/.idea/codeStyles/Project.xml +++ b/.idea/codeStyles/Project.xml @@ -1,5 +1,14 @@ + + +