银行卡添加日弹判断
This commit is contained in:
parent
9364706365
commit
0e8ea7147f
@ -51,6 +51,7 @@ import com.arpa.hndahesudintocctmsdriver.ui.home.shangchuan.ShangChuangImgActivi
|
||||
import com.arpa.hndahesudintocctmsdriver.ui.news.NewActivity;
|
||||
import com.arpa.hndahesudintocctmsdriver.ui.wallet.UpBankActivity;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.MessageUtils;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.OneDayShowUtils;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.SPUtils;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.string.StringUtil;
|
||||
import com.bumptech.glide.Glide;
|
||||
@ -689,7 +690,9 @@ public class HomeFragment extends BaseFragment {
|
||||
if (UiAuxiliary.isLogin(con)) {
|
||||
int curWaybillId = (int) SPUtils.get(con, "curWaybillId", -1);
|
||||
ur.User();
|
||||
qr.getBankCardList();
|
||||
if (!OneDayShowUtils.getInstance().todayIsShow(con)){
|
||||
qr.getBankCardList();
|
||||
}
|
||||
ur.getDriverExpire();
|
||||
hyr.startOrder(curWaybillId==-1 ? 0 : curWaybillId);
|
||||
ur.driverAuthData();
|
||||
|
@ -0,0 +1,53 @@
|
||||
package com.arpa.hndahesudintocctmsdriver.util;
|
||||
|
||||
import android.content.Context;
|
||||
import android.text.TextUtils;
|
||||
|
||||
import com.arpa.hndahesudintocctmsdriver.util.sp.SPUtil;
|
||||
import com.dahe.mylibrary.utils.TimeUtil;
|
||||
import com.dahe.mylibrary.utils.ToastUtils;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Locale;
|
||||
|
||||
/**
|
||||
* @ClassName OneDayShowUtils
|
||||
* @Author john
|
||||
* @Date 2024/9/11 15:33
|
||||
* @Description TODO
|
||||
*/
|
||||
public class OneDayShowUtils {
|
||||
|
||||
private static class SingletonHolder {
|
||||
private static final OneDayShowUtils INSTANCE = new OneDayShowUtils();
|
||||
}
|
||||
|
||||
private OneDayShowUtils() {
|
||||
}
|
||||
|
||||
public static final OneDayShowUtils getInstance() {
|
||||
return OneDayShowUtils.SingletonHolder.INSTANCE;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param ctx
|
||||
* @return true:当天已弹出 false:当天未弹出
|
||||
*/
|
||||
public boolean todayIsShow(Context ctx) {
|
||||
String preday = (String) SPUtils.get(ctx, "PREDAY", "");
|
||||
if (TextUtils.isEmpty(preday)) {
|
||||
String nowString = TimeUtil.getNowString("yyyy-MM-dd");
|
||||
SPUtils.put(ctx, "PREDAY", nowString);
|
||||
return false;
|
||||
} else {
|
||||
boolean today = TimeUtil.isToday(preday, new SimpleDateFormat("yyyy-MM-dd", Locale.getDefault()));
|
||||
if (!today) {
|
||||
String nowString = TimeUtil.getNowString("yyyy-MM-dd");
|
||||
SPUtils.put(ctx, "PREDAY", nowString);
|
||||
}
|
||||
return today;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -1,14 +0,0 @@
|
||||
package com.arpa.hndahesudintocctmsdriver
|
||||
|
||||
import org.junit.Test
|
||||
|
||||
/**
|
||||
* Example local unit test, which will execute on the development machine (host).
|
||||
*
|
||||
* See [testing documentation](http://d.android.com/tools/testing).
|
||||
*/
|
||||
class ExampleUnitTest {
|
||||
@Test
|
||||
fun addition_isCorrect() {
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user