Commit ef58b614 authored by linfeng's avatar linfeng

租车和钱包修改

parent b1b1879e
...@@ -716,7 +716,7 @@ public class ConfirmOrderActivity extends BaseStatusActivity<CommonPresenter> { ...@@ -716,7 +716,7 @@ public class ConfirmOrderActivity extends BaseStatusActivity<CommonPresenter> {
if (memberData != null) { if (memberData != null) {
if (memberData.getRentFreeDays() == 0) { if (memberData.getRentFreeDays() == 0) {
swbtnMember.setChecked(false); swbtnMember.setChecked(false);
showToast("免费用车天数0"); showToast("免费用车天数0");
return true; return true;
} }
} }
...@@ -751,9 +751,11 @@ public class ConfirmOrderActivity extends BaseStatusActivity<CommonPresenter> { ...@@ -751,9 +751,11 @@ public class ConfirmOrderActivity extends BaseStatusActivity<CommonPresenter> {
ArrayList<OrderPriceDetailBean.ChildrenBean> childrenBeanList = new ArrayList<>(); //费用明细 ArrayList<OrderPriceDetailBean.ChildrenBean> childrenBeanList = new ArrayList<>(); //费用明细
double payMoney = 0.00; double payMoney = 0.00;
// double dayPrice = mCarBean.getVehicleModel().getSum(); // 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++) { 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(); int dayNum = dataBean.getDayNum();
...@@ -761,35 +763,50 @@ public class ConfirmOrderActivity extends BaseStatusActivity<CommonPresenter> { ...@@ -761,35 +763,50 @@ public class ConfirmOrderActivity extends BaseStatusActivity<CommonPresenter> {
OrderPriceDetailBean.ChildrenBean childrenBean2 = new OrderPriceDetailBean.ChildrenBean(); OrderPriceDetailBean.ChildrenBean childrenBean2 = new OrderPriceDetailBean.ChildrenBean();
childrenBean2.setKey("车辆租赁费"); childrenBean2.setKey("车辆租赁费");
childrenBean2.setDetail(dayNum + "天"); 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); childrenBeanList.add(childrenBean2);
if (isMemberType == 0) { //是否使用会员 0 不使用 if (isMemberType == 0) { //是否使用会员 0 不使用
payMoney = totalPrice + priceBean.getData().getDeposit(); //租车和押金价格 payMoney = totalCarPrice + priceBean.getData().getDeposit(); //租车和押金价格
carAmount = totalPrice; carAmount = totalCarPrice;
} else { } else {
// if (memberData != null) { if (memberData != null) {
// if (dayNum > memberData.getRentFreeDays()) { 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(); // payMoney = dayPrice * (dayNum - memberData.getRentFreeDays()) + priceBean.getData().getDeposit();
//
// carAmount = dayPrice * (dayNum - memberData.getRentFreeDays()); OrderPriceDetailBean.ChildrenBean childrenBean1 = new OrderPriceDetailBean.ChildrenBean();
// OrderPriceDetailBean.ChildrenBean childrenBean1 = new OrderPriceDetailBean.ChildrenBean(); childrenBean1.setKey("免费天数");
// childrenBean1.setKey("免费天数"); childrenBean1.setDetail("会员天数" + (memberData.getRentFreeDays()) + "天");
// childrenBean1.setDetail("会员天数" + (dayNum - memberData.getRentFreeDays()) + "天"); childrenBean1.setVal("-¥" + new BigDecimal(useTotalMemberPrice).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue());
// childrenBean1.setVal("-¥" + new BigDecimal(dayPrice * memberData.getRentFreeDays()).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue()); childrenBeanList.add(childrenBean1);
// childrenBeanList.add(childrenBean1); } else if (totalMemberDays <= memberData.getRentFreeDays()) {
// } else if (dayNum <= memberData.getRentFreeDays()) { payMoney = priceBean.getData().getDeposit();
// payMoney = priceBean.getData().getDeposit(); carAmount = 0;
// carAmount = 0;
// OrderPriceDetailBean.ChildrenBean childrenBean1 = new OrderPriceDetailBean.ChildrenBean();
// OrderPriceDetailBean.ChildrenBean childrenBean1 = new OrderPriceDetailBean.ChildrenBean(); childrenBean1.setKey("免费天数");
// childrenBean1.setKey("免费天数"); childrenBean1.setDetail("会员天数" + totalMemberDays + "天");
// childrenBean1.setDetail("会员天数" + dayNum + "天"); childrenBean1.setVal("-¥" + new BigDecimal(totalCarPrice).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue());
// childrenBean1.setVal("-¥" + new BigDecimal(dayPrice * dayNum).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue()); childrenBeanList.add(childrenBean1);
// childrenBeanList.add(childrenBean1); }
// } }
// }
} }
if (drivingType == 1) { if (drivingType == 1) {
payMoney = payMoney + priceBean.getData().getDriverAmount(); // + 专职司机 payMoney = payMoney + priceBean.getData().getDriverAmount(); // + 专职司机
...@@ -823,7 +840,7 @@ public class ConfirmOrderActivity extends BaseStatusActivity<CommonPresenter> { ...@@ -823,7 +840,7 @@ public class ConfirmOrderActivity extends BaseStatusActivity<CommonPresenter> {
OrderPriceDetailBean.ChildrenBean childrenBean = new OrderPriceDetailBean.ChildrenBean(); OrderPriceDetailBean.ChildrenBean childrenBean = new OrderPriceDetailBean.ChildrenBean();
childrenBean.setKey("租房车押金"); childrenBean.setKey("租房车押金");
childrenBean.setVal("¥" + priceBean.getData().getDeposit()); childrenBean.setVal("¥" + new BigDecimal(priceBean.getData().getDeposit()).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue());
childrenBeanList.add(childrenBean); childrenBeanList.add(childrenBean);
if (couponAmount > 0) { if (couponAmount > 0) {
......
...@@ -32,21 +32,17 @@ public class OrderCalendarPriceBean extends BaseBean implements Serializable { ...@@ -32,21 +32,17 @@ public class OrderCalendarPriceBean extends BaseBean implements Serializable {
} }
public static class DataBean 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 price;
private double no_discount_price; private double no_discount_price;
private double freeDays; private double freeDays;
public long getDate() { public String getDate() {
return date; return date;
} }
public void setDate(long date) { public void setDate(String date) {
this.date = date; this.date = date;
} }
......
...@@ -25,6 +25,8 @@ import com.xxrv.wallet.presenter.WalletPresenter; ...@@ -25,6 +25,8 @@ import com.xxrv.wallet.presenter.WalletPresenter;
import com.yuyife.okgo.OkGoUtil; import com.yuyife.okgo.OkGoUtil;
import butterknife.BindView; import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import static com.ruiwenliu.wrapper.weight.webview.SafeWebView.hasKitkat; import static com.ruiwenliu.wrapper.weight.webview.SafeWebView.hasKitkat;
...@@ -125,6 +127,12 @@ public class CashWithdrawalDetailsActivity extends BaseStatusActivity<WalletPres ...@@ -125,6 +127,12 @@ public class CashWithdrawalDetailsActivity extends BaseStatusActivity<WalletPres
}); });
} }
@OnClick(R2.id.tv_ok)
public void onViewClicked() {
finish();
}
public class AndroidJs { public class AndroidJs {
@JavascriptInterface @JavascriptInterface
public String getToken() { public String getToken() {
......
...@@ -135,33 +135,47 @@ public class WalletActivity extends BaseStatusActivity<WalletPresenter> { ...@@ -135,33 +135,47 @@ public class WalletActivity extends BaseStatusActivity<WalletPresenter> {
} }
private void isAccountNumber(AccountNumberListBean result) { 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微信
startActivity(WithdrawActivity.getIntent(mActivity, balance)); int num = 0;
} else { for (int i = 0; i < result.getData().size(); i++) {
new ThirdPartyBindingDialog(mActivity) { if (1 == result.getData().get(i).getType()) {
@Override num++;
public void helper(ViewHolder helper) {
super.helper(helper);
helper.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
int id = v.getId();
if (id == R.id.ll_item_alipay) {
//支付宝绑定
getAuthInfo();
dismiss();
} else if (id == R.id.ll_item_wechat) {
//微信绑定
dismiss();
}
}
}, R.id.ll_item_alipay, R.id.ll_item_wechat);
} }
}.show(); }
if (num >0){
startActivity(WithdrawActivity.getIntent(mActivity, balance));
}else {
showBindingDialog();
}
} else {
showBindingDialog();
} }
} }
private void showBindingDialog() {
new ThirdPartyBindingDialog(mActivity) {
@Override
public void helper(ViewHolder helper) {
super.helper(helper);
helper.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
int id = v.getId();
if (id == R.id.ll_item_alipay) {
//支付宝绑定
getAuthInfo();
dismiss();
} else if (id == R.id.ll_item_wechat) {
//微信绑定
dismiss();
}
}
}, R.id.ll_item_alipay, R.id.ll_item_wechat);
}
}.show();
}
private void setWalletData(WalletBean bean) { private void setWalletData(WalletBean bean) {
if (bean != null && bean.getData() != null) { if (bean != null && bean.getData() != null) {
......
...@@ -212,15 +212,20 @@ public class WithdrawActivity extends BaseStatusActivity<WalletPresenter> implem ...@@ -212,15 +212,20 @@ public class WithdrawActivity extends BaseStatusActivity<WalletPresenter> implem
*/ */
private void setAccountNumber(AccountNumberListBean result) { private void setAccountNumber(AccountNumberListBean result) {
if (result != null && result.getData() != null && result.getData().size() > 0) { if (result != null && result.getData() != null && result.getData().size() > 0) {
AccountNumberListBean.DataBean dataBean = result.getData().get(0); for (int i = 0; i < result.getData().size(); i++) {
selectAccountNumber = dataBean; if (1 == result.getData().get(i).getType()) {
dataBean.setCheck(true); AccountNumberListBean.DataBean dataBean = result.getData().get(0);
if (dataBean.getType() == 1) { //1支付宝 2微信 selectAccountNumber = dataBean;
ivAccountNumberIcon.setImageResource(R.drawable.common_icon_wallet_alipay_small); dataBean.setCheck(true);
tvAccountNumber.setText("支付宝余额(" + dataBean.getNickname() + ")"); if (dataBean.getType() == 1) { //1支付宝 2微信
} else if (dataBean.getType() == 2) { ivAccountNumberIcon.setImageResource(R.drawable.common_icon_wallet_alipay_small);
ivAccountNumberIcon.setImageResource(R.drawable.common_icon_wallet_weiwx_small); tvAccountNumber.setText("支付宝余额(" + dataBean.getNickname() + ")");
tvAccountNumber.setText("微信零钱(" + dataBean.getNickname() + ")"); } else if (dataBean.getType() == 2) {
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 ...@@ -283,7 +288,7 @@ public class WithdrawActivity extends BaseStatusActivity<WalletPresenter> implem
.withInt("type", 20) .withInt("type", 20)
.navigation(); .navigation();
} else if (id == R.id.ll_item_select_account_number) { } else if (id == R.id.ll_item_select_account_number) {
selectShow(); // selectShow();
} }
} }
......
...@@ -15,8 +15,7 @@ ...@@ -15,8 +15,7 @@
android:indeterminateOnly="false" android:indeterminateOnly="false"
android:max="100" android:max="100"
android:progressDrawable="@drawable/shape_rv_bg_yellow_progress" android:progressDrawable="@drawable/shape_rv_bg_yellow_progress"
android:visibility="gone"> android:visibility="gone"></ProgressBar>
</ProgressBar>
<WebView <WebView
android:id="@+id/webView" android:id="@+id/webView"
...@@ -24,4 +23,20 @@ ...@@ -24,4 +23,20 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="1" /> 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> </LinearLayout>
\ No newline at end of file
...@@ -54,7 +54,8 @@ ...@@ -54,7 +54,8 @@
<ImageView <ImageView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="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> </LinearLayout>
......
...@@ -35,10 +35,21 @@ ...@@ -35,10 +35,21 @@
android:layout_marginLeft="@dimen/size_15" android:layout_marginLeft="@dimen/size_15"
android:layout_marginRight="@dimen/size_15" android:layout_marginRight="@dimen/size_15"
android:layout_marginBottom="@dimen/size_26" android:layout_marginBottom="@dimen/size_26"
android:text="提现有2种方式,提现到微信零钱或支付宝余额。需至少绑定一种方式:" android:text="支持提现到支付余额,请绑定支付宝。"
android:textColor="@color/textGray" android:textColor="@color/textGray"
android:textSize="@dimen/size_16" /> 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 <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
...@@ -75,7 +86,8 @@ ...@@ -75,7 +86,8 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginTop="@dimen/size_10" android:layout_marginTop="@dimen/size_10"
android:layout_marginBottom="@dimen/size_10" android:layout_marginBottom="@dimen/size_10"
android:background="@color/colorLine" /> android:background="@color/colorLine"
android:visibility="gone" />
<LinearLayout <LinearLayout
android:id="@+id/ll_item_wechat" android:id="@+id/ll_item_wechat"
...@@ -83,7 +95,8 @@ ...@@ -83,7 +95,8 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
android:gravity="center_horizontal" android:gravity="center_horizontal"
android:orientation="vertical"> android:orientation="vertical"
android:visibility="gone">
<TextView <TextView
android:layout_width="wrap_content" 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