Commit b2ba6988 authored by zhang_z's avatar zhang_z

提交代码;

parent f1716013
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
<w>kongrun</w> <w>kongrun</w>
<w>likui</w> <w>likui</w>
<w>liubei</w> <w>liubei</w>
<w>lvzhi</w>
<w>mawu</w> <w>mawu</w>
<w>patt</w> <w>patt</w>
<w>shixiu</w> <w>shixiu</w>
...@@ -21,6 +22,7 @@ ...@@ -21,6 +22,7 @@
<w>xishi</w> <w>xishi</w>
<w>yanqing</w> <w>yanqing</w>
<w>yuefei</w> <w>yuefei</w>
<w>yuji</w>
<w>zhangfei</w> <w>zhangfei</w>
<w>zhouyu</w> <w>zhouyu</w>
</words> </words>
......
...@@ -477,4 +477,11 @@ public class C { ...@@ -477,4 +477,11 @@ public class C {
public static final int PAYMENT = 1; public static final int PAYMENT = 1;
public static final int STORE = 2; public static final int STORE = 2;
} }
public final class TITLE_MODE {
public static final int HIDE = 0;
public static final int TEXT = 1;
public static final int VIP = 2;
}
} }
...@@ -28,8 +28,6 @@ import me.yokeyword.fragmentation.SupportFragment; ...@@ -28,8 +28,6 @@ import me.yokeyword.fragmentation.SupportFragment;
*/ */
public abstract class BaseFragment<P extends BasePresenter, B extends ViewDataBinding> extends SupportFragment { public abstract class BaseFragment<P extends BasePresenter, B extends ViewDataBinding> extends SupportFragment {
private FragmentBaseBinding mBaseBinding;
public Context mContext; public Context mContext;
public P mPresenter; public P mPresenter;
public B mViewBinding; public B mViewBinding;
...@@ -41,49 +39,55 @@ public abstract class BaseFragment<P extends BasePresenter, B extends ViewDataBi ...@@ -41,49 +39,55 @@ public abstract class BaseFragment<P extends BasePresenter, B extends ViewDataBi
public abstract int getLayoutId(); public abstract int getLayoutId();
protected boolean isLazy() {
return false;
}
@Nullable @Nullable
@Override @Override
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
mContext = ActivityUtils.getTopActivity(); mContext = ActivityUtils.getTopActivity();
mPresenter = (P) ((BaseActivity) getActivity()).mPresenter; mPresenter = (P) ((BaseActivity) getActivity()).mPresenter;
if (isLazy()) { if (this instanceof titleBar || this instanceof searchBar) {
return getLazyFragmentView(inflater, container); return getTitleFragmentView(inflater, container);
} else { } else {
return getFragmentView(inflater, container); return getFragmentView(inflater, container);
} }
} }
protected interface titleBar {
int getTitleText();
}
protected interface searchBar {
int getSearchMode();
String getHintText();
void onSearchClick();
}
@Override
public void onResume() {
super.onResume();
}
private View getFragmentView(LayoutInflater inflater, ViewGroup container) { private View getFragmentView(LayoutInflater inflater, ViewGroup container) {
mViewBinding = DataBindingUtil.inflate(inflater, getLayoutId(), container, false); mViewBinding = DataBindingUtil.inflate(inflater, getLayoutId(), container, false);
initView(); initView();
return mViewBinding.getRoot(); return mViewBinding.getRoot();
} }
private View getLazyFragmentView(LayoutInflater inflater, ViewGroup container) {
mBaseBinding = DataBindingUtil.inflate(inflater, R.layout.fragment_base, container, false);
return mBaseBinding.getRoot();
}
@Override private View getTitleFragmentView(LayoutInflater inflater, ViewGroup container) {
public void onEnterAnimationEnd(Bundle savedInstanceState) { FragmentBaseBinding mBaseBinding = DataBindingUtil.inflate(inflater, R.layout.fragment_base, container, false);
super.onEnterAnimationEnd(savedInstanceState);
if (isLazy()) {
mBaseBinding.vsFragment.getViewStub().setLayoutResource(getLayoutId()); mBaseBinding.vsFragment.getViewStub().setLayoutResource(getLayoutId());
mBaseBinding.vsFragment.getViewStub().setOnInflateListener((viewStub, view) -> { mBaseBinding.vsFragment.getViewStub().setOnInflateListener((viewStub, view) -> mViewBinding = DataBindingUtil.bind(view));
mViewBinding = DataBindingUtil.bind(view);
mBaseBinding.skvLoading.setVisibility(View.GONE);
});
mBaseBinding.vsFragment.getViewStub().inflate(); mBaseBinding.vsFragment.getViewStub().inflate();
initView(); mBaseBinding.btnBack.setOnClickListener(view -> onBackPressedSupport());
} this.initView();
return mBaseBinding.getRoot();
} }
public abstract void initView(); public abstract void initView();
public void showMainPopup(PopupWindow popupWindow, View view) { public void showMainPopup(PopupWindow popupWindow, View view) {
......
...@@ -2,7 +2,6 @@ package com.xingdata.zzdpos.ui.announcement.fragment; ...@@ -2,7 +2,6 @@ package com.xingdata.zzdpos.ui.announcement.fragment;
import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.LinearLayoutManager;
import android.view.View;
import com.xingdata.zzdpos.R; import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseFragment; import com.xingdata.zzdpos.base.BaseFragment;
...@@ -23,11 +22,6 @@ public class AnnouncementFragment extends BaseFragment<AnnouncementPresenter, Fr ...@@ -23,11 +22,6 @@ public class AnnouncementFragment extends BaseFragment<AnnouncementPresenter, Fr
return R.layout.fragment_announcement; return R.layout.fragment_announcement;
} }
@Override
protected boolean isLazy() {
return false;
}
@Override @Override
public void initView() { public void initView() {
......
...@@ -22,6 +22,7 @@ public class PaymentActivity extends BaseActivity<PaymentPresenter, ActivityPaym ...@@ -22,6 +22,7 @@ public class PaymentActivity extends BaseActivity<PaymentPresenter, ActivityPaym
@Override @Override
public void initView() { public void initView() {
loadRootFragment(R.id.f_payment, mPaymentFragment); loadRootFragment(R.id.f_payment, mPaymentFragment);
mViewBinding.btnBack.setOnClickListener(view -> onBackPressedSupport());
} }
......
package com.xingdata.zzdpos.ui.payment; package com.xingdata.zzdpos.ui.payment;
import com.blankj.utilcode.util.EncryptUtils;
import com.xingdata.zzdpos.api.ApiFactory;
import com.xingdata.zzdpos.util.SystemUtil;
public class PaymentPresenter extends PaymentContract.Presenter { public class PaymentPresenter extends PaymentContract.Presenter {
@Override @Override
public void onAttached() { public void onAttached() {
ApiFactory.Test.signBefore("13111111111", EncryptUtils.encryptMD5ToString("000000".getBytes()),
"1", SystemUtil.getDeviceSN()).subscribe(loginReturnBean -> {
}, throwable -> {
});
} }
@Override @Override
......
package com.xingdata.zzdpos.ui.settle; package com.xingdata.zzdpos.ui.settle;
import android.view.inputmethod.EditorInfo;
import com.blankj.utilcode.util.ActivityUtils; import com.blankj.utilcode.util.ActivityUtils;
import com.blankj.utilcode.util.KeyboardUtils;
import com.xingdata.zzdpos.C; import com.xingdata.zzdpos.C;
import com.xingdata.zzdpos.R; import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseActivity; import com.xingdata.zzdpos.base.BaseActivity;
...@@ -14,6 +17,8 @@ import com.xingdata.zzdpos.ui.main.MainActivity; ...@@ -14,6 +17,8 @@ import com.xingdata.zzdpos.ui.main.MainActivity;
import com.xingdata.zzdpos.ui.settle.fragment.CashPayFragment; import com.xingdata.zzdpos.ui.settle.fragment.CashPayFragment;
import com.xingdata.zzdpos.ui.settle.fragment.PayResultFragment; import com.xingdata.zzdpos.ui.settle.fragment.PayResultFragment;
import com.xingdata.zzdpos.ui.settle.fragment.SettleFragment; import com.xingdata.zzdpos.ui.settle.fragment.SettleFragment;
import com.xingdata.zzdpos.ui.settle.fragment.TicketFragment;
import com.xingdata.zzdpos.ui.settle.fragment.VipFragment;
import java.util.List; import java.util.List;
...@@ -21,8 +26,11 @@ import java.util.List; ...@@ -21,8 +26,11 @@ import java.util.List;
public class SettleActivity extends BaseActivity<SettlePresenter, ActivitySettleBinding> implements SettleContract.View { public class SettleActivity extends BaseActivity<SettlePresenter, ActivitySettleBinding> implements SettleContract.View {
private SettleFragment mSettleFragment = new SettleFragment(); private SettleFragment mSettleFragment = new SettleFragment();
private CashPayFragment mCashPayFragment = new CashPayFragment();
private TicketFragment mTicketFragment = new TicketFragment();
private VipFragment mVipFragment = new VipFragment();
private CashPayFragment mCashPayFragment = new CashPayFragment();
private PayResultFragment mPayResultFragment = new PayResultFragment(); private PayResultFragment mPayResultFragment = new PayResultFragment();
private LoadingDialog mLoadingDialog = new LoadingDialog(); private LoadingDialog mLoadingDialog = new LoadingDialog();
...@@ -35,24 +43,41 @@ public class SettleActivity extends BaseActivity<SettlePresenter, ActivitySettle ...@@ -35,24 +43,41 @@ public class SettleActivity extends BaseActivity<SettlePresenter, ActivitySettle
@Override @Override
public void initView() { public void initView() {
this.loadRootFragment(R.id.f_settle, mSettleFragment); this.loadRootFragment(R.id.f_settle, mSettleFragment);
mViewBinding.setTitleMode(C.TITLE_MODE.TEXT);
mViewBinding.btnBack.setOnClickListener(view -> getTopFragment().onBackPressedSupport());
mViewBinding.etSearch.setOnEditorActionListener((textView, i, keyEvent) -> {
if (i == EditorInfo.IME_ACTION_SEARCH) {
KeyboardUtils.hideSoftInput(textView);
switch (mViewBinding.getTitleMode()) {
case C.TITLE_MODE.VIP:
mPresenter.searchVip(textView.getText().toString());
break;
}
}
return false;
});
} }
@Override @Override
public void setSettleFragmentBySettleMode(int settleMode) { public void setSettleFragmentBySettleMode(int settleMode) {
mSettleFragment.setViewBySettleMode(settleMode);
} }
@Override @Override
public void showSettleFragment() { public void showSettleFragment() {
this.popTo(mSettleFragment.getClass(), false); this.popTo(mSettleFragment.getClass(), false);
mViewBinding.tvTitle.setText(R.string.settle_title);
} }
@Override @Override
public void showVipFragment() { public void showVipFragment() {
this.showTitleBarByTitleMode(C.TITLE_MODE.VIP);
this.start(mVipFragment);
} }
@Override @Override
public void loadVips(List<Vip> vips) { public void loadVips(List<Vip> vips) {
mVipFragment.loadVips(vips);
} }
@Override @Override
...@@ -67,7 +92,6 @@ public class SettleActivity extends BaseActivity<SettlePresenter, ActivitySettle ...@@ -67,7 +92,6 @@ public class SettleActivity extends BaseActivity<SettlePresenter, ActivitySettle
@Override @Override
public void loadTickets(List<Ticket> tickets) { public void loadTickets(List<Ticket> tickets) {
} }
@Override @Override
...@@ -75,6 +99,11 @@ public class SettleActivity extends BaseActivity<SettlePresenter, ActivitySettle ...@@ -75,6 +99,11 @@ public class SettleActivity extends BaseActivity<SettlePresenter, ActivitySettle
} }
@Override
public void loadAvlTicketNum(int avlNum) {
mSettleFragment.loadAvlTicketNum(avlNum);
}
@Override @Override
public void loadPays(List<Pay> pays) { public void loadPays(List<Pay> pays) {
mSettleFragment.loadPays(pays); mSettleFragment.loadPays(pays);
...@@ -114,11 +143,15 @@ public class SettleActivity extends BaseActivity<SettlePresenter, ActivitySettle ...@@ -114,11 +143,15 @@ public class SettleActivity extends BaseActivity<SettlePresenter, ActivitySettle
@Override @Override
public void showPaySuccFragment(Saleorder saleorder) { public void showPaySuccFragment(Saleorder saleorder) {
this.start(mPayResultFragment.setResult(true).setSaleorder(saleorder)); this.start(mPayResultFragment.setResult(true).setSaleorder(saleorder));
this.showTitleBarByTitleMode(C.TITLE_MODE.TEXT);
mViewBinding.tvTitle.setText(R.string.settle_pay_result_title);
} }
@Override @Override
public void showPayFailFragment(Throwable throwable, Saleorder saleorder) { public void showPayFailFragment(Throwable throwable, Saleorder saleorder) {
this.start(mPayResultFragment.setResult(false).setSaleorder(saleorder)); this.start(mPayResultFragment.setResult(false).setSaleorder(saleorder));
this.showTitleBarByTitleMode(C.TITLE_MODE.TEXT);
mViewBinding.tvTitle.setText(R.string.settle_pay_result_title);
} }
@Override @Override
...@@ -126,4 +159,21 @@ public class SettleActivity extends BaseActivity<SettlePresenter, ActivitySettle ...@@ -126,4 +159,21 @@ public class SettleActivity extends BaseActivity<SettlePresenter, ActivitySettle
ActivityUtils.startActivity(this, MainActivity.class); ActivityUtils.startActivity(this, MainActivity.class);
} }
/**
* 根据titleMode显示TitleBar
*
* @param titleMode 标题模式
*/
public void showTitleBarByTitleMode(int titleMode) {
if (mViewBinding.getTitleMode() == titleMode) return;
mViewBinding.setTitleMode(titleMode);
switch (titleMode) {
case C.TITLE_MODE.VIP:
mViewBinding.etSearch.setHint(R.string.settle_vip_search_hint);
mViewBinding.etSearch.setText("");
break;
}
}
} }
...@@ -63,6 +63,13 @@ interface SettleContract { ...@@ -63,6 +63,13 @@ interface SettleContract {
*/ */
void loadTicket(Ticket ticket); void loadTicket(Ticket ticket);
/**
* 加载可用优惠券数量
*
* @param avlNum 可用数量
*/
void loadAvlTicketNum(int avlNum);
/*** /***
* 加载支付方式列表 * 加载支付方式列表
* *
...@@ -116,7 +123,6 @@ interface SettleContract { ...@@ -116,7 +123,6 @@ interface SettleContract {
*/ */
void showPayFailFragment(Throwable throwable, Saleorder saleorder); void showPayFailFragment(Throwable throwable, Saleorder saleorder);
/** /**
* 返回主页面 * 返回主页面
*/ */
......
...@@ -97,8 +97,7 @@ public class SettlePresenter extends SettleContract.Presenter { ...@@ -97,8 +97,7 @@ public class SettlePresenter extends SettleContract.Presenter {
@Override @Override
public void clickVipView() { public void clickVipView() {
// mView.showVipFragment(); mView.showVipFragment();
mView.loadVip(Vip.createDefault());
} }
@Override @Override
...@@ -115,7 +114,6 @@ public class SettlePresenter extends SettleContract.Presenter { ...@@ -115,7 +114,6 @@ public class SettlePresenter extends SettleContract.Presenter {
@Override @Override
public void selectVip(Vip vip) { public void selectVip(Vip vip) {
mView.showSettleFragment();
mView.loadVip(vip); mView.loadVip(vip);
} }
...@@ -127,7 +125,15 @@ public class SettlePresenter extends SettleContract.Presenter { ...@@ -127,7 +125,15 @@ public class SettlePresenter extends SettleContract.Presenter {
@Override @Override
public void searchTicket(Long vipId) { public void searchTicket(Long vipId) {
ApiFactory.Ticket.query(vipId).subscribe( ApiFactory.Ticket.query(vipId).subscribe(
tickets -> mView.loadTickets(tickets), tickets -> {
mView.loadTickets(tickets);
int avlTicketNum = 0;
for (int i = 0; i < tickets.size(); i++) {
if (tickets.get(i).getTruleOrderAmt() <= mSaleorder.getOrderPayAmt())
avlTicketNum++;
}
mView.loadAvlTicketNum(avlTicketNum);
},
throwable -> { throwable -> {
}); });
} }
...@@ -139,6 +145,8 @@ public class SettlePresenter extends SettleContract.Presenter { ...@@ -139,6 +145,8 @@ public class SettlePresenter extends SettleContract.Presenter {
@Override @Override
public void changePointState(boolean isUsePoint) { public void changePointState(boolean isUsePoint) {
mSaleorder.setBound(isUsePoint, mVip.getBoundCbal()).settle();
mView.loadSaleorder(mSaleorder);
} }
@Override @Override
...@@ -149,10 +157,7 @@ public class SettlePresenter extends SettleContract.Presenter { ...@@ -149,10 +157,7 @@ public class SettlePresenter extends SettleContract.Presenter {
@Override @Override
public void payInCash(Long inputAmt, Long changeAmt) { public void payInCash(Long inputAmt, Long changeAmt) {
subscribePay(commitOrder() subscribePay(commitOrder().flatMap(orderNo -> ApiFactory.Saleorder.addOrderPayMis(mSaleorder.pay(orderNo, C.PAY_CHANNEL.CASH))));
.flatMap(orderNo -> ApiFactory.Saleorder.addOrderPayMis(mSaleorder.pay(orderNo, C.PAY_CHANNEL.CASH)))
);
} }
@Override @Override
...@@ -193,10 +198,8 @@ public class SettlePresenter extends SettleContract.Presenter { ...@@ -193,10 +198,8 @@ public class SettlePresenter extends SettleContract.Presenter {
*/ */
private void subscribePay(Observable<Saleorder> observable) { private void subscribePay(Observable<Saleorder> observable) {
mView.showLoadingDialog(); mView.showLoadingDialog();
observable.doFinally(() -> mView.dismissLoadingDialog()).subscribe( observable.doFinally(() -> mView.dismissLoadingDialog())
this::paySucc, .subscribe(this::paySucc, this::payFail);
this::payFail
);
} }
/** /**
......
package com.xingdata.zzdpos.ui.settle.adapter;
import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseAdapter;
import com.xingdata.zzdpos.databinding.ItemSettleVipBinding;
import com.xingdata.zzdpos.model.Vip;
import com.xingdata.zzdpos.util.ConvertUtil;
import java.util.ArrayList;
public class VipAdapter extends BaseAdapter<Vip, ItemSettleVipBinding> {
public VipAdapter() {
super(R.layout.item_settle_vip, new ArrayList<>());
}
@Override
protected void convert(ItemSettleVipBinding mViewBinding, Vip item) {
mViewBinding.setName(item.getVipName());
mViewBinding.setPhone(ConvertUtil.longToString(item.getVipMobile()));
if (item.getVipDefDiscount() < 100 && item.getVipDefDiscount() > 0) {
mViewBinding.setDisRate(String.valueOf((double) item.getVipDefDiscount() / 10));
}
switch (item.getVipLevel()) {
case 1:
mViewBinding.ivLevel.setImageResource(R.mipmap.mk_grade01);
break;
case 2:
mViewBinding.ivLevel.setImageResource(R.mipmap.mk_grade02);
break;
case 3:
mViewBinding.ivLevel.setImageResource(R.mipmap.mk_grade03);
break;
}
}
}
...@@ -21,8 +21,10 @@ public class PayResultFragment extends BaseFragment<SettlePresenter, FragmentPay ...@@ -21,8 +21,10 @@ public class PayResultFragment extends BaseFragment<SettlePresenter, FragmentPay
mViewBinding.setPayResult(mResult); mViewBinding.setPayResult(mResult);
mViewBinding.tvCount.setText(mSaleorder.getGoodsCnt()); mViewBinding.tvCount.setText(mSaleorder.getGoodsCnt());
mViewBinding.tvOrderAmt.setText(mSaleorder.getPayAmt()); mViewBinding.tvOrderAmt.setText(mSaleorder.getPayAmt());
if (mResult) {
mViewBinding.tvType.setText(mSaleorder.getPayChannel()); mViewBinding.tvType.setText(mSaleorder.getPayChannel());
mViewBinding.tvTime.setText(mSaleorder.getOrderTime()); mViewBinding.tvTime.setText(mSaleorder.getOrderTime());
}
mViewBinding.ivResult.setImageResource(mResult ? R.mipmap.ic_succeed : R.mipmap.ic_fail); mViewBinding.ivResult.setImageResource(mResult ? R.mipmap.ic_succeed : R.mipmap.ic_fail);
mViewBinding.btnConfirm.setOnClickListener(view -> { mViewBinding.btnConfirm.setOnClickListener(view -> {
...@@ -31,6 +33,13 @@ public class PayResultFragment extends BaseFragment<SettlePresenter, FragmentPay ...@@ -31,6 +33,13 @@ public class PayResultFragment extends BaseFragment<SettlePresenter, FragmentPay
}); });
} }
@Override
public boolean onBackPressedSupport() {
if (mResult) mPresenter.clickComplete();
else mPresenter.clickRetry();
return true;
}
/** /**
* 设置订单信息 * 设置订单信息
* *
......
...@@ -33,33 +33,65 @@ public class SettleFragment extends BaseFragment<SettlePresenter, FragmentSettle ...@@ -33,33 +33,65 @@ public class SettleFragment extends BaseFragment<SettlePresenter, FragmentSettle
mPayAdapter = new PayAdapter(); mPayAdapter = new PayAdapter();
mViewBinding.rlPay.setAdapter(mPayAdapter); mViewBinding.rlPay.setAdapter(mPayAdapter);
mViewBinding.rlPay.setLayoutManager(new StaggeredGridLayoutManager(3, StaggeredGridLayoutManager.VERTICAL)); mViewBinding.rlPay.setLayoutManager(new StaggeredGridLayoutManager(3, StaggeredGridLayoutManager.VERTICAL));
mViewBinding.rlPay.addItemDecoration(new RecyclerViewUtil.GridSpacingItemDecoration(3, 20, true)); mViewBinding.rlPay.addItemDecoration(new RecyclerViewUtil.GridSpacingItemDecoration(3, 24, true));
mPayAdapter.setOnItemClickListener((adapter, view, position) -> mPresenter.clickPayChannelView(mPayAdapter.getData().get(position).getPayType())); mPayAdapter.setOnItemClickListener((adapter, view, position) -> mPresenter.clickPayChannelView(mPayAdapter.getData().get(position).getPayType()));
// other listener // other listener
mViewBinding.clVip.setOnClickListener(view -> mPresenter.clickVipView()); mViewBinding.clVip.setOnClickListener(view -> mPresenter.clickVipView());
mViewBinding.tvSettle.setOnClickListener(view -> BottomSheetBehavior.from(mViewBinding.llSheet).setState(BottomSheetBehavior.STATE_EXPANDED)); mViewBinding.tvSettle.setOnClickListener(view -> BottomSheetBehavior.from(mViewBinding.llSheet).setState(BottomSheetBehavior.STATE_EXPANDED));
mViewBinding.llPoint.setOnClickListener(view -> mViewBinding.cbPoint.setChecked(!mViewBinding.cbPoint.isChecked()));
mViewBinding.llTicket.setOnClickListener(view -> mPresenter.clickTicketView());
mViewBinding.cbPoint.setOnCheckedChangeListener((compoundButton, b) -> {
mViewBinding.cbPoint.setButtonDrawable(b ? R.mipmap.but_elect01 : R.mipmap.but_elect02);
mPresenter.changePointState(b);
});
// init
mPresenter.initSettle(); mPresenter.initSettle();
} }
/**
* 设置界面
*
* @param settleMode 收款模式
*/
public void setViewBySettleMode(int settleMode) {
}
/** /**
* 加载会员 * 加载会员
* *
* @param vip 会员信息 * @param vip 会员信息
*/ */
public void loadVip(Vip vip) { public void loadVip(Vip vip) {
mViewBinding.setDefualtVip(false); mViewBinding.setDefualtVip(vip.isDefaultVip());
mViewBinding.setName("张洋"); mViewBinding.setName(vip.getVipName());
mViewBinding.setPhone("15201451212"); mViewBinding.setPhone(ConvertUtil.longToString(vip.getVipMobile()));
mViewBinding.setDisRate("8.5"); if (vip.getVipDefDiscount() < 100 && vip.getVipDefDiscount() > 0) {
mViewBinding.setDisRate(String.valueOf((double) vip.getVipDefDiscount() / 10));
// mViewBinding.setDefualtVip(vip.isDefaultVip()); }
// mViewBinding.setName(vip.getVipName()); switch (vip.getVipLevel()) {
// mViewBinding.setPhone(ConvertUtil.longToString(vip.getVipMobile())); case 1:
// if (vip.getVipDefDiscount() < 100 && vip.getVipDefDiscount() > 0) { mViewBinding.ivLevel.setImageResource(R.mipmap.mk_grade01);
// mViewBinding.setDisRate(String.valueOf((double) vip.getVipDefDiscount() / 10)); break;
// } case 2:
mViewBinding.ivLevel.setImageResource(R.mipmap.mk_grade02);
break;
case 3:
mViewBinding.ivLevel.setImageResource(R.mipmap.mk_grade03);
break;
}
}
/**
* 加载可用优惠券数量
*
* @param avlNum 可用数量
*/
public void loadAvlTicketNum(int avlNum) {
mViewBinding.setAvlTicketNum(avlNum);
} }
/** /**
...@@ -69,6 +101,7 @@ public class SettleFragment extends BaseFragment<SettlePresenter, FragmentSettle ...@@ -69,6 +101,7 @@ public class SettleFragment extends BaseFragment<SettlePresenter, FragmentSettle
*/ */
public void loadSaleorder(Saleorder saleorder) { public void loadSaleorder(Saleorder saleorder) {
mViewBinding.tvPayAmt.setText(ConvertUtil.fenToYuan(saleorder.getOrderPayAmt())); mViewBinding.tvPayAmt.setText(ConvertUtil.fenToYuan(saleorder.getOrderPayAmt()));
mViewBinding.tvAuthAmt.setText(ConvertUtil.fenToYuan(saleorder.getOrderAuthAmt()));
} }
/** /**
...@@ -78,4 +111,5 @@ public class SettleFragment extends BaseFragment<SettlePresenter, FragmentSettle ...@@ -78,4 +111,5 @@ public class SettleFragment extends BaseFragment<SettlePresenter, FragmentSettle
mPayAdapter.setNewData(pays); mPayAdapter.setNewData(pays);
} }
} }
package com.xingdata.zzdpos.ui.settle.fragment;
public class TicketFragment {
}
package com.xingdata.zzdpos.ui.settle.fragment;
import android.support.v7.widget.LinearLayoutManager;
import com.xingdata.zzdpos.C;
import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseFragment;
import com.xingdata.zzdpos.databinding.FragmentSettleVipBinding;
import com.xingdata.zzdpos.model.Vip;
import com.xingdata.zzdpos.ui.settle.SettleActivity;
import com.xingdata.zzdpos.ui.settle.SettlePresenter;
import com.xingdata.zzdpos.ui.settle.adapter.VipAdapter;
import java.util.List;
public class VipFragment extends BaseFragment<SettlePresenter, FragmentSettleVipBinding> {
private VipAdapter mVipAdapter;
@Override
public int getLayoutId() {
return R.layout.fragment_settle_vip;
}
@Override
public void initView() {
mVipAdapter = new VipAdapter();
mViewBinding.rlVip.setAdapter(mVipAdapter);
mViewBinding.rlVip.setLayoutManager(new LinearLayoutManager(mContext));
mVipAdapter.setOnItemClickListener((adapter, view, position) -> {
mPresenter.selectVip(mVipAdapter.getData().get(position));
this.pop();
});
mViewBinding.llNone.setOnClickListener(view -> {
mPresenter.selectVip(Vip.createDefault());
this.pop();
});
}
/**
* 加载会员信息
*
* @param vips 会员列表
*/
public void loadVips(List<Vip> vips) {
mVipAdapter.setNewData(vips);
}
@Override
public void onDestroyView() {
if (getActivity() instanceof SettleActivity) {
((SettleActivity) getActivity()).showTitleBarByTitleMode(C.TITLE_MODE.TEXT);
}
super.onDestroyView();
}
}
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/shape_blue_r2" android:state_enabled="true" />
<item android:drawable="@drawable/shape_gray_r2" android:state_enabled="false" />
</selector>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="@dimen/settle_btn_radius" />
<solid android:color="@color/blue_mawu" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="@dimen/all_shape_radius" />
<solid android:color="@color/gray_zhouyu" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="@dimen/settle_btn_radius" />
<solid android:color="@color/gray_huanggai" />
</shape>
\ No newline at end of file
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
android:background="@color/black_zhangfei"> android:background="@color/black_zhangfei">
<ImageButton <ImageButton
android:id="@+id/btn_back"
android:layout_width="@dimen/title_height" android:layout_width="@dimen/title_height"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="?attr/selectableItemBackground" android:background="?attr/selectableItemBackground"
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<layout> <layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
<data>
<variable
name="titleMode"
type="int" />
</data>
<LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical"> android:orientation="vertical">
<FrameLayout <android.support.constraint.ConstraintLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize" android:layout_height="?attr/actionBarSize"
android:background="@color/white_caocao"> android:background="@color/white_caocao">
<ImageButton <ImageButton
android:id="@+id/btn_back"
android:layout_width="@dimen/title_height" android:layout_width="@dimen/title_height"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="?attr/selectableItemBackground" android:background="?attr/selectableItemBackground"
android:contentDescription="@string/all_go_back" android:contentDescription="@string/all_go_back"
android:gravity="center" android:gravity="center"
android:padding="@dimen/all_margin" android:padding="@dimen/all_margin"
android:src="@mipmap/back_black" /> android:src="@mipmap/back_black"
app:layout_constraintLeft_toLeftOf="parent" />
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginEnd="@dimen/all_margin"
android:visibility="@{titleMode>1?0:8}"
app:layout_constraintBottom_toTopOf="parent"
app:layout_constraintLeft_toRightOf="@id/btn_back"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="parent">
<EditText
android:id="@+id/et_search"
style="@style/searchBarEditor"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:inputType="number"
android:textColor="@color/black_likui"
android:textColorHint="@color/gray_huanggai"
android:textSize="@dimen/all_text_size" />
</LinearLayout>
<TextView <TextView
android:layout_width="match_parent" android:id="@+id/tv_title"
android:layout_width="wrap_content"
android:layout_height="match_parent" android:layout_height="match_parent"
android:gravity="center" android:gravity="center"
android:text="@string/payment_title" android:text="@string/payment_title"
android:textColor="@color/black_baozheng" android:textColor="@color/black_baozheng"
android:textSize="@dimen/all_sub_title_size" /> android:textSize="@dimen/all_sub_title_size"
android:visibility="@{titleMode>1?8:0}"
app:layout_constraintLeft_toRightOf="parent"
app:layout_constraintRight_toLeftOf="parent" />
<View <View
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/all_line_width" android:layout_height="@dimen/all_line_width"
android:layout_gravity="bottom" android:layout_gravity="bottom"
android:background="@color/gray_huanggai" /> android:background="@color/gray_huanggai"
app:layout_constraintBottom_toBottomOf="parent" />
</FrameLayout> </android.support.constraint.ConstraintLayout>
<FrameLayout <FrameLayout
android:id="@+id/f_settle" android:id="@+id/f_settle"
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<layout> <layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <data>
xmlns:app="http://schemas.android.com/apk/res-auto"
<variable
name="titleMode"
type="int" />
</data>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<android.support.constraint.ConstraintLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="@color/white_caocao">
<ImageButton
android:id="@+id/btn_back"
android:layout_width="@dimen/title_height"
android:layout_height="match_parent" android:layout_height="match_parent"
android:animateLayoutChanges="true" android:background="?attr/selectableItemBackground"
android:gravity="center"> android:contentDescription="@string/all_go_back"
android:gravity="center"
android:padding="@dimen/all_margin"
android:src="@mipmap/back_black"
app:layout_constraintLeft_toLeftOf="parent" />
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginEnd="@dimen/all_margin"
android:visibility="@{titleMode>1?0:8}"
app:layout_constraintBottom_toTopOf="parent"
app:layout_constraintLeft_toRightOf="@id/btn_back"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="parent">
<com.github.ybq.android.spinkit.SpinKitView <EditText
android:id="@+id/skv_loading" android:id="@+id/et_search"
style="@style/SpinKitView.Circle" style="@style/searchBarEditor"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:labelFor="@+id/et_search"
android:textColor="@color/black_likui"
android:textColorHint="@color/gray_huanggai"
android:textSize="@dimen/all_text_size" />
</LinearLayout>
<TextView
android:id="@+id/tv_title"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="match_parent"
app:SpinKit_Color="@color/blue" /> android:gravity="center"
android:textColor="@color/black_baozheng"
android:textSize="@dimen/all_sub_title_size"
android:visibility="@{titleMode>1?8:0}"
app:layout_constraintLeft_toRightOf="parent"
app:layout_constraintRight_toLeftOf="parent" />
<View
android:layout_width="match_parent"
android:layout_height="@dimen/all_line_width"
android:layout_gravity="bottom"
android:background="@color/gray_huanggai"
app:layout_constraintBottom_toBottomOf="parent" />
</android.support.constraint.ConstraintLayout>
<ViewStub <ViewStub
android:id="@+id/vs_fragment" android:id="@+id/vs_fragment"
...@@ -23,4 +78,6 @@ ...@@ -23,4 +78,6 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:inflatedId="@+id/panel_import" /> android:inflatedId="@+id/panel_import" />
</LinearLayout> </LinearLayout>
</layout> </layout>
\ No newline at end of file
...@@ -48,6 +48,7 @@ ...@@ -48,6 +48,7 @@
<View <View
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/all_line_width" android:layout_height="@dimen/all_line_width"
android:layout_marginBottom="@dimen/all_margin"
android:layout_marginEnd="@dimen/all_spacing" android:layout_marginEnd="@dimen/all_spacing"
android:layout_marginStart="@dimen/all_spacing" android:layout_marginStart="@dimen/all_spacing"
android:layout_marginTop="@dimen/all_margin" android:layout_marginTop="@dimen/all_margin"
...@@ -61,7 +62,7 @@ ...@@ -61,7 +62,7 @@
android:paddingBottom="@dimen/all_spacing" android:paddingBottom="@dimen/all_spacing"
android:paddingEnd="@dimen/all_margin" android:paddingEnd="@dimen/all_margin"
android:paddingStart="@dimen/all_margin" android:paddingStart="@dimen/all_margin"
android:paddingTop="@dimen/all_margin"> android:visibility="@{payResult?0:8}">
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
...@@ -85,7 +86,8 @@ ...@@ -85,7 +86,8 @@
android:orientation="horizontal" android:orientation="horizontal"
android:paddingBottom="@dimen/all_spacing" android:paddingBottom="@dimen/all_spacing"
android:paddingEnd="@dimen/all_margin" android:paddingEnd="@dimen/all_margin"
android:paddingStart="@dimen/all_margin"> android:paddingStart="@dimen/all_margin"
android:visibility="@{payResult?0:8}">
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
......
...@@ -19,6 +19,24 @@ ...@@ -19,6 +19,24 @@
<variable <variable
name="disRate" name="disRate"
type="String" /> type="String" />
<variable
name="avlTicketNum"
type="int" />
<variable
name="usePoint"
type="boolean" />
<variable
name="pointVip"
type="int" />
<variable
name="pointAmt"
type="String" />
</data> </data>
<android.support.design.widget.CoordinatorLayout <android.support.design.widget.CoordinatorLayout
...@@ -39,7 +57,6 @@ ...@@ -39,7 +57,6 @@
<View <View
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/all_line_width" android:layout_height="@dimen/all_line_width"
android:layout_gravity="bottom"
android:layout_marginTop="@dimen/all_spacing" android:layout_marginTop="@dimen/all_spacing"
android:background="@color/gray_huanggai" /> android:background="@color/gray_huanggai" />
...@@ -66,13 +83,12 @@ ...@@ -66,13 +83,12 @@
<com.facebook.drawee.view.SimpleDraweeView <com.facebook.drawee.view.SimpleDraweeView
android:id="@+id/iv_level"
android:layout_width="@dimen/settle_vip_level" android:layout_width="@dimen/settle_vip_level"
android:layout_height="@dimen/settle_vip_level" android:layout_height="@dimen/settle_vip_level"
android:visibility="@{defualtVip ? 8 : 0}" android:visibility="@{defualtVip ? 8 : 0}"
app:backgroundImage="@color/red_guanyu"
app:layout_constraintBottom_toBottomOf="@id/iv_head" app:layout_constraintBottom_toBottomOf="@id/iv_head"
app:layout_constraintRight_toRightOf="@id/iv_head" app:layout_constraintRight_toRightOf="@id/iv_head"
app:placeholderImage="@mipmap/bindingcounter_addcounter_befor"
app:roundAsCircle="true" /> app:roundAsCircle="true" />
<LinearLayout <LinearLayout
...@@ -140,10 +156,182 @@ ...@@ -140,10 +156,182 @@
<View <View
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/all_line_width" android:layout_height="@dimen/all_line_width"
android:layout_gravity="bottom"
android:layout_marginBottom="@dimen/all_spacing" android:layout_marginBottom="@dimen/all_spacing"
android:background="@color/gray_huanggai" /> android:background="@color/gray_huanggai" />
<FrameLayout
android:id="@+id/f_saledetail"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="gone" />
<LinearLayout
android:id="@+id/ll_vip"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white_caocao"
android:orientation="vertical">
<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="@dimen/title_height"
android:gravity="center"
android:paddingEnd="@dimen/all_margin"
android:paddingStart="@dimen/all_margin">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/settle_auth_amt"
android:textColor="@color/black_baozheng"
android:textSize="@dimen/all_text_size" />
<TextView
android:id="@+id/tv_auth_amt"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="end"
android:textColor="@color/red_guanyu"
android:textSize="@dimen/all_sub_title_size"
android:textStyle="bold" />
</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_huanggai" />
<LinearLayout
android:id="@+id/ll_ticket"
android:layout_width="match_parent"
android:layout_height="@dimen/title_height"
android:foreground="?android:attr/selectableItemBackground"
android:gravity="center"
android:paddingEnd="@dimen/all_margin"
android:paddingStart="@dimen/all_margin">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/settle_ticket"
android:textColor="@color/black_baozheng"
android:textSize="@dimen/all_text_size" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/all_spacing"
android:background="@drawable/selector_r2"
android:enabled="@{avlTicketNum > 0}"
android:gravity="end"
android:paddingBottom="@dimen/all_shape_radius"
android:paddingEnd="@dimen/all_padding"
android:paddingStart="@dimen/all_padding"
android:paddingTop="@dimen/all_shape_radius"
android:text="@{avlTicketNum + @string/settle_ticket_text}"
android:textColor="@color/white"
android:textSize="@dimen/all_caption_size" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@string/settle_ticket"
android:src="@mipmap/drop_down" />
</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_huanggai" />
<LinearLayout
android:id="@+id/ll_point"
android:layout_width="match_parent"
android:layout_height="@dimen/title_height"
android:foreground="?android:attr/selectableItemBackground"
android:gravity="center"
android:paddingEnd="@dimen/all_margin"
android:paddingStart="@dimen/all_margin">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/settle_point"
android:textColor="@color/black_baozheng"
android:textSize="@dimen/all_text_size" />
<TextView
android:id="@+id/tv_point"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/all_spacing"
android:text="@{@string/settle_point_vip_text + pointVip + @string/settle_point_amt_text + pointAmt}"
android:textColor="@color/black_likui" />
<CheckBox
android:id="@+id/cb_point"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:button="@mipmap/but_elect02"
android:contentDescription="@string/settle_balance" />
</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_huanggai" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="@dimen/title_height"
android:gravity="center"
android:paddingEnd="@dimen/all_margin"
android:paddingStart="@dimen/all_margin">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/settle_balance"
android:textColor="@color/black_baozheng"
android:textSize="@dimen/all_text_size" />
<TextView
android:id="@+id/tv_balance"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="end"
android:text="¥40.0"
android:textColor="@color/black_baozheng"
android:textSize="@dimen/all_sub_title_size"
android:textStyle="bold" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="@dimen/all_line_width"
android:background="@color/gray_huanggai" />
</LinearLayout>
</LinearLayout> </LinearLayout>
</ScrollView> </ScrollView>
...@@ -159,7 +347,6 @@ ...@@ -159,7 +347,6 @@
<View <View
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/all_line_width" android:layout_height="@dimen/all_line_width"
android:layout_gravity="bottom"
android:background="@color/gray_huanggai" /> android:background="@color/gray_huanggai" />
<LinearLayout <LinearLayout
...@@ -173,7 +360,7 @@ ...@@ -173,7 +360,7 @@
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/settle_pay_amt" android:text="@string/settle_order_amt"
android:textColor="@color/black_baozheng" android:textColor="@color/black_baozheng"
android:textSize="@dimen/all_text_size" /> android:textSize="@dimen/all_text_size" />
...@@ -191,7 +378,8 @@ ...@@ -191,7 +378,8 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
android:textColor="@color/red_guanyu" android:textColor="@color/red_guanyu"
android:textSize="@dimen/all_sub_title_size" /> android:textSize="@dimen/all_sub_title_size"
android:textStyle="bold" />
<TextView <TextView
android:id="@+id/tv_settle" android:id="@+id/tv_settle"
...@@ -210,7 +398,6 @@ ...@@ -210,7 +398,6 @@
<View <View
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/all_line_width" android:layout_height="@dimen/all_line_width"
android:layout_gravity="bottom"
android:background="@color/gray_huanggai" /> android:background="@color/gray_huanggai" />
<android.support.v7.widget.RecyclerView <android.support.v7.widget.RecyclerView
......
<?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="match_parent"
android:background="@color/gray_zhouyu"
android:orientation="vertical">
<View
android:layout_width="match_parent"
android:layout_height="@dimen/all_line_width"
android:layout_gravity="bottom"
android:layout_marginTop="@dimen/all_spacing"
android:background="@color/gray_huanggai" />
<LinearLayout
android:id="@+id/ll_none"
android:layout_width="match_parent"
android:layout_height="@dimen/title_height"
android:background="@color/white_caocao"
android:foreground="?android:attr/selectableItemBackground"
android:gravity="center"
android:paddingEnd="@dimen/all_margin"
android:paddingStart="@dimen/all_margin">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/settle_vip_none"
android:textColor="@color/black_baozheng"
android:textSize="@dimen/all_text_size" />
<CheckBox
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:button="@mipmap/but_elect02" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="@dimen/all_line_width"
android:layout_marginBottom="@dimen/all_margin"
android:background="@color/gray_huanggai" />
<android.support.v7.widget.RecyclerView
android:id="@+id/rl_vip"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</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="name"
type="String" />
<variable
name="phone"
type="String" />
<variable
name="disRate"
type="String" />
</data>
<android.support.constraint.ConstraintLayout
android:id="@+id/cl_vip"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="@color/white_caocao"
android:foreground="?android:attr/selectableItemBackground">
<com.facebook.drawee.view.SimpleDraweeView
android:id="@+id/iv_head"
android:layout_width="@dimen/settle_vip_head"
android:layout_height="@dimen/settle_vip_head"
android:layout_marginStart="@dimen/all_margin"
app:backgroundImage="@color/white_caocao"
app:layout_constraintBottom_toTopOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="parent"
app:placeholderImage="@mipmap/icon_menu_service_1"
app:roundAsCircle="true"
app:roundingBorderColor="@color/gray_huanggai"
app:roundingBorderWidth="@dimen/all_line_width" />
<com.facebook.drawee.view.SimpleDraweeView
android:id="@+id/iv_level"
android:layout_width="@dimen/settle_vip_level"
android:layout_height="@dimen/settle_vip_level"
app:layout_constraintBottom_toBottomOf="@id/iv_head"
app:layout_constraintRight_toRightOf="@id/iv_head"
app:roundAsCircle="true" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/all_margin"
android:orientation="vertical"
app:layout_constraintBottom_toTopOf="parent"
app:layout_constraintLeft_toRightOf="@id/iv_head"
app:layout_constraintTop_toBottomOf="parent">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@{name}"
android:textColor="@color/black_zhangfei"
android:textSize="@dimen/all_text_size" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@{phone}"
android:textColor="@color/black_likui"
android:textSize="@dimen/all_caption_size" />
</LinearLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/all_spacing"
android:text="@{@string/settle_vip_dis_rate_hint + disRate + @string/settle_vip_dis_rate}"
android:textColor="@color/black_zhangfei"
android:textSize="@dimen/all_caption_size"
app:layout_constraintBottom_toTopOf="parent"
app:layout_constraintRight_toLeftOf="@id/cb_point"
app:layout_constraintTop_toBottomOf="parent" />
<CheckBox
android:id="@+id/cb_point"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/all_margin"
android:button="@mipmap/but_elect02"
android:contentDescription="@string/settle_balance"
app:layout_constraintBottom_toTopOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="parent" />
</android.support.constraint.ConstraintLayout>
</layout>
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<color name="colorPrimary">@color/store_product_bg</color> <color name="colorPrimary">@color/gray_zhouyu</color>
<color name="colorPrimaryDark">@color/title</color> <color name="colorPrimaryDark">@color/gray_huanggai</color>
<color name="colorAccent">@color/blue</color> <color name="colorAccent">@color/red_guanyu</color>
<color name="appBack">#233142</color> <color name="appBack">#233142</color>
<color name="white">#ffffff</color> <color name="white">#ffffff</color>
<color name="green_L5">#009944</color> <color name="green_L5">#009944</color>
...@@ -122,6 +122,7 @@ ...@@ -122,6 +122,7 @@
<color name="red_guanyu">#b4282d</color> <color name="red_guanyu">#b4282d</color>
<color name="red_xishi">#e57b7b</color> <color name="red_xishi">#e57b7b</color>
<color name="red_diaochan">#ff8964</color> <color name="red_diaochan">#ff8964</color>
<color name="red_lvzhi">#a22929</color>
<color name="gray_zhouyu">#f1f3f7</color> <color name="gray_zhouyu">#f1f3f7</color>
<color name="gray_huanggai">#afb9c3</color> <color name="gray_huanggai">#afb9c3</color>
......
...@@ -504,6 +504,7 @@ ...@@ -504,6 +504,7 @@
<string name="settle_pay_amt">实收金额</string> <string name="settle_pay_amt">实收金额</string>
<string name="settle_pay_change">找零金额</string> <string name="settle_pay_change">找零金额</string>
<string name="settle_pay_result">支付结果</string> <string name="settle_pay_result">支付结果</string>
<string name="settle_pay_result_title">支付完成</string>
<string name="settle_pay_succ">支付成功</string> <string name="settle_pay_succ">支付成功</string>
<string name="settle_pay_fail">支付失败</string> <string name="settle_pay_fail">支付失败</string>
<string name="settle_pay_time">交易时间</string> <string name="settle_pay_time">交易时间</string>
...@@ -512,6 +513,19 @@ ...@@ -512,6 +513,19 @@
<string name="settle_pay_order_amt">合计金额</string> <string name="settle_pay_order_amt">合计金额</string>
<string name="settle_retry">重新支付</string> <string name="settle_retry">重新支付</string>
<string name="settle_complete">完成</string> <string name="settle_complete">完成</string>
<string name="settle_auth_amt">总计</string>
<string name="settle_ticket">优惠券</string>
<string name="settle_ticket_text">张可用</string>
<string name="settle_point">积分抵扣</string>
<string name="settle_point_vip_text">可用积分</string>
<string name="settle_point_amt_text"> , 可抵用</string>
<string name="settle_balance">账户余额</string>
<!--支付里的Vip-->
<string name="settle_vip_search_hint">请输入会员手机号</string>
<string name="settle_vip_none">不需要会员</string>
<!--帮助POS--> <!--帮助POS-->
<string name="help_hint">帮助</string> <string name="help_hint">帮助</string>
<string name="help_phone">400–800–9406</string> <string name="help_phone">400–800–9406</string>
......
...@@ -357,4 +357,15 @@ ...@@ -357,4 +357,15 @@
<item name="android:textSize">@dimen/all_text_size_small</item> <item name="android:textSize">@dimen/all_text_size_small</item>
<item name="android:textColor">@color/black_baozheng</item> <item name="android:textColor">@color/black_baozheng</item>
</style> </style>
<style name="searchBarEditor">
<item name="android:drawableStart">@mipmap/ic_search</item>
<item name="android:drawablePadding">@dimen/all_spacing</item>
<item name="android:maxLines">1</item>
<item name="android:maxLength">20</item>
<item name="android:background">@drawable/shape_gray_r1</item>
<item name="android:padding">@dimen/all_spacing</item>
<item name="android:imeOptions">actionSearch</item>
</style>
</resources> </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