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