Commit ed8b2c81 authored by zhang_z's avatar zhang_z

加大数量变化按钮;

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