Commit ef58b614 authored by linfeng's avatar linfeng

租车和钱包修改

parent b1b1879e
......@@ -716,7 +716,7 @@ public class ConfirmOrderActivity extends BaseStatusActivity<CommonPresenter> {
if (memberData != null) {
if (memberData.getRentFreeDays() == 0) {
swbtnMember.setChecked(false);
showToast("免费用车天数0");
showToast("免费用车天数0");
return true;
}
}
......@@ -751,9 +751,11 @@ public class ConfirmOrderActivity extends BaseStatusActivity<CommonPresenter> {
ArrayList<OrderPriceDetailBean.ChildrenBean> childrenBeanList = new ArrayList<>(); //费用明细
double payMoney = 0.00;
// double dayPrice = mCarBean.getVehicleModel().getSum();
double totalPrice = 0.00; //租车总价
double totalCarPrice = 0.00; //租车总价
double totalMemberDays = 0; //会员天数
for (int i = 0; i < calendarPriceBean.getData().size(); i++) {
totalPrice = totalPrice + calendarPriceBean.getData().get(i).getPrice();
totalCarPrice = totalCarPrice + calendarPriceBean.getData().get(i).getPrice();
totalMemberDays = totalMemberDays + calendarPriceBean.getData().get(i).getFreeDays();
}
int dayNum = dataBean.getDayNum();
......@@ -761,35 +763,50 @@ public class ConfirmOrderActivity extends BaseStatusActivity<CommonPresenter> {
OrderPriceDetailBean.ChildrenBean childrenBean2 = new OrderPriceDetailBean.ChildrenBean();
childrenBean2.setKey("车辆租赁费");
childrenBean2.setDetail(dayNum + "天");
childrenBean2.setVal("¥" + new BigDecimal(totalPrice).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue());
childrenBean2.setVal("¥" + new BigDecimal(totalCarPrice).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue());
childrenBeanList.add(childrenBean2);
if (isMemberType == 0) { //是否使用会员 0 不使用
payMoney = totalPrice + priceBean.getData().getDeposit(); //租车和押金价格
carAmount = totalPrice;
payMoney = totalCarPrice + priceBean.getData().getDeposit(); //租车和押金价格
carAmount = totalCarPrice;
} else {
// if (memberData != null) {
// if (dayNum > memberData.getRentFreeDays()) {
if (memberData != null) {
if (totalMemberDays > memberData.getRentFreeDays()) { //个人会员天数小于租车使用会员天数
double useTotalMemberPrice = 0.00;
double useTotalMemberDays = 0;
for (int j = 0; j < calendarPriceBean.getData().size(); j++) {
if (useTotalMemberDays < memberData.getRentFreeDays()) {
useTotalMemberDays = useTotalMemberDays + calendarPriceBean.getData().get(j).getFreeDays();
useTotalMemberPrice = useTotalMemberPrice + calendarPriceBean.getData().get(j).getPrice();
} else {
double memberPrice = calendarPriceBean.getData().get(j - 1).getPrice() / calendarPriceBean.getData().get(j - 1).getFreeDays(); //计算最后使用会员单价
useTotalMemberPrice = useTotalMemberPrice - (useTotalMemberDays - memberData.getRentFreeDays()) * memberPrice;
break;
}
}
payMoney = totalCarPrice - useTotalMemberPrice + priceBean.getData().getDeposit();
carAmount = totalCarPrice - useTotalMemberPrice;
// payMoney = dayPrice * (dayNum - memberData.getRentFreeDays()) + priceBean.getData().getDeposit();
//
// carAmount = dayPrice * (dayNum - memberData.getRentFreeDays());
// OrderPriceDetailBean.ChildrenBean childrenBean1 = new OrderPriceDetailBean.ChildrenBean();
// childrenBean1.setKey("免费天数");
// childrenBean1.setDetail("会员天数" + (dayNum - memberData.getRentFreeDays()) + "天");
// childrenBean1.setVal("-¥" + new BigDecimal(dayPrice * memberData.getRentFreeDays()).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue());
// childrenBeanList.add(childrenBean1);
// } else if (dayNum <= memberData.getRentFreeDays()) {
// payMoney = priceBean.getData().getDeposit();
// carAmount = 0;
//
// OrderPriceDetailBean.ChildrenBean childrenBean1 = new OrderPriceDetailBean.ChildrenBean();
// childrenBean1.setKey("免费天数");
// childrenBean1.setDetail("会员天数" + dayNum + "天");
// childrenBean1.setVal("-¥" + new BigDecimal(dayPrice * dayNum).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue());
// childrenBeanList.add(childrenBean1);
// }
// }
OrderPriceDetailBean.ChildrenBean childrenBean1 = new OrderPriceDetailBean.ChildrenBean();
childrenBean1.setKey("免费天数");
childrenBean1.setDetail("会员天数" + (memberData.getRentFreeDays()) + "天");
childrenBean1.setVal("-¥" + new BigDecimal(useTotalMemberPrice).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue());
childrenBeanList.add(childrenBean1);
} else if (totalMemberDays <= memberData.getRentFreeDays()) {
payMoney = priceBean.getData().getDeposit();
carAmount = 0;
OrderPriceDetailBean.ChildrenBean childrenBean1 = new OrderPriceDetailBean.ChildrenBean();
childrenBean1.setKey("免费天数");
childrenBean1.setDetail("会员天数" + totalMemberDays + "天");
childrenBean1.setVal("-¥" + new BigDecimal(totalCarPrice).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue());
childrenBeanList.add(childrenBean1);
}
}
}
if (drivingType == 1) {
payMoney = payMoney + priceBean.getData().getDriverAmount(); // + 专职司机
......@@ -823,7 +840,7 @@ public class ConfirmOrderActivity extends BaseStatusActivity<CommonPresenter> {
OrderPriceDetailBean.ChildrenBean childrenBean = new OrderPriceDetailBean.ChildrenBean();
childrenBean.setKey("租房车押金");
childrenBean.setVal("¥" + priceBean.getData().getDeposit());
childrenBean.setVal("¥" + new BigDecimal(priceBean.getData().getDeposit()).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue());
childrenBeanList.add(childrenBean);
if (couponAmount > 0) {
......
......@@ -32,21 +32,17 @@ public class OrderCalendarPriceBean extends BaseBean implements Serializable {
}
public static class DataBean implements Serializable {
// "date": "2019-10-26 00:00:00",
// "price": 0.180,
// "no_discount_price": 0.30,
// "freeDays": 1
private long date;
private String date;
private double price;
private double no_discount_price;
private double freeDays;
public long getDate() {
public String getDate() {
return date;
}
public void setDate(long date) {
public void setDate(String date) {
this.date = date;
}
......
......@@ -25,6 +25,8 @@ import com.xxrv.wallet.presenter.WalletPresenter;
import com.yuyife.okgo.OkGoUtil;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import static com.ruiwenliu.wrapper.weight.webview.SafeWebView.hasKitkat;
......@@ -125,6 +127,12 @@ public class CashWithdrawalDetailsActivity extends BaseStatusActivity<WalletPres
});
}
@OnClick(R2.id.tv_ok)
public void onViewClicked() {
finish();
}
public class AndroidJs {
@JavascriptInterface
public String getToken() {
......
......@@ -135,9 +135,25 @@ public class WalletActivity extends BaseStatusActivity<WalletPresenter> {
}
private void isAccountNumber(AccountNumberListBean result) {
if (result != null && result.getData() != null && result.getData().size() > 0) {
if (result != null && result.getData() != null && result.getData().size() > 0) { ////1支付宝 2微信
int num = 0;
for (int i = 0; i < result.getData().size(); i++) {
if (1 == result.getData().get(i).getType()) {
num++;
}
}
if (num >0){
startActivity(WithdrawActivity.getIntent(mActivity, balance));
}else {
showBindingDialog();
}
} else {
showBindingDialog();
}
}
private void showBindingDialog() {
new ThirdPartyBindingDialog(mActivity) {
@Override
public void helper(ViewHolder helper) {
......@@ -152,7 +168,6 @@ public class WalletActivity extends BaseStatusActivity<WalletPresenter> {
dismiss();
} else if (id == R.id.ll_item_wechat) {
//微信绑定
dismiss();
}
}
......@@ -160,7 +175,6 @@ public class WalletActivity extends BaseStatusActivity<WalletPresenter> {
}
}.show();
}
}
private void setWalletData(WalletBean bean) {
......
......@@ -212,6 +212,8 @@ public class WithdrawActivity extends BaseStatusActivity<WalletPresenter> implem
*/
private void setAccountNumber(AccountNumberListBean result) {
if (result != null && result.getData() != null && result.getData().size() > 0) {
for (int i = 0; i < result.getData().size(); i++) {
if (1 == result.getData().get(i).getType()) {
AccountNumberListBean.DataBean dataBean = result.getData().get(0);
selectAccountNumber = dataBean;
dataBean.setCheck(true);
......@@ -222,6 +224,9 @@ public class WithdrawActivity extends BaseStatusActivity<WalletPresenter> implem
ivAccountNumberIcon.setImageResource(R.drawable.common_icon_wallet_weiwx_small);
tvAccountNumber.setText("微信零钱(" + dataBean.getNickname() + ")");
}
break;
}
}
}
}
......@@ -283,7 +288,7 @@ public class WithdrawActivity extends BaseStatusActivity<WalletPresenter> implem
.withInt("type", 20)
.navigation();
} else if (id == R.id.ll_item_select_account_number) {
selectShow();
// selectShow();
}
}
......
......@@ -15,8 +15,7 @@
android:indeterminateOnly="false"
android:max="100"
android:progressDrawable="@drawable/shape_rv_bg_yellow_progress"
android:visibility="gone">
</ProgressBar>
android:visibility="gone"></ProgressBar>
<WebView
android:id="@+id/webView"
......@@ -24,4 +23,20 @@
android:layout_height="match_parent"
android:layout_weight="1" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="@dimen/size_60">
<Button
android:id="@+id/tv_ok"
android:layout_width="match_parent"
android:layout_height="@dimen/size_50"
android:layout_marginLeft="@dimen/size_15"
android:layout_marginTop="@dimen/size_5"
android:layout_marginRight="@dimen/size_15"
android:background="@drawable/shape_rv_bg_dark_yellow"
android:text="确定"
android:textSize="@dimen/text_16" />
</LinearLayout>
</LinearLayout>
\ No newline at end of file
......@@ -54,7 +54,8 @@
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/common_icon_rig_gray" />
android:src="@drawable/common_icon_rig_gray"
android:visibility="invisible" />
</LinearLayout>
......
......@@ -35,10 +35,21 @@
android:layout_marginLeft="@dimen/size_15"
android:layout_marginRight="@dimen/size_15"
android:layout_marginBottom="@dimen/size_26"
android:text="提现有2种方式,提现到微信零钱或支付宝余额。需至少绑定一种方式:"
android:text="支持提现到支付余额,请绑定支付宝。"
android:textColor="@color/textGray"
android:textSize="@dimen/size_16" />
<!--<TextView-->
<!--android:id="@+id/tv_content"-->
<!--android:layout_width="wrap_content"-->
<!--android:layout_height="wrap_content"-->
<!--android:layout_marginLeft="@dimen/size_15"-->
<!--android:layout_marginRight="@dimen/size_15"-->
<!--android:layout_marginBottom="@dimen/size_26"-->
<!--android:text="提现有2种方式,提现到微信零钱或支付宝余额。需至少绑定一种方式:"-->
<!--android:textColor="@color/textGray"-->
<!--android:textSize="@dimen/size_16" />-->
<LinearLayout
android:layout_width="match_parent"
......@@ -75,7 +86,8 @@
android:layout_height="match_parent"
android:layout_marginTop="@dimen/size_10"
android:layout_marginBottom="@dimen/size_10"
android:background="@color/colorLine" />
android:background="@color/colorLine"
android:visibility="gone" />
<LinearLayout
android:id="@+id/ll_item_wechat"
......@@ -83,7 +95,8 @@
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center_horizontal"
android:orientation="vertical">
android:orientation="vertical"
android:visibility="gone">
<TextView
android:layout_width="wrap_content"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment