ines-num lines-num-old"> 1142 1149
                    if ("price".equals(from)) {
1143 1150
                        if (list.size() == 0) {
1144 1151
                            new AlertDialogTwo(UserCenterActivity.this).builder()

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

@ -55,7 +55,10 @@ import com.electric.chargingpile.application.MainApplication;
55 55
import com.electric.chargingpile.data.CarOwnerCertificateBean;
56 56
import com.electric.chargingpile.data.Cars;
57 57
import com.electric.chargingpile.data.Province;
58
import com.electric.chargingpile.entity.CarModelEntity;
58 59
import com.electric.chargingpile.entity.CarSeriesEntity;
60
import com.electric.chargingpile.event.CarIntentModelEvent;
61
import com.electric.chargingpile.event.CarModelEvent;
59 62
import com.electric.chargingpile.manager.PreferenceManager;
60 63
import com.electric.chargingpile.manager.ProfileManager;
61 64
import com.electric.chargingpile.util.BarColorUtil;
@ -81,6 +84,9 @@ import com.umeng.analytics.MobclickAgent;
81 84
import com.zhy.http.okhttp.OkHttpUtils;
82 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 90
import org.json.JSONArray;
85 91
import org.json.JSONException;
86 92
import org.json.JSONObject;
@ -145,8 +151,8 @@ public class UserInfoActivity extends Activity implements View.OnClickListener,
145 151
    private Uri cropImageUri;
146 152
    private static final int RC_CAMERA_PERM = 123;
147 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 156
    private LinearLayout go_certificate;
151 157
    private TextView go_title;
152 158
    private TextView go_desc;
@ -154,11 +160,14 @@ public class UserInfoActivity extends Activity implements View.OnClickListener,
154 160
    private LinearLayout carIntentModel;
155 161
    private TextView carModel;
156 162
163
    private CarModelEntity mCarModelEntity;
164
157 165
    @Override
158 166
    protected void onCreate(Bundle savedInstanceState) {
159 167
        super.onCreate(savedInstanceState);
160 168
        BarColorUtil.initStatusBarColor(UserInfoActivity.this);
161 169
        setContentView(R.layout.activity_user_info);
170
        EventBus.getDefault().register(this);
162 171
        dialog = new LoadingDialog(this);
163 172
        dialog.setCanceledOnTouchOutside(false);
164 173
        mContext = this;
@ -261,6 +270,13 @@ public class UserInfoActivity extends Activity implements View.OnClickListener,
261 270
        if (userPhone.length() == 11) {
262 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 282
    private void setIcon() {
@ -405,17 +421,20 @@ public class UserInfoActivity extends Activity implements View.OnClickListener,
405 421
                            shite("");
406 422
                        }
407 423
                    }).start();
424
                    if (mCarModelEntity!=null){
425
                        requestCarIntentModel();
426
                    }
427
408 428
                    dialog.show();
409 429
                }
410 430
                break;
411 431
412 432
            case R.id.go_certificate:
413 433
                // 1 去认证  2审核中  3认证车主
414
                if (certificateStatus == 0) {
434
                if (certificateStatus == -2) {
415 435
                    getCarOwnerCertificateList(true);
416
                } else if (certificateStatus == 1) {
417
                    startActivity(new Intent(getApplication(), CarOwnerCertificateActivity.class));
418 436
                }
437
419 438
                break;
420 439
            case R.id.carIntentModel:
421 440
                CarBrandActivity.actionStart(this,"1");
@ -1068,6 +1087,7 @@ public class UserInfoActivity extends Activity implements View.OnClickListener,
1068 1087
    @Override
1069 1088
    protected void onDestroy() {
1070 1089
        super.onDestroy();
1090
        EventBus.getDefault().unregister(this);
1071 1091
    }
1072 1092
1073 1093
    private void getCarOwnerCertificateList(Boolean showLoading) {
@ -1085,6 +1105,7 @@ public class UserInfoActivity extends Activity implements View.OnClickListener,
1085 1105
        }
1086 1106
1087 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 1109
        OkHttpUtils.get().url(url).build().connTimeOut(6000).readTimeOut(6000).execute(new StringCallback() {
1089 1110
            @Override
1090 1111
            public void onError(Call call, Exception e) {
@ -1101,52 +1122,56 @@ public class UserInfoActivity extends Activity implements View.OnClickListener,
1101 1122
            public void onResponse(String response) {
1102 1123
                loadDialog.dismiss();
1103 1124
                String rtnCode = JsonUtils.getKeyResult(response, "rtnCode");
1104
                Log.e(TAG, "onResponse: "+response );
1105 1125
                if ("01".equals(rtnCode)) {
1106 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 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 1142
                        Gson gson = new Gson();
1118 1143
                        for (CarOwnerCertificateBean bean : list) {
1119 1144
                            //获取已通过车主认证车型
1120 1145
                            if (bean.getStatus() == 1 && bean.getMain() == 1 && isCertifiedOwner) {
1121
                                certificateStatus = 3;
1146
                                certificateStatus = 1;
1122 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 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 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 1170
                        go_title.setText("认证车主");
1146 1171
                        go_desc.setText("审核中");
1147 1172
                        go_desc.setTextColor(Color.RED);
1148 1173
                        go_cursor.setVisibility(View.INVISIBLE);
1149
                    } else if (certificateStatus == 3) {
1174
                    } else if (certificateStatus == 1) {
1150 1175
                        go_title.setText("认证车主");
1151 1176
                        if (carSeriesEntity != null) {
1152 1177
                            go_desc.setText(carSeriesEntity.getSeriesName());
@ -1160,7 +1185,7 @@ public class UserInfoActivity extends Activity implements View.OnClickListener,
1160 1185
                        go_cursor.setVisibility(View.VISIBLE);
1161 1186
                    }
1162 1187
1163
                    if (certificateStatus == 1 && showLoading) {
1188
                    if (certificateStatus == -2 && showLoading) {
1164 1189
                        startActivity(new Intent(getApplication(), CarOwnerCertificateActivity.class));
1165 1190
                    }
1166 1191
@ -1176,4 +1201,64 @@ public class UserInfoActivity extends Activity implements View.OnClickListener,
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,6 +12,7 @@ import android.util.Log;
12 12

13 13
import androidx.multidex.MultiDexApplication;
14 14

15
import com.alibaba.fastjson.JSONException;
15 16
import com.amap.api.maps.model.LatLng;
16 17
import com.blankj.utilcode.util.LogUtils;
17 18
import com.blankj.utilcode.util.Utils;
@ -90,13 +91,13 @@ public class MainApplication extends MultiDexApplication {
90 91
    public static String firstPoint = "";
91 92
    public static Boolean firstSsyd;
92 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 103
    //	public static String url = "https://cdz.d1ev.com";
@ -301,10 +302,17 @@ public class MainApplication extends MultiDexApplication {
301 302
                        @Override
302 303
                        public void onResponse(String response) {
303 304
                            String rtnCode = JsonUtils.getKeyResult(response, "rtnCode");
305
                            Log.e("TAG_hyc", "onResponse: "+response );
304 306
                            if ("01".equals(rtnCode)) {
305 307
                                String chexing = "";
306 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 316
                                boolean certificated = false;
309 317
                                for (CarOwnerCertificateBean bean : list) {
310 318
                                    if (bean.getStatus()!=2){ //排除意向车型,则证明用户已经车主认证过了

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

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

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

@ -0,0 +1,20 @@
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,7 +172,7 @@
172 172
                android:background="@color/ui_line"
173 173
                android:visibility="gone" />
174 174
175
            <RelativeLayout
175
            <LinearLayout
176 176
                android:id="@+id/go_certificate"
177 177
                android:layout_width="fill_parent"
178 178
                android:layout_height="45dp"
@ -184,10 +184,13 @@
184 184
                    android:layout_height="match_parent"
185 185
                    android:gravity="center"
186 186
                    android:paddingLeft="15dp"
187
                    android:text="去认证车主(获得充电优惠)"
187
                    android:text="去认证车主"
188 188
                    android:textColor="@color/color_f9f9f9"
189 189
                    android:textSize="14dp" />
190
190
                <View
191
                    android:layout_weight="1"
192
                    android:layout_width="0dp"
193
                    android:layout_height="wrap_content"/>
191 194
                <TextView
192 195
                    android:id="@+id/go_desc"
193 196
                    android:layout_width="wrap_content"
@ -215,8 +218,8 @@
215 218
                    android:layout_marginRight="15dp"
216 219
                    android:src="@drawable/icon_more2_0" />
217 220
218
            </RelativeLayout>
219
            <RelativeLayout
221
            </LinearLayout>
222
            <LinearLayout
220 223
                android:id="@+id/carIntentModel"
221 224
                android:layout_width="fill_parent"
222 225
                android:layout_height="45dp"
@ -231,21 +234,10 @@
231 234
                    android:textColor="@color/color_f9f9f9"
232 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 241
                <TextView
250 242
                    android:id="@+id/carModel"
251 243
                    android:layout_marginEnd="15dp"
@ -271,7 +263,7 @@
271 263
                    android:layout_marginRight="15dp"
272 264
                    android:src="@drawable/icon_more2_0" />
273 265
274
            </RelativeLayout>
266
            </LinearLayout>
275 267
276 268
            <RelativeLayout
277 269
                android:id="@+id/rl_select_car"

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

@ -252,7 +252,7 @@
252 252
                    />
253 253
                <ImageView
254 254
                    android:paddingEnd="14dp"
255
                   android:paddingStart="9dp"
255
                    android:paddingStart="9dp"
256 256
                    android:src="@drawable/icon_more2_0"
257 257
                    android:layout_width="wrap_content"
258 258
                    android:layout_height="match_parent"/>

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

@ -1,8 +1,8 @@
1 1
package com.google.zxing.client.android.constant;
2 2
3 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 7
    String USER_CHARGING_CHECK_URL = HOST_URL + "api/charge/check-user";
8 8
    String START_CHARGING_URL = HOST_URL + "api/charge/start";

cdzApp - Gogs: Go Git Service

充电桩app代码

huyuguo d0cc841f87 埋点完成 7 anni fa
XRefreshView f780ba992e remove 7 anni fa
app d0cc841f87 埋点完成 7 anni fa
autolayout e1cf244fe0 remove Useless dependence 7 anni fa
gradle e1cf244fe0 remove Useless dependence 7 anni fa
keystore 06bd894653 init 7 anni fa
library 7082cc0853 remove 7 anni fa
videolibrary 578e41f0e1 埋点 7 anni fa
zxing fa99484008 崩溃bug修复 7 anni fa
.gitignore 769b760623 信息流列表开发 7 anni fa
build.gradle 548ae8a830 话题详情页面开发 7 anni fa
gradlew 3473529e39 fix video play exception 7 anni fa
gradlew.bat e1cf244fe0 remove Useless dependence 7 anni fa
icon_sgreen.png e1cf244fe0 remove Useless dependence 7 anni fa
settings.gradle a2fcbb9471 视频部分开发 7 anni fa