Browse Source

修改bug

hy 2 years ago
parent
commit
03bce09bea

+ 15 - 5
app/src/main/java/com/electric/chargingpile/activity/ChargingPileActivity.java

10
import android.text.TextWatcher;
10
import android.text.TextWatcher;
11
import android.view.View;
11
import android.view.View;
12
import android.widget.EditText;
12
import android.widget.EditText;
13
import android.widget.ImageView;
13
import android.widget.LinearLayout;
14
import android.widget.LinearLayout;
14
import android.widget.TextView;
15
import android.widget.TextView;
15
import android.widget.Toast;
16
import android.widget.Toast;
68
    private static final int RC_TELL_PERM = 124;
69
    private static final int RC_TELL_PERM = 124;
69
    private static final int startInterface = 2;
70
    private static final int startInterface = 2;
70
    private static final String numType = "2";
71
    private static final String numType = "2";
72
    private ImageView iv_back;
71
73
72
    @Override
74
    @Override
73
    protected void onCreate(@Nullable @org.jetbrains.annotations.Nullable Bundle savedInstanceState) {
75
    protected void onCreate(@Nullable @org.jetbrains.annotations.Nullable Bundle savedInstanceState) {
87
        rootView = findViewById(R.id.rootView);
89
        rootView = findViewById(R.id.rootView);
88
        rvHistory = findViewById(R.id.rvHistory);
90
        rvHistory = findViewById(R.id.rvHistory);
89
        tvCoding = findViewById(R.id.tvCoding);
91
        tvCoding = findViewById(R.id.tvCoding);
92
        iv_back = findViewById(R.id.iv_back);
90
        alertDialog = new AlertDialogTwo(this);
93
        alertDialog = new AlertDialogTwo(this);
91
        loadingDialog = new LoadingDialog(this);
94
        loadingDialog = new LoadingDialog(this);
92
        loadingDialog.setCanceledOnTouchOutside(false);
95
        loadingDialog.setCanceledOnTouchOutside(false);
96
97
93
        tvCoding.setText("充电桩编码:"+pileId);
98
        tvCoding.setText("充电桩编码:"+pileId);
94
99
95
    }
100
    }
96
101
97
    private void initOnClick() {
102
    private void initOnClick() {
103
98
        rvHistory.setLayoutManager(new GridLayoutManager(this,3));
104
        rvHistory.setLayoutManager(new GridLayoutManager(this,3));
99
        mAdapter = new LicensePlateHistoryAdapter();
105
        mAdapter = new LicensePlateHistoryAdapter();
100
        mAdapter.setListener(str->{
106
        mAdapter.setListener(str->{
101
            mDialog.setLicensePlate(str);
102
            mDialog.show(getSupportFragmentManager());
107
            editText.setText(str);
108
            editText.setSelection(str.length());
103
        });
109
        });
104
        rvHistory.setAdapter(mAdapter);
110
        rvHistory.setAdapter(mAdapter);
105
        mAdapter.setList();
111
        mAdapter.setList();
111
            mAdapter.setList();
117
            mAdapter.setList();
112
        });
118
        });
113
119
120
        iv_back.setOnClickListener(v->{
121
            finish();
122
        });
