[6.0.0] 去除数据统计相关请求
This commit is contained in:
@@ -19,4 +19,7 @@ public interface ITaxiOrderStatusCallback {
|
||||
* @param isShow 是否显示导航地图(否播报声音)
|
||||
*/
|
||||
void onNaviToEnd(boolean isAmap, boolean isShow);
|
||||
|
||||
// 当前位置距离上车点的距离(米)、预估时间(秒)
|
||||
void onCurrentOrderDistToEndChanged(long meters, long timeInSecond);
|
||||
}
|
||||
|
||||
@@ -89,11 +89,6 @@ import com.mogo.och.taxi.constant.TaxiOrderStatusEnum
|
||||
import com.mogo.och.taxi.constant.TaxiOrderStatusEnum.Companion.valueOf
|
||||
import com.mogo.och.taxi.constant.TaxtServingStatusManager.isOpeningOrderStatus
|
||||
import com.mogo.och.taxi.network.TaxiServiceManager.changeOrderServing
|
||||
import com.mogo.och.taxi.network.TaxiServiceManager.queryDriverServiceData
|
||||
import com.mogo.och.taxi.network.TaxiServiceManager.queryOrderRoute
|
||||
import com.mogo.och.taxi.network.TaxiServiceManager.queryOrdersList
|
||||
import com.mogo.och.taxi.network.TaxiServiceManager.reportOrderRemain
|
||||
import com.mogo.och.taxi.utils.OrderUtil
|
||||
import com.mogo.och.taxi.utils.TaxiAnalyticsManager
|
||||
import com.mogo.och.taxi.utils.TaxiTrajectoryManager
|
||||
import com.zhjt.service.chain.ChainLog
|
||||
@@ -332,62 +327,6 @@ object TaxiModel {
|
||||
})
|
||||
}
|
||||
|
||||
// 获取全部订单列表
|
||||
fun queryOrdersList(page: Int, size: Int) {
|
||||
queryOrdersList(
|
||||
mContext!!, page, size,
|
||||
object : OchCommonServiceCallback<OrdersListQueryRespBean> {
|
||||
override fun onSuccess(data: OrdersListQueryRespBean) {
|
||||
if (null != data && 0 == data.code) {
|
||||
if (mCarOperationalCallback != null) {
|
||||
mCarOperationalCallback!!.onOrdersListPageRefresh(data.data.orders)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onError() {
|
||||
if (!NetworkUtils.isConnected(mContext)) {
|
||||
ToastUtils.showShort(mContext!!.getString(R.string.network_error_tip))
|
||||
} else {
|
||||
ToastUtils.showShort(mContext!!.getString(R.string.request_error_tip))
|
||||
}
|
||||
}
|
||||
|
||||
override fun onFail(code: Int, msg: String) {
|
||||
ToastUtilsOch.showWithCodeMessage(code, msg)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 查询司机服务数据
|
||||
fun queryDriverServiceData() {
|
||||
queryDriverServiceData(
|
||||
mContext!!,
|
||||
object : OchCommonServiceCallback<DriverServiceDataRespBean> {
|
||||
override fun onSuccess(data: DriverServiceDataRespBean) {
|
||||
if (data != null && data.code == 0 && data.data != null) {
|
||||
if (mCarOperationalCallback != null) {
|
||||
mCarOperationalCallback!!.onServiceDataUpdate(
|
||||
data.data.timeDuration, data.data.orderNum
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onError() {
|
||||
if (!NetworkUtils.isConnected(mContext)) {
|
||||
ToastUtils.showShort(mContext!!.getString(R.string.network_error_tip))
|
||||
} else {
|
||||
ToastUtils.showShort(mContext!!.getString(R.string.request_error_tip))
|
||||
}
|
||||
}
|
||||
|
||||
override fun onFail(code: Int, msg: String) {
|
||||
ToastUtilsOch.showWithCodeMessage(code, msg)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 获取当前订单
|
||||
fun getCurrentOCHOrder(): OrderQueryRespBean.Result? {
|
||||
return TaxiUnmannedViewModel.getCurrentOCHOrder()
|
||||
@@ -913,24 +852,6 @@ object TaxiModel {
|
||||
}
|
||||
}
|
||||
|
||||
private fun coordinateConverterWgsToGcjList(
|
||||
mContext: Context?,
|
||||
mogoLatLngList: List<MessagePad.Location?>
|
||||
): List<OrderRouteUpdateReqBean.Result?> {
|
||||
val points: MutableList<OrderRouteUpdateReqBean.Result?> = ArrayList()
|
||||
for (m: MessagePad.Location? in mogoLatLngList) {
|
||||
val mogoLatLng = coordinateConverterWgsToGcj(
|
||||
mContext,
|
||||
(m)!!
|
||||
)
|
||||
val result = OrderRouteUpdateReqBean.Result()
|
||||
result.latitude = mogoLatLng.latitude
|
||||
result.longitude = mogoLatLng.longitude
|
||||
points.add(result)
|
||||
}
|
||||
return points
|
||||
}
|
||||
|
||||
/**
|
||||
* 计算全路径长度,以及实时更新剩余距离,剩余时间,预计时间
|
||||
*
|
||||
@@ -949,18 +870,12 @@ object TaxiModel {
|
||||
startDynamicCalculateRouteInfo()
|
||||
}
|
||||
|
||||
fun startDynamicCalculateRouteInfo() {
|
||||
private fun startDynamicCalculateRouteInfo() {
|
||||
d(
|
||||
SceneConstant.M_TAXI + TAG,
|
||||
"--------mCurrentOCHOrder---------- $mCurrentOCHOrder"
|
||||
)
|
||||
if (mCurrentOCHOrder != null && mRoutePoints!!.size == 0) { //根据orderNo去查询
|
||||
queryOrderRouteList(mCurrentOCHOrder!!.orderNo)
|
||||
}
|
||||
d(SceneConstant.M_TAXI + TAG, "--------mRoutePoints.size---------- " + mRoutePoints!!.size)
|
||||
if (mRoutePoints.size > 0) {
|
||||
reportTotalDisAndTime()
|
||||
}
|
||||
//开启实时计算剩余距离,剩余时间,预计时间
|
||||
startOrStopCalculateRouteInfo(true)
|
||||
AmapNaviToDestinationModel.getInstance(mContext).destroyAmaNavi()
|
||||
@@ -969,12 +884,6 @@ object TaxiModel {
|
||||
}
|
||||
}
|
||||
|
||||
private fun reportTotalDisAndTime() {
|
||||
val lastSumLength = calculateRouteSumLength(mRoutePoints)
|
||||
val lastTime = lastSumLength / TaxiConst.TAXI_AVERAGE_SPEED * 3.6 //秒
|
||||
reportOrderRemain(lastSumLength.toLong(), lastTime.toLong())
|
||||
}
|
||||
|
||||
private fun updateDistance(lastSumLength: Float) {
|
||||
val lastTime = lastSumLength / TaxiConst.TAXI_AVERAGE_SPEED * 3.6 //秒
|
||||
d(
|
||||
@@ -991,7 +900,6 @@ object TaxiModel {
|
||||
lastTime.toLong()
|
||||
)
|
||||
}
|
||||
reportOrderRemain(lastSumLength.toLong(), lastTime.toLong())
|
||||
}
|
||||
|
||||
private val distanceListener: IDistanceListener = object : IDistanceListener {
|
||||
@@ -1039,38 +947,12 @@ object TaxiModel {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询当前订单的全局路径 (当自动驾驶开启后,订单前往乘客上车点,杀掉应用再次进来时候)
|
||||
*/
|
||||
private fun queryOrderRouteList(orderNo: String) {
|
||||
if (mCurrentOCHOrder != null) {
|
||||
queryOrderRoute(
|
||||
(mContext)!!, orderNo,
|
||||
object : OchCommonServiceCallback<QueryOrderRouteResp> {
|
||||
override fun onSuccess(data: QueryOrderRouteResp) {
|
||||
if ((data != null) && (data.data != null) && (mRoutePoints!!.size == 0)) {
|
||||
mRoutePoints.clear()
|
||||
val routePoints = coordinateConverterLatlngToLocation(data.data)
|
||||
mRoutePoints.addAll(routePoints)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onError() {
|
||||
// TODO: 2022/5/18 是否在请求异常的时候提示
|
||||
}
|
||||
|
||||
override fun onFail(code: Int, msg: String) {}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 开始轮询计算剩余里程和时间
|
||||
*
|
||||
* @param isStart
|
||||
*/
|
||||
fun startOrStopCalculateRouteInfo(isStart: Boolean) {
|
||||
private fun startOrStopCalculateRouteInfo(isStart: Boolean) {
|
||||
d(SceneConstant.M_TAXI + TAG, "startOrStopOrderLoop() $isStart")
|
||||
if (isStart) {
|
||||
TaxiModelLoopManager.getInstance().startCalculateRouteInfoLoop()
|
||||
@@ -1080,25 +962,6 @@ object TaxiModel {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 上报订单剩余里程和时间 单位:KM, M, 单位:秒
|
||||
*
|
||||
* @param lastSumLength
|
||||
* @param duration
|
||||
*/
|
||||
fun reportOrderRemain(lastSumLength: Long, duration: Long) { // 米/秒
|
||||
if (mCurrentOCHOrder == null) return
|
||||
reportOrderRemain(
|
||||
(mContext)!!,
|
||||
mCurrentOCHOrder!!.orderNo,
|
||||
lastSumLength,
|
||||
duration,
|
||||
object : OchCommonServiceCallback<BaseData> {
|
||||
override fun onSuccess(data: BaseData) {}
|
||||
override fun onFail(code: Int, msg: String) {}
|
||||
})
|
||||
}
|
||||
|
||||
// 登出
|
||||
fun logout() {
|
||||
loginService!!.loginOut(mLatitude, mLongitude)
|
||||
|
||||
@@ -22,29 +22,6 @@ object TaxiServiceManager {
|
||||
TaxiUnmannedServiceApi::class.java
|
||||
)
|
||||
|
||||
/**
|
||||
* 订单列表获取
|
||||
* @param context
|
||||
* @param page
|
||||
* @param size
|
||||
* @param callback
|
||||
*/
|
||||
@JvmStatic
|
||||
fun queryOrdersList(
|
||||
context: Context, page: Int, size: Int,
|
||||
callback: OchCommonServiceCallback<OrdersListQueryRespBean>?
|
||||
) {
|
||||
mOCHTaxiServiceApi.queryOrdersList(
|
||||
MoGoAiCloudClientConfig.getInstance().serviceAppId,
|
||||
MoGoAiCloudClientConfig.getInstance().token,
|
||||
OrdersListQueryReqBean(
|
||||
MoGoAiCloudClientConfig.getInstance().sn, page, size
|
||||
)
|
||||
)
|
||||
.transformTry()
|
||||
.subscribe(OchCommonSubscribeImpl(context, callback, "queryOrdersList"))
|
||||
}
|
||||
|
||||
/**
|
||||
* 暂停接单
|
||||
* @param context
|
||||
@@ -75,69 +52,4 @@ object TaxiServiceManager {
|
||||
baseDataObservable
|
||||
.subscribe(OchCommonSubscribeImpl(context, callback, "updateDriverServiceStatus"))
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询司机服务数据
|
||||
* @param context
|
||||
* @param callback
|
||||
*/
|
||||
@JvmStatic
|
||||
fun queryDriverServiceData(
|
||||
context: Context,
|
||||
callback: OchCommonServiceCallback<DriverServiceDataRespBean>?
|
||||
) {
|
||||
mOCHTaxiServiceApi.queryServiceData(
|
||||
MoGoAiCloudClientConfig.getInstance().serviceAppId,
|
||||
MoGoAiCloudClientConfig.getInstance().token,
|
||||
MoGoAiCloudClientConfig.getInstance().sn
|
||||
)
|
||||
.transformTry()
|
||||
.subscribe(OchCommonSubscribeImpl(context, callback, "queryDriverServiceData"))
|
||||
}
|
||||
|
||||
/**
|
||||
* 上报剩余里程,时间
|
||||
* @param context
|
||||
* @param orderNo
|
||||
* @param distance
|
||||
* @param duration
|
||||
* @param callback
|
||||
*/
|
||||
@JvmStatic
|
||||
fun reportOrderRemain(
|
||||
context: Context,
|
||||
orderNo: String?,
|
||||
distance: Long,
|
||||
duration: Long,
|
||||
callback: OchCommonServiceCallback<BaseData>?
|
||||
) {
|
||||
mOCHTaxiServiceApi.reportOrderRemain(
|
||||
MoGoAiCloudClientConfig.getInstance().serviceAppId,
|
||||
MoGoAiCloudClientConfig.getInstance().token,
|
||||
UpdateOrderDisAndTimeReqBean(orderNo, distance, duration)
|
||||
)
|
||||
.transformTry()
|
||||
.subscribe(OchCommonSubscribeImpl(context, callback, "reportOrderRemain"))
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询订单全路径
|
||||
* @param context
|
||||
* @param orderNo
|
||||
* @param callback
|
||||
*/
|
||||
@JvmStatic
|
||||
fun queryOrderRoute(
|
||||
context: Context,
|
||||
orderNo: String?,
|
||||
callback: OchCommonServiceCallback<QueryOrderRouteResp>?
|
||||
) {
|
||||
mOCHTaxiServiceApi.queryOrderRoute(
|
||||
MoGoAiCloudClientConfig.getInstance().serviceAppId,
|
||||
MoGoAiCloudClientConfig.getInstance().token,
|
||||
orderNo
|
||||
)
|
||||
.transformTry()
|
||||
.subscribe(OchCommonSubscribeImpl(context, callback, "queryOrderRoute"))
|
||||
}
|
||||
}
|
||||
@@ -21,60 +21,12 @@ import retrofit2.http.Query
|
||||
*/
|
||||
interface TaxiUnmannedServiceApi {
|
||||
|
||||
/**
|
||||
* 订单列表获取
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
@Headers("Content-type:application/json;charset=UTF-8") // @POST( "/autopilot-car-hailing/api/v1/driver/queryOrders" )
|
||||
@POST("/autopilot-car-hailing/order/v2/driver/taxi/queryOrders")
|
||||
fun queryOrdersList(
|
||||
@Header("appId") appId: String?,
|
||||
@Header("ticket") ticket: String?,
|
||||
@Body data: OrdersListQueryReqBean?
|
||||
): Observable<OrdersListQueryRespBean?>?
|
||||
|
||||
/**
|
||||
* 查询司机服务数据
|
||||
* @param sn
|
||||
* @return
|
||||
*/
|
||||
@Headers("Content-type:application/json;charset=UTF-8") // @GET( "/autopilot-car-hailing/api/v1/driver/serviceData/query" )
|
||||
@GET("/autopilot-car-hailing/order/v2/driver/taxi/serviceData/query")
|
||||
fun queryServiceData(
|
||||
@Header("appId") appId: String?, @Header("ticket") ticket: String?, @Query("sn") sn: String?
|
||||
): Observable<DriverServiceDataRespBean?>?
|
||||
|
||||
/**
|
||||
* 上报订单剩余里程和剩余时间
|
||||
* @param appId
|
||||
* @param ticket
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
@Headers("Content-type:application/json;charset=UTF-8")
|
||||
@POST("/autopilot-car-hailing/order/v2/driver/taxi/reportOrderRemain")
|
||||
fun reportOrderRemain(
|
||||
@Header("appId") appId: String?,
|
||||
@Header("ticket") ticket: String?,
|
||||
@Body data: UpdateOrderDisAndTimeReqBean?
|
||||
): Observable<BaseData?>?
|
||||
|
||||
|
||||
@Headers("Content-type:application/json;charset=UTF-8") // @GET( "/autopilot-car-hailing/api/v1/driver/serviceStatus/query" )
|
||||
@GET("/autopilot-car-hailing/order/v2/driver/taxi/orderRoute")
|
||||
fun queryOrderRoute(
|
||||
@Header("appId") appId: String?,
|
||||
@Header("ticket") ticket: String?,
|
||||
@Query("orderNo") orderNo: String?
|
||||
): Observable<QueryOrderRouteResp?>?
|
||||
|
||||
/**
|
||||
* 开始接单
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
@Headers("Content-type:application/json;charset=UTF-8") // @POST( "/autopilot-car-hailing/api/v1/driver/serviceStatus/update" )
|
||||
@Headers("Content-type:application/json;charset=UTF-8")
|
||||
@POST("/autopilot-car-hailing/cab/flow/v1/driver/taxi/stopOrderServing")
|
||||
fun stopOrderServing(
|
||||
@Header("appId") appId: String?,
|
||||
|
||||
@@ -36,9 +36,9 @@ public class TaxiOperationalPresenter extends Presenter<TaxiPersonalDialogFragme
|
||||
}
|
||||
|
||||
// 获取全部订单列表
|
||||
public void queryOrdersList(int page, int size) {
|
||||
TaxiModel.INSTANCE.queryOrdersList(page, size);
|
||||
}
|
||||
// public void queryOrdersList(int page, int size) {
|
||||
// TaxiModel.INSTANCE.queryOrdersList(page, size);
|
||||
// }
|
||||
|
||||
@Override
|
||||
public void onServiceDataUpdate(long dailyTimeDuration, long dailyOrderNum) {
|
||||
|
||||
@@ -44,7 +44,7 @@ class TaxiOperationDatasFragment : BaseTaxiUIFragment() {
|
||||
}
|
||||
|
||||
private fun initDatas() {
|
||||
TaxiModel.queryDriverServiceData()
|
||||
// TaxiModel.queryDriverServiceData()
|
||||
}
|
||||
|
||||
fun setType(type: Int) {
|
||||
|
||||
@@ -37,6 +37,14 @@ 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 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 java.util.Calendar
|
||||
|
||||
@@ -47,19 +55,13 @@ import java.util.Calendar
|
||||
class TaxiPersonalDialogFragment :
|
||||
MvpDialogFragment<TaxiPersonalDialogFragment?, TaxiOperationalPresenter?>(),
|
||||
View.OnClickListener {
|
||||
private var mOperationDataRl: RelativeLayout? = null
|
||||
private var mCloseIv: ImageView? = null
|
||||
private var mOrdersRv: RecyclerView? = null
|
||||
private var mShowOrdersBt: Button? = null
|
||||
private var mOperationTab: TabLayout? = null
|
||||
private var mOperationViewPager: ViewPager? = null
|
||||
private var mAdapter: OrderAdapter? = null
|
||||
private var mNoDatas: ConstraintLayout? = null
|
||||
private val orders: MutableList<OrderQueryRespBean.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(
|
||||
requireContext()
|
||||
@@ -112,46 +114,38 @@ class TaxiPersonalDialogFragment :
|
||||
|
||||
private fun initView() {
|
||||
initOperationTabDatas()
|
||||
mCloseIv = findViewById<ImageView>(R.id.module_och_taxi_order_list_close_iv)
|
||||
mOperationDataRl = findViewById<RelativeLayout>(R.id.module_och_taxi_operation_data_rl)
|
||||
mShowOrdersBt = findViewById<Button>(R.id.module_och_taxi_order_list_show_bt)
|
||||
mOrdersRv = findViewById<RecyclerView>(R.id.module_och_taxi_order_list)
|
||||
mNoDatas = findViewById<ConstraintLayout>(R.id.no_order_data_view)
|
||||
val imageView = findViewById<ImageView>(R.id.no_order_data_iv)
|
||||
imageView!!.setImageResource(R.drawable.no_order_data)
|
||||
val params = imageView.layoutParams as ConstraintLayout.LayoutParams
|
||||
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
|
||||
imageView.layoutParams = params
|
||||
mOrdersRv!!.visibility = View.GONE
|
||||
mNoDatas!!.visibility = View.GONE
|
||||
mShowOrdersBt!!.setOnClickListener(this)
|
||||
mCloseIv!!.setOnClickListener(this)
|
||||
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() {
|
||||
mOperationTab = findViewById<TabLayout>(R.id.operation_data_tablayout)
|
||||
mOperationViewPager = findViewById<ViewPager>(R.id.operation_data_viewpager)
|
||||
for (i in mTabTitles.indices) {
|
||||
val tab = mOperationTab!!.newTab()
|
||||
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) {
|
||||
mOperationTab!!.addTab(tab, true)
|
||||
operation_data_tablayout.addTab(tab, true)
|
||||
changeOperationTabLayoutTabUI(tab, true)
|
||||
fragments.add(TaxiOperationDatasFragment.newInstance(activity, 0))
|
||||
} else if (1 == i) {
|
||||
mOperationTab!!.addTab(tab)
|
||||
operation_data_tablayout.addTab(tab)
|
||||
changeOperationTabLayoutTabUI(tab, false)
|
||||
fragments.add(TaxiOperationDatasFragment.newInstance(activity, 1))
|
||||
}
|
||||
}
|
||||
mOperationTab!!.addOnTabSelectedListener(object : TabLayout.OnTabSelectedListener {
|
||||
operation_data_tablayout.addOnTabSelectedListener(object : TabLayout.OnTabSelectedListener {
|
||||
override fun onTabSelected(tab: TabLayout.Tab) {
|
||||
mOperationViewPager!!.currentItem = tab.position
|
||||
operation_data_viewpager.currentItem = tab.position
|
||||
changeOperationTabLayoutTabUI(tab, true)
|
||||
fragments[tab.position].setType(tab.position)
|
||||
}
|
||||
@@ -162,7 +156,7 @@ class TaxiPersonalDialogFragment :
|
||||
|
||||
override fun onTabReselected(tab: TabLayout.Tab) {}
|
||||
})
|
||||
mOperationViewPager!!.addOnPageChangeListener(object : OnPageChangeListener {
|
||||
operation_data_viewpager.addOnPageChangeListener(object : OnPageChangeListener {
|
||||
override fun onPageScrolled(
|
||||
position: Int,
|
||||
positionOffset: Float,
|
||||
@@ -171,12 +165,12 @@ class TaxiPersonalDialogFragment :
|
||||
}
|
||||
|
||||
override fun onPageSelected(position: Int) {
|
||||
mOperationTab!!.getTabAt(position)!!.select()
|
||||
operation_data_tablayout.getTabAt(position)!!.select()
|
||||
}
|
||||
|
||||
override fun onPageScrollStateChanged(state: Int) {}
|
||||
})
|
||||
mOperationViewPager!!.adapter = OrdersOperationFragmentAdapter(
|
||||
operation_data_viewpager.adapter = OrdersOperationFragmentAdapter(
|
||||
childFragmentManager, FragmentPagerAdapter.BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT
|
||||
)
|
||||
fragments[0].setType(0)
|
||||
@@ -216,11 +210,11 @@ class TaxiPersonalDialogFragment :
|
||||
if (v.id == R.id.module_och_taxi_order_list_close_iv) {
|
||||
dismiss()
|
||||
} else {
|
||||
mOrdersRv!!.visibility = View.VISIBLE
|
||||
mOperationDataRl!!.visibility = View.GONE
|
||||
mNoDatas!!.visibility = View.GONE
|
||||
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)
|
||||
// mPresenter!!.queryOrdersList(mNextPage, mPerPageSize)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -230,15 +224,15 @@ class TaxiPersonalDialogFragment :
|
||||
val manager = LinearLayoutManager(
|
||||
context
|
||||
)
|
||||
mOrdersRv!!.layoutManager = manager
|
||||
mOrdersRv!!.addOnScrollListener(object : OnTaxiOrderRvOnScrollListener() {
|
||||
module_och_taxi_order_list.layoutManager = manager
|
||||
module_och_taxi_order_list.addOnScrollListener(object : OnTaxiOrderRvOnScrollListener() {
|
||||
override fun onLoadMore() {
|
||||
if (!serverHadNoData) {
|
||||
mPresenter!!.queryOrdersList(mNextPage, mPerPageSize)
|
||||
// mPresenter!!.queryOrdersList(mNextPage, mPerPageSize)
|
||||
}
|
||||
}
|
||||
})
|
||||
mOrdersRv!!.adapter = mAdapter
|
||||
module_och_taxi_order_list.adapter = mAdapter
|
||||
}
|
||||
}
|
||||
|
||||
@@ -246,12 +240,12 @@ class TaxiPersonalDialogFragment :
|
||||
fun onOrdersListPageRefresh(ordersList: List<OrderQueryRespBean.Result>) {
|
||||
try {
|
||||
if (mNextPage == 0 || ordersList.isEmpty()) { //无数据
|
||||
mOrdersRv!!.visibility = View.GONE
|
||||
mNoDatas!!.visibility = View.VISIBLE
|
||||
module_och_taxi_order_list.visibility = View.GONE
|
||||
no_order_data_view.visibility = View.VISIBLE
|
||||
return
|
||||
}
|
||||
mOrdersRv!!.visibility = View.VISIBLE
|
||||
mNoDatas!!.visibility = View.GONE
|
||||
module_och_taxi_order_list.visibility = View.VISIBLE
|
||||
no_order_data_view.visibility = View.GONE
|
||||
if ((ordersList.size < mPerPageSize) && mNextPage > 0) { //已经没有更多数据,提示无数据
|
||||
//已经没有更多数据
|
||||
serverHadNoData = true
|
||||
|
||||
Reference in New Issue
Block a user