app/src/main/java/com/okgoincar/base/MyApplication.kt | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
app/src/main/java/com/okgoincar/bean/ServerVoiceBean.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
app/src/main/java/com/okgoincar/slab/SlabGetOrderFragment.kt | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
app/src/main/java/com/okgoincar/slab/SlabMainActivity.kt | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
app/src/main/java/com/okgoincar/base/MyApplication.kt
@@ -71,7 +71,6 @@ // LogUtils.OpenLog(true) initUpPoint() initSocket() } private fun initSocket() { @@ -88,7 +87,7 @@ val json = JSONObject(message) val method = json.optString("method") Handler(Looper.getMainLooper()).post { // toast("收到websocket=$method") toast("收到websocket=$method") } val data = json.optString("data") val code = json.optInt("code", -1) app/src/main/java/com/okgoincar/bean/ServerVoiceBean.java
New file @@ -0,0 +1,32 @@ package com.okgoincar.bean; public class ServerVoiceBean { private int code; private String msg; private String data; public int getCode() { return code; } public void setCode(int code) { this.code = code; } public String getMsg() { return msg; } public void setMsg(String msg) { this.msg = msg; } public String getData() { return data; } public void setData(String data) { this.data = data; } } app/src/main/java/com/okgoincar/slab/SlabGetOrderFragment.kt
@@ -17,6 +17,7 @@ import com.okgoincar.base.AMapKit import com.okgoincar.base.MyApplication import com.okgoincar.bean.OrderBean import com.okgoincar.bean.ServerVoiceBean import com.okgoincar.netUtls.Api import kotlinx.android.synthetic.main.item_get_order.* import kotlinx.android.synthetic.main.item_map_market.view.* @@ -60,9 +61,11 @@ tv_sure.text = strBtn + it.toString() + "秒" } } tv_close.clickDelay { finish() } tv_sure.clickDelay { if (type == 1){ showGetOrder() @@ -78,8 +81,16 @@ var map = getMapByAny() map["orderId"] = orderId map["orderType"] = orderType map["lat"] = MyApplication.getLocation().latitude map["lon"] = MyApplication.getLocation().longitude callNet(this,Api.queryVoiceBroadcast,map){ var bean = Gson().fromJson<ServerVoiceBean>(it,ServerVoiceBean::class.java) if (!bean.data.isNullOrEmpty()){ MyApplication.getTTsManager().setVideoText(bean.data) var str = bean.data str = str.substring(7,str.indexOf("公里,")) tv_title.text = "距您约"+str+"公里" } } } @@ -125,9 +136,8 @@ lineTance: Float, lineTime: Long ) { MyApplication.getTTsManager().setVideoText("收到新的"+ UiUtil.getNameByType(orderType!!)+"订单,"+"从"+data.startAddress+"出发,距您约"+AMapKit.getTance(lineTance)) tv_title.text = "距您约" + AMapKit.getTance(lineTance) // MyApplication.getTTsManager().setVideoText("收到新的"+ // UiUtil.getNameByType(orderType!!)+"订单,"+"从"+data.startAddress+"出发,距您约"+AMapKit.getTance(lineTance)) } }) } app/src/main/java/com/okgoincar/slab/SlabMainActivity.kt
@@ -222,7 +222,6 @@ startActivity<SlabOrderListActivity>() } ll_task.clickDelay { startActivity<SlabMineEventActivity>() } @@ -348,7 +347,6 @@ } } } private fun callLogin(ok: () -> Unit) { var jobNum = CacheKey.getKeyStr("jobNum")