Commit 2d7d2f15 authored by 陈前's avatar 陈前

Merge remote-tracking branch 'origin/master'

parents 34370e17 245d56ed
......@@ -36,12 +36,14 @@ public class UserPresenter extends UserContract.Presenter {
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();
Iterator it = operLevel.entrySet().iterator();
while (it.hasNext()) {
Map.Entry entity = (java.util.Map.Entry) it.next();
if (entity.getValue().equals(strLevel)) {
return entity.getKey().toString();
}
}
return "";
return "未知";
}
......@@ -97,6 +99,6 @@ public class UserPresenter extends UserContract.Presenter {
while (iterator.hasNext()) {
operLevelList.add(iterator.next().getKey());
}
return operLevelList;
return operLevelList.subList(0,operLevelList.size()-1);
}
}
......@@ -65,6 +65,8 @@ public class UserMenuDialog extends BaseSheetDialog<UserPresenter, DialogUserMen
}).show((BaseActivity) getActivity());
break;
}
dismiss();
});
}
......
......@@ -71,21 +71,21 @@ public class UserInfoEditFragment extends BaseFragment<UserPresenter, FragmentUs
if (oper == null) {
oper = new Oper();
}
if (mViewBinding.userLevel.getText().length()==0)
{
ToastUtils.showShort("会员等级不能为空");
if (mViewBinding.userName.getText().length() == 0) {
ToastUtils.showShort("会员名称不能为空");
return;
}
if (mViewBinding.userPhone.getText().length()==0)
{
if (mViewBinding.userPhone.getText().length() == 0) {
ToastUtils.showShort("会员帐号不能为空");
return;
}
if (mViewBinding.userName.getText().length()==0)
{
ToastUtils.showShort("会员名称不能为空");
if (mViewBinding.userLevel.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());
......
......@@ -46,6 +46,7 @@ public class UserListFragment extends BaseFragment<UserPresenter, FragmentUserLi
@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) -> {
......@@ -80,6 +81,7 @@ public class UserListFragment extends BaseFragment<UserPresenter, FragmentUserLi
adapter.setNewData(operPager.getList());
adapter.setEnableLoadMore(false);
adapter.loadMoreComplete();
mViewBinding.userRefresh.setRefreshing(false);
}
......
......@@ -57,7 +57,7 @@ public class VipInfoEditFragment extends BaseFragment<VipPresenter, FragmentVipI
} else {
mViewBinding.infoTitle.tvTitle.setText("添加会员");
}
if (levels.size() != 0) {
if (levels!=null&&levels.size() != 0) {
mViewBinding.vipDiscounts.setText(levels.get(0).getVipLevelName() + " " + ConvertUtil.discount(levels.get(0).getVipDefDiscount()) + "折");
}
......
......@@ -68,6 +68,10 @@ public class VipListFragment extends BaseFragment<VipPresenter, FragmentVipListB
mViewBinding.setOnClickListener(view -> {
switch (view.getId()) {
case R.id.addVip:
if (levels==null||levels.size()==0){
ToastUtils.showShort("缺少会员等级");
return;
}
toStartVipInfo(null);
// mPresenter.getVipLevel(0, 200);
break;
......
......@@ -51,7 +51,7 @@
<TextView
android:id="@+id/tv_keyword"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_height="@dimen/all_seach_height"
android:layout_marginEnd="@dimen/all_spacing"
android:layout_weight="1"
android:background="@drawable/shape_gray_r1"
......@@ -64,7 +64,7 @@
android:maxLength="20"
android:maxLines="1"
android:onClick="@{OnClickListener}"
android:padding="@dimen/all_spacing"
android:paddingLeft="@dimen/all_padding"
android:textColor="@color/black_likui"
android:textColorHint="@color/gray_huanggai"
android:textSize="@dimen/all_text_size"/>
......
......@@ -58,7 +58,7 @@
<TextView
android:id="@+id/tv_keyword"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_height="@dimen/all_seach_height"
android:layout_marginEnd="@dimen/all_spacing"
android:layout_weight="1"
android:background="@drawable/shape_gray_r1"
......@@ -71,7 +71,7 @@
android:maxLength="20"
android:maxLines="1"
android:onClick="@{OnClickListener}"
android:padding="@dimen/all_spacing"
android:paddingLeft="@dimen/all_padding"
android:textColor="@color/black_likui"
android:textColorHint="@color/gray_huanggai"
android:textSize="@dimen/all_text_size"/>
......
......@@ -50,7 +50,7 @@
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginEnd="@dimen/all_margin"
android:gravity="center"
android:gravity="center|left"
app:layout_constraintBottom_toTopOf="parent"
app:layout_constraintLeft_toRightOf="@id/btn_back"
app:layout_constraintRight_toRightOf="parent"
......@@ -58,16 +58,21 @@
<EditText
android:id="@+id/et_keyword"
style="@style/searchBarEditor"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_height="@dimen/all_seach_height"
android:layout_marginEnd="@dimen/all_spacing"
android:layout_weight="1"
android:background="@drawable/shape_gray_r1"
android:clickable="true"
android:drawableLeft="@mipmap/ic_search"
android:drawablePadding="@dimen/all_spacing"
android:enabled="true"
android:gravity="center|left"
android:hint="@string/store_search_hint"
android:imeOptions="actionSearch"
android:inputType="text"
android:labelFor="@+id/et_search"
android:saveEnabled="false"
android:maxLength="20"
android:maxLines="1"
android:onClick="@{OnClickListener}"
android:paddingLeft="@dimen/all_padding"
android:textColor="@color/black_likui"
android:textColorHint="@color/gray_huanggai"
android:textSize="@dimen/all_text_size"/>
......
......@@ -58,7 +58,7 @@
android:id="@+id/et_keyword"
style="@style/searchBarEditor"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_height="@dimen/all_seach_height"
android:layout_marginEnd="@dimen/all_spacing"
android:layout_weight="1"
android:focusable="true"
......
......@@ -101,10 +101,6 @@
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"
......
......@@ -11,9 +11,11 @@
<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:gravity="center_vertical"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:orientation="horizontal">
......@@ -25,6 +27,14 @@
android:layout_height="match_parent"
android:layout_weight="1" />
<TextView
style="@style/textView_body_small"
android:id="@+id/userSearch"
android:gravity="center"
android:text="搜索"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
<View
......
......@@ -23,6 +23,7 @@
<dimen name="all_tiny_size">9sp</dimen>
<dimen name="all_title_size">26sp</dimen>
<dimen name="all_padding">10dp</dimen>
<dimen name="all_seach_height">36dp</dimen>
<dimen name="all_padding_left_right">16dp</dimen>
<dimen name="Minus_padding_left_right">-17dp</dimen>
<dimen name="all_text_size_big">22sp</dimen>
......
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