Browse Source

代码更新

huyuguo 4 years ago
parent
commit
e04cd4c39a

+ 7 - 5
app/src/main/java/com/electric/chargingpile/activity/ChargingCommentActivity.java

1452
1452
1453
1453
1454
    private void getShareIntegral() {
1454
    private void getShareIntegral() {
1455
        String url = MainApplication.url + "/zhannew/basic/web/index.php/member/insert-task?userid=" + MainApplication.userId;
1455
        String url = MainApplication.url + "/zhannew/basic/web/index.php/member/insert-task?userid=" + MainApplication.userId + "&order_id=" + order_id;
1456
        OkHttpUtils.get().url(url).build().execute(new StringCallback() {
1456
        OkHttpUtils.get().url(url).build().execute(new StringCallback() {
1457
            @Override
1457
            @Override
1458
            public void onError(Call call, Exception e) {
1458
            public void onError(Call call, Exception e) {
1463
            public void onResponse(String response) {
1463
            public void onResponse(String response) {
1464
                LogUtils.e(response);
1464
                LogUtils.e(response);
1465
                String rtnCode = JsonUtils.getKeyResult(response, "rtnCode");
1465
                String rtnCode = JsonUtils.getKeyResult(response, "rtnCode");
1466
                String red_money = JsonUtils.getKeyResult(response, "red_money");
1467
                int redMoney = Integer.valueOf(red_money);
1468
                if (redMoney > 0) {
1469
                    new HongBaoResultDialog(ChargingCommentActivity.this).builder().setCancelable(true).show(redMoney);
1470
                }
1471
1466
                if ("01".equals(rtnCode)) { // 成功
1472
                if ("01".equals(rtnCode)) { // 成功
1467
                    String plusScore = JsonUtils.getKeyResult(response, "plusScore");
1473
                    String plusScore = JsonUtils.getKeyResult(response, "plusScore");
1468
                    if (!plusScore.equals("")) {
1474
                    if (!plusScore.equals("")) {
1475
                            }
1481
                            }
1476
                        }, 1500);
1482
                        }, 1500);
1477
                    }
1483
                    }
1478
1479
                    String redMoney = JsonUtils.getKeyResult(response, "red_money");
1480
                    System.out.println("dsssssssss");
1481
1482
                } else {
1484
                } else {
1483
                    ToastUtil.showToast(getApplicationContext(), "分享成功", Toast.LENGTH_SHORT);
1485
                    ToastUtil.showToast(getApplicationContext(), "分享成功", Toast.LENGTH_SHORT);
1484
                }
1486
                }

+ 3 - 1
app/src/main/java/com/electric/chargingpile/view/HongBaoResultDialog.java

56
        return this;
56
        return this;
57
    }
57
    }
58
58
59
    public void show() {
59
    public void show(int redMoney) {
60
        TextView red_money = dialog.findViewById(R.id.red_money);
61
        red_money.setText(redMoney + "元");
60
        dialog_close.setOnClickListener(new View.OnClickListener() {
62
        dialog_close.setOnClickListener(new View.OnClickListener() {
61
            @Override
63
            @Override
62
            public void onClick(View view) {
64
            public void onClick(View view) {

+ 9 - 0
app/src/main/res/layout/dialog_hongbao_result.xml

17
            android:layout_width="wrap_content"
17
            android:layout_width="wrap_content"
18
            android:layout_height="wrap_content"
18
            android:layout_height="wrap_content"
19
            android:src="@drawable/icon_hongbao_result" />
19
            android:src="@drawable/icon_hongbao_result" />
20
20
    </LinearLayout>
21
    </LinearLayout>
21
22
23
    <TextView
24
        android:id="@+id/red_money"
25
        android:layout_width="match_parent"
26
        android:layout_height="wrap_content"
27
        android:textAlignment="center"
28
        android:text=""
29
        android:textColor="@color/red"
30
        android:textSize="40sp" />
22
    <ImageView
31
    <ImageView
23
        android:id="@+id/dialog_close"
32
        android:id="@+id/dialog_close"
24
        android:layout_width="wrap_content"
33
        android:layout_width="wrap_content"