18034727885
2026-07-02 eb6124e310ae8875a0150ee5d2edd52d5a579d87
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
package com.driver.igotrip.base;
 
import android.content.Context;
import android.content.Intent;
import android.os.Handler;
 
import com.driver.igotrip.ui.main.CancelOrderFragment;
import com.driver.igotrip.ui.main.DriverPayFragment;
import com.driver.igotrip.ui.main.ForceOfflineFragment;
import com.driver.igotrip.ui.main.GetOrderFragment;
import com.driver.igotrip.ui.main.GoOrderTipsFragment;
import com.driver.igotrip.ui.main.ModifyAddressFragment;
import com.driver.igotrip.ui.main.TimeOutCancelOrderFragment;
import com.driver.igotrip.ui.main.TipsFragment;
import com.driver.igotrip.ui.main.TripActivity;
import com.driver.igotrip.utils.LanguageManager;
 
import cn.sinata.xldutils.activitys.BaseActivity;
 
public class PublicServiceActivity extends BaseActivity {
 
    /***
     * type 1:普通单 2:该派单
     * @param orderId
     * @param orderType
     * @param time
     * @param type
     */
    public void showOrder(String audioUrl, String orderId, String orderType, int time, int type) {
        new Handler(getMainLooper()).post(() -> {
            Intent intent = new Intent(MyApplication.Companion.getInstance(), GetOrderFragment.class);
            intent.putExtra("audioUrl", audioUrl);
            intent.putExtra("orderId", orderId);
            intent.putExtra("orderType", orderType);
            intent.putExtra("time", time);
            intent.putExtra("type", type);
            intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
            MyApplication.Companion.getInstance().startActivity(intent);
        });
    }
 
    @Override
    protected void attachBaseContext(Context newBase) {
        super.attachBaseContext(LanguageManager.wrapContext(newBase));
    }
 
    /**
     * 取消订单
     *
     * @param orderId
     * @param orderType
     * @param cancelReason
     * @param cancelPayMoney
     */
    public void cancelOrder(String audioUrl, String orderId, String orderType, String cancelReason, String cancelPayMoney) {
        new Handler(getMainLooper()).post(() -> {
            MyApplication.Companion.getTTsManager().setVideoText(audioUrl);
            Intent intent = new Intent(MyApplication.Companion.getInstance(), CancelOrderFragment.class);
            intent.putExtra("orderId", orderId);
            intent.putExtra("orderType", orderType);
            intent.putExtra("cancelReason", cancelReason);
            intent.putExtra("cancelPayMoney", cancelPayMoney);
            intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
            MyApplication.Companion.getInstance().startActivity(intent);
        });
    }
 
    /**
     * 取消订单
     *
     * @param orderId
     * @param orderType
     * @param timeOut
     * @param cancelPayMoney
     */
    public void cancelOrder(String cancelBy, String audioUrl, String orderId, String orderType, Long timeOut, String cancelPayMoney) {
        new Handler(getMainLooper()).post(() -> {
            MyApplication.Companion.getTTsManager().setVideoText(audioUrl);
            Intent intent = new Intent(MyApplication.Companion.getInstance(), TimeOutCancelOrderFragment.class);
            intent.putExtra("orderId", orderId);
            intent.putExtra("cancelBy", cancelBy);
            intent.putExtra("orderType", orderType);
            intent.putExtra("timeOut", timeOut);
            intent.putExtra("cancelPayMoney", cancelPayMoney);
            intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
            MyApplication.Companion.getInstance().startActivity(intent);
        });
    }
 
    /**
     * 取消待支付
     *
     * @param cancelPayMoney
     */
    public void cancelOrder(String audioUrl, String cancelPayMoney) {
        new Handler(getMainLooper()).post(() -> {
            MyApplication.Companion.getTTsManager().setVideoText(audioUrl);
            Intent intent = new Intent(MyApplication.Companion.getInstance(), TimeOutCancelOrderFragment.class);
            intent.putExtra("cancelPayMoney", cancelPayMoney);
            intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
            MyApplication.Companion.getInstance().startActivity(intent);
        });
    }
 