123
114
        tvStartCharge.setOnClickListener(v->{
124
        tvStartCharge.setOnClickListener(v->{
115
            String str = editText.getText().toString();
125
            String str = editText.getText().toString();
116
            if (str.equals("")){
126
            if (str.equals("")){
137
        kingKeyboard = new KingKeyboard(this,mKeyboardParent);
147
        kingKeyboard = new KingKeyboard(this,mKeyboardParent);
138
        //然后将EditText注册到KingKeyboard即可
148
        //然后将EditText注册到KingKeyboard即可
139
        kingKeyboard.setBringToFront(true);
149
        kingKeyboard.setBringToFront(true);
140
        kingKeyboard.register(editText, KingKeyboard.KeyboardType.LICENSE_PLATE_PROVINCE);
150
        kingKeyboard.register(editText, KingKeyboard.KeyboardType.LICENSE_PLATE);
141
151
142
        editText.addTextChangedListener(new TextWatcher() {
152
        editText.addTextChangedListener(new TextWatcher() {
143
            @Override
153
            @Override
149
            public void onTextChanged(CharSequence s, int start, int before, int count) {
159
            public void onTextChanged(CharSequence s, int start, int before, int count) {
150
                int length = s.toString().length();
160
                int length = s.toString().length();
151
                if (length == 0){
161
                if (length == 0){
152
                    if(kingKeyboard.getKeyboardType() != KingKeyboard.KeyboardType.LICENSE_PLATE_PROVINCE){
162
                    if(kingKeyboard.getKeyboardType() != KingKeyboard.KeyboardType.LICENSE_PLATE){
153
                        kingKeyboard.sendKey(KingKeyboard.KEYCODE_BACK);
163
                        kingKeyboard.sendKey(KingKeyboard.KEYCODE_BACK);
154
                    }
164
                    }
155
                }else if (length == 1){
165
                }else if (length == 1){
156
                    if(beforeCount == 0 && kingKeyboard.getKeyboardType() == KingKeyboard.KeyboardType.LICENSE_PLATE_PROVINCE){
166
                    if(beforeCount == 0 && kingKeyboard.getKeyboardType() == KingKeyboard.KeyboardType.LICENSE_PLATE){
157
                        kingKeyboard.sendKey(KingKeyboard.KEYCODE_MODE_CHANGE);
167
                        kingKeyboard.sendKey(KingKeyboard.KEYCODE_MODE_CHANGE);
158
                    }
168
                    }
159
                }else if (length >= 8){
169
                }else if (length >= 8){

+ 9 - 5
app/src/main/java/com/electric/chargingpile/activity/ConfirmOrderActivity.java

230
    }
230
    }
231
231
232
    private void  requestComment() {
232
    private void  requestComment() {
233
        if (this != null && !this.isFinishing()) {
233
        if (this != null && !this.isFinishing() && !mDialog.isShowing()) {
234
            mDialog.show();
234
            mDialog.show();
235
        }
235
        }
236
      //  Log.e("TAG_hcy", "requestComment: "+mRedEnvelopeId);
236
      //  Log.e("TAG_hcy", "requestComment: "+mRedEnvelopeId);
270
    }
270
    }
271
    private void pollingChargingStats() {
271
    private void pollingChargingStats() {
272
        try_count++;
272
        try_count++;
273
        if (this != null && !isFinishing() && !mDialog.isShowing()) {
274
            mDialog.show();
275
        }
276
273
        OkHttpUtils.get().url(UrlConstants.CHARGING_STATUS_URL)
277
        OkHttpUtils.get().url(UrlConstants.CHARGING_STATUS_URL)
274
                .addParams(com.electric.chargingpile.constant.ChargingConstants.USERID, MainApplication.userId)
278
                .addParams(com.electric.chargingpile.constant.ChargingConstants.USERID, MainApplication.userId)
275
                .addParams(com.electric.chargingpile.constant.ChargingConstants.PWD, MainApplication.userPassword)
279
                .addParams(com.electric.chargingpile.constant.ChargingConstants.PWD, MainApplication.userPassword)
281
                .execute(new StringCallback() {
285
                .execute(new StringCallback() {
282
                    @Override
286
                    @Override
283
                    public void onError(Call call, Exception e) {
287
                    public void onError(Call call, Exception e) {
284
//                        dismissDialog();
285
//                        ToastUtil.showToast(getApplicationContext(),"网络异常,请检查您的网络连接",Toast.LENGTH_SHORT);
288
                        dismissDialog();
289
                        ToastUtil.showToast(getApplicationContext(),"网络异常,请检查您的网络连接",Toast.LENGTH_SHORT);
286
                        CrashReport.postCatchedException(e);
290
                        CrashReport.postCatchedException(e);
287
                    }
291
                    }
288
292
335
                                startActivity(new Intent(getApplicationContext(), DelayInfoActivity.class));
339
                                startActivity(new Intent(getApplicationContext(), DelayInfoActivity.class));
336
                                finish();
340
                                finish();
337
                            } else {
341
                            } else {
338
//                                dismissDialog();
339
//                                ToastUtil.showToast(getApplicationContext(),rtnMsg,Toast.LENGTH_SHORT);
342
                                dismissDialog();
343
                                ToastUtil.showToast(getApplicationContext(),rtnMsg,Toast.LENGTH_SHORT);
340
                            }
344
                            }
341
                        }
345
                        }
342
                    }
346
                    }

+ 2 - 2
app/src/main/java/com/electric/chargingpile/activity/MainMapActivity.java

498
                                if (key.length - 1 > 2) {
498
                                if (key.length - 1 > 2) {
499
                                    permissionTask();
499
                                    permissionTask();
500
                                } else {
500
                                } else {
501
//                                    dialogup();
502
                                    permissionTask();
501
                                    dialogup();
502
//                                    permissionTask();
503
                                }
503
                                }
504
                            }
504
                            }
505
505

+ 2 - 0
app/src/main/java/com/electric/chargingpile/activity/MyWebViewActivity.java

282
        runOnUiThread(new Runnable() {
282
        runOnUiThread(new Runnable() {
283
            @Override
283
            @Override
284
            public void run() {
284
            public void run() {
285
                Log.e(TAG, "hyc run: "+show);
285
                if (show.equals("yes")) {
286
                if (show.equals("yes")) {
286
                    tv_webShare.setVisibility(View.VISIBLE);
287
                    tv_webShare.setVisibility(View.VISIBLE);
287
                    tv_webShare.setText("分享");
288
                    tv_webShare.setText("分享");
1315
                WebBackForwardList mWebBackForwardList = webView.copyBackForwardList();
1316
                WebBackForwardList mWebBackForwardList = webView.copyBackForwardList();
1316
                Log.e("tag", "mWebBackForwardList.getSize() " + mWebBackForwardList.getSize());
1317
                Log.e("tag", "mWebBackForwardList.getSize() " + mWebBackForwardList.getSize());
1317
                if (webView.canGoBack()) {
1318
                if (webView.canGoBack()) {
1319
                    showsharebtn("no");
1318
                    webView.goBack();
1320
                    webView.goBack();
1319
                    iv_webClose.setVisibility(View.VISIBLE);
1321
                    iv_webClose.setVisibility(View.VISIBLE);
1320
                } else {
1322
                } else {

+ 6 - 6
app/src/main/java/com/electric/chargingpile/application/MainApplication.java

100
    public static String firstPoint = "";
100
    public static String firstPoint = "";
101
    public static Boolean firstSsyd;
101
    public static Boolean firstSsyd;
102
    public static String password = "";
102
    public static String password = "";
103
    public static String url = "http://59.110.68.162";// 充电桩测试环境
104
    public static String pic_url = "http://59.110.68.162/zhannew/uploadfile/";
105
//    public static String url = "http://cdz.evcharge.cc";// 充电桩正式环境
106
//    public static String pic_url = "http://cdz.evcharge.cc/zhannew/uploadfile/";
103
//    public static String url = "http://59.110.68.162";// 充电桩测试环境
104
//    public static String pic_url = "http://59.110.68.162/zhannew/uploadfile/";
105
    public static String url = "http://cdz.evcharge.cc";// 充电桩正式环境
106
    public static String pic_url = "http://cdz.evcharge.cc/zhannew/uploadfile/";
107

107

108
        public static String urlNew = "http://123.56.67.7:83/api/0300";// 一电测试环境
109
//    public static String urlNew = "https://api.touchev.com:83/api/0300";// 一电正式环境
108
//        public static String urlNew = "http://123.56.67.7:83/api/0300";// 一电测试环境
109
    public static String urlNew = "https://api.touchev.com:83/api/0300";// 一电正式环境
110

110

111
    public static String d1evUrl = "https://d1ev-new.yiduyongche.com";// 评论上传视频
111
    public static String d1evUrl = "https://d1ev-new.yiduyongche.com";// 评论上传视频
112
    public static String CDN = "https://cdn-fs.d1ev.com";
112
    public static String CDN = "https://cdn-fs.d1ev.com";

+ 1 - 0
app/src/main/java/com/electric/chargingpile/data/ChargingBean.java

21
     * status : 充电中
21
     * status : 充电中
22
     * endInfo : 手动结束
22
     * endInfo : 手动结束
23
     * zhanname : 自定义站
23
     * zhanname : 自定义站
24
     * plate_number : 车牌号
24
     */
25
     */
25
26
26
    private String orderId;
27
    private String orderId;

+ 1 - 1
app/src/main/res/layout/activity_charging_pile.xml

131
            android:layout_width="wrap_content"
131
            android:layout_width="wrap_content"
132
            android:layout_height="wrap_content"
132
            android:layout_height="wrap_content"
133
            android:layout_marginTop="12dp"
133
            android:layout_marginTop="12dp"
134
            android:text="*输入正确车牌号充电结束可获取停车优惠(注意大写)"
134
            android:text="*输入正确车牌号充电结束可减免最多两小时停车费用(注意大写)"
135
            android:textColor="#ff3ec34c"
135
            android:textColor="#ff3ec34c"
136
            android:textSize="12sp"
136
            android:textSize="12sp"
137
            app:layout_constraintStart_toStartOf="parent"
137
            app:layout_constraintStart_toStartOf="parent"

+ 2 - 2
zxing/src/main/java/com/google/zxing/client/android/constant/UrlConstants.java

1
package com.google.zxing.client.android.constant;
1
package com.google.zxing.client.android.constant;
2
2
3
public interface UrlConstants {
3
public interface UrlConstants {
4
//    String HOST_URL = "http://cdz.evcharge.cc/zhannew/basic/web/index.php/";
5
    String HOST_URL = "http://59.110.68.162/zhannew/basic/web/index.php/"; //测试链接
4
    String HOST_URL = "http://cdz.evcharge.cc/zhannew/basic/web/index.php/";
5
//    String HOST_URL = "http://59.110.68.162/zhannew/basic/web/index.php/"; //测试链接
6
6
7
    String USER_CHARGING_CHECK_URL = HOST_URL + "api/charge/check-user";
7
    String USER_CHARGING_CHECK_URL = HOST_URL + "api/charge/check-user";
8
    String START_CHARGING_URL = HOST_URL + "api/charge/start";
8
    String START_CHARGING_URL = HOST_URL + "api/charge/start";