Commit e2b78a68 authored by 姜敏's avatar 姜敏

Merge remote-tracking branch 'origin/master'

parents 18295c54 011e8c43
......@@ -22,6 +22,7 @@
<w>shixiu</w>
<w>skugrps</w>
<w>skus</w>
<w>strs</w>
<w>sunquan</w>
<w>xishi</w>
<w>yanqing</w>
......
......@@ -10,6 +10,7 @@ android {
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
//解决问题的代码
dexOptions {
......@@ -80,6 +81,5 @@ dependencies {
compile 'com.github.ybq:Android-SpinKit:1.1.0'
compile 'com.youth.banner:banner:1.4.10'
compile 'cn.jzvd:jiaozivideoplayer:6.0.0'
compile 'com.liulishuo.filedownloader:library:1.6.8'
compile(name: 'zx_print_library-debug', ext: 'aar')
}
......@@ -92,6 +92,7 @@
android:name=".ui.manage.manageMenu.ManageMenuActivity"
android:configChanges="keyboard|orientation|screenSize|keyboardHidden"
android:windowSoftInputMode="adjustUnspecified|stateHidden" />
<activity android:name=".ui.manage.replenishment.ReplenishmentActivity"></activity>
</application>
</manifest>
\ No newline at end of file
......@@ -101,8 +101,7 @@ public abstract class BaseDialog<P extends BasePresenter, B extends ViewDataBind
mBaseBinding = DataBindingUtil.inflate(inflater, R.layout.dialog_base, container, false);
mBaseBinding.vsCenter.getViewStub().setLayoutResource(getLayoutId());
mBaseBinding.vsCenter.getViewStub().setOnInflateListener((viewStub, view) -> mViewBinding
= DataBindingUtil.bind(view));
mBaseBinding.vsCenter.getViewStub().setOnInflateListener((viewStub, view) -> mViewBinding = DataBindingUtil.bind(view));
mBaseBinding.vsCenter.getViewStub().inflate();
if (!isShowTitle() || getTitle() < 0) mBaseBinding.tvTitle.setVisibility(View.GONE);
......
......@@ -7,6 +7,7 @@ import com.xingdata.zzdpos.App;
import com.xingdata.zzdpos.C;
import com.xingdata.zzdpos.base.BaseModel;
import com.xingdata.zzdpos.model.HandoverInfo;
import com.xingdata.zzdpos.model.Level;
import com.xingdata.zzdpos.model.Ms;
import com.xingdata.zzdpos.model.Pay;
import com.xingdata.zzdpos.model.Sskugrp;
......@@ -207,6 +208,14 @@ public class DBFactory {
}
}
public static class Marketing {
public static class Ms {
public static Observable<List<Level>> queryLevel() {
return Observable.just(DB.getInstance().get(MainPresenter.class).where(Level.class).findAll())
.flatMap(levels -> Observable.just(getList(levels)));
}
}
}
public static <E extends RealmModel> List<E> getLimitList(RealmResults<E> data, int offset, int limit) {
List<E> obtainList = new ArrayList<>();
......
......@@ -58,7 +58,7 @@ public class Saledetail implements BaseModel, BaseBean,BaseGoodPrint {
@Override
public String getPrice() {
return ConvertUtil.fenToYuan(skuPrice, false);
return ConvertUtil.fenToYuan(skuPricePay, false);
}
@Override
......
......@@ -977,7 +977,7 @@ public class Saleorder extends SectionEntity<MediaStore.Video> implements BaseMo
@Override
public String getGoodsAmtSum() {
return ConvertUtil.fenToYuan(orderAuthAmt, true);
return ConvertUtil.fenToYuan(orderPayAmt, true);
}
@Override
......@@ -987,7 +987,7 @@ public class Saleorder extends SectionEntity<MediaStore.Video> implements BaseMo
@Override
public String getGoodsReduAmt() {
return null;
return ConvertUtil.fenToYuan(orderReduAmt, true);
}
@Override
......
package com.xingdata.zzdpos.model;
import android.provider.MediaStore;
import com.chad.library.adapter.base.entity.SectionEntity;
import com.xingdata.zzdpos.base.BaseBean;
import java.util.Date;
public class Ticket implements BaseBean {
public class Ticket extends SectionEntity<MediaStore.Video> implements BaseBean {
private boolean isSelected;
......@@ -16,9 +19,19 @@ public class Ticket implements BaseBean {
isSelected = selected;
}
public Ticket(boolean isHeader, String header) {
super(isHeader, header);
}
public Ticket(MediaStore.Video video) {
super(video);
}
public Ticket() {
super(false, "");
}
/**
* 创建默认优惠卷(无优惠)
*
......@@ -32,6 +45,7 @@ public class Ticket implements BaseBean {
@Deprecated
public Ticket(Long l) {
super(false, "");
this.id = l;
this.ticketNo = l;
this.ticketValAmt = 0L;
......
package com.xingdata.zzdpos.model;
import android.provider.MediaStore;
import com.chad.library.adapter.base.entity.SectionEntity;
import com.xingdata.api.print.entity.BaseGoodPrint;
import com.xingdata.api.print.entity.BaseOrderPrint;
import com.xingdata.zzdpos.base.BaseBean;
......@@ -12,7 +15,7 @@ import java.util.List;
* Created by Administrator on 2017/12/15.
*/
public class VipRechargeOrder implements BaseOrderPrint, BaseBean {
public class VipRechargeOrder extends SectionEntity<MediaStore.Video> implements BaseOrderPrint, BaseBean {
private Long cardAmtPay;
private Long cardAmtSend;
private String orderNo;
......@@ -23,6 +26,17 @@ public class VipRechargeOrder implements BaseOrderPrint, BaseBean {
private String vipMobile;
private Long createTime;
public VipRechargeOrder(boolean isHeader, String header) {
super(isHeader, header);
}
public VipRechargeOrder(MediaStore.Video video) {
super(video);
}
public VipRechargeOrder() {
super(false, "");
}
public Long getCreateTime() {
return createTime;
}
......
......@@ -34,6 +34,7 @@ import io.reactivex.schedulers.Schedulers;
public class MainActivity extends BaseActivity<MainPresenter, ActivityMainBinding> implements MainContract.View {
public static MainActivity mainActivity;
private int[] titleInts = {R.string.menu_cashier, R.string.menu_service, R.string.menu_myself};
private int[] iconList = {R.mipmap.icon_menu_cashier_1, R.mipmap.icon_menu_service_0, R.mipmap.icon_menu_myself_0};
private FragmentViewAdapter mFragmentPagerAdapter;
......@@ -48,6 +49,7 @@ public class MainActivity extends BaseActivity<MainPresenter, ActivityMainBindin
@Override
public void initView() {
mainActivity=this;
mPresenter.initHandoverInfo();
List<BaseFragment> fragments = new ArrayList<>();
fragments.add(new CasherFragment());
......
......@@ -11,6 +11,7 @@ import com.chad.library.adapter.base.BaseQuickAdapter;
import com.xingdata.zzdpos.C;
import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.databinding.ActivityMarketingMenuBinding;
import com.xingdata.zzdpos.ui.manage.replenishment.ReplenishmentActivity;
import com.xingdata.zzdpos.ui.marketing.integral.IntegralActivity;
import com.xingdata.zzdpos.ui.marketing.marketingMenu.MarketingMenuActivity;
import com.xingdata.zzdpos.ui.marketing.marketingMenu.adapter.MarketingMenuAdapter;
......@@ -57,30 +58,27 @@ public class ManageMenuActivity extends AppCompatActivity {
public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
switch (marketingMenuAdapter.getData().get(position)) {
case C.MENU.MENU_MANAGER_OPER: {
//会员等级
}
break;
case C.MENU.MENU_MANAGER_GOODS: {
//积分规则
ActivityUtils.startActivity(IntegralActivity.class);
}
break;
case C.MENU.MENU_MANAGER_BALE: {
//优惠券设置
ActivityUtils.startActivity(ReturnTicketActivity.class);
}
break;
case C.MENU.MENU_MANAGER_REPLENISHMENT: {
//充值优惠
ActivityUtils.startActivity(ManageMenuActivity.this, ReplenishmentActivity.class);
}
break;
case C.MENU.MENU_MANAGER_OTHER: {
//营销计划
ActivityUtils.startActivity(MsActivity.class);
}
break;
case C.MENU.MENU_MANAGER_INVENTORY: {
//群发短信
}
break;
default: {
......
package com.xingdata.zzdpos.ui.manage.replenishment;
import com.blankj.utilcode.util.KeyboardUtils;
import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseActivity;
import com.xingdata.zzdpos.databinding.ActivityReplenishmentBinding;
import com.xingdata.zzdpos.model.Psb;
import com.xingdata.zzdpos.model.Sssku;
import com.xingdata.zzdpos.ui.dialog.LoadingDialog;
import com.xingdata.zzdpos.ui.manage.replenishment.fragment.ReplenishmentFragment;
import java.util.List;
public class ReplenishmentActivity extends BaseActivity<ReplenishmentPresenter, ActivityReplenishmentBinding> implements ReplenishmentContract.View {
private ReplenishmentFragment mReplenishmentFragment = new ReplenishmentFragment();
// private ReplenishmentDetailFragment mReplenishmentDetailFragment = new ReplenishmentDetailFragment();
private boolean isAllowFragment = true;
LoadingDialog mLoadingDialog = new LoadingDialog();
@Override
public int getLayoutId() {
return R.layout.activity_replenishment;
}
@Override
public void initView() {
loadRootFragment(R.id.f_bottom, mReplenishmentFragment, true, false);
}
@Override
public void addPsbSuc() {
// mReplenishmentDetailFragment.pop();
mPresenter.refreshPsb();
}
@Override
public void showReplenishmentList(List<Psb> A, List<Psb> B, List<Psb> C) {
mReplenishmentFragment.showReplenishmentList(A, B, C);
}
@Override
public void openReplenishmentDetailFragment(List<Sssku> ssskuList) {
// if (isAllowFragment) {
// isAllowFragment = false;
// mReplenishmentDetailFragment.setSsskuList(ssskuList);
// start(mReplenishmentDetailFragment);
// }
}
@Override
public void openReplenishmentDetailFragment(Psb psb) {
// if (isAllowFragment) {
// isAllowFragment = false;
// mReplenishmentDetailFragment.setPsb(psb);
// start(mReplenishmentDetailFragment);
//
// }
}
@Override
protected void onPause() {
KeyboardUtils.hideSoftInput(this);
super.onPause();
}
@Override
public void isShowLoading(Boolean is) {
if (is) {
mLoadingDialog.show((BaseActivity) mContext);
} else {
if (mLoadingDialog.isShowing) {
mLoadingDialog.dismiss();
}
}
}
@Override
public void isAllowFragment(Boolean is) {
isAllowFragment = is;
}
}
package com.xingdata.zzdpos.ui.manage.replenishment;
import com.xingdata.zzdpos.base.BasePresenter;
import com.xingdata.zzdpos.base.BaseView;
import com.xingdata.zzdpos.model.Psb;
import com.xingdata.zzdpos.model.Sssku;
import com.xingdata.zzdpos.ui.manage.replenishment.fragment.ReplenishmentListFragment;
import java.util.List;
/**
* Created by Eurus on 2017/11/23.
*/
public interface ReplenishmentContract {
interface View extends BaseView {
void isShowLoading(Boolean is);
void isAllowFragment(Boolean is);
/**
* 提交订货成功
*/
void addPsbSuc();
/**
* 展示待确认的订单
*/
void showReplenishmentList(List<Psb> A,List<Psb> B,List<Psb> C);
/**
* 跳转订货详情
*/
void openReplenishmentDetailFragment(List<Sssku> ssskuList);
/**
* 跳转订货详情
*/
void openReplenishmentDetailFragment(Psb psb);
}
abstract class Presenter extends BasePresenter<View> {
/**
* 补货订货页面 - 点击一键补货
*/
public abstract void clickAdd();
/**
* 补货订货页面 - 查询门店订货订单
*/
public abstract void queryPsbList();
/**
* 补货订货页面 - 查询门店订货订单
*/
public abstract void searchPsbList(String wd, ReplenishmentListFragment replenishmentListFragment);
/**
* 补货订货页面 - 查询门店订货详情
*/
public abstract void queryPsbDetail(Psb psb);
/**
* 补货订货详情页面 - 点击订货提交
*/
public abstract void clickReplenishmentSubmit(Psb psb);
/**
* 补货订货详情页面 - 点击订货修改
*/
public abstract void clickReplenishmentUpdate(Psb psb);
/**
* 补货订货详情页面 - 点击确定收货
*/
public abstract void clickReplenishmentConfirm(String psbNo);
/**
* 补货订货页面 - 刷新
*/
public abstract void refreshPsb();
/**
* 补货订货页面 - 更改Fragment跳转安全
*/
public abstract void isAllowFragment(Boolean is);
}
}
package com.xingdata.zzdpos.ui.manage.replenishment;
import android.util.Log;
import com.blankj.utilcode.util.ToastUtils;
import com.xingdata.zzdpos.api.ApiFactory;
import com.xingdata.zzdpos.model.Psb;
import com.xingdata.zzdpos.ui.manage.replenishment.fragment.ReplenishmentListFragment;
import java.util.ArrayList;
import java.util.List;
public class ReplenishmentPresenter extends ReplenishmentContract.Presenter {
private List<Psb> unConfirmedPsbList = new ArrayList<>();
private List<Psb> unReceivePsbList = new ArrayList<>();
private List<Psb> finishedPsbList = new ArrayList<>();
@Override
public void onAttached() {
}
@Override
public void clickAdd() {
mView.isShowLoading(true);
ApiFactory.Psb.preOrder().doFinally(() -> {
mView.isShowLoading(false);
})
.subscribe(ssskuPager -> {
mView.openReplenishmentDetailFragment(ssskuPager.getList());
}, throwable -> {
ToastUtils.showShort(throwable.getMessage());
});
}
@Override
public void queryPsbList() {
unConfirmedPsbList.clear();
unReceivePsbList.clear();
finishedPsbList.clear();
ApiFactory.Psb.queryPsb(1, 200).doFinally(() -> {
})
.subscribe(psbPager -> {
for (Psb psb : psbPager.getList()) {
switch (psb.getPsbStatus()) {
case 3:
unConfirmedPsbList.add(psb);
break;
case 1:
unReceivePsbList.add(psb);
break;
case 0:
finishedPsbList.add(psb);
break;
}
}
mView.showReplenishmentList(unConfirmedPsbList, unReceivePsbList, finishedPsbList);
}, throwable -> {
ToastUtils.showShort(throwable.getMessage());
});
}
@Override
public void searchPsbList(String wd, ReplenishmentListFragment replenishmentListFragment) {
replenishmentListFragment.searchSucc(wd);
}
@Override
public void queryPsbDetail(Psb psb) {
mView.isShowLoading(true);
ApiFactory.Psb.queryPsbDetail(psb.getPsbNo(), psb.getId()).doFinally(() -> {
mView.isShowLoading(false);
})
.subscribe(psbNew -> {
// psbNew.setOutChannelNameabcn(psb.getOutChannelNameabcn());
// psbNew.setCityAddress(psb.getCityAddress());
// psbNew.setCityProvName(psb.getCityProvName());
// psbNew.setCityName(psb.getCityName());
// psbNew.setCityCountyName(psb.getCityCountyName());
mView.openReplenishmentDetailFragment(psbNew);
}, throwable -> {
ToastUtils.showShort(throwable.getMessage());
});
}
@Override
public void clickReplenishmentSubmit(Psb psb) {
mView.isShowLoading(true);
String s = com.alibaba.fastjson.JSON.toJSONString(psb);
ApiFactory.Psb.addPsb(psb).doFinally(() -> {
mView.isShowLoading(false);
})
.subscribe(psb1 -> {
mView.addPsbSuc();
}, throwable -> {
ToastUtils.showShort(throwable.getMessage());
});
}
@Override
public void clickReplenishmentUpdate(Psb psb) {
ApiFactory.Psb.updatePsb(psb).doFinally(() -> {
})
.subscribe(object -> {
mView.addPsbSuc();
}, throwable -> {
ToastUtils.showShort(throwable.getMessage());
});
}
@Override
public void clickReplenishmentConfirm(String psbNo) {
ApiFactory.Psb.confirmRPsb(psbNo).doFinally(() -> {
})
.subscribe(object -> {
mView.addPsbSuc();
}, throwable -> {
ToastUtils.showShort(throwable.getMessage());
});
}
@Override
public void refreshPsb() {
queryPsbList();
Log.e("r", "isrefreshp");
}
@Override
public void isAllowFragment(Boolean is) {
mView.isAllowFragment(is);
}
}
package com.xingdata.zzdpos.ui.manage.replenishment.adpter;
import android.support.annotation.Nullable;
import android.view.View;
import android.view.ViewGroup;
import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseAdapter;
import com.xingdata.zzdpos.databinding.ItemReplenishmentBinding;
import com.xingdata.zzdpos.model.Psb;
import com.xingdata.zzdpos.ui.login.LoginPresenter;
import com.xingdata.zzdpos.util.ConvertUtil;
import java.util.List;
public class ReplenishmentAdapter extends BaseAdapter<Psb, ItemReplenishmentBinding> {
public ReplenishmentAdapter(@Nullable List<Psb> data) {
super(R.layout.item_replenishment, data);
}
@Override
protected void convert(ItemReplenishmentBinding mViewBinding, Psb item) {
mViewBinding.setAmt(ConvertUtil.fenToYuan(item.getPsbAmt()));
mViewBinding.setDate(com.blankj.utilcode.util.TimeUtils.millis2String(item.getCreateTime()));
mViewBinding.setNo(item.getPsbNo());
mViewBinding.setNum(item.getPsbCnt() + "");
mViewBinding.setShopName(LoginPresenter.loginReturnBean.getShopNameAbcn());
switch (item.getPsbStatus()) {
case 3:
mViewBinding.setStatus("待确认");
break;
case 1:
mViewBinding.setStatus("待收货");
break;
case 0:
mViewBinding.setStatus("已入库");
break;
}
mViewBinding.setSupplierName(item.getOutChannelNameabcn());
mViewBinding.setSupplierAddress(item.getOutCityProvName() + item.getOutCityName() + item.getOutCityCountyName() + item.getOutCityAddress());
}
@Override
protected View getItemView(int layoutResId, ViewGroup parent) {
return super.getItemView(layoutResId, parent);
}
}
//package com.xingdata.zzdpos.ui.manage.replenishment.adpter;
//
//
//import android.support.annotation.Nullable;
//import android.support.v4.content.ContextCompat;
//import android.text.Editable;
//import android.text.TextWatcher;
//import android.view.View;
//import android.view.ViewGroup;
//import android.widget.EditText;
//
//
//import com.xingdata.zzdpos.R;
//import com.xingdata.zzdpos.model.Sssku;
//import com.xingdata.zzdpos.util.ConvertUtil;
//
//import java.util.List;
//
//public class ReplenishmentDetailAdapter extends BaseAdapter<Sssku, ItemReplenishmentDetailBinding> {
// private Boolean isTouch = true;
// private UpdatePriceListener mUpdatePriceListener;
//
// public ReplenishmentDetailAdapter(@Nullable List<Sssku> data, boolean Touch) {
// super(R.layout.item_replenishment_detail, data);
// isTouch = Touch;
//
// }
//
//
// @Override
// protected void convert(ItemReplenishmentDetailBinding mViewBinding, Sssku item) {
// mViewBinding.imgGoods.setImageURI(item.getSpuImg());
// mViewBinding.tvGoodsName.setText(item.getSpuName());
// mViewBinding.tvGoodsCode.setText(item.getSpuBarcode() + "");
// mViewBinding.tvGoodsSize.setText("规格/" + item.getSpuUnitName());
// mViewBinding.tvGoodsPrice.setText(ConvertUtil.fenToYuan(item.getSkuCost(), false));
// mViewBinding.tvStock.setText(item.getSkuStock() + "");
// if (item.getSkuCnt() != null) {
// mViewBinding.etCount.setText(item.getSkuCnt() + "");
// } else {
// item.setSkuCnt(1);
// }
//
// if (!isTouch) {
// mViewBinding.etCount.setEnabled(false);
// mViewBinding.etCount.setTextColor(ContextCompat.getColor(mContext,R.color.white_cargo));
// mViewBinding.btnDown.setVisibility(View.GONE);
// mViewBinding.btnUp.setVisibility(View.GONE);
// }
// }
//
//
// @Override
// protected void convert(BaseViewHolder helper, Sssku item) {
//
// if (isTouch) {
// helper.getView(R.id.btn_up).setOnClickListener(v -> {
// Integer sellCount = item.getSkuCnt();
// if (sellCount >= 0 && sellCount < 9999) {
// helper.setText(R.id.et_count, String.valueOf(++sellCount));
// item.setSkuCnt(sellCount);
//// mUpdatePriceListener.updatePrice(1L*(item.getSkuCost()));
// }
// });
// helper.getView(R.id.btn_down).setOnClickListener(v -> {
// Integer sellCount = item.getSkuCnt();
// if (sellCount == 1) {
// return;
// }
// if (sellCount > 1 && sellCount <= 9999) {
// helper.setText(R.id.et_count, String.valueOf(--sellCount));
// item.setSkuCnt(sellCount);
//// mUpdatePriceListener.updatePrice(-1L*(item.getSkuCost()));
//
// }
// });
// ((EditText) helper.getView(R.id.et_count)).addTextChangedListener((new TextWatcher() {
//
// @Override
// public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {
//
// }
//
// @Override
// public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
// Integer sellCount = ((EditText) helper.getView(R.id.et_count)).getText().toString().length() == 0 ? 1 : Integer.valueOf(((EditText) helper.getView(R.id.et_count)).getText().toString());
// if (sellCount==0){
// sellCount=1;
// helper.setText(R.id.et_count,"");
//
// }
// Integer changedNum = sellCount - item.getSkuCnt();
// item.setSkuCnt(sellCount);
// mUpdatePriceListener.updatePrice(item.getSkuCost() * changedNum);
// }
//
// @Override
// public void afterTextChanged(Editable editable) {
// }
//
//
// }));
// }
// super.convert(helper, item);
// }
//
// @Override
// protected View getItemView(int layoutResId, ViewGroup parent) {
// return super.getItemView(layoutResId, parent);
// }
//
//
// public void setmUpdatePriceListener(UpdatePriceListener updatePriceListener) {
// this.mUpdatePriceListener = updatePriceListener;
// }
//
//
// public abstract static class UpdatePriceListener {
//
// public abstract void updatePrice(long amt);
// }
//
//}
//package com.xingdata.zzdpos.ui.manage.replenishment.fragment;
//
//
//import android.annotation.SuppressLint;
//import android.graphics.drawable.Drawable;
//import android.support.v7.widget.LinearLayoutManager;
//import android.view.KeyEvent;
//import android.view.View;
//import android.widget.TextView;
//
//import com.blankj.utilcode.util.KeyboardUtils;
//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.BaseActivity;
//import com.xingdata.zzdhd.base.BaseFragment;
//import com.xingdata.zzdhd.databinding.FragmentReplenishementDetailBinding;
//import com.xingdata.zzdhd.model.Psb;
//import com.xingdata.zzdhd.model.Sssku;
//import com.xingdata.zzdhd.ui.dialog.PromptDialog;
//import com.xingdata.zzdhd.ui.login.LoginPresenter;
//import com.xingdata.zzdhd.ui.manager.replenishment.ReplenishmentPresenter;
//import com.xingdata.zzdhd.ui.manager.replenishment.adpter.ReplenishmentDetailAdapter;
//import com.xingdata.zzdhd.util.ConvertUtil;
//import com.xingdata.zzdhd.util.OnClickListener;
//
//import java.util.ArrayList;
//import java.util.List;
//import java.util.regex.Matcher;
//import java.util.regex.Pattern;
//
//
///**
// * Created by Administrator on 2017/11/24.
// */
//
//public class ReplenishmentDetailFragment extends BaseFragment<ReplenishmentPresenter, FragmentReplenishementDetailBinding> {
//
// private ReplenishmentDetailAdapter mReplenishmentDetailAdapter;
// private List<Sssku> ssskuList = new ArrayList<>();
// private Psb mPsb;
// private long sumPrice;
// private boolean isAdd = true;
//
// @Override
// public int getLayoutId() {
// return R.layout.fragment_replenishement_detail;
// }
//
// @Override
// public void initView() {
//
// initRecycycler();
// mViewBinding.btnSearch.setOnClickListener(view -> {
// scrollToItem(mViewBinding.etKeyword.getText().toString().trim());
// });
// mViewBinding.etKeyword.setOnKeyListener((v, keyCode, event) -> {
// if (keyCode == KeyEvent.KEYCODE_ENTER)
// scrollToItem(mViewBinding.etKeyword.getText().toString().trim());
// return false;
// });
// mViewBinding.btnCanel.setOnClickListener(view -> {
// this.pop();
// });
//
// mViewBinding.btnEnd.setOnClickListener(view -> {
// if (mPsb == null || mPsb.getPsbStatus() == null) {
// Psb psb = new Psb();
// psb.setPsbType("0");
// psb.setSsskuList(mReplenishmentDetailAdapter.getData());
// mPresenter.clickReplenishmentSubmit(psb);
// } else {
// switch (mPsb.getPsbStatus()) {
// case 3:
// mPsb.setPsbdetailList(mReplenishmentDetailAdapter.getData());
// mPresenter.clickReplenishmentUpdate(mPsb);
// break;
// case 1:
// mPresenter.clickReplenishmentConfirm(mPsb.getPsbNo());
// break;
// }
// }
// });
// mViewBinding.btnPrint.setOnClickListener(new OnClickListener() {
// @Override
// protected void myOnClickListener(View v) {
// ZX_PrintPOS.getInstance(mContext).printOrder(1, mPsb);
// }
// });
// }
//
// private void initRecycycler() {
// mViewBinding.replenishmentRightRecycler.setLayoutManager(new LinearLayoutManager(getActivity()));
// if (mPsb != null && mPsb.getPsbStatus() != null) {
// switch (mPsb.getPsbStatus()) {
// case 3:
// mReplenishmentDetailAdapter = new ReplenishmentDetailAdapter(ssskuList, true);
// break;
// case 1:
// mReplenishmentDetailAdapter = new ReplenishmentDetailAdapter(ssskuList, true);
// break;
// case 0:
// mReplenishmentDetailAdapter = new ReplenishmentDetailAdapter(ssskuList, false);
// break;
// default:
// mReplenishmentDetailAdapter = new ReplenishmentDetailAdapter(ssskuList, true);
// break;
// }
// } else {
// mReplenishmentDetailAdapter = new ReplenishmentDetailAdapter(ssskuList, true);
// }
// mReplenishmentDetailAdapter.setEmptyView(getEmptyView());
// mViewBinding.replenishmentRightRecycler.setAdapter(mReplenishmentDetailAdapter);
// mReplenishmentDetailAdapter.setOnItemLongClickListener((adapter, view, position) -> {
// PromptDialog delDialog = new PromptDialog();
// delDialog.setDialogType(PromptDialog.PROMPTDIALOG_SELECT, "是否删除").setClick(new View.OnClickListener() {
// @Override
// public void onClick(View view) {
// mReplenishmentDetailAdapter.getData().remove(position);
// mReplenishmentDetailAdapter.notifyDataSetChanged();
// delDialog.dismiss();
// }
// }, new View.OnClickListener() {
// @Override
// public void onClick(View view) {
// delDialog.dismiss();
// }
// }).setCancelables(false).show((BaseActivity) mContext);
// return false;
// });
// mReplenishmentDetailAdapter.setmUpdatePriceListener(new ReplenishmentDetailAdapter.UpdatePriceListener() {
// @Override
// public void updatePrice(long amt) {
// sumPrice = sumPrice + amt;
// mViewBinding.setFinallyPrice(ConvertUtil.fenToYuan(sumPrice, true));
// }
// });
// initData();
// }
//
// private void initData() {
// if (isAdd) {
// mViewBinding.setIsShowSupplier(false);
// } else {
// mViewBinding.setIsShowSupplier(true);
// mViewBinding.setSupplierName(mPsb.getOutChannelNameabcn());
// mViewBinding.setSupplierAddress(mPsb.getOutCityProvName() + mPsb.getOutCityName() + mPsb.getOutCityCountyName() + mPsb.getOutCityAddress());
// mViewBinding.setSupplierTel(mPsb.getOutContactMob());
// mViewBinding.setDate(TimeUtils.millis2String(mPsb.getCreateTime()));
// mViewBinding.setNo(mPsb.getPsbNo());
// }
// if (this.ssskuList.size() != 0) {
// mViewBinding.setSumNum(ssskuList.size() + "种");
// mViewBinding.setFinallyPrice(ConvertUtil.fenToYuan(getSumPrice(), true));
// } else {
// mViewBinding.setSumNum("0个");
// mViewBinding.setFinallyPrice("¥0.00");
// }
// mViewBinding.setShopOderName(LoginPresenter.loginReturnBean.getOperName());
// mViewBinding.setShopName(LoginPresenter.loginReturnBean.getShopNameAbcn());
// mViewBinding.setShopAddress(LoginPresenter.loginReturnBean.getCityProvName() + LoginPresenter.loginReturnBean.getCityName() + LoginPresenter.loginReturnBean.getCityCountyName() + LoginPresenter.loginReturnBean.getCityAddress());
// mViewBinding.setShopTel(LoginPresenter.loginReturnBean.getContactTel());
//
// if (mPsb != null && mPsb.getPsbStatus() != null) {
// switch (mPsb.getPsbStatus()) {
// case 3:
// mViewBinding.btnEnd.setText("修改订单");
// mViewBinding.btnPrint.setVisibility(View.VISIBLE);
// break;
// case 1:
// mViewBinding.btnEnd.setText("确认收货");
// mViewBinding.btnPrint.setVisibility(View.VISIBLE);
// break;
// case 0:
// mViewBinding.btnEnd.setVisibility(View.GONE);
// mViewBinding.btnPrint.setVisibility(View.VISIBLE);
// break;
// default:
// break;
// }
// }
//
// }
//
// public long getSumPrice() {
// sumPrice = 0;
// for (Sssku sssku : mReplenishmentDetailAdapter.getData()) {
// sumPrice = sumPrice + sssku.getSellSumAmt();
// }
// return sumPrice;
// }
//
//
// public void setSsskuList(List<Sssku> ssskuList) {
// this.ssskuList = ssskuList;
// isAdd = true;
// this.mPsb = null;
// }
//
// public void setPsb(Psb psb) {
// this.mPsb = psb;
// this.ssskuList = psb.getSsskuList();
// isAdd = false;
// }
//
//
// @Override
// public void onDestroy() {
// mPresenter.isAllowFragment(true);
// super.onDestroy();
// }
//
// /**
// * 获取空页面
// *
// *
// * @return 空页面
// */
// protected View getEmptyView() {
// @SuppressLint("InflateParams") View view = getLayoutInflater().inflate(R.layout.view_empty, null);
// Drawable drawable=getResources().getDrawable(R.mipmap.bg_no_null);
// drawable.setBounds(0,0,200,200);
//
// TextView textView=((TextView) view.findViewById(R.id.tv_empty));
// textView.setCompoundDrawablesRelative(null,drawable,null,null);
// textView.setText(R.string.replenishment_detail_full);
// textView.setTextColor(getResources().getColor(R.color.black));
// return view;
// }
// private void scrollToItem(String string) {
//
// if (string.length() == 0) {
// ToastUtils.showShort("请输入搜索内容");
// return;
// }
// Pattern pattern = Pattern.compile(string, Pattern.CASE_INSENSITIVE);
//
// for (int i = 0; i < mReplenishmentDetailAdapter.getData().size(); i++) {
// Matcher matcher = pattern.matcher((mReplenishmentDetailAdapter.getData().get(i)).getSpuBarcode() + "");
// if (matcher.find()) {
// ((LinearLayoutManager) mViewBinding.replenishmentRightRecycler.getLayoutManager()).scrollToPositionWithOffset(i, 0);
// ToastUtils.showShort("已找到商品:" + mReplenishmentDetailAdapter.getData().get(i).getSpuName());
// KeyboardUtils.hideSoftInput(getActivity());
// return;
// }
// matcher = pattern.matcher((mReplenishmentDetailAdapter.getData().get(i)).getSpuAb() + "");
// if (matcher.find()) {
// ((LinearLayoutManager) mViewBinding.replenishmentRightRecycler.getLayoutManager()).scrollToPositionWithOffset(i, 0);
// ToastUtils.showShort("已找到商品:" + mReplenishmentDetailAdapter.getData().get(i).getSpuName());
// KeyboardUtils.hideSoftInput(getActivity());
// return;
// }
// matcher = pattern.matcher((mReplenishmentDetailAdapter.getData().get(i)).getSpuName() + "");
// if (matcher.find()) {
// ((LinearLayoutManager) mViewBinding.replenishmentRightRecycler.getLayoutManager()).scrollToPositionWithOffset(i, 0);
// ToastUtils.showShort("已找到商品:" + mReplenishmentDetailAdapter.getData().get(i).getSpuName());
// KeyboardUtils.hideSoftInput(getActivity());
// return;
// }
// }
//
// ToastUtils.showShort("没有找到相关货品");
// }
//}
package com.xingdata.zzdpos.ui.manage.replenishment.fragment;
import android.databinding.DataBindingUtil;
import android.graphics.Typeface;
import android.support.design.widget.TabLayout;
import android.view.View;
import android.widget.TextView;
import com.blankj.utilcode.util.ToastUtils;
import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseFragment;
import com.xingdata.zzdpos.databinding.FragmentReplenishementBinding;
import com.xingdata.zzdpos.databinding.ItemStringBinding;
import com.xingdata.zzdpos.model.Psb;
import com.xingdata.zzdpos.ui.dialog.LoadingDialog;
import com.xingdata.zzdpos.ui.main.adapter.FragmentViewAdapter;
import com.xingdata.zzdpos.ui.manage.replenishment.ReplenishmentPresenter;
import com.xingdata.zzdpos.ui.manage.replenishment.adpter.ReplenishmentAdapter;
import java.util.ArrayList;
import java.util.List;
import io.reactivex.Observable;
import io.reactivex.ObservableEmitter;
import io.reactivex.ObservableOnSubscribe;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.functions.Consumer;
import io.reactivex.schedulers.Schedulers;
/**
* Created by Administrator on 2017/11/24.
*/
public class ReplenishmentFragment extends BaseFragment<ReplenishmentPresenter, FragmentReplenishementBinding> {
private int[] titleInts = {R.string.manage_replenishment_unConfirmed, R.string.manage_replenishment_unReceive, R.string.manage_replenishment_finished};
private FragmentViewAdapter mFragmentPagerAdapter;
private List<BaseFragment> fragments;
@Override
public int getLayoutId() {
return R.layout.fragment_replenishement;
}
@Override
public void initView() {
initData();
initTab();
mPresenter.queryPsbList();
mViewBinding.btnAdd.setOnClickListener(view -> {
mPresenter.clickAdd();
});
mViewBinding.icTitle.ivRight.setImageResource(R.mipmap.but_sweep_yard);
mViewBinding.icTitle.edTitle.setHint("请输入供货商名称");
mViewBinding.icTitle.edTitle.setOnClickListener(view -> {
if (mViewBinding.icTitle.edTitle.getText().toString().trim().length() == 0) {
ToastUtils.showShort("请输入供货商名称");
return;
}
switch (mViewBinding.tab.getSelectedTabPosition()) {
case 0:
mPresenter.searchPsbList(mViewBinding.icTitle.edTitle.getText().toString(), (ReplenishmentListFragment) fragments.get(0));
break;
case 1:
mPresenter.searchPsbList(mViewBinding.icTitle.edTitle.getText().toString(), (ReplenishmentListFragment) fragments.get(1));
break;
case 2:
mPresenter.searchPsbList(mViewBinding.icTitle.edTitle.getText().toString(), (ReplenishmentListFragment) fragments.get(2));
break;
}
});
}
private void initTab() {
mViewBinding.tab.setupWithViewPager(mViewBinding.fragmentContainer);
Observable.create(new ObservableOnSubscribe<View>() {
@Override
public void subscribe(ObservableEmitter<View> e) throws Exception {
e.onNext(getLayoutInflater().inflate(R.layout.item_string, null));
e.onNext(getLayoutInflater().inflate(R.layout.item_string, null));
e.onNext(getLayoutInflater().inflate(R.layout.item_string, null));
}
}).subscribeOn(Schedulers.newThread()).observeOn(AndroidSchedulers.mainThread()).subscribe(new Consumer<View>() {
int i = 0;
@Override
public void accept(View view) throws Exception {
ItemStringBinding itemMenuBottomBinding = DataBindingUtil.bind(view);
if (i == 0) {
itemMenuBottomBinding.itemTv.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD));
}
itemMenuBottomBinding.itemTv.setText(titleInts[i]);
itemMenuBottomBinding.itemTv.setPadding(0, 0, 0, 0);
mViewBinding.tab.getTabAt(i).setCustomView(view);
i++;
}
});
mViewBinding.tab.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() {
@Override
public void onTabSelected(TabLayout.Tab tab) {
TextView textView = (TextView) tab.getCustomView().findViewById(R.id.item_tv);
textView.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD));
}
@Override
public void onTabUnselected(TabLayout.Tab tab) {
TextView textView = (TextView) tab.getCustomView().findViewById(R.id.item_tv);
textView.setTypeface(Typeface.defaultFromStyle(Typeface.NORMAL));
}
@Override
public void onTabReselected(TabLayout.Tab tab) {
}
});
}
public void initData() {
fragments = new ArrayList<>();
fragments.add(new ReplenishmentListFragment());
fragments.add(new ReplenishmentListFragment());
fragments.add(new ReplenishmentListFragment());
mFragmentPagerAdapter = new FragmentViewAdapter(fragments, getChildFragmentManager());
mViewBinding.fragmentContainer.setAdapter(mFragmentPagerAdapter);
}
public void showReplenishmentList(List<Psb> A, List<Psb> B, List<Psb> C) {
((ReplenishmentListFragment) fragments.get(0)).setData(A, true);
((ReplenishmentListFragment) fragments.get(1)).setData(B, true);
((ReplenishmentListFragment) fragments.get(2)).setData(C, true);
}
}
package com.xingdata.zzdpos.ui.manage.replenishment.fragment;
import android.content.Intent;
import android.os.Handler;
import android.support.v7.widget.LinearLayoutManager;
import android.view.View;
import android.widget.TextView;
import com.blankj.utilcode.util.ActivityUtils;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseFragment;
import com.xingdata.zzdpos.databinding.FragmentReplenishmentListBinding;
import com.xingdata.zzdpos.databinding.FragmentServiceBinding;
import com.xingdata.zzdpos.model.Pager;
import com.xingdata.zzdpos.model.Psb;
import com.xingdata.zzdpos.model.Saleorder;
import com.xingdata.zzdpos.ui.main.MainPresenter;
import com.xingdata.zzdpos.ui.main.adapter.MenuRecyclerAdapter;
import com.xingdata.zzdpos.ui.manage.replenishment.ReplenishmentPresenter;
import com.xingdata.zzdpos.ui.manage.replenishment.adpter.ReplenishmentAdapter;
import com.xingdata.zzdpos.ui.statistics.StatisticsDetailActivity;
import com.xingdata.zzdpos.ui.statistics.adapter.StatisticsOrderGroupAdapter;
import java.util.ArrayList;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class ReplenishmentListFragment extends BaseFragment<ReplenishmentPresenter, FragmentReplenishmentListBinding> {
private ReplenishmentAdapter mReplenishmentAdapter;
private List<Psb> psbArrayList = new ArrayList<>();
@Override
public int getLayoutId() {
return R.layout.fragment_replenishment_list;
}
@Override
public void initView() {
if (mReplenishmentAdapter == null) {
mReplenishmentAdapter = new ReplenishmentAdapter(psbArrayList);
mViewBinding.recycler.setLayoutManager(new LinearLayoutManager(getActivity()));
mViewBinding.recycler.setAdapter(mReplenishmentAdapter);
} else {
mViewBinding.recycler.setLayoutManager(new LinearLayoutManager(getActivity()));
mViewBinding.recycler.setAdapter(mReplenishmentAdapter);
}
mReplenishmentAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
@Override
public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
Intent intent = new Intent(getActivity(), StatisticsDetailActivity.class);
intent.putExtra(Saleorder.class.getName(), mReplenishmentAdapter.getData().get(position).getId());
ActivityUtils.startActivity(intent);
}
});
mViewBinding.srlProduct.setOnRefreshListener(this::onRefresh);
}
private void onRefresh() {
mPresenter.queryPsbList();
}
/**
* 设置数据
*
* @param pager 数据
* @param isRefresh 是否刷新
*/
/**
* 设置数据
*
* @param psbList 数据
* @param isRefresh 是否刷新
*/
public void setData(List<Psb> psbList, boolean isRefresh) {
if (mReplenishmentAdapter == null) {
psbArrayList = psbList;
return;
}
if (isRefresh) {
mReplenishmentAdapter.setEnableLoadMore(true);
mViewBinding.srlProduct.setRefreshing(false);
}
if (isRefresh) mReplenishmentAdapter.setNewData(psbList);
else if (psbList.size() > 0) mReplenishmentAdapter.addData(psbList);
if (mReplenishmentAdapter.getData().size() == 0) {
mViewBinding.llEmpty.setVisibility(View.VISIBLE);
mViewBinding.recycler.setVisibility(View.GONE);
} else {
mViewBinding.llEmpty.setVisibility(View.GONE);
mViewBinding.recycler.setVisibility(View.VISIBLE);
}
}
public void searchSucc(String wd) {
List<Psb> psbs = new ArrayList<>();
if (psbArrayList == null) {
return;
}
for (Psb psb : psbArrayList) {
if (wd.trim().length() == 0) {
return;
}
Pattern pattern = Pattern.compile(wd, Pattern.CASE_INSENSITIVE);
Matcher matcher = pattern.matcher((psb.getOutChannelNameabcn() + ""));
if (matcher.find()) {
psbs.add(psb);
}
}
mViewBinding.recycler.setVisibility(View.GONE);
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
if (psbs.size() == 0) {
mViewBinding.llEmpty.setVisibility(View.VISIBLE);
} else {
mReplenishmentAdapter.setNewData(psbs);
mReplenishmentAdapter.loadMoreEnd();
mViewBinding.recycler.setVisibility(View.VISIBLE);
}
}
}, 500);
}
}
......@@ -6,9 +6,14 @@ import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseActivity;
import com.xingdata.zzdpos.databinding.ActivityMsBinding;
import com.xingdata.zzdpos.model.Ms;
import com.xingdata.zzdpos.ui.dialog.LoadingDialog;
import com.xingdata.zzdpos.ui.marketing.ms.fragment.AddFragment;
import com.xingdata.zzdpos.ui.marketing.ms.fragment.EditorFragment;
import com.xingdata.zzdpos.ui.marketing.ms.fragment.ManagerFragment;
import com.xingdata.zzdpos.ui.marketing.ms.model.Area;
import com.xingdata.zzdpos.ui.marketing.ms.model.Group;
import com.xingdata.zzdpos.ui.marketing.ms.model.Type;
import com.xingdata.zzdpos.ui.marketing.ms.model.User;
import java.util.List;
......@@ -18,6 +23,8 @@ public class MsActivity extends BaseActivity<MsPresenter, ActivityMsBinding> imp
private EditorFragment mEditorFragment = new EditorFragment();
private AddFragment mAddFragment = new AddFragment();
private LoadingDialog mLoadingDialog = new LoadingDialog();
@Override
public int getLayoutId() {
return R.layout.activity_ms;
......@@ -42,20 +49,42 @@ public class MsActivity extends BaseActivity<MsPresenter, ActivityMsBinding> imp
@Override
public void showEditorFragment(Ms ms) {
LogUtils.e("编辑 " + ms.getMsName());
start(mEditorFragment);
}
@Override
public void showEditorFragment(int msType) {
LogUtils.e("添加 " + msType);
start(mEditorFragment);
}
@Override
public void showLoadingDialog() {
public void loadTypes(List<Type> types) {
mAddFragment.loadTypes(types);
}
@Override
public void loadAreas(List<Area> areas) {
mEditorFragment.loadArea(areas);
}
@Override
public void dismissLoadingDialog() {
public void loadGroups(List<Group> groups) {
mEditorFragment.loadGroup(groups);
}
@Override
public void loadUsers(List<User> users) {
mEditorFragment.loadUser(users);
}
@Override
public void showLoadingDialog() {
mLoadingDialog.show(this);
}
@Override
public void dismissLoadingDialog() {
mLoadingDialog.dismiss();
}
}
......@@ -3,6 +3,10 @@ package com.xingdata.zzdpos.ui.marketing.ms;
import com.xingdata.zzdpos.base.BasePresenter;
import com.xingdata.zzdpos.base.BaseView;
import com.xingdata.zzdpos.model.Ms;
import com.xingdata.zzdpos.ui.marketing.ms.model.Area;
import com.xingdata.zzdpos.ui.marketing.ms.model.Group;
import com.xingdata.zzdpos.ui.marketing.ms.model.Type;
import com.xingdata.zzdpos.ui.marketing.ms.model.User;
import java.util.List;
......@@ -27,7 +31,6 @@ interface MsContract {
*/
void showEditorFragment(Ms ms);
/**
* 显示编辑页面
*
......@@ -35,6 +38,34 @@ interface MsContract {
*/
void showEditorFragment(int msType);
/**
* 加载营销类型
*
* @param types 营销类型列表
*/
void loadTypes(List<Type> types);
/**
* 加载营销范围
*
* @param areas 营销范围列表
*/
void loadAreas(List<Area> areas);
/**
* 加载营销主体
*
* @param groups 营销主体列表
*/
void loadGroups(List<Group> groups);
/**
* 加载营销对象
*
* @param users 营销对象列表
*/
void loadUsers(List<User> users);
/**
* 显示读取对话框
*/
......@@ -68,10 +99,20 @@ interface MsContract {
*/
public abstract void clickMsItem(Ms ms);
/**
* 添加页面 - 初始化
*/
public abstract void initAdd();
/**
* 添加页面 - 点击类型的item
*/
public abstract void clickTypeItem(int msType);
public abstract void clickTypeItem(Type type);
/**
* 编辑页面 - 初始化
*/
public abstract void initEditor();
}
......
package com.xingdata.zzdpos.ui.marketing.ms;
import com.xingdata.zzdpos.C;
import com.xingdata.zzdpos.api.ApiFactory;
import com.xingdata.zzdpos.db.DBFactory;
import com.xingdata.zzdpos.model.Ms;
import com.xingdata.zzdpos.ui.marketing.ms.model.Area;
import com.xingdata.zzdpos.ui.marketing.ms.model.Group;
import com.xingdata.zzdpos.ui.marketing.ms.model.Type;
import com.xingdata.zzdpos.ui.marketing.ms.model.User;
import java.util.ArrayList;
import java.util.List;
public class MsPresenter extends MsContract.Presenter {
......@@ -38,8 +47,46 @@ public class MsPresenter extends MsContract.Presenter {
}
@Override
public void clickTypeItem(int msType) {
mView.showEditorFragment(msType);
public void initAdd() {
List<Type> types = new ArrayList<>();
types.add(new Type(C.MS_TYPE.DIS));
types.add(new Type(C.MS_TYPE.PROMOTION));
types.add(new Type(C.MS_TYPE.MONEY_OFF));
types.add(new Type(C.MS_TYPE.GIFT));
mView.loadTypes(types);
}
@Override
public void clickTypeItem(Type type) {
mView.showEditorFragment(type.getId());
}
@Override
public void initEditor() {
List<Group> groups = new ArrayList<>();
groups.add(new Group(C.MS_GROUP.ALL, "全场"));
groups.add(new Group(C.MS_GROUP.CATE, "指定品类"));
groups.add(new Group(C.MS_GROUP.SKU, "指定商品"));
List<Area> areas = new ArrayList<>();
areas.add(new Area(0, "所有门店"));
areas.add(new Area(1, "本店"));
List<User> users = new ArrayList<>();
users.add(new User(0, "所有顾客", 0));
users.add(new User(0, "所有会员", 0));
DBFactory.Marketing.Ms.queryLevel()
.doFinally(() -> {
mView.loadUsers(users);
mView.loadGroups(groups);
mView.loadAreas(areas);
})
.subscribe(levels -> {
for (int i = 0; i < levels.size(); i++) {
users.add(new User(1, levels.get(i).getVipLevelName(), levels.get(i).getVipLevel()));
}
});
}
/**
......
package com.xingdata.zzdpos.ui.marketing.ms.adapter;
import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseSelectedAdapter;
import com.xingdata.zzdpos.base.BaseViewHolder;
import com.xingdata.zzdpos.databinding.ItemSelectorBinding;
import com.xingdata.zzdpos.ui.marketing.ms.model.BaseBean;
import java.util.ArrayList;
public class BeanAdapter<T extends BaseBean> extends BaseSelectedAdapter<T, ItemSelectorBinding> {
public BeanAdapter() {
super(R.layout.item_selector, new ArrayList<>(), true);
}
@Override
protected void convert(BaseViewHolder helper, ItemSelectorBinding mViewBinding, T item) {
mViewBinding.setSelected(getSelectedPosition() == helper.getAdapterPosition());
mViewBinding.tvName.getPaint().setFakeBoldText(getSelectedPosition() == helper.getAdapterPosition());
mViewBinding.tvName.setText(item.getName());
}
public String[] getStrs() {
String[] strs = new String[getData().size()];
for (int i = 0; i < getData().size(); i++) {
strs[i] = getData().get(i).getName();
}
return strs;
}
public <B extends BaseBean> void setItemId(B b) {
}
}
package com.xingdata.zzdpos.ui.marketing.ms.adapter;
import android.support.annotation.Nullable;
import com.xingdata.zzdpos.C;
import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseAdapter;
import com.xingdata.zzdpos.databinding.ItemMsTypeBinding;
import com.xingdata.zzdpos.ui.marketing.ms.model.Type;
import java.util.List;
import java.util.ArrayList;
public class TypeAdapter extends BaseAdapter<Integer, ItemMsTypeBinding> {
public class TypeAdapter extends BaseAdapter<Type, ItemMsTypeBinding> {
public TypeAdapter(@Nullable List<Integer> data) {
super(R.layout.item_ms_type, data);
public TypeAdapter() {
super(R.layout.item_ms_type, new ArrayList<>());
}
@Override
protected void convert(ItemMsTypeBinding mViewBinding, Integer item) {
protected void convert(ItemMsTypeBinding mViewBinding, Type item) {
int resPic = -1, resStr = -1;
switch (item) {
switch (item.getId()) {
case C.MS_TYPE.DIS:
resPic = R.mipmap.icon_discount02;
resStr = R.string.ms_type_dis;
......
......@@ -2,19 +2,20 @@ package com.xingdata.zzdpos.ui.marketing.ms.fragment;
import android.support.v7.widget.GridLayoutManager;
import com.xingdata.zzdpos.C;
import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseFragment;
import com.xingdata.zzdpos.databinding.FragmentMsAddBinding;
import com.xingdata.zzdpos.ui.marketing.ms.MsPresenter;
import com.xingdata.zzdpos.ui.marketing.ms.adapter.TypeAdapter;
import com.xingdata.zzdpos.ui.marketing.ms.model.Type;
import com.xingdata.zzdpos.util.MyMenuItemDecoration;
import java.util.ArrayList;
import java.util.List;
public class AddFragment extends BaseFragment<MsPresenter, FragmentMsAddBinding> {
private TypeAdapter mTypeAdapter;
@Override
public int getLayoutId() {
return R.layout.fragment_ms_add;
......@@ -23,24 +24,28 @@ public class AddFragment extends BaseFragment<MsPresenter, FragmentMsAddBinding>
@Override
public void initView() {
// init type
TypeAdapter mTypeAdapter = new TypeAdapter(getTypeList());
mTypeAdapter = new TypeAdapter();
mViewBinding.rlType.setAdapter(mTypeAdapter);
mViewBinding.rlType.setLayoutManager(new GridLayoutManager(mContext, 2));
mViewBinding.rlType.addItemDecoration(new MyMenuItemDecoration(mContext, 2, getResources().getColor(R.color.gray_kongming)));
// set t listener
mTypeAdapter.setOnItemClickListener((adapter, view, position) -> mPresenter.clickTypeItem(mTypeAdapter.getData().get(position)));
mTypeAdapter.setOnItemClickListener((adapter, view, position) -> {
this.pop();
mPresenter.clickTypeItem(mTypeAdapter.getData().get(position));
});
// init data
mPresenter.initAdd();
}
/**
* 加载营销类型
*
* @param types 营销类型列表
*/
private List<Integer> getTypeList() {
List<Integer> msList = new ArrayList<>();
msList.add(C.MS_TYPE.DIS);
msList.add(C.MS_TYPE.PROMOTION);
msList.add(C.MS_TYPE.MONEY_OFF);
msList.add(C.MS_TYPE.GIFT);
return msList;
public void loadTypes(List<Type> types) {
mTypeAdapter.setNewData(types);
}
}
package com.xingdata.zzdpos.ui.marketing.ms.fragment;
import android.app.DatePickerDialog;
import android.app.TimePickerDialog;
import android.content.DialogInterface;
import android.databinding.DataBindingUtil;
import android.os.Build;
import android.support.v7.app.AlertDialog;
import android.support.v7.widget.LinearLayoutManager;
import android.view.View;
import com.blankj.utilcode.util.FragmentUtils;
import com.xingdata.zzdpos.C;
import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseFragment;
import com.xingdata.zzdpos.databinding.FragmentMsEditorBinding;
import com.xingdata.zzdpos.databinding.ViewTimeDetailBinding;
import com.xingdata.zzdpos.model.Ms;
import com.xingdata.zzdpos.ui.marketing.ms.MsPresenter;
import com.xingdata.zzdpos.ui.marketing.ms.adapter.BeanAdapter;
import com.xingdata.zzdpos.ui.marketing.ms.model.Area;
import com.xingdata.zzdpos.ui.marketing.ms.model.Group;
import com.xingdata.zzdpos.ui.marketing.ms.model.User;
import com.xingdata.zzdpos.ui.marketing.ms.view.BaseGroupView;
import com.xingdata.zzdpos.ui.marketing.ms.view.GroupAllView;
import com.xingdata.zzdpos.ui.marketing.ms.view.GroupCateView;
import com.xingdata.zzdpos.ui.marketing.ms.view.GroupSkuView;
import com.xingdata.zzdpos.util.ConvertUtil;
import java.util.List;
public class EditorFragment extends BaseFragment<MsPresenter, FragmentMsEditorBinding> {
private Ms mMs;
private BeanAdapter<Group> mGroupAdapter;
private BeanAdapter<Area> mAreaAdapter;
private BeanAdapter<User> mUserAdapter;
private DatePickerDialog mDateStartDialog, mDateEndDialog;
private TimePickerDialog mTimeStartDialog, mTimeEndDialog;
private ViewTimeDetailBinding mTimeDetailBinding;
private BaseGroupView mGroupView;
private GroupAllView mGroupAllView = new GroupAllView();
private GroupCateView mGroupCateView = new GroupCateView();
private GroupSkuView mGroupSkuView = new GroupSkuView();
@Override
public int getLayoutId() {
return R.layout.fragment_ms_editor;
......@@ -14,6 +55,287 @@ public class EditorFragment extends BaseFragment<MsPresenter, FragmentMsEditorBi
@Override
public void initView() {
{//TODO DELETE
mMs = new Ms();
mMs.setMsDateBegin(20170105L);
mMs.setMsDateEnd(20170115L);
mMs.setMsTimeBegin(000000L);
mMs.setMsTimeEnd(235959L);
mMs.setMsWeekPlan("1,2,3,5");
}
initInfoViews();
initTimeViews();
initMsViews();
mPresenter.initEditor();
}
/**
* 营销方案
*/
public EditorFragment setMs(Ms ms) {
this.mMs = ms;
return this;
}
/**
* 加载主体对象
*
* @param groups 营销主体列表
*/
public void loadGroup(List<Group> groups) {
mGroupAdapter.setNewData(groups);
}
/**
* 加载营销对象
*
* @param users 营销对象列表
*/
public void loadUser(List<User> users) {
mUserAdapter.setNewData(users);
}
/**
* 加载范围对象
*
* @param areas 营销范围列表
*/
public void loadArea(List<Area> areas) {
mAreaAdapter.setNewData(areas);
}
/**
* 初始化基本信息界面
*/
private void initInfoViews() {
}
private void setViewByMs() {
mViewBinding.setName(mMs.getMsName());
mViewBinding.setDateStart(new StringBuffer(mMs.getMsDateBegin().toString()).insert(8, "日").insert(6, "月").insert(4, "年").toString());
mViewBinding.setDateEnd(new StringBuffer(mMs.getMsDateEnd().toString()).insert(8, "日").insert(6, "月").insert(4, "年").toString());
}
/**
* 初始化时间信息界面
*/
private void initTimeViews() {
//init
mTimeDetailBinding = null;
//view stub
mViewBinding.vsTimeDetail.getViewStub().setOnInflateListener((viewStub, view) -> initTimeDetailViews(view));
//date
mViewBinding.llDateStart.setOnClickListener(view -> {
if (mDateStartDialog == null) initDateStartDialog();
mDateStartDialog.show();
});
mViewBinding.llDateEnd.setOnClickListener(view -> {
if (mDateEndDialog == null) initDateEndDialog();
mDateEndDialog.show();
});
// listener
mViewBinding.tvTimeMore.setOnClickListener(view -> {
if (mTimeDetailBinding == null) {
mViewBinding.vsTimeDetail.getViewStub().inflate();
} else if (mTimeDetailBinding.getRoot().getVisibility() == View.VISIBLE) {
mTimeDetailBinding.getRoot().setVisibility(View.GONE);
} else {
mTimeDetailBinding.getRoot().setVisibility(View.VISIBLE);
}
});
}
/**
* 初始化时间信息详情界面
*
* @param v viewStub的parent
*/
private void initTimeDetailViews(View v) {
mTimeDetailBinding = DataBindingUtil.bind(v);
//time
StringBuilder strTimeBegin = new StringBuilder(mMs.getMsTimeBegin().toString());
StringBuilder strTimeEnd = new StringBuilder(mMs.getMsTimeEnd().toString());
for (int i = strTimeBegin.length(); i < 6; i++) {
strTimeBegin.insert(0, "0");
}
for (int i = strTimeEnd.length(); i < 6; i++) {
strTimeEnd.insert(0, "0");
}
mTimeDetailBinding.setTimeStart(strTimeBegin.delete(4, 6).insert(2, ":").toString());
mTimeDetailBinding.setTimeEnd(strTimeEnd.delete(4, 6).insert(2, ":").toString());
// week
mTimeDetailBinding.cbSun.setChecked(mMs.getMsWeekPlan().contains("1"));
mTimeDetailBinding.cbMon.setChecked(mMs.getMsWeekPlan().contains("2"));
mTimeDetailBinding.cbTue.setChecked(mMs.getMsWeekPlan().contains("3"));
mTimeDetailBinding.cbWed.setChecked(mMs.getMsWeekPlan().contains("4"));
mTimeDetailBinding.cbThu.setChecked(mMs.getMsWeekPlan().contains("5"));
mTimeDetailBinding.cbFri.setChecked(mMs.getMsWeekPlan().contains("6"));
mTimeDetailBinding.cbSat.setChecked(mMs.getMsWeekPlan().contains("7"));
// listener
mTimeDetailBinding.tvTimeStart.setOnClickListener(view -> {
if (mTimeStartDialog == null) initTimeStartDialog();
mTimeStartDialog.show();
});
mTimeDetailBinding.tvTimeEnd.setOnClickListener(view -> {
if (mTimeEndDialog == null) initTimeEndDialog();
mTimeEndDialog.show();
});
}
/**
* 初始化活动信息界面
*/
private void initMsViews() {
// group
mGroupAdapter = new BeanAdapter<>();
mViewBinding.rlGroup.setAdapter(mGroupAdapter);
mViewBinding.rlGroup.setLayoutManager(new LinearLayoutManager(mContext));
// area
mAreaAdapter = new BeanAdapter<>();
// user
mUserAdapter = new BeanAdapter<>();
// listener
mGroupAdapter.setOnItemClickListener((adapter, view, position) -> {
});
mViewBinding.llArea.setOnClickListener(view -> showSelectorDialog(R.string.ms_editor_area, mAreaAdapter, (dialog, which) -> {
mViewBinding.setArea(mAreaAdapter.getStrs()[which]);
mAreaAdapter.setSelectedPosition(which);
dialog.dismiss();
})
);
mViewBinding.llUser.setOnClickListener(view -> showSelectorDialog(R.string.ms_editor_user, mUserAdapter, (dialog, which) -> {
mViewBinding.setUser(mUserAdapter.getStrs()[which]);
mUserAdapter.setSelectedPosition(which);
dialog.dismiss();
})
);
mGroupAdapter.setOnItemClickListener((adapter, view, position) -> {
switch (mGroupAdapter.getData().get(position).getId()) {
case C.MS_GROUP.ALL:
mGroupView = mGroupAllView;
break;
case C.MS_GROUP.CATE:
mGroupView = mGroupCateView;
break;
case C.MS_GROUP.SKU:
mGroupView = mGroupSkuView;
break;
}
mGroupView.setMs(mMs);
if (getChildFragmentManager().getFragments().size() == 0) {
FragmentUtils.add(getChildFragmentManager(), mGroupView, R.id.f_group);
} else {
FragmentUtils.replace(getChildFragmentManager(), mGroupView, R.id.f_group);
}
});
}
/**
* 初始化开始日期选择对话框
*/
private void initDateStartDialog() {
String[] strings = mViewBinding.getDateStart().split("[^x00-xff]");
mDateStartDialog = new DatePickerDialog(mContext, 0, (datePicker, year, month, day) -> {
String m = String.valueOf(month + 1).length() >= 2 ? String.valueOf(month + 1) : "0" + String.valueOf(month + 1);
String d = String.valueOf(day).length() >= 2 ? String.valueOf(day) : "0" + String.valueOf(day);
mViewBinding.setDateStart(year + "年" + m + "月" + d + "日");
mMs.setMsDateBegin(ConvertUtil.stringToLong(year + m + d));
if (mMs.getMsDateBegin() > mMs.getMsDateEnd()) {
mViewBinding.setDateEnd(mViewBinding.getDateStart());
if (mDateEndDialog != null) mDateEndDialog.updateDate(year, month, day);
}
}, Integer.valueOf(strings[0]), Integer.valueOf(strings[1]) - 1, Integer.valueOf(strings[2]));
}
/**
* 初始化结束日期选择对话框
*/
private void initDateEndDialog() {
String[] strings = mViewBinding.getDateEnd().split("[^x00-xff]");
mDateEndDialog = new DatePickerDialog(mContext, (datePicker, year, month, day) -> {
String m = String.valueOf(month + 1).length() >= 2 ? String.valueOf(month + 1) : "0" + String.valueOf(month + 1);
String d = String.valueOf(day).length() >= 2 ? String.valueOf(day) : "0" + String.valueOf(day);
mViewBinding.setDateEnd(year + "年" + m + "月" + d + "日");
mMs.setMsDateEnd(ConvertUtil.stringToLong(year + m + d));
if (mMs.getMsDateBegin() > mMs.getMsDateEnd()) {
mViewBinding.setDateStart(mViewBinding.getDateEnd());
if (mDateStartDialog != null) mDateStartDialog.updateDate(year, month, day);
}
}, Integer.valueOf(strings[0]), Integer.valueOf(strings[1]) - 1, Integer.valueOf(strings[2]));
}
/**
* 初始化开始时间选择对话框
*/
private void initTimeStartDialog() {
String[] strings = mTimeDetailBinding.getTimeStart().split(":");
mTimeStartDialog = new TimePickerDialog(mContext, (timePicker, hourOfDay, minute) -> {
String h = String.valueOf(hourOfDay).length() >= 2 ? String.valueOf(hourOfDay) : "0" + String.valueOf(hourOfDay);
String m = String.valueOf(minute).length() >= 2 ? String.valueOf(minute) : "0" + String.valueOf(minute);
mTimeDetailBinding.setTimeStart(h + ":" + m);
mMs.setMsTimeBegin(ConvertUtil.stringToLong(h + "" + m + 59));
if (mMs.getMsTimeBegin() > mMs.getMsTimeEnd()) {
mTimeDetailBinding.setTimeEnd(mTimeDetailBinding.getTimeStart());
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M && mTimeEndDialog != null) {
mTimeEndDialog.updateTime(hourOfDay, minute);
}
}
}, Integer.valueOf(strings[0]), Integer.valueOf(strings[1]), true);
}
/**
* 初始化结束时间选择对话框
*/
private void initTimeEndDialog() {
String[] strings = mTimeDetailBinding.getTimeEnd().split(":");
mTimeEndDialog = new TimePickerDialog(mContext, (timePicker, hourOfDay, minute) -> {
String h = String.valueOf(hourOfDay).length() >= 2 ? String.valueOf(hourOfDay) : "0" + String.valueOf(hourOfDay);
String m = String.valueOf(minute).length() >= 2 ? String.valueOf(minute) : "0" + String.valueOf(minute);
mTimeDetailBinding.setTimeEnd(h + ":" + m);
mMs.setMsTimeEnd(ConvertUtil.stringToLong(h + "" + m + 59));
if (mMs.getMsTimeBegin() > mMs.getMsTimeEnd()) {
mTimeDetailBinding.setTimeStart(mTimeDetailBinding.getTimeEnd());
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M && mTimeStartDialog != null) {
mTimeStartDialog.updateTime(hourOfDay, minute);
}
}
}, Integer.valueOf(strings[0]), Integer.valueOf(strings[1]), true);
}
/**
* 显示选择对话框
*
* @param title 标题
* @param adapter 适配器信息
* @param onClickListener item点击事件
*/
private void showSelectorDialog(int title, BeanAdapter adapter, DialogInterface.OnClickListener onClickListener) {
new AlertDialog.Builder(mContext).setTitle(title)
.setSingleChoiceItems(adapter.getStrs(), adapter.getSelectedPosition(), onClickListener)
.create().show();
}
}
package com.xingdata.zzdpos.ui.marketing.ms.model;
public class Area extends BaseBean {
public Area(int id, String name) {
setId(id);
setName(name);
}
}
package com.xingdata.zzdpos.ui.marketing.ms.model;
public class BaseBean {
private int id;
private String name;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
package com.xingdata.zzdpos.ui.marketing.ms.model;
public class Group extends BaseBean {
public Group(int id, String name) {
setId(id);
setName(name);
}
}
package com.xingdata.zzdpos.ui.marketing.ms.model;
public class Type extends BaseBean {
public Type(int id) {
setId(id);
}
}
package com.xingdata.zzdpos.ui.marketing.ms.model;
public class User extends BaseBean {
public User(int id, String name, int levelId) {
setId(id);
setName(name);
setLevelId(levelId);
}
private int levelId;
public int getLevelId() {
return levelId;
}
public void setLevelId(int levelId) {
this.levelId = levelId;
}
}
package com.xingdata.zzdpos.ui.marketing.ms.view;
import android.databinding.ViewDataBinding;
import com.xingdata.zzdpos.base.BaseFragment;
import com.xingdata.zzdpos.model.Ms;
import com.xingdata.zzdpos.ui.marketing.ms.MsPresenter;
public abstract class BaseGroupView<B extends ViewDataBinding> extends BaseFragment<MsPresenter, B> {
public Ms mMs;
@Override
public void initView() {
if (mMs != null) setViewByMs();
}
protected abstract void setViewByMs();
/**
* 设置营销计划
*
* @param ms 营销计划实体
* @return this
*/
public BaseGroupView setMs(Ms ms) {
this.mMs = ms;
return this;
}
/**
* 获取当前页面的属性赋给营销计划实体
*
* @param ms 要编辑的营销计划
* @return 是否成功赋值
*/
public abstract boolean processMs(Ms ms);
@Override
public void onDestroyView() {
if (mMs != null) processMs(mMs);
super.onDestroyView();
}
}
package com.xingdata.zzdpos.ui.marketing.ms.view;
import com.xingdata.zzdpos.C;
import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.databinding.ViewGroupAllBinding;
import com.xingdata.zzdpos.model.Ms;
/**
* 全场页面
*/
public class GroupAllView extends BaseGroupView<ViewGroupAllBinding> {
@Override
public int getLayoutId() {
return R.layout.view_group_all;
}
@Override
protected void setViewByMs() {
}
@Override
public boolean processMs(Ms ms) {
ms.setMsTouchTag2((byte) C.MS_GROUP.ALL);
return true;
}
}
package com.xingdata.zzdpos.ui.marketing.ms.view;
import android.view.View;
import android.widget.AdapterView;
import com.xingdata.zzdpos.C;
import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.api.ApiFactory;
import com.xingdata.zzdpos.databinding.ViewGroupCateBinding;
import com.xingdata.zzdpos.model.Category;
import com.xingdata.zzdpos.model.Ms;
import java.util.ArrayList;
import java.util.List;
/**
* 指定品类页面
*/
public class GroupCateView extends BaseGroupView<ViewGroupCateBinding> {
private int mClaPosition = 0, mGrpPosition = 0, mCatePosition = 0;
private List<Category> mClas, mGrps, mCates;
private AdapterView.OnItemSelectedListener mOnItemSelectedListener;
private long cateId;
public GroupCateView() {
mOnItemSelectedListener = new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> adapterView, View view, int i, long l) {
switch (adapterView.getId()) {
case R.id.ns_type_1:
mClaPosition = i;
mGrpPosition = 0;
mCatePosition = 0;
mViewBinding.nsType3.setVisibility(View.GONE);
loadGrp(mClas.get(i));
cateId = mClas.get(i).getSpuCateId();
break;
case R.id.ns_type_2:
mGrpPosition = i;
mCatePosition = 0;
if (mGrps.get(i).getSpuCateId() > 0) {
loadCate(mGrps.get(i));
cateId = mGrps.get(i).getSpuCateId();
mViewBinding.nsType3.setVisibility(View.VISIBLE);
} else {
cateId = mClas.get(mClaPosition).getSpuCateId();
mViewBinding.nsType3.setVisibility(View.GONE);
}
break;
case R.id.ns_type_3:
mCatePosition = i;
if (mCates.get(i).getSpuCateId() < 0) {
cateId = mGrps.get(mGrpPosition).getSpuCateId();
} else {
cateId = mCates.get(i).getSpuCateId();
}
break;
}
}
@Override
public void onNothingSelected(AdapterView<?> adapterView) {
}
};
}
@Override
public int getLayoutId() {
return R.layout.view_group_cate;
}
@Override
public void initView() {
super.initView();
loadCla();
mViewBinding.nsType1.setOnItemSelectedListener(mOnItemSelectedListener);
mViewBinding.nsType2.setOnItemSelectedListener(mOnItemSelectedListener);
mViewBinding.nsType3.setOnItemSelectedListener(mOnItemSelectedListener);
}
@Override
protected void setViewByMs() {
}
@Override
public boolean processMs(Ms ms) {
ms.setMsTouchTag2((byte) C.MS_GROUP.CATE);
ms.setSpuCateId((int) cateId);
return true;
}
/**
* 加载大类
*/
private void loadCla() {
ApiFactory.Shop.queryAll().subscribe(
categories -> {
mClas = categories;
List<String> strClas = new ArrayList<>();
for (int i = 0; i < categories.size(); i++) {
if (mMs != null && mMs.getSpuCateId() != null && mMs.getSpuCateId() / 10000 == categories.get(i).getSpuCateId() / 10000)
mClaPosition = i;
strClas.add(categories.get(i).getSpuClaName());
}
mViewBinding.nsType1.attachDataSource(strClas);
mViewBinding.nsType1.setSelectedIndex(mClaPosition);
cateId = mClas.get(0).getSpuCateId();
loadGrp(mClas.get(mClaPosition));
},
throwable -> {
});
}
/**
* 设置大类信息,加载中类
*
* @param cateCla 大类信息
*/
private void loadGrp(Category cateCla) {
ApiFactory.Shop.queryAll(cateCla).subscribe(
categories -> {
Category category = new Category();
category.setSpuGrpName("全部");
category.setSpuCateId(cateCla.getSpuCateId());
categories.add(0, category);
mGrps = categories;
List<String> strGrps = new ArrayList<>();
for (int j = 0; j < categories.size(); j++) {
if (mMs != null && mMs.getSpuCateId() != null && mMs.getSpuCateId() / 100 == categories.get(j).getSpuCateId() / 100)
mGrpPosition = j;
strGrps.add(categories.get(j).getSpuGrpName());
}
mViewBinding.nsType2.attachDataSource(strGrps);
mViewBinding.nsType2.setSelectedIndex(mGrpPosition);
if (mGrpPosition != 0) {
loadCate(mGrps.get(mGrpPosition));
mViewBinding.nsType3.setVisibility(View.VISIBLE);
}
},
throwable -> {
});
}
/**
* 设置中类信息,加载小类
*
* @param cateGrp 中类信息
*/
private void loadCate(Category cateGrp) {
ApiFactory.Shop.queryAll(cateGrp).subscribe(
categories -> {
Category category = new Category();
category.setSpuCateName("全部");
category.setSpuCateId(cateGrp.getSpuCateId());
categories.add(0, category);
mCates = categories;
List<String> strCates = new ArrayList<>();
for (int j = 0; j < categories.size(); j++) {
if (mMs != null && mMs.getSpuCateId() != null && mMs.getSpuCateId().longValue() == categories.get(j).getSpuCateId())
mCatePosition = j;
strCates.add(categories.get(j).getSpuCateName());
}
mViewBinding.nsType3.attachDataSource(strCates);
mViewBinding.nsType3.setSelectedIndex(mCatePosition);
},
throwable -> {
});
}
}
package com.xingdata.zzdpos.ui.marketing.ms.view;
import android.annotation.SuppressLint;
import android.view.View;
import com.xingdata.zzdpos.C;
import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.databinding.ViewGroupSkuBinding;
import com.xingdata.zzdpos.model.Ms;
import com.xingdata.zzdpos.model.Sssku;
import com.xingdata.zzdpos.util.ConvertUtil;
/**
* 指定商品页面
*/
public class GroupSkuView extends BaseGroupView<ViewGroupSkuBinding> {
private Sssku mSssku;
@Override
public int getLayoutId() {
return R.layout.view_group_sku;
}
@Override
public void initView() {
super.initView();
mViewBinding.btnSearch.setOnClickListener(view -> {
//TODO
// mPresenter.clickGroupSkuSearchButton(mViewBinding.etKeyword.getText().toString());
});
mViewBinding.etKeyword.requestFocus();
}
@SuppressLint("SetTextI18n")
@Override
protected void setViewByMs() {
if (mMs.getMsTouchTag2() == null || mMs.getMsTouchTag2() != C.MS_GROUP.SKU) return;
mViewBinding.llProduct.setVisibility(View.VISIBLE);
mViewBinding.etKeyword.setText(ConvertUtil.longToString(mMs.getSkuBarCode()));
mViewBinding.tvProductName.setText(getString(R.string.ms_editor_group_sku_name) + mMs.getSkuName());
mViewBinding.tvProductPrice.setText(getString(R.string.ms_editor_group_sku_price) + ConvertUtil.fenToYuan(mMs.getSkuPrice1(), true));
}
@Override
public boolean processMs(Ms ms) {
ms.setMsTouchTag2((byte) C.MS_GROUP.SKU);
if (mSssku == null && ms.getSkuId() == null) return false;
if (mSssku != null) ms.setSkuId(mSssku.getSkuId());
return true;
}
@SuppressLint("SetTextI18n")
public void loadSssku(Sssku sssku) {
this.mSssku = sssku;
if (sssku != null) {
mViewBinding.etKeyword.setText(ConvertUtil.longToString(sssku.getSpuBarcode()));
mViewBinding.tvProductName.setText(getString(R.string.ms_editor_group_sku_name) + sssku.getSpuName());
mViewBinding.tvProductPrice.setText(getString(R.string.ms_editor_group_sku_price) + ConvertUtil.fenToYuan(sssku.getSkuRetailPrice1(), true));
mViewBinding.llProduct.setVisibility(View.VISIBLE);
} else {
mViewBinding.llProduct.setVisibility(View.GONE);
}
}
}
package com.xingdata.zzdpos.ui.settle;
import android.content.Context;
import com.blankj.utilcode.util.StringUtils;
import com.xingdata.api.print.ZX_PrintPOS;
import com.xingdata.zzdpos.App;
import com.xingdata.zzdpos.C;
import com.xingdata.zzdpos.api.ApiFactory;
import com.xingdata.zzdpos.db.DBFactory;
......@@ -11,6 +15,7 @@ import com.xingdata.zzdpos.model.Saledetail;
import com.xingdata.zzdpos.model.Saleorder;
import com.xingdata.zzdpos.model.Ticket;
import com.xingdata.zzdpos.model.Vip;
import com.xingdata.zzdpos.ui.main.MainActivity;
import com.xingdata.zzdpos.ui.main.MainPresenter;
import java.util.ArrayList;
......@@ -301,6 +306,7 @@ public class SettlePresenter extends SettleContract.Presenter {
private void paySucc(Saleorder saleorder) {
mView.showPaySuccFragment(saleorder);
this.updateHandover(MainPresenter.handoverInfo);
ZX_PrintPOS.getInstance(MainActivity.mainActivity).print(1, saleorder);
}
/**
......
package com.xingdata.zzdpos.ui.settle.fragment;
import android.support.annotation.NonNull;
import android.support.design.widget.BottomSheetBehavior;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.LinearLayoutManager;
......@@ -58,6 +59,17 @@ public class SettleFragment extends BaseFragment<SettlePresenter, FragmentSettle
mViewBinding.cbPoint.setButtonDrawable(b ? R.mipmap.but_elect01 : R.mipmap.but_elect02);
mPresenter.changePointState(b);
});
BottomSheetBehavior.from(mViewBinding.llSheet).setBottomSheetCallback(new BottomSheetBehavior.BottomSheetCallback() {
@Override
public void onStateChanged(@NonNull View bottomSheet, int newState) {
}
@Override
public void onSlide(@NonNull View bottomSheet, float slideOffset) {
mViewBinding.tvSettle.setAlpha(1 - slideOffset);
}
});
// init
mPresenter.initSettle();
......
......@@ -4,6 +4,7 @@ package com.xingdata.zzdpos.ui.statistics;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.databinding.DataBindingUtil;
import android.graphics.Paint;
import android.util.TimeUtils;
import android.view.LayoutInflater;
import android.view.View;
......@@ -11,6 +12,7 @@ import android.view.View;
import com.alibaba.fastjson.JSON;
import com.blankj.utilcode.util.ToastUtils;
import com.google.gson.Gson;
import com.xingdata.api.print.ZX_PrintPOS;
import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseActivity;
import com.xingdata.zzdpos.databinding.ActivityStatisticsDetailBinding;
......@@ -23,6 +25,7 @@ import com.xingdata.zzdpos.model.Saleorder;
import com.xingdata.zzdpos.model.Ticket;
import com.xingdata.zzdpos.model.VipRechargeOrder;
import com.xingdata.zzdpos.ui.dialog.LoadingDialog;
import com.xingdata.zzdpos.ui.main.MainActivity;
import com.xingdata.zzdpos.util.ConvertUtil;
import com.xingdata.zzdpos.util.OnClickListener;
......@@ -128,6 +131,8 @@ public class StatisticsDetailActivity extends BaseActivity<StatisticsDetailPrese
viewOrderDetailBinding.setSumAmt(ConvertUtil.fenToYuan(mSaleorder.getOrderAuthAmt(), false));
viewOrderDetailBinding.setOperName(mSaleorder.getOperName());
viewOrderDetailBinding.setGoodsNum(mSaleorder.getOrderCnt() + "");
if (mSaleorder.getCutAmt() == null || mSaleorder.getCutAmt() == 0) {
viewOrderDetailBinding.setCutAmtShow(false);
} else {
......@@ -145,7 +150,14 @@ public class StatisticsDetailActivity extends BaseActivity<StatisticsDetailPrese
itemSettleSaledetailBinding.tvCount.setText(saledetail.getCnt());
itemSettleSaledetailBinding.tvPrice.setText("¥" + saledetail.getPrice());
itemSettleSaledetailBinding.tvName.setText(saledetail.getName());
// itemSettleSaledetailBinding.tvInitialPrice.setText(saledetail.getpr);
if (saledetail.isDiscount()) {
itemSettleSaledetailBinding.tvInitialPrice.setText(ConvertUtil.fenToYuan(saledetail.getSkuPrice(), true));
itemSettleSaledetailBinding.tvInitialPrice.setVisibility(View.VISIBLE);
itemSettleSaledetailBinding.tvInitialPrice.setPaintFlags(itemSettleSaledetailBinding.tvInitialPrice.getPaintFlags() | Paint.STRIKE_THRU_TEXT_FLAG);
} else {
itemSettleSaledetailBinding.tvInitialPrice.setVisibility(View.GONE);
}
viewOrderDetailBinding.llGoodsList.addView(view);
}
......@@ -169,6 +181,14 @@ public class StatisticsDetailActivity extends BaseActivity<StatisticsDetailPrese
}
});
mViewBinding.btnPrint.setOnClickListener(new OnClickListener() {
@Override
protected void myOnClickListener(View v) {
ZX_PrintPOS.getInstance(MainActivity.mainActivity).print(1, mSaleorder);
mViewBinding.btnPrint.setEnabled(false);
mViewBinding.btnPrint.setText("已打印");
}
});
}
}
......
......@@ -49,7 +49,7 @@ public class StatisticsPresenter extends StatisticsContract.Presenter {
})
.subscribe(orderlist -> {
fragment.setData(orderlist, orderlist.isFirstPage());
fragment.setData(orderlist);
}, throwable -> {
ToastUtils.showShort(throwable.getMessage());
});
......@@ -77,7 +77,7 @@ public class StatisticsPresenter extends StatisticsContract.Presenter {
mView.isShowLoading(true);
ApiFactory.Rctrace.queryRecharge(pageNumber, nowPageSize).doFinally(()-> mView.isShowLoading(false))
.subscribe(vipRechargeOrderPager -> {
msListFragment.setData(vipRechargeOrderPager, vipRechargeOrderPager.isFirstPage());
msListFragment.setData(vipRechargeOrderPager);
}, throwable -> {
ToastUtils.showShort(throwable.getMessage());
});
......@@ -104,7 +104,7 @@ public class StatisticsPresenter extends StatisticsContract.Presenter {
mView.isShowLoading(true);
ApiFactory.Ticket.query(pageNumber, nowPageSize, 2).doFinally(()-> mView.isShowLoading(false))
.subscribe(ticketPager -> {
msListFragment.setData(ticketPager, ticketPager.isFirstPage());
msListFragment.setData(ticketPager);
}, throwable -> {
ToastUtils.showShort(throwable.getMessage());
});
......
package com.xingdata.zzdpos.ui.statistics.adapter;
import android.support.v7.widget.RecyclerView;
import com.chad.library.adapter.base.BaseSectionQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.xingdata.zzdpos.model.Saleorder;
import java.util.List;
/**
* Created by Administrator on 2017/12/26.
*/
public class StatisticsGroupAdapter extends BaseSectionQuickAdapter<Saleorder, BaseViewHolder> {
public StatisticsGroupAdapter(int layoutResId, int sectionHeadResId, List<Saleorder> data) {
super(layoutResId, sectionHeadResId, data);
}
@Override
protected void convertHead(com.chad.library.adapter.base.BaseViewHolder helper, Saleorder item) {
}
@Override
protected void convert(BaseViewHolder helper, Saleorder item) {
}
}
\ No newline at end of file
package com.xingdata.zzdpos.ui.statistics.adapter;
import android.widget.ImageView;
import com.blankj.utilcode.util.TimeUtils;
import com.chad.library.adapter.base.BaseSectionQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.xingdata.zzdpos.C;
import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.model.Saleorder;
import com.xingdata.zzdpos.model.VipRechargeOrder;
import com.xingdata.zzdpos.util.ConvertUtil;
import com.xingdata.zzdpos.util.StringUtil;
import java.text.SimpleDateFormat;
import java.util.List;
/**
* Created by Administrator on 2017/12/26.
*/
public class StatisticsOrderGroupAdapter extends BaseSectionQuickAdapter<Saleorder, BaseViewHolder> {
public StatisticsOrderGroupAdapter(List<Saleorder> data) {
super(R.layout.item_statistics, R.layout.item_string_head, data);
}
@Override
protected void convertHead(BaseViewHolder helper, Saleorder item) {
helper.setText(R.id.item_tv, item.header);
}
@Override
protected void convert(BaseViewHolder helper, Saleorder item) {
if (item.getFirstName() != null) {
helper.setText(R.id.tv_left_top, item.getFirstName());
} else {
helper.setText(R.id.tv_left_top, item.getOrderNo());
}
if (item.getOrderPayAmt() > 0) {
helper.setText(R.id.tv_right_top, "+" + item.getPayAmt());
} else {
helper.setText(R.id.tv_right_top, item.getPayAmt());
}
helper.setText(R.id.tv_left_bottom, com.blankj.utilcode.util.TimeUtils.millis2String(item.getCreateTime(), new SimpleDateFormat(StringUtil.mmddhhmmmDatePattern)));
switch (item.getPayType()) {
case C.PAY_CHANNEL.CASH:
((ImageView) helper.getView(R.id.img_left)).setImageResource(R.mipmap.pay_cash);
break;
case C.PAY_CHANNEL.WECHAT:
((ImageView) helper.getView(R.id.img_left)).setImageResource(R.mipmap.pay_wechat);
break;
case C.PAY_CHANNEL.ALI:
((ImageView) helper.getView(R.id.img_left)).setImageResource(R.mipmap.pay_alipay);
break;
case C.PAY_CHANNEL.BANK:
((ImageView) helper.getView(R.id.img_left)).setImageResource(R.mipmap.pay_card);
break;
case C.PAY_CHANNEL.CARD:
((ImageView) helper.getView(R.id.img_left)).setImageResource(R.mipmap.pay_membershipcard);
break;
case C.PAY_CHANNEL.TALLY:
((ImageView) helper.getView(R.id.img_left)).setImageResource(R.mipmap.pay_credit);
break;
}
}
}
\ No newline at end of file
package com.xingdata.zzdpos.ui.statistics.adapter;
import android.support.v7.widget.RecyclerView;
import android.widget.ImageView;
import com.chad.library.adapter.base.BaseSectionQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.model.Saleorder;
import com.xingdata.zzdpos.model.VipRechargeOrder;
import com.xingdata.zzdpos.util.ConvertUtil;
import com.xingdata.zzdpos.util.StringUtil;
import java.text.SimpleDateFormat;
import java.util.List;
/**
* Created by Administrator on 2017/12/26.
*/
public class StatisticsRechargeGroupAdapter extends BaseSectionQuickAdapter<VipRechargeOrder, BaseViewHolder> {
public StatisticsRechargeGroupAdapter(List<VipRechargeOrder> data) {
super(R.layout.item_statistics, R.layout.item_string_head, data);
}
@Override
protected void convertHead(com.chad.library.adapter.base.BaseViewHolder helper, VipRechargeOrder item) {
helper.setText(R.id.item_tv,item.header);
}
@Override
protected void convert(BaseViewHolder helper, VipRechargeOrder item) {
helper.setText(R.id.tv_left_top,item.getUserName());
helper.setText(R.id.tv_left_bottom,com.blankj.utilcode.util.TimeUtils.millis2String(item.getCreateTime(),new SimpleDateFormat(StringUtil.mmddhhmmmDatePattern)));
helper.setText(R.id.tv_right_top,"+"+ ConvertUtil.fenToYuan(item.getCardAmtPay(),false));
((ImageView)helper.getView(R.id.img_left)).setImageResource(R.mipmap.ic_text_recharge);
}
}
\ No newline at end of file
package com.xingdata.zzdpos.ui.statistics.adapter;
import android.widget.ImageView;
import com.blankj.utilcode.util.TimeUtils;
import com.chad.library.adapter.base.BaseSectionQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.model.Ticket;
import com.xingdata.zzdpos.model.VipRechargeOrder;
import com.xingdata.zzdpos.util.ConvertUtil;
import com.xingdata.zzdpos.util.StringUtil;
import java.text.SimpleDateFormat;
import java.util.List;
/**
* Created by Administrator on 2017/12/26.
*/
public class StatisticsTicketGroupAdapter extends BaseSectionQuickAdapter<Ticket, BaseViewHolder> {
public StatisticsTicketGroupAdapter(List<Ticket> data) {
super(R.layout.item_statistics, R.layout.item_string_head, data);
}
@Override
protected void convertHead(BaseViewHolder helper, Ticket item) {
helper.setText(R.id.item_tv, item.header);
}
@Override
protected void convert(BaseViewHolder helper, Ticket item) {
helper.setText(R.id.tv_left_top, ConvertUtil.fenToYuanNoZero(item.getTicketValAmt()) + "元优惠券");
helper.setText(R.id.tv_left_bottom, TimeUtils.date2String(item.getCreateTime(),new SimpleDateFormat(StringUtil.mmddhhmmmDatePattern)));
((ImageView) helper.getView(R.id.img_left)).setImageResource(R.mipmap.ic_text_ticket);
}
}
\ No newline at end of file
......@@ -225,7 +225,7 @@ public class StatisticsTitleFragment extends BaseFragment<StatisticsPresenter, F
return true;
}
if (mTicketSearchFragment.isAdded()) {
FragmentUtils.remove(mRechargeSearchFragment);
FragmentUtils.remove(mTicketSearchFragment);
return true;
}
mViewBinding.icTitle.edTitle.setText("");
......
package com.xingdata.zzdpos.ui.statistics.fragment.ms;
import android.databinding.DataBindingUtil;
import android.graphics.Typeface;
import android.support.design.widget.TabLayout;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.TextView;
import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseFragment;
import com.xingdata.zzdpos.databinding.FragmentMsMainBinding;
import com.xingdata.zzdpos.databinding.ItemMenuBottomBinding;
import com.xingdata.zzdpos.databinding.ItemStringBinding;
import com.xingdata.zzdpos.ui.main.MainPresenter;
import com.xingdata.zzdpos.ui.main.adapter.FragmentViewAdapter;
......@@ -11,9 +20,16 @@ import java.util.ArrayList;
import java.util.Calendar;
import java.util.List;
import io.reactivex.Observable;
import io.reactivex.ObservableEmitter;
import io.reactivex.ObservableOnSubscribe;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.functions.Consumer;
import io.reactivex.schedulers.Schedulers;
public class MsMainFragment extends BaseFragment<MainPresenter, FragmentMsMainBinding> {
public class MsMainFragment extends BaseFragment<MainPresenter, FragmentMsMainBinding> {
private int[] titleInts = {R.string.statistics_menu_ms_recharge, R.string.statistics_menu_ms_usedTicket};
private FragmentViewAdapter mFragmentStateAdapter;
private List<Long> dateLongs = new ArrayList<>();
private List<BaseFragment> fragments = new ArrayList<>();
......@@ -57,7 +73,60 @@ public class MsMainFragment extends BaseFragment<MainPresenter, FragmentMsMainBi
}, 1);
}
initTab();
}
private void initTab() {
Observable.create(new ObservableOnSubscribe<View>() {
@Override
public void subscribe(ObservableEmitter<View> e) throws Exception {
e.onNext(getLayoutInflater().inflate(R.layout.item_string, null));
e.onNext(getLayoutInflater().inflate(R.layout.item_string, null));
}
}).subscribeOn(Schedulers.newThread()).observeOn(AndroidSchedulers.mainThread()).subscribe(new Consumer<View>() {
int i = 0;
@Override
public void accept(View view) throws Exception {
ItemStringBinding itemMenuBottomBinding = DataBindingUtil.bind(view);
if (i == 0) {
itemMenuBottomBinding.itemTv.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD));
}
itemMenuBottomBinding.itemTv.setText(titleInts[i]);
itemMenuBottomBinding.itemTv.setPadding(0, 0, 0, 0);
mViewBinding.tabLayout.getTabAt(i).setCustomView(view);
i++;
}
});
mViewBinding.tabLayout.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() {
@Override
public void onTabSelected(TabLayout.Tab tab) {
TextView textView = (TextView) tab.getCustomView().findViewById(R.id.item_tv);
textView.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD));
textView.setText(tab.getText());
}
@Override
public void onTabUnselected(TabLayout.Tab tab) {
TextView textView = (TextView) tab.getCustomView().findViewById(R.id.item_tv);
textView.setTypeface(Typeface.defaultFromStyle(Typeface.NORMAL));
textView.setText(tab.getText());
}
@Override
public void onTabReselected(TabLayout.Tab tab) {
}
});
}
public int getTabItem() {
return mViewBinding.tabLayout.getSelectedTabPosition();
}
......
......@@ -6,6 +6,7 @@ import android.support.v7.widget.LinearLayoutManager;
import android.view.View;
import com.blankj.utilcode.util.ActivityUtils;
import com.blankj.utilcode.util.TimeUtils;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseFragment;
......@@ -14,14 +15,23 @@ import com.xingdata.zzdpos.model.Pager;
import com.xingdata.zzdpos.model.VipRechargeOrder;
import com.xingdata.zzdpos.ui.statistics.StatisticsDetailActivity;
import com.xingdata.zzdpos.ui.statistics.StatisticsPresenter;
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 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 RechargeListFragment extends BaseFragment<StatisticsPresenter, FragmentMsListBinding> {
private StatisticsRechargeAdapter mStatisticsRechargeAdapter;
private StatisticsRechargeGroupAdapter mStatisticsGroupAdapter;
private int pagerNum;
private String monthDate;
@Override
......@@ -33,30 +43,36 @@ public class RechargeListFragment extends BaseFragment<StatisticsPresenter, Frag
public void initView() {
pagerNum = 1;
mViewBinding.tvEmpty.setText(R.string.statistics_search_empty_recharge);
if (mStatisticsRechargeAdapter == null) {
mStatisticsRechargeAdapter = new StatisticsRechargeAdapter(new ArrayList<>());
if (mStatisticsGroupAdapter == null) {
mStatisticsGroupAdapter = new StatisticsRechargeGroupAdapter(new ArrayList<>());
mViewBinding.statisticsRecycler.setLayoutManager(new LinearLayoutManager(getActivity()));
mViewBinding.statisticsRecycler.setAdapter(mStatisticsRechargeAdapter);
mViewBinding.statisticsRecycler.setAdapter(mStatisticsGroupAdapter);
} else {
mViewBinding.statisticsRecycler.setLayoutManager(new LinearLayoutManager(getActivity()));
mViewBinding.statisticsRecycler.setAdapter(mStatisticsRechargeAdapter);
mViewBinding.statisticsRecycler.setAdapter(mStatisticsGroupAdapter);
}
mStatisticsRechargeAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
mStatisticsGroupAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
@Override
public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
Intent intent = new Intent(getActivity(), StatisticsDetailActivity.class);
intent.putExtra(VipRechargeOrder.class.getName(), mStatisticsRechargeAdapter.getData().get(position));
ActivityUtils.startActivity(intent);
if (!mStatisticsGroupAdapter.getData().get(position).isHeader) {
Intent intent = new Intent(getActivity(), StatisticsDetailActivity.class);
intent.putExtra(VipRechargeOrder.class.getName(), mStatisticsGroupAdapter.getData().get(position));
ActivityUtils.startActivity(intent);
}
}
});
mViewBinding.srlProduct.setOnRefreshListener(this::onRefresh);
mStatisticsRechargeAdapter.setOnLoadMoreListener(this::onLoadMore, mViewBinding.statisticsRecycler);
mStatisticsGroupAdapter.setOnLoadMoreListener(this::onLoadMore, mViewBinding.statisticsRecycler);
mPresenter.getRechargeList(pagerNum, this);
}
private void onRefresh() {
......@@ -78,15 +94,15 @@ public class RechargeListFragment extends BaseFragment<StatisticsPresenter, Frag
*/
public void setData(Pager<VipRechargeOrder> pager, boolean isRefresh) {
if (isRefresh) {
mStatisticsRechargeAdapter.setEnableLoadMore(true);
mStatisticsGroupAdapter.setEnableLoadMore(true);
mViewBinding.srlProduct.setRefreshing(false);
}
if (isRefresh) mStatisticsRechargeAdapter.setNewData(pager.getList());
else if (pager.getList().size() > 0) mStatisticsRechargeAdapter.addData(pager.getList());
if (pager.isLastPage()) mStatisticsRechargeAdapter.loadMoreEnd(isRefresh);
else mStatisticsRechargeAdapter.loadMoreComplete();
if (isRefresh) mStatisticsGroupAdapter.setNewData(pager.getList());
else if (pager.getList().size() > 0) mStatisticsGroupAdapter.addData(pager.getList());
if (pager.isLastPage()) mStatisticsGroupAdapter.loadMoreEnd(isRefresh);
else mStatisticsGroupAdapter.loadMoreComplete();
if (mStatisticsRechargeAdapter.getData().size() == 0) {
if (mStatisticsGroupAdapter.getData().size() == 0) {
mViewBinding.llEmpty.setVisibility(View.VISIBLE);
mViewBinding.statisticsRecycler.setVisibility(View.GONE);
} else {
......@@ -95,9 +111,44 @@ public class RechargeListFragment extends BaseFragment<StatisticsPresenter, Frag
}
}
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();
}
@Override
public String getTabTitle() {
return "充值记录";
}
@Override
public void onDestroy() {
super.onDestroy();
}
}
......@@ -6,6 +6,7 @@ import android.support.v7.widget.LinearLayoutManager;
import android.view.View;
import com.blankj.utilcode.util.ActivityUtils;
import com.blankj.utilcode.util.TimeUtils;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseFragment;
......@@ -14,17 +15,25 @@ import com.xingdata.zzdpos.model.Pager;
import com.xingdata.zzdpos.model.Ticket;
import com.xingdata.zzdpos.ui.statistics.StatisticsDetailActivity;
import com.xingdata.zzdpos.ui.statistics.StatisticsPresenter;
import com.xingdata.zzdpos.ui.statistics.adapter.StatisticsTicketAdapter;
import com.xingdata.zzdpos.ui.statistics.adapter.StatisticsTicketAdapter;
import com.xingdata.zzdpos.ui.statistics.adapter.StatisticsRechargeGroupAdapter;
import com.xingdata.zzdpos.ui.statistics.adapter.StatisticsTicketGroupAdapter;
import com.xingdata.zzdpos.util.StringUtil;
import java.text.SimpleDateFormat;
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 UsedTicketListFragment extends BaseFragment<StatisticsPresenter, FragmentMsListBinding> {
private StatisticsTicketAdapter mStatisticsTicketAdapter;
private StatisticsTicketGroupAdapter mStatisticsGroupAdapter;
private int pagerNum;
private String monthDate;
@Override
public int getLayoutId() {
......@@ -36,27 +45,30 @@ public class UsedTicketListFragment extends BaseFragment<StatisticsPresenter, Fr
pagerNum = 1;
mViewBinding.tvEmpty.setText(R.string.statistics_search_empty_ticket);
if (mStatisticsTicketAdapter == null) {
mStatisticsTicketAdapter = new StatisticsTicketAdapter(new ArrayList<>());
if (mStatisticsGroupAdapter == null) {
mStatisticsGroupAdapter = new StatisticsTicketGroupAdapter(new ArrayList<>());
mViewBinding.statisticsRecycler.setLayoutManager(new LinearLayoutManager(getActivity()));
mViewBinding.statisticsRecycler.setAdapter(mStatisticsTicketAdapter);
mViewBinding.statisticsRecycler.setAdapter(mStatisticsGroupAdapter);
} else {
mViewBinding.statisticsRecycler.setLayoutManager(new LinearLayoutManager(getActivity()));
mViewBinding.statisticsRecycler.setAdapter(mStatisticsTicketAdapter);
mViewBinding.statisticsRecycler.setAdapter(mStatisticsGroupAdapter);
}
mStatisticsTicketAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
mStatisticsGroupAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
@Override
public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
Intent intent = new Intent(getActivity(), StatisticsDetailActivity.class);
intent.putExtra(Ticket.class.getName(), mStatisticsTicketAdapter.getData().get(position));
ActivityUtils.startActivity(intent);
if (!mStatisticsGroupAdapter.getData().get(position).isHeader) {
Intent intent = new Intent(getActivity(), StatisticsDetailActivity.class);
intent.putExtra(Ticket.class.getName(), mStatisticsGroupAdapter.getData().get(position));
ActivityUtils.startActivity(intent);
}
}
});
mViewBinding.srlProduct.setOnRefreshListener(this::onRefresh);
mStatisticsTicketAdapter.setOnLoadMoreListener(this::onLoadMore, mViewBinding.statisticsRecycler);
mStatisticsGroupAdapter.setOnLoadMoreListener(this::onLoadMore, mViewBinding.statisticsRecycler);
mPresenter.getTicketList(pagerNum, this);
}
......@@ -80,15 +92,15 @@ public class UsedTicketListFragment extends BaseFragment<StatisticsPresenter, Fr
*/
public void setData(Pager<Ticket> pager, boolean isRefresh) {
if (isRefresh) {
mStatisticsTicketAdapter.setEnableLoadMore(true);
mStatisticsGroupAdapter.setEnableLoadMore(true);
mViewBinding.srlProduct.setRefreshing(false);
}
if (isRefresh) mStatisticsTicketAdapter.setNewData(pager.getList());
else if (pager.getList().size() > 0) mStatisticsTicketAdapter.addData(pager.getList());
if (pager.isLastPage()) mStatisticsTicketAdapter.loadMoreEnd(isRefresh);
else mStatisticsTicketAdapter.loadMoreComplete();
if (isRefresh) mStatisticsGroupAdapter.setNewData(pager.getList());
else if (pager.getList().size() > 0) mStatisticsGroupAdapter.addData(pager.getList());
if (pager.isLastPage()) mStatisticsGroupAdapter.loadMoreEnd(isRefresh);
else mStatisticsGroupAdapter.loadMoreComplete();
if (mStatisticsTicketAdapter.getData().size() == 0) {
if (mStatisticsGroupAdapter.getData().size() == 0) {
mViewBinding.llEmpty.setVisibility(View.VISIBLE);
mViewBinding.statisticsRecycler.setVisibility(View.GONE);
} else {
......@@ -97,6 +109,36 @@ public class UsedTicketListFragment extends BaseFragment<StatisticsPresenter, Fr
}
}
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();
}
@Override
public String getTabTitle() {
......
......@@ -8,6 +8,7 @@ import android.view.View;
import com.alibaba.fastjson.JSON;
import com.blankj.utilcode.util.ActivityUtils;
import com.blankj.utilcode.util.TimeUtils;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseFragment;
......@@ -21,18 +22,29 @@ import com.xingdata.zzdpos.ui.statistics.StatisticsDetailActivity;
import com.xingdata.zzdpos.ui.statistics.StatisticsPresenter;
import com.xingdata.zzdpos.ui.statistics.adapter.StatisticsOrderAdapter;
import com.xingdata.zzdpos.ui.statistics.adapter.StatisticsOrderGroupAdapter;
import com.xingdata.zzdpos.util.OnClickListener;
import com.xingdata.zzdpos.util.StringUtil;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
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 OrderListFragment extends BaseFragment<StatisticsPresenter, FragmentOrderListBinding> {
private StatisticsOrderAdapter mStatisticsAdapter;
private StatisticsOrderGroupAdapter mStatisticsAdapter;
private Long monthDateStart;
private Long monthDateEnd;
private int pagerNum ;
private String monthDate;
public OrderListFragment setDate(Long end, Long start) {
monthDateStart = start;
......@@ -49,27 +61,27 @@ public class OrderListFragment extends BaseFragment<StatisticsPresenter, Fragmen
@Override
public void initView() {
pagerNum=1;
Calendar calendar = Calendar.getInstance();
//获得当前时间的月份,月份从0开始所以结果要加1
int monthNow = calendar.get(Calendar.MONTH) + 1;
calendar.setTimeInMillis(monthDateStart);
int monthStart = calendar.get(Calendar.MONTH) + 1;
if (monthStart == monthNow) {
mViewBinding.setMonth("本月");
} else {
mViewBinding.setMonth(monthStart + "月");
}
mViewBinding.setAmt("收入:¥230.00");
mViewBinding.llTitle.setOnClickListener(new OnClickListener() {
@Override
protected void myOnClickListener(View v) {
pop();
}
});
// Calendar calendar = Calendar.getInstance();
////获得当前时间的月份,月份从0开始所以结果要加1
// int monthNow = calendar.get(Calendar.MONTH) + 1;
// calendar.setTimeInMillis(monthDateStart);
// int monthStart = calendar.get(Calendar.MONTH) + 1;
// if (monthStart == monthNow) {
// mViewBinding.setMonth("本月");
// } else {
// mViewBinding.setMonth(monthStart + "月");
// }
// mViewBinding.setAmt("收入:¥230.00");
// mViewBinding.llTitle.setOnClickListener(new OnClickListener() {
// @Override
// protected void myOnClickListener(View v) {
// pop();
// }
// });
mViewBinding.tvEmpty.setText(R.string.statistics_search_empty);
if (mStatisticsAdapter == null) {
mStatisticsAdapter = new StatisticsOrderAdapter(new ArrayList<>());
mStatisticsAdapter = new StatisticsOrderGroupAdapter(new ArrayList<>());
mViewBinding.statisticsRecycler.setLayoutManager(new LinearLayoutManager(getActivity()));
mViewBinding.statisticsRecycler.setAdapter(mStatisticsAdapter);
......@@ -128,4 +140,36 @@ public class OrderListFragment extends BaseFragment<StatisticsPresenter, Fragmen
mViewBinding.statisticsRecycler.setVisibility(View.VISIBLE);
}
}
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();
}
}
......@@ -163,7 +163,7 @@ interface StoreContract {
* @param sku 商品
* @param <Sku> 商品类型
*/
public abstract <Sku extends BaseSku> void clickAddSku(Sku sku);
public abstract <Sku extends BaseSku> void clickAddSku(Sku sku, int value);
/**
* 商店页面 - 点击删除商品
......@@ -171,7 +171,7 @@ interface StoreContract {
* @param sku 商品
* @param <Sku> 商品类型
*/
public abstract <Sku extends BaseSku> void clickRemoveSku(Sku sku);
public abstract <Sku extends BaseSku> void clickRemoveSku(Sku sku, int value);
/**
* 购物车页面 - 购物车发生变化
......
......@@ -126,9 +126,9 @@ public class StorePresenter extends StoreContract.Presenter {
}
@Override
public <Sku extends BaseSku> void clickAddSku(Sku sku) {
public <Sku extends BaseSku> void clickAddSku(Sku sku, int value) {
//更新购物车信息
updateCart(sku, 1);
updateCart(sku, value);
//发送购物车信息(不需要刷新页面)
mView.loadSaledetails(mSaledetails, false);
//购物车发生变化
......@@ -136,15 +136,16 @@ public class StorePresenter extends StoreContract.Presenter {
}
@Override
public <Sku extends BaseSku> void clickRemoveSku(Sku sku) {
public <Sku extends BaseSku> void clickRemoveSku(Sku sku, int value) {
//更新购物车信息
updateCart(sku, -1);
updateCart(sku, value);
//发送购物车信息(不需要刷新页面)
mView.loadSaledetails(mSaledetails, false);
//购物车发生变化
this.cartChanged();
}
@Override
public void cartChanged() {
//设置订单信息
......
package com.xingdata.zzdpos.ui.store.adapter;
import android.support.annotation.Nullable;
import android.view.View;
import com.xingdata.zzdpos.R;
......@@ -39,24 +38,22 @@ public class SkuAdapter<T extends BaseSku> extends BaseAdapter<T, ItemStoreSkuBi
mViewBinding.tvName.setText(item.getSpuName());
mViewBinding.tvAmt.setText(ConvertUtil.fenToYuan(item.getSkuRetailPrice1()));
mViewBinding.ivIncrease.setOnClickListener(view -> {
if (mViewBinding.getCount() >= 99) return;
mViewBinding.setCount(mViewBinding.getCount() + 1);
setViewByCount(mViewBinding);
if (mOnCountChangeListener != null) {
mOnCountChangeListener.onCountChange(item, 1);
mOnCountChangeListener.onCountChange(mViewBinding.ivPic, item, 1);
}
});
mViewBinding.ivReduce.setOnClickListener(view -> {
mViewBinding.setCount(mViewBinding.getCount() - 1);
setViewByCount(mViewBinding);
if (mOnCountChangeListener != null) {
mOnCountChangeListener.onCountChange(item, -1);
mOnCountChangeListener.onCountChange(mViewBinding.ivPic, item, -1);
}
});
mViewBinding.setCount(0);
for (int i = 0; i < mSaledetails.size(); i++) {
if (mSaledetails.get(i).getSkuId().longValue() == item.getSkuId()) {
......@@ -77,12 +74,6 @@ public class SkuAdapter<T extends BaseSku> extends BaseAdapter<T, ItemStoreSkuBi
mViewBinding.ivReduce.setVisibility(View.GONE);
mViewBinding.tvCount.setVisibility(View.GONE);
}
}
@Override
public void setOnItemClickListener(@Nullable OnItemClickListener listener) {
super.setOnItemClickListener(listener);
}
}
......@@ -3,19 +3,19 @@ package com.xingdata.zzdpos.ui.store.adapter;
import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseSelectedAdapter;
import com.xingdata.zzdpos.base.BaseViewHolder;
import com.xingdata.zzdpos.databinding.ItemStoreSkugrpBinding;
import com.xingdata.zzdpos.databinding.ItemSelectorBinding;
import com.xingdata.zzdpos.model.Sskugrp;
import java.util.ArrayList;
public class SkugrpAdapter extends BaseSelectedAdapter<Sskugrp, ItemStoreSkugrpBinding> {
public class SkugrpAdapter extends BaseSelectedAdapter<Sskugrp, ItemSelectorBinding> {
public SkugrpAdapter() {
super(R.layout.item_store_skugrp, new ArrayList<>(), false);
super(R.layout.item_selector, new ArrayList<>(), false);
}
@Override
protected void convert(BaseViewHolder helper, ItemStoreSkugrpBinding mViewBinding, Sskugrp item) {
protected void convert(BaseViewHolder helper, ItemSelectorBinding mViewBinding, Sskugrp item) {
mViewBinding.setSelected(getSelectedPosition() == helper.getAdapterPosition());
mViewBinding.tvName.getPaint().setFakeBoldText(getSelectedPosition() == helper.getAdapterPosition());
mViewBinding.tvName.setText(item.getSkuGrpName());
......
......@@ -35,9 +35,9 @@ public class SearchFragment extends BaseFragment<StorePresenter, FragmentStoreSe
// set sku listener
mSkuAdapter.setOnLoadMoreListener(this::loadMoreSku, mViewBinding.rlSku);
mSkuAdapter.setOnCountChangeListener((sku, value) -> {
if (value > 0) mPresenter.clickAddSku(sku);
else mPresenter.clickRemoveSku(sku);
mSkuAdapter.setOnCountChangeListener((view, sku, value) -> {
if (value > 0) mPresenter.clickAddSku(sku, value);
else mPresenter.clickRemoveSku(sku, value);
});
// set empty
......
package com.xingdata.zzdpos.ui.store.fragment;
import android.animation.Animator;
import android.animation.ValueAnimator;
import android.annotation.SuppressLint;
import android.graphics.Path;
import android.graphics.PathMeasure;
import android.support.constraint.ConstraintLayout;
import android.support.v7.widget.LinearLayoutManager;
import android.view.View;
import android.view.animation.LinearInterpolator;
import android.widget.ImageView;
import com.blankj.utilcode.util.ScreenUtils;
import com.blankj.utilcode.util.StringUtils;
import com.xingdata.zzdpos.C;
import com.xingdata.zzdpos.R;
......@@ -26,10 +34,12 @@ public class StoreFragment extends BaseFragment<StorePresenter, FragmentStoreBin
private SkugrpAdapter mSkugrpAdapter;
private SkuAdapter mSkuAdapter;
public interface OnCountChangeListener {
void onCountChange(BaseSku sku, int value);
void onCountChange(View view, BaseSku sku, int value);
}
@Override
public int getLayoutId() {
return R.layout.fragment_store;
......@@ -50,11 +60,11 @@ public class StoreFragment extends BaseFragment<StorePresenter, FragmentStoreBin
// set sku listener
mViewBinding.srlSku.setOnRefreshListener(this::refreshSku);
mSkuAdapter.setOnLoadMoreListener(this::loadMoreSku, mViewBinding.rlSku);
mSkuAdapter.setOnCountChangeListener((sku, value) -> {
if (value > 0) mPresenter.clickAddSku(sku);
else mPresenter.clickRemoveSku(sku);
});
mSkuAdapter.setOnCountChangeListener((view, sku, value) -> {
if (value > 0) this.clickAdd(view, sku, value);
else mPresenter.clickRemoveSku(sku, value);
});
// set grp listener
mSkugrpAdapter.setOnItemClickListener((adapter, view, position) -> mPresenter.clickSkugrp(mSkugrpAdapter.getData().get(position)));
......@@ -71,6 +81,7 @@ public class StoreFragment extends BaseFragment<StorePresenter, FragmentStoreBin
mPresenter.initStore();
}
/**
* 刷新商品
*/
......@@ -218,4 +229,97 @@ public class StoreFragment extends BaseFragment<StorePresenter, FragmentStoreBin
}
/**
* 点击添加按钮
*
* @param view 按钮
* @param sku 商品信息
* @param value 数量
*/
private void clickAdd(View view, BaseSku sku, int value) {
// 路径测量
PathMeasure mPathMeasure;
// 贝塞尔曲线中间过程点坐标
float[] mCurrentPosition = new float[2];
final ImageView icon = new ImageView(mContext);
icon.setImageDrawable(((ImageView) view).getDrawable());
ConstraintLayout.LayoutParams params = new ConstraintLayout.LayoutParams(view.getWidth(), view.getHeight());
mViewBinding.clStore.addView(icon, params);
int[] parentLocation = new int[2];
mViewBinding.clStore.getLocationInWindow(parentLocation);
int startLoc[] = new int[2];
view.getLocationInWindow(startLoc);
// 得到购物车图片的坐标(用于计算动画结束后的坐标)
int endLoc[] = new int[]{0, ScreenUtils.getScreenHeight()};
float startX = startLoc[0] - parentLocation[0];
float startY = startLoc[1] - parentLocation[1];
// 商品掉落后的终点坐标:购物车起始点-父布局起始点+购物车图片的1/5
float toX = endLoc[0] - parentLocation[0];
float toY = endLoc[1] - parentLocation[1];
// 开始绘制贝塞尔曲线
Path path = new Path();
// 移动到起始点(贝塞尔曲线的起点)
path.moveTo(startX, startY);
// 使用二阶贝塞尔曲线:注意第一个起始坐标越大,贝塞尔曲线的横向距离就会越大,一般按照下面的式子取即可
path.quadTo((startX + toX) / 2, startY, toX, toY);
// mPathMeasure用来计算贝塞尔曲线的曲线长度和贝塞尔曲线中间插值的坐标,如果是true,path会形成一个闭环
mPathMeasure = new PathMeasure(path, false);
// 属性动画实现(从0到贝塞尔曲线的长度之间进行插值计算,获取中间过程的距离值)
ValueAnimator valueAnimator = ValueAnimator.ofFloat(0, mPathMeasure.getLength());
valueAnimator.setDuration(500);
// 匀速线性插值器
valueAnimator.setInterpolator(new LinearInterpolator());
valueAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
// 当插值计算进行时,获取中间的每个值,
// 这里这个值是中间过程中的曲线长度(下面根据这个值来得出中间点的坐标值)
float value = (Float) animation.getAnimatedValue();
// 获取当前点坐标封装到mCurrentPosition
// boolean getPosTan(float distance, float[] pos, float[] tan) :
// 传入一个距离distance(0<=distance<=getLength()),然后会计算当前距离的坐标点和切线,pos会自动填充上坐标,这个方法很重要。
// mCurrentPosition此时就是中间距离点的坐标值
mPathMeasure.getPosTan(value, mCurrentPosition, null);
// 移动的商品图片(动画图片)的坐标设置为该中间点的坐标
icon.setTranslationX(mCurrentPosition[0]);
icon.setTranslationY(mCurrentPosition[1]);
}
});
// 开始执行动画
valueAnimator.start();
// 动画结束后的处理
valueAnimator.addListener(new Animator.AnimatorListener() {
@Override
public void onAnimationStart(Animator animation) {
}
@Override
public void onAnimationEnd(Animator animation) {
mPresenter.clickAddSku(sku, value);
// 把执行动画的商品图片从父布局中移除
mViewBinding.clStore.removeView(icon);
}
@Override
public void onAnimationCancel(Animator animation) {
}
@Override
public void onAnimationRepeat(Animator animation) {
}
});
}
}
......@@ -16,6 +16,7 @@ import java.util.Date;
public class StringUtil {
public static String defaultDatePattern = "yyyy-MM-dd";
public static String mmddhhmmmDatePattern = "MM-dd HH:mm";
/**
......
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="@dimen/all_shape_radius"/>
<corners android:radius="@dimen/all_radius"/>
<stroke
android:width="@dimen/edit_border"
android:color="@color/gary"/>
......
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:app="http://schemas.android.com/apk/res-auto">
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<FrameLayout
android:id="@+id/f_bottom"
android:layout_width="0dp"
android:layout_height="0dp"
android:background="@color/white"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent">
</FrameLayout>
</android.support.constraint.ConstraintLayout>
</layout>
\ No newline at end of file
......@@ -53,7 +53,7 @@
app:layout_constraintBottom_toBottomOf="parent">
<Button
android:id="@+id/btn_cancel"
android:id="@+id/btn_print"
style="@style/button_passive"
android:layout_width="0dp"
android:layout_height="wrap_content"
......
......@@ -32,22 +32,10 @@
android:id="@+id/ic_title"
layout="@layout/title"/>
<Button
android:id="@+id/btn_add"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_margin="@dimen/all_margin"
android:background="@color/red_guanyu"
android:onClick="@{OnClickListener}"
android:text="确定"
android:textColor="@color/white"
android:textSize="@dimen/et_textsize"/>
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@+id/btn_add"
android:layout_below="@+id/ic_title">
<LinearLayout
......@@ -680,8 +668,8 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginRight="@dimen/all_padding_left_right"
android:gravity="right"
android:layout_weight="2"
android:gravity="right"
android:text="个月"
android:textColor="@color/black_baozheng"
android:textSize="@dimen/et_textsize"/>
......@@ -692,6 +680,23 @@
android:layout_height="@dimen/all_line_width"
android:background="@color/gray1"></View>
<LinearLayout
android:layout_width="match_parent"
android:background="@color/white"
android:layout_height="wrap_content">
<Button
android:id="@+id/btn_add"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/all_margin"
android:background="@color/red_guanyu"
android:onClick="@{OnClickListener}"
android:text="确定"
android:textColor="@color/white"
android:textSize="@dimen/et_textsize"/>
</LinearLayout>
</LinearLayout>
</ScrollView>
......
......@@ -37,6 +37,7 @@
android:layout_weight="1"
android:drawableTop="@mipmap/icon_receivables"
android:gravity="center"
android:textSize="@dimen/all_sub_title_size"
android:text="@string/menu_receivables"
android:textColor="#FFF" />
......@@ -48,6 +49,7 @@
android:drawableTop="@mipmap/icon_billing"
android:gravity="center"
android:text="@string/menu_billing"
android:textSize="@dimen/all_sub_title_size"
android:textColor="#FFF" />
......
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android">
<LinearLayout
<data>
<variable
name="name"
type="String" />
<variable
name="dateStart"
type="String" />
<variable
name="dateEnd"
type="String" />
<variable
name="user"
type="String" />
<variable
name="area"
type="String" />
</data>
<android.support.v4.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/gray_zhouyu"
android:orientation="vertical">
android:background="@color/gray_zhouyu">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:gravity="center_vertical"
android:paddingEnd="@dimen/all_margin"
android:paddingStart="@dimen/all_margin"
android:text="@string/ms_editor_subtitle_info"
android:textColor="@color/black_baozheng"
android:textSize="@dimen/all_sub_title_size" />
<View
android:layout_width="match_parent"
android:layout_height="@dimen/all_line_width"
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"
android:paddingEnd="@dimen/all_margin"
android:paddingStart="@dimen/all_margin">
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="center_vertical"
android:text="@string/ms_editor_name"
android:textColor="@color/black_baozheng"
android:textSize="@dimen/all_text_size" />
<EditText
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginStart="@dimen/all_margin"
android:background="@color/transparent"
android:hint="@string/ms_editor_name_hint"
android:text="@{name}"
android:textColor="@color/black_baozheng"
android:textSize="@dimen/all_text_size" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="@dimen/all_line_width"
android:background="@color/gray_huanggai" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:orientation="horizontal"
android:paddingEnd="@dimen/all_margin"
android:paddingStart="@dimen/all_margin">
<TextView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center_vertical"
android:text="@string/ms_editor_subtitle_time"
android:textColor="@color/black_baozheng"
android:textSize="@dimen/all_sub_title_size" />
<TextView
android:id="@+id/tv_time_more"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:foreground="?android:attr/selectableItemBackground"
android:paddingBottom="@dimen/all_spacing"
android:paddingEnd="@dimen/all_margin"
android:paddingStart="@dimen/all_margin"
android:paddingTop="@dimen/all_spacing"
android:text="@string/ms_editor_time_more"
android:textColor="@color/blue_mawu"
android:textSize="@dimen/all_body_size" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="@dimen/all_line_width"
android:background="@color/gray_huanggai" />
<LinearLayout
android:id="@+id/ll_date_start"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="@color/white_caocao"
android:foreground="?android:attr/selectableItemBackground"
android:gravity="center_vertical"
android:paddingEnd="@dimen/all_margin"
android:paddingStart="@dimen/all_margin">
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="center_vertical"
android:text="@string/ms_editor_date_start"
android:textColor="@color/black_baozheng"
android:textSize="@dimen/all_text_size" />
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginStart="@dimen/all_margin"
android:drawableEnd="@mipmap/createstore_drop_down"
android:gravity="center_vertical"
android:text="@{dateStart}"
android:textColor="@color/black_baozheng"
android:textSize="@dimen/all_text_size" />
</LinearLayout>
<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" />
<LinearLayout
android:id="@+id/ll_date_end"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="@color/white_caocao"
android:foreground="?android:attr/selectableItemBackground"
android:gravity="center_vertical"
android:paddingEnd="@dimen/all_margin"
android:paddingStart="@dimen/all_margin">
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="center_vertical"
android:text="@string/ms_editor_date_end"
android:textColor="@color/black_baozheng"
android:textSize="@dimen/all_text_size" />
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginStart="@dimen/all_margin"
android:drawableEnd="@mipmap/createstore_drop_down"
android:gravity="center_vertical"
android:text="@{dateEnd}"
android:textColor="@color/black_baozheng"
android:textSize="@dimen/all_text_size" />
</LinearLayout>
<ViewStub
android:id="@+id/vs_time_detail"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout="@layout/view_time_detail" />
<View
android:layout_width="match_parent"
android:layout_height="@dimen/all_line_width"
android:background="@color/gray_huanggai" />
<TextView
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:gravity="center_vertical"
android:paddingEnd="@dimen/all_margin"
android:paddingStart="@dimen/all_margin"
android:text="@string/ms_editor_subtitle_ms"
android:textColor="@color/black_baozheng"
android:textSize="@dimen/all_sub_title_size" />
<View
android:layout_width="match_parent"
android:layout_height="@dimen/all_line_width"
android:background="@color/gray_huanggai" />
<LinearLayout
android:id="@+id/ll_user"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="@color/white_caocao"
android:foreground="?android:attr/selectableItemBackground"
android:gravity="center_vertical"
android:paddingEnd="@dimen/all_margin"
android:paddingStart="@dimen/all_margin">
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="center_vertical"
android:text="@string/ms_editor_user"
android:textColor="@color/black_baozheng"
android:textSize="@dimen/all_text_size" />
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginStart="@dimen/all_margin"
android:drawableEnd="@mipmap/createstore_drop_down"
android:gravity="center_vertical"
android:text="@{user}"
android:textColor="@color/black_baozheng"
android:textSize="@dimen/all_text_size" />
</LinearLayout>
<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" />
<LinearLayout
android:id="@+id/ll_area"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="@color/white_caocao"
android:foreground="?android:attr/selectableItemBackground"
android:gravity="center_vertical"
android:paddingEnd="@dimen/all_margin"
android:paddingStart="@dimen/all_margin">
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="center_vertical"
android:text="@string/ms_editor_area"
android:textColor="@color/black_baozheng"
android:textSize="@dimen/all_text_size" />
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginStart="@dimen/all_margin"
android:drawableEnd="@mipmap/createstore_drop_down"
android:gravity="center_vertical"
android:text="@{area}"
android:textColor="@color/black_baozheng"
android:textSize="@dimen/all_text_size" />
</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" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.v7.widget.RecyclerView
android:id="@+id/rl_group"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
<FrameLayout
android:id="@+id/f_group"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="3" />
</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" />
<FrameLayout
android:id="@+id/f_type"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white_caocao" />
<View
android:layout_width="match_parent"
android:layout_height="@dimen/all_line_width"
android:layout_marginBottom="@dimen/all_margin"
android:background="@color/gray_huanggai" />
</LinearLayout>
<Button
android:id="@+id/btn_confirm"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/all_margin"
android:layout_marginEnd="@dimen/all_margin"
android:layout_marginStart="@dimen/all_margin"
android:background="@drawable/shape_red_r1"
android:foreground="?android:attr/selectableItemBackground"
android:text="@string/all_confirm"
android:textColor="@color/white_caocao"
android:textSize="@dimen/all_text_size" />
</LinearLayout>
</android.support.v4.widget.NestedScrollView>
</layout>
\ No newline at end of file
......@@ -28,7 +28,6 @@
android:id="@+id/srl_product"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginTop="@dimen/all_padding"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
......
......@@ -24,7 +24,8 @@
android:background="@color/white_caocao"
app:layout_constraintTop_toTopOf="parent"
app:tabIndicatorColor="@color/red_lvzhi"
app:tabIndicatorHeight="@dimen/view_line_L2">
app:tabIndicatorHeight="@dimen/view_line_L2"
app:tabTextColor="@color/black_baozheng">
</android.support.design.widget.TabLayout>
......
......@@ -75,7 +75,7 @@
android:layout_height="wrap_content"
android:text="@{opername}"
android:textColor="@color/white_caocao"
android:textSize="@dimen/big_text_size" />
android:textSize="@dimen/all_text_size" />
<TextView
android:layout_width="wrap_content"
......@@ -83,7 +83,7 @@
android:layout_marginStart="@dimen/all_padding"
android:text="@{phone}"
android:textColor="@color/white_caocao"
android:textSize="@dimen/small_text_size" />
android:textSize="@dimen/all_text_size_small" />
</LinearLayout>
<LinearLayout
......@@ -98,7 +98,7 @@
android:layout_height="wrap_content"
android:text="@{address}"
android:textColor="@color/white_caocao"
android:textSize="@dimen/small_text_size" />
android:textSize="@dimen/all_text_size_small" />
<ImageView
android:layout_width="wrap_content"
......
......@@ -24,33 +24,33 @@
<!-- TODO: Update blank fragmfragment_integral_indexyout -->
<LinearLayout
android:id="@+id/ll_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:weightSum="2"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="left"
android:padding="@dimen/all_padding"
android:text="@{month}" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="right"
android:padding="@dimen/all_padding"
android:text="@{amt}"
android:visibility="invisible" />
</LinearLayout>
<!--<LinearLayout-->
<!--android:id="@+id/ll_title"-->
<!--android:layout_width="match_parent"-->
<!--android:layout_height="wrap_content"-->
<!--android:orientation="horizontal"-->
<!--android:weightSum="2"-->
<!--app:layout_constraintEnd_toEndOf="parent"-->
<!--app:layout_constraintStart_toStartOf="parent"-->
<!--app:layout_constraintTop_toTopOf="parent">-->
<!--<TextView-->
<!--android:layout_width="0dp"-->
<!--android:layout_height="wrap_content"-->
<!--android:layout_weight="1"-->
<!--android:gravity="left"-->
<!--android:padding="@dimen/all_padding"-->
<!--android:text="@{month}" />-->
<!--<TextView-->
<!--android:layout_width="0dp"-->
<!--android:layout_height="wrap_content"-->
<!--android:layout_weight="1"-->
<!--android:gravity="right"-->
<!--android:padding="@dimen/all_padding"-->
<!--android:text="@{amt}"-->
<!--android:visibility="invisible" />-->
<!--</LinearLayout>-->
<android.support.v4.widget.SwipeRefreshLayout
android:id="@+id/srl_product"
......
......@@ -157,12 +157,16 @@
<Button
android:id="@+id/btn_confirm"
style="@style/button_positive"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/all_margin"
android:layout_marginEnd="@dimen/all_margin"
android:layout_marginStart="@dimen/all_margin"
android:background="@drawable/shape_red_r1"
android:foreground="?android:attr/selectableItemBackground"
android:text="@{payResult?@string/settle_complete:@string/settle_retry}" />
android:text="@{payResult?@string/settle_complete:@string/settle_retry}"
android:textColor="@color/white_caocao"
android:textSize="@dimen/all_text_size" />
</LinearLayout>
</layout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:tools="http://schemas.android.com/tools">
<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="match_parent"
android:background="@color/white_caocao"
android:orientation="vertical"
android:splitMotionEvents="false">
<include
android:id="@+id/ic_title"
layout="@layout/title_order"
app:layout_constraintTop_toTopOf="parent" />
<View
android:layout_width="match_parent"
android:layout_height="@dimen/view_line_L050"
android:background="@color/gray_kongming" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?android:attr/selectableItemBackground"
android:gravity="center"
android:orientation="horizontal">
<TextView
android:id="@+id/btn_add"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawablePadding="@dimen/dp_4"
android:drawableStart="@mipmap/but_add"
android:gravity="center"
android:padding="@dimen/all_padding"
android:text="@string/manage_replenishment_add"
android:textColor="@color/red_lvzhi"
android:textSize="@dimen/big_text_size" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="@dimen/view_line_L050"
android:background="@color/gray_kongming" />
<android.support.design.widget.TabLayout
android:id="@+id/tab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:tabMinWidth="150dp"
app:tabTextColor="@color/black_baozheng">
</android.support.design.widget.TabLayout>
<View
android:layout_width="match_parent"
android:layout_height="@dimen/all_margin"
android:background="@color/gray_zhouyu"
/>
<android.support.v4.view.ViewPager
android:id="@+id/fragment_container"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
</layout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<layout>
<data>
<import type="android.view.View" />
<variable
name="sumNum"
type="String" />
<variable
name="finallyPrice"
type="String" />
<variable
name="isShowSupplier"
type="Boolean" />
<variable
name="shopOderName"
type="String" />
<variable
name="shopName"
type="String" />
<variable
name="shopAddress"
type="String" />
<variable
name="shopTel"
type="String" />
<variable
name="supplierName"
type="String" />
<variable
name="supplierAddress"
type="String" />
<variable
name="supplierTel"
type="String" />
<variable
name="date"
type="String" />
<variable
name="no"
type="String" />
</data>
<android.support.constraint.ConstraintLayout 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="match_parent"
android:background="@color/white"
android:splitMotionEvents="false">
<!--<android.support.v7.widget.CardView-->
<!--android:id="@+id/f_left"-->
<!--android:layout_width="0dp"-->
<!--android:layout_height="0dp"-->
<!--android:layout_marginEnd="@dimen/all_padding"-->
<!--android:background="@color/white"-->
<!--app:cardElevation="@dimen/all_padding"-->
<!--app:layout_constraintBottom_toBottomOf="parent"-->
<!--app:layout_constraintHorizontal_weight="10"-->
<!--app:layout_constraintLeft_toLeftOf="parent"-->
<!--app:layout_constraintRight_toLeftOf="@+id/f_right"-->
<!--app:layout_constraintTop_toTopOf="parent"-->
<!--app:layout_constraintVertical_weight="25">-->
<!--<android.support.constraint.ConstraintLayout-->
<!--android:layout_width="match_parent"-->
<!--android:layout_height="match_parent"-->
<!--android:background="@color/white">-->
<!--<TextView-->
<!--android:id="@+id/tv_supplier_title"-->
<!--android:layout_width="wrap_content"-->
<!--android:layout_height="wrap_content"-->
<!--android:layout_margin="@dimen/all_margin"-->
<!--android:text="供货方"-->
<!--android:textColor="@color/black"-->
<!--android:textSize="@dimen/all_text_size_big"-->
<!--android:visibility="@{isShowSupplier? View.VISIBLE: View.GONE}"-->
<!--app:layout_constraintStart_toStartOf="parent"-->
<!--app:layout_constraintTop_toTopOf="parent" />-->
<!--<View-->
<!--android:id="@+id/view_line_left_1"-->
<!--android:layout_width="match_parent"-->
<!--android:layout_height="@dimen/all_slight_line_width"-->
<!--android:layout_margin="@dimen/all_margin"-->
<!--android:background="@color/line"-->
<!--android:visibility="@{isShowSupplier? View.VISIBLE: View.GONE}"-->
<!--app:layout_constraintTop_toBottomOf="@id/tv_supplier_title" />-->
<!--<LinearLayout-->
<!--android:id="@+id/ll_supplier_name"-->
<!--android:layout_width="0dp"-->
<!--android:layout_height="wrap_content"-->
<!--android:layout_margin="@dimen/all_margin"-->
<!--android:gravity="center_vertical"-->
<!--android:orientation="horizontal"-->
<!--android:visibility="@{isShowSupplier? View.VISIBLE: View.GONE}"-->
<!--app:layout_constraintEnd_toEndOf="parent"-->
<!--app:layout_constraintStart_toStartOf="parent"-->
<!--app:layout_constraintTop_toTopOf="@id/view_line_left_1">-->
<!--<ImageView-->
<!--android:layout_width="wrap_content"-->
<!--android:layout_height="wrap_content"-->
<!--android:src="@mipmap/icon_stores" />-->
<!--<TextView-->
<!--android:layout_width="wrap_content"-->
<!--android:layout_height="wrap_content"-->
<!--android:paddingBottom="@dimen/dp_4"-->
<!--android:paddingLeft="@dimen/all_padding"-->
<!--android:paddingTop="@dimen/dp_4"-->
<!--android:text="@{supplierName}"-->
<!--android:textColor="@color/black" />-->
<!--</LinearLayout>-->
<!--<LinearLayout-->
<!--android:id="@+id/ll_supplier_address"-->
<!--android:layout_width="0dp"-->
<!--android:layout_height="wrap_content"-->
<!--android:gravity="center_vertical"-->
<!--android:orientation="horizontal"-->
<!--android:visibility="@{isShowSupplier? View.VISIBLE: View.GONE}"-->
<!--app:layout_constraintEnd_toEndOf="@id/ll_supplier_name"-->
<!--app:layout_constraintStart_toStartOf="@id/ll_supplier_name"-->
<!--app:layout_constraintTop_toBottomOf="@id/ll_supplier_name">-->
<!--<ImageView-->
<!--android:layout_width="wrap_content"-->
<!--android:layout_height="wrap_content"-->
<!--android:src="@mipmap/icon_address" />-->
<!--<TextView-->
<!--android:layout_width="wrap_content"-->
<!--android:layout_height="wrap_content"-->
<!--android:paddingBottom="@dimen/dp_4"-->
<!--android:paddingLeft="@dimen/all_padding"-->
<!--android:paddingTop="@dimen/dp_4"-->
<!--android:text="@{supplierAddress}"-->
<!--android:textColor="@color/black" />-->
<!--</LinearLayout>-->
<!--<LinearLayout-->
<!--android:id="@+id/ll_supplier_phone"-->
<!--android:layout_width="0dp"-->
<!--android:layout_height="wrap_content"-->
<!--android:gravity="center_vertical"-->
<!--android:orientation="horizontal"-->
<!--android:visibility="@{isShowSupplier? View.VISIBLE: View.GONE}"-->
<!--app:layout_constraintEnd_toEndOf="@id/ll_supplier_name"-->
<!--app:layout_constraintStart_toStartOf="@id/ll_supplier_name"-->
<!--app:layout_constraintTop_toBottomOf="@id/ll_supplier_address">-->
<!--<ImageView-->
<!--android:layout_width="wrap_content"-->
<!--android:layout_height="wrap_content"-->
<!--android:src="@mipmap/icon_telephone" />-->
<!--<TextView-->
<!--android:layout_width="wrap_content"-->
<!--android:layout_height="wrap_content"-->
<!--android:paddingBottom="@dimen/dp_4"-->
<!--android:paddingLeft="@dimen/all_padding"-->
<!--android:paddingTop="@dimen/dp_4"-->
<!--android:text="@{supplierTel}"-->
<!--android:textColor="@color/black" />-->
<!--</LinearLayout>-->
<!--<TextView-->
<!--android:id="@+id/tv_shop_title"-->
<!--android:layout_width="wrap_content"-->
<!--android:layout_height="wrap_content"-->
<!--android:layout_marginEnd="@dimen/all_margin"-->
<!--android:layout_marginStart="@dimen/all_margin"-->
<!--android:layout_marginTop="@dimen/all_margin_big"-->
<!--android:text="定货方"-->
<!--android:textColor="@color/black"-->
<!--android:textSize="@dimen/all_text_size_big"-->
<!--app:layout_constraintStart_toStartOf="parent"-->
<!--app:layout_constraintTop_toBottomOf="@id/ll_supplier_phone"-->
<!--app:layout_goneMarginTop="@dimen/all_margin" />-->
<!--<View-->
<!--android:id="@+id/view_line_left_2"-->
<!--android:layout_width="match_parent"-->
<!--android:layout_height="@dimen/all_slight_line_width"-->
<!--android:layout_margin="@dimen/all_margin"-->
<!--android:background="@color/line"-->
<!--app:layout_constraintTop_toBottomOf="@id/tv_shop_title" />-->
<!--<LinearLayout-->
<!--android:id="@+id/ll_shop_name"-->
<!--android:layout_width="0dp"-->
<!--android:layout_height="wrap_content"-->
<!--android:layout_margin="@dimen/all_margin"-->
<!--android:gravity="center_vertical"-->
<!--android:orientation="horizontal"-->
<!--app:layout_constraintEnd_toEndOf="parent"-->
<!--app:layout_constraintStart_toStartOf="parent"-->
<!--app:layout_constraintTop_toTopOf="@id/view_line_left_2">-->
<!--<ImageView-->
<!--android:layout_width="wrap_content"-->
<!--android:layout_height="wrap_content"-->
<!--android:src="@mipmap/icon_stores" />-->
<!--<TextView-->
<!--android:layout_width="wrap_content"-->
<!--android:layout_height="wrap_content"-->
<!--android:paddingBottom="@dimen/dp_4"-->
<!--android:paddingLeft="@dimen/all_padding"-->
<!--android:paddingTop="@dimen/dp_4"-->
<!--android:text="@{shopName}"-->
<!--android:textColor="@color/black" />-->
<!--</LinearLayout>-->
<!--<LinearLayout-->
<!--android:id="@+id/ll_shop_address"-->
<!--android:layout_width="0dp"-->
<!--android:layout_height="wrap_content"-->
<!--android:gravity="center_vertical"-->
<!--android:orientation="horizontal"-->
<!--app:layout_constraintEnd_toEndOf="@id/ll_shop_name"-->
<!--app:layout_constraintStart_toStartOf="@id/ll_shop_name"-->
<!--app:layout_constraintTop_toBottomOf="@id/ll_shop_name">-->
<!--<ImageView-->
<!--android:layout_width="wrap_content"-->
<!--android:layout_height="wrap_content"-->
<!--android:src="@mipmap/icon_address" />-->
<!--<TextView-->
<!--android:layout_width="wrap_content"-->
<!--android:layout_height="wrap_content"-->
<!--android:paddingBottom="@dimen/dp_4"-->
<!--android:paddingLeft="@dimen/all_padding"-->
<!--android:paddingTop="@dimen/dp_4"-->
<!--android:text="@{shopAddress}"-->
<!--android:textColor="@color/black" />-->
<!--</LinearLayout>-->
<!--<LinearLayout-->
<!--android:id="@+id/ll_shop_phone"-->
<!--android:layout_width="0dp"-->
<!--android:layout_height="wrap_content"-->
<!--android:gravity="center_vertical"-->
<!--android:orientation="horizontal"-->
<!--app:layout_constraintEnd_toEndOf="@id/ll_shop_name"-->
<!--app:layout_constraintStart_toStartOf="@id/ll_shop_name"-->
<!--app:layout_constraintTop_toBottomOf="@id/ll_shop_address">-->
<!--<ImageView-->
<!--android:layout_width="wrap_content"-->
<!--android:layout_height="wrap_content"-->
<!--android:src="@mipmap/icon_telephone" />-->
<!--<TextView-->
<!--android:layout_width="wrap_content"-->
<!--android:layout_height="wrap_content"-->
<!--android:paddingBottom="@dimen/dp_4"-->
<!--android:paddingLeft="@dimen/all_padding"-->
<!--android:paddingTop="@dimen/dp_4"-->
<!--android:text="@{shopTel}"-->
<!--android:textColor="@color/black" />-->
<!--</LinearLayout>-->
<!--<View-->
<!--android:id="@+id/view_line_left_3"-->
<!--android:layout_width="match_parent"-->
<!--android:layout_height="@dimen/all_slight_line_width"-->
<!--android:layout_margin="@dimen/all_margin"-->
<!--android:background="@color/line"-->
<!--android:visibility="@{isShowSupplier? View.VISIBLE: View.GONE}"-->
<!--app:layout_constraintTop_toBottomOf="@id/ll_shop_phone" />-->
<!--<LinearLayout-->
<!--android:id="@+id/ll_date"-->
<!--android:layout_width="0dp"-->
<!--android:layout_height="wrap_content"-->
<!--android:layout_marginTop="@dimen/all_margin"-->
<!--android:gravity="center_vertical"-->
<!--android:orientation="horizontal"-->
<!--android:visibility="@{isShowSupplier? View.VISIBLE: View.GONE}"-->
<!--app:layout_constraintEnd_toEndOf="@id/ll_shop_name"-->
<!--app:layout_constraintStart_toStartOf="@id/ll_shop_name"-->
<!--app:layout_constraintTop_toBottomOf="@id/view_line_left_3">-->
<!--<ImageView-->
<!--android:layout_width="wrap_content"-->
<!--android:layout_height="wrap_content"-->
<!--android:src="@mipmap/icon_dates_green" />-->
<!--<TextView-->
<!--android:layout_width="wrap_content"-->
<!--android:layout_height="wrap_content"-->
<!--android:paddingBottom="@dimen/dp_4"-->
<!--android:paddingLeft="@dimen/all_padding"-->
<!--android:paddingTop="@dimen/dp_4"-->
<!--android:text="@{date}"-->
<!--android:textColor="@color/black" />-->
<!--</LinearLayout>-->
<!--<LinearLayout-->
<!--android:id="@+id/ll_no"-->
<!--android:layout_width="0dp"-->
<!--android:layout_height="wrap_content"-->
<!--android:gravity="center_vertical"-->
<!--android:orientation="horizontal"-->
<!--android:visibility="@{isShowSupplier? View.VISIBLE: View.GONE}"-->
<!--app:layout_constraintEnd_toEndOf="@id/ll_shop_name"-->
<!--app:layout_constraintStart_toStartOf="@id/ll_shop_name"-->
<!--app:layout_constraintTop_toBottomOf="@id/ll_date">-->
<!--<ImageView-->
<!--android:layout_width="wrap_content"-->
<!--android:layout_height="wrap_content"-->
<!--android:src="@mipmap/icon_no_green" />-->
<!--<TextView-->
<!--android:layout_width="wrap_content"-->
<!--android:layout_height="wrap_content"-->
<!--android:paddingBottom="@dimen/dp_4"-->
<!--android:paddingLeft="@dimen/all_padding"-->
<!--android:paddingTop="@dimen/dp_4"-->
<!--android:text="@{no}"-->
<!--android:textColor="@color/black" />-->
<!--</LinearLayout>-->
<!--<LinearLayout-->
<!--android:id="@+id/ll_result"-->
<!--android:layout_width="0dp"-->
<!--android:layout_height="wrap_content"-->
<!--android:layout_marginBottom="@dimen/all_margin"-->
<!--android:gravity="center"-->
<!--android:orientation="horizontal"-->
<!--app:layout_constraintBottom_toBottomOf="parent"-->
<!--app:layout_constraintEnd_toEndOf="parent"-->
<!--app:layout_constraintHorizontal_weight="1"-->
<!--app:layout_constraintStart_toEndOf="@id/ll_num">-->
<!--<TextView-->
<!--android:layout_width="wrap_content"-->
<!--android:layout_height="wrap_content"-->
<!--android:gravity="center"-->
<!--android:paddingBottom="@dimen/dp_4"-->
<!--android:paddingLeft="@dimen/all_padding"-->
<!--android:paddingRight="@dimen/all_padding"-->
<!--android:paddingTop="@dimen/dp_4"-->
<!--android:text="@{finallyPrice}"-->
<!--android:textColor="@color/reddeep"-->
<!--android:textSize="@dimen/all_text_size_big" />-->
<!--</LinearLayout>-->
<!--<LinearLayout-->
<!--android:id="@+id/ll_num"-->
<!--android:layout_width="0dp"-->
<!--android:layout_height="wrap_content"-->
<!--android:gravity="center"-->
<!--android:orientation="horizontal"-->
<!--app:layout_constraintBottom_toBottomOf="@id/ll_result"-->
<!--app:layout_constraintEnd_toStartOf="@id/ll_result"-->
<!--app:layout_constraintHorizontal_weight="1"-->
<!--app:layout_constraintStart_toStartOf="parent"-->
<!--app:layout_constraintTop_toTopOf="@id/ll_result">-->
<!--<TextView-->
<!--android:layout_width="wrap_content"-->
<!--android:layout_height="wrap_content"-->
<!--android:padding="@dimen/dp_4"-->
<!--android:text="@{sumNum}"-->
<!--android:textColor="@color/reddeep"-->
<!--android:textSize="@dimen/all_text_size_big"-->
<!--android:textStyle="bold" />-->
<!--</LinearLayout>-->
<!--<TextView-->
<!--android:id="@+id/tv_result_hint"-->
<!--android:layout_width="wrap_content"-->
<!--android:layout_height="wrap_content"-->
<!--android:layout_margin="@dimen/all_margin"-->
<!--android:text="金额"-->
<!--android:textColor="@color/black"-->
<!--app:layout_constraintBottom_toTopOf="@id/ll_result"-->
<!--app:layout_constraintEnd_toEndOf="@id/ll_result"-->
<!--app:layout_constraintStart_toStartOf="@id/ll_result" />-->
<!--<TextView-->
<!--android:layout_width="wrap_content"-->
<!--android:layout_height="wrap_content"-->
<!--android:layout_margin="@dimen/all_margin"-->
<!--android:text="种类"-->
<!--android:textColor="@color/black"-->
<!--app:layout_constraintBottom_toBottomOf="@id/tv_result_hint"-->
<!--app:layout_constraintEnd_toEndOf="@id/ll_num"-->
<!--app:layout_constraintStart_toStartOf="@id/ll_num"-->
<!--app:layout_constraintTop_toTopOf="@id/tv_result_hint" />-->
<!--<View-->
<!--android:id="@+id/view_line_left_bottom"-->
<!--android:layout_width="match_parent"-->
<!--android:layout_height="@dimen/all_margin"-->
<!--android:layout_marginBottom="100dp"-->
<!--android:background="@color/lyt_main_bg"-->
<!--app:layout_constraintBottom_toBottomOf="parent" />-->
<!--</android.support.constraint.ConstraintLayout>-->
<!--</android.support.v7.widget.CardView>-->
<!--<android.support.constraint.ConstraintLayout-->
<!--android:id="@+id/f_right"-->
<!--android:layout_width="0dp"-->
<!--android:layout_height="0dp"-->
<!--android:background="@color/white"-->
<!--android:splitMotionEvents="false"-->
<!--app:layout_constraintBottom_toBottomOf="parent"-->
<!--app:layout_constraintHorizontal_weight="22"-->
<!--app:layout_constraintLeft_toRightOf="@+id/f_left"-->
<!--app:layout_constraintRight_toRightOf="parent"-->
<!--app:layout_constraintTop_toTopOf="parent"-->
<!--app:layout_constraintVertical_weight="25">-->
<!--<EditText-->
<!--android:id="@+id/et_keyword"-->
<!--style="@style/dialog_edit"-->
<!--android:layout_width="wrap_content"-->
<!--android:layout_height="0dp"-->
<!--android:layout_marginEnd="@dimen/all_margin"-->
<!--android:drawableEnd="@mipmap/ic_scan"-->
<!--android:hint="@string/inventory_add_et_hint"-->
<!--android:inputType="number"-->
<!--android:maxLength="19"-->
<!--android:minWidth="@dimen/fragment_store_et_min_width"-->
<!--android:paddingEnd="@dimen/fragment_detail_padding_end"-->
<!--android:paddingStart="@dimen/all_margin"-->
<!--android:singleLine="true"-->
<!--app:layout_constraintBottom_toBottomOf="@id/btn_search"-->
<!--app:layout_constraintRight_toRightOf="@id/btn_search"-->
<!--app:layout_constraintTop_toTopOf="@id/btn_search" />-->
<!--<ImageButton-->
<!--android:id="@+id/btn_search"-->
<!--android:layout_width="@dimen/fragment_store_btn_width"-->
<!--android:layout_height="@dimen/fragment_store_et_height"-->
<!--android:layout_marginEnd="@dimen/all_margin"-->
<!--android:layout_marginTop="@dimen/all_margin"-->
<!--android:background="@drawable/shape_store_btn_search_select"-->
<!--android:contentDescription="@string/store_search"-->
<!--android:scaleType="centerInside"-->
<!--android:src="@mipmap/store_search"-->
<!--app:layout_constraintEnd_toEndOf="parent"-->
<!--app:layout_constraintTop_toTopOf="parent" />-->
<!--<TextView-->
<!--android:layout_width="wrap_content"-->
<!--android:layout_height="wrap_content"-->
<!--android:layout_margin="@dimen/all_margin"-->
<!--android:text="@string/replenishment_detail_title"-->
<!--android:textColor="@color/black"-->
<!--android:textSize="@dimen/all_sub_title_size"-->
<!--app:layout_constraintBottom_toBottomOf="@id/et_keyword"-->
<!--app:layout_constraintStart_toStartOf="parent"-->
<!--app:layout_constraintTop_toTopOf="@id/et_keyword" />-->
<!--<View-->
<!--android:id="@+id/view_line"-->
<!--android:layout_width="match_parent"-->
<!--android:layout_height="@dimen/all_slight_line_width"-->
<!--android:layout_marginLeft="@dimen/all_padding"-->
<!--android:layout_marginRight="@dimen/all_margin"-->
<!--android:layout_marginTop="@dimen/all_padding"-->
<!--android:background="@color/line"-->
<!--app:layout_constraintTop_toBottomOf="@id/et_keyword" />-->
<!--<android.support.v7.widget.RecyclerView-->
<!--android:id="@+id/replenishment_right_recycler"-->
<!--android:layout_width="0dp"-->
<!--android:layout_height="0dp"-->
<!--android:layout_marginTop="@dimen/view_line_L1"-->
<!--android:splitMotionEvents="false"-->
<!--app:layout_constraintBottom_toTopOf="@id/cl_btn"-->
<!--app:layout_constraintEnd_toEndOf="parent"-->
<!--app:layout_constraintStart_toStartOf="parent"-->
<!--app:layout_constraintTop_toBottomOf="@id/view_line" />-->
<!--<android.support.constraint.ConstraintLayout-->
<!--android:id="@+id/cl_btn"-->
<!--android:layout_width="match_parent"-->
<!--android:layout_height="100dp"-->
<!--app:layout_constraintBottom_toBottomOf="parent"-->
<!--app:layout_constraintTop_toBottomOf="@id/replenishment_right_recycler">-->
<!--<View-->
<!--android:layout_width="match_parent"-->
<!--android:layout_height="@dimen/all_slight_line_width"-->
<!--android:layout_marginLeft="@dimen/all_padding"-->
<!--android:layout_marginRight="@dimen/all_margin"-->
<!--android:layout_marginTop="@dimen/view_line_L1"-->
<!--android:background="@color/line"-->
<!--app:layout_constraintTop_toTopOf="parent" />-->
<!--<Button-->
<!--android:id="@+id/btn_end"-->
<!--style="@style/button_positive"-->
<!--android:layout_width="wrap_content"-->
<!--android:layout_height="wrap_content"-->
<!--android:layout_marginBottom="@dimen/all_margin"-->
<!--android:layout_marginLeft="@dimen/all_margin"-->
<!--android:layout_marginRight="@dimen/all_margin"-->
<!--android:stateListAnimator="@null"-->
<!--android:text="@string/replenishment_detail_submit"-->
<!--app:layout_constraintBottom_toBottomOf="parent"-->
<!--app:layout_constraintEnd_toEndOf="parent" />-->
<!--<Button-->
<!--android:id="@+id/btn_print"-->
<!--style="@style/button_positive"-->
<!--android:layout_width="wrap_content"-->
<!--android:layout_height="wrap_content"-->
<!--android:layout_marginBottom="@dimen/all_margin"-->
<!--android:layout_marginLeft="@dimen/all_margin"-->
<!--android:layout_marginRight="@dimen/all_margin"-->
<!--android:stateListAnimator="@null"-->
<!--android:text="@string/replenishment_detail_print"-->
<!--android:visibility="gone"-->
<!--app:layout_constraintBottom_toBottomOf="parent"-->
<!--app:layout_constraintStart_toStartOf="parent" />-->
<!--<Button-->
<!--android:id="@+id/btn_canel"-->
<!--style="@style/button_passive"-->
<!--android:layout_width="wrap_content"-->
<!--android:layout_height="wrap_content"-->
<!--android:layout_marginBottom="@dimen/all_margin"-->
<!--android:layout_marginEnd="@dimen/all_margin_big"-->
<!--android:stateListAnimator="@null"-->
<!--android:text="@string/replenishment_detail_cancel"-->
<!--app:layout_constraintBottom_toBottomOf="parent"-->
<!--app:layout_constraintEnd_toStartOf="@id/btn_end"-->
<!--app:layout_goneMarginLeft="@dimen/all_margin"-->
<!--app:layout_goneMarginRight="@dimen/all_margin" />-->
<!--</android.support.constraint.ConstraintLayout>-->
<!--</android.support.constraint.ConstraintLayout>-->
</android.support.constraint.ConstraintLayout>
</layout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:app="http://schemas.android.com/apk/res-auto">
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v4.widget.SwipeRefreshLayout
android:id="@+id/srl_product"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@id/ll_title">
<android.support.v7.widget.RecyclerView
android:id="@+id/recycler"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="visible">
</android.support.v7.widget.RecyclerView>
</android.support.v4.widget.SwipeRefreshLayout>
<LinearLayout
android:id="@+id/ll_empty"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@id/ll_title"
android:background="@color/white_caocao"
android:gravity="center"
android:orientation="vertical"
android:visibility="gone">
<TextView
android:id="@+id/tv_empty"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:drawablePadding="@dimen/all_margin"
android:drawableTop="@mipmap/nong"
android:gravity="center"
android:lineSpacingExtra="@dimen/all_padding"
android:text="@string/replenishment_empty_hint"
android:textColor="@color/gray_huanggai"
android:textSize="@dimen/all_text_size" />
</LinearLayout>
</android.support.constraint.ConstraintLayout>
</layout>
\ No newline at end of file
......@@ -26,7 +26,7 @@
android:padding="0dp"
android:text="@string/menu_service"
android:textColor="@color/black_baozheng"
android:textSize="@dimen/big_text_size"
android:textSize="@dimen/all_sub_title_size"
app:layout_constraintTop_toTopOf="parent">
</TextView>
......
......@@ -82,30 +82,38 @@
android:layout_marginTop="@dimen/all_margin"
android:background="@color/gray_huanggai" />
<LinearLayout
<android.support.constraint.ConstraintLayout
android:id="@+id/cl_store"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
android:layout_height="match_parent">
<android.support.v7.widget.RecyclerView
android:id="@+id/rl_skugrp"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1" />
android:layout_height="0dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintHorizontal_weight="1"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toLeftOf="@id/srl_sku"
app:layout_constraintTop_toTopOf="parent" />
<android.support.v4.widget.SwipeRefreshLayout
android:id="@+id/srl_sku"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="3"
android:background="@color/white_caocao">
android:layout_height="0dp"
android:background="@color/white_caocao"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintHorizontal_weight="3"
app:layout_constraintLeft_toRightOf="@id/rl_skugrp"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent">
<android.support.v7.widget.RecyclerView
android:id="@+id/rl_sku"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</android.support.v4.widget.SwipeRefreshLayout>
</LinearLayout>
</android.support.constraint.ConstraintLayout>
</LinearLayout>
</layout>
\ No newline at end of file
......@@ -10,7 +10,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/all_margin"
android:layout_marginTop="@dimen/all_padding_left_right"
android:background="@color/white"
android:orientation="horizontal">
......
......@@ -23,7 +23,8 @@
android:id="@+id/text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/black_baozheng" />
android:textColor="@color/black_baozheng"
android:textSize="@dimen/all_text_size" />
</LinearLayout>
</layout>
......
<?xml version="1.0" encoding="utf-8"?>
<layout>
<data>
<variable
name="shopName"
type="String" />
<variable
name="supplierName"
type="String" />
<variable
name="supplierAddress"
type="String" />
<variable
name="no"
type="String" />
<variable
name="date"
type="String" />
<variable
name="amt"
type="String" />
<variable
name="num"
type="String" />
<variable
name="status"
type="String" />
</data>
<android.support.constraint.ConstraintLayout 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:padding="@dimen/all_padding"
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
android:id="@+id/ll_boss"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:padding="@dimen/dp_4"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@mipmap/icon_stores" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingTop="@dimen/all_padding"
android:text="@{shopName}"
android:textColor="@color/black"
android:textSize="@dimen/all_text_size" />
</LinearLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="@dimen/all_padding"
android:paddingBottom="@dimen/dp_4"
android:paddingEnd="@dimen/all_padding"
android:paddingStart="@dimen/all_padding"
android:paddingTop="@dimen/dp_4"
android:text="@{status}"
android:textColor="@color/white"
app:layout_constraintBottom_toBottomOf="@id/ll_boss"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@id/ll_boss" />
<LinearLayout
android:id="@+id/ll_date"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:padding="@dimen/dp_4"
app:layout_constraintTop_toBottomOf="@id/ll_boss">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@mipmap/icon_dates_green" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingBottom="@dimen/dp_4"
android:paddingStart="@dimen/all_padding"
android:paddingTop="@dimen/dp_4"
android:text="@{date}"
android:textColor="@color/black"
android:textSize="@dimen/all_text_size" />
</LinearLayout>
<LinearLayout
android:id="@+id/ll_no"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:padding="@dimen/dp_4"
app:layout_constraintTop_toBottomOf="@id/ll_date">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@mipmap/icon_no_green" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingStart="@dimen/all_padding"
android:text="@{no}"
android:textColor="@color/black"
android:textSize="@dimen/all_text_size" />
</LinearLayout>
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/all_padding"
app:cardElevation="0dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toBottomOf="@id/ll_no">
<android.support.constraint.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/gray_zhouyu"
android:padding="@dimen/all_padding">
<TextView
android:id="@+id/tv_supplier_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:text="供货方"
android:textColor="@color/black"
android:textSize="@dimen/big_text_size"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<View
android:layout_width="0dp"
android:layout_height="@dimen/view_line_L1"
android:layout_marginTop="@dimen/dp_4"
android:background="@color/line_bg"
android:elevation="@dimen/view_line_L050"
app:layout_constraintEnd_toEndOf="@id/guideline_right"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_supplier_title" />
<LinearLayout
android:id="@+id/ll_supplier_info"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/all_padding"
android:gravity="center_vertical"
android:orientation="horizontal"
app:layout_constraintEnd_toEndOf="@id/guideline_right"
app:layout_constraintStart_toStartOf="@id/tv_supplier_title"
app:layout_constraintTop_toBottomOf="@id/tv_supplier_title">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@mipmap/icon_stores" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="@dimen/dp_4"
android:text="@{supplierName}"
android:textColor="@color/black"
android:textSize="@dimen/all_text_size" />
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal"
app:layout_constraintEnd_toEndOf="@id/guideline_right"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/ll_supplier_info">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@mipmap/icon_address" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="@dimen/dp_4"
android:text="@{supplierAddress}"
android:textColor="@color/black"
android:textSize="@dimen/all_text_size" />
</LinearLayout>
<android.support.constraint.Guideline
android:id="@+id/guideline_right"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_percent="0.66" />
<LinearLayout
android:id="@+id/ll_cut"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/all_padding"
android:layout_marginRight="@dimen/all_padding"
android:layout_marginTop="@dimen/all_margin"
android:gravity="end"
android:orientation="horizontal"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="@id/guideline_right"
app:layout_constraintTop_toTopOf="@id/tv_supplier_title">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@{num}"
android:textColor="@color/reddeep"
android:textSize="@dimen/all_text_size_big" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="@dimen/dp_4"
android:text="件"
android:textColor="@color/black" />
</LinearLayout>
<LinearLayout
android:id="@+id/ll_price"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/all_padding"
android:layout_marginTop="@dimen/all_margin"
android:gravity="end"
android:orientation="horizontal"
app:layout_constraintEnd_toEndOf="@id/ll_cut"
app:layout_constraintStart_toStartOf="@id/guideline_right"
app:layout_constraintTop_toBottomOf="@id/ll_cut">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="@dimen/dp_4"
android:text="¥"
android:textColor="@color/reddeep" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@{amt}"
android:textColor="@color/reddeep"
android:textSize="@dimen/all_text_size_big" />
</LinearLayout>
</android.support.constraint.ConstraintLayout>
</android.support.v7.widget.CardView>
</android.support.constraint.ConstraintLayout>
</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"
xmlns:tools="http://schemas.android.com/tools">
<data>
</data>
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/all_padding"
android:layout_marginEnd="@dimen/all_margin"
android:layout_marginStart="@dimen/all_padding"
android:layout_marginBottom="@dimen/all_padding"
app:cardCornerRadius="@dimen/all_shape_radius"
app:cardElevation="1dp">
<!--<android.support.constraint.ConstraintLayout-->
<!--android:layout_width="match_parent"-->
<!--android:layout_height="wrap_content"-->
<!--android:padding="@dimen/all_padding"-->
<!--android:background="@drawable/black_border">-->
<!--<com.facebook.drawee.view.SimpleDraweeView-->
<!--android:id="@+id/img_goods"-->
<!--android:layout_width="130dp"-->
<!--android:layout_height="130dp"-->
<!--app:placeholderImage="@mipmap/icon_goods_default" />-->
<!--<TextView-->
<!--android:id="@+id/tv_goods_name"-->
<!--style="@style/other_select_blacktext_style"-->
<!--android:layout_width="0dp"-->
<!--android:layout_height="wrap_content"-->
<!--android:layout_marginEnd="@dimen/all_margin"-->
<!--android:layout_marginTop="@dimen/all_margin"-->
<!--android:layout_marginStart="@dimen/all_padding"-->
<!--android:text="贝斯克莱因和美妖精生日巧克力蛋糕"-->
<!--app:layout_constraintEnd_toEndOf="@id/guideline_center"-->
<!--app:layout_constraintStart_toEndOf="@id/img_goods"-->
<!--app:layout_constraintTop_toTopOf="@id/img_goods" />-->
<!--<TextView-->
<!--android:id="@+id/tv_goods_code_hint"-->
<!--style="@style/other_select_smallstyle"-->
<!--android:layout_width="wrap_content"-->
<!--android:layout_height="wrap_content"-->
<!--android:layout_marginTop="@dimen/all_padding"-->
<!--android:text="条码:"-->
<!--app:layout_constraintStart_toStartOf="@id/tv_goods_name"-->
<!--app:layout_constraintTop_toBottomOf="@id/tv_goods_name" />-->
<!--<TextView-->
<!--android:id="@+id/tv_goods_code"-->
<!--style="@style/other_select_smallstyle"-->
<!--android:layout_width="wrap_content"-->
<!--android:layout_height="0dp"-->
<!--android:text="12783163981789"-->
<!--app:layout_constraintBottom_toBottomOf="@id/tv_goods_code_hint"-->
<!--app:layout_constraintStart_toEndOf="@id/tv_goods_code_hint"-->
<!--app:layout_constraintTop_toTopOf="@id/tv_goods_code_hint" />-->
<!--<TextView-->
<!--android:id="@+id/tv_goods_size"-->
<!--style="@style/store_product_size"-->
<!--android:layout_width="wrap_content"-->
<!--android:layout_height="wrap_content"-->
<!--android:text="规格"-->
<!--app:layout_constraintBottom_toBottomOf="@id/tv_goods_price"-->
<!--app:layout_constraintStart_toStartOf="@id/tv_goods_name"-->
<!--app:layout_constraintTop_toBottomOf="@id/tv_goods_code_hint" />-->
<!--<TextView-->
<!--android:id="@+id/tv_goods_price"-->
<!--android:layout_width="wrap_content"-->
<!--android:layout_height="wrap_content"-->
<!--android:layout_marginBottom="@dimen/all_margin"-->
<!--android:layout_marginEnd="@dimen/all_margin"-->
<!--android:text="999"-->
<!--android:textColor="@color/store_product_price"-->
<!--android:textSize="@dimen/fragment_store_product_price"-->
<!--app:layout_constraintBottom_toBottomOf="@id/img_goods"-->
<!--app:layout_constraintEnd_toEndOf="@id/guideline_center" />-->
<!--<TextView-->
<!--android:layout_width="wrap_content"-->
<!--android:layout_height="wrap_content"-->
<!--android:layout_marginBottom="2dp"-->
<!--android:text="@string/money_rmb"-->
<!--android:textColor="@color/store_product_price"-->
<!--android:textSize="@dimen/item_superpurchase_textsize_big"-->
<!--app:layout_constraintBottom_toBottomOf="@id/tv_goods_price"-->
<!--app:layout_constraintEnd_toStartOf="@+id/tv_goods_price" />-->
<!--<View-->
<!--android:layout_width="@dimen/all_line_width"-->
<!--android:layout_height="0dp"-->
<!--android:layout_marginBottom="@dimen/all_margin"-->
<!--android:layout_marginTop="@dimen/all_margin"-->
<!--android:background="@color/lyt_main_bg"-->
<!--app:layout_constraintBottom_toBottomOf="@id/img_goods"-->
<!--app:layout_constraintEnd_toEndOf="@id/guideline_center"-->
<!--app:layout_constraintTop_toTopOf="@id/img_goods" />-->
<!--<LinearLayout-->
<!--android:id="@+id/linearLayout"-->
<!--android:layout_width="wrap_content"-->
<!--android:layout_height="@dimen/dialog_cart_item_button_height"-->
<!--android:layout_margin="@dimen/all_margin"-->
<!--android:gravity="center"-->
<!--android:orientation="horizontal"-->
<!--app:layout_constraintBottom_toBottomOf="parent"-->
<!--app:layout_constraintEnd_toEndOf="parent"-->
<!--app:layout_constraintStart_toStartOf="@id/guideline_center">-->
<!--<ImageButton-->
<!--android:id="@+id/btn_down"-->
<!--android:layout_width="wrap_content"-->
<!--android:layout_height="match_parent"-->
<!--android:layout_marginEnd="@dimen/all_margin"-->
<!--android:layout_weight="1"-->
<!--android:background="@color/white"-->
<!--android:src="@mipmap/but_cut"-->
<!--tools:layout_editor_absoluteX="602dp"-->
<!--tools:layout_editor_absoluteY="97dp" />-->
<!--<EditText-->
<!--android:id="@+id/et_count"-->
<!--android:layout_width="100dp"-->
<!--android:layout_height="match_parent"-->
<!--android:layout_weight="1"-->
<!--android:background="@drawable/hint_border"-->
<!--android:gravity="center"-->
<!--android:hint="1"-->
<!--android:inputType="number"-->
<!--android:maxLength="4"-->
<!--android:saveEnabled="false"-->
<!--tools:layout_editor_absoluteX="540dp"-->
<!--tools:layout_editor_absoluteY="192dp" />-->
<!--<ImageButton-->
<!--android:id="@+id/btn_up"-->
<!--android:layout_width="wrap_content"-->
<!--android:layout_height="match_parent"-->
<!--android:layout_marginStart="@dimen/all_margin"-->
<!--android:layout_weight="1"-->
<!--android:background="@color/white"-->
<!--android:src="@mipmap/but_plus"-->
<!--tools:layout_editor_absoluteX="666dp"-->
<!--tools:layout_editor_absoluteY="97dp" />-->
<!--</LinearLayout>-->
<!--<TextView-->
<!--android:id="@+id/tv_stock_hint"-->
<!--android:layout_width="0dp"-->
<!--android:layout_height="wrap_content"-->
<!--android:gravity="right"-->
<!--android:text="库存:"-->
<!--android:textColor="@color/black"-->
<!--android:textSize="@dimen/big_text_size"-->
<!--app:layout_constraintBottom_toTopOf="@id/linearLayout"-->
<!--app:layout_constraintEnd_toStartOf="@id/tv_stock"-->
<!--app:layout_constraintHorizontal_weight="1"-->
<!--app:layout_constraintStart_toStartOf="@id/guideline_center"-->
<!--app:layout_constraintTop_toTopOf="parent" />-->
<!--<TextView-->
<!--android:id="@+id/tv_stock"-->
<!--android:layout_width="0dp"-->
<!--android:layout_height="wrap_content"-->
<!--android:text="0个"-->
<!--android:textColor="@color/black"-->
<!--android:textSize="@dimen/big_text_size"-->
<!--app:layout_constraintBottom_toTopOf="@id/linearLayout"-->
<!--app:layout_constraintEnd_toStartOf="@id/tv_traffic_hint"-->
<!--app:layout_constraintHorizontal_weight="1"-->
<!--app:layout_constraintStart_toEndOf="@id/tv_stock_hint"-->
<!--app:layout_constraintTop_toTopOf="parent" />-->
<!--<TextView-->
<!--android:id="@+id/tv_traffic_hint"-->
<!--android:layout_width="0dp"-->
<!--android:layout_height="wrap_content"-->
<!--android:gravity="right"-->
<!--android:text="在途:"-->
<!--android:textColor="@color/black"-->
<!--android:textSize="@dimen/big_text_size"-->
<!--app:layout_constraintBottom_toTopOf="@id/linearLayout"-->
<!--app:layout_constraintEnd_toStartOf="@id/tv_traffic"-->
<!--app:layout_constraintHorizontal_weight="1"-->
<!--app:layout_constraintStart_toEndOf="@id/tv_stock"-->
<!--app:layout_constraintTop_toTopOf="parent" />-->
<!--<TextView-->
<!--android:id="@+id/tv_traffic"-->
<!--android:layout_width="0dp"-->
<!--android:layout_height="wrap_content"-->
<!--android:text="0个"-->
<!--android:textColor="@color/black"-->
<!--android:textSize="@dimen/big_text_size"-->
<!--app:layout_constraintBottom_toTopOf="@id/linearLayout"-->
<!--app:layout_constraintEnd_toEndOf="parent"-->
<!--app:layout_constraintHorizontal_weight="1"-->
<!--app:layout_constraintStart_toEndOf="@id/tv_traffic_hint"-->
<!--app:layout_constraintTop_toTopOf="parent" />-->
<!--<android.support.constraint.Guideline-->
<!--android:id="@+id/guideline_center"-->
<!--android:layout_width="wrap_content"-->
<!--android:layout_height="wrap_content"-->
<!--android:orientation="vertical"-->
<!--app:layout_constraintGuide_percent="0.60" />-->
<!--</android.support.constraint.ConstraintLayout>-->
</android.support.v7.widget.CardView>
</layout>
\ No newline at end of file
......@@ -28,7 +28,7 @@
android:layout_weight="2.3">
<ImageView
android:layout_width="wrap_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@mipmap/return_ticket_one"/>
......@@ -97,7 +97,7 @@
android:layout_weight="1">
<ImageView
android:layout_width="wrap_content"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@mipmap/return_ticket_two"
/>
......
......@@ -27,6 +27,9 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/all_margin"
android:textStyle="bold"
android:textColor="@color/black_baozheng"
android:textSize="@dimen/all_text_size_small"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@id/img_left" />
......@@ -36,7 +39,7 @@
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/all_padding_left_right"
android:text="本店"
android:textSize="@dimen/small_text_size"
android:textSize="@dimen/all_text_size_small"
app:layout_constraintBottom_toBottomOf="@id/img_left"
app:layout_constraintEnd_toEndOf="parent" />
......@@ -57,7 +60,7 @@
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/all_padding"
android:text="11-15 15:23"
android:textSize="@dimen/small_text_size"
android:textSize="@dimen/all_text_size_small_small"
app:layout_constraintBottom_toBottomOf="@id/img_left"
app:layout_constraintStart_toEndOf="@id/img_left" />
......
......@@ -9,7 +9,6 @@
<variable
name="count"
type="int" />
</data>
<android.support.constraint.ConstraintLayout
......
......@@ -14,7 +14,7 @@
android:singleLine="true"
android:text="北京店"
android:textColor="@color/black"
android:textSize="14sp" />
android:textSize="@dimen/all_text_size_low" />
</RelativeLayout>
......
<?xml version="1.0" encoding="utf-8"?>
<layout>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<TextView
android:id="@+id/item_tv"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:gravity="left"
android:paddingTop="@dimen/all_padding"
android:paddingBottom="@dimen/all_padding"
android:paddingStart="@dimen/all_padding_left_right"
android:singleLine="true"
android:text="北京店"
android:textColor="@color/black"
android:textSize="14sp" />
</RelativeLayout>
</layout>
\ No newline at end of file
......@@ -36,7 +36,7 @@
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
android:textColor="@color/black_baozheng"
android:textSize="@dimen/big_text_size"/>
android:textSize="@dimen/all_sub_title_size"/>
......
......@@ -34,7 +34,7 @@
android:layout_centerInParent="true"
android:text="标题"
android:textColor="@color/white"
android:textSize="@dimen/big_text_size"
android:textSize="@dimen/all_sub_title_size"
/>
......
......@@ -14,6 +14,8 @@
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="@color/white_caocao"
android:focusable="true"
android:focusableInTouchMode="true"
>
......@@ -52,7 +54,7 @@
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:textColor="@color/black_baozheng"
android:textSize="@dimen/big_text_size"
android:textSize="@dimen/all_sub_title_size"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@id/iv_right"
......
<?xml version="1.0" encoding="utf-8"?>
<layout>
<android.support.constraint.ConstraintLayout 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:background="@color/transparent">
<TextView
android:layout_width="wrap_content"
android:layout_height="@dimen/editor_item_height"
android:gravity="center"
android:text="@{@string/ms_editor_buy + @string/ms_editor_group_all_hint}"
android:textColor="@color/black"
android:textSize="@dimen/big_text_size" />
</android.support.constraint.ConstraintLayout>
</layout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<layout>
<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:background="@color/transparent"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="@dimen/editor_item_height"
android:gravity="center"
android:text="@string/ms_editor_buy"
android:textColor="@color/black"
android:textSize="@dimen/big_text_size" />
<org.angmarch.views.NiceSpinner
android:id="@+id/ns_type_1"
style="@style/editor_edit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/all_spacing"
android:minWidth="@dimen/et_min_width_short"
app:backgroundSelector="@drawable/selector_white_background_stroke_2" />
<org.angmarch.views.NiceSpinner
android:id="@+id/ns_type_2"
style="@style/editor_edit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/all_spacing"
android:minWidth="@dimen/et_min_width_short"
app:backgroundSelector="@drawable/selector_white_background_stroke_2" />
<org.angmarch.views.NiceSpinner
android:id="@+id/ns_type_3"
style="@style/editor_edit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/all_spacing"
android:minWidth="@dimen/et_min_width_short"
android:visibility="gone"
app:backgroundSelector="@drawable/selector_white_background_stroke_2" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/all_spacing"
android:gravity="center"
android:text="@string/ms_editor_group_skugrp_hint"
android:textColor="@color/black"
android:textSize="@dimen/big_text_size" />
</LinearLayout>
</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">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginEnd="@dimen/all_margin"
android:layout_marginStart="@dimen/all_margin"
android:layout_marginTop="@dimen/all_margin">
<EditText
android:id="@+id/et_search"
style="@style/searchBarEditor"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginEnd="@dimen/all_spacing"
android:layout_weight="1"
android:hint="@string/ms_editor_type_gift_search_hint"
android:inputType="text"
android:labelFor="@+id/et_search"
android:textColor="@color/black_likui"
android:textColorHint="@color/gray_huanggai"
android:textSize="@dimen/all_text_size" />
<ImageButton
android:id="@+id/btn_scan"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@color/transparent"
android:contentDescription="@string/store_scan"
android:foreground="?android:attr/actionBarItemBackground"
android:src="@mipmap/but_sweep_yard" />
</LinearLayout>
<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:layout_marginTop="@dimen/all_margin"
android:background="@color/gray_kongming" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<com.facebook.drawee.view.SimpleDraweeView
android:layout_width="80dp"
android:layout_height="80dp"
android:layout_gravity="center_vertical"
android:layout_marginStart="@dimen/all_margin" />
<LinearLayout
android:id="@+id/ll_product"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/all_spacing"
android:orientation="vertical"
android:padding="@dimen/all_margin">
<TextView
android:id="@+id/tv_product_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/ms_editor_group_sku_name" />
<TextView
android:id="@+id/tv_product_price"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/all_margin"
android:text="@string/ms_editor_group_sku_price" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</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="timeStart"
type="String" />
<variable
name="timeEnd"
type="String" />
</data>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<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" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="@color/white_caocao"
android:gravity="center_vertical"
android:paddingEnd="@dimen/all_margin"
android:paddingStart="@dimen/all_margin">
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="center_vertical"
android:text="@string/ms_editor_time"
android:textColor="@color/black_baozheng"
android:textSize="@dimen/all_text_size" />
<TextView
android:id="@+id/tv_time_start"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginStart="@dimen/all_margin"
android:layout_weight="1"
android:foreground="?android:attr/selectableItemBackground"
android:gravity="center"
android:text="@{timeStart}"
android:textColor="@color/black_likui"
android:textSize="@dimen/all_text_size" />
<View
android:layout_width="@dimen/view_line_L1"
android:layout_height="match_parent"
android:layout_margin="@dimen/all_margin"
android:background="@color/golden_yuji" />
<TextView
android:id="@+id/tv_time_end"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:foreground="?android:attr/selectableItemBackground"
android:gravity="center"
android:text="@{timeEnd}"
android:textColor="@color/black_likui"
android:textSize="@dimen/all_text_size" />
</LinearLayout>
<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:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="@color/white_caocao"
android:gravity="center_vertical"
android:paddingEnd="@dimen/all_margin"
android:paddingStart="@dimen/all_margin"
android:text="@string/ms_editor_week"
android:textColor="@color/black_baozheng"
android:textSize="@dimen/all_text_size" />
<android.support.constraint.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white_caocao"
android:paddingEnd="@dimen/all_margin"
android:paddingStart="@dimen/all_margin">
<CheckBox
android:id="@+id/cb_mon"
android:layout_width="wrap_content"
android:layout_height="?attr/actionBarSize"
android:text="@string/week_mon"
app:layout_constraintHorizontal_chainStyle="spread_inside"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toLeftOf="@id/cb_tue"
app:layout_constraintTop_toTopOf="parent" />
<CheckBox
android:id="@+id/cb_tue"
android:layout_width="wrap_content"
android:layout_height="?attr/actionBarSize"
android:text="@string/week_tue"
app:layout_constraintLeft_toRightOf="@id/cb_mon"
app:layout_constraintRight_toLeftOf="@id/cb_wed"
app:layout_constraintTop_toTopOf="@id/cb_mon" />
<CheckBox
android:id="@+id/cb_wed"
android:layout_width="wrap_content"
android:layout_height="?attr/actionBarSize"
android:text="@string/week_wed"
app:layout_constraintLeft_toRightOf="@id/cb_tue"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="@id/cb_mon" />
<CheckBox
android:id="@+id/cb_thu"
android:layout_width="wrap_content"
android:layout_height="?attr/actionBarSize"
android:text="@string/week_thu"
app:layout_constraintLeft_toLeftOf="@id/cb_mon"
app:layout_constraintTop_toBottomOf="@id/cb_mon" />
<CheckBox
android:id="@+id/cb_fri"
android:layout_width="wrap_content"
android:layout_height="?attr/actionBarSize"
android:text="@string/week_fri"
app:layout_constraintLeft_toLeftOf="@id/cb_tue"
app:layout_constraintTop_toTopOf="@id/cb_thu" />
<CheckBox
android:id="@+id/cb_sat"
android:layout_width="wrap_content"
android:layout_height="?attr/actionBarSize"
android:text="@string/week_sat"
app:layout_constraintLeft_toLeftOf="@id/cb_wed"
app:layout_constraintTop_toTopOf="@id/cb_thu" />
<CheckBox
android:id="@+id/cb_sun"
android:layout_width="wrap_content"
android:layout_height="?attr/actionBarSize"
android:text="@string/week_sun"
app:layout_constraintTop_toBottomOf="@id/cb_thu" />
</android.support.constraint.ConstraintLayout>
</LinearLayout>
</layout>
\ No newline at end of file
......@@ -8,9 +8,15 @@
<dimen name="all_margin_big">28dp</dimen>
<dimen name="all_spacing">6dp</dimen>
<dimen name="all_sub_title_size">20sp</dimen>
<dimen name="big_text_size">18sp</dimen>
<dimen name="sbig_text_size">25sp</dimen>
<dimen name="all_text_size">16sp</dimen>
<dimen name="all_text_size_low">14sp</dimen>
<dimen name="all_text_size_small">12sp</dimen>
<dimen name="all_text_size_small_small">10sp</dimen>
<dimen name="small_text_size">13sp</dimen>
<dimen name="all_caption_size">12sp</dimen>
<dimen name="all_body_size">14sp</dimen>
<dimen name="all_tiny_size">9sp</dimen>
<dimen name="all_title_size">26sp</dimen>
<dimen name="all_padding">10dp</dimen>
......@@ -20,10 +26,7 @@
<dimen name="all_text_size_super_big">25sp</dimen>
<dimen name="all_margin_left">17dp</dimen>
<dimen name="title_height">50dp</dimen>
<dimen name="small_text_size">13sp</dimen>
<dimen name="all_textview_width">120dp</dimen>
<dimen name="big_text_size">18sp</dimen>
<dimen name="sbig_text_size">25sp</dimen>
<dimen name="all_dialog_button">40dp</dimen>
<integer name="all_top_weight">2</integer>
<integer name="all_content_weight">25</integer>
......@@ -202,4 +205,8 @@
<dimen name="store_cart_count">20dp</dimen>
<!--新标准-->
<dimen name="headline">20dp</dimen>
</resources>
......@@ -272,7 +272,7 @@
<string name="replenishment_add">一键补货</string>
<string name="replenishment_order">共%s个订单</string>
<string name="replenishment_search_hint">搜索供货商订单</string>
<string name="replenishment_empty_hint">没有相关订单</string>
<string name="replenishment_empty_hint">还没有订货单哦~</string>
<string name="replenishment_detail_cancel">关闭</string>
<string name="replenishment_detail_submit">定货提交</string>
<string name="replenishment_detail_print">打印</string>
......@@ -325,14 +325,21 @@
<string name="ms_empty_hint">没有搜到此计划\n请重新搜索,或点击添加按钮进行添加~</string>
<string name="ms_editor_title">管理-营销计划</string>
<string name="ms_editor_setting">设置营销计划</string>
<string name="ms_editor_name">计划名称:</string>
<string name="ms_editor_subtitle_info">基本信息</string>
<string name="ms_editor_name">计划名称</string>
<string name="ms_editor_name_hint">请输入计划名称</string>
<string name="ms_editor_subtitle_time">时间信息</string>
<string name="ms_editor_time_more">更多设置</string>
<string name="ms_editor_date">起止时间:</string>
<string name="ms_editor_time">限定时段:</string>
<string name="ms_editor_week">限定星期:</string>
<string name="ms_editor_date_start">开始时间</string>
<string name="ms_editor_date_end">结束时间</string>
<string name="ms_editor_time">限定时段</string>
<string name="ms_editor_week">限定星期</string>
<string name="ms_editor_subtitle_ms">活动信息</string>
<string name="ms_editor_type">营销方式:</string>
<string name="ms_editor_group">营销对象:</string>
<string name="ms_editor_area">营销范围:</string>
<string name="ms_editor_group">营销主体</string>
<string name="ms_editor_user">营销对象</string>
<string name="ms_editor_area">营销范围</string>
<string name="ms_editor_buy"></string>
<string name="ms_editor_group_all_hint">任意商品</string>
<string name="ms_editor_group_skugrp_hint">品类下的任意商品</string>
......@@ -358,6 +365,10 @@
<string name="ms_editor_type_gift_hint">条码:请扫码或输入条码</string>
<string name="ms_editor_type_gift_name">品名:</string>
<string name="ms_editor_type_gift_price">售价:</string>
<string name="ms_editor_type_gift_search_hint">请扫内包装商品条码</string>
<string name="ms_editor_date_format">%s年%s月%s日</string>
<string name="ms_editor_time_format">%s:%s</string>
<!--商品管理-->
<string name="sssku_title">商品维护</string>
......@@ -627,6 +638,8 @@
<string name="statistics_hint">统计</string>
<string name="statistics_menu_order">订单</string>
<string name="statistics_menu_ms">营销</string>
<string name="statistics_menu_ms_recharge">充值记录</string>
<string name="statistics_menu_ms_usedTicket">已用优惠券</string>
<string name="statistics_todayAmt_hint">今日销售额</string>
<string name="statistics_todayOrder_hint">今日订单数</string>
<string name="statistics_todayRecharge_hint">今日充值</string>
......@@ -649,6 +662,11 @@
<string name="oder_detail_cutAmt">抹零金额:</string>
<string name="ticket_detail_date">使用时间:</string>
<string name="ticket_detail_no">销售单号:</string>
<!--管理POS-->
<string name="manage_replenishment_add">一键补货</string>
<string name="manage_replenishment_unConfirmed">待确认</string>
<string name="manage_replenishment_unReceive">待收货</string>
<string name="manage_replenishment_finished">已入库</string>
</resources>
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