Commit 741bf401 authored by zhang_z's avatar zhang_z

BUG修改;

parent e5ab6579
......@@ -11,6 +11,7 @@ import com.xingdata.zzdpos.model.Ms;
import com.xingdata.zzdpos.model.Pay;
import com.xingdata.zzdpos.model.Sskugrp;
import com.xingdata.zzdpos.model.Sssku;
import com.xingdata.zzdpos.model.Ussku;
import com.xingdata.zzdpos.ui.main.MainPresenter;
import com.xingdata.zzdpos.ui.settle.SettlePresenter;
import com.xingdata.zzdpos.ui.store.StorePresenter;
......@@ -100,6 +101,21 @@ public class DBFactory {
return Observable.just(query.findAll()).flatMap(ssskus -> Observable.just(getLimitList(ssskus, pageNum, C.PRODUCT.PAGE_SIZE)));
}
/**
* 查询组合商品
*
* @return 组合商品
*/
public static Observable<List<Ussku>> queryUSku() {
RealmQuery<Ussku> query = DB.getInstance().get(MainPresenter.class).where(Ussku.class);
query.equalTo("skuStatus", 0);
return Observable.just(query.findAll())
.flatMap(usskus -> Observable.just(getList(usskus)));
}
/**
* 查询商品分组
*
......
......@@ -143,6 +143,11 @@ interface SettleContract {
*/
public abstract void initStoreInfo();
/**
* 结算页面 - 初始化收款信息
*/
public abstract void initPaymentInfo();
/**
* 结算页面 - 点击会员View
*/
......
......@@ -110,7 +110,6 @@ public class SettlePresenter extends SettleContract.Presenter {
}
);
mView.setSettleFragmentBySettleMode(mSettleMode);
this.reprice();
}
@Override
......@@ -118,7 +117,6 @@ public class SettlePresenter extends SettleContract.Presenter {
mView.loadSaledetails(mSaledetails);
//设置订单详情
mSaleorder.setSaledetails(mSaledetails);
DBFactory.Settle.queryMss().subscribe(ms -> {
mMss = ms;
for (int i = 0; i < mMss.size(); i++) {
......@@ -131,6 +129,13 @@ public class SettlePresenter extends SettleContract.Presenter {
});
}
@Override
public void initPaymentInfo() {
//设置订单详情
mSaleorder.setSaledetails(mSaledetails);
this.reprice();
}
@Override
public void clickVipView() {
mView.showVipFragment();
......@@ -330,6 +335,7 @@ public class SettlePresenter extends SettleContract.Presenter {
* 处理营销活动
*/
private void processMs() {
if (mMss == null || mMss.size() == 0) return;
//重置商品
for (int i = 0; i < mMss.size(); i++) {
mMss.get(i).setSaledetailList(new ArrayList<>());
......
......@@ -80,10 +80,11 @@ public class SettleFragment extends BaseFragment<SettlePresenter, FragmentSettle
public void setViewBySettleMode(int settleMode) {
switch (settleMode) {
case C.SETTLE_MODE.PAYMENT:
mViewBinding.llTicket.setVisibility(View.GONE);
mViewBinding.llStore.setVisibility(View.GONE);
mPresenter.initPaymentInfo();
break;
case C.SETTLE_MODE.STORE:
mViewBinding.llTicket.setVisibility(View.VISIBLE);
mViewBinding.llStore.setVisibility(View.VISIBLE);
this.initStoreView();
break;
}
......
......@@ -77,7 +77,7 @@ public class StoreActivity extends BaseActivity<StorePresenter, ActivityStoreBin
@Override
public void loadSkugrpState(Long skugrpId) {
mStoreFragment.loadSkugrpState(skugrpId);
}
@Override
......
......@@ -74,6 +74,7 @@ public class StorePresenter extends StoreContract.Presenter {
@Override
public void clickCartLogo() {
if (mSaledetails.size() == 0) return;
mView.showCartDialog(mSaleorder, mSaledetails);
}
......@@ -113,6 +114,11 @@ public class StorePresenter extends StoreContract.Presenter {
@Override
public void clickSkugrp(Sskugrp sskugrp) {
this.mStorePageNum = 0;
this.mSkuGrpId = sskugrp.getSkuGrpId();
mView.loadSkugrpState(mSkuGrpId);
if (mSkuGrpId < 0) this.getStoreUSku();
else this.getStoreSku();
}
@Override
......@@ -233,6 +239,20 @@ public class StorePresenter extends StoreContract.Presenter {
);
}
/**
* 获取组合商品
*/
private void getStoreUSku() {
mView.showLoadingDialog();
mCompositeDisposable.add(
DBFactory.Store.queryUSku()
.doOnSubscribe(subscription -> mView.dismissLoadingDialog())
.subscribe(usskus -> mView.loadSkus(usskus, true))
);
}
/**
* 搜索商品
*/
......
......@@ -96,6 +96,15 @@ public class StoreFragment extends BaseFragment<StorePresenter, FragmentStoreBin
mSkugrpAdapter.setNewData(sskugrps);
}
/**
* 加载分组选择状态
*
* @param skugrpId 分组ID
*/
public void loadSkugrpState(Long skugrpId) {
}
/**
* 加载营销方案
*
......
......@@ -63,7 +63,8 @@
<android.support.v4.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_height="match_parent"
android:layout_marginBottom="?attr/actionBarSize">
<LinearLayout
android:layout_width="match_parent"
......@@ -73,7 +74,7 @@
<View
android:layout_width="match_parent"
android:layout_height="@dimen/all_line_width"
android:layout_marginTop="@dimen/all_spacing"
android:layout_marginTop="@dimen/all_margin"
android:background="@color/gray_huanggai" />
<android.support.constraint.ConstraintLayout
......@@ -175,18 +176,19 @@
android:background="@color/gray_huanggai" />
<LinearLayout
android:id="@+id/ll_store"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:visibility="gone">
<View
android:layout_width="match_parent"
android:layout_height="@dimen/all_line_width"
android:layout_marginTop="@dimen/all_margin"
android:background="@color/gray_huanggai" />
<LinearLayout
android:id="@+id/ll_store"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:id="@+id/ll_saledetail_hint"
android:layout_width="match_parent"
......@@ -345,6 +347,7 @@
android:id="@+id/ll_vip"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/all_margin"
android:layout_marginTop="@dimen/all_margin"
android:background="@color/white_caocao"
android:orientation="vertical">
......
......@@ -13,15 +13,10 @@
android:background="@color/gray_zhouyu"
android:orientation="vertical">
<View
android:layout_width="match_parent"
android:layout_height="@dimen/all_line_width"
android:layout_marginTop="@dimen/all_margin"
android:background="@color/gray_huanggai" />
<android.support.v7.widget.RecyclerView
android:id="@+id/rl_sku"
android:layout_width="match_parent"
android:layout_height="match_parent" />
android:layout_height="match_parent"
android:layout_marginTop="@dimen/all_margin" />
</LinearLayout>
</layout>
\ No newline at end of file
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