Explorar o código

修改绑定逻辑

zhaofuxin %!s(int64=4) %!d(string=hai) anos
pai
achega
4497fe603b

+ 1 - 1
app/src/main/java/com/jld/vod/base/BaseActivity.kt

@@ -77,7 +77,7 @@ abstract class BaseActivity : XPageActivity() {
                     MotionEvent.ACTION_UP->
                         {
                             handlerBaseActivity.removeCallbacks(runnableBaseActivity)
-                            handlerBaseActivity.postDelayed(runnableBaseActivity, 1800 * 1000)
+                             handlerBaseActivity.postDelayed(runnableBaseActivity, 1800 * 1000)
                             LogUtils.logD( "dispatchTouchEvent:ACTION_UP");
                         }
                 }

+ 4 - 0
app/src/main/java/com/jld/vod/service/PositionAdvertService.kt

@@ -50,4 +50,8 @@ class PositionAdvertService : Service() {
         return null
     }
 
+    override fun onDestroy() {
+        super.onDestroy()
+
+    }
 }

+ 4 - 1
app/src/main/java/com/jld/vod/view/SplashActivity.kt

@@ -465,7 +465,7 @@ class SplashActivity : BaseActivity(){
          */
         //检测车辆是否绑定
         splashViewmodel.eqCarliveData.observe(this){res->
-            if (res == "20000") {
+            if (res == "20000") {//已绑定
                 ajaxInfo(getString(R.string.detection_map)+"....",null)
                 //本地如果没有地图则下载地图
                 val mapFile = File(getExternalFilesDir(null), region + ".map")
@@ -479,6 +479,9 @@ class SplashActivity : BaseActivity(){
                     Log.i(TAG, "eqCarliveData: 进入游戏未安装检测:"+mapFile.path)
                     splashViewmodel.findGameByNoInstall(deviceSN)
                 }
+            }else if(res == "20001")//未绑定
+            {
+                ajaxInfo(getString(R.string.unbound_vehicle)+"....",null)
             }
         }
     }

+ 2 - 2
app/src/main/java/com/jld/vod/viewmodel/MainViewModel.kt

@@ -129,8 +129,8 @@ class MainViewModel (app: Application)  : AndroidViewModel(app)  {
                     }
                 },
                 { ex ->
-                    ex.printStackTrace()
-                    findAllModularRotateImgBeanLiveData.postValue(BaseBean.error(ex.message!!, null))
+                  //  ex.printStackTrace()
+                    findPositionAdvertLiveData.postValue(BaseBean.error(ex.message!!, null))
                 }
         )
         return findPositionAdvertLiveData

+ 2 - 2
app/src/main/java/com/jld/vod/viewmodel/SplashViewModel.kt

@@ -192,9 +192,9 @@ class SplashViewModel(app: Application) : AndroidViewModel(app) {
         eqCarliveData.postValue(null)
         RetrofitUtils.eqCar(
             { t ->
-                //LogUtils.logD("eqCart"+t)
+               // LogUtils.logD("eqCart"+t)
                 when (t.code) {
-                    20001 -> findCarByUnbound(userId)//previewAPKliveData.postValue("0")
+                    20001 ->eqCarliveData.postValue("20001")// findCarByUnbound(userId)//previewAPKliveData.postValue("0")
                     20000 -> eqCarliveData.postValue("20000")
                     else  -> eqCarliveData.postValue("404")
                 }

+ 2 - 0
app/src/main/res/values-th-rTH/strings.xml

@@ -85,4 +85,6 @@
     <string name="finished">"เรียบร้อยแล้ว  "</string>
     <string name="underway">"ดำเนินการอยู่ "</string>
     <string name="canceled">ยกเลิก</string>
+    <string name="unbound_vehicle">"ไม่มีการเชื่อมต่อรถ "</string>
+    <string name="finish">"เรียบร้อยแล้ว "</string>
 </resources>

+ 1 - 0
app/src/main/res/values-zh-rCN/strings.xml

@@ -59,6 +59,7 @@
     <string name="load_language">初始化语言</string>
     <string name="Load_vehicle_information">获取车辆信息</string>
     <string name="no_vehicle">无车辆进行绑定</string>
+    <string name="unbound_vehicle">车辆未绑定</string>
     <string name="inspection_application_welcome">检测游戏安装环境</string>
     <string name="detection_map">检测地图是否下载</string>
     <string name="download_map">下载地图</string>

+ 1 - 0
app/src/main/res/values/strings.xml

@@ -139,4 +139,5 @@
     <string name="underway">Underway</string>
     <string name="canceled">Canceled</string>
     <string name="finish">Finish</string>
+    <string name="unbound_vehicle">Unbound vehicle</string>
 </resources>