Commit f652ac97 authored by linfeng's avatar linfeng

租车和rxbus修复

parents 2064a893 d67908b5
......@@ -4,7 +4,7 @@ android {
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
defaultConfig {
applicationId "com.test.rv"
applicationId "com.xxfc.rv"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 104
......
......@@ -21,7 +21,6 @@ public interface RvFrameConfig extends RvFrameConstant {
String VEHICLE_TOURUSER = HOST + "/api/tour/";
String VEHICLE_CAMPLIST = HOST + "/api/campsite/";
String APP_ID = "wx9ed5e51251cf7c61";//微信注册ID
class RvFrameInfo {
......
......@@ -43,7 +43,7 @@ ext {
compileSdkVersion = 28
buildToolsVersion = "28.0.3"
minSdkVersion = 19
targetSdkVersion = 22
targetSdkVersion = 24
versionCode = 1
versionName = "1.0"
supportVersion = '28.0.0'
......
......@@ -139,6 +139,11 @@ public class ForPaymentFragment extends BaseFragment<CommonPresenter> implements
}
@Override
public void onDestroyView() {
super.onDestroyView();
}
@Override
public void onShowResult(int requestType, BaseBean result) {
switch (requestType) {
......
package com.rv.home.rv.module.ui.main.home.order.adapter;
import android.text.TextUtils;
import android.view.View;
import android.widget.ImageView;
import com.chad.library.adapter.base.BaseMultiItemQuickAdapter;
......@@ -8,7 +10,9 @@ import com.ruiwenliu.wrapper.util.BaseGlideHolder;
import com.ruiwenliu.wrapper.util.TimeManager;
import com.rv.home.R;
import com.rv.home.rv.module.ui.main.home.order.bean.OrderListBean;
import com.rv.home.rv.module.ui.main.home.order.view.MyTimerView;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
/**
......@@ -32,9 +36,16 @@ public class ForPaymentAdapter extends BaseMultiItemQuickAdapter<MultiItemEntity
@Override
protected void convert(BaseGlideHolder helper, MultiItemEntity item) {
OrderListBean.DataBeanX.DataBean dataBean;
try {
setTimes(helper, (OrderListBean.DataBeanX.DataBean) item);
} catch (Exception e) {
e.printStackTrace();
}
switch (helper.getItemViewType()) {
case TYPE_FOR_PAYMENT:
OrderListBean.DataBeanX.DataBean dataBean = (OrderListBean.DataBeanX.DataBean) item;
dataBean = (OrderListBean.DataBeanX.DataBean) item;
if (dataBean == null) {
return;
}
......@@ -42,6 +53,7 @@ public class ForPaymentAdapter extends BaseMultiItemQuickAdapter<MultiItemEntity
if (dataBean.getOrderRentVehicleDetail() != null && dataBean.getOrderRentVehicleDetail().getStart_city_name() != null) {
helper.setText(R.id.tv_city, dataBean.getOrderRentVehicleDetail().getStart_city_name());
}
helper.loadRoundImage(mContext, dataBean.getPicture(), (ImageView) helper.getView(R.id.iv_goods), 10);
helper.setText(R.id.tv_order_state, mContext.getString(R.string.rv_order_for_payment));
helper.loadRoundImage(mContext, dataBean.getIcon(), (ImageView) helper.getView(R.id.iv_goods), 10);
helper.setText(R.id.tv_car_type, dataBean.getName());
......@@ -56,54 +68,90 @@ public class ForPaymentAdapter extends BaseMultiItemQuickAdapter<MultiItemEntity
helper.addOnClickListener(R.id.tv_process);
break;
case TYPE_TO_TRAVEL:
OrderListBean.DataBeanX.DataBean dataBean2 = (OrderListBean.DataBeanX.DataBean) item;
if (dataBean2 == null) {
dataBean = (OrderListBean.DataBeanX.DataBean) item;
if (dataBean == null) {
return;
}
if (dataBean2.getOrderTourDetail() == null) {
if (dataBean.getOrderTourDetail() == null) {
return;
}
helper.setText(R.id.tv_order_time, String.format("%1$s%2$s", mContext.getString(R.string.rv_order_time), dataBean2.getCrtTime()));
helper.setText(R.id.tv_city, dataBean2.getOrderTourDetail().getStartCityName());
helper.setText(R.id.tv_order_state, mContext.getString(R.string.rv_order_for_payment));
helper.loadRoundImage(mContext, dataBean2.getPicture(), (ImageView) helper.getView(R.id.iv_goods), 10);
helper.setText(R.id.tv_car_type, dataBean2.getName());
helper.setText(R.id.tv_out_time, mContext.getString(R.string.rv_to_time) + TimeManager.stampToDate2(String.valueOf(dataBean2.getOrderTourDetail().getStartTime())));
helper.setText(R.id.tv_count_person, String.format("%1$s%2$s", mContext.getString(R.string.rv_to_person), dataBean2.getOrderTourDetail().getTotalNumber(), mContext.getString(R.string.rv_person)));
helper.setText(R.id.tv_price, String.format("¥%1$s", dataBean2.getOrderAmount()));
helper.setText(R.id.tv_order_time, String.format("%1$s%2$s", mContext.getString(R.string.rv_order_time), dataBean.getCrtTime()));
helper.setText(R.id.tv_city, dataBean.getOrderTourDetail().getStartCityName());
helper.loadRoundImage(mContext, dataBean.getPicture(), (ImageView) helper.getView(R.id.iv_goods), 10);
helper.setText(R.id.tv_car_type, dataBean.getName());
helper.setText(R.id.tv_out_time, mContext.getString(R.string.rv_to_time) + TimeManager.stampToDate2(String.valueOf(dataBean.getOrderTourDetail().getStartTime())));
helper.setText(R.id.tv_count_person, String.format("%1$s%2$s", mContext.getString(R.string.rv_to_person), dataBean.getOrderTourDetail().getTotalNumber(), mContext.getString(R.string.rv_person)));
helper.setText(R.id.tv_price, String.format("¥%1$s", dataBean.getOrderAmount()));
helper.setText(R.id.tv_camp_process, mContext.getString(R.string.rv_to_pay_for));
helper.addOnClickListener(R.id.tv_camp_process);
break;
case TYPE_TO_MEMBER:
OrderListBean.DataBeanX.DataBean dataBean3 = (OrderListBean.DataBeanX.DataBean) item;
if (dataBean3 == null) {
dataBean = (OrderListBean.DataBeanX.DataBean) item;
if (dataBean == null) {
return;
}
if (dataBean3.getOrderMemberDetail() == null) {
if (dataBean.getOrderMemberDetail() == null) {
return;
}
helper.setText(R.id.tv_order_time, String.format("%1$s%2$s", mContext.getString(R.string.rv_order_time), dataBean3.getCrtTime()));
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.setText(R.id.tv_name, dataBean3.getName());
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_order_time, String.format("%1$s%2$s", mContext.getString(R.string.rv_order_time), dataBean.getCrtTime()));
helper.loadRoundImage(mContext, dataBean.getPicture(), (ImageView) helper.getView(R.id.iv_goods), 10);
helper.setText(R.id.tv_name, dataBean.getName());
helper.setText(R.id.tv_content, dataBean.getOrderMemberDetail().getContent());
helper.setText(R.id.tv_price, String.format("¥%1$s", dataBean.getOrderAmount()));
helper.setText(R.id.tv_member_pay, mContext.getString(R.string.rv_to_pay_for));
helper.addOnClickListener(R.id.tv_member_pay);
break;
}
}
private void setTimes(BaseGlideHolder helper, OrderListBean.DataBeanX.DataBean bean) throws Exception {
if (bean != null) {
String crtStr = bean.getCrtTime();
if (!TextUtils.isEmpty(crtStr)) {
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date date = format.parse(crtStr);
long remain = effTime - (System.currentTimeMillis() - date.getTime());
if (remain <= 0) {
helper.setText(R.id.tv_order_state, mContext.getString(R.string.tv_order_cancel));
switch (bean.getType()) {
case TYPE_FOR_PAYMENT:
helper.itemView.findViewById(R.id.tv_process).setVisibility(View.GONE);
break;
case TYPE_TO_TRAVEL:
helper.itemView.findViewById(R.id.tv_camp_process).setVisibility(View.GONE);
break;
case TYPE_TO_MEMBER:
helper.itemView.findViewById(R.id.tv_member_pay).setVisibility(View.GONE);
break;
}
} else {
helper.setText(R.id.tv_order_state, mContext.getString(R.string.rv_order_for_payment));
((MyTimerView) helper.itemView.findViewById(R.id.tv_remain_time)).setTime(effTime, date.getTime(), timerListener);
}
}
}
}
public void addNewData(OrderListBean bean) {
mData.clear();
addData(bean.getData().getData());
notifyDataSetChanged();
}
/******
* 设置失效时间
* @param effTime
*/
public void setEffTime(long effTime) {
this.effTime = effTime;
notifyDataSetChanged();
}
public MyTimerView.TimerListener timerListener = new MyTimerView.TimerListener() {
@Override
public void onTimeFinish() {
notifyDataSetChanged();
}
};
}
package com.rv.home.rv.module.ui.main.home.order.view;
import android.content.Context;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
import android.util.AttributeSet;
import android.view.View;
import android.widget.TextView;
import java.util.Timer;
import java.util.TimerTask;
public class MyTimerView extends TextView {
private long efftiveTime;
private long crTime;
private Timer timer;
private TimerListener mListener;
public MyTimerView(Context context, AttributeSet attrs) {
super(context, attrs);
}
/********
* @param efftiveTime
* 失效时间
* @param crTime
* 创建时间
* @param listener
*/
public void setTime(long efftiveTime, long crTime, TimerListener listener) {
this.efftiveTime = efftiveTime;
this.crTime = crTime;
this.mListener = listener;
showEffTime();
startTimer();
}
private void showEffTime() {
long mTime = efftiveTime - (System.currentTimeMillis() - crTime);
if (mTime > 0) {
int day = 0;
int hour = 0;
int min = 0;
int seconds = (int) (mTime / 1000);
if (seconds > 60) {
min = seconds / 60;
seconds = seconds % 60;
if (min > 60) {
hour = min / 60;
min = min % 60;
if (hour > 24) {
day = hour / 24;
hour = hour % 24;
}
}
}
StringBuilder builder = new StringBuilder();
builder.append("剩余");
if (day > 0) {
builder.append(day + "天");
}
dealTime(false, hour, builder);
dealTime(false, min, builder);
dealTime(true, seconds, builder);
setText(builder.toString());
setVisibility(VISIBLE);
} else {
if (mListener != null) {
mListener.onTimeFinish();
}
setVisibility(GONE);
if (timer != null) {
timer.cancel();
timer = null;
}
}
}
private void dealTime(boolean isSecond, int hms, StringBuilder builder) {
if (hms < 10) {
builder.append("0");
}
builder.append(hms);
if (!isSecond) {
builder.append(":");
}
}
@Override
protected void onDetachedFromWindow() {
super.onDetachedFromWindow();
if (timer != null) {
timer.cancel();
}
if (handler != null) {
handler.removeCallbacksAndMessages(null);
}
}
/*****
* 开始计时
*/
public void startTimer() {
timer = new Timer();
timer.schedule(new RemindTask(), 0, 1000);
}
class RemindTask extends TimerTask {
@Override
public void run() {
handler.sendEmptyMessage(0);
}
}
private Handler handler = new Handler(Looper.getMainLooper()) {
@Override
public void handleMessage(Message msg) {
showEffTime();
}
};
public interface TimerListener {
void onTimeFinish();
}
}
......@@ -80,9 +80,9 @@
android:layout_height="wrap_content"
android:background="@null"
android:hint="@string/rv_phone_hint"
android:inputType="number"
android:maxLength="11"
android:paddingLeft="@dimen/size_20"
android:inputType="number"
android:text=""
android:textColor="@color/textMain"
android:textSize="@dimen/text_14" />
......@@ -117,7 +117,9 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@null"
android:digits="0123456789xyzXYZ"
android:hint="@string/rv_id_card_hint"
android:inputType="number|text"
android:maxLength="18"
android:paddingLeft="@dimen/size_20"
android:text=""
......@@ -131,108 +133,118 @@
android:layout_marginLeft="@dimen/size_15"
android:layout_marginRight="@dimen/size_15"
android:background="@color/colorWrite">
<include layout="@layout/common_line" />
</RelativeLayout>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/size_5"
android:background="@color/colorWrite"
android:padding="@dimen/size_15"
android:layout_marginTop="@dimen/size_5"
android:text="@string/rv_upload_content"
android:textColor="@color/textMain"
android:textSize="@dimen/text_16" />
<RelativeLayout
android:id="@+id/rl_card"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="@dimen/size_80"
android:layout_marginTop="@dimen/size_20"
android:layout_marginRight="@dimen/size_80"
android:layout_marginLeft="@dimen/size_80"
android:background="@color/colorLine"
android:layout_width="match_parent"
android:layout_height="match_parent">
android:background="@color/colorLine">
<ImageView
android:id="@+id/iv_card"
android:scaleType="centerCrop"
android:layout_width="match_parent"
android:layout_height="@dimen/size_150" />
android:layout_height="@dimen/size_150"
android:scaleType="centerCrop" />
<LinearLayout
android:id="@+id/ll_card"
android:layout_centerInParent="true"
android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:gravity="center_horizontal"
android:layout_height="wrap_content">
android:orientation="vertical">
<ImageView
android:src="@drawable/im_pickup_button_norma"
android:layout_width="@dimen/size_45"
android:layout_height="@dimen/size_30" />
<TextView
android:layout_marginTop="@dimen/size_10"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/rv_positive"
/>
android:layout_height="@dimen/size_30"
android:src="@drawable/im_pickup_button_norma" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/size_10"
android:text="@string/rv_positive" />
</LinearLayout>
</RelativeLayout>
<RelativeLayout
android:visibility="gone"
android:id="@+id/rl_card_copy"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="@dimen/size_80"
android:layout_marginTop="@dimen/size_20"
android:layout_marginRight="@dimen/size_80"
android:layout_marginLeft="@dimen/size_80"
android:background="@color/colorLine"
android:layout_width="match_parent"
android:layout_height="match_parent">
android:visibility="gone">
<ImageView
android:id="@+id/iv_card_copy"
android:layout_width="match_parent"
android:scaleType="centerCrop"
android:layout_height="@dimen/size_150" />
android:layout_height="@dimen/size_150"
android:scaleType="centerCrop" />
<LinearLayout
android:id="@+id/ll_card_copy"
android:layout_centerInParent="true"
android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:gravity="center_horizontal"
android:layout_height="wrap_content">
android:orientation="vertical">
<ImageView
android:src="@drawable/im_pickup_button_norma"
android:layout_width="@dimen/size_45"
android:layout_height="@dimen/size_30" />
android:layout_height="@dimen/size_30"
android:src="@drawable/im_pickup_button_norma" />
<TextView
android:layout_marginTop="@dimen/size_10"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/rv_copy"
/>
android:layout_marginTop="@dimen/size_10"
android:text="@string/rv_copy" />
</LinearLayout>
</RelativeLayout>
<TextView
android:layout_marginTop="@dimen/size_15"
android:text="@string/rv_driving_content"
android:layout_width="match_parent"
android:textSize="@dimen/text_12"
android:textColor="@color/textLightGrey"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/size_15"
android:gravity="center"
/>
android:text="@string/rv_driving_content"
android:textColor="@color/textLightGrey"
android:textSize="@dimen/text_12" />
<TextView
android:layout_width="match_parent"
android:text="@string/rv_delete"
android:id="@+id/tv_delete"
android:layout_width="match_parent"
android:layout_height="@dimen/size_50"
android:layout_margin="@dimen/size_25"
android:textColor="@color/colorWrite"
android:background="@drawable/shape_rv_bg_yellow"
android:gravity="center"
android:textSize="@dimen/text_16"
android:layout_height="@dimen/size_50" />
android:text="@string/rv_delete"
android:textColor="@color/colorWrite"
android:textSize="@dimen/text_16" />
<View
android:layout_width="match_parent"
android:layout_height="@dimen/size_20"/>
android:layout_height="@dimen/size_20" />
</LinearLayout>
......
......@@ -28,14 +28,35 @@
android:textColor="@color/textGray"
android:textSize="@dimen/text_12" />
<TextView
android:id="@+id/tv_order_state"
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:text=""
android:textColor="@color/textMain"
android:textSize="@dimen/text_12" />
android:layout_centerVertical="true"
android:gravity="center"
android:orientation="horizontal">
<com.rv.home.rv.module.ui.main.home.order.view.MyTimerView
android:id="@+id/tv_remain_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="@dimen/size_10"
android:text="xxx"
android:textColor="@color/textGray"
android:textSize="@dimen/text_12"
android:visibility="gone" />
<TextView
android:id="@+id/tv_order_state"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="sss"
android:textColor="@color/textMain"
android:textSize="@dimen/text_12" />
</LinearLayout>
</RelativeLayout>
<LinearLayout
......@@ -50,6 +71,7 @@
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/iv_goods"
android:layout_width="@dimen/size_100"
......@@ -59,11 +81,11 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="@dimen/text_10"
android:padding="@dimen/size_5"
android:background="@drawable/shape_rv_bg_yellow"
android:padding="@dimen/size_5"
android:text="租房车"
android:textColor="@color/colorWrite"
android:text="租房车"/>
android:textSize="@dimen/text_10" />
</RelativeLayout>
<RelativeLayout
......
......@@ -28,14 +28,35 @@
android:textColor="@color/textGray"
android:textSize="@dimen/text_12" />
<TextView
android:id="@+id/tv_order_state"
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:text="待付款"
android:textColor="@color/textMain"
android:textSize="@dimen/text_12" />
android:layout_centerVertical="true"
android:gravity="center"
android:orientation="horizontal">
<com.rv.home.rv.module.ui.main.home.order.view.MyTimerView
android:id="@+id/tv_remain_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="@dimen/size_10"
android:text="xxx"
android:textColor="@color/textGray"
android:textSize="@dimen/text_12"
android:visibility="gone" />
<TextView
android:id="@+id/tv_order_state"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="sss"
android:textColor="@color/textMain"
android:textSize="@dimen/text_12" />
</LinearLayout>
</RelativeLayout>
<LinearLayout
......@@ -58,8 +79,8 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_vertical"
android:layout_marginLeft="@dimen/size_8"
android:gravity="center_vertical"
android:orientation="vertical">
<TextView
......
......@@ -28,14 +28,35 @@
android:textColor="@color/textGray"
android:textSize="@dimen/text_12" />
<TextView
android:id="@+id/tv_order_state"
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:text=""
android:textColor="@color/textMain"
android:textSize="@dimen/text_12" />
android:layout_centerVertical="true"
android:gravity="center"
android:orientation="horizontal">
<com.rv.home.rv.module.ui.main.home.order.view.MyTimerView
android:id="@+id/tv_remain_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="@dimen/size_10"
android:text="xxx"
android:textColor="@color/textGray"
android:textSize="@dimen/text_12"
android:visibility="gone" />
<TextView
android:id="@+id/tv_order_state"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="sss"
android:textColor="@color/textMain"
android:textSize="@dimen/text_12" />
</LinearLayout>
</RelativeLayout>
<LinearLayout
......
......@@ -123,6 +123,7 @@
<string name="rv_add_driving_toast">请添加驾驶证</string>
<string name="rv_my_order">我的订单</string>
<string name="rv_order_time">下单时间:</string>
<string name="tv_order_cancel">已取消</string>
<string name="rv_order_for_payment">待支付</string>
<string name="rv_order_to_travel">待出行</string>
<string name="rv_order_have_travel">出行中</string>
......
......@@ -382,7 +382,7 @@ public class MineFragment extends BaseFragment<CommonPresenter> implements Simpl
tvVerified.setEnabled(true);
} else if (info.getCertificationStatus() == 1) {
tvVerified.setText("已实名认证");
tvVerified.setEnabled(false);
// tvVerified.setEnabled(false);
}
if (0 == info.getIsMember()) {
......
......@@ -196,9 +196,9 @@ public class IDCardCertificationActivity extends BaseStatusActivity<PickerPresen
uploadFile(new File(mPresenter.gerCameraStoreUrl()), "camera");
}
}
if (requestCode == AppSettingsDialog.DEFAULT_SETTINGS_REQ_CODE) {
processPicker();
}
// if (requestCode == AppSettingsDialog.DEFAULT_SETTINGS_REQ_CODE) {
// processPicker();
// }
}
......@@ -280,22 +280,13 @@ public class IDCardCertificationActivity extends BaseStatusActivity<PickerPresen
// }
// }
// }
private String[] cameraPermissions = {Manifest.permission.WRITE_EXTERNAL_STORAGE, Manifest.permission.CAMERA,Manifest.permission.READ_EXTERNAL_STORAGE};
private String[] cameraPermissions = {Manifest.permission.WRITE_EXTERNAL_STORAGE, Manifest.permission.CAMERA, Manifest.permission.READ_EXTERNAL_STORAGE};
private void processPicker() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
int checkResult = ContextCompat.checkSelfPermission(this, Manifest.permission.CAMERA) ;
if (checkResult == PackageManager.PERMISSION_GRANTED) {
ActivityCompat.requestPermissions(this, cameraPermissions, 1);
}
// if (!EasyPermissions.hasPermissions(this, cameraPermissions)) {
// EasyPermissions.requestPermissions(this, "拍照需要此权限", 1, cameraPermissions);
// return;
// }
if (!EasyPermissions.hasPermissions(this, cameraPermissions)) {
EasyPermissions.requestPermissions(this, "拍照需要此权限,否则无法正常使用", 1, cameraPermissions);
return;
}
switch (typeCamera) {
case 1001:
......@@ -307,6 +298,11 @@ public class IDCardCertificationActivity extends BaseStatusActivity<PickerPresen
}
}
@Override
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
EasyPermissions.onRequestPermissionsResult(requestCode,permissions,grantResults, this);
}
/**
* 上传文件
......@@ -367,7 +363,10 @@ public class IDCardCertificationActivity extends BaseStatusActivity<PickerPresen
public void onPermissionsDenied(int requestCode, @NonNull List<String> perms) {
Toast.makeText(this, "用户授权失败", Toast.LENGTH_SHORT).show();
if (EasyPermissions.somePermissionPermanentlyDenied(this, perms)) {
new AppSettingsDialog.Builder(this).build().show();
new AppSettingsDialog.Builder(this).
setTitle("需要权限")
.setRationale("如果没有这些权限,此应用程序可能无法正常工作,是否打开设置修改该应用权限")
.build().show();
}
}
......
......@@ -141,6 +141,7 @@ public class PersonalInformationActivity extends BaseStatusActivity<PickerPresen
RxBus.post(new UserInfoEvent());
finish();
break;
}
}
......
......@@ -36,8 +36,8 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:button="@drawable/selector_rv_check"
android:paddingLeft="@dimen/size_10"
android:checked="true"
android:paddingLeft="@dimen/size_10"
android:text="@string/cb_adult_hint"
android:textSize="@dimen/text_14" />
......@@ -113,9 +113,9 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:button="@drawable/selector_rv_check"
android:checked="true"
android:paddingLeft="@dimen/size_10"
android:text="@string/cb_man_hint"
android:checked="true"
android:textSize="@dimen/text_14" />
<CheckBox
......@@ -187,10 +187,12 @@
</LinearLayout>
<EditText
android:inputType="number|text"
android:digits="0123456789xyzXYZ"
android:id="@+id/et_id_card"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@null"
android:hint="@string/et_id_card_hint"
android:maxLength="18"
......@@ -224,12 +226,12 @@
<EditText
android:id="@+id/et_phone"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@null"
android:hint="@string/et_phone_hint"
android:maxLength="11"
android:inputType="phone|number"
android:maxLength="11"
android:paddingLeft="@dimen/size_5"
android:text=""
android:textColor="@color/textMain"
......
......@@ -22,26 +22,26 @@ public class VisitorInformationAdapter extends BaseQuickAdapter<BeanVisitorInfor
protected void convert(BaseViewHolder helper, BeanVisitorInformation item) {
if ("0".equals(item.getIsChild())) {
helper.setText(R.id.tv_people_type, "成人");
}else {
} else {
helper.setText(R.id.tv_people_type, "儿童");
}
if (item ==null|| TextUtil.isEmpty(item.getName()) ||TextUtil.isEmpty(item.getPhone())){
helper.setGone(R.id.tv_hint,true);
helper.setGone(R.id.ll_item_content,false);
if (item == null || TextUtil.isEmpty(item.getName()) || ("0".equals(item.getIsChild()) && TextUtil.isEmpty(item.getPhone()))) {
helper.setGone(R.id.tv_hint, true);
helper.setGone(R.id.ll_item_content, false);
return;
}
helper.setGone(R.id.tv_hint,false);
helper.setGone(R.id.ll_item_content,true);
helper.setGone(R.id.tv_hint, false);
helper.setGone(R.id.ll_item_content, true);
helper.setText(R.id.tv_name,item.getName());
helper.setText(R.id.tv_phone,item.getPhone());
helper.setText(R.id.tv_name, item.getName());
helper.setText(R.id.tv_phone, item.getPhone());
if (TextUtil.isEmpty(item.getIdCard())) {
helper.setVisible(R.id.tv_idcard_title,false);
}else {
helper.setVisible(R.id.tv_idcard_title, false);
} else {
helper.setText(R.id.tv_idcard, item.getIdCard());
helper.setVisible(R.id.tv_idcard_title,true);
helper.setVisible(R.id.tv_idcard_title, true);
}
}
}
......@@ -85,6 +85,7 @@ public class MemberCenterActivity extends BaseStatusActivity<MemberPresenter> {
private IWXAPI api;
private int memberLevel = 0; // 会员等级
private int freeUseDay = 0; // 免费租车天数
private boolean verified = false; // 是否实名认证
public static Intent getIntent(Context context) {
return new Intent(context, MemberCenterActivity.class);
......@@ -191,6 +192,14 @@ public class MemberCenterActivity extends BaseStatusActivity<MemberPresenter> {
return true;
}
private boolean isVerified() {
if (!verified) {
ARouter.getInstance().build(Constance.ACTIVITY_URL_IDCARDCERTIFICATION)
.navigation(this, REQUEST_VERIFIED);
}
return verified;
}
@Override
protected void loadData(Bundle savedInstanceState, Intent intent) {
......@@ -224,9 +233,11 @@ public class MemberCenterActivity extends BaseStatusActivity<MemberPresenter> {
GlideManager.getInstance(this).loadImage(info.getHeadimgurl(), ivAvatar);
tvNickname.setText(info.getUsername());
if (info.getCertificationStatus() == 0) { //实名认证状态:0-未认证,1-已认证
verified = false;
tvVerified.setText("未实名认证");
tvVerified.setEnabled(true);
} else if (info.getCertificationStatus() == 1) {
verified = true;
tvVerified.setText("已实名认证");
tvVerified.setEnabled(false);
}
......@@ -298,7 +309,7 @@ public class MemberCenterActivity extends BaseStatusActivity<MemberPresenter> {
@Override
public void pay(final MemberListBean.MemberCard card) {
if (!isLogin()) return;
if (!isVerified()) return;
new PaymentTypeSelection(MemberCenterActivity.this) {
@Override
public void helper(final ViewHolder helper) {
......
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