Browse Source

修复认证车主,意向车型的bug

hy 3 years ago
parent
commit
7aa4a63b25

+ 9 - 48
app/src/main/java/com/electric/chargingpile/activity/CarModelActivity.java

21
import com.electric.chargingpile.entity.CarModelEntity;
21
import com.electric.chargingpile.entity.CarModelEntity;
22
import com.electric.chargingpile.entity.CarModelGroupEntity;
22
import com.electric.chargingpile.entity.CarModelGroupEntity;
23
import com.electric.chargingpile.entity.CarSeriesEntity;
23
import com.electric.chargingpile.entity.CarSeriesEntity;
24
import com.electric.chargingpile.event.CarIntentModelEvent;
24
import com.electric.chargingpile.event.CarModelEvent;
25
import com.electric.chargingpile.event.CarModelEvent;
25
import com.electric.chargingpile.event.CarSeriesEvent;
26
import com.electric.chargingpile.event.CarSeriesEvent;
26
import com.electric.chargingpile.manager.ProfileManager;
27
import com.electric.chargingpile.manager.ProfileManager;
47
48
48
/**
49
/**
49
 * 车型选择
50
 * 车型选择
50
 * */
51
 */
51
public class CarModelActivity extends AppCompatActivity implements View.OnClickListener {
52
public class CarModelActivity extends AppCompatActivity implements View.OnClickListener {
52
53
53
    private RecyclerView recycler_view;
54
    private RecyclerView recycler_view;
124
        return carModelEntity;
125
        return carModelEntity;
125
    }
126
    }
126
127
127
    private void requestCarIntentModel( CarModelEntity carModelEntity) {
128
        loadDialog.show();
128
    private void requestCarIntentModel(CarModelEntity carModelEntity) {
129
        EventBus.getDefault().postSticky(new CarIntentModelEvent(carModelEntity));
129
        String sourceType = CarBrandActivity.sourceType;
130
        String sourceType = CarBrandActivity.sourceType;
131
        CarBrandActivity.sourceType = "";
130
132
131
        String url = MainApplication.url + "/zhannew/basic/web/index.php/car/add";
132
133
        long tokenTime = System.currentTimeMillis() / 1000 - MainMapActivity.cha - 1;
134
        String token = null;
135
        try {
136
            token = DES3.encode(String.valueOf(tokenTime));
137
        } catch (Exception e) {
138
            e.printStackTrace();
133
        if (sourceType.equals("1")) {
134
            startActivity(new Intent(CarModelActivity.this, UserInfoActivity.class));
135
        } else if (sourceType.equals("2")) {
136
            startActivity(new Intent(CarModelActivity.this, SkipUserInfoActivity.class));
139
        }
137
        }
140
        Map<String, String> map = new HashMap<>();
141
        map.put("engine_number", "yixiang");
142
        map.put("plate_number", "意向");
143
        map.put("cartype", "自用");
144
        map.put("userid", MainApplication.userId);
145
        map.put("token", token);
146
147
        Gson gson = new Gson();
148
        String chexing = gson.toJson(carModelEntity);
149
        map.put("chexing", chexing);
150
151
        OkHttpUtils.post().params(map).url(url).build().execute(new StringCallback() {
152
153
            @Override
154
            public void onError(Call call, Exception e) {
155
                loadDialog.dismiss();
156
            }
157
138
158
            @Override
159
            public void onResponse(String response) {
160
                loadDialog.dismiss();
161
                String rtnCode = JsonUtils.getKeyResult(response, "rtnCode");
162
                if ("01".equals(rtnCode)) {
163
                    ToastUtil.showToast(getApplicationContext(), "意向车型提交成功", Toast.LENGTH_SHORT);
164
                    finish();
165
                    MainApplication.userCarIntentMode= carSeriesEntity.getSeriesName();
166
                    ProfileManager.getInstance().setCarIntentModel(CarModelActivity.this,carSeriesEntity.getSeriesName());
167
                    if (sourceType.equals("1")){
168
                        startActivity(new Intent(CarModelActivity.this, UserInfoActivity.class));
169
                    }else if (sourceType.equals("2")){
170
                        startActivity(new Intent(CarModelActivity.this, SkipUserInfoActivity.class));
171
172
                    }
173
                } else {
174
                    ToastUtil.showToast(getApplicationContext(), "意向车型提交失败,请重新提交", Toast.LENGTH_SHORT);
175
                }
176
            }
177
        });
178
    }
139
    }
