Commit f3f1bc8a authored by jianglx's avatar jianglx

1 添加了删除出游人功能;

2 确认订单页,会员不能选择免费使用;
3 缺少购买会员订单详情,且页面应该没有“押金信息”按钮;
4 添加出游人,点击2次保存,保存了2条数据
5 未选择驾驶人信息,就可以下单
6 控件的免费用车天数不合理
7 会员中心的《会员服务协议会员规则》不能点击查看,
parent 5db54a31
...@@ -46,6 +46,7 @@ public class ApiConfig { ...@@ -46,6 +46,7 @@ public class ApiConfig {
public static String HTTP_URL_CERTIFICATE = RvFrameConfig.VEHICLE_UPLOAD + "certif/app/certificate";//实名认证 public static String HTTP_URL_CERTIFICATE = RvFrameConfig.VEHICLE_UPLOAD + "certif/app/certificate";//实名认证
public static String HTTP_URL_UPUSER_EDIT = RvFrameConfig.ADMIN_POST + "app/user/edit";//更新用户信息 public static String HTTP_URL_UPUSER_EDIT = RvFrameConfig.ADMIN_POST + "app/user/edit";//更新用户信息
public static String HTTP_URL_GETTOURUSERLIST = RvFrameConfig.VEHICLE_TOURUSER + "tourUser/app/unauth/getTourUserList";//获得全部出游人信息 public static String HTTP_URL_GETTOURUSERLIST = RvFrameConfig.VEHICLE_TOURUSER + "tourUser/app/unauth/getTourUserList";//获得全部出游人信息
public static String HTTP_URL_DELETEDRIVER = RvFrameConfig.VEHICLE_TOURUSER + "tourUser/app/del"; // 删除出游人
public static String HTTP_URL_ADDANDUPDATE = RvFrameConfig.VEHICLE_TOURUSER + "tourUser/app/addAndUpdate";//添加和更新出游人信息 public static String HTTP_URL_ADDANDUPDATE = RvFrameConfig.VEHICLE_TOURUSER + "tourUser/app/addAndUpdate";//添加和更新出游人信息
public static String HTTP_URL_CAR_TYPE_NOTICE = RvFrameConfig.HOST + "/h5/appHtml/view/notice.html";//预定须知 public static String HTTP_URL_CAR_TYPE_NOTICE = RvFrameConfig.HOST + "/h5/appHtml/view/notice.html";//预定须知
...@@ -66,4 +67,6 @@ public class ApiConfig { ...@@ -66,4 +67,6 @@ public class ApiConfig {
public static String HTTP_URL_VERSION_CHECK = "/api/app/version/app/unauth/info?version=%s"; // 检测版本 public static String HTTP_URL_VERSION_CHECK = "/api/app/version/app/unauth/info?version=%s"; // 检测版本
public static String HTTP_URL_FIND_BANNERLIST = RvFrameConfig.HOST + "/api/app/banner/app/unauth/findBannerlist"; // banner图接口 public static String HTTP_URL_FIND_BANNERLIST = RvFrameConfig.HOST + "/api/app/banner/app/unauth/findBannerlist"; // banner图接口
public static String HTTP_URL_EFFECTIVE_TIME = RvFrameConfig.VEHICLE_ORDER + "/baseOrder/app/unauth/getOrderParam" ; // 获取订单失效时间
} }
...@@ -17,6 +17,7 @@ import android.widget.LinearLayout; ...@@ -17,6 +17,7 @@ import android.widget.LinearLayout;
import android.widget.PopupWindow; import android.widget.PopupWindow;
import android.widget.RatingBar; import android.widget.RatingBar;
import android.widget.TextView; import android.widget.TextView;
import android.widget.Toast;
import com.alibaba.android.arouter.launcher.ARouter; import com.alibaba.android.arouter.launcher.ARouter;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
...@@ -142,7 +143,7 @@ public class ConfirmOrderActivity extends BaseStatusActivity<CommonPresenter> { ...@@ -142,7 +143,7 @@ public class ConfirmOrderActivity extends BaseStatusActivity<CommonPresenter> {
private OrderDataBean dataBean; private OrderDataBean dataBean;
private CarTypeListBean.DataBeanX.DataBean mCarBean; private CarTypeListBean.DataBeanX.DataBean mCarBean;
private DrivingListBean.DataBeanX.DataBean drivingListBean; private DrivingListBean.DataBeanX.DataBean drivingListBean;
private int drivingType ;//驾驶证类型1、欣新驾驶员2、自驾 private int drivingType = 0;//驾驶证类型1、欣新驾驶员2、自驾
private OrderPriceDetailPw detailPw;//显示订单价格明细弹窗 private OrderPriceDetailPw detailPw;//显示订单价格明细弹窗
private OrderPriceDetailBean orderPriceDetailBean;//订单价格明细实体类 private OrderPriceDetailBean orderPriceDetailBean;//订单价格明细实体类
private IWXAPI api; private IWXAPI api;
...@@ -257,7 +258,7 @@ public class ConfirmOrderActivity extends BaseStatusActivity<CommonPresenter> { ...@@ -257,7 +258,7 @@ 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, @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.tv_detail, R2.id.tv_confirm_order, R2.id.tv_delete, R2.id.rb_xin_driving,
R2.id.rb_user_driving, R2.id.tv_contract_agreement, R2.id.tv_service_fee_show, R2.id.tv_vehicle_cleaning_fee_show, R2.id.rb_user_driving, 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.tv_lab3, R2.id.tv_deposit_hint, R2.id.tv_privilege_service_hint, R2.id.tv_booking_instructions_hint})
public void onViewClicked(View view) { public void onViewClicked(View view) {
int i = view.getId(); int i = view.getId();
if (i == R.id.rl_goods) { if (i == R.id.rl_goods) {
...@@ -315,26 +316,26 @@ public class ConfirmOrderActivity extends BaseStatusActivity<CommonPresenter> { ...@@ -315,26 +316,26 @@ public class ConfirmOrderActivity extends BaseStatusActivity<CommonPresenter> {
deductiblePriceType = 0; deductiblePriceType = 0;
} }
getPayMoney(); getPayMoney();
}else if (i == R.id.tv_deposit_hint){ } else if (i == R.id.tv_deposit_hint) {
//欣新平台租车押金 //欣新平台租车押金
ARouter.getInstance().build(Constance.ACTIVITY_URL_WEBVIEW) ARouter.getInstance().build(Constance.ACTIVITY_URL_WEBVIEW)
.withString("title","欣新平台租车押金") .withString("title", "欣新平台租车押金")
.withString("url",ApiConfig.HTTP_URL_CAR_TYPE_NOTICE) .withString("url", ApiConfig.HTTP_URL_CAR_TYPE_NOTICE)
.withInt("type",4) .withInt("type", 4)
.navigation(); .navigation();
}else if (i == R.id.tv_privilege_service_hint){ } else if (i == R.id.tv_privilege_service_hint) {
//尊享服务 //尊享服务
ARouter.getInstance().build(Constance.ACTIVITY_URL_WEBVIEW) ARouter.getInstance().build(Constance.ACTIVITY_URL_WEBVIEW)
.withString("title","尊享服务") .withString("title", "尊享服务")
.withString("url",ApiConfig.HTTP_URL_CAR_TYPE_NOTICE) .withString("url", ApiConfig.HTTP_URL_CAR_TYPE_NOTICE)
.withInt("type",5) .withInt("type", 5)
.navigation(); .navigation();
}else if (i == R.id.tv_booking_instructions_hint){ } else if (i == R.id.tv_booking_instructions_hint) {
//预订须知 //预订须知
ARouter.getInstance().build(Constance.ACTIVITY_URL_WEBVIEW) ARouter.getInstance().build(Constance.ACTIVITY_URL_WEBVIEW)
.withString("title","预订须知") .withString("title", "预订须知")
.withString("url",ApiConfig.HTTP_URL_CAR_TYPE_NOTICE) .withString("url", ApiConfig.HTTP_URL_CAR_TYPE_NOTICE)
.withInt("type",2) .withInt("type", 2)
.navigation(); .navigation();
} }
} }
...@@ -343,6 +344,12 @@ public class ConfirmOrderActivity extends BaseStatusActivity<CommonPresenter> { ...@@ -343,6 +344,12 @@ public class ConfirmOrderActivity extends BaseStatusActivity<CommonPresenter> {
* 确定订单 * 确定订单
*/ */
private void confirmOrder() { private void confirmOrder() {
if (drivingType == 0) {
showToast("未选择驾驶人");
return;
}
if (drivingType == 2 && drivingListBean == null) { if (drivingType == 2 && drivingListBean == null) {
showToast(mActivity.getString(R.string.rv_add_driving_toast)); showToast(mActivity.getString(R.string.rv_add_driving_toast));
return; return;
...@@ -356,7 +363,7 @@ public class ConfirmOrderActivity extends BaseStatusActivity<CommonPresenter> { ...@@ -356,7 +363,7 @@ public class ConfirmOrderActivity extends BaseStatusActivity<CommonPresenter> {
@Override @Override
public void helper(final ViewHolder helper) { public void helper(final ViewHolder helper) {
super.helper(helper); super.helper(helper);
helper.setText(R.id.tv_amount,tvPayMoney.getText().toString()); helper.setText(R.id.tv_amount, tvPayMoney.getText().toString());
helper.setOnClickListener(new View.OnClickListener() { helper.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
...@@ -408,7 +415,7 @@ public class ConfirmOrderActivity extends BaseStatusActivity<CommonPresenter> { ...@@ -408,7 +415,7 @@ public class ConfirmOrderActivity extends BaseStatusActivity<CommonPresenter> {
map.put("startTime", dataBean.getStartTime()); map.put("startTime", dataBean.getStartTime());
map.put("endTime", dataBean.getEndTime()); map.put("endTime", dataBean.getEndTime());
map.put("dayNum", dataBean.getDayNum()); map.put("dayNum", dataBean.getDayNum());
mPresenter.getData(RvFrameConfig.VEHICLE_ORDER, 0, ApiConfig.HTTP_URL_GET_ORDER_PRICE, OrderPriceBean.class, map,headMap, true); mPresenter.getData(RvFrameConfig.VEHICLE_ORDER, 0, ApiConfig.HTTP_URL_GET_ORDER_PRICE, OrderPriceBean.class, map, headMap, true);
} }
/** /**
...@@ -471,32 +478,32 @@ public class ConfirmOrderActivity extends BaseStatusActivity<CommonPresenter> { ...@@ -471,32 +478,32 @@ public class ConfirmOrderActivity extends BaseStatusActivity<CommonPresenter> {
* 支付价格计算 * 支付价格计算
*/ */
private void getPayMoney() { private void getPayMoney() {
if (priceBean !=null && priceBean.getData() ==null){ if (priceBean != null && priceBean.getData() == null) {
return; return;
} }
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();
int dayNum = dataBean.getDayNum(); int dayNum = dataBean.getDayNum();
if (isMemberType ==0) { //是否使用会员 0 不使用 if (isMemberType == 0) { //是否使用会员 0 不使用
payMoney = dayPrice * dayNum + priceBean.getData().getDeposit(); //租车和押金价格 payMoney = dayPrice * dayNum + priceBean.getData().getDeposit(); //租车和押金价格
OrderPriceDetailBean.ChildrenBean childrenBean2 = new OrderPriceDetailBean.ChildrenBean(); OrderPriceDetailBean.ChildrenBean childrenBean2 = new OrderPriceDetailBean.ChildrenBean();
childrenBean2.setKey("车辆租赁费"); childrenBean2.setKey("车辆租赁费");
childrenBean2.setDetail("¥"+ dayPrice +"/天 *"+dayNum +"天" ); childrenBean2.setDetail("¥" + dayPrice + "/天 *" + dayNum + "天");
childrenBean2.setVal("¥" + dayPrice * dayNum); childrenBean2.setVal("¥" + dayPrice * dayNum);
childrenBeanList.add(childrenBean2); childrenBeanList.add(childrenBean2);
}else { } else {
if (info !=null){ if (info != null) {
if (dayNum >info.getRentFreeDays()){ if (dayNum > info.getRentFreeDays()) {
payMoney = dayPrice *(dayNum -info.getRentFreeDays()) + priceBean.getData().getDeposit(); payMoney = dayPrice * (dayNum - info.getRentFreeDays()) + priceBean.getData().getDeposit();
OrderPriceDetailBean.ChildrenBean childrenBean1 = new OrderPriceDetailBean.ChildrenBean(); OrderPriceDetailBean.ChildrenBean childrenBean1 = new OrderPriceDetailBean.ChildrenBean();
childrenBean1.setKey("车辆租赁费"); childrenBean1.setKey("车辆租赁费");
childrenBean1.setDetail("¥"+ dayPrice +"/天 *"+ (dayNum -info.getRentFreeDays()) +"天" ); childrenBean1.setDetail("¥" + dayPrice + "/天 *" + (dayNum - info.getRentFreeDays()) + "天");
childrenBean1.setVal("¥" + dayPrice *(dayNum -info.getRentFreeDays())); childrenBean1.setVal("¥" + dayPrice * (dayNum - info.getRentFreeDays()));
childrenBeanList.add(childrenBean1); childrenBeanList.add(childrenBean1);
}else if (dayNum <= info.getRentFreeDays()){ } else if (dayNum <= info.getRentFreeDays()) {
payMoney = priceBean.getData().getDeposit(); payMoney = priceBean.getData().getDeposit();
} }
} }
} }
...@@ -504,16 +511,16 @@ public class ConfirmOrderActivity extends BaseStatusActivity<CommonPresenter> { ...@@ -504,16 +511,16 @@ public class ConfirmOrderActivity extends BaseStatusActivity<CommonPresenter> {
payMoney = payMoney + priceBean.getData().getDriverAmount(); // + 专职司机 payMoney = payMoney + priceBean.getData().getDriverAmount(); // + 专职司机
OrderPriceDetailBean.ChildrenBean childrenBean3 = new OrderPriceDetailBean.ChildrenBean(); OrderPriceDetailBean.ChildrenBean childrenBean3 = new OrderPriceDetailBean.ChildrenBean();
childrenBean3.setKey("专职司机服务费"); childrenBean3.setKey("专职司机服务费");
childrenBean3.setDetail("¥"+ priceBean.getData().getDriverPrice() +"/天 *"+dayNum +"天" ); childrenBean3.setDetail("¥" + priceBean.getData().getDriverPrice() + "/天 *" + dayNum + "天");
childrenBean3.setVal("¥" + priceBean.getData().getDriverAmount()); childrenBean3.setVal("¥" + priceBean.getData().getDriverAmount());
childrenBeanList.add(childrenBean3); childrenBeanList.add(childrenBean3);
} }
if (deductiblePriceType ==1){ if (deductiblePriceType == 1) {
payMoney = payMoney +priceBean.getData().getDamageSafePrice() * dayNum; //+免赔付价格 payMoney = payMoney + priceBean.getData().getDamageSafePrice() * dayNum; //+免赔付价格
OrderPriceDetailBean.ChildrenBean childrenBean4 = new OrderPriceDetailBean.ChildrenBean(); OrderPriceDetailBean.ChildrenBean childrenBean4 = new OrderPriceDetailBean.ChildrenBean();
childrenBean4.setKey("车损免赔费"); childrenBean4.setKey("车损免赔费");
childrenBean4.setDetail("¥"+ priceBean.getData().getDamageSafePrice() +"/天 *"+dayNum +"天" ); childrenBean4.setDetail("¥" + priceBean.getData().getDamageSafePrice() + "/天 *" + dayNum + "天");
childrenBean4.setVal("¥" + priceBean.getData().getDamageSafePrice() * dayNum); childrenBean4.setVal("¥" + priceBean.getData().getDamageSafePrice() * dayNum);
childrenBeanList.add(childrenBean4); childrenBeanList.add(childrenBean4);
} }
...@@ -524,7 +531,7 @@ public class ConfirmOrderActivity extends BaseStatusActivity<CommonPresenter> { ...@@ -524,7 +531,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("¥" + priceBean.getData().getDeposit());
childrenBeanList.add(childrenBean); childrenBeanList.add(childrenBean);
orderPriceDetailBean.setChildren(childrenBeanList); orderPriceDetailBean.setChildren(childrenBeanList);
} }
......
package com.rv.home.rv.module.ui.main.home.bean;
import com.ruiwenliu.wrapper.base.BaseBean;
public class EffectiveTimeBean extends BaseBean {
private EffectiveData data;
private boolean rel;
public EffectiveData getData() {
return data;
}
public void setData(EffectiveData data) {
this.data = data;
}
public boolean isRel() {
return rel;
}
public void setRel(boolean rel) {
this.rel = rel;
}
public static class EffectiveData {
private float insurePrice;
private long actRent;
private long actTour;
public float getInsurePrice() {
return insurePrice;
}
public void setInsurePrice(float insurePrice) {
this.insurePrice = insurePrice;
}
public long getActRent() {
return actRent;
}
public void setActRent(long actRent) {
this.actRent = actRent;
}
public long getActTour() {
return actTour;
}
public void setActTour(long actTour) {
this.actTour = actTour;
}
}
}
...@@ -77,10 +77,12 @@ public class AllOrderFragment extends BaseFragment<CommonPresenter> implements B ...@@ -77,10 +77,12 @@ public class AllOrderFragment extends BaseFragment<CommonPresenter> implements B
@Override @Override
public void onItemClick(BaseQuickAdapter adapter, View view, int position) { public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
OrderListBean.DataBeanX.DataBean dataBean = (OrderListBean.DataBeanX.DataBean) adapter.getItem(position); OrderListBean.DataBeanX.DataBean dataBean = (OrderListBean.DataBeanX.DataBean) adapter.getItem(position);
if (1 ==dataBean.getType()) { if (1 == dataBean.getType()) {
startActivityForResult(OrderDetailActivity.getIntent(_mActivity, dataBean), 1); startActivityForResult(OrderDetailActivity.getIntent(_mActivity, dataBean), 1);
}else if (2== dataBean.getType()){ } else if (2 == dataBean.getType()) {
startActivityForResult(TravelOrderDetailsActivity.getIntent(_mActivity, dataBean), 2); startActivityForResult(TravelOrderDetailsActivity.getIntent(_mActivity, dataBean), 2);
} else if (3 == dataBean.getType()) {
startActivityForResult(TravelOrderDetailsActivity.getIntent(_mActivity, dataBean),3);
} }
} }
}); });
...@@ -92,32 +94,32 @@ public class AllOrderFragment extends BaseFragment<CommonPresenter> implements B ...@@ -92,32 +94,32 @@ public class AllOrderFragment extends BaseFragment<CommonPresenter> implements B
int id = view.getId(); int id = view.getId();
OrderListBean.DataBeanX.DataBean dataBean = (OrderListBean.DataBeanX.DataBean) adapter.getItem(position); OrderListBean.DataBeanX.DataBean dataBean = (OrderListBean.DataBeanX.DataBean) adapter.getItem(position);
// 0–删除 1–创建订单 2–取消 3–待付款 4–待出行 5–出行中(进行中) 6–已完成 // 0–删除 1–创建订单 2–取消 3–待付款 4–待出行 5–出行中(进行中) 6–已完成
switch (dataBean.getStatusX()){ switch (dataBean.getStatusX()) {
case 3: case 3:
if (id == R.id.tv_process){ if (id == R.id.tv_process) {
payShowSelect(dataBean.getNo(),dataBean.getOrderAmount()); payShowSelect(dataBean.getNo(), dataBean.getOrderAmount());
}else if (id == R.id.tv_camp_process){ } else if (id == R.id.tv_camp_process) {
payShowSelect(dataBean.getNo(),dataBean.getOrderAmount()); payShowSelect(dataBean.getNo(), dataBean.getOrderAmount());
}else if (id == R.id.tv_member_pay){ } else if (id == R.id.tv_member_pay) {
payShowSelect(dataBean.getNo(),dataBean.getOrderAmount()); payShowSelect(dataBean.getNo(), dataBean.getOrderAmount());
} }
break; break;
case 4: case 4:
if (id == R.id.tv_process){ if (id == R.id.tv_process) {
startActivity(PickUpTheCarQRCodeActivity.getIntent(_mActivity,dataBean)); startActivity(PickUpTheCarQRCodeActivity.getIntent(_mActivity, dataBean));
}else if (id == R.id.tv_camp_process){ } else if (id == R.id.tv_camp_process) {
startActivity(GetOnTheCarQRCodeActivity.getIntent(_mActivity,dataBean)); startActivity(GetOnTheCarQRCodeActivity.getIntent(_mActivity, dataBean));
} }
break; break;
case 5: case 5:
if (id == R.id.tv_process){ if (id == R.id.tv_process) {
}else if (id == R.id.tv_camp_process){ } else if (id == R.id.tv_camp_process) {
startActivity(GetOnTheCarQRCodeActivity.getIntent(_mActivity,dataBean)); startActivity(GetOnTheCarQRCodeActivity.getIntent(_mActivity, dataBean));
} }
break; break;
case 6: case 6:
break; break;
} }
} }
}); });
...@@ -185,8 +187,8 @@ public class AllOrderFragment extends BaseFragment<CommonPresenter> implements B ...@@ -185,8 +187,8 @@ public class AllOrderFragment extends BaseFragment<CommonPresenter> implements B
countPage = bean.getData().getTotalPage(); countPage = bean.getData().getTotalPage();
mAdapter.addNewData(bean); mAdapter.addNewData(bean);
mSimpleRefreshLayout.onRefreshComplete(); mSimpleRefreshLayout.onRefreshComplete();
if(bean.getData().getTotalCount()==0){ if (bean.getData().getTotalCount() == 0) {
mAdapter.setEmptyView(getEmptyView(recyclerView,-1,_mActivity.getString(R.string.rv_select_not_data))); mAdapter.setEmptyView(getEmptyView(recyclerView, -1, _mActivity.getString(R.string.rv_select_not_data)));
mAdapter.notifyDataSetChanged(); mAdapter.notifyDataSetChanged();
} }
...@@ -210,19 +212,19 @@ public class AllOrderFragment extends BaseFragment<CommonPresenter> implements B ...@@ -210,19 +212,19 @@ public class AllOrderFragment extends BaseFragment<CommonPresenter> implements B
@Override @Override
public void onClick(View v) { public void onClick(View v) {
int id = v.getId(); int id = v.getId();
if (id == R.id.iv_close){ if (id == R.id.iv_close) {
dismiss(); dismiss();
}else if (id == R.id.ll_item_wechat){ } else if (id == R.id.ll_item_wechat) {
helper.setChecked(R.id.rb_wechat, true); helper.setChecked(R.id.rb_wechat, true);
helper.setChecked(R.id.rb_alipay, false); helper.setChecked(R.id.rb_alipay, false);
}else if (id == R.id.ll_item_alipay){ } else if (id == R.id.ll_item_alipay) {
showToast("该功能还没有开通!"); showToast("该功能还没有开通!");
}else if (id == R.id.tv_pay_immediately){ } else if (id == R.id.tv_pay_immediately) {
dismiss(); dismiss();
createOrder(no, 1, 1); createOrder(no, 1, 1);
} }
} }
},R.id.iv_close, R.id.ll_item_wechat, R.id.ll_item_alipay, R.id.tv_pay_immediately); }, R.id.iv_close, R.id.ll_item_wechat, R.id.ll_item_alipay, R.id.tv_pay_immediately);
} }
}; };
dialog.setCanceledOnTouchOutside(false); dialog.setCanceledOnTouchOutside(false);
......
...@@ -33,7 +33,7 @@ import butterknife.BindView; ...@@ -33,7 +33,7 @@ import butterknife.BindView;
* Desc:已完成 * Desc:已完成
*/ */
public class CompletedFragment extends BaseFragment<CommonPresenter>implements BaseQuickAdapter.RequestLoadMoreListener, SimpleRefreshLayout.OnSimpleRefreshListener { public class CompletedFragment extends BaseFragment<CommonPresenter> implements BaseQuickAdapter.RequestLoadMoreListener, SimpleRefreshLayout.OnSimpleRefreshListener {
@BindView(R2.id.recyclerView) @BindView(R2.id.recyclerView)
RecyclerView recyclerView; RecyclerView recyclerView;
...@@ -42,7 +42,7 @@ public class CompletedFragment extends BaseFragment<CommonPresenter>implements B ...@@ -42,7 +42,7 @@ public class CompletedFragment extends BaseFragment<CommonPresenter>implements B
CompletedAdapter mAdapter; CompletedAdapter mAdapter;
private int mPage; private int mPage;
private int countPage; private int countPage;
private final int TYPE_REQUEST_EVALUATION=1; private final int TYPE_REQUEST_EVALUATION = 1;
public static CompletedFragment getInstance(int type) { public static CompletedFragment getInstance(int type) {
Bundle bundl = new Bundle(); Bundle bundl = new Bundle();
...@@ -72,9 +72,9 @@ public class CompletedFragment extends BaseFragment<CommonPresenter>implements B ...@@ -72,9 +72,9 @@ public class CompletedFragment extends BaseFragment<CommonPresenter>implements B
OrderListBean.DataBeanX.DataBean dataBean = (OrderListBean.DataBeanX.DataBean) adapter.getItem(position); OrderListBean.DataBeanX.DataBean dataBean = (OrderListBean.DataBeanX.DataBean) adapter.getItem(position);
int i = view.getId(); int i = view.getId();
if (i == R.id.tv_process) { if (i == R.id.tv_process) {
startActivityForResult(EvaluationActivity.getIntent(_mActivity,dataBean), TYPE_REQUEST_EVALUATION); startActivityForResult(EvaluationActivity.getIntent(_mActivity, dataBean), TYPE_REQUEST_EVALUATION);
}else if (i == R.id.tv_camp_process){ } else if (i == R.id.tv_camp_process) {
startActivityForResult(EvaluationActivity.getIntent(_mActivity,dataBean), TYPE_REQUEST_EVALUATION); startActivityForResult(EvaluationActivity.getIntent(_mActivity, dataBean), TYPE_REQUEST_EVALUATION);
} }
} }
}); });
...@@ -83,10 +83,12 @@ public class CompletedFragment extends BaseFragment<CommonPresenter>implements B ...@@ -83,10 +83,12 @@ public class CompletedFragment extends BaseFragment<CommonPresenter>implements B
@Override @Override
public void onItemClick(BaseQuickAdapter adapter, View view, int position) { public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
OrderListBean.DataBeanX.DataBean dataBean = (OrderListBean.DataBeanX.DataBean) adapter.getItem(position); OrderListBean.DataBeanX.DataBean dataBean = (OrderListBean.DataBeanX.DataBean) adapter.getItem(position);
if (1 ==dataBean.getType()) { if (1 == dataBean.getType()) {
startActivityForResult(OrderDetailActivity.getIntent(_mActivity, dataBean), 1); startActivityForResult(OrderDetailActivity.getIntent(_mActivity, dataBean), 1);
}else if (2== dataBean.getType()){ } else if (2 == dataBean.getType()) {
startActivityForResult(TravelOrderDetailsActivity.getIntent(_mActivity, dataBean), 2); startActivityForResult(TravelOrderDetailsActivity.getIntent(_mActivity, dataBean), 2);
} else if (3 == dataBean.getType()) {
startActivity(TravelOrderDetailsActivity.getIntent(_mActivity, dataBean));
} }
} }
}); });
...@@ -131,8 +133,6 @@ public class CompletedFragment extends BaseFragment<CommonPresenter>implements B ...@@ -131,8 +133,6 @@ public class CompletedFragment extends BaseFragment<CommonPresenter>implements B
} }
private void orderData(int page) { private void orderData(int page) {
Map<String, Object> headMap = new LinkedHashMap<>(); Map<String, Object> headMap = new LinkedHashMap<>();
if (OkGoUtil.getToken() != null) if (OkGoUtil.getToken() != null)
...@@ -154,8 +154,8 @@ public class CompletedFragment extends BaseFragment<CommonPresenter>implements B ...@@ -154,8 +154,8 @@ public class CompletedFragment extends BaseFragment<CommonPresenter>implements B
countPage = bean.getData().getTotalPage(); countPage = bean.getData().getTotalPage();
mAdapter.addNewData(bean); mAdapter.addNewData(bean);
mSimpleRefreshLayout.onRefreshComplete(); mSimpleRefreshLayout.onRefreshComplete();
if(bean.getData().getTotalCount()==0){ if (bean.getData().getTotalCount() == 0) {
mAdapter.setEmptyView(getEmptyView(recyclerView,-1,_mActivity.getString(R.string.rv_select_not_data))); mAdapter.setEmptyView(getEmptyView(recyclerView, -1, _mActivity.getString(R.string.rv_select_not_data)));
mAdapter.notifyDataSetChanged(); mAdapter.notifyDataSetChanged();
} }
...@@ -166,5 +166,4 @@ public class CompletedFragment extends BaseFragment<CommonPresenter>implements B ...@@ -166,5 +166,4 @@ public class CompletedFragment extends BaseFragment<CommonPresenter>implements B
} }
} }
...@@ -27,6 +27,7 @@ import com.rv.home.R; ...@@ -27,6 +27,7 @@ import com.rv.home.R;
import com.rv.home.R2; import com.rv.home.R2;
import com.rv.home.rv.module.ApiConfig; import com.rv.home.rv.module.ApiConfig;
import com.rv.home.rv.module.basic.presenter.CommonPresenter; import com.rv.home.rv.module.basic.presenter.CommonPresenter;
import com.rv.home.rv.module.ui.main.home.bean.EffectiveTimeBean;
import com.rv.home.rv.module.ui.main.home.bean.OrderPayBean; import com.rv.home.rv.module.ui.main.home.bean.OrderPayBean;
import com.rv.home.rv.module.ui.main.home.order.adapter.ForPaymentAdapter; import com.rv.home.rv.module.ui.main.home.order.adapter.ForPaymentAdapter;
import com.rv.home.rv.module.ui.main.home.order.bean.OrderListBean; import com.rv.home.rv.module.ui.main.home.order.bean.OrderListBean;
...@@ -59,6 +60,7 @@ public class ForPaymentFragment extends BaseFragment<CommonPresenter> implements ...@@ -59,6 +60,7 @@ public class ForPaymentFragment extends BaseFragment<CommonPresenter> implements
private int mPage; private int mPage;
private int countPage; private int countPage;
private IWXAPI api; private IWXAPI api;
private long effTime = 0; // 失效时间
public static ForPaymentFragment getInstance(int type) { public static ForPaymentFragment getInstance(int type) {
Bundle bundl = new Bundle(); Bundle bundl = new Bundle();
...@@ -88,11 +90,11 @@ public class ForPaymentFragment extends BaseFragment<CommonPresenter> implements ...@@ -88,11 +90,11 @@ public class ForPaymentFragment extends BaseFragment<CommonPresenter> implements
@Override @Override
public void onItemClick(BaseQuickAdapter adapter, View view, int position) { public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
OrderListBean.DataBeanX.DataBean dataBean = (OrderListBean.DataBeanX.DataBean) adapter.getItem(position); OrderListBean.DataBeanX.DataBean dataBean = (OrderListBean.DataBeanX.DataBean) adapter.getItem(position);
if (1 ==dataBean.getType()) { if (1 == dataBean.getType()) {
startActivityForResult(OrderDetailActivity.getIntent(_mActivity, dataBean), 1); startActivityForResult(OrderDetailActivity.getIntent(_mActivity, dataBean), 1);
}else if (2== dataBean.getType()){ } else if (2 == dataBean.getType()) {
startActivityForResult(TravelOrderDetailsActivity.getIntent(_mActivity, dataBean), 2); startActivityForResult(TravelOrderDetailsActivity.getIntent(_mActivity, dataBean), 2);
}else if (3 == dataBean.getType()){ } else if (3 == dataBean.getType()) {
} }
} }
...@@ -102,15 +104,15 @@ public class ForPaymentFragment extends BaseFragment<CommonPresenter> implements ...@@ -102,15 +104,15 @@ public class ForPaymentFragment extends BaseFragment<CommonPresenter> implements
@Override @Override
public void onItemChildClick(BaseQuickAdapter adapter, View view, int position) { public void onItemChildClick(BaseQuickAdapter adapter, View view, int position) {
int id = view.getId(); int id = view.getId();
if (id == R.id.tv_process){ if (id == R.id.tv_process) {
OrderListBean.DataBeanX.DataBean dataBean = (OrderListBean.DataBeanX.DataBean) adapter.getItem(position); OrderListBean.DataBeanX.DataBean dataBean = (OrderListBean.DataBeanX.DataBean) adapter.getItem(position);
payShowSelect(dataBean.getNo(),dataBean.getOrderAmount()); payShowSelect(dataBean.getNo(), dataBean.getOrderAmount());
}else if (id == R.id.tv_camp_process){ } else if (id == R.id.tv_camp_process) {
OrderListBean.DataBeanX.DataBean dataBean = (OrderListBean.DataBeanX.DataBean) adapter.getItem(position); OrderListBean.DataBeanX.DataBean dataBean = (OrderListBean.DataBeanX.DataBean) adapter.getItem(position);
payShowSelect(dataBean.getNo(),dataBean.getOrderAmount()); payShowSelect(dataBean.getNo(), dataBean.getOrderAmount());
}else if (id == R.id.tv_member_pay){ } else if (id == R.id.tv_member_pay) {
OrderListBean.DataBeanX.DataBean dataBean = (OrderListBean.DataBeanX.DataBean) adapter.getItem(position); OrderListBean.DataBeanX.DataBean dataBean = (OrderListBean.DataBeanX.DataBean) adapter.getItem(position);
payShowSelect(dataBean.getNo(),dataBean.getOrderAmount()); payShowSelect(dataBean.getNo(), dataBean.getOrderAmount());
} }
} }
}); });
...@@ -118,7 +120,7 @@ public class ForPaymentFragment extends BaseFragment<CommonPresenter> implements ...@@ -118,7 +120,7 @@ public class ForPaymentFragment extends BaseFragment<CommonPresenter> implements
@Override @Override
protected void loadData(Bundle savedInstanceState) { protected void loadData(Bundle savedInstanceState) {
getEffectiveTime();
} }
@SuppressLint("CheckResult") @SuppressLint("CheckResult")
...@@ -143,6 +145,24 @@ public class ForPaymentFragment extends BaseFragment<CommonPresenter> implements ...@@ -143,6 +145,24 @@ public class ForPaymentFragment extends BaseFragment<CommonPresenter> implements
case 1: case 1:
pay((OrderPayBean) result); pay((OrderPayBean) result);
break; break;
case 2:
EffectiveTimeBean bean = (EffectiveTimeBean) result;
if (bean != null && bean.isRel() && bean.getData() != null) {
effTime = bean.getData().getActRent();
startTime();
}
break;
}
}
/******
* 开始计时
* @param
*/
private void startTime() {
if (effTime != 0l && mAdapter != null && mAdapter.getData() != null) {
mAdapter.setEffTime(effTime);
} }
} }
...@@ -156,6 +176,7 @@ public class ForPaymentFragment extends BaseFragment<CommonPresenter> implements ...@@ -156,6 +176,7 @@ public class ForPaymentFragment extends BaseFragment<CommonPresenter> implements
public void onRefresh() { public void onRefresh() {
mPage = 1; mPage = 1;
orderData(mPage); orderData(mPage);
} }
@Override @Override
...@@ -173,11 +194,15 @@ public class ForPaymentFragment extends BaseFragment<CommonPresenter> implements ...@@ -173,11 +194,15 @@ public class ForPaymentFragment extends BaseFragment<CommonPresenter> implements
@Override @Override
public void onActivityResult(int requestCode, int resultCode, Intent data) { public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data); super.onActivityResult(requestCode, resultCode, data);
if(resultCode==RESULT_OK){ if (resultCode == RESULT_OK) {
onRefresh(); onRefresh();
} }
} }
private void getEffectiveTime() {
mPresenter.getData(2, ApiConfig.HTTP_URL_EFFECTIVE_TIME, EffectiveTimeBean.class, false);
}
private void orderData(int page) { private void orderData(int page) {
Map<String, Object> headMap = new LinkedHashMap<>(); Map<String, Object> headMap = new LinkedHashMap<>();
if (OkGoUtil.getToken() != null) if (OkGoUtil.getToken() != null)
...@@ -199,8 +224,8 @@ public class ForPaymentFragment extends BaseFragment<CommonPresenter> implements ...@@ -199,8 +224,8 @@ public class ForPaymentFragment extends BaseFragment<CommonPresenter> implements
countPage = bean.getData().getTotalPage(); countPage = bean.getData().getTotalPage();
mAdapter.addNewData(bean); mAdapter.addNewData(bean);
mSimpleRefreshLayout.onRefreshComplete(); mSimpleRefreshLayout.onRefreshComplete();
if(bean.getData().getTotalCount()==0){ if (bean.getData().getTotalCount() == 0) {
mAdapter.setEmptyView(getEmptyView(recyclerView,-1,_mActivity.getString(R.string.rv_select_not_data))); mAdapter.setEmptyView(getEmptyView(recyclerView, -1, _mActivity.getString(R.string.rv_select_not_data)));
mAdapter.notifyDataSetChanged(); mAdapter.notifyDataSetChanged();
} }
...@@ -223,19 +248,19 @@ public class ForPaymentFragment extends BaseFragment<CommonPresenter> implements ...@@ -223,19 +248,19 @@ public class ForPaymentFragment extends BaseFragment<CommonPresenter> implements
@Override @Override
public void onClick(View v) { public void onClick(View v) {
int id = v.getId(); int id = v.getId();
if (id == R.id.iv_close){ if (id == R.id.iv_close) {
dismiss(); dismiss();
}else if (id == R.id.ll_item_wechat){ } else if (id == R.id.ll_item_wechat) {
helper.setChecked(R.id.rb_wechat, true); helper.setChecked(R.id.rb_wechat, true);
helper.setChecked(R.id.rb_alipay, false); helper.setChecked(R.id.rb_alipay, false);
}else if (id == R.id.ll_item_alipay){ } else if (id == R.id.ll_item_alipay) {
showToast("该功能还没有开通!"); showToast("该功能还没有开通!");
}else if (id == R.id.tv_pay_immediately){ } else if (id == R.id.tv_pay_immediately) {
dismiss(); dismiss();
createOrder(no, 1, 1); createOrder(no, 1, 1);
} }
} }
},R.id.iv_close, R.id.ll_item_wechat, R.id.ll_item_alipay, R.id.tv_pay_immediately); }, R.id.iv_close, R.id.ll_item_wechat, R.id.ll_item_alipay, R.id.tv_pay_immediately);
} }
}; };
dialog.setCanceledOnTouchOutside(false); dialog.setCanceledOnTouchOutside(false);
......
...@@ -135,7 +135,7 @@ public class OrderDetailActivity extends BaseStatusActivity<PickerPresenter> { ...@@ -135,7 +135,7 @@ public class OrderDetailActivity extends BaseStatusActivity<PickerPresenter> {
initRxBus(); initRxBus();
api = WXAPIFactory.createWXAPI(mActivity, RvFrameConfig.APP_ID); api = WXAPIFactory.createWXAPI(mActivity, RvFrameConfig.APP_ID);
dataBean = (OrderListBean.DataBeanX.DataBean) intent.getSerializableExtra("dataBean"); dataBean = (OrderListBean.DataBeanX.DataBean) intent.getSerializableExtra("dataBean");
if (dataBean !=null){ if (dataBean != null) {
status = dataBean.getStatusX(); status = dataBean.getStatusX();
no = dataBean.getNo(); no = dataBean.getNo();
orderAmount = dataBean.getOrderAmount(); orderAmount = dataBean.getOrderAmount();
...@@ -155,6 +155,9 @@ public class OrderDetailActivity extends BaseStatusActivity<PickerPresenter> { ...@@ -155,6 +155,9 @@ public class OrderDetailActivity extends BaseStatusActivity<PickerPresenter> {
tvPickUpTheCar.setText(mActivity.getString(R.string.rv_return_car)); tvPickUpTheCar.setText(mActivity.getString(R.string.rv_return_car));
break; break;
case 6: case 6:
if (dataBean.getType() == 3) {
tvCancelOrder.setVisibility(View.GONE);
}
tvCancelOrder.setText(mActivity.getString(R.string.deposit_information)); tvCancelOrder.setText(mActivity.getString(R.string.deposit_information));
tvPickUpTheCar.setText(mActivity.getString(R.string.rv_to_evaluate)); tvPickUpTheCar.setText(mActivity.getString(R.string.rv_to_evaluate));
break; break;
...@@ -228,13 +231,13 @@ public class OrderDetailActivity extends BaseStatusActivity<PickerPresenter> { ...@@ -228,13 +231,13 @@ public class OrderDetailActivity extends BaseStatusActivity<PickerPresenter> {
payShowSelect(no, orderAmount); payShowSelect(no, orderAmount);
break; break;
case 4: case 4:
startActivity(PickUpTheCarQRCodeActivity.getIntent(mActivity,dataBean)); startActivity(PickUpTheCarQRCodeActivity.getIntent(mActivity, dataBean));
break; break;
case 5: case 5:
startActivity(PickUpTheCarQRCodeActivity.getIntent(mActivity,dataBean)); startActivity(PickUpTheCarQRCodeActivity.getIntent(mActivity, dataBean));
break; break;
case 6: case 6:
startActivityForResult(EvaluationActivity.getIntent(mActivity,dataBean), TYPE_REQUEST_EVALUATION); startActivityForResult(EvaluationActivity.getIntent(mActivity, dataBean), TYPE_REQUEST_EVALUATION);
break; break;
} }
} }
...@@ -425,7 +428,7 @@ public class OrderDetailActivity extends BaseStatusActivity<PickerPresenter> { ...@@ -425,7 +428,7 @@ public class OrderDetailActivity extends BaseStatusActivity<PickerPresenter> {
mWebView.post(new Runnable() { mWebView.post(new Runnable() {
@Override @Override
public void run() { public void run() {
ClipboardUtil.setText(mActivity,no); ClipboardUtil.setText(mActivity, no);
} }
}); });
} }
......
...@@ -21,6 +21,7 @@ public class ForPaymentAdapter extends BaseMultiItemQuickAdapter<MultiItemEntity ...@@ -21,6 +21,7 @@ public class ForPaymentAdapter extends BaseMultiItemQuickAdapter<MultiItemEntity
public static final int TYPE_FOR_PAYMENT = 1; //1--租车;2--旅游 public static final int TYPE_FOR_PAYMENT = 1; //1--租车;2--旅游
public static final int TYPE_TO_TRAVEL = 2; public static final int TYPE_TO_TRAVEL = 2;
public static final int TYPE_TO_MEMBER = 3; public static final int TYPE_TO_MEMBER = 3;
private long effTime = 0l;
public ForPaymentAdapter(List<MultiItemEntity> data) { public ForPaymentAdapter(List<MultiItemEntity> data) {
super(data); super(data);
...@@ -75,10 +76,10 @@ public class ForPaymentAdapter extends BaseMultiItemQuickAdapter<MultiItemEntity ...@@ -75,10 +76,10 @@ public class ForPaymentAdapter extends BaseMultiItemQuickAdapter<MultiItemEntity
break; break;
case TYPE_TO_MEMBER: case TYPE_TO_MEMBER:
OrderListBean.DataBeanX.DataBean dataBean3 = (OrderListBean.DataBeanX.DataBean) item; OrderListBean.DataBeanX.DataBean dataBean3 = (OrderListBean.DataBeanX.DataBean) item;
if (dataBean3 ==null){ if (dataBean3 == null) {
return; return;
} }
if (dataBean3.getOrderMemberDetail() ==null){ if (dataBean3.getOrderMemberDetail() == null) {
return; return;
} }
...@@ -86,7 +87,7 @@ public class ForPaymentAdapter extends BaseMultiItemQuickAdapter<MultiItemEntity ...@@ -86,7 +87,7 @@ public class ForPaymentAdapter extends BaseMultiItemQuickAdapter<MultiItemEntity
helper.setText(R.id.tv_order_state, mContext.getString(R.string.rv_order_for_payment)); helper.setText(R.id.tv_order_state, mContext.getString(R.string.rv_order_for_payment));
helper.loadRoundImage(mContext, dataBean3.getPicture(), (ImageView) helper.getView(R.id.iv_goods), 10); helper.loadRoundImage(mContext, dataBean3.getPicture(), (ImageView) helper.getView(R.id.iv_goods), 10);
helper.setText(R.id.tv_name, dataBean3.getName()); helper.setText(R.id.tv_name, dataBean3.getName());
helper.setText(R.id.tv_content,dataBean3.getOrderMemberDetail().getContent() ); helper.setText(R.id.tv_content, dataBean3.getOrderMemberDetail().getContent());
helper.setText(R.id.tv_price, String.format("¥%1$s", dataBean3.getOrderAmount())); helper.setText(R.id.tv_price, String.format("¥%1$s", dataBean3.getOrderAmount()));
helper.setText(R.id.tv_member_pay, mContext.getString(R.string.rv_to_pay_for)); helper.setText(R.id.tv_member_pay, mContext.getString(R.string.rv_to_pay_for));
helper.addOnClickListener(R.id.tv_member_pay); helper.addOnClickListener(R.id.tv_member_pay);
...@@ -101,4 +102,8 @@ public class ForPaymentAdapter extends BaseMultiItemQuickAdapter<MultiItemEntity ...@@ -101,4 +102,8 @@ public class ForPaymentAdapter extends BaseMultiItemQuickAdapter<MultiItemEntity
notifyDataSetChanged(); notifyDataSetChanged();
} }
public void setEffTime(long effTime) {
this.effTime = effTime;
}
} }
...@@ -672,7 +672,7 @@ ...@@ -672,7 +672,7 @@
android:id="@+id/ll_layout_member_hint" android:id="@+id/ll_layout_member_hint"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/size_50" android:layout_height="@dimen/size_50"
android:visibility="gone" android:visibility="visible"
android:gravity="center_vertical" android:gravity="center_vertical"
android:orientation="horizontal"> android:orientation="horizontal">
......
package com.rv.rvmine.bean;
public class DeleteInfo {
private int id;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public DeleteInfo(int id) {
this.id = id;
}
}
package com.rv.rvmine.bean;
import com.ruiwenliu.wrapper.base.BaseBean;
public class DeleteVistorBean extends BaseBean {
private boolean rel;
public boolean isRel() {
return rel;
}
public void setRel(boolean rel) {
this.rel = rel;
}
}
...@@ -4,9 +4,11 @@ import android.Manifest; ...@@ -4,9 +4,11 @@ import android.Manifest;
import android.annotation.SuppressLint; import android.annotation.SuppressLint;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.content.pm.PackageManager;
import android.os.Build; import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
import android.support.annotation.NonNull; import android.support.annotation.NonNull;
import android.support.v4.app.ActivityCompat;
import android.support.v4.content.ContextCompat; import android.support.v4.content.ContextCompat;
import android.text.TextUtils; import android.text.TextUtils;
import android.view.View; import android.view.View;
...@@ -278,14 +280,22 @@ public class IDCardCertificationActivity extends BaseStatusActivity<PickerPresen ...@@ -278,14 +280,22 @@ public class IDCardCertificationActivity extends BaseStatusActivity<PickerPresen
// } // }
// } // }
// } // }
private String[] cameraPermissions = {Manifest.permission.WRITE_EXTERNAL_STORAGE, Manifest.permission.CAMERA}; private String[] cameraPermissions = {Manifest.permission.WRITE_EXTERNAL_STORAGE, Manifest.permission.CAMERA,Manifest.permission.READ_EXTERNAL_STORAGE};
private void processPicker() { private void processPicker() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
if (!EasyPermissions.hasPermissions(this, cameraPermissions)) {
EasyPermissions.requestPermissions(this, "拍照需要此权限", 1, cameraPermissions); int checkResult = ContextCompat.checkSelfPermission(this, Manifest.permission.CAMERA) ;
return;
if (checkResult == PackageManager.PERMISSION_GRANTED) {
ActivityCompat.requestPermissions(this, cameraPermissions, 1);
} }
// if (!EasyPermissions.hasPermissions(this, cameraPermissions)) {
// EasyPermissions.requestPermissions(this, "拍照需要此权限", 1, cameraPermissions);
// return;
// }
} }
switch (typeCamera) { switch (typeCamera) {
case 1001: case 1001:
......
...@@ -101,13 +101,13 @@ public class AddAVisitorActivity extends BaseStatusActivity<CommonPresenter> { ...@@ -101,13 +101,13 @@ public class AddAVisitorActivity extends BaseStatusActivity<CommonPresenter> {
return; return;
} }
String idCard = null, phone = null; String idCard = null, phone = null;
if (identityType == 0) { idCard = etIdCard.getText().toString().trim();
idCard = etIdCard.getText().toString().trim(); if (TextUtil.isEmpty(idCard)) {
if (TextUtil.isEmpty(idCard)) { showToast("身份证号不能为空!");
showToast("身份证号不能为空!"); return;
return; }
}
if (identityType == 0) {
phone = etPhone.getText().toString().trim(); phone = etPhone.getText().toString().trim();
if (TextUtil.isEmpty(phone)) { if (TextUtil.isEmpty(phone)) {
showToast("手机号码不能为空!"); showToast("手机号码不能为空!");
......
...@@ -5,8 +5,8 @@ import android.content.Intent; ...@@ -5,8 +5,8 @@ import android.content.Intent;
import android.os.Bundle; import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView; import android.support.v7.widget.RecyclerView;
import android.text.TextUtils;
import android.view.View; import android.view.View;
import android.widget.Toast;
import com.alibaba.android.arouter.facade.annotation.Route; import com.alibaba.android.arouter.facade.annotation.Route;
import com.chad.library.adapter.base.BaseQuickAdapter; import com.chad.library.adapter.base.BaseQuickAdapter;
...@@ -20,7 +20,10 @@ import com.rv.home.rv.module.basic.BaseStatusActivity; ...@@ -20,7 +20,10 @@ import com.rv.home.rv.module.basic.BaseStatusActivity;
import com.rv.home.rv.module.basic.presenter.CommonPresenter; import com.rv.home.rv.module.basic.presenter.CommonPresenter;
import com.rv.rvmine.R; import com.rv.rvmine.R;
import com.rv.rvmine.adapter.TravelerListAdapter; import com.rv.rvmine.adapter.TravelerListAdapter;
import com.rv.rvmine.bean.DeleteInfo;
import com.rv.rvmine.bean.DeleteVistorBean;
import com.rv.rvmine.bean.TravelerListBean; import com.rv.rvmine.bean.TravelerListBean;
import com.rv.rvmine.view.DeletePopupWindow;
import com.yuyife.okgo.OkGoUtil; import com.yuyife.okgo.OkGoUtil;
import java.util.ArrayList; import java.util.ArrayList;
...@@ -45,7 +48,9 @@ public class ChooseAVisitorActivity extends BaseStatusActivity<CommonPresenter> ...@@ -45,7 +48,9 @@ public class ChooseAVisitorActivity extends BaseStatusActivity<CommonPresenter>
private int mPage; private int mPage;
private int countPage; private int countPage;
private int visitorType; private int visitorType;
private DeletePopupWindow deletePopupWindow;
private List<TravelerListBean.DataBean> visitors = new ArrayList<>(); private List<TravelerListBean.DataBean> visitors = new ArrayList<>();
private TravelerListBean.DataBean deletBean = null;
public static Intent getIntent(Context context) { public static Intent getIntent(Context context) {
return new Intent(context, ChooseAVisitorActivity.class); return new Intent(context, ChooseAVisitorActivity.class);
...@@ -96,6 +101,31 @@ public class ChooseAVisitorActivity extends BaseStatusActivity<CommonPresenter> ...@@ -96,6 +101,31 @@ public class ChooseAVisitorActivity extends BaseStatusActivity<CommonPresenter>
} }
} }
}); });
mAdapter.setOnItemLongClickListener(new BaseQuickAdapter.OnItemLongClickListener() {
@Override
public boolean onItemLongClick(BaseQuickAdapter adapter, View view, int position) {
TravelerListBean.DataBean item = mAdapter.getItem(position);
showDeletePopupWindow(item, view);
return true;
}
});
}
private void showDeletePopupWindow(final TravelerListBean.DataBean item, View view) {
if (deletePopupWindow == null) {
deletePopupWindow = new DeletePopupWindow(this, new View.OnClickListener() {
@Override
public void onClick(View view) {
deleteDriver(item);
deletePopupWindow.dismiss();
}
});
deletePopupWindow.getContentView().measure(View.MeasureSpec.UNSPECIFIED, View.MeasureSpec.UNSPECIFIED);
}
deletePopupWindow.showAsDropDown(view, view.getWidth() / 2 - deletePopupWindow.getContentView().getMeasuredWidth() / 2,
-deletePopupWindow.getContentView().getHeight() / 2);
} }
@Override @Override
...@@ -106,7 +136,22 @@ public class ChooseAVisitorActivity extends BaseStatusActivity<CommonPresenter> ...@@ -106,7 +136,22 @@ public class ChooseAVisitorActivity extends BaseStatusActivity<CommonPresenter>
@Override @Override
public void onShowResult(int requestType, BaseBean result) { public void onShowResult(int requestType, BaseBean result) {
processData((TravelerListBean) result); if (requestType == 0) {
processData((TravelerListBean) result);
} else if (requestType == 1) {
DeleteVistorBean bean = (DeleteVistorBean) result;
if (bean != null) {
if (bean.isRel()) {
if (deletBean != null) {
if (visitors.remove(deletBean)) {
mAdapter.notifyDataSetChanged();
}
deletBean = null;
}
}
}
}
} }
...@@ -151,4 +196,12 @@ public class ChooseAVisitorActivity extends BaseStatusActivity<CommonPresenter> ...@@ -151,4 +196,12 @@ public class ChooseAVisitorActivity extends BaseStatusActivity<CommonPresenter>
} }
} }
private void deleteDriver(TravelerListBean.DataBean item) {
deletBean = item;
Map<String, Object> headMap = new LinkedHashMap<>();
if (OkGoUtil.getToken() != null)
headMap.put("Authorization", OkGoUtil.getToken());
mPresenter.postBodyData(1, ApiConfig.HTTP_URL_DELETEDRIVER , DeleteVistorBean.class, new DeleteInfo(deletBean.getId()), headMap, true);
}
} }
package com.rv.rvmine.view;
import android.app.Activity;
import android.content.Context;
import android.graphics.drawable.ColorDrawable;
import android.view.LayoutInflater;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.view.WindowManager;
import android.widget.LinearLayout.LayoutParams;
import android.widget.PopupWindow;
import com.rv.rvmine.R;
/**
* 发布文字、图片...
*/
public class DeletePopupWindow extends PopupWindow {
public DeletePopupWindow(final Activity context, OnClickListener onClickListener) {
super(context);
LayoutInflater inflater = (LayoutInflater) context
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
ViewGroup menuView = (ViewGroup) inflater.inflate(R.layout.popu_delete, null);
menuView.findViewById(R.id.tv_delete).setOnClickListener(onClickListener);
this.setContentView(menuView);
// 设置SelectPicPopupWindow弹出窗体的宽
this.setWidth(LayoutParams.WRAP_CONTENT);
// 设置SelectPicPopupWindow弹出窗体的高
this.setHeight(LayoutParams.WRAP_CONTENT);
// 设置SelectPicPopupWindow弹出窗体可点击
this.setFocusable(true);
// // 设置SelectPicPopupWindow弹出窗体动画效果
// this.setAnimationStyle(R.style.Buttom_Popwindow);
//设置SelectPicPopupWindow弹出窗体的背景
// 透明背景,
this.setBackgroundDrawable(new ColorDrawable(0));
// WindowManager.LayoutParams lp = context.getWindow().getAttributes();
// lp.alpha = 0.7f;
// context.getWindow().setAttributes(lp);
//
setOnDismissListener(new OnDismissListener() {
@Override
public void onDismiss() {
WindowManager.LayoutParams lp = context.getWindow().getAttributes();
lp.alpha = 1f;
context.getWindow().setAttributes(lp);
}
});
}
}
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="2dp" />
<solid android:color="@color/white" />
<stroke
android:width="1dp"
android:color="@color/gray_EEEEEE" />
</shape>
\ No newline at end of file
...@@ -9,6 +9,7 @@ import android.support.annotation.Nullable; ...@@ -9,6 +9,7 @@ import android.support.annotation.Nullable;
import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView; import android.support.v7.widget.RecyclerView;
import android.text.TextUtils; import android.text.TextUtils;
import android.util.Log;
import android.view.View; import android.view.View;
import android.widget.ImageView; import android.widget.ImageView;
import android.widget.LinearLayout; import android.widget.LinearLayout;
...@@ -104,7 +105,6 @@ public class MemberCenterActivity extends BaseStatusActivity<MemberPresenter> { ...@@ -104,7 +105,6 @@ public class MemberCenterActivity extends BaseStatusActivity<MemberPresenter> {
@SuppressLint("CheckResult") @SuppressLint("CheckResult")
private void initRxBus() { private void initRxBus() {
RxBus.tObservable(PaymentSuccessfulEvent.class) RxBus.tObservable(PaymentSuccessfulEvent.class)
.observeOn(Schedulers.io()) .observeOn(Schedulers.io())
.subscribe(new Consumer<PaymentSuccessfulEvent>() { .subscribe(new Consumer<PaymentSuccessfulEvent>() {
...@@ -120,6 +120,7 @@ public class MemberCenterActivity extends BaseStatusActivity<MemberPresenter> { ...@@ -120,6 +120,7 @@ public class MemberCenterActivity extends BaseStatusActivity<MemberPresenter> {
@Override @Override
public void accept(PaymentFailedEvent payEvent) throws Exception { public void accept(PaymentFailedEvent payEvent) throws Exception {
if (mActivity.getClass().equals(MemberCenterActivity.class)) { if (mActivity.getClass().equals(MemberCenterActivity.class)) {
Log.e("xxxxxxxxxxxxxx", "xxxxxxxxxxxxxxxxxxxxxxxxxx");
ARouter.getInstance().build(Constance.ACTIVITY_URL_ORDERLIST).navigation(); ARouter.getInstance().build(Constance.ACTIVITY_URL_ORDERLIST).navigation();
finish(); finish();
} }
......
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