Commit 2b26af2a authored by zhang_z's avatar zhang_z

无法使用储值卡消费的问题;

parent 441f0a28
...@@ -144,26 +144,32 @@ public class MsPresenter<Sku extends BaseSku> extends MsContract.Presenter<Sku> ...@@ -144,26 +144,32 @@ public class MsPresenter<Sku extends BaseSku> extends MsContract.Presenter<Sku>
case C.MS_EDITOR_MODE.ADD: case C.MS_EDITOR_MODE.ADD:
ApiFactory.Ms.add(ms) ApiFactory.Ms.add(ms)
.doOnSubscribe(disposable -> mView.dismissLoadingDialog()) .doOnSubscribe(disposable -> mView.dismissLoadingDialog())
.subscribe(ms1 -> { .subscribe(
mView.showMsg("添加成功"); ms1 -> {
isNeedSync = true; mView.showMsg("添加成功");
mView.backToManagerFragment(); isNeedSync = true;
mView.addMs(ms1); mView.backToManagerFragment();
}, throwable -> { mView.addMs(ms1);
mView.showMsg("添加失败"); },
}); throwable -> {
mView.showMsg("添加失败");
}
);
break; break;
case C.MS_EDITOR_MODE.UPDATE: case C.MS_EDITOR_MODE.UPDATE:
ApiFactory.Ms.update(ms) ApiFactory.Ms.update(ms)
.doOnSubscribe(disposable -> mView.dismissLoadingDialog()) .doOnSubscribe(disposable -> mView.dismissLoadingDialog())
.subscribe(ms1 -> { .subscribe(
mView.showMsg("修改成功"); ms1 -> {
isNeedSync = true; mView.showMsg("修改成功");
mView.backToManagerFragment(); isNeedSync = true;
mView.updateMs(ms1); mView.backToManagerFragment();
}, throwable -> { mView.updateMs(ms1);
mView.showMsg("修改失败"); },
}); throwable -> {
mView.showMsg("修改失败");
}
);
break; break;
} }
} }
......
...@@ -34,6 +34,8 @@ public class SettleFragment extends BaseFragment<SettlePresenter, FragmentSettle ...@@ -34,6 +34,8 @@ public class SettleFragment extends BaseFragment<SettlePresenter, FragmentSettle
private SaledetailAdapter mSaledetailAdapter; private SaledetailAdapter mSaledetailAdapter;
private DisAdapter mDisAdapter; private DisAdapter mDisAdapter;
private Vip mVip;
@Override @Override
public int getLayoutId() { public int getLayoutId() {
return R.layout.fragment_settle; return R.layout.fragment_settle;
...@@ -41,6 +43,8 @@ public class SettleFragment extends BaseFragment<SettlePresenter, FragmentSettle ...@@ -41,6 +43,8 @@ public class SettleFragment extends BaseFragment<SettlePresenter, FragmentSettle
@Override @Override
public void initView() { public void initView() {
mVip = Vip.createDefault();
mPays = new ArrayList<>(); mPays = new ArrayList<>();
mViewBinding.setDefualtVip(true); mViewBinding.setDefualtVip(true);
...@@ -149,8 +153,6 @@ public class SettleFragment extends BaseFragment<SettlePresenter, FragmentSettle ...@@ -149,8 +153,6 @@ public class SettleFragment extends BaseFragment<SettlePresenter, FragmentSettle
* @param vip 会员信息 * @param vip 会员信息
*/ */
public void loadVip(Vip vip) { public void loadVip(Vip vip) {
mPayAdapter.setNewData(getAvlPays(vip));
mViewBinding.setDefualtVip(vip.isDefaultVip()); mViewBinding.setDefualtVip(vip.isDefaultVip());
mViewBinding.setName(vip.getVipName()); mViewBinding.setName(vip.getVipName());
mViewBinding.setPhone(vip.getVipMobile()); mViewBinding.setPhone(vip.getVipMobile());
...@@ -171,6 +173,7 @@ public class SettleFragment extends BaseFragment<SettlePresenter, FragmentSettle ...@@ -171,6 +173,7 @@ public class SettleFragment extends BaseFragment<SettlePresenter, FragmentSettle
mViewBinding.ivLevel.setImageResource(R.mipmap.mk_grade03); mViewBinding.ivLevel.setImageResource(R.mipmap.mk_grade03);
break; break;
} }
this.mVip = vip;
} }
...@@ -203,6 +206,8 @@ public class SettleFragment extends BaseFragment<SettlePresenter, FragmentSettle ...@@ -203,6 +206,8 @@ public class SettleFragment extends BaseFragment<SettlePresenter, FragmentSettle
mViewBinding.tvVipOffAmt.setText(ConvertUtil.fenToYuan(saleorder.getOrderVipOffAmt(), true)); mViewBinding.tvVipOffAmt.setText(ConvertUtil.fenToYuan(saleorder.getOrderVipOffAmt(), true));
mViewBinding.tvOrderCnt.setText(String.valueOf(saleorder.getOrderCnt())); mViewBinding.tvOrderCnt.setText(String.valueOf(saleorder.getOrderCnt()));
} }
mPayAdapter.setNewData(getAvlPays(mVip));
} }
......
...@@ -80,14 +80,12 @@ ...@@ -80,14 +80,12 @@
<ImageButton <ImageButton
android:id="@+id/btn_payment" android:id="@+id/btn_payment"
android:layout_width="wrap_content" android:layout_width="?attr/actionBarSize"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginStart="@dimen/all_spacing" android:layout_marginStart="@dimen/all_spacing"
android:background="@color/transparent" android:background="@color/transparent"
android:contentDescription="@string/store_scan" android:contentDescription="@string/store_scan"
android:foreground="?android:attr/actionBarItemBackground" android:foreground="?android:attr/actionBarItemBackground"
android:paddingEnd="@dimen/all_padding"
android:paddingStart="@dimen/all_bounced_padding"
android:src="@mipmap/but_collection" android:src="@mipmap/but_collection"
android:visibility="@{titleMode>1?View.GONE:View.VISIBLE}" android:visibility="@{titleMode>1?View.GONE:View.VISIBLE}"
app:layout_constraintBottom_toTopOf="parent" app:layout_constraintBottom_toTopOf="parent"
...@@ -96,14 +94,12 @@ ...@@ -96,14 +94,12 @@
<ImageButton <ImageButton
android:id="@+id/btn_scan" android:id="@+id/btn_scan"
android:layout_width="wrap_content" android:layout_width="?attr/actionBarSize"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginStart="@dimen/all_spacing" android:layout_marginStart="@dimen/all_spacing"
android:background="@color/transparent" android:background="@color/transparent"
android:contentDescription="@string/store_scan" android:contentDescription="@string/store_scan"
android:foreground="?android:attr/actionBarItemBackground" android:foreground="?android:attr/actionBarItemBackground"
android:paddingEnd="@dimen/all_padding"
android:paddingStart="@dimen/all_bounced_padding"
android:src="@mipmap/but_sweep_yard" android:src="@mipmap/but_sweep_yard"
android:visibility="@{titleMode>1?View.GONE:View.VISIBLE}" android:visibility="@{titleMode>1?View.GONE:View.VISIBLE}"
app:layout_constraintBottom_toTopOf="parent" app:layout_constraintBottom_toTopOf="parent"
......
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