>47
* 确认订单
|
|
20
|
48
|
* */
|
|
21
|
49
|
public class ConfirmOrderActivity extends AppCompatActivity implements View.OnClickListener {
|
|
22
|
50
|
|
|
23
|
|
private RelativeLayout layoutRed;
|
|
|
51
|
private RelativeLayout layoutRed,rl_end_info;
|
|
|
52
|
private TextView tv_name,tv_charging_shifu,tv_charging_cost,tv_service_cost,tv_charging_hongbao,
|
|
|
53
|
tv_zhuang_no,tv_charging_time,tv_charging_liang,tv_tishi,tv_gocomment;
|
|
|
54
|
private ImageView default_hb,iv_back;
|
|
|
55
|
|
|
|
56
|
private String mRedEnvelopeId=null;
|
|
|
57
|
private String activeUrl;
|
|
|
58
|
private ChargingBean mChargingBean;
|
|
|
59
|
private LoadingDialog mDialog;
|
|
|
60
|
private int try_count=0;
|
|
|
61
|
private int delayedSettlementCount=0;
|
|
24
|
62
|
|
|
25
|
63
|
@Override
|
|
26
|
64
|
protected void onCreate(@Nullable @org.jetbrains.annotations.Nullable Bundle savedInstanceState) {
|
|
27
|
65
|
super.onCreate(savedInstanceState);
|
|
28
|
66
|
setContentView(R.layout.activity_submit_orders);
|
|
|
67
|
mDialog = new LoadingDialog(this);
|
|
|
68
|
mDialog.setCanceledOnTouchOutside(false);
|
|
|
69
|
|
|
|
70
|
initIntent();
|
|
29
|
71
|
initView();
|
|
|
72
|
initData();
|
|
|
73
|
}
|
|
|
74
|
|
|
|
75
|
private void initIntent() {
|
|
|
76
|
mChargingBean = (ChargingBean) getIntent().getSerializableExtra(BaseConstants.CHARGING_DATA);
|
|
|
77
|
activeUrl = getIntent().getStringExtra(BaseConstants.ACTIVITY_URL);
|
|
|
78
|
String orderId = getIntent().getStringExtra(ChargingConstants.ORDERID);
|
|
|
79
|
if (!TextUtils.isEmpty(orderId)){
|
|
|
80
|
requestDelayedSettlement(orderId);
|
|
|
81
|
}
|
|
|
82
|
}
|
|
|
83
|
|
|
|
84
|
private void requestDelayedSettlement(String orderId) {
|
|
|
85
|
delayedSettlementCount++;
|
|
|
86
|
if (this != null && !this.isFinishing()) {
|
|
|
87
|
mDialog.show();
|
|
|
88
|
}
|
|
|
89
|
Log.e("TAG", "requestDelayedSettlement: userid: "+MainApplication.userId );
|
|
|
90
|
Log.e("TAG", "requestDelayedSettlement: pwd: "+ MainApplication.userPassword);
|
|
|
91
|
Log.e("TAG", "requestDelayedSettlement: orderid: "+ orderId);
|
|
|
92
|
OkHttpUtils.get()
|
|
|
93
|
.url(UrlConstants.QUERY_NOT_CLOSE)
|
|
|
94
|
.addParams(com.electric.chargingpile.constant.ChargingConstants.USERID, MainApplication.userId)
|
|
|
95
|
.addParams(com.electric.chargingpile.constant.ChargingConstants.PWD, MainApplication.userPassword)
|
|
|
96
|
.addParams(com.electric.chargingpile.constant.ChargingConstants.ORDERID, orderId)
|
|
|
97
|
.build()
|
|
|
98
|
.connTimeOut(15000)
|
|
|
99
|
.readTimeOut(15000)
|
|
|
100
|
.execute(new StringCallback() {
|
|
|
101
|
@Override
|
|
|
102
|
public void onError(Call call, Exception e) {
|
|
|
103
|
LogUtils.e();
|
|
|
104
|
ToastUtil.showToast(getApplicationContext(), "网络异常,请检查您的网络连接", Toast.LENGTH_SHORT);
|
|
|
105
|
CrashReport.postCatchedException(e);
|
|
|
106
|
|
|
|
107
|
Log.e(this.getClass().getName(),"requestDelayedSettlement--onError--"+e.getMessage());
|
|
|
108
|
|
|
|
109
|
}
|
|
|
110
|
|
|
|
111
|
@Override
|
|
|
112
|
public void onResponse(String response) {
|
|
|
113
|
LogUtils.e("hyc requestDelayedSettlement--" + response);
|
|
|
114
|
String rtnCode = JsonUtils.getKeyResult(response, "rtnCode");
|
|
|
115
|
String rtnMsg = JsonUtils.getKeyResult(response, "rtnMsg");
|
|
|
116
|
|
|
|
117
|
if (null != rtnCode) {
|
|
|
118
|
if ("01".equals(rtnCode)) {
|
|
|
119
|
String data = JsonUtils.getKeyResult(response, "data");
|
|
|
120
|
ChargingBean chargingBean = JsonUtils.parseToObjectBean(data, ChargingBean.class);
|
|
|
121
|
int status = chargingBean.getStatus();
|
|
|
122
|
if (status >= 2) {
|
|
|
123
|
mChargingBean=chargingBean;
|
|
|
124
|
dismissDialog();
|
|
|
125
|
upDateView();
|
|
|
126
|
} else {
|
|
|
127
|
if (delayedSettlementCount < 6) {
|
|
|
128
|
new Handler().postDelayed(new Runnable() {
|
|
|
129
|
@Override
|
|
|
130
|
public void run() {
|
|
|
131
|
requestDelayedSettlement(orderId);
|
|
|
132
|
}
|
|
|
133
|
}, 2000);
|
|
|
134
|
} else {
|
|
|
135
|
dismissDialog();
|
|
|
136
|
startActivity(new Intent(getApplicationContext(), DelayInfoActivity.class));
|
|
|
137
|
finish();
|
|
|
138
|
}
|
|
|
139
|
}
|
|
|
140
|
}
|
|
|
141
|
if ("02".equals(rtnCode)) {
|
|
|
142
|
dismissDialog();
|
|
|
143
|
startActivity(new Intent(getApplicationContext(), DelayInfoActivity.class));
|
|
|
144
|
finish();
|
|
|
145
|
} else {
|
|
|
146
|
dismissDialog();
|
|
|
147
|
ToastUtil.showToast(getApplicationContext(),rtnMsg,Toast.LENGTH_SHORT);
|
|
|
148
|
}
|
|
|
149
|
}
|
|
|
150
|
|
|
|
151
|
}
|
|
|
152
|
});
|
|
30
|
153
|
}
|
|
31
|
154
|
|
|
32
|
155
|
private void initView() {
|
|
|
156
|
iv_back = findViewById(R.id.iv_back);
|
|
|
157
|
|
|
|
158
|
tv_name=findViewById(R.id.tv_name);
|
|
|
159
|
tv_charging_shifu=findViewById(R.id.tv_charging_shifu);
|
|
|
160
|
tv_charging_cost=findViewById(R.id.tv_charging_cost);
|
|
|
161
|
tv_service_cost=findViewById(R.id.tv_service_cost);
|
|
|
162
|
|
|
|
163
|
|
|
33
|
164
|
layoutRed = findViewById(R.id.layoutRed);
|
|
|
165
|
// default_hb = findViewById(R.id.default_hb);
|
|
|
166
|
tv_charging_hongbao = findViewById(R.id.tv_charging_hongbao);
|
|
|
167
|
|
|
|
168
|
tv_zhuang_no=findViewById(R.id.tv_zhuang_no);
|
|
|
169
|
tv_charging_time=findViewById(R.id.tv_charging_time);
|
|
|
170
|
tv_charging_liang=findViewById(R.id.tv_charging_liang);
|
|
|
171
|
tv_tishi=findViewById(R.id.tv_tishi);
|
|
|
172
|
rl_end_info=findViewById(R.id.rl_end_info);
|
|
|
173
|
|
|
|
174
|
tv_gocomment = findViewById(R.id.tv_gocomment);
|
|
|
175
|
|
|
|
176
|
iv_back.setOnClickListener(this);
|
|
34
|
177
|
layoutRed.setOnClickListener(this);
|
|
|
178
|
tv_gocomment.setOnClickListener(this);
|
|
|
179
|
|
|
|
180
|
upDateView();
|
|
|
181
|
|
|
35
|
182
|
}
|
|
36
|
183
|
|
|
|
184
|
private void upDateView() {
|
|
|
185
|
if (mChargingBean!=null){
|
|
|
186
|
tv_name.setText(mChargingBean.getZhanname());
|
|
|
187
|
tv_charging_shifu.setText(mChargingBean.getUserMoney());
|
|
|
188
|
tv_charging_cost.setText(mChargingBean.getElecMoney()+"元");
|
|
|
189
|
tv_service_cost.setText(mChargingBean.getServiceMoney()+"元");
|
|
|
190
|
tv_charging_hongbao.setText("默认已选择最大优惠 >");
|
|
37
|
191
|
|
|
38
|
|
@Override
|
|
39
|
|
public void onClick(View v) {
|
|
40
|
|
switch (v.getId()){
|
|
41
|
|
case R.id.layoutRed:
|
|
42
|
|
FragmentManager fragmentManager = getSupportFragmentManager();
|
|
43
|
|
FragmentTransaction ft = fragmentManager.beginTransaction();
|
|
44
|
|
Fragment prev = fragmentManager.findFragmentByTag(PreferentialDialog.class.getName());
|
|
45
|
|
if (prev != null) {
|
|
46
|
|
ft.remove(prev);
|
|
47
|
|
}
|
|
|
192
|
tv_zhuang_no.setText(mChargingBean.getStubId());
|
|
|
193
|
tv_charging_time.setText(mChargingBean.getTimeCharge());
|
|
|
194
|
tv_charging_liang.setText(mChargingBean.getPower()+"度");
|
|
48
|
195
|
|
|
49
|
|
PreferentialDialog dialog= PreferentialDialog.newInstance();
|
|
50
|
|
dialog.show(fragmentManager,PreferentialDialog.class.getName());
|
|
|
196
|
/* if (TextUtils.isEmpty(mChargingBean.getEndInfo())) {
|
|
|
197
|
rl_end_info.setVisibility(View.GONE);
|
|
|
198
|
}else{
|
|
|
199
|
tv_tishi.setText(mChargingBean.getEndInfo());
|
|
|
200
|
rl_end_info.setVisibility(View.VISIBLE);
|
|
|
201
|
}*/
|
|
|
202
|
}
|
|
|
203
|
}
|
|
51
|
204
|
|
|
52
|
|
fragmentManager.executePendingTransactions();
|
|
53
|
205
|
|
|
|
206
|
@Override
|
|
|
207
|
public void onClick(View v) {
|
|
|
208
|
switch (v.getId()){
|
|
|
209
|
case R.id.layoutRed: //优惠券选择
|
|
|
210
|
// default_hb.setVisibility(View.GONE);
|
|
|
211
|
showPreferentialDialog();
|
|
54
|
212
|
break;
|
|
55
|
213
|
case R.id.tv_gocomment:
|
|
56
|
|
Intent oderIntent = new Intent(this, OderDetailsActivity.class);
|
|
57
|
|
startActivity(oderIntent);
|
|
|
214
|
if (TextUtils.isEmpty(mRedEnvelopeId)){
|
|
|
215
|
pollingChargingStats();
|
|
|
216
|
|
|
|
217
|
}else{
|
|
|
218
|
requestComment();
|
|
|
219
|
}
|
|
58
|
220
|
break;
|
|
59
|
221
|
case R.id.iv_back:
|
|
60
|
222
|
finish();
|
|
|
@ -62,8 +224,222 @@ public class ConfirmOrderActivity extends AppCompatActivity implements View.OnCl
|
|
62
|
224
|
}
|
|
63
|
225
|
}
|
|
64
|
226
|
|
|
65
|
|
public static void actionStart(Context context){
|
|
|
227
|
private void requestComment() {
|
|
|
228
|
if (this != null && !this.isFinishing()) {
|
|
|
229
|
mDialog.show();
|
|
|
230
|
}
|
|
|
231
|
Log.e("TAG_hcy", "requestComment: "+mRedEnvelopeId);
|
|
|
232
|
OkHttpUtils.get()
|
|
|
233
|
.url(UrlConstants.SETTLEMENT)
|
|
|
234
|
.addParams(ChargingConstants.USERID, MainApplication.userId)
|
|
|
235
|
.addParams(ChargingConstants.PWD, MainApplication.userPassword)
|
|
|
236
|
.addParams(ChargingConstants.ORDERID, mChargingBean.getOrderId())
|
|
|
237
|
.addParams(ChargingConstants.HBID, mRedEnvelopeId)
|
|
|
238
|
.build()
|
|
|
239
|
.execute(new StringCallback() {
|
|
|
240
|
@Override
|
|
|
241
|
public void onError(Call call, Exception e) {
|
|
|
242
|
dismissDialog();
|
|
|
243
|
LogUtils.e();
|
|
|
244
|
ToastUtil.showToast(getApplicationContext(), "网络异常,请检查您的网络连接", Toast.LENGTH_SHORT);
|
|
|
245
|
CrashReport.postCatchedException(e);
|
|
|
246
|
|
|
|
247
|
Log.e(this.getClass().getName(),"requestComment--onError--"+e.getMessage());
|
|
|
248
|
}
|
|
|
249
|
|
|
|
250
|
@Override
|
|
|
251
|
public void onResponse(String response) {
|
|
|
252
|
LogUtils.e("SETTLEMENT=" + response);
|
|
|
253
|
String rtnCode = JsonUtils.getKeyResult(response, "rtnCode");
|
|
|
254
|
String rtnMsg = JsonUtils.getKeyResult(response, "rtnMsg");
|
|
|
255
|
dismissDialog();
|
|
|
256
|
if (null != rtnCode) {
|
|
|
257
|
if ("01".equals(rtnCode)) {
|
|
|
258
|
pollingChargingStats();
|
|
|
259
|
}
|
|
|
260
|
}
|
|
|
261
|
|
|
|
262
|
}
|
|
|
263
|
});
|
|
|
264
|
|
|
|
265
|
}
|
|
|
266
|
private void pollingChargingStats() {
|
|
|
267
|
try_count++;
|
|
|
268
|
OkHttpUtils.get().url(UrlConstants.CHARGING_STATUS_URL)
|
|
|
269
|
.addParams(com.electric.chargingpile.constant.ChargingConstants.USERID, MainApplication.userId)
|
|
|
270
|
.addParams(com.electric.chargingpile.constant.ChargingConstants.PWD, MainApplication.userPassword)
|
|
|
271
|
.addParams(com.electric.chargingpile.constant.ChargingConstants.ORDERID, mChargingBean.getOrderId())
|
|
|
272
|
.tag(this)
|
|
|
273
|
.build()
|
|
|
274
|
.connTimeOut(15000)
|
|
|
275
|
.readTimeOut(15000)
|
|
|
276
|
.execute(new StringCallback() {
|
|
|
277
|
@Override
|
|
|
278
|
public void onError(Call call, Exception e) {
|
|
|
279
|
// dismissDialog();
|
|
|
280
|
// ToastUtil.showToast(getApplicationContext(),"网络异常,请检查您的网络连接",Toast.LENGTH_SHORT);
|
|
|
281
|
CrashReport.postCatchedException(e);
|
|
|
282
|
}
|
|
|
283
|
|
|
|
284
|
@Override
|
|
|
285
|
public void onResponse(String response) {
|
|
|
286
|
LogUtils.e("polling=" + response);
|
|
|
287
|
String rtnCode = JsonUtils.getKeyResult(response, "rtnCode");
|
|
|
288
|
String rtnMsg = JsonUtils.getKeyResult(response, "rtnMsg");
|
|
|
289
|
if (null != rtnCode) {
|
|
|
290
|
if ("01".equals(rtnCode)) {
|
|
|
291
|
String data = JsonUtils.getKeyResult(response, "data");
|
|
|
292
|
ChargingBean chargingBean = JsonUtils.parseToObjectBean(data, ChargingBean.class);
|
|
|
293
|
int status = chargingBean.getStatus();
|
|
|
294
|
if (status >= 4) {
|
|
|
295
|
// if (mTimer != null) {
|
|
|
296
|
// mTimer.cancel();
|
|
|
297
|
// mTimer = null;
|
|
|
298
|
// }
|
|
|
299
|
// if (timer != null) {
|
|
|
300
|
// timer.cancel();
|
|
|
301
|
// timer = null;
|
|
|
302
|
// }
|
|
|
303
|
dismissDialog();
|
|
|
304
|
ToastUtil.showToast(getApplicationContext(), "本次充电已结束", Toast.LENGTH_SHORT);
|
|
|
305
|
MainApplication.isAppStart = false;
|
|
|
306
|
ProfileManager.getInstance().setAppStart(getApplicationContext(), MainApplication.isAppStart);
|
|
|
307
|
Intent intent = new Intent(getApplicationContext(), OderDetailsActivity.class);
|
|
|
308
|
intent.putExtra(BaseConstants.CHARGING_DATA, chargingBean);
|
|
|
309
|
intent.putExtra(BaseConstants.ACTIVITY_URL, activeUrl);
|
|
|
310
|
startActivity(intent);
|
|
|
311
|
finish();
|
|
|
312
|
|
|
|
313
|
} else {
|
|
|
314
|
if (try_count < 6) {
|
|
|
315
|
new Handler().postDelayed(new Runnable() {
|
|
|
316
|
@Override
|
|
|
317
|
public void run() {
|
|
|
318
|
pollingChargingStats();
|
|
|
319
|
}
|
|
|
320
|
}, 2000);
|
|
|
321
|
} else {
|
|
|
322
|
dismissDialog();
|
|
|
323
|
startActivity(new Intent(getApplicationContext(), DelayInfoActivity.class));
|
|
|
324
|
finish();
|
|
|
325
|
}
|
|
|
326
|
}
|
|
|
327
|
}
|
|
|
328
|
if ("02".equals(rtnCode)) {
|
|
|
329
|
dismissDialog();
|
|
|
330
|
startActivity(new Intent(getApplicationContext(), DelayInfoActivity.class));
|
|
|
331
|
finish();
|
|
|
332
|
} else {
|
|
|
333
|
// dismissDialog();
|
|
|
334
|
// ToastUtil.showToast(getApplicationContext(),rtnMsg,Toast.LENGTH_SHORT);
|
|
|
335
|
}
|
|
|
336
|
}
|
|
|
337
|
}
|
|
|
338
|
});
|
|
|
339
|
}
|
|
|
340
|
|
|
|
341
|
|
|
|
342
|
|
|
|
343
|
private void showPreferentialDialog() {
|
|
|
344
|
FragmentManager fragmentManager = getSupportFragmentManager();
|
|
|
345
|
FragmentTransaction ft = fragmentManager.beginTransaction();
|
|
|
346
|
Fragment prev = fragmentManager.findFragmentByTag(PreferentialDialog.class.getName());
|
|
|
347
|
if (prev != null) {
|
|
|
348
|
ft.remove(prev);
|
|
|
349
|
}
|
|
|
350
|
if (TextUtils.isEmpty(mChargingBean.getUserMoney())){
|
|
|
351
|
Toast.makeText(this, "结算金额出现问题", Toast.LENGTH_SHORT).show();
|
|
|
352
|
return ;
|
|
|
353
|
}
|
|
|
354
|
PreferentialDialog dialog= PreferentialDialog.newInstance(mChargingBean.getUserMoney());
|
|
|
355
|
dialog.setListener(bean -> {
|
|
|
356
|
if (bean!=null){
|
|
|
357
|
String hongbao = Util.getRedEnvelopeName(bean);
|
|
|
358
|
mRedEnvelopeId=bean.getId();
|
|
|
359
|
tv_charging_hongbao.setText(hongbao+" >");
|
|
|
360
|
}
|
|
|
361
|
});
|
|
|
362
|
dialog.show(fragmentManager,PreferentialDialog.class.getName());
|
|
|
363
|
fragmentManager.executePendingTransactions();
|
|
|
364
|
}
|
|
|
365
|
private void dismissDialog() {
|
|
|
366
|
if (this != null && !this.isFinishing()) {
|
|
|
367
|
if (mDialog.isShowing()) {
|
|
|
368
|
mDialog.dismiss();
|
|
|
369
|
}
|
|
|
370
|
}
|
|
|
371
|
}
|
|
|
372
|
|
|
|
373
|
|
|
|
374
|
private void initData() {
|
|
|
375
|
OkHttpUtils.get()
|
|
|
376
|
.url(com.google.zxing.client.android.constant.UrlConstants.RED_ENVELOPE_LIST)
|
|
|
377
|
.addParams(ChargingConstants.USERID, MainApplication.userId)
|
|
|
378
|
.addParams(ChargingConstants.PWD, MainApplication.userPassword)
|
|
|
379
|
.build()
|
|
|
380
|
.execute(new StringCallback() {
|
|
|
381
|
@Override
|
|
|
382
|
public void onError(Call call, Exception e) {
|
|
|
383
|
|
|
|
384
|
}
|
|
|
385
|
|
|
|
386
|
@Override
|
|
|
387
|
public void onResponse(String response) {
|
|
|
388
|
Log.d("HYC", "onResponse: " + response);
|
|
|
389
|
|
|
|
390
|
Gson gson = new Gson();
|
|
|
391
|
List<RedEnvelopeBean> datas = gson.fromJson(response, new TypeToken<List<RedEnvelopeBean>>() {
|
|
|
392
|
}.getType());
|
|
|
393
|
if (datas != null) {
|
|
|
394
|
removeData(datas);
|
|
|
395
|
if (datas.size()>0){
|
|
|
396
|
layoutRed.setEnabled(true);
|
|
|
397
|
}else{
|
|
|
398
|
layoutRed.setEnabled(false);
|
|
|
399
|
tv_charging_hongbao.setText("暂无红包/优惠券");
|
|
|
400
|
tv_charging_hongbao.setTextColor(Color.parseColor("#DDDDDD"));
|
|
|
401
|
}
|
|
|
402
|
}else{
|
|
|
403
|
layoutRed.setEnabled(false);
|
|
|
404
|
tv_charging_hongbao.setText("暂无红包/优惠券");
|
|
|
405
|
tv_charging_hongbao.setTextColor(Color.parseColor("#DDDDDD"));
|
|
|
406
|
|
|
|
407
|
}
|
|
|
408
|
}
|
|
|
409
|
});
|
|
|
410
|
}
|
|
|
411
|
|
|
|
412
|
private void removeData(List<RedEnvelopeBean> datas) {
|
|
|
413
|
String userMoney = mChargingBean.getUserMoney();
|
|
|
414
|
if (TextUtils.isEmpty(userMoney)){
|
|
|
415
|
return;
|
|
|
416
|
}
|
|
|
417
|
try {
|
|
|
418
|
for (int i = datas.size() - 1; i >= 0; i--) {
|
|
|
419
|
RedEnvelopeBean redEnvelopeBean = datas.get(i);
|
|
|
420
|
double max_money = Double.parseDouble(redEnvelopeBean.getMax_money());
|
|
|
421
|
double money = Double.parseDouble(userMoney);
|
|
|
422
|
if (money < max_money) {
|
|
|
423
|
datas.remove(i);
|
|
|
424
|
}
|
|
|
425
|
}
|
|
|
426
|
} catch (NumberFormatException e) {
|
|
|
427
|
LogUtils.e("polling=" + e.getMessage());
|
|
|
428
|
}
|
|
|
429
|
|
|
|
430
|
}
|
|
|
431
|
|
|
|
432
|
@Override
|
|
|
433
|
protected void onDestroy() {
|
|
|
434
|
super.onDestroy();
|
|
|
435
|
try_count = 0;
|
|
|
436
|
delayedSettlementCount = 0;
|
|
|
437
|
}
|
|
|
438
|
|
|
|
439
|
public static void actionStart(Context context, ChargingBean bean, String activeUrl){
|
|
66
|
440
|
Intent intent = new Intent(context, ConfirmOrderActivity.class);
|
|
|
441
|
intent.putExtra(BaseConstants.CHARGING_DATA,bean);
|
|
|
442
|
intent.putExtra(BaseConstants.ACTIVITY_URL,activeUrl);
|
|
67
|
443
|
context.startActivity(intent);
|
|
68
|
444
|
}
|
|
69
|
445
|
|
|
|
@ -131,6 +131,7 @@ import com.electric.chargingpile.util.ZhanDBHelper;
|
|
131
|
131
|
import com.electric.chargingpile.view.AlertDialogCommon;
|
|
132
|
132
|
import com.electric.chargingpile.view.AlertDialogUpdate;
|
|
133
|
133
|
import com.electric.chargingpile.view.NotRegisterDialog;
|
|
|
134
|
import com.electric.chargingpile.view.PreferentialDialog;
|
|
134
|
135
|
import com.electric.chargingpile.view.SlideAdView;
|
|
135
|
136
|
import com.electric.chargingpile.view.UpdateDialog;
|
|
136
|
137
|
import com.google.gson.Gson;
|
|
|
@ -908,7 +909,7 @@ public class MainMapActivity extends Activity implements LocationSource, AMapLoc
|
|
908
|
909
|
}
|
|
909
|
910
|
|
|
910
|
911
|
showPostDelayedDialog();
|
|
911
|
|
|
|
|
912
|
// ConfirmOrderActivity.actionStart(this);
|
|
912
|
913
|
// startActivity(new Intent(getApplication(), ChargingStatusActivity.class));
|
|
913
|
914
|
// startActivity(new Intent(this, SkipUserInfoActivity.class));
|
|
914
|
915
|
}
|
|
|
@ -1057,11 +1057,6 @@ public class UserInfoActivity extends Activity implements View.OnClickListener,
|
|
1057
|
1057
|
super.onResume();
|
|
1058
|
1058
|
MobclickAgent.onResume(this);
|
|
1059
|
1059
|
getCarOwnerCertificateList(false);
|
|
1060
|
|
String carIntentModel = ProfileManager.getInstance().getCarIntentModel(this);
|
|
1061
|
|
|
|
1062
|
|
if (!TextUtils.isEmpty(carIntentModel)){
|
|
1063
|
|
carModel.setText(carIntentModel);
|
|
1064
|
|
}
|
|
1065
|
1060
|
}
|
|
1066
|
1061
|
|
|
1067
|
1062
|
@Override
|
|
|
@ -1106,6 +1101,7 @@ public class UserInfoActivity extends Activity implements View.OnClickListener,
|
|
1106
|
1101
|
public void onResponse(String response) {
|
|
1107
|
1102
|
loadDialog.dismiss();
|
|
1108
|
1103
|
String rtnCode = JsonUtils.getKeyResult(response, "rtnCode");
|
|
|
1104
|
Log.e(TAG, "onResponse: "+response );
|
|
1109
|
1105
|
if ("01".equals(rtnCode)) {
|
|
1110
|
1106
|
String data = JsonUtils.getKeyResult(response, "data");
|
|
1111
|
1107
|
List<CarOwnerCertificateBean> list = JsonUtils.parseToObjectList(data, CarOwnerCertificateBean.class);
|
|
|
@ -1149,14 +1145,14 @@ public class UserInfoActivity extends Activity implements View.OnClickListener,
|
|
1149
|
1145
|
go_title.setText("认证车主");
|
|
1150
|
1146
|
go_desc.setText("审核中");
|
|
1151
|
1147
|
go_desc.setTextColor(Color.RED);
|
|
1152
|
|
go_cursor.setVisibility(View.GONE);
|
|
|
1148
|
go_cursor.setVisibility(View.INVISIBLE);
|
|
1153
|
1149
|
} else if (certificateStatus == 3) {
|
|
1154
|
1150
|
go_title.setText("认证车主");
|
|
1155
|
1151
|
if (carSeriesEntity != null) {
|
|
1156
|
1152
|
go_desc.setText(carSeriesEntity.getSeriesName());
|
|
1157
|
1153
|
}
|
|
1158
|
1154
|
go_desc.setTextColor(Color.parseColor("#0E0E0E"));
|
|
1159
|
|
go_cursor.setVisibility(View.GONE);
|
|
|
1155
|
go_cursor.setVisibility(View.INVISIBLE);
|
|
1160
|
1156
|
} else {
|
|
1161
|
1157
|
go_title.setText("认证车主");
|
|
1162
|
1158
|
go_desc.setText("去认证车主(得充电优惠券)");
|
|
|
@ -1,15 +1,19 @@
|
|
1
|
1
|
package com.electric.chargingpile.adapter;
|
|
2
|
2
|
|
|
|
3
|
import android.content.Context;
|
|
3
|
4
|
import android.view.LayoutInflater;
|
|
4
|
5
|
import android.view.View;
|
|
5
|
6
|
import android.view.ViewGroup;
|
|
6
|
7
|
import android.widget.CheckBox;
|
|
7
|
8
|
import android.widget.TextView;
|
|
|
9
|
import android.widget.Toast;
|
|
8
|
10
|
|
|
9
|
11
|
import androidx.annotation.NonNull;
|
|
10
|
12
|
import androidx.recyclerview.widget.RecyclerView;
|
|
11
|
13
|
|
|
12
|
14
|
import com.electric.chargingpile.R;
|
|
|
15
|
import com.electric.chargingpile.data.RedEnvelopeBean;
|
|
|
16
|
import com.electric.chargingpile.util.Util;
|
|
13
|
17
|
|
|
14
|
18
|
import org.jetbrains.annotations.NotNull;
|
|
15
|
19
|
|
|
|
@ -18,7 +22,33 @@ import java.util.List;
|
|
18
|
22
|
|
|
19
|
23
|
public class PreferentialAdapter extends RecyclerView.Adapter<PreferentialAdapter.ViewHodler> {
|
|
20
|
24
|
|
|
21
|
|
private List<String> mDatas=new ArrayList<String>();
|
|
|
25
|
private List<RedEnvelopeBean> mDatas = new ArrayList<RedEnvelopeBean>();
|
|
|
26
|
private Context mContext;
|
|
|
27
|
|
|
|
28
|
private int lastPosition = -1;
|
|
|
29
|
private int currentPostion = -1;
|
|
|
30
|
public PreferentialAdapter(Context context){
|
|
|
31
|
mContext=context;
|
|
|
32
|
}
|
|
|
33
|
|
|
|
34
|
|
|
|
35
|
public List<RedEnvelopeBean> getmDatas() {
|
|
|
36
|
return mDatas;
|
|
|
37
|
}
|
|
|
38
|
|
|
|
39
|
public void setDatas(List<RedEnvelopeBean> datas) {
|
|
|
40
|
RedEnvelopeBean element = new RedEnvelopeBean();
|
|
|
41
|
element.setId("nono");
|
|
|
42
|
element.setType("-1");
|
|
|
43
|
element.setCheck(true);
|
|
|
44
|
if (datas == null){
|
|
|
45
|
datas = new ArrayList<RedEnvelopeBean>();
|
|
|
46
|
}
|
|
|
47
|
this.mDatas = datas;
|
|
|
48
|
mDatas.add(0, element);
|
|
|
49
|
notifyDataSetChanged();
|
|
|
50
|
}
|
|
|
51
|
|
|
22
|
52
|
@NonNull
|
|
23
|
53
|
@NotNull
|
|
24
|
54
|
@Override
|
|
|
@ -29,23 +59,45 @@ public class PreferentialAdapter extends RecyclerView.Adapter<PreferentialAdapte
|
|
29
|
59
|
|
|
30
|
60
|
@Override
|
|
31
|
61
|
public void onBindViewHolder(@NonNull @NotNull ViewHodler holder, int position) {
|
|
32
|
|
holder.checkBox.setChecked(false);
|
|
33
|
|
holder.name.setText("优惠券" + position);
|
|
|
62
|
RedEnvelopeBean bean = mDatas.get(position);
|
|
|
63
|
if (bean != null) {
|
|
|
64
|
String name = Util.getRedEnvelopeName(bean);
|
|
|
65
|
|
|
|
66
|
holder.checkBox.setChecked(bean.isCheck());
|
|
|
67
|
holder.name.setText(name);
|
|
|
68
|
|
|
|
69
|
|
|
|
70
|
holder.itemView.setOnClickListener(v->{
|
|
|
71
|
if (bean.isCheck()){
|
|
|
72
|
return;
|
|
|
73
|
}
|
|
|
74
|
selectPostioin(position);
|
|
|
75
|
});
|
|
34
|
76
|
|
|
35
|
|
holder.checkBox.setOnClickListener(v->{
|
|
36
|
|
selectPostioin(position);
|
|
37
|
|
});
|
|
|
77
|
holder.checkBox.setOnClickListener(v -> {
|
|
|
78
|
if (bean.isCheck()){
|
|
|
79
|
holder.checkBox.setChecked(bean.isCheck());
|
|
|
80
|
return;
|
|
|
81
|
}
|
|
|
82
|
|
|
|
83
|
selectPostioin(position);
|
|
|
84
|
});
|
|
|
85
|
}
|
|
38
|
86
|
}
|
|
39
|
87
|
|
|
40
|
88
|
@Override
|
|
41
|
89
|
public int getItemCount() {
|
|
42
|
|
return 30;
|
|
|
90
|
return mDatas.size();
|
|
43
|
91
|
}
|
|
44
|
92
|
|
|
45
|
|
private void selectPostioin(int postioin){
|
|
46
|
|
for (int i = 0; i < mDatas.size(); i++) {
|
|
47
|
|
//将下标对应的bean类修改为true,其他的bean修改为false即可。
|
|
|
93
|
private void selectPostioin(int postioin) {
|
|
|
94
|
for (RedEnvelopeBean bean:mDatas) {
|
|
|
95
|
bean.setCheck(false);
|
|
48
|
96
|
}
|
|
|
97
|
currentPostion=postioin;
|
|
|
98
|
mDatas.get(postioin).setCheck(true);
|
|
|
99
|
notifyDataSetChanged();
|
|
|
100
|
|
|
49
|
101
|
}
|
|
50
|
102
|
|
|
51
|
103
|
public static class ViewHodler extends RecyclerView.ViewHolder {
|
|
|
@ -37,6 +37,7 @@ import com.nostra13.universalimageloader.core.assist.ImageScaleType;
|
|
37
|
37
|
import com.tencent.bugly.crashreport.CrashReport;
|
|
38
|
38
|
import com.zhy.http.okhttp.OkHttpUtils;
|
|
39
|
39
|
import com.zhy.http.okhttp.callback.StringCallback;
|
|
|
40
|
import com.zhy.http.okhttp.log.LoggerInterceptor;
|
|
40
|
41
|
|
|
41
|
42
|
import java.io.BufferedReader;
|
|
42
|
43
|
import java.io.BufferedWriter;
|
|
|
@ -54,6 +55,7 @@ import java.util.Map;
|
|
54
|
55
|
|
|
55
|
56
|
import cn.jpush.android.api.JPushInterface;
|
|
56
|
57
|
import okhttp3.Call;
|
|
|
58
|
import okhttp3.OkHttpClient;
|
|
57
|
59
|
|
|
58
|
60
|
|
|
59
|
61
|
public class MainApplication extends MultiDexApplication {
|
|
|
@ -88,13 +90,13 @@ public class MainApplication extends MultiDexApplication {
|
|
88
|
90
|
public static String firstPoint = "";
|
|
89
|
91
|
public static Boolean firstSsyd;
|
|
90
|
92
|
public static String password = "";
|
|
91
|
|
public static String url = "http://59.110.68.162";// 充电桩测试环境
|
|
92
|
|
public static String pic_url = "http://59.110.68.162/zhannew/uploadfile/";
|
|
93
|
|
// public static String url = "http://cdz.evcharge.cc";// 充电桩正式环境
|
|
94
|
|
// public static String pic_url = "http://cdz.evcharge.cc/zhannew/uploadfile/";
|
|
|
93
|
// public static String url = "http://59.110.68.162";// 充电桩测试环境
|
|
|
94
|
// public static String pic_url = "http://59.110.68.162/zhannew/uploadfile/";
|
|
|
95
|
public static String url = "http://cdz.evcharge.cc";// 充电桩正式环境
|
|
|
96
|
public static String pic_url = "http://cdz.evcharge.cc/zhannew/uploadfile/";
|
|
95
|
97
|
|
|
96
|
|
public static String urlNew = "http://123.56.67.7:83/api/0300";// 一电测试环境
|
|
97
|
|
// public static String urlNew = "https://api.touchev.com:83/api/0300";// 一电正式环境
|
|
|
98
|
// public static String urlNew = "http://123.56.67.7:83/api/0300";// 一电测试环境
|
|
|
99
|
public static String urlNew = "https://api.touchev.com:83/api/0300";// 一电正式环境
|
|
98
|
100
|
|
|
99
|
101
|
|
|
100
|
102
|
// public static String url = "https://cdz.d1ev.com";
|
|
|
@ -1,9 +1,12 @@
|
|
1
|
1
|
package com.electric.chargingpile.constant;
|
|
2
|
2
|
|
|
3
|
3
|
public interface UrlConstants {
|
|
4
|
|
String HOST_URL = "http://cdz.evcharge.cc/zhannew/basic/web/index.php/";
|
|
5
|
|
String USER_CHARGING_CHECK_URL = HOST_URL + "api/charge/check-user";
|
|
6
|
|
String START_CHARGING_URL = HOST_URL + "api/charge/start";
|
|
7
|
|
String CHARGING_STATUS_URL = HOST_URL + "api/charge/query";
|
|
8
|
|
String STOP_CHARGING_URL = HOST_URL + "api/charge/close";
|
|
|
4
|
String HOST_URL = com.google.zxing.client.android.constant.UrlConstants.HOST_URL;
|
|
|
5
|
String USER_CHARGING_CHECK_URL = com.google.zxing.client.android.constant.UrlConstants.USER_CHARGING_CHECK_URL;
|
|
|
6
|
String START_CHARGING_URL = com.google.zxing.client.android.constant.UrlConstants.START_CHARGING_URL;
|
|
|
7
|
String CHARGING_STATUS_URL = com.google.zxing.client.android.constant.UrlConstants.CHARGING_STATUS_URL;
|
|
|
8
|
|
|
|
9
|
String STOP_CHARGING_URL =com.google.zxing.client.android.constant.UrlConstants.STOP_CHARGING_URL;
|
|
|
10
|
String SETTLEMENT = com.google.zxing.client.android.constant.UrlConstants.SETTLEMENT;
|
|
|
11
|
String QUERY_NOT_CLOSE =com.google.zxing.client.android.constant.UrlConstants.QUERY_NOT_CLOSE;
|
|
9
|
12
|
}
|
|
|
@ -0,0 +1,108 @@
|
|
|
1
|
package com.electric.chargingpile.data;
|
|
|
2
|
|
|
|
3
|
public class RedEnvelopeBean{
|
|
|
4
|
/**
|
|
|
5
|
* {
|
|
|
6
|
* "money":"5",
|
|
|
7
|
* "max_money":"20",
|
|
|
8
|
* "id":"41967",
|
|
|
9
|
* "end_time":"1606607999",
|
|
|
10
|
* "type":"3",
|
|
|
11
|
* "supplier":"",
|
|
|
12
|
* "title":"\u4f18\u8d28\u8bc4\u8bba"
|
|
|
13
|
* }
|
|
|
14
|
*
|
|
|
15
|
* 0邀请好友分享红包 1兑换 2注册赠送红包 3优质评论 4纠错奖励 5车主认证 6车主成交价 7服务费折扣 8订单折扣
|
|
|
16
|
* 7,8的时候 money是百分值
|
|
|
17
|
*
|
|
|
18
|
* */
|
|
|
19
|
private String money;
|
|
|
20
|
private String max_money;
|
|
|
21
|
private String id;
|
|
|
22
|
private String end_time;
|
|
|
23
|
private String type;
|
|
|
24
|
private String supplier;
|
|
|
25
|
private String title;
|
|
|
26
|
private boolean isCheck;
|
|
|
27
|
|
|
|
28
|
public boolean isCheck() {
|
|
|
29
|
return isCheck;
|
|
|
30
|
}
|
|
|
31
|
|
|
|
32
|
public void setCheck(boolean check) {
|
|
|
33
|
isCheck = check;
|
|
|
34
|
}
|
|
|
35
|
|
|
|
36
|
public RedEnvelopeBean() {
|
|
|
37
|
}
|
|
|
38
|
|
|
|
39
|
public String getMoney() {
|
|
|
40
|
return money;
|
|
|
41
|
}
|
|
|
42
|
|
|
|
43
|
public void setMoney(String money) {
|
|
|
44
|
this.money = money;
|
|
|
45
|
}
|
|
|
46
|
|
|
|
47
|
public String getMax_money() {
|
|
|
48
|
return max_money;
|
|
|
49
|
}
|
|
|
50
|
|
|
|
51
|
public void setMax_money(String max_money) {
|
|
|
52
|
this.max_money = max_money;
|
|
|
53
|
}
|
|
|
54
|
|
|
|
55
|
public String getId() {
|
|
|
56
|
return id;
|
|
|
57
|
}
|
|
|
58
|
|
|
|
59
|
public void setId(String id) {
|
|
|
60
|
this.id = id;
|
|
|
61
|
}
|
|
|
62
|
|
|
|
63
|
public String getEnd_time() {
|
|
|
64
|
return end_time;
|
|
|
65
|
}
|
|
|
66
|
|
|
|
67
|
public void setEnd_time(String end_time) {
|
|
|
68
|
this.end_time = end_time;
|
|
|
69
|
}
|
|
|
70
|
|
|
|
71
|
public String getType() {
|
|
|
72
|
return type;
|
|
|
73
|
}
|
|
|
74
|
|
|
|
75
|
public void setType(String type) {
|
|
|
76
|
this.type = type;
|
|
|
77
|
}
|
|
|
78
|
|
|
|
79
|
public String getSupplier() {
|
|
|
80
|
return supplier;
|
|
|
81
|
}
|
|
|
82
|
|
|
|
83
|
public void setSupplier(String supplier) {
|
|
|
84
|
this.supplier = supplier;
|
|
|
85
|
}
|
|
|
86
|
|
|
|
87
|
public String getTitle() {
|
|
|
88
|
return title;
|
|
|
89
|
}
|
|
|
90
|
|
|
|
91
|
public void setTitle(String title) {
|
|
|
92
|
this.title = title;
|
|
|
93
|
}
|
|
|
94
|
|
|
|
95
|
@Override
|
|
|
96
|
public String toString() {
|
|
|
97
|
return "RedEnvelopeBean{" +
|
|
|
98
|
"money='" + money + '\'' +
|
|
|
99
|
", max_money='" + max_money + '\'' +
|
|
|
100
|
", id='" + id + '\'' +
|
|
|
101
|
", end_time='" + end_time + '\'' +
|
|
|
102
|
", type='" + type + '\'' +
|
|
|
103
|
", supplier='" + supplier + '\'' +
|
|
|
104
|
", title='" + title + '\'' +
|
|
|
105
|
", isCheck=" + isCheck +
|
|
|
106
|
'}';
|
|
|
107
|
}
|
|
|
108
|
}
|
|
|
@ -20,6 +20,7 @@ import com.blankj.utilcode.util.StringUtils;
|
|
20
|
20
|
import com.electric.chargingpile.R;
|
|
21
|
21
|
import com.electric.chargingpile.activity.MainMapActivity;
|
|
22
|
22
|
import com.electric.chargingpile.application.MainApplication;
|
|
|
23
|
import com.electric.chargingpile.data.RedEnvelopeBean;
|
|
23
|
24
|
import com.electric.chargingpile.data.Zhan;
|
|
24
|
25
|
import com.electric.chargingpile.data.Zhuang;
|
|
25
|
26
|
import com.electric.chargingpile.manager.ProfileManager;
|
|
|
@ -598,4 +599,54 @@ public class Util {
|
|
598
|
599
|
return false;
|
|
599
|
600
|
}
|
|
600
|
601
|
}
|
|
|
602
|
|
|
|
603
|
public static String getRedEnvelopeName(RedEnvelopeBean bean) {
|
|
|
604
|
String str="";
|
|
|
605
|
if (bean.getType() == null){
|
|
|
606
|
bean.setType("");
|
|
|
607
|
}
|
|
|
608
|
if (bean.getType().equals("7")){
|
|
|
609
|
String format = getDisCount(bean);
|
|
|
610
|
str="服务费"+format+"折";
|
|
|
611
|
}else if (bean.getType().equals("8")){
|
|
|
612
|
String format = getDisCount(bean);
|
|
|
613
|
str="订单费"+format+"折";
|
|
|
614
|
}else if (bean.getType().equals("-1")){
|
|
|
615
|
str="不使用";
|
|
|
616
|
}else if(bean.getType().equals("")){
|
|
|
617
|
str="--";
|
|
|
618
|
} else{
|
|
|
619
|
str="满"+bean.getMax_money()+"减"+bean.getMoney();
|
|
|
620
|
}
|
|
|
621
|
|
|
|
622
|
/*
|
|
|
623
|
switch (bean.getType()) {
|
|
|
624
|
case "-1":
|
|
|
625
|
break;
|
|
|
626
|
case "0":
|
|
|
627
|
case "1":
|
|
|
628
|
case "2":
|
|
|
629
|
case "3":
|
|
|
630
|
case "4":
|
|
|
631
|
case "5":
|
|
|
632
|
case "6":
|
|
|
633
|
break;
|
|
|
634
|
|
|
|
635
|
case "7": //服务费折扣
|
|
|
636
|
break;
|
|
|
637
|
case "8": //订单折扣
|
|
|
638
|
break;
|
|
|
639
|
default:
|
|
|
640
|
str="--";
|
|
|
641
|
break;
|
|
|
642
|
}
|
|
|
643
|
*/
|
|
|
644
|
return str;
|
|
|
645
|
}
|
|
|
646
|
|
|
|
647
|
private static String getDisCount(RedEnvelopeBean bean) {
|
|
|
648
|
double money = Double.parseDouble(bean.getMoney());
|
|
|
649
|
double discount = money / 10;
|
|
|
650
|
return String.format("%.1f", discount);
|
|
|
651
|
}
|
|
601
|
652
|
}
|
|
|
@ -1,9 +1,11 @@
|
|
1
|
1
|
package com.electric.chargingpile.view;
|
|
2
|
2
|
|
|
3
|
3
|
import android.os.Bundle;
|
|
|
4
|
import android.util.Log;
|
|
4
|
5
|
import android.view.LayoutInflater;
|
|
5
|
6
|
import android.view.View;
|
|
6
|
7
|
import android.view.ViewGroup;
|
|
|
8
|
import android.widget.ProgressBar;
|
|
7
|
9
|
import android.widget.TextView;
|
|
8
|
10
|
|
|
9
|
11
|
import androidx.annotation.NonNull;
|
|
|
@ -11,22 +13,45 @@ import androidx.annotation.Nullable;
|
|
11
|
13
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
|
12
|
14
|
import androidx.recyclerview.widget.RecyclerView;
|
|
13
|
15
|
|
|
|
16
|
import com.blankj.utilcode.util.LogUtils;
|
|
14
|
17
|
import com.electric.chargingpile.R;
|
|
15
|
18
|
import com.electric.chargingpile.adapter.PreferentialAdapter;
|
|
|
19
|
import com.electric.chargingpile.application.MainApplication;
|
|
|
20
|
import com.electric.chargingpile.data.RechargeData;
|
|
|
21
|
import com.electric.chargingpile.data.RedEnvelopeBean;
|
|
16
|
22
|
import com.google.android.material.bottomsheet.BottomSheetDialogFragment;
|
|
|
23
|
import com.google.gson.Gson;
|
|
|
24
|
import com.google.gson.reflect.TypeToken;
|
|
|
25
|
import com.google.zxing.client.android.constant.ChargingConstants;
|
|
|
26
|
import com.google.zxing.client.android.constant.UrlConstants;
|
|
|
27
|
import com.zhy.http.okhttp.OkHttpUtils;
|
|
|
28
|
import com.zhy.http.okhttp.builder.GetBuilder;
|
|
|
29
|
import com.zhy.http.okhttp.callback.StringCallback;
|
|
17
|
30
|
|
|
18
|
31
|
import org.jetbrains.annotations.NotNull;
|
|
|
32
|
|
|
|
33
|
import java.util.ArrayList;
|
|
|
34
|
import java.util.List;
|
|
|
35
|
|
|
|
36
|
import okhttp3.Call;
|
|
|
37
|
|
|
19
|
38
|
/**
|
|
20
|
39
|
* 选择优惠类型
|
|
21
|
|
* */
|
|
|
40
|
*/
|
|
22
|
41
|
public class PreferentialDialog extends BottomSheetDialogFragment {
|
|
23
|
42
|
|
|
24
|
43
|
private RecyclerView recyclerView;
|
|
25
|
44
|
private CompleteListener mListener;
|
|
|
45
|
private PreferentialAdapter mAdapter;
|
|
|
46
|
private TextView noPreferential;
|
|
|
47
|
private String userMoney; //用户费用
|
|
|
48
|
private ProgressBar mProgressBar;
|
|
26
|
49
|
|
|
27
|
|
public static PreferentialDialog newInstance(){
|
|
|
50
|
public static PreferentialDialog newInstance(String userMoney) {
|
|
28
|
51
|
PreferentialDialog dialog = new PreferentialDialog();
|
|
29
|
|
Bundle arguments = dialog.getArguments();
|
|
|
52
|
Bundle arguments = new Bundle();
|
|
|
53
|
arguments.putString("userMoney", userMoney);
|
|
|
54
|
dialog.setArguments(arguments);
|
|
30
|
55
|
return dialog;
|
|
31
|
56
|
}
|
|
32
|
57
|
|
|
|
@ -42,29 +67,130 @@ public class PreferentialDialog extends BottomSheetDialogFragment {
|
|
42
|
67
|
@org.jetbrains.annotations.Nullable
|
|
43
|
68
|
@Override
|
|
44
|
69
|
public View onCreateView(@NonNull @NotNull LayoutInflater inflater, @Nullable @org.jetbrains.annotations.Nullable ViewGroup container, @Nullable @org.jetbrains.annotations.Nullable Bundle savedInstanceState) {
|
|
45
|
|
View rootView=inflater.inflate(R.layout.dialog_preferential,container,false);
|
|
46
|
|
return rootView;
|
|
|
70
|
return inflater.inflate(R.layout.dialog_preferential, container, false);
|
|
47
|
71
|
}
|
|
48
|
72
|
|
|
49
|
73
|
@Override
|
|
50
|
74
|
public void onViewCreated(@NonNull @NotNull View view, @Nullable @org.jetbrains.annotations.Nullable Bundle savedInstanceState) {
|
|
51
|
75
|
super.onViewCreated(view, savedInstanceState);
|
|
52
|
|
TextView complete=view.findViewById(R.id.complete);
|
|
|
76
|
initIntent();
|
|
|
77
|
initView(view);
|
|
|
78
|
initData();
|
|
|
79
|
|
|
|
80
|
}
|
|
|
81
|
|
|
|
82
|
private void initIntent() {
|
|
|
83
|
Bundle arguments = getArguments();
|
|
|
84
|
if (arguments != null) {
|
|
|
85
|
userMoney = arguments.getString("userMoney");
|
|
|
86
|
}
|
|
|
87
|
|
|
|
88
|
|
|
|
89
|
}
|
|
|
90
|
|
|
|
91
|
private void initData() {
|
|
|
92
|
recyclerView.setVisibility(View.GONE);
|
|
|
93
|
mProgressBar.setVisibility(View.VISIBLE);
|
|
|
94
|
OkHttpUtils.get()
|
|
|
95
|
.url(UrlConstants.RED_ENVELOPE_LIST)
|
|
|
96
|
.addParams(ChargingConstants.USERID, MainApplication.userId)
|
|
|
97
|
.addParams(ChargingConstants.PWD, MainApplication.userPassword)
|
|
|
98
|
.build()
|
|
|
99
|
.execute(new StringCallback() {
|
|
|
100
|
@Override
|
|
|
101
|
public void onError(Call call, Exception e) {
|
|
|
102
|
|
|
|
103
|
recyclerView.setVisibility(View.GONE);
|
|
|
104
|
mProgressBar.setVisibility(View.GONE);
|
|
|
105
|
noPreferential.setVisibility(View.GONE);
|
|
|
106
|
}
|
|
|
107
|
|
|
|
108
|
@Override
|
|
|
109
|
public void onResponse(String response) {
|
|
|
110
|
Log.d("HYC", "onResponse: " + response);
|
|
|
111
|
|
|
|
112
|
mProgressBar.setVisibility(View.GONE);
|
|
|
113
|
Gson gson = new Gson();
|
|
|
114
|
List<RedEnvelopeBean> datas = gson.fromJson(response, new TypeToken<List<RedEnvelopeBean>>() {
|
|
|
115
|
}.getType());
|
|
|
116
|
if (datas != null) {
|
|
|
117
|
removeData(datas);
|
|
|
118
|
if (datas.size() > 0) {
|
|
|
119
|
recyclerView.setVisibility(View.VISIBLE);
|
|
|
120
|
noPreferential.setVisibility(View.GONE);
|
|
|
121
|
mAdapter.setDatas(datas);
|
|
|
122
|
} else {
|
|
|
123
|
recyclerView.setVisibility(View.GONE);
|
|
|
124
|
noPreferential.setVisibility(View.VISIBLE);
|
|
|
125
|
}
|
|
|
126
|
} else {
|
|
|
127
|
recyclerView.setVisibility(View.GONE);
|
|
|
128
|
noPreferential.setVisibility(View.VISIBLE);
|
|
|
129
|
}
|
|
|
130
|
|
|
|
131
|
// recyclerView.setVisibility(View.VISIBLE);
|
|
|
132
|
// noPreferential.setVisibility(View.GONE);
|
|
|
133
|
// }else{
|
|
|
134
|
// recyclerView.setVisibility(View.GONE);
|
|
|
135
|
// noPreferential.setVisibility(View.VISIBLE);
|
|
|
136
|
// }
|
|
|
137
|
|
|
|
138
|
}
|
|
|
139
|
});
|
|
|
140
|
}
|
|
|
141
|
|
|
|
142
|
private void removeData(List<RedEnvelopeBean> datas) {
|
|
|
143
|
try {
|
|
|
144
|
for (int i = datas.size() - 1; i >= 0; i--) {
|
|
|
145
|
RedEnvelopeBean redEnvelopeBean = datas.get(i);
|
|
|
146
|
double max_money = Double.parseDouble(redEnvelopeBean.getMax_money());
|
|
|
147
|
double money = Double.parseDouble(userMoney);
|
|
|
148
|
if (money < max_money) {
|
|
|
149
|
datas.remove(i);
|
|
|
150
|
}
|
|
|
151
|
}
|
|
|
152
|
} catch (NumberFormatException e) {
|
|
|
153
|
LogUtils.e("polling=" + e.getMessage());
|
|
|
154
|
}
|
|
|
155
|
|
|
|
156
|
}
|
|
|
157
|
|
|
|
158
|
private void initView(@NotNull View view) {
|
|
|
159
|
TextView complete = view.findViewById(R.id.complete);
|
|
|
160
|
noPreferential = view.findViewById(R.id.noPreferential);
|
|
53
|
161
|
recyclerView = view.findViewById(R.id.recyclerView);
|
|
|
162
|
mProgressBar = view.findViewById(R.id.progressBar);
|
|
54
|
163
|
recyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
|
|
55
|
|
PreferentialAdapter adapter=new PreferentialAdapter();
|
|
56
|
|
recyclerView.setAdapter(adapter);
|
|
57
|
|
complete.setOnClickListener(v->{
|
|
58
|
|
//获取adapter被选中的数据,并且返回回调给
|
|
59
|
|
mListener.onComplete();
|
|
|
164
|
mAdapter = new PreferentialAdapter(getActivity());
|
|
|
165
|
recyclerView.setAdapter(mAdapter);
|
|
|
166
|
complete.setOnClickListener(v -> {
|
|
|
167
|
complete();
|
|
60
|
168
|
});
|
|
61
|
169
|
}
|
|
62
|
170
|
|
|
63
|
|
public void setListener(CompleteListener listener){
|
|
64
|
|
mListener=listener;
|
|
|
171
|
private void complete() {
|
|
|
172
|
RedEnvelopeBean bean = null;
|
|
|
173
|
//获取adapter被选中的数据,并且返回回调给
|
|
|
174
|
if (mAdapter.getmDatas() != null) {
|
|
|
175
|
for (RedEnvelopeBean redEnvelopeBean : mAdapter.getmDatas()) {
|
|
|
176
|
if (redEnvelopeBean.isCheck()) {
|
|
|
177
|
bean = redEnvelopeBean;
|
|
|
178
|
}
|
|
|
179
|
}
|
|
|
180
|
}
|
|
|
181
|
|
|
|
182
|
if (mListener != null) {
|
|
|
183
|
mListener.onComplete(bean);
|
|
|
184
|
}
|
|
|
185
|
Log.e("hyc", "complete 红包类: " + bean);
|
|
|
186
|
dismissAllowingStateLoss();
|
|
|
187
|
}
|
|
|
188
|
|
|
|
189
|
public void setListener(CompleteListener listener) {
|
|
|
190
|
mListener = listener;
|
|
65
|
191
|
}
|
|
66
|
192
|
|
|
67
|
|
public interface CompleteListener{
|
|
68
|
|
void onComplete();
|
|
|
193
|
public interface CompleteListener {
|
|
|
194
|
void onComplete(RedEnvelopeBean bean);
|
|
69
|
195
|
}
|
|
70
|
196
|
}
|
|
|
@ -146,7 +146,7 @@
|
|
146
|
146
|
android:layout_height="wrap_content"
|
|
147
|
147
|
android:layout_alignParentLeft="true"
|
|
148
|
148
|
android:layout_marginLeft="15dp"
|
|
149
|
|
android:text="红包减免"
|
|
|
149
|
android:text="红包/优惠券减免"
|
|
150
|
150
|
android:textColor="@color/juhuang"
|
|
151
|
151
|
android:textSize="14sp" />
|
|
152
|
152
|
|
|
|
@ -1,6 +1,7 @@
|
|
1
|
1
|
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
2
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
|
3
|
3
|
android:layout_width="match_parent"
|
|
|
4
|
xmlns:tools="http://schemas.android.com/tools"
|
|
4
|
5
|
android:background="@color/white"
|
|
5
|
6
|
android:layout_height="match_parent">
|
|
6
|
7
|
<RelativeLayout
|
|
|
@ -17,7 +18,7 @@
|
|
17
|
18
|
android:layout_width="wrap_content"
|
|
18
|
19
|
android:layout_height="wrap_content"
|
|
19
|
20
|
android:layout_centerInParent="true"
|
|
20
|
|
android:text="订单详情"
|
|
|
21
|
android:text="确认订单"
|
|
21
|
22
|
android:textColor="@color/ui_62"
|
|
22
|
23
|
android:textSize="18sp" />
|
|
23
|
24
|
|
|
|
@ -144,13 +145,16 @@
|
|
144
|
145
|
android:layout_marginLeft="15dp"
|
|
145
|
146
|
android:text="红包/优惠券"
|
|
146
|
147
|
android:textSize="14sp" />
|
|
|
148
|
<!--
|
|
147
|
149
|
<ImageView
|
|
|
150
|
android:id="@+id/default_hb"
|
|
148
|
151
|
android:layout_marginTop="8dp"
|
|
149
|
152
|
android:layout_alignStart="@+id/redEnvelope"
|
|
150
|
153
|
android:src="@drawable/ic_default_orders"
|
|
151
|
154
|
android:layout_below="@+id/redEnvelope"
|
|
152
|
155
|
android:layout_width="wrap_content"
|
|
153
|
156
|
android:layout_height="wrap_content"/>
|
|
|
157
|
-->
|
|
154
|
158
|
|
|
155
|
159
|
<TextView
|
|
156
|
160
|
android:layout_centerVertical="true"
|
|
|
@ -159,7 +163,7 @@
|
|
159
|
163
|
android:layout_height="wrap_content"
|
|
160
|
164
|
android:layout_alignParentRight="true"
|
|
161
|
165
|
android:layout_marginRight="15dp"
|
|
162
|
|
android:text="--"
|
|
|
166
|
android:text="--123"
|
|
163
|
167
|
android:textColor="@color/juhuang"
|
|
164
|
168
|
android:textSize="14sp" />
|
|
165
|
169
|
|
|
|
@ -251,6 +255,8 @@
|
|
251
|
255
|
</RelativeLayout>
|
|
252
|
256
|
|
|
253
|
257
|
<RelativeLayout
|
|
|
258
|
tools:visibility="visible"
|
|
|
259
|
android:visibility="gone"
|
|
254
|
260
|
android:id="@+id/rl_end_info"
|
|
255
|
261
|
android:layout_width="match_parent"
|
|
256
|
262
|
android:layout_height="wrap_content"
|
|
|
@ -32,6 +32,7 @@
|
|
32
|
32
|
android:layout_height="250dp"
|
|
33
|
33
|
android:layout_centerHorizontal="true"
|
|
34
|
34
|
android:background="@drawable/bg_center">
|
|
|
35
|
<!--
|
|
35
|
36
|
<TextView
|
|
36
|
37
|
android:id="@+id/tv_mine"
|
|
37
|
38
|
android:layout_marginTop="24dp"
|
|
|
@ -43,10 +44,10 @@
|
|
43
|
44
|
android:textColor="@color/color_white"
|
|
44
|
45
|
android:textSize="20sp"
|
|
45
|
46
|
/>
|
|
|
47
|
-->
|
|
46
|
48
|
|
|
47
|
49
|
<RelativeLayout
|
|
48
|
|
android:layout_marginTop="22dp"
|
|
49
|
|
android:layout_below="@+id/tv_mine"
|
|
|
50
|
android:layout_marginTop="64dp"
|
|
50
|
51
|
android:id="@+id/ll_btn"
|
|
51
|
52
|
android:layout_width="wrap_content"
|
|
52
|
53
|
android:layout_height="wrap_content"
|
|
|
@ -160,9 +161,8 @@
|
|
160
|
161
|
|
|
161
|
162
|
|
|
162
|
163
|
<com.zhy.autolayout.AutoRelativeLayout
|
|
163
|
|
android:layout_marginTop="22dp"
|
|
|
164
|
android:layout_marginTop="64dp"
|
|
164
|
165
|
android:id="@+id/ll_noLogin"
|
|
165
|
|
android:layout_below="@+id/tv_mine"
|
|
166
|
166
|
android:layout_width="wrap_content"
|
|
167
|
167
|
android:layout_height="wrap_content"
|
|
168
|
168
|
android:orientation="horizontal"
|
|
|
@ -129,13 +129,10 @@
|
|
129
|
129
|
<EditText
|
|
130
|
130
|
android:id="@+id/et_nickName"
|
|
131
|
131
|
android:layout_width="wrap_content"
|
|
132
|
|
android:layout_height="130px"
|
|
|
132
|
android:layout_height="130dp"
|
|
133
|
133
|
android:layout_alignParentTop="true"
|
|
134
|
134
|
android:layout_alignParentEnd="true"
|
|
135
|
|
|
|
136
|
|
android:layout_alignParentRight="true"
|
|
137
|
|
android:layout_marginEnd="15dp"
|
|
138
|
|
android:layout_marginRight="15dp"
|
|
|
135
|
android:layout_marginEnd="30dp"
|
|
139
|
136
|
android:background="@color/white"
|
|
140
|
137
|
android:gravity="center|right"
|
|
141
|
138
|
android:hint="请输入昵称"
|
|
|
@ -163,14 +160,14 @@
|
|
163
|
160
|
android:textSize="15sp" />
|
|
164
|
161
|
|
|
165
|
162
|
<TextView
|
|
|
163
|
|
|
|
164
|
tools:text="dsadas"
|
|
166
|
165
|
android:id="@+id/phone"
|
|
167
|
166
|
android:layout_width="wrap_content"
|
|
168
|
|
android:layout_height="130px"
|
|
|
167
|
android:layout_height="130dp"
|
|
169
|
168
|
android:layout_alignParentTop="true"
|
|
170
|
169
|
android:layout_alignParentEnd="true"
|
|
171
|
|
android:layout_alignParentRight="true"
|
|
172
|
|
android:layout_marginEnd="15dp"
|
|
173
|
|
android:layout_marginRight="15dp"
|
|
|
170
|
android:layout_marginEnd="30dp"
|
|
174
|
171
|
android:background="@color/white"
|
|
175
|
172
|
android:gravity="center|right"
|
|
176
|
173
|
android:textColor="@color/ui_62"
|
|
|
@ -15,19 +15,28 @@
|
|
15
|
15
|
android:textColor="#ff0e0e0e"
|
|
16
|
16
|
android:textSize="18sp"
|
|
17
|
17
|
/>
|
|
18
|
|
<androidx.recyclerview.widget.RecyclerView
|
|
19
|
|
android:id="@+id/recyclerView"
|
|
|
18
|
<RelativeLayout
|
|
20
|
19
|
android:layout_width="match_parent"
|
|
21
|
|
android:layout_height="320dp"/>
|
|
22
|
|
<TextView
|
|
23
|
|
android:visibility="gone"
|
|
24
|
|
android:gravity="center"
|
|
25
|
|
android:text="暂无优惠券~"
|
|
26
|
|
android:textColor="#ff9b9b9b"
|
|
27
|
|
android:textSize="18sp"
|
|
28
|
|
android:id="@+id/noPreferential"
|
|
29
|
|
android:layout_width="match_parent"
|
|
30
|
|
android:layout_height="320dp"/>
|
|
|
20
|
android:layout_height="320dp">
|
|
|
21
|
<androidx.recyclerview.widget.RecyclerView
|
|
|
22
|
android:id="@+id/recyclerView"
|
|
|
23
|
android:layout_width="match_parent"
|
|
|
24
|
android:layout_height="320dp"/>
|
|
|
25
|
<ProgressBar
|
|
|
26
|
android:id="@+id/progressBar"
|
|
|
27
|
android:layout_centerInParent="true"
|
|
|
28
|
android:layout_width="wrap_content"
|
|
|
29
|
android:layout_height="wrap_content" />
|
|
|
30
|
<TextView
|
|
|
31
|
android:visibility="gone"
|
|
|
32
|
android:gravity="center"
|
|
|
33
|
android:text="暂无优惠券~"
|
|
|
34
|
android:textColor="#ff9b9b9b"
|
|
|
35
|
android:textSize="18sp"
|
|
|
36
|
android:id="@+id/noPreferential"
|
|
|
37
|
android:layout_width="match_parent"
|
|
|
38
|
android:layout_height="320dp"/>
|
|
|
39
|
</RelativeLayout>
|
|
31
|
40
|
<TextView
|
|
32
|
41
|
android:id="@+id/complete"
|
|
33
|
42
|
android:layout_width="match_parent"
|
|
|
@ -1,6 +1,7 @@
|
|
1
|
1
|
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
2
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
|
3
|
3
|
android:layout_width="match_parent"
|
|
|
4
|
xmlns:tools="http://schemas.android.com/tools"
|
|
4
|
5
|
android:padding="10dp"
|
|
5
|
6
|
android:layout_height="wrap_content">
|
|
6
|
7
|
|
|
|
@ -10,7 +11,7 @@
|
|
10
|
11
|
android:layout_weight="1"
|
|
11
|
12
|
android:layout_width="0dp"
|
|
12
|
13
|
android:layout_height="wrap_content"
|
|
13
|
|
android:text="不使用"
|
|
|
14
|
tools:text="不使用"
|
|
14
|
15
|
android:textColor="@color/color_ff333333"
|
|
15
|
16
|
android:textSize="14sp" />
|
|
16
|
17
|
<CheckBox
|
|
|
@ -212,6 +212,8 @@
|
|
212
|
212
|
</LinearLayout>
|
|
213
|
213
|
</LinearLayout>
|
|
214
|
214
|
<TextView
|
|
|
215
|
android:ellipsize="end"
|
|
|
216
|
android:lines="1"
|
|
215
|
217
|
android:visibility="gone"
|
|
216
|
218
|
android:id="@+id/parkingFee"
|
|
217
|
219
|
android:layout_marginEnd="15dp"
|
|
|
@ -65,6 +65,7 @@ import com.google.zxing.client.android.camera.CameraManager;
|
|
65
|
65
|
import com.google.zxing.client.android.clipboard.ClipboardInterface;
|
|
66
|
66
|
import com.google.zxing.client.android.constant.ChargingConstants;
|
|
67
|
67
|
import com.google.zxing.client.android.constant.UrlConstants;
|
|
|
68
|
import com.google.zxing.client.android.data.DelayedSettlementBean;
|
|
68
|
69
|
import com.google.zxing.client.android.data.OperatorPicsBean;
|
|
69
|
70
|
import com.google.zxing.client.android.dialog.SettleAccountsDialog;
|
|
70
|
71
|
import com.google.zxing.client.android.history.HistoryItem;
|
|
|
@ -571,13 +572,13 @@ public final class CaptureActivity extends Activity implements SurfaceHolder.Cal
|
|
571
|
572
|
@Override
|
|
572
|
573
|
public void onActivityResult(int requestCode, int resultCode, Intent intent) {
|
|
573
|
574
|
if (resultCode == RESULT_OK && requestCode == HISTORY_REQUEST_CODE && historyManager != null) {
|
|
574
|
|
if (isSettleAccounts == 0){
|
|
|
575
|
// if (isSettleAccounts == 0){
|
|
575
|
576
|
int itemNumber = intent.getIntExtra(Intents.History.ITEM_NUMBER, -1);
|
|
576
|
577
|
if (itemNumber >= 0) {
|
|
577
|
578
|
HistoryItem historyItem = historyManager.buildHistoryItem(itemNumber);
|
|
578
|
579
|
decodeOrStoreSavedBitmap(null, historyItem.getResult());
|
|
579
|
580
|
}
|
|
580
|
|
}
|
|
|
581
|
// }
|
|
581
|
582
|
}
|
|
582
|
583
|
}
|
|
583
|
584
|
|
|
|
@ -1113,7 +1114,7 @@ public final class CaptureActivity extends Activity implements SurfaceHolder.Cal
|
|
1113
|
1114
|
}
|
|
1114
|
1115
|
|
|
1115
|
1116
|
private void handlingOperations(String response, int interfaceType) {
|
|
1116
|
|
LogUtils.e(interfaceType + "---" + response);
|
|
|
1117
|
LogUtils.e(interfaceType + "hyc---" + response);
|
|
1117
|
1118
|
String rtnCode = JsonUtils.getKeyResult(response, "rtnCode");
|
|
1118
|
1119
|
String rtnMsg = JsonUtils.getKeyResult(response, "rtnMsg");
|
|
1119
|
1120
|
switch (rtnCode) {
|
|
|
@ -1168,6 +1169,12 @@ public final class CaptureActivity extends Activity implements SurfaceHolder.Cal
|
|
1168
|
1169
|
}
|
|
1169
|
1170
|
try305Count++;
|
|
1170
|
1171
|
if (!CaptureActivity.this.isFinishing() && CaptureActivity.this != null) {
|
|
|
1172
|
String data = JsonUtils.getKeyResult(response, "data");
|
|
|
1173
|
Gson gson=new Gson();
|
|
|
1174
|
List<DelayedSettlementBean> datas = gson.fromJson(data, new TypeToken<List<DelayedSettlementBean>>() {
|
|
|
1175
|
}.getType());
|
|
|
1176
|
showSettleAccountsDialog(datas);
|
|
|
1177
|
/*
|
|
1171
|
1178
|
alertDialog.builder()
|
|
1172
|
1179
|
.setMsg(rtnMsg)
|
|
1173
|
1180
|
.setPositiveButton("联系客服", new View.OnClickListener() {
|
|
|
@ -1175,7 +1182,8 @@ public final class CaptureActivity extends Activity implements SurfaceHolder.Cal
|
|
1175
|
1182
|
public void onClick(View v) {
|
|
1176
|
1183
|
try305Count = 1;
|
|
1177
|
1184
|
//tellTask();
|
|
1178
|
|
wechatAlert();
|
|
|
1185
|
// wechatAlert();
|
|
|
1186
|
showSettleAccountsDialog();
|
|
1179
|
1187
|
}
|
|
1180
|
1188
|
}).setNegativeButton("取消", new View.OnClickListener() {
|
|
1181
|
1189
|
@Override
|
|
|
@ -1183,6 +1191,7 @@ public final class CaptureActivity extends Activity implements SurfaceHolder.Cal
|
|
1183
|
1191
|
try305Count = 1;
|
|
1184
|
1192
|
}
|
|
1185
|
1193
|
}).show();
|
|
|
1194
|
*/
|
|
1186
|
1195
|
}
|
|
1187
|
1196
|
break;
|
|
1188
|
1197
|
case "309":
|
|
|
@ -1395,23 +1404,31 @@ public final class CaptureActivity extends Activity implements SurfaceHolder.Cal
|
|
1395
|
1404
|
});
|
|
1396
|
1405
|
}
|
|
1397
|
1406
|
|
|
1398
|
|
private void showSettleAccountsDialog(){
|
|
|
1407
|
private void showSettleAccountsDialog(final List<DelayedSettlementBean> datas){
|
|
1399
|
1408
|
if (isDestroyed() ||isFinishing()) {
|
|
1400
|
1409
|
return;
|
|
1401
|
1410
|
}
|
|
1402
|
|
isSettleAccounts=1;
|
|
|
1411
|
|
|
1403
|
1412
|
new SettleAccountsDialog(this)
|
|
1404
|
1413
|
.builder()
|
|
1405
|
|
.setCancleOnClick(new View.OnClickListener() {
|
|
|
1414
|
.setOpenOnClick(new View.OnClickListener() {
|
|
1406
|
1415
|
@Override
|
|
1407
|
1416
|
public void onClick(View v) {
|
|
1408
|
|
isSettleAccounts=1;
|
|
|
1417
|
try305Count = 1;
|
|
|
1418
|
if (datas!=null && datas.size()>0){
|
|
|
1419
|
Intent intent = new Intent();
|
|
|
1420
|
intent.setClassName("com.electric.chargingpile",
|
|
|
1421
|
"com.electric.chargingpile.activity.ConfirmOrderActivity");
|
|
|
1422
|
intent.putExtra(ChargingConstants.ORDERID, datas.get(0).getOrder_id());
|
|
|
1423
|
startActivity(intent);
|
|
|
1424
|
}
|
|
1409
|
1425
|
}
|
|
1410
|
1426
|
})
|
|
1411
|
1427
|
.setCancleOnClick(new View.OnClickListener(){
|
|
1412
|
1428
|
|
|
1413
|
1429
|
@Override
|
|
1414
|
1430
|
public void onClick(View v) {
|
|
|
1431
|
try305Count = 1;
|
|
1415
|
1432
|
finish();
|
|
1416
|
1433
|
}
|
|
1417
|
1434
|
})
|
|
|
@ -7,4 +7,5 @@ public interface ChargingConstants {
|
|
7
|
7
|
String FLAG = "flag";
|
|
8
|
8
|
String ORDERID = "orderid";
|
|
9
|
9
|
String TYPE = "type";
|
|
|
10
|
String HBID = "hbid";
|
|
10
|
11
|
}
|
|
|
@ -2,8 +2,15 @@ package com.google.zxing.client.android.constant;
|
|
2
|
2
|
|
|
3
|
3
|
public interface UrlConstants {
|
|
4
|
4
|
String HOST_URL = "http://cdz.evcharge.cc/zhannew/basic/web/index.php/";
|
|
|
5
|
// String HOST_URL = "http://59.110.68.162/zhannew/basic/web/index.php/";
|
|
|
6
|
|
|
5
|
7
|
String USER_CHARGING_CHECK_URL = HOST_URL + "api/charge/check-user";
|
|
6
|
8
|
String START_CHARGING_URL = HOST_URL + "api/charge/start";
|
|
7
|
9
|
String CHARGING_STATUS_URL = HOST_URL + "api/charge/query";
|
|
8
|
|
String STOP_CHARGING_URL = HOST_URL + "api/charge/close";
|
|
|
10
|
String STOP_CHARGING_URL = HOST_URL + "api/charge/close";//关闭充电
|
|
|
11
|
|
|
|
12
|
String RED_ENVELOPE_LIST = HOST_URL + "/api/charge/hblist";//红包列表
|
|
|
13
|
String SETTLEMENT = HOST_URL + "api/charge/settlement"; //选中红包时,提交结算时的接口
|
|
|
14
|
String QUERY_NOT_CLOSE = HOST_URL + "api/charge/querynotclose"; //仅仅是查询接口状态,充电是否停止,state >= 2 则表示停止
|
|
|
15
|
|
|
9
|
16
|
}
|
|
|
@ -0,0 +1,80 @@
|
|
|
1
|
package com.google.zxing.client.android.data;
|
|
|
2
|
|
|
|
3
|
public class DelayedSettlementBean {
|
|
|
4
|
private String id;
|
|
|
5
|
private String company;
|
|
|
6
|
private String third_party_id;
|
|
|
7
|
private String user_id;
|
|
|
8
|
private String third_id;
|
|
|
9
|
private String settlement;
|
|
|
10
|
private String order_id;
|
|
|
11
|
|
|
|
12
|
public String getOrder_id() {
|
|
|
13
|
return order_id;
|
|
|
14
|
}
|
|
|
15
|
|
|
|
16
|
public void setOrder_id(String order_id) {
|
|
|
17
|
this.order_id = order_id;
|
|
|
18
|
}
|
|
|
19
|
|
|
|
20
|
@Override
|
|
|
21
|
public String toString() {
|
|
|
22
|
return "DelayedSettlementBean{" +
|
|
|
23
|
"id='" + id + '\'' +
|
|
|
24
|
", company='" + company + '\'' +
|
|
|
25
|
", third_party_id='" + third_party_id + '\'' +
|
|
|
26
|
", user_id='" + user_id + '\'' +
|
|
|
27
|
", third_id='" + third_id + '\'' +
|
|
|
28
|
", settlement='" + settlement + '\'' +
|
|
|
29
|
", order_id='" + order_id + '\'' +
|
|
|
30
|
'}';
|
|
|
31
|
}
|
|
|
32
|
|
|
|
33
|
public String getId() {
|
|
|
34
|
return id;
|
|
|
35
|
}
|
|
|
36
|
|
|
|
37
|
public void setId(String id) {
|
|
|
38
|
this.id = id;
|
|
|
39
|
}
|
|
|
40
|
|
|
|
41
|
public String getCompany() {
|
|
|
42
|
return company;
|
|
|
43
|
}
|
|
|
44
|
|
|
|
45
|
public void setCompany(String company) {
|
|
|
46
|
this.company = company;
|
|
|
47
|
}
|
|
|
48
|
|
|
|
49
|
public String getThird_party_id() {
|
|
|
50
|
return third_party_id;
|
|
|
51
|
}
|
|
|
52
|
|
|
|
53
|
public void setThird_party_id(String third_party_id) {
|
|
|
54
|
this.third_party_id = third_party_id;
|
|
|
55
|
}
|
|
|
56
|
|
|
|
57
|
public String getUser_id() {
|
|
|
58
|
return user_id;
|
|
|
59
|
}
|
|
|
60
|
|
|
|
61
|
public void setUser_id(String user_id) {
|
|
|
62
|
this.user_id = user_id;
|
|
|
63
|
}
|
|
|
64
|
|
|
|
65
|
public String getThird_id() {
|
|
|
66
|
return third_id;
|
|
|
67
|
}
|
|
|
68
|
|
|
|
69
|
public void setThird_id(String third_id) {
|
|
|
70
|
this.third_id = third_id;
|
|
|
71
|
}
|
|
|
72
|
|
|
|
73
|
public String getSettlement() {
|
|
|
74
|
return settlement;
|
|
|
75
|
}
|
|
|
76
|
|
|
|
77
|
public void setSettlement(String settlement) {
|
|
|
78
|
this.settlement = settlement;
|
|
|
79
|
}
|
|
|
80
|
}
|