Commit 60dc818c authored by 陈前's avatar 陈前

Merge remote-tracking branch 'origin/master'

parents ff2c838c 4fe88f23
...@@ -23,6 +23,7 @@ import com.xingdata.zzdpos.ui.login.fragment.bean.LoginReturnBean; ...@@ -23,6 +23,7 @@ import com.xingdata.zzdpos.ui.login.fragment.bean.LoginReturnBean;
import com.xingdata.zzdpos.ui.login.fragment.bean.StoreAddressJsonBean; 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.StoreTypeJsonBean;
import com.xingdata.zzdpos.ui.marketing.integral.IntegralActivity; import com.xingdata.zzdpos.ui.marketing.integral.IntegralActivity;
import com.xingdata.zzdpos.ui.payment.PaymentActivity;
import com.xingdata.zzdpos.ui.splash.SplashActivity; import com.xingdata.zzdpos.ui.splash.SplashActivity;
import com.xingdata.zzdpos.view.PopupWindowDownList; import com.xingdata.zzdpos.view.PopupWindowDownList;
...@@ -137,7 +138,7 @@ public class LoginActivity extends BaseActivity<LoginPresenter, ActivityLoginBin ...@@ -137,7 +138,7 @@ public class LoginActivity extends BaseActivity<LoginPresenter, ActivityLoginBin
promptDialog.dismiss(); promptDialog.dismiss();
//如果sn已经绑定款台,则直接跳转主页 //如果sn已经绑定款台,则直接跳转主页
if (loginReturnBean.getBindSN()) { if (loginReturnBean.getBindSN()) {
startActivity(new Intent(LoginActivity.this, MainActivity.class)); startActivity(new Intent(LoginActivity.this, IntegralActivity.class));
LoginActivity.this.finish(); LoginActivity.this.finish();
return; return;
} }
......
package com.xingdata.zzdpos.ui.marketing.integral; package com.xingdata.zzdpos.ui.marketing.integral;
import android.support.annotation.Nullable; import android.support.annotation.Nullable;
import android.support.v7.widget.LinearLayoutManager;
import android.view.View; import android.view.View;
import android.widget.TextView;
import com.blankj.utilcode.util.ActivityUtils; import com.blankj.utilcode.util.ActivityUtils;
import com.blankj.utilcode.util.LogUtils; import com.blankj.utilcode.util.LogUtils;
...@@ -17,26 +15,12 @@ import com.xingdata.zzdpos.model.Pager; ...@@ -17,26 +15,12 @@ import com.xingdata.zzdpos.model.Pager;
import com.xingdata.zzdpos.model.Ubound; import com.xingdata.zzdpos.model.Ubound;
import com.xingdata.zzdpos.ui.dialog.LoadingDialog; import com.xingdata.zzdpos.ui.dialog.LoadingDialog;
import com.xingdata.zzdpos.ui.dialog.PromptDialog; import com.xingdata.zzdpos.ui.dialog.PromptDialog;
import com.xingdata.zzdpos.ui.marketing.integral.adapter.IntegralAdapter;
import com.xingdata.zzdpos.ui.marketing.integral.adapter.IntegralExchangeAdapter;
import com.xingdata.zzdpos.ui.marketing.integral.dialog.IntegralExchangeDialog;
import com.xingdata.zzdpos.ui.marketing.integral.dialog.IntegralGetDialog;
import com.xingdata.zzdpos.util.OnClickListener; import com.xingdata.zzdpos.util.OnClickListener;
import java.util.ArrayList;
import java.util.List; import java.util.List;
public class IntegralActivity extends BaseActivity<IntegralPresenter, ActivityIntegralBinding> public class IntegralActivity extends BaseActivity<IntegralPresenter, ActivityIntegralBinding>
implements IntegralContract.View { implements IntegralContract.View {
IntegralGetDialog integralGetDialog;
IntegralAdapter integralAdapter;
IntegralExchangeAdapter integralExchangeAdapter;
private Boolean isLoadMore = false;
public static final int NORMAL_TYPE = 1;
public static final int LOADMORE_TYPE = 2;
public static final int REFRESH_TYPE = 3;
LoadingDialog loadingDialog = new LoadingDialog();
private long mExitTime;//控制快速点击
@Override @Override
public int getLayoutId() { public int getLayoutId() {
...@@ -45,81 +29,13 @@ public class IntegralActivity extends BaseActivity<IntegralPresenter, ActivityIn ...@@ -45,81 +29,13 @@ public class IntegralActivity extends BaseActivity<IntegralPresenter, ActivityIn
@Override @Override
public void initView() { public void initView() {
integralAdapter = new IntegralAdapter(R.layout.item_integral, new ArrayList<>()); loadRootFragment(R.id.frg, mPresenter.integralIndexFragment);
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this);
linearLayoutManager.setOrientation(LinearLayoutManager.VERTICAL);
mViewBinding.rvMessage.setLayoutManager(linearLayoutManager);
mViewBinding.rvMessage.setAdapter(integralAdapter);
List<Ubound> list = new ArrayList<>();
Ubound ubound = new Ubound();
ubound.setBoundValAmt(1000l);
ubound.setBoundUseStatus((byte) 0);
ubound.setBoundOrderAmt(10l);
ubound.setBoundUseNum(10000l);
list.add(ubound);
integralExchangeAdapter = new IntegralExchangeAdapter(R.layout.item_integral, list);
LinearLayoutManager linearLayoutManager1 = new LinearLayoutManager(this);
linearLayoutManager1.setOrientation(LinearLayoutManager.VERTICAL);
mViewBinding.rvExchangeMessage.setLayoutManager(linearLayoutManager1);
mViewBinding.rvExchangeMessage.setAdapter(integralExchangeAdapter);
mViewBinding.icTitle.tvTitle.setText("积分规则");
mViewBinding.icTitle.setOnClickListener(new OnClickListener() {
@Override
protected void myOnClickListener(View v) {
ActivityUtils.finishActivity(IntegralActivity.class);
}
});
mViewBinding.setOnClickListener(v -> {
switch (v.getId()) {
case R.id.btn_add: {
integralGetDialog = new IntegralGetDialog();
integralGetDialog.setNowType(1);
integralGetDialog.show(IntegralActivity.this);
}
break;
case R.id.rb_get: {
mViewBinding.rbGet.getPaint().setFakeBoldText(true);
mViewBinding.rbExchange.getPaint().setFakeBoldText(false);
showView(v.getId());
mPresenter.query(1, NORMAL_TYPE, null);
}
break;
case R.id.rb_exchange: {
mViewBinding.rbGet.getPaint().setFakeBoldText(false);
mViewBinding.rbExchange.getPaint().setFakeBoldText(true);
showView(v.getId());
LoadingDialog loadingDialog = new LoadingDialog();
loadingDialog.show(this);
mPresenter.exchangeQuery(loadingDialog);
}
break;
default: {
}
break;
}
});
//set Presenter listener
mViewBinding.srlProduct.setOnRefreshListener(this::refreshProduct);
integralAdapter.setOnLoadMoreListener(this::loadMoreProduct, mViewBinding.rvMessage);
integralAdapter.setOnItemClickListener((adapter, view, position) -> clickProduct
(integralAdapter.getData().get(position)));
integralExchangeAdapter.setOnItemClickListener((adapter, view, position) ->
exchangeClickProduct(integralExchangeAdapter.getData().get(position)));
mPresenter.query(1, NORMAL_TYPE, null);
} }
@Override @Override
public void initComplete(List<Category> list, int nowCategory) { public void initComplete(List<Category> list, int nowCategory) {
if (list.size() <= 0) { mPresenter.integralIndexFragment.initComplete(list, nowCategory);
return;
}
integralGetDialog.setCategoryDate(list, nowCategory);
} }
@Override @Override
...@@ -144,63 +60,24 @@ public class IntegralActivity extends BaseActivity<IntegralPresenter, ActivityIn ...@@ -144,63 +60,24 @@ public class IntegralActivity extends BaseActivity<IntegralPresenter, ActivityIn
@Override @Override
public void querySucc(@Nullable Pager<Gbound> pager, Boolean isLoadMore, int queryType, public void querySucc(@Nullable Pager<Gbound> pager, Boolean isLoadMore, int queryType,
LoadingDialog loadingDialog) { LoadingDialog loadingDialog) {
if (loadingDialog != null) { mPresenter.integralIndexFragment.querySucc(pager, isLoadMore, queryType, loadingDialog);
loadingDialog.dismiss();
}
this.isLoadMore = isLoadMore;
if (pager == null || pager.getList() == null || pager.getList().size() <= 0) {
integralAdapter.setEmptyView(getEmptyView("没有规则"));
}
if (pager.getList() != null) {
switch (queryType) {
case NORMAL_TYPE: {
//正常请求
integralAdapter.setNewData(pager.getList());
}
break;
case LOADMORE_TYPE: {
//加载更多
integralAdapter.addData(pager.getList());
}
break;
case REFRESH_TYPE: {
//刷新请求
integralAdapter.setNewData(pager.getList());
}
break;
}
} }
integralAdapter.setEnableLoadMore(false);
mViewBinding.srlProduct.setRefreshing(false);
}
@Override @Override
public void addSucc(LoadingDialog loadingDialog) { public void addSucc(LoadingDialog loadingDialog) {
mPresenter.query(1, NORMAL_TYPE, loadingDialog); mPresenter.query(1, mPresenter.integralIndexFragment.NORMAL_TYPE, loadingDialog);
} }
@Override @Override
public void updateSucc(LoadingDialog loadingDialog) { public void updateSucc(LoadingDialog loadingDialog) {
mPresenter.query(1, NORMAL_TYPE, loadingDialog); pop();
mPresenter.query(1, mPresenter.integralIndexFragment.NORMAL_TYPE, loadingDialog);
} }
@Override @Override
public void exchangeQuerySucc(Pager<Ubound> uboundPager, LoadingDialog loadingDialog) { public void exchangeQuerySucc(Pager<Ubound> uboundPager, LoadingDialog loadingDialog) {
if (loadingDialog != null) { mPresenter.integralIndexFragment.exchangeQuerySucc(uboundPager, loadingDialog);
loadingDialog.dismiss();
}
if (uboundPager != null && uboundPager.getList() != null) {
// if (uboundPager.getList().size() <= 0) {
// Ubound ubound = new Ubound();
// ubound.setBoundValAmt(1000l);
// ubound.setBoundUseStatus((byte) 0);
// ubound.setBoundOrderAmt(9900l);
// ubound.setBoundUseNum(10L);
// uboundPager.getList().add(ubound);
// }
integralExchangeAdapter.setNewData(uboundPager.getList());
}
} }
@Override @Override
...@@ -208,75 +85,4 @@ public class IntegralActivity extends BaseActivity<IntegralPresenter, ActivityIn ...@@ -208,75 +85,4 @@ public class IntegralActivity extends BaseActivity<IntegralPresenter, ActivityIn
mPresenter.exchangeQuery(loadingDialog); mPresenter.exchangeQuery(loadingDialog);
} }
/**
* 刷新商品
*/
private void refreshProduct() {
integralAdapter.setEnableLoadMore(false);
mPresenter.query(1, REFRESH_TYPE, null);
}
/**
* 加载更多商品
*/
private void loadMoreProduct() {
mViewBinding.srlProduct.setRefreshing(false);
if (isLoadMore) {
mPresenter.query(-1, LOADMORE_TYPE, null);
}
}
/**
* 积分获取页面点击item
*/
private void clickProduct(Gbound gbound) {
if ((System.currentTimeMillis() - mExitTime) > 1000) {
integralGetDialog = new IntegralGetDialog();
loadingDialog.show(this);
integralGetDialog.setData(gbound, loadingDialog);
integralGetDialog.show(this);
mExitTime = System.currentTimeMillis();
} else {
ToastUtils.showLong("您操作太快了");
}
}
/**
* 积分兑换页面点击item
*/
private void exchangeClickProduct(Ubound gbound) {
if ((System.currentTimeMillis() - mExitTime) > 1000) {
IntegralExchangeDialog integralExchangeDialog = new IntegralExchangeDialog();
integralExchangeDialog.setData(gbound);
integralExchangeDialog.show(this);
mExitTime = System.currentTimeMillis();
} else {
ToastUtils.showLong("您操作太快了");
}
}
private View getEmptyView(String str) {
View view = getLayoutInflater().inflate(R.layout.view_empty, null);
((TextView) view.findViewById(R.id.tv_empty)).setText(str);
return view;
}
private void showView(int id) {
switch (id) {
case R.id.rb_get: {
mViewBinding.llGet.setVisibility(View.VISIBLE);
mViewBinding.llExchange.setVisibility(View.GONE);
}
break;
case R.id.rb_exchange: {
mViewBinding.llGet.setVisibility(View.GONE);
mViewBinding.llExchange.setVisibility(View.VISIBLE);
}
break;
}
}
} }
...@@ -8,6 +8,8 @@ import com.xingdata.zzdpos.model.Category; ...@@ -8,6 +8,8 @@ import com.xingdata.zzdpos.model.Category;
import com.xingdata.zzdpos.model.Gbound; import com.xingdata.zzdpos.model.Gbound;
import com.xingdata.zzdpos.model.Ubound; import com.xingdata.zzdpos.model.Ubound;
import com.xingdata.zzdpos.ui.dialog.LoadingDialog; import com.xingdata.zzdpos.ui.dialog.LoadingDialog;
import com.xingdata.zzdpos.ui.marketing.integral.fragment.IntegralGetFragment;
import com.xingdata.zzdpos.ui.marketing.integral.fragment.IntegralIndexFragment;
import java.util.List; import java.util.List;
...@@ -19,7 +21,8 @@ import io.reactivex.functions.Function; ...@@ -19,7 +21,8 @@ import io.reactivex.functions.Function;
public class IntegralPresenter extends IntegralContract.Presenter { public class IntegralPresenter extends IntegralContract.Presenter {
private int number = 1; private int number = 1;
public IntegralIndexFragment integralIndexFragment = new IntegralIndexFragment();
public IntegralGetFragment integralGetFragment = new IntegralGetFragment();
@Override @Override
public void onAttached() { public void onAttached() {
......
...@@ -35,9 +35,9 @@ public class IntegralAdapter extends BaseAdapter<Gbound, ItemIntegralBinding> { ...@@ -35,9 +35,9 @@ public class IntegralAdapter extends BaseAdapter<Gbound, ItemIntegralBinding> {
mViewBinding.tvGet.setText(item.getTruleName()); mViewBinding.tvGet.setText(item.getTruleName());
//开通启用状态 0:正常 1 暂停 默认 0 //开通启用状态 0:正常 1 暂停 默认 0
if (item.getBoundGetStatus() == 0) { if (item.getBoundGetStatus() == 0) {
mViewBinding.tvStatus.setImageResource(R.mipmap.integral_open); mViewBinding.tvStatus.setText("启用");
} else { } else {
mViewBinding.tvStatus.setImageResource(R.mipmap.integral_close); mViewBinding.tvStatus.setText("未启用");
} }
} }
......
...@@ -2,8 +2,6 @@ package com.xingdata.zzdpos.ui.marketing.integral.adapter; ...@@ -2,8 +2,6 @@ package com.xingdata.zzdpos.ui.marketing.integral.adapter;
import android.support.annotation.Nullable; import android.support.annotation.Nullable;
import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseAdapter; import com.xingdata.zzdpos.base.BaseAdapter;
import com.xingdata.zzdpos.databinding.ItemIntegralBinding; import com.xingdata.zzdpos.databinding.ItemIntegralBinding;
import com.xingdata.zzdpos.model.Ubound; import com.xingdata.zzdpos.model.Ubound;
...@@ -22,6 +20,11 @@ public class IntegralExchangeAdapter extends BaseAdapter<Ubound, ItemIntegralBin ...@@ -22,6 +20,11 @@ public class IntegralExchangeAdapter extends BaseAdapter<Ubound, ItemIntegralBin
@Override @Override
protected void convert(ItemIntegralBinding mViewBinding, Ubound item) { protected void convert(ItemIntegralBinding mViewBinding, Ubound item) {
mViewBinding.tvVipTitle.setText("积分面值");
mViewBinding.tvSourceTitle.setText("兑换规则");
mViewBinding.tvVip.setText(item.getBoundValAmt() + "个积分=1元"); mViewBinding.tvVip.setText(item.getBoundValAmt() + "个积分=1元");
//兑换规则 //兑换规则
if (item.getBoundOrderAmt() != null && item.getBoundUseNum() != null) { if (item.getBoundOrderAmt() != null && item.getBoundUseNum() != null) {
...@@ -33,9 +36,9 @@ public class IntegralExchangeAdapter extends BaseAdapter<Ubound, ItemIntegralBin ...@@ -33,9 +36,9 @@ public class IntegralExchangeAdapter extends BaseAdapter<Ubound, ItemIntegralBin
if (item.getBoundUseStatus() != null) { if (item.getBoundUseStatus() != null) {
//开通启用状态 0:正常 1 暂停 默认 0 //开通启用状态 0:正常 1 暂停 默认 0
if (item.getBoundUseStatus() == 0) { if (item.getBoundUseStatus() == 0) {
mViewBinding.tvStatus.setImageResource(R.mipmap.integral_open); mViewBinding.tvStatus.setText("启用");
} else { } else {
mViewBinding.tvStatus.setImageResource(R.mipmap.integral_close); mViewBinding.tvStatus.setText("未启用");
} }
} }
......
...@@ -79,94 +79,7 @@ public class IntegralGetDialog extends BaseDialog<IntegralPresenter, ...@@ -79,94 +79,7 @@ public class IntegralGetDialog extends BaseDialog<IntegralPresenter,
setCancelable(false); setCancelable(false);
mViewBinding.setOnClickListener(
new OnClickListener() {
@Override
protected void myOnClickListener(View v) {
hintKbTwo();
switch (v.getId()) {
case R.id.rd_suspendeds: {
//暂停
gbound.setBoundGetStatus(1);
}
break;
case R.id.rd_starts: {
//启用
gbound.setBoundGetStatus(0);
}
break;
case R.id.rd_gettype_all: {
//通用
showView(v.getId());
gbound.setVipGboundType((byte) 0);
}
break;
case R.id.rd_gettype_category: {
//品类定义
showView(v.getId());
gbound.setVipGboundType((byte) 1);
}
break;
case R.id.rd_gettype_shop: {
//商品定义
showView(v.getId());
gbound.setVipGboundType((byte) 2);
}
break;
case R.id.tv_vip_level_select: {
Realm realm = Realm.getInstance(App.instance.mRealmConfig);
RealmResults<Level> realmResult = realm.where(Level.class)
.findAll();
if (realmResult != null && realmResult.size() > 0) {
initVipLevelOptionPicker(realmResult);
}
}
break;
case R.id.tv_category_select_one: {
mPresenter.initData(getCategory(v.getId()), ONE_CATEGORY);
mViewBinding.tvCategorySelectTwo.setText("");
mViewBinding.tvCategorySelectThree.setText("");
}
break;
case R.id.tv_category_select_two: {
if (nowShopTypeId >= 1) {
mPresenter.initData(getCategory(v.getId()), TWO_CATEGORY);
mViewBinding.tvCategorySelectThree.setText("");
nowShopTypeId = 2;
} else {
ToastUtils.showLong("请先选择第一类品类");
}
}
break;
case R.id.tv_category_select_three: {
if (nowShopTypeId >= 2) {
mPresenter.initData(getCategory(v.getId()), THREE_CATEGORY);
nowShopTypeId = 3;
} else {
ToastUtils.showLong("请先选择第一二类品类");
}
}
break;
default: {
}
break;
}
}
});
if (nowType == 0) {
setShopTypeClick(false);
updateUi();
} else if (nowType == 1) {
setShopTypeClick(true);
mViewBinding.rdSuspendeds.setChecked(true);
gbound.setBoundGetStatus(1);
gbound.setVipGboundType((byte) 0);
}
if (loadingDialog != null) {
loadingDialog.dismiss();
}
} }
......
package com.xingdata.zzdpos.ui.marketing.integral.fragment;
import android.text.TextUtils;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import com.bigkoo.pickerview.OptionsPickerView;
import com.bigkoo.pickerview.listener.CustomListener;
import com.blankj.utilcode.util.LogUtils;
import com.blankj.utilcode.util.ToastUtils;
import com.xingdata.zzdpos.App;
import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseActivity;
import com.xingdata.zzdpos.base.BaseFragment;
import com.xingdata.zzdpos.databinding.DialogIntegralGetSettingBinding;
import com.xingdata.zzdpos.model.Category;
import com.xingdata.zzdpos.model.Gbound;
import com.xingdata.zzdpos.model.Level;
import com.xingdata.zzdpos.ui.dialog.LoadingDialog;
import com.xingdata.zzdpos.ui.marketing.integral.IntegralPresenter;
import com.xingdata.zzdpos.util.ConvertUtil;
import com.xingdata.zzdpos.util.OnClickListener;
import java.util.ArrayList;
import java.util.List;
import io.realm.Realm;
import io.realm.RealmResults;
/**
* 绑定款台界面
* <p>
* 设备没有绑定款台的进行绑定操作
*/
public class IntegralGetFragment extends BaseFragment<IntegralPresenter,
DialogIntegralGetSettingBinding> {
//区分请求类型 正常 加载更多,下拉刷新
public static final int ONE_CATEGORY = 1;
public static final int TWO_CATEGORY = 2;
public static final int THREE_CATEGORY = 3;
//请求商品类别使用的id
private long spuCateIdTwo = -1;
private long spuCateIdThree = -1;
private OptionsPickerView pvCustomOptions;
private List<Category> listCategory = new ArrayList<>();
//积分获取提交给服务器对象
private Gbound gbound = new Gbound();
//ui显示用
private Gbound ShowGbound = new Gbound();
//商品品类提交服务器对象
private Category category = new Category();
//当前为修改还是新增 0为修改1为新增
private int nowType = -1;
//进度对话框
LoadingDialog loadingDialog;
//当前点击商品类型空间id,防止直接点击商品第二三种类型
private int nowShopTypeId = 1;
@Override
public int getLayoutId() {
return R.layout.dialog_integral_get_setting;
}
@Override
public void initView() {
mViewBinding.setOnClickListener(
new OnClickListener() {
@Override
protected void myOnClickListener(View v) {
// hintKbTwo();
switch (v.getId()) {
case R.id.rd_suspendeds: {
//暂停
gbound.setBoundGetStatus(1);
}
break;
case R.id.rd_starts: {
//启用
gbound.setBoundGetStatus(0);
}
break;
case R.id.rd_gettype_all: {
//通用
showView(v.getId());
gbound.setVipGboundType((byte) 0);
}
break;
case R.id.rd_gettype_category: {
//品类定义
showView(v.getId());
gbound.setVipGboundType((byte) 1);
}
break;
case R.id.rd_gettype_shop: {
//商品定义
showView(v.getId());
gbound.setVipGboundType((byte) 2);
}
break;
case R.id.tv_vip_level_select: {
Realm realm = Realm.getInstance(App.instance.mRealmConfig);
RealmResults<Level> realmResult = realm.where(Level.class)
.findAll();
if (realmResult != null && realmResult.size() > 0) {
initVipLevelOptionPicker(realmResult);
}
}
break;
case R.id.tv_category_select_one: {
mPresenter.initData(getCategory(v.getId()), ONE_CATEGORY);
mViewBinding.tvCategorySelectTwo.setText("");
mViewBinding.tvCategorySelectThree.setText("");
}
break;
case R.id.tv_category_select_two: {
if (nowShopTypeId >= 1) {
mPresenter.initData(getCategory(v.getId()), TWO_CATEGORY);
mViewBinding.tvCategorySelectThree.setText("");
nowShopTypeId = 2;
} else {
ToastUtils.showLong("请先选择第一类品类");
}
}
break;
case R.id.tv_category_select_three: {
if (nowShopTypeId >= 2) {
mPresenter.initData(getCategory(v.getId()), THREE_CATEGORY);
nowShopTypeId = 3;
} else {
ToastUtils.showLong("请先选择第一二类品类");
}
}
break;
case R.id.btn_add: {
if (isNullAndSetDate()) {
LoadingDialog loadingDialog = new LoadingDialog();
loadingDialog.show((BaseActivity) getActivity());
if (nowType == 0) {
//修改
mPresenter.update(gbound, loadingDialog);
LogUtils.e("修改");
} else if (nowType == 1) {
//新增
mPresenter.add(gbound, loadingDialog);
LogUtils.e("新增");
}
} else {
ToastUtils.showLong("输入数据不能null");
}
}
break;
default: {
}
break;
}
}
});
if (nowType == 0) {
setShopTypeClick(false);
updateUi();
} else if (nowType == 1) {
setShopTypeClick(true);
mViewBinding.rdSuspendeds.setChecked(true);
gbound.setBoundGetStatus(1);
gbound.setVipGboundType((byte) 0);
}
if (loadingDialog != null) {
loadingDialog.dismiss();
}
}
private void setShopTypeClick(Boolean b) {
mViewBinding.rdGettypeAll.setEnabled(b);
mViewBinding.rdGettypeShop.setEnabled(b);
mViewBinding.rdGettypeCategory.setEnabled(b);
if (b) {
mViewBinding.tvCategorySelectShowNoEdit.setVisibility(View.GONE);
mViewBinding.tvVipLevelSelectShowNoEdit.setVisibility(View.GONE);
mViewBinding.tvCategorySelectOne.setVisibility(View.VISIBLE);
mViewBinding.tvCategorySelectTwo.setVisibility(View.VISIBLE);
mViewBinding.tvCategorySelectThree.setVisibility(View.VISIBLE);
mViewBinding.tvVipLevelSelect.setVisibility(View.VISIBLE);
} else {
mViewBinding.tvCategorySelectShowNoEdit.setVisibility(View.VISIBLE);
mViewBinding.tvVipLevelSelectShowNoEdit.setVisibility(View.VISIBLE);
mViewBinding.tvCategorySelectOne.setVisibility(View.GONE);
mViewBinding.tvCategorySelectTwo.setVisibility(View.GONE);
mViewBinding.tvCategorySelectThree.setVisibility(View.GONE);
mViewBinding.tvVipLevelSelect.setVisibility(View.GONE);
}
}
private void updateUi() {
if (ShowGbound != null && ShowGbound.getTruleName() != null && !(ShowGbound.getTruleName
().equals("")
)) {
mViewBinding.tvRulesName.setText(ShowGbound.getTruleName());
//开通启用状态 0:正常 1 暂停 默认 0
if (ShowGbound.getBoundGetStatus() == 0) {
mViewBinding.rdStarts
.setChecked(true);
} else if (ShowGbound.getBoundGetStatus() == 1) {
mViewBinding.rdSuspendeds.setChecked(true);
}
mViewBinding.tvVipLevelSelectShowNoEdit.setText(ShowGbound.getVipLevelName());
//积分获取类型 0:通用 1:品类定义积分 2:商品定义积分
switch (ShowGbound.getVipGboundType()) {
case 0: {
showView(R.id.rd_gettype_all);
mViewBinding.rdGettypeAll.setChecked(true);
if (ShowGbound.getTransAmt() != null) {
mViewBinding.etIntegralWeight.setText(ConvertUtil.fenToYuanNoPoint
(ShowGbound.getTransAmt()));
}
if (ShowGbound.getBoundExp() != null) {
mViewBinding.etIntegralTimeLimit.setText(ShowGbound.getBoundExp() + "");
}
}
break;
case 1: {
showView(R.id.rd_gettype_category);
mViewBinding.rdGettypeCategory.setChecked(true);
if (ShowGbound.getSpuClaName() != null) {
mViewBinding.tvCategorySelectOne.setText((ShowGbound.getSpuClaName()));
mViewBinding.tvCategorySelectShowNoEdit.setText(ShowGbound.getSpuClaName
() + "/");
}
if (ShowGbound.getSpuGrpName() != null) {
mViewBinding.tvCategorySelectTwo.setText((ShowGbound.getSpuGrpName()));
mViewBinding.tvCategorySelectShowNoEdit.setText(mViewBinding
.tvCategorySelectShowNoEdit.getText().toString() + ShowGbound
.getSpuGrpName() + "/");
}
if (ShowGbound.getSpuCateName() != null) {
mViewBinding.tvCategorySelectThree.setText((ShowGbound.getSpuCateName()));
mViewBinding.tvCategorySelectShowNoEdit.setText(mViewBinding
.tvCategorySelectShowNoEdit.getText().toString() + ShowGbound
.getSpuCateName());
}
if (ShowGbound.getTransAmt() != null) {
mViewBinding.etIntegralCategoryWeight.setText(ConvertUtil
.fenToYuanNoPoint(ShowGbound
.getTransAmt()));
}
if (ShowGbound.getBoundExp() != null) {
mViewBinding.etIntegralCategoryTimeLimit.setText(ShowGbound.getBoundExp()
+ "");
}
}
break;
case 2: {
showView(R.id.rd_gettype_shop);
mViewBinding.rdGettypeShop.setChecked(true);
if (ShowGbound.getBoundExp() != null) {
mViewBinding.etShopTimeLimit.setText(ShowGbound.getBoundExp() + "");
}
}
break;
}
}
}
/**
* 通过用户点击品类等级 构建提交给服务器Category对象
*
* @param id 按钮id
* @return 构建好的Category对象
*/
private Category getCategory(int id) {
switch (id) {
case R.id.tv_category_select_one: {
category = new Category();
}
break;
case R.id.tv_category_select_two: {
category.setSpuCateId(spuCateIdTwo);
}
break;
case R.id.tv_category_select_three: {
category.setSpuCateId(spuCateIdThree);
}
break;
}
return category;
}
/**
* 初始化会员等级选择对话框
*/
private void initVipLevelOptionPicker(RealmResults<Level> realmResult) {//条件选择器初始化,自定义布局
pvCustomOptions = new OptionsPickerView.Builder(getActivity(), new OptionsPickerView
.OnOptionsSelectListener() {
@Override
public void onOptionsSelect(int options1, int option2, int options3, View v) {
gbound.setVipLevel(realmResult.get(options1).getVipLevel());
mViewBinding.tvVipLevelSelect.setText(realmResult.get(options1).getVipLevelName());
}
}).setLayoutRes(R.layout.pickerview_custom_options, new CustomListener() {
@Override
public void customLayout(View v) {
final TextView tvSubmit = v.findViewById(R.id.tv_finish);
ImageView ivCancel = v.findViewById(R.id.iv_cancel);
tvSubmit.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
pvCustomOptions.returnData();
pvCustomOptions.dismiss();
}
});
ivCancel.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
pvCustomOptions.dismiss();
}
});
}
})
.isDialog(true)
.build();
pvCustomOptions.setPicker(realmResult);//添加数据
pvCustomOptions.show();
}
/**
* 初始化商品品类选择对话框
*
* @param list 选择对话框数据
* @param nowList 当前选中的品类索引
*/
private void initCustomOptionPicker(List<Category> list, int nowList) {//条件选择器初始化,自定义布局
pvCustomOptions = new OptionsPickerView.Builder(getActivity(), new OptionsPickerView
.OnOptionsSelectListener() {
@Override
public void onOptionsSelect(int options1, int option2, int options3, View v) {
gbound.setSpuCateId((int) Long.parseLong(list.get(options1).getSpuCateId() + ""));
//返回的分别是三个级别的选中位置
switch (nowList) {
case ONE_CATEGORY: {
mViewBinding.tvCategorySelectOne.setText(listCategory.get(options1)
.getSpuClaName());
spuCateIdTwo = listCategory.get(options1).getSpuCateId();
}
break;
case TWO_CATEGORY: {
mViewBinding.tvCategorySelectTwo.setText(listCategory.get(options1)
.getSpuGrpName());
spuCateIdThree = listCategory.get(options1).getSpuCateId();
}
break;
case THREE_CATEGORY: {
mViewBinding.tvCategorySelectThree.setText(listCategory.get(options1)
.getSpuCateName());
}
break;
}
}
}).setLayoutRes(R.layout.pickerview_custom_options, new CustomListener() {
@Override
public void customLayout(View v) {
final TextView tvSubmit = v.findViewById(R.id.tv_finish);
ImageView ivCancel = v.findViewById(R.id.iv_cancel);
tvSubmit.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
pvCustomOptions.returnData();
pvCustomOptions.dismiss();
}
});
ivCancel.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
pvCustomOptions.dismiss();
}
});
}
})
.isDialog(true)
.build();
pvCustomOptions.setPicker(list);//添加数据
pvCustomOptions.show();
}
/**
* 根据用户点击控制UI控件的隐藏显示
*
* @param id 用户点击的id
*/
private void showView(int id) {
switch (id) {
case R.id.rd_gettype_all: {
mViewBinding.llAll.setVisibility(View.VISIBLE);
mViewBinding.llCategory.setVisibility(View.GONE);
mViewBinding.llShop.setVisibility(View.GONE);
}
break;
case R.id.rd_gettype_category: {
//品类定义
mViewBinding.llAll.setVisibility(View.GONE);
mViewBinding.llCategory.setVisibility(View.VISIBLE);
mViewBinding.llShop.setVisibility(View.GONE);
}
break;
case R.id.rd_gettype_shop: {
//商品定义
mViewBinding.llAll.setVisibility(View.GONE);
mViewBinding.llCategory.setVisibility(View.GONE);
mViewBinding.llShop.setVisibility(View.VISIBLE);
}
break;
}
}
/**
* 请求成功设置数据
*
* @param list
* @param nowList
*/
public void setCategoryDate(List<Category> list, int nowList) {
listCategory = list;
initCustomOptionPicker(list, nowList);
}
/**
* 判断用户输入数据是否为null
*
* @return 输入为null返回false 反之返回true
*/
private boolean isNullAndSetDate() {
if (gbound.getVipGboundType() == null || gbound.getVipLevel() == null) {
return false;
}
switch (gbound.getVipGboundType()) {
case 0: {
if (TextUtils.isEmpty(mViewBinding.etIntegralWeight.getText().toString())
|| TextUtils.isEmpty(mViewBinding.etIntegralTimeLimit.getText().toString
())) {
return false;
} else {
mViewBinding.tvRulesName.setText(mViewBinding.etIntegralWeight.getText()
.toString() +
"元送一个积分");
gbound.setTransAmt(ConvertUtil.yuanToFen(mViewBinding.etIntegralWeight
.getText().toString()));
gbound.setBoundExp(Byte.parseByte(mViewBinding.etIntegralTimeLimit.getText()
.toString()));
}
}
break;
case 1: {
if (TextUtils.isEmpty(mViewBinding.etIntegralCategoryWeight.getText().toString())
|| TextUtils.isEmpty(mViewBinding.etIntegralCategoryTimeLimit.getText()
.toString()) || gbound.getSpuCateId() == -1) {
return false;
} else {
mViewBinding.tvRulesName.setText(mViewBinding.etIntegralCategoryWeight
.getText().toString() +
"元送一个积分");
gbound.setTransAmt(ConvertUtil.yuanToFen(mViewBinding
.etIntegralCategoryWeight.getText().toString()));
gbound.setBoundExp(Byte.parseByte(mViewBinding.etIntegralCategoryTimeLimit
.getText().toString()));
}
}
break;
case 2: {
if (TextUtils.isEmpty(mViewBinding.etShopTimeLimit.getText().toString())) {
return false;
} else {
mViewBinding.tvRulesName.setText("商品定义规则");
gbound.setBoundExp(Byte.parseByte(mViewBinding.etShopTimeLimit.getText()
.toString()));
}
}
break;
}
gbound.setTruleName(mViewBinding.tvRulesName.getText().toString());
return true;
}
/**
* @param gbound
*/
public void setData(Gbound gbound, LoadingDialog loadingDialog) {
this.gbound = gbound.clone();
this.ShowGbound = gbound;
this.loadingDialog = loadingDialog;
//置状态为修改状态
setNowType(0);
}
public void setNowType(int nowType) {
this.nowType = nowType;
}
//
// /**
// * 显示软键盘,Dialog使用
// */
// public void hintKbTwo() {
// View view = getTopFragment().getCurrentFocus();
// if (view == null) {
// return;
// }
// if (view instanceof TextView) {
// InputMethodManager mInputMethodManager = (InputMethodManager) getContext()
// .getSystemService(Context.INPUT_METHOD_SERVICE);
// mInputMethodManager.hideSoftInputFromWindow(view.getWindowToken(), InputMethodManager
// .RESULT_UNCHANGED_SHOWN);
// }
// }
// @Override
// public void dismiss() {
// hintKbTwo();
// super.dismiss();
// }
}
package com.xingdata.zzdpos.ui.marketing.integral.fragment;
import android.support.annotation.Nullable;
import android.support.v7.widget.LinearLayoutManager;
import android.view.View;
import android.widget.TextView;
import com.blankj.utilcode.util.ActivityUtils;
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.FragmentIntegralMainBinding;
import com.xingdata.zzdpos.model.Category;
import com.xingdata.zzdpos.model.Gbound;
import com.xingdata.zzdpos.model.Pager;
import com.xingdata.zzdpos.model.Ubound;
import com.xingdata.zzdpos.ui.dialog.LoadingDialog;
import com.xingdata.zzdpos.ui.marketing.integral.IntegralActivity;
import com.xingdata.zzdpos.ui.marketing.integral.IntegralPresenter;
import com.xingdata.zzdpos.ui.marketing.integral.adapter.IntegralAdapter;
import com.xingdata.zzdpos.ui.marketing.integral.adapter.IntegralExchangeAdapter;
import com.xingdata.zzdpos.ui.marketing.integral.dialog.IntegralExchangeDialog;
import com.xingdata.zzdpos.util.OnClickListener;
import java.util.ArrayList;
import java.util.List;
/**
* 绑定款台界面
* <p>
* 设备没有绑定款台的进行绑定操作
*/
public class IntegralIndexFragment extends BaseFragment<IntegralPresenter,
FragmentIntegralMainBinding> {
// IntegralGetDialog integralGetDialog;
IntegralAdapter integralAdapter;
IntegralExchangeAdapter integralExchangeAdapter;
private Boolean isLoadMore = false;
public static final int NORMAL_TYPE = 1;
public static final int LOADMORE_TYPE = 2;
public static final int REFRESH_TYPE = 3;
LoadingDialog loadingDialog = new LoadingDialog();
private long mExitTime;//控制快速点击
@Override
public int getLayoutId() {
return R.layout.fragment_integral_main;
}
@Override
public void initView() {
mViewBinding.icTitle.tvTitle.setText("积分规则");
mViewBinding.icTitle.setOnClickListener(new OnClickListener() {
@Override
protected void myOnClickListener(View v) {
ActivityUtils.finishActivity(IntegralActivity.class);
}
});
integralAdapter = new IntegralAdapter(R.layout.item_integral, new ArrayList<>());
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(getActivity());
linearLayoutManager.setOrientation(LinearLayoutManager.VERTICAL);
mViewBinding.rvMessage.setLayoutManager(linearLayoutManager);
mViewBinding.rvMessage.setAdapter(integralAdapter);
List<Ubound> list = new ArrayList<>();
Ubound ubound = new Ubound();
ubound.setBoundValAmt(1000l);
ubound.setBoundUseStatus((byte) 0);
ubound.setBoundOrderAmt(10l);
ubound.setBoundUseNum(10000l);
list.add(ubound);
integralExchangeAdapter = new IntegralExchangeAdapter(R.layout.item_integral, list);
LinearLayoutManager linearLayoutManager1 = new LinearLayoutManager(getActivity());
linearLayoutManager1.setOrientation(LinearLayoutManager.VERTICAL);
mViewBinding.rvExchangeMessage.setLayoutManager(linearLayoutManager1);
mViewBinding.rvExchangeMessage.setAdapter(integralExchangeAdapter);
mViewBinding.setOnClickListener(v -> {
switch (v.getId()) {
case R.id.btn_add: {
mPresenter.integralGetFragment.setNowType(1);
start(mPresenter.integralGetFragment);
// integralGetDialog = new IntegralGetDialog();
// integralGetDialog.setNowType(1);
// integralGetDialog.show((BaseActivity) getActivity());
}
break;
case R.id.rb_get: {
mViewBinding.rbGet.getPaint().setFakeBoldText(true);
mViewBinding.rbExchange.getPaint().setFakeBoldText(false);
showView(v.getId());
mPresenter.query(1, NORMAL_TYPE, null);
}
break;
case R.id.rb_exchange: {
mViewBinding.rbGet.getPaint().setFakeBoldText(false);
mViewBinding.rbExchange.getPaint().setFakeBoldText(true);
showView(v.getId());
LoadingDialog loadingDialog = new LoadingDialog();
loadingDialog.show((BaseActivity) getActivity());
mPresenter.exchangeQuery(loadingDialog);
}
break;
default: {
}
break;
}
});
//set Presenter listener
mViewBinding.srlProduct.setOnRefreshListener(this::refreshProduct);
integralAdapter.setOnLoadMoreListener(this::loadMoreProduct, mViewBinding.rvMessage);
integralAdapter.setOnItemClickListener((adapter, view, position) -> clickProduct
(integralAdapter.getData().get(position)));
integralExchangeAdapter.setOnItemClickListener((adapter, view, position) ->
exchangeClickProduct(integralExchangeAdapter.getData().get(position)));
mPresenter.query(1, NORMAL_TYPE, null);
}
public void initComplete(List<Category> list, int nowCategory) {
if (list.size() <= 0) {
return;
}
mPresenter.integralGetFragment.setCategoryDate(list, nowCategory);
}
public void querySucc(@Nullable Pager<Gbound> pager, Boolean isLoadMore, int queryType,
LoadingDialog loadingDialog) {
if (loadingDialog != null) {
loadingDialog.dismiss();
}
this.isLoadMore = isLoadMore;
if (pager == null || pager.getList() == null || pager.getList().size() <= 0) {
integralAdapter.setEmptyView(getEmptyView("没有规则"));
}
if (pager.getList() != null) {
switch (queryType) {
case NORMAL_TYPE: {
//正常请求
integralAdapter.setNewData(pager.getList());
}
break;
case LOADMORE_TYPE: {
//加载更多
integralAdapter.addData(pager.getList());
}
break;
case REFRESH_TYPE: {
//刷新请求
integralAdapter.setNewData(pager.getList());
}
break;
}
}
integralAdapter.setEnableLoadMore(false);
mViewBinding.srlProduct.setRefreshing(false);
}
public void exchangeQuerySucc(Pager<Ubound> uboundPager, LoadingDialog loadingDialog) {
if (loadingDialog != null) {
loadingDialog.dismiss();
}
if (uboundPager != null && uboundPager.getList() != null) {
integralExchangeAdapter.setNewData(uboundPager.getList());
}
}
/**
* 刷新商品
*/
private void refreshProduct() {
integralAdapter.setEnableLoadMore(false);
mPresenter.query(1, REFRESH_TYPE, null);
}
/**
* 加载更多商品
*/
private void loadMoreProduct() {
mViewBinding.srlProduct.setRefreshing(false);
if (isLoadMore) {
mPresenter.query(-1, LOADMORE_TYPE, null);
}
}
/**
* 积分获取页面点击item
*/
private void clickProduct(Gbound gbound) {
if ((System.currentTimeMillis() - mExitTime) > 1000) {
// integralGetDialog = new IntegralGetDialog();
loadingDialog.show((BaseActivity) getActivity());
mPresenter.integralGetFragment.setData(gbound, loadingDialog);
start(mPresenter.integralGetFragment);
// integralGetDialog.show((BaseActivity) getActivity());
mExitTime = System.currentTimeMillis();
} else {
ToastUtils.showLong("您操作太快了");
}
}
/**
* 积分兑换页面点击item
*/
private void exchangeClickProduct(Ubound gbound) {
if ((System.currentTimeMillis() - mExitTime) > 1000) {
IntegralExchangeDialog integralExchangeDialog = new IntegralExchangeDialog();
integralExchangeDialog.setData(gbound);
integralExchangeDialog.show((BaseActivity) getActivity());
mExitTime = System.currentTimeMillis();
} else {
ToastUtils.showLong("您操作太快了");
}
}
private View getEmptyView(String str) {
View view = getLayoutInflater().inflate(R.layout.view_empty, null);
((TextView) view.findViewById(R.id.tv_empty)).setText(str);
return view;
}
private void showView(int id) {
switch (id) {
case R.id.rb_get: {
mViewBinding.llGet.setVisibility(View.VISIBLE);
mViewBinding.llExchange.setVisibility(View.GONE);
}
break;
case R.id.rb_exchange: {
mViewBinding.llGet.setVisibility(View.GONE);
mViewBinding.llExchange.setVisibility(View.VISIBLE);
}
break;
}
}
}
package com.xingdata.zzdpos.ui.settle; package com.xingdata.zzdpos.ui.settle;
import com.blankj.utilcode.util.ActivityUtils;
import com.xingdata.zzdpos.C; import com.xingdata.zzdpos.C;
import com.xingdata.zzdpos.R; import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseActivity; import com.xingdata.zzdpos.base.BaseActivity;
...@@ -9,6 +10,7 @@ import com.xingdata.zzdpos.model.Saleorder; ...@@ -9,6 +10,7 @@ import com.xingdata.zzdpos.model.Saleorder;
import com.xingdata.zzdpos.model.Ticket; import com.xingdata.zzdpos.model.Ticket;
import com.xingdata.zzdpos.model.Vip; import com.xingdata.zzdpos.model.Vip;
import com.xingdata.zzdpos.ui.dialog.LoadingDialog; import com.xingdata.zzdpos.ui.dialog.LoadingDialog;
import com.xingdata.zzdpos.ui.main.MainActivity;
import com.xingdata.zzdpos.ui.settle.fragment.CashPayFragment; import com.xingdata.zzdpos.ui.settle.fragment.CashPayFragment;
import com.xingdata.zzdpos.ui.settle.fragment.PayResultFragment; import com.xingdata.zzdpos.ui.settle.fragment.PayResultFragment;
import com.xingdata.zzdpos.ui.settle.fragment.SettleFragment; import com.xingdata.zzdpos.ui.settle.fragment.SettleFragment;
...@@ -121,7 +123,7 @@ public class SettleActivity extends BaseActivity<SettlePresenter, ActivitySettle ...@@ -121,7 +123,7 @@ public class SettleActivity extends BaseActivity<SettlePresenter, ActivitySettle
@Override @Override
public void backToMainActivity() { public void backToMainActivity() {
//TODO 返回主页面 ActivityUtils.startActivity(this, MainActivity.class);
} }
} }
...@@ -18,41 +18,41 @@ public class PayAdapter extends BaseAdapter<Pay, ItemPayBinding> { ...@@ -18,41 +18,41 @@ public class PayAdapter extends BaseAdapter<Pay, ItemPayBinding> {
@Override @Override
protected void convert(ItemPayBinding mViewBinding, Pay item) { protected void convert(ItemPayBinding mViewBinding, Pay item) {
// int resLogo, resBackground; int resLogo, resBackground;
// switch (item.getPayType()) { switch (item.getPayType()) {
// case C.PAY_CHANNEL.CASH: case C.PAY_CHANNEL.CASH:
// resLogo = R.mipmap.pay_cash; resLogo = R.mipmap.pay_cash;
// resBackground = R.color.red_diaochan; resBackground = R.color.red_diaochan;
// break; break;
// case C.PAY_CHANNEL.WECHAT: case C.PAY_CHANNEL.WECHAT:
// resLogo = R.mipmap.pay_wechat; resLogo = R.mipmap.pay_wechat;
// resBackground = R.color.green_kongrun; resBackground = R.color.green_kongrun;
// break; break;
// case C.PAY_CHANNEL.ALI: case C.PAY_CHANNEL.ALI:
// resLogo = R.mipmap.pay_alipay; resLogo = R.mipmap.pay_alipay;
// resBackground = R.color.blue_yuefei; resBackground = R.color.blue_yuefei;
// break; break;
// case C.PAY_CHANNEL.BANK: case C.PAY_CHANNEL.BANK:
// resLogo = R.mipmap.pay_card; resLogo = R.mipmap.pay_card;
// resBackground = R.color.cyan_liubei; resBackground = R.color.cyan_liubei;
// break; break;
// case C.PAY_CHANNEL.CARD: case C.PAY_CHANNEL.CARD:
// resLogo = R.mipmap.pay_membershipcard; resLogo = R.mipmap.pay_membershipcard;
// resBackground = R.color.yellow_huangxin; resBackground = R.color.yellow_huangxin;
// break; break;
// case C.PAY_CHANNEL.TALLY: case C.PAY_CHANNEL.TALLY:
// resLogo = R.mipmap.pay_credit; resLogo = R.mipmap.pay_credit;
// resBackground = R.color.purple_yanqing; resBackground = R.color.purple_yanqing;
// break; break;
// default: default:
// resLogo = R.mipmap.pay_cash; resLogo = R.mipmap.pay_cash;
// resBackground = R.color.red_diaochan; resBackground = R.color.red_diaochan;
// break; break;
// } }
// mViewBinding.ivLogo.setImageResource(resLogo); mViewBinding.ivLogo.setImageResource(resLogo);
//
// GenericDraweeHierarchy hierarchy = mViewBinding.ivBackground.getHierarchy(); GenericDraweeHierarchy hierarchy = mViewBinding.ivBackground.getHierarchy();
// hierarchy.setBackgroundImage(mContext.getResources().getDrawable(resBackground)); hierarchy.setBackgroundImage(mContext.getResources().getDrawable(resBackground));
// mViewBinding.ivBackground.setHierarchy(hierarchy); mViewBinding.ivBackground.setHierarchy(hierarchy);
} }
} }
...@@ -59,7 +59,7 @@ public class CashPayFragment extends BaseFragment<SettlePresenter, FragmentPayCa ...@@ -59,7 +59,7 @@ public class CashPayFragment extends BaseFragment<SettlePresenter, FragmentPayCa
* @param payAmt 实付价格 * @param payAmt 实付价格
*/ */
private void clickSettle(Long payAmt) { private void clickSettle(Long payAmt) {
if (payAmt - mOrderAmt > 0) { if (payAmt - mOrderAmt >= 0) {
mPresenter.payInCash(payAmt, payAmt - mOrderAmt); mPresenter.payInCash(payAmt, payAmt - mOrderAmt);
} }
} }
......
package com.xingdata.zzdpos.ui.store;
import com.xingdata.zzdpos.base.BasePresenter;
import com.xingdata.zzdpos.base.BaseView;
interface StoreContract {
interface View extends BaseView {
}
abstract class Presenter extends BasePresenter<View> {
}
}
...@@ -10,197 +10,18 @@ ...@@ -10,197 +10,18 @@
<android.support.constraint.ConstraintLayout <android.support.constraint.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="@color/white" android:background="@color/white">
tools:context="com.xingdata.zzdpos.ui.marketing.integral.IntegralActivity">
<include <FrameLayout
android:id="@+id/ic_title" android:id="@+id/frg"
layout="@layout/title"/>
<LinearLayout
android:id="@+id/btn_add"
android:layout_width="0dp"
android:layout_height="0dp"
android:background="@drawable/singleline_white_gray"
android:gravity="center"
android:onClick="@{OnClickListener}"
android:orientation="horizontal"
app:layout_constraintBottom_toTopOf="@id/ll_menu"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/ic_title"
app:layout_constraintVertical_weight="@integer/all_top_weight">
<ImageView
android:id="@+id/iv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@mipmap/but_add"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/all_padding"
android:text="添加获取规则"
android:textColor="@color/red_guanyu"
android:textSize="@dimen/text_three_title"/>
</LinearLayout>
<LinearLayout
android:id="@+id/ll_menu"
android:layout_width="0dp"
android:layout_height="49dp"
android:background="@color/white"
android:gravity="center"
android:orientation="horizontal"
app:layout_constraintBottom_toBottomOf="@id/cl_bottom"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/btn_add"
app:layout_constraintVertical_weight="2.5">
<RadioGroup
android:layout_width="match_parent"
android:layout_height="match_parent"
android:checkedButton="@id/rb_get"
android:gravity="center"
android:orientation="horizontal">
<RadioButton
android:id="@+id/rb_get"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/all_margin"
android:layout_marginRight="@dimen/all_margin"
android:layout_weight="1"
android:background="@drawable/radio_select"
android:button="@null"
android:gravity="center"
android:onClick="@{OnClickListener}"
android:padding="@dimen/all_padding"
android:text="获取规则"
android:textColor="@drawable/radio_select"
android:textSize="@dimen/et_textsize"/>
<RadioButton
android:id="@+id/rb_exchange"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/all_margin"
android:layout_marginRight="@dimen/all_margin"
android:layout_weight="1"
android:background="@drawable/radio_select"
android:button="@null"
android:gravity="center"
android:onClick="@{OnClickListener}"
android:padding="@dimen/all_padding"
android:text="兑换规则"
android:textColor="@drawable/radio_select"
android:textSize="@dimen/et_textsize"/>
</RadioGroup>
</LinearLayout>
<LinearLayout
android:id="@+id/cl_bottom"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="0dp" android:layout_height="0dp"
android:orientation="vertical"
android:padding="@dimen/padding_big"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent" app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/ll_menu" app:layout_constraintTop_toTopOf="parent"></FrameLayout>
app:layout_constraintVertical_weight="22">
<LinearLayout
android:id="@+id/ll_get"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white"
android:orientation="vertical">
<android.support.v4.widget.SwipeRefreshLayout
android:id="@+id/srl_product"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v7.widget.RecyclerView
android:id="@+id/rv_message"
android:layout_width="match_parent"
android:layout_height="match_parent">
</android.support.v7.widget.RecyclerView>
</android.support.v4.widget.SwipeRefreshLayout>
</LinearLayout>
<LinearLayout
android:id="@+id/ll_exchange"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white"
android:orientation="vertical"
android:padding="@dimen/cl_padding"
android:visibility="gone">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="3"
android:text="积分面值"
android:textSize="@dimen/et_textsize"/>
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="5"
android:text="兑换规则"
android:textSize="@dimen/et_textsize"/>
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="3"
android:text="备注"
android:textSize="@dimen/et_textsize"/>
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:text="状态 "
android:textSize="@dimen/et_textsize"/>
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="@dimen/view_line_height"
android:layout_marginTop="@dimen/all_margin"
android:background="@color/vip_line"
android:paddingBottom="@dimen/all_padding"/>
<android.support.v7.widget.RecyclerView
android:id="@+id/rv_exchange_message"
android:layout_width="match_parent"
android:layout_height="match_parent">
</android.support.v7.widget.RecyclerView>
</LinearLayout>
</LinearLayout>
</android.support.constraint.ConstraintLayout> </android.support.constraint.ConstraintLayout>
......
...@@ -571,5 +571,15 @@ ...@@ -571,5 +571,15 @@
android:textColor="@color/black" android:textColor="@color/black"
android:textSize="@dimen/et_textsize"/> android:textSize="@dimen/et_textsize"/>
</LinearLayout> </LinearLayout>
<Button
android:id="@+id/btn_add"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/red_guanyu"
android:text="添加"
android:textColor="@color/white"
android:onClick="@{OnClickListener}"
android:textSize="@dimen/et_textsize"/>
</LinearLayout> </LinearLayout>
</layout> </layout>
\ No newline at end of file
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
android:background="@color/gray_zhouyu" android:background="@color/gray_zhouyu"
tools:context="com.example.administrator.tangkupos.CasherFragment"> tools:context="com.example.administrator.tangkupos.CasherFragment">
<!-- TODO: Update blank fragment layout --> <!-- TODO: Update blank fragmfragment_integral_indexyout -->
<android.support.constraint.Guideline <android.support.constraint.Guideline
android:id="@+id/guideline" android:id="@+id/guideline"
android:layout_width="wrap_content" android:layout_width="wrap_content"
......
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:app="http://schemas.android.com/apk/res-auto">
<data>
<variable
name="OnClickListener"
type="android.view.View.OnClickListener"></variable>
</data>
<android.support.constraint.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white">
<include
android:id="@+id/ic_title"
layout="@layout/title"/>
<LinearLayout
android:id="@+id/btn_add"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="@drawable/singleline_white_gray"
android:gravity="center"
android:onClick="@{OnClickListener}"
android:orientation="horizontal"
app:layout_constraintBottom_toTopOf="@id/ll_menu"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@+id/ic_title">
<ImageView
android:id="@+id/iv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@mipmap/but_add"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/all_padding"
android:text="添加获取规则"
android:textColor="@color/red_guanyu"
android:textSize="@dimen/text_three_title"/>
</LinearLayout>
<LinearLayout
android:id="@+id/ll_menu"
android:layout_width="0dp"
android:layout_height="49dp"
android:background="@color/white"
android:gravity="center"
android:orientation="horizontal"
app:layout_constraintBottom_toBottomOf="@id/cl_bottom"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/btn_add"
app:layout_constraintVertical_weight="2.5">
<RadioGroup
android:layout_width="match_parent"
android:layout_height="match_parent"
android:checkedButton="@id/rb_get"
android:gravity="center"
android:orientation="horizontal">
<RadioButton
android:id="@+id/rb_get"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/all_margin"
android:layout_marginRight="@dimen/all_margin"
android:layout_weight="1"
android:background="@drawable/radio_select"
android:button="@null"
android:gravity="center"
android:onClick="@{OnClickListener}"
android:padding="@dimen/all_padding"
android:text="获取规则"
android:textColor="@drawable/radio_select"
android:textSize="@dimen/et_textsize"/>
<RadioButton
android:id="@+id/rb_exchange"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/all_margin"
android:layout_marginRight="@dimen/all_margin"
android:layout_weight="1"
android:background="@drawable/radio_select"
android:button="@null"
android:gravity="center"
android:onClick="@{OnClickListener}"
android:padding="@dimen/all_padding"
android:text="兑换规则"
android:textColor="@drawable/radio_select"
android:textSize="@dimen/et_textsize"/>
</RadioGroup>
</LinearLayout>
<LinearLayout
android:id="@+id/cl_bottom"
android:layout_width="0dp"
android:layout_height="0dp"
android:background="@color/gray_zhouyu"
android:orientation="vertical"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/ll_menu"
app:layout_constraintVertical_weight="22">
<LinearLayout
android:id="@+id/ll_get"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/gray_zhouyu"
android:orientation="vertical"
android:padding="@dimen/all_padding">
<android.support.v4.widget.SwipeRefreshLayout
android:id="@+id/srl_product"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v7.widget.RecyclerView
android:id="@+id/rv_message"
android:layout_width="match_parent"
android:layout_height="match_parent">
</android.support.v7.widget.RecyclerView>
</android.support.v4.widget.SwipeRefreshLayout>
</LinearLayout>
<LinearLayout
android:id="@+id/ll_exchange"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/gray_zhouyu"
android:orientation="vertical"
android:padding="@dimen/all_padding"
android:visibility="gone">
<android.support.v7.widget.RecyclerView
android:id="@+id/rv_exchange_message"
android:layout_width="match_parent"
android:layout_height="match_parent">
</android.support.v7.widget.RecyclerView>
</LinearLayout>
</LinearLayout>
</android.support.constraint.ConstraintLayout>
</layout>
\ No newline at end of file
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
android:background="@color/gray_zhouyu" android:background="@color/gray_zhouyu"
tools:context="com.example.administrator.tangkupos.CasherFragment"> tools:context="com.example.administrator.tangkupos.CasherFragment">
<!-- TODO: Update blank fragment layout --> <!-- TODO: Update blank fragmfragment_integral_indexyout -->
<android.support.constraint.Guideline <android.support.constraint.Guideline
android:id="@+id/guideline" android:id="@+id/guideline"
android:layout_width="wrap_content" android:layout_width="wrap_content"
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
android:background="@color/gray_zhouyu" android:background="@color/gray_zhouyu"
tools:context="com.example.administrator.tangkupos.CasherFragment"> tools:context="com.example.administrator.tangkupos.CasherFragment">
<!-- TODO: Update blank fragment layout --> <!-- TODO: Update blank fragmfragment_integral_indexyout -->
<android.support.constraint.Guideline <android.support.constraint.Guideline
android:id="@+id/guideline" android:id="@+id/guideline"
android:layout_width="wrap_content" android:layout_width="wrap_content"
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<layout> <layout>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/cv_item" android:id="@+id/cv_item"
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:layout_marginTop="@dimen/all_padding"
android:paddingTop="@dimen/all_padding" android:background="@color/gray_zhouyu"
android:paddingBottom="@dimen/all_padding"
android:orientation="horizontal"> android:orientation="horizontal">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@mipmap/integral_bg"
android:orientation="horizontal"
android:padding="@dimen/all_padding">
<TextView
android:id="@+id/tv_get"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:gravity="center"
android:text="满100送一个积分"
android:textColor="@color/white"
android:textSize="@dimen/text_secondary_title"/>
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/all_padding"
android:layout_marginRight="@dimen/all_padding"
android:layout_marginTop="55dp">
<LinearLayout
android:id="@+id/ll_vip"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:orientation="horizontal"
android:padding="@dimen/all_margin">
<TextView
android:id="@+id/tv_vip_title"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="适用会员"
android:textColor="@color/black_baozheng"
android:textSize="@dimen/et_textsize"/>
<TextView <TextView
android:id="@+id/tv_vip" android:id="@+id/tv_vip"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="3" android:layout_weight="3"
android:text="适用会员" android:gravity="right"
android:text="金牌会员"
android:textColor="@color/black_baozheng"
android:textSize="@dimen/et_textsize"/> android:textSize="@dimen/et_textsize"/>
</LinearLayout>
<LinearLayout
android:id="@+id/ll_source"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/ll_vip"
android:background="@color/white"
android:orientation="horizontal"
android:padding="@dimen/all_margin">
<TextView <TextView
android:id="@+id/tv_source" android:id="@+id/tv_source_title"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="5" android:layout_weight="1"
android:text="来源品类" android:text="来源品类"
android:textSize="@dimen/et_textsize"/> android:textColor="@color/black_baozheng"
android:textSize="@dimen/et_textsize"
/>
<TextView <TextView
android:id="@+id/tv_get" android:id="@+id/tv_source"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="3" android:layout_weight="3"
android:text="获取规则" android:gravity="right"
android:singleLine="true"
android:text="金牌会员"
android:textColor="@color/black_baozheng"
android:textSize="@dimen/et_textsize"/> android:textSize="@dimen/et_textsize"/>
</LinearLayout>
<ImageView <LinearLayout
android:id="@+id/tv_status" android:id="@+id/ll_status"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/ll_source"
android:background="@color/white"
android:orientation="horizontal"
android:padding="@dimen/all_margin">
<TextView
android:id="@+id/tv_status_title"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
android:src="@mipmap/integral_open" android:text="启用状态"
android:textColor="@color/black_baozheng"
android:textSize="@dimen/et_textsize"/>
<TextView
android:id="@+id/tv_status"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="3"
android:gravity="right"
android:text="启用状态"
android:textColor="@color/black_baozheng"
android:textSize="@dimen/et_textsize"/> android:textSize="@dimen/et_textsize"/>
</LinearLayout> </LinearLayout>
</RelativeLayout>
<!--<TextView-->
<!--android:id="@+id/tv_source"-->
<!--android:layout_width="0dp"-->
<!--android:layout_height="wrap_content"-->
<!--android:layout_weight="5"-->
<!--android:text="来源品类"-->
<!--android:textSize="@dimen/et_textsize"/>-->
<!--<TextView-->
<!--android:id="@+id/tv_get"-->
<!--android:layout_width="0dp"-->
<!--android:layout_height="wrap_content"-->
<!--android:layout_weight="3"-->
<!--android:text="获取规则"-->
<!--android:textSize="@dimen/et_textsize"/>-->
<!--<ImageView-->
<!--android:id="@+id/tv_status"-->
<!--android:layout_width="0dp"-->
<!--android:layout_height="wrap_content"-->
<!--android:layout_weight="1"-->
<!--android:src="@mipmap/integral_open"-->
<!--android:textSize="@dimen/et_textsize"/>-->
</RelativeLayout>
</layout> </layout>
\ No newline at end of file
...@@ -17,11 +17,11 @@ ...@@ -17,11 +17,11 @@
android:orientation="horizontal"> android:orientation="horizontal">
<ImageView <ImageButton
android:id="@+id/iv_back" android:id="@+id/iv_back"
android:layout_width="@dimen/title_height" android:layout_width="?attr/actionBarSize"
android:layout_height="wrap_content" android:layout_height="match_parent"
android:gravity="center" android:background="@color/transparent"
android:onClick="@{onClickListener}" android:onClick="@{onClickListener}"
android:padding="@dimen/all_margin" android:padding="@dimen/all_margin"
android:src="@mipmap/back_black"/> android:src="@mipmap/back_black"/>
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
android:layout_centerInParent="true" android:layout_centerInParent="true"
android:text="标题" android:text="标题"
android:textColor="@color/black_baozheng" android:textColor="@color/black_baozheng"
android:textSize="@dimen/text_secondary_title" /> android:textSize="@dimen/text_secondary_title"/>
</RelativeLayout> </RelativeLayout>
......
...@@ -12,18 +12,19 @@ ...@@ -12,18 +12,19 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/title_height" android:layout_height="?attr/actionBarSize"
android:background="@drawable/singleline" android:background="@drawable/singleline"
android:orientation="horizontal"> android:orientation="horizontal">
<ImageView <ImageButton
android:id="@+id/iv_back" android:id="@+id/iv_back"
android:layout_width="@dimen/title_height" android:layout_width="?attr/actionBarSize"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="@color/transparent"
android:gravity="center" android:gravity="center"
android:onClick="@{onClickListener}" android:onClick="@{onClickListener}"
android:padding="16dp" android:padding="@dimen/all_margin"
android:src="@mipmap/back_white"/> android:src="@mipmap/back_white"/>
<TextView <TextView
......
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