huyuguo лет назад: 4
Родитель
Сommit
e04cd4c39a

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

@ -1452,7 +1452,7 @@ public class ChargingCommentActivity extends Activity implements View.OnClickLis
1452 1452
1453 1453
1454 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 1456
        OkHttpUtils.get().url(url).build().execute(new StringCallback() {
1457 1457
            @Override
1458 1458
            public void onError(Call call, Exception e) {
@ -1463,6 +1463,12 @@ public class ChargingCommentActivity extends Activity implements View.OnClickLis
1463 1463
            public void onResponse(String response) {
1464 1464
                LogUtils.e(response);
1465 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 1472
                if ("01".equals(rtnCode)) { // 成功
1467 1473
                    String plusScore = JsonUtils.getKeyResult(response, "plusScore");
1468 1474
                    if (!plusScore.equals("")) {
@ -1475,10 +1481,6 @@ public class ChargingCommentActivity extends Activity implements View.OnClickLis
1475 1481
                            }
1476 1482
                        }, 1500);
1477 1483
                    }
1478
1479
                    String redMoney = JsonUtils.getKeyResult(response, "red_money");
1480
                    System.out.println("dsssssssss");
1481
1482 1484
                } else {
1483 1485
                    ToastUtil.showToast(getApplicationContext(), "分享成功", Toast.LENGTH_SHORT);
1484 1486
                }

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

@ -56,7 +56,9 @@ public class HongBaoResultDialog {
56 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 62
        dialog_close.setOnClickListener(new View.OnClickListener() {
61 63
            @Override
62 64
            public void onClick(View view) {

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

@ -17,8 +17,17 @@
17 17
            android:layout_width="wrap_content"
18 18
            android:layout_height="wrap_content"
19 19
            android:src="@drawable/icon_hongbao_result" />
20
20 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 31
    <ImageView
23 32
        android:id="@+id/dialog_close"
24 33
        android:layout_width="wrap_content"