[6.4.2]
[问题打点上报]
This commit is contained in:
@@ -16,6 +16,7 @@ import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
|
||||
import com.mogo.eagle.core.utilcode.util.ActivityUtils
|
||||
import com.mogo.eagle.core.utilcode.util.KeyboardUtils
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
import com.mogo.och.biz.BuildConfig
|
||||
import com.mogo.och.biz.R
|
||||
import com.mogo.och.biz.login.callback.ILoginViewCallback
|
||||
import com.mogo.och.biz.login.presenter.LoginPresenter
|
||||
|
||||
@@ -27,9 +27,18 @@ class BusinessView : ConstraintLayout, BusinessViewModel.IErrorInfoViewCallback
|
||||
|
||||
constructor(context: Context, attributeSet: AttributeSet) : super(context, attributeSet)
|
||||
|
||||
constructor(context: Context, attributeSet: AttributeSet, defStyleAttr: Int) : super(context, attributeSet, defStyleAttr)
|
||||
constructor(context: Context, attributeSet: AttributeSet, defStyleAttr: Int) : super(
|
||||
context,
|
||||
attributeSet,
|
||||
defStyleAttr
|
||||
)
|
||||
|
||||
constructor(context: Context, attributeSet: AttributeSet, defStyleAttr: Int, defStyleRes: Int) : super(context, attributeSet, defStyleAttr, defStyleRes)
|
||||
constructor(
|
||||
context: Context,
|
||||
attributeSet: AttributeSet,
|
||||
defStyleAttr: Int,
|
||||
defStyleRes: Int
|
||||
) : super(context, attributeSet, defStyleAttr, defStyleRes)
|
||||
|
||||
private var viewModel: BusinessViewModel? = null
|
||||
private fun initView() {
|
||||
@@ -53,7 +62,7 @@ class BusinessView : ConstraintLayout, BusinessViewModel.IErrorInfoViewCallback
|
||||
actv_debugview.onClick { ToggleDebugView.toggleDebugView.toggle(context) }
|
||||
}
|
||||
|
||||
private fun swtichBusiness(businessEnum: BusinessEnum){
|
||||
private fun swtichBusiness(businessEnum: BusinessEnum) {
|
||||
LoginStatusManager.invokeLBusinessTypeChangeDebug(businessEnum)
|
||||
visibility = GONE
|
||||
}
|
||||
@@ -61,62 +70,38 @@ class BusinessView : ConstraintLayout, BusinessViewModel.IErrorInfoViewCallback
|
||||
|
||||
override fun onVisibilityAggregated(isVisible: Boolean) {
|
||||
super.onVisibilityAggregated(isVisible)
|
||||
if(isVisible){
|
||||
if (isVisible) {
|
||||
|
||||
}else{
|
||||
} else {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
fun selectBusniess(){
|
||||
if(FunctionBuildConfig.supportBusiness.size==1){
|
||||
FunctionBuildConfig.supportBusiness.forEach {
|
||||
when (it) {
|
||||
"shuttle" -> {
|
||||
swtichBusiness(BusinessEnum.Shuttle)
|
||||
}
|
||||
|
||||
"bus" -> {
|
||||
swtichBusiness(BusinessEnum.Bus)
|
||||
}
|
||||
|
||||
"taxi" -> {
|
||||
swtichBusiness(BusinessEnum.Taxi)
|
||||
}
|
||||
|
||||
"charter" -> {
|
||||
swtichBusiness(BusinessEnum.Charter)
|
||||
}
|
||||
|
||||
else -> {}
|
||||
fun selectBusniess() {
|
||||
visibility = VISIBLE
|
||||
actv_business_shuttle.visibility = GONE
|
||||
actv_business_bus.visibility = GONE
|
||||
actv_business_taxi.visibility = GONE
|
||||
actv_business_charter.visibility = GONE
|
||||
FunctionBuildConfig.supportBusiness.forEach {
|
||||
when (it) {
|
||||
"shuttle" -> {
|
||||
actv_business_shuttle.visibility = VISIBLE
|
||||
}
|
||||
}
|
||||
}else {
|
||||
visibility = VISIBLE
|
||||
actv_business_shuttle.visibility = GONE
|
||||
actv_business_bus.visibility = GONE
|
||||
actv_business_taxi.visibility = GONE
|
||||
actv_business_charter.visibility = GONE
|
||||
FunctionBuildConfig.supportBusiness.forEach {
|
||||
when (it) {
|
||||
"shuttle" -> {
|
||||
actv_business_shuttle.visibility = VISIBLE
|
||||
}
|
||||
|
||||
"bus" -> {
|
||||
actv_business_bus.visibility = VISIBLE
|
||||
}
|
||||
|
||||
"taxi" -> {
|
||||
actv_business_taxi.visibility = VISIBLE
|
||||
}
|
||||
|
||||
"charter" -> {
|
||||
actv_business_charter.visibility = VISIBLE
|
||||
}
|
||||
|
||||
else -> {}
|
||||
"bus" -> {
|
||||
actv_business_bus.visibility = VISIBLE
|
||||
}
|
||||
|
||||
"taxi" -> {
|
||||
actv_business_taxi.visibility = VISIBLE
|
||||
}
|
||||
|
||||
"charter" -> {
|
||||
actv_business_charter.visibility = VISIBLE
|
||||
}
|
||||
|
||||
else -> {}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
package com.mogo.och.common.module
|
||||
|
||||
/**
|
||||
* @author: wangmingjun
|
||||
* @date: 2022/4/26
|
||||
*/
|
||||
class OchCommonApi private constructor(){
|
||||
companion object{
|
||||
private var instance: OchCommonApi? = null
|
||||
get() {
|
||||
if (field == null){
|
||||
field = OchCommonApi();
|
||||
}
|
||||
return field
|
||||
}
|
||||
@Synchronized
|
||||
fun get():OchCommonApi{
|
||||
return instance!!
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
package com.mogo.och.common.module.wigets
|
||||
|
||||
import android.animation.ObjectAnimator
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import android.view.animation.LinearInterpolator
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import com.mogo.commons.module.status.MogoStatusManager
|
||||
import com.mogo.eagle.core.data.config.HdMapBuildConfig
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||
import com.mogo.map.listener.IMogoMapListener
|
||||
import com.mogo.map.listener.MogoMapListenerHandler
|
||||
import com.mogo.map.uicontroller.EnumMapUI
|
||||
import com.mogo.och.common.module.R
|
||||
import kotlinx.android.synthetic.main.common_loading_map.view.aciv_loading_map
|
||||
|
||||
class CommonLoadingView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
) : ConstraintLayout(context, attrs, defStyleAttr),IMogoMapListener {
|
||||
companion object {
|
||||
const val TAG = "LoadingMapStatusView"
|
||||
}
|
||||
|
||||
private var autopilotLoadingAnimator: ObjectAnimator? = null
|
||||
|
||||
init {
|
||||
LayoutInflater.from(context).inflate(R.layout.common_loading_map, this, true)
|
||||
}
|
||||
|
||||
override fun onAttachedToWindow() {
|
||||
super.onAttachedToWindow()
|
||||
CallerLogger.d(TAG,"onAttachedToWindow")
|
||||
visibility = VISIBLE
|
||||
MogoMapListenerHandler.mogoMapListenerHandler.registerHostMapListener(TAG,this)
|
||||
if (autopilotLoadingAnimator == null) {
|
||||
autopilotLoadingAnimator =
|
||||
ObjectAnimator.ofFloat(aciv_loading_map, "rotation", 0f, 360f)
|
||||
autopilotLoadingAnimator?.setInterpolator(LinearInterpolator())
|
||||
autopilotLoadingAnimator?.setRepeatCount(-1) //无限循环
|
||||
autopilotLoadingAnimator?.setDuration(1000) //设置持续时间
|
||||
}
|
||||
autopilotLoadingAnimator!!.start() //动画开始
|
||||
|
||||
setOnClickListener {
|
||||
CallerLogger.d(TAG,"点击")
|
||||
}
|
||||
}
|
||||
|
||||
override fun onMapLoaded() {
|
||||
MogoStatusManager.getInstance().setScreenCoverMode(TAG, true)
|
||||
HdMapBuildConfig.isMapLoaded = true
|
||||
// 设置地图样式
|
||||
MogoMapListenerHandler.mogoMapListenerHandler.onMapModeChanged(EnumMapUI.MAP_STYLE_DAY_VR)
|
||||
UiThreadHandler.postDelayed({ visibility = GONE },2_000,UiThreadHandler.MODE.QUEUE)
|
||||
}
|
||||
|
||||
override fun onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow()
|
||||
CallerLogger.d(TAG,"onDetachedFromWindow")
|
||||
MogoMapListenerHandler.mogoMapListenerHandler.unregisterHostMapListener(TAG)
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mogo.och.taxi.passenger.widget
|
||||
package com.mogo.och.common.module.wigets
|
||||
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 2.2 KiB |
22
OCH/common/common/src/main/res/layout/common_loading.xml
Normal file
22
OCH/common/common/src/main/res/layout/common_loading.xml
Normal file
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:gravity="center"
|
||||
android:layout_gravity="center">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/dialog_loading_view"
|
||||
android:layout_width="@dimen/dp_80"
|
||||
android:layout_height="@dimen/dp_80"
|
||||
android:src="@drawable/common_loading_nor" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/dialog_loading_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="请求中,请稍后..."
|
||||
android:textColor="#CCFFFFFF"
|
||||
android:layout_marginTop="@dimen/dp_10"/>
|
||||
</LinearLayout>
|
||||
@@ -56,6 +56,7 @@ dependencies {
|
||||
implementation rootProject.ext.dependencies.rxandroid
|
||||
implementation rootProject.ext.dependencies.androidxconstraintlayout
|
||||
implementation rootProject.ext.dependencies.amapnavi3dmap
|
||||
implementation rootProject.ext.dependencies.flexbox
|
||||
|
||||
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.5.1"
|
||||
|
||||
|
||||
@@ -51,7 +51,17 @@ data class StartGrayAndQueryContrailRsp(
|
||||
var contrail: ContrailBean?,
|
||||
var grayLineBean: GrayLineBean
|
||||
) : BaseData()
|
||||
data class PointError(var code:String,var name:String,var isCheck:Boolean = false)
|
||||
|
||||
data class QueryPointErrorReasonsRsp(var data: MutableList<PointError>?) : BaseData()
|
||||
data class SaveGrayContrailErrorReasons(
|
||||
var grayId: Long,
|
||||
var gcjLon: Double,
|
||||
var gcjLat: Double,
|
||||
var wgs84Lon: Double,
|
||||
var wgs84Lat: Double,
|
||||
var noteCodes: MutableList<String>,
|
||||
) //feedback 1:成功 2:失败
|
||||
enum class EndGrayTaskFeedbackType(var type: Int) {
|
||||
USABLE_YES(1),
|
||||
USABLE_NO(2)
|
||||
|
||||
@@ -5,7 +5,9 @@ import com.mogo.commons.storage.SharedPrefsMgr
|
||||
import com.mogo.eagle.core.data.BaseData
|
||||
import com.mogo.och.taxi.bean.EndGrayContrailTaskReq
|
||||
import com.mogo.och.taxi.bean.QueryGrayContrailListRsp
|
||||
import com.mogo.och.taxi.bean.QueryPointErrorReasonsRsp
|
||||
import com.mogo.och.taxi.bean.QueryRoutingContrailByIdRsp
|
||||
import com.mogo.och.taxi.bean.SaveGrayContrailErrorReasons
|
||||
import com.mogo.och.taxi.bean.StartGrayContrailTaskReq
|
||||
import com.mogo.och.taxi.bean.StartGrayContrailTaskRsp
|
||||
import com.mogo.och.taxi.bean.SubmitGrayLineIssueLocationReq
|
||||
@@ -73,4 +75,25 @@ interface TaxiRoutingServiceApi {
|
||||
@Header("ticket") ticket: String = SharedPrefsMgr.getInstance().token,
|
||||
@Body data: EndGrayContrailTaskReq
|
||||
): Observable<BaseData>
|
||||
|
||||
/**
|
||||
* 获取打点问题字典
|
||||
*/
|
||||
@Headers("Content-type:application/json;charset=UTF-8")
|
||||
@GET("/och-vehicle/api/dict/v1/dot/list")
|
||||
fun getDotErrorList(
|
||||
@Header("appId") appId: String = MoGoAiCloudClientConfig.getInstance().serviceAppId,
|
||||
@Header("ticket") ticket: String = SharedPrefsMgr.getInstance().token,
|
||||
): Observable<QueryPointErrorReasonsRsp>
|
||||
|
||||
/**
|
||||
* 结束一个路线的灰度任务
|
||||
*/
|
||||
@Headers("Content-type:application/json;charset=UTF-8")
|
||||
@POST("/och-taxi-cabin/api/business/v1/saveDotDetail")
|
||||
fun saveDotDetail(
|
||||
@Header("appId") appId: String = MoGoAiCloudClientConfig.getInstance().serviceAppId,
|
||||
@Header("ticket") ticket: String = SharedPrefsMgr.getInstance().token,
|
||||
@Body data: SaveGrayContrailErrorReasons
|
||||
): Observable<BaseData>
|
||||
}
|
||||
@@ -11,7 +11,9 @@ import com.mogo.och.common.module.network.interceptor.transformTry
|
||||
import com.mogo.och.taxi.bean.EndGrayContrailTaskReq
|
||||
import com.mogo.och.taxi.bean.GrayLineBean
|
||||
import com.mogo.och.taxi.bean.QueryGrayContrailListRsp
|
||||
import com.mogo.och.taxi.bean.QueryPointErrorReasonsRsp
|
||||
import com.mogo.och.taxi.bean.QueryRoutingContrailByIdRsp
|
||||
import com.mogo.och.taxi.bean.SaveGrayContrailErrorReasons
|
||||
import com.mogo.och.taxi.bean.StartGrayAndQueryContrailRsp
|
||||
import com.mogo.och.taxi.bean.StartGrayContrailTaskReq
|
||||
import com.mogo.och.taxi.bean.StartGrayContrailTaskRsp
|
||||
@@ -87,6 +89,22 @@ object TaxiRoutingServiceManager {
|
||||
.subscribe(OchCommonSubscribeImpl(context, callback, "endGrayTask"))
|
||||
}
|
||||
|
||||
fun getErrorPointReasons(
|
||||
context: Context,
|
||||
callback: OchCommonServiceCallback<QueryPointErrorReasonsRsp>
|
||||
) {
|
||||
mRoutingServiceApi.getDotErrorList().transformTry()
|
||||
.subscribe(OchCommonSubscribeImpl(context, callback, "dot/list"))
|
||||
}
|
||||
fun saveDotDetail(
|
||||
context: Context,
|
||||
data: SaveGrayContrailErrorReasons,
|
||||
callback: OchCommonServiceCallback<BaseData>
|
||||
) {
|
||||
mRoutingServiceApi.saveDotDetail(data = data).transformTry()
|
||||
.subscribe(OchCommonSubscribeImpl(context, callback, "dot/list"))
|
||||
}
|
||||
|
||||
fun startGrayTaskAndQueryRoutingContrail(
|
||||
context: Context,
|
||||
sn: String,
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
package com.mogo.och.taxi.ui.errorpoint
|
||||
|
||||
import android.content.Context
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.CheckBox
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.mogo.och.taxi.R
|
||||
import com.mogo.och.taxi.bean.PointError
|
||||
|
||||
/**
|
||||
* Created by yangyakun on 06/06/17.
|
||||
*/
|
||||
class ErrorPointItemAdapter(
|
||||
private val context: Context,
|
||||
private val dataList: MutableList<PointError>
|
||||
) : RecyclerView.Adapter<ErrorPointItemAdapter.TextVH>() {
|
||||
|
||||
fun setDataList(dataList: List<PointError>) {
|
||||
this.dataList.clear()
|
||||
this.dataList.addAll(dataList)
|
||||
notifyDataSetChanged()
|
||||
}
|
||||
|
||||
fun getCheckDataList():MutableList<PointError>{
|
||||
val mutableListOf = mutableListOf<PointError>()
|
||||
this.dataList.forEach {
|
||||
if(it.isCheck){
|
||||
mutableListOf.add(it)
|
||||
}
|
||||
}
|
||||
return mutableListOf
|
||||
}
|
||||
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): TextVH {
|
||||
val view: View
|
||||
val inflater = LayoutInflater.from(context)
|
||||
view = inflater.inflate(R.layout.taxt_report_error_point_item, parent, false)
|
||||
return TextVH(view)
|
||||
}
|
||||
|
||||
override fun onBindViewHolder(holder: TextVH, position: Int) {
|
||||
val errorInfo = dataList[holder.bindingAdapterPosition]
|
||||
holder.cbErrorInfo.text = errorInfo.name
|
||||
holder.cbErrorInfo.isChecked = errorInfo.isCheck
|
||||
holder.cbErrorInfo.setOnCheckedChangeListener { buttonView, isChecked ->
|
||||
if(buttonView==holder.cbErrorInfo){
|
||||
errorInfo.isCheck = isChecked
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun getItemCount(): Int {
|
||||
return dataList.size
|
||||
}
|
||||
|
||||
inner class TextVH(itemView: View) : RecyclerView.ViewHolder(itemView) {
|
||||
var cbErrorInfo: CheckBox
|
||||
init {
|
||||
cbErrorInfo = itemView.findViewById(R.id.cb_error_info)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package com.mogo.och.taxi.ui.errorpoint
|
||||
|
||||
import android.content.Context
|
||||
import android.widget.ImageView
|
||||
import android.widget.TextView
|
||||
import androidx.lifecycle.LifecycleObserver
|
||||
import com.mogo.eagle.core.function.hmi.dialog.BaseFloatDialog
|
||||
import com.mogo.och.taxi.R
|
||||
import kotlinx.android.synthetic.main.dialog_taxt_report_error.repvErrorPointReason
|
||||
|
||||
class ReportErrorPointDialog(context: Context,grayId: Long?) : BaseFloatDialog(context), LifecycleObserver {
|
||||
|
||||
init {
|
||||
setContentView(R.layout.dialog_taxt_report_error)
|
||||
setCanceledOnTouchOutside(true)
|
||||
repvErrorPointReason.setGrayId(grayId)
|
||||
repvErrorPointReason.setDismiss(object :ReportErrorPointView.CloseCallback{
|
||||
override fun close() {
|
||||
dismiss()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
fun showDialog() {
|
||||
if (isShowing) {
|
||||
return
|
||||
}
|
||||
show()
|
||||
}
|
||||
|
||||
fun hideDialog() {
|
||||
if (isShowing) {
|
||||
dismiss()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,160 @@
|
||||
package com.mogo.och.taxi.ui.errorpoint
|
||||
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import androidx.lifecycle.ViewModelProvider
|
||||
import androidx.lifecycle.findViewTreeViewModelStoreOwner
|
||||
import com.google.android.flexbox.AlignItems
|
||||
import com.google.android.flexbox.FlexDirection
|
||||
import com.google.android.flexbox.FlexWrap
|
||||
import com.google.android.flexbox.FlexboxLayoutManager
|
||||
import com.mogo.eagle.core.utilcode.kotlin.onClick
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.d
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
|
||||
import com.mogo.eagle.core.utilcode.util.TimeUtils
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
import com.mogo.och.common.module.wigets.WindowRelativeLayout
|
||||
import com.mogo.och.taxi.R
|
||||
import com.mogo.och.taxi.bean.PointError
|
||||
import com.mogo.och.taxi.ui.routing.TaxiRoutingLoadingDialog
|
||||
import kotlinx.android.synthetic.main.taxt_report_error_point_panel.view.rvErrorPointReason
|
||||
import kotlinx.android.synthetic.main.taxt_report_error_point_panel.view.tv_report_error_point_reason
|
||||
import kotlinx.android.synthetic.main.taxt_report_error_point_panel.view.tv_report_error_point_reason_cancel
|
||||
import kotlinx.android.synthetic.main.taxt_report_error_point_panel.view.tv_work_order_time
|
||||
|
||||
/**
|
||||
*
|
||||
* 评价View
|
||||
* Created on 2022/5/16
|
||||
*/
|
||||
class ReportErrorPointView : WindowRelativeLayout,
|
||||
ReportErrorPointViewModel.ReportErrorPointViewCallback {
|
||||
|
||||
constructor(context: Context) : super(context)
|
||||
|
||||
constructor(context: Context, attributeSet: AttributeSet) : super(context, attributeSet)
|
||||
|
||||
constructor(context: Context, attributeSet: AttributeSet, defStyleAttr: Int) : super(
|
||||
context,
|
||||
attributeSet,
|
||||
defStyleAttr
|
||||
)
|
||||
|
||||
constructor(
|
||||
context: Context,
|
||||
attributeSet: AttributeSet,
|
||||
defStyleAttr: Int,
|
||||
defStyleRes: Int
|
||||
) : super(context, attributeSet, defStyleAttr, defStyleRes)
|
||||
|
||||
|
||||
private var viewModel: ReportErrorPointViewModel? = null
|
||||
|
||||
private lateinit var errorPointItemAdapter: ErrorPointItemAdapter
|
||||
|
||||
private var closeCallback: CloseCallback? = null
|
||||
|
||||
private var grayId: Long?=-1L
|
||||
|
||||
private val mLoadingDialog: TaxiRoutingLoadingDialog by lazy {
|
||||
TaxiRoutingLoadingDialog(
|
||||
context
|
||||
)
|
||||
}
|
||||
|
||||
private fun initView() {
|
||||
d(SceneConstant.M_TAXI_P + TAG, "initView")
|
||||
LayoutInflater.from(context).inflate(R.layout.taxt_report_error_point_panel, this, true)
|
||||
|
||||
val flexboxLayoutManager = FlexboxLayoutManager(context)
|
||||
flexboxLayoutManager.flexDirection = FlexDirection.ROW;
|
||||
flexboxLayoutManager.alignItems = AlignItems.CENTER
|
||||
flexboxLayoutManager.flexWrap = FlexWrap.WRAP
|
||||
|
||||
rvErrorPointReason?.layoutManager = flexboxLayoutManager
|
||||
rvErrorPointReason?.setHasFixedSize(true)
|
||||
errorPointItemAdapter = ErrorPointItemAdapter(
|
||||
context, mutableListOf(
|
||||
|
||||
)
|
||||
)
|
||||
rvErrorPointReason?.adapter = errorPointItemAdapter
|
||||
|
||||
tv_report_error_point_reason_cancel.onClick {
|
||||
this.closeCallback?.close()
|
||||
}
|
||||
tv_report_error_point_reason.onClick {
|
||||
val checkDataList = errorPointItemAdapter.getCheckDataList()
|
||||
if(checkDataList.isEmpty()){
|
||||
ToastUtils.showShort("请选择问题类型")
|
||||
return@onClick
|
||||
}
|
||||
mLoadingDialog.showLoading()
|
||||
this.viewModel?.submitErrorPointReasons(checkDataList)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onVisibilityAggregated(isVisible: Boolean) {
|
||||
super.onVisibilityAggregated(isVisible)
|
||||
d(SceneConstant.M_TAXI_P + TAG, "展示---:${isVisible}")
|
||||
if (isVisible) {
|
||||
tv_work_order_time.text = "时间:${TimeUtils.millis2String(System.currentTimeMillis(), TimeUtils.getHourMinSecondFormat())}"
|
||||
viewModel?.getPointErrorReasons()
|
||||
mLoadingDialog.showLoading()
|
||||
} else {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
override fun onAttachedToWindow() {
|
||||
super.onAttachedToWindow()
|
||||
viewModel = ViewModelProvider(this).get(ReportErrorPointViewModel::class.java)
|
||||
viewModel?.setViewCallback(this)
|
||||
viewModel?.setGrayId(grayId)
|
||||
}
|
||||
|
||||
companion object {
|
||||
const val TAG = "TaxiPassengerArrivedView"
|
||||
}
|
||||
|
||||
init {
|
||||
try {
|
||||
initView()
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
}
|
||||
|
||||
override fun addViewData(it: MutableList<PointError>) {
|
||||
mLoadingDialog.hideLoading()
|
||||
errorPointItemAdapter.setDataList(it)
|
||||
}
|
||||
|
||||
override fun hideLoadingWithMessage(msg: String?) {
|
||||
msg?.let {
|
||||
ToastUtils.showLong(msg)
|
||||
}
|
||||
mLoadingDialog.hideLoading()
|
||||
}
|
||||
|
||||
override fun submitErrorReasons() {
|
||||
mLoadingDialog.hideLoading()
|
||||
this.closeCallback?.close()
|
||||
}
|
||||
|
||||
fun setDismiss(listener: CloseCallback) {
|
||||
this.closeCallback = listener
|
||||
}
|
||||
|
||||
fun setGrayId(grayId: Long?) {
|
||||
this.grayId = grayId
|
||||
}
|
||||
|
||||
interface CloseCallback {
|
||||
fun close()
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,120 @@
|
||||
package com.mogo.och.taxi.ui.errorpoint
|
||||
|
||||
import androidx.lifecycle.ViewModel
|
||||
import com.mogo.commons.AbsMogoApplication
|
||||
import com.mogo.eagle.core.data.BaseData
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02ListenerManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
import com.mogo.och.common.module.network.OchCommonServiceCallback
|
||||
import com.mogo.och.taxi.bean.PointError
|
||||
import com.mogo.och.taxi.bean.QueryPointErrorReasonsRsp
|
||||
import com.mogo.och.taxi.bean.SaveGrayContrailErrorReasons
|
||||
import com.mogo.och.taxi.network.TaxiRoutingServiceManager
|
||||
import com.mogo.och.taxi.ui.routing.TaxiRoutingModel
|
||||
|
||||
class ReportErrorPointViewModel : ViewModel() {
|
||||
|
||||
private val TAG = ReportErrorPointViewModel::class.java.simpleName
|
||||
|
||||
private var viewCallback: ReportErrorPointViewCallback? = null
|
||||
|
||||
private var grayId: Long?=-1L
|
||||
|
||||
init {
|
||||
|
||||
}
|
||||
|
||||
fun setViewCallback(viewCallback: ReportErrorPointViewCallback) {
|
||||
this.viewCallback = viewCallback
|
||||
|
||||
}
|
||||
|
||||
fun getPointErrorReasons(){
|
||||
TaxiRoutingServiceManager.getErrorPointReasons(
|
||||
AbsMogoApplication.getApp(),
|
||||
object : OchCommonServiceCallback<QueryPointErrorReasonsRsp> {
|
||||
override fun onSuccess(data: QueryPointErrorReasonsRsp?) {
|
||||
data?.data?.let {
|
||||
viewCallback?.addViewData(it)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onFail(code: Int, msg: String?) {
|
||||
viewCallback?.hideLoadingWithMessage(msg)
|
||||
}
|
||||
|
||||
override fun onError() {
|
||||
super.onError()
|
||||
viewCallback?.hideLoadingWithMessage("网络错误、请稍后再试")
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
override fun onCleared() {
|
||||
super.onCleared()
|
||||
this.viewCallback = null
|
||||
}
|
||||
|
||||
fun submitErrorPointReasons(checkDataList: MutableList<PointError>) {
|
||||
CallerLogger.d(TAG,checkDataList,grayId)
|
||||
if (grayId == null || grayId!! < 0L) {
|
||||
viewCallback?.hideLoadingWithMessage("未找到规划Id")
|
||||
return
|
||||
}
|
||||
grayId?.let {
|
||||
val gcj02 = CallerChassisLocationGCJ02ListenerManager.getChassisLocationGCJ02()
|
||||
val wgs84 = CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84()
|
||||
val errorReasonCodes = mutableListOf<String>()
|
||||
checkDataList.forEach {pointError->
|
||||
errorReasonCodes.add(pointError.code)
|
||||
}
|
||||
val saveGrayContrailErrorReasons = SaveGrayContrailErrorReasons(
|
||||
it,
|
||||
gcj02.longitude,
|
||||
gcj02.latitude,
|
||||
wgs84.longitude,
|
||||
wgs84.latitude,
|
||||
errorReasonCodes
|
||||
)
|
||||
TaxiRoutingServiceManager.saveDotDetail(
|
||||
AbsMogoApplication.getApp(),
|
||||
saveGrayContrailErrorReasons,
|
||||
object : OchCommonServiceCallback<BaseData> {
|
||||
override fun onSuccess(data: BaseData?) {
|
||||
if (data != null && data.code == 0){
|
||||
ToastUtils.showShort("提交成功")
|
||||
viewCallback?.submitErrorReasons()
|
||||
}
|
||||
}
|
||||
|
||||
override fun onFail(code: Int, msg: String?) {
|
||||
viewCallback?.hideLoadingWithMessage(msg)
|
||||
}
|
||||
|
||||
override fun onError() {
|
||||
super.onError()
|
||||
viewCallback?.hideLoadingWithMessage("网络错误、请稍后再试")
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
fun setGrayId(grayId: Long?) {
|
||||
this.grayId = grayId
|
||||
}
|
||||
|
||||
|
||||
interface ReportErrorPointViewCallback {
|
||||
fun addViewData(it: MutableList<PointError>)
|
||||
fun hideLoadingWithMessage(msg: String?)
|
||||
|
||||
fun submitErrorReasons()
|
||||
|
||||
}
|
||||
}
|
||||
@@ -10,6 +10,7 @@ import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02Lis
|
||||
import com.mogo.eagle.core.function.main.MainMoGoApplication
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
|
||||
import com.mogo.eagle.core.utilcode.util.ActivityUtils
|
||||
import com.mogo.eagle.core.utilcode.util.ThreadUtils
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||
import com.mogo.och.common.module.map.AmapNaviToDestinationModel
|
||||
@@ -19,6 +20,7 @@ import com.mogo.och.taxi.R
|
||||
import com.mogo.och.taxi.bean.EndGrayTaskFeedbackType
|
||||
import com.mogo.och.taxi.constant.TaxiDriverEventConst
|
||||
import com.mogo.och.taxi.constant.TaxiUnmannedConst
|
||||
import com.mogo.och.taxi.ui.errorpoint.ReportErrorPointDialog
|
||||
import com.mogo.och.taxi.utils.MapMakerManager
|
||||
import com.mogo.och.taxi.utils.TaskUtils
|
||||
import kotlinx.android.synthetic.main.routing_fragment.btnChooseTask
|
||||
@@ -195,11 +197,16 @@ class TaxiRoutingFragment : BaseFragment(), ICommonNaviChangedCallback {
|
||||
)
|
||||
}
|
||||
btnSummitIssue.setOnClickListener {
|
||||
mViewModel.sendUiIntent(
|
||||
TaxiRoutingUiIntent.SubmitGrayLineIssueLocation(
|
||||
routingTask.grayId ?: -1L
|
||||
)
|
||||
)
|
||||
// mViewModel.sendUiIntent(
|
||||
// TaxiRoutingUiIntent.SubmitGrayLineIssueLocation(
|
||||
// routingTask.grayId ?: -1L
|
||||
// )
|
||||
// )
|
||||
//ErrorPointFloatWindow(ActivityUtils.getTopActivity()).showFloatWindow()
|
||||
context?.let {
|
||||
ReportErrorPointDialog(it,routingTask.grayId ?: -1L).showDialog()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
naviToStart.visibility = View.INVISIBLE
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 110 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 94 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 19 KiB |
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item
|
||||
android:drawable="@drawable/taxi_error_point_reason_unselect"
|
||||
android:state_checked="false"/>
|
||||
|
||||
<item
|
||||
android:drawable="@drawable/taxi_error_point_reason_select"
|
||||
android:state_checked="true"/>
|
||||
|
||||
</selector>
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<solid android:color="#0056FF"/>
|
||||
<corners android:radius="@dimen/dp_8"/>
|
||||
</shape>
|
||||
@@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle"
|
||||
android:useLevel="false"
|
||||
>
|
||||
|
||||
<!--内部填充-->
|
||||
<solid android:color="#1AA7B6F0" />
|
||||
|
||||
<stroke
|
||||
android:width="@dimen/dp_1"
|
||||
android:color="#A7B6F0"
|
||||
/>
|
||||
|
||||
<corners android:radius="@dimen/dp_8"/>
|
||||
|
||||
</shape>
|
||||
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<gradient
|
||||
android:startColor="#029DFF"
|
||||
android:endColor="#0056FF"
|
||||
android:angle="0"
|
||||
/>
|
||||
<corners android:radius="8dp" />
|
||||
</shape>
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<com.mogo.och.taxi.ui.errorpoint.ReportErrorPointView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/repvErrorPointReason"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
</com.mogo.och.taxi.ui.errorpoint.ReportErrorPointView>
|
||||
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
<CheckBox
|
||||
android:id="@+id/cb_error_info"
|
||||
android:button="@null"
|
||||
android:text="原因"
|
||||
android:layout_margin="@dimen/dp_10"
|
||||
android:paddingStart="@dimen/dp_40"
|
||||
android:paddingEnd="@dimen/dp_40"
|
||||
android:paddingTop="@dimen/dp_14"
|
||||
android:paddingBottom="@dimen/dp_14"
|
||||
android:textColor="@color/white"
|
||||
android:background="@drawable/taxi_error_point_reason_bg"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
</FrameLayout>
|
||||
@@ -0,0 +1,105 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="@dimen/dp_844"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/taxi_error_point_report_bg">
|
||||
|
||||
<View
|
||||
android:id="@+id/view_title_bg"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_102"
|
||||
android:background="@drawable/taxi_error_point_head_bg"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_report_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_33"
|
||||
android:text="问题上报"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_34"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintBottom_toBottomOf="@id/view_title_bg"
|
||||
app:layout_constraintStart_toStartOf="@id/view_title_bg"
|
||||
app:layout_constraintTop_toTopOf="@+id/view_title_bg" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_work_order_time"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="@dimen/dp_31"
|
||||
android:text="时间"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_30"
|
||||
app:layout_constraintBottom_toBottomOf="@id/view_title_bg"
|
||||
app:layout_constraintEnd_toEndOf="@id/view_title_bg"
|
||||
app:layout_constraintTop_toTopOf="@id/view_title_bg" />
|
||||
|
||||
<View
|
||||
android:id="@+id/view_type_label"
|
||||
android:layout_width="@dimen/dp_6"
|
||||
android:layout_height="@dimen/dp_29"
|
||||
android:layout_marginStart="@dimen/dp_33"
|
||||
android:layout_marginTop="@dimen/dp_40"
|
||||
android:background="#FF0176FF"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/view_title_bg" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_type_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_13"
|
||||
android:text="问题类型"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_32"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintBottom_toBottomOf="@id/view_type_label"
|
||||
app:layout_constraintLeft_toRightOf="@id/view_type_label"
|
||||
app:layout_constraintTop_toTopOf="@id/view_type_label" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rvErrorPointReason"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_23"
|
||||
android:layout_marginTop="@dimen/dp_6"
|
||||
android:layout_marginEnd="@dimen/dp_23"
|
||||
app:layout_constraintHeight_min="@dimen/dp_140"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_type_title" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_report_error_point_reason"
|
||||
android:layout_width="@dimen/dp_370"
|
||||
android:layout_height="@dimen/dp_80"
|
||||
android:layout_marginTop="@dimen/dp_30"
|
||||
android:layout_marginBottom="@dimen/dp_40"
|
||||
android:background="@drawable/taxi_error_point_report_submit_bg"
|
||||
android:gravity="center"
|
||||
android:text="上报"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="@dimen/sp_27"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toLeftOf="@id/tv_report_error_point_reason_cancel"
|
||||
app:layout_constraintTop_toBottomOf="@+id/rvErrorPointReason" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_report_error_point_reason_cancel"
|
||||
android:layout_width="@dimen/dp_370"
|
||||
android:layout_height="@dimen/dp_80"
|
||||
android:layout_marginBottom="@dimen/dp_40"
|
||||
android:background="@drawable/taxi_error_point_report_cancle_bg"
|
||||
android:gravity="center"
|
||||
android:text="取消"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="@dimen/sp_27"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toRightOf="@id/tv_report_error_point_reason"
|
||||
app:layout_constraintRight_toRightOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="@dimen/dp_844"
|
||||
android:layout_height="@dimen/dp_808">
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_102"
|
||||
android:background="@drawable/icon_work_order_title"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
/>
|
||||
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -18,7 +18,7 @@ import com.mogo.och.common.module.utils.BigFrameAnimatorContainer
|
||||
import com.mogo.och.common.module.utils.RxUtils
|
||||
import com.mogo.och.taxi.passenger.R
|
||||
import com.mogo.och.taxi.passenger.ui.TaxiPassengerBaseFragment
|
||||
import com.mogo.och.taxi.passenger.widget.WindowRelativeLayout
|
||||
import com.mogo.och.common.module.wigets.WindowRelativeLayout
|
||||
import io.reactivex.disposables.Disposable
|
||||
import kotlinx.android.synthetic.main.taxt_u_p_arrived_end_panel.view.aciv_bg
|
||||
import kotlinx.android.synthetic.main.taxt_u_p_arrived_end_panel.view.aciv_close
|
||||
|
||||
@@ -21,7 +21,7 @@ import com.mogo.och.common.module.manager.xiaozhi.ZhiViewmanager
|
||||
import com.mogo.och.common.module.utils.BigFrameAnimatorContainer
|
||||
import com.mogo.och.taxi.passenger.R
|
||||
import com.mogo.och.taxi.passenger.model.TaxiPassengerModel
|
||||
import com.mogo.och.taxi.passenger.widget.WindowRelativeLayout
|
||||
import com.mogo.och.common.module.wigets.WindowRelativeLayout
|
||||
import kotlinx.android.synthetic.main.taxt_u_p_check_startautopilot.view.aciv_check_autopilot
|
||||
import kotlinx.android.synthetic.main.taxt_u_p_check_startautopilot.view.aciv_start_autopilt_success_ani
|
||||
import kotlinx.android.synthetic.main.taxt_u_p_check_startautopilot.view.aciv_start_autopilt_success_bg
|
||||
|
||||
@@ -13,7 +13,7 @@ import com.mogo.och.common.module.manager.device.data.DoorPosition
|
||||
import com.mogo.och.common.module.manager.device.data.DoorState
|
||||
import com.mogo.och.common.module.utils.FrameAnimatorContainer
|
||||
import com.mogo.och.taxi.passenger.R
|
||||
import com.mogo.och.taxi.passenger.widget.WindowRelativeLayout
|
||||
import com.mogo.och.common.module.wigets.WindowRelativeLayout
|
||||
import kotlinx.android.synthetic.main.taxt_u_p_start_autopilot_view.view.aciv_middle_car
|
||||
import kotlinx.android.synthetic.main.taxt_u_p_start_autopilot_view.view.actv_front_left_door
|
||||
import kotlinx.android.synthetic.main.taxt_u_p_start_autopilot_view.view.actv_front_right_door
|
||||
|
||||
Reference in New Issue
Block a user