[Taxi-d 280 Taxi-p 130] opt
@@ -791,7 +791,9 @@ public class TaxiPassengerModel implements IOCHTaxiPassengerNaviChangedCallback
|
||||
@Override
|
||||
public void onSuccess(TaxiPassengerBaseRespBean data) {
|
||||
updateAutopilotStatus(data.code == 0);
|
||||
startOrStopReadyToAutopilotoop(false);
|
||||
if (data != null && data.code == 0) {
|
||||
startOrStopReadyToAutopilotoop(false);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -143,7 +143,10 @@ public class BaseTaxiPassengerPresenter extends Presenter<TaxiPassengerBaseFragm
|
||||
|
||||
@Override
|
||||
public void onDriverHasCheckedPilotCondition(boolean isBoarded) {
|
||||
mView.showOrHideStartAutopilotView(true,true);
|
||||
if (isBoarded){
|
||||
mView.showOrHideServingOrderFragment(true);
|
||||
}
|
||||
mView.showOrHideStartAutopilotView(true,isBoarded);
|
||||
}
|
||||
|
||||
private void updateOrderView(TaxiPassengerOrderQueryRespBean.Result order) {
|
||||
@@ -175,9 +178,9 @@ public class BaseTaxiPassengerPresenter extends Presenter<TaxiPassengerBaseFragm
|
||||
// TODO: 2022/6/10 若司机端已经确认,则显示开始行程按钮 并且可点击,第二步的轮询停止
|
||||
//TODO: 2022/6/10 若订单取消或者隐藏则关掉开始行程界面,轮询也要取消
|
||||
if (TaxiPassengerOrderStatusEnum.UserArriveAtStart.getCode() == order.orderStatus){
|
||||
//开启轮询司机是否已准备好开启自动驾驶的环境
|
||||
TaxiPassengerModel.getInstance().startDriverReadyToAutopilotLoop();
|
||||
runOnUIThread(() ->{
|
||||
//开启轮询司机是否已准备好开启自动驾驶的环境
|
||||
TaxiPassengerModel.getInstance().startDriverReadyToAutopilotLoop();
|
||||
mView.showOrHideStartAutopilotView(true,false);
|
||||
});
|
||||
}
|
||||
@@ -195,7 +198,6 @@ public class BaseTaxiPassengerPresenter extends Presenter<TaxiPassengerBaseFragm
|
||||
mView.showOrHideArrivedEndLayout(false,"","");
|
||||
mView.showOrHidePressengerCheckPager(false, "",
|
||||
"", "", "", "");
|
||||
mView.showOrHideServingOrderFragment(true);
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ import android.widget.TextView;
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
|
||||
import com.mogo.och.taxi.passenger.R;
|
||||
import com.mogo.och.taxi.passenger.callback.ITPClickStartAutopilotCallback;
|
||||
import com.mogo.och.taxi.passenger.model.TaxiPassengerModel;
|
||||
|
||||
/**
|
||||
* @author: wangmingjun
|
||||
@@ -21,23 +22,38 @@ import com.mogo.och.taxi.passenger.callback.ITPClickStartAutopilotCallback;
|
||||
public class TaxiPassengerStartAutopilotView extends RelativeLayout implements View.OnClickListener {
|
||||
|
||||
private TextView mStartAutopilotBtn;
|
||||
private ImageView mAutopilotImage;
|
||||
private ImageView mAutopilotStartingImage;
|
||||
private ITPClickStartAutopilotCallback mClickCallback;
|
||||
public boolean isStarting = false;
|
||||
private ObjectAnimator autopilotLoadingAnimator;
|
||||
private AnimationDrawable animationDrawable;
|
||||
private AnimationDrawable mAnimationBtnDrawable;
|
||||
private AnimationDrawable mAnimationStartingDrawable;
|
||||
private static final long TIMER_START_AUTOPILOT_INTERVAL = 10 * 1000L;
|
||||
private Context mContext;
|
||||
|
||||
public TaxiPassengerStartAutopilotView(Context context) {
|
||||
super(context);
|
||||
mContext = context;
|
||||
initView(context);
|
||||
}
|
||||
|
||||
private void initView(Context context) {
|
||||
View view = LayoutInflater.from(context).inflate(R.layout.taxi_p_start_autopilot_view, this,true);
|
||||
mStartAutopilotBtn = view.findViewById(R.id.taxi_p_start_autopilot);
|
||||
mAutopilotImage = view.findViewById(R.id.taxi_p_autopilot_iv);
|
||||
mAutopilotStartingImage = view.findViewById(R.id.taxi_p_autopilot_starting);
|
||||
mStartAutopilotBtn.setOnClickListener(this);
|
||||
|
||||
//debug 调试使用,长按光圈,调用乘客开启自动驾驶
|
||||
mAutopilotStartingImage.setOnLongClickListener(new OnLongClickListener() {
|
||||
@Override
|
||||
public boolean onLongClick(View v) {
|
||||
//开启动画和自动驾驶
|
||||
if (!isStarting){
|
||||
startOrStopLoadingAnim(true);
|
||||
TaxiPassengerModel.getInstance().startAutopilot();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void setOnClickStartAutopilotBtnCallback(ITPClickStartAutopilotCallback clickCallback){
|
||||
@@ -58,60 +74,67 @@ public class TaxiPassengerStartAutopilotView extends RelativeLayout implements V
|
||||
public void updateStartAutopilotBtnStatus(boolean isClickable){
|
||||
if (mStartAutopilotBtn == null) return;
|
||||
mStartAutopilotBtn.setClickable(isClickable);
|
||||
mAutopilotImage.setVisibility(GONE);
|
||||
mStartAutopilotBtn.setText(getResources().getString(R.string.taxi_p_start_autopilot_txt));
|
||||
mStartAutopilotBtn.setText(mContext.getResources().getString(R.string.taxi_p_start_autopilot_txt));
|
||||
if (isClickable){ //可点击状态下UI
|
||||
mStartAutopilotBtn.setTextColor(mContext.getResources().getColor(R.color.taxi_p_start_autopilot_txt_color));
|
||||
startAutopilotBgAnimatorDrawable(true);
|
||||
}else {// 不可点击状态下 UI
|
||||
mStartAutopilotBtn.setTextColor(mContext.getResources().getColor(R.color.taxi_p_start_autopilot_txt_un_color));
|
||||
startAutopilotBgAnimatorDrawable(false);
|
||||
}
|
||||
}
|
||||
|
||||
public void startAutopilotBgAnimatorDrawable(boolean isStart){
|
||||
if (isStart){
|
||||
if (animationDrawable == null) {
|
||||
if (mAnimationBtnDrawable == null) {
|
||||
mStartAutopilotBtn.setBackground(getResources().getDrawable(R.drawable.anmi_flow));
|
||||
animationDrawable = (AnimationDrawable) mStartAutopilotBtn.getBackground();
|
||||
mAnimationBtnDrawable = (AnimationDrawable) mStartAutopilotBtn.getBackground();
|
||||
}
|
||||
if (animationDrawable.isRunning()) {
|
||||
if (mAnimationBtnDrawable.isRunning()) {
|
||||
return;
|
||||
}
|
||||
animationDrawable.selectDrawable(0);
|
||||
animationDrawable.start();
|
||||
mAnimationBtnDrawable.selectDrawable(0);
|
||||
mAnimationBtnDrawable.start();
|
||||
}else {
|
||||
if (animationDrawable != null) {
|
||||
animationDrawable.selectDrawable(0);
|
||||
animationDrawable.stop();
|
||||
if (mAnimationBtnDrawable != null) {
|
||||
mAnimationBtnDrawable.selectDrawable(0);
|
||||
mAnimationBtnDrawable.stop();
|
||||
}
|
||||
// mStartAutopilotBtn.setBackground(getResources().getDrawable();
|
||||
animationDrawable = null;
|
||||
mAnimationBtnDrawable = null;
|
||||
}
|
||||
}
|
||||
|
||||
private void startingAutopilotAnimatorDrawable(boolean isStart){
|
||||
if (isStart){
|
||||
if (mAnimationStartingDrawable == null) {
|
||||
mAutopilotStartingImage.setBackground(getResources().getDrawable(R.drawable.starting_anmi_flow));
|
||||
mAnimationStartingDrawable = (AnimationDrawable) mAutopilotStartingImage.getBackground();
|
||||
}
|
||||
if (mAnimationStartingDrawable.isRunning()) {
|
||||
return;
|
||||
}
|
||||
mAnimationStartingDrawable.selectDrawable(0);
|
||||
mAnimationStartingDrawable.start();
|
||||
}else {
|
||||
if (mAnimationStartingDrawable != null) {
|
||||
mAnimationStartingDrawable.selectDrawable(0);
|
||||
mAnimationStartingDrawable.stop();
|
||||
}
|
||||
mAnimationStartingDrawable = null;
|
||||
}
|
||||
}
|
||||
|
||||
public void startOrStopLoadingAnim(boolean start) {
|
||||
startingAutopilotAnimatorDrawable(start);
|
||||
if (start) {
|
||||
isStarting = true;
|
||||
mAutopilotImage.setVisibility(VISIBLE);
|
||||
|
||||
mStartAutopilotBtn.setText(getResources().getString(R.string.taxi_p_start_autopilot_loading));
|
||||
mStartAutopilotBtn.setTextColor(getResources().getColor(R.color.taxi_autopilot_text_color_normal));
|
||||
if (autopilotLoadingAnimator == null) {
|
||||
autopilotLoadingAnimator = ObjectAnimator.ofFloat(mAutopilotImage,
|
||||
"rotation", 0f, 360f);
|
||||
}
|
||||
autopilotLoadingAnimator.setInterpolator(new LinearInterpolator());
|
||||
autopilotLoadingAnimator.setRepeatCount(-1);//无限循环
|
||||
autopilotLoadingAnimator.setStartDelay(100);
|
||||
autopilotLoadingAnimator.setDuration(1000);//设置持续时间
|
||||
autopilotLoadingAnimator.start();//动画开始
|
||||
|
||||
startingAutopilotCountDown();
|
||||
} else {
|
||||
isStarting = false;
|
||||
mAutopilotImage.setVisibility(GONE);
|
||||
if (autopilotLoadingAnimator != null) {
|
||||
autopilotLoadingAnimator.end();
|
||||
mAutopilotImage.clearAnimation();
|
||||
autopilotLoadingAnimator = null;
|
||||
}
|
||||
updateStartAutopilotBtnStatus(true);
|
||||
}
|
||||
}
|
||||
|
||||
|
After Width: | Height: | Size: 930 KiB |
|
After Width: | Height: | Size: 930 KiB |
BIN
OCH/mogo-och-taxi-passenger/src/main/res/drawable/light_00000.png
Executable file
|
After Width: | Height: | Size: 28 KiB |
BIN
OCH/mogo-och-taxi-passenger/src/main/res/drawable/light_00001.png
Executable file
|
After Width: | Height: | Size: 31 KiB |
BIN
OCH/mogo-och-taxi-passenger/src/main/res/drawable/light_00002.png
Executable file
|
After Width: | Height: | Size: 34 KiB |
BIN
OCH/mogo-och-taxi-passenger/src/main/res/drawable/light_00003.png
Executable file
|
After Width: | Height: | Size: 37 KiB |
BIN
OCH/mogo-och-taxi-passenger/src/main/res/drawable/light_00004.png
Executable file
|
After Width: | Height: | Size: 39 KiB |
BIN
OCH/mogo-och-taxi-passenger/src/main/res/drawable/light_00005.png
Executable file
|
After Width: | Height: | Size: 38 KiB |
BIN
OCH/mogo-och-taxi-passenger/src/main/res/drawable/light_00006.png
Executable file
|
After Width: | Height: | Size: 39 KiB |
BIN
OCH/mogo-och-taxi-passenger/src/main/res/drawable/light_00007.png
Executable file
|
After Width: | Height: | Size: 39 KiB |
BIN
OCH/mogo-och-taxi-passenger/src/main/res/drawable/light_00008.png
Executable file
|
After Width: | Height: | Size: 38 KiB |
BIN
OCH/mogo-och-taxi-passenger/src/main/res/drawable/light_00009.png
Executable file
|
After Width: | Height: | Size: 37 KiB |
BIN
OCH/mogo-och-taxi-passenger/src/main/res/drawable/light_00010.png
Executable file
|
After Width: | Height: | Size: 38 KiB |
BIN
OCH/mogo-och-taxi-passenger/src/main/res/drawable/light_00011.png
Executable file
|
After Width: | Height: | Size: 35 KiB |
BIN
OCH/mogo-och-taxi-passenger/src/main/res/drawable/light_00012.png
Executable file
|
After Width: | Height: | Size: 35 KiB |
BIN
OCH/mogo-och-taxi-passenger/src/main/res/drawable/light_00013.png
Executable file
|
After Width: | Height: | Size: 31 KiB |
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<animation-list xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:oneshot="false">
|
||||
<item android:drawable="@drawable/light_00000" android:duration="100"></item>
|
||||
<item android:drawable="@drawable/light_00001" android:duration="100"></item>
|
||||
<item android:drawable="@drawable/light_00002" android:duration="100"></item>
|
||||
<item android:drawable="@drawable/light_00003" android:duration="100"></item>
|
||||
<item android:drawable="@drawable/light_00004" android:duration="100"></item>
|
||||
<item android:drawable="@drawable/light_00005" android:duration="100"></item>
|
||||
<item android:drawable="@drawable/light_00006" android:duration="100"></item>
|
||||
<item android:drawable="@drawable/light_00007" android:duration="100"></item>
|
||||
<item android:drawable="@drawable/light_00008" android:duration="100"></item>
|
||||
<item android:drawable="@drawable/light_00009" android:duration="100"></item>
|
||||
<item android:drawable="@drawable/light_00010" android:duration="100"></item>
|
||||
<item android:drawable="@drawable/light_00011" android:duration="100"></item>
|
||||
<item android:drawable="@drawable/light_00012" android:duration="100"></item>
|
||||
<item android:drawable="@drawable/light_00013" android:duration="100"></item>
|
||||
</animation-list>
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:tools="http://schemas.android.com/tools" xmlns:android="http://schemas.android.com/apk/res/android" tools:ignore="MissingDefaultResource">
|
||||
<item android:drawable="@drawable/starting_anmi_flow" android:state_checkable="true"/>
|
||||
<item android:drawable="@drawable/taxi_p_start_autopilot_txt_btn_bg"/>
|
||||
</selector>
|
||||
@@ -1,11 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<corners android:radius="80px"/>
|
||||
<corners android:radius="76px"/>
|
||||
<gradient
|
||||
android:angle="180"
|
||||
android:type="linear"
|
||||
android:startColor="#E61980FF"
|
||||
android:endColor="#E65D8BFF" />
|
||||
android:startColor="#E639699F"
|
||||
android:endColor="#395EC5" />
|
||||
|
||||
</shape>
|
||||
|
||||
@@ -5,23 +5,16 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:ignore="MissingDefaultResource"
|
||||
android:background="@drawable/taxi_p_passenger_check_panel_bg">
|
||||
|
||||
<!-- <com.mogo.och.common.module.wigets.OCHBorderShadowLayout-->
|
||||
<!-- android:id="@+id/taxi_p_start_autopilot_shadow"-->
|
||||
<!-- android:layout_width="wrap_content"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- app:bgColor="@color/taxi_p_map_bg"-->
|
||||
<!-- app:blurRadius="@dimen/dp_80"-->
|
||||
<!-- app:shadowColor="@color/taxi_p_start_autopilot_bg_shadow"-->
|
||||
<!-- app:shadowRadius="@dimen/dp_80"-->
|
||||
<!-- app:shadow_position="outer"-->
|
||||
<!-- app:xOffset="0px"-->
|
||||
<!-- app:yOffset="0px"-->
|
||||
<!-- android:layout_marginBottom="@dimen/dp_120"-->
|
||||
<!-- app:layout_constraintLeft_toLeftOf="parent"-->
|
||||
<!-- app:layout_constraintRight_toRightOf="parent"-->
|
||||
<!-- app:layout_constraintBottom_toBottomOf="parent">-->
|
||||
android:background="@drawable/taxi_p_passenger_start_panel_bg">
|
||||
<ImageView
|
||||
android:id="@+id/taxi_p_autopilot_starting"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:background="@drawable/starting_anmi_flow"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
/>
|
||||
<TextView
|
||||
android:id="@+id/taxi_p_start_autopilot"
|
||||
android:layout_width="@dimen/taxi_p_start_autopilot_btn_width"
|
||||
@@ -32,19 +25,9 @@
|
||||
android:textStyle="bold"
|
||||
android:textColor="@android:color/white"
|
||||
android:elevation="5dp"
|
||||
android:clickable="false"
|
||||
android:background="@drawable/taxi_p_autopilot_btn_bg_selector"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"/>
|
||||
<ImageView
|
||||
android:id="@+id/taxi_p_autopilot_iv"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="@dimen/dp_220"
|
||||
android:layout_marginLeft="@dimen/dp_340"
|
||||
android:src="@drawable/taxi_p_ic_autopilot_loading"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/taxi_p_start_autopilot"
|
||||
app:layout_constraintTop_toTopOf="@+id/taxi_p_start_autopilot"/>
|
||||
<!-- </com.mogo.och.common.module.wigets.OCHBorderShadowLayout>-->
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -50,6 +50,8 @@
|
||||
<color name="taxi_p_check_keyboard_samll_mogo_color">#151937</color>
|
||||
|
||||
<color name="taxi_p_start_autopilot_bg_shadow">#80141D45</color>
|
||||
<color name="taxi_p_start_autopilot_txt_un_color">#4DFFFFFF</color>
|
||||
<color name="taxi_p_start_autopilot_txt_color">#FFFFFF</color>
|
||||
|
||||
|
||||
</resources>
|
||||
@@ -33,5 +33,5 @@
|
||||
<string name="tv_delete">删除</string>
|
||||
|
||||
<string name="taxi_p_start_autopilot_txt">点击开始</string>
|
||||
<string name="taxi_p_start_autopilot_loading">启动中</string>
|
||||
<string name="taxi_p_start_autopilot_loading">启动中...</string>
|
||||
</resources>
|
||||
@@ -435,39 +435,6 @@ public class TaxiModel {
|
||||
});
|
||||
}
|
||||
|
||||
//更新当前订单状态
|
||||
public void updateOCHOrderStatus(final TaxiOrderStatusEnum orderStatus) {
|
||||
if (mCurrentOCHOrder == null) {
|
||||
return;
|
||||
}
|
||||
final String orderNo = mCurrentOCHOrder.orderNo;
|
||||
TaxiServiceManager.getInstance().updateOrderStatus(mContext, orderNo,
|
||||
orderStatus.getCode(), new TaxiServiceCallback<BaseData>() {
|
||||
@Override
|
||||
public void onSuccess(BaseData data) {
|
||||
if (null != data && 0 == data.code
|
||||
&& mCurrentOCHOrder != null && mCurrentOCHOrder.orderNo.equals(orderNo)) {
|
||||
mCurrentOCHOrder.orderStatus = orderStatus.getCode();
|
||||
if (mOrderStatusCallback != null) {
|
||||
mOrderStatusCallback.onCurrentOrderStatusChanged(mCurrentOCHOrder);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError() {
|
||||
if (!NetworkUtils.isConnected(mContext)) {
|
||||
ToastUtils.showShort(mContext.getString(R.string.network_error_tip));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFail(int code, String msg) {
|
||||
// ToastUtils.showShort(code + "," + msg);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 取消当前订单
|
||||
public void cancelCurrentOrder(int reasonType, String reason) {
|
||||
if (mCurrentOCHOrder == null) {
|
||||
@@ -802,9 +769,6 @@ public class TaxiModel {
|
||||
}
|
||||
|
||||
public void updateAutopilotStatus(boolean isSafe){
|
||||
if(isSafe){
|
||||
ToastUtils.showLong(mContext.getResources().getString(R.string.module_och_taxi_order_choose_start_autopilot_tip));
|
||||
}
|
||||
if (mOrderStatusCallback != null){
|
||||
mOrderStatusCallback.onDriverHasCheckedPilotCondition(isSafe);
|
||||
}
|
||||
@@ -970,26 +934,11 @@ public class TaxiModel {
|
||||
}
|
||||
|
||||
if (distance <= TaxiConst.ARRIVE_AT_START_STATION_DISTANCE) {
|
||||
updateOCHOrderStatus(TaxiOrderStatusEnum.ArriveAtStart);
|
||||
arrivedStartPoint();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: 2021/9/12
|
||||
public void calculateTravelDistance(Location carLocation) {
|
||||
if (checkCurrentOCHOrder() && mCurrentOCHOrder.endSiteGcjPoint.size() > 0) {
|
||||
double endLon = mCurrentOCHOrder.endSiteGcjPoint.get(0);
|
||||
double endLat = mCurrentOCHOrder.endSiteGcjPoint.get(1);
|
||||
double distance = CoordinateUtils.calculateLineDistance(
|
||||
endLon, endLat,
|
||||
carLocation.getLongitude(), carLocation.getLatitude());
|
||||
mCurrentOCHOrder.decreaseTravelDistance(distance);
|
||||
if (mOrderStatusCallback != null && distance >= 0) {
|
||||
mOrderStatusCallback.onCurrentOrderDistToEndChanged((long) distance, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//监听网络变化,避免启动机器时无网导致无法更新订单信息
|
||||
private final IMogoIntentListener mNetWorkIntentListener = new IMogoIntentListener() {
|
||||
@Override
|
||||
@@ -1061,7 +1010,16 @@ public class TaxiModel {
|
||||
ToastUtils.showShort("订单状态不匹配该操作!");
|
||||
return;
|
||||
}
|
||||
updateOCHOrderStatus(TaxiOrderStatusEnum.ArriveAtStart);
|
||||
arrivedStartPoint();
|
||||
}
|
||||
|
||||
public void setDriverConfirmCondition() {
|
||||
if (mCurrentOCHOrder == null
|
||||
|| mCurrentOCHOrder.orderStatus != TaxiOrderStatusEnum.UserArriveAtStart.getCode()) {
|
||||
ToastUtils.showShort("订单状态不匹配该操作!");
|
||||
return;
|
||||
}
|
||||
confirmAutopilotConditionByDriver();
|
||||
}
|
||||
|
||||
public void setArriveAtEndStation() {
|
||||
@@ -1070,19 +1028,18 @@ public class TaxiModel {
|
||||
ToastUtils.showShort("订单状态不匹配该操作!");
|
||||
return;
|
||||
}
|
||||
updateOCHOrderStatus(TaxiOrderStatusEnum.ArriveAtEnd);
|
||||
arriveTerminal();
|
||||
}
|
||||
|
||||
/**
|
||||
* 测试开始服务
|
||||
* 测试开启自动驾驶
|
||||
*/
|
||||
public void setOnTheWayToEndStation() {
|
||||
// if (mADASStatusCallback != null) mADASStatusCallback.onAutopilotRunning();
|
||||
if (mCurrentOCHOrder == null
|
||||
|| mCurrentOCHOrder.orderStatus != TaxiOrderStatusEnum.UserArriveAtStart.getCode()) {
|
||||
ToastUtils.showShort("订单状态不匹配该操作!");
|
||||
}
|
||||
updateOCHOrderStatus(TaxiOrderStatusEnum.OnTheWayToEnd);
|
||||
startServicePilotDone();
|
||||
}
|
||||
|
||||
private final IMoGoAutopilotStatusListener mGoAutopilotStatusListener = new IMoGoAutopilotStatusListener() {
|
||||
@@ -1109,7 +1066,6 @@ public class TaxiModel {
|
||||
// 当高频返回autopilot 2时,不重复调用订单状态变更
|
||||
mPrevAPStatus = state; // 每个状态单独赋值,解决无订单时已经是2的状态导致的新订单来时无法进入此逻辑更新状态
|
||||
|
||||
// updateOCHOrderStatus(TaxiOrderStatusEnum.OnTheWayToEnd);
|
||||
startServicePilotDone();
|
||||
|
||||
TaxiAnalyticsManager.getInstance().triggerStartAutopilotEvent(false, true,
|
||||
@@ -1165,7 +1121,7 @@ public class TaxiModel {
|
||||
if (DebugConfig.isDebug()) {
|
||||
// ToastUtils.showShort("到达目的地");
|
||||
}
|
||||
updateOCHOrderStatus(TaxiOrderStatusEnum.ArriveAtEnd);
|
||||
arriveTerminal();
|
||||
if (FunctionBuildConfig.isDemoMode) {
|
||||
// 当美化模式(演示模式)开启时: 到达目的地,置false
|
||||
FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData = false;
|
||||
@@ -1367,6 +1323,9 @@ public class TaxiModel {
|
||||
, new TaxiServiceCallback<TaxiDataBaseRespBean>() {
|
||||
@Override
|
||||
public void onSuccess(TaxiDataBaseRespBean data) {
|
||||
if (null != data && 0 == data.code){
|
||||
updateOrderStatus(TaxiOrderStatusEnum.UserArriveAtStart);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1382,13 +1341,15 @@ public class TaxiModel {
|
||||
TaxiOrPassengerReadyReqBean.Result result = new TaxiOrPassengerReadyReqBean.Result();
|
||||
result.lat = mLatitude;
|
||||
result.lon = mLongitude;
|
||||
TaxiServiceManager.getInstance().updatePassengerHasBoardedStatus(mContext
|
||||
TaxiServiceManager.getInstance().startServicePilotDone(mContext
|
||||
, mCurrentOCHOrder.orderNo
|
||||
, result
|
||||
, new TaxiServiceCallback<TaxiDataBaseRespBean>() {
|
||||
@Override
|
||||
public void onSuccess(TaxiDataBaseRespBean data) {
|
||||
|
||||
if (null != data && 0 == data.code){
|
||||
updateOrderStatus(TaxiOrderStatusEnum.OnTheWayToEnd);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1398,4 +1359,82 @@ public class TaxiModel {
|
||||
});
|
||||
}
|
||||
|
||||
public void arrivedStartPoint(){
|
||||
if (mCurrentOCHOrder == null) return;
|
||||
TaxiOrPassengerReadyReqBean.Result result = new TaxiOrPassengerReadyReqBean.Result();
|
||||
result.lat = mLatitude;
|
||||
result.lon = mLongitude;
|
||||
TaxiServiceManager.getInstance().arrivedStartPoint(mContext
|
||||
, mCurrentOCHOrder.orderNo
|
||||
, result
|
||||
, new TaxiServiceCallback<TaxiDataBaseRespBean>() {
|
||||
@Override
|
||||
public void onSuccess(TaxiDataBaseRespBean data) {
|
||||
if (null != data && 0 == data.code){
|
||||
updateOrderStatus(TaxiOrderStatusEnum.ArriveAtStart);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFail(int code, String msg) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void arriveTerminal(){
|
||||
if (mCurrentOCHOrder == null) return;
|
||||
TaxiOrPassengerReadyReqBean.Result result = new TaxiOrPassengerReadyReqBean.Result();
|
||||
result.lat = mLatitude;
|
||||
result.lon = mLongitude;
|
||||
TaxiServiceManager.getInstance().arriveTerminal(mContext
|
||||
, mCurrentOCHOrder.orderNo
|
||||
, result
|
||||
, new TaxiServiceCallback<TaxiDataBaseRespBean>() {
|
||||
@Override
|
||||
public void onSuccess(TaxiDataBaseRespBean data) {
|
||||
if (null != data && 0 == data.code){
|
||||
updateOrderStatus(TaxiOrderStatusEnum.ArriveAtEnd);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFail(int code, String msg) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void orderCompleted(){
|
||||
if (mCurrentOCHOrder == null) return;
|
||||
TaxiOrPassengerReadyReqBean.Result result = new TaxiOrPassengerReadyReqBean.Result();
|
||||
result.lat = mLatitude;
|
||||
result.lon = mLongitude;
|
||||
TaxiServiceManager.getInstance().orderCompleted(mContext
|
||||
, mCurrentOCHOrder.orderNo
|
||||
, result
|
||||
, new TaxiServiceCallback<TaxiDataBaseRespBean>() {
|
||||
@Override
|
||||
public void onSuccess(TaxiDataBaseRespBean data) {
|
||||
if (null != data && 0 == data.code){
|
||||
updateOrderStatus(TaxiOrderStatusEnum.JourneyCompleted);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFail(int code, String msg) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
//更新当前订单状态
|
||||
public void updateOrderStatus(final TaxiOrderStatusEnum orderStatus) {
|
||||
if (mCurrentOCHOrder == null) {
|
||||
return;
|
||||
}
|
||||
mCurrentOCHOrder.orderStatus = orderStatus.getCode();
|
||||
if (mOrderStatusCallback != null) {
|
||||
mOrderStatusCallback.onCurrentOrderStatusChanged(mCurrentOCHOrder);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -271,4 +271,40 @@ interface TaxiServiceApiNew {
|
||||
@POST( "/autopilot-car-hailing/cab/flow/v1/driver/taxi/startServicePilot" )
|
||||
Observable<TaxiDataBaseRespBean> startServicePilotDone(@Header ("appId") String appId
|
||||
, @Header("ticket") String ticket,@Body TaxiOrPassengerReadyReqBean data);
|
||||
|
||||
/**
|
||||
* 达到乘客上车点
|
||||
* @param appId
|
||||
* @param ticket
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
@Headers( {"Content-type:application/json;charset=UTF-8"} )
|
||||
@POST( "/autopilot-car-hailing/cab/flow/v1/driver/taxi/passenger/arriveStartPoint" )
|
||||
Observable<TaxiDataBaseRespBean> arrivedStartPoint(@Header ("appId") String appId
|
||||
, @Header("ticket") String ticket,@Body TaxiOrPassengerReadyReqBean data);
|
||||
|
||||
/**
|
||||
* 到达乘客目的地
|
||||
* @param appId
|
||||
* @param ticket
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
@Headers( {"Content-type:application/json;charset=UTF-8"} )
|
||||
@POST( "/autopilot-car-hailing/cab/flow/v1/driver/taxi/arriveTerminal" )
|
||||
Observable<TaxiDataBaseRespBean> arriveTerminal(@Header ("appId") String appId
|
||||
, @Header("ticket") String ticket,@Body TaxiOrPassengerReadyReqBean data);
|
||||
|
||||
/**
|
||||
* 订单完成
|
||||
* @param appId
|
||||
* @param ticket
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
@Headers( {"Content-type:application/json;charset=UTF-8"} )
|
||||
@POST( "/autopilot-car-hailing/cab/flow/v1/driver/taxi/orderCompleted" )
|
||||
Observable<TaxiDataBaseRespBean> orderCompleted(@Header ("appId") String appId
|
||||
, @Header("ticket") String ticket,@Body TaxiOrPassengerReadyReqBean data);
|
||||
}
|
||||
|
||||
@@ -396,6 +396,46 @@ public class TaxiServiceManager {
|
||||
.subscribe(getSubscribeImpl(context, callback, "startServicePilotDone"));
|
||||
}
|
||||
|
||||
public void arrivedStartPoint(Context context, String orderNo
|
||||
, TaxiOrPassengerReadyReqBean.Result loc
|
||||
, TaxiServiceCallback<TaxiDataBaseRespBean> callback){
|
||||
mOCHTaxiServiceApi.arrivedStartPoint(MoGoAiCloudClientConfig.getInstance().getServiceAppId()
|
||||
,MoGoAiCloudClientConfig.getInstance().getToken()
|
||||
,new TaxiOrPassengerReadyReqBean(MoGoAiCloudClientConfig.getInstance().getSn()
|
||||
,orderNo,loc))
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(getSubscribeImpl(context, callback, "arrivedStartPoint"));
|
||||
|
||||
}
|
||||
|
||||
public void arriveTerminal(Context context, String orderNo
|
||||
, TaxiOrPassengerReadyReqBean.Result loc
|
||||
, TaxiServiceCallback<TaxiDataBaseRespBean> callback){
|
||||
mOCHTaxiServiceApi.arriveTerminal(MoGoAiCloudClientConfig.getInstance().getServiceAppId()
|
||||
,MoGoAiCloudClientConfig.getInstance().getToken()
|
||||
,new TaxiOrPassengerReadyReqBean(MoGoAiCloudClientConfig.getInstance().getSn()
|
||||
,orderNo,loc))
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(getSubscribeImpl(context, callback, "arriveTerminal"));
|
||||
|
||||
}
|
||||
|
||||
|
||||
public void orderCompleted(Context context, String orderNo
|
||||
, TaxiOrPassengerReadyReqBean.Result loc
|
||||
, TaxiServiceCallback<TaxiDataBaseRespBean> callback){
|
||||
mOCHTaxiServiceApi.orderCompleted(MoGoAiCloudClientConfig.getInstance().getServiceAppId()
|
||||
,MoGoAiCloudClientConfig.getInstance().getToken()
|
||||
,new TaxiOrPassengerReadyReqBean(MoGoAiCloudClientConfig.getInstance().getSn()
|
||||
,orderNo,loc))
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(getSubscribeImpl(context, callback, "arriveTerminal"));
|
||||
|
||||
}
|
||||
|
||||
private <T extends BaseData> SubscribeImpl getSubscribeImpl(
|
||||
Context context, TaxiServiceCallback<T> callback, String apiName) {
|
||||
return new SubscribeImpl<T>(RequestOptions.create(context)) {
|
||||
|
||||
@@ -112,10 +112,6 @@ public class TaxiPresenter extends Presenter<TaxiFragment> implements ITaxiADASS
|
||||
TaxiModel.getInstance().updateCarStatus();
|
||||
}
|
||||
|
||||
// 更新当前订单状态(当前订单状态流转)
|
||||
public void updateCurOrderStatus(TaxiOrderStatusEnum status) {
|
||||
TaxiModel.getInstance().updateOCHOrderStatus(status);
|
||||
}
|
||||
|
||||
// 获取当前订单状态
|
||||
public TaxiOrderStatusEnum getCurOrderStatus() {
|
||||
@@ -157,6 +153,11 @@ public class TaxiPresenter extends Presenter<TaxiFragment> implements ITaxiADASS
|
||||
TaxiModel.getInstance().queryDriverServiceData();
|
||||
}
|
||||
|
||||
//更新订单已完成状态
|
||||
public void completeOrderService() {
|
||||
TaxiModel.getInstance().orderCompleted();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotArriveEnd() {
|
||||
|
||||
|
||||
@@ -300,6 +300,8 @@ public abstract class BaseTaxiTabFragment<V extends IView, P extends Presenter<V
|
||||
public void onCheckPilotConditionSafe(boolean isSafe){
|
||||
ctvAutopilotStatus.setTag(isSafe);
|
||||
if (isSafe){
|
||||
ToastUtils.showLong(getResources().getString(
|
||||
R.string.module_och_taxi_order_choose_start_autopilot_tip));
|
||||
updateOrderUI();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -394,7 +394,7 @@ public class TaxiBeingServerdOrdersFragment extends BaseTaxiUIFragment implement
|
||||
}else if (TaxiOrderStatusEnum.UserArriveAtStart.getCode() == mCurrentOrder.orderStatus) {//点击此按钮,说明通知后端准备好开启自动驾驶的条件
|
||||
mTaxiFragment.confirmAutopilotConditionByDriver();
|
||||
}else if (TaxiOrderStatusEnum.ArriveAtEnd.getCode() == mCurrentOrder.orderStatus) {//点击了完成服务,结束订单并更新订单信息
|
||||
mTaxiFragment.completeOrderService(TaxiOrderStatusEnum.JourneyCompleted);
|
||||
mTaxiFragment.completeOrderService();
|
||||
showNotice(getResources().getString(R.string.module_och_taxi_order_server_completed_tip));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -228,8 +228,8 @@ public class TaxiFragment extends BaseTaxiTabFragment<TaxiFragment, TaxiPresente
|
||||
mPresenter.jumpPassengerCheckDone();
|
||||
}
|
||||
|
||||
public void completeOrderService(TaxiOrderStatusEnum status) {
|
||||
mPresenter.updateCurOrderStatus(status);
|
||||
public void completeOrderService() {
|
||||
mPresenter.completeOrderService();
|
||||
}
|
||||
|
||||
public void cancelCurOrder(int reasonType, String reaso) {
|
||||
@@ -356,11 +356,10 @@ public class TaxiFragment extends BaseTaxiTabFragment<TaxiFragment, TaxiPresente
|
||||
findViewById(R.id.test_bar_to_end).setOnClickListener(v -> {
|
||||
TaxiModel.getInstance().setArriveAtEndStation();
|
||||
});
|
||||
findViewById(R.id.test_bar_on_the_way_to_end1).setOnClickListener(v -> {
|
||||
TaxiModel.getInstance().confirmAutopilotConditionByDriver();
|
||||
findViewById(R.id.test_bar_start_service_confirm).setOnClickListener(v -> {
|
||||
TaxiModel.getInstance().setDriverConfirmCondition();
|
||||
});
|
||||
findViewById(R.id.test_bar_on_the_way_to_end).setOnClickListener(v -> {
|
||||
// showNotice("自动驾驶已启动,请系好安全带");
|
||||
if (!isStarting){
|
||||
mPresenter.startAutoPilot(false);
|
||||
startOrStopLoadingAnim(true);
|
||||
|
||||
@@ -48,12 +48,12 @@
|
||||
android:text="到达上车点"
|
||||
android:textSize="12sp" />
|
||||
<Button
|
||||
android:id="@+id/test_bar_on_the_way_to_end1"
|
||||
android:id="@+id/test_bar_start_service_confirm"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="12sp"
|
||||
android:onClick="testWayToEnd"
|
||||
android:text="确认可开启服务"/>
|
||||
android:text="开启服务"/>
|
||||
|
||||
<Button
|
||||
android:id="@+id/test_bar_on_the_way_to_end"
|
||||
@@ -61,7 +61,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="12sp"
|
||||
android:onClick="testWayToEnd"
|
||||
android:text="开启自动驾驶按钮"/>
|
||||
android:text="开启自动驾驶"/>
|
||||
|
||||
<Button
|
||||
android:id="@+id/test_bar_to_end"
|
||||
|
||||