浏览代码

代码修改

huyuguo 4 年之前
父节点
当前提交
243cec858a

+ 30 - 19
app/src/main/java/com/electric/chargingpile/activity/CarOwnerCertificateActivity.java

@ -230,7 +230,6 @@ public class CarOwnerCertificateActivity extends AppCompatActivity implements Vi
230 230
            }
231 231
232 232
233
234 233
            if ("自用".equals(carOwnerCertificateBean.getCartype())) {
235 234
                drivingLicenseType = "自用";
236 235
                driving_license_type_first.setCompoundDrawables(selected, null, null, null);
@ -254,9 +253,9 @@ public class CarOwnerCertificateActivity extends AppCompatActivity implements Vi
254 253
        if (showLoading)
255 254
            loadDialog.show();
256 255
        // https://www.jianshu.com/p/10382cc71127
257
        String url = "https://api.touchev.com:83/car/api/v1000/brand/list.do";
258
//        String url = "http://car.d1ev.com/car/api/v1000/brand/list.do";
259
        OkHttpUtils.get().url(url).build().connTimeOut(5000).readTimeOut(5000).execute(new StringCallback() {
256
//        String url = "https://api.touchev.com:83/car/api/v1000/brand/list.do";
257
        String url = "http://car.d1ev.com/car/api/v1000/brand/list.do";
258
        OkHttpUtils.get().url(url).build().connTimeOut(30000).readTimeOut(30000).execute(new StringCallback() {
260 259
            @Override
261 260
            public void onError(Call call, Exception e) {
262 261
                Toast.makeText(getApplicationContext(), "网络不给力,请检查网络状态", Toast.LENGTH_SHORT).show();
@ -498,11 +497,11 @@ public class CarOwnerCertificateActivity extends AppCompatActivity implements Vi
498 497
        drivingLicenseBase64Data = "data:image/png;base64," + base64;
499 498
        insertDialog.setMessage("正在识别行驶证");
500 499
        insertDialog.show();
501
        long appTime = System.currentTimeMillis() / 1000;
502
        long updateTime = appTime - MainMapActivity.cha - 1;
500
501
        long tokenTime = System.currentTimeMillis() / 1000 - MainMapActivity.cha - 1;
503 502
        String token = null;
504 503
        try {
505
            token = URLEncoder.encode(DES3.encode(String.valueOf(updateTime)));
504
            token = DES3.encode(String.valueOf(tokenTime));
506 505
        } catch (Exception e) {
507 506
            e.printStackTrace();
508 507
        }
@ -544,10 +543,26 @@ public class CarOwnerCertificateActivity extends AppCompatActivity implements Vi
544 543
            return;
545 544
        }
546 545
547
//        if (drivingLicenseBase64Data == null) {
548
//            ToastUtil.showToast(this, "请上传行驶证首页" + drivingLicenseType, Toast.LENGTH_SHORT);
549
//            return;
550
//        }
546
        if (drivingLicenseBase64Data == null) {
547
            ToastUtil.showToast(this, "请上传行驶证首页" + drivingLicenseType, Toast.LENGTH_SHORT);
548
            return;
549
        }
550
551
        if (TextUtils.isEmpty(plate_num.getText().toString().trim())) {
552
            ToastUtil.showToast(this, "请输入车牌号", Toast.LENGTH_SHORT);
553
            return;
554
        }
555
556
        if (TextUtils.isEmpty(engine_num.getText().toString().trim())) {
557
            ToastUtil.showToast(this, "请输入发动机号", Toast.LENGTH_SHORT);
558
            return;
559
        }
560
561
        if (TextUtils.isEmpty(register_date.getText().toString().trim())) {
562
            ToastUtil.showToast(this, "请输入注册日期", Toast.LENGTH_SHORT);
563
            return;
564
        }
565
551 566
552 567
        insertDialog.setMessage("数据提交中");
553 568
        insertDialog.show();
@ -570,19 +585,15 @@ public class CarOwnerCertificateActivity extends AppCompatActivity implements Vi
570 585
        map.put("cartype", drivingLicenseType);
571 586
        map.put("userid", MainApplication.userId);
572 587
573
        long appTime11 = System.currentTimeMillis() / 1000;
574
        long updatetime1 = appTime11 - MainMapActivity.cha - 5;
575
        String token1 = String.valueOf(updatetime1);
576
        String encode_token = null;
577
588
        long tokenTime = System.currentTimeMillis() / 1000 - MainMapActivity.cha - 1;
589
        String token = null;
578 590
        try {
579
            encode_token = DES3.encode(token1);
591
            token = DES3.encode(String.valueOf(tokenTime));
580 592
        } catch (Exception e) {
581 593
            e.printStackTrace();
582 594
        }
583
        String replace = URLEncoder.encode(encode_token);
584
        map.put("token", replace);
585 595
596
        map.put("token", token);
586 597
//        OkHttpUtils.postString().url(url).content(new Gson().toJson(map)).mediaType(MediaType.parse("application/json; charset=utf-8"))
587 598
        OkHttpUtils.post().params(map).url(url).build().execute(new StringCallback() {
588 599
            @Override

+ 6 - 9
app/src/main/java/com/electric/chargingpile/activity/CarOwnerCertificateListActivity.java

@ -110,11 +110,10 @@ public class CarOwnerCertificateListActivity extends AppCompatActivity {
110 110
    private void deleteCarOwnerCertificate(int id) {
111 111
        loadDialog.show();
112 112
113
        long appTime = System.currentTimeMillis() / 1000;
114
        long updateTime = appTime - MainMapActivity.cha - 1;
113
        long tokenTime = System.currentTimeMillis() / 1000 - MainMapActivity.cha - 1;
115 114
        String token = null;
116 115
        try {
117
            token = URLEncoder.encode(DES3.encode(String.valueOf(updateTime)));
116
            token = DES3.encode(String.valueOf(tokenTime));
118 117
        } catch (Exception e) {
119 118
            e.printStackTrace();
120 119
        }
@ -148,11 +147,10 @@ public class CarOwnerCertificateListActivity extends AppCompatActivity {
148 147
    private void setCarOwnerCertificateMain(int id) {
149 148
        loadDialog.show();
150 149
151
        long appTime = System.currentTimeMillis() / 1000;
152
        long updateTime = appTime - MainMapActivity.cha - 1;
150
        long tokenTime = System.currentTimeMillis() / 1000 - MainMapActivity.cha - 1;
153 151
        String token = null;
154 152
        try {
155
            token = URLEncoder.encode(DES3.encode(String.valueOf(updateTime)));
153
            token = DES3.encode(String.valueOf(tokenTime));
156 154
        } catch (Exception e) {
157 155
            e.printStackTrace();
158 156
        }
@ -181,11 +179,10 @@ public class CarOwnerCertificateListActivity extends AppCompatActivity {
181 179
    }
182 180
183 181
    private void getCarOwnerCertificateList() {
184
        long appTime = System.currentTimeMillis() / 1000;
185
        long updateTime = appTime - MainMapActivity.cha - 1;
182
        long tokenTime = System.currentTimeMillis() / 1000 - MainMapActivity.cha - 1;
186 183
        String token = null;
187 184
        try {
188
            token = URLEncoder.encode(DES3.encode(String.valueOf(updateTime)));
185
            token = DES3.encode(String.valueOf(tokenTime));
189 186
        } catch (Exception e) {
190 187
            e.printStackTrace();
191 188
        }

+ 9 - 1
app/src/main/java/com/electric/chargingpile/activity/UserCenterActivity.java

@ -1066,7 +1066,15 @@ public class UserCenterActivity extends Activity implements View.OnClickListener
1066 1066
1067 1067
    private void getCarOwnerCertificateList(String from) {
1068 1068
        loadDialog.show();
1069
        String url = MainApplication.url + "/zhannew/basic/web/index.php/car/my?userid=" + MainApplication.userId;
1069
        long tokenTime = System.currentTimeMillis() / 1000 - MainMapActivity.cha - 1;
1070
        String token = null;
1071
        try {
1072
            token = DES3.encode(String.valueOf(tokenTime));
1073
        } catch (Exception e) {
1074
            e.printStackTrace();
1075
        }
1076
1077
        String url = MainApplication.url + "/zhannew/basic/web/index.php/car/my?userid=" + MainApplication.userId + "&token=" + token;
1070 1078
        OkHttpUtils.get().url(url).build().connTimeOut(6000).readTimeOut(6000).execute(new StringCallback() {
1071 1079
            @Override
1072 1080
            public void onError(Call call, Exception e) {

+ 5 - 5
app/src/main/res/layout/activity_car_owner_certificate.xml

@ -165,7 +165,7 @@
165 165
                    android:id="@+id/driving_license_text_view"
166 166
                    android:layout_width="wrap_content"
167 167
                    android:layout_height="wrap_content"
168
                    android:text="上传行驶证首页(选填)"
168
                    android:text="上传行驶证首页"
169 169
                    android:textColor="#3D5545"
170 170
                    android:textSize="14sp"
171 171
                    app:layout_constraintBottom_toBottomOf="parent"
@ -206,7 +206,7 @@
206 206
                    <TextView
207 207
                        android:layout_width="90dp"
208 208
                        android:layout_height="wrap_content"
209
                        android:text="车牌号"
209
                        android:text="*车牌号"
210 210
                        android:textColor="#0D1120"
211 211
                        android:textSize="14sp"
212 212
                        android:textStyle="bold" />
@ -238,7 +238,7 @@
238 238
                    <TextView
239 239
                        android:layout_width="90dp"
240 240
                        android:layout_height="wrap_content"
241
                        android:text="发动机号"
241
                        android:text="*发动机号"
242 242
                        android:textColor="#0D1120"
243 243
                        android:textSize="14sp"
244 244
                        android:textStyle="bold" />
@ -270,7 +270,7 @@
270 270
                    <TextView
271 271
                        android:layout_width="90dp"
272 272
                        android:layout_height="wrap_content"
273
                        android:text="注册日期"
273
                        android:text="*注册日期"
274 274
                        android:textColor="#0D1120"
275 275
                        android:textSize="14sp"
276 276
                        android:textStyle="bold" />
@ -281,7 +281,7 @@
281 281
                        android:layout_height="match_parent"
282 282
                        android:layout_weight="1"
283 283
                        android:background="@null"
284
                        android:hint="请输入注册日期"
284
                        android:hint="*请输入注册日期"
285 285
                        android:inputType="text"
286 286
                        android:textColor="#0D1120"
287 287
                        android:textColorHint="#CBCBCB"