[6.2.0] 运营信息统计opt
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
package com.mogo.och.taxi.bean
|
||||
|
||||
import com.mogo.eagle.core.data.BaseData
|
||||
|
||||
/**
|
||||
* @author: wangmingjun
|
||||
* @date: 2023/11/3
|
||||
*/
|
||||
|
||||
data class QueryTaskRespBean(var data: Result?) : BaseData(){
|
||||
class Result(var startSiteName: String,
|
||||
var endSiteName: String,
|
||||
var startTime: Long,
|
||||
var taskType: Int)
|
||||
}
|
||||
|
||||
data class QueryOrdersRespBean(var data: Result?) : BaseData(){
|
||||
class Result(var orderNo: String,
|
||||
var payAmount:String,
|
||||
var status: Int, //70已取消 60已完成 51待支付 40服务中
|
||||
var createTime: Long
|
||||
)
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
package com.mogo.och.taxi.callback;
|
||||
|
||||
/**
|
||||
* Created on 2021/9/8
|
||||
*
|
||||
* Model->Presenter回调:接单车状态变更 登录状态变更
|
||||
*/
|
||||
public interface ITaxiCarOperationalCallback {
|
||||
|
||||
void onServiceDataUpdate(long dailyTimeDuration, long dailyOrderNum);
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
package com.mogo.och.taxi.network
|
||||
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
|
||||
import com.mogo.eagle.core.data.BaseData
|
||||
import com.mogo.och.taxi.bean.QueryTaskRespBean
|
||||
import com.mogo.och.taxi.bean.QueryOrdersRespBean
|
||||
import io.reactivex.Observable
|
||||
import retrofit2.http.GET
|
||||
import retrofit2.http.Header
|
||||
import retrofit2.http.Headers
|
||||
import retrofit2.http.Query
|
||||
|
||||
/**
|
||||
* @author: wangmingjun
|
||||
* @date: 2023/7/26
|
||||
*/
|
||||
interface TaxiPersonalDataServiceApi {
|
||||
|
||||
/**
|
||||
* 车辆演练任务列表
|
||||
*/
|
||||
@Headers("Content-type:application/json;charset=UTF-8")
|
||||
@GET("/och-taxi-cabin/api/business/v1/queryCurrentScheduledTaskList")
|
||||
fun queryCurrentScheduledTaskList(
|
||||
@Header("appId") appId: String = MoGoAiCloudClientConfig.getInstance().serviceAppId,
|
||||
@Header("ticket") ticket: String = MoGoAiCloudClientConfig.getInstance().token,
|
||||
@Query("sn") sn: String?
|
||||
): Observable<QueryTaskRespBean>
|
||||
|
||||
/**
|
||||
* 查询车辆服务时长
|
||||
*/
|
||||
@Headers("Content-type:application/json;charset=UTF-8")
|
||||
@GET("/och-taxi-cabin/api/business/v1/queryServingDuration")
|
||||
fun queryServingDuration(@Header("appId") appId: String = MoGoAiCloudClientConfig.getInstance().serviceAppId,
|
||||
@Header("ticket") ticket: String = MoGoAiCloudClientConfig.getInstance().token,
|
||||
@Query("sn") sn: String?
|
||||
):Observable<BaseData>
|
||||
|
||||
/**
|
||||
* 根据订单查询任务列表
|
||||
*/
|
||||
@Headers("Content-type:application/json;charset=UTF-8")
|
||||
@GET("/och-taxi-cabin/api/business/v1/queryTaskListByOrder")
|
||||
fun queryTaskListByOrder(
|
||||
@Header("appId") appId: String = MoGoAiCloudClientConfig.getInstance().serviceAppId,
|
||||
@Header("ticket") ticket: String = MoGoAiCloudClientConfig.getInstance().token,
|
||||
@Query("orderNo")orderNo: Long?
|
||||
): Observable<QueryTaskRespBean>
|
||||
|
||||
/**
|
||||
* 查询车辆当天已完成订单
|
||||
*/
|
||||
@Headers("Content-type:application/json;charset=UTF-8")
|
||||
@GET("/och-taxi-cabin/api/business/v1/queryCurrentCompleteOrder")
|
||||
fun queryCurrentCompleteOrder(
|
||||
@Header("appId") appId: String = MoGoAiCloudClientConfig.getInstance().serviceAppId,
|
||||
@Header("ticket") ticket: String = MoGoAiCloudClientConfig.getInstance().token,
|
||||
@Query("sn") sn: String?
|
||||
): Observable<QueryOrdersRespBean>
|
||||
|
||||
/**
|
||||
* 查询车辆当天所有订单
|
||||
*/
|
||||
@Headers("Content-type:application/json;charset=UTF-8")
|
||||
@GET("/och-taxi-cabin/api/business/v1/queryCurrentDayOrder")
|
||||
fun queryCurrentDayOrder(
|
||||
@Header("appId") appId: String = MoGoAiCloudClientConfig.getInstance().serviceAppId,
|
||||
@Header("ticket") ticket: String = MoGoAiCloudClientConfig.getInstance().token,
|
||||
@Query("sn") sn: String?
|
||||
): Observable<QueryOrdersRespBean>
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
package com.mogo.och.taxi.network
|
||||
|
||||
import android.content.Context
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
|
||||
import com.mogo.eagle.core.data.BaseData
|
||||
import com.mogo.eagle.core.network.MoGoRetrofitFactory
|
||||
import com.mogo.och.common.module.biz.constant.OchCommonConst
|
||||
import com.mogo.och.common.module.biz.network.OchCommonServiceCallback
|
||||
import com.mogo.och.common.module.biz.network.OchCommonSubscribeImpl
|
||||
import com.mogo.och.common.module.biz.network.interceptor.transformTry
|
||||
import com.mogo.och.taxi.bean.QueryOrdersRespBean
|
||||
import com.mogo.och.taxi.bean.QueryTaskRespBean
|
||||
|
||||
/**
|
||||
* Created by pangfan on 2021/8/19
|
||||
*/
|
||||
object TaxiPersonalDataServiceManager {
|
||||
|
||||
private var mOCHTaxiPersonalDataServiceApi: TaxiPersonalDataServiceApi =
|
||||
MoGoRetrofitFactory.getInstance(OchCommonConst.getBaseUrl()).create(
|
||||
TaxiPersonalDataServiceApi::class.java
|
||||
)
|
||||
|
||||
/**
|
||||
* 查询车辆演练任务
|
||||
*/
|
||||
@JvmStatic
|
||||
fun queryCurrentScheduledTaskList(context: Context,
|
||||
callback: OchCommonServiceCallback<QueryTaskRespBean>?
|
||||
) {
|
||||
mOCHTaxiPersonalDataServiceApi.queryCurrentScheduledTaskList(
|
||||
sn = MoGoAiCloudClientConfig.getInstance().sn
|
||||
)
|
||||
.transformTry()
|
||||
.subscribe(OchCommonSubscribeImpl(context, callback, "queryCurrentScheduledTaskList"))
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询车辆服务时长
|
||||
*/
|
||||
@JvmStatic
|
||||
fun queryServingDuration(context: Context, callback: OchCommonServiceCallback<BaseData>?) {
|
||||
mOCHTaxiPersonalDataServiceApi.queryServingDuration(
|
||||
sn = MoGoAiCloudClientConfig.getInstance().sn
|
||||
)
|
||||
.transformTry()
|
||||
.subscribe(OchCommonSubscribeImpl(context, callback, "queryServingDuration"))
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据订单查询任务列表
|
||||
*/
|
||||
@JvmStatic
|
||||
fun queryTaskListByOrder(
|
||||
context: Context,orderNo: Long,
|
||||
callback: OchCommonServiceCallback<QueryTaskRespBean>?
|
||||
) {
|
||||
mOCHTaxiPersonalDataServiceApi.queryTaskListByOrder(
|
||||
orderNo = orderNo
|
||||
)
|
||||
.transformTry()
|
||||
.subscribe(OchCommonSubscribeImpl(context, callback, "queryTaskListByOrder"))
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询车辆当天已完成订单
|
||||
*/
|
||||
@JvmStatic
|
||||
fun queryCurrentCompleteOrder(
|
||||
context: Context,
|
||||
callback: OchCommonServiceCallback<QueryOrdersRespBean>?
|
||||
) {
|
||||
mOCHTaxiPersonalDataServiceApi.queryCurrentCompleteOrder(
|
||||
sn = MoGoAiCloudClientConfig.getInstance().sn
|
||||
)
|
||||
.transformTry()
|
||||
.subscribe(OchCommonSubscribeImpl(context, callback, "queryCurrentCompleteOrder"))
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询车辆当天所有订单
|
||||
*/
|
||||
@JvmStatic
|
||||
fun queryCurrentDayOrder(
|
||||
context: Context,
|
||||
callback: OchCommonServiceCallback<QueryOrdersRespBean>?
|
||||
) {
|
||||
mOCHTaxiPersonalDataServiceApi.queryCurrentDayOrder(
|
||||
sn = MoGoAiCloudClientConfig.getInstance().sn
|
||||
)
|
||||
.transformTry()
|
||||
.subscribe(OchCommonSubscribeImpl(context, callback, "queryCurrentDayOrder"))
|
||||
}
|
||||
}
|
||||
@@ -1,45 +0,0 @@
|
||||
package com.mogo.och.taxi.presenter;
|
||||
|
||||
import android.os.Looper;
|
||||
|
||||
import com.mogo.commons.mvp.Presenter;
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
|
||||
import com.mogo.och.taxi.callback.ITaxiCarOperationalCallback;
|
||||
import com.mogo.och.taxi.ui.personal.TaxiPersonalDialogFragment;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.lifecycle.LifecycleOwner;
|
||||
|
||||
public class TaxiOperationalPresenter extends Presenter<TaxiPersonalDialogFragment>
|
||||
implements ITaxiCarOperationalCallback {
|
||||
public TaxiOperationalPresenter(TaxiPersonalDialogFragment view) {
|
||||
super(view);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy(@NonNull LifecycleOwner owner) {
|
||||
super.onDestroy(owner);
|
||||
}
|
||||
|
||||
// 获取全部订单列表
|
||||
// public void queryOrdersList(int page, int size) {
|
||||
// TaxiModel.INSTANCE.queryOrdersList(page, size);
|
||||
// }
|
||||
|
||||
@Override
|
||||
public void onServiceDataUpdate(long dailyTimeDuration, long dailyOrderNum) {
|
||||
runOnUIThread(() -> mView.onServiceDataUpdate(dailyTimeDuration,dailyOrderNum));
|
||||
}
|
||||
|
||||
private void runOnUIThread( Runnable executor ) {
|
||||
if ( executor == null ) {
|
||||
return;
|
||||
}
|
||||
if ( Looper.myLooper() != Looper.getMainLooper() ) {
|
||||
UiThreadHandler.post( executor );
|
||||
} else {
|
||||
executor.run();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -57,21 +57,21 @@ class TaxiFragment : BaseTaxiTabFragment<TaxiFragment, TaxiPresenter>(),
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
fun openOperationalInfoView(eventLogout: EventLogout) {
|
||||
// V6.0.0 临时注释,后台目前没有提供相应接口和数据来展示
|
||||
// if (eventLogout.messgae == EventLogout.PERSONAL_TYPE) {
|
||||
// V6.2.0 增加订单统计功能
|
||||
if (eventLogout.messgae == EventLogout.PERSONAL_TYPE) {
|
||||
// 个人信息, 运营数据在无人化阶段暂时不展示
|
||||
// d(SceneConstant.M_TAXI + TAG, "openOperationalInfoView Event个人中心")
|
||||
// openOperationalInfoView()
|
||||
// }
|
||||
d(SceneConstant.M_TAXI + TAG, "openOperationalInfoView Event个人中心")
|
||||
openOperationalInfoView()
|
||||
}
|
||||
}
|
||||
|
||||
// private fun openOperationalInfoView() {
|
||||
// personalDialogFragment = WeakReference(TaxiPersonalDialogFragment())
|
||||
// activity?.supportFragmentManager?.let {
|
||||
// personalDialogFragment!!.get()
|
||||
// ?.show(it, "service_data")
|
||||
// }
|
||||
// }
|
||||
private fun openOperationalInfoView() {
|
||||
personalDialogFragment = WeakReference(TaxiPersonalDialogFragment())
|
||||
activity?.supportFragmentManager?.let {
|
||||
personalDialogFragment!!.get()
|
||||
?.show(it, "service_data")
|
||||
}
|
||||
}
|
||||
|
||||
override fun getTagName(): String {
|
||||
return "TaxiFragment"
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.mogo.och.taxi.ui.personal
|
||||
|
||||
import com.mogo.eagle.core.data.BaseData
|
||||
import com.mogo.och.taxi.base.IUiState
|
||||
import com.mogo.och.taxi.bean.QueryOrdersRespBean
|
||||
import com.mogo.och.taxi.bean.QueryTaskRespBean
|
||||
|
||||
/**
|
||||
* @author: wangmingjun
|
||||
* @date: 2023/11/2
|
||||
*/
|
||||
data class PersonalDataUIState(val personalDataUIState: PersonalDataStateUIState) : IUiState
|
||||
sealed class PersonalDataStateUIState{
|
||||
object Init : PersonalDataStateUIState()
|
||||
|
||||
data class ScheduledTaskList(val currentScheduledTaskList : QueryTaskRespBean.Result?)
|
||||
: PersonalDataStateUIState()
|
||||
|
||||
data class OrderTaskList(val currentOrderTaskList : QueryTaskRespBean.Result?)
|
||||
: PersonalDataStateUIState()
|
||||
|
||||
data class TotalOrderList(val totalOrderList : QueryOrdersRespBean.Result?)
|
||||
: PersonalDataStateUIState()
|
||||
|
||||
data class CompletedOrderList(val completedOrderList : QueryOrdersRespBean.Result?)
|
||||
: PersonalDataStateUIState()
|
||||
|
||||
data class ServingDuration(val servingDuration : BaseData?)
|
||||
: PersonalDataStateUIState()
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.mogo.och.taxi.ui.personal
|
||||
|
||||
import com.mogo.och.taxi.base.IUiIntent
|
||||
|
||||
/**
|
||||
* @author: wangmingjun
|
||||
* @date: 2023/7/26
|
||||
*/
|
||||
sealed class PersonalDataUiIntent: IUiIntent{
|
||||
//查询车辆演练任务
|
||||
object QueryCurrentScheduledTaskList : PersonalDataUiIntent()
|
||||
|
||||
//查询车辆服务时长
|
||||
object QueryServingDuration : PersonalDataUiIntent()
|
||||
|
||||
//根据订单查询任务列表
|
||||
class QueryTaskListByOrder(val orderNo: Long) : PersonalDataUiIntent()
|
||||
|
||||
//查询车辆当天已完成订单
|
||||
object QueryCurrentCompleteOrder: PersonalDataUiIntent()
|
||||
|
||||
//查询车辆当天所有订单
|
||||
object QueryCurrentDayOrder: PersonalDataUiIntent()
|
||||
|
||||
}
|
||||
@@ -1,139 +0,0 @@
|
||||
package com.mogo.och.taxi.ui.personal
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.content.Context
|
||||
import android.os.Build
|
||||
import android.os.Bundle
|
||||
import android.text.Html
|
||||
import android.text.TextUtils
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.TextView
|
||||
import androidx.annotation.RequiresApi
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.mogo.commons.mvp.BaseFragment
|
||||
import com.mogo.och.common.module.utils.DateTimeUtil
|
||||
import com.mogo.och.taxi.R
|
||||
import kotlinx.android.synthetic.main.taxi_operation_data_view.operation_data_recycler_view
|
||||
|
||||
/**
|
||||
* @author: wangmingjun
|
||||
* @date: 2023/7/24
|
||||
*/
|
||||
class TaxiOperationDatasFragment : BaseFragment() {
|
||||
private val mDurationData: MutableList<Long> = ArrayList()
|
||||
private val mOrderNumData: MutableList<Long> = ArrayList()
|
||||
private val mData: MutableList<Long> = ArrayList()
|
||||
private var mAdapter: OperationDataAdapter? = null
|
||||
override fun getLayoutId(): Int {
|
||||
return R.layout.taxi_operation_data_view
|
||||
}
|
||||
|
||||
override fun getTagName(): String {
|
||||
return "TaxiOperationDatasFragment"
|
||||
}
|
||||
|
||||
override fun initViews() {
|
||||
operation_data_recycler_view.layoutManager = LinearLayoutManager(mContext)
|
||||
mContext?.let {
|
||||
mAdapter = OperationDataAdapter(it, mData)
|
||||
operation_data_recycler_view.adapter = mAdapter
|
||||
initDatas()
|
||||
}
|
||||
}
|
||||
|
||||
private fun initDatas() {
|
||||
// TaxiModel.queryDriverServiceData()
|
||||
}
|
||||
|
||||
fun setType(type: Int) {
|
||||
mType = type
|
||||
mData.clear()
|
||||
if (mType == 0) {
|
||||
mData.addAll(mDurationData)
|
||||
} else if (mType == 1) {
|
||||
mData.addAll(mOrderNumData)
|
||||
}
|
||||
if (mAdapter != null) mAdapter!!.notifyDataSetChanged()
|
||||
}
|
||||
|
||||
fun updateData(dailyTimeDuration: Long, dailyOrderNum: Long) {
|
||||
mDurationData.clear()
|
||||
mOrderNumData.clear()
|
||||
mData.clear()
|
||||
mDurationData.add(dailyTimeDuration)
|
||||
mOrderNumData.add(dailyOrderNum)
|
||||
mData.addAll(mDurationData)
|
||||
if (mAdapter != null) mAdapter!!.notifyDataSetChanged()
|
||||
}
|
||||
|
||||
internal inner class OperationDataAdapter(
|
||||
private val context: Context,
|
||||
private val datas: List<Long>
|
||||
) :
|
||||
RecyclerView.Adapter<RecyclerView.ViewHolder>() {
|
||||
override fun onCreateViewHolder(
|
||||
parent: ViewGroup,
|
||||
viewType: Int
|
||||
): RecyclerView.ViewHolder {
|
||||
val view: View = LayoutInflater.from(context)
|
||||
.inflate(R.layout.taxi_operation_data_item_view, parent, false)
|
||||
return OperationDataViewHolder(view)
|
||||
}
|
||||
|
||||
@RequiresApi(Build.VERSION_CODES.N)
|
||||
override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int) {
|
||||
if (holder is OperationDataViewHolder) {
|
||||
if (0 == mType) {
|
||||
val hourData = if (TextUtils.isEmpty(
|
||||
DateTimeUtil.secondsToHourStr(
|
||||
datas[position]
|
||||
)
|
||||
)
|
||||
) "0" else DateTimeUtil.secondsToHourStr(datas[position])
|
||||
val minuteData = DateTimeUtil.secondsToMinuteStr(datas[position])
|
||||
val data =
|
||||
"<font><b><big><big><big>$hourData</big></big></big></b> 时 </font><font><b><big><big><big>$minuteData</big></big></big></b> 分</font>"
|
||||
holder.operationDataTv.text = Html.fromHtml(data,Html.FROM_HTML_MODE_LEGACY)
|
||||
holder.operationDataTitle.text = "今日在线时长"
|
||||
} else if (1 == mType) {
|
||||
val data =
|
||||
"<font><b><big><big><big>" + datas[position].toString() + "</big></big></big></b>" + " 单" + "</font>"
|
||||
holder.operationDataTv.text = Html.fromHtml(data,Html.FROM_HTML_MODE_LEGACY)
|
||||
holder.operationDataTitle.text = "今日订单完成数"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun getItemCount(): Int {
|
||||
return datas.size
|
||||
}
|
||||
}
|
||||
|
||||
internal inner class OperationDataViewHolder(itemView: View) :
|
||||
RecyclerView.ViewHolder(itemView) {
|
||||
var operationDataTv: TextView
|
||||
var operationDataTitle: TextView
|
||||
|
||||
init {
|
||||
operationDataTv = itemView.findViewById<TextView>(R.id.operation_data_tv)
|
||||
operationDataTitle = itemView.findViewById<TextView>(R.id.operation_data_title_tv)
|
||||
}
|
||||
}
|
||||
|
||||
companion object {
|
||||
@SuppressLint("StaticFieldLeak")
|
||||
private var mContext: Context? = null
|
||||
private var mType = 0 //0: 运营时长 1:运营单数
|
||||
fun newInstance(context: Context?, type: Int): TaxiOperationDatasFragment {
|
||||
mContext = context
|
||||
mType = type
|
||||
val args = Bundle()
|
||||
val fragment = TaxiOperationDatasFragment()
|
||||
fragment.arguments = args
|
||||
return fragment
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,133 @@
|
||||
package com.mogo.och.taxi.ui.personal
|
||||
|
||||
import com.mogo.commons.AbsMogoApplication
|
||||
import com.mogo.eagle.core.data.BaseData
|
||||
import com.mogo.och.common.module.biz.network.OchCommonServiceCallback
|
||||
import com.mogo.och.taxi.base.BaseViewModel
|
||||
import com.mogo.och.taxi.base.IUiIntent
|
||||
import com.mogo.och.taxi.bean.QueryOrdersRespBean
|
||||
import com.mogo.och.taxi.bean.QueryTaskRespBean
|
||||
import com.mogo.och.taxi.network.TaxiPersonalDataServiceManager
|
||||
|
||||
/**
|
||||
* @author: wangmingjun
|
||||
* @date: 2023/11/2
|
||||
*/
|
||||
class TaxiPersonalDataViewModel : BaseViewModel<PersonalDataUIState, PersonalDataUiIntent>(){
|
||||
|
||||
override fun initUiState(): PersonalDataUIState {
|
||||
return PersonalDataUIState(PersonalDataStateUIState.Init)
|
||||
}
|
||||
|
||||
override fun handleIntent(intent: IUiIntent) {
|
||||
when (intent) {
|
||||
is PersonalDataUiIntent.QueryCurrentScheduledTaskList -> {
|
||||
queryCurrentScheduledTaskList()
|
||||
}
|
||||
is PersonalDataUiIntent.QueryServingDuration -> {
|
||||
queryServingDuration()
|
||||
}
|
||||
is PersonalDataUiIntent.QueryTaskListByOrder -> {
|
||||
queryTaskListByOrder(intent.orderNo)
|
||||
}
|
||||
is PersonalDataUiIntent.QueryCurrentCompleteOrder -> {
|
||||
queryCurrentCompleteOrder()
|
||||
}
|
||||
is PersonalDataUiIntent.QueryCurrentDayOrder -> {
|
||||
queryCurrentDayOrder()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 车辆演练任务列表
|
||||
*/
|
||||
private fun queryCurrentScheduledTaskList() {
|
||||
TaxiPersonalDataServiceManager.queryCurrentScheduledTaskList(
|
||||
AbsMogoApplication.getApp().applicationContext,
|
||||
object :OchCommonServiceCallback<QueryTaskRespBean>{
|
||||
override fun onSuccess(data: QueryTaskRespBean?) {
|
||||
TODO("Not yet implemented")
|
||||
}
|
||||
|
||||
override fun onFail(code: Int, msg: String?) {
|
||||
TODO("Not yet implemented")
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 车辆服务市场列表
|
||||
*/
|
||||
private fun queryServingDuration(){
|
||||
TaxiPersonalDataServiceManager.queryServingDuration(
|
||||
AbsMogoApplication.getApp().applicationContext,
|
||||
object :OchCommonServiceCallback<BaseData>{
|
||||
override fun onSuccess(data: BaseData?) {
|
||||
TODO("Not yet implemented")
|
||||
}
|
||||
|
||||
override fun onFail(code: Int, msg: String?) {
|
||||
TODO("Not yet implemented")
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据订单查询任务列表
|
||||
*/
|
||||
private fun queryTaskListByOrder(orderNo: Long){
|
||||
TaxiPersonalDataServiceManager.queryTaskListByOrder(
|
||||
AbsMogoApplication.getApp().applicationContext,
|
||||
orderNo,
|
||||
object :OchCommonServiceCallback<QueryTaskRespBean>{
|
||||
override fun onSuccess(data: QueryTaskRespBean?) {
|
||||
TODO("Not yet implemented")
|
||||
}
|
||||
|
||||
override fun onFail(code: Int, msg: String?) {
|
||||
TODO("Not yet implemented")
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询车辆当天已完成订单
|
||||
*/
|
||||
private fun queryCurrentCompleteOrder(){
|
||||
TaxiPersonalDataServiceManager.queryCurrentCompleteOrder(
|
||||
AbsMogoApplication.getApp().applicationContext,
|
||||
object :OchCommonServiceCallback<QueryOrdersRespBean>{
|
||||
override fun onSuccess(data: QueryOrdersRespBean?) {
|
||||
TODO("Not yet implemented")
|
||||
}
|
||||
|
||||
override fun onFail(code: Int, msg: String?) {
|
||||
TODO("Not yet implemented")
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询车辆当天所有订单
|
||||
*/
|
||||
private fun queryCurrentDayOrder(){
|
||||
TaxiPersonalDataServiceManager.queryCurrentDayOrder(
|
||||
AbsMogoApplication.getApp().applicationContext,
|
||||
object :OchCommonServiceCallback<QueryOrdersRespBean>{
|
||||
override fun onSuccess(data: QueryOrdersRespBean?) {
|
||||
TODO("Not yet implemented")
|
||||
}
|
||||
|
||||
override fun onFail(code: Int, msg: String?) {
|
||||
TODO("Not yet implemented")
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -1,62 +1,43 @@
|
||||
package com.mogo.och.taxi.ui.personal
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.app.Dialog
|
||||
import android.content.Context
|
||||
import android.graphics.Color
|
||||
import android.graphics.Point
|
||||
import android.graphics.Typeface
|
||||
import android.os.Bundle
|
||||
import android.util.TypedValue
|
||||
import android.view.Gravity
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.view.WindowManager
|
||||
import android.widget.Button
|
||||
import android.widget.ImageView
|
||||
import android.widget.TextView
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.fragment.app.FragmentManager
|
||||
import androidx.fragment.app.FragmentPagerAdapter
|
||||
import androidx.fragment.app.DialogFragment
|
||||
import androidx.lifecycle.ViewModelProvider
|
||||
import androidx.lifecycle.lifecycleScope
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import androidx.viewpager.widget.ViewPager.OnPageChangeListener
|
||||
import com.google.android.material.tabs.TabLayout
|
||||
import com.mogo.commons.mvp.MvpDialogFragment
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.d
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
|
||||
import com.mogo.och.taxi.R
|
||||
import com.mogo.och.taxi.ui.common.AvoidLeakDialog
|
||||
import com.mogo.och.taxi.bean.QueryCurrentTaskRespBean
|
||||
import com.mogo.och.taxi.constant.TaxiOrderStatusEnum.*
|
||||
import com.mogo.och.taxi.constant.TaxiOrderStatusEnum.Companion.valueOf
|
||||
import com.mogo.och.taxi.constant.TaxiOrderTypeEnum
|
||||
import com.mogo.och.taxi.presenter.TaxiOperationalPresenter
|
||||
import com.mogo.och.taxi.ui.task.TaxiCurrentTaskFragment
|
||||
import kotlinx.android.synthetic.main.taxi_no_data_common_view.no_order_data_iv
|
||||
import kotlinx.android.synthetic.main.taxi_no_data_common_view.no_order_data_view
|
||||
import kotlinx.android.synthetic.main.taxi_orders_list_view.module_och_taxi_operation_data_rl
|
||||
import kotlinx.android.synthetic.main.taxi_orders_list_view.module_och_taxi_order_list
|
||||
import kotlinx.android.synthetic.main.taxi_orders_list_view.module_och_taxi_order_list_close_iv
|
||||
import kotlinx.android.synthetic.main.taxi_orders_list_view.module_och_taxi_order_list_show_bt
|
||||
import kotlinx.android.synthetic.main.taxi_orders_list_view.operation_data_tablayout
|
||||
import kotlinx.android.synthetic.main.taxi_orders_list_view.operation_data_viewpager
|
||||
import me.jessyan.autosize.utils.AutoSizeUtils
|
||||
import kotlinx.android.synthetic.main.taxi_personal_data_view.module_och_taxi_order_list_close_iv
|
||||
import kotlinx.coroutines.flow.map
|
||||
|
||||
/**
|
||||
* @author: wangmingjun
|
||||
* @date: 2023/7/24
|
||||
*/
|
||||
class TaxiPersonalDialogFragment :
|
||||
MvpDialogFragment<TaxiPersonalDialogFragment?, TaxiOperationalPresenter?>(),
|
||||
class TaxiPersonalDialogFragment : DialogFragment(),
|
||||
View.OnClickListener {
|
||||
|
||||
private lateinit var mViewModel: TaxiPersonalDataViewModel
|
||||
private val orders: MutableList<QueryCurrentTaskRespBean.Result> = ArrayList()
|
||||
private val mTabTitles = arrayOf("在线时长", "订单完成数")
|
||||
private val fragments: MutableList<TaxiOperationDatasFragment> = ArrayList()
|
||||
private var mNextPage = 1 //订单列表分页从1开始
|
||||
private val mPerPageSize = 10
|
||||
private var mAdapter: OrderAdapter? = null
|
||||
|
||||
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
|
||||
val dialog = AvoidLeakDialog(
|
||||
@@ -66,20 +47,26 @@ class TaxiPersonalDialogFragment :
|
||||
return dialog
|
||||
}
|
||||
|
||||
override fun getLayoutId(): Int {
|
||||
return R.layout.taxi_orders_list_view
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
mViewModel = ViewModelProvider(
|
||||
this,
|
||||
ViewModelProvider.NewInstanceFactory()
|
||||
)[TaxiPersonalDataViewModel::class.java]
|
||||
}
|
||||
|
||||
override fun initViews() {
|
||||
override fun onCreateView(
|
||||
inflater: LayoutInflater,
|
||||
container: ViewGroup?,
|
||||
savedInstanceState: Bundle?
|
||||
): View? {
|
||||
return inflater.inflate(R.layout.taxi_personal_data_view, container, false )
|
||||
}
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
initView()
|
||||
}
|
||||
|
||||
override fun createPresenter(): TaxiOperationalPresenter {
|
||||
return TaxiOperationalPresenter(this)
|
||||
}
|
||||
|
||||
override fun getTagName(): String {
|
||||
return TAG
|
||||
initViewModelObserver()
|
||||
}
|
||||
|
||||
override fun onStart() {
|
||||
@@ -106,310 +93,52 @@ class TaxiPersonalDialogFragment :
|
||||
}
|
||||
|
||||
private fun initView() {
|
||||
initOperationTabDatas()
|
||||
no_order_data_iv.setImageResource(R.drawable.no_order_data)
|
||||
val params = no_order_data_iv.layoutParams as ConstraintLayout.LayoutParams
|
||||
params.width = 480
|
||||
params.height = 480
|
||||
no_order_data_iv.layoutParams = params
|
||||
module_och_taxi_order_list.visibility = View.GONE
|
||||
no_order_data_view.visibility = View.VISIBLE
|
||||
module_och_taxi_order_list_show_bt.setOnClickListener(this)
|
||||
module_och_taxi_order_list_close_iv.setOnClickListener(this)
|
||||
}
|
||||
|
||||
private fun initOperationTabDatas() {
|
||||
for (i in mTabTitles.indices) {
|
||||
val tab = operation_data_tablayout.newTab()
|
||||
tab.view.setBackgroundColor(Color.parseColor("#00000000"))
|
||||
val tabView = View.inflate(context, R.layout.taxi_operation_tab_item_custom, null)
|
||||
val tv = tabView.findViewById<TextView>(R.id.operation_tab_title)
|
||||
tv.text = mTabTitles[i]
|
||||
tab.customView = tabView
|
||||
if (0 == i) {
|
||||
operation_data_tablayout.addTab(tab, true)
|
||||
changeOperationTabLayoutTabUI(tab, true)
|
||||
fragments.add(TaxiOperationDatasFragment.newInstance(activity, 0))
|
||||
} else if (1 == i) {
|
||||
operation_data_tablayout.addTab(tab)
|
||||
changeOperationTabLayoutTabUI(tab, false)
|
||||
fragments.add(TaxiOperationDatasFragment.newInstance(activity, 1))
|
||||
private fun initViewModelObserver() {
|
||||
lifecycleScope.launchWhenStarted {
|
||||
mViewModel.uiStateFlow.map { it.personalDataUIState }.collect { personalDataUIState ->
|
||||
d(TaxiCurrentTaskFragment.TAG, "uiStateFlow-initViewModelObserver: $personalDataUIState")
|
||||
when (personalDataUIState) {
|
||||
is PersonalDataStateUIState.Init -> {
|
||||
}
|
||||
|
||||
is PersonalDataStateUIState.ServingDuration-> { //今日时长
|
||||
|
||||
}
|
||||
|
||||
is PersonalDataStateUIState.CompletedOrderList -> {// 今日订单完成量
|
||||
|
||||
}
|
||||
|
||||
is PersonalDataStateUIState.TotalOrderList -> { //今日全部订单
|
||||
|
||||
}
|
||||
|
||||
is PersonalDataStateUIState.ScheduledTaskList -> { // 今日演练任务量
|
||||
|
||||
}
|
||||
|
||||
is PersonalDataStateUIState.OrderTaskList -> { //订单的任务
|
||||
|
||||
}
|
||||
|
||||
else -> {}
|
||||
}
|
||||
}
|
||||
}
|
||||
operation_data_tablayout.addOnTabSelectedListener(object : TabLayout.OnTabSelectedListener {
|
||||
override fun onTabSelected(tab: TabLayout.Tab) {
|
||||
operation_data_viewpager.currentItem = tab.position
|
||||
changeOperationTabLayoutTabUI(tab, true)
|
||||
fragments[tab.position].setType(tab.position)
|
||||
}
|
||||
|
||||
override fun onTabUnselected(tab: TabLayout.Tab) {
|
||||
changeOperationTabLayoutTabUI(tab, false)
|
||||
}
|
||||
|
||||
override fun onTabReselected(tab: TabLayout.Tab) {}
|
||||
})
|
||||
operation_data_viewpager.addOnPageChangeListener(object : OnPageChangeListener {
|
||||
override fun onPageScrolled(
|
||||
position: Int,
|
||||
positionOffset: Float,
|
||||
positionOffsetPixels: Int
|
||||
) {
|
||||
}
|
||||
|
||||
override fun onPageSelected(position: Int) {
|
||||
operation_data_tablayout.getTabAt(position)!!.select()
|
||||
}
|
||||
|
||||
override fun onPageScrollStateChanged(state: Int) {}
|
||||
})
|
||||
operation_data_viewpager.adapter = OrdersOperationFragmentAdapter(
|
||||
childFragmentManager, FragmentPagerAdapter.BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT
|
||||
)
|
||||
fragments[0].setType(0)
|
||||
}
|
||||
|
||||
fun onServiceDataUpdate(dailyTimeDuration: Long, dailyOrderNum: Long) {
|
||||
for (i in fragments.indices) {
|
||||
fragments[i].updateData(dailyTimeDuration, dailyOrderNum)
|
||||
}
|
||||
}
|
||||
|
||||
private fun changeOperationTabLayoutTabUI(tab: TabLayout.Tab, isSelected: Boolean) {
|
||||
val textView = tab.customView!!.findViewById<View>(R.id.operation_tab_title) as TextView
|
||||
val imageView = tab.customView!!.findViewById<View>(R.id.operation_tab_line_iv) as ImageView
|
||||
if (isSelected) {
|
||||
textView.setTextSize(
|
||||
TypedValue.COMPLEX_UNIT_PX,
|
||||
AutoSizeUtils.dp2px(context, 46f).toFloat()
|
||||
)
|
||||
d(SceneConstant.M_TAXI + TAG, "SelectTv = " + textView.text)
|
||||
textView.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD))
|
||||
textView.setTextColor(Color.parseColor("#FFFFFF"))
|
||||
imageView.setImageDrawable(resources.getDrawable(R.drawable.taxi_driver_operation_tab_line))
|
||||
} else {
|
||||
textView.setTextSize(
|
||||
TypedValue.COMPLEX_UNIT_PX,
|
||||
AutoSizeUtils.dp2px(context, 40f).toFloat()
|
||||
)
|
||||
d(SceneConstant.M_TAXI + TAG, "unSelectTv = " + textView.text)
|
||||
textView.setTypeface(Typeface.defaultFromStyle(Typeface.NORMAL))
|
||||
textView.setTextColor(Color.parseColor("#A7B6F0"))
|
||||
imageView.setImageDrawable(null)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onClick(v: View) {
|
||||
if (v.id == R.id.module_och_taxi_order_list_close_iv) {
|
||||
dismiss()
|
||||
} else {
|
||||
module_och_taxi_order_list.visibility = View.VISIBLE
|
||||
module_och_taxi_operation_data_rl.visibility = View.GONE
|
||||
no_order_data_view.visibility = View.GONE
|
||||
initOrdersView()
|
||||
// mPresenter!!.queryOrdersList(mNextPage, mPerPageSize)
|
||||
}
|
||||
}
|
||||
|
||||
private fun initOrdersView() {
|
||||
context?.let {
|
||||
mAdapter = OrderAdapter(it, orders)
|
||||
val manager = LinearLayoutManager(
|
||||
context
|
||||
)
|
||||
module_och_taxi_order_list.layoutManager = manager
|
||||
module_och_taxi_order_list.addOnScrollListener(object :
|
||||
OnTaxiOrderRvOnScrollListener() {
|
||||
override fun onLoadMore() {
|
||||
if (!serverHadNoData) {
|
||||
// mPresenter!!.queryOrdersList(mNextPage, mPerPageSize)
|
||||
}
|
||||
}
|
||||
})
|
||||
module_och_taxi_order_list.adapter = mAdapter
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressLint("NotifyDataSetChanged")
|
||||
fun onOrdersListPageRefresh(ordersList: List<QueryCurrentTaskRespBean.Result>) {
|
||||
try {
|
||||
if (mNextPage == 0 || ordersList.isEmpty()) { //无数据
|
||||
module_och_taxi_order_list.visibility = View.GONE
|
||||
no_order_data_view.visibility = View.VISIBLE
|
||||
return
|
||||
}
|
||||
module_och_taxi_order_list.visibility = View.VISIBLE
|
||||
no_order_data_view.visibility = View.GONE
|
||||
if ((ordersList.size < mPerPageSize) && mNextPage > 0) { //已经没有更多数据,提示无数据
|
||||
//已经没有更多数据
|
||||
serverHadNoData = true
|
||||
orders.addAll(ordersList!!)
|
||||
mAdapter!!.notifyDataSetChanged()
|
||||
mNextPage += 1
|
||||
return
|
||||
}
|
||||
serverHadNoData = false
|
||||
orders.addAll(ordersList)
|
||||
if (mAdapter != null) {
|
||||
mAdapter!!.notifyDataSetChanged()
|
||||
}
|
||||
mNextPage += 1
|
||||
} catch (e: Exception) {
|
||||
e.fillInStackTrace()
|
||||
}
|
||||
}
|
||||
|
||||
internal inner class OrderAdapter(
|
||||
private val context: Context,
|
||||
private var orders: List<QueryCurrentTaskRespBean.Result>
|
||||
) : RecyclerView.Adapter<RecyclerView.ViewHolder>() {
|
||||
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): RecyclerView.ViewHolder {
|
||||
if (viewType == ORDER_DETAIL_ITEM) {
|
||||
val view: View = LayoutInflater.from(context)
|
||||
.inflate(R.layout.taxi_orders_list_item, parent, false)
|
||||
return OrderDetailViewHolder(view)
|
||||
} else { //viewType == DAY_GROUP_ITEM
|
||||
val view: View = LayoutInflater.from(context)
|
||||
.inflate(R.layout.taxi_orders_list_day_item, parent, false)
|
||||
return DayGroupViewHolder(view)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int) {
|
||||
// val queryRespBean = orders[position]
|
||||
// ?: return
|
||||
// if (holder is DayGroupViewHolder) {
|
||||
// holder.dayGroupTv.text = DateTimeUtil.getYMDTime(queryRespBean.createTime)
|
||||
// bindOrderDetailData(
|
||||
// queryRespBean,
|
||||
// holder.orderTimeTv,
|
||||
// holder.startStationTv,
|
||||
// holder.endStationTv,
|
||||
// holder.orderStatusBt,
|
||||
// holder.orderTypeBt,
|
||||
// holder.orderNumTv
|
||||
// )
|
||||
// if (isNoLineItem(position)) {
|
||||
// holder.dividerLine.visibility = View.VISIBLE
|
||||
// } else {
|
||||
// holder.dividerLine.visibility = View.GONE
|
||||
// }
|
||||
// if (position == orders.size - 1 && serverHadNoData) {
|
||||
// holder.mBootNoDataView.visibility = View.VISIBLE
|
||||
// } else {
|
||||
// holder.mBootNoDataView.visibility = View.GONE
|
||||
// }
|
||||
// } else if (holder is OrderDetailViewHolder) {
|
||||
// bindOrderDetailData(
|
||||
// queryRespBean,
|
||||
// holder.orderTimeTv,
|
||||
// holder.startStationTv,
|
||||
// holder.endStationTv,
|
||||
// holder.orderStatusBt,
|
||||
// holder.orderTypeBt,
|
||||
// holder.orderNumTv
|
||||
// )
|
||||
// if (isNoLineItem(position)) {
|
||||
// holder.dividerLine.visibility = View.VISIBLE
|
||||
// } else {
|
||||
// holder.dividerLine.visibility = View.GONE
|
||||
// }
|
||||
// if (position == orders.size - 1 && serverHadNoData) {
|
||||
// holder.mBootNoDataView.visibility = View.VISIBLE
|
||||
// } else {
|
||||
// holder.mBootNoDataView.visibility = View.GONE
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
override fun getItemId(position: Int): Long {
|
||||
return position.toLong()
|
||||
}
|
||||
|
||||
override fun getItemViewType(position: Int): Int {
|
||||
//第一个要显示时间
|
||||
// if (position == 0) {
|
||||
// return Companion.DAY_GROUP_ITEM
|
||||
// }
|
||||
// val currentDate = DateTimeUtil.getYMDTime(orders[position].createTime) //获取当前订单时间
|
||||
// val prevIndex = position - 1
|
||||
// val preDate = DateTimeUtil.getYMDTime(orders[prevIndex].createTime)
|
||||
// val isDifferent = preDate != currentDate //前一个订单的日期跟第二个订单的日期是否一致
|
||||
// return if (isDifferent) DAY_GROUP_ITEM else ORDER_DETAIL_ITEM //一样订单详情, 不一样新添加分组
|
||||
return 0
|
||||
}
|
||||
|
||||
private fun isNoLineItem(position: Int): Boolean {
|
||||
// return if (position == orders.size - 1) {
|
||||
// false
|
||||
// } else {
|
||||
// val currentDate =
|
||||
// DateTimeUtil.getYMDTime(orders[position].createTime) //获取当前订单时间
|
||||
// val nextIndex = position + 1
|
||||
// val preDate =
|
||||
// DateTimeUtil.getYMDTime(orders[nextIndex].createTime)
|
||||
// preDate == currentDate //一样有划分线, 不一样没有划分线
|
||||
// }
|
||||
return false
|
||||
}
|
||||
|
||||
override fun getItemCount(): Int {
|
||||
return orders.size
|
||||
}
|
||||
|
||||
@SuppressLint("SetTextI18n")
|
||||
private fun bindOrderDetailData(
|
||||
queryRespBean: QueryCurrentTaskRespBean.Result,
|
||||
orderTimeTv: TextView,
|
||||
startStationTv: TextView,
|
||||
endStationTv: TextView,
|
||||
orderStatusBt: Button,
|
||||
orderTypeBt: Button,
|
||||
orderNumTv: TextView
|
||||
) {
|
||||
// val calendar = Calendar.getInstance()
|
||||
// calendar.timeInMillis = queryRespBean.createTime
|
||||
// orderTimeTv.text = DateTimeUtil.formatCalendarToString(calendar, DateTimeUtil.HH_mm)
|
||||
// startStationTv.text = queryRespBean.startSiteAddr
|
||||
// endStationTv.text = queryRespBean.endSiteAddr
|
||||
// orderStatusBt.text = getOrderStatus(queryRespBean.orderStatus, orderStatusBt)
|
||||
// orderTypeBt.text = getOrderType(queryRespBean.orderType, orderTypeBt)
|
||||
// orderNumTv.text = "订单编号:" + queryRespBean.orderNo.toString()
|
||||
}
|
||||
|
||||
@SuppressLint("UseCompatLoadingForDrawables")
|
||||
private fun getOrderStatus(status: Int, button: Button): String {
|
||||
return when (valueOf(status)) {
|
||||
JourneyCompleted -> {
|
||||
button.background =
|
||||
context.getDrawable(R.drawable.taxi_order_button_status_canceled_bg)
|
||||
"已完成"
|
||||
}
|
||||
|
||||
Cancel -> {
|
||||
button.background =
|
||||
context.getDrawable(R.drawable.taxi_order_button_status_canceled_bg)
|
||||
"已取消"
|
||||
}
|
||||
|
||||
else -> {
|
||||
button.background = context.getDrawable(R.drawable.taxi_order_button_status_bg)
|
||||
"服务中"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressLint("UseCompatLoadingForDrawables")
|
||||
private fun getOrderType(type: Int, button: Button): String {
|
||||
return if (type == TaxiOrderTypeEnum.Reserved.type) {
|
||||
button.background =
|
||||
context.getDrawable(R.drawable.taxi_order_button_type_reserver_bg)
|
||||
"预约单"
|
||||
} else {
|
||||
button.background = context.getDrawable(R.drawable.taxi_order_button_type_bg)
|
||||
"即时单"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -422,7 +151,6 @@ class TaxiPersonalDialogFragment :
|
||||
var orderNumTv: TextView
|
||||
var orderTypeBt: Button
|
||||
var dividerLine: View
|
||||
var mBootNoDataView: View
|
||||
|
||||
init {
|
||||
orderTimeTv = itemView.findViewById<TextView>(R.id.order_time_hm_tv)
|
||||
@@ -432,7 +160,6 @@ class TaxiPersonalDialogFragment :
|
||||
orderNumTv = itemView.findViewById<TextView>(R.id.order_num)
|
||||
orderTypeBt = itemView.findViewById<Button>(R.id.order_type_bt)
|
||||
dividerLine = itemView.findViewById<View>(R.id.module_och_taxi_order_divider)
|
||||
mBootNoDataView = itemView.findViewById<View>(R.id.boot_refresh_no_data_view)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -474,29 +201,10 @@ class TaxiPersonalDialogFragment :
|
||||
|
||||
override fun dismiss() {
|
||||
super.dismiss()
|
||||
mNextPage = 0
|
||||
orders.clear()
|
||||
}
|
||||
|
||||
private inner class OrdersOperationFragmentAdapter(fm: FragmentManager, behavior: Int) :
|
||||
FragmentPagerAdapter(fm, behavior) {
|
||||
override fun getItem(position: Int): Fragment {
|
||||
return fragments[position]
|
||||
}
|
||||
|
||||
override fun getCount(): Int {
|
||||
return fragments.size
|
||||
}
|
||||
|
||||
override fun getPageTitle(position: Int): CharSequence {
|
||||
return mTabTitles[position]
|
||||
}
|
||||
}
|
||||
|
||||
companion object {
|
||||
private const val TAG = "OCHTaxiOrdersDialog"
|
||||
private var serverHadNoData = false
|
||||
private const val ORDER_DETAIL_ITEM = 0
|
||||
private const val DAY_GROUP_ITEM = 1
|
||||
}
|
||||
}
|
||||
@@ -124,14 +124,4 @@
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<include
|
||||
android:id="@+id/boot_refresh_no_data_view"
|
||||
layout="@layout/taxi_order_list_boot_no_data_view"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="80dp"
|
||||
android:layout_marginBottom="80dp"
|
||||
android:layout_below="@+id/order_item_cl"
|
||||
android:layout_centerHorizontal="true"/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
@@ -1,100 +0,0 @@
|
||||
<?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="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="#F0151D41">
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/module_och_taxi_operation_data_rl"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<Button
|
||||
android:id="@+id/module_och_taxi_order_list_show_bt"
|
||||
android:layout_width="@dimen/taxi_order_list_show_bt_width"
|
||||
android:layout_height="@dimen/taxi_order_list_show_bt_height"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="206dp"
|
||||
android:background="@drawable/taxi_show_orders_bg"
|
||||
android:drawableLeft="@drawable/shape_size_see_all_order"
|
||||
android:gravity="center"
|
||||
android:paddingLeft="154dp"
|
||||
android:paddingRight="132dp"
|
||||
android:text="查看全部订单"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:textSize="@dimen/dp_44" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/module_och_taxi_operation_data_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="86dp"
|
||||
android:layout_below="@+id/module_och_taxi_order_list_show_bt"
|
||||
android:layout_marginLeft="80dp"
|
||||
android:layout_marginTop="112dp"
|
||||
android:gravity="center"
|
||||
android:text="出租车运营数据:"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="@dimen/dp_44" />
|
||||
|
||||
<View
|
||||
android:layout_width="14dp"
|
||||
android:layout_height="50dp"
|
||||
android:layout_below="@+id/module_och_taxi_order_list_show_bt"
|
||||
android:layout_marginLeft="47dp"
|
||||
android:layout_marginTop="132dp"
|
||||
android:background="#2966EC" />
|
||||
|
||||
<com.google.android.material.tabs.TabLayout
|
||||
android:id="@+id/operation_data_tablayout"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/module_och_taxi_operation_data_title"
|
||||
app:tabMode="fixed"
|
||||
android:layout_marginLeft="80dp"
|
||||
android:layout_marginTop="30dp"
|
||||
app:tabIndicatorHeight="0dp"
|
||||
app:tabMaxWidth="@dimen/taxi_order_list_tab_max_weight"
|
||||
app:tabMinWidth="@dimen/taxi_order_list_tab_min_weight"
|
||||
app:tabSelectedTextColor="#FFFFFF"
|
||||
app:tabTextColor="#A7B6F0" />
|
||||
|
||||
<androidx.viewpager.widget.ViewPager
|
||||
android:id="@+id/operation_data_viewpager"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="820dp"
|
||||
android:layout_marginLeft="80dp"
|
||||
android:layout_marginRight="80dp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
android:layout_below="@+id/operation_data_tablayout" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/module_och_taxi_order_list"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingBottom="50dp">
|
||||
|
||||
</androidx.recyclerview.widget.RecyclerView>
|
||||
</RelativeLayout>
|
||||
|
||||
<include
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
layout="@layout/taxi_no_data_common_view"/>
|
||||
<ImageView
|
||||
android:id="@+id/module_och_taxi_order_list_close_iv"
|
||||
android:layout_width="150dp"
|
||||
android:layout_height="150dp"
|
||||
android:layout_gravity="right"
|
||||
android:padding="30dp"
|
||||
android:src="@drawable/taxi_order_cancel_close1" />
|
||||
|
||||
</FrameLayout>
|
||||
@@ -0,0 +1,46 @@
|
||||
<?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="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="#F0151D41">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/taxi_operation_data_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_86"
|
||||
android:gravity="center"
|
||||
android:text="网约车运营数据"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="@dimen/dp_42"
|
||||
android:layout_marginTop="@dimen/dp_78"
|
||||
android:layout_marginLeft="@dimen/dp_114"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"/>
|
||||
|
||||
<View
|
||||
android:layout_width="@dimen/dp_14"
|
||||
android:layout_height="@dimen/dp_50"
|
||||
android:layout_marginRight="@dimen/dp_20"
|
||||
android:background="#2966EC"
|
||||
app:layout_constraintTop_toTopOf="@+id/taxi_operation_data_title"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/taxi_operation_data_title"
|
||||
app:layout_constraintRight_toLeftOf="@+id/taxi_operation_data_title"/>
|
||||
|
||||
<include
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:visibility="gone"
|
||||
layout="@layout/taxi_no_data_common_view"/>
|
||||
<ImageView
|
||||
android:id="@+id/module_och_taxi_order_list_close_iv"
|
||||
android:layout_width="@dimen/dp_106"
|
||||
android:layout_height="@dimen/dp_106"
|
||||
android:layout_marginRight="@dimen/dp_40"
|
||||
android:src="@drawable/taxi_order_cancel_close1"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/taxi_operation_data_title"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/taxi_operation_data_title"/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
Reference in New Issue
Block a user