Commit 6018a9db authored by zhang_z's avatar zhang_z

Merge remote-tracking branch 'origin/master'

parents 4eb532b8 c4b2740c
...@@ -11,6 +11,7 @@ import android.widget.EditText; ...@@ -11,6 +11,7 @@ import android.widget.EditText;
import android.widget.Toast; import android.widget.Toast;
import com.blankj.utilcode.util.ActivityUtils; import com.blankj.utilcode.util.ActivityUtils;
import com.xingdata.api.print.ZX_PrintPOS;
import com.xingdata.zzdpos.R; import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseActivity; import com.xingdata.zzdpos.base.BaseActivity;
import com.xingdata.zzdpos.base.BaseFragment; import com.xingdata.zzdpos.base.BaseFragment;
...@@ -209,4 +210,9 @@ public class MainActivity extends BaseActivity<MainPresenter, ActivityMainBindin ...@@ -209,4 +210,9 @@ public class MainActivity extends BaseActivity<MainPresenter, ActivityMainBindin
} }
@Override
protected void onDestroy() {
ZX_PrintPOS.getInstance(this).Destory();
super.onDestroy();
}
} }
...@@ -237,7 +237,6 @@ public class BaleIndexFragment extends BaseFragment<BalePresenter, FragmentBaleI ...@@ -237,7 +237,6 @@ public class BaleIndexFragment extends BaseFragment<BalePresenter, FragmentBaleI
private View getEmptyView(int resHint) { private View getEmptyView(int resHint) {
View view = getLayoutInflater().inflate(R.layout.view_empty, null); View view = getLayoutInflater().inflate(R.layout.view_empty, null);
view.setBackgroundResource(R.color.gray_zhouyu);
((TextView) view.findViewById(R.id.tv_empty)).setText(resHint); ((TextView) view.findViewById(R.id.tv_empty)).setText(resHint);
return view; return view;
} }
......
...@@ -50,6 +50,11 @@ public class UserActivity extends BaseActivity<UserPresenter, ActivityUserBindin ...@@ -50,6 +50,11 @@ public class UserActivity extends BaseActivity<UserPresenter, ActivityUserBindin
mPresenter.userListFragment.delUserSus(); mPresenter.userListFragment.delUserSus();
} }
@Override
public void searchOperSus(Pager<Oper> operPager) {
mPresenter.userListSearchFragment.searchOperSus(operPager);
}
@Override @Override
public boolean dispatchTouchEvent(MotionEvent ev) { public boolean dispatchTouchEvent(MotionEvent ev) {
Global.clickHideKeyboard(ev, this); Global.clickHideKeyboard(ev, this);
......
...@@ -25,6 +25,7 @@ public interface UserContract { ...@@ -25,6 +25,7 @@ public interface UserContract {
void addSusSus(Oper oper); void addSusSus(Oper oper);
void updateUserSus(Oper oper); void updateUserSus(Oper oper);
void delUserSus(); void delUserSus();
void searchOperSus(Pager<Oper> operPager);
} }
abstract class Presenter extends BasePresenter<View> { abstract class Presenter extends BasePresenter<View> {
...@@ -33,6 +34,5 @@ public interface UserContract { ...@@ -33,6 +34,5 @@ public interface UserContract {
public abstract void querySta(); public abstract void querySta();
public abstract void updateUser(Oper oper); public abstract void updateUser(Oper oper);
public abstract void delUser(Oper oper); public abstract void delUser(Oper oper);
public abstract void queryUser(String wd);
} }
} }
\ No newline at end of file
...@@ -8,6 +8,7 @@ import com.xingdata.zzdpos.ui.manage.user.dialog.UserMenuDialog; ...@@ -8,6 +8,7 @@ import com.xingdata.zzdpos.ui.manage.user.dialog.UserMenuDialog;
import com.xingdata.zzdpos.ui.manage.user.fragment.UserInfoEditFragment; import com.xingdata.zzdpos.ui.manage.user.fragment.UserInfoEditFragment;
import com.xingdata.zzdpos.ui.manage.user.fragment.UserInfoFragment; import com.xingdata.zzdpos.ui.manage.user.fragment.UserInfoFragment;
import com.xingdata.zzdpos.ui.manage.user.fragment.UserListFragment; import com.xingdata.zzdpos.ui.manage.user.fragment.UserListFragment;
import com.xingdata.zzdpos.ui.manage.user.fragment.UserListSearchFragment;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Iterator; import java.util.Iterator;
...@@ -21,6 +22,7 @@ public class UserPresenter extends UserContract.Presenter { ...@@ -21,6 +22,7 @@ public class UserPresenter extends UserContract.Presenter {
public UserInfoFragment userInfoFragment = new UserInfoFragment(); public UserInfoFragment userInfoFragment = new UserInfoFragment();
public LinkedHashMap<String, String> operLevel = new LinkedHashMap<>();//用户级别 1 员工 2主管 3 店长 9老板 public LinkedHashMap<String, String> operLevel = new LinkedHashMap<>();//用户级别 1 员工 2主管 3 店长 9老板
public UserMenuDialog userMenuDialog = new UserMenuDialog(); public UserMenuDialog userMenuDialog = new UserMenuDialog();
public UserListSearchFragment userListSearchFragment = new UserListSearchFragment();
@Override @Override
public void onAttached() { public void onAttached() {
...@@ -50,7 +52,12 @@ public class UserPresenter extends UserContract.Presenter { ...@@ -50,7 +52,12 @@ public class UserPresenter extends UserContract.Presenter {
@Override @Override
public void getUserList(String wd) { public void getUserList(String wd) {
ApiFactory.Oper.queryOper(wd).subscribe(operPager -> { ApiFactory.Oper.queryOper(wd).subscribe(operPager -> {
if (wd==null){
mView.queryOperSus(operPager); mView.queryOperSus(operPager);
}else {
mView.searchOperSus(operPager);
}
}, throwable -> { }, throwable -> {
ToastUtils.showShort(throwable.getMessage()); ToastUtils.showShort(throwable.getMessage());
}); });
...@@ -92,14 +99,14 @@ public class UserPresenter extends UserContract.Presenter { ...@@ -92,14 +99,14 @@ public class UserPresenter extends UserContract.Presenter {
}); });
} }
@Override // @Override
public void queryUser(String wd) { // public void queryUser(String wd) {
ApiFactory.Oper.queryOper(wd).subscribe(operPager -> { // ApiFactory.Oper.queryOper(wd).subscribe(operPager -> {
mView.queryOperSus(operPager); // mView.queryOperSus(operPager);
}, throwable -> { // }, throwable -> {
ToastUtils.showShort(throwable.getMessage()); // ToastUtils.showShort(throwable.getMessage());
}); // });
} // }
public List<String> getOperLevelList() { public List<String> getOperLevelList() {
......
...@@ -37,7 +37,7 @@ public class UserListFragment extends BaseFragment<UserPresenter, FragmentUserLi ...@@ -37,7 +37,7 @@ public class UserListFragment extends BaseFragment<UserPresenter, FragmentUserLi
@Override @Override
public void initView() { public void initView() {
adapter = new UserListAdapter(getActivity(), opers,mPresenter); adapter = new UserListAdapter(getActivity(), opers, mPresenter);
mViewBinding.userRefresh.setOnRefreshListener(this::onRefresh); mViewBinding.userRefresh.setOnRefreshListener(this::onRefresh);
mViewBinding.userRecyclerView.setLayoutManager(new LinearLayoutManager(getActivity())); mViewBinding.userRecyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
mViewBinding.userRecyclerView.setAdapter(adapter); mViewBinding.userRecyclerView.setAdapter(adapter);
...@@ -48,6 +48,7 @@ public class UserListFragment extends BaseFragment<UserPresenter, FragmentUserLi ...@@ -48,6 +48,7 @@ public class UserListFragment extends BaseFragment<UserPresenter, FragmentUserLi
adapter.setOnLoadMoreListener(this::onLoadMore, mViewBinding.userRecyclerView); adapter.setOnLoadMoreListener(this::onLoadMore, mViewBinding.userRecyclerView);
adapter.setEnableLoadMore(false); adapter.setEnableLoadMore(false);
mViewBinding.titleLayout.tvTitle.setText("店员管理"); mViewBinding.titleLayout.tvTitle.setText("店员管理");
mViewBinding.searchLayout.serchEditText.setHint("请输入手机号或者店员名称");
mViewBinding.titleLayout.setOnClickListener(new OnClickListener() { mViewBinding.titleLayout.setOnClickListener(new OnClickListener() {
@Override @Override
protected void myOnClickListener(View v) { protected void myOnClickListener(View v) {
...@@ -60,18 +61,21 @@ public class UserListFragment extends BaseFragment<UserPresenter, FragmentUserLi ...@@ -60,18 +61,21 @@ public class UserListFragment extends BaseFragment<UserPresenter, FragmentUserLi
mPresenter.userInfoEditFragment.setOper(null); mPresenter.userInfoEditFragment.setOper(null);
start(mPresenter.userInfoEditFragment); start(mPresenter.userInfoEditFragment);
break; break;
case R.id.userSearch: // case R.id.userSearch:
if(mViewBinding.userSearch.getText().toString().length()==0){ // if(mViewBinding.userSearch.getText().toString().length()==0){
ToastUtils.showShort("搜索条件不能为空"); // ToastUtils.showShort("搜索条件不能为空");
return; // return;
} // }
mPresenter.queryUser( mViewBinding.searchLayout.serchEditText.getText().toString().trim()); //
break; // break;
// case R.id.onBack: // case R.id.onBack:
// getActivity().finish(); // getActivity().finish();
// break; // break;
} }
}); });
mViewBinding.searchLayout.serchEditText.setOnClickListener(view -> {
start( mPresenter.userListSearchFragment);
});
onRefresh(); onRefresh();
} }
......
package com.xingdata.zzdpos.ui.manage.user.fragment;
/**
* Created by JM_DEV on 2017/12/21.
*/
import android.support.v7.widget.LinearLayoutManager;
import android.view.View;
import android.view.inputmethod.EditorInfo;
import com.blankj.utilcode.util.ToastUtils;
import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseFragment;
import com.xingdata.zzdpos.databinding.FragmentUserListBinding;
import com.xingdata.zzdpos.databinding.FragmentUserSearchListBinding;
import com.xingdata.zzdpos.model.Level;
import com.xingdata.zzdpos.model.Oper;
import com.xingdata.zzdpos.model.Pager;
import com.xingdata.zzdpos.model.Sta;
import com.xingdata.zzdpos.ui.manage.user.UserPresenter;
import com.xingdata.zzdpos.ui.manage.user.adapter.UserListAdapter;
import com.xingdata.zzdpos.util.OnClickListener;
import java.util.ArrayList;
import java.util.List;
/**
* 店员管理界面
*/
public class UserListSearchFragment extends BaseFragment<UserPresenter, FragmentUserSearchListBinding> {
private UserListAdapter adapter;
private List<Oper> opers = new ArrayList<>();
@Override
public int getLayoutId() {
return R.layout.fragment_user_search_list;
}
@Override
public void initView() {
adapter = new UserListAdapter(getActivity(), opers, mPresenter);
mViewBinding.userRefresh.setOnRefreshListener(this::onRefresh);
mViewBinding.userRecyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
mViewBinding.userRecyclerView.setAdapter(adapter);
adapter.setOnItemClickListener((adapter, view, position) -> {
mPresenter.userInfoFragment.setOper((Oper) adapter.getData().get(position));
start(mPresenter.userInfoFragment);
});
adapter.setOnLoadMoreListener(this::onLoadMore, mViewBinding.userRecyclerView);
adapter.setEnableLoadMore(false);
mViewBinding.vipSearch.requestFocus();
mViewBinding.vipSearch.setOnEditorActionListener((textView, i, keyEvent) -> {
if (EditorInfo.IME_ACTION_SEARCH == i) {
if (textView.getText().toString().trim().length() == 0) {
ToastUtils.showShort("搜索条件不能");
return true;
}
mPresenter.getUserList(textView.getText().toString().trim());
}
return false;
});
mViewBinding.ivBack.setOnClickListener(view -> {
pop();
});
onRefresh();
}
private void onLoadMore() {
}
public void onRefresh() {
mPresenter.getUserList(null);
mPresenter.querySta();
}
public void searchOperSus(Pager<Oper> operPager) {
adapter.setNewData(operPager.getList());
adapter.setEnableLoadMore(false);
adapter.loadMoreComplete();
mViewBinding.userRefresh.setRefreshing(false);
if (operPager.getTotalPage() == 0) {
ToastUtils.showShort("沒有搜索到店员信息");
}
}
@Override
public void onResume() {
super.onResume();
mViewBinding.vipSearch.setText("");
}
}
...@@ -74,7 +74,7 @@ public class TickerIndexFragment extends BaseFragment<ReturnTicketPresenter, ...@@ -74,7 +74,7 @@ public class TickerIndexFragment extends BaseFragment<ReturnTicketPresenter,
if (trulePager == null || trulePager.getList() == null || trulePager.getList().size() <= if (trulePager == null || trulePager.getList() == null || trulePager.getList().size() <=
0) { 0) {
// mViewBinding.tvEmpty.setVisibility(View.VISIBLE); // mViewBinding.tvEmpty.setVisibility(View.VISIBLE);
returnTicketAdapter.setEmptyView(getEmptyView("没有积分规则~")); returnTicketAdapter.setEmptyView(getEmptyView("没有优惠券~"));
} }
if (trulePager != null && trulePager.getList() != null) { if (trulePager != null && trulePager.getList() != null) {
mViewBinding.tvEmpty.setVisibility(View.GONE); mViewBinding.tvEmpty.setVisibility(View.GONE);
......
...@@ -277,7 +277,7 @@ public class StatisticsDetailActivity extends BaseActivity<StatisticsDetailPrese ...@@ -277,7 +277,7 @@ public class StatisticsDetailActivity extends BaseActivity<StatisticsDetailPrese
@Override @Override
protected void myOnClickListener(View v) { protected void myOnClickListener(View v) {
try { try {
ZX_PrintPOS.getInstance(StatisticsDetailActivity.this).print(1, mSaleorder); ZX_PrintPOS.getInstance(MainActivity.mainActivity).print(1, mSaleorder);
} catch (Exception e) { } catch (Exception e) {
ToastUtils.showShort("打印异常"); ToastUtils.showShort("打印异常");
} }
......
...@@ -100,7 +100,7 @@ public class VipActivity extends BaseActivity<VipPresenter, ActivityVipBinding> ...@@ -100,7 +100,7 @@ public class VipActivity extends BaseActivity<VipPresenter, ActivityVipBinding>
@Override @Override
public void rechangeSus(Vip v) { public void rechangeSus(Vip v) {
ViewTools.toastSuss(this, "充值成功"); ViewTools.toastSuss(this, "充值成功");
mPresenter.vipRechargeFragment.pop(); popTo(mPresenter.vipListFragment.getClass(),false);
mPresenter.vipListFragment.onRefresh(); mPresenter.vipListFragment.onRefresh();
} }
......
...@@ -17,6 +17,7 @@ import com.xingdata.zzdpos.model.Level; ...@@ -17,6 +17,7 @@ import com.xingdata.zzdpos.model.Level;
import com.xingdata.zzdpos.model.Mscard; import com.xingdata.zzdpos.model.Mscard;
import com.xingdata.zzdpos.model.Vip; import com.xingdata.zzdpos.model.Vip;
import com.xingdata.zzdpos.model.VipRechargeOrder; import com.xingdata.zzdpos.model.VipRechargeOrder;
import com.xingdata.zzdpos.ui.main.MainActivity;
import com.xingdata.zzdpos.ui.vip.fragment.VipAddSucceedFragment; import com.xingdata.zzdpos.ui.vip.fragment.VipAddSucceedFragment;
import com.xingdata.zzdpos.ui.vip.fragment.VipExpenseListFragment; import com.xingdata.zzdpos.ui.vip.fragment.VipExpenseListFragment;
import com.xingdata.zzdpos.ui.vip.fragment.VipInfoEditFragment; import com.xingdata.zzdpos.ui.vip.fragment.VipInfoEditFragment;
...@@ -39,7 +40,7 @@ public class VipPresenter extends VipContract.Presenter { ...@@ -39,7 +40,7 @@ public class VipPresenter extends VipContract.Presenter {
public VipTruleListFragment vipMscardListFragment = new VipTruleListFragment(); public VipTruleListFragment vipMscardListFragment = new VipTruleListFragment();
public VipSearchFragment vipSearchFragment = new VipSearchFragment(); public VipSearchFragment vipSearchFragment = new VipSearchFragment();
public VipRechargeFragment vipRechargeFragment = new VipRechargeFragment(); public VipRechargeFragment vipRechargeFragment = new VipRechargeFragment();
public VipAddSucceedFragment vipAddSucceedFragment =new VipAddSucceedFragment(); public VipAddSucceedFragment vipAddSucceedFragment = new VipAddSucceedFragment();
public ArrayList<Level> levels = new ArrayList<>(); public ArrayList<Level> levels = new ArrayList<>();
@Override @Override
...@@ -78,10 +79,9 @@ public class VipPresenter extends VipContract.Presenter { ...@@ -78,10 +79,9 @@ public class VipPresenter extends VipContract.Presenter {
} }
@Override @Override
public void addVip(Vip vip) { public void addVip(Vip vip) {
int vipDis= vip.getVipDefDiscount(); int vipDis = vip.getVipDefDiscount();
if (vip.getVipId() == null) { if (vip.getVipId() == null) {
ApiFactory.User.addVip(vip).subscribe(mVip -> { ApiFactory.User.addVip(vip).subscribe(mVip -> {
mVip.setVipLevelName(vip.getVipLevelName()); mVip.setVipLevelName(vip.getVipLevelName());
...@@ -210,7 +210,7 @@ public class VipPresenter extends VipContract.Presenter { ...@@ -210,7 +210,7 @@ public class VipPresenter extends VipContract.Presenter {
mVipRechangeOrdervip.setRechangeBefore(vipOld.getAcctCbal()); mVipRechangeOrdervip.setRechangeBefore(vipOld.getAcctCbal());
mVipRechangeOrdervip.setRechangeAfter(vip.getAcctCbal()); mVipRechangeOrdervip.setRechangeAfter(vip.getAcctCbal());
try { try {
ZX_PrintPOS.getInstance(App.instance).printSave(1, mVipRechangeOrdervip); ZX_PrintPOS.getInstance(MainActivity.mainActivity).printSave(1, mVipRechangeOrdervip);
} catch (Exception e) { } catch (Exception e) {
ToastUtils.showShort("打印异常"); ToastUtils.showShort("打印异常");
} }
......
...@@ -38,21 +38,23 @@ public class VipAddSucceedFragment extends BaseFragment<VipPresenter, FragmentVi ...@@ -38,21 +38,23 @@ public class VipAddSucceedFragment extends BaseFragment<VipPresenter, FragmentVi
//继续添加 //继续添加
mViewBinding.vipAdd.setOnClickListener(view -> { mViewBinding.vipAdd.setOnClickListener(view -> {
mPresenter.vipInfoEditFragment.setVip(null); mPresenter.vipInfoEditFragment.setVip(null);
startWithPop(mPresenter.vipInfoEditFragment); popTo(mPresenter.vipInfoEditFragment.getClass(),false);
// start(mPresenter.vipInfoEditFragment);
}); });
//充值 //充值
mViewBinding.vipRecharge.setOnClickListener(view -> { mViewBinding.vipRecharge.setOnClickListener(view -> {
mPresenter.vipRechargeFragment.setVip(mVip); mPresenter.vipRechargeFragment.setVip(mVip);
startWithPop(mPresenter.vipRechargeFragment); start(mPresenter.vipRechargeFragment);
}); });
mViewBinding.vipSure.setOnClickListener(view -> { mViewBinding.vipSure.setOnClickListener(view -> {
mPresenter.vipListFragment.updateVipSus(null); mPresenter.vipListFragment.updateVipSus(null);
}); });
//返回强制出堆栈
mViewBinding.infoTitle.ivBack.setOnClickListener(view -> { mViewBinding.infoTitle.ivBack.setOnClickListener(view -> {
pop(); popTo(mPresenter.vipListFragment.getClass(),false);
}); });
} }
......
...@@ -235,7 +235,7 @@ public class VipListFragment extends BaseFragment<VipPresenter, FragmentVipListB ...@@ -235,7 +235,7 @@ public class VipListFragment extends BaseFragment<VipPresenter, FragmentVipListB
vipListAdapter.notifyDataSetChanged(); vipListAdapter.notifyDataSetChanged();
pageNumber = 0; pageNumber = 0;
// ToastUtils.showShort("没有更多数据"); // ToastUtils.showShort("没有更多数据");
return; // return;
} }
vipListAdapter.addData(vipPager.getList()); vipListAdapter.addData(vipPager.getList());
pageNumber = vipPager.getPageNumber() + 1; pageNumber = vipPager.getPageNumber() + 1;
......
...@@ -57,14 +57,15 @@ public class VipRechargeFragment extends BaseFragment<VipPresenter, FragmentVipR ...@@ -57,14 +57,15 @@ public class VipRechargeFragment extends BaseFragment<VipPresenter, FragmentVipR
@Override @Override
public void initView() { public void initView() {
setMoney("0","0"); setMoney("0", "0");
mViewBinding.infoTitle.popMenu.setVisibility(View.GONE); mViewBinding.infoTitle.popMenu.setVisibility(View.GONE);
mViewBinding.vipMobile.setText(String.valueOf(mVip.getVipMobile())); mViewBinding.vipMobile.setText(String.valueOf(mVip.getVipMobile()));
mViewBinding.vipName.setText(String.valueOf(mVip.getVipName())); mViewBinding.vipName.setText(String.valueOf(mVip.getVipName()));
mViewBinding.infoTitle.tvTitle.setText("充值"); mViewBinding.infoTitle.tvTitle.setText("充值");
mViewBinding.vipBalance.setText(getString(R.string.vip_balance_text, ConvertUtil.fenToYuan2(mVip.getAcctCbal()))); mViewBinding.vipBalance.setText(getString(R.string.vip_balance_text, ConvertUtil.fenToYuan2(mVip.getAcctCbal())));
mViewBinding.infoTitle.ivBack.setOnClickListener(view -> { mViewBinding.infoTitle.ivBack.setOnClickListener(view -> {
pop(); // pop();
popTo(mPresenter.vipListFragment.getClass(), false);
}); });
mPresenter.getMscardList(mVip.getVipId()); mPresenter.getMscardList(mVip.getVipId());
mPayAdapter = new PayAdapter(); mPayAdapter = new PayAdapter();
...@@ -102,18 +103,16 @@ public class VipRechargeFragment extends BaseFragment<VipPresenter, FragmentVipR ...@@ -102,18 +103,16 @@ public class VipRechargeFragment extends BaseFragment<VipPresenter, FragmentVipR
}); });
} }
@Override @Override
public boolean onBackPressedSupport() { public boolean onBackPressedSupport() {
pop(); popTo(mPresenter.vipListFragment.getClass(), false);
return true; return true;
} }
public void setVip(Vip mVip) { public void setVip(Vip mVip) {
this.mVip = mVip; this.mVip = mVip;
} }
...@@ -124,8 +123,7 @@ public class VipRechargeFragment extends BaseFragment<VipPresenter, FragmentVipR ...@@ -124,8 +123,7 @@ public class VipRechargeFragment extends BaseFragment<VipPresenter, FragmentVipR
mscards.clear(); mscards.clear();
mscards.addAll(mscardPager.getList()); mscards.addAll(mscardPager.getList());
layoutParams = new LinearLayout.LayoutParams(inWight / 3, LinearLayout.LayoutParams.MATCH_PARENT, 1);
layoutParams = new LinearLayout.LayoutParams(inWight/3, LinearLayout.LayoutParams.MATCH_PARENT, 1);
layoutParams.setMargins(0, 0, 20, 0); layoutParams.setMargins(0, 0, 20, 0);
int mscardLength = 0; int mscardLength = 0;
if (mscards.size() <= 3) { if (mscards.size() <= 3) {
...@@ -141,6 +139,9 @@ public class VipRechargeFragment extends BaseFragment<VipPresenter, FragmentVipR ...@@ -141,6 +139,9 @@ public class VipRechargeFragment extends BaseFragment<VipPresenter, FragmentVipR
mViewBinding.payMoneyLayout.addView(radioButton); mViewBinding.payMoneyLayout.addView(radioButton);
} }
if (mViewBinding.payMoneyLayout.getChildCount() != 0) {
mViewBinding.payMoneyLayout.setVisibility(View.VISIBLE);
}
String hintStr = "自定义金额"; String hintStr = "自定义金额";
SpannableString ss = new SpannableString(hintStr); SpannableString ss = new SpannableString(hintStr);
...@@ -157,10 +158,12 @@ public class VipRechargeFragment extends BaseFragment<VipPresenter, FragmentVipR ...@@ -157,10 +158,12 @@ public class VipRechargeFragment extends BaseFragment<VipPresenter, FragmentVipR
} }
}); });
//输入监听 //输入监听
mViewBinding.stealMoney.addTextChangedListener(new TextWatcher() { mViewBinding.stealMoney.addTextChangedListener(new TextWatcher() {
@Override @Override
public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) { public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {
} }
@Override @Override
...@@ -169,8 +172,11 @@ public class VipRechargeFragment extends BaseFragment<VipPresenter, FragmentVipR ...@@ -169,8 +172,11 @@ public class VipRechargeFragment extends BaseFragment<VipPresenter, FragmentVipR
@Override @Override
public void afterTextChanged(Editable editable) { public void afterTextChanged(Editable editable) {
if (mViewBinding.stealMoney.getText().length() == 0){ if (!mViewBinding.stealMoney.hasFocus()){
setMoney("0","0"); return;
}
if (mViewBinding.stealMoney.getText().length() == 0 ) {
setMoney("0", "0");
return; return;
} }
...@@ -197,9 +203,9 @@ public class VipRechargeFragment extends BaseFragment<VipPresenter, FragmentVipR ...@@ -197,9 +203,9 @@ public class VipRechargeFragment extends BaseFragment<VipPresenter, FragmentVipR
*/ */
private void setMoney(String rechangeMoney, String sendMoney) { private void setMoney(String rechangeMoney, String sendMoney) {
mViewBinding.sendAmt.setText(sendMoney); mViewBinding.sendAmt.setText(sendMoney);
mViewBinding.rechargAMT.setText(rechangeMoney);
// mViewBinding.rechangeMoney.setText(rechangeMoney); // mViewBinding.rechangeMoney.setText(rechangeMoney);
mViewBinding.recargeAccount.setText(ConvertUtil.fenToYuan2(ConvertUtil.yuanToFen(sendMoney) + ConvertUtil.yuanToFen(rechangeMoney))); mViewBinding.recargeAccount.setText(ConvertUtil.fenToYuan2(ConvertUtil.yuanToFen(sendMoney) + ConvertUtil.yuanToFen(rechangeMoney)));
mViewBinding.rechargAMT.setText(rechangeMoney);
} }
......
...@@ -211,8 +211,9 @@ ...@@ -211,8 +211,9 @@
android:id="@+id/srl_products" android:id="@+id/srl_products"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="@color/gray_zhouyu" android:layout_marginLeft="@dimen/all_padding"
android:padding="@dimen/all_padding"> android:layout_marginRight="@dimen/all_padding"
android:layout_marginTop="@dimen/all_padding">
<android.support.v7.widget.RecyclerView <android.support.v7.widget.RecyclerView
android:id="@+id/rc_bale_shop" android:id="@+id/rc_bale_shop"
......
...@@ -250,8 +250,6 @@ ...@@ -250,8 +250,6 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="0dp" android:layout_height="0dp"
android:layout_weight="9" android:layout_weight="9"
android:paddingLeft="@dimen/all_padding"
android:paddingRight="@dimen/all_padding"
android:visibility="visible"/> android:visibility="visible"/>
</LinearLayout> </LinearLayout>
......
...@@ -13,15 +13,23 @@ ...@@ -13,15 +13,23 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical"> android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal">
<include <include
android:id="@+id/title_layout" android:id="@+id/title_layout"
layout="@layout/title" /> layout="@layout/title" />
</LinearLayout>
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize" android:layout_height="?attr/actionBarSize"
android:gravity="center_vertical"
android:background="@drawable/up_down_line_white_bottom" android:background="@drawable/up_down_line_white_bottom"
android:gravity="center_vertical"
android:orientation="horizontal"> android:orientation="horizontal">
<include <include
...@@ -30,6 +38,7 @@ ...@@ -30,6 +38,7 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="1" /> android:layout_weight="1" />
<TextView <TextView
android:id="@+id/userSearch" android:id="@+id/userSearch"
style="@style/textView_body_small" style="@style/textView_body_small"
......
<?xml version="1.0" encoding="utf-8"?>
<layout>
<data>
<variable
name="onClickListener"
type="android.view.View.OnClickListener" />
</data>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="@drawable/up_down_line_white_bottom"
android:gravity="center_vertical"
android:orientation="horizontal">
<ImageView
android:id="@+id/iv_back"
android:layout_width="wrap_content"
android:padding="@dimen/all_margin"
android:layout_height="wrap_content"
android:background="@mipmap/go_back" />
<EditText
android:id="@+id/vip_search"
style="@style/searchBarEditor"
android:layout_width="0dp"
android:imeOptions="actionSearch"
android:hint="请输入手机或者店员名称"
android:layout_weight="1"
android:inputType="text"
android:labelFor="@+id/et_search" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="@dimen/all_margin_left"
android:layout_weight="1"
android:orientation="horizontal">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1">
<android.support.v4.widget.SwipeRefreshLayout
android:id="@+id/user_refresh"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v7.widget.RecyclerView
android:id="@+id/userRecyclerView"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</android.support.v4.widget.SwipeRefreshLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</layout>
\ No newline at end of file
...@@ -139,7 +139,7 @@ ...@@ -139,7 +139,7 @@
style="@style/default_blacktext_bigstyle" style="@style/default_blacktext_bigstyle"
android:layout_width="90dp" android:layout_width="90dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="级标准" /> android:text="级标准" />
</LinearLayout> </LinearLayout>
<View <View
......
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
<LinearLayout <LinearLayout
android:visibility="gone"
android:id="@+id/addVipLinearLayout" android:id="@+id/addVipLinearLayout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="58dp" android:layout_height="58dp"
......
...@@ -95,6 +95,7 @@ ...@@ -95,6 +95,7 @@
android:layout_height="50dp" android:layout_height="50dp"
android:layout_marginBottom="@dimen/all_margin" android:layout_marginBottom="@dimen/all_margin"
android:gravity="center_vertical" android:gravity="center_vertical"
android:visibility="gone"
android:onCheckedChanged="@{onCheckedChangeListener}" android:onCheckedChanged="@{onCheckedChangeListener}"
android:orientation="horizontal"></RadioGroup> android:orientation="horizontal"></RadioGroup>
...@@ -126,7 +127,7 @@ ...@@ -126,7 +127,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:background="@null" android:background="@null"
android:digits="1234567890." android:digits="1234567890"
android:inputType="phone" android:inputType="phone"
android:maxLength="6" android:maxLength="6"
android:onClick="@{onClickListener}" android:onClick="@{onClickListener}"
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@color/white"
android:orientation="vertical"> android:orientation="vertical">
<LinearLayout <LinearLayout
...@@ -87,9 +88,6 @@ ...@@ -87,9 +88,6 @@
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
<View <include layout="@layout/line_layout"/>
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/line_bg" />
</LinearLayout> </LinearLayout>
</layout> </layout>
\ No newline at end of file
...@@ -2,5 +2,5 @@ ...@@ -2,5 +2,5 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="0.5dp" android:layout_height="0.5dp"
android:background="@color/black_likui" android:background="@color/gray_huanggai"
></LinearLayout> ></LinearLayout>
\ No newline at end of file
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="0.5dp" android:layout_height="0.5dp"
android:background="@color/line_bg" android:background="@color/gray_huanggai"
android:layout_marginLeft="@dimen/all_margin_left" android:layout_marginLeft="@dimen/all_margin_left"
android:layout_marginRight="@dimen/all_margin_left" android:layout_marginRight="@dimen/all_margin_left"
></LinearLayout> ></LinearLayout>
\ No newline at end of file
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
style="@style/searchBarEditor" style="@style/searchBarEditor"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="30dp" android:layout_height="30dp"
android:imeOptions="actionSearch"
android:layout_marginEnd="@dimen/all_padding" android:layout_marginEnd="@dimen/all_padding"
android:drawablePadding="@dimen/all_padding" android:drawablePadding="@dimen/all_padding"
android:hint="请输入手机号或会员姓名" android:hint="请输入手机号或会员姓名"
......
...@@ -4,7 +4,9 @@ ...@@ -4,7 +4,9 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:gravity="center"> android:gravity="center"
android:orientation="vertical">
<TextView <TextView
android:id="@+id/tv_empty" android:id="@+id/tv_empty"
......
...@@ -451,7 +451,7 @@ ...@@ -451,7 +451,7 @@
<string name="tv_bale_edit_count"> 共 %s 件</string> <string name="tv_bale_edit_count"> 共 %s 件</string>
<string name="money">¥ %s </string> <string name="money">¥ %s </string>
<!--会员管理--> <!--会员管理-->
<string name="adv_plan"> 级标准:消费金额满 %s</string> <string name="adv_plan"> 级标准:消费金额满 %s</string>
<string name="level_Number">共有 %s个会员等级</string> <string name="level_Number">共有 %s个会员等级</string>
<string name="vip_level_title">等级设置</string> <string name="vip_level_title">等级设置</string>
<string name="vip_mscard_period_of_validity">有效期:%s-%s</string> <string name="vip_mscard_period_of_validity">有效期:%s-%s</string>
......
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