spinnerCity.setSelection(default_type);
|
408
|
403
|
default_type = -1;
|
|
409
|
404
|
}
|
|
410
|
|
// if (currentProvince.getCities().size() > 0) {
|
|
411
|
|
// cityAdapter.notifyDataSetChanged();
|
|
412
|
|
// spinnerCity.setSelection(0);
|
|
413
|
|
// }
|
|
414
|
405
|
}
|
|
415
|
406
|
|
|
416
|
407
|
|
|
417
|
408
|
@Override
|
|
418
|
409
|
public void onClick(View v) {
|
|
419
|
410
|
switch (v.getId()) {
|
|
420
|
|
case R.id.rl_isBuy:
|
|
421
|
|
LayoutInflater inflater1 = (LayoutInflater) getSystemService(mContext.LAYOUT_INFLATER_SERVICE);
|
|
422
|
|
View popupWindowView = inflater1.inflate(R.layout.layout_isbuy, null);
|
|
423
|
|
final PopupWindow popupWindow1 = new PopupWindow(popupWindowView,
|
|
424
|
|
ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.FILL_PARENT,
|
|
425
|
|
true);
|
|
426
|
|
popupWindow1.setBackgroundDrawable(getResources().getDrawable(R.drawable.bg_yinying531));
|
|
427
|
|
popupWindow1.setOutsideTouchable(true);
|
|
428
|
|
popupWindowView.setOnKeyListener(new View.OnKeyListener() {
|
|
429
|
|
@Override
|
|
430
|
|
public boolean onKey(View v, int keyCode, KeyEvent event) {
|
|
431
|
|
if ((keyCode == KeyEvent.KEYCODE_MENU) && (popupWindow1.isShowing())) {
|
|
432
|
|
popupWindow1.dismiss();
|
|
433
|
|
return true;
|
|
434
|
|
}
|
|
435
|
|
return false;
|
|
436
|
|
}
|
|
437
|
|
});
|
|
438
|
|
popupWindowView.setOnTouchListener(new View.OnTouchListener() {
|
|
439
|
|
|
|
440
|
|
@Override
|
|
441
|
|
public boolean onTouch(View v, MotionEvent event) {
|
|
442
|
|
if (popupWindow1.isShowing()) {
|
|
443
|
|
popupWindow1.dismiss();
|
|
444
|
|
}
|
|
445
|
|
return false;
|
|
446
|
|
}
|
|
447
|
|
});
|
|
448
|
|
// 设置PopupWindow的弹出和消失效果
|
|
449
|
|
popupWindow1.setAnimationStyle(R.style.popupAnimation);
|
|
450
|
|
Button cancleButton = (Button) popupWindowView
|
|
451
|
|
.findViewById(R.id.cancleButton);
|
|
452
|
|
cancleButton.setOnClickListener(new View.OnClickListener() {
|
|
453
|
|
@Override
|
|
454
|
|
public void onClick(View view) {
|
|
455
|
|
popupWindow1.dismiss();
|
|
456
|
|
}
|
|
457
|
|
});
|
|
458
|
|
Button btn_one = (Button) popupWindowView.findViewById(R.id.tvTwo);
|
|
459
|
|
btn_one.setOnClickListener(new View.OnClickListener() {
|
|
460
|
|
@Override
|
|
461
|
|
public void onClick(View view) {
|
|
462
|
|
tv_buy.setText("已购买");
|
|
463
|
|
rl_select_car.setVisibility(View.VISIBLE);
|
|
464
|
|
|
|
465
|
|
// Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
|
|
466
|
|
// intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(new File(
|
|
467
|
|
// Environment.getExternalStorageDirectory(), "androidapp.jpg")));
|
|
468
|
|
// ((Activity) mContext).startActivityForResult(intent, 2);
|
|
469
|
|
popupWindow1.dismiss();
|
|
470
|
|
}
|
|
471
|
|
});
|
|
472
|
|
Button btn_two = (Button) popupWindowView.findViewById(R.id.tvThree);
|
|
473
|
|
btn_two.setOnClickListener(new View.OnClickListener() {
|
|
474
|
|
@Override
|
|
475
|
|
public void onClick(View view) {
|
|
476
|
|
tv_buy.setText("未购买");
|
|
477
|
|
rl_select_car.setVisibility(View.GONE);
|
|
478
|
|
// Intent intent = new Intent(Intent.ACTION_PICK, null);
|
|
479
|
|
// intent.setDataAndType(
|
|
480
|
|
// MediaStore.Images.Media.EXTERNAL_CONTENT_URI,
|
|
481
|
|
// "image/*");
|
|
482
|
|
// startActivityForResult(intent, 1);
|
|
483
|
|
popupWindow1.dismiss();
|
|
484
|
|
}
|
|
485
|
|
});
|
|
486
|
|
|
|
487
|
|
popupWindow1.showAtLocation(cancleButton, Gravity.CENTER, 0, 0);
|
|
488
|
|
break;
|
|
489
|
411
|
case R.id.rl_select_car:
|
|
490
|
412
|
startActivityForResult(new Intent(SkipUserInfoActivity.this, SelectCarActivity.class), REQUSET);
|
|
491
|
413
|
break;
|
|
|
@ -548,24 +470,12 @@ public class SkipUserInfoActivity extends Activity implements View.OnClickListen
|
|
548
|
470
|
|
|
549
|
471
|
private boolean checkText() {
|
|
550
|
472
|
String nickName = et_nickName.getText().toString().trim();
|
|
551
|
|
String isBuy = tv_buy.getText().toString().trim();
|
|
552
|
473
|
String carType = et_car.getText().toString().trim();
|
|
553
|
474
|
|
|
554
|
475
|
if (TextUtils.isEmpty(nickName)) {
|
|
555
|
476
|
Toast.makeText(this, "请输入您的昵称", Toast.LENGTH_SHORT).show();
|
|
556
|
477
|
return false;
|
|
557
|
478
|
}
|
|
558
|
|
if (TextUtils.isEmpty(isBuy)) {
|
|
559
|
|
Toast.makeText(this, "请选择您是否购买了新能源汽车", Toast.LENGTH_SHORT).show();
|
|
560
|
|
return false;
|
|
561
|
|
}
|
|
562
|
|
if (isBuy.equals("已购买")) {
|
|
563
|
|
if (TextUtils.isEmpty(carType)) {
|
|
564
|
|
Toast.makeText(this, "请选择您购买的车型", Toast.LENGTH_SHORT).show();
|
|
565
|
|
return false;
|
|
566
|
|
}
|
|
567
|
|
}
|
|
568
|
|
|
|
569
|
479
|
|
|
570
|
480
|
return true;
|
|
571
|
481
|
}
|
|
|
@ -600,18 +510,7 @@ public class SkipUserInfoActivity extends Activity implements View.OnClickListen
|
|
600
|
510
|
Log.i("cha---", MainMapActivity.cha + "");
|
|
601
|
511
|
String token = String.valueOf(updatetime);
|
|
602
|
512
|
Log.i("token---", token);
|
|
603
|
|
|
|
604
|
|
if (tv_buy.getText().toString().equals("未购买")) {
|
|
605
|
|
havecar = "待购";
|
|
606
|
|
} else {
|
|
607
|
|
if (null != car_type && null != car_brand) {
|
|
608
|
|
havecar = car_brand + "$$" + car_type;
|
|
609
|
|
}
|
|
610
|
|
}
|
|
611
|
|
|
|
612
|
513
|
nocar = "";
|
|
613
|
|
|
|
614
|
|
|
|
615
|
514
|
try {
|
|
616
|
515
|
if (photo != null) {
|
|
617
|
516
|
|
|
|
@ -49,6 +49,7 @@ import com.electric.chargingpile.R;
|
|
49
|
49
|
import com.electric.chargingpile.application.MainApplication;
|
|
50
|
50
|
import com.electric.chargingpile.data.Adin;
|
|
51
|
51
|
import com.electric.chargingpile.data.CarOwnerCertificateBean;
|
|
|
52
|
import com.electric.chargingpile.entity.CarSeriesEntity;
|
|
52
|
53
|
import com.electric.chargingpile.manager.ProfileManager;
|
|
53
|
54
|
import com.electric.chargingpile.util.DES3;
|
|
54
|
55
|
import com.electric.chargingpile.util.JsonUtils;
|
|
|
@ -65,6 +66,7 @@ import com.electric.chargingpile.view.SignInDialog;
|
|
65
|
66
|
import com.google.android.gms.appindexing.Action;
|
|
66
|
67
|
import com.google.android.gms.appindexing.AppIndex;
|
|
67
|
68
|
import com.google.android.gms.common.api.GoogleApiClient;
|
|
|
69
|
import com.google.gson.Gson;
|
|
68
|
70
|
import com.squareup.okhttp.Request;
|
|
69
|
71
|
import com.squareup.okhttp.Response;
|
|
70
|
72
|
import com.squareup.picasso.Picasso;
|
|
|
@ -172,6 +174,7 @@ public class UserCenterActivity extends Activity implements View.OnClickListener
|
|
172
|
174
|
*/
|
|
173
|
175
|
private GoogleApiClient client;
|
|
174
|
176
|
private ImageView chat_share_bar;
|
|
|
177
|
private TextView car_owner_certificate_label;
|
|
175
|
178
|
|
|
176
|
179
|
//把一个url的网络图片变成一个本地的BitMap
|
|
177
|
180
|
public Bitmap returnBitMap(final String url) {
|
|
|
@ -365,6 +368,8 @@ public class UserCenterActivity extends Activity implements View.OnClickListener
|
|
365
|
368
|
llPerson = (RelativeLayout) findViewById(R.id.ll_person);
|
|
366
|
369
|
llPerson.setOnClickListener(this);
|
|
367
|
370
|
|
|
|
371
|
car_owner_certificate_label = findViewById(R.id.car_owner_certificate_label);
|
|
|
372
|
|
|
368
|
373
|
//登陆按钮
|
|
369
|
374
|
userLogin = (TextView) findViewById(R.id.userLogin);
|
|
370
|
375
|
userLogin.setOnClickListener(this);
|
|
|
@ -431,6 +436,8 @@ public class UserCenterActivity extends Activity implements View.OnClickListener
|
|
431
|
436
|
|
|
432
|
437
|
set_loginShow();
|
|
433
|
438
|
|
|
|
439
|
getCarOwnerCertificateList("init");
|
|
|
440
|
|
|
434
|
441
|
}
|
|
435
|
442
|
|
|
436
|
443
|
private void getSharePrompt(String user_id) {
|
|
|
@ -1097,7 +1104,7 @@ public class UserCenterActivity extends Activity implements View.OnClickListener
|
|
1097
|
1104
|
intent.putExtra("url", "https://www.d1ev.com/special/models/wap/webView/index.html");
|
|
1098
|
1105
|
startActivity(intent);
|
|
1099
|
1106
|
}
|
|
1100
|
|
} else {
|
|
|
1107
|
} else if ("certificate".equals(from)) {
|
|
1101
|
1108
|
if (list.size() == 0) {
|
|
1102
|
1109
|
startActivity(new Intent(getApplication(), CarOwnerCertificateActivity.class));
|
|
1103
|
1110
|
} else {
|
|
|
@ -1105,6 +1112,24 @@ public class UserCenterActivity extends Activity implements View.OnClickListener
|
|
1105
|
1112
|
intent.putExtra("data", data);
|
|
1106
|
1113
|
startActivity(intent);
|
|
1107
|
1114
|
}
|
|
|
1115
|
} else if ("init".equals(from)) {
|
|
|
1116
|
boolean certificated = false;
|
|
|
1117
|
String chexing = "";
|
|
|
1118
|
for (CarOwnerCertificateBean bean : list) {
|
|
|
1119
|
if (bean.getStatus() == 1 && bean.getMain() == 1) {
|
|
|
1120
|
certificated = true;
|
|
|
1121
|
chexing = bean.getChexing();
|
|
|
1122
|
break;
|
|
|
1123
|
}
|
|
|
1124
|
}
|
|
|
1125
|
if (certificated) {
|
|
|
1126
|
Gson gson = new Gson();
|
|
|
1127
|
CarSeriesEntity carSeriesEntity = gson.fromJson(chexing, CarSeriesEntity.class);
|
|
|
1128
|
car_owner_certificate_label.setText(carSeriesEntity.getSeriesName());
|
|
|
1129
|
} else {
|
|
|
1130
|
car_owner_certificate_label.setText("认证车主得充电红包");
|
|
|
1131
|
}
|
|
|
1132
|
|
|
1108
|
1133
|
}
|
|
1109
|
1134
|
} else {
|
|
1110
|
1135
|
String rtnMsg = JsonUtils.getKeyResult(response, "rtnMsg");
|
|
|
@ -158,55 +158,6 @@
|
|
158
|
158
|
<View
|
|
159
|
159
|
android:layout_width="match_parent"
|
|
160
|
160
|
android:layout_height="0.5dp"
|
|
161
|
|
android:background="@color/in_line"
|
|
162
|
|
android:layout_marginLeft="16dp" />
|
|
163
|
|
|
|
164
|
|
<RelativeLayout
|
|
165
|
|
android:id="@+id/rl_isBuy"
|
|
166
|
|
android:layout_width="fill_parent"
|
|
167
|
|
android:background="@color/white"
|
|
168
|
|
android:layout_height="45dp"
|
|
169
|
|
android:visibility="visible">
|
|
170
|
|
<TextView
|
|
171
|
|
android:layout_width="wrap_content"
|
|
172
|
|
android:layout_height="match_parent"
|
|
173
|
|
android:text="是否购买新能源汽车"
|
|
174
|
|
android:textColor="@color/title_row"
|
|
175
|
|
android:textSize="15sp"
|
|
176
|
|
android:paddingLeft="16dp"
|
|
177
|
|
android:gravity="center"/>
|
|
178
|
|
|
|
179
|
|
<TextView
|
|
180
|
|
android:id="@+id/tv_buy"
|
|
181
|
|
android:layout_width="wrap_content"
|
|
182
|
|
android:layout_height="45dp"
|
|
183
|
|
android:background="@color/white"
|
|
184
|
|
android:hint="请选择"
|
|
185
|
|
android:textColorHint="@color/hintColor"
|
|
186
|
|
android:gravity="center|right"
|
|
187
|
|
android:singleLine="true"
|
|
188
|
|
android:textColor="@color/ui_62"
|
|
189
|
|
android:textSize="15sp"
|
|
190
|
|
android:layout_alignParentTop="true"
|
|
191
|
|
android:layout_marginRight="8dp"
|
|
192
|
|
android:layout_toLeftOf="@+id/imageView14"
|
|
193
|
|
android:layout_toStartOf="@+id/imageView14" />
|
|
194
|
|
|
|
195
|
|
<ImageView
|
|
196
|
|
android:layout_width="wrap_content"
|
|
197
|
|
android:layout_height="match_parent"
|
|
198
|
|
android:src="@drawable/icon_more2_0"
|
|
199
|
|
android:layout_centerVertical="true"
|
|
200
|
|
android:layout_alignParentRight="true"
|
|
201
|
|
android:layout_alignParentEnd="true"
|
|
202
|
|
android:layout_marginRight="16dp"
|
|
203
|
|
android:id="@+id/imageView14" />
|
|
204
|
|
|
|
205
|
|
</RelativeLayout>
|
|
206
|
|
|
|
207
|
|
<View
|
|
208
|
|
android:layout_width="match_parent"
|
|
209
|
|
android:layout_height="0.5dp"
|
|
210
|
161
|
android:background="@color/ui_line"
|
|
211
|
162
|
android:layout_marginLeft="16dp"
|
|
212
|
163
|
android:visibility="visible"/>
|
|
|
@ -501,6 +501,17 @@
|
|
501
|
501
|
android:textSize="15sp" />
|
|
502
|
502
|
|
|
503
|
503
|
<TextView
|
|
|
504
|
android:id="@+id/car_owner_certificate_label"
|
|
|
505
|
android:layout_width="wrap_content"
|
|
|
506
|
android:layout_height="match_parent"
|
|
|
507
|
android:layout_toLeftOf="@+id/iv_certificate_cursor"
|
|
|
508
|
android:text=""
|
|
|
509
|
android:textSize="14sp"
|
|
|
510
|
android:gravity="center_vertical"
|
|
|
511
|
android:layout_marginRight="12dp"
|
|
|
512
|
android:textColor="@color/lvse"/>
|
|
|
513
|
<TextView
|
|
|
514
|
android:id="@+id/iv_certificate_cursor"
|
|
504
|
515
|
android:layout_width="wrap_content"
|
|
505
|
516
|
android:layout_height="wrap_content"
|
|
506
|
517
|
android:layout_alignParentTop="true"
|
|
|
@ -543,6 +554,17 @@
|
|
543
|
554
|
|
|
544
|
555
|
<TextView
|
|
545
|
556
|
android:layout_width="wrap_content"
|
|
|
557
|
android:layout_height="match_parent"
|
|
|
558
|
android:layout_toLeftOf="@+id/iv_price_cursor"
|
|
|
559
|
android:text="发表成交价得充电红包"
|
|
|
560
|
android:textSize="14sp"
|
|
|
561
|
android:gravity="center_vertical"
|
|
|
562
|
android:layout_marginRight="12dp"
|
|
|
563
|
android:textColor="@color/lvse"/>
|
|
|
564
|
|
|
|
565
|
<TextView
|
|
|
566
|
android:id="@+id/iv_price_cursor"
|
|
|
567
|
android:layout_width="wrap_content"
|
|
546
|
568
|
android:layout_height="wrap_content"
|
|
547
|
569
|
android:layout_alignParentTop="true"
|
|
548
|
570
|
android:layout_alignParentRight="true"
|