|
@@ -181,7 +181,7 @@ import top.keepempty.sph.library.SphResultCallback;
|
|
|
* Created by cjx on 2020-08-21
|
|
|
* 说明:
|
|
|
*/
|
|
|
-public class IceCreamFragment extends BaseAutoExitFragment implements View.OnClickListener, Animation.AnimationListener ,View.OnTouchListener{
|
|
|
+public class IceCreamFragment extends BaseAutoExitFragment implements View.OnClickListener, Animation.AnimationListener{
|
|
|
|
|
|
// 去除末尾的0
|
|
|
// private DecimalFormat decimalFormat = new DecimalFormat("###################.###########");
|
|
@@ -669,7 +669,7 @@ public class IceCreamFragment extends BaseAutoExitFragment implements View.OnCli
|
|
|
if (!mClickHelper.canClick()) {
|
|
|
return;
|
|
|
}
|
|
|
-// resetFinishDelay();
|
|
|
+ resetFinishDelay();
|
|
|
int id = v.getId();
|
|
|
if (id == R.id.dishes_shop_cart_clear) {
|
|
|
showClearDialog();
|
|
@@ -691,7 +691,7 @@ public class IceCreamFragment extends BaseAutoExitFragment implements View.OnCli
|
|
|
// }
|
|
|
if (!CommunicationHelper.getInstance().canGenerateOrder()) {
|
|
|
ToastUtil.getInstance().showText(CommunicationHelper.getInstance().getWhyCanOrderText());
|
|
|
-// return;//是否开机
|
|
|
+ return;//是否开机
|
|
|
}
|
|
|
if (Hawk.get(Name.SHOPPING_TROLLEY, true)) {
|
|
|
addShopCart();
|
|
@@ -717,7 +717,6 @@ public class IceCreamFragment extends BaseAutoExitFragment implements View.OnCli
|
|
|
} else if (id == R.id.dishes_kernel_2) {
|
|
|
selectKernel(1);
|
|
|
}
|
|
|
- resetFinishDelay();
|
|
|
}
|
|
|
|
|
|
private void showChoosePay() {
|
|
@@ -754,6 +753,7 @@ public class IceCreamFragment extends BaseAutoExitFragment implements View.OnCli
|
|
|
pri = PriceUtil.getDishPriceOne(currentDish);
|
|
|
}
|
|
|
showLoading();
|
|
|
+ resetFinishDelay();
|
|
|
if (App.app.payChannel == Constant.PAY_FREE || manualReason != null) {
|
|
|
payType = 0;
|
|
|
manualMake();
|
|
@@ -795,7 +795,6 @@ public class IceCreamFragment extends BaseAutoExitFragment implements View.OnCli
|
|
|
dismissLoading();
|
|
|
showDialogChoosePay();
|
|
|
}
|
|
|
- resetFinishDelay();
|
|
|
}
|
|
|
|
|
|
private ShoppingTrolleyDialogChoosePay shoppingTrolleyDialogChoosePay;
|
|
@@ -1616,7 +1615,7 @@ public class IceCreamFragment extends BaseAutoExitFragment implements View.OnCli
|
|
|
resetIceCreamView();
|
|
|
break;
|
|
|
case "RefreshUI":
|
|
|
- if (Hawk.get(Name.VALUE_ZERO,false)) {
|
|
|
+ if (Hawk.get(Name.VALUE_ZERO, false)) {
|
|
|
tvMoney.setText(UiUtil.getStringRes(R.string.have_money) + Global.hasmoney.setScale(2, RoundingMode.HALF_UP));
|
|
|
}
|
|
|
break;
|
|
@@ -1756,17 +1755,17 @@ public class IceCreamFragment extends BaseAutoExitFragment implements View.OnCli
|
|
|
// tvMoney.setText(haveMoney + (Global.hasmoney.doubleValue() + Global.hascoin.doubleValue()) + Hawk.get(Name.UNIT_OF_CURRENCY_TIME, ""));
|
|
|
tvMoney.setText(haveMoney + Global.hasmoney.add(Global.hascoin).setScale(2, RoundingMode.HALF_UP) + Hawk.get(Name.UNIT_OF_CURRENCY_TIME, ""));
|
|
|
|
|
|
- coin=Global.hasmoney.add(Global.hascoin).doubleValue();
|
|
|
+ coin = Global.hasmoney.add(Global.hascoin).doubleValue();
|
|
|
if (payMixDialog != null && payMixDialog.isShowing()) {
|
|
|
if (Global.hasmoney.doubleValue() + Global.hascoin.doubleValue() >= pri) {
|
|
|
// tvMoney.setText(haveMoney + (Global.hasmoney.doubleValue() + Global.hascoin.doubleValue() - pri) + Hawk.get(Name.UNIT_OF_CURRENCY_TIME, ""));
|
|
|
tvMoney.setText(haveMoney + (Global.hasmoney.add(Global.hascoin).subtract(new BigDecimal(pri + "").setScale(2, RoundingMode.HALF_UP))) + Hawk.get(Name.UNIT_OF_CURRENCY_TIME, UiUtil.getStringRes(R.string.price_unit)));
|
|
|
remainMoney = Global.hasmoney.doubleValue() + Global.hascoin.doubleValue() - pri;
|
|
|
payPaperSuccess(); // 收钞完成
|
|
|
- Log.d(TAG, "event: payPaperSuccessa "+pri);//商品价格
|
|
|
- Log.d(TAG, "event: payPaperSuccessa "+coin);//投入金额
|
|
|
- Log.d(TAG, "event: payPaperSuccessb"+remainMoney);//剩余可用金额
|
|
|
- Log.d(TAG, "event: payPaperSuccessc"+Global.hasmoney.doubleValue() + Global.hascoin.doubleValue());//商品价格
|
|
|
+ Log.d(TAG, "event: payPaperSuccessa " + pri);//商品价格
|
|
|
+ Log.d(TAG, "event: payPaperSuccessa " + coin);//投入金额
|
|
|
+ Log.d(TAG, "event: payPaperSuccessb" + remainMoney);//剩余可用金额
|
|
|
+ Log.d(TAG, "event: payPaperSuccessc" + Global.hasmoney.doubleValue() + Global.hascoin.doubleValue());//商品价格
|
|
|
EventBus.getDefault().post(new ApiMessageEvent("cashsale",
|
|
|
ByteUtils.decimal2fitHex((long) (coin * 100), 4)
|
|
|
+ ";" + ByteUtils.decimal2fitHex((long) 1, 4)));
|
|
@@ -1794,14 +1793,14 @@ public class IceCreamFragment extends BaseAutoExitFragment implements View.OnCli
|
|
|
break;
|
|
|
case Name.ENDSESSION:
|
|
|
// if (Hawk.get(Name.END_CREDIT_CARD, false)) {
|
|
|
- new Handler().postDelayed(new Runnable() {
|
|
|
- @Override
|
|
|
- public void run() {
|
|
|
- if (mMdbCreditCardDialog != null) {
|
|
|
- mMdbCreditCardDialog.dismiss();
|
|
|
- }
|
|
|
+ new Handler().postDelayed(new Runnable() {
|
|
|
+ @Override
|
|
|
+ public void run() {
|
|
|
+ if (mMdbCreditCardDialog != null) {
|
|
|
+ mMdbCreditCardDialog.dismiss();
|
|
|
}
|
|
|
- }, 3000);
|
|
|
+ }
|
|
|
+ }, 3000);
|
|
|
// }
|
|
|
break;
|
|
|
default:
|
|
@@ -1867,7 +1866,7 @@ public class IceCreamFragment extends BaseAutoExitFragment implements View.OnCli
|
|
|
payMixDialog.show();
|
|
|
dismissLoading();
|
|
|
if (Global.hasmoney.doubleValue() + Global.hascoin.doubleValue() >= pri) {
|
|
|
- coin=Global.hasmoney.add(Global.hascoin).doubleValue();
|
|
|
+ coin = Global.hasmoney.add(Global.hascoin).doubleValue();
|
|
|
|
|
|
// tvMoney.setText(haveMoney + (Global.hasmoney.doubleValue() + Global.hascoin.doubleValue() - pri) + Hawk.get(Name.UNIT_OF_CURRENCY_TIME, ""));
|
|
|
tvMoney.setText(haveMoney + (Global.hasmoney.add(Global.hascoin).subtract(new BigDecimal(pri + "").setScale(2, RoundingMode.HALF_UP))) + Hawk.get(Name.UNIT_OF_CURRENCY_TIME, UiUtil.getStringRes(R.string.price_unit)));
|
|
@@ -3164,13 +3163,4 @@ public class IceCreamFragment extends BaseAutoExitFragment implements View.OnCli
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
- @Override
|
|
|
- public boolean onTouch(View view, MotionEvent motionEvent) {
|
|
|
- switch (motionEvent.getAction()) {
|
|
|
- case MotionEvent.ACTION_DOWN:
|
|
|
- resetFinishDelay();
|
|
|
- return true;
|
|
|
- }
|
|
|
- return false;
|
|
|
- }
|
|
|
}
|