Commit 419a3da6 authored by 姜敏's avatar 姜敏

Merge remote-tracking branch 'origin/master'

parents 4f1e4bea 79d651a8
...@@ -2,8 +2,9 @@ ...@@ -2,8 +2,9 @@
<project version="4"> <project version="4">
<component name="ProjectModuleManager"> <component name="ProjectModuleManager">
<modules> <modules>
<module fileurl="file://$PROJECT_DIR$/.idea/TangKuPos.iml" filepath="$PROJECT_DIR$/.idea/TangKuPos.iml" /> <module fileurl="file://$PROJECT_DIR$/TangKuPos.iml" filepath="$PROJECT_DIR$/TangKuPos.iml" />
<module fileurl="file://C:\Users\JM_DEV\AndroidStudioProjects\TangKuPos\TangKuPos.iml" filepath="C:\Users\JM_DEV\AndroidStudioProjects\TangKuPos\TangKuPos.iml" /> <module fileurl="file://C:\Users\JM_DEV\AndroidStudioProjects\TangKuPos\TangKuPos.iml" filepath="C:\Users\JM_DEV\AndroidStudioProjects\TangKuPos\TangKuPos.iml" />
<module fileurl="file://D:\Work\Android\AndroidProject\XingData\TangKuPos\.idea\TangKuPos.iml" filepath="D:\Work\Android\AndroidProject\XingData\TangKuPos\.idea\TangKuPos.iml" />
<module fileurl="file://$PROJECT_DIR$/app/app.iml" filepath="$PROJECT_DIR$/app/app.iml" /> <module fileurl="file://$PROJECT_DIR$/app/app.iml" filepath="$PROJECT_DIR$/app/app.iml" />
</modules> </modules>
</component> </component>
......
...@@ -294,7 +294,10 @@ public class C { ...@@ -294,7 +294,10 @@ public class C {
public final class SSKUGRP { public final class SSKUGRP {
private static final String ROOT_URL = PKG + "sskugrp/"; private static final String ROOT_URL = PKG + "sskugrp/";
public static final String add = ROOT_URL + "add";
public static final String query = ROOT_URL + "query"; public static final String query = ROOT_URL + "query";
public static final String delete = ROOT_URL + "delete";
public static final String update = ROOT_URL + "update";
} }
public final class CSDETAIL { public final class CSDETAIL {
...@@ -560,6 +563,7 @@ public class C { ...@@ -560,6 +563,7 @@ public class C {
public static final int GIFT = 4; public static final int GIFT = 4;
public static final int PKG = 5; public static final int PKG = 5;
public static final int SKU_DETAIL = 6; public static final int SKU_DETAIL = 6;
public static final int ADD_SKU = 7;
} }
......
...@@ -10,7 +10,6 @@ import com.xingdata.zzdpos.db.DBFactory; ...@@ -10,7 +10,6 @@ import com.xingdata.zzdpos.db.DBFactory;
import com.xingdata.zzdpos.model.Category; import com.xingdata.zzdpos.model.Category;
import com.xingdata.zzdpos.model.Gbound; import com.xingdata.zzdpos.model.Gbound;
import com.xingdata.zzdpos.model.Mscard; import com.xingdata.zzdpos.model.Mscard;
import com.xingdata.zzdpos.model.NewSssku;
import com.xingdata.zzdpos.model.Pager; import com.xingdata.zzdpos.model.Pager;
import com.xingdata.zzdpos.model.Trule; import com.xingdata.zzdpos.model.Trule;
import com.xingdata.zzdpos.model.Ubound; import com.xingdata.zzdpos.model.Ubound;
...@@ -667,7 +666,7 @@ public final class ApiFactory { ...@@ -667,7 +666,7 @@ public final class ApiFactory {
.retryWhen(new RetryHelper(3)); .retryWhen(new RetryHelper(3));
} }
public static Observable<com.xingdata.zzdpos.model.Sssku> update(NewSssku sssku) { public static Observable<com.xingdata.zzdpos.model.Sssku> update(com.xingdata.zzdpos.model.Sssku sssku) {
return Api.getInstance().service.updateSssku(sssku) return Api.getInstance().service.updateSssku(sssku)
.onErrorReturn(new ErrorFilter<>()) .onErrorReturn(new ErrorFilter<>())
.map(new ResultFilter<>()) .map(new ResultFilter<>())
...@@ -676,7 +675,7 @@ public final class ApiFactory { ...@@ -676,7 +675,7 @@ public final class ApiFactory {
.retryWhen(new RetryHelper(3)); .retryWhen(new RetryHelper(3));
} }
public static Observable<com.xingdata.zzdpos.model.Sssku> addSssku(NewSssku sssku) { public static Observable<com.xingdata.zzdpos.model.Sssku> addSssku(com.xingdata.zzdpos.model.Sssku sssku) {
return Api.getInstance().service.addSssku(sssku) return Api.getInstance().service.addSssku(sssku)
.onErrorReturn(new ErrorFilter<>()) .onErrorReturn(new ErrorFilter<>())
.map(new ResultFilter<>()) .map(new ResultFilter<>())
...@@ -932,6 +931,33 @@ public final class ApiFactory { ...@@ -932,6 +931,33 @@ public final class ApiFactory {
.observeOn(AndroidSchedulers.mainThread()) .observeOn(AndroidSchedulers.mainThread())
.retryWhen(new RetryHelper(3)); .retryWhen(new RetryHelper(3));
} }
public static Observable<String> add(com.xingdata.zzdpos.model.Sskugrp sskugrp) {
return Api.getInstance().service.addSskugrp(sskugrp)
.onErrorReturn(new ErrorFilter<>())
.map(new ResultFilter<>())
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.retryWhen(new RetryHelper(3));
}
public static Observable<String> update(com.xingdata.zzdpos.model.Sskugrp sskugrp) {
return Api.getInstance().service.updateSskugrp(sskugrp)
.onErrorReturn(new ErrorFilter<>())
.map(new ResultFilter<>())
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.retryWhen(new RetryHelper(3));
}
public static Observable<String> delete(Long skuGrpId) {
return Api.getInstance().service.deleteSskugrp(skuGrpId)
.onErrorReturn(new ErrorFilter<>())
.map(new ResultFilter<>())
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.retryWhen(new RetryHelper(3));
}
} }
public static class User { public static class User {
......
...@@ -11,7 +11,6 @@ import com.xingdata.zzdpos.model.Gbound; ...@@ -11,7 +11,6 @@ import com.xingdata.zzdpos.model.Gbound;
import com.xingdata.zzdpos.model.Level; import com.xingdata.zzdpos.model.Level;
import com.xingdata.zzdpos.model.Ms; import com.xingdata.zzdpos.model.Ms;
import com.xingdata.zzdpos.model.Mscard; import com.xingdata.zzdpos.model.Mscard;
import com.xingdata.zzdpos.model.NewSssku;
import com.xingdata.zzdpos.model.Notice; import com.xingdata.zzdpos.model.Notice;
import com.xingdata.zzdpos.model.Oper; import com.xingdata.zzdpos.model.Oper;
import com.xingdata.zzdpos.model.Ossku; import com.xingdata.zzdpos.model.Ossku;
...@@ -197,7 +196,7 @@ interface ApiService { ...@@ -197,7 +196,7 @@ interface ApiService {
("pageSize") int pageSize); ("pageSize") int pageSize);
@POST(C.URL.RCTRACE.query) @POST(C.URL.RCTRACE.query)
Observable<HttpMessage<Pager<VipRechargeOrder>>> queryRecharge(@Query("vipId") long vipId,@Query("pageNumber") int pageNum, @Query Observable<HttpMessage<Pager<VipRechargeOrder>>> queryRecharge(@Query("vipId") long vipId, @Query("pageNumber") int pageNum, @Query
("pageSize") int pageSize); ("pageSize") int pageSize);
@POST(C.URL.RCTRACE.query) @POST(C.URL.RCTRACE.query)
...@@ -361,6 +360,15 @@ interface ApiService { ...@@ -361,6 +360,15 @@ interface ApiService {
@POST(C.URL.SSKUGRP.query) @POST(C.URL.SSKUGRP.query)
Observable<HttpMessage<Pager<Sskugrp>>> querySskugrp(); Observable<HttpMessage<Pager<Sskugrp>>> querySskugrp();
@POST(C.URL.SSKUGRP.add)
Observable<HttpMessage<String>> addSskugrp(@Body Sskugrp sskugrp);
@POST(C.URL.SSKUGRP.update)
Observable<HttpMessage<String>> updateSskugrp(@Body Sskugrp sskugrp);
@POST(C.URL.SSKUGRP.delete)
Observable<HttpMessage<String>> deleteSskugrp(@Query("id") Long skuGrpId);
@POST(C.URL.MS.query) @POST(C.URL.MS.query)
Observable<HttpMessage<Pager<Ms>>> queryMs(@Query("pageNumber") int pageNumber, Observable<HttpMessage<Pager<Ms>>> queryMs(@Query("pageNumber") int pageNumber,
@Query("pageSize") int pageSize, @Query("pageSize") int pageSize,
...@@ -379,13 +387,13 @@ interface ApiService { ...@@ -379,13 +387,13 @@ interface ApiService {
Observable<HttpMessage<List<Cor>>> queryAllCor(); Observable<HttpMessage<List<Cor>>> queryAllCor();
@POST(C.URL.SSSKU.add) @POST(C.URL.SSSKU.add)
Observable<HttpMessage<Sssku>> addSssku(@Body NewSssku sssku); Observable<HttpMessage<Sssku>> addSssku(@Body Sssku sssku);
@POST(C.URL.SSSKU.detail) @POST(C.URL.SSSKU.detail)
Observable<HttpMessage<Sssku>> detailSssku(@Query("id") Long id); Observable<HttpMessage<Sssku>> detailSssku(@Query("id") Long id);
@POST(C.URL.SSSKU.update) @POST(C.URL.SSSKU.update)
Observable<HttpMessage<Sssku>> updateSssku(@Body NewSssku sssku); Observable<HttpMessage<Sssku>> updateSssku(@Body Sssku sssku);
@POST(C.URL.LEVEL.add) @POST(C.URL.LEVEL.add)
Observable<HttpMessage<Level>> addVipLevel(@Body Level l); Observable<HttpMessage<Level>> addVipLevel(@Body Level l);
......
...@@ -5,6 +5,7 @@ import com.xingdata.api.print.entity.BaseOrderPrint; ...@@ -5,6 +5,7 @@ import com.xingdata.api.print.entity.BaseOrderPrint;
import com.xingdata.zzdpos.db.DB; import com.xingdata.zzdpos.db.DB;
import com.xingdata.zzdpos.ui.login.LoginPresenter; import com.xingdata.zzdpos.ui.login.LoginPresenter;
import com.xingdata.zzdpos.ui.main.MainPresenter; import com.xingdata.zzdpos.ui.main.MainPresenter;
import com.xingdata.zzdpos.ui.marketing.ms.model.BaseBean;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
...@@ -14,7 +15,7 @@ import java.util.List; ...@@ -14,7 +15,7 @@ import java.util.List;
* 盘库记录类 * 盘库记录类
*/ */
public class Cs implements BaseOrderPrint { public class Cs implements BaseOrderPrint, com.xingdata.zzdpos.base.BaseBean {
/** /**
* channelMapId : 0 * channelMapId : 0
......
package com.xingdata.zzdpos.model; package com.xingdata.zzdpos.model;
import com.xingdata.api.print.entity.BaseGoodPrint; import com.xingdata.api.print.entity.BaseGoodPrint;
import com.xingdata.zzdpos.base.BaseBean;
/** /**
* Created by Administrator on 2017/12/1. * Created by Administrator on 2017/12/1.
*/ */
public class CsDetail implements BaseGoodPrint { public class CsDetail implements BaseGoodPrint ,BaseBean{
/** /**
......
...@@ -11,7 +11,6 @@ import io.realm.annotations.PrimaryKey; ...@@ -11,7 +11,6 @@ import io.realm.annotations.PrimaryKey;
public class Sskugrp extends RealmObject implements BaseModel, BaseBean { public class Sskugrp extends RealmObject implements BaseModel, BaseBean {
/** /**
* 创建默认分组 * 创建默认分组
* *
...@@ -116,4 +115,9 @@ public class Sskugrp extends RealmObject implements BaseModel, BaseBean { ...@@ -116,4 +115,9 @@ public class Sskugrp extends RealmObject implements BaseModel, BaseBean {
public String getPrimaryKey() { public String getPrimaryKey() {
return "skuGrpId"; return "skuGrpId";
} }
@Override
public String toString() {
return getSkuGrpName();
}
} }
\ No newline at end of file
...@@ -42,6 +42,7 @@ public class MainActivity extends BaseActivity<MainPresenter, ActivityMainBindin ...@@ -42,6 +42,7 @@ public class MainActivity extends BaseActivity<MainPresenter, ActivityMainBindin
private List<ItemMenuBottomBinding> itemMenuBottomBindings = new ArrayList<>(); private List<ItemMenuBottomBinding> itemMenuBottomBindings = new ArrayList<>();
private HandoverDialog mHandoverDialog = new HandoverDialog(); private HandoverDialog mHandoverDialog = new HandoverDialog();
LoadingDialog mLoadingDialog = new LoadingDialog(); LoadingDialog mLoadingDialog = new LoadingDialog();
@Override @Override
public int getLayoutId() { public int getLayoutId() {
return R.layout.activity_main; return R.layout.activity_main;
...@@ -49,7 +50,7 @@ public class MainActivity extends BaseActivity<MainPresenter, ActivityMainBindin ...@@ -49,7 +50,7 @@ public class MainActivity extends BaseActivity<MainPresenter, ActivityMainBindin
@Override @Override
public void initView() { public void initView() {
mainActivity=this; mainActivity = this;
mPresenter.initHandoverInfo(); mPresenter.initHandoverInfo();
List<BaseFragment> fragments = new ArrayList<>(); List<BaseFragment> fragments = new ArrayList<>();
fragments.add(new CasherFragment()); fragments.add(new CasherFragment());
...@@ -163,4 +164,9 @@ public class MainActivity extends BaseActivity<MainPresenter, ActivityMainBindin ...@@ -163,4 +164,9 @@ public class MainActivity extends BaseActivity<MainPresenter, ActivityMainBindin
public void showHandoverDialog() { public void showHandoverDialog() {
mHandoverDialog.show(this); mHandoverDialog.show(this);
} }
@Override
public void onBackPressedSupport() {
}
} }
package com.xingdata.zzdpos.ui.manage.inventory; package com.xingdata.zzdpos.ui.manage.inventory;
import android.content.Intent;
import com.blankj.utilcode.util.ActivityUtils; import com.blankj.utilcode.util.ActivityUtils;
import com.blankj.utilcode.util.FragmentUtils;
import com.blankj.utilcode.util.KeyboardUtils; import com.blankj.utilcode.util.KeyboardUtils;
import com.xingdata.zzdpos.R; import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseActivity; import com.xingdata.zzdpos.base.BaseActivity;
...@@ -9,13 +11,15 @@ import com.xingdata.zzdpos.databinding.ActivityInventoryBinding; ...@@ -9,13 +11,15 @@ import com.xingdata.zzdpos.databinding.ActivityInventoryBinding;
import com.xingdata.zzdpos.model.Cs; import com.xingdata.zzdpos.model.Cs;
import com.xingdata.zzdpos.model.CsDetail; import com.xingdata.zzdpos.model.CsDetail;
import com.xingdata.zzdpos.model.Pager; import com.xingdata.zzdpos.model.Pager;
import com.xingdata.zzdpos.model.Saleorder;
import com.xingdata.zzdpos.model.Sssku; import com.xingdata.zzdpos.model.Sssku;
import com.xingdata.zzdpos.ui.dialog.LoadingDialog; import com.xingdata.zzdpos.ui.dialog.LoadingDialog;
import com.xingdata.zzdpos.ui.manage.inventory.fragment.InventoryAddFragment; import com.xingdata.zzdpos.ui.manage.inventory.fragment.InventoryAddFragment;
import com.xingdata.zzdpos.ui.manage.inventory.fragment.InventoryFragment; import com.xingdata.zzdpos.ui.manage.inventory.fragment.InventoryFragment;
import com.xingdata.zzdpos.ui.manage.manageMenu.ManageDateFragment; import com.xingdata.zzdpos.ui.manage.manageMenu.ManageDateFragment;
import com.xingdata.zzdpos.ui.statistics.fragment.StatisticsDateFragment; import com.xingdata.zzdpos.ui.statistics.StatisticsDetailActivity;
import java.util.List; import java.util.List;
...@@ -23,8 +27,7 @@ import java.util.List; ...@@ -23,8 +27,7 @@ import java.util.List;
public class InventoryActivity extends BaseActivity<InventoryPresenter, ActivityInventoryBinding> implements InventoryContract.View { public class InventoryActivity extends BaseActivity<InventoryPresenter, ActivityInventoryBinding> implements InventoryContract.View {
private InventoryFragment mInventoryFragment = new InventoryFragment(); private InventoryFragment mInventoryFragment = new InventoryFragment();
private ManageDateFragment mManageDateFragment = new ManageDateFragment(); private ManageDateFragment mManageDateFragment = new ManageDateFragment();
private InventoryAddFragment mInventoryAddFragment = new InventoryAddFragment(); private InventoryAddFragment mInventoryAddFragment;
// private InventoryDetailDialog mInventoryDetailDialog = new InventoryDetailDialog();
LoadingDialog mLoadingDialog = new LoadingDialog(); LoadingDialog mLoadingDialog = new LoadingDialog();
@Override @Override
...@@ -61,8 +64,9 @@ public class InventoryActivity extends BaseActivity<InventoryPresenter, Activity ...@@ -61,8 +64,9 @@ public class InventoryActivity extends BaseActivity<InventoryPresenter, Activity
@Override @Override
public void showInventoryDetailDialog(Cs cs) { public void showInventoryDetailDialog(Cs cs) {
Intent intent = new Intent(InventoryActivity.this, StatisticsDetailActivity.class);
// mInventoryDetailDialog.setData(cs).show(this); intent.putExtra(Cs.class.getName(), cs);
ActivityUtils.startActivity(intent);
} }
@Override @Override
...@@ -82,10 +86,10 @@ public class InventoryActivity extends BaseActivity<InventoryPresenter, Activity ...@@ -82,10 +86,10 @@ public class InventoryActivity extends BaseActivity<InventoryPresenter, Activity
@Override @Override
public void disInventoryDetailFragment(Boolean idChange) { public void disInventoryDetailFragment(Boolean idChange) {
if (idChange) { if (idChange) {
// mInventoryAddFragment.pop(); mInventoryAddFragment.pop();
// mPresenter.refreshCs(); mInventoryFragment.onRefresh();
} else { } else {
// mInventoryAddFragment.pop(); mInventoryAddFragment.pop();
} }
} }
...@@ -103,6 +107,7 @@ public class InventoryActivity extends BaseActivity<InventoryPresenter, Activity ...@@ -103,6 +107,7 @@ public class InventoryActivity extends BaseActivity<InventoryPresenter, Activity
@Override @Override
public void openInventoryAddFragment(Cs cs) { public void openInventoryAddFragment(Cs cs) {
mInventoryAddFragment = new InventoryAddFragment();
mInventoryAddFragment.setCs(cs); mInventoryAddFragment.setCs(cs);
start(mInventoryAddFragment); start(mInventoryAddFragment);
} }
......
...@@ -180,9 +180,14 @@ public class InventoryPresenter extends InventoryContract.Presenter { ...@@ -180,9 +180,14 @@ public class InventoryPresenter extends InventoryContract.Presenter {
ApiFactory.Cs.querCsList(pageNum, nowPageSize, start, end).doFinally(() -> mView.isShowLoading(false)) ApiFactory.Cs.querCsList(pageNum, nowPageSize, start, end).doFinally(() -> mView.isShowLoading(false))
.subscribe(csPager -> { .subscribe(csPager -> {
//判断是否能加载更多 //判断是否能加载更多
mView.loadCs(csPager, start, end); if (csPager.getList().size() == 0) {
mView.setInventoryCount(com.blankj.utilcode.util.TimeUtils.millis2String(start, new SimpleDateFormat(StringUtil.defaultDatePattern)) + " ~ " + ToastUtils.showShort("没有盘库记录");
com.blankj.utilcode.util.TimeUtils.millis2String(end, new SimpleDateFormat(StringUtil.defaultDatePattern))); } else {
mView.loadCs(csPager, start, end);
mView.setInventoryCount(com.blankj.utilcode.util.TimeUtils.millis2String(start, new SimpleDateFormat(StringUtil.defaultDatePattern)) + " ~ " +
com.blankj.utilcode.util.TimeUtils.millis2String(end - 86400000L, new SimpleDateFormat(StringUtil.defaultDatePattern)));
}
}, throwable -> { }, throwable -> {
ToastUtils.showShort(throwable.getMessage()); ToastUtils.showShort(throwable.getMessage());
......
...@@ -26,15 +26,10 @@ public class InventoryAdapter extends BaseAdapter<Cs, ItemInventoryBinding> { ...@@ -26,15 +26,10 @@ public class InventoryAdapter extends BaseAdapter<Cs, ItemInventoryBinding> {
@Override @Override
protected void convert(ItemInventoryBinding mViewBinding, Cs item) { protected void convert(ItemInventoryBinding mViewBinding, Cs item) {
Drawable drawable = mContext.getResources().getDrawable(R.mipmap.icon_time);
drawable.setBounds(0, 0, (int) mViewBinding.tvDate.getTextSize(), (int) mViewBinding.tvDate.getTextSize());
mViewBinding.tvDate.setCompoundDrawablesRelative(drawable, null, null, null);
mViewBinding.tvDate.setCompoundDrawablePadding(10);
mViewBinding.tvName.setText(item.getOperName()); mViewBinding.tvName.setText(item.getOperName());
mViewBinding.tvPhone.setText(item.getOper_mobile()); mViewBinding.tvPhone.setText(item.getOper_mobile());
mViewBinding.tvDate.setText(TimeUtils.millis2String(item.getCreateTime()) + ""); mViewBinding.tvDate.setText(TimeUtils.millis2String(item.getCreateTime()) + "");
mViewBinding.tvNum.setText(item.getCount() + ""); mViewBinding.tvNum.setText(item.getCsdetailCount() + "");
switch (item.getCsResultFlag()) { switch (item.getCsResultFlag()) {
case 0: case 0:
mViewBinding.tvResult.setText("相符"); mViewBinding.tvResult.setText("相符");
......
...@@ -4,11 +4,8 @@ import com.xingdata.zzdpos.R; ...@@ -4,11 +4,8 @@ import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseAdapter; import com.xingdata.zzdpos.base.BaseAdapter;
import com.xingdata.zzdpos.base.BaseViewHolder; import com.xingdata.zzdpos.base.BaseViewHolder;
import com.xingdata.zzdpos.databinding.ItemInventoryCartBinding; import com.xingdata.zzdpos.databinding.ItemInventoryCartBinding;
import com.xingdata.zzdpos.databinding.ItemStoreSaledetailBinding;
import com.xingdata.zzdpos.model.CsDetail; import com.xingdata.zzdpos.model.CsDetail;
import com.xingdata.zzdpos.model.Saledetail;
import com.xingdata.zzdpos.ui.store.dialog.CartDialog;
import com.xingdata.zzdpos.util.ConvertUtil;
import java.util.List; import java.util.List;
...@@ -18,21 +15,11 @@ public class InventoryCartAdapter extends BaseAdapter<CsDetail, ItemInventoryCar ...@@ -18,21 +15,11 @@ public class InventoryCartAdapter extends BaseAdapter<CsDetail, ItemInventoryCar
super(R.layout.item_inventory_cart, csDetailList); super(R.layout.item_inventory_cart, csDetailList);
} }
private CartDialog.OnCountChangeListener mOnCountChangeListener;
public void setOnCountChangeListener(CartDialog.OnCountChangeListener onCountChangeListener) {
this.mOnCountChangeListener = onCountChangeListener;
}
@Override @Override
protected void convert(ItemInventoryCartBinding mViewBinding, CsDetail item) { protected void convert(ItemInventoryCartBinding mViewBinding, CsDetail item) {
mViewBinding.tvName.setText(item.getSpuName()); mViewBinding.tvName.setText(item.getSpuName());
mViewBinding.setCount(item.getCsCnt() + item.getSpuUnitName());
mViewBinding.setCount(item.getCsCnt());
} }
......
//package com.xingdata.zzdpos.ui.manage.inventory.adpter; package com.xingdata.zzdpos.ui.manage.inventory.adpter;
//
//
//import android.support.annotation.Nullable; import android.support.annotation.Nullable;
//import android.view.View; import android.view.View;
//import android.view.ViewGroup; import android.view.ViewGroup;
//
//
//import java.util.List; import com.xingdata.zzdpos.R;
// import com.xingdata.zzdpos.base.BaseAdapter;
//public class InventoryDetailAdapter extends BaseAdapter<CsDetail, ItemInventoryLeftBinding> { import com.xingdata.zzdpos.databinding.ItemInventoryLeftBinding;
// private int count = 1; import com.xingdata.zzdpos.model.CsDetail;
//
// public InventoryDetailAdapter(@Nullable List<CsDetail> data) { import java.util.List;
// super(R.layout.item_inventory_left, data);
// public class InventoryDetailAdapter extends BaseAdapter<CsDetail, ItemInventoryLeftBinding> {
// } private int count = 1;
//
// public InventoryDetailAdapter(@Nullable List<CsDetail> data) {
// @Override super(R.layout.item_inventory_left, data);
// protected void convert(ItemInventoryLeftBinding mViewBinding, CsDetail item) {
// }
// mViewBinding.tvName.setText(item.getSpuName());
// mViewBinding.tvStockCount.setText(item.getSkuCnt() + "");
// mViewBinding.tvResultCount.setText(item.getCsCnt() + ""); @Override
// switch (item.getCsResultFlag()) { protected void convert(ItemInventoryLeftBinding mViewBinding, CsDetail item) {
// case 0://相等
// mViewBinding.imgResult.setImageResource(R.mipmap.icon_mark_equal); mViewBinding.tvName.setText(item.getSpuName());
// break; mViewBinding.tvStockCount.setText(item.getSkuCnt() + "");
// case 1://盘多 mViewBinding.tvResultCount.setText(item.getCsCnt() + "");
// mViewBinding.imgResult.setImageResource(R.mipmap.icon_mark_offer_more); switch (item.getCsResultFlag()) {
// break; case 0://相等
// case 2://盘少 mViewBinding.imgResult.setImageResource(R.mipmap.icon_mark_equal);
// mViewBinding.imgResult.setImageResource(R.mipmap.icon_mark_offer_less); break;
// break; case 1://盘多
// } mViewBinding.imgResult.setImageResource(R.mipmap.icon_mark_offer_more);
// } break;
// case 2://盘少
// @Override mViewBinding.imgResult.setImageResource(R.mipmap.icon_mark_offer_less);
// protected View getItemView(int layoutResId, ViewGroup parent) { break;
// return super.getItemView(layoutResId, parent); }
// } }
//
// @Override
//} protected View getItemView(int layoutResId, ViewGroup parent) {
return super.getItemView(layoutResId, parent);
}
}
...@@ -5,25 +5,22 @@ import android.support.v7.widget.LinearLayoutManager; ...@@ -5,25 +5,22 @@ import android.support.v7.widget.LinearLayoutManager;
import com.xingdata.zzdpos.R; import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseSheetDialog; import com.xingdata.zzdpos.base.BaseSheetDialog;
import com.xingdata.zzdpos.databinding.DialogStoreCartBinding; import com.xingdata.zzdpos.databinding.DialogInventoryCartBinding;
import com.xingdata.zzdpos.model.CsDetail; import com.xingdata.zzdpos.model.CsDetail;
import com.xingdata.zzdpos.model.Saledetail;
import com.xingdata.zzdpos.model.Saleorder; import com.xingdata.zzdpos.ui.manage.inventory.InventoryPresenter;
import com.xingdata.zzdpos.ui.manage.inventory.adpter.InventoryCartAdapter; import com.xingdata.zzdpos.ui.manage.inventory.adpter.InventoryCartAdapter;
import com.xingdata.zzdpos.ui.store.StorePresenter;
import com.xingdata.zzdpos.ui.store.adapter.SaledetailAdapter;
import java.util.List; import java.util.List;
public class CsCartDialog extends BaseSheetDialog<StorePresenter, DialogStoreCartBinding> { public class CsCartDialog extends BaseSheetDialog<InventoryPresenter, DialogInventoryCartBinding> {
private List<CsDetail> mCsDetails; private List<CsDetail> mCsDetails;
private String result;
public interface OnCountChangeListener {
void onCountChange(Saledetail saledetail, int value);
}
@Override @Override
protected boolean isTransparentBackground() { protected boolean isTransparentBackground() {
...@@ -32,22 +29,35 @@ public class CsCartDialog extends BaseSheetDialog<StorePresenter, DialogStoreCar ...@@ -32,22 +29,35 @@ public class CsCartDialog extends BaseSheetDialog<StorePresenter, DialogStoreCar
@Override @Override
public int getLayoutId() { public int getLayoutId() {
return R.layout.dialog_store_cart; return R.layout.dialog_inventory_cart;
} }
@Override @Override
public void initView() { public void initView() {
;
// init C // init C
InventoryCartAdapter mInventoryCartAdapter = new InventoryCartAdapter(mCsDetails); InventoryCartAdapter mInventoryCartAdapter = new InventoryCartAdapter(mCsDetails);
mViewBinding.rlCart.setAdapter(mInventoryCartAdapter); mViewBinding.rlCart.setAdapter(mInventoryCartAdapter);
mViewBinding.rlCart.setLayoutManager(new LinearLayoutManager(mContext)); mViewBinding.rlCart.setLayoutManager(new LinearLayoutManager(mContext));
mViewBinding.setCartCount(getCount());
mViewBinding.setResult(result);
// set Other listener // set Other listener
mViewBinding.tvSettle.setOnClickListener(view -> mPresenter.clickSettle()); mViewBinding.tvOk.setOnClickListener(view -> mPresenter.exitInventoryAdd());
mViewBinding.tvClear.setOnClickListener(view -> mPresenter.clearCart());
}
public void setResult(String s) {
result = s;
}
private int getCount() {
long i = 0;
for (CsDetail csDetail : mCsDetails) {
i = i + csDetail.getCsCnt();
}
return (int) i;
} }
@Override @Override
...@@ -58,14 +68,13 @@ public class CsCartDialog extends BaseSheetDialog<StorePresenter, DialogStoreCar ...@@ -58,14 +68,13 @@ public class CsCartDialog extends BaseSheetDialog<StorePresenter, DialogStoreCar
} }
public CsCartDialog setSaledetails(List<CsDetail> csDetailList) { public CsCartDialog setCsDetails(List<CsDetail> csDetailList) {
this.mCsDetails = csDetailList; this.mCsDetails = csDetailList;
return this; return this;
} }
@Override @Override
public void onDestroyView() { public void onDestroyView() {
mPresenter.exitCartDialog();
super.onDestroyView(); super.onDestroyView();
} }
......
//package com.xingdata.zzdpos.ui.manage.inventory.dialog;
//
//import android.support.v7.widget.LinearLayoutManager;
//import android.view.View;
//
//import com.blankj.utilcode.util.TimeUtils;
//import com.blankj.utilcode.util.ToastUtils;
//import com.xingdata.api.print.ZX_PrintPOS;
//import com.xingdata.zzdhd.R;
//import com.xingdata.zzdhd.base.BaseDialog;
//import com.xingdata.zzdhd.databinding.DialogInventoryDetailBinding;
//import com.xingdata.zzdhd.model.Cs;
//import com.xingdata.zzdhd.model.CsDetail;
//import com.xingdata.zzdhd.ui.manager.inventory.InventoryPresenter;
//import com.xingdata.zzdhd.ui.manager.inventory.adpter.InventoryDetailAdapter;
//
//import java.util.ArrayList;
//import java.util.List;
//
///**
// * Created by Administrator on 2017/12/4.
// */
//
//public class InventoryDetailDialog extends BaseDialog<InventoryPresenter, DialogInventoryDetailBinding> {
// private InventoryDetailAdapter mInventoryDetailAdapter;
// private List<CsDetail> csDetails = new ArrayList<>();
// private Cs cs;
// private long mExitTime=0;
//
//
// @Override
// public int getLayoutId() {
// return R.layout.dialog_inventory_detail;
// }
//
// @Override
// public void initView() {
// initLeftRecycler();
// if (cs == null) {
// ToastUtils.showShort("未获取到相关数据");
// return;
// }
// setBtnName("取消", "打印清单");
// mViewBinding.setOperName(cs.getOperName());
// mViewBinding.setDate(TimeUtils.millis2String(cs.getCreateTime()));
// mViewBinding.setSumNum(cs.getCount() + "");
// switch (cs.getCsResultFlag()) {
// case 0:
// mViewBinding.setFinallyResult("相符");
// break;
// case 1:
// mViewBinding.setFinallyResult("不相符");
// break;
// }
// csDetails.clear();
// csDetails.addAll(cs.getCsdetailList());
// mInventoryDetailAdapter.notifyDataSetChanged();
// getDialog().setCanceledOnTouchOutside(false);
//
// }
//
// @Override
// protected boolean isShowTitle() {
// return false;
// }
//
// public InventoryDetailDialog setData(Cs csDetailList) {
// this.cs = csDetailList;
// return this;
// }
//
// private void initLeftRecycler() {
// mViewBinding.replenishmentLeftRecycler.setLayoutManager(new LinearLayoutManager(getActivity()));
// mInventoryDetailAdapter = new InventoryDetailAdapter(csDetails);
// mViewBinding.replenishmentLeftRecycler.setAdapter(mInventoryDetailAdapter);
// }
//
// @Override
// public void onConfirmClick(View view) {
// if ((System.currentTimeMillis() - mExitTime) > 2000) {
// ZX_PrintPOS.getInstance(mContext).printInventory(1,cs);
// } else {
//
// }
// super.onConfirmClick(view);
// }
//}
package com.xingdata.zzdpos.ui.manage.inventory.fragment; package com.xingdata.zzdpos.ui.manage.inventory.fragment;
import android.graphics.drawable.Drawable;
import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.LinearLayoutManager;
import android.view.KeyEvent; import android.view.KeyEvent;
import android.view.View; import android.view.View;
import android.view.inputmethod.EditorInfo; import android.view.inputmethod.EditorInfo;
import android.widget.TextView; import android.widget.TextView;
import com.blankj.utilcode.util.KeyboardUtils;
import com.blankj.utilcode.util.TimeUtils;
import com.blankj.utilcode.util.ToastUtils; import com.blankj.utilcode.util.ToastUtils;
import com.xingdata.api.print.ZX_PrintPOS;
import com.xingdata.zzdpos.R; import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseActivity; import com.xingdata.zzdpos.base.BaseActivity;
import com.xingdata.zzdpos.base.BaseFragment; import com.xingdata.zzdpos.base.BaseFragment;
import com.xingdata.zzdpos.databinding.FragmentInventoryAddBinding; import com.xingdata.zzdpos.databinding.FragmentInventoryAddBinding;
import com.xingdata.zzdpos.model.Cs; import com.xingdata.zzdpos.model.Cs;
import com.xingdata.zzdpos.model.CsDetail; import com.xingdata.zzdpos.model.CsDetail;
import com.xingdata.zzdpos.model.Saledetail;
import com.xingdata.zzdpos.model.Sssku; import com.xingdata.zzdpos.model.Sssku;
import com.xingdata.zzdpos.ui.dialog.PromptDialog; import com.xingdata.zzdpos.ui.dialog.PromptDialog;
import com.xingdata.zzdpos.ui.manage.inventory.InventoryPresenter; import com.xingdata.zzdpos.ui.manage.inventory.InventoryPresenter;
import com.xingdata.zzdpos.ui.manage.inventory.adpter.InventoryGoodsAdapter; import com.xingdata.zzdpos.ui.manage.inventory.adpter.InventoryGoodsAdapter;
import com.xingdata.zzdpos.ui.manage.inventory.dialog.CsCartDialog; import com.xingdata.zzdpos.ui.manage.inventory.dialog.CsCartDialog;
import com.xingdata.zzdpos.util.OnClickListener; import com.xingdata.zzdpos.util.OnClickListener;
import com.xingdata.zzdpos.util.RecyclerViewUtil;
import java.util.ArrayList; import java.util.ArrayList;
...@@ -56,7 +56,7 @@ public class InventoryAddFragment extends BaseFragment<InventoryPresenter, Fragm ...@@ -56,7 +56,7 @@ public class InventoryAddFragment extends BaseFragment<InventoryPresenter, Fragm
initRecycler(); initRecycler();
mViewBinding.setCartCount(0); mViewBinding.setCartCount(0);
mViewBinding.icTitle.edTitle.setHint(R.string.inventory_add_et_hint);
mViewBinding.icTitle.edTitle.setOnEditorActionListener(new TextView.OnEditorActionListener() { mViewBinding.icTitle.edTitle.setOnEditorActionListener(new TextView.OnEditorActionListener() {
@Override @Override
public boolean onEditorAction(TextView textView, int i, KeyEvent keyEvent) { public boolean onEditorAction(TextView textView, int i, KeyEvent keyEvent) {
...@@ -73,25 +73,24 @@ public class InventoryAddFragment extends BaseFragment<InventoryPresenter, Fragm ...@@ -73,25 +73,24 @@ public class InventoryAddFragment extends BaseFragment<InventoryPresenter, Fragm
if (bottomCsList.size() == 0) { if (bottomCsList.size() == 0) {
return; return;
} }
mCartDialog.setSaledetails(bottomCsList).show((BaseActivity) getActivity()); mCartDialog.setCsDetails(bottomCsList).show((BaseActivity) getActivity());
}
});
mViewBinding.btnEnd.setOnClickListener(view -> {
mPresenter.exitInventoryAdd();
});
mViewBinding.icTitle.setOnClickListener(new OnClickListener() {
@Override
protected void myOnClickListener(View v) {
PromptDialog promptDialog = new PromptDialog();
promptDialog.setDialogType(PromptDialog.PROMPTDIALOG_SELECT, "退出前是否删除本次盘库记录").setClick(view1 -> {
mPresenter.cancelInventoryAdd(mCs);
promptDialog.dismiss();
}, view1 -> {
promptDialog.dismiss();
}).setCancelables(false).show((BaseActivity) mContext);
} }
}); });
// mViewBinding.btnEnd.setOnClickListener(view -> {
// mPresenter.exitInventoryAdd();
// });
// mViewBinding.btnDel.setOnClickListener(view -> {
// {
// PromptDialog promptDialog = new PromptDialog();
// promptDialog.setDialogType(PromptDialog.PROMPTDIALOG_SELECT, "请确认删除本次盘库记录").setClick(view1 -> {
// mPresenter.cancelInventoryAdd(mCs);
// promptDialog.dismiss();
// }, view1 -> {
// promptDialog.dismiss();
// }).setCancelables(false).show((BaseActivity) mContext);
//
// }
//
// });
// mViewBinding.btnPrint.setOnClickListener(new OnClickListener() { // mViewBinding.btnPrint.setOnClickListener(new OnClickListener() {
// @Override // @Override
// protected void myOnClickListener(View v) { // protected void myOnClickListener(View v) {
...@@ -138,6 +137,8 @@ public class InventoryAddFragment extends BaseFragment<InventoryPresenter, Fragm ...@@ -138,6 +137,8 @@ public class InventoryAddFragment extends BaseFragment<InventoryPresenter, Fragm
} }
}); });
Drawable drawable = getResources().getDrawable(R.drawable.singleline_zhouyu_huanggai);
mViewBinding.recyclerView.addItemDecoration(new RecyclerViewUtil.ListCardItemDecoration(getActivity(), 50, drawable));
mViewBinding.recyclerView.setAdapter(mInventoryGoodsAdapter); mViewBinding.recyclerView.setAdapter(mInventoryGoodsAdapter);
} }
...@@ -186,8 +187,10 @@ public class InventoryAddFragment extends BaseFragment<InventoryPresenter, Fragm ...@@ -186,8 +187,10 @@ public class InventoryAddFragment extends BaseFragment<InventoryPresenter, Fragm
mInventoryGoodsAdapter.notifyDataSetChanged(); mInventoryGoodsAdapter.notifyDataSetChanged();
if (isResult) { if (isResult) {
mViewBinding.setResult("相符"); mViewBinding.setResult("相符");
mCartDialog.setResult("相符");
} else { } else {
mViewBinding.setResult("不相符"); mViewBinding.setResult("不相符");
mCartDialog.setResult("不相符");
} }
} }
...@@ -204,6 +207,20 @@ public class InventoryAddFragment extends BaseFragment<InventoryPresenter, Fragm ...@@ -204,6 +207,20 @@ public class InventoryAddFragment extends BaseFragment<InventoryPresenter, Fragm
mCs.setCsdetailList(bottomCsList); mCs.setCsdetailList(bottomCsList);
} }
@Override
public boolean onBackPressedSupport() {
PromptDialog promptDialog = new PromptDialog();
promptDialog.setDialogType(PromptDialog.PROMPTDIALOG_SELECT, "退出前是否删除本次盘库记录").setClick(view1 -> {
mPresenter.cancelInventoryAdd(mCs);
promptDialog.dismiss();
}, view1 -> {
promptDialog.dismiss();
pop();
}).setCancelables(false).show((BaseActivity) mContext);
return true;
}
public void searchGoodsSuc() { public void searchGoodsSuc() {
// mViewBinding.etKeyword.setText(""); // mViewBinding.etKeyword.setText("");
......
...@@ -2,6 +2,7 @@ package com.xingdata.zzdpos.ui.manage.inventory.fragment; ...@@ -2,6 +2,7 @@ package com.xingdata.zzdpos.ui.manage.inventory.fragment;
import android.databinding.DataBindingUtil; import android.databinding.DataBindingUtil;
import android.graphics.drawable.ColorDrawable; import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
import android.support.v7.widget.GridLayoutManager; import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.LinearLayoutManager;
import android.text.Html; import android.text.Html;
...@@ -26,7 +27,9 @@ import com.xingdata.zzdpos.ui.dialog.LoadingDialog; ...@@ -26,7 +27,9 @@ import com.xingdata.zzdpos.ui.dialog.LoadingDialog;
import com.xingdata.zzdpos.ui.dialog.PromptDialog; import com.xingdata.zzdpos.ui.dialog.PromptDialog;
import com.xingdata.zzdpos.ui.manage.inventory.InventoryPresenter; import com.xingdata.zzdpos.ui.manage.inventory.InventoryPresenter;
import com.xingdata.zzdpos.ui.manage.inventory.adpter.InventoryAdapter; import com.xingdata.zzdpos.ui.manage.inventory.adpter.InventoryAdapter;
import com.xingdata.zzdpos.util.MyMenuItemDecoration;
import com.xingdata.zzdpos.util.OnClickListener; import com.xingdata.zzdpos.util.OnClickListener;
import com.xingdata.zzdpos.util.RecyclerViewUtil;
import com.xingdata.zzdpos.util.StringUtil; import com.xingdata.zzdpos.util.StringUtil;
...@@ -46,7 +49,6 @@ public class InventoryFragment extends BaseFragment<InventoryPresenter, Fragment ...@@ -46,7 +49,6 @@ public class InventoryFragment extends BaseFragment<InventoryPresenter, Fragment
private Long end; private Long end;
@Override @Override
public int getLayoutId() { public int getLayoutId() {
return R.layout.fragment_inventory; return R.layout.fragment_inventory;
...@@ -67,7 +69,11 @@ public class InventoryFragment extends BaseFragment<InventoryPresenter, Fragment ...@@ -67,7 +69,11 @@ public class InventoryFragment extends BaseFragment<InventoryPresenter, Fragment
mViewBinding.recyclerInventory.setLayoutManager(new LinearLayoutManager(getActivity())); mViewBinding.recyclerInventory.setLayoutManager(new LinearLayoutManager(getActivity()));
mInventoryAdapter = new InventoryAdapter(new ArrayList<>()); mInventoryAdapter = new InventoryAdapter(new ArrayList<>());
mInventoryAdapter.setEmptyView(getEmptyView()); mInventoryAdapter.setEmptyView(getEmptyView());
mViewBinding.recyclerInventory.setAdapter(mInventoryAdapter); Drawable drawable = getResources().getDrawable(R.drawable.singleline_zhouyu_huanggai);
mInventoryAdapter.bindToRecyclerView( mViewBinding.recyclerInventory);
mViewBinding.recyclerInventory.addItemDecoration(new RecyclerViewUtil.ListCardItemDecoration(getActivity(), 50, drawable));
mViewBinding.srlProduct.setOnRefreshListener(this::onRefresh); mViewBinding.srlProduct.setOnRefreshListener(this::onRefresh);
mInventoryAdapter.setOnLoadMoreListener(this::onLoadMore, mViewBinding.recyclerInventory); mInventoryAdapter.setOnLoadMoreListener(this::onLoadMore, mViewBinding.recyclerInventory);
mInventoryAdapter.setOnItemClickListener((adapter, view, position) -> { mInventoryAdapter.setOnItemClickListener((adapter, view, position) -> {
...@@ -121,7 +127,7 @@ public class InventoryFragment extends BaseFragment<InventoryPresenter, Fragment ...@@ -121,7 +127,7 @@ public class InventoryFragment extends BaseFragment<InventoryPresenter, Fragment
mViewBinding.tvCount.setText(count); mViewBinding.tvCount.setText(count);
} }
private void onRefresh() { public void onRefresh() {
start = null; start = null;
end = null; end = null;
pageNum = 1; pageNum = 1;
...@@ -156,6 +162,12 @@ public class InventoryFragment extends BaseFragment<InventoryPresenter, Fragment ...@@ -156,6 +162,12 @@ public class InventoryFragment extends BaseFragment<InventoryPresenter, Fragment
if (pager.isLastPage()) mInventoryAdapter.loadMoreEnd(isRefresh); if (pager.isLastPage()) mInventoryAdapter.loadMoreEnd(isRefresh);
else mInventoryAdapter.loadMoreComplete(); else mInventoryAdapter.loadMoreComplete();
if (mInventoryAdapter.getData().size() == 0) {
mViewBinding.tvCount.setVisibility(View.GONE);
} else {
mViewBinding.tvCount.setVisibility(View.VISIBLE);
}
} }
...@@ -167,8 +179,6 @@ public class InventoryFragment extends BaseFragment<InventoryPresenter, Fragment ...@@ -167,8 +179,6 @@ public class InventoryFragment extends BaseFragment<InventoryPresenter, Fragment
} }
public void setDate(long start, long end) { public void setDate(long start, long end) {
this.start = start; this.start = start;
this.end = end; this.end = end;
......
package com.xingdata.zzdpos.ui.manage.otherselect; package com.xingdata.zzdpos.ui.manage.otherselect;
import android.text.InputType;
import android.view.KeyEvent; import android.view.KeyEvent;
import android.view.View; import android.view.View;
...@@ -30,6 +31,7 @@ public class OtherSelectActivity extends BaseActivity<OtherSelectPresenter, Acti ...@@ -30,6 +31,7 @@ public class OtherSelectActivity extends BaseActivity<OtherSelectPresenter, Acti
@Override @Override
public void initView() { public void initView() {
mViewBinding.lyTitle.ivRight.setVisibility(View.GONE); mViewBinding.lyTitle.ivRight.setVisibility(View.GONE);
mViewBinding.lyTitle.edTitle.setInputType(InputType.TYPE_CLASS_TEXT);
FragmentUtils.add(getSupportFragmentManager(), mOtherListFragment, mViewBinding.fragmentContainer.getId(), false, true); FragmentUtils.add(getSupportFragmentManager(), mOtherListFragment, mViewBinding.fragmentContainer.getId(), false, true);
mViewBinding.lyTitle.edTitle.setOnKeyListener((v, keyCode, event) -> { mViewBinding.lyTitle.edTitle.setOnKeyListener((v, keyCode, event) -> {
if (keyCode == KeyEvent.KEYCODE_ENTER) if (keyCode == KeyEvent.KEYCODE_ENTER)
......
...@@ -2,6 +2,7 @@ package com.xingdata.zzdpos.ui.manage.otherselect.fragment; ...@@ -2,6 +2,7 @@ package com.xingdata.zzdpos.ui.manage.otherselect.fragment;
import android.annotation.SuppressLint; import android.annotation.SuppressLint;
import android.content.Intent; import android.content.Intent;
import android.graphics.drawable.Drawable;
import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView; import android.support.v7.widget.RecyclerView;
import android.view.KeyEvent; import android.view.KeyEvent;
...@@ -20,6 +21,7 @@ import com.xingdata.zzdpos.model.Ossku; ...@@ -20,6 +21,7 @@ import com.xingdata.zzdpos.model.Ossku;
import com.xingdata.zzdpos.model.Pager; import com.xingdata.zzdpos.model.Pager;
import com.xingdata.zzdpos.ui.manage.otherselect.OtherSelectPresenter; import com.xingdata.zzdpos.ui.manage.otherselect.OtherSelectPresenter;
import com.xingdata.zzdpos.ui.manage.otherselect.adpter.OtherSelectAdapter; import com.xingdata.zzdpos.ui.manage.otherselect.adpter.OtherSelectAdapter;
import com.xingdata.zzdpos.util.RecyclerViewUtil;
import java.util.ArrayList; import java.util.ArrayList;
...@@ -46,7 +48,8 @@ public class OtherListFragment extends BaseFragment<OtherSelectPresenter, Fragme ...@@ -46,7 +48,8 @@ public class OtherListFragment extends BaseFragment<OtherSelectPresenter, Fragme
mOtherSelectAdapter.setEmptyView(getEmptyView(R.string.empty_other_select)); mOtherSelectAdapter.setEmptyView(getEmptyView(R.string.empty_other_select));
mViewBinding.recyclerOtherSelcet.setLayoutManager(new LinearLayoutManager(getActivity())); mViewBinding.recyclerOtherSelcet.setLayoutManager(new LinearLayoutManager(getActivity()));
mViewBinding.recyclerOtherSelcet.setAdapter(mOtherSelectAdapter); mViewBinding.recyclerOtherSelcet.setAdapter(mOtherSelectAdapter);
Drawable drawable = getResources().getDrawable(R.drawable.singleline_zhouyu_huanggai);
mViewBinding.recyclerOtherSelcet.addItemDecoration(new RecyclerViewUtil.ListCardItemDecoration(getActivity(), 50, drawable));
mOtherSelectAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() { mOtherSelectAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
@Override @Override
...@@ -84,12 +87,16 @@ public class OtherListFragment extends BaseFragment<OtherSelectPresenter, Fragme ...@@ -84,12 +87,16 @@ public class OtherListFragment extends BaseFragment<OtherSelectPresenter, Fragme
else if (pager.getList().size() > 0) mOtherSelectAdapter.addData(pager.getList()); else if (pager.getList().size() > 0) mOtherSelectAdapter.addData(pager.getList());
if (pager.isLastPage()) mOtherSelectAdapter.loadMoreEnd(isRefresh); if (pager.isLastPage()) mOtherSelectAdapter.loadMoreEnd(isRefresh);
else mOtherSelectAdapter.loadMoreComplete(); else mOtherSelectAdapter.loadMoreComplete();
if (mOtherSelectAdapter.getData().size() == 0) {
mViewBinding.viewLine.setVisibility(View.GONE);
} else {
mViewBinding.viewLine.setVisibility(View.VISIBLE);
}
} }
private View getEmptyView(int resHint) { private View getEmptyView(int resHint) {
View view = getLayoutInflater().inflate(R.layout.view_empty, null); View view = getLayoutInflater().inflate(R.layout.view_empty, null);
view.setBackgroundResource(R.color.white_caocao);
((TextView) view.findViewById(R.id.tv_empty)).setText(resHint); ((TextView) view.findViewById(R.id.tv_empty)).setText(resHint);
return view; return view;
} }
......
...@@ -55,13 +55,19 @@ public class ReplenishmentDetailFragment extends BaseFragment<ReplenishmentPrese ...@@ -55,13 +55,19 @@ public class ReplenishmentDetailFragment extends BaseFragment<ReplenishmentPrese
public void initView() { public void initView() {
mViewBinding.lyTitle.edTitle.setHint(R.string.inventory_add_et_hint); mViewBinding.lyTitle.edTitle.setHint(R.string.inventory_add_et_hint);
mViewBinding.lyTitle.edTitle.setText(""); mViewBinding.lyTitle.edTitle.setText("");
Drawable drawableTop = getResources().getDrawable(R.mipmap.but_up); Drawable drawableTop = getResources().getDrawable(R.mipmap.but_unfurled);
Drawable drawableBottom = getResources().getDrawable(R.mipmap.but_unfurled); Drawable drawableBottom = getResources().getDrawable(R.mipmap.but_up);
drawableTop.setBounds(0, 0, (int) mViewBinding.tvShopTitle.getTextSize() - 10, (int) mViewBinding.tvShopTitle.getTextSize() - 10); drawableTop.setBounds(0, 0, (int) mViewBinding.tvShopTitle.getTextSize() - 10, (int) mViewBinding.tvShopTitle.getTextSize() - 10);
drawableBottom.setBounds(0, 0, (int) mViewBinding.tvShopTitle.getTextSize() - 10, (int) mViewBinding.tvShopTitle.getTextSize() - 10); drawableBottom.setBounds(0, 0, (int) mViewBinding.tvShopTitle.getTextSize() - 10, (int) mViewBinding.tvShopTitle.getTextSize() - 10);
mViewBinding.tvShopTitle.setCompoundDrawables(null, null, drawableTop, null); mViewBinding.tvShopTitle.setCompoundDrawables(null, null, drawableTop, null);
mViewBinding.tvSupplierTitle.setCompoundDrawables(null, null, drawableTop, null); mViewBinding.tvSupplierTitle.setCompoundDrawables(null, null, drawableTop, null);
initRecycycler(); initRecycycler();
mViewBinding.lyTitle.setOnClickListener(new OnClickListener() {
@Override
protected void myOnClickListener(View v) {
pop();
}
});
mViewBinding.tvShopTitle.setOnClickListener(new OnClickListener() { mViewBinding.tvShopTitle.setOnClickListener(new OnClickListener() {
@Override @Override
protected void myOnClickListener(View v) { protected void myOnClickListener(View v) {
......
...@@ -2,6 +2,7 @@ package com.xingdata.zzdpos.ui.manage.replenishment.fragment; ...@@ -2,6 +2,7 @@ package com.xingdata.zzdpos.ui.manage.replenishment.fragment;
import android.content.Intent; import android.content.Intent;
import android.graphics.drawable.Drawable;
import android.os.Handler; import android.os.Handler;
import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.LinearLayoutManager;
import android.view.View; import android.view.View;
...@@ -23,6 +24,7 @@ import com.xingdata.zzdpos.ui.manage.replenishment.ReplenishmentPresenter; ...@@ -23,6 +24,7 @@ import com.xingdata.zzdpos.ui.manage.replenishment.ReplenishmentPresenter;
import com.xingdata.zzdpos.ui.manage.replenishment.adpter.ReplenishmentAdapter; import com.xingdata.zzdpos.ui.manage.replenishment.adpter.ReplenishmentAdapter;
import com.xingdata.zzdpos.ui.statistics.StatisticsDetailActivity; import com.xingdata.zzdpos.ui.statistics.StatisticsDetailActivity;
import com.xingdata.zzdpos.ui.statistics.adapter.StatisticsOrderGroupAdapter; import com.xingdata.zzdpos.ui.statistics.adapter.StatisticsOrderGroupAdapter;
import com.xingdata.zzdpos.util.RecyclerViewUtil;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
...@@ -42,15 +44,17 @@ public class ReplenishmentListFragment extends BaseFragment<ReplenishmentPresent ...@@ -42,15 +44,17 @@ public class ReplenishmentListFragment extends BaseFragment<ReplenishmentPresent
@Override @Override
public void initView() { public void initView() {
Drawable drawable = getResources().getDrawable(R.drawable.singleline_zhouyu_huanggai);
if (mReplenishmentAdapter == null) { if (mReplenishmentAdapter == null) {
mReplenishmentAdapter = new ReplenishmentAdapter(new ArrayList<>()); mReplenishmentAdapter = new ReplenishmentAdapter(new ArrayList<>());
mViewBinding.recycler.setLayoutManager(new LinearLayoutManager(getActivity())); mViewBinding.recycler.setLayoutManager(new LinearLayoutManager(getActivity()));
mViewBinding.recycler.setAdapter(mReplenishmentAdapter); mViewBinding.recycler.setAdapter(mReplenishmentAdapter);
mViewBinding.recycler.addItemDecoration(new RecyclerViewUtil.ListCardItemDecoration(getActivity(), 50, drawable));
} else { } else {
mViewBinding.recycler.setLayoutManager(new LinearLayoutManager(getActivity())); mViewBinding.recycler.setLayoutManager(new LinearLayoutManager(getActivity()));
mViewBinding.recycler.setAdapter(mReplenishmentAdapter); mViewBinding.recycler.setAdapter(mReplenishmentAdapter);
mViewBinding.recycler.addItemDecoration(new RecyclerViewUtil.ListCardItemDecoration(getActivity(), 50, drawable));
} }
mReplenishmentAdapter.setOnItemClickListener((adapter, view, position) -> { mReplenishmentAdapter.setOnItemClickListener((adapter, view, position) -> {
...@@ -63,7 +67,7 @@ public class ReplenishmentListFragment extends BaseFragment<ReplenishmentPresent ...@@ -63,7 +67,7 @@ public class ReplenishmentListFragment extends BaseFragment<ReplenishmentPresent
}); });
mViewBinding.srlProduct.setOnRefreshListener(this::onRefresh); mViewBinding.srlProduct.setOnRefreshListener(this::onRefresh);
setData(psbArrayList,true); setData(psbArrayList, true);
} }
private void onRefresh() { private void onRefresh() {
...@@ -85,10 +89,10 @@ public class ReplenishmentListFragment extends BaseFragment<ReplenishmentPresent ...@@ -85,10 +89,10 @@ public class ReplenishmentListFragment extends BaseFragment<ReplenishmentPresent
* @param isRefresh 是否刷新 * @param isRefresh 是否刷新
*/ */
public void setData(List<Psb> psbList, boolean isRefresh) { public void setData(List<Psb> psbList, boolean isRefresh) {
if (mReplenishmentAdapter==null){ if (mReplenishmentAdapter == null) {
this.psbArrayList=psbList; this.psbArrayList = psbList;
return; return;
} }
if (isRefresh) { if (isRefresh) {
mReplenishmentAdapter.setEnableLoadMore(true); mReplenishmentAdapter.setEnableLoadMore(true);
...@@ -106,13 +110,14 @@ public class ReplenishmentListFragment extends BaseFragment<ReplenishmentPresent ...@@ -106,13 +110,14 @@ public class ReplenishmentListFragment extends BaseFragment<ReplenishmentPresent
} }
public void setData(List<Psb> psbList){ public void setData(List<Psb> psbList) {
this.psbArrayList=psbList; this.psbArrayList = psbList;
} }
public void searchSucc(String wd) { public void searchSucc(String wd) {
List<Psb> psbs = new ArrayList<>(); List<Psb> psbs = new ArrayList<>();
if (psbArrayList .size()==0) { if (psbArrayList.size() == 0) {
return; return;
} }
for (Psb psb : psbArrayList) { for (Psb psb : psbArrayList) {
......
...@@ -2,15 +2,20 @@ package com.xingdata.zzdpos.ui.manage.sssku; ...@@ -2,15 +2,20 @@ package com.xingdata.zzdpos.ui.manage.sssku;
import android.view.inputmethod.EditorInfo; import android.view.inputmethod.EditorInfo;
import com.blankj.utilcode.util.ActivityUtils;
import com.blankj.utilcode.util.KeyboardUtils; import com.blankj.utilcode.util.KeyboardUtils;
import com.blankj.utilcode.util.StringUtils; import com.blankj.utilcode.util.StringUtils;
import com.blankj.utilcode.util.ToastUtils;
import com.xingdata.zzdpos.C; import com.xingdata.zzdpos.C;
import com.xingdata.zzdpos.R; import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseActivity; import com.xingdata.zzdpos.base.BaseActivity;
import com.xingdata.zzdpos.databinding.ActivitySsskuBinding; import com.xingdata.zzdpos.databinding.ActivitySsskuBinding;
import com.xingdata.zzdpos.model.Cor;
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.ui.dialog.LoadingDialog; import com.xingdata.zzdpos.ui.dialog.LoadingDialog;
import com.xingdata.zzdpos.ui.manage.replenishment.ReplenishmentActivity;
import com.xingdata.zzdpos.ui.manage.sssku.fragment.AddFragment;
import com.xingdata.zzdpos.ui.manage.sssku.fragment.DetailFragment; import com.xingdata.zzdpos.ui.manage.sssku.fragment.DetailFragment;
import com.xingdata.zzdpos.ui.manage.sssku.fragment.EditorFragment; import com.xingdata.zzdpos.ui.manage.sssku.fragment.EditorFragment;
import com.xingdata.zzdpos.ui.manage.sssku.fragment.ManagerFragment; import com.xingdata.zzdpos.ui.manage.sssku.fragment.ManagerFragment;
...@@ -25,6 +30,7 @@ public class SsskuActivity extends BaseActivity<SsskuPresenter, ActivitySsskuBin ...@@ -25,6 +30,7 @@ public class SsskuActivity extends BaseActivity<SsskuPresenter, ActivitySsskuBin
private SearchFragment mSearchFragment = new SearchFragment(); private SearchFragment mSearchFragment = new SearchFragment();
private SkugrpFragment mSkugrpFragment = new SkugrpFragment(); private SkugrpFragment mSkugrpFragment = new SkugrpFragment();
private AddFragment mAddFragment = new AddFragment();
private EditorFragment mEditorFragment = new EditorFragment(); private EditorFragment mEditorFragment = new EditorFragment();
private DetailFragment mDetailFragment = new DetailFragment(); private DetailFragment mDetailFragment = new DetailFragment();
...@@ -51,10 +57,21 @@ public class SsskuActivity extends BaseActivity<SsskuPresenter, ActivitySsskuBin ...@@ -51,10 +57,21 @@ public class SsskuActivity extends BaseActivity<SsskuPresenter, ActivitySsskuBin
return false; return false;
}); });
mViewBinding.etSearch.setOnFocusChangeListener((view, b) -> { mViewBinding.etSearch.setOnFocusChangeListener((view, b) -> {
mPresenter.searchBarFocusChanged(b); mPresenter.searchBarFocusChanged(b, C.TITLE_MODE.SKU);
}); });
mViewBinding.btnMenu.setOnClickListener(view -> {
mPresenter.clickSkuMenu();
});
}
@Override
public void onBackPressedSupport() {
} }
@Override
public void showMsg(String msg) {
ToastUtils.showShort(msg);
}
@Override @Override
public void loadSkus(List<Sssku> skus, boolean isRefresh) { public void loadSkus(List<Sssku> skus, boolean isRefresh) {
...@@ -64,6 +81,9 @@ public class SsskuActivity extends BaseActivity<SsskuPresenter, ActivitySsskuBin ...@@ -64,6 +81,9 @@ public class SsskuActivity extends BaseActivity<SsskuPresenter, ActivitySsskuBin
@Override @Override
public void loadSkugrps(List<Sskugrp> sskugrps) { public void loadSkugrps(List<Sskugrp> sskugrps) {
mManagerFragment.loadSkugrps(sskugrps); mManagerFragment.loadSkugrps(sskugrps);
mSkugrpFragment.loadSkugrps(sskugrps);
mDetailFragment.loadSkugrps(sskugrps);
mEditorFragment.loadSkugrps(sskugrps);
} }
@Override @Override
...@@ -86,32 +106,62 @@ public class SsskuActivity extends BaseActivity<SsskuPresenter, ActivitySsskuBin ...@@ -86,32 +106,62 @@ public class SsskuActivity extends BaseActivity<SsskuPresenter, ActivitySsskuBin
mSearchFragment.loadSkus(skus, isRefresh); mSearchFragment.loadSkus(skus, isRefresh);
} }
@Override
public void loadCors(List<Cor> cors) {
mDetailFragment.loadCors(cors);
mEditorFragment.loadCors(cors);
}
@Override
public void loadPkgSku(Sssku pkgSku) {
mEditorFragment.loadPkgSku(pkgSku);
}
@Override
public void loadCheckSkus(List<Sssku> ssskus) {
mAddFragment.loadCheckSkus(ssskus);
}
@Override @Override
public void showSearchFragment(int searchType) { public void showSearchFragment(int searchType) {
if (mSearchFragment.isAdded()) return; if (mSearchFragment.isAdded()) return;
mViewBinding.etSearch.requestFocus();
this.showTitleBarByTitleMode(searchType); this.showTitleBarByTitleMode(searchType);
this.start(mSearchFragment.setSearchType(searchType)); this.start(mSearchFragment.setSearchType(searchType));
} }
@Override @Override
public void showEditorFragment(Sssku sku) { public void showAddFragment() {
this.showTitleBarByTitleMode(C.TITLE_MODE.TEXT); this.showTitleBarByTitleMode(C.TITLE_MODE.TEXT);
mViewBinding.tvTitle.setText(R.string.sssku_update); mViewBinding.tvTitle.setText(R.string.sssku_add);
this.start(mEditorFragment); this.start(mAddFragment);
} }
@Override @Override
public void showEditorFragment() { public void showEditorFragment(Sssku sku, int editMode) {
this.showTitleBarByTitleMode(C.TITLE_MODE.TEXT); this.showTitleBarByTitleMode(C.TITLE_MODE.TEXT);
mViewBinding.tvTitle.setText(R.string.sssku_add); switch (editMode) {
this.start(mEditorFragment); case C.SKU_EDITOR_MODE.ADD:
mViewBinding.tvTitle.setText(R.string.sssku_add);
this.start(mEditorFragment.setSssku(sku).setEditMode(C.SKU_EDITOR_MODE.ADD));
break;
case C.SKU_EDITOR_MODE.UNKNOWN:
mViewBinding.tvTitle.setText(R.string.sssku_add);
this.start(mEditorFragment.setSssku(sku).setEditMode(C.SKU_EDITOR_MODE.UNKNOWN));
break;
case C.SKU_EDITOR_MODE.UPDATE:
mViewBinding.tvTitle.setText(R.string.sssku_update);
this.start(mEditorFragment.setSssku(sku).setEditMode(C.SKU_EDITOR_MODE.UPDATE));
break;
}
} }
@Override @Override
public void showDetailFragment(Sssku sku) { public void showDetailFragment(Sssku sku) {
this.showTitleBarByTitleMode(C.TITLE_MODE.SKU_DETAIL); this.showTitleBarByTitleMode(C.TITLE_MODE.SKU_DETAIL);
mViewBinding.tvTitle.setText(R.string.sssku_detail); mViewBinding.tvTitle.setText(R.string.sssku_detail);
this.start(mDetailFragment); this.start(mDetailFragment.setSssku(sku));
} }
@Override @Override
...@@ -121,15 +171,40 @@ public class SsskuActivity extends BaseActivity<SsskuPresenter, ActivitySsskuBin ...@@ -121,15 +171,40 @@ public class SsskuActivity extends BaseActivity<SsskuPresenter, ActivitySsskuBin
this.start(mSkugrpFragment); this.start(mSkugrpFragment);
} }
@Override
public void showSkuMenuDialog() {
mDetailFragment.showSkuMenuDialog();
}
@Override @Override
public void backToEditFragment() { public void backToEditFragment() {
this.showTitleBarByTitleMode(C.TITLE_MODE.TEXT); this.showTitleBarByTitleMode(C.TITLE_MODE.TEXT);
mViewBinding.tvTitle.setText(R.string.sssku_update);
this.pop();
} }
@Override @Override
public void backToManagerFragment() { public void backToManagerFragment() {
this.showTitleBarByTitleMode(C.TITLE_MODE.SKU); this.showTitleBarByTitleMode(C.TITLE_MODE.SKU);
this.resetSearchBar(); this.resetSearchBar();
this.pop();
}
@Override
public void backToDetailFragment() {
this.showTitleBarByTitleMode(C.TITLE_MODE.SKU_DETAIL);
mViewBinding.tvTitle.setText(R.string.sssku_detail);
this.pop();
}
@Override
public void addSku(Sssku sssku) {
mManagerFragment.addSku(sssku);
}
@Override
public void updateSku(Sssku sssku) {
mManagerFragment.updateSku(sssku);
} }
@Override @Override
...@@ -142,6 +217,11 @@ public class SsskuActivity extends BaseActivity<SsskuPresenter, ActivitySsskuBin ...@@ -142,6 +217,11 @@ public class SsskuActivity extends BaseActivity<SsskuPresenter, ActivitySsskuBin
mLoadingDialog.dismiss(); mLoadingDialog.dismiss();
} }
@Override
public void startReplenishmentActivity() {
ActivityUtils.startActivity(this, ReplenishmentActivity.class);
}
/** /**
* 根据titleMode显示TitleBar * 根据titleMode显示TitleBar
* *
...@@ -169,7 +249,5 @@ public class SsskuActivity extends BaseActivity<SsskuPresenter, ActivitySsskuBin ...@@ -169,7 +249,5 @@ public class SsskuActivity extends BaseActivity<SsskuPresenter, ActivitySsskuBin
private void resetSearchBar() { private void resetSearchBar() {
mViewBinding.etSearch.setText(""); mViewBinding.etSearch.setText("");
mViewBinding.clTitle.requestFocus(); mViewBinding.clTitle.requestFocus();
mViewBinding.clTitle.requestFocusFromTouch();
} }
} }
...@@ -3,6 +3,7 @@ package com.xingdata.zzdpos.ui.manage.sssku; ...@@ -3,6 +3,7 @@ package com.xingdata.zzdpos.ui.manage.sssku;
import com.xingdata.zzdpos.base.BasePresenter; import com.xingdata.zzdpos.base.BasePresenter;
import com.xingdata.zzdpos.base.BaseView; import com.xingdata.zzdpos.base.BaseView;
import com.xingdata.zzdpos.model.Cor;
import com.xingdata.zzdpos.model.Sskugrp; import com.xingdata.zzdpos.model.Sskugrp;
import com.xingdata.zzdpos.model.Sssku; import com.xingdata.zzdpos.model.Sssku;
...@@ -11,6 +12,14 @@ import java.util.List; ...@@ -11,6 +12,14 @@ import java.util.List;
public interface SsskuContract { public interface SsskuContract {
interface View extends BaseView { interface View extends BaseView {
/**
* 显示文字内容
*
* @param msg 要显示的内容
*/
void showMsg(String msg);
/** /**
* 加载商品 * 加载商品
* *
...@@ -53,22 +62,44 @@ public interface SsskuContract { ...@@ -53,22 +62,44 @@ public interface SsskuContract {
*/ */
void loadSearchResult(List<Sssku> skus, boolean isRefresh); void loadSearchResult(List<Sssku> skus, boolean isRefresh);
/**
* 加载供应商列表
*
* @param cors 供应商列表
*/
void loadCors(List<Cor> cors);
/**
* 加载包装内的商品
*
* @param pkgSku 包装内商品
*/
void loadPkgSku(Sssku pkgSku);
/**
* 加载检查出来的商品列表
*
* @param ssskus 商品信息
*/
void loadCheckSkus(List<Sssku> ssskus);
/** /**
* 显示搜索页面 * 显示搜索页面
*/ */
void showSearchFragment(int searchType); void showSearchFragment(int searchType);
/** /**
* 显示编辑页面 * 显示添加检查页面
*
* @param sku 要编辑的商品
*/ */
void showEditorFragment(Sssku sku); void showAddFragment();
/** /**
* 显示编辑页面 * 显示编辑页面
*
* @param sku 要编辑的商品
* @param editMode 编辑模式
*/ */
void showEditorFragment(); void showEditorFragment(Sssku sku, int editMode);
/** /**
* 显示详情页面 * 显示详情页面
...@@ -82,6 +113,11 @@ public interface SsskuContract { ...@@ -82,6 +113,11 @@ public interface SsskuContract {
*/ */
void showSkugrpFragment(); void showSkugrpFragment();
/**
* 显示商品菜单对话框
*/
void showSkuMenuDialog();
/** /**
* 返回编辑页面 * 返回编辑页面
*/ */
...@@ -92,6 +128,25 @@ public interface SsskuContract { ...@@ -92,6 +128,25 @@ public interface SsskuContract {
*/ */
void backToManagerFragment(); void backToManagerFragment();
/**
* 返回详情页面
*/
void backToDetailFragment();
/**
* 添加商品
*
* @param sssku 要添加的商品
*/
void addSku(Sssku sssku);
/**
* 更新商品
*
* @param sssku 更新商品
*/
void updateSku(Sssku sssku);
/** /**
* 显示读取对话框 * 显示读取对话框
*/ */
...@@ -102,6 +157,15 @@ public interface SsskuContract { ...@@ -102,6 +157,15 @@ public interface SsskuContract {
*/ */
void dismissLoadingDialog(); void dismissLoadingDialog();
/**
* 关闭所有对话框
*/
void dismissAllDialog();
/**
* 跳转到补货界面
*/
void startReplenishmentActivity();
} }
abstract class Presenter extends BasePresenter<View> { abstract class Presenter extends BasePresenter<View> {
...@@ -140,6 +204,7 @@ public interface SsskuContract { ...@@ -140,6 +204,7 @@ public interface SsskuContract {
*/ */
public abstract void clickAddSku(); public abstract void clickAddSku();
/** /**
* 管理页面 - 点击添加分组 * 管理页面 - 点击添加分组
*/ */
...@@ -150,6 +215,11 @@ public interface SsskuContract { ...@@ -150,6 +215,11 @@ public interface SsskuContract {
*/ */
public abstract void clickReplenish(); public abstract void clickReplenish();
/**
* 添加页面 - 检查条码
*/
public abstract void clickCheck(String barcode);
/** /**
* 搜索页面 - 点击搜索 * 搜索页面 - 点击搜索
*/ */
...@@ -175,6 +245,27 @@ public interface SsskuContract { ...@@ -175,6 +245,27 @@ public interface SsskuContract {
*/ */
public abstract void clickEditSku(Sssku sssku); public abstract void clickEditSku(Sssku sssku);
/**
* 详情页面 - 编辑商品价格
*
* @param sssku 要编辑的商品
*/
public abstract void clickEditPriceSku(Sssku sssku);
/**
* 详情页面 - 编辑商品会员信息
*
* @param sssku 要编辑的商品
*/
public abstract void clickEditVipSku(Sssku sssku);
/**
* 分组页面 - 添加分组
*
* @param skugrpName 分组名
*/
public abstract void clickAddSkugrp(String skugrpName);
/** /**
* 分组页面 - 删除分组. * 分组页面 - 删除分组.
* *
...@@ -189,11 +280,25 @@ public interface SsskuContract { ...@@ -189,11 +280,25 @@ public interface SsskuContract {
*/ */
public abstract void clickEditSkugrp(Sskugrp sskugrp); public abstract void clickEditSkugrp(Sskugrp sskugrp);
/**
* 编辑页面 - 点击提交按钮
*
* @param sssku 商品
* @param editorMode 编辑模式
*/
public abstract void clickConfirm(Sssku sssku, int editorMode);
/** /**
* 主页面 - 搜索框焦点改变 * 主页面 - 搜索框焦点改变
* *
* @param b 获取焦点 * @param b 获取焦点
* @param searchMode 搜索模式
*/
public abstract void searchBarFocusChanged(boolean b, int searchMode);
/**
* 主页面 - 点击菜单按钮
*/ */
public abstract void searchBarFocusChanged(boolean b); public abstract void clickSkuMenu();
} }
} }
package com.xingdata.zzdpos.ui.manage.sssku; package com.xingdata.zzdpos.ui.manage.sssku;
import com.blankj.utilcode.util.StringUtils;
import com.xingdata.zzdpos.C; import com.xingdata.zzdpos.C;
import com.xingdata.zzdpos.api.ApiFactory; import com.xingdata.zzdpos.api.ApiFactory;
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.util.ConvertUtil;
public class SsskuPresenter extends SsskuContract.Presenter { public class SsskuPresenter extends SsskuContract.Presenter {
...@@ -15,6 +17,7 @@ public class SsskuPresenter extends SsskuContract.Presenter { ...@@ -15,6 +17,7 @@ public class SsskuPresenter extends SsskuContract.Presenter {
@Override @Override
public void onAttached() { public void onAttached() {
getCor();
} }
@Override @Override
...@@ -40,11 +43,12 @@ public class SsskuPresenter extends SsskuContract.Presenter { ...@@ -40,11 +43,12 @@ public class SsskuPresenter extends SsskuContract.Presenter {
@Override @Override
public void clickSku(Sssku sssku) { public void clickSku(Sssku sssku) {
mView.showDetailFragment(sssku); clickSku(sssku, C.TITLE_MODE.SKU);
} }
@Override @Override
public void clickSkugrp(Sskugrp sskugrp) { public void clickSkugrp(Sskugrp sskugrp) {
//点击商品管理里的分组
this.mPageNum = 0; this.mPageNum = 0;
this.mSkuGrpId = sskugrp.getSkuGrpId(); this.mSkuGrpId = sskugrp.getSkuGrpId();
mView.loadSkugrpState(mSkuGrpId); mView.loadSkugrpState(mSkuGrpId);
...@@ -53,7 +57,7 @@ public class SsskuPresenter extends SsskuContract.Presenter { ...@@ -53,7 +57,7 @@ public class SsskuPresenter extends SsskuContract.Presenter {
@Override @Override
public void clickAddSku() { public void clickAddSku() {
mView.showEditorFragment(); mView.showAddFragment();
} }
@Override @Override
...@@ -63,7 +67,29 @@ public class SsskuPresenter extends SsskuContract.Presenter { ...@@ -63,7 +67,29 @@ public class SsskuPresenter extends SsskuContract.Presenter {
@Override @Override
public void clickReplenish() { public void clickReplenish() {
//TODO 跳转到补货界面 mView.startReplenishmentActivity();
}
@Override
public void clickCheck(String barcode) {
if (StringUtils.isEmpty(barcode)) return;
mView.showLoadingDialog();
mCompositeDisposable.add(
ApiFactory.Scsku.queryScsku(barcode)
.doFinally(() -> mView.dismissLoadingDialog())
.subscribe(
ssskuPager -> {
if (ssskuPager.getList().size() > 1) {
mView.loadCheckSkus(ssskuPager.getList());
} else if (ssskuPager.getList().size() == 1) {
mView.showEditorFragment(ssskuPager.getList().get(0), C.SKU_EDITOR_MODE.ADD);
} else {
Sssku sssku = new Sssku();
sssku.setSpuBarcode(ConvertUtil.stringToLong(barcode));
mView.showEditorFragment(sssku, C.SKU_EDITOR_MODE.UNKNOWN);
}
})
);
} }
@Override @Override
...@@ -83,31 +109,137 @@ public class SsskuPresenter extends SsskuContract.Presenter { ...@@ -83,31 +109,137 @@ public class SsskuPresenter extends SsskuContract.Presenter {
public void clickSku(Sssku sssku, int searchType) { public void clickSku(Sssku sssku, int searchType) {
switch (searchType) { switch (searchType) {
case C.TITLE_MODE.SKU: case C.TITLE_MODE.SKU:
mView.showDetailFragment(sssku); mView.showLoadingDialog();
mCompositeDisposable.add(
ApiFactory.Sssku.detailSssku(sssku.getId())
.doFinally(() -> mView.dismissLoadingDialog())
.subscribe(
sssku1 -> {
mView.showDetailFragment(sssku1);
},
throwable -> {
})
);
break; break;
case C.TITLE_MODE.PKG: case C.TITLE_MODE.PKG:
mView.loadPkgSku(sssku);
break;
case C.TITLE_MODE.ADD_SKU:
mView.showEditorFragment(sssku, C.SKU_EDITOR_MODE.ADD);
break; break;
} }
} }
@Override @Override
public void clickEditSku(Sssku sssku) { public void clickEditSku(Sssku sssku) {
mView.showEditorFragment(sssku); mView.showEditorFragment(sssku, C.SKU_EDITOR_MODE.UPDATE);
} }
@Override @Override
public void clickDeleteSkugrp(Sskugrp sskugrp) { public void clickEditPriceSku(Sssku sssku) {
//TODO
}
@Override
public void clickEditVipSku(Sssku sssku) {
//TODO
}
@Override
public void clickAddSkugrp(String skugrpName) {
mView.showLoadingDialog();
Sskugrp sskugrp = new Sskugrp();
sskugrp.setSkuGrpName(skugrpName);
mCompositeDisposable.add(
ApiFactory.Sskugrp.add(sskugrp)
.doOnSubscribe(subscription -> mView.dismissLoadingDialog())
.subscribe(s -> {
mView.dismissAllDialog();
this.getSkugrp();
}, throwable -> {
})
);
}
@Override
public void clickDeleteSkugrp(Sskugrp sskugrp) {
mView.showLoadingDialog();
mCompositeDisposable.add(
ApiFactory.Sskugrp.delete(sskugrp.getSkuGrpId())
.doOnSubscribe(subscription -> mView.dismissLoadingDialog())
.subscribe(s -> {
mView.dismissAllDialog();
this.getSkugrp();
}, throwable -> {
})
);
} }
@Override @Override
public void clickEditSkugrp(Sskugrp sskugrp) { public void clickEditSkugrp(Sskugrp sskugrp) {
mView.showLoadingDialog();
sskugrp.setCreateTime(null);
sskugrp.setUpdateTime(null);
mCompositeDisposable.add(
ApiFactory.Sskugrp.update(sskugrp)
.doOnSubscribe(subscription -> mView.dismissLoadingDialog())
.subscribe(s -> {
mView.dismissAllDialog();
this.getSkugrp();
}, throwable -> {
})
);
}
@Override
public void clickConfirm(Sssku sssku, int editorMode) {
switch (editorMode) {
case C.SKU_EDITOR_MODE.ADD:
ApiFactory.Sssku.addSssku(sssku).subscribe(
sssku1 -> {
mView.showMsg("添加成功");
mView.backToEditFragment();
mView.backToManagerFragment();
if (sssku1.getSkuGrpId().longValue() == mSkuGrpId) {
mView.addSku(sssku1);
}
},
throwable -> mView.showMsg(throwable.getMessage()));
break;
case C.SKU_EDITOR_MODE.UPDATE:
ApiFactory.Sssku.update(sssku).subscribe(
sssku1 -> {
mView.showMsg("修改成功");
mView.backToEditFragment();
mView.backToManagerFragment();
if (sssku1.getSkuGrpId().longValue() == mSkuGrpId) {
mView.updateSku(sssku1);
}
}, throwable -> mView.showMsg(throwable.getMessage()));
break;
case C.SKU_EDITOR_MODE.UNKNOWN:
ApiFactory.Sssku.addSssku(sssku).subscribe(
sssku1 -> {
mView.showMsg("添加成功");
mView.backToEditFragment();
mView.backToManagerFragment();
if (sssku1.getSkuGrpId().longValue() == mSkuGrpId) {
mView.addSku(sssku1);
}
}, throwable -> mView.showMsg(throwable.getMessage()));
break;
}
}
@Override
public void searchBarFocusChanged(boolean b, int searchMode) {
if (b) mView.showSearchFragment(searchMode);
} }
@Override @Override
public void searchBarFocusChanged(boolean b) { public void clickSkuMenu() {
if (b) mView.showSearchFragment(C.TITLE_MODE.SKU); mView.showSkuMenuDialog();
} }
/** /**
...@@ -119,7 +251,8 @@ public class SsskuPresenter extends SsskuContract.Presenter { ...@@ -119,7 +251,8 @@ public class SsskuPresenter extends SsskuContract.Presenter {
ApiFactory.Sssku.querySssku(mPageNum, "", mSkuGrpId) ApiFactory.Sssku.querySssku(mPageNum, "", mSkuGrpId)
.doOnSubscribe(subscription -> mView.dismissLoadingDialog()) .doOnSubscribe(subscription -> mView.dismissLoadingDialog())
.subscribe(ssskuPager -> { .subscribe(ssskuPager -> {
if (mPageNum == 0) mView.loadSsskuCount(ssskuPager.getTotalRow()); if (mPageNum == 0 && mSkuGrpId == 0L)
mView.loadSsskuCount(ssskuPager.getTotalRow());
mView.loadSkus(ssskuPager.getList(), mPageNum == 0); mView.loadSkus(ssskuPager.getList(), mPageNum == 0);
}) })
); );
...@@ -143,11 +276,6 @@ public class SsskuPresenter extends SsskuContract.Presenter { ...@@ -143,11 +276,6 @@ public class SsskuPresenter extends SsskuContract.Presenter {
private void getSkugrp() { private void getSkugrp() {
mCompositeDisposable.add( mCompositeDisposable.add(
ApiFactory.Sskugrp.querySskugrp().subscribe(sskugrpPager -> { ApiFactory.Sskugrp.querySskugrp().subscribe(sskugrpPager -> {
Sskugrp sskugrp = new Sskugrp();
sskugrp.setSkuGrpId(0L);
sskugrp.setSkuGrpName("全部分组");
sskugrp.setSelected(true);
sskugrpPager.getList().add(0, sskugrp);
mView.loadSkugrps(sskugrpPager.getList()); mView.loadSkugrps(sskugrpPager.getList());
} }
) )
...@@ -162,4 +290,13 @@ public class SsskuPresenter extends SsskuContract.Presenter { ...@@ -162,4 +290,13 @@ public class SsskuPresenter extends SsskuContract.Presenter {
ApiFactory.Psb.preOrder().subscribe(ssskuPager -> mView.loadReplenishCount(ssskuPager.getTotalRow())) ApiFactory.Psb.preOrder().subscribe(ssskuPager -> mView.loadReplenishCount(ssskuPager.getTotalRow()))
); );
} }
/**
* 获取供货商
*/
private void getCor() {
mCompositeDisposable.add(
ApiFactory.Cor.queryAll().subscribe(cors -> mView.loadCors(cors))
);
}
} }
package com.xingdata.zzdpos.ui.manage.sssku.dialog; package com.xingdata.zzdpos.ui.manage.sssku.dialog;
import android.view.View;
import com.xingdata.zzdpos.R; import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseDialog; import com.xingdata.zzdpos.base.BaseDialog;
import com.xingdata.zzdpos.databinding.DialogSkugrpEditorBinding; import com.xingdata.zzdpos.databinding.DialogSkugrpEditorBinding;
...@@ -27,6 +29,17 @@ public class SkugrpEditorDialog extends BaseDialog<SsskuPresenter, DialogSkugrpE ...@@ -27,6 +29,17 @@ public class SkugrpEditorDialog extends BaseDialog<SsskuPresenter, DialogSkugrpE
@Override @Override
public void initView() { public void initView() {
if (mSskugrp != null) mViewBinding.etName.setText(mSskugrp.getSkuGrpName());
}
@Override
public void onConfirmClick(View view) {
super.onConfirmClick(view);
if (mSskugrp == null) {
mPresenter.clickAddSkugrp(mViewBinding.etName.getText().toString());
} else {
mSskugrp.setSkuGrpName(mViewBinding.etName.getText().toString());
mPresenter.clickEditSkugrp(mSskugrp);
}
} }
} }
...@@ -4,11 +4,18 @@ import com.xingdata.zzdpos.R; ...@@ -4,11 +4,18 @@ import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseSheetDialog; import com.xingdata.zzdpos.base.BaseSheetDialog;
import com.xingdata.zzdpos.databinding.DialogSkugrpMenuBinding; import com.xingdata.zzdpos.databinding.DialogSkugrpMenuBinding;
import com.xingdata.zzdpos.model.Sskugrp; import com.xingdata.zzdpos.model.Sskugrp;
import com.xingdata.zzdpos.ui.manage.sssku.SsskuActivity;
import com.xingdata.zzdpos.ui.manage.sssku.SsskuPresenter; import com.xingdata.zzdpos.ui.manage.sssku.SsskuPresenter;
public class SkugrpMenuDialog extends BaseSheetDialog<SsskuPresenter, DialogSkugrpMenuBinding> { public class SkugrpMenuDialog extends BaseSheetDialog<SsskuPresenter, DialogSkugrpMenuBinding> {
private Sskugrp mSskugrp; private Sskugrp mSskugrp;
@Override
protected boolean isTransparentBackground() {
return true;
}
public SkugrpMenuDialog setSskugrp(Sskugrp sskugrp) { public SkugrpMenuDialog setSskugrp(Sskugrp sskugrp) {
this.mSskugrp = sskugrp; this.mSskugrp = sskugrp;
return this; return this;
...@@ -21,6 +28,16 @@ public class SkugrpMenuDialog extends BaseSheetDialog<SsskuPresenter, DialogSkug ...@@ -21,6 +28,16 @@ public class SkugrpMenuDialog extends BaseSheetDialog<SsskuPresenter, DialogSkug
@Override @Override
public void initView() { public void initView() {
mViewBinding.tvCancel.setOnClickListener(view -> {
this.dismiss();
});
mViewBinding.tvDelete.setOnClickListener(view -> {
this.dismiss();
new SkugrpDeleteDialog().setSskugrp(mSskugrp).show(((SsskuActivity) getActivity()));
});
mViewBinding.tvUpdate.setOnClickListener(view -> {
this.dismiss();
new SkugrpEditorDialog().setSskugrp(mSskugrp).show(((SsskuActivity) getActivity()));
});
} }
} }
package com.xingdata.zzdpos.ui.manage.sssku.dialog;
import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseSheetDialog;
import com.xingdata.zzdpos.databinding.DialogSsskuMenuBinding;
import com.xingdata.zzdpos.model.Sssku;
import com.xingdata.zzdpos.ui.manage.sssku.SsskuPresenter;
public class SsskuMenuDialog extends BaseSheetDialog<SsskuPresenter, DialogSsskuMenuBinding> {
private Sssku mSssku;
@Override
protected boolean isTransparentBackground() {
return true;
}
public SsskuMenuDialog setSssku(Sssku sssku) {
this.mSssku = sssku;
return this;
}
@Override
public int getLayoutId() {
return R.layout.dialog_sssku_menu;
}
@Override
public void initView() {
mViewBinding.tvCancel.setOnClickListener(view -> {
this.dismiss();
});
mViewBinding.tvUpdate.setOnClickListener(view -> {
this.dismiss();
mPresenter.clickEditSku(mSssku);
});
mViewBinding.tvUpdatePrice.setOnClickListener(view -> {
this.dismiss();
mPresenter.clickEditPriceSku(mSssku);
});
mViewBinding.tvUpdateVip.setOnClickListener(view -> {
this.dismiss();
mPresenter.clickEditVipSku(mSssku);
});
}
}
package com.xingdata.zzdpos.ui.manage.sssku.fragment;
import android.support.v7.widget.LinearLayoutManager;
import android.view.inputmethod.EditorInfo;
import com.blankj.utilcode.util.KeyboardUtils;
import com.blankj.utilcode.util.StringUtils;
import com.xingdata.zzdpos.C;
import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseFragment;
import com.xingdata.zzdpos.databinding.FragmentSsskuAddBinding;
import com.xingdata.zzdpos.model.Sssku;
import com.xingdata.zzdpos.ui.manage.sssku.SsskuActivity;
import com.xingdata.zzdpos.ui.manage.sssku.SsskuPresenter;
import com.xingdata.zzdpos.ui.marketing.ms.adapter.SkuAdapter;
import java.util.List;
public class AddFragment extends BaseFragment<SsskuPresenter, FragmentSsskuAddBinding> {
private SkuAdapter<Sssku> mSkuAdapter;
@Override
public int getLayoutId() {
return R.layout.fragment_sssku_add;
}
@Override
public void initView() {
mViewBinding.etBarcode.requestFocus();
mViewBinding.etBarcode.setOnEditorActionListener((textView, i, keyEvent) -> {
if ((i == EditorInfo.IME_ACTION_SEARCH || i == EditorInfo.IME_ACTION_UNSPECIFIED) && !StringUtils.isEmpty(textView.getText())) {
KeyboardUtils.hideSoftInput(textView);
mPresenter.clickCheck(mViewBinding.etBarcode.getText().toString());
}
return false;
});
mViewBinding.tvCheck.setOnClickListener(view -> {
mPresenter.clickCheck(mViewBinding.etBarcode.getText().toString());
});
// init sku
mSkuAdapter = new SkuAdapter<>();
mViewBinding.rlSku.setAdapter(mSkuAdapter);
mViewBinding.rlSku.setLayoutManager(new LinearLayoutManager(mContext));
// set sku listener
mSkuAdapter.setOnItemClickListener((adapter, view, position) -> {
((SsskuActivity) getActivity()).backToManagerFragment();
mPresenter.clickSku(mSkuAdapter.getData().get(position), C.TITLE_MODE.ADD_SKU);
});
}
public void loadCheckSkus(List<Sssku> ssskus) {
mSkuAdapter.setNewData(ssskus);
}
@Override
public boolean onBackPressedSupport() {
((SsskuActivity) getActivity()).backToManagerFragment();
return super.onBackPressedSupport();
}
}
...@@ -4,13 +4,21 @@ package com.xingdata.zzdpos.ui.manage.sssku.fragment; ...@@ -4,13 +4,21 @@ package com.xingdata.zzdpos.ui.manage.sssku.fragment;
import com.xingdata.zzdpos.R; import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseFragment; import com.xingdata.zzdpos.base.BaseFragment;
import com.xingdata.zzdpos.databinding.FragmentSsskuDetailBinding; import com.xingdata.zzdpos.databinding.FragmentSsskuDetailBinding;
import com.xingdata.zzdpos.model.Cor;
import com.xingdata.zzdpos.model.Sskugrp;
import com.xingdata.zzdpos.model.Sssku; import com.xingdata.zzdpos.model.Sssku;
import com.xingdata.zzdpos.ui.manage.sssku.SsskuActivity; import com.xingdata.zzdpos.ui.manage.sssku.SsskuActivity;
import com.xingdata.zzdpos.ui.manage.sssku.SsskuPresenter; import com.xingdata.zzdpos.ui.manage.sssku.SsskuPresenter;
import com.xingdata.zzdpos.ui.manage.sssku.dialog.SsskuMenuDialog;
import java.util.ArrayList;
import java.util.List;
public class DetailFragment extends BaseFragment<SsskuPresenter, FragmentSsskuDetailBinding> { public class DetailFragment extends BaseFragment<SsskuPresenter, FragmentSsskuDetailBinding> {
private Sssku mSssku; private Sssku mSssku;
private List<Sskugrp> mSskugrps;
private List<Cor> mCors;
@Override @Override
public int getLayoutId() { public int getLayoutId() {
...@@ -19,10 +27,48 @@ public class DetailFragment extends BaseFragment<SsskuPresenter, FragmentSsskuDe ...@@ -19,10 +27,48 @@ public class DetailFragment extends BaseFragment<SsskuPresenter, FragmentSsskuDe
@Override @Override
public void initView() { public void initView() {
mViewBinding.tvEdit.setOnClickListener(view -> { mViewBinding.ivPic.setImageURI(mSssku.getSpuImg());
this.pop(); mViewBinding.setSku(mSssku);
mPresenter.clickEditSku(mSssku);
}); for (int i = 0; i < mSskugrps.size(); i++) {
if (mSskugrps.get(i).getSkuGrpId().longValue() == mSssku.getSkuGrpId()) {
mViewBinding.setSkugrpName(mSskugrps.get(i).getSkuGrpName());
break;
}
}
for (int i = 0; i < mCors.size(); i++) {
if (mCors.get(i).getChannelMapId().longValue() == mSssku.getChannelMapId()) {
mViewBinding.setChannelName(mCors.get(i).getChannelName());
break;
}
}
}
/**
* 加载商品分组
*
* @param sskugrps 分组信息
*/
public void loadSkugrps(List<Sskugrp> sskugrps) {
mSskugrps = new ArrayList<>();
mSskugrps.addAll(sskugrps);
}
/**
* 加载供应商
*
* @param cors 供应商
*/
public void loadCors(List<Cor> cors) {
this.mCors = cors;
}
/**
* 显示菜单
*/
public void showSkuMenuDialog() {
new SsskuMenuDialog().setSssku(mSssku).show((SsskuActivity) getActivity());
} }
/** /**
......
...@@ -16,6 +16,7 @@ import com.xingdata.zzdpos.ui.manage.sssku.SsskuPresenter; ...@@ -16,6 +16,7 @@ import com.xingdata.zzdpos.ui.manage.sssku.SsskuPresenter;
import com.xingdata.zzdpos.ui.manage.sssku.adapter.SkuAdapter; import com.xingdata.zzdpos.ui.manage.sssku.adapter.SkuAdapter;
import com.xingdata.zzdpos.ui.manage.sssku.adapter.SkugrpAdapter; import com.xingdata.zzdpos.ui.manage.sssku.adapter.SkugrpAdapter;
import java.util.ArrayList;
import java.util.List; import java.util.List;
public class ManagerFragment extends BaseFragment<SsskuPresenter, FragmentSsskuManagerBinding> { public class ManagerFragment extends BaseFragment<SsskuPresenter, FragmentSsskuManagerBinding> {
...@@ -86,7 +87,14 @@ public class ManagerFragment extends BaseFragment<SsskuPresenter, FragmentSsskuM ...@@ -86,7 +87,14 @@ public class ManagerFragment extends BaseFragment<SsskuPresenter, FragmentSsskuM
* @param sskugrps 分组信息 * @param sskugrps 分组信息
*/ */
public void loadSkugrps(List<Sskugrp> sskugrps) { public void loadSkugrps(List<Sskugrp> sskugrps) {
mSkugrpAdapter.setNewData(sskugrps); Sskugrp sskugrp = new Sskugrp();
sskugrp.setSkuGrpId(0L);
sskugrp.setSkuGrpName("全部分组");
sskugrp.setSelected(true);
List<Sskugrp> _sskugrps = new ArrayList<>();
_sskugrps.addAll(sskugrps);
_sskugrps.add(0, sskugrp);
mSkugrpAdapter.setNewData(_sskugrps);
} }
/** /**
...@@ -121,6 +129,31 @@ public class ManagerFragment extends BaseFragment<SsskuPresenter, FragmentSsskuM ...@@ -121,6 +129,31 @@ public class ManagerFragment extends BaseFragment<SsskuPresenter, FragmentSsskuM
mViewBinding.tvTotalCount.setText(String.valueOf(count)); mViewBinding.tvTotalCount.setText(String.valueOf(count));
} }
/**
* 添加商品
*
* @param sssku 要添加的商品
*/
public void addSku(Sssku sssku) {
mSkuAdapter.setEnableLoadMore(false);
mViewBinding.rlSku.scrollToPosition(0);
mSkuAdapter.addData(0, sssku);
}
/**
* 更新商品
*
* @param sssku 要更新的商品
*/
public void updateSku(Sssku sssku) {
for (int i = 0; i < mSkuAdapter.getData().size(); i++) {
if (mSkuAdapter.getData().get(i).getSkuId().longValue() == sssku.getSkuId().longValue()) {
mSkuAdapter.setData(i, sssku);
return;
}
}
}
/** /**
* 刷新商品 * 刷新商品
*/ */
......
...@@ -35,7 +35,14 @@ public class SearchFragment extends BaseFragment<SsskuPresenter, FragmentSsskuSe ...@@ -35,7 +35,14 @@ public class SearchFragment extends BaseFragment<SsskuPresenter, FragmentSsskuSe
// set sku listener // set sku listener
mSkuAdapter.setOnLoadMoreListener(this::loadMoreSku, mViewBinding.rlSku); mSkuAdapter.setOnLoadMoreListener(this::loadMoreSku, mViewBinding.rlSku);
mSkuAdapter.setOnItemClickListener((adapter, view, position) -> { mSkuAdapter.setOnItemClickListener((adapter, view, position) -> {
this.pop(); switch (mSearchType) {
case C.TITLE_MODE.SKU:
((SsskuActivity) getActivity()).backToManagerFragment();
break;
case C.TITLE_MODE.PKG:
((SsskuActivity) getActivity()).backToEditFragment();
break;
}
mPresenter.clickSku(mSkuAdapter.getData().get(position), mSearchType); mPresenter.clickSku(mSkuAdapter.getData().get(position), mSearchType);
}); });
......
package com.xingdata.zzdpos.ui.manage.sssku.fragment; package com.xingdata.zzdpos.ui.manage.sssku.fragment;
import android.support.v7.widget.LinearLayoutManager;
import android.view.View; import android.view.View;
import com.xingdata.zzdpos.R; import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseFragment; import com.xingdata.zzdpos.base.BaseFragment;
import com.xingdata.zzdpos.databinding.FragmentSsskuSkugrpBinding; import com.xingdata.zzdpos.databinding.FragmentSsskuSkugrpBinding;
import com.xingdata.zzdpos.model.Sskugrp;
import com.xingdata.zzdpos.ui.manage.sssku.SsskuActivity; import com.xingdata.zzdpos.ui.manage.sssku.SsskuActivity;
import com.xingdata.zzdpos.ui.manage.sssku.SsskuPresenter; import com.xingdata.zzdpos.ui.manage.sssku.SsskuPresenter;
import com.xingdata.zzdpos.ui.manage.sssku.adapter.SkugrpAdapter;
import com.xingdata.zzdpos.ui.manage.sssku.dialog.SkugrpEditorDialog; import com.xingdata.zzdpos.ui.manage.sssku.dialog.SkugrpEditorDialog;
import com.xingdata.zzdpos.ui.manage.sssku.dialog.SkugrpMenuDialog;
import java.util.List;
public class SkugrpFragment extends BaseFragment<SsskuPresenter, FragmentSsskuSkugrpBinding> { public class SkugrpFragment extends BaseFragment<SsskuPresenter, FragmentSsskuSkugrpBinding> {
private List<Sskugrp> mSskugrps;
private SkugrpAdapter mSkugrpAdapter;
@Override @Override
public int getLayoutId() { public int getLayoutId() {
...@@ -20,11 +28,32 @@ public class SkugrpFragment extends BaseFragment<SsskuPresenter, FragmentSsskuSk ...@@ -20,11 +28,32 @@ public class SkugrpFragment extends BaseFragment<SsskuPresenter, FragmentSsskuSk
@Override @Override
public void initView() { public void initView() {
mViewBinding.setVisibility(View.GONE); mSkugrpAdapter = new SkugrpAdapter();
mSkugrpAdapter.setNewData(mSskugrps);
mViewBinding.rlSkugrp.setAdapter(mSkugrpAdapter);
mViewBinding.rlSkugrp.setLayoutManager(new LinearLayoutManager(mContext));
mViewBinding.setVisibility(View.INVISIBLE);
mViewBinding.llSkugrpAdd.setOnClickListener(view -> { mViewBinding.llSkugrpAdd.setOnClickListener(view -> {
new SkugrpEditorDialog().show(((SsskuActivity) getActivity())); new SkugrpEditorDialog().show(((SsskuActivity) getActivity()));
}); });
mSkugrpAdapter.setOnItemClickListener((adapter, view, position) -> {
new SkugrpMenuDialog().setSskugrp(mSkugrpAdapter.getData().get(position)).show(((SsskuActivity) getActivity()));
});
}
/**
* 加载商品分组
*
* @param sskugrps 分组信息
*/
public void loadSkugrps(List<Sskugrp> sskugrps) {
mSskugrps = sskugrps;
if (mSkugrpAdapter == null) return;
mSkugrpAdapter.notifyDataSetChanged();
mViewBinding.setVisibility(sskugrps.size() > 0 ? View.VISIBLE : View.INVISIBLE);
} }
@Override @Override
......
...@@ -5,6 +5,7 @@ import android.app.AlertDialog; ...@@ -5,6 +5,7 @@ import android.app.AlertDialog;
import android.content.DialogInterface; import android.content.DialogInterface;
import android.databinding.DataBindingUtil; import android.databinding.DataBindingUtil;
import android.graphics.Paint; import android.graphics.Paint;
import android.support.v7.widget.LinearLayoutManager;
import android.util.TimeUtils; import android.util.TimeUtils;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
...@@ -13,19 +14,23 @@ import com.alibaba.fastjson.JSON; ...@@ -13,19 +14,23 @@ import com.alibaba.fastjson.JSON;
import com.blankj.utilcode.util.ToastUtils; import com.blankj.utilcode.util.ToastUtils;
import com.google.gson.Gson; import com.google.gson.Gson;
import com.xingdata.api.print.ZX_PrintPOS; import com.xingdata.api.print.ZX_PrintPOS;
import com.xingdata.zzdpos.C;
import com.xingdata.zzdpos.R; import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseActivity; import com.xingdata.zzdpos.base.BaseActivity;
import com.xingdata.zzdpos.databinding.ActivityStatisticsDetailBinding; import com.xingdata.zzdpos.databinding.ActivityStatisticsDetailBinding;
import com.xingdata.zzdpos.databinding.ItemSettleSaledetailBinding; import com.xingdata.zzdpos.databinding.ItemSettleSaledetailBinding;
import com.xingdata.zzdpos.databinding.ViewInventoryDetailBinding;
import com.xingdata.zzdpos.databinding.ViewOrderDetailBinding; import com.xingdata.zzdpos.databinding.ViewOrderDetailBinding;
import com.xingdata.zzdpos.databinding.ViewTicketBinding; import com.xingdata.zzdpos.databinding.ViewTicketBinding;
import com.xingdata.zzdpos.databinding.ViewVipRechargeBinding; import com.xingdata.zzdpos.databinding.ViewVipRechargeBinding;
import com.xingdata.zzdpos.model.Cs;
import com.xingdata.zzdpos.model.Saledetail; import com.xingdata.zzdpos.model.Saledetail;
import com.xingdata.zzdpos.model.Saleorder; import com.xingdata.zzdpos.model.Saleorder;
import com.xingdata.zzdpos.model.Ticket; import com.xingdata.zzdpos.model.Ticket;
import com.xingdata.zzdpos.model.VipRechargeOrder; import com.xingdata.zzdpos.model.VipRechargeOrder;
import com.xingdata.zzdpos.ui.dialog.LoadingDialog; import com.xingdata.zzdpos.ui.dialog.LoadingDialog;
import com.xingdata.zzdpos.ui.main.MainActivity; import com.xingdata.zzdpos.ui.main.MainActivity;
import com.xingdata.zzdpos.ui.manage.inventory.adpter.InventoryDetailAdapter;
import com.xingdata.zzdpos.util.ConvertUtil; import com.xingdata.zzdpos.util.ConvertUtil;
import com.xingdata.zzdpos.util.OnClickListener; import com.xingdata.zzdpos.util.OnClickListener;
...@@ -57,6 +62,7 @@ public class StatisticsDetailActivity extends BaseActivity<StatisticsDetailPrese ...@@ -57,6 +62,7 @@ public class StatisticsDetailActivity extends BaseActivity<StatisticsDetailPrese
Long data = getIntent().getLongExtra(Saleorder.class.getName(), -1); Long data = getIntent().getLongExtra(Saleorder.class.getName(), -1);
VipRechargeOrder vipRechargeOrder = (VipRechargeOrder) getIntent().getSerializableExtra(VipRechargeOrder.class.getName()); VipRechargeOrder vipRechargeOrder = (VipRechargeOrder) getIntent().getSerializableExtra(VipRechargeOrder.class.getName());
Ticket ticket = (Ticket) getIntent().getSerializableExtra(Ticket.class.getName()); Ticket ticket = (Ticket) getIntent().getSerializableExtra(Ticket.class.getName());
Cs cs = (Cs) getIntent().getSerializableExtra(Cs.class.getName());
if (data > 0) { if (data > 0) {
mPresenter.getOrderDetail(String.valueOf(data)); mPresenter.getOrderDetail(String.valueOf(data));
mViewBinding.icTitle.tvTitle.setText(R.string.statistics_order_detail_hint); mViewBinding.icTitle.tvTitle.setText(R.string.statistics_order_detail_hint);
...@@ -69,6 +75,10 @@ public class StatisticsDetailActivity extends BaseActivity<StatisticsDetailPrese ...@@ -69,6 +75,10 @@ public class StatisticsDetailActivity extends BaseActivity<StatisticsDetailPrese
mViewBinding.icTitle.tvTitle.setText(R.string.statistics_used_ticket_hint); mViewBinding.icTitle.tvTitle.setText(R.string.statistics_used_ticket_hint);
getTicketSuss(ticket); getTicketSuss(ticket);
} }
if (cs != null) {
mViewBinding.icTitle.tvTitle.setText(R.string.statistics_inventory_detail_hint);
getCsSuss(cs);
}
} }
} }
...@@ -88,6 +98,44 @@ public class StatisticsDetailActivity extends BaseActivity<StatisticsDetailPrese ...@@ -88,6 +98,44 @@ public class StatisticsDetailActivity extends BaseActivity<StatisticsDetailPrese
} }
private void getCsSuss(Cs cs) {
mViewBinding.viewCs.getViewStub().inflate();
ViewInventoryDetailBinding viewInventoryDetailBinding = DataBindingUtil.bind(mViewBinding.viewCs.getRoot());
viewInventoryDetailBinding.replenishmentLeftRecycler.setLayoutManager(new LinearLayoutManager(this));
InventoryDetailAdapter mInventoryDetailAdapter = new InventoryDetailAdapter(cs.getCsdetailList());
viewInventoryDetailBinding.replenishmentLeftRecycler.setAdapter(mInventoryDetailAdapter);
mViewBinding.btnPrint.setText("取消");
mViewBinding.btnReturn.setText("打印清单");
viewInventoryDetailBinding.setOperName(cs.getOperName());
viewInventoryDetailBinding.setDate(com.blankj.utilcode.util.TimeUtils.millis2String(cs.getCreateTime()));
viewInventoryDetailBinding.setSumNum(cs.getCount() + "");
switch (cs.getCsResultFlag()) {
case 0:
viewInventoryDetailBinding.setFinallyResult("相符");
break;
case 1:
viewInventoryDetailBinding.setFinallyResult("不相符");
break;
}
mViewBinding.btnReturn.setOnClickListener(new OnClickListener() {
@Override
protected void myOnClickListener(View v) {
ZX_PrintPOS.getInstance(MainActivity.mainActivity).print(1, cs);
mViewBinding.btnReturn.setEnabled(false);
mViewBinding.btnReturn.setText("已打印");
}
});
mViewBinding.btnPrint.setOnClickListener(new OnClickListener() {
@Override
protected void myOnClickListener(View v) {
finish();
}
});
}
private void getVipRechargeOrderSuss(VipRechargeOrder vipRechargeOrder) { private void getVipRechargeOrderSuss(VipRechargeOrder vipRechargeOrder) {
mViewBinding.btnReturn.setVisibility(View.GONE); mViewBinding.btnReturn.setVisibility(View.GONE);
mViewBinding.viewVipRecharge.getViewStub().inflate(); mViewBinding.viewVipRecharge.getViewStub().inflate();
...@@ -145,6 +193,7 @@ public class StatisticsDetailActivity extends BaseActivity<StatisticsDetailPrese ...@@ -145,6 +193,7 @@ public class StatisticsDetailActivity extends BaseActivity<StatisticsDetailPrese
for (Saledetail saledetail : mSaleorder.getSaledetailList()) { for (Saledetail saledetail : mSaleorder.getSaledetailList()) {
View view = LayoutInflater.from(this).inflate(R.layout.item_settle_saledetail, null); View view = LayoutInflater.from(this).inflate(R.layout.item_settle_saledetail, null);
view.setPadding(20, 20, 20, 20);
ItemSettleSaledetailBinding itemSettleSaledetailBinding = DataBindingUtil.bind(view); ItemSettleSaledetailBinding itemSettleSaledetailBinding = DataBindingUtil.bind(view);
itemSettleSaledetailBinding.tvAmt.setText("¥" + saledetail.getSubtotal()); itemSettleSaledetailBinding.tvAmt.setText("¥" + saledetail.getSubtotal());
itemSettleSaledetailBinding.tvCount.setText(saledetail.getCnt()); itemSettleSaledetailBinding.tvCount.setText(saledetail.getCnt());
......
...@@ -39,9 +39,10 @@ public class StatisticsTitleFragment extends BaseFragment<StatisticsPresenter, F ...@@ -39,9 +39,10 @@ public class StatisticsTitleFragment extends BaseFragment<StatisticsPresenter, F
@Override @Override
public void initView() { public void initView() {
mViewBinding.viewLine.setVisibility(View.VISIBLE);
switch (fragmentMenu) { switch (fragmentMenu) {
case C.MENU.MENU_STATISTICS_ORDER: case C.MENU.MENU_STATISTICS_ORDER:
mViewBinding.viewLine.setVisibility(View.GONE);
FragmentUtils.add(getChildFragmentManager(), mOrderMainFragment, mViewBinding.mainFrame.getId(), false, true); FragmentUtils.add(getChildFragmentManager(), mOrderMainFragment, mViewBinding.mainFrame.getId(), false, true);
mViewBinding.icTitle.edTitle.setOnFocusChangeListener(new View.OnFocusChangeListener() { mViewBinding.icTitle.edTitle.setOnFocusChangeListener(new View.OnFocusChangeListener() {
...@@ -105,6 +106,7 @@ public class StatisticsTitleFragment extends BaseFragment<StatisticsPresenter, F ...@@ -105,6 +106,7 @@ public class StatisticsTitleFragment extends BaseFragment<StatisticsPresenter, F
break; break;
case C.MENU.MENU_STATISTICS_MS: case C.MENU.MENU_STATISTICS_MS:
mViewBinding.viewLine.setVisibility(View.GONE);
FragmentUtils.add(getChildFragmentManager(), mMsMainFragment, mViewBinding.mainFrame.getId(), false, true); FragmentUtils.add(getChildFragmentManager(), mMsMainFragment, mViewBinding.mainFrame.getId(), false, true);
mViewBinding.icTitle.edTitle.setVisibility(View.GONE); mViewBinding.icTitle.edTitle.setVisibility(View.GONE);
mViewBinding.icTitle.tvTitle.setText(R.string.menu_ms); mViewBinding.icTitle.tvTitle.setText(R.string.menu_ms);
...@@ -123,6 +125,7 @@ public class StatisticsTitleFragment extends BaseFragment<StatisticsPresenter, F ...@@ -123,6 +125,7 @@ public class StatisticsTitleFragment extends BaseFragment<StatisticsPresenter, F
mViewBinding.icTitle.setOnClickListener(new OnClickListener() { mViewBinding.icTitle.setOnClickListener(new OnClickListener() {
@Override @Override
protected void myOnClickListener(View v) { protected void myOnClickListener(View v) {
mViewBinding.viewLine.setVisibility(View.GONE);
if (mViewBinding.icTitle.edTitle.isFocused()) { if (mViewBinding.icTitle.edTitle.isFocused()) {
mViewBinding.icTitle.edTitle.clearFocus(); mViewBinding.icTitle.edTitle.clearFocus();
return; return;
...@@ -150,6 +153,7 @@ public class StatisticsTitleFragment extends BaseFragment<StatisticsPresenter, F ...@@ -150,6 +153,7 @@ public class StatisticsTitleFragment extends BaseFragment<StatisticsPresenter, F
} }
public void searchSuc(Pager<Saleorder> saleorderPager, int payType) { public void searchSuc(Pager<Saleorder> saleorderPager, int payType) {
mViewBinding.viewLine.setVisibility(View.VISIBLE);
if (mViewBinding.icTitle.edTitle.isFocused()) { if (mViewBinding.icTitle.edTitle.isFocused()) {
mViewBinding.icTitle.edTitle.clearFocus(); mViewBinding.icTitle.edTitle.clearFocus();
} }
...@@ -158,11 +162,12 @@ public class StatisticsTitleFragment extends BaseFragment<StatisticsPresenter, F ...@@ -158,11 +162,12 @@ public class StatisticsTitleFragment extends BaseFragment<StatisticsPresenter, F
FragmentUtils.add(getChildFragmentManager(), mOrderSearchFragment, mViewBinding.mainFrame.getId(), false, true); FragmentUtils.add(getChildFragmentManager(), mOrderSearchFragment, mViewBinding.mainFrame.getId(), false, true);
} else { } else {
mOrderSearchFragment.setType(OrderSearchFragment.PAYTYPE); mOrderSearchFragment.setType(OrderSearchFragment.PAYTYPE);
mOrderSearchFragment.setData(saleorderPager, saleorderPager.isFirstPage()); mOrderSearchFragment.setData(saleorderPager);
} }
} }
public void searchSuc(Pager<Saleorder> saleorderPager, String wd) { public void searchSuc(Pager<Saleorder> saleorderPager, String wd) {
mViewBinding.viewLine.setVisibility(View.VISIBLE);
if (mViewBinding.icTitle.edTitle.isFocused()) { if (mViewBinding.icTitle.edTitle.isFocused()) {
mViewBinding.icTitle.edTitle.clearFocus(); mViewBinding.icTitle.edTitle.clearFocus();
} }
...@@ -171,12 +176,13 @@ public class StatisticsTitleFragment extends BaseFragment<StatisticsPresenter, F ...@@ -171,12 +176,13 @@ public class StatisticsTitleFragment extends BaseFragment<StatisticsPresenter, F
FragmentUtils.add(getChildFragmentManager(), mOrderSearchFragment, mViewBinding.mainFrame.getId(), false, true); FragmentUtils.add(getChildFragmentManager(), mOrderSearchFragment, mViewBinding.mainFrame.getId(), false, true);
} else { } else {
mOrderSearchFragment.setType(OrderSearchFragment.WD); mOrderSearchFragment.setType(OrderSearchFragment.WD);
mOrderSearchFragment.setData(saleorderPager, saleorderPager.isFirstPage()); mOrderSearchFragment.setData(saleorderPager);
} }
} }
public void searchSuc(Pager<Saleorder> saleorderPager, long start, long end) { public void searchSuc(Pager<Saleorder> saleorderPager, long start, long end) {
mViewBinding.viewLine.setVisibility(View.VISIBLE);
if (mViewBinding.icTitle.edTitle.isFocused()) { if (mViewBinding.icTitle.edTitle.isFocused()) {
mViewBinding.icTitle.edTitle.clearFocus(); mViewBinding.icTitle.edTitle.clearFocus();
} }
...@@ -185,33 +191,36 @@ public class StatisticsTitleFragment extends BaseFragment<StatisticsPresenter, F ...@@ -185,33 +191,36 @@ public class StatisticsTitleFragment extends BaseFragment<StatisticsPresenter, F
FragmentUtils.add(getChildFragmentManager(), mOrderSearchFragment, mViewBinding.mainFrame.getId(), false, true); FragmentUtils.add(getChildFragmentManager(), mOrderSearchFragment, mViewBinding.mainFrame.getId(), false, true);
} else { } else {
mOrderSearchFragment.setType(OrderSearchFragment.DATE); mOrderSearchFragment.setType(OrderSearchFragment.DATE);
mOrderSearchFragment.setData(saleorderPager, saleorderPager.isFirstPage()); mOrderSearchFragment.setData(saleorderPager);
} }
} }
public void searchRechargeSuc(Pager<VipRechargeOrder> vipRechargeOrderPager, long start, long end) { public void searchRechargeSuc(Pager<VipRechargeOrder> vipRechargeOrderPager, long start, long end) {
mViewBinding.viewLine.setVisibility(View.VISIBLE);
if (!mRechargeSearchFragment.isAdded()) { if (!mRechargeSearchFragment.isAdded()) {
mRechargeSearchFragment.setCreateData(vipRechargeOrderPager, start, end); mRechargeSearchFragment.setCreateData(vipRechargeOrderPager, start, end);
FragmentUtils.add(getChildFragmentManager(), mRechargeSearchFragment, mViewBinding.mainFrame.getId(), false, true); FragmentUtils.add(getChildFragmentManager(), mRechargeSearchFragment, mViewBinding.mainFrame.getId(), false, true);
} else { } else {
mRechargeSearchFragment.setType(OrderSearchFragment.DATE); mRechargeSearchFragment.setType(OrderSearchFragment.DATE);
mRechargeSearchFragment.setData(vipRechargeOrderPager, vipRechargeOrderPager.isFirstPage()); mRechargeSearchFragment.setData(vipRechargeOrderPager);
} }
} }
public void searchTicketSuc(Pager<Ticket> ticketPager, long start, long end) { public void searchTicketSuc(Pager<Ticket> ticketPager, long start, long end) {
mViewBinding.viewLine.setVisibility(View.VISIBLE);
if (!mTicketSearchFragment.isAdded()) { if (!mTicketSearchFragment.isAdded()) {
mTicketSearchFragment.setCreateData(ticketPager, start, end); mTicketSearchFragment.setCreateData(ticketPager, start, end);
FragmentUtils.add(getChildFragmentManager(), mTicketSearchFragment, mViewBinding.mainFrame.getId(), false, true); FragmentUtils.add(getChildFragmentManager(), mTicketSearchFragment, mViewBinding.mainFrame.getId(), false, true);
} else { } else {
mTicketSearchFragment.setType(OrderSearchFragment.DATE); mTicketSearchFragment.setType(OrderSearchFragment.DATE);
mTicketSearchFragment.setData(ticketPager, ticketPager.isFirstPage()); mTicketSearchFragment.setData(ticketPager);
} }
} }
@Override @Override
public boolean onBackPressedSupport() { public boolean onBackPressedSupport() {
mViewBinding.viewLine.setVisibility(View.GONE);
if (mViewBinding.icTitle.edTitle.isFocused()) { if (mViewBinding.icTitle.edTitle.isFocused()) {
mViewBinding.icTitle.edTitle.clearFocus(); mViewBinding.icTitle.edTitle.clearFocus();
return true; return true;
......
...@@ -6,6 +6,7 @@ import android.support.v7.widget.LinearLayoutManager; ...@@ -6,6 +6,7 @@ import android.support.v7.widget.LinearLayoutManager;
import android.view.View; import android.view.View;
import com.blankj.utilcode.util.ActivityUtils; import com.blankj.utilcode.util.ActivityUtils;
import com.blankj.utilcode.util.TimeUtils;
import com.chad.library.adapter.base.BaseQuickAdapter; import com.chad.library.adapter.base.BaseQuickAdapter;
import com.xingdata.zzdpos.R; import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseFragment; import com.xingdata.zzdpos.base.BaseFragment;
...@@ -15,13 +16,23 @@ import com.xingdata.zzdpos.model.VipRechargeOrder; ...@@ -15,13 +16,23 @@ import com.xingdata.zzdpos.model.VipRechargeOrder;
import com.xingdata.zzdpos.ui.statistics.StatisticsDetailActivity; import com.xingdata.zzdpos.ui.statistics.StatisticsDetailActivity;
import com.xingdata.zzdpos.ui.statistics.StatisticsPresenter; import com.xingdata.zzdpos.ui.statistics.StatisticsPresenter;
import com.xingdata.zzdpos.ui.statistics.adapter.StatisticsOrderAdapter; import com.xingdata.zzdpos.ui.statistics.adapter.StatisticsOrderAdapter;
import com.xingdata.zzdpos.ui.statistics.adapter.StatisticsOrderGroupAdapter;
import com.xingdata.zzdpos.ui.statistics.adapter.StatisticsRechargeAdapter; import com.xingdata.zzdpos.ui.statistics.adapter.StatisticsRechargeAdapter;
import com.xingdata.zzdpos.ui.statistics.adapter.StatisticsRechargeGroupAdapter;
import com.xingdata.zzdpos.util.StringUtil;
import java.text.SimpleDateFormat;
import java.util.ArrayList; import java.util.ArrayList;
import io.reactivex.ObservableEmitter;
import io.reactivex.ObservableOnSubscribe;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.functions.Action;
import io.reactivex.schedulers.Schedulers;
public class RechargeSearchFragment extends BaseFragment<StatisticsPresenter, FragmentOrderSearchBinding> { public class RechargeSearchFragment extends BaseFragment<StatisticsPresenter, FragmentOrderSearchBinding> {
private StatisticsRechargeAdapter mStatisticsAdapter; private StatisticsRechargeGroupAdapter mStatisticsAdapter;
private Pager<VipRechargeOrder> VipRechargeOrders; private Pager<VipRechargeOrder> VipRechargeOrders;
private int pagerNum; private int pagerNum;
private String wd = ""; private String wd = "";
...@@ -30,7 +41,7 @@ public class RechargeSearchFragment extends BaseFragment<StatisticsPresenter, Fr ...@@ -30,7 +41,7 @@ public class RechargeSearchFragment extends BaseFragment<StatisticsPresenter, Fr
public static final int DATE = 100; public static final int DATE = 100;
private Long startDate; private Long startDate;
private Long endDate; private Long endDate;
private String monthDate;
@Override @Override
public int getLayoutId() { public int getLayoutId() {
...@@ -41,7 +52,7 @@ public class RechargeSearchFragment extends BaseFragment<StatisticsPresenter, Fr ...@@ -41,7 +52,7 @@ public class RechargeSearchFragment extends BaseFragment<StatisticsPresenter, Fr
public void initView() { public void initView() {
if (mStatisticsAdapter == null) { if (mStatisticsAdapter == null) {
mStatisticsAdapter = new StatisticsRechargeAdapter(new ArrayList<>()); mStatisticsAdapter = new StatisticsRechargeGroupAdapter(new ArrayList<>());
mViewBinding.statisticsRecycler.setLayoutManager(new LinearLayoutManager(getActivity())); mViewBinding.statisticsRecycler.setLayoutManager(new LinearLayoutManager(getActivity()));
mViewBinding.statisticsRecycler.setAdapter(mStatisticsAdapter); mViewBinding.statisticsRecycler.setAdapter(mStatisticsAdapter);
} else { } else {
...@@ -51,14 +62,17 @@ public class RechargeSearchFragment extends BaseFragment<StatisticsPresenter, Fr ...@@ -51,14 +62,17 @@ public class RechargeSearchFragment extends BaseFragment<StatisticsPresenter, Fr
mViewBinding.srlProduct.setOnRefreshListener(this::onRefresh); mViewBinding.srlProduct.setOnRefreshListener(this::onRefresh);
mStatisticsAdapter.setOnLoadMoreListener(this::onLoadMore, mViewBinding.statisticsRecycler); mStatisticsAdapter.setOnLoadMoreListener(this::onLoadMore, mViewBinding.statisticsRecycler);
if (VipRechargeOrders != null) { if (VipRechargeOrders != null) {
setData(VipRechargeOrders, VipRechargeOrders.isFirstPage()); setData(VipRechargeOrders);
} }
mStatisticsAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() { mStatisticsAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
@Override @Override
public void onItemClick(BaseQuickAdapter adapter, View view, int position) { public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
Intent intent = new Intent(getActivity(), StatisticsDetailActivity.class); if (!mStatisticsAdapter.getData().get(position).isHeader) {
intent.putExtra(VipRechargeOrder.class.getName(), mStatisticsAdapter.getData().get(position)); Intent intent = new Intent(getActivity(), StatisticsDetailActivity.class);
ActivityUtils.startActivity(intent); intent.putExtra(VipRechargeOrder.class.getName(), mStatisticsAdapter.getData().get(position));
ActivityUtils.startActivity(intent);
}
} }
}); });
...@@ -96,7 +110,7 @@ public class RechargeSearchFragment extends BaseFragment<StatisticsPresenter, Fr ...@@ -96,7 +110,7 @@ public class RechargeSearchFragment extends BaseFragment<StatisticsPresenter, Fr
* @param pager 数据 * @param pager 数据
* @param isRefresh 是否刷新 * @param isRefresh 是否刷新
*/ */
public void setData(Pager<VipRechargeOrder> pager, boolean isRefresh) { private void setData(Pager<VipRechargeOrder> pager, boolean isRefresh) {
if (isRefresh) { if (isRefresh) {
mStatisticsAdapter.setEnableLoadMore(true); mStatisticsAdapter.setEnableLoadMore(true);
mViewBinding.srlProduct.setRefreshing(false); mViewBinding.srlProduct.setRefreshing(false);
...@@ -109,6 +123,37 @@ public class RechargeSearchFragment extends BaseFragment<StatisticsPresenter, Fr ...@@ -109,6 +123,37 @@ public class RechargeSearchFragment extends BaseFragment<StatisticsPresenter, Fr
} }
public void setData(Pager<VipRechargeOrder> pager) {
if (pager.isFirstPage()) {
monthDate = "";
}
io.reactivex.Observable.create(new ObservableOnSubscribe<Pager<VipRechargeOrder>>() {
@Override
public void subscribe(ObservableEmitter<Pager<VipRechargeOrder>> e) throws Exception {
for (int i = 0; i < pager.getList().size(); i++) {
String m = TimeUtils.millis2String(pager.getList().get(i).getCreateTime(), new SimpleDateFormat(StringUtil.defaultDatePattern));
if (!m.equals(monthDate)) {
monthDate = m;
pager.getList().add(i, new VipRechargeOrder(true, monthDate + ""));
i++;
}
}
e.onComplete();
}
}).subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread()).doOnComplete(new Action() {
@Override
public void run() throws Exception {
setData(pager, pager.isFirstPage());
}
}).subscribe();
}
public void setCreateData(Pager<VipRechargeOrder> list, String wd) { public void setCreateData(Pager<VipRechargeOrder> list, String wd) {
this.VipRechargeOrders = list; this.VipRechargeOrders = list;
this.wd = wd; this.wd = wd;
......
...@@ -6,6 +6,7 @@ import android.support.v7.widget.LinearLayoutManager; ...@@ -6,6 +6,7 @@ import android.support.v7.widget.LinearLayoutManager;
import android.view.View; import android.view.View;
import com.blankj.utilcode.util.ActivityUtils; import com.blankj.utilcode.util.ActivityUtils;
import com.blankj.utilcode.util.TimeUtils;
import com.chad.library.adapter.base.BaseQuickAdapter; import com.chad.library.adapter.base.BaseQuickAdapter;
import com.xingdata.zzdpos.R; import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseFragment; import com.xingdata.zzdpos.base.BaseFragment;
...@@ -16,12 +17,21 @@ import com.xingdata.zzdpos.ui.statistics.StatisticsDetailActivity; ...@@ -16,12 +17,21 @@ import com.xingdata.zzdpos.ui.statistics.StatisticsDetailActivity;
import com.xingdata.zzdpos.ui.statistics.StatisticsPresenter; import com.xingdata.zzdpos.ui.statistics.StatisticsPresenter;
import com.xingdata.zzdpos.ui.statistics.adapter.StatisticsRechargeAdapter; import com.xingdata.zzdpos.ui.statistics.adapter.StatisticsRechargeAdapter;
import com.xingdata.zzdpos.ui.statistics.adapter.StatisticsTicketAdapter; import com.xingdata.zzdpos.ui.statistics.adapter.StatisticsTicketAdapter;
import com.xingdata.zzdpos.ui.statistics.adapter.StatisticsTicketGroupAdapter;
import com.xingdata.zzdpos.util.StringUtil;
import java.text.SimpleDateFormat;
import java.util.ArrayList; import java.util.ArrayList;
import io.reactivex.ObservableEmitter;
import io.reactivex.ObservableOnSubscribe;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.functions.Action;
import io.reactivex.schedulers.Schedulers;
public class TicketSearchFragment extends BaseFragment<StatisticsPresenter, FragmentOrderSearchBinding> { public class TicketSearchFragment extends BaseFragment<StatisticsPresenter, FragmentOrderSearchBinding> {
private StatisticsTicketAdapter mStatisticsAdapter; private StatisticsTicketGroupAdapter mStatisticsAdapter;
private Pager<Ticket> Tickets; private Pager<Ticket> Tickets;
private int pagerNum; private int pagerNum;
private String wd = ""; private String wd = "";
...@@ -30,6 +40,7 @@ public class TicketSearchFragment extends BaseFragment<StatisticsPresenter, Frag ...@@ -30,6 +40,7 @@ public class TicketSearchFragment extends BaseFragment<StatisticsPresenter, Frag
public static final int DATE = 100; public static final int DATE = 100;
private Long startDate; private Long startDate;
private Long endDate; private Long endDate;
private String monthDate;
@Override @Override
...@@ -41,7 +52,7 @@ public class TicketSearchFragment extends BaseFragment<StatisticsPresenter, Frag ...@@ -41,7 +52,7 @@ public class TicketSearchFragment extends BaseFragment<StatisticsPresenter, Frag
public void initView() { public void initView() {
if (mStatisticsAdapter == null) { if (mStatisticsAdapter == null) {
mStatisticsAdapter = new StatisticsTicketAdapter(new ArrayList<>()); mStatisticsAdapter = new StatisticsTicketGroupAdapter(new ArrayList<>());
mViewBinding.statisticsRecycler.setLayoutManager(new LinearLayoutManager(getActivity())); mViewBinding.statisticsRecycler.setLayoutManager(new LinearLayoutManager(getActivity()));
mViewBinding.statisticsRecycler.setAdapter(mStatisticsAdapter); mViewBinding.statisticsRecycler.setAdapter(mStatisticsAdapter);
} else { } else {
...@@ -51,7 +62,7 @@ public class TicketSearchFragment extends BaseFragment<StatisticsPresenter, Frag ...@@ -51,7 +62,7 @@ public class TicketSearchFragment extends BaseFragment<StatisticsPresenter, Frag
mViewBinding.srlProduct.setOnRefreshListener(this::onRefresh); mViewBinding.srlProduct.setOnRefreshListener(this::onRefresh);
mStatisticsAdapter.setOnLoadMoreListener(this::onLoadMore, mViewBinding.statisticsRecycler); mStatisticsAdapter.setOnLoadMoreListener(this::onLoadMore, mViewBinding.statisticsRecycler);
if (Tickets != null) { if (Tickets != null) {
setData(Tickets, Tickets.isFirstPage()); setData(Tickets);
} }
mStatisticsAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() { mStatisticsAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
@Override @Override
...@@ -97,7 +108,7 @@ public class TicketSearchFragment extends BaseFragment<StatisticsPresenter, Frag ...@@ -97,7 +108,7 @@ public class TicketSearchFragment extends BaseFragment<StatisticsPresenter, Frag
* @param pager 数据 * @param pager 数据
* @param isRefresh 是否刷新 * @param isRefresh 是否刷新
*/ */
public void setData(Pager<Ticket> pager, boolean isRefresh) { private void setData(Pager<Ticket> pager, boolean isRefresh) {
if (isRefresh) { if (isRefresh) {
mStatisticsAdapter.setEnableLoadMore(true); mStatisticsAdapter.setEnableLoadMore(true);
mViewBinding.srlProduct.setRefreshing(false); mViewBinding.srlProduct.setRefreshing(false);
...@@ -110,6 +121,37 @@ public class TicketSearchFragment extends BaseFragment<StatisticsPresenter, Frag ...@@ -110,6 +121,37 @@ public class TicketSearchFragment extends BaseFragment<StatisticsPresenter, Frag
} }
public void setData(Pager<Ticket> pager) {
if (pager.isFirstPage()) {
monthDate = "";
}
io.reactivex.Observable.create(new ObservableOnSubscribe<Pager<Ticket>>() {
@Override
public void subscribe(ObservableEmitter<Pager<Ticket>> e) throws Exception {
for (int i = 0; i < pager.getList().size(); i++) {
String m = TimeUtils.date2String(pager.getList().get(i).getCreateTime(), new SimpleDateFormat(StringUtil.defaultDatePattern));
if (!m.equals(monthDate)) {
monthDate = m;
pager.getList().add(i, new Ticket(true, monthDate + ""));
i++;
}
}
e.onComplete();
}
}).subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread()).doOnComplete(new Action() {
@Override
public void run() throws Exception {
setData(pager, pager.isFirstPage());
}
}).subscribe();
}
public void setCreateData(Pager<Ticket> list, String wd) { public void setCreateData(Pager<Ticket> list, String wd) {
this.Tickets = list; this.Tickets = list;
this.wd = wd; this.wd = wd;
......
...@@ -93,9 +93,12 @@ public class OrderListFragment extends BaseFragment<StatisticsPresenter, Fragmen ...@@ -93,9 +93,12 @@ public class OrderListFragment extends BaseFragment<StatisticsPresenter, Fragmen
mStatisticsAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() { mStatisticsAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
@Override @Override
public void onItemClick(BaseQuickAdapter adapter, View view, int position) { public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
Intent intent = new Intent(getActivity(), StatisticsDetailActivity.class); if (!mStatisticsAdapter.getData().get(position).isHeader) {
intent.putExtra(Saleorder.class.getName(), mStatisticsAdapter.getData().get(position).getId()); Intent intent = new Intent(getActivity(), StatisticsDetailActivity.class);
ActivityUtils.startActivity(intent); intent.putExtra(Saleorder.class.getName(), mStatisticsAdapter.getData().get(position).getId());
ActivityUtils.startActivity(intent);
}
} }
}); });
...@@ -122,7 +125,7 @@ public class OrderListFragment extends BaseFragment<StatisticsPresenter, Fragmen ...@@ -122,7 +125,7 @@ public class OrderListFragment extends BaseFragment<StatisticsPresenter, Fragmen
* @param pager 数据 * @param pager 数据
* @param isRefresh 是否刷新 * @param isRefresh 是否刷新
*/ */
public void setData(Pager<Saleorder> pager, boolean isRefresh) { private void setData(Pager<Saleorder> pager, boolean isRefresh) {
if (isRefresh) { if (isRefresh) {
mStatisticsAdapter.setEnableLoadMore(true); mStatisticsAdapter.setEnableLoadMore(true);
mViewBinding.srlProduct.setRefreshing(false); mViewBinding.srlProduct.setRefreshing(false);
......
...@@ -6,6 +6,7 @@ import android.support.v7.widget.LinearLayoutManager; ...@@ -6,6 +6,7 @@ import android.support.v7.widget.LinearLayoutManager;
import android.view.View; import android.view.View;
import com.blankj.utilcode.util.ActivityUtils; import com.blankj.utilcode.util.ActivityUtils;
import com.blankj.utilcode.util.TimeUtils;
import com.chad.library.adapter.base.BaseQuickAdapter; import com.chad.library.adapter.base.BaseQuickAdapter;
import com.xingdata.zzdpos.R; import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseFragment; import com.xingdata.zzdpos.base.BaseFragment;
...@@ -17,14 +18,23 @@ import com.xingdata.zzdpos.model.Saleorder; ...@@ -17,14 +18,23 @@ import com.xingdata.zzdpos.model.Saleorder;
import com.xingdata.zzdpos.ui.statistics.StatisticsDetailActivity; import com.xingdata.zzdpos.ui.statistics.StatisticsDetailActivity;
import com.xingdata.zzdpos.ui.statistics.StatisticsPresenter; import com.xingdata.zzdpos.ui.statistics.StatisticsPresenter;
import com.xingdata.zzdpos.ui.statistics.adapter.StatisticsOrderAdapter; import com.xingdata.zzdpos.ui.statistics.adapter.StatisticsOrderAdapter;
import com.xingdata.zzdpos.ui.statistics.adapter.StatisticsOrderGroupAdapter;
import com.xingdata.zzdpos.util.StringUtil;
import java.text.SimpleDateFormat;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import io.reactivex.ObservableEmitter;
import io.reactivex.ObservableOnSubscribe;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.functions.Action;
import io.reactivex.schedulers.Schedulers;
public class OrderSearchFragment extends BaseFragment<StatisticsPresenter, FragmentOrderSearchBinding> { public class OrderSearchFragment extends BaseFragment<StatisticsPresenter, FragmentOrderSearchBinding> {
private StatisticsOrderAdapter mStatisticsAdapter; private StatisticsOrderGroupAdapter mStatisticsAdapter;
private Pager<Saleorder> saleorders; private Pager<Saleorder> saleorders;
private int pagerNum; private int pagerNum;
private String wd = ""; private String wd = "";
...@@ -35,7 +45,7 @@ public class OrderSearchFragment extends BaseFragment<StatisticsPresenter, Fragm ...@@ -35,7 +45,7 @@ public class OrderSearchFragment extends BaseFragment<StatisticsPresenter, Fragm
public static final int PAYTYPE = 101; public static final int PAYTYPE = 101;
private Long startDate; private Long startDate;
private Long endDate; private Long endDate;
private String monthDate;
@Override @Override
public int getLayoutId() { public int getLayoutId() {
...@@ -46,7 +56,7 @@ public class OrderSearchFragment extends BaseFragment<StatisticsPresenter, Fragm ...@@ -46,7 +56,7 @@ public class OrderSearchFragment extends BaseFragment<StatisticsPresenter, Fragm
public void initView() { public void initView() {
if (mStatisticsAdapter == null) { if (mStatisticsAdapter == null) {
mStatisticsAdapter = new StatisticsOrderAdapter(new ArrayList<>()); mStatisticsAdapter = new StatisticsOrderGroupAdapter(new ArrayList<>());
mViewBinding.statisticsRecycler.setLayoutManager(new LinearLayoutManager(getActivity())); mViewBinding.statisticsRecycler.setLayoutManager(new LinearLayoutManager(getActivity()));
mViewBinding.statisticsRecycler.setAdapter(mStatisticsAdapter); mViewBinding.statisticsRecycler.setAdapter(mStatisticsAdapter);
} else { } else {
...@@ -56,14 +66,17 @@ public class OrderSearchFragment extends BaseFragment<StatisticsPresenter, Fragm ...@@ -56,14 +66,17 @@ public class OrderSearchFragment extends BaseFragment<StatisticsPresenter, Fragm
mViewBinding.srlProduct.setOnRefreshListener(this::onRefresh); mViewBinding.srlProduct.setOnRefreshListener(this::onRefresh);
mStatisticsAdapter.setOnLoadMoreListener(this::onLoadMore, mViewBinding.statisticsRecycler); mStatisticsAdapter.setOnLoadMoreListener(this::onLoadMore, mViewBinding.statisticsRecycler);
if (saleorders != null) { if (saleorders != null) {
setData(saleorders, saleorders.isFirstPage()); setData(saleorders);
} }
mStatisticsAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() { mStatisticsAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
@Override @Override
public void onItemClick(BaseQuickAdapter adapter, View view, int position) { public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
Intent intent = new Intent(getActivity(), StatisticsDetailActivity.class); if (!mStatisticsAdapter.getData().get(position).isHeader) {
intent.putExtra(Saleorder.class.getName(), mStatisticsAdapter.getData().get(position).getId()); Intent intent = new Intent(getActivity(), StatisticsDetailActivity.class);
ActivityUtils.startActivity(intent); intent.putExtra(Saleorder.class.getName(), mStatisticsAdapter.getData().get(position).getId());
ActivityUtils.startActivity(intent);
}
} }
}); });
...@@ -107,7 +120,7 @@ public class OrderSearchFragment extends BaseFragment<StatisticsPresenter, Fragm ...@@ -107,7 +120,7 @@ public class OrderSearchFragment extends BaseFragment<StatisticsPresenter, Fragm
* @param pager 数据 * @param pager 数据
* @param isRefresh 是否刷新 * @param isRefresh 是否刷新
*/ */
public void setData(Pager<Saleorder> pager, boolean isRefresh) { private void setData(Pager<Saleorder> pager, boolean isRefresh) {
if (isRefresh) { if (isRefresh) {
mStatisticsAdapter.setEnableLoadMore(true); mStatisticsAdapter.setEnableLoadMore(true);
mViewBinding.srlProduct.setRefreshing(false); mViewBinding.srlProduct.setRefreshing(false);
...@@ -120,6 +133,38 @@ public class OrderSearchFragment extends BaseFragment<StatisticsPresenter, Fragm ...@@ -120,6 +133,38 @@ public class OrderSearchFragment extends BaseFragment<StatisticsPresenter, Fragm
} }
public void setData(Pager<Saleorder> pager) {
if (pager.isFirstPage()) {
monthDate = "";
}
io.reactivex.Observable.create(new ObservableOnSubscribe<Pager<Saleorder>>() {
@Override
public void subscribe(ObservableEmitter<Pager<Saleorder>> e) throws Exception {
for (int i = 0; i < pager.getList().size(); i++) {
String m = TimeUtils.millis2String(pager.getList().get(i).getCreateTime(), new SimpleDateFormat(StringUtil.defaultDatePattern));
if (!m.equals(monthDate)) {
monthDate = m;
pager.getList().add(i, new Saleorder(true, monthDate + ""));
i++;
}
}
e.onComplete();
}
}).subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread()).doOnComplete(new Action() {
@Override
public void run() throws Exception {
setData(pager, pager.isFirstPage());
}
}).subscribe();
}
public void setCreateData(Pager<Saleorder> list, int patType) { public void setCreateData(Pager<Saleorder> list, int patType) {
this.saleorders = list; this.saleorders = list;
this.payType = patType; this.payType = patType;
......
package com.xingdata.zzdpos.util; package com.xingdata.zzdpos.util;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Rect; import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.support.v7.widget.RecyclerView; import android.support.v7.widget.RecyclerView;
import android.view.View; import android.view.View;
...@@ -40,4 +45,81 @@ public class RecyclerViewUtil { ...@@ -40,4 +45,81 @@ public class RecyclerViewUtil {
} }
} }
} }
public static class ListCardItemDecoration extends RecyclerView.ItemDecoration {
private Drawable mDividerDarwable;
private int mDividerHight = 1;
private Paint mColorPaint;
public final int[] ATRRS = new int[]{android.R.attr.listDivider};
public ListCardItemDecoration(Context context) {
final TypedArray ta = context.obtainStyledAttributes(ATRRS);
this.mDividerDarwable = ta.getDrawable(0);
ta.recycle();
}
/*
int dividerHight 分割线的线宽
int dividerColor 分割线的颜色
*/
public ListCardItemDecoration(Context context, int dividerHight, int dividerColor) {
this(context);
mDividerHight = dividerHight;
mColorPaint = new Paint();
mColorPaint.setColor(dividerColor);
}
/*
int dividerHight 分割线的线宽
Drawable dividerDrawable 图片分割线
*/
public ListCardItemDecoration(Context context, int dividerHight, Drawable dividerDrawable) {
this(context);
mDividerHight = dividerHight;
mDividerDarwable = dividerDrawable;
}
@Override
public void getItemOffsets(Rect outRect, View view, RecyclerView parent, RecyclerView.State state) {
super.getItemOffsets(outRect, view, parent, state);
outRect.bottom = mDividerHight + 1;
}
@Override
public void onDraw(Canvas c, RecyclerView parent, RecyclerView.State state) {
super.onDraw(c, parent, state);
//画水平和垂直分割线
drawHorizontalDivider(c, parent);
}
public void drawHorizontalDivider(Canvas c, RecyclerView parent) {
final int childCount = parent.getChildCount();
for (int i = 0; i < childCount - 1; i++) {
final View child = parent.getChildAt(i);
RecyclerView.LayoutParams params = (RecyclerView.LayoutParams) child.getLayoutParams();
final int left = child.getLeft() - params.leftMargin - mDividerHight;
final int right = child.getRight() + params.rightMargin;
int top = 0;
int bottom = 0;
top = child.getBottom() + params.bottomMargin;
bottom = top + mDividerHight;
//画分割线
mDividerDarwable.setBounds(left, top, right, bottom);
mDividerDarwable.draw(c);
if (mColorPaint != null) {
c.drawRect(left, top, right, bottom, mColorPaint);
}
}
}
}
} }
\ No newline at end of file
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" > <?xml version="1.0" encoding="utf-8"?>
<!-- This is the main color --> <shape xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape>
<!-- 边框颜色 -->
<solid android:color="@color/black_baozheng"/>
</shape>
</item>
<!-- 给View的上 左 右设置8dp的边框 -->
<item android:bottom="@dimen/view_line_L050" android:top="@dimen/view_line_L050"
android:start="@dimen/view_line_L050" android:end="@dimen/view_line_L050">
<shape>
<!-- View填充颜色 -->
<solid android:color="@color/gray_zhouyu" />
</shape>
</item>
</layer-list> <corners android:radius="@dimen/all_shape_radius"/>
\ No newline at end of file <stroke
android:width="@dimen/edit_border"
android:color="@color/black_baozheng"/>
<solid android:color="@color/gray_zhouyu"/>
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="@dimen/all_shape_radius" />
<solid android:color="@color/white_caocao" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape>
<solid android:color="@color/gray_huanggai"/>
</shape>
</item>
<item android:bottom="@dimen/view_line_L050" android:top="@dimen/view_line_L050">
<shape>
<solid android:color="@color/gray_zhouyu"/>
</shape>
</item>
</layer-list>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
<corners android:radius="20dp" />
<stroke
android:width="1dp"
android:color="@color/yellow_bg" />
<solid android:color="@color/yellow_bg" />
</shape>
\ No newline at end of file
...@@ -16,24 +16,19 @@ ...@@ -16,24 +16,19 @@
android:background="@color/white_caocao" android:background="@color/white_caocao"
android:gravity="center_vertical|center_horizontal" android:gravity="center_vertical|center_horizontal"
android:orientation="horizontal" android:orientation="horizontal"
android:paddingTop="@dimen/all_padding"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:tabIndicatorHeight="0dp" app:tabIndicatorHeight="0dp"
app:tabPaddingTop="0dp"
app:tabPaddingBottom="0dp" app:tabPaddingBottom="0dp"
app:tabPaddingEnd="0dp" app:tabPaddingEnd="0dp"
app:tabPaddingStart="0dp" app:tabPaddingStart="0dp"
android:paddingTop="@dimen/all_padding" app:tabPaddingTop="0dp"
app:tabSelectedTextColor="@color/red_guanyu" app:tabSelectedTextColor="@color/red_guanyu"
app:tabTextAppearance="@android:style/TextAppearance.Holo.Small" app:tabTextAppearance="@android:style/TextAppearance.Holo.Small"
app:tabTextColor="@color/black_likui"> app:tabTextColor="@color/black_likui">
</android.support.design.widget.TabLayout> </android.support.design.widget.TabLayout>
<TextView
android:layout_width="match_parent"
android:layout_height="@dimen/view_line_L1"
android:background="@color/gray_zhouyu"
app:layout_constraintTop_toTopOf="@id/tab_layout" />
<android.support.v4.view.ViewPager <android.support.v4.view.ViewPager
android:id="@+id/fragment_container" android:id="@+id/fragment_container"
...@@ -47,7 +42,14 @@ ...@@ -47,7 +42,14 @@
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="1.0"> app:layout_constraintVertical_bias="1.0">
</android.support.v4.view.ViewPager> </android.support.v4.view.ViewPager>
<TextView
android:layout_width="match_parent"
android:layout_height="@dimen/view_line_L050"
android:background="@color/gray_huanggai"
app:layout_constraintTop_toTopOf="@id/tab_layout" />
</android.support.constraint.ConstraintLayout> </android.support.constraint.ConstraintLayout>
</layout> </layout>
\ No newline at end of file
...@@ -12,11 +12,15 @@ ...@@ -12,11 +12,15 @@
android:id="@+id/ly_title" android:id="@+id/ly_title"
layout="@layout/title_order" /> layout="@layout/title_order" />
<View
android:layout_width="match_parent"
android:layout_height="@dimen/view_line_L050"
android:background="@color/gray_huanggai" />
<FrameLayout <FrameLayout
android:id="@+id/fragment_container" android:id="@+id/fragment_container"
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_padding_left_right"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
......
...@@ -52,7 +52,6 @@ ...@@ -52,7 +52,6 @@
android:textColor="@color/black_likui" android:textColor="@color/black_likui"
android:textColorHint="@color/gray_huanggai" android:textColorHint="@color/gray_huanggai"
android:textSize="@dimen/all_text_size" /> android:textSize="@dimen/all_text_size" />
</LinearLayout> </LinearLayout>
<TextView <TextView
......
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="1" android:layout_weight="1"
android:inputType="number" android:inputType="text"
android:labelFor="@+id/et_search" android:labelFor="@+id/et_search"
android:textColor="@color/black_likui" android:textColor="@color/black_likui"
android:textColorHint="@color/gray_huanggai" android:textColorHint="@color/gray_huanggai"
...@@ -71,6 +71,20 @@ ...@@ -71,6 +71,20 @@
app:layout_constraintLeft_toRightOf="parent" app:layout_constraintLeft_toRightOf="parent"
app:layout_constraintRight_toLeftOf="parent" /> app:layout_constraintRight_toLeftOf="parent" />
<ImageButton
android:id="@+id/btn_menu"
android:layout_width="?attr/actionBarSize"
android:layout_height="match_parent"
android:background="?attr/actionBarItemBackground"
android:contentDescription="@string/all_go_back"
android:gravity="center"
android:padding="@dimen/all_margin"
android:src="@mipmap/click_down"
android:visibility="@{titleMode==6?0:8}"
app:layout_constraintRight_toRightOf="parent" />
<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"
......
...@@ -40,25 +40,31 @@ ...@@ -40,25 +40,31 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout="@layout/view_ticket" /> android:layout="@layout/view_ticket" />
<ViewStub
android:id="@+id/view_cs"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout="@layout/view_inventory_detail" />
</FrameLayout> </FrameLayout>
<LinearLayout <android.support.constraint.ConstraintLayout
android:id="@+id/ll_bottom" android:id="@+id/ll_bottom"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="@dimen/layout_statistics_bottom_height"
android:layout_marginTop="@dimen/all_padding" android:layout_marginTop="@dimen/all_padding"
android:background="@color/white_caocao" android:background="@color/white_caocao"
android:elevation="@dimen/view_line_L2" android:elevation="@dimen/view_line_L2"
android:gravity="center"
android:orientation="horizontal" android:orientation="horizontal"
app:layout_constraintBottom_toBottomOf="parent"> app:layout_constraintBottom_toBottomOf="parent">
<Button <Button
android:id="@+id/btn_print" android:id="@+id/btn_print"
style="@style/button_passive" style="@style/button_passive"
android:layout_width="0dp" android:layout_width="@dimen/layout_statistics_bottom_button_width"
android:layout_height="wrap_content" android:layout_height="@dimen/layout_statistics_bottom_button_height"
android:layout_margin="@dimen/all_padding" android:layout_marginStart="@dimen/all_margin_big_big"
android:layout_weight="1"
android:stateListAnimator="@null" android:stateListAnimator="@null"
android:text="@string/settle_print_receipt" android:text="@string/settle_print_receipt"
android:textSize="@dimen/all_text_size" android:textSize="@dimen/all_text_size"
...@@ -71,10 +77,9 @@ ...@@ -71,10 +77,9 @@
<Button <Button
android:id="@+id/btn_return" android:id="@+id/btn_return"
style="@style/button_positive" style="@style/button_positive"
android:layout_width="0dp" android:layout_width="@dimen/layout_statistics_bottom_button_width"
android:layout_height="wrap_content" android:layout_height="@dimen/layout_statistics_bottom_button_height"
android:layout_margin="@dimen/all_padding" android:layout_marginEnd="@dimen/all_margin_big_big"
android:layout_weight="1"
android:stateListAnimator="@null" android:stateListAnimator="@null"
android:text="@string/pay_return" android:text="@string/pay_return"
android:textSize="@dimen/all_text_size" android:textSize="@dimen/all_text_size"
...@@ -82,8 +87,9 @@ ...@@ -82,8 +87,9 @@
app:layout_constraintLeft_toRightOf="@id/btn_cancel" app:layout_constraintLeft_toRightOf="@id/btn_cancel"
app:layout_constraintRight_toRightOf="parent" app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"
app:layout_goneMarginStart="@dimen/all_margin_big_big"
tools:targetApi="lollipop" /> tools:targetApi="lollipop" />
</LinearLayout> </android.support.constraint.ConstraintLayout>
</android.support.constraint.ConstraintLayout> </android.support.constraint.ConstraintLayout>
</layout> </layout>
\ No newline at end of file
...@@ -6,17 +6,13 @@ ...@@ -6,17 +6,13 @@
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@color/lyt_main_bg"
android:orientation="vertical"> android:orientation="vertical">
<TextView <TextView
android:id="@+id/tv_title" android:id="@+id/tv_title"
style="@style/dialog_title" style="@style/dialog_title"
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_padding" />
<ViewStub <ViewStub
android:id="@+id/vs_center" android:id="@+id/vs_center"
...@@ -25,22 +21,25 @@ ...@@ -25,22 +21,25 @@
android:layout_weight="1" android:layout_weight="1"
android:inflatedId="@+id/panel_import" /> android:inflatedId="@+id/panel_import" />
<View
android:layout_width="match_parent"
android:layout_height="@dimen/all_line_width"
android:background="@color/gray_kongming" />
<LinearLayout <LinearLayout
android:layout_marginTop="@dimen/all_padding"
android:orientation="horizontal"
android:weightSum="2"
android:background="@color/white_caocao"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"> android:layout_height="wrap_content"
android:background="@color/white_caocao"
android:orientation="horizontal"
android:weightSum="2">
<Button <Button
android:layout_margin="@dimen/all_padding"
android:id="@+id/btn_cancel" android:id="@+id/btn_cancel"
style="@style/button_passive" style="@style/button_passive"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_margin="@dimen/all_padding"
android:layout_weight="1"
android:stateListAnimator="@null" android:stateListAnimator="@null"
android:text="@string/all_cancel" android:text="@string/all_cancel"
android:textSize="@dimen/all_text_size" android:textSize="@dimen/all_text_size"
...@@ -51,12 +50,12 @@ ...@@ -51,12 +50,12 @@
tools:targetApi="lollipop" /> tools:targetApi="lollipop" />
<Button <Button
android:layout_margin="@dimen/all_padding"
android:id="@+id/btn_confirm" android:id="@+id/btn_confirm"
style="@style/button_positive" style="@style/button_positive"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_margin="@dimen/all_padding"
android:layout_weight="1"
android:stateListAnimator="@null" android:stateListAnimator="@null"
android:text="@string/all_confirm" android:text="@string/all_confirm"
android:textSize="@dimen/all_text_size" android:textSize="@dimen/all_text_size"
...@@ -68,7 +67,6 @@ ...@@ -68,7 +67,6 @@
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
</layout> </layout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<data>
<variable
name="cartCount"
type="int" />
<variable
name="result"
type="String" />
</data>
<android.support.constraint.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="vertical">
<View
android:id="@+id/ll_title"
android:layout_width="0dp"
android:layout_height="?attr/actionBarSize"
android:layout_marginTop="@dimen/all_margin"
android:background="@color/white_caocao"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent">
</View>
<View
android:layout_width="match_parent"
android:layout_height="@dimen/all_line_width"
android:background="@color/gray_huanggai"
app:layout_constraintBottom_toTopOf="@id/rl_cart" />
<android.support.v7.widget.RecyclerView
android:id="@+id/rl_cart"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white_caocao"
app:layout_constraintBottom_toTopOf="@id/ll_info"
app:layout_constraintTop_toBottomOf="@id/ll_title" />
<View
android:layout_width="match_parent"
android:layout_height="@dimen/all_line_width"
android:background="@color/gray_huanggai"
app:layout_constraintBottom_toTopOf="@id/ll_info" />
<LinearLayout
android:id="@+id/ll_info"
android:layout_width="0dp"
android:layout_height="?attr/actionBarSize"
android:background="@color/white_caocao"
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingEnd="@dimen/all_margin"
android:paddingStart="@dimen/all_margin"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="结果:"
android:textColor="@color/black_baozheng"
android:textSize="@dimen/all_text_size" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text='@{result}'
android:textColor="@color/red_guanyu"
android:textSize="@dimen/all_sub_title_size"
android:textStyle="bold" />
<TextView
android:id="@+id/tv_ok"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/shape_red_round_rectangle_more_round"
android:foreground="?android:attr/actionBarItemBackground"
android:paddingBottom="@dimen/all_spacing"
android:paddingEnd="@dimen/all_margin_big"
android:paddingStart="@dimen/all_margin_big"
android:paddingTop="@dimen/all_spacing"
android:text="@string/inventory_add_btn_end"
android:textColor="@color/white_caocao" />
</LinearLayout>
<FrameLayout
android:id="@+id/fl_logo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/all_margin"
android:layout_marginStart="@dimen/all_margin"
android:animateLayoutChanges="true"
app:layout_constraintBottom_toBottomOf="@id/ll_title"
app:layout_constraintLeft_toLeftOf="parent">
<ImageView
android:id="@+id/iv_cart"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/all_spacing"
android:contentDescription="@string/store_cart"
android:foreground="?attr/actionBarItemBackground"
android:src="@mipmap/shopping_cart" />
<TextView
android:layout_width="@dimen/store_cart_count"
android:layout_height="@dimen/store_cart_count"
android:layout_gravity="end"
android:background="@drawable/shape_white_oval"
android:gravity="center"
android:text='@{cartCount+""}'
android:textColor="@color/red_guanyu"
android:textSize="@{cartCount &lt; 100?@dimen/all_caption_size:@dimen/all_tiny_size}"
android:textStyle="bold" />
</FrameLayout>
</android.support.constraint.ConstraintLayout>
</layout>
\ No newline at end of file
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
<LinearLayout <LinearLayout
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@color/white_caocao"
android:orientation="vertical"> android:orientation="vertical">
<TextView <TextView
...@@ -21,11 +22,12 @@ ...@@ -21,11 +22,12 @@
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_marginBottom="@dimen/all_margin"
android:layout_marginStart="@dimen/all_margin"
android:layout_marginTop="@dimen/all_margin" android:layout_marginTop="@dimen/all_margin"
android:text="确定删除吗?" android:text="确定删除吗?"
android:textColor="@color/black_baozheng" android:textColor="@color/black_baozheng"
android:textSize="@dimen/all_body_size" /> android:textSize="@dimen/all_text_size" />
</LinearLayout> </LinearLayout>
</layout> </layout>
\ No newline at end of file
...@@ -3,26 +3,27 @@ ...@@ -3,26 +3,27 @@
xmlns:app="http://schemas.android.com/apk/res-auto"> xmlns:app="http://schemas.android.com/apk/res-auto">
<LinearLayout <LinearLayout
android:layout_width="wrap_content" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@color/white_caocao"
android:orientation="vertical"> android:orientation="vertical">
<TextView <TextView
android:layout_width="match_parent" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="@dimen/all_margin"
android:layout_marginTop="@dimen/all_margin" android:layout_marginTop="@dimen/all_margin"
android:gravity="center" android:text="@string/skugrp_add_hint"
android:text="提示"
android:textColor="@color/black_baozheng" android:textColor="@color/black_baozheng"
android:textSize="@dimen/all_sub_title_size" android:textSize="@dimen/all_text_size" />
android:textStyle="bold" />
<EditText <EditText
android:id="@+id/et_pwd" android:id="@+id/et_name"
style="@style/editText_new" style="@style/editText_new"
android:layout_marginBottom="@dimen/all_margin" android:layout_marginBottom="@dimen/all_margin"
android:layout_marginTop="@dimen/et_margin_edittext" android:layout_marginTop="@dimen/all_margin"
android:hint="@string/skugrp_add_hint" android:inputType="text"
android:labelFor="@+id/et_name"
android:maxLength="16" /> android:maxLength="16" />
</LinearLayout> </LinearLayout>
......
...@@ -3,10 +3,59 @@ ...@@ -3,10 +3,59 @@
xmlns:app="http://schemas.android.com/apk/res-auto"> xmlns:app="http://schemas.android.com/apk/res-auto">
<LinearLayout <LinearLayout
android:layout_width="wrap_content" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@color/transparent"> android:orientation="vertical"
android:paddingBottom="@dimen/all_margin"
android:paddingEnd="@dimen/all_margin"
android:paddingStart="@dimen/all_margin">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/shape_white_r1"
android:orientation="vertical">
<TextView
android:id="@+id/tv_update"
android:layout_width="match_parent"
android:layout_height="@dimen/button3_height"
android:foreground="?android:attr/selectableItemBackground"
android:gravity="center"
android:text="@string/all_update"
android:textColor="@color/blue_mawu"
android:textSize="@dimen/all_text_size" />
<View
android:layout_width="match_parent"
android:layout_height="@dimen/all_line_width"
android:layout_marginEnd="@dimen/all_margin"
android:layout_marginStart="@dimen/all_margin"
android:background="@color/gray_kongming" />
<TextView
android:id="@+id/tv_delete"
android:layout_width="match_parent"
android:layout_height="@dimen/button3_height"
android:foreground="?android:attr/selectableItemBackground"
android:gravity="center"
android:text="@string/all_delete"
android:textColor="@color/red_guanyu"
android:textSize="@dimen/all_text_size" />
</LinearLayout>
<TextView
android:id="@+id/tv_cancel"
android:layout_width="match_parent"
android:layout_height="@dimen/button3_height"
android:layout_marginTop="@dimen/all_margin"
android:background="@drawable/shape_white_r1"
android:foreground="?android:attr/selectableItemBackground"
android:gravity="center"
android:padding="@dimen/all_spacing"
android:text="@string/all_cancel"
android:textColor="@color/black_likui"
android:textSize="@dimen/all_text_size" />
</LinearLayout> </LinearLayout>
</layout> </layout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingBottom="@dimen/all_margin"
android:paddingEnd="@dimen/all_margin"
android:paddingStart="@dimen/all_margin">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/shape_white_r1"
android:orientation="vertical">
<TextView
android:id="@+id/tv_update"
android:layout_width="match_parent"
android:layout_height="@dimen/button3_height"
android:foreground="?android:attr/selectableItemBackground"
android:gravity="center"
android:text="@string/sku_update"
android:textColor="@color/blue_mawu"
android:textSize="@dimen/all_text_size" />
<View
android:layout_width="match_parent"
android:layout_height="@dimen/all_line_width"
android:layout_marginEnd="@dimen/all_margin"
android:layout_marginStart="@dimen/all_margin"
android:background="@color/gray_kongming"
android:visibility="gone" />
<TextView
android:id="@+id/tv_update_price"
android:layout_width="match_parent"
android:layout_height="@dimen/button3_height"
android:foreground="?android:attr/selectableItemBackground"
android:gravity="center"
android:text="@string/sku_update_price"
android:textColor="@color/blue_mawu"
android:textSize="@dimen/all_text_size"
android:visibility="gone" />
<View
android:layout_width="match_parent"
android:layout_height="@dimen/all_line_width"
android:layout_marginEnd="@dimen/all_margin"
android:layout_marginStart="@dimen/all_margin"
android:background="@color/gray_kongming"
android:visibility="gone" />
<TextView
android:id="@+id/tv_update_vip"
android:layout_width="match_parent"
android:layout_height="@dimen/button3_height"
android:foreground="?android:attr/selectableItemBackground"
android:gravity="center"
android:text="@string/sku_update_vip"
android:textColor="@color/blue_mawu"
android:textSize="@dimen/all_text_size"
android:visibility="gone" />
</LinearLayout>
<TextView
android:id="@+id/tv_cancel"
android:layout_width="match_parent"
android:layout_height="@dimen/button3_height"
android:layout_marginTop="@dimen/all_margin"
android:background="@drawable/shape_white_r1"
android:foreground="?android:attr/selectableItemBackground"
android:gravity="center"
android:padding="@dimen/all_spacing"
android:text="@string/all_cancel"
android:textColor="@color/black_likui"
android:textSize="@dimen/all_text_size" />
</LinearLayout>
</layout>
\ No newline at end of file
...@@ -37,9 +37,9 @@ ...@@ -37,9 +37,9 @@
android:layout_weight="1" android:layout_weight="1"
android:drawableTop="@mipmap/icon_receivables" android:drawableTop="@mipmap/icon_receivables"
android:gravity="center" android:gravity="center"
android:textSize="@dimen/all_sub_title_size"
android:text="@string/menu_receivables" android:text="@string/menu_receivables"
android:textColor="#FFF" /> android:textColor="#FFF"
android:textSize="@dimen/all_sub_title_size" />
<TextView <TextView
android:id="@+id/tv_store" android:id="@+id/tv_store"
...@@ -49,8 +49,8 @@ ...@@ -49,8 +49,8 @@
android:drawableTop="@mipmap/icon_billing" android:drawableTop="@mipmap/icon_billing"
android:gravity="center" android:gravity="center"
android:text="@string/menu_billing" android:text="@string/menu_billing"
android:textSize="@dimen/all_sub_title_size" android:textColor="#FFF"
android:textColor="#FFF" /> android:textSize="@dimen/all_sub_title_size" />
</LinearLayout> </LinearLayout>
...@@ -76,11 +76,21 @@ ...@@ -76,11 +76,21 @@
android:layout_height="0dp" android:layout_height="0dp"
android:layout_marginBottom="@dimen/all_padding" android:layout_marginBottom="@dimen/all_padding"
android:layout_marginTop="@dimen/all_padding" android:layout_marginTop="@dimen/all_padding"
android:background="@color/white_caocao"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@id/guideline" /> app:layout_constraintTop_toTopOf="@id/guideline" />
<View
android:layout_width="match_parent"
android:layout_height="@dimen/view_line_L050"
android:background="@color/gray_kongming"
app:layout_constraintTop_toTopOf="@id/fragment_casher_recycler" />
<View
android:layout_width="match_parent"
android:layout_height="@dimen/view_line_L050"
android:background="@color/gray_kongming"
app:layout_constraintBottom_toBottomOf="@id/fragment_casher_recycler" />
</android.support.constraint.ConstraintLayout> </android.support.constraint.ConstraintLayout>
</layout> </layout>
\ No newline at end of file
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
<View <View
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/view_line_L050" android:layout_height="@dimen/view_line_L050"
android:background="@color/gray_kongming" /> android:background="@color/gray_huanggai" />
<LinearLayout <LinearLayout
android:id="@+id/btn_add" android:id="@+id/btn_add"
...@@ -44,17 +44,12 @@ ...@@ -44,17 +44,12 @@
android:textSize="@dimen/big_text_size" /> android:textSize="@dimen/big_text_size" />
</LinearLayout> </LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="@dimen/view_line_L050"
android:background="@color/gray_kongming" />
<TextView <TextView
android:id="@+id/tv_count" android:id="@+id/tv_count"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@color/gray_zhouyu" android:background="@drawable/singleline_zhouyu_huanggai"
android:paddingBottom="@dimen/all_padding" android:paddingBottom="@dimen/all_padding"
android:paddingStart="@dimen/all_padding_left_right" android:paddingStart="@dimen/all_padding_left_right"
android:paddingTop="@dimen/all_padding" android:paddingTop="@dimen/all_padding"
...@@ -63,6 +58,7 @@ ...@@ -63,6 +58,7 @@
android:textSize="@dimen/all_text_size_low" android:textSize="@dimen/all_text_size_low"
android:textStyle="bold" /> android:textStyle="bold" />
<android.support.v4.widget.SwipeRefreshLayout <android.support.v4.widget.SwipeRefreshLayout
android:id="@+id/srl_product" android:id="@+id/srl_product"
android:layout_width="match_parent" android:layout_width="match_parent"
...@@ -71,9 +67,9 @@ ...@@ -71,9 +67,9 @@
<android.support.v7.widget.RecyclerView <android.support.v7.widget.RecyclerView
android:id="@+id/recycler_inventory" android:id="@+id/recycler_inventory"
android:background="@color/gray_zhouyu"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent"
android:background="@color/gray_zhouyu">
</android.support.v7.widget.RecyclerView> </android.support.v7.widget.RecyclerView>
</android.support.v4.widget.SwipeRefreshLayout> </android.support.v4.widget.SwipeRefreshLayout>
......
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
<android.support.constraint.ConstraintLayout <android.support.constraint.ConstraintLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="@color/gray_zhouyu"
android:orientation="vertical"> android:orientation="vertical">
<include <include
...@@ -25,11 +26,17 @@ ...@@ -25,11 +26,17 @@
layout="@layout/title_order" layout="@layout/title_order"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
<View
android:layout_width="match_parent"
android:layout_height="@dimen/view_line_L050"
android:background="@color/gray_huanggai"
app:layout_constraintTop_toBottomOf="@id/ic_title" />
<TextView <TextView
android:id="@+id/tv_title_small" android:id="@+id/tv_title_small"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@color/gray_zhouyu" android:background="@drawable/singleline_zhouyu_huanggai"
android:paddingBottom="@dimen/all_padding" android:paddingBottom="@dimen/all_padding"
android:paddingStart="@dimen/all_padding_left_right" android:paddingStart="@dimen/all_padding_left_right"
android:paddingTop="@dimen/all_padding" android:paddingTop="@dimen/all_padding"
...@@ -39,16 +46,24 @@ ...@@ -39,16 +46,24 @@
android:textStyle="bold" android:textStyle="bold"
app:layout_constraintTop_toBottomOf="@id/ic_title" /> app:layout_constraintTop_toBottomOf="@id/ic_title" />
<android.support.v7.widget.RecyclerView <LinearLayout
android:id="@+id/recycler_view"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="0dp" android:layout_height="0dp"
android:orientation="vertical"
app:layout_constraintBottom_toTopOf="@id/fl_cart" app:layout_constraintBottom_toTopOf="@id/fl_cart"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_title_small"> app:layout_constraintTop_toBottomOf="@id/tv_title_small">
</android.support.v7.widget.RecyclerView> <android.support.v7.widget.RecyclerView
android:id="@+id/recycler_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/singleline_white_gray">
</android.support.v7.widget.RecyclerView>
</LinearLayout>
<FrameLayout <FrameLayout
android:id="@+id/fl_cart" android:id="@+id/fl_cart"
...@@ -81,15 +96,15 @@ ...@@ -81,15 +96,15 @@
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
android:textColor="@color/red_guanyu"
android:text="@{result}" android:text="@{result}"
android:textColor="@color/red_guanyu"
android:textSize="@dimen/all_sub_title_size" android:textSize="@dimen/all_sub_title_size"
android:textStyle="bold" /> android:textStyle="bold" />
</LinearLayout> </LinearLayout>
<TextView <TextView
android:id="@+id/tv_settle" android:id="@+id/btn_end"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/all_margin" android:layout_marginEnd="@dimen/all_margin"
...@@ -106,13 +121,19 @@ ...@@ -106,13 +121,19 @@
app:layout_constraintTop_toBottomOf="@id/fl_cart" /> app:layout_constraintTop_toBottomOf="@id/fl_cart" />
<View
android:layout_width="match_parent"
android:layout_height="@dimen/view_line_L050"
android:background="@color/gray_huanggai"
app:layout_constraintTop_toTopOf="@id/fl_cart" />
<FrameLayout <FrameLayout
android:id="@+id/fl_logo" android:id="@+id/fl_logo"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="@dimen/all_margin_big" android:layout_marginStart="@dimen/all_margin_big"
android:animateLayoutChanges="true" android:animateLayoutChanges="true"
app:layout_constraintBottom_toBottomOf="@id/tv_settle" app:layout_constraintBottom_toBottomOf="@id/btn_end"
app:layout_constraintLeft_toLeftOf="@id/fl_cart"> app:layout_constraintLeft_toLeftOf="@id/fl_cart">
......
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
<import type="android.view.View" /> <import type="android.view.View" />
</data> </data>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" <android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
...@@ -16,6 +15,11 @@ ...@@ -16,6 +15,11 @@
android:background="@color/gray_zhouyu" android:background="@color/gray_zhouyu"
tools:context="com.example.administrator.tangkupos.CasherFragment"> tools:context="com.example.administrator.tangkupos.CasherFragment">
<View
android:layout_width="match_parent"
android:layout_height="@dimen/view_line_L050"
android:background="@color/gray_huanggai"
app:layout_constraintTop_toTopOf="parent" />
<!-- TODO: Update blank fragmfragment_integral_indexyout --> <!-- TODO: Update blank fragmfragment_integral_indexyout -->
<android.support.constraint.Guideline <android.support.constraint.Guideline
android:id="@+id/guideline" android:id="@+id/guideline"
......
...@@ -41,5 +41,10 @@ ...@@ -41,5 +41,10 @@
</android.support.v4.view.ViewPager> </android.support.v4.view.ViewPager>
<View
android:layout_width="match_parent"
android:layout_height="@dimen/view_line_L050"
android:background="@color/gray_huanggai"
app:layout_constraintBottom_toBottomOf="@id/tab_layout" />
</android.support.constraint.ConstraintLayout> </android.support.constraint.ConstraintLayout>
</layout> </layout>
\ No newline at end of file
...@@ -23,33 +23,38 @@ ...@@ -23,33 +23,38 @@
<!-- TODO: Update blank fragmfragment_integral_indexyout --> <!-- TODO: Update blank fragmfragment_integral_indexyout -->
<View
android:layout_alignParentTop="true"
android:layout_width="match_parent"
android:layout_height="@dimen/view_line_L050"
android:background="@color/gray_huanggai" />
<!--<LinearLayout--> <!--<LinearLayout-->
<!--android:id="@+id/ll_title"--> <!--android:id="@+id/ll_title"-->
<!--android:layout_width="match_parent"--> <!--android:layout_width="match_parent"-->
<!--android:layout_height="wrap_content"--> <!--android:layout_height="wrap_content"-->
<!--android:orientation="horizontal"--> <!--android:orientation="horizontal"-->
<!--android:weightSum="2"--> <!--android:weightSum="2"-->
<!--app:layout_constraintEnd_toEndOf="parent"--> <!--app:layout_constraintEnd_toEndOf="parent"-->
<!--app:layout_constraintStart_toStartOf="parent"--> <!--app:layout_constraintStart_toStartOf="parent"-->
<!--app:layout_constraintTop_toTopOf="parent">--> <!--app:layout_constraintTop_toTopOf="parent">-->
<!--<TextView--> <!--<TextView-->
<!--android:layout_width="0dp"--> <!--android:layout_width="0dp"-->
<!--android:layout_height="wrap_content"--> <!--android:layout_height="wrap_content"-->
<!--android:layout_weight="1"--> <!--android:layout_weight="1"-->
<!--android:gravity="left"--> <!--android:gravity="left"-->
<!--android:padding="@dimen/all_padding"--> <!--android:padding="@dimen/all_padding"-->
<!--android:text="@{month}" />--> <!--android:text="@{month}" />-->
<!--<TextView--> <!--<TextView-->
<!--android:layout_width="0dp"--> <!--android:layout_width="0dp"-->
<!--android:layout_height="wrap_content"--> <!--android:layout_height="wrap_content"-->
<!--android:layout_weight="1"--> <!--android:layout_weight="1"-->
<!--android:gravity="right"--> <!--android:gravity="right"-->
<!--android:padding="@dimen/all_padding"--> <!--android:padding="@dimen/all_padding"-->
<!--android:text="@{amt}"--> <!--android:text="@{amt}"-->
<!--android:visibility="invisible" />--> <!--android:visibility="invisible" />-->
<!--</LinearLayout>--> <!--</LinearLayout>-->
<android.support.v4.widget.SwipeRefreshLayout <android.support.v4.widget.SwipeRefreshLayout
...@@ -75,7 +80,6 @@ ...@@ -75,7 +80,6 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_below="@id/ll_title" android:layout_below="@id/ll_title"
android:background="@color/white_caocao"
android:gravity="center" android:gravity="center"
android:orientation="vertical" android:orientation="vertical"
android:visibility="gone"> android:visibility="gone">
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
android:id="@+id/tab_layout" android:id="@+id/tab_layout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="30dp" android:layout_height="30dp"
android:background="@color/white_caocao" android:background="@drawable/singleline_white_gray"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"
app:tabIndicatorHeight="0dp" app:tabIndicatorHeight="0dp"
app:tabMinWidth="100dp" app:tabMinWidth="100dp"
......
...@@ -15,7 +15,6 @@ ...@@ -15,7 +15,6 @@
android:id="@+id/srl_product" android:id="@+id/srl_product"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="0dp" android:layout_height="0dp"
android:layout_marginTop="@dimen/all_padding"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
......
...@@ -28,6 +28,11 @@ ...@@ -28,6 +28,11 @@
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/view_line_L050"
android:layout_marginTop="@dimen/all_padding_left_right"
android:background="@color/gray_huanggai" />
<android.support.constraint.ConstraintLayout <android.support.constraint.ConstraintLayout
android:layout_width="match_parent" android:layout_width="match_parent"
...@@ -36,11 +41,7 @@ ...@@ -36,11 +41,7 @@
android:background="@drawable/singleline_white_gray" android:background="@drawable/singleline_white_gray"
android:paddingBottom="@dimen/all_padding"> android:paddingBottom="@dimen/all_padding">
<View
android:layout_width="match_parent"
android:layout_height="@dimen/view_line_L050"
android:background="@color/gray_kongming"
app:layout_constraintTop_toTopOf="parent" />
<com.facebook.drawee.view.SimpleDraweeView <com.facebook.drawee.view.SimpleDraweeView
android:id="@+id/img_goods" android:id="@+id/img_goods"
...@@ -100,13 +101,12 @@ ...@@ -100,13 +101,12 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="¥"
android:layout_marginBottom="@dimen/view_line_L2" android:layout_marginBottom="@dimen/view_line_L2"
android:text="¥"
android:textColor="@color/red_lvzhi" android:textColor="@color/red_lvzhi"
android:textSize="@dimen/all_text_size_small" android:textSize="@dimen/all_text_size_small"
app:layout_constraintBottom_toBottomOf="@id/tv_price" app:layout_constraintBottom_toBottomOf="@id/tv_price"
app:layout_constraintEnd_toStartOf="@id/tv_price" app:layout_constraintEnd_toStartOf="@id/tv_price" />
/>
<TextView <TextView
android:id="@+id/tv_price" android:id="@+id/tv_price"
...@@ -119,6 +119,11 @@ ...@@ -119,6 +119,11 @@
app:layout_constraintTop_toBottomOf="@id/tv_goods_code_hint" /> app:layout_constraintTop_toBottomOf="@id/tv_goods_code_hint" />
</android.support.constraint.ConstraintLayout> </android.support.constraint.ConstraintLayout>
<View
android:layout_width="match_parent"
android:layout_height="@dimen/view_line_L050"
android:background="@color/gray_huanggai" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
...@@ -150,8 +155,8 @@ ...@@ -150,8 +155,8 @@
android:background="@color/white_caocao" android:background="@color/white_caocao"
android:drawablePadding="@dimen/all_padding" android:drawablePadding="@dimen/all_padding"
android:drawableStart="@mipmap/icon_stores" android:drawableStart="@mipmap/icon_stores"
android:paddingStart="@dimen/all_padding_left_right"
android:paddingEnd="@dimen/all_padding_left_right" android:paddingEnd="@dimen/all_padding_left_right"
android:paddingStart="@dimen/all_padding_left_right"
android:paddingTop="@dimen/all_padding_left_right" android:paddingTop="@dimen/all_padding_left_right"
android:text="@{shopName}" android:text="@{shopName}"
android:textSize="@dimen/all_text_size_low" /> android:textSize="@dimen/all_text_size_low" />
...@@ -159,11 +164,11 @@ ...@@ -159,11 +164,11 @@
<TextView <TextView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:drawablePadding="@dimen/all_padding"
android:background="@color/white_caocao" android:background="@color/white_caocao"
android:drawablePadding="@dimen/all_padding"
android:drawableStart="@mipmap/icon_address" android:drawableStart="@mipmap/icon_address"
android:paddingStart="@dimen/all_padding_left_right"
android:paddingEnd="@dimen/all_padding_left_right" android:paddingEnd="@dimen/all_padding_left_right"
android:paddingStart="@dimen/all_padding_left_right"
android:paddingTop="@dimen/all_padding_left_right" android:paddingTop="@dimen/all_padding_left_right"
android:text="@{address}" android:text="@{address}"
android:textSize="@dimen/all_text_size_low" /> android:textSize="@dimen/all_text_size_low" />
...@@ -171,16 +176,20 @@ ...@@ -171,16 +176,20 @@
<TextView <TextView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:drawablePadding="@dimen/all_padding"
android:background="@color/white_caocao" android:background="@color/white_caocao"
android:drawablePadding="@dimen/all_padding"
android:drawableStart="@mipmap/icon_telephone" android:drawableStart="@mipmap/icon_telephone"
android:paddingStart="@dimen/all_padding_left_right" android:paddingBottom="@dimen/all_padding_left_right"
android:paddingEnd="@dimen/all_padding_left_right" android:paddingEnd="@dimen/all_padding_left_right"
android:paddingStart="@dimen/all_padding_left_right"
android:paddingTop="@dimen/all_padding_left_right" android:paddingTop="@dimen/all_padding_left_right"
android:paddingBottom="@dimen/all_padding_left_right"
android:text="@{phone}" android:text="@{phone}"
android:textSize="@dimen/all_text_size_low" /> android:textSize="@dimen/all_text_size_low" />
<View
android:layout_width="match_parent"
android:layout_height="@dimen/view_line_L050"
android:background="@color/gray_huanggai" />
</LinearLayout> </LinearLayout>
......
...@@ -10,15 +10,20 @@ ...@@ -10,15 +10,20 @@
android:background="@color/gray_zhouyu" android:background="@color/gray_zhouyu"
android:orientation="vertical"> android:orientation="vertical">
<View
android:id="@+id/view_line"
android:layout_width="match_parent"
android:layout_height="@dimen/view_line_L050"
android:layout_marginTop="@dimen/padding_small"
android:background="@color/gray_huanggai"
android:visibility="gone" />
<android.support.v4.widget.SwipeRefreshLayout <android.support.v4.widget.SwipeRefreshLayout
android:id="@+id/srl_product" android:id="@+id/srl_product"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_below="@id/ll_title" android:layout_below="@id/ll_title">
>
<android.support.v7.widget.RecyclerView <android.support.v7.widget.RecyclerView
android:id="@+id/recycler_other_selcet" android:id="@+id/recycler_other_selcet"
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
<View <View
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/view_line_L050" android:layout_height="@dimen/view_line_L050"
android:background="@color/gray_kongming" /> android:background="@color/gray_huanggai" />
<LinearLayout <LinearLayout
android:id="@+id/btn_add" android:id="@+id/btn_add"
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
<View <View
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/view_line_L050" android:layout_height="@dimen/view_line_L050"
android:background="@color/gray_kongming" /> android:background="@color/gray_huanggai" />
<android.support.design.widget.TabLayout <android.support.design.widget.TabLayout
android:id="@+id/tab" android:id="@+id/tab"
...@@ -63,8 +63,7 @@ ...@@ -63,8 +63,7 @@
<View <View
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/all_margin" android:layout_height="@dimen/all_margin"
android:background="@color/gray_zhouyu" android:background="@drawable/singleline_zhouyu_huanggai" />
/>
<android.support.v4.view.ViewPager <android.support.v4.view.ViewPager
android:id="@+id/fragment_container" android:id="@+id/fragment_container"
......
...@@ -67,12 +67,13 @@ ...@@ -67,12 +67,13 @@
layout="@layout/title_order" layout="@layout/title_order"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
<android.support.constraint.ConstraintLayout <android.support.constraint.ConstraintLayout
android:id="@+id/cl_default" android:id="@+id/cl_default"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_below="@id/ly_title" android:layout_below="@id/ly_title"
android:layout_marginTop="@dimen/all_margin" android:layout_marginTop="@dimen/all_padding_left_right"
android:background="@color/white_caocao"> android:background="@color/white_caocao">
<TextView <TextView
...@@ -220,8 +221,7 @@ ...@@ -220,8 +221,7 @@
android:textColor="@color/black" android:textColor="@color/black"
android:textSize="@dimen/all_text_size" android:textSize="@dimen/all_text_size"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/ll_supplier" app:layout_constraintTop_toBottomOf="@id/ll_supplier" />
/>
<TextView <TextView
android:id="@+id/tv_shop_name" android:id="@+id/tv_shop_name"
...@@ -493,7 +493,7 @@ ...@@ -493,7 +493,7 @@
<TextView <TextView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@color/gray_zhouyu" android:background="@drawable/singleline_zhouyu_huanggai"
android:padding="@dimen/all_padding_left_right" android:padding="@dimen/all_padding_left_right"
android:text="定货明细" android:text="定货明细"
android:textColor="@color/black_baozheng" android:textColor="@color/black_baozheng"
...@@ -503,6 +503,19 @@ ...@@ -503,6 +503,19 @@
</android.support.constraint.ConstraintLayout> </android.support.constraint.ConstraintLayout>
<View
android:layout_width="match_parent"
android:layout_height="@dimen/view_line_L050"
android:layout_below="@id/ly_title"
android:background="@color/gray_huanggai" />
<View
android:layout_width="match_parent"
android:layout_height="@dimen/view_line_L050"
android:layout_below="@id/ly_title"
android:layout_marginTop="@dimen/all_padding_left_right"
android:background="@color/gray_huanggai" />
<android.support.v7.widget.RecyclerView <android.support.v7.widget.RecyclerView
android:id="@+id/recycler_view" android:id="@+id/recycler_view"
android:layout_width="match_parent" android:layout_width="match_parent"
...@@ -554,5 +567,11 @@ ...@@ -554,5 +567,11 @@
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
</LinearLayout> </LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="@dimen/view_line_L050"
android:layout_above="@id/ll_bottom"
android:background="@color/gray_huanggai" />
</RelativeLayout> </RelativeLayout>
</layout> </layout>
\ No newline at end of file
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
<android.support.v7.widget.RecyclerView <android.support.v7.widget.RecyclerView
android:id="@+id/recycler" android:id="@+id/recycler"
android:background="@color/gray_zhouyu"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:visibility="visible"> android:visibility="visible">
...@@ -29,7 +30,6 @@ ...@@ -29,7 +30,6 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_below="@id/ll_title" android:layout_below="@id/ll_title"
android:background="@color/white_caocao"
android:gravity="center" android:gravity="center"
android:orientation="vertical" android:orientation="vertical"
android:visibility="gone"> android:visibility="gone">
......
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<data>
<import type="android.view.View" />
<variable
name="dataCount"
type="int" />
</data>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
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_spacing"
android:background="@color/gray_huanggai" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="@color/white_caocao"
android:gravity="center_vertical">
<TextView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center_vertical"
android:paddingEnd="@null"
android:paddingStart="@dimen/all_margin"
android:text="@string/sku_barcode"
android:textColor="@color/black_baozheng"
android:textSize="@dimen/all_text_size" />
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="3">
<EditText
android:id="@+id/et_barcode"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@color/transparent"
android:gravity="center_vertical"
android:inputType="number"
android:labelFor="@+id/et_barcode"
android:saveEnabled="false"
android:textColor="@color/black_baozheng"
android:textSize="@dimen/all_text_size" />
<TextView
android:id="@+id/tv_check"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/all_margin"
android:layout_marginStart="@dimen/all_margin"
android:background="@drawable/shape_red_round_rectangle_more_round"
android:foreground="?android:attr/actionBarItemBackground"
android:paddingBottom="@dimen/all_spacing"
android:paddingEnd="@dimen/all_margin_big"
android:paddingStart="@dimen/all_margin_big"
android:paddingTop="@dimen/all_spacing"
android:text="@string/sku_check"
android:textColor="@color/white_caocao" />
</LinearLayout>
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="@dimen/all_line_width"
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"
android:visibility="@{dataCount>0?View.VISIBLE:View.GONE}" />
<android.support.v7.widget.RecyclerView
android:id="@+id/rl_sku"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
</layout>
\ No newline at end of file
...@@ -159,5 +159,17 @@ ...@@ -159,5 +159,17 @@
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@id/guideline" /> app:layout_constraintTop_toTopOf="@id/guideline" />
<View
android:layout_width="match_parent"
android:layout_height="@dimen/view_line_L050"
android:background="@color/gray_kongming"
app:layout_constraintTop_toTopOf="@id/fragment_casher_recycler" />
<View
android:layout_width="match_parent"
android:layout_height="@dimen/view_line_L050"
android:background="@color/gray_kongming"
app:layout_constraintBottom_toBottomOf="@id/fragment_casher_recycler" />
</android.support.constraint.ConstraintLayout> </android.support.constraint.ConstraintLayout>
</layout> </layout>
\ No newline at end of file
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
<View <View
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/view_line_L1" android:layout_height="@dimen/view_line_L1"
android:background="@color/gray_zhouyu" android:background="@color/gray_huanggai"
app:layout_constraintBottom_toBottomOf="parent"/> app:layout_constraintBottom_toBottomOf="parent"/>
</android.support.constraint.ConstraintLayout> </android.support.constraint.ConstraintLayout>
......
...@@ -22,6 +22,12 @@ ...@@ -22,6 +22,12 @@
layout="@layout/title_order" layout="@layout/title_order"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
<View
android:id="@+id/view_line"
android:layout_width="match_parent"
android:layout_height="@dimen/view_line_L050"
android:background="@color/gray_huanggai"
app:layout_constraintBottom_toBottomOf="@id/ic_title" />
<FrameLayout <FrameLayout
android:id="@+id/main_frame" android:id="@+id/main_frame"
......
...@@ -11,14 +11,16 @@ ...@@ -11,14 +11,16 @@
<android.support.constraint.ConstraintLayout <android.support.constraint.ConstraintLayout
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_padding_left_right"
android:background="@color/white_caocao" android:background="@color/white_caocao"
android:padding="@dimen/all_padding_left_right"> android:elevation="@dimen/view_line_L050"
android:foreground="?attr/selectableItemBackground">
<ImageView <ImageView
android:id="@+id/img" android:id="@+id/img"
android:layout_width="50dp" android:layout_width="50dp"
android:layout_height="50dp" android:layout_height="50dp"
android:layout_margin="@dimen/all_padding_left_right"
android:src="@mipmap/img_boss" android:src="@mipmap/img_boss"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
...@@ -60,7 +62,9 @@ ...@@ -60,7 +62,9 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@drawable/singleline_white_gray" android:background="@drawable/singleline_white_gray"
android:padding="@dimen/all_padding" android:paddingTop="@dimen/all_padding"
android:paddingEnd="@dimen/all_padding"
android:paddingBottom="@dimen/all_padding"
android:text="件" android:text="件"
android:textColor="@color/black" android:textColor="@color/black"
android:textSize="@dimen/sp_14" android:textSize="@dimen/sp_14"
...@@ -71,10 +75,9 @@ ...@@ -71,10 +75,9 @@
android:id="@+id/tv_num" android:id="@+id/tv_num"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:padding="0dp" android:padding="@dimen/all_padding"
android:paddingEnd="@dimen/all_padding" android:background="@drawable/singleline_white_gray"
android:text="" android:textColor="@color/black_baozheng"
android:textColor="@color/black"
android:textSize="@dimen/all_text_size_low" android:textSize="@dimen/all_text_size_low"
android:textStyle="bold" android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="@id/tv_unit" app:layout_constraintBottom_toBottomOf="@id/tv_unit"
...@@ -90,7 +93,7 @@ ...@@ -90,7 +93,7 @@
android:textColor="@color/black" android:textColor="@color/black"
android:textSize="@dimen/all_text_size_low" android:textSize="@dimen/all_text_size_low"
app:layout_constraintBottom_toBottomOf="@id/tv_unit" app:layout_constraintBottom_toBottomOf="@id/tv_unit"
app:layout_constraintEnd_toStartOf="@id/tv_unit" app:layout_constraintEnd_toStartOf="@id/tv_num"
app:layout_constraintStart_toStartOf="parent" /> app:layout_constraintStart_toStartOf="parent" />
...@@ -110,6 +113,7 @@ ...@@ -110,6 +113,7 @@
android:id="@+id/tv_result" android:id="@+id/tv_result"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/all_padding"
android:background="@drawable/singleline_white_gray" android:background="@drawable/singleline_white_gray"
android:padding="@dimen/all_padding" android:padding="@dimen/all_padding"
android:paddingEnd="@dimen/all_margin" android:paddingEnd="@dimen/all_margin"
...@@ -145,6 +149,7 @@ ...@@ -145,6 +149,7 @@
android:id="@+id/img_inventory" android:id="@+id/img_inventory"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/all_padding"
android:src="@mipmap/ic_not_consistent" android:src="@mipmap/ic_not_consistent"
app:layout_constraintBottom_toBottomOf="@id/tv_result" app:layout_constraintBottom_toBottomOf="@id/tv_result"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<variable <variable
name="count" name="count"
type="long" /> type="String" />
</data> </data>
...@@ -41,6 +41,7 @@ ...@@ -41,6 +41,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
android:gravity="center" android:gravity="center"
android:text="@{count}"
android:textColor="@color/black_baozheng" android:textColor="@color/black_baozheng"
android:textSize="@dimen/all_text_size" /> android:textSize="@dimen/all_text_size" />
......
...@@ -12,14 +12,18 @@ ...@@ -12,14 +12,18 @@
<android.support.constraint.ConstraintLayout <android.support.constraint.ConstraintLayout
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_padding_left_right" android:background="@color/white_caocao"
android:background="@drawable/singleline_white_gray" android:paddingBottom="@dimen/all_padding">
android:padding="@dimen/all_padding">
<com.facebook.drawee.view.SimpleDraweeView <com.facebook.drawee.view.SimpleDraweeView
android:id="@+id/img_goods" android:id="@+id/img_goods"
android:layout_width="65dp" android:layout_width="65dp"
android:layout_height="65dp" android:layout_height="65dp"
android:layout_marginStart="@dimen/all_padding_left_right"
android:layout_marginTop="@dimen/all_padding"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:placeholderImage="@mipmap/icon_goods_default" /> app:placeholderImage="@mipmap/icon_goods_default" />
<TextView <TextView
...@@ -30,6 +34,7 @@ ...@@ -30,6 +34,7 @@
android:layout_marginEnd="@dimen/all_padding_left_right" android:layout_marginEnd="@dimen/all_padding_left_right"
android:layout_marginStart="@dimen/all_padding_left_right" android:layout_marginStart="@dimen/all_padding_left_right"
android:text="贝斯克莱因和美妖精生日巧克力蛋糕" android:text="贝斯克莱因和美妖精生日巧克力蛋糕"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/img_goods" app:layout_constraintStart_toEndOf="@id/img_goods"
app:layout_constraintTop_toTopOf="@id/img_goods" /> app:layout_constraintTop_toTopOf="@id/img_goods" />
...@@ -58,6 +63,7 @@ ...@@ -58,6 +63,7 @@
android:id="@+id/tv_goods_size" android:id="@+id/tv_goods_size"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/all_padding_left_right"
android:background="@drawable/frame_frame_zhouyu_bg" android:background="@drawable/frame_frame_zhouyu_bg"
android:padding="@dimen/dp_4" android:padding="@dimen/dp_4"
android:text="规格" android:text="规格"
...@@ -76,8 +82,7 @@ ...@@ -76,8 +82,7 @@
android:textStyle="bold" android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="@id/tv_price_hint" app:layout_constraintBottom_toBottomOf="@id/tv_price_hint"
app:layout_constraintStart_toEndOf="@id/tv_rmb" app:layout_constraintStart_toEndOf="@id/tv_rmb"
app:layout_constraintTop_toTopOf="@id/tv_price_hint" app:layout_constraintTop_toTopOf="@id/tv_price_hint" />
/>
<TextView <TextView
android:id="@+id/tv_rmb" android:id="@+id/tv_rmb"
...@@ -88,14 +93,14 @@ ...@@ -88,14 +93,14 @@
android:textColor="@color/store_product_price" android:textColor="@color/store_product_price"
android:textSize="@dimen/all_text_size_small" android:textSize="@dimen/all_text_size_small"
app:layout_constraintBottom_toBottomOf="@id/tv_price_hint" app:layout_constraintBottom_toBottomOf="@id/tv_price_hint"
app:layout_constraintStart_toEndOf="@+id/tv_price_hint" app:layout_constraintStart_toEndOf="@+id/tv_price_hint" />
/>
<LinearLayout <LinearLayout
android:id="@+id/linearLayout" android:id="@+id/linearLayout"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="@dimen/dialog_cart_item_button_height" android:layout_height="@dimen/dialog_cart_item_button_height"
android:layout_marginStart="@dimen/all_padding_left_right"
android:gravity="center" android:gravity="center"
android:orientation="horizontal" android:orientation="horizontal"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
...@@ -142,7 +147,8 @@ ...@@ -142,7 +147,8 @@
style="@style/other_select_smallstyle" style="@style/other_select_smallstyle"
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_padding" android:layout_marginStart="@dimen/all_padding_left_right"
android:layout_marginTop="@dimen/dp_4"
android:text="构成数量:" android:text="构成数量:"
android:textStyle="bold" android:textStyle="bold"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
...@@ -153,8 +159,8 @@ ...@@ -153,8 +159,8 @@
style="@style/other_select_smallstyle" style="@style/other_select_smallstyle"
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_padding"
android:layout_marginStart="@dimen/all_padding_left_right" android:layout_marginStart="@dimen/all_padding_left_right"
android:layout_marginTop="@dimen/all_padding"
android:text="系统库存:" android:text="系统库存:"
android:textStyle="bold" android:textStyle="bold"
app:layout_constraintStart_toEndOf="@id/tv_goods_price" app:layout_constraintStart_toEndOf="@id/tv_goods_price"
...@@ -187,6 +193,7 @@ ...@@ -187,6 +193,7 @@
android:id="@+id/btn_ok" android:id="@+id/btn_ok"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/all_padding_left_right"
android:background="@drawable/shape_red_round_rectangle_more_round" android:background="@drawable/shape_red_round_rectangle_more_round"
android:foreground="?android:attr/actionBarItemBackground" android:foreground="?android:attr/actionBarItemBackground"
android:paddingBottom="@dimen/all_spacing" android:paddingBottom="@dimen/all_spacing"
......
<?xml version="1.0" encoding="utf-8"?>
<layout>
<data>
</data>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="horizontal"
android:paddingBottom="@dimen/all_padding"
android:paddingEnd="@dimen/dp_4"
android:paddingStart="@dimen/dp_4"
android:paddingTop="@dimen/all_padding"
android:weightSum="5">
<TextView
android:id="@+id/tv_name"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="2"
android:gravity="left"
android:paddingStart="@dimen/all_padding"
android:text=""
android:textColor="@color/black"
android:textSize="@dimen/all_text_size_small" />
<TextView
android:id="@+id/tv_stock_count"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:text=""
android:textColor="@color/black"
android:textSize="@dimen/all_text_size_small" />
<TextView
android:id="@+id/tv_result_count"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:text=""
android:textColor="@color/black"
android:textSize="@dimen/all_text_size_small" />
<ImageView
android:id="@+id/img_result"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:src="@mipmap/icon_mark_equal" />
</LinearLayout>
</layout>
\ No newline at end of file
...@@ -7,7 +7,8 @@ ...@@ -7,7 +7,8 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_margin="0.8dp" android:layout_margin="0.8dp"
android:background="?android:attr/selectableItemBackground" android:foreground="?android:attr/selectableItemBackground"
android:background="@color/white_caocao"
android:gravity="center" android:gravity="center"
android:orientation="vertical" android:orientation="vertical"
android:paddingBottom="25dp" android:paddingBottom="25dp"
......
...@@ -12,16 +12,9 @@ ...@@ -12,16 +12,9 @@
<android.support.constraint.ConstraintLayout <android.support.constraint.ConstraintLayout
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_padding_left_right"
android:background="@drawable/singleline_white_gray" android:background="@drawable/singleline_white_gray"
android:paddingBottom="@dimen/all_padding"> android:paddingBottom="@dimen/all_padding">
<View
android:layout_width="match_parent"
android:layout_height="@dimen/view_line_L050"
android:background="@color/gray_kongming"
app:layout_constraintTop_toTopOf="parent" />
<com.facebook.drawee.view.SimpleDraweeView <com.facebook.drawee.view.SimpleDraweeView
android:id="@+id/img_goods" android:id="@+id/img_goods"
android:layout_width="65dp" android:layout_width="65dp"
......
...@@ -40,20 +40,15 @@ ...@@ -40,20 +40,15 @@
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:padding="@dimen/all_padding" android:background="@drawable/singleline_white_gray">
android:background="@color/white">
<View
android:layout_width="match_parent"
android:layout_height="@dimen/view_line_L050"
android:background="@color/gray_kongming"
app:layout_constraintBottom_toBottomOf="parent"/>
<LinearLayout <LinearLayout
android:id="@+id/ll_boss" android:id="@+id/ll_boss"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="@dimen/all_padding_left_right"
android:layout_marginTop="@dimen/all_padding"
android:gravity="center" android:gravity="center"
android:padding="@dimen/dp_4" android:padding="@dimen/dp_4"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
...@@ -91,8 +86,10 @@ ...@@ -91,8 +86,10 @@
android:id="@+id/ll_date" android:id="@+id/ll_date"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="@dimen/all_padding_left_right"
android:gravity="center" android:gravity="center"
android:padding="@dimen/dp_4" android:padding="@dimen/dp_4"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/ll_boss"> app:layout_constraintTop_toBottomOf="@id/ll_boss">
<ImageView <ImageView
...@@ -115,8 +112,10 @@ ...@@ -115,8 +112,10 @@
android:id="@+id/ll_no" android:id="@+id/ll_no"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="@dimen/all_padding_left_right"
android:gravity="center" android:gravity="center"
android:padding="@dimen/dp_4" android:padding="@dimen/dp_4"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/ll_date"> app:layout_constraintTop_toBottomOf="@id/ll_date">
<ImageView <ImageView
...@@ -138,7 +137,7 @@ ...@@ -138,7 +137,7 @@
<android.support.v7.widget.CardView <android.support.v7.widget.CardView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_margin="@dimen/all_padding" android:layout_margin="@dimen/all_margin"
app:cardElevation="0dp" app:cardElevation="0dp"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toBottomOf="@id/ll_no"> app:layout_constraintTop_toBottomOf="@id/ll_no">
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<android.support.constraint.ConstraintLayout <android.support.constraint.ConstraintLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="@dimen/item_statistics_height"
android:background="@color/white_caocao" android:background="@color/white_caocao"
android:foreground="?android:attr/selectableItemBackground"> android:foreground="?android:attr/selectableItemBackground">
...@@ -26,10 +26,10 @@ ...@@ -26,10 +26,10 @@
android:id="@+id/tv_right_top" android:id="@+id/tv_right_top"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/all_margin" android:layout_marginEnd="@dimen/all_text_size_small"
android:textStyle="bold"
android:textColor="@color/black_baozheng" android:textColor="@color/black_baozheng"
android:textSize="@dimen/all_text_size_small" android:textSize="@dimen/all_text_size_small"
android:textStyle="bold"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@id/img_left" /> app:layout_constraintTop_toTopOf="@id/img_left" />
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
android:id="@+id/tv_right_bottom" android:id="@+id/tv_right_bottom"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/all_padding_left_right" android:layout_marginEnd="@dimen/all_text_size_small"
android:text="本店" android:text="本店"
android:textSize="@dimen/all_text_size_small" android:textSize="@dimen/all_text_size_small"
app:layout_constraintBottom_toBottomOf="@id/img_left" app:layout_constraintBottom_toBottomOf="@id/img_left"
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<layout> <layout xmlns:app="http://schemas.android.com/apk/res-auto">
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" <android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="wrap_content" > android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView <TextView
android:id="@+id/item_tv" android:id="@+id/item_tv"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:background="@drawable/singleline_zhouyu_huanggai"
android:gravity="left" android:gravity="left"
android:paddingTop="@dimen/all_padding"
android:paddingBottom="@dimen/all_padding" android:paddingBottom="@dimen/all_padding"
android:paddingStart="@dimen/all_padding_left_right" android:paddingStart="@dimen/all_padding_left_right"
android:paddingTop="@dimen/all_padding"
android:singleLine="true" android:singleLine="true"
android:text="北京店" android:text="北京店"
android:textColor="@color/black" android:textColor="@color/black"
android:textSize="14sp" /> android:textSize="14sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</RelativeLayout> </android.support.constraint.ConstraintLayout>
</layout> </layout>
\ No newline at end of file
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
android:hint="@string/statistics_order_edit_hint" android:hint="@string/statistics_order_edit_hint"
android:inputType="number" android:inputType="number"
android:textColor="@color/black_likui" android:textColor="@color/black_likui"
android:textColorHint="@color/gray_huanggai" android:textColorHint="@color/gray_kongming"
android:textSize="@dimen/all_text_size" android:textSize="@dimen/all_text_size"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@id/iv_right" app:layout_constraintEnd_toStartOf="@id/iv_right"
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -53,6 +53,7 @@ ...@@ -53,6 +53,7 @@
<item name="android:textColor">@color/black</item> <item name="android:textColor">@color/black</item>
<item name="android:textSize">@dimen/detail_textview_size</item> <item name="android:textSize">@dimen/detail_textview_size</item>
</style> </style>
<style name="default_blacktext_margin_smallstyle"> <style name="default_blacktext_margin_smallstyle">
<item name="android:layout_width">wrap_content</item> <item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">match_parent</item> <item name="android:layout_height">match_parent</item>
...@@ -325,7 +326,6 @@ ...@@ -325,7 +326,6 @@
</style> </style>
<style name="button_passive" parent="android:ButtonBar"> <style name="button_passive" parent="android:ButtonBar">
<item name="android:foreground">?android:attr/selectableItemBackgroundBorderless</item>
<item name="android:background">@drawable/selector_gradient_gray_button_background</item> <item name="android:background">@drawable/selector_gradient_gray_button_background</item>
<item name="android:textColor">@drawable/selector_gray_button_text_color</item> <item name="android:textColor">@drawable/selector_gray_button_text_color</item>
<item name="android:gravity">center</item> <item name="android:gravity">center</item>
......
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