网约车 增加部分订单状态转换时 tts播报
This commit is contained in:
@@ -4,21 +4,17 @@ import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.location.Location;
|
||||
import android.net.ConnectivityManager;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
|
||||
import com.mogo.cloud.commons.utils.CoordinateUtils;
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig;
|
||||
import com.mogo.commons.data.BaseData;
|
||||
import com.mogo.commons.network.SubscribeImpl;
|
||||
import com.mogo.map.MogoLatLng;
|
||||
import com.mogo.map.location.MogoLocation;
|
||||
import com.mogo.map.navi.IMogoCarLocationChangedListener2;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.module.common.constants.HostConst;
|
||||
import com.mogo.och.taxi.ui.OCHTaxiUiController;
|
||||
import com.mogo.service.adas.IMogoAdasOCHCallback;
|
||||
import com.mogo.service.adas.IMogoAdasRouteCallBack;
|
||||
import com.mogo.service.adas.RemoteControlAutoPilotParameters;
|
||||
import com.mogo.service.adas.entity.AdasOCHData;
|
||||
import com.mogo.service.connection.IMogoOnMessageListener;
|
||||
@@ -248,7 +244,7 @@ class MogoOCHTaxiModel {
|
||||
OCHOrderStatus status = OCHOrderStatus.valueOf( data.data.orderDispatchType );
|
||||
OCHTaxiUiController.getInstance().onOrderStatusChanged(data.data.orderDispatchType);
|
||||
switch ( status ) {
|
||||
case Completed:
|
||||
case JourneyCompleted:
|
||||
TipToast.shortTip( mContext.getString( R.string.module_och_taxi_order_completed ) );
|
||||
clearCurrentOCHOrder();
|
||||
// OCHTaxiUiController.getInstance().removeFragment();
|
||||
@@ -259,6 +255,7 @@ class MogoOCHTaxiModel {
|
||||
// OCHTaxiUiController.getInstance().removeFragment();
|
||||
break;
|
||||
case ArriveAtEndStation:
|
||||
case UserState:
|
||||
mIsArriveAtEndStation = true;
|
||||
mIsArriveAtStartStation = false;
|
||||
mIsOnTheWay2EndStation = false;
|
||||
@@ -481,6 +478,7 @@ class MogoOCHTaxiModel {
|
||||
updateOCHOrderStatus( OCHOrderStatus.ArriveAtStartStation, new OCHOrderStatusCallback() {
|
||||
@Override
|
||||
public void onSuccess( Object data ) {
|
||||
OCHTaxiUiController.getInstance().onOrderStatusChanged(OCHOrderStatus.ArriveAtStartStation.getCode());
|
||||
Logger.d( TAG, "更新状态成功" );
|
||||
}
|
||||
|
||||
@@ -497,7 +495,7 @@ class MogoOCHTaxiModel {
|
||||
} );
|
||||
return;
|
||||
}
|
||||
Logger.d( TAG, "distance = %s", distance );
|
||||
// Logger.d( TAG, "distance = %s", distance );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -633,6 +631,7 @@ class MogoOCHTaxiModel {
|
||||
if (mOCHRHCarstatus != 1){
|
||||
return;
|
||||
}
|
||||
|
||||
Logger.d(TAG, "订单状态被改变:" + GsonUtil.jsonFromObject(obj));
|
||||
OCHOrderStatus status = OCHOrderStatus.valueOf( obj.orderDispatchType );
|
||||
switch ( status ) {
|
||||
|
||||
@@ -22,8 +22,9 @@ enum OCHOrderStatus {
|
||||
UserArriveAtStartStation( 3 ),
|
||||
OnTheWayToEndStation( 4 ),
|
||||
ArriveAtEndStation( 5 ),
|
||||
Completed( 6 ),//行程完成
|
||||
Cancel( 7 );
|
||||
UserState( 6 ),//小程序用的状态 车机不处理
|
||||
Cancel( 7 ),
|
||||
JourneyCompleted(8);//行程完成
|
||||
|
||||
private int code;
|
||||
|
||||
|
||||
@@ -8,9 +8,6 @@ import android.widget.TextView;
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.mogo.cloud.commons.utils.CoordinateUtils;
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig;
|
||||
import com.mogo.commons.network.SubscribeImpl;
|
||||
import com.mogo.commons.voice.AIAssist;
|
||||
import com.mogo.map.MogoLatLng;
|
||||
import com.mogo.map.location.MogoLocation;
|
||||
import com.mogo.map.navi.IMogoCarLocationChangedListener2;
|
||||
@@ -30,23 +27,13 @@ import com.mogo.och.view.SlidePanelView;
|
||||
import com.mogo.service.adas.IMogoAdasOCHCallback;
|
||||
import com.mogo.service.adas.IMogoAdasRouteCallBack;
|
||||
import com.mogo.service.adas.entity.AdasOCHData;
|
||||
import com.mogo.service.adas.IMogoAdasRouteCallBack;
|
||||
import com.mogo.service.statusmanager.IMogoStatusChangedListener;
|
||||
import com.mogo.service.statusmanager.StatusDescriptor;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
import com.mogo.utils.network.RequestOptions;
|
||||
import com.mogo.utils.network.utils.GsonUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.schedulers.Schedulers;
|
||||
import okhttp3.MediaType;
|
||||
import okhttp3.RequestBody;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public
|
||||
/**
|
||||
* @author congtaowang
|
||||
@@ -80,6 +67,7 @@ class OCHTaxiFragment extends BaseOchFragment< OCHTaxiView, OCHTaxiPresenter > i
|
||||
private TextView mDistance;
|
||||
|
||||
private MogoPolylineOptions mogoPolylineOptions;
|
||||
private int saveOrderState = -1;
|
||||
@Override
|
||||
public int getStationPanelViewId() {
|
||||
return R.layout.module_och_taxi_panel;
|
||||
@@ -181,7 +169,6 @@ class OCHTaxiFragment extends BaseOchFragment< OCHTaxiView, OCHTaxiPresenter > i
|
||||
slidePanelView.setVisibility( View.VISIBLE );
|
||||
slidePanelView.setText( getString( R.string.module_och_taxi_arrive_at_end_station ) );
|
||||
mOrderStatus.setText( R.string.module_och_taxi_arrive_at_end_station2 );
|
||||
SpeakNoticeOnce();
|
||||
} else if ( MogoOCHTaxiModel.getInstance().isOnTheWay2EndStation() ) {
|
||||
Logger.d( TAG, "已经去往终点" );
|
||||
slidePanelView.setVisibility( View.GONE );
|
||||
@@ -245,6 +232,7 @@ class OCHTaxiFragment extends BaseOchFragment< OCHTaxiView, OCHTaxiPresenter > i
|
||||
@Override
|
||||
public void onSuccess( Object data ) {
|
||||
Logger.d( TAG, "更新状态成功" );
|
||||
onOrderStatusChanged(OCHOrderStatus.ArriveAtEndStation.getCode());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -302,7 +290,7 @@ class OCHTaxiFragment extends BaseOchFragment< OCHTaxiView, OCHTaxiPresenter > i
|
||||
private void onSlidePanelMoveToEnd() {
|
||||
// 已到达终点,需要结束订单
|
||||
if ( MogoOCHTaxiModel.getInstance().isArriveAtEndStation() ) {
|
||||
MogoOCHTaxiModel.getInstance().updateOCHOrderStatus( OCHOrderStatus.Completed, new OCHOrderStatusCallback() {
|
||||
MogoOCHTaxiModel.getInstance().updateOCHOrderStatus( OCHOrderStatus.JourneyCompleted, new OCHOrderStatusCallback() {
|
||||
@Override
|
||||
public void onSuccess( Object data ) {
|
||||
Logger.d( TAG, "更新状态成功" );
|
||||
@@ -324,7 +312,6 @@ class OCHTaxiFragment extends BaseOchFragment< OCHTaxiView, OCHTaxiPresenter > i
|
||||
return;
|
||||
// 乘客已确认到达起点,前往下一站并开启自动驾驶
|
||||
} else if ( !MogoOCHTaxiModel.getInstance().isOnTheWay2EndStation() ) {
|
||||
// MogoOCHTaxiModel.getInstance().isUserArriveAtStartStation() &&
|
||||
MogoOCHTaxiModel.getInstance().startAutoPilot();
|
||||
}
|
||||
}
|
||||
@@ -349,6 +336,7 @@ class OCHTaxiFragment extends BaseOchFragment< OCHTaxiView, OCHTaxiPresenter > i
|
||||
@Override
|
||||
public void onSuccess( Object data ) {
|
||||
Logger.d( TAG, "更新状态成功" );
|
||||
onOrderStatusChanged(OCHOrderStatus.OnTheWayToEndStation.getCode());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -445,8 +433,13 @@ class OCHTaxiFragment extends BaseOchFragment< OCHTaxiView, OCHTaxiPresenter > i
|
||||
|
||||
@Override
|
||||
public void onOrderStatusChanged(int status) {
|
||||
|
||||
// int orderState = MogoOCHTaxiModel.getInstance().getCurrentOCHOrder().orderDispatchType;
|
||||
// if (orderState == status){
|
||||
// return;
|
||||
// }
|
||||
getActivity().runOnUiThread(() -> {
|
||||
if (status == OCHOrderStatus.None.getCode() || status == OCHOrderStatus.Cancel.getCode() || status == OCHOrderStatus.Completed.getCode() ){
|
||||
if (status == OCHOrderStatus.None.getCode() || status == OCHOrderStatus.Cancel.getCode() || status == OCHOrderStatus.JourneyCompleted.getCode() ){
|
||||
getPanelView().setVisibility(View.INVISIBLE);
|
||||
hideSlidePanel();
|
||||
changeOperationViewVisible(View.VISIBLE);
|
||||
@@ -455,9 +448,31 @@ class OCHTaxiFragment extends BaseOchFragment< OCHTaxiView, OCHTaxiPresenter > i
|
||||
getPanelView().setVisibility(View.VISIBLE);
|
||||
changeOperationViewVisible(View.INVISIBLE);
|
||||
}
|
||||
if (status == OCHOrderStatus.OnTheWayToStartStation.getCode()){
|
||||
showNotice("收到新订单");
|
||||
|
||||
if(status != saveOrderState){
|
||||
OCHOrderStatus ochStatus = OCHOrderStatus.valueOf( status );
|
||||
switch (ochStatus){
|
||||
case OnTheWayToStartStation:
|
||||
showNotice(getString( R.string.module_och_taxi_new_order));
|
||||
break;
|
||||
case Cancel:
|
||||
showNotice(getString( R.string.module_och_taxi_order_cancel));
|
||||
break;
|
||||
case ArriveAtStartStation:
|
||||
showNotice( getString( R.string.module_och_taxi_order_status_ph_text) );
|
||||
break;
|
||||
case OnTheWayToEndStation:
|
||||
// showNotice("欢迎使用蘑菇智行");
|
||||
break;
|
||||
case ArriveAtEndStation:
|
||||
showNotice( getString( R.string.module_och_taxi_order_complete_1) );
|
||||
break;
|
||||
case JourneyCompleted:
|
||||
showNotice( "感谢您使用蘑菇智行,再见~" );
|
||||
break;
|
||||
}
|
||||
}
|
||||
saveOrderState = status;
|
||||
updateOrderStatus();
|
||||
});
|
||||
}
|
||||
@@ -488,7 +503,7 @@ class OCHTaxiFragment extends BaseOchFragment< OCHTaxiView, OCHTaxiPresenter > i
|
||||
MogoLatLng routeLatLng;
|
||||
for (int i = 0 ; i< routeList.size() ; i++) {
|
||||
routeLatLng =routeList.get(i);
|
||||
//需要剔除已经行驶过的经纬度,这里需要比对推荐路线集合中的点是否在当前车辆行驶方向前面如果不在则抛弃
|
||||
//需要剔除已经行驶过的经纬度,这里需要比对推荐路线集合中点是否在当前车w辆行驶方向前面如果不在则抛弃
|
||||
if (LocationUtils.isPointOnCarFront(carLocation, routeLatLng)) {
|
||||
mPolylinePointList.add(routeLatLng);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user