|
@@ -1,7 +1,6 @@
|
|
|
package com.miekir.ym.ui.coupon;
|
|
package com.miekir.ym.ui.coupon;
|
|
|
|
|
|
|
|
import android.content.DialogInterface;
|
|
import android.content.DialogInterface;
|
|
|
-import android.content.Intent;
|
|
|
|
|
|
|
|
|
|
import androidx.appcompat.app.AlertDialog;
|
|
import androidx.appcompat.app.AlertDialog;
|
|
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
|
@@ -13,7 +12,6 @@ import com.miekir.common.utils.ToastTool;
|
|
|
import com.miekir.mvp.presenter.InjectPresenter;
|
|
import com.miekir.mvp.presenter.InjectPresenter;
|
|
|
import com.miekir.mvp.view.BaseMvpFragment;
|
|
import com.miekir.mvp.view.BaseMvpFragment;
|
|
|
import com.miekir.ym.R;
|
|
import com.miekir.ym.R;
|
|
|
-import com.miekir.ym.constant.FragmentType;
|
|
|
|
|
import com.miekir.ym.listener.ITopActionListener;
|
|
import com.miekir.ym.listener.ITopActionListener;
|
|
|
import com.miekir.ym.listener.OnRcvScrollListener;
|
|
import com.miekir.ym.listener.OnRcvScrollListener;
|
|
|
import com.miekir.ym.widget.NormalDividerItemDecoration;
|
|
import com.miekir.ym.widget.NormalDividerItemDecoration;
|
|
@@ -28,7 +26,7 @@ public class CouponFragment extends BaseMvpFragment implements ICouponView<Coupo
|
|
|
private static final int PAGE_START = 0;
|
|
private static final int PAGE_START = 0;
|
|
|
private static final int PAGE_SIZE = 20;
|
|
private static final int PAGE_SIZE = 20;
|
|
|
|
|
|
|
|
- private int mTemplateType = FragmentType.DIGITAL;
|
|
|
|
|
|
|
+ private int mTemplateType = CouponBean.TYPE_ALL;
|
|
|
|
|
|
|
|
@InjectPresenter
|
|
@InjectPresenter
|
|
|
CouponPresenter mPresenter;
|
|
CouponPresenter mPresenter;
|
|
@@ -77,7 +75,7 @@ public class CouponFragment extends BaseMvpFragment implements ICouponView<Coupo
|
|
|
srl_template.setOnRefreshListener(() -> {
|
|
srl_template.setOnRefreshListener(() -> {
|
|
|
mIsRefresh = true;
|
|
mIsRefresh = true;
|
|
|
mCurrentPage = PAGE_START;
|
|
mCurrentPage = PAGE_START;
|
|
|
- mPresenter.getTemplateData(mCurrentPage, PAGE_SIZE);
|
|
|
|
|
|
|
+ mPresenter.getCouponData(mCurrentPage, PAGE_SIZE);
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
// 加载更多
|
|
// 加载更多
|
|
@@ -89,7 +87,7 @@ public class CouponFragment extends BaseMvpFragment implements ICouponView<Coupo
|
|
|
if (!srl_template.isRefreshing()) {
|
|
if (!srl_template.isRefreshing()) {
|
|
|
mIsRefresh = false;
|
|
mIsRefresh = false;
|
|
|
srl_template.setRefreshing(true);
|
|
srl_template.setRefreshing(true);
|
|
|
- mPresenter.getTemplateData(mCurrentPage, PAGE_SIZE);
|
|
|
|
|
|
|
+ mPresenter.getCouponData(mCurrentPage, PAGE_SIZE);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
@@ -99,7 +97,7 @@ public class CouponFragment extends BaseMvpFragment implements ICouponView<Coupo
|
|
|
protected void onLazyLoad() {
|
|
protected void onLazyLoad() {
|
|
|
// 获取数据
|
|
// 获取数据
|
|
|
srl_template.setRefreshing(true);
|
|
srl_template.setRefreshing(true);
|
|
|
- mPresenter.getTemplateData(mCurrentPage, PAGE_SIZE);
|
|
|
|
|
|
|
+ mPresenter.getCouponData(mCurrentPage, PAGE_SIZE);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -107,10 +105,6 @@ public class CouponFragment extends BaseMvpFragment implements ICouponView<Coupo
|
|
|
*/
|
|
*/
|
|
|
private void showAdminDialog(int position) {
|
|
private void showAdminDialog(int position) {
|
|
|
CouponBean couponBean = mCouponBeanList.get(position);
|
|
CouponBean couponBean = mCouponBeanList.get(position);
|
|
|
- if (couponBean.isLocal) {
|
|
|
|
|
- // 本地写死的不能删除
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
AlertDialog alertDialog = new AlertDialog.Builder(getActivity())
|
|
AlertDialog alertDialog = new AlertDialog.Builder(getActivity())
|
|
|
.setMessage("选择操作")
|
|
.setMessage("选择操作")
|
|
|
.setPositiveButton("修改", (dialog, which) -> {
|
|
.setPositiveButton("修改", (dialog, which) -> {
|