huyuguo 4 gadi atpakaļ
vecāks
revīzija
1922051b91

+ 1 - 1
app/build.gradle

@ -81,7 +81,7 @@ android {
81 81
            zipAlignEnabled true
82 82
            // 移除无用的resource文件
83 83
            //启用代码混淆
84
            minifyEnabled true
84
            minifyEnabled false
85 85
//            shrinkResources true
86 86
            //混淆规则配置文件
87 87
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'

+ 8 - 6
app/src/main/java/com/electric/chargingpile/activity/CarBrandActivity.java

@ -6,6 +6,7 @@ import androidx.recyclerview.widget.RecyclerView;
6 6
7 7
import android.content.Intent;
8 8
import android.os.Bundle;
9
import android.util.Log;
9 10
import android.view.View;
10 11
import android.widget.TextView;
11 12
@ -48,8 +49,14 @@ public class CarBrandActivity extends AppCompatActivity implements View.OnClickL
48 49
        CarBrandEvent event = EventBus.getDefault().removeStickyEvent(CarBrandEvent.class);
49 50
        if (event != null) {
50 51
            groups = event.getGroups();
52
            Log.e("abs======================",   groups.size() + "");
53
            String[] letters = new String[groups.size()];
54
            for (int i = 0; i < groups.size(); i++) {
55
                letters[i] = groups.get(i).getInitial();
56
                Log.e("abs======================",   letters[i] + "+" + groups.get(i).getInitial());
57
            }
58
//            LetterSideView.letters = letters;
51 59
        }
52
53 60
        findViewById(R.id.iv_back).setOnClickListener(this::onClick);
54 61
        letter_side_view = findViewById(R.id.letter_side_view);
55 62
        text_view_dialog = findViewById(R.id.text_view_dialog);
@ -75,11 +82,6 @@ public class CarBrandActivity extends AppCompatActivity implements View.OnClickL
75 82
            }
76 83
        });
77 84
78
        String[] letters = new String[groups.size()];
79
        for (int i = 0; i < groups.size(); i++) {
80
            letters[i] = groups.get(i).getInitial();
81
        }
82
        LetterSideView.letters = letters;
83 85
        letter_side_view.setVisibility(View.VISIBLE);
84 86
85 87
        recycler_view = (RecyclerView) findViewById(R.id.recycler_view);

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

@ -16,6 +16,7 @@ import android.net.Uri;
16 16
import android.os.Bundle;
17 17
import android.text.TextUtils;
18 18
import android.util.Base64;
19
import android.util.Log;
19 20
import android.view.View;
20 21
import android.view.WindowManager;
21 22
import android.widget.Button;
@ -573,6 +574,7 @@ public class CarOwnerCertificateActivity extends AppCompatActivity implements Vi
573 574
        long updatetime1 = appTime11 - MainMapActivity.cha - 5;
574 575
        String token1 = String.valueOf(updatetime1);
575 576
        String encode_token = null;