    /**
     * 修改目的地
     *
     * @param orderId
     * @param orderType
     */
    public void modifyAddress(String audioUrl, String orderId, String orderType) {
        new Handler(getMainLooper()).post(() -> {
            MyApplication.Companion.getTTsManager().setVideoText(audioUrl);
            Intent intent = new Intent(MyApplication.Companion.getInstance(), ModifyAddressFragment.class);
            intent.putExtra("orderId", orderId);
            intent.putExtra("orderType", orderType);
            intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
            MyApplication.Companion.getInstance().startActivity(intent);
        });
    }
 
    /**
     * 强制下线提示
     */
    public void forceOffline(String audioUrl, String msg) {
        new Handler(getMainLooper()).post(() -> {
            MyApplication.Companion.getTTsManager().setVideoText(audioUrl);
            Intent intent = new Intent(MyApplication.Companion.getInstance(), ForceOfflineFragment.class);
            intent.putExtra("tips", msg);
            intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
            MyApplication.Companion.getInstance().startActivity(intent);
        });
    }
 
    public void onlyTips(String audioUrl, String tips) {
        new Handler(getMainLooper()).post(() -> {
            MyApplication.Companion.getTTsManager().setVideoText(audioUrl);
            Intent intent = new Intent(MyApplication.Companion.getInstance(), TipsFragment.class);
            intent.putExtra("tips", tips);
            intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
            MyApplication.Companion.getInstance().startActivity(intent);
        });
    }
 
    public void goOrderTips(String orderId, String orderType, String audioUrl, String describe) {
//        MyApplication.Companion.getTTsManager().setVideoText(audioUrl);
        boolean needGoOrder = !this.getClass().getName().equals("com.driver.igotrip.ui.main.TripActivity");
        new Handler(getMainLooper()).post(() -> {
            MyApplication.Companion.getTTsManager().setVideoText(audioUrl);
            Intent intent = new Intent(MyApplication.Companion.getInstance(), GoOrderTipsFragment.class);
            intent.putExtra("orderId", orderId);
            intent.putExtra("orderType", orderType);
            intent.putExtra("describe", describe);
            intent.putExtra("needGoOrder", needGoOrder);
            intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
            MyApplication.Companion.getInstance().startActivity(intent);
        });
    }
 
    public void showDriverPayDialog(String audioUrl, String orderId, String orderType, double money) {
        new Handler(getMainLooper()).post(() -> {
//            DialogUtil.INSTANCE.getDelAndSureDialog(this, getString(R.string.支付), getString(R.string.关闭),
//                    getString(R.string.您有一笔待支付的订单), () -> null, () -> {
//                        if (this instanceof OrderOverActivity){
//                            finish();
//                        }
//                        Intent intent = new Intent(MyBaseActivity.this, OrderOverActivity.class);
//                        intent.putExtra("orderId", orderId);
//                        intent.putExtra("orderType", orderType);
//                        startActivity(intent);
//                        return null;
//                    });
            MyApplication.Companion.getTTsManager().setVideoText(audioUrl);
            Intent intent = new Intent(MyApplication.Companion.getInstance(), DriverPayFragment.class);
            intent.putExtra("orderId", orderId);
            intent.putExtra("orderType", orderType);
            intent.putExtra("money", money);
            intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
            MyApplication.Companion.getInstance().startActivity(intent);
        });
    }
 
    /***
     * 扫码
     * @param orderId
     * @param orderType
     */
    public void toDorderAct(String orderId, String orderType) {
        Intent intent = new Intent(this, TripActivity.class);
        intent.putExtra("orderId", orderId);
        intent.putExtra("orderType", orderType);
        startActivity(intent);
    }
 
    /***
     * 跨城
     * @param orderId
     * @param orderType
     */
    public void toDorderActCity(String orderId, String orderType) {
 
    }
 
}