Commit 741bf401 authored by zhang_z's avatar zhang_z

BUG修改;

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