Commit 64c78f04 authored by 王海's avatar 王海

积分规则修改

parent 4fe88f23
...@@ -3,6 +3,7 @@ package com.xingdata.zzdpos.model; ...@@ -3,6 +3,7 @@ package com.xingdata.zzdpos.model;
import com.alibaba.fastjson.annotation.JSONField; import com.alibaba.fastjson.annotation.JSONField;
import com.bigkoo.pickerview.model.IPickerViewData; import com.bigkoo.pickerview.model.IPickerViewData;
import com.xingdata.zzdpos.base.BaseBean; import com.xingdata.zzdpos.base.BaseBean;
import com.xingdata.zzdpos.ui.marketing.integral.fragment.IntegralGetFragment;
/** /**
* Created by Administrator on 2017/11/27. * Created by Administrator on 2017/11/27.
...@@ -132,15 +133,15 @@ public class Category implements BaseBean, IPickerViewData { ...@@ -132,15 +133,15 @@ public class Category implements BaseBean, IPickerViewData {
@Override @Override
public String getPickerViewText() { public String getPickerViewText() {
switch (nowCategory) { switch (nowCategory) {
// case IntegralGetDialog.ONE_CATEGORY: { case IntegralGetFragment.ONE_CATEGORY: {
// return getSpuClaName() + ""; return getSpuClaName() + "";
// } }
// case IntegralGetDialog.TWO_CATEGORY: { case IntegralGetFragment.TWO_CATEGORY: {
// return getSpuGrpName() + ""; return getSpuGrpName() + "";
// } }
// case IntegralGetDialog.THREE_CATEGORY: { case IntegralGetFragment.THREE_CATEGORY: {
// return getSpuCateName() + ""; return getSpuCateName() + "";
// } }
} }
return ""; return "";
......
...@@ -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.marketing.ticket.ReturnTicketActivity;
import com.xingdata.zzdpos.ui.payment.PaymentActivity; 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;
...@@ -138,7 +139,7 @@ public class LoginActivity extends BaseActivity<LoginPresenter, ActivityLoginBin ...@@ -138,7 +139,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, IntegralActivity.class)); startActivity(new Intent(LoginActivity.this, ReturnTicketActivity.class));
LoginActivity.this.finish(); LoginActivity.this.finish();
return; return;
} }
......
...@@ -66,6 +66,7 @@ public class IntegralActivity extends BaseActivity<IntegralPresenter, ActivityIn ...@@ -66,6 +66,7 @@ public class IntegralActivity extends BaseActivity<IntegralPresenter, ActivityIn
@Override @Override
public void addSucc(LoadingDialog loadingDialog) { public void addSucc(LoadingDialog loadingDialog) {
pop();
mPresenter.query(1, mPresenter.integralIndexFragment.NORMAL_TYPE, loadingDialog); mPresenter.query(1, mPresenter.integralIndexFragment.NORMAL_TYPE, loadingDialog);
} }
...@@ -82,6 +83,7 @@ public class IntegralActivity extends BaseActivity<IntegralPresenter, ActivityIn ...@@ -82,6 +83,7 @@ public class IntegralActivity extends BaseActivity<IntegralPresenter, ActivityIn
@Override @Override
public void exchangeUpdateSucc(Ubound ubound, LoadingDialog loadingDialog) { public void exchangeUpdateSucc(Ubound ubound, LoadingDialog loadingDialog) {
pop();
mPresenter.exchangeQuery(loadingDialog); mPresenter.exchangeQuery(loadingDialog);
} }
......
...@@ -8,6 +8,7 @@ import com.xingdata.zzdpos.model.Category; ...@@ -8,6 +8,7 @@ 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.IntegralExchangeFragment;
import com.xingdata.zzdpos.ui.marketing.integral.fragment.IntegralGetFragment; import com.xingdata.zzdpos.ui.marketing.integral.fragment.IntegralGetFragment;
import com.xingdata.zzdpos.ui.marketing.integral.fragment.IntegralIndexFragment; import com.xingdata.zzdpos.ui.marketing.integral.fragment.IntegralIndexFragment;
...@@ -23,6 +24,7 @@ public class IntegralPresenter extends IntegralContract.Presenter { ...@@ -23,6 +24,7 @@ public class IntegralPresenter extends IntegralContract.Presenter {
private int number = 1; private int number = 1;
public IntegralIndexFragment integralIndexFragment = new IntegralIndexFragment(); public IntegralIndexFragment integralIndexFragment = new IntegralIndexFragment();
public IntegralGetFragment integralGetFragment = new IntegralGetFragment(); public IntegralGetFragment integralGetFragment = new IntegralGetFragment();
public IntegralExchangeFragment integralExchangeFragment = new IntegralExchangeFragment();
@Override @Override
public void onAttached() { public void onAttached() {
......
package com.xingdata.zzdpos.ui.marketing.integral.fragment;
import android.text.TextUtils;
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.BaseFragment;
import com.xingdata.zzdpos.databinding.DialogIntegralExchangeSettingBinding;
import com.xingdata.zzdpos.model.Ubound;
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;
/**
* 绑定款台界面
* <p>
* 设备没有绑定款台的进行绑定操作
*/
public class IntegralExchangeFragment extends BaseFragment<IntegralPresenter,
DialogIntegralExchangeSettingBinding> {
Ubound ubound;
@Override
public int getLayoutId() {
return R.layout.dialog_integral_exchange_setting;
}
@Override
public void initView() {
mViewBinding.icTitle.tvTitle.setText("积分规则");
mViewBinding.icTitle.setOnClickListener(new OnClickListener() {
@Override
protected void myOnClickListener(View v) {
pop();
}
});
mViewBinding.setOnClickListener(view -> {
// hintKbTwo();
switch (view.getId()) {
case R.id.rd_suspendeds: {
//暂停
ubound.setBoundUseStatus((byte) 1);
}
break;
case R.id.rd_starts: {
//启用
ubound.setBoundUseStatus((byte) 0);
}
break;
case R.id.btn_ok: {
if (isNullAndSet()) {
LoadingDialog loadingDialog = new LoadingDialog();
loadingDialog.show((BaseActivity) getActivity());
ubound.setUpdateTime(null);
ubound.setCreateTime(null);
mPresenter.exchangeUpdate(ubound, loadingDialog);
} else {
ToastUtils.showLong("输入数据不能null");
}
}
break;
}
});
initUiData();
}
private void initUiData() {
if (ubound != null) {
if (ubound.getBoundUseStatus() != null && ubound.getBoundUseStatus() == 0) {
mViewBinding.rdStarts.setChecked(true);
} else if (ubound.getBoundUseStatus() != null && ubound.getBoundUseStatus() == 1) {
mViewBinding.rdSuspendeds.setChecked(true);
}
if (ubound.getBoundValAmt() != null) {
mViewBinding.etIntegralExchangeRuleCountMoney.setText(ubound.getBoundValAmt() + "");
}
if (ubound.getBoundOrderAmt() != null) {
mViewBinding.etIntegralExchangeMoney.setText(ConvertUtil.fenToYuanNoPoint(ubound
.getBoundOrderAmt()));
}
if (ubound.getBoundUseNum() != null) {
mViewBinding.etIntegralExchangeCount.setText(ubound.getBoundUseNum() + "");
}
}
}
public void setData(Ubound ubound) {
this.ubound = ubound;
}
/**
* 判断用户输入数据是否为null
*
* @return 输入为null返回false 反之返回true
*/
private boolean isNullAndSet() {
if (ubound == null || ubound.getBoundUseStatus() == null) {
return false;
}
if (TextUtils.isEmpty(mViewBinding.etIntegralExchangeRuleCountMoney.getText().toString())
|| TextUtils.isEmpty(mViewBinding.etIntegralExchangeMoney.getText().toString())
|| TextUtils.isEmpty(mViewBinding.etIntegralExchangeCount.getText().toString
())) {
return false;
}
ubound.setBoundValAmt(Long.parseLong(mViewBinding.etIntegralExchangeRuleCountMoney
.getText().toString()));
ubound.setBoundOrderAmt(ConvertUtil.yuanToFen(mViewBinding.etIntegralExchangeMoney
.getText().toString()));
ubound.setBoundUseNum(Long.parseLong(mViewBinding.etIntegralExchangeCount.getText()
.toString()));
return true;
}
// /**
// * 显示软键盘,Dialog使用
// */
// public void hintKbTwo() {
// View view = getDialog().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();
// }
}
...@@ -55,7 +55,7 @@ public class IntegralGetFragment extends BaseFragment<IntegralPresenter, ...@@ -55,7 +55,7 @@ public class IntegralGetFragment extends BaseFragment<IntegralPresenter,
//进度对话框 //进度对话框
LoadingDialog loadingDialog; LoadingDialog loadingDialog;
//当前点击商品类型空间id,防止直接点击商品第二三种类型 //当前点击商品类型空间id,防止直接点击商品第二三种类型
private int nowShopTypeId = 1; private int nowShopTypeId = 0;
@Override @Override
public int getLayoutId() { public int getLayoutId() {
...@@ -64,6 +64,13 @@ public class IntegralGetFragment extends BaseFragment<IntegralPresenter, ...@@ -64,6 +64,13 @@ public class IntegralGetFragment extends BaseFragment<IntegralPresenter,
@Override @Override
public void initView() { public void initView() {
mViewBinding.icTitle.tvTitle.setText("积分规则");
mViewBinding.icTitle.setOnClickListener(new OnClickListener() {
@Override
protected void myOnClickListener(View v) {
pop();
}
});
mViewBinding.setOnClickListener( mViewBinding.setOnClickListener(
new OnClickListener() { new OnClickListener() {
@Override @Override
...@@ -118,7 +125,6 @@ public class IntegralGetFragment extends BaseFragment<IntegralPresenter, ...@@ -118,7 +125,6 @@ public class IntegralGetFragment extends BaseFragment<IntegralPresenter,
if (nowShopTypeId >= 1) { if (nowShopTypeId >= 1) {
mPresenter.initData(getCategory(v.getId()), TWO_CATEGORY); mPresenter.initData(getCategory(v.getId()), TWO_CATEGORY);
mViewBinding.tvCategorySelectThree.setText(""); mViewBinding.tvCategorySelectThree.setText("");
nowShopTypeId = 2;
} else { } else {
ToastUtils.showLong("请先选择第一类品类"); ToastUtils.showLong("请先选择第一类品类");
} }
...@@ -127,7 +133,6 @@ public class IntegralGetFragment extends BaseFragment<IntegralPresenter, ...@@ -127,7 +133,6 @@ public class IntegralGetFragment extends BaseFragment<IntegralPresenter,
case R.id.tv_category_select_three: { case R.id.tv_category_select_three: {
if (nowShopTypeId >= 2) { if (nowShopTypeId >= 2) {
mPresenter.initData(getCategory(v.getId()), THREE_CATEGORY); mPresenter.initData(getCategory(v.getId()), THREE_CATEGORY);
nowShopTypeId = 3;
} else { } else {
ToastUtils.showLong("请先选择第一二类品类"); ToastUtils.showLong("请先选择第一二类品类");
} }
...@@ -349,18 +354,21 @@ public class IntegralGetFragment extends BaseFragment<IntegralPresenter, ...@@ -349,18 +354,21 @@ public class IntegralGetFragment extends BaseFragment<IntegralPresenter,
//返回的分别是三个级别的选中位置 //返回的分别是三个级别的选中位置
switch (nowList) { switch (nowList) {
case ONE_CATEGORY: { case ONE_CATEGORY: {
nowShopTypeId=1;
mViewBinding.tvCategorySelectOne.setText(listCategory.get(options1) mViewBinding.tvCategorySelectOne.setText(listCategory.get(options1)
.getSpuClaName()); .getSpuClaName());
spuCateIdTwo = listCategory.get(options1).getSpuCateId(); spuCateIdTwo = listCategory.get(options1).getSpuCateId();
} }
break; break;
case TWO_CATEGORY: { case TWO_CATEGORY: {
nowShopTypeId=2;
mViewBinding.tvCategorySelectTwo.setText(listCategory.get(options1) mViewBinding.tvCategorySelectTwo.setText(listCategory.get(options1)
.getSpuGrpName()); .getSpuGrpName());
spuCateIdThree = listCategory.get(options1).getSpuCateId(); spuCateIdThree = listCategory.get(options1).getSpuCateId();
} }
break; break;
case THREE_CATEGORY: { case THREE_CATEGORY: {
nowShopTypeId=3;
mViewBinding.tvCategorySelectThree.setText(listCategory.get(options1) mViewBinding.tvCategorySelectThree.setText(listCategory.get(options1)
.getSpuCateName()); .getSpuCateName());
......
...@@ -20,7 +20,6 @@ import com.xingdata.zzdpos.ui.marketing.integral.IntegralActivity; ...@@ -20,7 +20,6 @@ import com.xingdata.zzdpos.ui.marketing.integral.IntegralActivity;
import com.xingdata.zzdpos.ui.marketing.integral.IntegralPresenter; 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.IntegralAdapter;
import com.xingdata.zzdpos.ui.marketing.integral.adapter.IntegralExchangeAdapter; 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 com.xingdata.zzdpos.util.OnClickListener;
import java.util.ArrayList; import java.util.ArrayList;
...@@ -80,6 +79,7 @@ public class IntegralIndexFragment extends BaseFragment<IntegralPresenter, ...@@ -80,6 +79,7 @@ public class IntegralIndexFragment extends BaseFragment<IntegralPresenter,
mViewBinding.setOnClickListener(v -> { mViewBinding.setOnClickListener(v -> {
switch (v.getId()) { switch (v.getId()) {
case R.id.btn_add: { case R.id.btn_add: {
mPresenter.integralGetFragment = new IntegralGetFragment();
mPresenter.integralGetFragment.setNowType(1); mPresenter.integralGetFragment.setNowType(1);
start(mPresenter.integralGetFragment); start(mPresenter.integralGetFragment);
// integralGetDialog = new IntegralGetDialog(); // integralGetDialog = new IntegralGetDialog();
...@@ -197,6 +197,7 @@ public class IntegralIndexFragment extends BaseFragment<IntegralPresenter, ...@@ -197,6 +197,7 @@ public class IntegralIndexFragment extends BaseFragment<IntegralPresenter,
if ((System.currentTimeMillis() - mExitTime) > 1000) { if ((System.currentTimeMillis() - mExitTime) > 1000) {
// integralGetDialog = new IntegralGetDialog(); // integralGetDialog = new IntegralGetDialog();
loadingDialog.show((BaseActivity) getActivity()); loadingDialog.show((BaseActivity) getActivity());
mPresenter.integralGetFragment = new IntegralGetFragment();
mPresenter.integralGetFragment.setData(gbound, loadingDialog); mPresenter.integralGetFragment.setData(gbound, loadingDialog);
start(mPresenter.integralGetFragment); start(mPresenter.integralGetFragment);
// integralGetDialog.show((BaseActivity) getActivity()); // integralGetDialog.show((BaseActivity) getActivity());
...@@ -213,9 +214,12 @@ public class IntegralIndexFragment extends BaseFragment<IntegralPresenter, ...@@ -213,9 +214,12 @@ public class IntegralIndexFragment extends BaseFragment<IntegralPresenter,
*/ */
private void exchangeClickProduct(Ubound gbound) { private void exchangeClickProduct(Ubound gbound) {
if ((System.currentTimeMillis() - mExitTime) > 1000) { if ((System.currentTimeMillis() - mExitTime) > 1000) {
IntegralExchangeDialog integralExchangeDialog = new IntegralExchangeDialog(); mPresenter.integralExchangeFragment = new IntegralExchangeFragment();
integralExchangeDialog.setData(gbound); mPresenter.integralExchangeFragment.setData(gbound);
integralExchangeDialog.show((BaseActivity) getActivity()); start(mPresenter.integralExchangeFragment);
// IntegralExchangeDialog integralExchangeDialog = new IntegralExchangeDialog();
// integralExchangeDialog.setData(gbound);
// integralExchangeDialog.show((BaseActivity) getActivity());
mExitTime = System.currentTimeMillis(); mExitTime = System.currentTimeMillis();
} else { } else {
ToastUtils.showLong("您操作太快了"); ToastUtils.showLong("您操作太快了");
......
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