| | |
| | | MyApplication.addOrderView(object : MyApplication.OrderStatueView { |
| | | override fun orderInfo(data: OrderSimpleData?) { |
| | | data?.let { |
| | | when(it.orderType){ |
| | | 1,2,3 -> { |
| | | when (it.orderType) { |
| | | 1, 2, 3,7 -> { |
| | | if (it.status == 10 || it.status == 12) { |
| | | Handler(Looper.getMainLooper()).post { |
| | | toast("用户已取消订单") |
| | |
| | | moveCamera(aMap, carMarker!!.position) |
| | | } |
| | | 5, 6 -> { |
| | | if (endMarker == null){ |
| | | if (endMarker == null) { |
| | | moveCamera(aMap, carMarker!!.position) |
| | | }else{ |
| | | } else { |
| | | moveCamera(aMap, carMarker!!.position, endMarker!!.position) |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | 5, 6 -> { |
| | | if (endMarker == null){ |
| | | if (endMarker == null) { |
| | | toast("暂无终点") |
| | | }else{ |
| | | } else { |
| | | startActivity<GPSNaviActivity>( |
| | | "start" to carMarker!!.position, |
| | | "end" to endMarker!!.position |
| | |
| | | toast("只能在预约时间的半小时内出行") |
| | | return@let |
| | | } |
| | | if (it.data.orderState == 4&& !rxPermissions.isGranted(Manifest.permission.RECORD_AUDIO)&& !rxPermissions.isGranted(Manifest.permission.WRITE_EXTERNAL_STORAGE)){ |
| | | if (it.data.orderState == 4&& (!rxPermissions.isGranted(Manifest.permission.RECORD_AUDIO) || !rxPermissions.isGranted(Manifest.permission.WRITE_EXTERNAL_STORAGE))){ |
| | | DialogUtil.getDelAndSureDialog(this,"去授权","取消","根据平台规则,为了保证司乘安全,我们将会对行程进行录音,因此需要获取录音和文件存储权限",{ |
| | | }){ |
| | | rxPermissions.request(Manifest.permission.RECORD_AUDIO,Manifest.permission.WRITE_EXTERNAL_STORAGE).subscribe { |
| | | if (it){ |
| | | |
| | | }else{ |
| | | } else { |
| | | toast("请前往应用设置页面打开录音和文件存储权限") |
| | | } |
| | | } |
| | |
| | | return@let |
| | | } |
| | | it.data.orderState++ |
| | | callStatue(it.data.orderState,{ |
| | | callStatue(it.data.orderState, { |
| | | showStatueMapUI(it) |
| | | if (it.data.orderState == 5){ |
| | | if (it.data.orderState == 5) { |
| | | showRecordDialog() |
| | | } |
| | | }) { |
| | |
| | | } |
| | | 5, 6 -> { |
| | | it.data.orderState = 6 |
| | | when(orderType){ |
| | | when (orderType) { |
| | | "2" -> { |
| | | showMoneyTypeDialog() |
| | | } |
| | | "1" -> { |
| | | callStatue(6,{ |
| | | "1","7" -> { |
| | | callStatue(6, { |
| | | startActivity<MajorSureMoneyActivity>( |
| | | "orderId" to orderId, |
| | | "orderType" to orderType |
| | |
| | | view.tv_view_two_base.gravity = Gravity.CENTER |
| | | view.view_hint_close_base.visibility = View.INVISIBLE |
| | | view.tv_count_timer.visible() |
| | | val timer = object:CountDownTimer(3000,1000){ |
| | | val timer = object:CountDownTimer(3000, 1000){ |
| | | override fun onTick(millisUntilFinished: Long) { |
| | | view.tv_count_timer.text = "${(millisUntilFinished/1000)+1}S" |
| | | } |
| | |
| | | onlySureDialog.setOnDismissListener { |
| | | timer.cancel() |
| | | } |
| | | EventBus.getDefault().post(BaseEvent(BaseEvent.START_RECORD)) |
| | | } |
| | | |
| | | private fun callStatue(i: Int, click: () -> Unit, clickFail: () -> Unit) { |
| | |
| | | map["state"] = i |
| | | map["lat"] = MyApplication.getLocation().latitude |
| | | map["lon"] = MyApplication.getLocation().longitude |
| | | callNet(Api.process, map,{ |
| | | callNet(Api.process, map, { |
| | | click() |
| | | }) { |
| | | clickFail() |
| | |
| | | pop.contentView.tv_ok.setOnClickListener { |
| | | pop.dismiss() |
| | | if (payType == 1) { |
| | | callStatue(6,{ |
| | | callStatue(6, { |
| | | startActivity<FillOutActivity>("orderId" to orderId, "orderType" to orderType) |
| | | finish() |
| | | }) { |
| | |
| | | map["orderId"] = orderId |
| | | map["orderType"] = orderType |
| | | map["type"] = payType |
| | | callStatue(6,{ |
| | | callStatue(6, { |
| | | callNet(Api.confirmFees, map) { |
| | | finish() |
| | | startActivity<OrderOverActivity>( |
| | |
| | | private fun callOrder() { |
| | | MyApplication.currentOrderId = orderId |
| | | MyApplication.currentOrderType = orderType |
| | | MyApplication.recordOrderId = orderId |
| | | MyApplication.recordOrderType = orderType |
| | | var map = getMapByAny() |
| | | map["orderId"] = orderId |
| | | map["orderType"] = orderType |
| | |
| | | tv_end_address.text = it.data.endAddress |
| | | tv_change_end.gone() |
| | | } |
| | | if (orderType == "1"){ |
| | | if (orderType == "1"||orderType == "7"){ |
| | | tv_red_money.gone() |
| | | } |
| | | tv_red_money.text = it.data.tipMoney.toString() + "元红包" |
| | |
| | | view.iv_img.setImageResource(R.mipmap.end_point) |
| | | endMarker = addMarker(aMap, it.data.endLat, it.data.endLon, view, "") |
| | | }else if (endMarker?.position?.latitude == 0.0){ |
| | | endMarker?.position = LatLng(orderBean.data.endLat,orderBean.data.endLon) |
| | | endMarker?.position = LatLng(orderBean.data.endLat, orderBean.data.endLon) |
| | | } |
| | | endMarker?.isVisible = false |
| | | if (carMarker == null) { |
| | |
| | | val carView = createView(R.layout.item_map_market, this) |
| | | carView.iv_img.setImageResource(R.mipmap.car_trip) |
| | | carView.tv_hint.visible() |
| | | carView.tv_hint.setColorBuild(this,content,R.color.main_yellow_qia,4,content.length) |
| | | carView.tv_hint.setColorBuild(this, content, R.color.main_yellow_qia, 4, content.length) |
| | | return carView |
| | | } |
| | | |
| | |
| | | tv_Right.visible() |
| | | when (it.data.orderState) { |
| | | 2, 3 -> { |
| | | if (it.data.reassign == 1){ |
| | | if (it.data.reassign == 1) { |
| | | tv_Right.gone() |
| | | } |
| | | iv_to_gd.visible() |
| | |
| | | } |
| | | 4 -> { |
| | | iv_to_gd.gone() |
| | | if (it.data.reassign == 1){ |
| | | if (it.data.reassign == 1) { |
| | | tv_Right.gone() |
| | | } |
| | | closeLine() |
| | |
| | | changeCarFive(true) |
| | | setTitleText("服务中") |
| | | slide_btn.changeButtonText("送达该乘客") |
| | | if (!MyApplication.isRecording){ |
| | | EventBus.getDefault().post(BaseEvent(BaseEvent.START_RECORD)) |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | mapByAny["lon"] = lon |
| | | mapByAny["endAddress"] = name |
| | | mapByAny["orderId"] = orderId |
| | | callNet(Api.setEnd,mapByAny){ |
| | | callNet(Api.setEnd, mapByAny) { |
| | | orderBean.data.endAddress = name |
| | | orderBean.data.endLat = lat |
| | | orderBean.data.endLon = lon |
| | | tv_end_address.text = name |
| | | tv_change_end.gone() |
| | | if (byChangeEnd){ |
| | | if (byChangeEnd) { |
| | | orderBean.data.orderState++ |
| | | callStatue(orderBean.data.orderState,{ |
| | | showStatueMapUI(orderBean) |
| | | callStatue(orderBean.data.orderState, { |
| | | showRecordDialog() |
| | | showStatueMapUI(orderBean) |
| | | }) { |
| | | orderBean.data.orderState-- |
| | | } |