|
|
@@ -6,6 +6,7 @@ import android.net.Uri;
|
|
6
|
6
|
import android.os.Bundle;
|
|
7
|
7
|
import android.view.View;
|
|
8
|
8
|
|
|
|
9
|
+import androidx.annotation.VisibleForTesting;
|
|
9
|
10
|
import androidx.lifecycle.ViewModelProvider;
|
|
10
|
11
|
|
|
11
|
12
|
import com.alibaba.fastjson.JSON;
|
|
|
@@ -24,6 +25,8 @@ import com.yihucha.hbyhc.presentation.order.OrderActivity;
|
|
24
|
25
|
import com.yihucha.hbyhc.presentation.order.OrderDetailsDaifukuanActivity;
|
|
25
|
26
|
import com.yihucha.hbyhc.presentation.order.model.OrderListObligationBean;
|
|
26
|
27
|
import com.yihucha.hbyhc.presentation.pay.view_model.PayViewModel;
|
|
|
28
|
+import com.yihucha.hbyhc.utils.DoubleFormatTool;
|
|
|
29
|
+import com.yihucha.hbyhc.utils.EmptyCheckUtils;
|
|
27
|
30
|
import com.yihucha.hbyhc.utils.LogUtil;
|
|
28
|
31
|
import com.yihucha.hbyhc.utils.MVUtils;
|
|
29
|
32
|
import com.yihucha.hbyhc.view.CustomDialog;
|
|
|
@@ -134,7 +137,25 @@ public class PayActivity extends ViewBindingTitleBaseActivity<ActivityPayBinding
|
|
134
|
137
|
}
|
|
135
|
138
|
|
|
136
|
139
|
private void initView() {
|
|
137
|
|
- mViewBinding.btvPrice.setText(price);
|
|
|
140
|
+ if (EmptyCheckUtils.isNotEmpty(bean)){
|
|
|
141
|
+ if (EmptyCheckUtils.isNotEmpty(bean.getType())){
|
|
|
142
|
+// String type = bean.getType().getType();
|
|
|
143
|
+// String note = bean.getType().getNote();
|
|
|
144
|
+ double price = bean.getType().getPrice();
|
|
|
145
|
+ double other = bean.getType().getOther();
|
|
|
146
|
+ StringBuffer sb = new StringBuffer("");
|
|
|
147
|
+ sb.append(DoubleFormatTool.getRoundHalfUpDouble(price));
|
|
|
148
|
+ if (bean.getType().getOther()>0){
|
|
|
149
|
+ sb.append("+");
|
|
|
150
|
+ sb.append(DoubleFormatTool.getRoundHalfUpDouble(other));
|
|
|
151
|
+ }
|
|
|
152
|
+ mViewBinding.btvPrice.setText(sb.toString());
|
|
|
153
|
+
|
|
|
154
|
+ }
|
|
|
155
|
+ }
|
|
|
156
|
+ else {
|
|
|
157
|
+ mViewBinding.btvPrice.setText(price);
|
|
|
158
|
+ }
|
|
138
|
159
|
}
|
|
139
|
160
|
|
|
140
|
161
|
@Override
|