Commit 4f2c1a76 authored by 王海's avatar 王海

Merge remote-tracking branch 'origin/master'

parents 6fa63cca 42606efe
...@@ -76,9 +76,18 @@ ...@@ -76,9 +76,18 @@
android:screenOrientation="portrait" android:screenOrientation="portrait"
android:theme="@style/AppTheme" android:theme="@style/AppTheme"
android:windowSoftInputMode="adjustUnspecified|stateHidden" /> android:windowSoftInputMode="adjustUnspecified|stateHidden" />
<activity android:name=".ui.help.HelpActivity" /> <activity
<activity android:name=".ui.feedback.FeedBackActivity" /> android:name=".ui.help.HelpActivity"
<activity android:name=".ui.statistics.StatisticsActivity" /> android:configChanges="keyboard|orientation|screenSize|keyboardHidden"
android:windowSoftInputMode="adjustUnspecified|stateHidden" />
<activity
android:name=".ui.feedback.FeedBackActivity"
android:configChanges="keyboard|orientation|screenSize|keyboardHidden"
android:windowSoftInputMode="adjustUnspecified|stateHidden" />
<activity
android:name=".ui.statistics.StatisticsActivity"
android:configChanges="keyboard|orientation|screenSize|keyboardHidden"
android:windowSoftInputMode="adjustUnspecified|stateHidden" />
<activity <activity
android:name=".ui.vip.VipActivity" android:name=".ui.vip.VipActivity"
android:configChanges="keyboard|orientation|screenSize|keyboardHidden" android:configChanges="keyboard|orientation|screenSize|keyboardHidden"
...@@ -89,11 +98,18 @@ ...@@ -89,11 +98,18 @@
android:name=".ui.marketing.ms.MsActivity" android:name=".ui.marketing.ms.MsActivity"
android:configChanges="keyboard|orientation|screenSize|keyboardHidden" android:configChanges="keyboard|orientation|screenSize|keyboardHidden"
android:windowSoftInputMode="adjustUnspecified|stateHidden" /> android:windowSoftInputMode="adjustUnspecified|stateHidden" />
<activity
android:name=".ui.manage.otherselect.OtherSelectActivity"
android:configChanges="keyboard|orientation|screenSize|keyboardHidden"
android:windowSoftInputMode="adjustUnspecified|stateHidden" />
<activity <activity
android:name=".ui.manage.manageMenu.ManageMenuActivity" android:name=".ui.manage.manageMenu.ManageMenuActivity"
android:configChanges="keyboard|orientation|screenSize|keyboardHidden" android:configChanges="keyboard|orientation|screenSize|keyboardHidden"
android:windowSoftInputMode="adjustUnspecified|stateHidden" /> android:windowSoftInputMode="adjustUnspecified|stateHidden" />
<activity android:name=".ui.manage.replenishment.ReplenishmentActivity"></activity> <activity
android:name=".ui.manage.replenishment.ReplenishmentActivity"
android:configChanges="keyboard|orientation|screenSize|keyboardHidden"
android:windowSoftInputMode="adjustUnspecified|stateHidden" />
</application> </application>
</manifest> </manifest>
\ No newline at end of file
...@@ -512,8 +512,8 @@ public class C { ...@@ -512,8 +512,8 @@ public class C {
public static final int MONEY_OFF = 4; public static final int MONEY_OFF = 4;
//换购 //换购
public static final int GIFT = 5; public static final int GIFT = 5;
//会员折扣 //第二件促销
public static final int VIP = 6; public static final int SECOND_PRO = 6;
} }
public final class DIS_TYPE { public final class DIS_TYPE {
......
...@@ -11,6 +11,7 @@ import com.chad.library.adapter.base.BaseQuickAdapter; ...@@ -11,6 +11,7 @@ import com.chad.library.adapter.base.BaseQuickAdapter;
import com.xingdata.zzdpos.C; import com.xingdata.zzdpos.C;
import com.xingdata.zzdpos.R; import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.databinding.ActivityMarketingMenuBinding; import com.xingdata.zzdpos.databinding.ActivityMarketingMenuBinding;
import com.xingdata.zzdpos.ui.manage.otherselect.OtherSelectActivity;
import com.xingdata.zzdpos.ui.manage.replenishment.ReplenishmentActivity; import com.xingdata.zzdpos.ui.manage.replenishment.ReplenishmentActivity;
import com.xingdata.zzdpos.ui.marketing.integral.IntegralActivity; import com.xingdata.zzdpos.ui.marketing.integral.IntegralActivity;
import com.xingdata.zzdpos.ui.marketing.marketingMenu.MarketingMenuActivity; import com.xingdata.zzdpos.ui.marketing.marketingMenu.MarketingMenuActivity;
...@@ -74,7 +75,7 @@ public class ManageMenuActivity extends AppCompatActivity { ...@@ -74,7 +75,7 @@ public class ManageMenuActivity extends AppCompatActivity {
} }
break; break;
case C.MENU.MENU_MANAGER_OTHER: { case C.MENU.MENU_MANAGER_OTHER: {
ActivityUtils.startActivity(ManageMenuActivity.this, OtherSelectActivity.class);
} }
break; break;
case C.MENU.MENU_MANAGER_INVENTORY: { case C.MENU.MENU_MANAGER_INVENTORY: {
......
package com.xingdata.zzdpos.ui.manage.otherselect;
import android.view.KeyEvent;
import com.blankj.utilcode.util.KeyboardUtils;
import com.blankj.utilcode.util.ToastUtils;
import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseActivity;
import com.xingdata.zzdpos.databinding.ActivityOtherSelectBinding;
import com.xingdata.zzdpos.model.Ossku;
import com.xingdata.zzdpos.model.Pager;
import com.xingdata.zzdpos.ui.manage.otherselect.fragment.OtherListFragment;
public class OtherSelectActivity extends BaseActivity<OtherSelectPresenter, ActivityOtherSelectBinding> implements OtherSelectContract.View {
private OtherListFragment mOtherListFragment = new OtherListFragment();
@Override
public int getLayoutId() {
return R.layout.activity_other_select;
}
@Override
public void initView() {
loadRootFragment(R.id.fragment_container, mOtherListFragment, false, false);
mViewBinding.lyTitle.edTitle.setOnKeyListener((v, keyCode, event) -> {
if (keyCode == KeyEvent.KEYCODE_ENTER)
search(mViewBinding.lyTitle.edTitle.getText().toString().trim());
return false;
});
}
@Override
public void isShowLoading(Boolean is) {
}
@Override
public void loadOssku(Pager<Ossku> osskuList, boolean isRefresh) {
mOtherListFragment.setData(osskuList, isRefresh);
}
@Override
protected void onPause() {
KeyboardUtils.hideSoftInput(this);
super.onPause();
}
private void search(String string) {
KeyboardUtils.hideSoftInput(this);
if (string.length() == 0) {
ToastUtils.showShort("请输入搜索内容");
return;
}
mPresenter.searchGoodsFirst(string);
}
}
package com.xingdata.zzdpos.ui.manage.otherselect;
import com.xingdata.zzdpos.base.BasePresenter;
import com.xingdata.zzdpos.base.BaseView;
import com.xingdata.zzdpos.model.Ossku;
import com.xingdata.zzdpos.model.Pager;
/**
* Created by Eurus on 2017/11/23.
*/
public interface OtherSelectContract {
interface View extends BaseView {
void isShowLoading(Boolean is);
/**
* 加载列表
*/
void loadOssku(Pager<Ossku> osskuList, boolean isRefresh);
}
abstract class Presenter extends BasePresenter<View> {
/**
* 临库查询界面 - 查找
*
* @param keyword 搜索关键字
*/
public abstract void searchGoodsFirst(String keyword);
/**
* 临库查询界面 - 查找
*
* @param keyword 搜索关键字
*/
abstract void searchGoods(String keyword);
/**
* 临库查询页面 - 加载更多
*/
public abstract void loadMore();
/**
* 临库查询页面 - 刷新
*/
public abstract void refresh();
}
}
package com.xingdata.zzdpos.ui.manage.otherselect;
import com.blankj.utilcode.util.ToastUtils;
import com.xingdata.zzdpos.api.ApiFactory;
public class OtherSelectPresenter extends OtherSelectContract.Presenter {
private int nowPageNumber = 1;
private int nowPageSize = 10;
private String wd;
@Override
public void onAttached() {
}
@Override
public void searchGoodsFirst(String keyword) {
wd = keyword;
nowPageNumber = 1;
searchGoods(wd);
}
@Override
void searchGoods(String keyword) {
mView.isShowLoading(true);
ApiFactory.Sssku.getOtherShopSsku(keyword, nowPageNumber, nowPageSize).doFinally(() -> {
mView.isShowLoading(false);
})
.subscribe(osskus -> {
if (osskus.getTotalRow() == 0) {
ToastUtils.showShort("没有搜到当前商品,请重新输入");
}
//判断是否能加载更多
mView.loadOssku(osskus, nowPageNumber == 1);
}, throwable -> {
ToastUtils.showShort(throwable.getMessage());
});
}
@Override
public void loadMore() {
this.nowPageNumber++;
searchGoods(wd);
}
@Override
public void refresh() {
this.nowPageNumber = 1;
searchGoods(wd);
}
}
package com.xingdata.zzdpos.ui.manage.otherselect.adpter;
import android.support.annotation.Nullable;
import android.view.View;
import android.view.ViewGroup;
import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseAdapter;
import com.xingdata.zzdpos.databinding.ItemOtherSelectBinding;
import com.xingdata.zzdpos.model.Ossku;
import com.xingdata.zzdpos.util.ConvertUtil;
import java.util.List;
public class OtherSelectAdapter extends BaseAdapter<Ossku, ItemOtherSelectBinding> {
public OtherSelectAdapter(@Nullable List<Ossku> data) {
super(R.layout.item_other_select, data);
}
@Override
protected void convert(ItemOtherSelectBinding mViewBinding, Ossku item) {
mViewBinding.tvGoodsName.setText(item.getSpuName());
mViewBinding.tvGoodsCode.setText(item.getSpuBarcode() + "");
// mViewBinding.tvGoodsPrice.setText(ConvertUtil.fenToYuan(item.getSkuRetailPrice1(), false));
mViewBinding.tvGoodsSize.setText("规格/" + item.getSpuUnitName());
mViewBinding.imgGoods.setImageURI(item.getSpuImg());
// mViewBinding.tvNum.setText(item.getSkuStock() + "个");
mViewBinding.tvShop.setText(item.getShopName());
// mViewBinding.tvAddress.setText(item.getCityAddress());
// mViewBinding.tvTel.setText(item.getContactTel());
}
}
package com.xingdata.zzdpos.ui.manage.otherselect.fragment;
import android.support.v7.widget.LinearLayoutManager;
import android.view.View;
import android.widget.TextView;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseFragment;
import com.xingdata.zzdpos.databinding.FragmentOtherListBinding;
import com.xingdata.zzdpos.model.Ossku;
import com.xingdata.zzdpos.model.Pager;
import com.xingdata.zzdpos.ui.manage.otherselect.OtherSelectPresenter;
import com.xingdata.zzdpos.ui.manage.otherselect.adpter.OtherSelectAdapter;
import java.util.ArrayList;
/**
* Created by Administrator on 2017/11/23.
*/
public class OtherDetailFragment extends BaseFragment<OtherSelectPresenter, FragmentOtherListBinding> {
private OtherSelectAdapter mOtherSelectAdapter;
@Override
public int getLayoutId() {
return R.layout.fragment_other_list;
}
@Override
public void initView() {
mOtherSelectAdapter = new OtherSelectAdapter(new ArrayList<>());
mOtherSelectAdapter.setEmptyView(getEmptyView(R.string.empty_other_select));
mViewBinding.recyclerOtherSelcet.setLayoutManager(new LinearLayoutManager(getActivity()));
mViewBinding.recyclerOtherSelcet.setAdapter(mOtherSelectAdapter);
mOtherSelectAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
@Override
public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
// Intent intent = new Intent(getActivity(), StatisticsDetailActivity.class);
// intent.putExtra(Saleorder.class.getName(), mStatisticsAdapter.getData().get(position).getId());
// ActivityUtils.startActivity(intent);
}
});
mViewBinding.srlProduct.setOnRefreshListener(this::onRefresh);
mOtherSelectAdapter.setOnLoadMoreListener(this::onLoadMore, mViewBinding.recyclerOtherSelcet);
}
private void onRefresh() {
mPresenter.refresh();
}
private void onLoadMore() {
mPresenter.loadMore();
}
/**
* 设置数据
*
* @param pager 数据
* @param isRefresh 是否刷新
*/
public void setData(Pager<Ossku> pager, boolean isRefresh) {
if (isRefresh) {
mOtherSelectAdapter.setEnableLoadMore(true);
mViewBinding.srlProduct.setRefreshing(false);
}
if (isRefresh) mOtherSelectAdapter.setNewData(pager.getList());
else if (pager.getList().size() > 0) mOtherSelectAdapter.addData(pager.getList());
if (pager.isLastPage()) mOtherSelectAdapter.loadMoreEnd(isRefresh);
else mOtherSelectAdapter.loadMoreComplete();
}
private View getEmptyView(int resHint) {
View view = getLayoutInflater().inflate(R.layout.view_empty, null);
view.setBackgroundResource(R.color.white_caocao);
((TextView) view.findViewById(R.id.tv_empty)).setText(resHint);
return view;
}
}
package com.xingdata.zzdpos.ui.manage.otherselect.fragment;
import android.annotation.SuppressLint;
import android.content.Intent;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.KeyEvent;
import android.view.View;
import android.widget.TextView;
import com.blankj.utilcode.util.KeyboardUtils;
import com.blankj.utilcode.util.ToastUtils;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseFragment;
import com.xingdata.zzdpos.databinding.FragmentOrderListBinding;
import com.xingdata.zzdpos.databinding.FragmentOtherListBinding;
import com.xingdata.zzdpos.model.Ossku;
import com.xingdata.zzdpos.model.Pager;
import com.xingdata.zzdpos.ui.manage.otherselect.OtherSelectPresenter;
import com.xingdata.zzdpos.ui.manage.otherselect.adpter.OtherSelectAdapter;
import java.util.ArrayList;
import java.util.List;
/**
* Created by Administrator on 2017/11/23.
*/
public class OtherListFragment extends BaseFragment<OtherSelectPresenter, FragmentOtherListBinding> {
private OtherSelectAdapter mOtherSelectAdapter;
@Override
public int getLayoutId() {
return R.layout.fragment_other_list;
}
@Override
public void initView() {
mOtherSelectAdapter = new OtherSelectAdapter(new ArrayList<>());
mOtherSelectAdapter.setEmptyView(getEmptyView(R.string.empty_other_select));
mViewBinding.recyclerOtherSelcet.setLayoutManager(new LinearLayoutManager(getActivity()));
mViewBinding.recyclerOtherSelcet.setAdapter(mOtherSelectAdapter);
mOtherSelectAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
@Override
public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
// Intent intent = new Intent(getActivity(), StatisticsDetailActivity.class);
// intent.putExtra(Saleorder.class.getName(), mStatisticsAdapter.getData().get(position).getId());
// ActivityUtils.startActivity(intent);
}
});
mViewBinding.srlProduct.setOnRefreshListener(this::onRefresh);
mOtherSelectAdapter.setOnLoadMoreListener(this::onLoadMore, mViewBinding.recyclerOtherSelcet);
}
private void onRefresh() {
mPresenter.refresh();
}
private void onLoadMore() {
mPresenter.loadMore();
}
/**
* 设置数据
*
* @param pager 数据
* @param isRefresh 是否刷新
*/
public void setData(Pager<Ossku> pager, boolean isRefresh) {
if (isRefresh) {
mOtherSelectAdapter.setEnableLoadMore(true);
mViewBinding.srlProduct.setRefreshing(false);
}
if (isRefresh) mOtherSelectAdapter.setNewData(pager.getList());
else if (pager.getList().size() > 0) mOtherSelectAdapter.addData(pager.getList());
if (pager.isLastPage()) mOtherSelectAdapter.loadMoreEnd(isRefresh);
else mOtherSelectAdapter.loadMoreComplete();
}
private View getEmptyView(int resHint) {
View view = getLayoutInflater().inflate(R.layout.view_empty, null);
view.setBackgroundResource(R.color.white_caocao);
((TextView) view.findViewById(R.id.tv_empty)).setText(resHint);
return view;
}
}
...@@ -34,7 +34,7 @@ public class ReplenishmentActivity extends BaseActivity<ReplenishmentPresenter, ...@@ -34,7 +34,7 @@ public class ReplenishmentActivity extends BaseActivity<ReplenishmentPresenter,
@Override @Override
public void addPsbSuc() { public void addPsbSuc() {
// mReplenishmentDetailFragment.pop(); mReplenishmentDetailFragment.pop();
mPresenter.refreshPsb(); mPresenter.refreshPsb();
} }
...@@ -62,12 +62,11 @@ public class ReplenishmentActivity extends BaseActivity<ReplenishmentPresenter, ...@@ -62,12 +62,11 @@ public class ReplenishmentActivity extends BaseActivity<ReplenishmentPresenter,
@Override @Override
public void openReplenishmentDetailFragment(Psb psb) { public void openReplenishmentDetailFragment(Psb psb) {
// if (isAllowFragment) { if (isAllowFragment) {
// isAllowFragment = false; isAllowFragment = false;
// mReplenishmentDetailFragment.setPsb(psb); mReplenishmentDetailFragment.setPsb(psb);
// start(mReplenishmentDetailFragment); start(mReplenishmentDetailFragment);
// }
// }
} }
......
...@@ -82,11 +82,7 @@ public class ReplenishmentPresenter extends ReplenishmentContract.Presenter { ...@@ -82,11 +82,7 @@ public class ReplenishmentPresenter extends ReplenishmentContract.Presenter {
mView.isShowLoading(false); mView.isShowLoading(false);
}) })
.subscribe(psbNew -> { .subscribe(psbNew -> {
// psbNew.setOutChannelNameabcn(psb.getOutChannelNameabcn());
// psbNew.setCityAddress(psb.getCityAddress());
// psbNew.setCityProvName(psb.getCityProvName());
// psbNew.setCityName(psb.getCityName());
// psbNew.setCityCountyName(psb.getCityCountyName());
mView.openReplenishmentDetailFragment(psbNew); mView.openReplenishmentDetailFragment(psbNew);
}, throwable -> { }, throwable -> {
ToastUtils.showShort(throwable.getMessage()); ToastUtils.showShort(throwable.getMessage());
......
...@@ -3,7 +3,9 @@ package com.xingdata.zzdpos.ui.manage.replenishment.fragment; ...@@ -3,7 +3,9 @@ package com.xingdata.zzdpos.ui.manage.replenishment.fragment;
import android.annotation.SuppressLint; import android.annotation.SuppressLint;
import android.graphics.drawable.Drawable; import android.graphics.drawable.Drawable;
import android.renderscript.ScriptGroup;
import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.LinearLayoutManager;
import android.text.InputType;
import android.view.KeyEvent; import android.view.KeyEvent;
import android.view.View; import android.view.View;
import android.widget.TextView; import android.widget.TextView;
...@@ -51,11 +53,13 @@ public class ReplenishmentDetailFragment extends BaseFragment<ReplenishmentPrese ...@@ -51,11 +53,13 @@ public class ReplenishmentDetailFragment extends BaseFragment<ReplenishmentPrese
@Override @Override
public void initView() { public void initView() {
mViewBinding.lyTitle.edTitle.setHint(R.string.inventory_add_et_hint);
Drawable drawableTop = getResources().getDrawable(R.mipmap.but_up); Drawable drawableTop = getResources().getDrawable(R.mipmap.but_up);
Drawable drawableBottom = getResources().getDrawable(R.mipmap.but_unfurled); Drawable drawableBottom = getResources().getDrawable(R.mipmap.but_unfurled);
drawableTop.setBounds(0, 0, (int) mViewBinding.tvShopTitle.getTextSize() - 10, (int) mViewBinding.tvShopTitle.getTextSize() - 10); drawableTop.setBounds(0, 0, (int) mViewBinding.tvShopTitle.getTextSize() - 10, (int) mViewBinding.tvShopTitle.getTextSize() - 10);
drawableBottom.setBounds(0, 0, (int) mViewBinding.tvShopTitle.getTextSize() - 10, (int) mViewBinding.tvShopTitle.getTextSize() - 10); drawableBottom.setBounds(0, 0, (int) mViewBinding.tvShopTitle.getTextSize() - 10, (int) mViewBinding.tvShopTitle.getTextSize() - 10);
mViewBinding.tvShopTitle.setCompoundDrawables(null, null, drawableTop, null); mViewBinding.tvShopTitle.setCompoundDrawables(null, null, drawableTop, null);
mViewBinding.tvSupplierTitle.setCompoundDrawables(null, null, drawableTop, null);
initRecycycler(); initRecycycler();
mViewBinding.tvShopTitle.setOnClickListener(new OnClickListener() { mViewBinding.tvShopTitle.setOnClickListener(new OnClickListener() {
@Override @Override
...@@ -69,42 +73,52 @@ public class ReplenishmentDetailFragment extends BaseFragment<ReplenishmentPrese ...@@ -69,42 +73,52 @@ public class ReplenishmentDetailFragment extends BaseFragment<ReplenishmentPrese
} }
} }
}); });
// mViewBinding.btnSearch.setOnClickListener(view -> { mViewBinding.tvSupplierTitle.setOnClickListener(new OnClickListener() {
// scrollToItem(mViewBinding.etKeyword.getText().toString().trim()); @Override
// }); protected void myOnClickListener(View v) {
// mViewBinding.etKeyword.setOnKeyListener((v, keyCode, event) -> { if (mViewBinding.llSupplier.getVisibility() != View.VISIBLE) {
// if (keyCode == KeyEvent.KEYCODE_ENTER) mViewBinding.llSupplier.setVisibility(View.VISIBLE);
// scrollToItem(mViewBinding.etKeyword.getText().toString().trim()); mViewBinding.tvSupplierTitle.setCompoundDrawables(null, null, drawableBottom, null);
// return false; } else {
// }); mViewBinding.llSupplier.setVisibility(View.GONE);
// mViewBinding.btnCanel.setOnClickListener(view -> { mViewBinding.tvSupplierTitle.setCompoundDrawables(null, null, drawableTop, null);
// this.pop(); }
// }); }
// });
// mViewBinding.btnEnd.setOnClickListener(view -> { mViewBinding.lyTitle.ivRight.setVisibility(View.GONE);
// if (mPsb == null || mPsb.getPsbStatus() == null) { mViewBinding.lyTitle.edTitle.setOnKeyListener((v, keyCode, event) -> {
// Psb psb = new Psb(); if (keyCode == KeyEvent.KEYCODE_ENTER)
// psb.setPsbType("0"); scrollToItem(mViewBinding.lyTitle.edTitle.getText().toString().trim());
// psb.setSsskuList(mReplenishmentDetailAdapter.getData()); return false;
// mPresenter.clickReplenishmentSubmit(psb); });
// } else { mViewBinding.lyTitle.ivBack.setOnClickListener(view -> {
// switch (mPsb.getPsbStatus()) { this.pop();
// case 3: });
// mPsb.setPsbdetailList(mReplenishmentDetailAdapter.getData());
// mPresenter.clickReplenishmentUpdate(mPsb); mViewBinding.btnOk.setOnClickListener(view -> {
// break; if (mPsb == null || mPsb.getPsbStatus() == null) {
// case 1: Psb psb = new Psb();
// mPresenter.clickReplenishmentConfirm(mPsb.getPsbNo()); psb.setPsbType("0");
// break; psb.setSsskuList(mReplenishmentDetailAdapter.getData());
// } mPresenter.clickReplenishmentSubmit(psb);
// } } else {
// }); switch (mPsb.getPsbStatus()) {
// mViewBinding.btnPrint.setOnClickListener(new OnClickListener() { case 3:
// @Override mPsb.setPsbdetailList(mReplenishmentDetailAdapter.getData());
// protected void myOnClickListener(View v) { mPresenter.clickReplenishmentUpdate(mPsb);
// ZX_PrintPOS.getInstance(mContext).printOrder(1, mPsb); break;
// } case 1:
// }); mPresenter.clickReplenishmentConfirm(mPsb.getPsbNo());
break;
}
}
});
mViewBinding.btnCancel.setOnClickListener(new OnClickListener() {
@Override
protected void myOnClickListener(View v) {
pop();
}
});
} }
// //
...@@ -180,24 +194,24 @@ public class ReplenishmentDetailFragment extends BaseFragment<ReplenishmentPrese ...@@ -180,24 +194,24 @@ public class ReplenishmentDetailFragment extends BaseFragment<ReplenishmentPrese
mViewBinding.setShopAddress(LoginPresenter.loginReturnBean.getCityProvName() + LoginPresenter.loginReturnBean.getCityName() + LoginPresenter.loginReturnBean.getCityCountyName() + LoginPresenter.loginReturnBean.getCityAddress()); mViewBinding.setShopAddress(LoginPresenter.loginReturnBean.getCityProvName() + LoginPresenter.loginReturnBean.getCityName() + LoginPresenter.loginReturnBean.getCityCountyName() + LoginPresenter.loginReturnBean.getCityAddress());
mViewBinding.setShopTel(LoginPresenter.loginReturnBean.getContactTel()); mViewBinding.setShopTel(LoginPresenter.loginReturnBean.getContactTel());
// if (mPsb != null && mPsb.getPsbStatus() != null) { if (mPsb != null && mPsb.getPsbStatus() != null) {
// switch (mPsb.getPsbStatus()) { switch (mPsb.getPsbStatus()) {
// case 3: case 3:
// mViewBinding.btnEnd.setText("修改订单"); mViewBinding.btnOk.setText("修改订单");
// mViewBinding.btnPrint.setVisibility(View.VISIBLE);
// break; break;
// case 1: case 1:
// mViewBinding.btnEnd.setText("确认收货"); mViewBinding.btnOk.setText("确认收货");
// mViewBinding.btnPrint.setVisibility(View.VISIBLE);
// break; break;
// case 0: case 0:
// mViewBinding.btnEnd.setVisibility(View.GONE); mViewBinding.llBottom.setVisibility(View.GONE);
// mViewBinding.btnPrint.setVisibility(View.VISIBLE);
// break; break;
// default: default:
// break; break;
// } }
// } }
} }
......
...@@ -4,6 +4,7 @@ package com.xingdata.zzdpos.ui.manage.replenishment.fragment; ...@@ -4,6 +4,7 @@ package com.xingdata.zzdpos.ui.manage.replenishment.fragment;
import android.databinding.DataBindingUtil; import android.databinding.DataBindingUtil;
import android.graphics.Typeface; import android.graphics.Typeface;
import android.support.design.widget.TabLayout; import android.support.design.widget.TabLayout;
import android.text.InputType;
import android.view.View; import android.view.View;
import android.widget.TextView; import android.widget.TextView;
...@@ -72,6 +73,8 @@ public class ReplenishmentFragment extends BaseFragment<ReplenishmentPresenter, ...@@ -72,6 +73,8 @@ public class ReplenishmentFragment extends BaseFragment<ReplenishmentPresenter,
}); });
mViewBinding.icTitle.ivRight.setVisibility(View.GONE); mViewBinding.icTitle.ivRight.setVisibility(View.GONE);
mViewBinding.icTitle.edTitle.setHint("请输入供货商名称"); mViewBinding.icTitle.edTitle.setHint("请输入供货商名称");
mViewBinding.icTitle.edTitle.setInputType(InputType.TYPE_CLASS_TEXT);
mViewBinding.icTitle.edTitle.setOnClickListener(view -> { mViewBinding.icTitle.edTitle.setOnClickListener(view -> {
if (mViewBinding.icTitle.edTitle.getText().toString().trim().length() == 0) { if (mViewBinding.icTitle.edTitle.getText().toString().trim().length() == 0) {
ToastUtils.showShort("请输入供货商名称"); ToastUtils.showShort("请输入供货商名称");
......
...@@ -8,6 +8,7 @@ import android.view.View; ...@@ -8,6 +8,7 @@ import android.view.View;
import android.widget.TextView; import android.widget.TextView;
import com.blankj.utilcode.util.ActivityUtils; import com.blankj.utilcode.util.ActivityUtils;
import com.blankj.utilcode.util.ToastUtils;
import com.chad.library.adapter.base.BaseQuickAdapter; import com.chad.library.adapter.base.BaseQuickAdapter;
import com.xingdata.zzdpos.R; import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseFragment; import com.xingdata.zzdpos.base.BaseFragment;
...@@ -32,7 +33,7 @@ import java.util.regex.Pattern; ...@@ -32,7 +33,7 @@ import java.util.regex.Pattern;
public class ReplenishmentListFragment extends BaseFragment<ReplenishmentPresenter, FragmentReplenishmentListBinding> { public class ReplenishmentListFragment extends BaseFragment<ReplenishmentPresenter, FragmentReplenishmentListBinding> {
private ReplenishmentAdapter mReplenishmentAdapter; private ReplenishmentAdapter mReplenishmentAdapter;
private List<Psb> psbArrayList = new ArrayList<>(); private List<Psb> psbArrayList = new ArrayList<>();
private long mExitTime = 0;
@Override @Override
public int getLayoutId() { public int getLayoutId() {
...@@ -52,13 +53,13 @@ public class ReplenishmentListFragment extends BaseFragment<ReplenishmentPresent ...@@ -52,13 +53,13 @@ public class ReplenishmentListFragment extends BaseFragment<ReplenishmentPresent
mViewBinding.recycler.setAdapter(mReplenishmentAdapter); mViewBinding.recycler.setAdapter(mReplenishmentAdapter);
} }
mReplenishmentAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() { mReplenishmentAdapter.setOnItemClickListener((adapter, view, position) -> {
@Override if ((System.currentTimeMillis() - mExitTime) > 500) {
public void onItemClick(BaseQuickAdapter adapter, View view, int position) { mPresenter.queryPsbDetail(mReplenishmentAdapter.getData().get(position));
Intent intent = new Intent(getActivity(), StatisticsDetailActivity.class); } else {
intent.putExtra(Saleorder.class.getName(), mReplenishmentAdapter.getData().get(position).getId()); ToastUtils.showLong("您操作太快了");
ActivityUtils.startActivity(intent);
} }
}); });
mViewBinding.srlProduct.setOnRefreshListener(this::onRefresh); mViewBinding.srlProduct.setOnRefreshListener(this::onRefresh);
...@@ -84,6 +85,10 @@ public class ReplenishmentListFragment extends BaseFragment<ReplenishmentPresent ...@@ -84,6 +85,10 @@ public class ReplenishmentListFragment extends BaseFragment<ReplenishmentPresent
* @param isRefresh 是否刷新 * @param isRefresh 是否刷新
*/ */
public void setData(List<Psb> psbList, boolean isRefresh) { public void setData(List<Psb> psbList, boolean isRefresh) {
if (mReplenishmentAdapter==null){
this.psbArrayList=psbList;
return;
}
if (isRefresh) { if (isRefresh) {
mReplenishmentAdapter.setEnableLoadMore(true); mReplenishmentAdapter.setEnableLoadMore(true);
......
...@@ -4,6 +4,7 @@ package com.xingdata.zzdpos.ui.marketing.ms; ...@@ -4,6 +4,7 @@ package com.xingdata.zzdpos.ui.marketing.ms;
import android.view.inputmethod.EditorInfo; import android.view.inputmethod.EditorInfo;
import com.blankj.utilcode.util.KeyboardUtils; import com.blankj.utilcode.util.KeyboardUtils;
import com.blankj.utilcode.util.ToastUtils;
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;
...@@ -57,6 +58,11 @@ public class MsActivity<Sku extends BaseSku> extends BaseActivity<MsPresenter, A ...@@ -57,6 +58,11 @@ public class MsActivity<Sku extends BaseSku> extends BaseActivity<MsPresenter, A
}); });
} }
@Override
public void showMsg(String msg) {
ToastUtils.showShort(msg);
}
@Override @Override
public void loadMss(List<Ms> mss, boolean isRefresh) { public void loadMss(List<Ms> mss, boolean isRefresh) {
mManagerFragment.loadMss(mss, isRefresh); mManagerFragment.loadMss(mss, isRefresh);
...@@ -69,12 +75,12 @@ public class MsActivity<Sku extends BaseSku> extends BaseActivity<MsPresenter, A ...@@ -69,12 +75,12 @@ public class MsActivity<Sku extends BaseSku> extends BaseActivity<MsPresenter, A
@Override @Override
public void showEditorFragment(Ms ms) { public void showEditorFragment(Ms ms) {
start(mEditorFragment.setMs(ms)); start(mEditorFragment.setMs(ms).setEditMode(C.MS_EDITOR_MODE.UPDATE));
} }
@Override @Override
public void showEditorFragment(int msType) { public void showEditorFragment(int msType) {
start(mEditorFragment); start(mEditorFragment.setMs(msType).setEditMode(C.MS_EDITOR_MODE.UPDATE));
} }
@Override @Override
...@@ -125,12 +131,27 @@ public class MsActivity<Sku extends BaseSku> extends BaseActivity<MsPresenter, A ...@@ -125,12 +131,27 @@ public class MsActivity<Sku extends BaseSku> extends BaseActivity<MsPresenter, A
mEditorFragment.loadTypeSku(sku); mEditorFragment.loadTypeSku(sku);
} }
@Override
public void addMs(Ms ms) {
mManagerFragment.addMs(ms);
}
@Override
public void updateMs(Ms ms) {
mManagerFragment.updateMs(ms);
}
@Override @Override
public void backToEditFragment() { public void backToEditFragment() {
this.popTo(EditorFragment.class, false);
this.showTitleBarByTitleMode(C.TITLE_MODE.TEXT); this.showTitleBarByTitleMode(C.TITLE_MODE.TEXT);
} }
@Override
public void backToManagerFragment() {
this.popTo(ManagerFragment.class, false);
}
@Override @Override
public void showLoadingDialog() { public void showLoadingDialog() {
mLoadingDialog.show(this); mLoadingDialog.show(this);
......
...@@ -14,6 +14,12 @@ import java.util.List; ...@@ -14,6 +14,12 @@ import java.util.List;
interface MsContract { interface MsContract {
interface View<Sku extends BaseSku> extends BaseView { interface View<Sku extends BaseSku> extends BaseView {
/**
* 显示文字内容
*
* @param msg 要显示的内容
*/
void showMsg(String msg);
/** /**
* 加载营销计划数据 * 加载营销计划数据
...@@ -101,11 +107,30 @@ interface MsContract { ...@@ -101,11 +107,30 @@ interface MsContract {
*/ */
void loadTypeGift(Sku sku); void loadTypeGift(Sku sku);
/**
* 添加营销
*
* @param ms 要添加的营销实体
*/
void addMs(Ms ms);
/**
* 更新营销
*
* @param ms 更新营销实体
*/
void updateMs(Ms ms);
/** /**
* 返回编辑页面 * 返回编辑页面
*/ */
void backToEditFragment(); void backToEditFragment();
/**
* 返回管理页面
*/
void backToManagerFragment();
/** /**
* 显示读取对话框 * 显示读取对话框
*/ */
...@@ -171,6 +196,14 @@ interface MsContract { ...@@ -171,6 +196,14 @@ interface MsContract {
*/ */
public abstract void clickSearchButton(String keyword); public abstract void clickSearchButton(String keyword);
/**
* 编辑页面 - 点击编辑器的确定
*
* @param ms 要保存的营销计划
* @param editMode 编辑模式
*/
public abstract void clickEditorConfirm(Ms ms, Integer editMode);
/** /**
* 搜索页面 - 加载更多搜索信息 * 搜索页面 - 加载更多搜索信息
*/ */
......
...@@ -48,7 +48,13 @@ public class MsPresenter<Sku extends BaseSku> extends MsContract.Presenter<Sku> ...@@ -48,7 +48,13 @@ public class MsPresenter<Sku extends BaseSku> extends MsContract.Presenter<Sku>
@Override @Override
public void clickMsItem(Ms ms) { public void clickMsItem(Ms ms) {
mView.showEditorFragment(ms); mView.showLoadingDialog();
ApiFactory.Ms.detail(ms.getId())
.doFinally(() -> mView.dismissLoadingDialog())
.subscribe(
ms1 -> mView.showEditorFragment(ms1),
throwable -> mView.dismissLoadingDialog()
);
} }
@Override @Override
...@@ -113,8 +119,38 @@ public class MsPresenter<Sku extends BaseSku> extends MsContract.Presenter<Sku> ...@@ -113,8 +119,38 @@ public class MsPresenter<Sku extends BaseSku> extends MsContract.Presenter<Sku>
} }
@Override @Override
public void loadMoreSearchResult() { public void clickEditorConfirm(Ms ms, Integer editMode) {
mView.showLoadingDialog();
switch (editMode) {
case C.MS_EDITOR_MODE.ADD:
ApiFactory.Ms.add(ms)
.doOnSubscribe(disposable -> mView.dismissLoadingDialog())
.subscribe(ms1 -> {
mView.showMsg("添加成功");
mView.backToManagerFragment();
mView.addMs(ms1);
}, throwable -> {
mView.showMsg("添加失败");
});
break;
case C.MS_EDITOR_MODE.UPDATE:
ApiFactory.Ms.update(ms)
.doOnSubscribe(disposable -> mView.dismissLoadingDialog())
.subscribe(ms1 -> {
mView.showMsg("修改成功");
mView.backToManagerFragment();
mView.updateMs(ms1);
}, throwable -> {
mView.showMsg("修改失败");
});
break;
}
}
@Override
public void loadMoreSearchResult() {
this.mSkuPageNum++;
this.getSearchSku();
} }
@Override @Override
......
...@@ -35,7 +35,9 @@ public class BeanAdapter<B extends BaseBean> extends BaseSelectedAdapter<B, Item ...@@ -35,7 +35,9 @@ public class BeanAdapter<B extends BaseBean> extends BaseSelectedAdapter<B, Item
if (b != null && data != null) { if (b != null && data != null) {
for (int i = 0; i < data.size(); i++) { for (int i = 0; i < data.size(); i++) {
if (data.get(i).getId() == b.getId() && data.get(i).getInfo() == b.getInfo()) { if (data.get(i).getId() == b.getId() && data.get(i).getInfo() == b.getInfo()) {
this.mOnItemSelectedListener.onItemSelected(data.get(i).getName()); if (mOnItemSelectedListener != null) {
this.mOnItemSelectedListener.onItemSelected(data.get(i).getName());
}
this.setSelectedPosition(i); this.setSelectedPosition(i);
} }
} }
......
...@@ -10,6 +10,9 @@ import android.support.v7.widget.LinearLayoutManager; ...@@ -10,6 +10,9 @@ import android.support.v7.widget.LinearLayoutManager;
import android.view.View; import android.view.View;
import com.blankj.utilcode.util.FragmentUtils; import com.blankj.utilcode.util.FragmentUtils;
import com.blankj.utilcode.util.StringUtils;
import com.blankj.utilcode.util.TimeUtils;
import com.blankj.utilcode.util.ToastUtils;
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.BaseFragment; import com.xingdata.zzdpos.base.BaseFragment;
...@@ -17,6 +20,7 @@ import com.xingdata.zzdpos.base.BaseSku; ...@@ -17,6 +20,7 @@ import com.xingdata.zzdpos.base.BaseSku;
import com.xingdata.zzdpos.databinding.FragmentMsEditorBinding; import com.xingdata.zzdpos.databinding.FragmentMsEditorBinding;
import com.xingdata.zzdpos.databinding.ViewTimeDetailBinding; import com.xingdata.zzdpos.databinding.ViewTimeDetailBinding;
import com.xingdata.zzdpos.model.Ms; import com.xingdata.zzdpos.model.Ms;
import com.xingdata.zzdpos.ui.login.LoginPresenter;
import com.xingdata.zzdpos.ui.marketing.ms.MsPresenter; import com.xingdata.zzdpos.ui.marketing.ms.MsPresenter;
import com.xingdata.zzdpos.ui.marketing.ms.adapter.BeanAdapter; import com.xingdata.zzdpos.ui.marketing.ms.adapter.BeanAdapter;
import com.xingdata.zzdpos.ui.marketing.ms.model.Area; import com.xingdata.zzdpos.ui.marketing.ms.model.Area;
...@@ -28,15 +32,19 @@ import com.xingdata.zzdpos.ui.marketing.ms.view.GroupAllView; ...@@ -28,15 +32,19 @@ import com.xingdata.zzdpos.ui.marketing.ms.view.GroupAllView;
import com.xingdata.zzdpos.ui.marketing.ms.view.GroupCateView; import com.xingdata.zzdpos.ui.marketing.ms.view.GroupCateView;
import com.xingdata.zzdpos.ui.marketing.ms.view.GroupSkuView; import com.xingdata.zzdpos.ui.marketing.ms.view.GroupSkuView;
import com.xingdata.zzdpos.ui.marketing.ms.view.TypeDisView; import com.xingdata.zzdpos.ui.marketing.ms.view.TypeDisView;
import com.xingdata.zzdpos.ui.marketing.ms.view.TypeGiftView;
import com.xingdata.zzdpos.ui.marketing.ms.view.TypeMoneyOffView; import com.xingdata.zzdpos.ui.marketing.ms.view.TypeMoneyOffView;
import com.xingdata.zzdpos.ui.marketing.ms.view.TypePromotionView; import com.xingdata.zzdpos.ui.marketing.ms.view.TypePromotionView;
import com.xingdata.zzdpos.util.ConvertUtil; import com.xingdata.zzdpos.util.ConvertUtil;
import java.text.SimpleDateFormat;
import java.util.List; import java.util.List;
import java.util.Locale;
public class EditorFragment extends BaseFragment<MsPresenter, FragmentMsEditorBinding> { public class EditorFragment extends BaseFragment<MsPresenter, FragmentMsEditorBinding> {
private Ms mMs; private Ms mMs;
private Integer mEditorMode;
private BeanAdapter<Group> mGroupAdapter; private BeanAdapter<Group> mGroupAdapter;
private BeanAdapter<Area> mAreaAdapter; private BeanAdapter<Area> mAreaAdapter;
...@@ -54,9 +62,6 @@ public class EditorFragment extends BaseFragment<MsPresenter, FragmentMsEditorBi ...@@ -54,9 +62,6 @@ public class EditorFragment extends BaseFragment<MsPresenter, FragmentMsEditorBi
private GroupCateView mGroupCateView = new GroupCateView(); private GroupCateView mGroupCateView = new GroupCateView();
private GroupSkuView mGroupSkuView = new GroupSkuView(); private GroupSkuView mGroupSkuView = new GroupSkuView();
private TypeDisView mTypeDisView = new TypeDisView();
private TypeMoneyOffView mMoneyOffView = new TypeMoneyOffView();
private TypePromotionView mPromotionView = new TypePromotionView();
@Override @Override
public int getLayoutId() { public int getLayoutId() {
...@@ -68,20 +73,74 @@ public class EditorFragment extends BaseFragment<MsPresenter, FragmentMsEditorBi ...@@ -68,20 +73,74 @@ public class EditorFragment extends BaseFragment<MsPresenter, FragmentMsEditorBi
initInfoViews(); initInfoViews();
initTimeViews(); initTimeViews();
initMsViews(); initMsViews();
setViewByMs(); setViewByMs();
mViewBinding.btnConfirm.setOnClickListener(view -> processMs());
mPresenter.initEditor(); mPresenter.initEditor();
} }
/** /**
* 营销方案 * 设置营销方案
*
* @param ms 营销计划
* @return this
*/ */
public EditorFragment setMs(Ms ms) { public EditorFragment setMs(Ms ms) {
this.mMs = ms; this.mMs = ms;
return this; return this;
} }
/**
* 设置营销方案
*
* @param msType 营销计划类型
* @return this
*/
public EditorFragment setMs(int msType) {
mMs = new Ms();
//类型 - 在addFragment选择的类型
mMs.setMsTools(msType);
//日期 - 当天
long now = ConvertUtil.stringToLong(TimeUtils.getNowString(new SimpleDateFormat("yyyyMMdd", Locale.getDefault())));
mMs.setMsDateBegin(now);
mMs.setMsDateEnd(now);
//时间 - 00:00 ~ 23:59
mMs.setMsTimeBegin(0L);
mMs.setMsTimeEnd(235959L);
//星期 - 全选
mMs.setMsWeekPlan("1,2,3,4,5,6,7");
//会员 - 全部
mMs.setMsCoustomTag((byte) C.MS_USER.ALL);
mMs.setVipLevel((byte) 0);
//范围 - 本渠道下所有门店
mMs.setMsRangeTag((byte) C.MS_AREA.MER);
mMs.setMerMapId(LoginPresenter.loginReturnBean.getMerMapId());
//主体 - 全场商品
mMs.setMsTouchTag2((byte) C.MS_GROUP.ALL);
return this;
}
/**
* 设置编辑类型
*
* @param editMode 编辑类型
* @return this
*/
public EditorFragment setEditMode(int editMode) {
this.mEditorMode = editMode;
return this;
}
/** /**
* 加载主体对象 * 加载主体对象
* *
...@@ -139,8 +198,9 @@ public class EditorFragment extends BaseFragment<MsPresenter, FragmentMsEditorBi ...@@ -139,8 +198,9 @@ public class EditorFragment extends BaseFragment<MsPresenter, FragmentMsEditorBi
mViewBinding.setDateStart(new StringBuffer(mMs.getMsDateBegin().toString()).insert(8, "日").insert(6, "月").insert(4, "年").toString()); mViewBinding.setDateStart(new StringBuffer(mMs.getMsDateBegin().toString()).insert(8, "日").insert(6, "月").insert(4, "年").toString());
mViewBinding.setDateEnd(new StringBuffer(mMs.getMsDateEnd().toString()).insert(8, "日").insert(6, "月").insert(4, "年").toString()); mViewBinding.setDateEnd(new StringBuffer(mMs.getMsDateEnd().toString()).insert(8, "日").insert(6, "月").insert(4, "年").toString());
mAreaAdapter.setBean(new Area(mMs.getMsRangeTag().intValue(), mMs.getMerMapId()));
mUserAdapter.setBean(new User(mMs.getMsCoustomTag().intValue(), mMs.getVipLevel().longValue())); mUserAdapter.setBean(new User(mMs.getMsCoustomTag().intValue(), mMs.getVipLevel().longValue()));
mAreaAdapter.setBean(new Area(mMs.getMsRangeTag().intValue(), mMs.getMerMapId()));
mGroupAdapter.setBean(new Group(mMs.getMsTouchTag2()));
} }
/** /**
...@@ -158,7 +218,6 @@ public class EditorFragment extends BaseFragment<MsPresenter, FragmentMsEditorBi ...@@ -158,7 +218,6 @@ public class EditorFragment extends BaseFragment<MsPresenter, FragmentMsEditorBi
mDateStartDialog.show(); mDateStartDialog.show();
}); });
mViewBinding.llDateEnd.setOnClickListener(view -> { mViewBinding.llDateEnd.setOnClickListener(view -> {
if (mDateEndDialog == null) initDateEndDialog(); if (mDateEndDialog == null) initDateEndDialog();
mDateEndDialog.show(); mDateEndDialog.show();
}); });
...@@ -265,7 +324,27 @@ public class EditorFragment extends BaseFragment<MsPresenter, FragmentMsEditorBi ...@@ -265,7 +324,27 @@ public class EditorFragment extends BaseFragment<MsPresenter, FragmentMsEditorBi
}); });
//type //type
loadRootFragment(R.id.f_type, mTypeDisView); switch (mMs.getMsTools()) {
case C.MS_TYPE.DIS:
mTypeView = new TypeDisView();
break;
case C.MS_TYPE.PROMOTION:
mTypeView = new TypePromotionView();
break;
case C.MS_TYPE.MONEY_OFF:
mTypeView = new TypeMoneyOffView();
break;
case C.MS_TYPE.GIFT:
mTypeView = new TypeGiftView();
break;
case C.MS_TYPE.SECOND:
mTypeView = new TypeDisView();
break;
case C.MS_TYPE.SECOND_PRO:
mTypeView = new TypePromotionView();
break;
}
this.loadRootFragment(R.id.f_type, mTypeView.setMs(mMs));
} }
/** /**
...@@ -363,4 +442,43 @@ public class EditorFragment extends BaseFragment<MsPresenter, FragmentMsEditorBi ...@@ -363,4 +442,43 @@ public class EditorFragment extends BaseFragment<MsPresenter, FragmentMsEditorBi
.setSingleChoiceItems(adapter.getStrs(), adapter.getSelectedPosition(), onClickListener) .setSingleChoiceItems(adapter.getStrs(), adapter.getSelectedPosition(), onClickListener)
.create().show(); .create().show();
} }
/**
* 处理数据
*/
private void processMs() {
if (StringUtils.isEmpty(mViewBinding.etName.getText().toString())) {
ToastUtils.showShort("请输入营销计划名");
mViewBinding.etName.requestFocus();
return;
}
if (!mTypeView.processMs(mMs) || !mGroupView.processMs(mMs)) {
ToastUtils.showShort("请确认输入内容是否正确");
return;
}
mMs.setMsName(mViewBinding.getName());
mMs.setMsDateBegin(ConvertUtil.stringToLong(mViewBinding.getDateStart().replaceAll("[\\u4e00-\\u9fa5]+", "")));
mMs.setMsDateEnd(ConvertUtil.stringToLong(mViewBinding.getDateEnd().replaceAll("[\\u4e00-\\u9fa5]+", "")));
if (mTimeDetailBinding != null) {
mMs.setMsTimeBegin(ConvertUtil.stringToLong(mTimeDetailBinding.getTimeStart().replace(":", "") + "00"));
mMs.setMsTimeEnd(ConvertUtil.stringToLong(mTimeDetailBinding.getTimeEnd().replace(":", "") + "59"));
String weekPlan = "";
if (mTimeDetailBinding.cbSun.isChecked()) weekPlan += "1,";
if (mTimeDetailBinding.cbMon.isChecked()) weekPlan += "2,";
if (mTimeDetailBinding.cbTue.isChecked()) weekPlan += "3,";
if (mTimeDetailBinding.cbWed.isChecked()) weekPlan += "4,";
if (mTimeDetailBinding.cbThu.isChecked()) weekPlan += "5,";
if (mTimeDetailBinding.cbFri.isChecked()) weekPlan += "6,";
if (mTimeDetailBinding.cbSat.isChecked()) weekPlan += "7,";
if (weekPlan.length() > 0) weekPlan = weekPlan.substring(0, weekPlan.lastIndexOf(","));
mMs.setMsWeekPlan(weekPlan);
}
mMs.setMsToolsType(mMs.getMsTools());
mMs.setGiftTag(mMs.getMsTools().byteValue());
mMs.setCreateTime(null);
mMs.setUpdateTime(null);
mPresenter.clickEditorConfirm(mMs, mEditorMode);
}
} }
...@@ -61,6 +61,31 @@ public class ManagerFragment extends BaseFragment<MsPresenter, FragmentMsManager ...@@ -61,6 +61,31 @@ public class ManagerFragment extends BaseFragment<MsPresenter, FragmentMsManager
} }
/**
* 添加营销计划
*
* @param ms 要添加的营销计划
*/
public void addMs(Ms ms) {
mMsAdapter.setEnableLoadMore(false);
mViewBinding.rlMs.scrollToPosition(0);
mMsAdapter.addData(0, ms);
}
/**
* 更新营销计划
*
* @param ms 要更新的营销计划
*/
public void updateMs(Ms ms) {
for (int i = 0; i < mMsAdapter.getData().size(); i++) {
if (mMsAdapter.getData().get(i).getId().longValue() == ms.getId().longValue()) {
mMsAdapter.setData(i, ms);
return;
}
}
}
/** /**
* 刷新营销计划 * 刷新营销计划
*/ */
......
...@@ -5,4 +5,8 @@ public class Group extends BaseBean { ...@@ -5,4 +5,8 @@ public class Group extends BaseBean {
setId(id); setId(id);
setName(name); setName(name);
} }
public Group(int id) {
setId(id);
}
} }
...@@ -80,6 +80,9 @@ public class GroupCateView extends BaseGroupView<ViewGroupCateBinding> { ...@@ -80,6 +80,9 @@ public class GroupCateView extends BaseGroupView<ViewGroupCateBinding> {
@Override @Override
public void initView() { public void initView() {
super.initView(); super.initView();
cateId = mMs.getSpuCateId();
loadCla(); loadCla();
mViewBinding.nsType1.setOnItemSelectedListener(mOnItemSelectedListener); mViewBinding.nsType1.setOnItemSelectedListener(mOnItemSelectedListener);
...@@ -115,7 +118,7 @@ public class GroupCateView extends BaseGroupView<ViewGroupCateBinding> { ...@@ -115,7 +118,7 @@ public class GroupCateView extends BaseGroupView<ViewGroupCateBinding> {
mViewBinding.nsType1.attachDataSource(strClas); mViewBinding.nsType1.attachDataSource(strClas);
mViewBinding.nsType1.setSelectedIndex(mClaPosition); mViewBinding.nsType1.setSelectedIndex(mClaPosition);
cateId = mClas.get(0).getSpuCateId(); if (cateId == 0) cateId = mClas.get(0).getSpuCateId();
loadGrp(mClas.get(mClaPosition)); loadGrp(mClas.get(mClaPosition));
}, },
......
...@@ -9,20 +9,21 @@ import com.xingdata.zzdpos.model.Ms; ...@@ -9,20 +9,21 @@ import com.xingdata.zzdpos.model.Ms;
public class TypeDisView extends BaseTypeView<ViewTypeDisBinding> { public class TypeDisView extends BaseTypeView<ViewTypeDisBinding> {
@Override @Override
protected void setViewByMs() { protected void setViewByMs() {
if (mMs.getMsTools() == null || mMs.getMsTools() != C.MS_TYPE.DIS) return; if (mMs.getMsTools() == null) return;
mViewBinding.etDis.setText(String.valueOf(Double.valueOf(mMs.getPriceDiscount()) / 10)); if (mMs.getMsTools() == C.MS_TYPE.DIS) mViewBinding.rbDis.setChecked(true);
if (mMs.getMsTools() == C.MS_TYPE.SECOND) mViewBinding.rbSecond.setChecked(true);
mViewBinding.etDis.setText(String.valueOf(mMs.getPriceDiscount()));
} }
@Override @Override
public boolean processMs(Ms ms) { public boolean processMs(Ms ms) {
ms.setMsTools(C.MS_TYPE.DIS); ms.setMsTools(mViewBinding.rbDis.isChecked() ? C.MS_TYPE.DIS : C.MS_TYPE.SECOND);
String strDis = mViewBinding.etDis.getText().toString(); String strDis = mViewBinding.etDis.getText().toString();
if (StringUtils.isEmpty(strDis)) return false; if (StringUtils.isEmpty(strDis)) return false;
ms.setPriceDiscount((byte) (Double.valueOf(strDis) * 10)); ms.setPriceDiscount(Byte.valueOf(strDis));
return true; return true;
} }
......
package com.xingdata.zzdpos.ui.marketing.ms.view;
import com.xingdata.zzdpos.C;
import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.databinding.ViewTypeGiftBinding;
import com.xingdata.zzdpos.model.Ms;
/**
* 促销页面
*/
public class TypeGiftView extends BaseTypeView<ViewTypeGiftBinding> {
@Override
public int getLayoutId() {
return R.layout.view_type_gift;
}
@Override
protected void setViewByMs() {
}
@Override
public boolean processMs(Ms ms) {
ms.setMsTools(C.MS_TYPE.GIFT);
return true;
}
}
...@@ -15,6 +15,7 @@ import com.xingdata.zzdpos.util.InputFilters; ...@@ -15,6 +15,7 @@ import com.xingdata.zzdpos.util.InputFilters;
* 满减返现页面 * 满减返现页面
*/ */
public class TypeMoneyOffView extends BaseTypeView<ViewTypeMoneyOffBinding> { public class TypeMoneyOffView extends BaseTypeView<ViewTypeMoneyOffBinding> {
@Override @Override
public int getLayoutId() { public int getLayoutId() {
return R.layout.view_type_money_off; return R.layout.view_type_money_off;
...@@ -26,7 +27,6 @@ public class TypeMoneyOffView extends BaseTypeView<ViewTypeMoneyOffBinding> { ...@@ -26,7 +27,6 @@ public class TypeMoneyOffView extends BaseTypeView<ViewTypeMoneyOffBinding> {
mViewBinding.etAmt.setFilters(InputFilters.getMoneyFilter(6)); mViewBinding.etAmt.setFilters(InputFilters.getMoneyFilter(6));
mViewBinding.etDisAmt.setFilters(InputFilters.getMoneyFilter(6)); mViewBinding.etDisAmt.setFilters(InputFilters.getMoneyFilter(6));
mViewBinding.etAmt.requestFocus();
mViewBinding.etAmt.addTextChangedListener(new TextWatcher() { mViewBinding.etAmt.addTextChangedListener(new TextWatcher() {
@Override @Override
public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) { public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {
......
...@@ -9,6 +9,7 @@ import com.xingdata.zzdpos.model.Ms; ...@@ -9,6 +9,7 @@ import com.xingdata.zzdpos.model.Ms;
* 促销页面 * 促销页面
*/ */
public class TypePromotionView extends BaseTypeView<ViewTypePromotionBinding> { public class TypePromotionView extends BaseTypeView<ViewTypePromotionBinding> {
@Override @Override
public int getLayoutId() { public int getLayoutId() {
return R.layout.view_type_promotion; return R.layout.view_type_promotion;
...@@ -16,12 +17,14 @@ public class TypePromotionView extends BaseTypeView<ViewTypePromotionBinding> { ...@@ -16,12 +17,14 @@ public class TypePromotionView extends BaseTypeView<ViewTypePromotionBinding> {
@Override @Override
protected void setViewByMs() { protected void setViewByMs() {
if (mMs.getMsTools() == null) return;
if (mMs.getMsTools() == C.MS_TYPE.PROMOTION) mViewBinding.rbPro.setChecked(true);
if (mMs.getMsTools() == C.MS_TYPE.SECOND_PRO) mViewBinding.rbSecondPro.setChecked(true);
} }
@Override @Override
public boolean processMs(Ms ms) { public boolean processMs(Ms ms) {
ms.setMsTools(C.MS_TYPE.PROMOTION); ms.setMsTools(mViewBinding.rbPro.isChecked() ? C.MS_TYPE.PROMOTION : C.MS_TYPE.SECOND_PRO);
return true; return true;
} }
} }
<?xml version="1.0" encoding="utf-8"?>
<layout>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/gray_zhouyu"
android:orientation="vertical">
<include
android:id="@+id/ly_title"
layout="@layout/title_order" />
<FrameLayout
android:id="@+id/fragment_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="@dimen/all_padding"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
</FrameLayout>
</LinearLayout>
</layout>
\ No newline at end of file
...@@ -67,11 +67,14 @@ ...@@ -67,11 +67,14 @@
android:textSize="@dimen/all_text_size" /> android:textSize="@dimen/all_text_size" />
<EditText <EditText
android:id="@+id/et_name"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginStart="@dimen/all_margin" android:layout_marginStart="@dimen/all_margin"
android:background="@color/transparent" android:background="@color/transparent"
android:hint="@string/ms_editor_name_hint" android:hint="@string/ms_editor_name_hint"
android:inputType="text"
android:lines="1"
android:text="@{name}" android:text="@{name}"
android:textColor="@color/black_baozheng" android:textColor="@color/black_baozheng"
android:textSize="@dimen/all_text_size" /> android:textSize="@dimen/all_text_size" />
......
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/gray_zhouyu"
android:orientation="vertical">
<android.support.constraint.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/all_padding_left_right"
android:background="@drawable/singleline_white_gray"
android:paddingBottom="@dimen/all_padding">
<View
android:layout_width="match_parent"
android:layout_height="@dimen/view_line_L050"
android:background="@color/gray_kongming"
app:layout_constraintTop_toTopOf="parent" />
<com.facebook.drawee.view.SimpleDraweeView
android:id="@+id/img_goods"
android:layout_width="65dp"
android:layout_height="65dp"
android:layout_marginStart="@dimen/all_padding_left_right"
android:layout_marginTop="@dimen/all_padding"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:placeholderImage="@mipmap/icon_goods_default" />
<TextView
android:id="@+id/tv_goods_name"
style="@style/other_select_blacktext_style"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/all_padding_left_right"
android:layout_marginStart="@dimen/all_padding_left_right"
android:text="贝斯克莱因和美妖精生日巧克力蛋糕"
app:layout_constraintStart_toEndOf="@id/img_goods"
app:layout_constraintTop_toTopOf="@id/img_goods" />
<TextView
android:id="@+id/tv_goods_code_hint"
android:layout_width="wrap_content"
android:layout_height="28dp"
android:layout_marginStart="@dimen/dp_4"
android:layout_marginTop="@dimen/all_padding"
android:text="条码:"
android:textSize="@dimen/all_text_size_small"
app:layout_constraintStart_toStartOf="@id/tv_goods_name"
app:layout_constraintTop_toBottomOf="@id/tv_goods_name" />
<TextView
android:id="@+id/tv_goods_code"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:text="12783163981789"
android:textSize="@dimen/all_text_size_small"
app:layout_constraintBottom_toBottomOf="@id/tv_goods_code_hint"
app:layout_constraintStart_toEndOf="@id/tv_goods_code_hint"
app:layout_constraintTop_toTopOf="@id/tv_goods_code_hint" />
<TextView
android:id="@+id/tv_goods_size"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/frame_frame_zhouyu_bg"
android:padding="@dimen/dp_4"
android:text="规格"
android:textSize="@dimen/all_text_size_small"
app:layout_constraintStart_toStartOf="@id/tv_goods_code_hint"
app:layout_constraintTop_toBottomOf="@id/tv_goods_code_hint" />
<TextView
android:id="@+id/tv_price"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/all_padding_left_right"
android:padding="@dimen/dp_4"
android:textColor="@color/black_baozheng"
android:textSize="@dimen/all_text_size_small"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_goods_code_hint" />
</android.support.constraint.ConstraintLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:weightSum="2">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
</LinearLayout>
</layout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/gray_zhouyu"
android:orientation="vertical">
<android.support.v4.widget.SwipeRefreshLayout
android:id="@+id/srl_product"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@id/ll_title"
>
<android.support.v7.widget.RecyclerView
android:id="@+id/recycler_other_selcet"
android:layout_width="match_parent"
android:layout_height="match_parent">
</android.support.v7.widget.RecyclerView>
</android.support.v4.widget.SwipeRefreshLayout>
</LinearLayout>
</layout>
\ No newline at end of file
...@@ -213,7 +213,6 @@ ...@@ -213,7 +213,6 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/all_padding_left_right" android:layout_marginEnd="@dimen/all_padding_left_right"
android:paddingBottom="@dimen/all_padding" android:paddingBottom="@dimen/all_padding"
android:paddingStart="@dimen/all_padding_left_right" android:paddingStart="@dimen/all_padding_left_right"
android:paddingTop="@dimen/all_padding" android:paddingTop="@dimen/all_padding"
...@@ -222,7 +221,7 @@ ...@@ -222,7 +221,7 @@
android:textSize="@dimen/all_text_size" android:textSize="@dimen/all_text_size"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/ll_supplier" app:layout_constraintTop_toBottomOf="@id/ll_supplier"
app:layout_goneMarginTop="@dimen/all_margin" /> />
<TextView <TextView
android:id="@+id/tv_shop_name" android:id="@+id/tv_shop_name"
...@@ -525,7 +524,7 @@ ...@@ -525,7 +524,7 @@
app:layout_constraintBottom_toBottomOf="parent"> app:layout_constraintBottom_toBottomOf="parent">
<Button <Button
android:id="@+id/btn_print" android:id="@+id/btn_cancel"
style="@style/button_passive" style="@style/button_passive"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
...@@ -540,7 +539,7 @@ ...@@ -540,7 +539,7 @@
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
<Button <Button
android:id="@+id/btn_return" android:id="@+id/btn_ok"
style="@style/button_positive" style="@style/button_positive"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
......
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">
<data>
</data>
<android.support.constraint.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/all_padding_left_right"
android:background="@drawable/singleline_white_gray"
android:paddingBottom="@dimen/all_padding">
<View
android:layout_width="match_parent"
android:layout_height="@dimen/view_line_L050"
android:background="@color/gray_kongming"
app:layout_constraintTop_toTopOf="parent" />
<com.facebook.drawee.view.SimpleDraweeView
android:id="@+id/img_goods"
android:layout_width="65dp"
android:layout_height="65dp"
android:layout_marginStart="@dimen/all_padding_left_right"
android:layout_marginTop="@dimen/all_padding"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:placeholderImage="@mipmap/icon_goods_default" />
<TextView
android:id="@+id/tv_goods_name"
style="@style/other_select_blacktext_style"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/all_padding_left_right"
android:layout_marginStart="@dimen/all_padding_left_right"
android:text="贝斯克莱因和美妖精生日巧克力蛋糕"
app:layout_constraintStart_toEndOf="@id/img_goods"
app:layout_constraintTop_toTopOf="@id/img_goods" />
<TextView
android:id="@+id/tv_goods_code_hint"
android:layout_width="wrap_content"
android:layout_height="28dp"
android:layout_marginStart="@dimen/dp_4"
android:layout_marginTop="@dimen/all_padding"
android:text="条码:"
android:textSize="@dimen/all_text_size_small"
app:layout_constraintStart_toStartOf="@id/tv_goods_name"
app:layout_constraintTop_toBottomOf="@id/tv_goods_name" />
<TextView
android:id="@+id/tv_goods_code"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:text="12783163981789"
android:textSize="@dimen/all_text_size_small"
app:layout_constraintBottom_toBottomOf="@id/tv_goods_code_hint"
app:layout_constraintStart_toEndOf="@id/tv_goods_code_hint"
app:layout_constraintTop_toTopOf="@id/tv_goods_code_hint" />
<TextView
android:id="@+id/tv_goods_size"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/frame_frame_zhouyu_bg"
android:padding="@dimen/dp_4"
android:text="规格"
android:textSize="@dimen/all_text_size_small"
app:layout_constraintStart_toStartOf="@id/tv_goods_code_hint"
app:layout_constraintTop_toBottomOf="@id/tv_goods_code_hint" />
<TextView
android:id="@+id/tv_shop"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/all_padding_left_right"
android:drawableStart="@mipmap/icon_stores"
android:padding="@dimen/dp_4"
android:textColor="@color/black_baozheng"
android:textSize="@dimen/all_text_size_small"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_goods_code_hint" />
</android.support.constraint.ConstraintLayout>
</layout>
\ No newline at end of file
...@@ -2,15 +2,6 @@ ...@@ -2,15 +2,6 @@
<layout xmlns:android="http://schemas.android.com/apk/res/android" <layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"> xmlns:app="http://schemas.android.com/apk/res-auto">
<data>
<import type="android.view.View" />
<variable
name="disRate"
type="String" />
</data>
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
...@@ -20,7 +11,6 @@ ...@@ -20,7 +11,6 @@
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize" android:layout_height="?attr/actionBarSize"
android:background="@color/white_caocao"
android:gravity="center_vertical" android:gravity="center_vertical"
android:paddingEnd="@dimen/all_margin" android:paddingEnd="@dimen/all_margin"
android:paddingStart="@dimen/all_margin"> android:paddingStart="@dimen/all_margin">
...@@ -67,7 +57,6 @@ ...@@ -67,7 +57,6 @@
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize" android:layout_height="?attr/actionBarSize"
android:background="@color/white_caocao"
android:gravity="center_vertical" android:gravity="center_vertical"
android:paddingEnd="@dimen/all_margin" android:paddingEnd="@dimen/all_margin"
android:paddingStart="@dimen/all_margin"> android:paddingStart="@dimen/all_margin">
......
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white_caocao"
android:orientation="vertical">
</LinearLayout>
</layout>
\ No newline at end of file
...@@ -5,55 +5,87 @@ ...@@ -5,55 +5,87 @@
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="@color/transparent" android:background="@color/white_caocao"
android:gravity="center_vertical" android:orientation="vertical">
android:orientation="horizontal">
<LinearLayout
<TextView android:layout_width="match_parent"
android:layout_width="wrap_content" android:layout_height="?attr/actionBarSize"
android:layout_height="wrap_content" android:layout_marginEnd="@dimen/all_margin"
android:gravity="center" android:layout_marginStart="@dimen/all_margin"
android:text="@string/ms_editor_type_money_off_text1" android:gravity="center_vertical">
android:textColor="@color/black"
android:textSize="@dimen/big_text_size" /> <TextView
android:layout_width="wrap_content"
<EditText android:layout_height="wrap_content"
android:id="@+id/et_amt" android:gravity="center"
style="@style/dialog_edit" android:text="@string/ms_editor_type_money_off_text1"
android:layout_width="wrap_content" android:textColor="@color/black"
android:layout_height="wrap_content" android:textSize="@dimen/big_text_size" />
<EditText
android:id="@+id/et_amt"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginEnd="@dimen/all_margin"
android:layout_marginStart="@dimen/all_margin"
android:layout_weight="1"
android:background="@color/transparent"
android:inputType="numberDecimal"
android:labelFor="@+id/et_amt"
android:saveEnabled="false" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/ms_editor_type_money_off_text3"
android:textColor="@color/black"
android:textSize="@dimen/big_text_size" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="@dimen/all_line_width"
android:layout_marginEnd="@dimen/all_margin" android:layout_marginEnd="@dimen/all_margin"
android:layout_marginStart="@dimen/all_margin" android:layout_marginStart="@dimen/all_margin"
android:inputType="numberDecimal" android:background="@color/gray_kongming" />
android:labelFor="@+id/et_amt"
android:minWidth="100dp" /> <LinearLayout
android:layout_width="match_parent"
<TextView android:layout_height="?attr/actionBarSize"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/ms_editor_type_money_off_text2"
android:textColor="@color/black"
android:textSize="@dimen/big_text_size" />
<EditText
android:id="@+id/et_dis_amt"
style="@style/dialog_edit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/all_margin" android:layout_marginEnd="@dimen/all_margin"
android:layout_marginStart="@dimen/all_margin" android:layout_marginStart="@dimen/all_margin"
android:inputType="numberDecimal" android:gravity="center_vertical">
android:labelFor="@+id/et_dis_amt"
android:minWidth="100dp" /> <TextView
android:layout_width="wrap_content"
<TextView android:layout_height="wrap_content"
android:layout_width="wrap_content" android:gravity="center"
android:layout_height="wrap_content" android:text="@string/ms_editor_type_money_off_text2"
android:gravity="center" android:textColor="@color/black"
android:text="@string/ms_editor_type_money_off_text3" android:textSize="@dimen/big_text_size" />
android:textColor="@color/black"
android:textSize="@dimen/big_text_size" /> <EditText
android:id="@+id/et_dis_amt"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginEnd="@dimen/all_margin"
android:layout_marginStart="@dimen/all_margin"
android:layout_weight="1"
android:background="@color/transparent"
android:inputType="numberDecimal"
android:labelFor="@+id/et_dis_amt" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/ms_editor_type_money_off_text3"
android:textColor="@color/black"
android:textSize="@dimen/big_text_size" />
</LinearLayout>
</LinearLayout> </LinearLayout>
......
...@@ -2,14 +2,6 @@ ...@@ -2,14 +2,6 @@
<layout xmlns:android="http://schemas.android.com/apk/res/android" <layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"> xmlns:app="http://schemas.android.com/apk/res-auto">
<data>
<import type="android.view.View" />
<variable
name="disRate"
type="String" />
</data>
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
...@@ -20,7 +12,6 @@ ...@@ -20,7 +12,6 @@
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize" android:layout_height="?attr/actionBarSize"
android:background="@color/white_caocao"
android:gravity="center_vertical" android:gravity="center_vertical"
android:paddingEnd="@dimen/all_margin" android:paddingEnd="@dimen/all_margin"
android:paddingStart="@dimen/all_margin"> android:paddingStart="@dimen/all_margin">
...@@ -42,18 +33,18 @@ ...@@ -42,18 +33,18 @@
android:orientation="horizontal"> android:orientation="horizontal">
<RadioButton <RadioButton
android:id="@+id/rb_dis" android:id="@+id/rb_pro"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:checked="true" android:checked="true"
android:text="@string/ms_type_dis" /> android:text="@string/ms_type_promotion" />
<RadioButton <RadioButton
android:id="@+id/rb_second" android:id="@+id/rb_second_pro"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="@dimen/all_margin" android:layout_marginStart="@dimen/all_margin"
android:text="@string/ms_type_second" /> android:text="@string/ms_type_second_pro" />
</RadioGroup> </RadioGroup>
</LinearLayout> </LinearLayout>
...@@ -64,35 +55,28 @@ ...@@ -64,35 +55,28 @@
android:layout_marginStart="@dimen/all_margin" android:layout_marginStart="@dimen/all_margin"
android:background="@color/gray_kongming" /> android:background="@color/gray_kongming" />
<LinearLayout
<TextView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize" android:layout_height="wrap_content"
android:background="@color/white_caocao" android:layout_marginEnd="@dimen/all_margin"
android:layout_marginStart="@dimen/all_margin"
android:layout_marginTop="@dimen/all_margin"
android:gravity="center_vertical" android:gravity="center_vertical"
android:paddingEnd="@dimen/all_margin" android:text="@string/ms_editor_type_promotion_text1"
android:paddingStart="@dimen/all_margin"> android:textColor="@color/black_baozheng"
android:textSize="@dimen/all_text_size" />
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="center_vertical"
android:text="@string/ms_editor_user"
android:textColor="@color/black_baozheng"
android:textSize="@dimen/all_text_size" />
<EditText
android:id="@+id/et_dis"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/all_margin"
android:background="@color/transparent"
android:hint="@string/ms_type_dis_hint"
android:inputType="number"
android:maxLength="2"
android:textColor="@color/black_baozheng"
android:textSize="@dimen/all_text_size" />
</LinearLayout>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/all_margin"
android:layout_marginEnd="@dimen/all_margin"
android:layout_marginStart="@dimen/all_margin"
android:layout_marginTop="@dimen/all_spacing"
android:gravity="center_vertical"
android:text="@string/ms_editor_type_promotion_text2"
android:textSize="@dimen/all_caption_size" />
</LinearLayout> </LinearLayout>
</layout> </layout>
\ No newline at end of file
...@@ -352,13 +352,13 @@ ...@@ -352,13 +352,13 @@
<string name="ms_editor_type_dis_hint">折扣比例</string> <string name="ms_editor_type_dis_hint">折扣比例</string>
<string name="ms_editor_type_dis_text2">折优惠</string> <string name="ms_editor_type_dis_text2">折优惠</string>
<string name="ms_editor_type_promotion_text1">按选定商品的促销价销售</string> <string name="ms_editor_type_promotion_text1">按选定商品的促销价销售</string>
<string name="ms_editor_type_promotion_text2">【商品管理中调整促销价】</string> <string name="ms_editor_type_promotion_text2">促销价为商品维护中的促销价</string>
<string name="ms_editor_type_second_text1">第二件享受</string> <string name="ms_editor_type_second_text1">第二件享受</string>
<string name="ms_editor_type_second_hint">折扣比例</string> <string name="ms_editor_type_second_hint">折扣比例</string>
<string name="ms_editor_type_second_text2">折优惠</string> <string name="ms_editor_type_second_text2">折优惠</string>
<string name="ms_editor_type_money_off_text1"></string> <string name="ms_editor_type_money_off_text1"></string>
<string name="ms_editor_type_money_off_text2">元,</string> <string name="ms_editor_type_money_off_text2"></string>
<string name="ms_editor_type_money_off_text3"></string>g> <string name="ms_editor_type_money_off_text3"></string>
<string name="ms_editor_type_gift_text1"></string> <string name="ms_editor_type_gift_text1"></string>
<string name="ms_editor_type_gift_text2">元,加</string> <string name="ms_editor_type_gift_text2">元,加</string>
<string name="ms_editor_type_gift_text3">元换购</string> <string name="ms_editor_type_gift_text3">元换购</string>
...@@ -608,6 +608,7 @@ ...@@ -608,6 +608,7 @@
<string name="ms_type_gift">换购</string> <string name="ms_type_gift">换购</string>
<string name="ms_type_gift_info">满%s元加%s元换购%s一件</string> <string name="ms_type_gift_info">满%s元加%s元换购%s一件</string>
<string name="ms_type_gift_abbr"></string> <string name="ms_type_gift_abbr"></string>
<string name="ms_type_second_pro">第二件促销</string>
<!--帮助POS--> <!--帮助POS-->
<string name="help_hint">帮助</string> <string name="help_hint">帮助</string>
......
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