Commit a4250736 authored by 姜敏's avatar 姜敏

修改会员充值

parent b8f16b94
...@@ -130,6 +130,14 @@ ...@@ -130,6 +130,14 @@
android:configChanges="keyboard|orientation|screenSize|keyboardHidden" android:configChanges="keyboard|orientation|screenSize|keyboardHidden"
android:windowSoftInputMode="adjustUnspecified|stateHidden" /> android:windowSoftInputMode="adjustUnspecified|stateHidden" />
<activity
android:name=".ui.marketing.recharge.RechargeRuleActivity"
android:configChanges="keyboard|orientation|screenSize|keyboardHidden"
android:windowSoftInputMode="adjustUnspecified|stateHidden" />
<activity
android:name=".ui.marketing.viplevel.LevelActivity"
android:configChanges="keyboard|orientation|screenSize|keyboardHidden"
android:windowSoftInputMode="adjustUnspecified|stateHidden" />
</application> </application>
</manifest> </manifest>
\ No newline at end of file
...@@ -1218,6 +1218,14 @@ public final class ApiFactory { ...@@ -1218,6 +1218,14 @@ public final class ApiFactory {
.observeOn(AndroidSchedulers.mainThread()) .observeOn(AndroidSchedulers.mainThread())
.retryWhen(new RetryHelper(3)); .retryWhen(new RetryHelper(3));
} }
public static Observable<Pager<Mscard>> mscardQuery() {
return Api.getInstance().service.mscardQuery()
.onErrorReturn(new ErrorFilter<>())
.map(new ResultFilter<>())
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.retryWhen(new RetryHelper(3));
}
} }
......
...@@ -420,6 +420,9 @@ interface ApiService { ...@@ -420,6 +420,9 @@ interface ApiService {
@POST(C.URL.MSCARD.query) @POST(C.URL.MSCARD.query)
Observable<HttpMessage<Pager<Mscard>>> mscardQuery(@Query("vipId") Long vipId); Observable<HttpMessage<Pager<Mscard>>> mscardQuery(@Query("vipId") Long vipId);
@POST(C.URL.MSCARD.query)
Observable<HttpMessage<Pager<Mscard>>> mscardQuery();
@POST(C.URL.MSCARD.add) @POST(C.URL.MSCARD.add)
Observable<HttpMessage<Mscard>> addMscard(@Body Mscard m); Observable<HttpMessage<Mscard>> addMscard(@Body Mscard m);
......
...@@ -56,7 +56,7 @@ public class UserListFragment extends BaseFragment<UserPresenter, FragmentUserLi ...@@ -56,7 +56,7 @@ public class UserListFragment extends BaseFragment<UserPresenter, FragmentUserLi
}); });
adapter.setOnLoadMoreListener(this::onLoadMore, mViewBinding.userRecyclerView); adapter.setOnLoadMoreListener(this::onLoadMore, mViewBinding.userRecyclerView);
adapter.setEnableLoadMore(false); adapter.setEnableLoadMore(false);
mViewBinding.titleSearch.onBack.setOnClickListener(view -> { mViewBinding.searchLayout.onBack.setOnClickListener(view -> {
getActivity().finish(); getActivity().finish();
}); });
mViewBinding.setOnClickListener(view -> { mViewBinding.setOnClickListener(view -> {
...@@ -70,7 +70,10 @@ public class UserListFragment extends BaseFragment<UserPresenter, FragmentUserLi ...@@ -70,7 +70,10 @@ public class UserListFragment extends BaseFragment<UserPresenter, FragmentUserLi
ToastUtils.showShort("搜索条件不能为空"); ToastUtils.showShort("搜索条件不能为空");
return; return;
} }
mPresenter.queryUser(mViewBinding.userSearch.getText().toString()); mPresenter.queryUser( mViewBinding.searchLayout.serchEditText.getText().toString().trim());
break;
case R.id.onBack:
getActivity().finish();
break; break;
} }
}); });
......
package com.xingdata.zzdpos.ui.marketing.fragment;
import android.annotation.SuppressLint;
import android.content.Context;
import android.view.Gravity;
import android.widget.RadioButton;
import com.blankj.utilcode.util.ToastUtils;
import com.xingdata.api.print.ZX_PrintPOS;
import com.xingdata.zzdpos.App;
import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.api.ApiFactory;
import com.xingdata.zzdpos.db.DBFactory;
import com.xingdata.zzdpos.model.Mscard;
import com.xingdata.zzdpos.model.Vip;
import com.xingdata.zzdpos.model.VipRechargeOrder;
import com.xingdata.zzdpos.ui.vip.VipContract;
import com.xingdata.zzdpos.ui.vip.fragment.VipExpenseListFragment;
import com.xingdata.zzdpos.ui.vip.fragment.VipInfoEditFragment;
import com.xingdata.zzdpos.ui.vip.fragment.VipInfoFragment;
import com.xingdata.zzdpos.ui.vip.fragment.VipListFragment;
import com.xingdata.zzdpos.ui.vip.fragment.VipRechargeFragment;
import com.xingdata.zzdpos.ui.vip.fragment.VipRechargeListFragment;
import com.xingdata.zzdpos.ui.vip.fragment.VipSearchFragment;
import com.xingdata.zzdpos.ui.vip.fragment.VipTruleListFragment;
import java.util.ArrayList;
import java.util.List;
public class VipPresenter extends VipContract.Presenter {
public VipListFragment vipListFragment = new VipListFragment();
public VipInfoEditFragment vipInfoEditFragment = new VipInfoEditFragment();
public VipInfoFragment vipInfoFragment = new VipInfoFragment();
public VipExpenseListFragment vipExpenseListFragment = new VipExpenseListFragment();
public VipRechargeListFragment vipRechargeListFragment = new VipRechargeListFragment();
public VipTruleListFragment vipMscardListFragment = new VipTruleListFragment();
public VipSearchFragment vipSearchFragment = new VipSearchFragment();
public VipRechargeFragment vipRechargeFragment = new VipRechargeFragment();
public int inVipState = 0; //1 充值
@Override
public void onAttached() {
this.initRealm();
}
@Override
public void getVipList(int pageNumber, String vipLevel) {
ApiFactory.User.getVipList(pageNumber, vipLevel).subscribe(vipPager -> {
mView.getVipListSus(vipPager, pageNumber);
}, throwable -> {
ToastUtils.showShort(throwable.getMessage());
});
}
@Override
public void getVipLevel(int pageNum, int
pageSize) {
ApiFactory.Level.getVipLevelList(pageNum, pageSize).subscribe(vipPager -> {
mView.getVipLevelSus(vipPager);
}, throwable -> {
ToastUtils.showShort(throwable.getMessage());
});
}
@Override
public void getVipNumber() {
ApiFactory.Sta.querySta().subscribe(sta -> {
mView.getVipNumberSus(sta);
}, throwable -> {
ToastUtils.showShort(throwable.getMessage());
});
}
@Override
public void addVip(Vip vip) {
if (vip.getVipId() == null) {
ApiFactory.User.addVip(vip).subscribe(mVip -> {
mView.addVipSus(mVip);
}, throwable -> {
ToastUtils.showShort(throwable.getMessage());
});
} else {
ApiFactory.User.updateVip(vip).subscribe(mVip -> {
mView.addVipSus(mVip);
}, throwable -> {
ToastUtils.showShort(throwable.getMessage());
});
}
}
@Override
public void ticketQuery(Long vipID) {
ApiFactory.Ticket.query(vipID).subscribe(ticketList -> {
mView.ticketQuerySus(ticketList);
}, throwable -> {
ToastUtils.showShort(throwable.getMessage());
});
}
@Override
public void saleorderQuery(Long vipID, int pageNumber) {
ApiFactory.Saleorder.querySaleorderByVipId(vipID, pageNumber, 5).subscribe(saleorder -> {
mView.getSaleorderSus(saleorder);
}, throwable -> {
ToastUtils.showShort(throwable.getMessage());
});
}
@Override
public void rechargeorderQuery(Long vipID, int number) {
ApiFactory.Rctrace.queryRecharge(vipID, number, 10).subscribe(rechargeOrderPager -> {
mView.getRechargeOrderSus(rechargeOrderPager);
}, throwable -> {
ToastUtils.showShort(throwable.getMessage());
});
}
@Override
public void truleQuery(Long vipID) {
ApiFactory.TRULE.truleQueryByVipId(vipID).subscribe(trulePager -> {
mView.getTruleSus(trulePager);
}, throwable -> {
ToastUtils.showShort(throwable.getMessage());
});
}
@Override
public void searchVip(String keyword) {
ApiFactory.User.queryUserDetailByWD(keyword).subscribe(
vipPager -> {
mView.searchVipSus(vipPager);
},
throwable -> {
ToastUtils.showShort(throwable.getMessage());
});
}
@Override
public void getMscardList(long vipID) {
ApiFactory.MsCard.mscardQuery(vipID).subscribe(
mscardPager -> {
mView.getMscardSus(mscardPager);
},
throwable -> {
ToastUtils.showShort(throwable.getMessage());
});
}
@SuppressLint("ResourceType")
public RadioButton addRadioButton(Context mContext, Mscard mscard) {
RadioButton radioButton = new RadioButton(mContext);
// ArrayList<RadioButton> radioButtons = new ArrayList<>();
radioButton.setTextSize(18);
radioButton.setTag(mscard.getCruleGradeNo());
radioButton.setText("充:" + mscard.getCruleChargeAmt() / 100);
radioButton.setButtonDrawable(null);
radioButton.setGravity(Gravity.CENTER);
radioButton.getPaint().setFakeBoldText(true);
radioButton.setBackgroundResource(R.drawable.selector_paymoney_radiobutton_bg);
radioButton.setTextColor(mContext.getResources().getColorStateList(R.drawable.selector_paymoney_textcolor_bg));
return radioButton;
}
public Mscard getMaxRechange(List<Mscard> realm, Long rechangeMoney) {
Mscard mMscard = null;
ArrayList<String> strings = new ArrayList<>();
long rechangeM = 0;
for (Mscard mscard : realm) {
if (rechangeMoney >= mscard.getCruleChargeAmt()) {
rechangeM = mscard.getCruleChargeAmt();
mMscard = mscard;
}
}
return mMscard;
}
@Override
public void initSettle() {
// Realm.getInstance(App.instance.mRealmConfig).
DBFactory.Vip.queryPays().subscribe(
pays -> mView.loadPays(pays),
throwable -> {
}
);
// mView.setSettleFragmentBySettleMode(mSettleMode);
}
@Override
public void fullVip(Vip vipOld, Long amtPay, Long amtSend) {
ApiFactory.Recard.fullVip(vipOld.getVipId(), amtPay, amtSend).subscribe(vip -> {
VipRechargeOrder mVipRechangeOrdervip = vip.getRctrace();
mVipRechangeOrdervip.setCreateTime(vip.getUpdateTime());
mVipRechangeOrdervip.setRechangeBefore(vipOld.getAcctCbal());
mVipRechangeOrdervip.setRechangeAfter(vip.getAcctCbal());
try {
ZX_PrintPOS.getInstance(App.instance).printSave(1, mVipRechangeOrdervip);
} catch (Exception e) {
ToastUtils.showShort("打印异常");
}
mView.rechangeSus(vip);
}, throwable -> {
mView.rechangeErr(vipOld, amtPay, amtSend, throwable.getMessage());
});
}
}
...@@ -15,7 +15,9 @@ import com.xingdata.zzdpos.model.MarketingMenuModel; ...@@ -15,7 +15,9 @@ import com.xingdata.zzdpos.model.MarketingMenuModel;
import com.xingdata.zzdpos.ui.marketing.integral.IntegralActivity; import com.xingdata.zzdpos.ui.marketing.integral.IntegralActivity;
import com.xingdata.zzdpos.ui.marketing.marketingMenu.adapter.MarketingMenuAdapter; import com.xingdata.zzdpos.ui.marketing.marketingMenu.adapter.MarketingMenuAdapter;
import com.xingdata.zzdpos.ui.marketing.ms.MsActivity; import com.xingdata.zzdpos.ui.marketing.ms.MsActivity;
import com.xingdata.zzdpos.ui.marketing.recharge.RechargeRuleActivity;
import com.xingdata.zzdpos.ui.marketing.ticket.ReturnTicketActivity; import com.xingdata.zzdpos.ui.marketing.ticket.ReturnTicketActivity;
import com.xingdata.zzdpos.ui.marketing.viplevel.LevelActivity;
import com.xingdata.zzdpos.util.OnClickListener; import com.xingdata.zzdpos.util.OnClickListener;
import com.xingdata.zzdpos.util.RecyclerViewUtil; import com.xingdata.zzdpos.util.RecyclerViewUtil;
...@@ -58,6 +60,7 @@ public class MarketingMenuActivity extends AppCompatActivity { ...@@ -58,6 +60,7 @@ public class MarketingMenuActivity extends AppCompatActivity {
switch (marketingMenuAdapter.getData().get(position)) { switch (marketingMenuAdapter.getData().get(position)) {
case C.MENU.MENU_MS_VIP_LEVEL: { case C.MENU.MENU_MS_VIP_LEVEL: {
//会员等级 //会员等级
ActivityUtils.startActivity(LevelActivity.class);
} }
break; break;
case C.MENU.MENU_MS_INTEGRAL: { case C.MENU.MENU_MS_INTEGRAL: {
...@@ -72,6 +75,7 @@ public class MarketingMenuActivity extends AppCompatActivity { ...@@ -72,6 +75,7 @@ public class MarketingMenuActivity extends AppCompatActivity {
break; break;
case C.MENU.MENU_MS_RECHARGE: { case C.MENU.MENU_MS_RECHARGE: {
//充值优惠 //充值优惠
ActivityUtils.startActivity(RechargeRuleActivity.class);
} }
break; break;
case C.MENU.MENU_MS_MS: { case C.MENU.MENU_MS_MS: {
......
package com.xingdata.zzdpos.ui.marketing.recharge;
import android.os.Bundle;
import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseActivity;
import com.xingdata.zzdpos.databinding.ActivityVipLevelBinding;
import com.xingdata.zzdpos.model.Mscard;
import com.xingdata.zzdpos.model.Pager;
public class RechargeRuleActivity extends BaseActivity<RechargeRulePresenter, ActivityVipLevelBinding> implements RechargeRuleContract.View {
private Bundle mBundle;
@Override
public int getLayoutId() {
return R.layout.activity_vip_level;
}
@Override
public void initView() {
mBundle = getIntent().getExtras();
loadRootFragment(R.id.vip_level_frame, mPresenter.rechargeListFragment, true, false);
}
@Override
public void mscardQuerySus(Pager<Mscard> mscardPager) {
mPresenter.rechargeListFragment.mscardQuerySus(mscardPager);
}
@Override
public void addMscardSus(Mscard mscard) {
mPresenter.rechargeRuleEditFragment.pop();
mPresenter.mscardQuery();
}
}
package com.xingdata.zzdpos.ui.marketing.recharge;
import com.xingdata.zzdpos.base.BasePresenter;
import com.xingdata.zzdpos.base.BaseView;
import com.xingdata.zzdpos.model.Level;
import com.xingdata.zzdpos.model.Mscard;
import com.xingdata.zzdpos.model.Pager;
public interface RechargeRuleContract {
interface View extends BaseView {
void mscardQuerySus(Pager<Mscard> mscardPager);
void addMscardSus(Mscard mscard);
}
abstract class Presenter extends BasePresenter<View> {
public abstract void mscardQuery();
public abstract void addMsCard(Mscard mscard);
}
}
\ No newline at end of file
package com.xingdata.zzdpos.ui.marketing.recharge;
import com.blankj.utilcode.util.ToastUtils;
import com.xingdata.zzdpos.api.ApiFactory;
import com.xingdata.zzdpos.model.Level;
import com.xingdata.zzdpos.model.Mscard;
import com.xingdata.zzdpos.ui.marketing.recharge.fragment.RechargeRuleEditFragment;
import com.xingdata.zzdpos.ui.marketing.recharge.fragment.RechargeRuleListFragment;
public class RechargeRulePresenter extends RechargeRuleContract.Presenter {
public RechargeRuleListFragment rechargeListFragment = new RechargeRuleListFragment();
public RechargeRuleEditFragment rechargeRuleEditFragment = new RechargeRuleEditFragment();
@Override
public void onAttached() {
mscardQuery();
}
@Override
public void mscardQuery() {
ApiFactory.MsCard.mscardQuery().subscribe(mscardPager -> {
mView.mscardQuerySus(mscardPager);
}, throwable -> {
ToastUtils.showShort(throwable.getMessage());
});
}
@Override
public void addMsCard(Mscard mscard) {
if (mscard.getId() != null) {
ApiFactory.MsCard.updteMsCard(mscard).subscribe(m -> {
mView.addMscardSus(m);
}, throwable -> {
ToastUtils.showShort(throwable.getMessage());
});
} else {
ApiFactory.MsCard.addMsCard(mscard).subscribe(m -> {
mView.addMscardSus(m);
}, throwable -> {
ToastUtils.showShort(throwable.getMessage());
});
}
}
}
package com.xingdata.zzdpos.ui.marketing.recharge.adapter;
import android.content.Context;
import android.support.annotation.Nullable;
import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseAdapter;
import com.xingdata.zzdpos.databinding.ItemRechargeRulelListItemBinding;
import com.xingdata.zzdpos.databinding.ItemVipLevelListItemBinding;
import com.xingdata.zzdpos.model.Level;
import com.xingdata.zzdpos.model.Mscard;
import com.xingdata.zzdpos.util.ConvertUtil;
import com.xingdata.zzdpos.util.StringUtil;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
/**
* Created by JM_DEV on 2017/12/25.
*/
public class RechargeRuleListAdapter extends BaseAdapter<Mscard, ItemRechargeRulelListItemBinding> {
private Context mContext;
public RechargeRuleListAdapter(Context mContext, @Nullable List<Mscard> data) {
super(R.layout.item_recharge_rulel_list_item, data);
this.mContext = mContext;
}
@Override
protected void convert(ItemRechargeRulelListItemBinding mViewBinding, Mscard item) {
mViewBinding.ruleName.setText(mContext.getString(R.string.recharge_send, ConvertUtil.fenToYuanNoZero(item.getCruleChargeAmt()), ConvertUtil.fenToYuanNoZero(item.getCruleSendAmt())));
mViewBinding.ruleValidity.setText(StringUtil.format(new Date(item.getDateBegin())) + "~" + StringUtil.format(new Date(item.getDateEnd())));
}
}
package com.xingdata.zzdpos.ui.marketing.recharge.fragment;
/**
* Created by JM_DEV on 2017/12/21.
*/
import android.app.DatePickerDialog;
import android.view.View;
import android.widget.DatePicker;
import android.widget.RadioButton;
import android.widget.TextView;
import com.blankj.utilcode.util.ToastUtils;
import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseFragment;
import com.xingdata.zzdpos.databinding.FragmentRechargeRuleEditBinding;
import com.xingdata.zzdpos.databinding.FragmentVipLevelEditBinding;
import com.xingdata.zzdpos.model.Level;
import com.xingdata.zzdpos.model.Mscard;
import com.xingdata.zzdpos.ui.marketing.recharge.RechargeRulePresenter;
import com.xingdata.zzdpos.util.ConvertUtil;
import com.xingdata.zzdpos.util.StringUtil;
import java.math.BigDecimal;
import java.util.Calendar;
import java.util.Date;
/**
* 会员等级编辑界面
*/
public class RechargeRuleEditFragment extends BaseFragment<RechargeRulePresenter, FragmentRechargeRuleEditBinding> {
private Mscard mMscard;
@Override
public int getLayoutId() {
return R.layout.fragment_recharge_rule_edit;
}
@Override
public void initView() {
mViewBinding.infoTitle.popMenu.setVisibility(View.GONE);
if (mMscard != null) {
mViewBinding.infoTitle.tvTitle.setText("修改会员");
mViewBinding.ruleNameLayout.setVisibility(View.GONE);
mViewBinding.ruleName.setText("充" + ConvertUtil.fenToYuanNoZero(mMscard.getCruleChargeAmt()) + "送" + ConvertUtil.fenToYuanNoZero(mMscard.getCruleSendAmt()) + "元");
mViewBinding.rechargAmt.setText(ConvertUtil.fenToYuanNoZero(mMscard.getCruleChargeAmt()));
mViewBinding.sendAmt.setText(ConvertUtil.fenToYuanNoZero(mMscard.getCruleSendAmt()));
mViewBinding.ruleBeginTime.setText(StringUtil.format(new Date(mMscard.getDateBegin())));
mViewBinding.ruleEndTime.setText(StringUtil.format(new Date(mMscard.getDateEnd())));
RadioButton radioButton = mViewBinding.ruleState.findViewWithTag(mMscard.getCruleStatus().toString());
if (radioButton != null) {
radioButton.setChecked(true);
}
} else {
mViewBinding.ruleNameLayout.setVisibility(View.GONE);
mViewBinding.infoTitle.tvTitle.setText("新增充值优惠");
mViewBinding.ruleNameLayout.setVisibility(View.VISIBLE);
}
mViewBinding.setOnClickListener(view -> {
switch (view.getId()) {
case R.id.onSure:
Mscard mscard = new Mscard();
if (mMscard != null) {
mscard.setId(mMscard.getId());
mscard.setCruleGradeNo(mMscard.getCruleGradeNo());
mscard.setIssuerMapId(mMscard.getIssuerMapId());
}
if (mViewBinding.rechargAmt.getText().length() == 0) {
ToastUtils.showShort("充值金额不能为空");
return;
}
if (Long.parseLong(mViewBinding.rechargAmt.getText().toString())<=0) {
ToastUtils.showShort("充值金额必须大于0");
return;
}
if (mViewBinding.sendAmt.getText().length() == 0) {
ToastUtils.showShort("赠送金额不能为空");
return;
}
if (Long.parseLong(mViewBinding.sendAmt.getText().toString())<=0) {
ToastUtils.showShort("赠送金额必须大于0");
return;
}
if (Long.parseLong(mViewBinding.sendAmt.getText().toString())>Long.parseLong(mViewBinding.rechargAmt.getText().toString())) {
ToastUtils.showShort("充值金额必须大于或者等于赠送金额");
return;
}
if (StringUtil.getTimeMillis(mViewBinding.ruleBeginTime.getText().toString()) >=StringUtil.getTimeMillis(mViewBinding.ruleEndTime.getText().toString())) {
ToastUtils.showShort("开始时间不能大于或者等于结束日期");
return;
}
mscard.setCruleChargeAmt(ConvertUtil.yuanToFen( mViewBinding.rechargAmt.getText().toString()));
mscard.setCruleSendAmt(ConvertUtil.yuanToFen( mViewBinding.sendAmt.getText().toString()));
mscard.setCruleStatus(Byte.parseByte(mViewBinding.ruleState.findViewById(mViewBinding.ruleState.getCheckedRadioButtonId()).getTag().toString()));
mscard.setDateBegin(StringUtil.getTimeMillis(mViewBinding.ruleBeginTime.getText().toString()));
mscard.setDateEnd(StringUtil.getTimeMillis(mViewBinding.ruleEndTime.getText().toString()));
mPresenter.addMsCard(mscard);
break;
case R.id.rule_begin_time:
showDialogPick(mViewBinding.ruleBeginTime);
break;
case R.id.rule_end_time:
showDialogPick(mViewBinding.ruleEndTime);
break;
}
});
mViewBinding.infoTitle.ivBack.setOnClickListener(view -> {
pop();
});
}
@Override
public boolean onBackPressedSupport() {
return false;
}
//将两个选择时间的dialog放在该函数中
private void showDialogPick(final View btn) {
//获取Calendar对象,用于获取当前时间
final Calendar calendar = Calendar.getInstance();
int year = calendar.get(Calendar.YEAR);
int month = calendar.get(Calendar.MONTH);
int day = calendar.get(Calendar.DAY_OF_MONTH);
//实例化DatePickerDialog对象
DatePickerDialog datePickerDialog = new DatePickerDialog(mContext, new
DatePickerDialog.OnDateSetListener() {
//选择完日期后会调用该回调函数
@Override
public void onDateSet(DatePicker view, int year, int monthOfYear, int
dayOfMonth) {
//因为monthOfYear会比实际月份少一月所以这边要加1
((TextView) btn).setText(year + "-" + (monthOfYear + 1) + "-" + dayOfMonth);
}
}, year, month, day);
//弹出选择日期对话框
datePickerDialog.show();
}
public void setmMscard(Mscard mMscard) {
this.mMscard = mMscard;
}
}
package com.xingdata.zzdpos.ui.marketing.recharge.fragment;
/**
* Created by JM_DEV on 2017/12/21.
*/
import android.support.v7.widget.LinearLayoutManager;
import android.view.View;
import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseFragment;
import com.xingdata.zzdpos.databinding.FragmentRechargeRuleEditBinding;
import com.xingdata.zzdpos.databinding.FragmentRechargeRuleListBinding;
import com.xingdata.zzdpos.databinding.FragmentVipLevelListBinding;
import com.xingdata.zzdpos.model.Mscard;
import com.xingdata.zzdpos.model.Pager;
import com.xingdata.zzdpos.ui.marketing.recharge.RechargeRulePresenter;
import com.xingdata.zzdpos.ui.marketing.recharge.adapter.RechargeRuleListAdapter;
import com.xingdata.zzdpos.util.OnClickListener;
import java.util.ArrayList;
/**
* 会员等级界面
*/
public class RechargeRuleListFragment extends BaseFragment<RechargeRulePresenter, FragmentRechargeRuleListBinding> {
private RechargeRuleListAdapter adapter;
private int pageNumber = 0;
private String strVipLevle;
private int vipState = 0;//0 会员 1 充值
@Override
public int getLayoutId() {
return R.layout.fragment_recharge_rule_list;
}
@Override
public void initView() {
adapter = new RechargeRuleListAdapter(getActivity(), new ArrayList<Mscard>());
mViewBinding.noRultBg.setVisibility(View.VISIBLE);
mViewBinding.titleLayout.setOnClickListener(new OnClickListener() {
@Override
protected void myOnClickListener(View v) {
getActivity().finish();
}
});
mViewBinding.levelRecyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
mViewBinding.levelRecyclerView.setAdapter(adapter);
mViewBinding.titleLayout.tvTitle.setText("充值优惠");
adapter.setOnItemClickListener((mAdapter, view, position) -> {
mPresenter.rechargeRuleEditFragment.setmMscard(adapter.getData().get(position));
start( mPresenter.rechargeRuleEditFragment);
});
adapter.setOnLoadMoreListener(this::onLoadMore, mViewBinding.levelRecyclerView);
adapter.setEnableLoadMore(false);
mViewBinding.setOnClickListener(view -> {
switch (view.getId()) {
case R.id.addRule:
mPresenter.rechargeRuleEditFragment.setmMscard(null);
start( mPresenter.rechargeRuleEditFragment);
break;
}
});
}
private void onLoadMore() {
}
public void mscardQuerySus(Pager<Mscard> mscardPager) {
adapter.setNewData(mscardPager.getList());
}
}
package com.xingdata.zzdpos.ui.marketing.viplevel;
import android.os.Bundle;
import android.view.View;
import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseActivity;
import com.xingdata.zzdpos.databinding.ActivityVipBinding;
import com.xingdata.zzdpos.databinding.ActivityVipLevelBinding;
import com.xingdata.zzdpos.model.Level;
import com.xingdata.zzdpos.model.Mscard;
import com.xingdata.zzdpos.model.Pager;
import com.xingdata.zzdpos.model.Pay;
import com.xingdata.zzdpos.model.Saleorder;
import com.xingdata.zzdpos.model.Sta;
import com.xingdata.zzdpos.model.Ticket;
import com.xingdata.zzdpos.model.Trule;
import com.xingdata.zzdpos.model.Vip;
import com.xingdata.zzdpos.model.VipRechargeOrder;
import com.xingdata.zzdpos.ui.dialog.PromptDialog;
import com.xingdata.zzdpos.ui.vip.VipContract;
import com.xingdata.zzdpos.ui.vip.VipPresenter;
import com.xingdata.zzdpos.view.ViewTools;
import java.util.List;
public class LevelActivity extends BaseActivity<LevelPresenter, ActivityVipLevelBinding> implements LevelContract.View {
private Bundle mBundle;
@Override
public int getLayoutId() {
return R.layout.activity_vip_level;
}
@Override
public void initView() {
mBundle = getIntent().getExtras();
loadRootFragment(R.id.vip_level_frame, mPresenter.levelListFragment, true, false);
}
@Override
public void getVipLevelSus(Pager<Level> levelPager) {
mPresenter.levelListFragment.getVipLevelSus(levelPager);
}
@Override
public void updateVipLevelSus(Level level) {
mPresenter.vipLevelEditFragment.pop();
mPresenter.getVipLevel(0,200);
}
}
package com.xingdata.zzdpos.ui.marketing.viplevel;
import com.xingdata.zzdpos.base.BasePresenter;
import com.xingdata.zzdpos.base.BaseView;
import com.xingdata.zzdpos.model.Level;
import com.xingdata.zzdpos.model.Mscard;
import com.xingdata.zzdpos.model.Pager;
import com.xingdata.zzdpos.model.Pay;
import com.xingdata.zzdpos.model.Saleorder;
import com.xingdata.zzdpos.model.Sta;
import com.xingdata.zzdpos.model.Ticket;
import com.xingdata.zzdpos.model.Trule;
import com.xingdata.zzdpos.model.Vip;
import com.xingdata.zzdpos.model.VipRechargeOrder;
import java.util.List;
public interface LevelContract {
interface View extends BaseView {
void getVipLevelSus(Pager<Level> levelPager);
void updateVipLevelSus(Level level);
}
abstract class Presenter extends BasePresenter<View> {
public abstract void getVipLevel(int pageNum, int
pageSize);
public abstract void updateVipLevel(Level level);
}
}
\ No newline at end of file
package com.xingdata.zzdpos.ui.marketing.viplevel;
import android.annotation.SuppressLint;
import android.content.Context;
import android.view.Gravity;
import android.widget.RadioButton;
import com.blankj.utilcode.util.ToastUtils;
import com.xingdata.api.print.ZX_PrintPOS;
import com.xingdata.zzdpos.App;
import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.api.ApiFactory;
import com.xingdata.zzdpos.db.DBFactory;
import com.xingdata.zzdpos.model.Level;
import com.xingdata.zzdpos.model.Mscard;
import com.xingdata.zzdpos.model.Vip;
import com.xingdata.zzdpos.model.VipRechargeOrder;
import com.xingdata.zzdpos.ui.marketing.viplevel.fragment.LevelListFragment;
import com.xingdata.zzdpos.ui.marketing.viplevel.fragment.VipLevelEditFragment;
import com.xingdata.zzdpos.ui.vip.VipContract;
import com.xingdata.zzdpos.ui.vip.fragment.VipExpenseListFragment;
import com.xingdata.zzdpos.ui.vip.fragment.VipInfoEditFragment;
import com.xingdata.zzdpos.ui.vip.fragment.VipInfoFragment;
import com.xingdata.zzdpos.ui.vip.fragment.VipListFragment;
import com.xingdata.zzdpos.ui.vip.fragment.VipRechargeFragment;
import com.xingdata.zzdpos.ui.vip.fragment.VipRechargeListFragment;
import com.xingdata.zzdpos.ui.vip.fragment.VipSearchFragment;
import com.xingdata.zzdpos.ui.vip.fragment.VipTruleListFragment;
import java.util.ArrayList;
import java.util.List;
public class LevelPresenter extends LevelContract.Presenter {
public LevelListFragment levelListFragment = new LevelListFragment();
public VipLevelEditFragment vipLevelEditFragment = new VipLevelEditFragment();
@Override
public void onAttached() {
getVipLevel(0,200);
}
@Override
public void getVipLevel(int pageNum, int
pageSize) {
ApiFactory.Level.getVipLevelList(pageNum, pageSize).subscribe(vipPager -> {
mView.getVipLevelSus(vipPager);
}, throwable -> {
ToastUtils.showShort(throwable.getMessage());
});
}
@Override
public void updateVipLevel(Level level) {
if (level.getId()!=null){
ApiFactory.Level.updateVipLevel(level).subscribe(mLevel -> {
mView.updateVipLevelSus(mLevel);
}, throwable -> {
ToastUtils.showShort(throwable.getMessage());
});
}else {
ApiFactory.Level.addVipLevel(level).subscribe(mLevel -> {
mView.updateVipLevelSus(mLevel);
}, throwable -> {
ToastUtils.showShort(throwable.getMessage());
});
}
}
}
package com.xingdata.zzdpos.ui.marketing.viplevel.adapter;
import android.content.Context;
import android.support.annotation.Nullable;
import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseAdapter;
import com.xingdata.zzdpos.databinding.ItemVipLevelListItemBinding;
import com.xingdata.zzdpos.databinding.ItemVipListItemBinding;
import com.xingdata.zzdpos.model.Level;
import com.xingdata.zzdpos.model.Vip;
import com.xingdata.zzdpos.util.ConvertUtil;
import java.util.HashMap;
import java.util.List;
/**
* Created by JM_DEV on 2017/12/25.
*/
public class VipLevelListAdapter extends BaseAdapter<Level, ItemVipLevelListItemBinding> {
private Context mContext;
private HashMap<String, Integer> bgMap = new HashMap<>();
public VipLevelListAdapter(Context mContext, @Nullable List<Level> data) {
super(R.layout.item_vip_level_list_item, data);
this.mContext = mContext;
}
public void initBG(List<Level> data) {
bgMap.clear();
for (int i = 0; i < data.size(); i++) {
if ((i + 1) % 3 == 0) {
bgMap.put(data.get(i).getVipLevel().toString(), R.mipmap.bg_grade03);
} else if ((i + 1) % 2 == 0) {
bgMap.put(data.get(i).getVipLevel().toString(), R.mipmap.bg_grade02);
} else {
bgMap.put(data.get(i).getVipLevel().toString(), R.mipmap.bg_grade01);
}
}
}
@Override
protected void convert(ItemVipLevelListItemBinding mViewBinding, Level item) {
mViewBinding.levelName.setText(item.getVipLevelName());
mViewBinding.levelDiscount.setText(ConvertUtil.discount(item.getVipDefDiscount()) + "折");
mViewBinding.levelCondition.setText(mContext.getString(R.string.adv_plan, ConvertUtil.fenToYuanNoZero(item.getVipUpgradeAmtTp())));
mViewBinding.levelBg.setBackgroundResource(bgMap.get(item.getVipLevel().toString()));
}
}
package com.xingdata.zzdpos.ui.marketing.viplevel.fragment;
/**
* Created by JM_DEV on 2017/12/21.
*/
import android.annotation.SuppressLint;
import android.support.v7.widget.LinearLayoutManager;
import android.view.Gravity;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.RadioButton;
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.FragmentVipLevelListBinding;
import com.xingdata.zzdpos.databinding.FragmentVipListBinding;
import com.xingdata.zzdpos.model.Level;
import com.xingdata.zzdpos.model.Pager;
import com.xingdata.zzdpos.model.Sta;
import com.xingdata.zzdpos.model.Vip;
import com.xingdata.zzdpos.ui.marketing.viplevel.LevelPresenter;
import com.xingdata.zzdpos.ui.marketing.viplevel.adapter.VipLevelListAdapter;
import com.xingdata.zzdpos.ui.vip.VipPresenter;
import com.xingdata.zzdpos.ui.vip.adapter.VipListAdapter;
import com.xingdata.zzdpos.util.ConvertUtil;
import com.xingdata.zzdpos.util.OnClickListener;
import java.util.ArrayList;
import java.util.List;
/**
* 会员等级界面
*/
public class LevelListFragment extends BaseFragment<LevelPresenter, FragmentVipLevelListBinding> {
private VipLevelListAdapter adapter;
private int pageNumber = 0;
private String strVipLevle;
private int vipState = 0;//0 会员 1 充值
@Override
public int getLayoutId() {
return R.layout.fragment_vip_level_list;
}
@Override
public void initView() {
adapter = new VipLevelListAdapter(getActivity(), new ArrayList<Level>());
mViewBinding.titleLayout.setOnClickListener(new OnClickListener() {
@Override
protected void myOnClickListener(View v) {
getActivity().finish();
}
});
mViewBinding.noRultBg.setVisibility(View.VISIBLE);
mViewBinding.levelRecyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
mViewBinding.levelRecyclerView.setAdapter(adapter);
mViewBinding.titleLayout.tvTitle.setText("会员等级");
adapter.setOnItemClickListener((mAdapter, view, position) -> {
mPresenter.vipLevelEditFragment.setmLevel((Level) mAdapter.getData().get(position));
start(mPresenter.vipLevelEditFragment);
});
adapter.setOnLoadMoreListener(this::onLoadMore, mViewBinding.levelRecyclerView);
adapter.setEnableLoadMore(false);
mViewBinding.setOnClickListener(view -> {
switch (view.getId()) {
case R.id.addVip:
mPresenter.vipLevelEditFragment.setmLevel(null);
start(mPresenter.vipLevelEditFragment);
break;
}
});
}
private void onLoadMore() {
}
public void getVipLevelSus(Pager<Level> levelPager) {
adapter.initBG(levelPager.getList());
adapter.setNewData(levelPager.getList());
if (levelPager.getList().size() != 0) {
mViewBinding.noRultBg.setVisibility(View.GONE);
} else {
mViewBinding.noRultBg.setVisibility(View.VISIBLE);
}
adapter.setEnableLoadMore(false);
adapter.loadMoreComplete();
}
}
package com.xingdata.zzdpos.ui.marketing.viplevel.fragment;
/**
* Created by JM_DEV on 2017/12/21.
*/
import android.view.View;
import com.blankj.utilcode.util.ToastUtils;
import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseFragment;
import com.xingdata.zzdpos.databinding.FragmentVipLevelEditBinding;
import com.xingdata.zzdpos.model.Level;
import com.xingdata.zzdpos.ui.marketing.viplevel.LevelPresenter;
import com.xingdata.zzdpos.util.ConvertUtil;
/**
* 会员等级编辑界面
*/
public class VipLevelEditFragment extends BaseFragment<LevelPresenter, FragmentVipLevelEditBinding> {
private Level mLevel;
@Override
public int getLayoutId() {
return R.layout.fragment_vip_level_edit;
}
@Override
public void initView() {
mViewBinding.infoTitle.popMenu.setVisibility(View.GONE);
mViewBinding.infoTitle.tvTitle.setText("等级设置");
mViewBinding.infoTitle.ivBack.setOnClickListener(view -> {
pop();
});
if (mLevel != null) {
mViewBinding.infoTitle.tvTitle.setText("修改会员");
mViewBinding.levelName.setText(mLevel.getVipLevelName());
mViewBinding.levelDiscont.setText(String.valueOf(mLevel.getVipDefDiscount()));
mViewBinding.updateMoney.setText( ConvertUtil.fenToYuanNoZero(mLevel.getVipUpgradeAmtTp()));
mViewBinding.updateDay.setText(mLevel.getVipUpgradeDay()+"");
}
mViewBinding.setOnClickListener(view -> {
switch (view.getId()) {
case R.id.onSure:
Level level = new Level();
if (mLevel != null) {
level.setId(mLevel.getId());
}
if (mViewBinding.levelName.getText().length() == 0) {
ToastUtils.showShort("等级名称不能为空");
return;
}
if (mViewBinding.levelDiscont.getText().length() == 0) {
ToastUtils.showShort("折扣不能为空");
return;
}
if (mViewBinding.updateDay.length() == 0) {
ToastUtils.showShort("最近多少天不能为空");
return;
}
if (mViewBinding.updateMoney.getText().length() == 0) {
ToastUtils.showShort("消费金额不能为空");
return;
}
level.setVipLevelName(mViewBinding.levelName.getText().toString());
level.setVipDefDiscount(Integer.parseInt(mViewBinding.levelDiscont.getText().toString()));
level.setVipUpgradeDay(Integer.parseInt(mViewBinding.updateDay.getText().toString()));
level.setVipUpgradeAmtTp(ConvertUtil.yuanToFen(mViewBinding.updateMoney.getText().toString()));
mPresenter.updateVipLevel(level);
break;
}
});
mViewBinding.infoTitle.ivBack.setOnClickListener(view -> {
pop();
});
}
@Override
public boolean onBackPressedSupport() {
return false;
}
public void setmLevel(Level mLevel) {
this.mLevel = mLevel;
}
}
...@@ -13,6 +13,7 @@ import android.widget.RadioButton; ...@@ -13,6 +13,7 @@ import android.widget.RadioButton;
import android.widget.TextView; import android.widget.TextView;
import com.bigkoo.pickerview.OptionsPickerView; import com.bigkoo.pickerview.OptionsPickerView;
import com.blankj.utilcode.util.ToastUtils;
import com.xingdata.zzdpos.R; import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseActivity; import com.xingdata.zzdpos.base.BaseActivity;
import com.xingdata.zzdpos.base.BaseFragment; import com.xingdata.zzdpos.base.BaseFragment;
...@@ -43,6 +44,7 @@ public class VipInfoEditFragment extends BaseFragment<VipPresenter, FragmentVipI ...@@ -43,6 +44,7 @@ public class VipInfoEditFragment extends BaseFragment<VipPresenter, FragmentVipI
@Override @Override
public void initView() { public void initView() {
mViewBinding.infoTitle.popMenu.setVisibility(View.GONE);
if (mVip != null) { if (mVip != null) {
mViewBinding.infoTitle.tvTitle.setText("修改会员"); mViewBinding.infoTitle.tvTitle.setText("修改会员");
mViewBinding.vipDiscounts.setText(mVip.getVipLevelName() + mVip.getVipDefDiscount() + "折"); mViewBinding.vipDiscounts.setText(mVip.getVipLevelName() + mVip.getVipDefDiscount() + "折");
...@@ -72,6 +74,16 @@ public class VipInfoEditFragment extends BaseFragment<VipPresenter, FragmentVipI ...@@ -72,6 +74,16 @@ public class VipInfoEditFragment extends BaseFragment<VipPresenter, FragmentVipI
break; break;
case R.id.onSure: case R.id.onSure:
if (mViewBinding.vipName.getText().length()==0){
ToastUtils.showShort("会员名称不能为空");
return;
}
if (mViewBinding.vipPhone.getText().length()==0){
ToastUtils.showShort("会员手机号不能为空");
return;
}
if (mVip == null) { if (mVip == null) {
mVip = new Vip(); mVip = new Vip();
} }
......
...@@ -107,7 +107,7 @@ public class StringUtil { ...@@ -107,7 +107,7 @@ public class StringUtil {
* @return * @return
*/ */
public static Long getTimeMillis(String strDate) { public static Long getTimeMillis(String strDate) {
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd"); SimpleDateFormat formatter = new SimpleDateFormat(defaultDatePattern);
ParsePosition pos = new ParsePosition(0); ParsePosition pos = new ParsePosition(0);
Date strtodate = formatter.parse(strDate, pos); Date strtodate = formatter.parse(strDate, pos);
return strtodate.getTime(); return strtodate.getTime();
......
<?xml version="1.0" encoding="utf-8"?>
<layout>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<FrameLayout
android:id="@+id/vip_level_frame"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
</layout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<layout>
<data>
<variable
name="onClickListener"
type="android.view.View.OnClickListener" />
</data>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/bg"
android:orientation="vertical">
<include
android:id="@+id/info_title"
layout="@layout/title_pop" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/all_margin"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
style="@style/default_blacktext_bigstyle"
android:layout_width="90dp"
android:layout_height="wrap_content"
android:text="基本信息" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:orientation="horizontal">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical">
<LinearLayout
android:id="@+id/rule_name_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:orientation="horizontal">
<TextView
android:id="@+id/rule_name"
style="@style/default_blacktext_margin_smallstyle"
android:layout_width="90dp"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/all_margin_left"
android:text="活动名称" />
<EditText
style="@style/dialog_edit"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@null"
android:enabled="false" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginRight="@dimen/all_margin_left"
android:background="@color/line_bg" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
style="@style/default_blacktext_margin_smallstyle"
android:layout_width="90dp"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/all_margin_left"
android:maxLength="11"
android:text="启用状态" />
<RadioGroup
android:id="@+id/rule_state"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="12sp"
android:gravity="center_vertical"
android:orientation="horizontal">
<RadioButton
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginRight="50dp"
android:layout_weight="1"
android:background="@drawable/selector_checkbox_bg"
android:button="@null"
android:tag="1"
android:text="暂停" />
<RadioButton
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginRight="50dp"
android:layout_weight="1"
android:background="@drawable/selector_checkbox_bg"
android:button="@null"
android:tag="0"
android:text="启用" />
</RadioGroup>
</LinearLayout>
</LinearLayout>
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/line_bg" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/all_margin"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
style="@style/default_blacktext_bigstyle"
android:layout_width="90dp"
android:layout_height="wrap_content"
android:text="优惠规则" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:orientation="horizontal">
<TextView
style="@style/default_blacktext_margin_smallstyle"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/all_margin_left"
android:text="充值每满" />
<EditText
android:id="@+id/recharg_amt"
style="@style/dialog_edit"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@null"
android:digits="0123456789"
android:gravity="center"
android:inputType="phone"
android:maxLength="8" />
<TextView
style="@style/default_blacktext_margin_smallstyle"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/all_margin_left"
android:text="元" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:orientation="horizontal">
<TextView
style="@style/default_blacktext_margin_smallstyle"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/all_margin_left"
android:text="送" />
<EditText
android:id="@+id/send_amt"
style="@style/dialog_edit"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@null"
android:digits="0123456789"
android:gravity="center"
android:inputType="phone"
android:maxLength="8" />
<TextView
style="@style/default_blacktext_margin_smallstyle"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/all_margin_left"
android:text="元" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:orientation="horizontal">
<TextView
style="@style/default_blacktext_margin_smallstyle"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/all_margin_left"
android:text="开始日期" />
<TextView
android:id="@+id/rule_begin_time"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginRight="@dimen/all_margin_left"
android:background="@mipmap/ic_expand_left"
android:gravity="center"
android:onClick="@{onClickListener}" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:orientation="horizontal">
<TextView
style="@style/default_blacktext_margin_smallstyle"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/all_margin_left"
android:text="结束日期" />
<TextView
android:id="@+id/rule_end_time"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginRight="@dimen/all_margin_left"
android:background="@mipmap/ic_expand_left"
android:gravity="center"
android:onClick="@{onClickListener}" />
</LinearLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<Button
android:id="@+id/onSure"
style="@style/button_positive_noradius"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginBottom="15dp"
android:onClick="@{onClickListener}"
android:text="确认" />
</RelativeLayout>
</LinearLayout>
</layout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<layout>
<data>
<variable
name="onClickListener"
type="android.view.View.OnClickListener" />
</data>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:orientation="horizontal">
<include
android:id="@+id/title_layout"
layout="@layout/title"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
<LinearLayout
android:id="@+id/addVipLinearLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:background="@color/white"
android:gravity="center"
android:orientation="vertical">
<LinearLayout
android:id="@+id/addRule"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:onClick="@{onClickListener}"
android:orientation="horizontal">
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_margin="5dp"
android:background="@mipmap/add_bg" />
<TextView
style="@style/default_blacktext_bigstyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="添加充值优惠"
android:textColor="@color/deep_red" />
</LinearLayout>
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_margin="@dimen/view_line_L5"
android:background="@color/line1" />
<RelativeLayout
android:id="@+id/RecyclerView_Layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="@dimen/all_margin_left">
<LinearLayout
android:id="@+id/noRultBg"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@mipmap/icon_things_null" />
<TextView
style="@style/textView_body_small"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="还没有会员等级,请添加会员等级~"
android:textColor="@color/gray_huanggai"
android:textSize="22sp" />
</LinearLayout>
<android.support.v7.widget.RecyclerView
android:id="@+id/levelRecyclerView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_centerHorizontal="true" />
</RelativeLayout>
</LinearLayout>
</layout>
\ No newline at end of file
...@@ -15,26 +15,26 @@ ...@@ -15,26 +15,26 @@
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:gravity="center_vertical"
android:orientation="horizontal"> android:orientation="horizontal">
<include <include
android:id="@+id/title_search" android:id="@+id/search_layout"
layout="@layout/title_search" layout="@layout/title_search"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="1" /> android:layout_weight="1" />
<TextView <TextView
style="@style/textView_body_small"
android:id="@+id/userSearch" android:id="@+id/userSearch"
style="@style/textView_body_small"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center" android:gravity="center"
android:text="搜索"
android:onClick="@{onClickListener}" android:onClick="@{onClickListener}"
android:layout_width="wrap_content" android:text="搜索" />
android:layout_height="wrap_content" />
</LinearLayout> </LinearLayout>
...@@ -124,8 +124,7 @@ ...@@ -124,8 +124,7 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="添加店员" android:text="添加店员"
android:textColor="@color/deep_red" android:textColor="@color/deep_red" />
android:textSize="22sp" />
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
......
<?xml version="1.0" encoding="utf-8"?>
<layout>
<data>
<variable
name="onClickListener"
type="android.view.View.OnClickListener" />
</data>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/bg"
android:orientation="vertical">
<include
android:id="@+id/info_title"
layout="@layout/title_pop" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/all_margin"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
style="@style/default_blacktext_bigstyle"
android:layout_width="90dp"
android:layout_height="wrap_content"
android:text="基本信息" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:orientation="horizontal">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:orientation="horizontal">
<TextView
style="@style/default_blacktext_margin_smallstyle"
android:layout_width="90dp"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/all_margin_left"
android:text="等级名称" />
<EditText
android:id="@+id/level_name"
style="@style/dialog_edit"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@null"
android:hint="请输入等级名称" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginRight="@dimen/all_margin_left"
android:background="@color/line_bg" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:orientation="horizontal">
<TextView
style="@style/default_blacktext_margin_smallstyle"
android:layout_width="90dp"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/all_margin_left"
android:maxLength="11"
android:text="折扣设置" />
<EditText
android:id="@+id/level_discont"
android:maxLength="3"
style="@style/dialog_edit"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@null"
android:digits="0123456789"
android:hint="%"
android:inputType="numberSigned" />
</LinearLayout>
</LinearLayout>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:background="@mipmap/img_grade" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/line_bg" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/all_margin"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
style="@style/default_blacktext_bigstyle"
android:layout_width="90dp"
android:layout_height="wrap_content"
android:text="晋级标准" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:orientation="horizontal">
<TextView
style="@style/default_blacktext_margin_smallstyle"
android:layout_width="90dp"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/all_margin_left"
android:text="最近" />
<EditText
android:id="@+id/update_day"
style="@style/dialog_edit"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@null"
android:maxLength="3"
android:digits="0123456789"
android:inputType="phone" />
<TextView
style="@style/default_blacktext_margin_smallstyle"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/all_margin_left"
android:text="天" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:orientation="horizontal">
<TextView
style="@style/default_blacktext_margin_smallstyle"
android:layout_width="90dp"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/all_margin_left"
android:text="消费金额" />
<EditText
android:id="@+id/update_money"
style="@style/dialog_edit"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:maxLength="8"
android:background="@null"
android:digits="0123456789"
android:inputType="phone" />
<TextView
style="@style/default_blacktext_margin_smallstyle"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/all_margin_left"
android:text="元" />
</LinearLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<Button
android:id="@+id/onSure"
style="@style/button_positive_noradius"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginBottom="15dp"
android:onClick="@{onClickListener}"
android:text="确认" />
</RelativeLayout>
</LinearLayout>
</layout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<layout>
<data>
<variable
name="onClickListener"
type="android.view.View.OnClickListener" />
</data>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:orientation="horizontal">
<include
android:id="@+id/title_layout"
layout="@layout/title"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
<LinearLayout
android:id="@+id/addVipLinearLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:background="@color/white"
android:gravity="center"
android:orientation="vertical">
<LinearLayout
android:id="@+id/addVip"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:onClick="@{onClickListener}"
android:orientation="horizontal">
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_margin="5dp"
android:background="@mipmap/add_bg" />
<TextView
style="@style/default_blacktext_bigstyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="添加等级"
android:textColor="@color/deep_red" />
</LinearLayout>
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_margin="@dimen/view_line_L5"
android:background="@color/line1" />
<RelativeLayout
android:id="@+id/RecyclerView_Layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="@dimen/all_margin_left">
<LinearLayout
android:id="@+id/noRultBg"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@mipmap/icon_things_null" />
<TextView
style="@style/textView_body_small"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="还没有会员等级,请添加会员等级~"
android:textColor="@color/gray_huanggai"
android:textSize="22sp" />
</LinearLayout>
<android.support.v7.widget.RecyclerView
android:id="@+id/levelRecyclerView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_centerHorizontal="true" />
</RelativeLayout>
</LinearLayout>
</layout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<layout>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/all_margin"
android:background="@mipmap/recharge_rule"
android:gravity="center_horizontal"
android:orientation="vertical">
<RelativeLayout
android:layout_margin="@dimen/all_margin"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_margin="@dimen/all_margin"
android:background="@mipmap/ic_filling" />
<TextView
android:id="@+id/rule_name"
style="@style/default_blacktext_bigstyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:text="@string/recharge_send" />
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/all_margin_left"
android:layout_marginRight="@dimen/all_margin_left"
android:layout_marginBottom="35dp"
android:background="@mipmap/rule_time"
android:gravity="center"
android:orientation="horizontal">
<TextView
android:id="@+id/rule_validity"
style="@style/textView_body_small"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="2017-2017"
android:textColor="@color/white"
android:textSize="@dimen/small_text_size" />
</LinearLayout>
</LinearLayout>
</layout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<layout>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:orientation="horizontal">
<LinearLayout
android:id="@+id/level_bg"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@mipmap/bg_grade01"
android:orientation="horizontal">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/all_margin"
android:layout_marginTop="25dp"
android:gravity="center_vertical"
android:orientation="horizontal">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@mipmap/bg_grade04" />
<TextView
android:id="@+id/level_name"
style="@style/textView_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/all_margin_left"
android:text="钻石会员"
android:textColor="@color/white" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginBottom="18dp"
android:layout_marginRight="@dimen/dtail_width_20"
android:layout_marginTop="25dp"
android:layout_weight="1"
android:gravity="left"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/level_Discount"
style="@style/textView_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="right"
android:text="8折"
android:textColor="@color/white" />
</LinearLayout>
<TextView
android:id="@+id/level_condition"
style="@style/textView_body_small"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginBottom="15dp"
android:gravity="bottom"
android:text="@string/adv_plan"
android:textColor="@color/white" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</layout>
\ No newline at end of file
...@@ -30,7 +30,6 @@ ...@@ -30,7 +30,6 @@
android:layout_marginEnd="@dimen/all_padding" android:layout_marginEnd="@dimen/all_padding"
android:drawablePadding="@dimen/all_padding" android:drawablePadding="@dimen/all_padding"
android:hint="请输入手机号或会员姓名" android:hint="请输入手机号或会员姓名"
android:inputType="number"
android:textColor="@color/black_likui" android:textColor="@color/black_likui"
android:textSize="@dimen/all_text_size_low" /> android:textSize="@dimen/all_text_size_low" />
......
...@@ -459,7 +459,7 @@ ...@@ -459,7 +459,7 @@
<string name="casher_manager_title">店员管理</string> <string name="casher_manager_title">店员管理</string>
<!--充值优惠--> <!--充值优惠-->
<string name="recharge_discounts_title">充值优惠</string> <string name="recharge_discounts_title">充值优惠</string>
<string name="recharge_send">充%s送%s元</string> <string name="recharge_send">充%s送%s元</string>
<string name="recharge_discounts_number">共%s个优惠</string> <string name="recharge_discounts_number">共%s个优惠</string>
<!--店员管理--> <!--店员管理-->
<string name="casher_titile">管理-店员管理</string> <string name="casher_titile">管理-店员管理</string>
......
...@@ -384,7 +384,7 @@ ...@@ -384,7 +384,7 @@
<item name="android:layout_marginLeft">@dimen/all_margin_left</item> <item name="android:layout_marginLeft">@dimen/all_margin_left</item>
<item name="android:textSize">@dimen/text_three_title</item> <item name="android:textSize">@dimen/text_three_title</item>
<item name="android:background">@color/transparent</item> <item name="android:background">@color/transparent</item>
<item name=" android:textColor">@color/gary</item> <item name="android:textColor">@color/gary</item>
<item name="android:gravity">center|left</item> <item name="android:gravity">center|left</item>
</style> </style>
......
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