Commit ed8b2c81 authored by zhang_z's avatar zhang_z

加大数量变化按钮;

打开支付宝支付;
parent 3f8eae3c
...@@ -34,6 +34,7 @@ public class AddFragment extends BaseFragment<SsskuPresenter, FragmentSsskuAddBi ...@@ -34,6 +34,7 @@ public class AddFragment extends BaseFragment<SsskuPresenter, FragmentSsskuAddBi
mViewBinding.etBarcode.setOnEditorActionListener((textView, i, keyEvent) -> { mViewBinding.etBarcode.setOnEditorActionListener((textView, i, keyEvent) -> {
if ((i == EditorInfo.IME_ACTION_SEARCH || i == EditorInfo.IME_ACTION_UNSPECIFIED) && !StringUtils.isEmpty(textView.getText())) { if ((i == EditorInfo.IME_ACTION_SEARCH || i == EditorInfo.IME_ACTION_UNSPECIFIED) && !StringUtils.isEmpty(textView.getText())) {
KeyboardUtils.hideSoftInput(textView); KeyboardUtils.hideSoftInput(textView);
this.pop();
mPresenter.clickCheck(mViewBinding.etBarcode.getText().toString()); mPresenter.clickCheck(mViewBinding.etBarcode.getText().toString());
} }
return false; return false;
......
...@@ -138,7 +138,11 @@ public class SettleActivity extends BaseActivity<SettlePresenter, ActivitySettle ...@@ -138,7 +138,11 @@ public class SettleActivity extends BaseActivity<SettlePresenter, ActivitySettle
break; break;
case C.PAY_CHANNEL.BANK: case C.PAY_CHANNEL.BANK:
case C.PAY_CHANNEL.ALI: case C.PAY_CHANNEL.ALI:
showMsg("暂时无法使用"); mScanFragment.setOnScanCompletedListener(barcode -> {
this.pop();
mPresenter.payInAli(barcode);
});
this.start(mScanFragment);
break; break;
case C.PAY_CHANNEL.WECHAT: case C.PAY_CHANNEL.WECHAT:
mScanFragment.setOnScanCompletedListener(barcode -> { mScanFragment.setOnScanCompletedListener(barcode -> {
......
...@@ -227,55 +227,48 @@ public class SettlePresenter extends SettleContract.Presenter { ...@@ -227,55 +227,48 @@ public class SettlePresenter extends SettleContract.Presenter {
public void payInAli(String payCode) { public void payInAli(String payCode) {
mView.showLoadingDialog(); mView.showLoadingDialog();
commitOrder() commitOrder()
.flatMap(orderNo -> { .flatMap(orderNo -> JniFactory.Settle.pay(C.PAY_CHANNEL.ALI, payCode, mSaleorder.getOrderPayAmt(), orderNo))
return JniFactory.Settle.pay(C.PAY_CHANNEL.ALI, payCode, mSaleorder.getOrderPayAmt(), orderNo);
})
.doFinally(() -> mView.dismissLoadingDialog()) .doFinally(() -> mView.dismissLoadingDialog())
.subscribe(response -> { .subscribe(
com.xingdata.zzdpos.api.Pay.Response r1 = JSON.parseObject(response.replace("\\", ""), com.xingdata.zzdpos.api.Pay.Response.class); response -> {
switch (r1.getResponseCode()) { com.xingdata.zzdpos.api.Pay.Response r1 = JSON.parseObject(response.replace("\\", ""), com.xingdata.zzdpos.api.Pay.Response.class);
case "0000": switch (r1.getResponseCode()) {
subscribePay(commitOrder().flatMap(orderNo -> ApiFactory.Saleorder.addOrderPayMis(mSaleorder.pay(orderNo, C.PAY_CHANNEL.ALI)).doFinally(() -> mView.dismissLoadingDialog()))); case "0000":
break; subscribePay(commitOrder().flatMap(orderNo -> ApiFactory.Saleorder.addOrderPayMis(mSaleorder.pay(orderNo, C.PAY_CHANNEL.ALI)).doFinally(() -> mView.dismissLoadingDialog())));
case "0098": break;
mView.showPayingDialog(C.PAY_CHANNEL.ALI, r1); case "0098":
break; mView.showPayingDialog(C.PAY_CHANNEL.ALI, r1);
default: break;
mView.showPayFailFragment(null, mSaleorder); default:
break; mView.showPayFailFragment(null, mSaleorder);
} break;
}, throwable -> { }
mView.showPayFailFragment(throwable, mSaleorder); },
}); throwable -> mView.showPayFailFragment(throwable, mSaleorder));
// .flatMap(response -> {
// return ApiFactory.Saleorder.addOrderPayMis(mSaleorder.pay(response.getOrderNo(), C.PAY_CHANNEL.ALI));
// });
} }
@Override @Override
public void payInWechat(String payCode) { public void payInWechat(String payCode) {
mView.showLoadingDialog(); mView.showLoadingDialog();
commitOrder() commitOrder()
.flatMap(orderNo -> { .flatMap(orderNo -> JniFactory.Settle.pay(C.PAY_CHANNEL.WECHAT, payCode, mSaleorder.getOrderPayAmt(), orderNo))
return JniFactory.Settle.pay(C.PAY_CHANNEL.WECHAT, payCode, mSaleorder.getOrderPayAmt(), orderNo);
})
.doFinally(() -> mView.dismissLoadingDialog()) .doFinally(() -> mView.dismissLoadingDialog())
.subscribe(response -> { .subscribe(
com.xingdata.zzdpos.api.Pay.Response r1 = JSON.parseObject(response.replace("\\", ""), com.xingdata.zzdpos.api.Pay.Response.class); response -> {
switch (r1.getResponseCode()) { com.xingdata.zzdpos.api.Pay.Response r1 = JSON.parseObject(response.replace("\\", ""), com.xingdata.zzdpos.api.Pay.Response.class);
case "0000": switch (r1.getResponseCode()) {
subscribePay(commitOrder().flatMap(orderNo -> ApiFactory.Saleorder.addOrderPayMis(mSaleorder.pay(orderNo, C.PAY_CHANNEL.WECHAT)).doFinally(() -> mView.dismissLoadingDialog()))); case "0000":
break; subscribePay(commitOrder().flatMap(orderNo -> ApiFactory.Saleorder.addOrderPayMis(mSaleorder.pay(orderNo, C.PAY_CHANNEL.WECHAT)).doFinally(() -> mView.dismissLoadingDialog())));
case "0098": break;
mView.showPayingDialog(C.PAY_CHANNEL.WECHAT, r1); case "0098":
break; mView.showPayingDialog(C.PAY_CHANNEL.WECHAT, r1);
default: break;
mView.showPayFailFragment(null, mSaleorder); default:
break; mView.showPayFailFragment(null, mSaleorder);
} break;
}, throwable -> { }
mView.showPayFailFragment(throwable, mSaleorder); },
}); throwable -> mView.showPayFailFragment(throwable, mSaleorder));
} }
@Override @Override
......
...@@ -39,10 +39,11 @@ ...@@ -39,10 +39,11 @@
app:layout_constraintRight_toRightOf="parent" /> app:layout_constraintRight_toRightOf="parent" />
<LinearLayout <LinearLayout
android:id="@+id/ll_price"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="@dimen/all_spacing" android:layout_marginTop="@dimen/all_spacing"
app:layout_constraintBottom_toBottomOf="@id/ll_count" app:layout_constraintBottom_toBottomOf="@id/iv_pic"
app:layout_constraintLeft_toLeftOf="@id/tv_name"> app:layout_constraintLeft_toLeftOf="@id/tv_name">
<TextView <TextView
...@@ -69,8 +70,8 @@ ...@@ -69,8 +70,8 @@
android:layout_marginTop="@dimen/all_spacing" android:layout_marginTop="@dimen/all_spacing"
android:animateLayoutChanges="true" android:animateLayoutChanges="true"
android:gravity="center" android:gravity="center"
app:layout_constraintBottom_toBottomOf="@id/iv_pic" app:layout_constraintRight_toRightOf="@id/tv_name"
app:layout_constraintRight_toRightOf="@id/tv_name"> app:layout_constraintTop_toBottomOf="@id/tv_name">
<ImageView <ImageView
android:id="@+id/iv_reduce" android:id="@+id/iv_reduce"
...@@ -78,8 +79,9 @@ ...@@ -78,8 +79,9 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:contentDescription="@string/store_reduce" android:contentDescription="@string/store_reduce"
android:foreground="?android:attr/actionBarItemBackground" android:foreground="?android:attr/actionBarItemBackground"
android:padding="@dimen/all_spacing"
android:src="@mipmap/but_reduce" android:src="@mipmap/but_reduce"
android:visibility="gone" /> android:visibility="visible" />
<TextView <TextView
android:id="@+id/tv_count" android:id="@+id/tv_count"
...@@ -98,6 +100,7 @@ ...@@ -98,6 +100,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:contentDescription="@string/store_increase" android:contentDescription="@string/store_increase"
android:foreground="?android:attr/actionBarItemBackground" android:foreground="?android:attr/actionBarItemBackground"
android:padding="@dimen/all_spacing"
android:src="@mipmap/but_increase02" /> android:src="@mipmap/but_increase02" />
</LinearLayout> </LinearLayout>
......
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