179
140
180
    private void getModelList() {
141
    private void getModelList() {

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

13
import androidx.recyclerview.widget.LinearLayoutManager;
13
import androidx.recyclerview.widget.LinearLayoutManager;
14
import androidx.recyclerview.widget.RecyclerView;
14
import androidx.recyclerview.widget.RecyclerView;
15
15
16
import com.alibaba.fastjson.JSONException;
16
import com.electric.chargingpile.R;
17
import com.electric.chargingpile.R;
17
import com.electric.chargingpile.adapter.CarOwnerCertificateListAdapter;
18
import com.electric.chargingpile.adapter.CarOwnerCertificateListAdapter;
18
import com.electric.chargingpile.application.MainApplication;
19
import com.electric.chargingpile.application.MainApplication;
231
                String rtnCode = JsonUtils.getKeyResult(response, "rtnCode");
232
                String rtnCode = JsonUtils.getKeyResult(response, "rtnCode");
232
                if ("01".equals(rtnCode)) {
233
                if ("01".equals(rtnCode)) {
233
                    String data = JsonUtils.getKeyResult(response, "data");
234
                    String data = JsonUtils.getKeyResult(response, "data");
234
                    mList = JsonUtils.parseToObjectList(data, CarOwnerCertificateBean.class);
235
                    try {
236
                        mList = JsonUtils.parseToObjectList(data, CarOwnerCertificateBean.class);
237
                    }catch (JSONException e){
238
239
                    }
235
                    Log.e("TAG", "onResponse: "+mList.size() );
240
                    Log.e("TAG", "onResponse: "+mList.size() );
236
                    for (int i = mList.size()-1; i >= 0; i--) {
241
                    for (int i = mList.size()-1; i >= 0; i--) {
237
                        CarOwnerCertificateBean bean = mList.get(i);
242
                        CarOwnerCertificateBean bean = mList.get(i);

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

24
import android.widget.TextView;
24
import android.widget.TextView;
25
import android.widget.Toast;
25
import android.widget.Toast;
26
26
27
import com.alibaba.fastjson.JSONException;
27
import com.blankj.utilcode.util.ActivityUtils;
28
import com.blankj.utilcode.util.ActivityUtils;
28
import com.blankj.utilcode.util.EmptyUtils;
29
import com.blankj.utilcode.util.EmptyUtils;
29
import com.blankj.utilcode.util.LogUtils;
30
import com.blankj.utilcode.util.LogUtils;
53
54
54
import java.net.URLEncoder;
55
import java.net.URLEncoder;
55
import java.text.SimpleDateFormat;
56
import java.text.SimpleDateFormat;
57
import java.util.ArrayList;
56
import java.util.Calendar;
58
import java.util.Calendar;
57
import java.util.Date;
59
import java.util.Date;
58
import java.util.List;
60
import java.util.List;
823
                if ("01".equals(rtnCode)) {
825
                if ("01".equals(rtnCode)) {
824
                    String chexing = "";
826
                    String chexing = "";
825
                    String data = JsonUtils.getKeyResult(response, "data");
827
                    String data = JsonUtils.getKeyResult(response, "data");
826
                    List<CarOwnerCertificateBean> list = JsonUtils.parseToObjectList(data, CarOwnerCertificateBean.class);
828
                    List<CarOwnerCertificateBean> list=new ArrayList<>();
829
                    try {
830
                        list = JsonUtils.parseToObjectList(data, CarOwnerCertificateBean.class);
831
                    }catch (JSONException e){
832
833
                    }
834
827
                    boolean certificated = false;
835
                    boolean certificated = false;
828
                    for (CarOwnerCertificateBean bean : list) {
836
                    for (CarOwnerCertificateBean bean : list) {
829
                        if (bean.getStatus() != 2) { //排除意向车型,则证明用户已经车主认证过了
837
                        if (bean.getStatus() != 2) { //排除意向车型,则证明用户已经车主认证过了

+ 7 - 1
app/src/main/java/com/electric/chargingpile/activity/MyWebViewActivity.java

47
47
48
import com.afollestad.materialdialogs.DialogAction;
48
import com.afollestad.materialdialogs.DialogAction;
49
import com.afollestad.materialdialogs.MaterialDialog;
49
import com.afollestad.materialdialogs.MaterialDialog;
50
import com.alibaba.fastjson.JSONException;
50
import com.blankj.utilcode.util.LogUtils;
51
import com.blankj.utilcode.util.LogUtils;
51
import com.bumptech.glide.Glide;
52
import com.bumptech.glide.Glide;
52
import com.bumptech.glide.request.target.CustomTarget;
53
import com.bumptech.glide.request.target.CustomTarget;
1715
                String rtnCode = JsonUtils.getKeyResult(response, "rtnCode");
1716
                String rtnCode = JsonUtils.getKeyResult(response, "rtnCode");
1716
                if ("01".equals(rtnCode)) {
1717
                if ("01".equals(rtnCode)) {
1717
                    String data = JsonUtils.getKeyResult(response, "data");
1718
                    String data = JsonUtils.getKeyResult(response, "data");
1718
                    List<CarOwnerCertificateBean> list = JsonUtils.parseToObjectList(data, CarOwnerCertificateBean.class);
1719
                    List<CarOwnerCertificateBean> list =new ArrayList<>();
1720
                    try{
1721
                         list = JsonUtils.parseToObjectList(data, CarOwnerCertificateBean.class);
1722
                    }catch (JSONException e){
1723
1724
                    }
1719
                    if (list.size() == 0) {
1725
                    if (list.size() == 0) {
1720
                        startActivity(new Intent(getApplication(), CarOwnerCertificateActivity.class));
1726
                        startActivity(new Intent(getApplication(), CarOwnerCertificateActivity.class));
1721
                    } else {
1727
                    } else {

+ 122 - 39
app/src/main/java/com/electric/chargingpile/activity/SkipUserInfoActivity.java

30
import android.widget.CompoundButton;
30
import android.widget.CompoundButton;
31
import android.widget.EditText;
31
import android.widget.EditText;
32
import android.widget.ImageView;
32
import android.widget.ImageView;
33
import android.widget.LinearLayout;
33
import android.widget.PopupWindow;
34
import android.widget.PopupWindow;
34
import android.widget.RelativeLayout;
35
import android.widget.RelativeLayout;
35
import android.widget.Spinner;
36
import android.widget.Spinner;
44
import com.electric.chargingpile.data.CarOwnerCertificateBean;
45
import com.electric.chargingpile.data.CarOwnerCertificateBean;
45
import com.electric.chargingpile.data.Cars;
46
import com.electric.chargingpile.data.Cars;
46
import com.electric.chargingpile.data.Province;
47
import com.electric.chargingpile.data.Province;
48
import com.electric.chargingpile.entity.CarModelEntity;
47
import com.electric.chargingpile.entity.CarSeriesEntity;
49
import com.electric.chargingpile.entity.CarSeriesEntity;
50
import com.electric.chargingpile.event.CarIntentModelEvent;
51
import com.electric.chargingpile.event.CarModelEvent;
48
import com.electric.chargingpile.manager.ProfileManager;
52
import com.electric.chargingpile.manager.ProfileManager;
49
import com.electric.chargingpile.util.ActivityManagerApplication;
53
import com.electric.chargingpile.util.ActivityManagerApplication;
50
import com.electric.chargingpile.util.BarColorUtil;
54
import com.electric.chargingpile.util.BarColorUtil;
56
import com.electric.chargingpile.util.OkHttpUtil;
60
import com.electric.chargingpile.util.OkHttpUtil;
57
import com.electric.chargingpile.util.PhotoUtils;
61
import com.electric.chargingpile.util.PhotoUtils;
58
import com.electric.chargingpile.util.StatusConstants;
62
import com.electric.chargingpile.util.StatusConstants;
63
import com.electric.chargingpile.util.ToastUtil;
59
import com.electric.chargingpile.util.UploadUtil;
64
import com.electric.chargingpile.util.UploadUtil;
60
import com.electric.chargingpile.view.CustomProgressDialog;
65
import com.electric.chargingpile.view.CustomProgressDialog;
61
import com.electric.chargingpile.view.RoundImageView;
66
import com.electric.chargingpile.view.RoundImageView;
66
import com.zhy.http.okhttp.OkHttpUtils;
71
import com.zhy.http.okhttp.OkHttpUtils;
67
import com.zhy.http.okhttp.callback.StringCallback;
72
import com.zhy.http.okhttp.callback.StringCallback;
68
73
74
import org.greenrobot.eventbus.EventBus;
75
import org.greenrobot.eventbus.Subscribe;
76
import org.greenrobot.eventbus.ThreadMode;
77
import org.jetbrains.annotations.NotNull;
69
import org.json.JSONArray;
78
import org.json.JSONArray;
70
import org.json.JSONException;
79
import org.json.JSONException;
71
import org.json.JSONObject;
80
import org.json.JSONObject;
128
    private SkipUserInfoActivity activity;
137
    private SkipUserInfoActivity activity;
129
138
130
    private LoadingDialog loadDialog;
139
    private LoadingDialog loadDialog;
131
    // 1.去认证车主(获得充电优惠)      > 2.认证车主             审核中  3.认证车主             宝马
132
    private int certificateStatus = 0; // 1 去认证  2审核中  3认证车主
133
    private RelativeLayout go_certificate;
140
    // -2 -> 去认证, -1 -> 认证失败,0 -> 审核中,1 -> 表示通过审核,2 -> 表示意向车型。
141
    private int certificateStatus = -2;
142
    private LinearLayout go_certificate;
134
    private TextView go_title;
143
    private TextView go_title;
135
    private TextView go_desc;
144
    private TextView go_desc;
136
    private ImageView go_cursor;
145
    private ImageView go_cursor;
137
    private RelativeLayout carIntentModel;
146
    private LinearLayout carIntentModel;
138
    private TextView carModel;
147
    private TextView carModel;
139
148
149
    private CarModelEntity mCarModelEntity;
150
140
    @Override
151
    @Override
141
    protected void onCreate(Bundle savedInstanceState) {
152
    protected void onCreate(Bundle savedInstanceState) {
142
        super.onCreate(savedInstanceState);
153
        super.onCreate(savedInstanceState);
144
        mContext = this;
155
        mContext = this;
145
        activity = this;
156
        activity = this;
146
        BarColorUtil.initStatusBarColor(SkipUserInfoActivity.this);
157
        BarColorUtil.initStatusBarColor(SkipUserInfoActivity.this);
158
        EventBus.getDefault().register(this);
159
147
        initView();
160
        initView();
148
        getFromServer();
161
        getFromServer();
149
        spinner();
162
        spinner();
172
        rl_icon = (RelativeLayout) findViewById(R.id.rl_icon);
185
        rl_icon = (RelativeLayout) findViewById(R.id.rl_icon);
173
        rl_icon.setOnClickListener(this);
186
        rl_icon.setOnClickListener(this);
174
187
175
        carIntentModel = (RelativeLayout) findViewById(R.id.carIntentModel);
188
        carIntentModel = findViewById(R.id.carIntentModel);
176
        carIntentModel.setOnClickListener(this);
189
        carIntentModel.setOnClickListener(this);
177
190
178
        btn_sex = (ToggleButton) findViewById(R.id.sex_button);
191
        btn_sex = (ToggleButton) findViewById(R.id.sex_button);
472
                            shite("");
485
                            shite("");
473
                        }
486
                        }
474
                    }).start();
487
                    }).start();
488
                    if (mCarModelEntity!=null){
489
                        requestCarIntentModel();
490
                    }
475
                    createDialog();
491
                    createDialog();
476
                }
492
                }
477
                break;
493
                break;
478
            case R.id.go_certificate:
494
            case R.id.go_certificate:
479
                // 1 去认证  2审核中  3认证车主
480
                if (certificateStatus == 0) {
495
                if (certificateStatus == -2) {
481
                    getCarOwnerCertificateList(true);
496
                    getCarOwnerCertificateList(true);
482
                } else if (certificateStatus == 1) {
483
                    startActivity(new Intent(getApplication(), CarOwnerCertificateActivity.class));
484
                }
497
                }
485
                break;
498
                break;
486
            case  R.id.carIntentModel:
487
                 CarBrandActivity.actionStart(this,"2");
499
            case R.id.carIntentModel:
500
                CarBrandActivity.actionStart(this, "2");
488
                break;
501
                break;
489
        }
502
        }
490
503
627
        return result;
640
        return result;
628
    }
641
    }
629
642
630
    @Override
631
    protected void onResume() {
632
        super.onResume();
633
        String carIntentModel = ProfileManager.getInstance().getCarIntentModel(this);
634
643
635
        if (!TextUtils.isEmpty(carIntentModel)){
636
            carModel.setText(carIntentModel);
637
        }
644
    @Override
645
    protected void onDestroy() {
646
        super.onDestroy();
647
        EventBus.getDefault().unregister(this);
638
    }
648
    }
639
649
640
    @Override
650
    @Override
925
935
926
    }
936
    }
927
937
938
    @Override
939
    protected void onResume() {
940
        super.onResume();
941
        getCarOwnerCertificateList(false);
942
    }
943
928
    private void getCarOwnerCertificateList(Boolean showLoading) {
944
    private void getCarOwnerCertificateList(Boolean showLoading) {
929
        if (showLoading) {
945
        if (showLoading) {
930
            loadDialog.show();
946
            loadDialog.show();
958
                String rtnCode = JsonUtils.getKeyResult(response, "rtnCode");
974
                String rtnCode = JsonUtils.getKeyResult(response, "rtnCode");
959
                if ("01".equals(rtnCode)) {
975
                if ("01".equals(rtnCode)) {
960
                    String data = JsonUtils.getKeyResult(response, "data");
976
                    String data = JsonUtils.getKeyResult(response, "data");
961
                    List<CarOwnerCertificateBean> list = JsonUtils.parseToObjectList(data, CarOwnerCertificateBean.class);
977
                    List<CarOwnerCertificateBean> list = new ArrayList<>();
978
                    try {
979
                        list = JsonUtils.parseToObjectList(data, CarOwnerCertificateBean.class);
980
                    } catch (com.alibaba.fastjson.JSONException e) {
981
982
                    }
983
962
                    CarSeriesEntity carSeriesEntity = null;
984
                    CarSeriesEntity carSeriesEntity = null;
963
                    // 1 去认证  2审核中  3认证车主
964
                    if (list.size() == 0) {
965
                        certificateStatus = 1;
966
                    } else {
967
                        certificateStatus = 2;
968
985
969
                        boolean isCertifiedOwner=true;//是否是已通过认证车主
970
                        boolean isVerified=true;//是否是已认证车主
971
                        boolean isCarIntendedModel=true;//是否是意向车型
986
                    if (list.size() != 0) {
987
988
                        boolean isCertifiedOwner = true;//是否是已通过认证车主
989
                        boolean isVerified = true;//是否是已认证车主
990
                        boolean isCarIntendedModel = true;//是否是意向车型
972
991
973
                        Gson gson = new Gson();
992
                        Gson gson = new Gson();
974
                        for (CarOwnerCertificateBean bean : list) {
993
                        for (CarOwnerCertificateBean bean : list) {
975
                            //获取已通过车主认证车型
994
                            //获取已通过车主认证车型
976
                            if (bean.getStatus() == 1 && bean.getMain() == 1 && isCertifiedOwner) {
995
                            if (bean.getStatus() == 1 && bean.getMain() == 1 && isCertifiedOwner) {
977
                                certificateStatus = 3;
996
                                certificateStatus = 1;
978
                                carSeriesEntity = gson.fromJson(bean.getChexing(), CarSeriesEntity.class);
997
                                carSeriesEntity = gson.fromJson(bean.getChexing(), CarSeriesEntity.class);
979
                                isCertifiedOwner=false;
998
                                isCertifiedOwner = false;
980
                            }
999
                            }
981
                            //获取意向车型
1000
                            //获取意向车型
982
                            if (bean.getStatus() == 2|| isCarIntendedModel){
983
1001
                            if (bean.getStatus() == 2 && isCarIntendedModel) {
984
                                CarSeriesEntity entity = gson.fromJson(bean.getChexing(), CarSeriesEntity.class);
1002
                                CarSeriesEntity entity = gson.fromJson(bean.getChexing(), CarSeriesEntity.class);
985
                                carModel.setText(entity.getSeriesName());
986
                                isCarIntendedModel=false;
1003
                                if (mCarModelEntity == null){
1004
                                    carModel.setText(entity.getSeriesName());
1005
                                }
1006
                                isCarIntendedModel = false;
987
                            }
1007
                            }
988
                            //已完成车主认证功能
1008
                            //已完成车主认证功能
989
                            if (bean.getStatus() != 2|| isVerified){
1009
                            if (bean.getStatus() != 2 && isVerified) {
1010
                                certificateStatus = bean.getStatus();
990
                                CarSeriesEntity entity = gson.fromJson(bean.getChexing(), CarSeriesEntity.class);
1011
                                CarSeriesEntity entity = gson.fromJson(bean.getChexing(), CarSeriesEntity.class);
991
                                MainApplication.userCertifiedModel=(entity.getSeriesName());
992
                                isVerified=false;
1012
                                MainApplication.userCertifiedModel = (entity.getSeriesName());
1013
                                isVerified = false;
1014
993
                            }
1015
                            }
994
                        }
1016
                        }
995
                    }
1017
                    }
996
1018
997
                    if (certificateStatus == 2) {
1019
                    if (certificateStatus == 0) {
998
                        go_title.setText("认证车主");
1020
                        go_title.setText("认证车主");
999
                        go_desc.setText("审核中");
1021
                        go_desc.setText("审核中");
1000
                        go_desc.setTextColor(Color.RED);
1022
                        go_desc.setTextColor(Color.RED);
1001
                        go_cursor.setVisibility(View.GONE);
1023
                        go_cursor.setVisibility(View.GONE);
1002
                    } else if (certificateStatus == 3) {
1024
                    } else if (certificateStatus == 1) {
1003
                        go_title.setText("认证车主");
1025
                        go_title.setText("认证车主");
1004
                        if (carSeriesEntity != null) {
1026
                        if (carSeriesEntity != null) {
1005
                            go_desc.setText(carSeriesEntity.getSeriesName());
1027
                            go_desc.setText(carSeriesEntity.getSeriesName());
1013
                        go_cursor.setVisibility(View.VISIBLE);
1035
                        go_cursor.setVisibility(View.VISIBLE);
1014
                    }
1036
                    }
1015
1037
1016
                    if (certificateStatus == 1 && showLoading) {
1038
                    if (certificateStatus == -2 && showLoading) {
1017
                        startActivity(new Intent(getApplication(), CarOwnerCertificateActivity.class));
1039
                        startActivity(new Intent(getApplication(), CarOwnerCertificateActivity.class));
1018
                    }
1040
                    }
1019
1041
1030
        });
1052
        });
1031
    }
1053
    }
1032
1054
1055
    /**
1056
     * 意向车型Event
1057
     */
1058
    @Subscribe(threadMode = ThreadMode.MAIN,sticky = true)
1059
    public void onCarModelEvent(CarIntentModelEvent event) {
1060
        if (event != null) {
1061
            mCarModelEntity = event.getCarModelEntity();
1062
            carModel.setText(mCarModelEntity.getSeriesName());
1063
            EventBus.getDefault().removeStickyEvent(event);
1064
        }
1065
    }
1066
1067
1068
    private void requestCarIntentModel() {
1069
1070
        String url = MainApplication.url + "/zhannew/basic/web/index.php/car/add";
1071
1072
        long tokenTime = System.currentTimeMillis() / 1000 - MainMapActivity.cha - 1;
1073
        String token = null;
1074
        try {
1075
            token = DES3.encode(String.valueOf(tokenTime));
1076
        } catch (Exception e) {
1077
            e.printStackTrace();
1078
        }
1079
        Map<String, String> map = new HashMap<>();
1080
        map.put("engine_number", "yixiang");
1081
        map.put("plate_number", "意向");
1082
        map.put("cartype", "自用");
1083
        map.put("userid", MainApplication.userId);
1084
        map.put("token", token);
1085
1086
        Gson gson = new Gson();
1087
        if (mCarModelEntity == null){
1088
            return;
1089
        }
1090
        String chexing = gson.toJson(mCarModelEntity);
1091
        map.put("chexing", chexing);
1092
1093
        OkHttpUtils.post().params(map).url(url).build().execute(new StringCallback() {
1094
1095
            @Override
1096
            public void onError(Call call, Exception e) {
1097
                loadDialog.dismiss();
1098
            }
1099
1100
            @Override
1101
            public void onResponse(String response) {
1102
                loadDialog.dismiss();
1103
                String rtnCode = JsonUtils.getKeyResult(response, "rtnCode");
1104
                if ("01".equals(rtnCode)) {
1105
                    ToastUtil.showToast(getApplicationContext(), "意向车型提交成功", Toast.LENGTH_SHORT);
1106
                    MainApplication.userCarIntentMode = mCarModelEntity.getSeriesName();
1107
                    carModel.setText(mCarModelEntity.getSeriesName());
1108
                    ProfileManager.getInstance().setCarIntentModel(SkipUserInfoActivity.this, mCarModelEntity.getSeriesName());
1109
                } else {
1110
                    ToastUtil.showToast(getApplicationContext(), "意向车型提交失败,请重新提交", Toast.LENGTH_SHORT);
1111
                }
1112
            }
1113
        });
1114
    }
1115
1033
}
1116
}

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

88
import java.net.MalformedURLException;
88
import java.net.MalformedURLException;
89
import java.net.URL;
89
import java.net.URL;
90
import java.net.URLEncoder;
90
import java.net.URLEncoder;
91
import java.util.ArrayList;
91
import java.util.List;
92
import java.util.List;
92
93
93
import okhttp3.Call;
94
import okhttp3.Call;
1138
                String rtnCode = JsonUtils.getKeyResult(response, "rtnCode");
1139
                String rtnCode = JsonUtils.getKeyResult(response, "rtnCode");
1139
                if ("01".equals(rtnCode)) {
1140
                if ("01".equals(rtnCode)) {
1140
                    String data = JsonUtils.getKeyResult(response, "data");
1141
                    String data = JsonUtils.getKeyResult(response, "data");
1141
                    List<CarOwnerCertificateBean> list = JsonUtils.parseToObjectList(data, CarOwnerCertificateBean.class);
1142
                    List<CarOwnerCertificateBean> list =new ArrayList<>();
1143
                    try{
1144
                        list = JsonUtils.parseToObjectList(data, CarOwnerCertificateBean.class);
1145
                    }catch (com.alibaba.fastjson.JSONException e){
1146
1147
                    }
1148
1142
                    if ("price".equals(from)) {
1149
                    if ("price".equals(from)) {
1143
                        if (list.size() == 0) {
1150
                        if (list.size() == 0) {
1144
                            new AlertDialogTwo(UserCenterActivity.this).builder()
1151
                            new AlertDialogTwo(UserCenterActivity.this).builder()

+ 115 - 30
app/src/main/java/com/electric/chargingpile/activity/UserInfoActivity.java

55
import com.electric.chargingpile.data.CarOwnerCertificateBean;
55
import com.electric.chargingpile.data.CarOwnerCertificateBean;
56
import com.electric.chargingpile.data.Cars;
56
import com.electric.chargingpile.data.Cars;
57
import com.electric.chargingpile.data.Province;
57
import com.electric.chargingpile.data.Province;
58
import com.electric.chargingpile.entity.CarModelEntity;
58
import com.electric.chargingpile.entity.CarSeriesEntity;
59
import com.electric.chargingpile.entity.CarSeriesEntity;
60
import com.electric.chargingpile.event.CarIntentModelEvent;
61
import com.electric.chargingpile.event.CarModelEvent;
59
import com.electric.chargingpile.manager.PreferenceManager;
62
import com.electric.chargingpile.manager.PreferenceManager;
60
import com.electric.chargingpile.manager.ProfileManager;
63
import com.electric.chargingpile.manager.ProfileManager;
61
import com.electric.chargingpile.util.BarColorUtil;
64
import com.electric.chargingpile.util.BarColorUtil;
81
import com.zhy.http.okhttp.OkHttpUtils;
84
import com.zhy.http.okhttp.OkHttpUtils;
82
import com.zhy.http.okhttp.callback.StringCallback;
85
import com.zhy.http.okhttp.callback.StringCallback;
83
86
87
import org.greenrobot.eventbus.EventBus;
88
import org.greenrobot.eventbus.Subscribe;
89
import org.greenrobot.eventbus.ThreadMode;
84
import org.json.JSONArray;
90
import org.json.JSONArray;
85
import org.json.JSONException;
91
import org.json.JSONException;
86
import org.json.JSONObject;
92
import org.json.JSONObject;
145
    private Uri cropImageUri;
151
    private Uri cropImageUri;
146
    private static final int RC_CAMERA_PERM = 123;
152
    private static final int RC_CAMERA_PERM = 123;
147
    private LoadingDialog loadDialog;
153
    private LoadingDialog loadDialog;
148
    // 1.去认证车主(获得充电优惠)      > 2.认证车主             审核中  3.认证车主             宝马
149
    private int certificateStatus = 0; // 1 去认证  2审核中  3认证车主
154
    // -2 -> 去认证, -1 -> 认证失败,0 -> 审核中,1 -> 表示通过审核,2 -> 表示意向车型。
155
    private int certificateStatus = -2;
150
    private LinearLayout go_certificate;
156
    private LinearLayout go_certificate;
151
    private TextView go_title;
157
    private TextView go_title;
152
    private TextView go_desc;
158
    private TextView go_desc;
154
    private LinearLayout carIntentModel;
160
    private LinearLayout carIntentModel;
155
    private TextView carModel;
161
    private TextView carModel;
156
162
163
    private CarModelEntity mCarModelEntity;
164
157
    @Override
165
    @Override
158
    protected void onCreate(Bundle savedInstanceState) {
166
    protected void onCreate(Bundle savedInstanceState) {
159
        super.onCreate(savedInstanceState);
167
        super.onCreate(savedInstanceState);
160
        BarColorUtil.initStatusBarColor(UserInfoActivity.this);
168
        BarColorUtil.initStatusBarColor(UserInfoActivity.this);
161
        setContentView(R.layout.activity_user_info);
169
        setContentView(R.layout.activity_user_info);
170
        EventBus.getDefault().register(this);
162
        dialog = new LoadingDialog(this);
171
        dialog = new LoadingDialog(this);
163
        dialog.setCanceledOnTouchOutside(false);
172
        dialog.setCanceledOnTouchOutside(false);
164
        mContext = this;
173
        mContext = this;
261
        if (userPhone.length() == 11) {
270
        if (userPhone.length() == 11) {
262
            phone.setText(userPhone.substring(0, 3) + "****" + userPhone.substring(7, userPhone.length()));
271
            phone.setText(userPhone.substring(0, 3) + "****" + userPhone.substring(7, userPhone.length()));
263
        }
272
        }
273
274
//        String carIntentModel = ProfileManager.getInstance().getCarIntentModel(this);
275
//
276
//        if (!TextUtils.isEmpty(carIntentModel)){
277
//            carModel.setText(carIntentModel);
278
//        }
279
264
    }
280
    }
265
281
266
    private void setIcon() {
282
    private void setIcon() {
405
                            shite("");
421
                            shite("");
406
                        }
422
                        }
407
                    }).start();
423
                    }).start();
424
                    if (mCarModelEntity!=null){
425
                        requestCarIntentModel();
426
                    }
427
408
                    dialog.show();
428
                    dialog.show();
409
                }
429
                }
410
                break;
430
                break;
411
431
412
            case R.id.go_certificate:
432
            case R.id.go_certificate:
413
                // 1 去认证  2审核中  3认证车主
433
                // 1 去认证  2审核中  3认证车主
414
                if (certificateStatus == 0) {
434
                if (certificateStatus == -2) {
415
                    getCarOwnerCertificateList(true);
435
                    getCarOwnerCertificateList(true);
416
                } else if (certificateStatus == 1) {
417
                    startActivity(new Intent(getApplication(), CarOwnerCertificateActivity.class));
418
                }
436
                }
437
419
                break;
438
                break;
420
            case R.id.carIntentModel:
439
            case R.id.carIntentModel:
421
                CarBrandActivity.actionStart(this,"1");
440
                CarBrandActivity.actionStart(this,"1");
1068
    @Override
1087
    @Override
1069
    protected void onDestroy() {
1088
    protected void onDestroy() {
1070
        super.onDestroy();
1089
        super.onDestroy();
1090
        EventBus.getDefault().unregister(this);
1071
    }
1091
    }
1072
1092
1073
    private void getCarOwnerCertificateList(Boolean showLoading) {
1093
    private void getCarOwnerCertificateList(Boolean showLoading) {
1085
        }
1105
        }
1086
1106
1087
        String url = MainApplication.url + "/zhannew/basic/web/index.php/car/my?userid=" + MainApplication.userId + "&order=1" + "&token=" + token;
1107
        String url = MainApplication.url + "/zhannew/basic/web/index.php/car/my?userid=" + MainApplication.userId + "&order=1" + "&token=" + token;
1108
      //  Log.e(TAG, "getCarOwnerCertificateList:  "+url );
1088
        OkHttpUtils.get().url(url).build().connTimeOut(6000).readTimeOut(6000).execute(new StringCallback() {
1109
        OkHttpUtils.get().url(url).build().connTimeOut(6000).readTimeOut(6000).execute(new StringCallback() {
1089
            @Override
1110
            @Override
1090
            public void onError(Call call, Exception e) {
1111
            public void onError(Call call, Exception e) {
1101
            public void onResponse(String response) {
1122
            public void onResponse(String response) {
1102
                loadDialog.dismiss();
1123
                loadDialog.dismiss();
1103
                String rtnCode = JsonUtils.getKeyResult(response, "rtnCode");
1124
                String rtnCode = JsonUtils.getKeyResult(response, "rtnCode");
1104
                Log.e(TAG, "onResponse: "+response );
1105
                if ("01".equals(rtnCode)) {
1125
                if ("01".equals(rtnCode)) {
1106
                    String data = JsonUtils.getKeyResult(response, "data");
1126
                    String data = JsonUtils.getKeyResult(response, "data");
1107
                    List<CarOwnerCertificateBean> list = JsonUtils.parseToObjectList(data, CarOwnerCertificateBean.class);
1127
                    List<CarOwnerCertificateBean> list = new ArrayList<>();
1128
                    try {
1129
                        list = JsonUtils.parseToObjectList(data, CarOwnerCertificateBean.class);
1130
                    } catch (com.alibaba.fastjson.JSONException e) {
1131
1132
                    }
1133
1108
                    CarSeriesEntity carSeriesEntity = null;
1134
                    CarSeriesEntity carSeriesEntity = null;
1109
                    // 1 去认证  2审核中  3认证车主
1110
                    if (list.size() == 0) {
1111
                        certificateStatus = 1;
1112
                    } else {
1113
                        certificateStatus = 2;
1114
                        boolean isCertifiedOwner=true;//是否是已通过认证车主
1115
                        boolean isVerified=true;//是否是已认证车主
1116
                        boolean isCarIntendedModel=true;//是否是意向车型
1135
1136
                    if (list.size() != 0) {
1137
1138
                        boolean isCertifiedOwner = true;//是否是已通过认证车主
1139
                        boolean isVerified = true;//是否是已认证车主
1140
                        boolean isCarIntendedModel = true;//是否是意向车型
1141
1117
                        Gson gson = new Gson();
1142
                        Gson gson = new Gson();
1118
                        for (CarOwnerCertificateBean bean : list) {
1143
                        for (CarOwnerCertificateBean bean : list) {
1119
                            //获取已通过车主认证车型
1144
                            //获取已通过车主认证车型
1120
                            if (bean.getStatus() == 1 && bean.getMain() == 1 && isCertifiedOwner) {
1145
                            if (bean.getStatus() == 1 && bean.getMain() == 1 && isCertifiedOwner) {
1121
                                certificateStatus = 3;
1146
                                certificateStatus = 1;
1122
                                carSeriesEntity = gson.fromJson(bean.getChexing(), CarSeriesEntity.class);
1147
                                carSeriesEntity = gson.fromJson(bean.getChexing(), CarSeriesEntity.class);
1123
                                isCertifiedOwner=false;
1148
                                isCertifiedOwner = false;
1124
                            }
1149
                            }
1125
                            //获取意向车型
1150
                            //获取意向车型
1126
                            if (bean.getStatus() == 2|| isCarIntendedModel){
1127
1151
                            if (bean.getStatus() == 2 && isCarIntendedModel) {
1128
                                CarSeriesEntity entity = gson.fromJson(bean.getChexing(), CarSeriesEntity.class);
1152
                                CarSeriesEntity entity = gson.fromJson(bean.getChexing(), CarSeriesEntity.class);
1129
                                carModel.setText(entity.getSeriesName());
1130
                                isCarIntendedModel=false;
1153
                                if (mCarModelEntity == null){
1154
                                    carModel.setText(entity.getSeriesName());
1155
                                }
1156
                                isCarIntendedModel = false;
1131
                            }
1157
                            }
1132
1133
                            //已完成车主认证功能
1158
                            //已完成车主认证功能
1134
                            if (bean.getStatus() != 2|| isVerified){
1159
                            if (bean.getStatus() != 2 && isVerified) {
1160
                                certificateStatus = bean.getStatus();
1135
                                CarSeriesEntity entity = gson.fromJson(bean.getChexing(), CarSeriesEntity.class);
1161
                                CarSeriesEntity entity = gson.fromJson(bean.getChexing(), CarSeriesEntity.class);
1136
                                MainApplication.userCertifiedModel=(entity.getSeriesName());
1137
                                isVerified=false;
1138
                            }
1162
                                MainApplication.userCertifiedModel = (entity.getSeriesName());
1163
                                isVerified = false;
1139
1164
1165
                            }
1140
                        }
1166
                        }
1141
1142
                    }
1167
                    }
1143
1168
1144
                    if (certificateStatus == 2) {
1169
                    if (certificateStatus == 0) {
1145
                        go_title.setText("认证车主");
1170
                        go_title.setText("认证车主");
1146
                        go_desc.setText("审核中");
1171
                        go_desc.setText("审核中");
1147
                        go_desc.setTextColor(Color.RED);
1172
                        go_desc.setTextColor(Color.RED);
1148
                        go_cursor.setVisibility(View.INVISIBLE);
1173
                        go_cursor.setVisibility(View.INVISIBLE);
1149
                    } else if (certificateStatus == 3) {
1174
                    } else if (certificateStatus == 1) {
1150
                        go_title.setText("认证车主");
1175
                        go_title.setText("认证车主");
1151
                        if (carSeriesEntity != null) {
1176
                        if (carSeriesEntity != null) {
1152
                            go_desc.setText(carSeriesEntity.getSeriesName());
1177
                            go_desc.setText(carSeriesEntity.getSeriesName());
1160
                        go_cursor.setVisibility(View.VISIBLE);
1185
                        go_cursor.setVisibility(View.VISIBLE);
1161
                    }
1186
                    }
1162
1187
1163
                    if (certificateStatus == 1 && showLoading) {
1188
                    if (certificateStatus == -2 && showLoading) {
1164
                        startActivity(new Intent(getApplication(), CarOwnerCertificateActivity.class));
1189
                        startActivity(new Intent(getApplication(), CarOwnerCertificateActivity.class));
1165
                    }
1190
                    }
1166
1191
1176
            }
1201
            }
1177
        });
1202
        });
1178
    }
1203
    }
1204
    /**
1205
     * 意向车型Event
1206
     */
1207
    @Subscribe(threadMode = ThreadMode.MAIN,sticky = true)
1208
    public void onCarModelEvent(CarIntentModelEvent event) {
1209
        if (event != null) {
1210
            mCarModelEntity = event.getCarModelEntity();
1211
            carModel.setText(mCarModelEntity.getSeriesName());
1212
            EventBus.getDefault().removeStickyEvent(event);
1213
        }
1214
    }
1215
    private void requestCarIntentModel() {
1216
        String url = MainApplication.url + "/zhannew/basic/web/index.php/car/add";
1217
1218
        long tokenTime = System.currentTimeMillis() / 1000 - MainMapActivity.cha - 1;
1219
        String token = null;
1220
        try {
1221
            token = DES3.encode(String.valueOf(tokenTime));
1222
        } catch (Exception e) {
1223
            e.printStackTrace();
1224
        }
1225
        Map<String, String> map = new HashMap<>();
1226
        map.put("engine_number", "yixiang");
1227
        map.put("plate_number", "意向");
1228
        map.put("cartype", "自用");
1229
        map.put("userid", MainApplication.userId);
1230
        map.put("token", token);
1231
1232
        Gson gson = new Gson();
1233
        if (mCarModelEntity == null){
1234
            return;
1235
        }
1236
        String chexing = gson.toJson(mCarModelEntity);
1237
        map.put("chexing", chexing);
1238
1239
1240
1241
        OkHttpUtils.post().params(map).url(url).build().execute(new StringCallback() {
1242
1243
            @Override
1244
            public void onError(Call call, Exception e) {
1245
                loadDialog.dismiss();
1246
            }
1247
1248
            @Override
1249
            public void onResponse(String response) {
1250
                loadDialog.dismiss();
1251
                String rtnCode = JsonUtils.getKeyResult(response, "rtnCode");
1252
                if ("01".equals(rtnCode)) {
1253
                    ToastUtil.showToast(getApplicationContext(), "意向车型提交成功", Toast.LENGTH_SHORT);
1254
                    MainApplication.userCarIntentMode = mCarModelEntity.getSeriesName();
1255
                    carModel.setText(mCarModelEntity.getSeriesName());
1256
                    ProfileManager.getInstance().setCarIntentModel(UserInfoActivity.this, mCarModelEntity.getSeriesName());
1257
                } else {
1258
                    ToastUtil.showToast(getApplicationContext(), "意向车型提交失败,请重新提交", Toast.LENGTH_SHORT);
1259
                }
1260
            }
1261
        });
1262
    }
1263
1179
}
1264
}

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

12

12

13
import androidx.multidex.MultiDexApplication;
13
import androidx.multidex.MultiDexApplication;
14

14

15
import com.alibaba.fastjson.JSONException;
15
import com.amap.api.maps.model.LatLng;
16
import com.amap.api.maps.model.LatLng;
16
import com.blankj.utilcode.util.LogUtils;
17
import com.blankj.utilcode.util.LogUtils;
17
import com.blankj.utilcode.util.Utils;
18
import com.blankj.utilcode.util.Utils;
90
    public static String firstPoint = "";
91
    public static String firstPoint = "";
91
    public static Boolean firstSsyd;
92
    public static Boolean firstSsyd;
92
    public static String password = "";
93
    public static String password = "";
93
//        public static String url = "http://59.110.68.162";// 充电桩测试环境
94
//    public static String pic_url = "http://59.110.68.162/zhannew/uploadfile/";
95
    public static String url = "http://cdz.evcharge.cc";// 充电桩正式环境
96
    public static String pic_url = "http://cdz.evcharge.cc/zhannew/uploadfile/";
94
        public static String url = "http://59.110.68.162";// 充电桩测试环境
95
    public static String pic_url = "http://59.110.68.162/zhannew/uploadfile/";
96
//    public static String url = "http://cdz.evcharge.cc";// 充电桩正式环境
97
//    public static String pic_url = "http://cdz.evcharge.cc/zhannew/uploadfile/";
97

98

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

101

101

102

102
    //	public static String url = "https://cdz.d1ev.com";
103
    //	public static String url = "https://cdz.d1ev.com";
301
                        @Override
302
                        @Override
302
                        public void onResponse(String response) {
303
                        public void onResponse(String response) {
303
                            String rtnCode = JsonUtils.getKeyResult(response, "rtnCode");
304
                            String rtnCode = JsonUtils.getKeyResult(response, "rtnCode");
305
                            Log.e("TAG_hyc", "onResponse: "+response );
304
                            if ("01".equals(rtnCode)) {
306
                            if ("01".equals(rtnCode)) {
305
                                String chexing = "";
307
                                String chexing = "";
306
                                String data = JsonUtils.getKeyResult(response, "data");
308
                                String data = JsonUtils.getKeyResult(response, "data");
307
                                List<CarOwnerCertificateBean> list = JsonUtils.parseToObjectList(data, CarOwnerCertificateBean.class);
309
                                List<CarOwnerCertificateBean> list=new ArrayList<>();
310
                                try {
311
                                    list = JsonUtils.parseToObjectList(data, CarOwnerCertificateBean.class);
312
                                }catch (JSONException e){
313

314
                                }
315

308
                                boolean certificated = false;
316
                                boolean certificated = false;
309
                                for (CarOwnerCertificateBean bean : list) {
317
                                for (CarOwnerCertificateBean bean : list) {
310
                                    if (bean.getStatus()!=2){ //排除意向车型,则证明用户已经车主认证过了
318
                                    if (bean.getStatus()!=2){ //排除意向车型,则证明用户已经车主认证过了

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

10
    private String chexing;
10
    private String chexing;
11
    private String regdate;
11
    private String regdate;
12
    private String cartype;
12
    private String cartype;
13
    private int status; //状态为1 表示通过审核,状态为2表示意向车型。
13
    private int status; //-1 -> 认证失败,0 -> 审核中,1 -> 表示通过审核,2 -> 表示意向车型。
14
    private int main;
14
    private int main;
15
    private String addTime;
15
    private String addTime;
16
    private String errmsg;
16
    private String errmsg;

+ 20 - 0
app/src/main/java/com/electric/chargingpile/event/CarIntentModelEvent.java

1
package com.electric.chargingpile.event;
2
3
import com.electric.chargingpile.entity.CarModelEntity;
4
import com.electric.chargingpile.entity.CarSeriesEntity;
5
6
public class CarIntentModelEvent {
7
    private CarModelEntity carModelEntity;
8
9
    public CarIntentModelEvent(CarModelEntity carModelEntity) {
10
        this.carModelEntity = carModelEntity;
11
    }
12
13
    public CarModelEntity getCarModelEntity() {
14
        return carModelEntity;
15
    }
16
17
    public void setCarModelEntity(CarModelEntity carModelEntity) {
18
        this.carModelEntity = carModelEntity;
19
    }
20
}

+ 13 - 21
app/src/main/res/layout/activity_skip_user_info.xml

172
                android:background="@color/ui_line"
172
                android:background="@color/ui_line"
173
                android:visibility="gone" />
173
                android:visibility="gone" />
174
174
175
            <RelativeLayout
175
            <LinearLayout
176
                android:id="@+id/go_certificate"
176
                android:id="@+id/go_certificate"
177
                android:layout_width="fill_parent"
177
                android:layout_width="fill_parent"
178
                android:layout_height="45dp"
178
                android:layout_height="45dp"
184
                    android:layout_height="match_parent"
184
                    android:layout_height="match_parent"
185
                    android:gravity="center"
185
                    android:gravity="center"
186
                    android:paddingLeft="15dp"
186
                    android:paddingLeft="15dp"
187
                    android:text="去认证车主(获得充电优惠)"
187
                    android:text="去认证车主"
188
                    android:textColor="@color/color_f9f9f9"
188
                    android:textColor="@color/color_f9f9f9"
189
                    android:textSize="14dp" />
189
                    android:textSize="14dp" />
190
190
                <View
191
                    android:layout_weight="1"
192
                    android:layout_width="0dp"
193
                    android:layout_height="wrap_content"/>
191
                <TextView
194
                <TextView
192
                    android:id="@+id/go_desc"
195
                    android:id="@+id/go_desc"
193
                    android:layout_width="wrap_content"
196
                    android:layout_width="wrap_content"
215
                    android:layout_marginRight="15dp"
218
                    android:layout_marginRight="15dp"
216
                    android:src="@drawable/icon_more2_0" />
219
                    android:src="@drawable/icon_more2_0" />
217
220
218
            </RelativeLayout>
219
            <RelativeLayout
221
            </LinearLayout>
222
            <LinearLayout
220
                android:id="@+id/carIntentModel"
223
                android:id="@+id/carIntentModel"
221
                android:layout_width="fill_parent"
224
                android:layout_width="fill_parent"
222
                android:layout_height="45dp"
225
                android:layout_height="45dp"
231
                    android:textColor="@color/color_f9f9f9"
234
                    android:textColor="@color/color_f9f9f9"
232
                    android:textSize="14sp"
235
                    android:textSize="14sp"
233
                    />
236
                    />
234
235
                <TextView
236
                    android:layout_width="wrap_content"
237
                    android:layout_height="45dp"
238
                    android:layout_alignParentTop="true"
239
                    android:layout_alignParentEnd="true"
240
                    android:layout_alignParentRight="true"
241
                    android:layout_marginRight="15dp"
242
                    android:background="@color/white"
243
                    android:gravity="center|right"
244
                    android:singleLine="true"
245
                    android:textColor="@color/ui_62"
246
                    android:textColorHint="@color/ui_68"
247
                    android:textSize="15sp"
248
                    tools:text="审核中" />
237
                <View
238
                    android:layout_weight="1"
239
                    android:layout_width="0dp"
240
                    android:layout_height="wrap_content"/>
249
                <TextView
241
                <TextView
250
                    android:id="@+id/carModel"
242
                    android:id="@+id/carModel"
251
                    android:layout_marginEnd="15dp"
243
                    android:layout_marginEnd="15dp"
271
                    android:layout_marginRight="15dp"
263
                    android:layout_marginRight="15dp"
272
                    android:src="@drawable/icon_more2_0" />
264
                    android:src="@drawable/icon_more2_0" />
273
265
274
            </RelativeLayout>
266
            </LinearLayout>
275
267
276
            <RelativeLayout
268
            <RelativeLayout
277
                android:id="@+id/rl_select_car"
269
                android:id="@+id/rl_select_car"

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

252
                    />
252
                    />
253
                <ImageView
253
                <ImageView
254
                    android:paddingEnd="14dp"
254
                    android:paddingEnd="14dp"
255
                   android:paddingStart="9dp"
255
                    android:paddingStart="9dp"
256
                    android:src="@drawable/icon_more2_0"
256
                    android:src="@drawable/icon_more2_0"
257
                    android:layout_width="wrap_content"
257
                    android:layout_width="wrap_content"
258
                    android:layout_height="match_parent"/>
258
                    android:layout_height="match_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";