|
@@ -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 {
|
|
|
+public class IceCreamFragment extends BaseAutoExitFragment implements View.OnClickListener, Animation.AnimationListener ,View.OnTouchListener{
|
|
|
|
|
|
// 去除末尾的0
|
|
|
// private DecimalFormat decimalFormat = new DecimalFormat("###################.###########");
|
|
@@ -284,6 +284,7 @@ public class IceCreamFragment extends BaseAutoExitFragment implements View.OnCli
|
|
|
public boolean onTouch(View view, MotionEvent motionEvent) {
|
|
|
switch (motionEvent.getAction()) {
|
|
|
case MotionEvent.ACTION_DOWN:
|
|
|
+ Log.d(TAG, "onTouch: ACTION_DOWN");
|
|
|
resetFinishDelay();
|
|
|
View v = getCurrentFocus();
|
|
|
if (isShouldHideKeyboard(v, motionEvent)) {
|
|
@@ -690,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();
|
|
@@ -750,7 +751,6 @@ public class IceCreamFragment extends BaseAutoExitFragment implements View.OnCli
|
|
|
} else {
|
|
|
priceList = new ArrayList<>();
|
|
|
priceList1 = new ArrayList<>();
|
|
|
-
|
|
|
pri = PriceUtil.getDishPriceOne(currentDish);
|
|
|
}
|
|
|
showLoading();
|
|
@@ -775,9 +775,11 @@ public class IceCreamFragment extends BaseAutoExitFragment implements View.OnCli
|
|
|
} else if (App.app.payChannel == Constant.PAY_POS_DEVICE || manualReason != null) {
|
|
|
Log.d(TAG, "onClick: MDB板信用卡支付");
|
|
|
payType = 4;
|
|
|
+ ispaySuccess = true;
|
|
|
pay();//MDB板信用卡支付
|
|
|
} else if (App.app.payChannel == Constant.PAY_PRICE_MODEL || manualReason != null) {
|
|
|
payType = 3;
|
|
|
+ ispaySuccess = true;
|
|
|
showPayMixDialog();
|
|
|
// manualMake();
|
|
|
} else if (App.app.payChannel == Constant.PAY_NAYAX_PAY || manualReason != null) {
|
|
@@ -1214,7 +1216,7 @@ public class IceCreamFragment extends BaseAutoExitFragment implements View.OnCli
|
|
|
} else if (tvAddCartLength <= 25) {
|
|
|
tvAddCart.setTextSize(TypedValue.COMPLEX_UNIT_SP, 20);
|
|
|
}
|
|
|
- priceView.setText(Hawk.get(Name.UNIT_OF_CURRENCY_TIME, "") + String.format(Locale.US, "%.2f", num));
|
|
|
+ priceView.setText(Hawk.get(Name.UNIT_OF_CURRENCY_TIME, UiUtil.getStringRes(R.string.price_unit)) + String.format(Locale.US, "%.2f", num));
|
|
|
}
|
|
|
|
|
|
private void initShopCartView(int position, boolean isAdd) {
|
|
@@ -1652,6 +1654,7 @@ public class IceCreamFragment extends BaseAutoExitFragment implements View.OnCli
|
|
|
httpCreditCardDialog.stopTimeDown();
|
|
|
}
|
|
|
|
|
|
+
|
|
|
if (ispaySuccess) {
|
|
|
ispaySuccess = false;
|
|
|
showDialogPaySuccess(R.string.pay_success, R.drawable.icon_zhifu_pay);
|
|
@@ -1757,7 +1760,7 @@ public class IceCreamFragment extends BaseAutoExitFragment implements View.OnCli
|
|
|
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, ""));
|
|
|
+ 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(); // 收钞完成
|
|
|
EventBus.getDefault().post(new ApiMessageEvent("cashsale",
|
|
@@ -1786,7 +1789,7 @@ public class IceCreamFragment extends BaseAutoExitFragment implements View.OnCli
|
|
|
}
|
|
|
break;
|
|
|
case Name.ENDSESSION:
|
|
|
- if (Hawk.get(Name.END_CREDIT_CARD, false)) {
|
|
|
+// if (Hawk.get(Name.END_CREDIT_CARD, false)) {
|
|
|
new Handler().postDelayed(new Runnable() {
|
|
|
@Override
|
|
|
public void run() {
|
|
@@ -1795,7 +1798,7 @@ public class IceCreamFragment extends BaseAutoExitFragment implements View.OnCli
|
|
|
}
|
|
|
}
|
|
|
}, 3000);
|
|
|
- }
|
|
|
+// }
|
|
|
break;
|
|
|
default:
|
|
|
break;
|
|
@@ -1861,7 +1864,7 @@ public class IceCreamFragment extends BaseAutoExitFragment implements View.OnCli
|
|
|
dismissLoading();
|
|
|
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, ""));
|
|
|
+ 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)));
|
|
|
payPaperSuccess(); // 收钞完成
|
|
|
EventBus.getDefault().post(new ApiMessageEvent("cashsale", ByteUtils.decimal2fitHex((long) (coin * 100), 4) + ";" + ByteUtils.decimal2fitHex((long) 1, 4)));
|
|
|
} else {
|
|
@@ -2072,7 +2075,7 @@ public class IceCreamFragment extends BaseAutoExitFragment implements View.OnCli
|
|
|
saveCoinOrder(shoppingCart.getShoppingName(), sum, payType, localOrderSn, orderHelper.getOrderList().get(i).buyCount);
|
|
|
}
|
|
|
}
|
|
|
- LogUtils.logWrite("制作了" + orderHelper.generateMakingIceCream().size() + "杯冰淇淋");
|
|
|
+ LogUtils.logWrite("共需制作" + orderHelper.generateMakingIceCream().size() + "杯冰淇淋");
|
|
|
if (App.app.payChannel != Constant.PAY_FREE) {
|
|
|
LogUtils.logWrite("非免费开始制作冰淇淋了");
|
|
|
}
|
|
@@ -2206,11 +2209,11 @@ public class IceCreamFragment extends BaseAutoExitFragment implements View.OnCli
|
|
|
private void getCodeSuccess(String rd_Pic, String sn) {
|
|
|
LogUtil.d(TAG, "getCodeSuccess: " + rd_Pic);
|
|
|
// resetFinishDelay();
|
|
|
+ removeFinish();
|
|
|
showDialogScan(rd_Pic, sn);
|
|
|
}
|
|
|
|
|
|
private void showDialogScan(String rd_Pic, String sn) {
|
|
|
- resetFinishDelay();
|
|
|
// Global.makeStatus = Name.IN_PRODUCTION;
|
|
|
if (scanDialog == null) {
|
|
|
scanDialog = new ScanDialog(getContext(), getActivity());
|
|
@@ -2243,7 +2246,7 @@ public class IceCreamFragment extends BaseAutoExitFragment implements View.OnCli
|
|
|
|
|
|
break;
|
|
|
case 1000:
|
|
|
-// resetFinishDelay();
|
|
|
+ resetFinishDelay();
|
|
|
break;
|
|
|
}
|
|
|
|
|
@@ -3094,6 +3097,9 @@ public class IceCreamFragment extends BaseAutoExitFragment implements View.OnCli
|
|
|
if (loadingDialog != null && loadingDialog.isShowing()) {
|
|
|
loadingDialog.dismiss();
|
|
|
}
|
|
|
+ if (scanDialog != null && scanDialog.isShowing()) {
|
|
|
+ scanDialog.dismiss();
|
|
|
+ }
|
|
|
if (shoppingTrolleyDialogChoosePay != null) {
|
|
|
shoppingTrolleyDialogChoosePay.dismiss();
|
|
|
}
|
|
@@ -3151,4 +3157,14 @@ 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;
|
|
|
+ }
|
|
|
}
|