Commit 8359ad94 authored by linfeng's avatar linfeng

随车物品

parent ca32fc7a
......@@ -8,8 +8,8 @@ android {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 127
versionName "1.2.7"
versionCode 128
versionName "1.2.8"
multiDexEnabled true
//新版Gradle 是 implementation 为了兼容compile,写上这句话
......
......@@ -153,7 +153,8 @@
<activity
android:name=".wxapi.WXPayEntryActivity"
android:exported="true"
android:launchMode="singleTop" /> <!-- QQ callback -->
android:launchMode="singleTop" />
<!-- QQ callback -->
<activity
android:name="com.tencent.tauth.AuthActivity"
android:launchMode="singleTask"
......
package com.rv.component.control;
import android.content.Context;
import android.content.res.TypedArray;
import android.util.AttributeSet;
import android.util.TypedValue;
import android.view.Gravity;
import android.view.View;
import android.view.ViewGroup;
import java.util.ArrayList;
import java.util.List;
public class FlowLayout extends ViewGroup {
private static final String LOG_TAG = FlowLayout.class.getSimpleName();
public static final int SPACING_AUTO = -65536;
public static final int SPACING_ALIGN = -65537;
private static final int SPACING_UNDEFINED = -65538;
private static final int UNSPECIFIED_GRAVITY = -1;
private static final int ROW_VERTICAL_GRAVITY_AUTO = -65536;
private static final boolean DEFAULT_FLOW = true;
private static final int DEFAULT_CHILD_SPACING = 0;
private static final int DEFAULT_CHILD_SPACING_FOR_LAST_ROW = SPACING_UNDEFINED;
private static final float DEFAULT_ROW_SPACING = 0;
private static final boolean DEFAULT_RTL = false;
private static final int DEFAULT_MAX_ROWS = Integer.MAX_VALUE;
private boolean mFlow = DEFAULT_FLOW;
private int mChildSpacing = DEFAULT_CHILD_SPACING;
private int mMinChildSpacing = DEFAULT_CHILD_SPACING;
private int mChildSpacingForLastRow = DEFAULT_CHILD_SPACING_FOR_LAST_ROW;
private float mRowSpacing = DEFAULT_ROW_SPACING;
private float mAdjustedRowSpacing = DEFAULT_ROW_SPACING;
private boolean mRtl = DEFAULT_RTL;
private int mMaxRows = DEFAULT_MAX_ROWS;
private int mGravity = UNSPECIFIED_GRAVITY;
private int mRowVerticalGravity = ROW_VERTICAL_GRAVITY_AUTO;
private int mExactMeasuredHeight;
private List<Float> mHorizontalSpacingForRow = new ArrayList<>();
private List<Integer> mHeightForRow = new ArrayList<>();
private List<Integer> mWidthForRow = new ArrayList<>();
private List<Integer> mChildNumForRow = new ArrayList<>();
public FlowLayout(Context context) {
this(context, null);
}
public FlowLayout(Context context, AttributeSet attrs) {
super(context, attrs);
TypedArray a = context.getTheme().obtainStyledAttributes(
attrs, R.styleable.FlowLayout, 0, 0);
try {
mFlow = a.getBoolean(R.styleable.FlowLayout_flFlow, DEFAULT_FLOW);
try {
mChildSpacing = a.getInt(R.styleable.FlowLayout_flChildSpacing, DEFAULT_CHILD_SPACING);
} catch (NumberFormatException e) {
mChildSpacing = a.getDimensionPixelSize(R.styleable.FlowLayout_flChildSpacing, (int) dpToPx(DEFAULT_CHILD_SPACING));
}
try {
mMinChildSpacing = a.getInt(R.styleable.FlowLayout_flMinChildSpacing, DEFAULT_CHILD_SPACING);
} catch (NumberFormatException e) {
mMinChildSpacing = a.getDimensionPixelSize(R.styleable.FlowLayout_flMinChildSpacing, (int) dpToPx(DEFAULT_CHILD_SPACING));
}
try {
mChildSpacingForLastRow = a.getInt(R.styleable.FlowLayout_flChildSpacingForLastRow, SPACING_UNDEFINED);
} catch (NumberFormatException e) {
mChildSpacingForLastRow = a.getDimensionPixelSize(R.styleable.FlowLayout_flChildSpacingForLastRow, (int) dpToPx(DEFAULT_CHILD_SPACING));
}
try {
mRowSpacing = a.getInt(R.styleable.FlowLayout_flRowSpacing, 0);
} catch (NumberFormatException e) {
mRowSpacing = a.getDimension(R.styleable.FlowLayout_flRowSpacing, dpToPx(DEFAULT_ROW_SPACING));
}
mMaxRows = a.getInt(R.styleable.FlowLayout_flMaxRows, DEFAULT_MAX_ROWS);
mRtl = a.getBoolean(R.styleable.FlowLayout_flRtl, DEFAULT_RTL);
mGravity = a.getInt(R.styleable.FlowLayout_android_gravity, UNSPECIFIED_GRAVITY);
mRowVerticalGravity = a.getInt(R.styleable.FlowLayout_flRowVerticalGravity, ROW_VERTICAL_GRAVITY_AUTO);
} finally {
a.recycle();
}
}
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
final int widthSize = MeasureSpec.getSize(widthMeasureSpec);
final int widthMode = MeasureSpec.getMode(widthMeasureSpec);
final int heightSize = MeasureSpec.getSize(heightMeasureSpec);
final int heightMode = MeasureSpec.getMode(heightMeasureSpec);
mHorizontalSpacingForRow.clear();
mHeightForRow.clear();
mWidthForRow.clear();
mChildNumForRow.clear();
int measuredHeight = 0, measuredWidth = 0, childCount = getChildCount();
int rowWidth = 0, maxChildHeightInRow = 0, childNumInRow = 0;
final int rowSize = widthSize - getPaddingLeft() - getPaddingRight();
int rowTotalChildWidth = 0;
final boolean allowFlow = widthMode != MeasureSpec.UNSPECIFIED && mFlow;
final int childSpacing = mChildSpacing == SPACING_AUTO && widthMode == MeasureSpec.UNSPECIFIED
? 0 : mChildSpacing;
final float tmpSpacing = childSpacing == SPACING_AUTO ? mMinChildSpacing : childSpacing;
for (int i = 0; i < childCount; i++) {
View child = getChildAt(i);
if (child.getVisibility() == GONE) {
continue;
}
LayoutParams childParams = child.getLayoutParams();
int horizontalMargin = 0, verticalMargin = 0;
if (childParams instanceof MarginLayoutParams) {
measureChildWithMargins(child, widthMeasureSpec, 0, heightMeasureSpec, measuredHeight);
MarginLayoutParams marginParams = (MarginLayoutParams) childParams;
horizontalMargin = marginParams.leftMargin + marginParams.rightMargin;
verticalMargin = marginParams.topMargin + marginParams.bottomMargin;
} else {
measureChild(child, widthMeasureSpec, heightMeasureSpec);
}
int childWidth = child.getMeasuredWidth() + horizontalMargin;
int childHeight = child.getMeasuredHeight() + verticalMargin;
if (allowFlow && rowWidth + childWidth > rowSize) { // Need flow to next row
// Save parameters for current row
mHorizontalSpacingForRow.add(
getSpacingForRow(childSpacing, rowSize, rowTotalChildWidth, childNumInRow));
mChildNumForRow.add(childNumInRow);
mHeightForRow.add(maxChildHeightInRow);
mWidthForRow.add(rowWidth - (int) tmpSpacing);
if (mHorizontalSpacingForRow.size() <= mMaxRows) {
measuredHeight += maxChildHeightInRow;
}
measuredWidth = Math.max(measuredWidth, rowWidth);
// Place the child view to next row
childNumInRow = 1;
rowWidth = childWidth + (int) tmpSpacing;
rowTotalChildWidth = childWidth;
maxChildHeightInRow = childHeight;
} else {
childNumInRow++;
rowWidth += childWidth + tmpSpacing;
rowTotalChildWidth += childWidth;
maxChildHeightInRow = Math.max(maxChildHeightInRow, childHeight);
}
}
// Measure remaining child views in the last row
if (mChildSpacingForLastRow == SPACING_ALIGN) {
// For SPACING_ALIGN, use the same spacing from the row above if there is more than one
// row.
if (mHorizontalSpacingForRow.size() >= 1) {
mHorizontalSpacingForRow.add(
mHorizontalSpacingForRow.get(mHorizontalSpacingForRow.size() - 1));
} else {
mHorizontalSpacingForRow.add(
getSpacingForRow(childSpacing, rowSize, rowTotalChildWidth, childNumInRow));
}
} else if (mChildSpacingForLastRow != SPACING_UNDEFINED) {
// For SPACING_AUTO and specific DP values, apply them to the spacing strategy.
mHorizontalSpacingForRow.add(
getSpacingForRow(mChildSpacingForLastRow, rowSize, rowTotalChildWidth, childNumInRow));
} else {
// For SPACING_UNDEFINED, apply childSpacing to the spacing strategy for the last row.
mHorizontalSpacingForRow.add(
getSpacingForRow(childSpacing, rowSize, rowTotalChildWidth, childNumInRow));
}
mChildNumForRow.add(childNumInRow);
mHeightForRow.add(maxChildHeightInRow);
mWidthForRow.add(rowWidth - (int) tmpSpacing);
if (mHorizontalSpacingForRow.size() <= mMaxRows) {
measuredHeight += maxChildHeightInRow;
}
measuredWidth = Math.max(measuredWidth, rowWidth);
if (childSpacing == SPACING_AUTO) {
measuredWidth = widthSize;
} else if (widthMode == MeasureSpec.UNSPECIFIED) {
measuredWidth = measuredWidth + getPaddingLeft() + getPaddingRight();
} else {
measuredWidth = Math.min(measuredWidth + getPaddingLeft() + getPaddingRight(), widthSize);
}
measuredHeight += getPaddingTop() + getPaddingBottom();
int rowNum = Math.min(mHorizontalSpacingForRow.size(), mMaxRows);
float rowSpacing = mRowSpacing == SPACING_AUTO && heightMode == MeasureSpec.UNSPECIFIED
? 0 : mRowSpacing;
if (rowSpacing == SPACING_AUTO) {
if (rowNum > 1) {
mAdjustedRowSpacing = (heightSize - measuredHeight) / (rowNum - 1);
} else {
mAdjustedRowSpacing = 0;
}
measuredHeight = heightSize;
} else {
mAdjustedRowSpacing = rowSpacing;
if (rowNum > 1) {
measuredHeight = heightMode == MeasureSpec.UNSPECIFIED
? ((int) (measuredHeight + mAdjustedRowSpacing * (rowNum - 1)))
: (Math.min((int) (measuredHeight + mAdjustedRowSpacing * (rowNum - 1)),
heightSize));
}
}
mExactMeasuredHeight = measuredHeight;
measuredWidth = widthMode == MeasureSpec.EXACTLY ? widthSize : measuredWidth;
measuredHeight = heightMode == MeasureSpec.EXACTLY ? heightSize : measuredHeight;
setMeasuredDimension(measuredWidth, measuredHeight);
}
@Override
protected void onLayout(boolean changed, int l, int t, int r, int b) {
final int paddingLeft = getPaddingLeft(), paddingRight = getPaddingRight(),
paddingTop = getPaddingTop(), paddingBottom = getPaddingBottom();
int x = mRtl ? (getWidth() - paddingRight) : paddingLeft;
int y = paddingTop;
int verticalGravity = mGravity & Gravity.VERTICAL_GRAVITY_MASK;
int horizontalGravity = mGravity & Gravity.HORIZONTAL_GRAVITY_MASK;
switch (verticalGravity) {
case Gravity.CENTER_VERTICAL: {
int offset = (b - t - paddingTop - paddingBottom - mExactMeasuredHeight) / 2;
y += offset;
break;
}
case Gravity.BOTTOM: {
int offset = b - t - paddingTop - paddingBottom - mExactMeasuredHeight;
y += offset;
break;
}
default:
break;
}
int horizontalPadding = paddingLeft + paddingRight, layoutWidth = r - l;
x += getHorizontalGravityOffsetForRow(horizontalGravity, layoutWidth, horizontalPadding, 0);
int verticalRowGravity = mRowVerticalGravity & Gravity.VERTICAL_GRAVITY_MASK;
int rowCount = mChildNumForRow.size(), childIdx = 0;
for (int row = 0; row < rowCount; row++) {
int childNum = mChildNumForRow.get(row);
int rowHeight = mHeightForRow.get(row);
float spacing = mHorizontalSpacingForRow.get(row);
for (int i = 0; i < childNum && childIdx < getChildCount(); ) {
View child = getChildAt(childIdx++);
if (child.getVisibility() == GONE) {
continue;
} else {
i++;
}
LayoutParams childParams = child.getLayoutParams();
int marginLeft = 0, marginTop = 0, marginBottom = 0, marginRight = 0;
if (childParams instanceof MarginLayoutParams) {
MarginLayoutParams marginParams = (MarginLayoutParams) childParams;
marginLeft = marginParams.leftMargin;
marginRight = marginParams.rightMargin;
marginTop = marginParams.topMargin;
marginBottom = marginParams.bottomMargin;
}
int childWidth = child.getMeasuredWidth();
int childHeight = child.getMeasuredHeight();
int tt = y + marginTop;
if (verticalRowGravity == Gravity.BOTTOM) {
tt = y + rowHeight - marginBottom - childHeight;
} else if (verticalRowGravity == Gravity.CENTER_VERTICAL) {
tt = y + marginTop + (rowHeight - marginTop - marginBottom - childHeight) / 2;
}
int bb = tt + childHeight;
if (mRtl) {
int l1 = x - marginRight - childWidth;
int r1 = x - marginRight;
child.layout(l1, tt, r1, bb);
x -= childWidth + spacing + marginLeft + marginRight;
} else {
int l2 = x + marginLeft;
int r2 = x + marginLeft + childWidth;
child.layout(l2, tt, r2, bb);
x += childWidth + spacing + marginLeft + marginRight;
}
}
x = mRtl ? (getWidth() - paddingRight) : paddingLeft;
x += getHorizontalGravityOffsetForRow(
horizontalGravity, layoutWidth, horizontalPadding, row + 1);
y += rowHeight + mAdjustedRowSpacing;
}
}
private int getHorizontalGravityOffsetForRow(int horizontalGravity, int parentWidth, int horizontalPadding, int row) {
if (mChildSpacing == SPACING_AUTO || row >= mWidthForRow.size()
|| row >= mChildNumForRow.size() || mChildNumForRow.get(row) <= 0) {
return 0;
}
int offset = 0;
switch (horizontalGravity) {
case Gravity.CENTER_HORIZONTAL:
offset = (parentWidth - horizontalPadding - mWidthForRow.get(row)) / 2;
break;
case Gravity.RIGHT:
offset = parentWidth - horizontalPadding - mWidthForRow.get(row);
break;
default:
break;
}
return offset;
}
@Override
protected LayoutParams generateLayoutParams(LayoutParams p) {
return new MarginLayoutParams(p);
}
@Override
public LayoutParams generateLayoutParams(AttributeSet attrs) {
return new MarginLayoutParams(getContext(), attrs);
}
public boolean isFlow() {
return mFlow;
}
public void setFlow(boolean flow) {
mFlow = flow;
requestLayout();
}
public int getChildSpacing() {
return mChildSpacing;
}
public void setChildSpacing(int childSpacing) {
mChildSpacing = childSpacing;
requestLayout();
}
public int getChildSpacingForLastRow() {
return mChildSpacingForLastRow;
}
public void setChildSpacingForLastRow(int childSpacingForLastRow) {
mChildSpacingForLastRow = childSpacingForLastRow;
requestLayout();
}
public float getRowSpacing() {
return mRowSpacing;
}
public void setRowSpacing(float rowSpacing) {
mRowSpacing = rowSpacing;
requestLayout();
}
public int getMaxRows() {
return mMaxRows;
}
public void setMaxRows(int maxRows) {
mMaxRows = maxRows;
requestLayout();
}
public void setGravity(int gravity) {
if (mGravity != gravity) {
mGravity = gravity;
requestLayout();
}
}
public void setRowVerticalGravity(int rowVerticalGravity) {
if (mRowVerticalGravity != rowVerticalGravity) {
mRowVerticalGravity = rowVerticalGravity;
requestLayout();
}
}
public boolean isRtl() {
return mRtl;
}
public void setRtl(boolean rtl) {
mRtl = rtl;
requestLayout();
}
public int getMinChildSpacing() {
return mMinChildSpacing;
}
public void setMinChildSpacing(int minChildSpacing) {
this.mMinChildSpacing = minChildSpacing;
requestLayout();
}
public int getRowsCount() {
return mChildNumForRow.size();
}
private float getSpacingForRow(int spacingAttribute, int rowSize, int usedSize, int childNum) {
float spacing;
if (spacingAttribute == SPACING_AUTO) {
if (childNum > 1) {
spacing = (rowSize - usedSize) / (childNum - 1);
} else {
spacing = 0;
}
} else {
spacing = spacingAttribute;
}
return spacing;
}
private float dpToPx(float dp) {
return TypedValue.applyDimension(
TypedValue.COMPLEX_UNIT_DIP, dp, getResources().getDisplayMetrics());
}
}
<?xml version="1.0" encoding="utf-8"?>
<resources>
<declare-styleable name="FlowLayout">
<attr name="flFlow" format="boolean"/>
<attr name="flChildSpacing" format="enum|dimension">
<enum name="auto" value="-65536"/>
</attr>
<attr name="flMinChildSpacing" format="dimension"/>
<attr name="flChildSpacingForLastRow" format="enum|dimension">
<enum name="auto" value="-65536"/>
<enum name="align" value="-65537"/>
</attr>
<attr name="flRowSpacing" format="enum|dimension">
<enum name="auto" value="-65536"/>
</attr>
<attr name="flRtl" format="boolean"/>
<attr name="flMaxRows" format="integer"/>
<attr name="flRowVerticalGravity" format="enum">
<enum name="auto" value="-65536"/>
<enum name="top" value="0x30"/>
<enum name="center" value="0x10"/>
<enum name="bottom" value="0x50"/>
</attr>
<attr name="android:gravity"/>
</declare-styleable>
</resources>
......@@ -3,6 +3,7 @@ package com.rv.component.utils;
import android.content.Context;
import android.text.TextPaint;
import android.util.DisplayMetrics;
import android.util.TypedValue;
import android.view.Display;
import android.view.WindowManager;
import android.widget.TextView;
......@@ -34,6 +35,12 @@ public class DisplayUtil {
return (int) (dipValue * scale + 0.5f);
}
public static float dpToPx(Context context, float dp){
return TypedValue.applyDimension(
TypedValue.COMPLEX_UNIT_DIP, dp, context.getResources().getDisplayMetrics());
}
/**
* 将px值转换为sp值,保证文字大小不变
*
......
......@@ -3,8 +3,10 @@
package="com.rv.home">
<application>
<activity android:name=".rv.module.ui.main.home.order.DepositefundProgressDetailsActivity"></activity>
<activity android:name=".rv.module.ui.main.home.other.SelectItemActivity" />
<activity android:name=".rv.module.ui.main.home.order.MemberOrderDetailsActivity" />
<activity android:name=".rv.module.ui.main.home.SalesroomActivity"></activity>
<activity android:name=".rv.module.ui.main.home.SalesroomActivity" />
</application>
</manifest>
\ No newline at end of file
......@@ -113,4 +113,13 @@ public class ApiConfig {
public static String HTTP_URL_RELATION_BIND = RvFrameConfig.HOST + "/api/admin/relation/bind";
public static String HTTP_URL_WALLETCATH_LIST = RvFrameConfig.HOST + "/api/admin/walletcath/page";
// 随车物品
public static String HTTP_URL_UNAUTH_TYPEITEMS = RvFrameConfig.HOST + "/vehicle/accompanyingItem/app/unauth/type_items";
//随车物品说明
public static String HTTP_URL_WEBVIEW_CARGOODS = RvFrameConfig.HOST + "/h5/appHtml/view/carGoods.html";
//押金退还进度
public static String HTTP_URL_WEBVIEW_REFUNDPROGRESS = RvFrameConfig.HOST + "/h5/appHtml/view/refundProgress.html";
}
......@@ -7,9 +7,12 @@ import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.support.v4.widget.PopupWindowCompat;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.text.Html;
import android.text.TextUtils;
import android.util.Log;
import android.util.TypedValue;
import android.view.Gravity;
import android.view.View;
import android.view.ViewGroup;
......@@ -40,16 +43,18 @@ import com.ruiwenliu.wrapper.util.UtilsManager;
import com.ruiwenliu.wrapper.util.ViewHolder;
import com.ruiwenliu.wrapper.util.glide.GlideManager;
import com.ruiwenliu.wrapper.weight.TitleView;
import com.rv.component.control.FlowLayout;
import com.rv.component.control.SwitchButton;
import com.rv.component.dialog.OrderPriceDetailPw;
import com.rv.component.dialog.PaymentTypeSelection;
import com.rv.component.dialog.bean.OrderPriceDetailBean;
import com.rv.component.utils.DisplayUtil;
import com.rv.home.R;
import com.rv.home.R2;
import com.rv.home.rv.module.ApiConfig;
import com.rv.home.rv.module.basic.BaseStatusActivity;
import com.rv.home.rv.module.basic.WebActivity;
import com.rv.home.rv.module.basic.presenter.CommonPresenter;
import com.rv.home.rv.module.ui.main.home.adapter.SelectedItemAdapter;
import com.rv.home.rv.module.ui.main.home.bean.CarTypeListBean;
import com.rv.home.rv.module.ui.main.home.bean.ConfirmOrderBean;
import com.rv.home.rv.module.ui.main.home.bean.DrivingListBean;
......@@ -57,7 +62,9 @@ import com.rv.home.rv.module.ui.main.home.bean.OrderAliPayBean;
import com.rv.home.rv.module.ui.main.home.bean.OrderDataBean;
import com.rv.home.rv.module.ui.main.home.bean.OrderPayBean;
import com.rv.home.rv.module.ui.main.home.bean.OrderPriceBean;
import com.rv.home.rv.module.ui.main.home.bean.SelectItemBean;
import com.rv.home.rv.module.ui.main.home.order.OrderListActivity;
import com.rv.home.rv.module.ui.main.home.other.SelectItemActivity;
import com.tencent.mm.opensdk.modelpay.PayReq;
import com.tencent.mm.opensdk.openapi.IWXAPI;
import com.tencent.mm.opensdk.openapi.WXAPIFactory;
......@@ -65,9 +72,9 @@ import com.xxrv.coupon.api.CouponApi;
import com.xxrv.coupon.bean.CouponBean;
import com.yuyife.okgo.OkGoUtil;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
......@@ -148,6 +155,8 @@ public class ConfirmOrderActivity extends BaseStatusActivity<CommonPresenter> {
TextView tvXinDrivingPrice;
@BindView(R2.id.tv_coupon_amount)
TextView tvCouponAmount;
@BindView(R2.id.rv_content_select)
FlowLayout rvContentSelect;
private final int TYPE_REQUEST_DRIVING = 3;
......@@ -170,11 +179,15 @@ public class ConfirmOrderActivity extends BaseStatusActivity<CommonPresenter> {
private double oldCarAmount;//
private List<CouponBean.DataBean> couponDataList;//优惠券数据
private SelectedItemAdapter mSelectedItemAdapter;
private double couponAmount = 0; //优惠券金额
private String status = "1";// 优惠券状态
private List<String> couponIdList = new ArrayList<>(); //选中优惠券
private List<String> selectItemList = new ArrayList<>();//随车物品
private List<SelectItemBean.DataBean> selectItem;
public static Intent getIntent(Context context, OrderDataBean bean, CarTypeListBean.DataBeanX.DataBean carBean, String startTime, String endTime) {
return new Intent(context, ConfirmOrderActivity.class)
......@@ -197,6 +210,22 @@ public class ConfirmOrderActivity extends BaseStatusActivity<CommonPresenter> {
mCarBean = (CarTypeListBean.DataBeanX.DataBean) intent.getSerializableExtra("carBean");
intiView();
initRxBus();
// mSelectedItemAdapter = new SelectedItemAdapter();
// rvContentSelect.setLayoutManager(new LinearLayoutManager(this));
// rvContentSelect.setAdapter(mSelectedItemAdapter);
}
private TextView buildLabel(String text) {
TextView textView = new TextView(this);
textView.setText(text);
textView.setTextColor(getResources().getColor(R.color.textGray));
textView.setTextSize(TypedValue.COMPLEX_UNIT_SP, 12);
textView.setPadding((int) DisplayUtil.dpToPx(mActivity, 15), (int) DisplayUtil.dpToPx(mActivity, 8), (int) DisplayUtil.dpToPx(mActivity, 15), (int) DisplayUtil.dpToPx(mActivity, 8));
return textView;
}
@SuppressLint("CheckResult")
......@@ -330,6 +359,19 @@ public class ConfirmOrderActivity extends BaseStatusActivity<CommonPresenter> {
// }
getPayMoney();
break;
case 134:
selectItem = JSON.parseArray(data.getStringExtra("selectItem"), SelectItemBean.DataBean.class);
rvContentSelect.removeAllViews();
selectItemList.clear();
if (selectItem != null && selectItem.size() > 0) {
for (int i = 0; i < selectItem.size(); i++) {
rvContentSelect.addView(buildLabel(selectItem.get(i).getName()));
selectItemList.add(selectItem.get(i).getId() + "," + selectItem.get(i).getNumber());
}
}
break;
}
}
}
......@@ -337,13 +379,14 @@ public class ConfirmOrderActivity extends BaseStatusActivity<CommonPresenter> {
@OnClick({R2.id.rl_goods, R2.id.tv_get_car_address, R2.id.tv_out_car_address, R2.id.iv_add_driving,
R2.id.tv_detail, R2.id.tv_confirm_order, R2.id.tv_delete, R2.id.rb_xin_driving, R2.id.ll_item_xin_driving,
R2.id.rb_user_driving, R2.id.tv_user_driving_hint, R2.id.tv_contract_agreement, R2.id.tv_service_fee_show, R2.id.tv_vehicle_cleaning_fee_show,
R2.id.tv_lab3, R2.id.tv_deposit_hint, R2.id.tv_privilege_service_hint, R2.id.tv_booking_instructions_hint, R2.id.rl_item_select_coupon})
R2.id.tv_lab3, R2.id.tv_deposit_hint, R2.id.tv_privilege_service_hint, R2.id.tv_booking_instructions_hint, R2.id.rl_item_select_coupon,
R2.id.tv_item_caritem, R2.id.tv_item_select_caritem})
public void onViewClicked(View view) {
int id = view.getId();
if (id == R.id.rl_goods) {
} else if (id == R.id.tv_get_car_address) {
} else if (id == R.id.tv_out_car_address) {
} else if (id == R.id.iv_add_driving) {
} else if (id == R.id.tv_user_driving_hint || id == R.id.iv_add_driving) {
startActivityForResult(DrivingListActivity.getIntent(mActivity, drivingListBean, 1), TYPE_REQUEST_DRIVING);
} else if (id == R.id.tv_detail) {
showOrderDetail(llBottom);
......@@ -363,7 +406,7 @@ public class ConfirmOrderActivity extends BaseStatusActivity<CommonPresenter> {
dataBean.setDriverType(1);
getPayMoney();
} else if (id == R.id.rb_user_driving || id == R.id.tv_user_driving_hint) {
} else if (id == R.id.rb_user_driving) {
drivingType = 2;
rbXinDriving.setChecked(false);
rbUserDriving.setChecked(true);
......@@ -431,6 +474,16 @@ public class ConfirmOrderActivity extends BaseStatusActivity<CommonPresenter> {
.withSerializable("coupon", JSON.toJSONString(couponDataList))
.navigation(this, 133);
}
} else if (id == R.id.tv_item_caritem) {
//随车物品
ARouter.getInstance().build(Constance.ACTIVITY_URL_WEBVIEW)
.withString("title", "随车物品说明")
.withString("url", ApiConfig.HTTP_URL_WEBVIEW_CARGOODS)
.navigation();
} else if (id == R.id.tv_item_select_caritem) {
//选择随车物品
startActivityForResult(SelectItemActivity.getIntent(mActivity, JSON.toJSONString(selectItem)), 134);
}
}
......@@ -439,16 +492,22 @@ public class ConfirmOrderActivity extends BaseStatusActivity<CommonPresenter> {
* 确定订单
*/
private void confirmOrder() {
//
// if (drivingType == 0) {
// showToast("未选择驾驶人");
// return;
// }
if (drivingType == 0) {
showToast("未选择驾驶人");
return;
}
// if (drivingType == 2 && drivingListBean == null) {
// showToast(mActivity.getString(R.string.rv_add_driving_toast));
// return;
// }
if (drivingType == 2 && drivingListBean == null) {
showToast(mActivity.getString(R.string.rv_add_driving_toast));
if (drivingListBean == null) {
showToast("请添加驾驶人!");
return;
}
if (tvPassengerKnow.isChecked() == false) {
showToast("请同意预定须知");
return;
......@@ -493,6 +552,8 @@ public class ConfirmOrderActivity extends BaseStatusActivity<CommonPresenter> {
String ids = couponIdList.toString().replace("[", "").replace("]", "").replaceAll(" ", "");
dataBean.setTickerNos(ids);
dataBean.setAccompanyStrs(selectItemList);
Log.i("confirmorderactivity", "createOrder: " + dataBean.toString());
mPresenter.postBodyData(RvFrameConfig.VEHICLE_ORDER, payType, ApiConfig.HTTP_URL_CONFIRM_ORDER, ConfirmOrderBean.class, dataBean, headMap, true);
}
......
package com.rv.home.rv.module.ui.main.home.adapter;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.rv.home.R;
import com.rv.home.rv.module.ui.main.home.bean.SelectItemBean;
/**
* 默认随车物品
*/
public class SelectItemDefaultAdapter extends BaseQuickAdapter<SelectItemBean.DataBean, BaseViewHolder> {
public SelectItemDefaultAdapter() {
super(R.layout.rv_item_selectitem_default_list);
}
@Override
protected void convert(BaseViewHolder helper, final SelectItemBean.DataBean item) {
if (item != null) {
helper.setText(R.id.tv_article_content, item.getName() + "*" + item.getNumber() + item.getUnit());
}
}
}
package com.rv.home.rv.module.ui.main.home.adapter;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.rv.home.R;
import com.rv.home.rv.module.ui.main.home.bean.SelectItemBean;
/**
* 可选随车物品
*/
public class SelectItemOptionalAdapter extends BaseQuickAdapter<SelectItemBean.DataBean, BaseViewHolder> {
public SelectItemOptionalAdapter() {
super(R.layout.rv_item_selectitem_optional_list);
}
@Override
protected void convert(BaseViewHolder helper, final SelectItemBean.DataBean item) {
if (item != null) {
helper.setText(R.id.tv_article_content, item.getName());
if (item.isSelect()){
helper.getView(R.id.iv_select).setSelected(true);
}else {
helper.getView(R.id.iv_select).setSelected(false);
}
}
}
}
package com.rv.home.rv.module.ui.main.home.adapter;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.rv.home.R;
/**
* 随车物品
*/
public class SelectedItemAdapter extends BaseQuickAdapter<String, BaseViewHolder> {
public SelectedItemAdapter() {
super(R.layout.rv_item_selectitemt_list);
}
@Override
protected void convert(BaseViewHolder helper, final String item) {
helper.setText(R.id.tv_article_content,item);
}
}
package com.rv.home.rv.module.ui.main.home.bean;
import java.io.Serializable;
import java.util.List;
/**
* Created :Auser
......@@ -50,6 +51,7 @@ public class OrderDataBean implements Serializable{
private int damageSafe;//是否购买免赔 1--是 0--否
private int rentFreeDay;//是否使用出租免费天数 1--是 0--否
private String tickerNos;//优惠券ids,逗号分割
private List<String> accompanyStrs; //随车物品参数
public int getDayNum() {
return dayNum;
......@@ -189,6 +191,14 @@ public class OrderDataBean implements Serializable{
this.tickerNos = tickerNos;
}
public List<String> getAccompanyStrs() {
return accompanyStrs;
}
public void setAccompanyStrs(List<String> accompanyStrs) {
this.accompanyStrs = accompanyStrs;
}
@Override
public String toString() {
return "OrderDataBean{" +
......
package com.rv.home.rv.module.ui.main.home.bean;
import com.ruiwenliu.wrapper.base.BaseBean;
import java.io.Serializable;
import java.util.List;
public class SelectItemBean extends BaseBean {
private List<DataBean> data;
private boolean rel;
public List<DataBean> getData() {
return data;
}
public void setData(List<DataBean> data) {
this.data = data;
}
public boolean isRel() {
return rel;
}
public void setRel(boolean rel) {
this.rel = rel;
}
public static class DataBean implements Serializable {
private String id;//": 99,
private String type;//": 1, 1:随车工具 2:随车配备 3:可配物品
private String name;//": "行驶证",
private String number;//": 1,
private String unit;//": "本", 单位
private double price;//": 0.00, 价格
private String rank;//": 20
private boolean select;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getNumber() {
return number;
}
public void setNumber(String number) {
this.number = number;
}
public String getUnit() {
return unit;
}
public void setUnit(String unit) {
this.unit = unit;
}
public double getPrice() {
return price;
}
public void setPrice(double price) {
this.price = price;
}
public String getRank() {
return rank;
}
public void setRank(String rank) {
this.rank = rank;
}
public boolean isSelect() {
return select;
}
public void setSelect(boolean select) {
this.select = select;
}
}
}
package com.rv.home.rv.module.ui.main.home.order;
import android.content.Context;
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.view.View;
import android.webkit.JavascriptInterface;
import android.webkit.WebChromeClient;
import android.webkit.WebResourceRequest;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.ProgressBar;
import com.ruiwenliu.wrapper.base.BaseBean;
import com.ruiwenliu.wrapper.weight.TitleView;
import com.rv.home.R;
import com.rv.home.R2;
import com.rv.home.rv.module.ApiConfig;
import com.rv.home.rv.module.basic.BaseStatusActivity;
import com.rv.home.rv.module.basic.presenter.PickerPresenter;
import com.yuyife.okgo.OkGoUtil;
import butterknife.BindView;
import static com.ruiwenliu.wrapper.weight.webview.SafeWebView.hasKitkat;
/**
* 押金退还进度
*/
public class DepositefundProgressDetailsActivity extends BaseStatusActivity<PickerPresenter> {
@BindView(R2.id.webView)
WebView mWebView;
@BindView(R2.id.pb_progress)
ProgressBar pbProgress;
private String webUrl;
public static Intent getIntent(Context context, String orderId) {
return new Intent(context, DepositefundProgressDetailsActivity.class)
.putExtra("orderId", orderId);
}
@Override
protected int setLayout() {
return R.layout.activity_depositefund_progress_details;
}
@Override
protected void initView(Bundle savedInstanceState, TitleView titleView, Intent intent) {
titleView.setTitle("押金退还进度");
String orderId = intent.getStringExtra("orderId");
webUrl = ApiConfig.HTTP_URL_WEBVIEW_REFUNDPROGRESS + "?orderId=" + orderId;
initWeb();
}
private void initWeb() {
WebSettings webSettings = mWebView.getSettings();
if (webSettings == null) return;
// 支持 Js 使用
webSettings.setJavaScriptEnabled(true);
// 开启DOM缓存,默认状态下是不支持LocalStorage的
webSettings.setDomStorageEnabled(true);
// 开启数据库缓存
webSettings.setDatabaseEnabled(true);
// 支持自动加载图片
webSettings.setLoadsImagesAutomatically(hasKitkat());
// 设置 WebView 的缓存模式
webSettings.setCacheMode(WebSettings.LOAD_DEFAULT);
// 支持启用缓存模式
webSettings.setAppCacheEnabled(true);
// 设置 AppCache 最大缓存值(现在官方已经不提倡使用,已废弃)
// webSettings.setAppCacheMaxSize(8 * 1024 * 1024);
// Android 私有缓存存储,如果你不调用setAppCachePath方法,WebView将不会产生这个目录
webSettings.setAppCachePath(getCacheDir().getAbsolutePath());
// 数据库路径
// if (!hasKitkat()) {
// webSettings.setDatabasePath(getDatabasePath("html").getPath());
// }
// 关闭密码保存提醒功能
// webSettings.setSavePassword(false);
// 支持缩放
webSettings.setSupportZoom(true);
// 设置 UserAgent 属性
webSettings.setUserAgentString("");
// 允许加载本地 html 文件/false
webSettings.setAllowFileAccess(true);
// 允许通过 file url 加载的 Javascript 读取其他的本地文件,Android 4.1 之前默认是true,在 Android 4.1 及以后默认是false,也就是禁止
webSettings.setAllowFileAccessFromFileURLs(true);
// 允许通过 file url 加载的 Javascript 可以访问其他的源,包括其他的文件和 http,https 等其他的源,
// Android 4.1 之前默认是true,在 Android 4.1 及以后默认是false,也就是禁止
// 如果此设置是允许,则 setAllowFileAccessFromFileURLs 不起做用
webSettings.setAllowUniversalAccessFromFileURLs(true);
mWebView.addJavascriptInterface(new AndroidJs(), "AndroidJs");
mWebView.setWebViewClient(new WebViewClient() {
@Override
public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request) {
return super.shouldOverrideUrlLoading(view, request);
}
});
mWebView.loadUrl(webUrl);
mWebView.setWebChromeClient(new WebChromeClient() {
@Override
public void onProgressChanged(WebView view, int newProgress) {
if (newProgress == 100) {
pbProgress.setVisibility(View.GONE);//加载完网页进度条消失
} else {
pbProgress.setVisibility(View.VISIBLE);//开始加载网页时显示进度条
pbProgress.setProgress(newProgress);//设置进度值
}
}
});
}
public class AndroidJs {
@JavascriptInterface
public String getToken() {
return OkGoUtil.getToken();
}
}
@Override
public void onResume() {
super.onResume();
mWebView.onResume();// 生命周期onResume
}
@Override
protected void onPause() {
super.onPause();
mWebView.onPause();//生命周期onPause
}
@Override
public void onDestroy() {
super.onDestroy();
mWebView.stopLoading();// 停止当前加载
mWebView.clearMatches();// 清除网页查找的高亮匹配字符。
mWebView.clearHistory();// 清除当前 WebView 访问的历史记录
mWebView.clearSslPreferences();//清除ssl信息
mWebView.clearCache(true);//清空网页访问留下的缓存数据。需要注意的时,由于缓存是全局的,所以只要是WebView用到的缓存都会被清空,即便其他地方也会使用到。该方法接受一个参数,从命名即可看出作用。若设为false,则只清空内存里的资源缓存,而不清空磁盘里的。
mWebView.loadUrl("about:blank");// 清空当前加载
mWebView.removeAllViews();// 清空子 View
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR2) {
mWebView.removeJavascriptInterface("AndroidNative");// 向 Web端注入 java 对象
}
// mWebView.addJavascriptInterface(new AndroidJs(),"AndroidJs");
mWebView.destroy();// 生命周期销毁
}
@Override
public void onShowResult(int requestType, BaseBean result) {
}
}
......@@ -294,10 +294,13 @@ public class OrderDetailActivity extends BaseStatusActivity<PickerPresenter> {
startActivityForResult(CancelTheTripActivity.getIntent(mActivity, no,"8"), 1);
break;
case 5:
showToast("该功能还在开发中...");
Intent intent = new Intent(Intent.ACTION_DIAL);
Uri uri = Uri.parse("tel:" + "4000369369");
intent.setData(uri);
startActivity(intent);
break;
case 6:
showToast("该功能还在开发中...");
startActivity(DepositefundProgressDetailsActivity.getIntent(mActivity,no));
break;
}
}
......
package com.rv.home.rv.module.ui.main.home.other;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.text.TextUtils;
import android.view.View;
import com.alibaba.fastjson.JSON;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.frame.rv.config.RvFrameConfig;
import com.ruiwenliu.wrapper.base.BaseBean;
import com.ruiwenliu.wrapper.weight.TitleView;
import com.rv.home.R;
import com.rv.home.R2;
import com.rv.home.rv.module.ApiConfig;
import com.rv.home.rv.module.basic.BaseStatusActivity;
import com.rv.home.rv.module.basic.presenter.CommonPresenter;
import com.rv.home.rv.module.ui.main.home.adapter.SelectItemDefaultAdapter;
import com.rv.home.rv.module.ui.main.home.adapter.SelectItemOptionalAdapter;
import com.rv.home.rv.module.ui.main.home.bean.SelectItemBean;
import com.yuyife.okgo.OkGoUtil;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import butterknife.BindView;
import butterknife.OnClick;
/**
* 选择随车物品
*/
public class SelectItemActivity extends BaseStatusActivity<CommonPresenter> {
@BindView(R2.id.rv_content_default)
RecyclerView rvContentDefault;
@BindView(R2.id.rv_content_select)
RecyclerView rvContentSelect;
private SelectItemDefaultAdapter mDefaultAdapter;
private SelectItemOptionalAdapter mOptionalAdapter;
private List<SelectItemBean.DataBean> dataBean;
private List<SelectItemBean.DataBean> selectData;
private List<SelectItemBean.DataBean> oldSelectData;
public static Intent getIntent(Context context, String selectItemList) {
return new Intent(context, SelectItemActivity.class)
.putExtra("selectitem", selectItemList);
}
@Override
protected int setLayout() {
return R.layout.activity_select_item;
}
@Override
protected void initView(Bundle savedInstanceState, TitleView titleView, Intent intent) {
titleView.setTitle("选择随车物品");
String selectitem = intent.getStringExtra("selectitem");
if (!TextUtils.isEmpty(selectitem)) {
oldSelectData = JSON.parseArray(selectitem, SelectItemBean.DataBean.class);
}
//默认随车物品
mDefaultAdapter = new SelectItemDefaultAdapter();
rvContentDefault.setLayoutManager(new GridLayoutManager(mActivity, 3));
rvContentDefault.setNestedScrollingEnabled(false);
rvContentDefault.setAdapter(mDefaultAdapter);
//可选随车物品
mOptionalAdapter = new SelectItemOptionalAdapter();
rvContentSelect.setLayoutManager(new LinearLayoutManager(mActivity, LinearLayoutManager.VERTICAL, false));
rvContentSelect.setNestedScrollingEnabled(false);
rvContentSelect.setAdapter(mOptionalAdapter);
mOptionalAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
@Override
public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
SelectItemBean.DataBean item = (SelectItemBean.DataBean) adapter.getItem(position);
if (item.isSelect()) {
item.setSelect(false);
} else {
item.setSelect(true);
}
mOptionalAdapter.notifyItemChanged(position);
}
});
}
@Override
protected void loadData(Bundle savedInstanceState, Intent intent) {
super.loadData(savedInstanceState, intent);
loadDefaultData();
loadSelectData();
}
private void loadSelectData() {
Map<String, Object> headMap = new LinkedHashMap<>();
if (OkGoUtil.getToken() != null)
headMap.put("Authorization", OkGoUtil.getToken());
Map<String, Object> map = new LinkedHashMap<>();
map.put("type", "3");
mPresenter.getData(RvFrameConfig.HOST, 1, ApiConfig.HTTP_URL_UNAUTH_TYPEITEMS, SelectItemBean.class, map, headMap, true);
}
private void loadDefaultData() {
Map<String, Object> headMap = new LinkedHashMap<>();
if (OkGoUtil.getToken() != null)
headMap.put("Authorization", OkGoUtil.getToken());
Map<String, Object> map = new LinkedHashMap<>();
map.put("type", "1,2");
mPresenter.getData(RvFrameConfig.HOST, 0, ApiConfig.HTTP_URL_UNAUTH_TYPEITEMS, SelectItemBean.class, map, headMap, true);
}
@Override
public void onShowResult(int requestType, BaseBean result) {
switch (requestType) {
case 0:
setDefaultData((SelectItemBean) result);
break;
case 1:
setSelectData((SelectItemBean) result);
break;
}
}
private void setSelectData(SelectItemBean bean) {
dataBean = bean.getData();
if (oldSelectData != null && oldSelectData.size() > 0 && dataBean != null && dataBean.size() > 0) {
for (int i = 0; i < oldSelectData.size(); i++) {
for (int j = 0; j < dataBean.size(); j++) {
if (dataBean.get(j).getId().equals(oldSelectData.get(i).getId())) {
dataBean.get(j).setSelect(true);
break;
}
}
}
}
mOptionalAdapter.addData(dataBean);
}
private void setDefaultData(SelectItemBean bean) {
mDefaultAdapter.addData(bean.getData());
}
@OnClick(R2.id.btn_item_ok)
public void onViewClicked(View v) {
int id = v.getId();
if (id == R.id.btn_item_ok) {
resultData();
getIntent().putExtra("selectItem", JSON.toJSONString(selectData));
setResult(RESULT_OK, getIntent());
finish();
}
}
private void resultData() {
selectData = new ArrayList<>();
if (dataBean != null && dataBean.size() > 0) {
for (int i = 0; i < dataBean.size(); i++) {
if (dataBean.get(i).isSelect()) {
selectData.add(dataBean.get(i));
}
}
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".rv.module.ui.main.home.order.DepositefundProgressDetailsActivity">
<ProgressBar
android:id="@+id/pb_progress"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="match_parent"
android:layout_height="@dimen/size_3"
android:indeterminateOnly="false"
android:max="100"
android:progressDrawable="@drawable/shape_rv_bg_yellow_progress"
android:visibility="gone"></ProgressBar>
<WebView
android:id="@+id/webView"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="@color/colorLine"
tools:context=".rv.module.ui.main.home.other.SelectItemActivity">
<android.support.v4.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/colorWrite"
android:layout_marginBottom="@dimen/size_15"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="@dimen/size_50"
android:layout_marginLeft="@dimen/size_15"
android:gravity="center_vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="默认随车物品"
android:textColor="@color/colorMain"
android:textSize="@dimen/text_14" />
</LinearLayout>
<include layout="@layout/common_line" />
<android.support.v7.widget.RecyclerView
android:id="@+id/rv_content_default"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/size_15"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/colorWrite"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="@dimen/size_50"
android:gravity="center_vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/size_15"
android:text="可选随车物品"
android:textColor="@color/colorMain"
android:textSize="@dimen/text_14" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="(部分物品损坏或遗失需按价赔偿)"
android:textColor="@color/text_Gray"
android:textSize="@dimen/text_12" />
</LinearLayout>
<android.support.v7.widget.RecyclerView
android:id="@+id/rv_content_select"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
</LinearLayout>
</android.support.v4.widget.NestedScrollView>
<LinearLayout
android:background="@color/colorWrite"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<include layout="@layout/common_line"/>
<Button
android:id="@+id/btn_item_ok"
android:layout_width="match_parent"
android:layout_height="@dimen/size_50"
android:layout_marginLeft="@dimen/size_15"
android:layout_marginTop="@dimen/size_10"
android:layout_marginRight="@dimen/size_15"
android:layout_marginBottom="@dimen/size_10"
android:background="@drawable/shape_rv_bg_shallow_dark_yellow_circle"
android:text="确定"
android:textColor="@color/colorWrite"
android:textSize="@dimen/text_16" />
</LinearLayout>
</LinearLayout>
\ No newline at end of file
......@@ -95,7 +95,7 @@
android:textSize="@dimen/text_14"
android:gravity="center"
android:id="@+id/tv_appointment"
android:background="@color/colorAuxiliaryYellow"
android:background="@color/gray_FFB74B"
android:textColor="@color/colorWrite"
android:text="@string/rv_to_appointment"
/>
......
......@@ -65,12 +65,12 @@
android:id="@+id/rating_bar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:isClick="true"
app:starCount="5"
app:starDistance="3dp"
app:starEmpty="@drawable/rv_vehicle_icon_star_gray"
app:starFill="@drawable/rv_vehicle_icon_star_light"
app:starDistance="3dp"
app:starCount="5"
app:isClick ="true"
app:starSize="@dimen/size_12"/>
app:starSize="@dimen/size_12" />
<TextView
android:id="@+id/tv_price"
......@@ -277,16 +277,21 @@
android:paddingBottom="@dimen/size_15"
android:text="@string/rv_driving_set"
android:textColor="@color/textMain"
android:textSize="@dimen/text_16" />
android:textSize="@dimen/text_16"
android:visibility="gone" />
<include layout="@layout/common_line" />
<include
layout="@layout/common_line"
android:visibility="gone" />
<LinearLayout
android:id="@+id/ll_item_xin_driving"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal">
android:orientation="horizontal"
android:visibility="gone">
<CheckBox
android:id="@+id/rb_xin_driving"
android:layout_width="wrap_content"
......@@ -303,19 +308,21 @@
android:id="@+id/tv_xin_driving_price"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="@dimen/text_14"
android:text="(¥600/天)"
android:textColor="@color/colorBg"
android:text="(¥600/天)"/>
android:textSize="@dimen/text_14" />
</LinearLayout>
<include layout="@layout/common_line" />
<include
layout="@layout/common_line"
android:visibility="gone" />
<LinearLayout
android:id="@+id/ll_item_driver_add"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/size_15"
android:gravity="center_vertical"
android:orientation="horizontal">
......@@ -328,17 +335,19 @@
android:button="@drawable/selector_rv_check"
android:paddingLeft="@dimen/size_10"
android:text="@string/rv_user_driving"
android:textSize="@dimen/text_14" />
android:textSize="@dimen/text_14"
android:visibility="gone" />
<TextView
android:id="@+id/tv_user_driving_hint"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/rv_user_driving_hint"
android:textColor="@color/textGray"
android:layout_marginLeft="@dimen/size_15"
android:layout_marginRight="@dimen/size_20"
android:textSize="@dimen/text_12" />
android:layout_weight="1"
android:text="添加驾驶人"
android:textColor="@color/colorMain"
android:textSize="@dimen/text_16" />
<ImageView
android:id="@+id/iv_add_driving"
......@@ -346,9 +355,9 @@
android:layout_height="@dimen/size_25"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:padding="@dimen/size_3"
android:paddingLeft="@dimen/size_15"
android:paddingRight="@dimen/size_15"
android:padding="@dimen/size_3"
android:src="@drawable/rv_common_icon_thestaff" />
</LinearLayout>
</LinearLayout>
......@@ -439,8 +448,8 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/colorWrite"
android:layout_marginBottom="@dimen/size_15"
android:background="@color/colorWrite"
android:orientation="vertical">
<RelativeLayout
......@@ -508,18 +517,18 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/size_15"
android:layout_marginBottom="@dimen/size_10"
android:text="租车期间服务费"
android:textColor="@color/textGray"
android:textSize="@dimen/text_10"
android:visibility="gone"
android:layout_marginBottom="@dimen/size_10"
android:text="租车期间服务费" />
android:visibility="gone" />
<View
android:layout_width="match_parent"
android:layout_height="@dimen/size_half"
android:layout_marginLeft="@dimen/size_15"
android:layout_marginRight="@dimen/size_15"
android:background="@color/colorLine"/>
android:background="@color/colorLine" />
<LinearLayout
......@@ -551,38 +560,38 @@
</LinearLayout>
<LinearLayout
android:visibility="gone"
android:id="@+id/ll_layout_clean_fee"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/size_15"
android:layout_marginRight="@dimen/size_15"
android:orientation="vertical">
android:orientation="vertical"
android:visibility="gone">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="@dimen/text_10"
android:text="车辆清洁费"
android:textColor="@color/colorMain"
android:text="车辆清洁费"/>
android:textSize="@dimen/text_10" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/size_5"
android:text="1. 已含100元车辆清洁费(含车辆外观、内饰等的清洁费用), 保证取车时车辆 干净整洁;"
android:textColor="@color/textGray"
android:textSize="@dimen/text_10"
android:text="1. 已含100元车辆清洁费(含车辆外观、内饰等的清洁费用), 保证取车时车辆 干净整洁;" />
android:textSize="@dimen/text_10" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/size_5"
android:textColor="@color/textGray"
android:textSize="@dimen/text_10"
android:layout_marginBottom="@dimen/size_10"
android:text="2. 还车时,因客户原因,出现以下情形的:\n a.黑水箱未清理或移动马桶有污渍;\n b.冰箱未清理或有污渍;\n c.床垫有明显新增污渍,每项加收100元清洁服务费。" />
android:text="2. 还车时,因客户原因,出现以下情形的:\n a.黑水箱未清理或移动马桶有污渍;\n b.冰箱未清理或有污渍;\n c.床垫有明显新增污渍,每项加收100元清洁服务费。"
android:textColor="@color/textGray"
android:textSize="@dimen/text_10" />
</LinearLayout>
<View
......@@ -590,7 +599,7 @@
android:layout_height="@dimen/size_half"
android:layout_marginLeft="@dimen/size_15"
android:layout_marginRight="@dimen/size_15"
android:background="@color/colorLine"/>
android:background="@color/colorLine" />
<RelativeLayout
android:layout_width="match_parent"
......@@ -638,20 +647,21 @@
android:layout_marginLeft="@dimen/size_15"
android:layout_marginBottom="@dimen/size_10"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="不计免赔服务 "
android:textColor="@color/colorMain"
android:textSize="@dimen/text_10"
android:text="不计免赔服务 "/>
android:textSize="@dimen/text_10" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="@dimen/text_10"
android:layout_marginTop="@dimen/size_5"
android:text="如在租赁期间内购买购买不计免赔服务,则1500元本车车辆损伤无需赔偿。"
android:textColor="@color/textGray"
android:text="如在租赁期间内购买购买不计免赔服务,则1500元本车车辆损伤无需赔偿。"/>
android:textSize="@dimen/text_10" />
</LinearLayout>
</LinearLayout>
......@@ -669,17 +679,17 @@
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/size_15"
android:text="会员特权"
android:visibility="gone"
android:textColor="@color/colorMain"
android:textSize="@dimen/text_16" />
android:textSize="@dimen/text_16"
android:visibility="gone" />
<LinearLayout
android:id="@+id/ll_layout_member_hint"
android:layout_width="match_parent"
android:layout_height="@dimen/size_50"
android:visibility="visible"
android:gravity="center_vertical"
android:orientation="horizontal">
android:orientation="horizontal"
android:visibility="visible">
<TextView
android:layout_width="wrap_content"
......@@ -733,10 +743,56 @@
android:textColor="@color/gray_FFB74B"
android:textSize="@dimen/text_14" />
</RelativeLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/size_15"
android:background="@color/colorWrite"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="@dimen/size_15"
android:paddingRight="@dimen/size_15"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:id="@+id/tv_item_caritem"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawableRight="@drawable/rv_common_icon_notice"
android:drawablePadding="@dimen/size_5"
android:text="随车物品"
android:textColor="@color/colorMain"
android:textSize="@dimen/text_16" />
<TextView
android:id="@+id/tv_item_select_caritem"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/size_10"
android:paddingTop="@dimen/size_15"
android:paddingBottom="@dimen/size_15"
android:gravity="right"
android:drawableRight="@drawable/common_icon_rig_gray"
android:drawablePadding="@dimen/size_5"
android:text="选择"
android:textColor="@color/text_Gray"
android:textSize="@dimen/text_10" />
</LinearLayout>
<com.rv.component.control.FlowLayout
android:id="@+id/rv_content_select"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
<RelativeLayout
android:layout_width="match_parent"
......@@ -844,7 +900,7 @@
android:id="@+id/tv_confirm_order"
android:layout_width="@dimen/size_100"
android:layout_height="match_parent"
android:background="@color/colorAuxiliaryYellow"
android:background="@color/gray_FFB74B"
android:gravity="center"
android:text="@string/rv_confirm_order"
android:textColor="@color/colorWrite" />
......
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<TextView
android:id="@+id/tv_article_content"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:singleLine="true"
android:textSize="@dimen/text_14"
android:layout_marginLeft="@dimen/size_15"
android:layout_marginTop="@dimen/size_20"
android:textColor="@color/textGray"
android:text="牙膏*2支"/>
</LinearLayout>
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<include layout="@layout/common_line" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="@dimen/size_50">
<TextView
android:id="@+id/tv_article_content"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="@dimen/size_15"
android:text="帐篷"
android:textColor="@color/colorMain"
android:textSize="@dimen/text_14" />
<ImageView
android:id="@+id/iv_select"
android:layout_width="@dimen/size_20"
android:layout_height="@dimen/size_20"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_gravity="center_vertical|right"
android:layout_marginLeft="@dimen/size_10"
android:layout_marginRight="@dimen/size_15"
android:src="@drawable/selector_rv_icon_mark" />
</RelativeLayout>
</LinearLayout>
<?xml version="1.0" encoding="utf-8"?>
<com.rv.component.control.FlowLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto"
app:flFlow="true"
app:flChildSpacing="auto"
app:flChildSpacingForLastRow="align">
<TextView
android:id="@+id/tv_article_content"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="@dimen/text_12"
android:layout_marginLeft="@dimen/size_15"
android:layout_marginTop="@dimen/size_10"
android:textColor="@color/textGray"
android:text="牙膏*2支"/>
</com.rv.component.control.FlowLayout>
......@@ -19,6 +19,7 @@ import android.widget.TextView;
import com.alibaba.android.arouter.launcher.ARouter;
import com.alibaba.fastjson.JSON;
import com.base.utils.tools.android.IntentUtil;
import com.base.utils.ui.datetime.selector.util.TextUtil;
import com.base.utils.ui.image.round.RoundImageView;
import com.frame.base.bus.LoginSuccessfulEvent;
import com.frame.base.bus.Observer;
......@@ -31,6 +32,7 @@ import com.frame.rv.config.RvFrameConfig;
import com.ruiwenliu.wrapper.SPConstance;
import com.ruiwenliu.wrapper.base.BaseBean;
import com.ruiwenliu.wrapper.base.BaseFragment;
import com.ruiwenliu.wrapper.bean.BeanUserInfo;
import com.ruiwenliu.wrapper.bean.UserInfoBean;
import com.ruiwenliu.wrapper.browse.ActivityImageBrowseInt;
import com.ruiwenliu.wrapper.statusbar.StatusBarUtil;
......@@ -165,6 +167,16 @@ public class MineFragment extends BaseFragment<CommonPresenter> implements Simpl
tvViewPrivileges.setText("查看会员特权");
mSimpleRefreshLayout.setPullDownEnable(true);
}
String spStringCode = UtilsManager.getInstance(OkGoUtil.application).getSPStringCode(SPConstance.USER_JSON, SPConstance.USER_JSON_USERINFO);
if (!TextUtil.isEmpty(spStringCode)) {
UserInfoBean.UserInfo userInfo = JSON.parseObject(spStringCode, UserInfoBean.UserInfo.class);
GlideManager.getInstance(_mActivity).loadImage(userInfo.getHeadimgurl(), ivAvatar);
tvNickname.setText(userInfo.getNickname());
setMember(userInfo);
}
}
private void initRefresh() {
......@@ -517,24 +529,7 @@ public class MineFragment extends BaseFragment<CommonPresenter> implements Simpl
}
if (0 == info.getIsMember()) {
tvMembershipLevel.setText("会员特权");
tvMemberHint.setText("免费用车- -天");
tvMember.setText("普通用户");
} else if (1 == info.getIsMember()) {
if (1 == info.getMemberLevel()) { //1 普通会员 2 黄金会员 3 钻石会员
tvMembershipLevel.setText(" 普通会员特权");
tvMember.setText("普通会员");
} else if (2 == info.getMemberLevel()) {
tvMembershipLevel.setText("黄金会员特权");
tvMember.setText("黄金会员");
} else if (3 == info.getMemberLevel()) {
tvMembershipLevel.setText("钻石会员特权");
tvMember.setText("钻石会员");
}
tvMemberHint.setText("免费用车" + info.getRentFreeDays() + "天");
}
setMember(info);
}
if (TextUtils.isEmpty(OkGoUtil.getToken())) {
......@@ -554,6 +549,26 @@ public class MineFragment extends BaseFragment<CommonPresenter> implements Simpl
}
}
private void setMember(UserInfoBean.UserInfo infos) {
if (0 == infos.getIsMember()) {
tvMembershipLevel.setText("会员特权");
tvMemberHint.setText("免费用车- -天");
tvMember.setText("普通用户");
} else if (1 == infos.getIsMember()) {
if (1 == infos.getMemberLevel()) { //1 普通会员 2 黄金会员 3 钻石会员
tvMembershipLevel.setText(" 普通会员特权");
tvMember.setText("普通会员");
} else if (2 == infos.getMemberLevel()) {
tvMembershipLevel.setText("黄金会员特权");
tvMember.setText("黄金会员");
} else if (3 == infos.getMemberLevel()) {
tvMembershipLevel.setText("钻石会员特权");
tvMember.setText("钻石会员");
}
tvMemberHint.setText("免费用车" + infos.getRentFreeDays() + "天");
}
}
@Override
public void onRefresh() {
......
......@@ -192,13 +192,6 @@ public class PersonalInformationActivity extends BaseStatusActivity<PickerPresen
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// TODO: add setContentView(...) invocation
ButterKnife.bind(this);
}
@OnClick({R2.id.rl_item_avatar, R2.id.ll_item_date_of_birth, R2.id.ll_item_sex, R2.id.ll_item_binding_qq, R2.id.ll_item_binding_wechat})
public void onViewClicked(View view) {
int id = view.getId();
......
......@@ -6,7 +6,8 @@
android:background="@color/colorLine"
android:orientation="vertical">
<com.ruiwenliu.wrapper.weight.refresh.SimpleRefreshLayout xmlns:android="http://schemas.android.com/apk/res/android"
<com.ruiwenliu.wrapper.weight.refresh.SimpleRefreshLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/refresh"
android:layout_width="match_parent"
android:layout_height="match_parent">
......@@ -48,19 +49,19 @@
android:orientation="horizontal">
<ImageView
android:id="@+id/iv_item_setting"
android:id="@+id/iv_item_message"
android:layout_width="@dimen/size_35"
android:layout_height="@dimen/size_35"
android:padding="@dimen/size_8"
android:src="@drawable/mycenter_icon_setting" />
android:src="@drawable/mycenter_icon_message" />
<ImageView
android:id="@+id/iv_item_message"
android:id="@+id/iv_item_setting"
android:layout_width="@dimen/size_35"
android:layout_height="@dimen/size_35"
android:layout_alignParentRight="true"
android:padding="@dimen/size_8"
android:src="@drawable/mycenter_icon_message" />
android:src="@drawable/mycenter_icon_setting" />
</RelativeLayout>
</com.ruiwenliu.wrapper.statusbar.StatusBarHeightView>
</LinearLayout>
......
......@@ -409,6 +409,18 @@ public class TravelDetailsActivity extends BaseStatusActivity<TourismPresenter>
}
@JavascriptInterface
public void hideButton() {
mWebView.post(new Runnable() {
@Override
public void run() {
llItemBottom.setVisibility(View.GONE);
}
});
}
@JavascriptInterface
public void tourStock(int num) {
if (num > 0) {
......
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