Browse Source

个人信息修改完成

huyuguo 4 years ago
parent
commit
2e20fd70e1

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

@ -1,6 +1,7 @@
1 1
package com.electric.chargingpile.activity;
2 2
3 3
import androidx.annotation.NonNull;
4
import androidx.annotation.Nullable;
4 5
import androidx.appcompat.app.AppCompatActivity;
5 6
import androidx.constraintlayout.widget.ConstraintLayout;
6 7
@ -25,6 +26,12 @@ import android.widget.TextView;
25 26
import android.widget.Toast;
26 27
27 28
import com.bumptech.glide.Glide;
29
import com.bumptech.glide.load.engine.DiskCacheStrategy;
30
import com.bumptech.glide.request.Request;
31
import com.bumptech.glide.request.target.CustomTarget;
32
import com.bumptech.glide.request.target.SizeReadyCallback;
33
import com.bumptech.glide.request.target.Target;
34
import com.bumptech.glide.request.transition.Transition;
28 35
import com.electric.chargingpile.R;
29 36
import com.electric.chargingpile.application.MainApplication;
30 37
import com.electric.chargingpile.data.CarOwnerCertificateBean;
@ -196,6 +203,33 @@ public class CarOwnerCertificateActivity extends AppCompatActivity implements Vi
196 203
            Gson gson = new Gson();
197 204
            CarSerieEvent event = new CarSerieEvent(gson.fromJson(carOwnerCertificateBean.getChexing(), CarSeriesEntity.class));
198 205
            onCarSeriesMessage(event);
206
207
            if (!TextUtils.isEmpty(carOwnerCertificateBean.getLicense_img1())) {
208
209
                Glide.with(this).asBitmap().load(MainApplication.pic_url + carOwnerCertificateBean.getLicense_img1()).diskCacheStrategy(DiskCacheStrategy.ALL).into(new CustomTarget<Bitmap>() {
210
                    @Override
211
                    public void onResourceReady(@NonNull Bitmap resource, @Nullable Transition<? super Bitmap> transition) {
212
                        driving_license_icon.setImageBitmap(resource);
213
                        String base64 = bitmapToBase64(resource);
214
                        drivingLicenseBase64Data = "data:image/png;base64," + base64;
215
                    }
216
217
                    @Override
218
                    public void onLoadCleared(@Nullable Drawable placeholder) {
219
220
                    }
221
                });
222
//                Glide.with(this).load(MainApplication.pic_url + carOwnerCertificateBean.getLicense_img1()).into(driving_license_icon);
223
                driving_license_upload_icon.setVisibility(View.GONE);
224
                driving_license_text_view.setVisibility(View.GONE);
225
                driving_license_info.setVisibility(View.VISIBLE);
226
                plate_num.setText(carOwnerCertificateBean.getPlate_number());
227
                engine_num.setText(carOwnerCertificateBean.getEngine_number());
228
                register_date.setText(carOwnerCertificateBean.getRegdate());
229
            }
230
231
232
199 233
            if ("自用".equals(carOwnerCertificateBean.getCartype())) {
200 234
                drivingLicenseType = "自用";
201 235
                driving_license_type_first.setCompoundDrawables(selected, null, null, null);

+ 34 - 11
app/src/main/java/com/electric/chargingpile/activity/UserCenterActivity.java

@ -57,6 +57,7 @@ import com.electric.chargingpile.util.NetUtil;
57 57
import com.electric.chargingpile.util.OkHttpUtil;
58 58
import com.electric.chargingpile.util.PicassoUtil;
59 59
import com.electric.chargingpile.util.Util;
60
import com.electric.chargingpile.view.AlertDialogTwo;
60 61
import com.electric.chargingpile.view.ObservableScrollView;
61 62
import com.electric.chargingpile.view.RoundImageView;
62 63
import com.electric.chargingpile.view.ScrollViewListener;
@ -787,7 +788,7 @@ public class UserCenterActivity extends Activity implements View.OnClickListener
787 788
                    Toast.makeText(getApplication(), "请先登录", Toast.LENGTH_SHORT).show();
788 789
                    startActivity(new Intent(getApplication(), LoginActivity.class));
789 790
                } else {
790
                    getCarOwnerCertificateList();
791
                    getCarOwnerCertificateList("certificate");
791 792
                }
792 793
                break;
793 794
            case R.id.rl_publish_price: // 发表成交价
@ -795,11 +796,9 @@ public class UserCenterActivity extends Activity implements View.OnClickListener
795 796
                    Toast.makeText(getApplication(), "请先登录", Toast.LENGTH_SHORT).show();
796 797
                    startActivity(new Intent(getApplication(), LoginActivity.class));
797 798
                } else {
798
                    // TODO 跳转html
799
                    System.out.println("come on");
799
                    getCarOwnerCertificateList("price");
800 800
                }
801 801
                break;
802
803 802
            case R.id.rl_chongzhi:
804 803
                if (!MainApplication.isLogin()) {
805 804
                    Toast.makeText(getApplication(), "请先登录", Toast.LENGTH_SHORT).show();
@ -1058,9 +1057,9 @@ public class UserCenterActivity extends Activity implements View.OnClickListener
1058 1057
        });
1059 1058
    }
