Commit 66cba04a authored by 陈前's avatar 陈前

Merge remote-tracking branch 'origin/master'

parents 6ae62c00 3d708d72
......@@ -85,7 +85,8 @@ interface ApiService {
*/
@POST(C.URL.LOGIN.register)
Observable<HttpMessage<Object>> register(@Query("operMobile") String operMobile, @Query
("loginPwd") String loginPwd, @Query("merName") String merName, @Query("shopName")
("loginPwd") String loginPwd, @Query("merName") String merName, @Query("operName")
String operName, @Query("shopName")
String shopName, @Query("mccId") int mccId,
@Query("cityCountyId") int
cityCountyId, @Query("cityAddress") String
......@@ -192,15 +193,19 @@ interface ApiService {
Observable<HttpMessage<Sta>> querySta();
@POST(C.URL.RCTRACE.query)
Observable<HttpMessage<Pager<VipRechargeOrder>>> queryRecharge(@Query("pageNumber") int pageNum, @Query
Observable<HttpMessage<Pager<VipRechargeOrder>>> queryRecharge(@Query("pageNumber") int
pageNum, @Query
("pageSize") int pageSize);
@POST(C.URL.RCTRACE.query)
Observable<HttpMessage<Pager<VipRechargeOrder>>> queryRecharge(@Query("vipId") long vipId, @Query("pageNumber") int pageNum, @Query
Observable<HttpMessage<Pager<VipRechargeOrder>>> queryRecharge(@Query("vipId") long vipId,
@Query("pageNumber") int
pageNum, @Query
("pageSize") int pageSize);
@POST(C.URL.RCTRACE.query)
Observable<HttpMessage<Pager<VipRechargeOrder>>> queryRecharge(@Query("pageNumber") int pageNum, @Query
Observable<HttpMessage<Pager<VipRechargeOrder>>> queryRecharge(@Query("pageNumber") int
pageNum, @Query
("pageSize") int pageSize, @Query("startDate") long startDate, @Query("endDate") long
endDate);
......@@ -228,11 +233,13 @@ interface ApiService {
@POST(C.URL.TICKET.query)
Observable<HttpMessage<Pager<Ticket>>> queryTicket(@Query("pageNumber") int pageNum, @Query
("pageSize") int pageSize, @Query("usedFlag") int usedFlag, @Query("ticketIsList") String ticketIsList);
("pageSize") int pageSize, @Query("usedFlag") int usedFlag, @Query("ticketIsList")
String ticketIsList);
@POST(C.URL.TICKET.query)
Observable<HttpMessage<Pager<Ticket>>> queryTicket(@Query("pageNumber") int pageNum, @Query
("pageSize") int pageSize, @Query("usedFlag") int usedFlag, @Query("ticketIsList") String ticketIsList, @Query("startDate") long startDate, @Query("endDate") long
("pageSize") int pageSize, @Query("usedFlag") int usedFlag, @Query("ticketIsList")
String ticketIsList, @Query("startDate") long startDate, @Query("endDate") long
endDate);
@POST(C.URL.TICKET.ticketBatchSend)
......@@ -248,7 +255,8 @@ interface ApiService {
Observable<HttpMessage<Saleorder>> addOrderPayMis(@Body Saleorder.Pay saleorderPay);
@POST(C.URL.SALEORDER.querySaleorderByVipId)
Observable<HttpMessage<Pager<Saleorder>>> querySaleorderByVipId(@Query("vipId") Long vipId, @Query
Observable<HttpMessage<Pager<Saleorder>>> querySaleorderByVipId(@Query("vipId") Long vipId,
@Query
("pageNumber") int pageNum, @Query("pageSize") int pageSize);
......@@ -313,6 +321,7 @@ interface ApiService {
@POST(C.URL.TRULE.truleQuery)
Observable<HttpMessage<Pager<Trule>>> truleQuery(@Query("startDate") String data);
@POST(C.URL.TRULE.truleQuery)
Observable<HttpMessage<Pager<Trule>>> truleQueryByVipId(@Query("vipId") long vipId);
......@@ -441,7 +450,7 @@ interface ApiService {
@POST(C.URL.VIP.query)
Observable<HttpMessage<Pager<Vip>>> getAllVipList(@Query("pageNumber") int pageNumber,
@Query("pageSize") int pageSize);
@Query("pageSize") int pageSize);
}
......@@ -62,6 +62,23 @@ public class Sta {
this.cardCount = cardCount;
}
public Long getOperCount() {
return operCount;
}
public Long getOperAddCount() {
return operAddCount;
}
public void setOperCount(Long operCount) {
this.operCount = operCount;
}
public void setOperAddCount(Long operAddCount) {
this.operAddCount = operAddCount;
}
/**
* 会员总数
*/
......@@ -81,5 +98,14 @@ public class Sta {
* 充值次数
*/
private Long cardCount = 0L;
/**
* 店员数量
*/
private Long operCount = 0L;
/**
* 店员新增数量
*/
private Long operAddCount = 0L;
}
......@@ -190,7 +190,7 @@ public interface LoginContract {
* 创建门店操作
*/
abstract void createStore(String operMobile, String loginPwd, String
merName, String shopName, int cityCountyId, String cityAddress, int startWay,
merName,String operName, String shopName, int cityCountyId, String cityAddress, int startWay,
LoadingDialog loadingDialog);
/*********************************************************************************************************************************
绑定款台界面逻辑接口定义**********************************************************************************************************
......
......@@ -10,23 +10,6 @@ import com.blankj.utilcode.util.LogUtils;
import com.blankj.utilcode.util.SPUtils;
import com.blankj.utilcode.util.ToastUtils;
import com.google.gson.Gson;
import org.json.JSONArray;
import org.json.JSONException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
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;
import io.realm.Realm;
import io.realm.RealmResults;
import com.xingdata.zzdpos.C;
import com.xingdata.zzdpos.api.ApiException;
import com.xingdata.zzdpos.api.ApiFactory;
......@@ -42,13 +25,28 @@ import com.xingdata.zzdpos.ui.login.fragment.SignInFragment;
import com.xingdata.zzdpos.ui.login.fragment.SmsCodeFragment;
import com.xingdata.zzdpos.ui.login.fragment.bean.LoginBean;
import com.xingdata.zzdpos.ui.login.fragment.bean.LoginReturnBean;
import com.xingdata.zzdpos.ui.login.fragment.bean.Shops;
import com.xingdata.zzdpos.ui.login.fragment.bean.StoreAddressJsonBean;
import com.xingdata.zzdpos.ui.login.fragment.bean.StoreTypeJsonBean;
import com.xingdata.zzdpos.ui.login.fragment.bean.UserStoreInfo;
import com.xingdata.zzdpos.util.PhoneFormatCheckUtils;
import com.xingdata.zzdpos.util.SystemUtil;
import org.json.JSONArray;
import org.json.JSONException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
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;
import io.realm.Realm;
import io.realm.RealmResults;
public class LoginPresenter extends LoginContract.Presenter {
/**
* 登录成功静态对象
......@@ -85,7 +83,6 @@ public class LoginPresenter extends LoginContract.Presenter {
}
@Override
public void createStoreFragmentinit(Context context, LoadingDialog loadingDialog) {
//加载城市数据列表,加载门店类型列表
......@@ -196,7 +193,8 @@ public class LoginPresenter extends LoginContract.Presenter {
@Override
public void createStore(String operMobile, String loginPwd, String merName, String shopName,
public void createStore(String operMobile, String loginPwd, String merName, String operName,
String shopName,
int cityCountyId, String cityAddress, int startWay, LoadingDialog
loadingDialog) {
if (PhoneFormatCheckUtils.isPhoneLegal(operMobile)) {
......@@ -204,7 +202,8 @@ public class LoginPresenter extends LoginContract.Presenter {
case 1: {
ApiFactory.Test.rigister(operMobile, EncryptUtils
.encryptMD5ToString(loginPwd),
merName, shopName, cityCountyId, cityAddress, SystemUtil.getDeviceSN(),
merName, operName, shopName, cityCountyId, cityAddress, SystemUtil
.getDeviceSN(),
SystemUtil.getDeviceModel(), getLoginBean().getSmsCode()).subscribe(
register -> {
logAndToast("注册成功");
......
......@@ -89,6 +89,7 @@ public class ChoiceStoreFragment extends BaseFragment<LoginPresenter,
}
mViewBinding.tvNickname.setText(LoginPresenter.userStoreInfo.getMerchant().getMerName());
list.clear();
for (int i = 0; i < LoginPresenter.userStoreInfo.getShops().size(); i++) {
list.add(LoginPresenter.userStoreInfo.getShops().get(i));
}
......
......@@ -31,7 +31,6 @@ public class CreateStoreFragment extends BaseFragment<LoginPresenter,
private ArrayList<ArrayList<ArrayList<String>>> listAddressItem3 = new ArrayList<>();
private ArrayList<StoreTypeJsonBean> listTypeItem1 = new ArrayList<>();
private ArrayList<ArrayList<String>> listTypeItem2 = new ArrayList<>();
LoadingDialog mLoadingDialog = new LoadingDialog();
......@@ -58,13 +57,19 @@ public class CreateStoreFragment extends BaseFragment<LoginPresenter,
}
});
if (startway == 1) {
mViewBinding.etMerchantsname.setVisibility(View.VISIBLE);
mViewBinding.etNickname.setVisibility(View.VISIBLE);
mViewBinding.tvNickname.setVisibility(View.GONE);
mViewBinding.tvMerchantsname.setVisibility(View.GONE);
} else {
mViewBinding.etNickname.setVisibility(View.GONE);
mViewBinding.etMerchantsname.setVisibility(View.GONE);
mViewBinding.tvNickname.setVisibility(View.VISIBLE);
mViewBinding.tvNickname.setText(LoginPresenter.userStoreInfo.getMerchant().getMerName
mViewBinding.tvMerchantsname.setVisibility(View.VISIBLE);
mViewBinding.tvMerchantsname.setText(LoginPresenter.userStoreInfo.getMerchant()
.getMerName
());
mViewBinding.tvNickname.setText(LoginPresenter.userStoreInfo.getOperName());
}
mLoadingDialog.show((BaseActivity) getActivity());
mPresenter.createStoreFragmentinit(getActivity(), mLoadingDialog);
......@@ -97,7 +102,8 @@ public class CreateStoreFragment extends BaseFragment<LoginPresenter,
if (isAllNull()) {
mLoadingDialog.show((BaseActivity) getActivity());
mPresenter.createStore(mPresenter.getLoginBean().getPhone_No(), mPresenter
.getLoginBean().getPwd(), mViewBinding.etNickname.getText()
.getLoginBean().getPwd(), mViewBinding.etMerchantsname
.getText().toString(), mViewBinding.etNickname.getText()
.toString(), mViewBinding.etStorename.getText().toString(),
addressId, mViewBinding.tvStoredetailedaddress.getText().toString
(), startway, mLoadingDialog);
......@@ -238,9 +244,9 @@ public class CreateStoreFragment extends BaseFragment<LoginPresenter,
//登录后新建门店
_isbl = mViewBinding.tvNickname.getText().toString().isEmpty();
}
return !(_isbl || mViewBinding
.etStorename.getText().toString().isEmpty() || mViewBinding.tvStoredetailedaddress
.getText().toString().isEmpty() || addressId == -1);
return !(_isbl || mViewBinding.tvMerchantsname.getText().toString().isEmpty() ||
mViewBinding.etStorename.getText().toString().isEmpty() || mViewBinding
.tvStoredetailedaddress.getText().toString().isEmpty() || addressId == -1);
}
}
......@@ -116,6 +116,9 @@ public class SmsCodeFragment extends BaseFragment<LoginPresenter,
}
}
});
mViewBinding.etPhone.setFocusable(true);
mViewBinding.etPhone.setFocusableInTouchMode(true);
mViewBinding.etPhone.requestFocus();
}
public void sendSmsSucc() {
......
......@@ -10,6 +10,15 @@ import java.util.List;
public class UserStoreInfo {
private List<Shops> shops = new ArrayList<>();
private Merchant merchant = new Merchant();
private String operName;
public String getOperName() {
return operName;
}
public void setOperName(String operName) {
this.operName = operName;
}
public void setShops(List<Shops> shops) {
this.shops = shops;
......
......@@ -32,17 +32,35 @@ public class UserActivity extends BaseActivity<UserPresenter, ActivityUserBindin
public int getLayoutId() {
return R.layout.activity_user;
}
@Override
public void initView() {
loadRootFragment(R.id.user_frame, mPresenter.userListFragment, true, false);
}
@Override
public void queryOperSus(Pager<Oper> operPager) {
mPresenter.userListFragment.queryOperSus(operPager);
}
@Override
public void querySta(Sta sta) {
public void queryStaSus(Sta sta) {
mPresenter.userListFragment.queryStaSus(sta);
}
@Override
public void addSusSus(Oper oper) {
mPresenter.userListFragment.addSusSus(oper);
mPresenter.userInfoEditFragment.pop();
}
@Override
public void updateUserSus(Oper oper) {
mPresenter.userListFragment.updateUserSus(oper);
}
@Override
public void delUserSus() {
mPresenter.userListFragment.delUserSus();
}
}
......@@ -21,12 +21,18 @@ public interface UserContract {
interface View extends BaseView {
void queryOperSus(Pager<Oper> operPager);
void querySta(Sta sta);
void queryStaSus(Sta sta);
void addSusSus(Oper oper);
void updateUserSus(Oper oper);
void delUserSus();
}
abstract class Presenter extends BasePresenter<View> {
public abstract void getUserList(String wd);
public abstract void addUser(Oper oper);
public abstract void querySta();
public abstract void updateUser(Oper oper);
public abstract void delUser(Oper oper);
}
}
\ No newline at end of file
package com.xingdata.zzdpos.ui.manage.user;
import com.blankj.utilcode.util.ToastUtils;
import com.xingdata.zzdpos.api.ApiFactory;
import com.xingdata.zzdpos.model.Oper;
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.UserInfoFragment;
import com.xingdata.zzdpos.ui.manage.user.fragment.UserListFragment;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
public class UserPresenter extends UserContract.Presenter {
public UserListFragment userListFragment = new UserListFragment();
public UserInfoEditFragment userInfoEditFragment = new UserInfoEditFragment();
public UserInfoFragment userInfoFragment = new UserInfoFragment();
public LinkedHashMap<String, String> operLevel = new LinkedHashMap<>();//用户级别 1 员工 2主管 3 店长 9老板
public UserMenuDialog userMenuDialog = new UserMenuDialog();
@Override
public void onAttached() {
initOperLevel();
}
private void initOperLevel() {
operLevel.put("员工", "1");
operLevel.put("主管", "2");
operLevel.put("店长", "3");
operLevel.put("老板", "9");
}
public String getOperLevelName(String strLevel) {
Iterator<Map.Entry<String, String>> iterator = operLevel.entrySet().iterator();
while (iterator.hasNext()) {
if (iterator.next().getValue().equals(strLevel))
return iterator.next().getKey();
}
return "";
}
......@@ -19,27 +50,53 @@ public class UserPresenter extends UserContract.Presenter {
ApiFactory.Oper.queryOper(wd).subscribe(operPager -> {
mView.queryOperSus(operPager);
}, throwable -> {
ToastUtils.showShort(throwable.getMessage());
});
}
@Override
public void addUser(Oper oper) {
ApiFactory.Oper.addOper(oper).subscribe(operPager -> {
ApiFactory.Oper.addOper(oper).subscribe(m -> {
mView.addSusSus(m);
}, throwable -> {
ToastUtils.showShort(throwable.getMessage());
});
}
@Override
public void querySta() {
ApiFactory.Sta.querySta().subscribe(sta -> {
mView.queryStaSus(sta);
}, throwable -> {
ToastUtils.showShort(throwable.getMessage());
});
}
@Override
public void updateUser(Oper oper) {
ApiFactory.Oper.updateOper(oper).subscribe(m -> {
mView.updateUserSus(m);
}, throwable -> {
ToastUtils.showShort(throwable.getMessage());
});
}
@Override
public void delUser(Oper oper) {
ApiFactory.Oper.deleteOper(oper.getOperId()).subscribe(m -> {
mView.delUserSus();
}, throwable -> {
ToastUtils.showShort(throwable.getMessage());
});
}
public List<String> getOperLevelList() {
ArrayList<String> operLevelList = new ArrayList<>();
Iterator<Map.Entry<String, String>> iterator = operLevel.entrySet().iterator();
while (iterator.hasNext()) {
operLevelList.add(iterator.next().getKey());
}
return operLevelList;
}
}
......@@ -9,6 +9,7 @@ import com.xingdata.zzdpos.databinding.ItemUserListItemBinding;
import com.xingdata.zzdpos.databinding.ItemVipListItemBinding;
import com.xingdata.zzdpos.model.Oper;
import com.xingdata.zzdpos.model.Vip;
import com.xingdata.zzdpos.ui.manage.user.UserPresenter;
import com.xingdata.zzdpos.ui.marketing.ms.model.User;
import com.xingdata.zzdpos.util.ConvertUtil;
......@@ -20,18 +21,18 @@ import java.util.List;
public class UserListAdapter extends BaseAdapter<Oper, ItemUserListItemBinding> {
private Context mContext;
private UserPresenter mP;
public UserListAdapter(Context mContext, @Nullable List<Oper> data) {
public UserListAdapter(Context mContext, @Nullable List<Oper> data,UserPresenter userPresenter) {
super(R.layout.item_user_list_item, data);
this.mContext = mContext;
this.mP=userPresenter;
}
@Override
protected void convert(ItemUserListItemBinding mViewBinding, Oper item) {
mViewBinding.userName.setText(item.getOperName());
mViewBinding.userMobile.setText(String.valueOf(item.getOperMobile()));
mViewBinding.vipLevelName.setText(mP.getOperLevelName(item.getOperLevel().toString()));
}
}
package com.xingdata.zzdpos.ui.manage.user.dialog;
import android.view.View;
import com.blankj.utilcode.util.ToastUtils;
import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseActivity;
import com.xingdata.zzdpos.base.BaseSheetDialog;
import com.xingdata.zzdpos.databinding.DialogUserMenuBinding;
import com.xingdata.zzdpos.databinding.DialogVipMenuBinding;
import com.xingdata.zzdpos.model.Level;
import com.xingdata.zzdpos.model.Oper;
import com.xingdata.zzdpos.model.Vip;
import com.xingdata.zzdpos.ui.dialog.PromptDialog;
import com.xingdata.zzdpos.ui.manage.user.UserPresenter;
import com.xingdata.zzdpos.ui.vip.VipPresenter;
import com.xingdata.zzdpos.ui.vip.fragment.VipInfoEditFragment;
import com.xingdata.zzdpos.ui.vip.fragment.VipRechargeListFragment;
import com.xingdata.zzdpos.ui.vip.fragment.VipTruleListFragment;
import java.util.List;
/**
* Created by JM_DEV on 2017/12/27.
*/
public class UserMenuDialog extends BaseSheetDialog<UserPresenter, DialogUserMenuBinding> {
private Oper oper;
private List<Level> mLevel;
@Override
public int getLayoutId() {
return R.layout.dialog_user_menu;
}
@Override
public void initView() {
mViewBinding.setOnClick(view -> {
switch (view.getId()) {
//編輯店员
case R.id.editUser:
mPresenter.userInfoEditFragment.setOper(oper);
((BaseActivity) getActivity()).start(mPresenter.userInfoEditFragment);
break;
//新增店员
case R.id.delUser:
/**
*调用方式
*/
//两个选择按钮,确定取消并含有提示信息
PromptDialog promptDialog = new PromptDialog();
promptDialog.setDialogType(PromptDialog.PROMPTDIALOG_SELECT, "确定是否删除店员?")
.setClick(new View.OnClickListener() {
@Override
public void onClick(View view) {
mPresenter.delUser(oper);
promptDialog.dismiss();
}
}, new View.OnClickListener() {
@Override
public void onClick(View view) {
promptDialog. dismiss();
}
}).show((BaseActivity) getActivity());
break;
}
});
}
@Override
protected boolean isTransparentBackground() {
return true;
}
public void setOper(Oper oper) {
this.oper = oper;
}
public void setLevel(List<Level> mLevel) {
this.mLevel = mLevel;
}
}
package com.xingdata.zzdpos.ui.manage.user.fragment;
/**
* Created by JM_DEV on 2017/12/21.
*/
import android.app.DatePickerDialog;
import android.graphics.Color;
import android.view.View;
import android.widget.CheckBox;
import android.widget.DatePicker;
import android.widget.RadioButton;
import android.widget.TextView;
import com.bigkoo.pickerview.OptionsPickerView;
import com.blankj.utilcode.util.ToastUtils;
import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseActivity;
import com.xingdata.zzdpos.base.BaseFragment;
import com.xingdata.zzdpos.databinding.FragmentUserInfoEditBinding;
import com.xingdata.zzdpos.databinding.FragmentVipInfoEditBinding;
import com.xingdata.zzdpos.model.Level;
import com.xingdata.zzdpos.model.Oper;
import com.xingdata.zzdpos.model.Vip;
import com.xingdata.zzdpos.ui.manage.user.UserPresenter;
import com.xingdata.zzdpos.ui.manage.user.dialog.UserMenuDialog;
import com.xingdata.zzdpos.ui.vip.VipPresenter;
import com.xingdata.zzdpos.ui.vip.dialog.VipEditMenuDialog;
import com.xingdata.zzdpos.util.ConvertUtil;
import com.xingdata.zzdpos.util.StringUtil;
import java.util.Calendar;
import java.util.Date;
import java.util.LinkedHashMap;
import java.util.List;
/**
* 会员信息界面
*/
public class UserInfoEditFragment extends BaseFragment<UserPresenter, FragmentUserInfoEditBinding> {
private Oper oper;
public void setOper(Oper oper) {
this.oper = oper;
}
@Override
public int getLayoutId() {
return R.layout.fragment_user_info_edit;
}
@Override
public void initView() {
if (oper == null) {
mViewBinding.infoTitle.tvTitle.setText("新增店员");
} else {
mViewBinding.infoTitle.tvTitle.setText("编辑店员");
mViewBinding.userName.setText(oper.getOperName());
mViewBinding.userName.setSelection(oper.getOperName().length());
mViewBinding.userPhone.setText(String.valueOf(oper.getOperMobile()));
mViewBinding.userLevel.setText(mPresenter.getOperLevelName(oper.getOperLevel().toString()));
}
mViewBinding.infoTitle.popMenu.setVisibility(View.GONE);
mViewBinding.setOnClickListener(view -> {
switch (view.getId()) {
case R.id.user_Level:
ShowPickerViewStoreAddress();
break;
case R.id.onSure:
if (oper == null) {
oper = new Oper();
}
if (mViewBinding.userLevel.getText().length()==0)
{
ToastUtils.showShort("会员等级不能为空");
return;
}
if (mViewBinding.userPhone.getText().length()==0)
{
ToastUtils.showShort("会员帐号不能为空");
return;
}
if (mViewBinding.userName.getText().length()==0)
{
ToastUtils.showShort("会员名称不能为空");
return;
}
oper.setOperLevel(Byte.valueOf(mPresenter.operLevel.get(mViewBinding.userLevel.getText().toString())));
oper.setOperMobile(Long.parseLong(mViewBinding.userPhone.getText().toString()));
oper.setOperName(mViewBinding.userName.getText().toString());
if (oper.getOperId() == null) {
mPresenter.addUser(oper);
} else {
mPresenter.updateUser(oper);
}
break;
}
});
mViewBinding.infoTitle.ivBack.setOnClickListener(view -> {
pop();
});
}
/**
* 弹出选择会员P
*/
private void ShowPickerViewStoreAddress() {// 弹出选择器
OptionsPickerView pvOptions = new OptionsPickerView.Builder(getActivity(), new
OptionsPickerView.OnOptionsSelectListener() {
@Override
public void onOptionsSelect(int options1, int options2, int options3, View v) {
mViewBinding.userLevel.setText(mPresenter.getOperLevelList().get(options1));
}
}).setTitleText("请选择")
.setDividerColor(Color.BLACK)
.setTextColorCenter(Color.BLACK) //设置选中项文字颜色
.setContentTextSize(20)
.build();
pvOptions.setPicker(mPresenter.getOperLevelList());
pvOptions.show();
}
@Override
public boolean onBackPressedSupport() {
return false;
}
}
package com.xingdata.zzdpos.ui.manage.user.fragment;
/**
* Created by JM_DEV on 2017/12/21.
*/
import android.graphics.Color;
import android.view.View;
import com.bigkoo.pickerview.OptionsPickerView;
import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseActivity;
import com.xingdata.zzdpos.base.BaseFragment;
import com.xingdata.zzdpos.databinding.FragmentUserInfoBinding;
import com.xingdata.zzdpos.databinding.FragmentUserInfoEditBinding;
import com.xingdata.zzdpos.model.Oper;
import com.xingdata.zzdpos.ui.manage.user.UserPresenter;
import com.xingdata.zzdpos.ui.manage.user.dialog.UserMenuDialog;
/**
* 会员信息界面
*/
public class UserInfoFragment extends BaseFragment<UserPresenter, FragmentUserInfoBinding> {
private Oper oper;
public void setOper(Oper oper) {
this.oper = oper;
}
@Override
public int getLayoutId() {
return R.layout.fragment_user_info;
}
@Override
public void initView() {
mViewBinding.infoTitle.tvTitle.setText("店员详情");
mViewBinding.userName.setText(oper.getOperName());
mViewBinding.userPhone.setText(String.valueOf(oper.getOperMobile()));
mViewBinding.userLevel.setText(mPresenter.getOperLevelName(oper.getOperLevel().toString()));
mViewBinding.setOnClickListener(view -> {
switch (view.getId()) {
case R.id.user_Level:
ShowPickerViewStoreAddress();
break;
case R.id.onSure:
if (oper == null) {
oper = new Oper();
}
oper.setOperLevel(Byte.valueOf(mPresenter.operLevel.get(mViewBinding.userLevel.getText().toString())));
oper.setOperMobile(Long.parseLong(mViewBinding.userPhone.getText().toString()));
oper.setOperName(mViewBinding.userName.getText().toString());
if (oper.getOperId() == null) {
mPresenter.addUser(oper);
} else {
mPresenter.updateUser(oper);
}
break;
}
});
mViewBinding.infoTitle.ivBack.setOnClickListener(view -> {
pop();
});
mViewBinding.infoTitle.popMenu.setOnClickListener(view -> {
mPresenter.userMenuDialog.setOper(oper);
mPresenter.userMenuDialog.show((BaseActivity) getActivity());
});
}
/**
* 弹出选择会员P
*/
private void ShowPickerViewStoreAddress() {// 弹出选择器
OptionsPickerView pvOptions = new OptionsPickerView.Builder(getActivity(), new
OptionsPickerView.OnOptionsSelectListener() {
@Override
public void onOptionsSelect(int options1, int options2, int options3, View v) {
mViewBinding.userLevel.setText(mPresenter.getOperLevelList().get(options1));
}
}).setTitleText("请选择")
.setDividerColor(Color.BLACK)
.setTextColorCenter(Color.BLACK) //设置选中项文字颜色
.setContentTextSize(20)
.build();
pvOptions.setPicker(mPresenter.getOperLevelList());
pvOptions.show();
}
@Override
public boolean onBackPressedSupport() {
return false;
}
}
......@@ -45,38 +45,59 @@ public class UserListFragment extends BaseFragment<UserPresenter, FragmentUserLi
@Override
public void initView() {
adapter = new UserListAdapter(getActivity(), opers);
adapter = new UserListAdapter(getActivity(), opers,mPresenter);
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(true);
adapter.loadMoreComplete();
adapter.setEnableLoadMore(false);
mViewBinding.titleSearch.onBack.setOnClickListener(view -> {
getActivity().finish();
});
mViewBinding.setOnClickListener(view -> {
switch (view.getId()) {
case R.id.addUser:
mPresenter.userInfoEditFragment.setOper(null);
start(mPresenter.userInfoEditFragment);
break;
}
});
onRefresh();
}
private void onLoadMore(){
private void onLoadMore() {
}
public void onRefresh() {
mPresenter.getUserList(null);
mPresenter.querySta();
}
public void queryOperSus(Pager<Oper> operPager) {
adapter.setNewData(operPager.getList());
adapter.setEnableLoadMore(false);
adapter.loadMoreComplete();
}
public void queryStaSus(Sta sta) {
mViewBinding.userCount.setText(String.valueOf(sta.getOperCount()));
mViewBinding.userCountAddTodayTitle.setText(String.valueOf(sta.getOperAddCount()));
}
public void addSusSus(Oper oper) {
onRefresh();
}
public void updateUserSus(Oper oper) {
onRefresh();
}
public void delUserSus() {
onRefresh();
}
}
......@@ -55,7 +55,7 @@ public final class SystemUtil {
}
}
// return deviceSN;
return "548496";
return "548496116";
}
......
......@@ -298,6 +298,7 @@ class DownlistAdapter extends BaseAdapter {
}
break;
}
_temp = oper.getOperName();
String entity = _temp + " " + oper.getOperMobile();
holder.item_tv.setText(entity);
break;
......
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android">
<data>
<variable
name="onClick"
type="android.view.View.OnClickListener" />
</data>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/transparent"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/dp_10"
android:background="@drawable/shape_white"
android:gravity="center_horizontal"
android:orientation="vertical">
<TextView
android:id="@+id/editUser"
style="@style/default_bluetext_popbutton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/dtail_hight_5"
android:background="@color/white"
android:foreground="?android:attr/selectableItemBackground"
android:gravity="center"
android:onClick="@{onClick}"
android:text="编辑店员" />
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/line_bg" />
<TextView
style="@style/default_bluetext_popbutton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="@dimen/dtail_hight_5"
android:id="@+id/delUser"
android:textColor="@color/deep_red"
android:background="@color/white"
android:foreground="?android:attr/actionBarItemBackground"
android:onClick="@{onClick}"
android:text="删除店员" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/dp_10"
android:layout_marginTop="30dp"
android:background="@drawable/shape_white"
android:gravity="center_horizontal"
android:orientation="vertical">
<TextView
android:id="@+id/cancelButton"
style="@style/default_blacktext_smallstyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/dtail_hight_5"
android:foreground="?android:attr/actionBarItemBackground"
android:onClick="@{onClick}"
android:gravity="center"
android:text="取消" />
</LinearLayout>
</LinearLayout>
</layout>
\ No newline at end of file
......@@ -25,6 +25,48 @@
android:layout_marginTop="@dimen/all_padding"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="@dimen/et_padding"
android:text="@string/login_createstorefragment_tv_merchantsname"
android:textColor="@color/black_baozheng"
android:textSize="@dimen/text_three_title"
android:textStyle="bold"/>
<TextView
android:id="@+id/tv_merchantsname"
android:layout_width="@dimen/et_width"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:ems="10"
android:gravity="center_vertical"
android:hint="@string/login_createstorefragment_et_nickname_hint"
android:lines="1"
android:maxLength="11"
android:padding="@dimen/et_padding"
android:singleLine="true"
android:textColor="@color/black_baozheng"
android:textColorHint="@color/hint"
android:textSize="@dimen/et_textsize"
android:visibility="gone"/>
<com.xingdata.zzdpos.view.ContainsEmojiEditText
android:id="@+id/et_merchantsname"
style="@style/editText_new"
android:ems="10"
android:hint="@string/login_createstorefragment_et_merchantsname_hint"
android:lines="1"
android:maxLength="11"
android:singleLine="true"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
......@@ -197,7 +239,7 @@
android:onClick="@{onClickListener}"
android:text="@string/login_createstorefragment_btn_last"
android:textColor="@color/white"
android:textSize="@dimen/et_textsize" />
android:textSize="@dimen/et_textsize"/>
<Button
android:id="@+id/btn_next"
......
......@@ -40,7 +40,7 @@
android:id="@+id/et_phone"
style="@style/editText_new"
android:digits="1234567890"
android:drawableLeft="@mipmap/login_pwd01"
android:drawableLeft="@mipmap/login_username1"
android:ems="10"
android:gravity="center_vertical"
android:hint="@string/login_et_phone_hint"
......
<?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:background="@color/bg"
android:orientation="vertical">
<include
android:id="@+id/info_title"
layout="@layout/title_pop" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/all_margin"
android:background="@color/white"
android:orientation="horizontal">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:orientation="horizontal">
<TextView
style="@style/default_blacktext_margin_smallstyle"
android:layout_width="70dp"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/all_margin_left"
android:text="姓名" />
<TextView
android:id="@+id/user_name"
style="@style/default_blacktext_margin_smallstyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="right"
android:text="111111"
android:textColor="@color/black_likui" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/line_bg" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:orientation="horizontal">
<TextView
style="@style/default_blacktext_margin_smallstyle"
android:layout_width="70dp"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/all_margin_left"
android:text="帐号" />
<TextView
android:id="@+id/user_phone"
style="@style/default_blacktext_margin_smallstyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@null"
android:gravity="right"
android:text="111111"
android:textColor="@color/black_likui" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/line_bg" />
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/line_bg" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:background="@color/white"
android:orientation="horizontal">
<TextView
style="@style/default_blacktext_margin_smallstyle"
android:layout_width="70dp"
android:layout_height="wrap_content"
android:text="级别" />
<TextView
android:id="@+id/user_Level"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginRight="@dimen/all_margin"
android:gravity="right"
android:onClick="@{onClickListener}"
android:textColor="@color/gray_huanggai" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/line_bg" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<Button
android:id="@+id/onSure"
style="@style/button_positive_noradius"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginBottom="15dp"
android:onClick="@{onClickListener}"
android:text="确认" />
</RelativeLayout>
</LinearLayout>
</layout>
\ No newline at end of file
<?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:background="@color/bg"
android:orientation="vertical">
<include
android:id="@+id/info_title"
layout="@layout/title_pop" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/all_margin"
android:background="@color/white"
android:orientation="horizontal">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:orientation="horizontal">
<TextView
style="@style/default_blacktext_margin_smallstyle"
android:layout_width="70dp"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/all_margin_left"
android:text="姓名" />
<EditText
android:id="@+id/user_name"
style="@style/dialog_edit"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@null"
android:hint="请输入姓名" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginRight="@dimen/all_margin_left"
android:background="@color/line_bg" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:orientation="horizontal">
<TextView
style="@style/default_blacktext_margin_smallstyle"
android:layout_width="70dp"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/all_margin_left"
android:maxLength="11"
android:text="帐号" />
<EditText
android:id="@+id/user_phone"
android:digits="0123456789"
android:inputType="phone"
style="@style/dialog_edit"
android:maxLength="11"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@null"
android:hint="请输入手机号" />
</LinearLayout>
</LinearLayout>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:background="@mipmap/camera" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/line_bg" />
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/line_bg" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:background="@color/white"
android:orientation="horizontal">
<TextView
style="@style/default_blacktext_margin_smallstyle"
android:layout_width="70dp"
android:layout_height="wrap_content"
android:text="级别" />
<TextView
android:id="@+id/user_Level"
android:layout_marginRight="@dimen/all_margin"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/sp_12"
android:drawableRight="@mipmap/ic_expand"
android:onClick="@{onClickListener}" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/line_bg" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<Button
android:id="@+id/onSure"
android:layout_alignParentBottom="true"
style="@style/button_positive_noradius"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="15dp"
android:onClick="@{onClickListener}"
android:text="确认" />
</RelativeLayout>
</LinearLayout>
</layout>
\ No newline at end of file
......@@ -50,7 +50,6 @@
android:text="店员数量" />
<TextView
android:id="@+id/vip_count_add_today_title"
style="@style/default_blacktext_smallstyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
......@@ -66,7 +65,7 @@
android:orientation="horizontal">
<TextView
android:id="@+id/vip_count"
android:id="@+id/user_count"
style="@style/default_blacktext_bigstyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
......@@ -76,7 +75,7 @@
android:textStyle="bold" />
<TextView
android:id="@+id/vip_count_add_today"
android:id="@+id/user_count_add_today_title"
style="@style/default_blacktext_bigstyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
......
......@@ -4,26 +4,21 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal">
<LinearLayout
<ImageView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="center_vertical"
android:layout_height="wrap_content"
android:layout_margin="@dimen/all_margin"
android:orientation="horizontal">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@mipmap/img_boss" />
</LinearLayout>
android:background="@mipmap/img_boss" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical">
<LinearLayout
......@@ -56,7 +51,8 @@
style="@style/default_gray_huanggaitext_smallstyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/Today_Income" />
android:text="@string/Today_Income"
android:visibility="gone" />
</LinearLayout>
</LinearLayout>
......@@ -64,14 +60,12 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="@dimen/all_margin"
android:layout_marginTop="@dimen/all_margin"
android:orientation="vertical">
<TextView
android:id="@+id/vip_level_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="员工"
android:textColor="@color/black"
android:textSize="@dimen/detail_textview_size" />
......
......@@ -221,6 +221,7 @@
<string name="login_smscodefragment_et_one_input_password_hint">请输入密码</string>
<string name="login_smscodefragment_et_two_input_password_hint">请再次输入密码</string>
<!--创建门店界面-->
<string name="login_createstorefragment_tv_merchantsname">商户名</string>
<string name="login_createstorefragment_tv_nickname">昵称</string>
<string name="login_createstorefragment_tv_storename">门店名称</string>
<string name="login_createstorefragment_tv_storetype">门店类型</string>
......@@ -228,6 +229,7 @@
<string name="login_createstorefragment_tv_storeaddressmessage">详细地址</string>
<string name="login_createstorefragment_tv_storetype_hint">请选择门店类别(连锁/超市)</string>
<string name="login_createstorefragment_tv_storeaddress_hint">请选择门店地址(省/市/县)</string>
<string name="login_createstorefragment_et_merchantsname_hint">请输入商户名</string>
<string name="login_createstorefragment_et_nickname_hint">请输入昵称</string>
<string name="login_createstorefragment_et_storename_hint">请输入门店名称</string>
<string name="login_createstorefragment_et_storedetailedaddress_hint">请输入街道门牌号</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