577
576 578
        try {
577 579
            encode_token = DES3.encode(token1);
578 580
        } catch (Exception e) {

+ 34 - 3
app/src/main/java/com/electric/chargingpile/activity/CarOwnerCertificateListActivity.java

@ -17,12 +17,14 @@ import com.electric.chargingpile.adapter.CarOwnerCertificateListAdapter;
17 17
import com.electric.chargingpile.application.MainApplication;
18 18
import com.electric.chargingpile.data.CarOwnerCertificateBean;
19 19
import com.electric.chargingpile.iview.RecyclerItemTypeClickListener;
20
import com.electric.chargingpile.util.DES3;
20 21
import com.electric.chargingpile.util.JsonUtils;
21 22
import com.electric.chargingpile.util.LoadingDialog;
22 23
import com.google.gson.Gson;
23 24
import com.zhy.http.okhttp.OkHttpUtils;
24 25
import com.zhy.http.okhttp.callback.StringCallback;
25 26
27
import java.net.URLEncoder;
26 28
import java.util.List;
27 29
28 30
import okhttp3.Call;
@ -107,7 +109,17 @@ public class CarOwnerCertificateListActivity extends AppCompatActivity {
107 109
108 110
    private void deleteCarOwnerCertificate(int id) {
109 111
        loadDialog.show();
110
        String url = MainApplication.url + "/zhannew/basic/web/index.php/car/del?userid=" + MainApplication.userId + "&id=" + id;
112
113
        long appTime = System.currentTimeMillis() / 1000;
114
        long updateTime = appTime - MainMapActivity.cha - 1;
115
        String token = null;
116
        try {
117
            token = URLEncoder.encode(DES3.encode(String.valueOf(updateTime)));
118
        } catch (Exception e) {
119
            e.printStackTrace();
120
        }
121
122
        String url = MainApplication.url + "/zhannew/basic/web/index.php/car/del?userid=" + MainApplication.userId + "&id=" + id + "&token=" + token;
111 123
        OkHttpUtils.get().url(url).build().connTimeOut(6000).readTimeOut(6000).execute(new StringCallback() {
112 124
            @Override
113 125
            public void onError(Call call, Exception e) {
@ -132,9 +144,19 @@ public class CarOwnerCertificateListActivity extends AppCompatActivity {
132 144
        });
133 145
    }
134 146
147
135 148
    private void setCarOwnerCertificateMain(int id) {
136 149
        loadDialog.show();
137
        String url = MainApplication.url + "/zhannew/basic/web/index.php/car/setmain?userid=" + MainApplication.userId + "&id=" + id;
150
151
        long appTime = System.currentTimeMillis() / 1000;
152
        long updateTime = appTime - MainMapActivity.cha - 1;
153
        String token = null;
154
        try {
155
            token = URLEncoder.encode(DES3.encode(String.valueOf(updateTime)));
156
        } catch (Exception e) {
157
            e.printStackTrace();
158
        }
159
        String url = MainApplication.url + "/zhannew/basic/web/index.php/car/setmain?userid=" + MainApplication.userId + "&id=" + id + "&token=" + token;
138 160
        OkHttpUtils.get().url(url).build().connTimeOut(6000).readTimeOut(6000).execute(new StringCallback() {
139 161
            @Override
140 162
            public void onError(Call call, Exception e) {
@ -159,7 +181,16 @@ public class CarOwnerCertificateListActivity extends AppCompatActivity {
159 181
    }
160 182
161 183
    private void getCarOwnerCertificateList() {
162
        String url = MainApplication.url + "/zhannew/basic/web/index.php/car/my?userid=" + MainApplication.userId;
184
        long appTime = System.currentTimeMillis() / 1000;
185
        long updateTime = appTime - MainMapActivity.cha - 1;
186
        String token = null;
187
        try {
188
            token = URLEncoder.encode(DES3.encode(String.valueOf(updateTime)));
189
        } catch (Exception e) {
190
            e.printStackTrace();
191
        }
192
193
        String url = MainApplication.url + "/zhannew/basic/web/index.php/car/my?userid=" + MainApplication.userId + "&token=" + token;
163 194
        OkHttpUtils.get().url(url).build().connTimeOut(6000).readTimeOut(6000).execute(new StringCallback() {
164 195
            @Override
165 196
            public void onError(Call call, Exception e) {

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

@ -440,13 +440,13 @@ public class ChargingQianDaoActivity extends Activity implements View.OnClickLis
440 440
                    iv_success.setOnClickListener(new View.OnClickListener() {
441 441
                        @Override
442 442
                        public void onClick(View view) {
443
                            if (!MainApplication.userCar.equals("") && !MainApplication.userCar.equals("nullnull")
444
                                    && !MainApplication.userCar.equals("null$$null") && !MainApplication.userCar.equals("$$")
445
                                    && MainApplication.userCar.length() > 0 && !MainApplication.userCar.equals("待购")) {
443
//                            if (!MainApplication.userCar.equals("") && !MainApplication.userCar.equals("nullnull")
444
//                                    && !MainApplication.userCar.equals("null$$null") && !MainApplication.userCar.equals("$$")
445
//                                    && MainApplication.userCar.length() > 0 && !MainApplication.userCar.equals("待购")) {
446 446
                                qiandao(1 + "");
447
                            } else {
448
                                ToastUtil.showToast(getApplicationContext(), "请您绑定车型继续提交", Toast.LENGTH_SHORT);
449
                            }
447
//                            } else {
448
//                                ToastUtil.showToast(getApplicationContext(), "请您绑定车型继续提交", Toast.LENGTH_SHORT);
449
//                            }
450 450
451 451
452 452
                        }

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

@ -619,7 +619,6 @@ public class RegisterActivity extends Activity implements OnClickListener {
619 619

620 620
                @Override
621 621
                public void onResponse(String response) {
622
//                    Log.e(TAG, "onResponse: "+response );
623 622
                    String rtnCode = JsonUtils.getKeyResult(response, "rtnCode");
624 623
                    if ("01".equals(rtnCode)) {
625 624
                        String data = JsonUtils.getKeyResult(response, "data");
@ -647,7 +646,6 @@ public class RegisterActivity extends Activity implements OnClickListener {
647 646
    }
648 647

649 648
    private void saveUserInfo(String info) {
650
//        Log.e(TAG, "saveUserInfo: "+info );
651 649
        String userid = JsonUtils.getKeyResult(info, "userid");
652 650
        String nickname = JsonUtils.getKeyResult(info, "nickname");
653 651
        String tel = JsonUtils.getKeyResult(info, "tel");

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

@ -107,8 +107,8 @@ public class SkipUserInfoActivity extends Activity implements View.OnClickListen
107 107
    String chexing;
108 108
    public static final int REQUSET = 11;
109 109
    String select_pinpai = "", select_chexing = "";
110
    private TextView tv_point, tv_buy;
111
    private RelativeLayout rl_point, rl_isBuy;
110
    private TextView tv_point;
111
    private RelativeLayout rl_point;
112 112
    private Bitmap download_bmp;
113 113
    private File fileUri = new File(Environment.getExternalStorageDirectory().getPath() + "/photo.jpg");
114 114
    private File fileCropUri = new File(Environment.getExternalStorageDirectory().getPath() + "/crop_photo.jpg");
@ -130,10 +130,7 @@ public class SkipUserInfoActivity extends Activity implements View.OnClickListen
130 130
    }
131 131
132 132
    private void initView() {
133
        rl_isBuy = (RelativeLayout) findViewById(R.id.rl_isBuy);
134
        rl_isBuy.setOnClickListener(this);
135 133
        rl_point = (RelativeLayout) findViewById(R.id.rl_point);
136
        tv_buy = (TextView) findViewById(R.id.tv_buy);
137 134
        tv_point = (TextView) findViewById(R.id.tv_point);
138 135
139 136
        et_car = (TextView) findViewById(R.id.et_che);
@ -181,8 +178,6 @@ public class SkipUserInfoActivity extends Activity implements View.OnClickListen
181 178
        });
182 179
183 180
        iconPic = (RoundImageView) findViewById(R.id.iv_user_icon);
184
//        setIcon();
185
186 181
        tv_save = (TextView) findViewById(R.id.tv_make_sure);
187 182
        tv_save.setOnClickListener(this);
188 183
@ -407,85 +402,12 @@ public class SkipUserInfoActivity extends Activity implements View.OnClickListen
407 402
            spinnerCity.setSelection(default_type);
408 403
            default_type = -1;
409 404
        }
410
//		if (currentProvince.getCities().size() > 0) {
411
//			cityAdapter.notifyDataSetChanged();
412
//			spinnerCity.setSelection(0);
413
//		}
414 405
    }
415 406
416 407
417 408
    @Override
418 409
    public void onClick(View v) {
419 410
        switch (v.getId()) {
420
            case R.id.rl_isBuy:
421
                LayoutInflater inflater1 = (LayoutInflater) getSystemService(mContext.LAYOUT_INFLATER_SERVICE);
422
                View popupWindowView = inflater1.inflate(R.layout.layout_isbuy, null);
423
                final PopupWindow popupWindow1 = new PopupWindow(popupWindowView,
424
                        ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.FILL_PARENT,
425
                        true);
426
                popupWindow1.setBackgroundDrawable(getResources().getDrawable(R.drawable.bg_yinying531));
427
                popupWindow1.setOutsideTouchable(true);
428
                popupWindowView.setOnKeyListener(new View.OnKeyListener() {
429
                    @Override
430
                    public boolean onKey(View v, int keyCode, KeyEvent event) {
431
                        if ((keyCode == KeyEvent.KEYCODE_MENU) && (popupWindow1.isShowing())) {
432
                            popupWindow1.dismiss();
433
                            return true;
434
                        }
435
                        return false;
436
                    }
437
                });
438
                popupWindowView.setOnTouchListener(new View.OnTouchListener() {
439
440
                    @Override
441
                    public boolean onTouch(View v, MotionEvent event) {
442
                        if (popupWindow1.isShowing()) {
443
                            popupWindow1.dismiss();
444
                        }
445
                        return false;
446
                    }
447
                });
448
                // 设置PopupWindow的弹出和消失效果
449
                popupWindow1.setAnimationStyle(R.style.popupAnimation);
450
                Button cancleButton = (Button) popupWindowView
451
                        .findViewById(R.id.cancleButton);
452
                cancleButton.setOnClickListener(new View.OnClickListener() {
453
                    @Override
454
                    public void onClick(View view) {
455
                        popupWindow1.dismiss();
456
                    }
457
                });
458
                Button btn_one = (Button) popupWindowView.findViewById(R.id.tvTwo);
459
                btn_one.setOnClickListener(new View.OnClickListener() {
460
                    @Override
461
                    public void onClick(View view) {
462
                        tv_buy.setText("已购买");
463
                        rl_select_car.setVisibility(View.VISIBLE);
464
465
//                        Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
466
//                        intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(new File(
467
//                                Environment.getExternalStorageDirectory(), "androidapp.jpg")));
468
//                        ((Activity) mContext).startActivityForResult(intent, 2);
469
                        popupWindow1.dismiss();
470
                    }
471
                });
472
                Button btn_two = (Button) popupWindowView.findViewById(R.id.tvThree);
473
                btn_two.setOnClickListener(new View.OnClickListener() {
474
                    @Override
475
                    public void onClick(View view) {
476
                        tv_buy.setText("未购买");
477
                        rl_select_car.setVisibility(View.GONE);
478
//                        Intent intent = new Intent(Intent.ACTION_PICK, null);
479
//                        intent.setDataAndType(
480
//                                MediaStore.Images.Media.EXTERNAL_CONTENT_URI,
481
//                                "image/*");
482
//                        startActivityForResult(intent, 1);
483
                        popupWindow1.dismiss();
484
                    }
485
                });
486
487
                popupWindow1.showAtLocation(cancleButton, Gravity.CENTER, 0, 0);
488
                break;
489 411
            case R.id.rl_select_car:
490 412
                startActivityForResult(new Intent(SkipUserInfoActivity.this, SelectCarActivity.class), REQUSET);
491 413
                break;
@ -548,24 +470,12 @@ public class SkipUserInfoActivity extends Activity implements View.OnClickListen
548 470
549 471
    private boolean checkText() {
550 472
        String nickName = et_nickName.getText().toString().trim();
551
        String isBuy = tv_buy.getText().toString().trim();
552 473
        String carType = et_car.getText().toString().trim();
553 474
554 475
        if (TextUtils.isEmpty(nickName)) {
555 476
            Toast.makeText(this, "请输入您的昵称", Toast.LENGTH_SHORT).show();
556 477
            return false;
557 478
        }
558
        if (TextUtils.isEmpty(isBuy)) {
559
            Toast.makeText(this, "请选择您是否购买了新能源汽车", Toast.LENGTH_SHORT).show();
560
            return false;
561
        }
562
        if (isBuy.equals("已购买")) {
563
            if (TextUtils.isEmpty(carType)) {
564
                Toast.makeText(this, "请选择您购买的车型", Toast.LENGTH_SHORT).show();
565
                return false;
566
            }
567
        }
568
569 479
570 480
        return true;
571 481
    }
@ -600,18 +510,7 @@ public class SkipUserInfoActivity extends Activity implements View.OnClickListen
600 510
        Log.i("cha---", MainMapActivity.cha + "");
601 511
        String token = String.valueOf(updatetime);
602 512
        Log.i("token---", token);
603
604
        if (tv_buy.getText().toString().equals("未购买")) {
605
            havecar = "待购";
606
        } else {
607
            if (null != car_type && null != car_brand) {
608
                havecar = car_brand + "$$" + car_type;
609
            }
610
        }
611
612 513
        nocar = "";
613
614
615 514
        try {
616 515
            if (photo != null) {
617 516

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

@ -49,6 +49,7 @@ import com.electric.chargingpile.R;
49 49
import com.electric.chargingpile.application.MainApplication;
50 50
import com.electric.chargingpile.data.Adin;
51 51
import com.electric.chargingpile.data.CarOwnerCertificateBean;
52
import com.electric.chargingpile.entity.CarSeriesEntity;
52 53
import com.electric.chargingpile.manager.ProfileManager;
53 54
import com.electric.chargingpile.util.DES3;
54 55
import com.electric.chargingpile.util.JsonUtils;
@ -65,6 +66,7 @@ import com.electric.chargingpile.view.SignInDialog;
65 66
import com.google.android.gms.appindexing.Action;
66 67
import com.google.android.gms.appindexing.AppIndex;
67 68
import com.google.android.gms.common.api.GoogleApiClient;
69
import com.google.gson.Gson;
68 70
import com.squareup.okhttp.Request;
69 71
import com.squareup.okhttp.Response;
70 72
import com.squareup.picasso.Picasso;
@ -172,6 +174,7 @@ public class UserCenterActivity extends Activity implements View.OnClickListener
172 174
     */
173 175
    private GoogleApiClient client;
174 176
    private ImageView chat_share_bar;
177
    private TextView car_owner_certificate_label;
175 178
176 179
    //把一个url的网络图片变成一个本地的BitMap
177 180
    public Bitmap returnBitMap(final String url) {
@ -365,6 +368,8 @@ public class UserCenterActivity extends Activity implements View.OnClickListener
365 368
        llPerson = (RelativeLayout) findViewById(R.id.ll_person);
366 369
        llPerson.setOnClickListener(this);
367 370
371
        car_owner_certificate_label = findViewById(R.id.car_owner_certificate_label);
372
368 373
        //登陆按钮
369 374
        userLogin = (TextView) findViewById(R.id.userLogin);
370 375
        userLogin.setOnClickListener(this);
@ -431,6 +436,8 @@ public class UserCenterActivity extends Activity implements View.OnClickListener
431 436
432 437
        set_loginShow();
433 438
439
        getCarOwnerCertificateList("init");
440
434 441
    }
435 442
436 443
    private void getSharePrompt(String user_id) {
@ -1097,7 +1104,7 @@ public class UserCenterActivity extends Activity implements View.OnClickListener
1097 1104
                            intent.putExtra("url", "https://www.d1ev.com/special/models/wap/webView/index.html");
1098 1105
                            startActivity(intent);
1099 1106
                        }
1100
                    } else {
1107
                    } else if ("certificate".equals(from)) {
1101 1108
                        if (list.size() == 0) {
1102 1109
                            startActivity(new Intent(getApplication(), CarOwnerCertificateActivity.class));
1103 1110
                        } else {
@ -1105,6 +1112,24 @@ public class UserCenterActivity extends Activity implements View.OnClickListener
1105 1112
                            intent.putExtra("data", data);
1106 1113
                            startActivity(intent);
1107 1114
                        }
1115
                    } else if ("init".equals(from)) {
1116
                        boolean certificated = false;
1117
                        String chexing = "";
1118
                        for (CarOwnerCertificateBean bean : list) {
1119
                            if (bean.getStatus() == 1 && bean.getMain() == 1) {
1120
                                certificated = true;
1121
                                chexing = bean.getChexing();
1122
                                break;
1123
                            }
1124
                        }
1125
                        if (certificated) {
1126
                            Gson gson = new Gson();
1127
                            CarSeriesEntity carSeriesEntity = gson.fromJson(chexing, CarSeriesEntity.class);
1128
                            car_owner_certificate_label.setText(carSeriesEntity.getSeriesName());
1129
                        } else {
1130
                            car_owner_certificate_label.setText("认证车主得充电红包");
1131
                        }
1132
1108 1133
                    }
1109 1134
                } else {
1110 1135
                    String rtnMsg = JsonUtils.getKeyResult(response, "rtnMsg");

+ 0 - 49
app/src/main/res/layout/activity_skip_user_info.xml

@ -158,55 +158,6 @@
158 158
            <View
159 159
                android:layout_width="match_parent"
160 160
                android:layout_height="0.5dp"
161
                android:background="@color/in_line"
162
                android:layout_marginLeft="16dp" />
163
164
            <RelativeLayout
165
                android:id="@+id/rl_isBuy"
166
                android:layout_width="fill_parent"
167
                android:background="@color/white"
168
                android:layout_height="45dp"
169
                android:visibility="visible">
170
                <TextView
171
                    android:layout_width="wrap_content"
172
                    android:layout_height="match_parent"
173
                    android:text="是否购买新能源汽车"
174
                    android:textColor="@color/title_row"
175
                    android:textSize="15sp"
176
                    android:paddingLeft="16dp"
177
                    android:gravity="center"/>
178
179
                <TextView
180
                    android:id="@+id/tv_buy"
181
                    android:layout_width="wrap_content"
182
                    android:layout_height="45dp"
183
                    android:background="@color/white"
184
                    android:hint="请选择"
185
                    android:textColorHint="@color/hintColor"
186
                    android:gravity="center|right"
187
                    android:singleLine="true"
188
                    android:textColor="@color/ui_62"
189
                    android:textSize="15sp"
190
                    android:layout_alignParentTop="true"
191
                    android:layout_marginRight="8dp"
192
                    android:layout_toLeftOf="@+id/imageView14"
193
                    android:layout_toStartOf="@+id/imageView14" />
194
195
                <ImageView
196
                    android:layout_width="wrap_content"
197
                    android:layout_height="match_parent"
198
                    android:src="@drawable/icon_more2_0"
199
                    android:layout_centerVertical="true"
200
                    android:layout_alignParentRight="true"
201
                    android:layout_alignParentEnd="true"
202
                    android:layout_marginRight="16dp"
203
                    android:id="@+id/imageView14" />
204
205
            </RelativeLayout>
206
207
            <View
208
                android:layout_width="match_parent"
209
                android:layout_height="0.5dp"
210 161
                android:background="@color/ui_line"
211 162
                android:layout_marginLeft="16dp"
212 163
                android:visibility="visible"/>

+ 22 - 0
app/src/main/res/layout/activity_user_center.xml

@ -501,6 +501,17 @@
501 501
                            android:textSize="15sp" />
502 502
503 503
                        <TextView
504
                            android:id="@+id/car_owner_certificate_label"
505
                            android:layout_width="wrap_content"
506
                            android:layout_height="match_parent"
507
                            android:layout_toLeftOf="@+id/iv_certificate_cursor"
508
                            android:text=""
509
                            android:textSize="14sp"
510
                            android:gravity="center_vertical"
511
                            android:layout_marginRight="12dp"
512
                            android:textColor="@color/lvse"/>
513
                        <TextView
514
                            android:id="@+id/iv_certificate_cursor"
504 515
                            android:layout_width="wrap_content"
505 516
                            android:layout_height="wrap_content"
506 517
                            android:layout_alignParentTop="true"
@ -543,6 +554,17 @@
543 554
544 555
                        <TextView
545 556
                            android:layout_width="wrap_content"
557
                            android:layout_height="match_parent"
558
                            android:layout_toLeftOf="@+id/iv_price_cursor"
559
                            android:text="发表成交价得充电红包"
560
                            android:textSize="14sp"
561
                            android:gravity="center_vertical"
562
                            android:layout_marginRight="12dp"
563
                            android:textColor="@color/lvse"/>
564
565
                        <TextView
566
                            android:id="@+id/iv_price_cursor"
567
                            android:layout_width="wrap_content"
546 568
                            android:layout_height="wrap_content"
547 569
                            android:layout_alignParentTop="true"
548 570
                            android:layout_alignParentRight="true"