1060 1059
1061
    private void getCarOwnerCertificateList() {
1060
    private void getCarOwnerCertificateList(String from) {
1062 1061
        loadDialog.show();
1063
        String url = MainApplication.url + "/zhannew/basic/web/index.php/car/my?userid=" + MainApplication.userId ;
1062
        String url = MainApplication.url + "/zhannew/basic/web/index.php/car/my?userid=" + MainApplication.userId;
1064 1063
        OkHttpUtils.get().url(url).build().connTimeOut(6000).readTimeOut(6000).execute(new StringCallback() {
1065 1064
            @Override
1066 1065
            public void onError(Call call, Exception e) {
@ -1076,12 +1075,36 @@ public class UserCenterActivity extends Activity implements View.OnClickListener
1076 1075
                if ("01".equals(rtnCode)) {
1077 1076
                    String data = JsonUtils.getKeyResult(response, "data");
1078 1077
                    List<CarOwnerCertificateBean> list = JsonUtils.parseToObjectList(data, CarOwnerCertificateBean.class);
1079
                    if (list.size() == 0) {
1080
                        startActivity(new Intent(getApplication(), CarOwnerCertificateActivity.class));
1078
                    if ("price".equals(from)) {
1079
                        if (list.size() == 0) {
1080
                            new AlertDialogTwo(UserCenterActivity.this).builder()
1081
                                    .setMsg("您还没有认证车主,认证车主可获双倍奖励哦。")
1082
                                    .setPositiveButton("继续发表", new View.OnClickListener() {
1083
                                        @Override
1084
                                        public void onClick(View v) {
1085
                                            Intent intent = new Intent(getApplication(), MyWebViewActivity.class);
1086
                                            intent.putExtra("url", "https://www.d1ev.com/special/models/wap/webView/index.html");
1087
                                            startActivity(intent);
1088
                                        }
1089
                                    }).setNegativeButton("去认证", new View.OnClickListener() {
1090
                                @Override
1091
                                public void onClick(View v) {
1092
                                    startActivity(new Intent(getApplication(), CarOwnerCertificateActivity.class));
1093
                                }
1094
                            }).show();
1095
                        } else {
1096
                            Intent intent = new Intent(getApplication(), MyWebViewActivity.class);
1097
                            intent.putExtra("url", "https://www.d1ev.com/special/models/wap/webView/index.html");
1098
                            startActivity(intent);
1099
                        }
1081 1100
                    } else {
1082
                        Intent intent = new Intent(getApplication(), CarOwnerCertificateListActivity.class);
1083
                        intent.putExtra("data", data);
1084
                        startActivity(intent);
1101
                        if (list.size() == 0) {
1102
                            startActivity(new Intent(getApplication(), CarOwnerCertificateActivity.class));
1103
                        } else {
1104
                            Intent intent = new Intent(getApplication(), CarOwnerCertificateListActivity.class);
1105
                            intent.putExtra("data", data);
1106
                            startActivity(intent);
1107
                        }
1085 1108
                    }
1086 1109
                } else {
1087 1110
                    String rtnMsg = JsonUtils.getKeyResult(response, "rtnMsg");

+ 106 - 313
app/src/main/java/com/electric/chargingpile/activity/UserInfoActivity.java

@ -22,7 +22,9 @@ import android.os.Environment;
22 22
import android.os.Handler;
23 23
import android.os.Message;
24 24
import android.provider.MediaStore;
25
25 26
import androidx.core.content.FileProvider;
27
26 28
import android.text.TextUtils;
27 29
import android.util.Log;
28 30
import android.view.Gravity;
@ -47,8 +49,10 @@ import android.widget.ToggleButton;
47 49
48 50
import com.electric.chargingpile.R;
49 51
import com.electric.chargingpile.application.MainApplication;
52
import com.electric.chargingpile.data.CarOwnerCertificateBean;
50 53
import com.electric.chargingpile.data.Cars;
51 54
import com.electric.chargingpile.data.Province;
55
import com.electric.chargingpile.entity.CarSeriesEntity;
52 56
import com.electric.chargingpile.manager.ProfileManager;
53 57
import com.electric.chargingpile.util.BarColorUtil;
54 58
import com.electric.chargingpile.util.DES3;
@ -60,14 +64,18 @@ import com.electric.chargingpile.util.PhotoUtils;
60 64
import com.electric.chargingpile.util.StatusConstants;
61 65
import com.electric.chargingpile.util.ToastUtil;
62 66
import com.electric.chargingpile.util.UploadUtil;
67
import com.electric.chargingpile.view.AlertDialogTwo;
63 68
import com.electric.chargingpile.view.CustomProgressDialog;
64 69
import com.electric.chargingpile.view.RoundImageView;
65 70
import com.electric.chargingpile.view.xrichtext.SDCardUtil;
71
import com.google.gson.Gson;
66 72
import com.squareup.okhttp.Request;
67 73
import com.squareup.okhttp.Response;
68 74
import com.squareup.picasso.Picasso;
69 75
import com.squareup.picasso.Target;
70 76
import com.umeng.analytics.MobclickAgent;
77
import com.zhy.http.okhttp.OkHttpUtils;
78
import com.zhy.http.okhttp.callback.StringCallback;
71 79
72 80
import org.json.JSONArray;
73 81
import org.json.JSONException;
@ -83,6 +91,7 @@ import java.util.HashMap;
83 91
import java.util.List;
84 92
import java.util.Map;
85 93
94
import okhttp3.Call;
86 95
import pub.devrel.easypermissions.AfterPermissionGranted;
87 96
import pub.devrel.easypermissions.EasyPermissions;
88 97
@ -92,17 +101,14 @@ public class UserInfoActivity extends Activity implements View.OnClickListener,
92 101
    private ImageView back;
93 102
    private EditText et_nickName;
94 103
    private EditText et_realName;
95
    private TextView et_che;
96 104
    private ToggleButton btn_sex, btn_car;
97
    private RelativeLayout rl_icon, rl_select_car, rl_isBuy;
105
    private RelativeLayout rl_icon;
98 106
    private Button cancleButton, btn_one, btn_two;
99 107
    private PopupWindow popupWindow;
100 108
    private View popupWindowView;
101 109
    private RoundImageView iconPic;
102 110
    private TextView tv_save, onclick;
103 111
    private String sex = "1";
104
    private String nocar = "";
105
    private String havecar = "";
106 112
    private Bitmap download_bmp;
107 113
    LoadingDialog dialog;
108 114
    String name0 = "";
@ -124,9 +130,8 @@ public class UserInfoActivity extends Activity implements View.OnClickListener,
124 130
    String chexing;
125 131
    String yichexing;
126 132
    private ImageView point;
127
    public static final int REQUSET = 11;
128 133
    String select_pinpai = "", select_chexing = "";
129
    private TextView tv_point, tv_buy;
134
    private TextView tv_point;
130 135
    private RelativeLayout rl_point;
131 136
    private android.view.animation.Animation animation;
132 137
    private File fileUri = new File(Environment.getExternalStorageDirectory().getPath() + "/photo.jpg");
@ -134,6 +139,13 @@ public class UserInfoActivity extends Activity implements View.OnClickListener,
134 139
    private Uri imageUri;
135 140
    private Uri cropImageUri;
136 141
    private static final int RC_CAMERA_PERM = 123;
142
    private LoadingDialog loadDialog;
143
    // 1.去认证车主(获得充电优惠)      > 2.认证车主             审核中  3.认证车主             宝马
144
    private int certificateStatus = 0; // 1 去认证  2审核中  3认证车主
145
    private RelativeLayout go_certificate;
146
    private TextView go_title;
147
    private TextView go_desc;
148
    private ImageView go_cursor;
137 149
138 150
    @Override
139 151
    protected void onCreate(Bundle savedInstanceState) {
@ -144,28 +156,21 @@ public class UserInfoActivity extends Activity implements View.OnClickListener,
144 156
        dialog.setCanceledOnTouchOutside(false);
145 157
        mContext = this;
146 158
        initView();
147
//        getFromServer();
148 159
        spinner();
149 160
        getFromServer();
150 161
    }
151 162
152 163
    public void onEventMainThread(Province b) {
153
        Log.e("ffff", b.getName() + "   " + b.getCities().get(b.getId()).getName());
154
//        Toast.makeText(this, b.getName()+ "   " + b.getCities().get(b.getId()).getName(), Toast.LENGTH_SHORT).show();
155
        et_che.setText(b.getName() + " - " + b.getCities().get(b.getId()).getName());
156 164
        car_brand = b.getName();
157 165
        car_type = b.getCities().get(b.getId()).getName();
158 166
    }
159 167
160 168
    private void initView() {
161
        tv_buy = (TextView) findViewById(R.id.tv_buy);
169
        loadDialog = new LoadingDialog(this);
170
        loadDialog.setCanceledOnTouchOutside(false);
162 171
        rl_point = (RelativeLayout) findViewById(R.id.rl_point);
163
        rl_isBuy = (RelativeLayout) findViewById(R.id.rl_isBuy);
164
        rl_isBuy.setOnClickListener(this);
165 172
        tv_point = (TextView) findViewById(R.id.tv_point);
166 173
        animation = AnimationUtils.loadAnimation(UserInfoActivity.this, R.anim.nn);
167
        rl_select_car = (RelativeLayout) findViewById(R.id.rl_select_car);
168
        rl_select_car.setOnClickListener(this);
169 174
170 175
        animation = AnimationUtils.loadAnimation(UserInfoActivity.this, R.anim.nn);
171 176
        point = (ImageView) findViewById(R.id.tv_one);
@ -179,20 +184,11 @@ public class UserInfoActivity extends Activity implements View.OnClickListener,
179 184
            }
180 185
        });
181 186
        et_realName = (EditText) findViewById(R.id.et_realName);
182
        et_che = (TextView) findViewById(R.id.et_che);
183 187
        Log.e(TAG, "initView: " + MainApplication.userCar);
184 188
        if (MainApplication.userCar.equals("")) {
185
            tv_buy.setText("");
186
            rl_select_car.setVisibility(View.GONE);
187 189
        } else if ("待购".equals(MainApplication.userCar)) {
188
            tv_buy.setText("未购买");
189
            rl_select_car.setVisibility(View.GONE);
190
            et_che.setText("");
191 190
        } else {
192 191
            String car = MainApplication.userCar.replace("$$", " ");
193
            tv_buy.setText("已购买");
194
            rl_select_car.setVisibility(View.VISIBLE);
195
            et_che.setText(car);
196 192
            String[] strarray = car.split(" ");
197 193
            if (strarray.length > 1) {
198 194
                car_brand = strarray[0];
@ -242,25 +238,11 @@ public class UserInfoActivity extends Activity implements View.OnClickListener,
242 238
        tv_save = (TextView) findViewById(R.id.tv_make_sure);
243 239
        tv_save.setOnClickListener(this);
244 240
245
//        rl_brand = (RelativeLayout) findViewById(R.id.rl_1);
246
//        rl_brand.setOnClickListener(this);
247
//        rl_type = (RelativeLayout) findViewById(R.id.rl_2);
248
//        rl_type.setOnClickListener(this);
249
//        long appTime1 = System.currentTimeMillis()/1000;
250
////        Log.d("appTime(long)---", appTime1+"");
251
//        String apptime = String.valueOf(appTime1);
252
//        int updateapptime = Integer.valueOf(apptime);
253
//
254
//        if(MainFragment.cha>0){
255
//            cha = updateapptime - (MainFragment.cha);
256
//        }else if (MainFragment.cha<0){
257
//            cha = updateapptime+(MainFragment.cha);
258
//        }else {
259
//            cha = updateapptime;
260
//        }
261
//        chatime = String.valueOf(cha);
262
//        Log.i("updatetime----",updateapptime+"");
263
//        Log.i("cha",chatime);
241
        go_certificate = findViewById(R.id.go_certificate);
242
        go_certificate.setOnClickListener(this);
243
        go_title = findViewById(R.id.go_title);
244
        go_desc = findViewById(R.id.go_desc);
245
        go_cursor = findViewById(R.id.go_cursor);
264 246
    }
265 247
266 248
    private void setIcon() {
@ -288,38 +270,15 @@ public class UserInfoActivity extends Activity implements View.OnClickListener,
288 270
            iconPic.setImageResource(R.drawable.icon_face2_0);
289 271
            photo = ((BitmapDrawable) iconPic.getDrawable()).getBitmap();
290 272
        }
291
//        if (ImageTools.findPhotoFromSDCard(MainApplication.storePath,"user_icon")){
292
//            Bitmap bmp = BitmapFactory.decodeFile(MainApplication.storePath+"/user_icon.png");
293
//            photo = bmp;
294
//            iconPic.setImageBitmap(bmp);
295
//        }else {
296
//            Log.e(TAG, "setIcon: "+MainApplication.userIcon );
297
//            new Task().execute(MainApplication.userIcon);
298
//        }
299
300 273
    }
301 274
302 275
    private void spinner() {
303 276
        List<Cars> cars = new ArrayList<Cars>();
304 277
        Cars car = new Cars("E140ev", "1", "1");
305
//        Cars car1=new Cars("E150ev","1","2");
306
//        Cars car2=new Cars("EV160","1","3");
307
//        Cars car3=new Cars("EV200","1","4");
308 278
        cars.add(car);
309
//        cars.add(car1);
310
//        cars.add(car2);
311
//        cars.add(car3);
312
//
313 279
        List<Cars> cars2 = new ArrayList<Cars>();
314 280
        Cars car0 = new Cars("车型", "1", "1");
315
//        Cars car11=new Cars("2222","1","2");
316
//        Cars car22=new Cars("33333","1","3");
317
//        Cars car33=new Cars("4444","1","4");
318 281
        cars2.add(car0);
319
//        cars2.add(car11);
320
//        cars2.add(car22);
321
//        cars2.add(car33);
322
//		// spinner方面的东西
323 282
        spinnerProvince = (Spinner) this
324 283
                .findViewById(R.id.spinner_province_search_event);
325 284
        spinnerCity = (Spinner) this
@ -328,24 +287,7 @@ public class UserInfoActivity extends Activity implements View.OnClickListener,
328 287
        p.setCities(cars2);
329 288
        p.setId(1);
330 289
        p.setName("品牌");
331
//		Province p2=new Province("比亚迪1", 2, cars2);
332
//		Province p3=new Province("比亚迪2", 2, cars);
333
//		Province p4=new Province("比亚迪3", 2, cars);
334
//		Province p5=new Province("比亚迪4", 2, cars);
335
//		Province p6=new Province("比亚迪5", 2, cars);
336
//		Province p7=new Province("比亚迪6", 2, cars);
337
//		Province p8=new Province("比亚迪7", 2, cars);
338
//		Province p9=new Province("比亚迪8", 2, cars);
339 290
        pr.add(p);
340
//		pr.add(p2);
341
//		pr.add(p3);
342
//		pr.add(p4);
343
//		pr.add(p5);
344
//		pr.add(p6);
345
//		pr.add(p7);
346
//		pr.add(p8);
347
//		pr.add(p9);
348
//		pr.add(p2);
349 291
        ArrayAdapter<Province> provinceAdapter = new ArrayAdapter<Province>(UserInfoActivity.this, R.layout.simple_spinner_item, pr);
350 292
        spinnerProvince.setAdapter(provinceAdapter);
351 293
@ -374,7 +316,6 @@ public class UserInfoActivity extends Activity implements View.OnClickListener,
374 316
                                   int position, long id) {
375 317
            onProvinChange(position);
376 318
            Province d = pr.get(position);
377
//            btnP.setText(d.getName());
378 319
            try {
379 320
                car_brand = d.getName();
380 321
            } catch (Exception e) {
@ -396,14 +337,12 @@ public class UserInfoActivity extends Activity implements View.OnClickListener,
396 337
    final class CityAdapter extends ProvinceAdapter {
397 338
        @Override
398 339
        public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
399
//			currentCity = currentProvince.getCities().get(position);
400 340
            car_type = (String) spinnerCity.getSelectedItem();
401 341
            Log.e("car_type", car_type);
402 342
        }
403 343
    }
404 344
405 345
    public void onProvinChange(int position) {
406
//		currentProvince = parse.getProvinces().get(position);
407 346
        List<Cars> car = pr.get(position).getCities();
408 347
        List<String> strName = new ArrayList<String>();
409 348
        for (int i = 0; i < car.size(); i++) {
@ -421,101 +360,12 @@ public class UserInfoActivity extends Activity implements View.OnClickListener,
421 360
            spinnerCity.setSelection(default_type);
422 361
            default_type = -1;
423 362
        }
424
425
//        Log.e("default_type",default_type+"");
426
//        if (default_type==-1){
427
//            spinnerCity.setSelection(0);
428
//            default_type=-1;
429
//        }else{
430
//            spinnerCity.setSelection(default_type);
431
//        }
432
433
//		if (currentProvince.getCities().size() > 0) {
434
//			cityAdapter.notifyDataSetChanged();
435
//			spinnerCity.setSelection(0);
436
//		}
437 363
    }
438 364
439 365
440 366
    @Override
441 367
    public void onClick(View v) {
442 368
        switch (v.getId()) {
443
            case R.id.rl_select_car:
444
                MobclickAgent.onEvent(getApplicationContext(), "0802", new HashMap<String, String>().put("type", "车型"));
445
//                startActivityForResult(new Intent(UserInfoActivity.this,
446
//                        ChePaiActivity.class), 55);
447
                startActivityForResult(new Intent(UserInfoActivity.this, SelectCarActivity.class), REQUSET);
448
                break;
449
            case R.id.rl_isBuy:
450
                MobclickAgent.onEvent(getApplicationContext(), "0802", new HashMap<String, String>().put("type", "是否购车"));
451
                LayoutInflater inflater1 = (LayoutInflater) getSystemService(mContext.LAYOUT_INFLATER_SERVICE);
452
                View popupWindowView = inflater1.inflate(R.layout.layout_isbuy, null);
453
                final PopupWindow popupWindow1 = new PopupWindow(popupWindowView,
454
                        ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.FILL_PARENT,
455
                        true);
456
                popupWindow1.setBackgroundDrawable(getResources().getDrawable(R.drawable.bg_yinying531));
457
                popupWindow1.setOutsideTouchable(true);
458
                popupWindowView.setOnKeyListener(new View.OnKeyListener() {
459
                    @Override
460
                    public boolean onKey(View v, int keyCode, KeyEvent event) {
461
                        if ((keyCode == KeyEvent.KEYCODE_MENU) && (popupWindow1.isShowing())) {
462
                            popupWindow1.dismiss();
463
                            return true;
464
                        }
465
                        return false;
466
                    }
467
                });
468
                popupWindowView.setOnTouchListener(new View.OnTouchListener() {
469
470
                    @Override
471
                    public boolean onTouch(View v, MotionEvent event) {
472
                        if (popupWindow1.isShowing()) {
473
                            popupWindow1.dismiss();
474
                        }
475
                        return false;
476
                    }
477
                });
478
                // 设置PopupWindow的弹出和消失效果
479
                popupWindow1.setAnimationStyle(R.style.popupAnimation);
480
                Button cancleButton = (Button) popupWindowView
481
                        .findViewById(R.id.cancleButton);
482
                cancleButton.setOnClickListener(new View.OnClickListener() {
483
                    @Override
484
                    public void onClick(View view) {
485
                        popupWindow1.dismiss();
486
                    }
487
                });
488
                Button btn_one = (Button) popupWindowView.findViewById(R.id.tvTwo);
489
                btn_one.setOnClickListener(new View.OnClickListener() {
490
                    @Override
491
                    public void onClick(View view) {
492
                        tv_buy.setText("已购买");
493
                        rl_select_car.setVisibility(View.VISIBLE);
494
495
//                        Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
496
//                        intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(new File(
497
//                                Environment.getExternalStorageDirectory(), "androidapp.jpg")));
498
//                        ((Activity) mContext).startActivityForResult(intent, 2);
499
                        popupWindow1.dismiss();
500
                    }
501
                });
502
                Button btn_two = (Button) popupWindowView.findViewById(R.id.tvThree);
503
                btn_two.setOnClickListener(new View.OnClickListener() {
504
                    @Override
505
                    public void onClick(View view) {
506
                        tv_buy.setText("未购买");
507
                        rl_select_car.setVisibility(View.GONE);
508
//                        Intent intent = new Intent(Intent.ACTION_PICK, null);
509
//                        intent.setDataAndType(
510
//                                MediaStore.Images.Media.EXTERNAL_CONTENT_URI,
511
//                                "image/*");
512
//                        startActivityForResult(intent, 1);
513
                        popupWindow1.dismiss();
514
                    }
515
                });
516
517
                popupWindow1.showAtLocation(cancleButton, Gravity.CENTER, 0, 0);
518
                break;
519 369
520 370
            case R.id.onclick:
521 371
@ -542,29 +392,25 @@ public class UserInfoActivity extends Activity implements View.OnClickListener,
542 392
                    dialog.show();
543 393
                }
544 394
                break;
395
396
            case R.id.go_certificate:
397
                // 1 去认证  2审核中  3认证车主
398
                if (certificateStatus == 0) {
399
                    getCarOwnerCertificateList(true);
400
                } else if (certificateStatus == 1) {
401
                    startActivity(new Intent(getApplication(), CarOwnerCertificateActivity.class));
402
                }
403
                break;
545 404
        }
546 405
    }
547 406
548 407
    private boolean checkText() {
549 408
        String nickName = et_nickName.getText().toString().trim();
550
        String isBuy = tv_buy.getText().toString().trim();
551
        String carType = et_che.getText().toString().trim();
552 409
553 410
        if (TextUtils.isEmpty(nickName)) {
554 411
            Toast.makeText(this, "请输入您的昵称", Toast.LENGTH_SHORT).show();
555 412
            return false;
556 413
        }
557
        if (TextUtils.isEmpty(isBuy)) {
558
            Toast.makeText(this, "请选择您是否购买了新能源汽车", Toast.LENGTH_SHORT).show();
559
            return false;
560
        }
561
        if (isBuy.equals("已购买")) {
562
            if (TextUtils.isEmpty(carType)) {
563
                Toast.makeText(this, "请选择您购买的车型", Toast.LENGTH_SHORT).show();
564
                return false;
565
            }
566
        }
567
568 414
        return true;
569 415
    }
570 416
@ -659,15 +505,6 @@ public class UserInfoActivity extends Activity implements View.OnClickListener,
659 505
        String token = String.valueOf(updatetime);
660 506
        Log.i("token---", token);
661 507
662
        if (tv_buy.getText().toString().equals("未购买")) {
663
            havecar = "待购";
664
        } else {
665
            if (car_brand != null && null != car_type) {
666
                havecar = car_brand + "$$" + car_type;
667
            }
668
        }
669
670
        nocar = "";
671 508
        try {
672 509
            if (null != photo) {
673 510
                Bitmap bm = imageZoom(photo);
@ -683,10 +520,6 @@ public class UserInfoActivity extends Activity implements View.OnClickListener,
683 520
        par.put("username", et_realName.getText().toString());
684 521
        par.put("nickname", et_nickName.getText().toString());
685 522
        par.put("sex", sex);
686
        par.put("chexing", havecar);
687
        par.put("yichexing", nocar);
688
        Log.e("chexing", havecar);
689
        Log.e("yichexing", nocar);
690 523
691 524
        try {
692 525
            par.put("token", DES3.encode(token));
@ -842,14 +675,6 @@ public class UserInfoActivity extends Activity implements View.OnClickListener,
842 675
843 676
        switch (requestCode) {
844 677
            // 如果是直接从相册获取
845
            case REQUSET:
846
                select_pinpai = data.getStringExtra("pinpai");
847
                select_chexing = data.getStringExtra("chexing");
848
849
                et_che.setText(select_pinpai + " " + select_chexing);
850
                car_brand = select_pinpai;
851
                car_type = select_chexing;
852
                break;
853 678
            case 1:
854 679
                if (SDCardUtil.hasSdcard()) {
855 680
                    cropImageUri = Uri.fromFile(fileCropUri);
@ -916,8 +741,6 @@ public class UserInfoActivity extends Activity implements View.OnClickListener,
916 741
        matrix.postScale(scaleWidth, scaleHeight);
917 742
        Bitmap bitmap = Bitmap.createBitmap(bgimage, 0, 0, (int) width,
918 743
                (int) height, matrix, true);
919
//        iv_2.setImageBitmap(bitmap);
920
//        tv_2.setText(bitmap.getRowBytes() * bitmap.getHeight() + "");
921 744
        return bitmap;
922 745
    }
923 746
@ -1040,66 +863,13 @@ public class UserInfoActivity extends Activity implements View.OnClickListener,
1040 863
    }
1041 864
1042 865
1043
    /*
1044
     *bitmap转base64
1045
     */
1046
//    public static Bitmap base64ToBitmap(String base64String){
1047
//        byte[] bytes = Base64.decode(base64String);
1048
//        Bitmap bitmap= BitmapFactory.decodeByteArray(bytes, 0, bytes.length);
1049
//        return bitmap;
1050
//    }
1051
1052 866
    Handler handle = new Handler() {
1053 867
        public void handleMessage(Message msg) {
1054 868
            switch (msg.what) {
1055 869
                case StatusConstants.REQUEST_WHAT_SUCCESS:
1056 870
                    LogUtils.getLogger().e(msg.obj.toString());
1057
//                    Toast.makeText(UserInfoActivity.this, msg.obj.toString(), 1).show();
1058 871
                    break;
1059 872
                case 1:
1060
//
1061
//				Gson g = new Gson();
1062
//				pr.clear();
1063
//				pr = g.fromJson(msg.obj.toString(), new TypeToken<List<Province>>() {
1064
//				}.getType());
1065
//				String s=msg.obj.toString();
1066
//				JSONObject
1067
//				Province p= new Province(s.get, code, cities)
1068
//				pr.add(arg0)
1069
//				spinner();
1070
//                    if (!chexing.equals("") && yichexing.equals("")){
1071
//                        String[] strarray=chexing.split("\\$\\$");
1072
//
1073
//                        if(strarray.length>1){
1074
//                            name0=strarray[0];//江淮
1075
//                            name1=strarray[1];//iEV3
1076
//                        }
1077
//                        Log.e("name0+name1",name0+name1);
1078
//                        et_che.setText(name0 + " - " + name1);
1079
//                        Log.e(TAG, "handleMessage: "+ et_che.getText().toString());
1080
//                        if (et_che.getText().toString().equals(" - ")){
1081
//                            tv_buy.setText("未购买");
1082
//                            rl_select_car.setVisibility(View.GONE);
1083
//                        }else {
1084
//                            tv_buy.setText("已购买");
1085
//                            rl_select_car.setVisibility(View.VISIBLE);
1086
//                        }
1087
//                        car_brand = name0;
1088
//                        car_type = name1;
1089
//                    }else if(chexing.equals("") && !yichexing.equals("")){
1090
//                        String[] strarray=yichexing.split("\\$\\$");
1091
//
1092
//                        if(strarray.length>1){
1093
//                            name0=strarray[0];//江淮
1094
//                            name1=strarray[1];//iEV3
1095
//                        }
1096
//                        Log.e("name0+name1",name0+name1);
1097
//                        et_che.setText(name0 + " - " + name1);
1098
//                        car_brand = name0;
1099
//                        car_type = name1;
1100
//                }
1101
1102
1103 873
                    try {
1104 874
                        JSONArray jsonary = new JSONArray(msg.obj.toString());
1105 875
                        for (int i = 0; i < jsonary.length(); i++) {
@ -1124,24 +894,12 @@ public class UserInfoActivity extends Activity implements View.OnClickListener,
1124 894
                            pr.remove(prov);
1125 895
                            pr.add(prov);
1126 896
1127
//                            spinnerProvince.setSelection(de);
1128
//                                    spinnerCity
1129 897
                        }
1130 898
1131 899
                    } catch (JSONException e) {
1132 900
                        e.printStackTrace();
1133 901
                    }
1134
//				pr =(List<Province>) JsonUtils.parseToObjectBean(msg.obj.toString(), Province.class);
1135
//                    Log.e("pe", pr.size()+"");
1136
//                    Log.e("pe", pr.get(0).getCities().size()+"");
1137
//                    Log.e("pe", pr.get(1).getCities().size()+"");
1138
//                    Log.e("pe", pr.get(2).getCities().size()+"");
1139
//                    Log.e("pe", pr.get(3).getCities().size()+"");
1140
//				Log.e("pe", pr.size()+"");
1141
//				Log.e("pe", pr.size()+"");
1142 902
1143
1144
//
1145 903
                    ArrayAdapter<Province> provinceAdapter = new ArrayAdapter<Province>(UserInfoActivity.this, R.layout.simple_spinner_item, pr);
1146 904
                    spinnerProvince.setAdapter(provinceAdapter);
1147 905
                    provinceAdapter.notifyDataSetChanged();
@ -1166,38 +924,15 @@ public class UserInfoActivity extends Activity implements View.OnClickListener,
1166 924
1167 925
                        if (rtnCode.equals("01")) {
1168 926
                            dialog.cancel();
1169
//                            SharedPreferences mySharedPreferences= getSharedPreferences("userInfo",
1170
//                                    Activity.MODE_PRIVATE);
1171
//                            SharedPreferences.Editor editor = mySharedPreferences.edit();
1172
//                            editor.putString("nickname", et_nickName.getText().toString());
1173
//                            editor.putString("username", et_realName.getText().toString());
1174
//                            editor.putString("sex", sex);
1175
//                            editor.putString("chexing", havecar);
1176
//                            editor.putString("yichexing", nocar);
1177
//
1178
////                            String data = JsonUtils.getKeyResult(msg.obj.toString(),"data");
1179
////                            String userid = JsonUtils.getKeyResult(data,"userid");
1180
////                            String username = JsonUtils.getKeyResult(data,"username");
1181
////                            String userpic = JsonUtils.getKeyResult(data,"userpic");
1182
////                            String nickname = JsonUtils.getKeyResult(data,"nickname");
1183
////                            LogUtils.getLogger().e(userid+"---"+username+"---"+userpic+"---"+nickname);
1184
////                            Log.e(TAG, "handleMessage: "+userid+"---"+username+"---"+userpic+"---"+nickname );
1185
//
1186
//                            editor.commit();
1187 927
                            String picurl = JsonUtils.getKeyResult(msg.obj.toString(), "picurl");
1188 928
                            MainApplication.userIcon = MainApplication.url + picurl;
1189 929
                            ProfileManager.getInstance().setUsericon(getApplicationContext(), MainApplication.userIcon);
1190
                            MainApplication.userCar = havecar;
1191
                            ProfileManager.getInstance().setUsercar(getApplicationContext(), havecar);
1192 930
                            MainApplication.userNickname = et_nickName.getText().toString();
1193 931
                            ProfileManager.getInstance().setNickname(getApplicationContext(), et_nickName.getText().toString());
1194 932
                            Intent intent = new Intent();
1195 933
                            intent.putExtra("nickname", et_nickName.getText().toString().trim());
1196 934
                            intent.putExtra("userphoto", ss);
1197 935
                            setResult(RESULT_SUCCESS, intent);
1198
//                            MainApplication.userIcon="V";
1199
//                            ProfileManager.getInstance().setUsericon(UserInfoActivity.this, "V");
1200
//                            ImageTools.saveImageToGallery(getApplicationContext(),photo,"user_icon");
1201 936
1202 937
                            String plusScore = jsonObject.getString("plusScore");
1203 938
                            if (!plusScore.equals("")) {
@ -1209,12 +944,6 @@ public class UserInfoActivity extends Activity implements View.OnClickListener,
1209 944
                                        rl_point.setVisibility(View.GONE);
1210 945
                                    }
1211 946
                                }, 1000);
1212
//                                if (photo != null) {
1213
//                                    photo.recycle();
1214
//                                    photo = null;
1215
////                                            bitmap.recycle();
1216
//
1217
//                                }
1218 947
                                new Handler().postDelayed(new Runnable() {
1219 948
                                    public void run() {
1220 949
@ -1223,11 +952,6 @@ public class UserInfoActivity extends Activity implements View.OnClickListener,
1223 952
                                }, 1500);
1224 953
                            } else {
1225 954
                                ToastUtil.showToast(UserInfoActivity.this, "保存成功", Toast.LENGTH_SHORT);
1226
//                                if (photo != null) {
1227
//                                    photo.recycle();
1228
//                                    photo = null;
1229
//
1230
//                                }
1231 955
                                UserInfoActivity.this.finish();
1232 956
                            }
1233 957
@ -1241,10 +965,7 @@ public class UserInfoActivity extends Activity implements View.OnClickListener,
1241 965
                    } catch (JSONException e) {
1242 966
                        e.printStackTrace();
1243 967
                    }
1244
1245
//                    Toast.makeText(UserInfoActivity.this, msg.obj.toString(), Toast.LENGTH_SHORT).show();
1246 968
                    break;
1247
1248 969
                case 5:
1249 970
                    Toast.makeText(UserInfoActivity.this, msg.obj.toString(), Toast.LENGTH_SHORT).show();
1250 971
                    break;
@ -1314,6 +1035,7 @@ public class UserInfoActivity extends Activity implements View.OnClickListener,
1314 1035
    protected void onResume() {
1315 1036
        super.onResume();
1316 1037
        MobclickAgent.onResume(this);
1038
        getCarOwnerCertificateList(false);
1317 1039
    }
1318 1040
1319 1041
    @Override
@ -1326,4 +1048,75 @@ public class UserInfoActivity extends Activity implements View.OnClickListener,
1326 1048
    protected void onDestroy() {
1327 1049
        super.onDestroy();
1328 1050
    }
1051
1052
    private void getCarOwnerCertificateList(Boolean showLoading) {
1053
        if (showLoading) {
1054
            loadDialog.show();
1055
        }
1056
        String url = MainApplication.url + "/zhannew/basic/web/index.php/car/my?userid=" + MainApplication.userId;
1057
        OkHttpUtils.get().url(url).build().connTimeOut(6000).readTimeOut(6000).execute(new StringCallback() {
1058
            @Override
1059
            public void onError(Call call, Exception e) {
1060
                e.printStackTrace();
1061
                loadDialog.dismiss();
1062
                Toast.makeText(getApplicationContext(), e.getLocalizedMessage(), Toast.LENGTH_SHORT).show();
1063
                go_title.setText("去认证车主(获得充电优惠)");
1064
                go_desc.setText("");
1065
                go_cursor.setVisibility(View.VISIBLE);
1066
            }
1067
1068
            @Override
1069
            public void onResponse(String response) {
1070
                loadDialog.dismiss();
1071
                String rtnCode = JsonUtils.getKeyResult(response, "rtnCode");
1072
                if ("01".equals(rtnCode)) {
1073
                    String data = JsonUtils.getKeyResult(response, "data");
1074
                    List<CarOwnerCertificateBean> list = JsonUtils.parseToObjectList(data, CarOwnerCertificateBean.class);
1075
                    CarSeriesEntity carSeriesEntity = null;
1076
                    // 1 去认证  2审核中  3认证车主
1077
                    if (list.size() == 0) {
1078
                        certificateStatus = 1;
1079
                    } else {
1080
                        certificateStatus = 2;
1081
                        for (CarOwnerCertificateBean bean : list) {
1082
                            if (bean.getStatus() == 1 && bean.getMain() == 1) {
1083
                                certificateStatus = 3;
1084
                                Gson gson = new Gson();
1085
                                carSeriesEntity = gson.fromJson(bean.getChexing(), CarSeriesEntity.class);
1086
                                break;
1087
                            }
1088
                        }
1089
                    }
1090
1091
                    if (certificateStatus == 2) {
1092
                        go_title.setText("认证车主");
1093
                        go_desc.setText("审核中");
1094
                        go_cursor.setVisibility(View.GONE);
1095
                    } else if (certificateStatus == 3) {
1096
                        go_title.setText("认证车主");
1097
                        if (carSeriesEntity != null) {
1098
                            go_desc.setText(carSeriesEntity.getSeriesName());
1099
                        }
1100
                        go_cursor.setVisibility(View.GONE);
1101
                    } else {
1102
                        go_title.setText("去认证车主(获得充电优惠)");
1103
                        go_desc.setText("");
1104
                        go_cursor.setVisibility(View.VISIBLE);
1105
                    }
1106
1107
                    if (certificateStatus == 1) {
1108
                        startActivity(new Intent(getApplication(), CarOwnerCertificateActivity.class));
1109
                    }
1110
1111
                } else {
1112
                    String rtnMsg = JsonUtils.getKeyResult(response, "rtnMsg");
1113
                    Toast.makeText(getApplicationContext(), rtnMsg, Toast.LENGTH_SHORT).show();
1114
1115
                    go_title.setText("去认证车主(获得充电优惠)");
1116
                    go_desc.setText("");
1117
                    go_cursor.setVisibility(View.VISIBLE);
1118
                }
1119
            }
1120
        });
1121
    }
1329 1122
}

+ 1 - 2
app/src/main/java/com/electric/chargingpile/adapter/CarOwnerCertificateListAdapter.java

@ -49,8 +49,7 @@ public class CarOwnerCertificateListAdapter extends RecyclerView.Adapter<CarOwne
49 49
        CarOwnerCertificateBean bean = mList.get(position);
50 50
        Gson gson = new Gson();
51 51
        CarSeriesEntity carSeriesEntity = gson.fromJson(bean.getChexing(), CarSeriesEntity.class);
52
//        Glide.with(mContext).load(carSeriesEntity.getIcon()).into(holder.master_pic);
53
//        Picasso.with(mContext).load(carSeriesEntity.getMasterPic()).into(holder.master_pic);
52
        Glide.with(mContext).load(carSeriesEntity.getIcon()).into(holder.master_pic);
54 53
        holder.name.setText(carSeriesEntity.getCompanyName());
55 54
        holder.detail_name.setText(carSeriesEntity.getSeriesName());
56 55

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

@ -75,10 +75,14 @@ public class MainApplication extends MultiDexApplication {
75 75
    public static Boolean firstSsyd;
76 76
    public static String password = "";
77 77
    public static String url = "http://59.110.68.162";// 充电桩测试环境
78
//        public static String url = "http://cdz.evcharge.cc";// 充电桩正式环境
78
    public static String pic_url = "http://59.110.68.162/zhannew/uploadfile/";
79
//    public static String url = "http://cdz.evcharge.cc";// 充电桩正式环境
80
//    public static String pic_url = "http://cdz.evcharge.cc/zhannew/uploadfile/";
81

79 82
//    public static String urlNew = "http://123.56.67.7:83/api/0300";// 一电测试环境
80 83
    public static String urlNew = "https://api.touchev.com:83/api/0300";// 一电正式环境
81
    public static String pic_url = "http://cdz.evcharge.cc/zhannew/uploadfile/";
84

85

82 86
    //	public static String url = "https://cdz.d1ev.com";
83 87
    public static String build_flag = "0";
84 88
    public static String support = "0"; // true:本APP支付  false:其他方式支付

+ 0 - 11
app/src/main/java/com/electric/chargingpile/entity/CarSeriesEntity.java

@ -13,17 +13,6 @@ public class CarSeriesEntity {
13 13
    private String maxSalePrice;
14 14
    private String minSalePrice;
15 15
16
//    public CarSeriesEntity(String brandId, String brandName, String companyId, String companyName, String seriesId, String seriesName, String salePrice, String icon) {
17
//        this.brandId = brandId;
18
//        this.brandName = brandName;
19
//        this.companyId = companyId;
20
//        this.companyName = companyName;
21
//        this.seriesId = seriesId;
22
//        this.seriesName = seriesName;
23
//        this.salePrice = salePrice;
24
//        this.icon = icon;
25
//    }
26
27 16
    public String getBrandId() {
28 17
        return brandId;
29 18
    }

+ 211 - 253
app/src/main/res/layout/activity_user_info.xml

@ -1,10 +1,11 @@
1 1
<?xml version="1.0" encoding="utf-8"?>
2 2
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3
    xmlns:tools="http://schemas.android.com/tools"
3 4
    android:layout_width="match_parent"
4 5
    android:layout_height="match_parent"
5
    android:orientation="vertical"
6 6
    android:focusable="true"
7
    android:focusableInTouchMode="true">
7
    android:focusableInTouchMode="true"
8
    android:orientation="vertical">
8 9
9 10
    <RelativeLayout
10 11
        android:layout_width="fill_parent"
@ -17,10 +18,10 @@
17 18
            android:layout_height="match_parent"
18 19
            android:layout_centerVertical="true"
19 20
            android:contentDescription="@null"
20
            android:paddingBottom="4dp"
21 21
            android:paddingLeft="16dp"
22
            android:paddingRight="16dp"
23 22
            android:paddingTop="4dp"
23
            android:paddingRight="16dp"
24
            android:paddingBottom="4dp"
24 25
            android:src="@drawable/icon_lvback1119" />
25 26
26 27
        <TextView
@ -36,18 +37,18 @@
36 37
            android:id="@+id/iv_right"
37 38
            android:layout_width="wrap_content"
38 39
            android:layout_height="match_parent"
39
            android:paddingBottom="4dp"
40
            android:layout_alignParentTop="true"
41
            android:layout_alignParentEnd="true"
42
            android:layout_alignParentRight="true"
43
            android:gravity="center"
40 44
            android:paddingLeft="16dp"
41
            android:paddingRight="16dp"
42 45
            android:paddingTop="4dp"
43
            android:textSize="15sp"
44
            android:visibility="gone"
46
            android:paddingRight="16dp"
47
            android:paddingBottom="4dp"
45 48
            android:text="跳过"
46
            android:gravity="center"
47 49
            android:textColor="@color/white"
48
            android:layout_alignParentTop="true"
49
            android:layout_alignParentRight="true"
50
            android:layout_alignParentEnd="true" />
50
            android:textSize="15sp"
51
            android:visibility="gone" />
51 52
    </RelativeLayout>
52 53
53 54
@ -70,38 +71,40 @@
70 71
                android:layout_width="fill_parent"
71 72
                android:layout_height="62dp"
72 73
                android:background="@color/white">
74
73 75
                <TextView
74 76
                    android:layout_width="wrap_content"
75 77
                    android:layout_height="match_parent"
78
                    android:gravity="center"
79
                    android:paddingLeft="15dp"
76 80
                    android:text="头像"
77 81
                    android:textColor="@color/title_row"
78
                    android:textSize="15sp"
79
                    android:paddingLeft="15dp"
80
                    android:gravity="center"/>
82
                    android:textSize="15sp" />
81 83
82 84
                <com.electric.chargingpile.view.RoundImageView
83 85
                    android:id="@+id/iv_user_icon"
84 86
                    android:layout_width="45dp"
85 87
                    android:layout_height="45dp"
86
                    android:src="@drawable/icon_face2_0"
87
                    android:layout_centerVertical="true"
88
                    android:layout_alignParentRight="true"
89 88
                    android:layout_alignParentEnd="true"
89
                    android:layout_alignParentRight="true"
90
                    android:layout_centerVertical="true"
91
                    android:layout_marginEnd="32dp"
90 92
                    android:layout_marginRight="32dp"
91
                    android:layout_marginEnd="32dp" />
93
                    android:src="@drawable/icon_face2_0" />
94
92 95
                <ImageView
93 96
                    android:layout_width="wrap_content"
94 97
                    android:layout_height="match_parent"
95
                    android:src="@drawable/icon_more2_0"
96
                    android:layout_centerVertical="true"
97
                    android:layout_alignParentRight="true"
98 98
                    android:layout_alignParentEnd="true"
99
                    android:layout_alignParentRight="true"
100
                    android:layout_centerVertical="true"
101
                    android:layout_marginEnd="15dp"
99 102
                    android:layout_marginRight="15dp"
100
                    android:layout_marginEnd="15dp" />
101
103
                    android:src="@drawable/icon_more2_0" />
102 104
103 105
104 106
            </RelativeLayout>
107
105 108
            <View
106 109
                android:layout_width="match_parent"
107 110
                android:layout_height="0.5dp"
@ -112,208 +115,166 @@
112 115
                android:layout_width="fill_parent"
113 116
                android:layout_height="45dp"
114 117
                android:background="@color/white">
118
115 119
                <TextView
116 120
                    android:layout_width="wrap_content"
117 121
                    android:layout_height="match_parent"
122
                    android:gravity="center"
123
                    android:paddingLeft="15dp"
118 124
                    android:text="昵称"
119 125
                    android:textColor="@color/title_row"
120
                    android:textSize="15sp"
121
                    android:paddingLeft="15dp"
122
                    android:gravity="center"/>
126
                    android:textSize="15sp" />
123 127
124 128
                <EditText
125 129
                    android:id="@+id/et_nickName"
126 130
                    android:layout_width="wrap_content"
127 131
                    android:layout_height="130px"
128
                    android:background="@color/white"
129
                    android:hint="请输入昵称"
132
                    android:layout_alignParentTop="true"
133
                    android:layout_alignParentEnd="true"
130 134
135
                    android:layout_alignParentRight="true"
136
                    android:layout_marginEnd="15dp"
137
                    android:layout_marginRight="15dp"
138
                    android:background="@color/white"
131 139
                    android:gravity="center|right"
140
                    android:hint="请输入昵称"
141
                    android:maxLength="16"
132 142
                    android:singleLine="true"
133
                    android:textColorHint="@color/ui_68"
134 143
                    android:textColor="@color/ui_62"
135
                    android:textSize="15sp"
136
                    android:maxLength="16"
137
                    android:layout_alignParentTop="true"
138
                    android:layout_alignParentRight="true"
139
                    android:layout_alignParentEnd="true"
140
                    android:layout_marginRight="15dp"
141
                    android:layout_marginEnd="15dp" />
144
                    android:textColorHint="@color/ui_68"
145
                    android:textSize="15sp" />
142 146
143 147
            </RelativeLayout>
144 148
145 149
            <View
146 150
                android:layout_width="match_parent"
147 151
                android:layout_height="0.5dp"
148
                android:background="@color/ui_line"
149 152
                android:layout_marginLeft="15dp"
150
                android:visibility="visible"/>
151
153
                android:background="@color/ui_line"
154
                android:visibility="visible" />
152 155
153 156
154 157
            <RelativeLayout
155
                android:id="@+id/rl_isBuy"
158
                android:id="@+id/go_certificate"
156 159
                android:layout_width="fill_parent"
157
                android:background="@color/white"
158 160
                android:layout_height="45dp"
161
                android:background="@color/white"
159 162
                android:visibility="visible">
163
160 164
                <TextView
165
                    android:id="@+id/go_title"
161 166
                    android:layout_width="wrap_content"
162 167
                    android:layout_height="match_parent"
163
                    android:text="是否购买新能源汽车"
168
                    android:gravity="center"
169
                    android:paddingLeft="15dp"
164 170
                    android:textColor="@color/title_row"
165 171
                    android:textSize="15sp"
166
                    android:paddingLeft="15dp"
167
                    android:gravity="center"/>
172
                    android:text="去认证车主(获得充电优惠)" />
168 173
169 174
                <TextView
170
                    android:id="@+id/tv_buy"
175
                    android:id="@+id/go_desc"
171 176
                    android:layout_width="wrap_content"
172 177
                    android:layout_height="45dp"
178
                    android:layout_alignParentTop="true"
179
                    android:layout_alignParentEnd="true"
180
                    android:layout_alignParentRight="true"
181
                    android:layout_marginEnd="15dp"
182
                    android:layout_marginRight="15dp"
173 183
                    android:background="@color/white"
174
                    android:text="未购买"
175
                    android:hint="请选择"
176 184
                    android:gravity="center|right"
177 185
                    android:singleLine="true"
178
                    android:textColorHint="@color/ui_68"
186
                    tools:text="审核中"
179 187
                    android:textColor="@color/ui_62"
180
                    android:textSize="15sp"
181
                    android:layout_alignParentTop="true"
182
                    android:layout_marginRight="8dp"
183
                    android:layout_toLeftOf="@+id/imageView14"
184
                    android:layout_toStartOf="@+id/imageView14" />
188
                    android:textColorHint="@color/ui_68"
189
                    android:textSize="15sp" />
185 190
186 191
                <ImageView
192
                    android:id="@+id/go_cursor"
187 193
                    android:layout_width="wrap_content"
188 194
                    android:layout_height="match_parent"
189
                    android:src="@drawable/icon_more2_0"
190
                    android:layout_centerVertical="true"
191
                    android:layout_alignParentRight="true"
192 195
                    android:layout_alignParentEnd="true"
196
                    android:layout_alignParentRight="true"
197
                    android:layout_centerVertical="true"
193 198
                    android:layout_marginRight="15dp"
194
                    android:id="@+id/imageView14" />
199
                    android:src="@drawable/icon_more2_0" />
195 200
196 201
            </RelativeLayout>
197 202
198 203
            <View
199 204
                android:layout_width="match_parent"
200 205
                android:layout_height="0.5dp"
201
                android:background="@color/ui_line"
202 206
                android:layout_marginLeft="15dp"
203
                android:visibility="visible"/>
204
205
206
207
            <RelativeLayout
208
                android:id="@+id/rl_select_car"
209
                android:layout_width="fill_parent"
210
                android:background="@color/white"
211
                android:layout_height="45dp"
212
                android:visibility="visible">
213
                <TextView
214
                    android:layout_width="wrap_content"
215
                    android:layout_height="match_parent"
216
                    android:text="品牌型号"
217
                    android:textColor="@color/title_row"
218
                    android:textSize="15sp"
219
                    android:paddingLeft="15dp"
220
                    android:gravity="center"/>
221
222
                <TextView
223
                    android:id="@+id/et_che"
224
                    android:layout_width="wrap_content"
225
                    android:layout_height="45dp"
226
                    android:background="@color/white"
227
                    android:hint="请选择品牌车型"
228
                    android:gravity="center|right"
229
                    android:singleLine="true"
230
                    android:textColorHint="@color/ui_68"
231
                    android:textColor="@color/ui_62"
232
                    android:textSize="15sp"
233
                    android:layout_alignParentTop="true"
234
                    android:layout_marginRight="8dp"
235
                    android:layout_toLeftOf="@+id/imageView13"
236
                    android:layout_toStartOf="@+id/imageView13" />
237
238
                <ImageView
239
                    android:layout_width="wrap_content"
240
                    android:layout_height="match_parent"
241
                    android:src="@drawable/icon_more2_0"
242
                    android:layout_centerVertical="true"
243
                    android:layout_alignParentRight="true"
244
                    android:layout_alignParentEnd="true"
245
                    android:layout_marginRight="15dp"
246
                    android:id="@+id/imageView13" />
247
248
            </RelativeLayout>
249
207
                android:background="@color/ui_line"
208
                android:visibility="visible" />
250 209
251 210
            <com.zhy.autolayout.AutoRelativeLayout
252 211
                android:layout_width="fill_parent"
253 212
                android:layout_height="139px"
254 213
                android:visibility="gone">
214
255 215
                <TextView
256 216
                    android:layout_width="wrap_content"
257 217
                    android:layout_height="match_parent"
218
                    android:gravity="center"
219
                    android:paddingLeft="44px"
258 220
                    android:text="性别"
259 221
                    android:textColor="@color/title_row"
260
                    android:textSize="15sp"
261
                    android:paddingLeft="44px"
262
                    android:gravity="center"/>
222
                    android:textSize="15sp" />
263 223
264 224
                <ToggleButton
265 225
                    android:id="@+id/sex_button"
266 226
                    android:layout_width="wrap_content"
267 227
                    android:layout_height="wrap_content"
228
                    android:layout_alignParentEnd="true"
229
                    android:layout_alignParentRight="true"
230
                    android:layout_centerVertical="true"
268 231
                    android:layout_gravity="center_horizontal"
232
                    android:layout_marginRight="5dp"
269 233
                    android:background="@android:color/transparent"
270 234
                    android:button="@drawable/sex_btn"
271 235
                    android:gravity="center"
272 236
                    android:textOff=""
273
                    android:textOn=""
274
                    android:layout_marginRight="5dp"
275
                    android:layout_centerVertical="true"
276
                    android:layout_alignParentRight="true"
277
                    android:layout_alignParentEnd="true" />
237
                    android:textOn="" />
278 238
279 239
            </com.zhy.autolayout.AutoRelativeLayout>
280 240
281 241
            <View
282 242
                android:layout_width="match_parent"
283 243
                android:layout_height="0.5dp"
284
                android:background="@color/ui_line"
285 244
                android:layout_marginLeft="44px"
286
                android:visibility="gone"/>
245
                android:background="@color/ui_line"
246
                android:visibility="gone" />
287 247
288 248
            <com.zhy.autolayout.AutoRelativeLayout
289 249
                android:layout_width="fill_parent"
290 250
                android:layout_height="139px"
291 251
                android:visibility="gone">
252
292 253
                <TextView
293 254
                    android:layout_width="wrap_content"
294 255
                    android:layout_height="match_parent"
256
                    android:gravity="center"
257
                    android:paddingLeft="44px"
295 258
                    android:text="真实姓名"
296 259
                    android:textColor="@color/title_row"
297
                    android:textSize="15sp"
298
                    android:paddingLeft="44px"
299
                    android:gravity="center"/>
260
                    android:textSize="15sp" />
300 261
301 262
                <EditText
302 263
                    android:id="@+id/et_realName"
303 264
                    android:layout_width="wrap_content"
304 265
                    android:layout_height="139px"
266
                    android:layout_alignParentTop="true"
267
                    android:layout_alignParentEnd="true"
268
                    android:layout_alignParentRight="true"
269
                    android:layout_marginEnd="44px"
270
                    android:layout_marginRight="44px"
305 271
                    android:background="@color/white"
272
                    android:gravity="center|right"
306 273
                    android:hint="请输入真实姓名"
307 274
                    android:singleLine="true"
308
                    android:textColorHint="@color/ui_68"
309 275
                    android:textColor="@color/ui_62"
310
                    android:gravity="center|right"
311
                    android:textSize="15sp"
312
                    android:layout_alignParentTop="true"
313
                    android:layout_alignParentRight="true"
314
                    android:layout_alignParentEnd="true"
315
                    android:layout_marginRight="44px"
316
                    android:layout_marginEnd="44px" />
276
                    android:textColorHint="@color/ui_68"
277
                    android:textSize="15sp" />
317 278
318 279
            </com.zhy.autolayout.AutoRelativeLayout>
319 280
@ -324,113 +285,112 @@
324 285
                android:background="@color/ui_line" />
325 286
326 287
327
328 288
        </LinearLayout>
329 289
330 290
        <com.zhy.autolayout.AutoLinearLayout
331 291
            android:layout_width="match_parent"
332 292
            android:layout_height="wrap_content"
333
            android:orientation="vertical"
293
            android:layout_marginTop="15dp"
334 294
            android:background="@color/white"
335
            android:layout_marginTop="15dp">
295
            android:orientation="vertical">
336 296
337
        <View
338
            android:layout_width="match_parent"
339
            android:layout_height="0.5dp"
340
            android:background="@color/ui_line"
341
            android:visibility="gone"/>
297
            <View
298
                android:layout_width="match_parent"
299
                android:layout_height="0.5dp"
300
                android:background="@color/ui_line"
301
                android:visibility="gone" />
342 302
343
        <com.zhy.autolayout.AutoRelativeLayout
344
            android:layout_width="fill_parent"
345
            android:layout_height="139px"
346
            android:background="@color/white"
347
            android:visibility="gone">
303
            <com.zhy.autolayout.AutoRelativeLayout
304
                android:layout_width="fill_parent"
305
                android:layout_height="139px"
306
                android:background="@color/white"
307
                android:visibility="gone">
348 308
349 309
350
            <ToggleButton
351
                android:id="@+id/car_button"
352
                android:layout_width="wrap_content"
353
                android:layout_height="wrap_content"
354
                android:layout_gravity="center_horizontal"
355
                android:background="@android:color/transparent"
356
                android:button="@drawable/car_btn"
357
                android:layout_marginLeft="44px"
358
                android:gravity="center"
359
                android:textOff=""
360
                android:textOn=""
361
                android:layout_centerVertical="true"
362
                android:visibility="gone"/>
310
                <ToggleButton
311
                    android:id="@+id/car_button"
312
                    android:layout_width="wrap_content"
313
                    android:layout_height="wrap_content"
314
                    android:layout_centerVertical="true"
315
                    android:layout_gravity="center_horizontal"
316
                    android:layout_marginLeft="44px"
317
                    android:background="@android:color/transparent"
318
                    android:button="@drawable/car_btn"
319
                    android:gravity="center"
320
                    android:textOff=""
321
                    android:textOn=""
322
                    android:visibility="gone" />
363 323
364 324
365
        </com.zhy.autolayout.AutoRelativeLayout>
325
            </com.zhy.autolayout.AutoRelativeLayout>
366 326
367 327
328
            <com.zhy.autolayout.AutoLinearLayout
329
                android:layout_width="fill_parent"
330
                android:layout_height="45dp"
331
                android:background="@color/white"
332
                android:orientation="horizontal"
333
                android:visibility="gone">
368 334
369
        <com.zhy.autolayout.AutoLinearLayout
370
            android:layout_width="fill_parent"
371
            android:layout_height="45dp"
372
            android:background="@color/white"
373
            android:orientation="horizontal"
374
            android:visibility="gone">
375
           <com.zhy.autolayout.AutoLinearLayout
376
               android:id="@+id/rl_1"
377
               android:layout_width="0dp"
378
               android:layout_weight="1"
379
               android:layout_height="match_parent"
380
               android:orientation="horizontal">
381
                <TextView
382
                    android:id="@+id/onclick"
383
                    android:layout_width="wrap_content"
335
                <com.zhy.autolayout.AutoLinearLayout
336
                    android:id="@+id/rl_1"
337
                    android:layout_width="0dp"
384 338
                    android:layout_height="match_parent"
385
                    android:text="品牌"
386
                    android:paddingLeft="16dp"
387
                    android:textSize="16sp"
388
                    android:textColor="@color/hintColor"
389
                    android:gravity="center_vertical"/>
390
               <Spinner
391
                   android:id = "@+id/spinner_province_search_event"
392
                   android:layout_width = "match_parent"
393
                   android:layout_height ="match_parent"
394
                   android:gravity="center"
395
                   android:spinnerMode="dialog">
396
               </Spinner >
397
398
399
               <!--<ImageView-->
400
                   <!--android:layout_width="wrap_content"-->
401
                   <!--android:layout_height="wrap_content"-->
402
                   <!--android:src="@drawable/icon_xiala2_0"-->
403
                   <!--android:layout_centerVertical="true"-->
404
                   <!--android:layout_alignParentRight="true"-->
405
                   <!--android:layout_alignParentEnd="true"-->
406
                   <!--android:layout_marginRight="16dp" />-->
407
           </com.zhy.autolayout.AutoLinearLayout>
339
                    android:layout_weight="1"
340
                    android:orientation="horizontal">
408 341
342
                    <TextView
343
                        android:id="@+id/onclick"
344
                        android:layout_width="wrap_content"
345
                        android:layout_height="match_parent"
346
                        android:gravity="center_vertical"
347
                        android:paddingLeft="16dp"
348
                        android:text="品牌"
349
                        android:textColor="@color/hintColor"
350
                        android:textSize="16sp" />
351
352
                    <Spinner
353
                        android:id="@+id/spinner_province_search_event"
354
                        android:layout_width="match_parent"
355
                        android:layout_height="match_parent"
356
                        android:gravity="center"
357
                        android:spinnerMode="dialog"></Spinner>
358
359
360
                    <!--<ImageView-->
361
                    <!--android:layout_width="wrap_content"-->
362
                    <!--android:layout_height="wrap_content"-->
363
                    <!--android:src="@drawable/icon_xiala2_0"-->
364
                    <!--android:layout_centerVertical="true"-->
365
                    <!--android:layout_alignParentRight="true"-->
366
                    <!--android:layout_alignParentEnd="true"-->
367
                    <!--android:layout_marginRight="16dp" />-->
368
                </com.zhy.autolayout.AutoLinearLayout>
409 369
410
            <com.zhy.autolayout.AutoLinearLayout
411
                android:id="@+id/rl_2"
412
                android:layout_width="0dp"
413
                android:layout_weight="1"
414
                android:layout_height="match_parent"
415
                android:orientation="horizontal">
416 370
417
                <TextView
418
                    android:layout_width="wrap_content"
371
                <com.zhy.autolayout.AutoLinearLayout
372
                    android:id="@+id/rl_2"
373
                    android:layout_width="0dp"
419 374
                    android:layout_height="match_parent"
420
                    android:text="车型"
421
                    android:paddingLeft="44px"
422
                    android:textSize="16sp"
423
                    android:textColor="@color/hintColor"
424
                    android:gravity="center_vertical"/>
425
426
                <Spinner
427
                    android:id = "@+id/spinner_city_search_event"
428
                    android:layout_width = "match_parent"
429
                    android:layout_height ="match_parent"
430
                    android:gravity="center"
431
                    android:spinnerMode="dialog">
432
                </Spinner >
433
                <!--<ImageView-->
375
                    android:layout_weight="1"
376
                    android:orientation="horizontal">
377
378
                    <TextView
379
                        android:layout_width="wrap_content"
380
                        android:layout_height="match_parent"
381
                        android:gravity="center_vertical"
382
                        android:paddingLeft="44px"
383
                        android:text="车型"
384
                        android:textColor="@color/hintColor"
385
                        android:textSize="16sp" />
386
387
                       <Spinner
388
                        android:id="@+id/spinner_city_search_event"
389
                        android:layout_width="match_parent"
390
                        android:layout_height="match_parent"
391
                        android:gravity="center"
392
                        android:spinnerMode="dialog"></Spinner>
393
                    <!--<ImageView-->
434 394
                    <!--android:layout_width="wrap_content"-->
435 395
                    <!--android:layout_height="wrap_content"-->
436 396
                    <!--android:src="@drawable/icon_xiala2_0"-->
@ -439,24 +399,23 @@
439 399
                    <!--android:layout_alignParentEnd="true"-->
440 400
                    <!--android:layout_marginRight="16dp" />-->
441 401
442
            </com.zhy.autolayout.AutoLinearLayout>
402
                </com.zhy.autolayout.AutoLinearLayout>
443 403
444
        </com.zhy.autolayout.AutoLinearLayout>
445
446
        <View
447
            android:layout_width="match_parent"
448
            android:layout_height="0.5dp"
449
            android:background="@color/ui_line"
450
            android:layout_marginLeft="16dp"
451
            android:visibility="gone"/>
404
            </com.zhy.autolayout.AutoLinearLayout>
452 405
406
            <View
407
                android:layout_width="match_parent"
408
                android:layout_height="0.5dp"
409
                android:layout_marginLeft="16dp"
410
                android:background="@color/ui_line"
411
                android:visibility="gone" />
453 412
454 413
455
        <View
456
            android:layout_width="match_parent"
457
            android:layout_height="0.5dp"
458
            android:background="@color/ui_line"
459
            android:visibility="gone"/>
414
            <View
415
                android:layout_width="match_parent"
416
                android:layout_height="0.5dp"
417
                android:background="@color/ui_line"
418
                android:visibility="gone" />
460 419
461 420
        </com.zhy.autolayout.AutoLinearLayout>
462 421
@ -513,49 +472,49 @@
513 472
                android:layout_width="match_parent"
514 473
                android:layout_height="39dp"
515 474
                android:layout_alignParentBottom="true"
516
                android:layout_marginTop="15dp"
517 475
                android:layout_marginLeft="15dp"
476
                android:layout_marginTop="15dp"
518 477
                android:layout_marginRight="15dp"
519 478
                android:layout_marginBottom="8dp"
520 479
                android:background="@drawable/textview_greenstyle"
521
                android:textColor="@color/white"
522
                android:textSize="16sp"
480
                android:gravity="center"
523 481
                android:text="保存"
524
                android:gravity="center" />
482
                android:textColor="@color/white"
483
                android:textSize="16sp" />
525 484
526 485
            <ImageView
527 486
                android:id="@+id/tv_one"
528 487
                android:layout_width="wrap_content"
529 488
                android:layout_height="wrap_content"
530
                android:layout_gravity="center"
489
                android:layout_above="@+id/tv_make_sure"
531 490
532
                android:gravity="center"
491
                android:layout_centerHorizontal="true"
533 492
493
                android:layout_gravity="center"
494
                android:layout_marginBottom="20dp"
495
                android:background="@drawable/icon_5point"
496
                android:gravity="center"
534 497
                android:padding="5dp"
535 498
                android:scaleType="fitXY"
536
                android:background="@drawable/icon_5point"
537 499
                android:textColor="#000000"
538
                android:visibility="gone"
539
                android:layout_marginBottom="20dp"
540
                android:layout_above="@+id/tv_make_sure"
541
                android:layout_centerHorizontal="true" />
500
                android:visibility="gone" />
542 501
543 502
544 503
            <RelativeLayout
545 504
                android:id="@+id/rl_point"
546 505
                android:layout_width="80dp"
547 506
                android:layout_height="80dp"
548
                android:layout_marginBottom="50dp"
549
                android:layout_centerHorizontal="true"
550 507
                android:layout_alignParentBottom="true"
551
                android:visibility="gone"
552
                android:background="@drawable/icon_point_bg">
508
                android:layout_centerHorizontal="true"
509
                android:layout_marginBottom="50dp"
510
                android:background="@drawable/icon_point_bg"
511
                android:visibility="gone">
553 512
554 513
                <LinearLayout
555 514
                    android:layout_width="wrap_content"
556 515
                    android:layout_height="wrap_content"
557
                    android:orientation="vertical"
558
                    android:layout_centerInParent="true">
516
                    android:layout_centerInParent="true"
517
                    android:orientation="vertical">
559 518
560 519
                    <LinearLayout
561 520
                        android:layout_width="wrap_content"
@ -566,17 +525,17 @@
566 525
                            android:layout_width="wrap_content"
567 526
                            android:layout_height="wrap_content"
568 527
                            android:text="+"
569
                            android:textSize="16sp"
570
                            android:textColor="@color/white"/>
528
                            android:textColor="@color/white"
529
                            android:textSize="16sp" />
571 530
572 531
                        <TextView
573 532
                            android:id="@+id/tv_point"
574 533
                            android:layout_width="wrap_content"
575 534
                            android:layout_height="wrap_content"
576
                            android:text="20"
577
                            android:textSize="19sp"
578 535
                            android:layout_marginLeft="2dp"
579
                            android:textColor="@color/white"/>
536
                            android:text="20"
537
                            android:textColor="@color/white"
538
                            android:textSize="19sp" />
580 539
581 540
582 541
                    </LinearLayout>
@ -585,16 +544,15 @@
585 544
                        android:layout_width="wrap_content"
586 545
                        android:layout_height="wrap_content"
587 546
                        android:layout_gravity="center_horizontal"
547
                        android:layout_marginTop="2dp"
588 548
                        android:text="充电币"
589
                        android:textSize="13sp"
590 549
                        android:textColor="@color/white"
591
                        android:layout_marginTop="2dp"/>
550
                        android:textSize="13sp" />
592 551
593 552
594 553
                </LinearLayout>
595 554
596 555
597
598 556
            </RelativeLayout>
599 557
600 558
        </com.zhy.autolayout.AutoRelativeLayout>