Commit f7936c90 authored by 姜敏's avatar 姜敏

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	app/src/main/java/com/xingdata/zzdpos/api/ApiFactory.java
#	app/src/main/res/values/styles.xml
parents aba17abc bb82bb24
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
<activity <activity
android:name=".ui.splash.SplashActivity" android:name=".ui.splash.SplashActivity"
android:configChanges="keyboard|orientation|screenSize|keyboardHidden" android:configChanges="keyboard|orientation|screenSize|keyboardHidden"
android:screenOrientation="portrait"
android:theme="@style/AppTheme"> android:theme="@style/AppTheme">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.MAIN" /> <action android:name="android.intent.action.MAIN" />
...@@ -75,9 +76,18 @@ ...@@ -75,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"
...@@ -88,11 +98,26 @@ ...@@ -88,11 +98,26 @@
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" />
<activity
android:name=".ui.manage.sssku.SsskuActivity"
android:configChanges="keyboard|orientation|screenSize|keyboardHidden"
android:windowSoftInputMode="adjustUnspecified|stateHidden" />
<activity
android:name=".ui.manage.inventory.InventoryActivity"
android:configChanges="keyboard|orientation|screenSize|keyboardHidden"
android:windowSoftInputMode="adjustUnspecified|stateHidden" />
</application> </application>
</manifest> </manifest>
\ No newline at end of file
...@@ -18,9 +18,9 @@ public class C { ...@@ -18,9 +18,9 @@ public class C {
public static final int MENU_MANAGER_OPER = 1251; public static final int MENU_MANAGER_OPER = 1251;
public static final int MENU_MANAGER_GOODS = 1252; public static final int MENU_MANAGER_GOODS = 1252;
public static final int MENU_MANAGER_BALE = 1253; public static final int MENU_MANAGER_BALE = 1253;
public static final int MENU_MANAGER_REPLENISHMENT= 1254; public static final int MENU_MANAGER_REPLENISHMENT = 1254;
public static final int MENU_MANAGER_OTHER= 1255; public static final int MENU_MANAGER_OTHER = 1255;
public static final int MENU_MANAGER_INVENTORY= 1256; public static final int MENU_MANAGER_INVENTORY = 1256;
public static final int MENU_ANNOUNCEMENT = 107; public static final int MENU_ANNOUNCEMENT = 107;
...@@ -513,8 +513,8 @@ public class C { ...@@ -513,8 +513,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 {
...@@ -537,6 +537,16 @@ public class C { ...@@ -537,6 +537,16 @@ public class C {
public static final int SKU = 4; public static final int SKU = 4;
} }
public final class MS_AREA {
public static final int MER = 3;
public static final int LOCAL = 4;
}
public final class MS_USER {
public static final int ALL = 0;
public static final int VIP = 1;
}
public final class SETTLE_MODE { public final class SETTLE_MODE {
public static final int PAYMENT = 1; public static final int PAYMENT = 1;
public static final int STORE = 2; public static final int STORE = 2;
...@@ -546,6 +556,11 @@ public class C { ...@@ -546,6 +556,11 @@ public class C {
public static final int HIDE = 0; public static final int HIDE = 0;
public static final int TEXT = 1; public static final int TEXT = 1;
public static final int VIP = 2; public static final int VIP = 2;
public static final int SKU = 3;
public static final int GIFT = 4;
public static final int PKG = 5;
public static final int SKU_DETAIL = 6;
} }
} }
...@@ -582,6 +582,9 @@ public final class ApiFactory { ...@@ -582,6 +582,9 @@ public final class ApiFactory {
.observeOn(AndroidSchedulers.mainThread()) .observeOn(AndroidSchedulers.mainThread())
.retryWhen(new RetryHelper(3)); .retryWhen(new RetryHelper(3));
} }
public static Observable<com.xingdata.zzdpos.model.Saleorder> querySaleorderByVipId(Long vipId, int pageNumber, int pageSize) {
return Api.getInstance().service.querySaleorderByVipId(vipId, pageNumber, pageSize)
public static Observable<Pager<com.xingdata.zzdpos.model.Saleorder>> querySaleorderByVipId(Long vipId,int pageNumber ,int pageSize) { public static Observable<Pager<com.xingdata.zzdpos.model.Saleorder>> querySaleorderByVipId(Long vipId,int pageNumber ,int pageSize) {
return Api.getInstance().service.querySaleorderByVipId(vipId,pageNumber,pageSize) return Api.getInstance().service.querySaleorderByVipId(vipId,pageNumber,pageSize)
.onErrorReturn(new ErrorFilter<>()) .onErrorReturn(new ErrorFilter<>())
...@@ -592,8 +595,6 @@ public final class ApiFactory { ...@@ -592,8 +595,6 @@ public final class ApiFactory {
} }
} }
public static class Ticket { public static class Ticket {
...@@ -641,10 +642,8 @@ public final class ApiFactory { ...@@ -641,10 +642,8 @@ public final class ApiFactory {
.observeOn(AndroidSchedulers.mainThread()); .observeOn(AndroidSchedulers.mainThread());
} }
public static Observable<Pager<com.xingdata.zzdpos.model.Sssku>> querySssku(int pageNum, public static Observable<Pager<com.xingdata.zzdpos.model.Sssku>> querySssku(int pageNum, String keyword, Long skuGrpId) {
String keyword, Long skuGrpId) { return Api.getInstance().service.querySssku(pageNum, C.PRODUCT.PAGE_SIZE, skuGrpId, keyword)
return Api.getInstance().service.querySssku(pageNum, C.PRODUCT.PAGE_SIZE, skuGrpId,
keyword)
.onErrorReturn(new ErrorFilter<>()) .onErrorReturn(new ErrorFilter<>())
.map(new ResultFilter<>()) .map(new ResultFilter<>())
.subscribeOn(Schedulers.io()) .subscribeOn(Schedulers.io())
...@@ -761,6 +760,21 @@ public final class ApiFactory { ...@@ -761,6 +760,21 @@ public final class ApiFactory {
ErrorFilter<>()).map(new ResultFilter<>()).subscribeOn(Schedulers.io()) ErrorFilter<>()).map(new ResultFilter<>()).subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread()); .observeOn(AndroidSchedulers.mainThread());
} }
/**
* 库存盘点记录查询接口
*
* @param pageNulmber
* @param pageSize
* @return
*/
public static Observable<Pager<com.xingdata.zzdpos.model.Cs>> querCsList(int pageNulmber,
int pageSize
) {
return Api.getInstance().service.querCsList(pageNulmber, pageSize).onErrorReturn(new
ErrorFilter<>()).map(new ResultFilter<>()).subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread());
}
} }
public static class Notice { public static class Notice {
......
...@@ -181,6 +181,10 @@ interface ApiService { ...@@ -181,6 +181,10 @@ interface ApiService {
("pageSize") int pageSize, @Query("startDate") long startDate, @Query("endDate") long ("pageSize") int pageSize, @Query("startDate") long startDate, @Query("endDate") long
endDate); endDate);
@POST(C.URL.CS.query)
Observable<HttpMessage<Pager<Cs>>> querCsList(@Query("pageNumber") int pageNum, @Query
("pageSize") int pageSize);
@POST(C.URL.NOTICE.query) @POST(C.URL.NOTICE.query)
Observable<HttpMessage<Pager<Notice>>> queryNotice(@Query("pageNumber") int pageNum, @Query Observable<HttpMessage<Pager<Notice>>> queryNotice(@Query("pageNumber") int pageNum, @Query
("pageSize") int pageSize); ("pageSize") int pageSize);
...@@ -249,7 +253,6 @@ interface ApiService { ...@@ -249,7 +253,6 @@ interface ApiService {
("pageNumber") int pageNum, @Query("pageSize") int pageSize); ("pageNumber") int pageNum, @Query("pageSize") int pageSize);
@POST(C.URL.USER.query) @POST(C.URL.USER.query)
Observable<HttpMessage<Pager<Vip>>> queryDetailByWD(@Query("wd") String keyword, @Query Observable<HttpMessage<Pager<Vip>>> queryDetailByWD(@Query("wd") String keyword, @Query
("pageNumber") int pageNum, @Query("pageSize") int pageSize); ("pageNumber") int pageNum, @Query("pageSize") int pageSize);
...@@ -349,15 +352,17 @@ interface ApiService { ...@@ -349,15 +352,17 @@ interface ApiService {
@Query("pageSize") int pageSize); @Query("pageSize") int pageSize);
@POST(C.URL.SSSKU.query) @POST(C.URL.SSSKU.query)
Observable<HttpMessage<Pager<Sssku>>> querySssku(@Query("pageNumber") int pageNumber, @Query Observable<HttpMessage<Pager<Sssku>>> querySssku(@Query("pageNumber") int pageNumber,
("pageSize") int pageSize, @Query("wd") String keyword); @Query("pageSize") int pageSize,
@Query("wd") String keyword);
@POST(C.URL.SSKUGRP.query) @POST(C.URL.SSKUGRP.query)
Observable<HttpMessage<Pager<Sskugrp>>> querySskugrp(); Observable<HttpMessage<Pager<Sskugrp>>> querySskugrp();
@POST(C.URL.MS.query) @POST(C.URL.MS.query)
Observable<HttpMessage<Pager<Ms>>> queryMs(@Query("pageNumber") int pageNumber, @Query Observable<HttpMessage<Pager<Ms>>> queryMs(@Query("pageNumber") int pageNumber,
("pageSize") int pageSize, @Query("msName") String keyword); @Query("pageSize") int pageSize,
@Query("msName") String keyword);
@POST(C.URL.MS.detail) @POST(C.URL.MS.detail)
Observable<HttpMessage<Ms>> detailMs(@Query("id") long id); Observable<HttpMessage<Ms>> detailMs(@Query("id") long id);
......
...@@ -43,7 +43,6 @@ public abstract class BaseDialog<P extends BasePresenter, B extends ViewDataBind ...@@ -43,7 +43,6 @@ public abstract class BaseDialog<P extends BasePresenter, B extends ViewDataBind
public boolean isShowing; public boolean isShowing;
static { static {
AppCompatDelegate.setCompatVectorFromResourcesEnabled(true); AppCompatDelegate.setCompatVectorFromResourcesEnabled(true);
} }
......
...@@ -4,6 +4,7 @@ import com.xingdata.api.print.entity.BaseGoodPrint; ...@@ -4,6 +4,7 @@ import com.xingdata.api.print.entity.BaseGoodPrint;
import com.xingdata.api.print.entity.BaseOrderPrint; import com.xingdata.api.print.entity.BaseOrderPrint;
import com.xingdata.zzdpos.db.DB; import com.xingdata.zzdpos.db.DB;
import com.xingdata.zzdpos.ui.login.LoginPresenter; import com.xingdata.zzdpos.ui.login.LoginPresenter;
import com.xingdata.zzdpos.ui.main.MainPresenter;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
...@@ -255,6 +256,14 @@ public class Cs implements BaseOrderPrint { ...@@ -255,6 +256,14 @@ public class Cs implements BaseOrderPrint {
return baseGoodPrints; return baseGoodPrints;
} }
public String getOperName() {
if (operName == null) {
operName = DB.getInstance().get(MainPresenter.class).where(Oper.class)
.equalTo("operId", getCreateOperId())
.findFirst().getOperName();
}
return operName;
}
@Override @Override
public String getDRAW_URL() { public String getDRAW_URL() {
return null; return null;
......
package com.xingdata.zzdpos.ui.manage.inventory;
import com.blankj.utilcode.util.ActivityUtils;
import com.blankj.utilcode.util.FragmentUtils;
import com.blankj.utilcode.util.KeyboardUtils;
import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseActivity;
import com.xingdata.zzdpos.databinding.ActivityInventoryBinding;
import com.xingdata.zzdpos.model.Cs;
import com.xingdata.zzdpos.model.CsDetail;
import com.xingdata.zzdpos.model.Pager;
import com.xingdata.zzdpos.model.Sssku;
import com.xingdata.zzdpos.ui.dialog.LoadingDialog;
import com.xingdata.zzdpos.ui.manage.inventory.fragment.InventoryAddFragment;
import com.xingdata.zzdpos.ui.manage.inventory.fragment.InventoryFragment;
import com.xingdata.zzdpos.ui.manage.manageMenu.ManageDateFragment;
import com.xingdata.zzdpos.ui.statistics.fragment.StatisticsDateFragment;
import java.util.List;
public class InventoryActivity extends BaseActivity<InventoryPresenter, ActivityInventoryBinding> implements InventoryContract.View {
private InventoryFragment mInventoryFragment = new InventoryFragment();
private ManageDateFragment mManageDateFragment = new ManageDateFragment();
private InventoryAddFragment mInventoryAddFragment = new InventoryAddFragment();
// private InventoryDetailDialog mInventoryDetailDialog = new InventoryDetailDialog();
LoadingDialog mLoadingDialog = new LoadingDialog();
@Override
public int getLayoutId() {
return R.layout.activity_inventory;
}
@Override
public void initView() {
loadRootFragment(R.id.f_bottom, mInventoryFragment, true, false);
}
@Override
public void showDateFragment() {
start(mManageDateFragment);
}
@Override
public void addInventoryDetailItem(CsDetail csDetail, Sssku sssku) {
mInventoryAddFragment.addInventoryDetailItem(csDetail, sssku);
}
@Override
public void addInventoryGoodsItem(List<Sssku> ssskuList) {
mInventoryAddFragment.addInventoryGoodsItem(ssskuList);
}
@Override
public void addInventoryGoodsItem(Sssku sssku) {
mInventoryAddFragment.addInventoryGoodsItem(sssku);
}
@Override
public void showInventoryDetailDialog(Cs cs) {
// mInventoryDetailDialog.setData(cs).show(this);
}
@Override
public void loadCs(Pager<Cs> csList) {
mInventoryFragment.setData(csList, csList.isFirstPage());
}
@Override
public void loadCs(Pager<Cs> csList, long start, long end) {
if (mManageDateFragment.isAdded()) {
mManageDateFragment.pop();
}
mInventoryFragment.setDate(start, end);
mInventoryFragment.setData(csList, csList.isFirstPage());
}
@Override
public void disInventoryDetailFragment(Boolean idChange) {
if (idChange) {
// mInventoryAddFragment.pop();
// mPresenter.refreshCs();
} else {
// mInventoryAddFragment.pop();
}
}
@Override
public void setInventoryCount(int count) {
mInventoryFragment.setCount(count);
}
@Override
public void setInventoryCount(String s) {
mInventoryFragment.setCount(s);
}
@Override
public void openInventoryAddFragment(Cs cs) {
mInventoryAddFragment.setCs(cs);
start(mInventoryAddFragment);
}
@Override
public void showDateAlert(Boolean f) {
// mInventoryFragment.showDateAlert(f);
}
@Override
protected void onPause() {
KeyboardUtils.hideSoftInput(this);
super.onPause();
}
@Override
public void searchGoodsSuc() {
// mInventoryAddFragment.searchGoodsSuc();
}
@Override
public void isShowLoading(Boolean is) {
if (is) {
mLoadingDialog.show((BaseActivity) mContext);
} else {
if (mLoadingDialog.isShowing) {
mLoadingDialog.dismiss();
}
}
}
}
package com.xingdata.zzdpos.ui.manage.inventory;
import com.xingdata.zzdpos.base.BasePresenter;
import com.xingdata.zzdpos.base.BaseView;
import com.xingdata.zzdpos.model.Cs;
import com.xingdata.zzdpos.model.CsDetail;
import com.xingdata.zzdpos.model.Pager;
import com.xingdata.zzdpos.model.Sssku;
import java.util.List;
/**
* Created by Eurus on 2017/11/23.
*/
public interface InventoryContract {
interface View extends BaseView {
/**
* 添加盘库 搜索商品成功
*/
void searchGoodsSuc();
void isShowLoading(Boolean is);
/**
* 跳转日期搜索
*/
void showDateFragment();
/**
* 设置盘库记录条目数量
*/
void setInventoryCount(int count);
/**
* 设置盘库记录条目数量
*/
void setInventoryCount(String s);
/**
* 关闭添加盘库详情界面
*/
void disInventoryDetailFragment(Boolean isChange);
/**
* 添加左侧详情商品条目
*/
void addInventoryDetailItem(CsDetail csDetail, Sssku sssku);
/**
* 添加商品条目
*/
void addInventoryGoodsItem(List<Sssku> ssskuList);
void addInventoryGoodsItem(Sssku sssku);
//________________________________________
/**
* 展示记录详情Dialog
*/
void showInventoryDetailDialog(Cs csDetailList);
/**
* 加载列表
*/
void loadCs(Pager<Cs> csList);
/**
* 加载列表
*/
void loadCs(Pager<Cs> csList, long start, long end);
/**
* 跳转盘库页
*/
void openInventoryAddFragment(Cs cs);
/**
* 盘库页面-展示日期警告
*/
void showDateAlert(Boolean f);
}
abstract class Presenter extends BasePresenter<View> {
/**
* 跳转日期搜索
*/
public abstract void clickDate();
/**
* 盘库添加页面 - 取消退出这次盘库的记录
*
* @param cs 盘库记录
*/
public abstract void cancelInventoryAdd(Cs cs);
/**
* 盘库添加页面 - 结束盘库记录
*/
public abstract void exitInventoryAdd();
/**
* 盘库添加页面-确认盘库明细
*/
public abstract void clickOkCsDetail(Sssku ssku, Cs cs);
/**
* 根据条形码获取商品
*
* @param barcode 条形码
*/
public abstract void getProductByBarcode(String barcode);
/**
* 盘库列表页面 - 删除列表里的记录
*
* @param cs 盘库记录
*/
public abstract void delInventoryItem(Cs cs);
/**
* 盘库列表页面 - 点击列表里的记录
*
* @param cs 盘库记录
*/
public abstract void clickInventoryItem(Cs cs);
/**
* 盘库列表页面-检查日期合法性
*
* @param dateStart 起始时间
* @param dateEnd 终止时间
*/
public abstract void inspectDate(String dateStart, String dateEnd);
/**
* 盘库列表页面-点击开始盘库
*/
public abstract void clickStartInventory();
/**
* 获取盘库列表
*/
public abstract void getInventoryList(int pageNum, long start, long end);
/**
* 获取盘库列表
*/
public abstract void getInventoryList(long start, long end, int PageNumber, int pageSize);
/**
* 获取盘库列表
*/
public abstract void getInventoryList(int PageNumber);
}
}
package com.xingdata.zzdpos.ui.manage.inventory;
import com.blankj.utilcode.util.TimeUtils;
import com.blankj.utilcode.util.ToastUtils;
import com.xingdata.zzdpos.api.ApiFactory;
import com.xingdata.zzdpos.db.DB;
import com.xingdata.zzdpos.db.DBFactory;
import com.xingdata.zzdpos.model.Cs;
import com.xingdata.zzdpos.model.CsDetail;
import com.xingdata.zzdpos.model.Sssku;
import com.xingdata.zzdpos.ui.main.MainPresenter;
import com.xingdata.zzdpos.util.StringUtil;
import java.text.SimpleDateFormat;
import java.util.List;
import io.reactivex.Observable;
import io.realm.RealmQuery;
import static com.xingdata.zzdpos.db.DBFactory.getList;
public class InventoryPresenter extends InventoryContract.Presenter {
private int nowPageSize = 20;
private long start;
private long end;
@Override
public void onAttached() {
}
@Override
public void clickOkCsDetail(Sssku sssku, Cs mCs) {
CsDetail csDetail = new CsDetail();
csDetail.setSpuName(sssku.getSpuName());
csDetail.setSkuId(sssku.getSkuId());
csDetail.setSpuBarcode(sssku.getSpuBarcode());
csDetail.setSkuCnt(sssku.getSkuStock());
csDetail.setSpuUnitName(sssku.getSpuUnitName());
csDetail.setCsCnt((long) sssku.getInventoryCut());
csDetail.setChannelMapId(mCs.getChannelMapId().longValue());
csDetail.setCsNo(mCs.getCsNo());
csDetail.setSkuId(sssku.getSkuId());
csDetail.setOpMapId(mCs.getOpMapId().longValue());
if (csDetail.getCsCnt() == csDetail.getSkuCnt()) {
csDetail.setCsResultFlag(0);
} else if (csDetail.getCsCnt() > csDetail.getSkuCnt()) {
csDetail.setCsResultFlag(1);
} else {
csDetail.setCsResultFlag(2);
}
mView.isShowLoading(true);
ApiFactory.CsDetail.addCsDetail(csDetail).doFinally(() -> mView.isShowLoading(false))
.subscribe(detail -> {
mView.addInventoryDetailItem(detail, sssku);
}, throwable -> {
ToastUtils.showShort(throwable.getMessage());
});
}
/**
* 根据条形码获取商品
*
* @param barcode 条形码
*/
public void getProductByBarcode(String barcode) {
mView.isShowLoading(true);
mCompositeDisposable.add(
queryProductsByScan(barcode).subscribe(ssskus -> {
mView.isShowLoading(false);
mView.searchGoodsSuc();
if (ssskus.size() > 1) {
mView.addInventoryGoodsItem(ssskus);
} else if (ssskus.size() == 1) {
mView.addInventoryGoodsItem(ssskus.get(0));
} else {
ToastUtils.showShort("没有此商品");
}
})
);
}
/**
* 扫码查询商品
*
* @param barcode 扫描出的条形码
* @return 商品信息
*/
public static Observable<List<Sssku>> queryProductsByScan(String barcode) {
RealmQuery<Sssku> query = DB.getInstance().get(MainPresenter.class).where(Sssku.class);
query.equalTo("spuBarcode", StringUtil.strToLong(barcode)).equalTo("skuStatus", 0);
return Observable.just(query.findAll())
.flatMap(ssskus -> Observable.just(getList(ssskus)));
}
@Override
public void clickInventoryItem(Cs cs) {
mView.isShowLoading(true);
ApiFactory.Cs.getCsDetail(cs.getId()).doFinally(() -> mView.isShowLoading(false))
.subscribe(cslist -> {
mView.showInventoryDetailDialog(cslist);
}, throwable -> {
ToastUtils.showShort(throwable.getMessage());
});
}
@Override
public void delInventoryItem(Cs cs) {
mView.isShowLoading(true);
ApiFactory.Cs.delCsDetail(cs.getId(), cs.getCsNo()).doFinally(() -> mView.isShowLoading(false))
.subscribe(object -> {
}, throwable -> {
ToastUtils.showShort(throwable.getMessage());
});
}
@Override
public void clickDate() {
mView.showDateFragment();
}
@Override
public void cancelInventoryAdd(Cs cs) {
mView.isShowLoading(true);
ApiFactory.Cs.delCsDetail(cs.getId(), cs.getCsNo()).doFinally(() -> mView.isShowLoading(false))
.subscribe(object -> {
mView.disInventoryDetailFragment(false);
}, throwable -> {
ToastUtils.showShort(throwable.getMessage());
});
}
@Override
public void exitInventoryAdd() {
mView.disInventoryDetailFragment(true);
}
@Override
public void inspectDate(String dateStart, String dateEnd) {
long longStart = TimeUtils.string2Millis(dateStart, new SimpleDateFormat(StringUtil.defaultDatePattern));
long longEnd = TimeUtils.string2Millis(dateEnd, new SimpleDateFormat(StringUtil.defaultDatePattern)) + 86400000L;
if (longStart > longEnd) {
ToastUtils.showShort("日期不符合区间");
mView.showDateAlert(true);
} else {
mView.showDateAlert(false);
getInventoryList(longStart, longEnd, 1, nowPageSize);
}
}
@Override
public void clickStartInventory() {
mView.isShowLoading(true);
ApiFactory.Cs.addCs().doFinally(() -> {
mView.isShowLoading(false);
}).subscribe(cs -> {
if (cs.getCreateTime() == null) {
cs.setCreateTime(System.currentTimeMillis());
}
mView.openInventoryAddFragment(cs);
}, throwable -> {
ToastUtils.showShort(throwable.getMessage());
});
}
@Override
public void getInventoryList(int pageNum, long start, long end) {
mView.isShowLoading(true);
ApiFactory.Cs.querCsList(pageNum, nowPageSize, start, end).doFinally(() -> mView.isShowLoading(false))
.subscribe(csPager -> {
//判断是否能加载更多
mView.loadCs(csPager, start, end);
mView.setInventoryCount(com.blankj.utilcode.util.TimeUtils.millis2String(start, new SimpleDateFormat(StringUtil.defaultDatePattern)) + " ~ " +
com.blankj.utilcode.util.TimeUtils.millis2String(end, new SimpleDateFormat(StringUtil.defaultDatePattern)));
}, throwable -> {
ToastUtils.showShort(throwable.getMessage());
});
}
@Override
public void getInventoryList(long startdate, long enddate, int pageNumber, int pageSize) {
this.start = startdate;
this.end = enddate;
this.nowPageSize = pageSize;
getInventoryList(pageNumber, start, end);
}
@Override
public void getInventoryList(int PageNumber) {
mView.isShowLoading(true);
ApiFactory.Cs.querCsList(PageNumber, nowPageSize).doFinally(() -> mView.isShowLoading(false))
.subscribe(csPager -> {
//判断是否能加载更多
mView.loadCs(csPager);
mView.setInventoryCount(csPager.getTotalRow());
}, throwable -> {
ToastUtils.showShort(throwable.getMessage());
});
}
}
package com.xingdata.zzdpos.ui.manage.inventory.adpter;
import android.graphics.drawable.Drawable;
import android.support.annotation.Nullable;
import android.view.View;
import android.view.ViewGroup;
import com.blankj.utilcode.util.TimeUtils;
import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseAdapter;
import com.xingdata.zzdpos.databinding.ItemInventoryBinding;
import com.xingdata.zzdpos.model.Cs;
import java.util.List;
public class InventoryAdapter extends BaseAdapter<Cs, ItemInventoryBinding> {
public InventoryAdapter(@Nullable List<Cs> data) {
super(R.layout.item_inventory, data);
}
@Override
protected void convert(ItemInventoryBinding mViewBinding, Cs item) {
Drawable drawable = mContext.getResources().getDrawable(R.mipmap.icon_time);
drawable.setBounds(0, 0, (int) mViewBinding.tvDate.getTextSize(), (int) mViewBinding.tvDate.getTextSize());
mViewBinding.tvDate.setCompoundDrawablesRelative(drawable, null, null, null);
mViewBinding.tvDate.setCompoundDrawablePadding(10);
mViewBinding.tvName.setText(item.getOperName());
mViewBinding.tvPhone.setText(item.getOper_mobile());
mViewBinding.tvDate.setText(TimeUtils.millis2String(item.getCreateTime()) + "");
mViewBinding.tvNum.setText(item.getCount() + "");
switch (item.getCsResultFlag()) {
case 0:
mViewBinding.tvResult.setText("相符");
mViewBinding.imgInventory.setImageResource(R.mipmap.ic_consistent);
break;
case 1:
mViewBinding.tvResult.setText("不相符");
mViewBinding.imgInventory.setImageResource(R.mipmap.ic_not_consistent);
break;
}
}
@Override
protected View getItemView(int layoutResId, ViewGroup parent) {
return super.getItemView(layoutResId, parent);
}
}
package com.xingdata.zzdpos.ui.manage.inventory.adpter;
import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseAdapter;
import com.xingdata.zzdpos.base.BaseViewHolder;
import com.xingdata.zzdpos.databinding.ItemInventoryCartBinding;
import com.xingdata.zzdpos.databinding.ItemStoreSaledetailBinding;
import com.xingdata.zzdpos.model.CsDetail;
import com.xingdata.zzdpos.model.Saledetail;
import com.xingdata.zzdpos.ui.store.dialog.CartDialog;
import com.xingdata.zzdpos.util.ConvertUtil;
import java.util.List;
public class InventoryCartAdapter extends BaseAdapter<CsDetail, ItemInventoryCartBinding> {
public InventoryCartAdapter(List<CsDetail> csDetailList) {
super(R.layout.item_inventory_cart, csDetailList);
}
private CartDialog.OnCountChangeListener mOnCountChangeListener;
public void setOnCountChangeListener(CartDialog.OnCountChangeListener onCountChangeListener) {
this.mOnCountChangeListener = onCountChangeListener;
}
@Override
protected void convert(ItemInventoryCartBinding mViewBinding, CsDetail item) {
mViewBinding.tvName.setText(item.getSpuName());
mViewBinding.setCount(item.getCsCnt());
}
@Override
protected void convert(BaseViewHolder helper, CsDetail item) {
super.convert(helper, item);
}
}
//package com.xingdata.zzdpos.ui.manage.inventory.adpter;
//
//
//import android.support.annotation.Nullable;
//import android.view.View;
//import android.view.ViewGroup;
//
//
//import java.util.List;
//
//public class InventoryDetailAdapter extends BaseAdapter<CsDetail, ItemInventoryLeftBinding> {
// private int count = 1;
//
// public InventoryDetailAdapter(@Nullable List<CsDetail> data) {
// super(R.layout.item_inventory_left, data);
//
// }
//
//
// @Override
// protected void convert(ItemInventoryLeftBinding mViewBinding, CsDetail item) {
//
// mViewBinding.tvName.setText(item.getSpuName());
// mViewBinding.tvStockCount.setText(item.getSkuCnt() + "");
// mViewBinding.tvResultCount.setText(item.getCsCnt() + "");
// switch (item.getCsResultFlag()) {
// case 0://相等
// mViewBinding.imgResult.setImageResource(R.mipmap.icon_mark_equal);
// break;
// case 1://盘多
// mViewBinding.imgResult.setImageResource(R.mipmap.icon_mark_offer_more);
// break;
// case 2://盘少
// mViewBinding.imgResult.setImageResource(R.mipmap.icon_mark_offer_less);
// break;
// }
// }
//
// @Override
// protected View getItemView(int layoutResId, ViewGroup parent) {
// return super.getItemView(layoutResId, parent);
// }
//
//
//}
package com.xingdata.zzdpos.ui.manage.inventory.adpter;
import android.support.annotation.Nullable;
import android.text.Editable;
import android.text.TextWatcher;
import android.view.View;
import android.view.ViewGroup;
import android.widget.EditText;
import com.facebook.drawee.view.SimpleDraweeView;
import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseAdapter;
import com.xingdata.zzdpos.base.BaseViewHolder;
import com.xingdata.zzdpos.databinding.ItemInventoryGoodsBinding;
import com.xingdata.zzdpos.model.Sssku;
import com.xingdata.zzdpos.util.ConvertUtil;
import java.util.List;
public class InventoryGoodsAdapter extends BaseAdapter<Sssku, ItemInventoryGoodsBinding> {
private int count ;
public InventoryGoodsAdapter(@Nullable List<Sssku> data) {
super(R.layout.item_inventory_goods, data);
}
@Override
protected void convert(BaseViewHolder helper, Sssku item) {
if (item.getInventoryCut() == 0) {
item.setInventoryCut(1);
}
count=item.getInventoryCut();
helper.setText(R.id.et_count, item.getInventoryCut() + "");
helper.setText(R.id.tv_goods_name, item.getSpuName())
.setText(R.id.tv_goods_code, item.getSpuBarcode() + "")
.setText(R.id.tv_goods_size, "规格/" + item.getSpuUnitName())
.setText(R.id.tv_goods_price, ConvertUtil.fenToYuan(item.getSkuRetailPrice1(), false))
.setText(R.id.tv_stock, item.getSkuStock() + "");
((SimpleDraweeView) helper.getView(R.id.img_goods)).setImageURI(item.getSpuImg());
helper.getView(R.id.btn_up).setOnClickListener(v -> {
if (count > 0 && count < 9999) {
helper.setText(R.id.et_count, String.valueOf(++count));
item.setInventoryCut(count);
}
});
helper.getView(R.id.btn_down).setOnClickListener(v -> {
if (count == 1) {
item.setInventoryCut(count);
return;
}
if (count > 1 && count < 100) {
helper.setText(R.id.et_count, String.valueOf(--count));
item.setInventoryCut(count);
}
});
((EditText) helper.getView(R.id.et_count)).addTextChangedListener((new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {
}
@Override
public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
count = ((EditText) helper.getView(R.id.et_count)).getText().toString().length() == 0 ? 1 : Integer.valueOf(((EditText) helper.getView(R.id.et_count)).getText().toString());
item.setInventoryCut(count);
}
@Override
public void afterTextChanged(Editable editable) {
}
}));
helper.addOnClickListener(R.id.btn_ok);
super.convert(helper, item);
}
@Override
protected void convert(ItemInventoryGoodsBinding mViewBinding, Sssku item) {
}
@Override
protected View getItemView(int layoutResId, ViewGroup parent) {
return super.getItemView(layoutResId, parent);
}
}
package com.xingdata.zzdpos.ui.manage.inventory.dialog;
import android.support.design.widget.BottomSheetBehavior;
import android.support.v7.widget.LinearLayoutManager;
import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseSheetDialog;
import com.xingdata.zzdpos.databinding.DialogStoreCartBinding;
import com.xingdata.zzdpos.model.CsDetail;
import com.xingdata.zzdpos.model.Saledetail;
import com.xingdata.zzdpos.model.Saleorder;
import com.xingdata.zzdpos.ui.manage.inventory.adpter.InventoryCartAdapter;
import com.xingdata.zzdpos.ui.store.StorePresenter;
import com.xingdata.zzdpos.ui.store.adapter.SaledetailAdapter;
import java.util.List;
public class CsCartDialog extends BaseSheetDialog<StorePresenter, DialogStoreCartBinding> {
private List<CsDetail> mCsDetails;
public interface OnCountChangeListener {
void onCountChange(Saledetail saledetail, int value);
}
@Override
protected boolean isTransparentBackground() {
return true;
}
@Override
public int getLayoutId() {
return R.layout.dialog_store_cart;
}
@Override
public void initView() {
;
// init C
InventoryCartAdapter mInventoryCartAdapter = new InventoryCartAdapter(mCsDetails);
mViewBinding.rlCart.setAdapter(mInventoryCartAdapter);
mViewBinding.rlCart.setLayoutManager(new LinearLayoutManager(mContext));
// set Other listener
mViewBinding.tvSettle.setOnClickListener(view -> mPresenter.clickSettle());
mViewBinding.tvClear.setOnClickListener(view -> mPresenter.clearCart());
}
@Override
public void onStart() {
super.onStart();
//默认全屏展开
mBehavior.setState(BottomSheetBehavior.STATE_EXPANDED);
}
public CsCartDialog setSaledetails(List<CsDetail> csDetailList) {
this.mCsDetails = csDetailList;
return this;
}
@Override
public void onDestroyView() {
mPresenter.exitCartDialog();
super.onDestroyView();
}
}
//package com.xingdata.zzdpos.ui.manage.inventory.dialog;
//
//import android.support.v7.widget.LinearLayoutManager;
//import android.view.View;
//
//import com.blankj.utilcode.util.TimeUtils;
//import com.blankj.utilcode.util.ToastUtils;
//import com.xingdata.api.print.ZX_PrintPOS;
//import com.xingdata.zzdhd.R;
//import com.xingdata.zzdhd.base.BaseDialog;
//import com.xingdata.zzdhd.databinding.DialogInventoryDetailBinding;
//import com.xingdata.zzdhd.model.Cs;
//import com.xingdata.zzdhd.model.CsDetail;
//import com.xingdata.zzdhd.ui.manager.inventory.InventoryPresenter;
//import com.xingdata.zzdhd.ui.manager.inventory.adpter.InventoryDetailAdapter;
//
//import java.util.ArrayList;
//import java.util.List;
//
///**
// * Created by Administrator on 2017/12/4.
// */
//
//public class InventoryDetailDialog extends BaseDialog<InventoryPresenter, DialogInventoryDetailBinding> {
// private InventoryDetailAdapter mInventoryDetailAdapter;
// private List<CsDetail> csDetails = new ArrayList<>();
// private Cs cs;
// private long mExitTime=0;
//
//
// @Override
// public int getLayoutId() {
// return R.layout.dialog_inventory_detail;
// }
//
// @Override
// public void initView() {
// initLeftRecycler();
// if (cs == null) {
// ToastUtils.showShort("未获取到相关数据");
// return;
// }
// setBtnName("取消", "打印清单");
// mViewBinding.setOperName(cs.getOperName());
// mViewBinding.setDate(TimeUtils.millis2String(cs.getCreateTime()));
// mViewBinding.setSumNum(cs.getCount() + "");
// switch (cs.getCsResultFlag()) {
// case 0:
// mViewBinding.setFinallyResult("相符");
// break;
// case 1:
// mViewBinding.setFinallyResult("不相符");
// break;
// }
// csDetails.clear();
// csDetails.addAll(cs.getCsdetailList());
// mInventoryDetailAdapter.notifyDataSetChanged();
// getDialog().setCanceledOnTouchOutside(false);
//
// }
//
// @Override
// protected boolean isShowTitle() {
// return false;
// }
//
// public InventoryDetailDialog setData(Cs csDetailList) {
// this.cs = csDetailList;
// return this;
// }
//
// private void initLeftRecycler() {
// mViewBinding.replenishmentLeftRecycler.setLayoutManager(new LinearLayoutManager(getActivity()));
// mInventoryDetailAdapter = new InventoryDetailAdapter(csDetails);
// mViewBinding.replenishmentLeftRecycler.setAdapter(mInventoryDetailAdapter);
// }
//
// @Override
// public void onConfirmClick(View view) {
// if ((System.currentTimeMillis() - mExitTime) > 2000) {
// ZX_PrintPOS.getInstance(mContext).printInventory(1,cs);
// } else {
//
// }
// super.onConfirmClick(view);
// }
//}
package com.xingdata.zzdpos.ui.manage.inventory.fragment;
import android.support.v7.widget.LinearLayoutManager;
import android.view.KeyEvent;
import android.view.View;
import android.view.inputmethod.EditorInfo;
import android.widget.TextView;
import com.blankj.utilcode.util.KeyboardUtils;
import com.blankj.utilcode.util.TimeUtils;
import com.blankj.utilcode.util.ToastUtils;
import com.xingdata.api.print.ZX_PrintPOS;
import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseActivity;
import com.xingdata.zzdpos.base.BaseFragment;
import com.xingdata.zzdpos.databinding.FragmentInventoryAddBinding;
import com.xingdata.zzdpos.model.Cs;
import com.xingdata.zzdpos.model.CsDetail;
import com.xingdata.zzdpos.model.Saledetail;
import com.xingdata.zzdpos.model.Sssku;
import com.xingdata.zzdpos.ui.dialog.PromptDialog;
import com.xingdata.zzdpos.ui.manage.inventory.InventoryPresenter;
import com.xingdata.zzdpos.ui.manage.inventory.adpter.InventoryGoodsAdapter;
import com.xingdata.zzdpos.ui.manage.inventory.dialog.CsCartDialog;
import com.xingdata.zzdpos.util.OnClickListener;
import java.util.ArrayList;
import java.util.List;
/**
* Created by Administrator on 2017/11/24.
*/
public class InventoryAddFragment extends BaseFragment<InventoryPresenter, FragmentInventoryAddBinding> {
private List<Sssku> topCsList = new ArrayList<>();
private InventoryGoodsAdapter mInventoryGoodsAdapter;
private CsCartDialog mCartDialog = new CsCartDialog();
/**
* 当前购物车信息
*/
private List<CsDetail> bottomCsList = new ArrayList<>();
// private InventoryDetailAdapter mInventoryDetailAdapter;
private Cs mCs;
private boolean isResult = true;
@Override
public int getLayoutId() {
return R.layout.fragment_inventory_add;
}
@Override
public void initView() {
initRecycler();
mViewBinding.setCartCount(0);
mViewBinding.icTitle.edTitle.setOnEditorActionListener(new TextView.OnEditorActionListener() {
@Override
public boolean onEditorAction(TextView textView, int i, KeyEvent keyEvent) {
if (i == EditorInfo.IME_ACTION_SEARCH) {
mPresenter.getProductByBarcode(mViewBinding.icTitle.edTitle.getText().toString());
hideSoftInput();
}
return false;
}
});
mViewBinding.ivCart.setOnClickListener(new OnClickListener() {
@Override
protected void myOnClickListener(View v) {
if (bottomCsList.size() == 0) {
return;
}
mCartDialog.setSaledetails(bottomCsList).show((BaseActivity) getActivity());
}
});
// mViewBinding.btnEnd.setOnClickListener(view -> {
// mPresenter.exitInventoryAdd();
// });
// mViewBinding.btnDel.setOnClickListener(view -> {
// {
// PromptDialog promptDialog = new PromptDialog();
// promptDialog.setDialogType(PromptDialog.PROMPTDIALOG_SELECT, "请确认删除本次盘库记录").setClick(view1 -> {
// mPresenter.cancelInventoryAdd(mCs);
// promptDialog.dismiss();
// }, view1 -> {
// promptDialog.dismiss();
// }).setCancelables(false).show((BaseActivity) mContext);
//
// }
//
// });
// mViewBinding.btnPrint.setOnClickListener(new OnClickListener() {
// @Override
// protected void myOnClickListener(View v) {
// ZX_PrintPOS.getInstance(mContext).printInventory(1, mCs);
// }
// });
}
private void initRecycler() {
mViewBinding.recyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
mInventoryGoodsAdapter = new InventoryGoodsAdapter(topCsList);
mInventoryGoodsAdapter.setOnItemLongClickListener((adapter, view, position) -> {
PromptDialog delDialog = new PromptDialog();
delDialog.setDialogType(PromptDialog.PROMPTDIALOG_SELECT, "是否删除").setClick(new View.OnClickListener() {
@Override
public void onClick(View view) {
adapter.getData().remove(position);
adapter.notifyDataSetChanged();
delDialog.dismiss();
}
}, new View.OnClickListener() {
@Override
public void onClick(View view) {
delDialog.dismiss();
}
}).setCancelables(false).show((BaseActivity) mContext);
return false;
});
mInventoryGoodsAdapter.setOnItemChildClickListener((adapter, view, position) -> {
switch (view.getId()) {
case R.id.btn_ok:
PromptDialog promptDialog = new PromptDialog();
promptDialog.setDialogType(PromptDialog.PROMPTDIALOG_SELECT, "请确认添加记录").setClick(view1 -> {
mPresenter.clickOkCsDetail(mInventoryGoodsAdapter.getData().get(position), mCs);
promptDialog.dismiss();
}, view1 -> {
promptDialog.dismiss();
}).setCancelables(false).show((BaseActivity) mContext);
break;
}
});
mViewBinding.recyclerView.setAdapter(mInventoryGoodsAdapter);
}
public void addInventoryGoodsItem(List<Sssku> list) {
for (Sssku s : list) {
if (topCsList.contains(s)) {
ToastUtils.showShort("商品已存在");
} else {
if (bottomCsList.contains(s)) {
ToastUtils.showShort("商品已盘点");
} else {
topCsList.add(s);
}
}
}
mInventoryGoodsAdapter.notifyDataSetChanged();
}
public void addInventoryGoodsItem(Sssku sssku) {
if (!topCsList.contains(sssku)) {
if (bottomCsList.contains(sssku)) {
ToastUtils.showShort("商品已盘点");
} else {
topCsList.add(sssku);
}
} else {
ToastUtils.showShort("商品已存在");
}
mInventoryGoodsAdapter.notifyDataSetChanged();
}
public void addInventoryDetailItem(CsDetail csDetail, Sssku sssku) {
if (csDetail.getCsResultFlag() != 0) {
isResult = false;
}
bottomCsList.add(csDetail);
mViewBinding.setCartCount(getSumNum());
topCsList.remove(sssku);
mInventoryGoodsAdapter.notifyDataSetChanged();
if (isResult) {
mViewBinding.setResult("相符");
} else {
mViewBinding.setResult("不相符");
}
}
private int getSumNum() {
long i = 0;
for (CsDetail csDetail : bottomCsList) {
i = i + csDetail.getCsCnt();
}
return (int) i;
}
public void setCs(Cs cs) {
mCs = cs;
mCs.setCsdetailList(bottomCsList);
}
public void searchGoodsSuc() {
// mViewBinding.etKeyword.setText("");
// KeyboardUtils.hideSoftInput(getActivity());
}
}
package com.xingdata.zzdpos.ui.manage.inventory.fragment;
import android.databinding.DataBindingUtil;
import android.graphics.drawable.ColorDrawable;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.LinearLayoutManager;
import android.text.Html;
import android.util.TimeUtils;
import android.util.TypedValue;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.DatePicker;
import android.widget.PopupWindow;
import android.widget.TextView;
import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseActivity;
import com.xingdata.zzdpos.base.BaseFragment;
import com.xingdata.zzdpos.databinding.FragmentInventoryBinding;
import com.xingdata.zzdpos.model.Cs;
import com.xingdata.zzdpos.model.Ossku;
import com.xingdata.zzdpos.model.Pager;
import com.xingdata.zzdpos.ui.dialog.LoadingDialog;
import com.xingdata.zzdpos.ui.dialog.PromptDialog;
import com.xingdata.zzdpos.ui.manage.inventory.InventoryPresenter;
import com.xingdata.zzdpos.ui.manage.inventory.adpter.InventoryAdapter;
import com.xingdata.zzdpos.util.OnClickListener;
import com.xingdata.zzdpos.util.StringUtil;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.List;
/**
* Created by Administrator on 2017/11/24.
*/
public class InventoryFragment extends BaseFragment<InventoryPresenter, FragmentInventoryBinding> {
private InventoryAdapter mInventoryAdapter;
private int pageNum;
private Long start;
private Long end;
@Override
public int getLayoutId() {
return R.layout.fragment_inventory;
}
@Override
public void initView() {
start = null;
end = null;
pageNum = 1;
initTitle();
mViewBinding.btnAdd.setOnClickListener(new OnClickListener() {
@Override
protected void myOnClickListener(View v) {
mPresenter.clickStartInventory();
}
});
mViewBinding.recyclerInventory.setLayoutManager(new LinearLayoutManager(getActivity()));
mInventoryAdapter = new InventoryAdapter(new ArrayList<>());
mInventoryAdapter.setEmptyView(getEmptyView());
mViewBinding.recyclerInventory.setAdapter(mInventoryAdapter);
mViewBinding.srlProduct.setOnRefreshListener(this::onRefresh);
mInventoryAdapter.setOnLoadMoreListener(this::onLoadMore, mViewBinding.recyclerInventory);
mInventoryAdapter.setOnItemClickListener((adapter, view, position) -> {
mPresenter.clickInventoryItem(mInventoryAdapter.getData().get(position));
});
mViewBinding.btnAdd.setOnClickListener(new OnClickListener() {
@Override
protected void myOnClickListener(View v) {
mPresenter.clickStartInventory();
}
}
);
mInventoryAdapter.setOnItemLongClickListener((adapter, view, position) -> {
PromptDialog promptDialog = new PromptDialog();
promptDialog.setDialogType(PromptDialog.PROMPTDIALOG_SELECT, "请确认删除此记录").setClick(view1 -> {
mPresenter.delInventoryItem(mInventoryAdapter.getData().get(position));
promptDialog.dismiss();
}, view1 -> {
promptDialog.dismiss();
}).setCancelables(false).show((BaseActivity) mContext);
return false;
});
mPresenter.getInventoryList(pageNum);
}
private void initTitle() {
mViewBinding.icTitle.edTitle.setVisibility(View.GONE);
mViewBinding.icTitle.tvTitle.setText("盘库记录");
mViewBinding.icTitle.tvTitle.setVisibility(View.VISIBLE);
mViewBinding.icTitle.ivRight.setOnClickListener(new OnClickListener() {
@Override
protected void myOnClickListener(View v) {
mPresenter.clickDate();
}
});
mViewBinding.icTitle.setOnClickListener(new OnClickListener() {
@Override
protected void myOnClickListener(View v) {
getActivity().finish();
}
});
}
//
public void setCount(int count) {
mViewBinding.tvCount.setText("共" + count + "人次盘库记录");
}
public void setCount(String count) {
mViewBinding.tvCount.setText(count);
}
private void onRefresh() {
start = null;
end = null;
pageNum = 1;
mPresenter.getInventoryList(pageNum);
}
private void onLoadMore() {
pageNum++;
if (start != null) {
mPresenter.getInventoryList(pageNum, start, end);
} else {
mPresenter.getInventoryList(pageNum);
}
}
/**
* 设置数据
*
* @param pager 数据
* @param isRefresh 是否刷新
*/
public void setData(Pager<Cs> pager, boolean isRefresh) {
if (isRefresh) {
mInventoryAdapter.setEnableLoadMore(true);
mViewBinding.srlProduct.setRefreshing(false);
pageNum = 1;
}
if (isRefresh) mInventoryAdapter.setNewData(pager.getList());
else if (pager.getList().size() > 0) mInventoryAdapter.addData(pager.getList());
if (pager.isLastPage()) mInventoryAdapter.loadMoreEnd(isRefresh);
else mInventoryAdapter.loadMoreComplete();
}
private View getEmptyView() {
View view = getLayoutInflater().inflate(R.layout.view_empty, null);
TextView textView = view.findViewById(R.id.tv_empty);
textView.setText(R.string.inventory_empty_hint);
return view;
}
public void setDate(long start, long end) {
this.start = start;
this.end = end;
}
}
package com.xingdata.zzdpos.ui.manage.manageMenu;
import android.util.TypedValue;
import android.view.View;
import android.widget.DatePicker;
import android.widget.TextView;
import com.blankj.utilcode.util.TimeUtils;
import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseFragment;
import com.xingdata.zzdpos.databinding.FragmentStatisticsDateBinding;
import com.xingdata.zzdpos.ui.manage.inventory.InventoryPresenter;
import com.xingdata.zzdpos.ui.statistics.StatisticsPresenter;
import com.xingdata.zzdpos.util.OnClickListener;
import com.xingdata.zzdpos.util.StringUtil;
import java.text.SimpleDateFormat;
public class ManageDateFragment extends BaseFragment<InventoryPresenter, FragmentStatisticsDateBinding> {
private float textSize;
private View.OnFocusChangeListener mOnFocusChangeListener;
private View.OnClickListener mOnClickListener;
@Override
public int getLayoutId() {
return R.layout.fragment_statistics_date;
}
@Override
public void initView() {
initListener();
textSize = mViewBinding.editStart.getTextSize();
mViewBinding.editStart.setOnFocusChangeListener(mOnFocusChangeListener);
mViewBinding.editEnd.setOnFocusChangeListener(mOnFocusChangeListener);
mViewBinding.editStart.setOnClickListener(mOnClickListener);
mViewBinding.editEnd.setOnClickListener(mOnClickListener);
String startAll = StringUtil.monthStart();
String[] stringsStart = startAll.split("-");
mViewBinding.datePickerStart.setMaxDate(System.currentTimeMillis());
mViewBinding.datePickerStart.init(2000, 0, 0, new DatePicker.OnDateChangedListener() {
@Override
public void onDateChanged(DatePicker datePicker, int i, int i1, int i2) {
String month = String.valueOf(i1 + 1).length() >= 2 ? String.valueOf(i1 + 1) : "0" + String.valueOf(i1 + 1);
String day = String.valueOf(i2).length() >= 2 ? String.valueOf(i2) : "0" + String.valueOf(i2);
mViewBinding.editStart.setText(i + "-" + month + "-" + day);
}
});
String endAll = TimeUtils.millis2String(System.currentTimeMillis(), new SimpleDateFormat(StringUtil.defaultDatePattern));
String[] stringsEnd = endAll.split("-");
mViewBinding.datePickerEnd.setMaxDate(System.currentTimeMillis());
mViewBinding.datePickerEnd.init(2000, 0, 0, new DatePicker.OnDateChangedListener() {
@Override
public void onDateChanged(DatePicker datePicker, int i, int i1, int i2) {
String month = String.valueOf(i1 + 1).length() >= 2 ? String.valueOf(i1 + 1) : "0" + String.valueOf(i1 + 1);
String day = String.valueOf(i2).length() >= 2 ? String.valueOf(i2) : "0" + String.valueOf(i2);
mViewBinding.editEnd.setText(i + "-" + month + "-" + day);
}
});
mViewBinding.tvOk.setOnClickListener(new OnClickListener() {
@Override
protected void myOnClickListener(View v) {
mPresenter.inspectDate(mViewBinding.editStart.getText().toString(), mViewBinding.editEnd.getText().toString());
}
});
mViewBinding.tvCancel.setOnClickListener(new OnClickListener() {
@Override
protected void myOnClickListener(View v) {
pop();
}
});
new android.os.Handler().postDelayed(new Runnable() {
@Override
public void run() {
mViewBinding.datePickerStart.updateDate(Integer.valueOf(stringsStart[0]), Integer.valueOf(stringsStart[1]) - 1, Integer.valueOf(stringsStart[2]));
mViewBinding.datePickerEnd.updateDate(Integer.valueOf(stringsEnd[0]), Integer.valueOf(stringsEnd[1]) - 1, Integer.valueOf(stringsEnd[2]));
mViewBinding.editStart.performClick();
mViewBinding.editStart.setText(startAll);
mViewBinding.editEnd.setText(endAll);
}
}, 10);
}
public void showDateAlert(Boolean f) {
if (f) {
mViewBinding.imgAlert.setVisibility(View.VISIBLE);
} else {
mViewBinding.imgAlert.setVisibility(View.GONE);
}
}
private void initListener() {
mOnFocusChangeListener = new View.OnFocusChangeListener() {
@Override
public void onFocusChange(View view, boolean b) {
if (b) {
((TextView) view).setTextSize(TypedValue.COMPLEX_UNIT_PX, textSize + 5);
((TextView) view).setTextColor(getResources().getColor(R.color.red_guanyu));
String[] strings = ((TextView) view).getText().toString().split("-");
if (mViewBinding.datePickerStart.getVisibility() == View.GONE) {
mViewBinding.datePickerStart.setVisibility(View.VISIBLE);
mViewBinding.datePickerEnd.setVisibility(View.GONE);
} else {
mViewBinding.datePickerStart.setVisibility(View.GONE);
mViewBinding.datePickerEnd.setVisibility(View.VISIBLE);
}
} else {
((TextView) view).setTextSize(TypedValue.COMPLEX_UNIT_PX, textSize);
((TextView) view).setTextColor(getResources().getColor(R.color.gray_kongming));
}
}
};
mOnClickListener = new OnClickListener() {
@Override
protected void myOnClickListener(View v) {
if (v.isFocused()) {
} else {
v.setFocusable(true);
v.setFocusableInTouchMode(true);
v.requestFocus();
}
}
};
}
}
...@@ -11,12 +11,11 @@ import com.chad.library.adapter.base.BaseQuickAdapter; ...@@ -11,12 +11,11 @@ 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.inventory.InventoryActivity;
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.manage.sssku.SsskuActivity;
import com.xingdata.zzdpos.ui.marketing.marketingMenu.MarketingMenuActivity;
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.ticket.ReturnTicketActivity;
import com.xingdata.zzdpos.util.OnClickListener; import com.xingdata.zzdpos.util.OnClickListener;
import java.util.ArrayList; import java.util.ArrayList;
...@@ -62,7 +61,7 @@ public class ManageMenuActivity extends AppCompatActivity { ...@@ -62,7 +61,7 @@ public class ManageMenuActivity extends AppCompatActivity {
} }
break; break;
case C.MENU.MENU_MANAGER_GOODS: { case C.MENU.MENU_MANAGER_GOODS: {
ActivityUtils.startActivity(ManageMenuActivity.this, SsskuActivity.class);
} }
break; break;
case C.MENU.MENU_MANAGER_BALE: { case C.MENU.MENU_MANAGER_BALE: {
...@@ -74,11 +73,11 @@ public class ManageMenuActivity extends AppCompatActivity { ...@@ -74,11 +73,11 @@ 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: {
ActivityUtils.startActivity(ManageMenuActivity.this, InventoryActivity.class);
} }
break; break;
default: { default: {
......
package com.xingdata.zzdpos.ui.manage.otherselect;
import android.view.KeyEvent;
import android.view.View;
import com.blankj.utilcode.util.FragmentUtils;
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.dialog.LoadingDialog;
import com.xingdata.zzdpos.ui.manage.otherselect.fragment.OtherDetailFragment;
import com.xingdata.zzdpos.ui.manage.otherselect.fragment.OtherListFragment;
import com.xingdata.zzdpos.util.OnClickListener;
public class OtherSelectActivity extends BaseActivity<OtherSelectPresenter, ActivityOtherSelectBinding> implements OtherSelectContract.View {
private OtherListFragment mOtherListFragment = new OtherListFragment();
private OtherDetailFragment mOtherDetailFragment = new OtherDetailFragment();
LoadingDialog mLoadingDialog = new LoadingDialog();
@Override
public int getLayoutId() {
return R.layout.activity_other_select;
}
@Override
public void initView() {
mViewBinding.lyTitle.ivRight.setVisibility(View.GONE);
FragmentUtils.add(getSupportFragmentManager(), mOtherListFragment, mViewBinding.fragmentContainer.getId(), false, true);
mViewBinding.lyTitle.edTitle.setOnKeyListener((v, keyCode, event) -> {
if (keyCode == KeyEvent.KEYCODE_ENTER)
search(mViewBinding.lyTitle.edTitle.getText().toString().trim());
return false;
});
mViewBinding.lyTitle.setOnClickListener(new OnClickListener() {
@Override
protected void myOnClickListener(View v) {
if (mViewBinding.lyTitle.edTitle.isFocused()) {
mViewBinding.lyTitle.edTitle.clearFocus();
}
if (mOtherDetailFragment.isAdded()) {
mOtherDetailFragment.pop();
return;
}
finish();
}
});
}
@Override
public void isShowLoading(Boolean is) {
if (is) {
mLoadingDialog.show((BaseActivity) mContext);
} else {
if (mLoadingDialog.isShowing) {
mLoadingDialog.dismiss();
}
}
}
@Override
public void loadOssku(Pager<Ossku> osskuList, boolean isRefresh) {
if (mOtherDetailFragment.isAdded()) {
mOtherDetailFragment.pop();
}
mOtherListFragment.setData(osskuList, isRefresh);
}
@Override
public void showOsskuDetail(Ossku ossku) {
mOtherDetailFragment.setOssku(ossku);
FragmentUtils.add(getSupportFragmentManager(), mOtherDetailFragment, mViewBinding.fragmentContainer.getId(), false, true);
}
@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);
void showOsskuDetail(Ossku ossku);
}
abstract class Presenter extends BasePresenter<View> {
public abstract void clickOsskuItem(Ossku ossku);
/**
* 临库查询界面 - 查找
*
* @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;
import com.xingdata.zzdpos.model.Ossku;
public class OtherSelectPresenter extends OtherSelectContract.Presenter {
private int nowPageNumber = 1;
private int nowPageSize = 10;
private String wd;
@Override
public void onAttached() {
}
@Override
public void clickOsskuItem(Ossku ossku) {
mView.showOsskuDetail(ossku);
}
@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.FragmentOtherDetailBinding;
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 com.xingdata.zzdpos.util.ConvertUtil;
import java.util.ArrayList;
/**
* Created by Administrator on 2017/11/23.
*/
public class OtherDetailFragment extends BaseFragment<OtherSelectPresenter, FragmentOtherDetailBinding> {
private Ossku ossku;
@Override
public int getLayoutId() {
return R.layout.fragment_other_detail;
}
@Override
public void initView() {
if (ossku != null) {
mViewBinding.tvGoodsName.setText(ossku.getSpuName());
mViewBinding.tvGoodsCode.setText(ossku.getSpuBarcode() + "");
mViewBinding.tvPrice.setText(ConvertUtil.fenToYuan(ossku.getSkuRetailPrice1(), false));
mViewBinding.tvGoodsSize.setText("规格/" + ossku.getSpuUnitName());
mViewBinding.imgGoods.setImageURI(ossku.getSpuImg());
mViewBinding.setStock("库存:" + ossku.getSkuStock());
mViewBinding.setShopName(ossku.getShopName());
mViewBinding.setAddress(ossku.getCityAddress());
mViewBinding.setPhone(ossku.getContactTel());
}
}
public void setOssku(Ossku ossku) {
this.ossku = ossku;
}
}
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) {
mPresenter.clickOsskuItem(mOtherSelectAdapter.getData().get(position));
}
});
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;
}
}
...@@ -5,17 +5,19 @@ import com.blankj.utilcode.util.KeyboardUtils; ...@@ -5,17 +5,19 @@ import com.blankj.utilcode.util.KeyboardUtils;
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.databinding.ActivityReplenishmentBinding; import com.xingdata.zzdpos.databinding.ActivityReplenishmentBinding;
import com.xingdata.zzdpos.model.Pager;
import com.xingdata.zzdpos.model.Psb; import com.xingdata.zzdpos.model.Psb;
import com.xingdata.zzdpos.model.Sssku; import com.xingdata.zzdpos.model.Sssku;
import com.xingdata.zzdpos.ui.dialog.LoadingDialog; import com.xingdata.zzdpos.ui.dialog.LoadingDialog;
import com.xingdata.zzdpos.ui.manage.replenishment.fragment.ReplenishmentDetailFragment;
import com.xingdata.zzdpos.ui.manage.replenishment.fragment.ReplenishmentFragment; import com.xingdata.zzdpos.ui.manage.replenishment.fragment.ReplenishmentFragment;
import java.util.List; import java.util.List;
public class ReplenishmentActivity extends BaseActivity<ReplenishmentPresenter, ActivityReplenishmentBinding> implements ReplenishmentContract.View { public class ReplenishmentActivity extends BaseActivity<ReplenishmentPresenter, ActivityReplenishmentBinding> implements ReplenishmentContract.View {
private ReplenishmentFragment mReplenishmentFragment = new ReplenishmentFragment(); private ReplenishmentFragment mReplenishmentFragment = new ReplenishmentFragment();
// private ReplenishmentDetailFragment mReplenishmentDetailFragment = new ReplenishmentDetailFragment(); private ReplenishmentDetailFragment mReplenishmentDetailFragment = new ReplenishmentDetailFragment();
private boolean isAllowFragment = true; private boolean isAllowFragment = true;
LoadingDialog mLoadingDialog = new LoadingDialog(); LoadingDialog mLoadingDialog = new LoadingDialog();
...@@ -26,40 +28,45 @@ public class ReplenishmentActivity extends BaseActivity<ReplenishmentPresenter, ...@@ -26,40 +28,45 @@ public class ReplenishmentActivity extends BaseActivity<ReplenishmentPresenter,
@Override @Override
public void initView() { public void initView() {
loadRootFragment(R.id.f_bottom, mReplenishmentFragment, true, false); mPresenter.queryPsbList();
} }
@Override @Override
public void addPsbSuc() { public void addPsbSuc() {
// mReplenishmentDetailFragment.pop(); mReplenishmentDetailFragment.pop();
mPresenter.refreshPsb(); mPresenter.refreshPsb();
} }
@Override @Override
public void showReplenishmentList(List<Psb> A, List<Psb> B, List<Psb> C) { public void showReplenishmentList(List<Psb> A, List<Psb> B, List<Psb> C) {
mReplenishmentFragment.showReplenishmentList(A, B, C); if (mReplenishmentFragment.isAdded()){
mReplenishmentFragment.showReplenishmentList(A, B, C,false);
}else {
mReplenishmentFragment.showReplenishmentList(A, B, C,true);
loadRootFragment(R.id.f_bottom, mReplenishmentFragment, true, false);
}
} }
@Override @Override
public void openReplenishmentDetailFragment(List<Sssku> ssskuList) { public void openReplenishmentDetailFragment(List<Sssku> ssskuList) {
// if (isAllowFragment) { if (isAllowFragment) {
// isAllowFragment = false; isAllowFragment = false;
// mReplenishmentDetailFragment.setSsskuList(ssskuList); mReplenishmentDetailFragment.setSsskuList(ssskuList);
// start(mReplenishmentDetailFragment); start(mReplenishmentDetailFragment);
// } }
} }
@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);
// }
// }
} }
...@@ -84,4 +91,6 @@ public class ReplenishmentActivity extends BaseActivity<ReplenishmentPresenter, ...@@ -84,4 +91,6 @@ public class ReplenishmentActivity extends BaseActivity<ReplenishmentPresenter,
public void isAllowFragment(Boolean is) { public void isAllowFragment(Boolean is) {
isAllowFragment = is; isAllowFragment = is;
} }
} }
...@@ -2,6 +2,7 @@ package com.xingdata.zzdpos.ui.manage.replenishment; ...@@ -2,6 +2,7 @@ package com.xingdata.zzdpos.ui.manage.replenishment;
import android.util.Log; import android.util.Log;
import android.util.TimeUtils;
import com.blankj.utilcode.util.ToastUtils; import com.blankj.utilcode.util.ToastUtils;
import com.xingdata.zzdpos.api.ApiFactory; import com.xingdata.zzdpos.api.ApiFactory;
...@@ -24,8 +25,6 @@ public class ReplenishmentPresenter extends ReplenishmentContract.Presenter { ...@@ -24,8 +25,6 @@ public class ReplenishmentPresenter extends ReplenishmentContract.Presenter {
} }
@Override @Override
public void clickAdd() { public void clickAdd() {
mView.isShowLoading(true); mView.isShowLoading(true);
...@@ -33,7 +32,11 @@ public class ReplenishmentPresenter extends ReplenishmentContract.Presenter { ...@@ -33,7 +32,11 @@ public class ReplenishmentPresenter extends ReplenishmentContract.Presenter {
mView.isShowLoading(false); mView.isShowLoading(false);
}) })
.subscribe(ssskuPager -> { .subscribe(ssskuPager -> {
mView.openReplenishmentDetailFragment(ssskuPager.getList()); if (ssskuPager.getList().size() == 0) {
ToastUtils.showShort("库存正常,无需补货");
} else {
mView.openReplenishmentDetailFragment(ssskuPager.getList());
}
}, throwable -> { }, throwable -> {
ToastUtils.showShort(throwable.getMessage()); ToastUtils.showShort(throwable.getMessage());
}); });
...@@ -42,10 +45,12 @@ public class ReplenishmentPresenter extends ReplenishmentContract.Presenter { ...@@ -42,10 +45,12 @@ public class ReplenishmentPresenter extends ReplenishmentContract.Presenter {
@Override @Override
public void queryPsbList() { public void queryPsbList() {
mView.isShowLoading(true);
unConfirmedPsbList.clear(); unConfirmedPsbList.clear();
unReceivePsbList.clear(); unReceivePsbList.clear();
finishedPsbList.clear(); finishedPsbList.clear();
ApiFactory.Psb.queryPsb(1, 200).doFinally(() -> { ApiFactory.Psb.queryPsb(1, 200).doFinally(() -> {
mView.isShowLoading(false);
}) })
.subscribe(psbPager -> { .subscribe(psbPager -> {
...@@ -82,11 +87,7 @@ public class ReplenishmentPresenter extends ReplenishmentContract.Presenter { ...@@ -82,11 +87,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());
......
//package com.xingdata.zzdpos.ui.manage.replenishment.adpter; package com.xingdata.zzdpos.ui.manage.replenishment.adpter;
//
//
//import android.support.annotation.Nullable; import android.support.annotation.Nullable;
//import android.support.v4.content.ContextCompat; import android.support.v4.content.ContextCompat;
//import android.text.Editable; import android.text.Editable;
//import android.text.TextWatcher; import android.text.TextWatcher;
//import android.view.View; import android.view.View;
//import android.view.ViewGroup; import android.view.ViewGroup;
//import android.widget.EditText; import android.widget.EditText;
//
//
//import com.xingdata.zzdpos.R; import com.xingdata.zzdpos.R;
//import com.xingdata.zzdpos.model.Sssku; import com.xingdata.zzdpos.base.BaseAdapter;
//import com.xingdata.zzdpos.util.ConvertUtil; import com.xingdata.zzdpos.base.BaseViewHolder;
// import com.xingdata.zzdpos.databinding.ItemReplenishmentDetailBinding;
//import java.util.List; import com.xingdata.zzdpos.model.Sssku;
// import com.xingdata.zzdpos.util.ConvertUtil;
//public class ReplenishmentDetailAdapter extends BaseAdapter<Sssku, ItemReplenishmentDetailBinding> {
// private Boolean isTouch = true; import java.util.List;
// private UpdatePriceListener mUpdatePriceListener;
// public class ReplenishmentDetailAdapter extends BaseAdapter<Sssku, ItemReplenishmentDetailBinding> {
// public ReplenishmentDetailAdapter(@Nullable List<Sssku> data, boolean Touch) { private Boolean isTouch = true;
// super(R.layout.item_replenishment_detail, data); private UpdatePriceListener mUpdatePriceListener;
// isTouch = Touch;
// public ReplenishmentDetailAdapter(@Nullable List<Sssku> data, boolean Touch) {
// } super(R.layout.item_replenishment_detail, data);
// isTouch = Touch;
//
// @Override }
// protected void convert(ItemReplenishmentDetailBinding mViewBinding, Sssku item) {
// mViewBinding.imgGoods.setImageURI(item.getSpuImg());
// mViewBinding.tvGoodsName.setText(item.getSpuName()); @Override
// mViewBinding.tvGoodsCode.setText(item.getSpuBarcode() + ""); protected void convert(ItemReplenishmentDetailBinding mViewBinding, Sssku item) {
// mViewBinding.tvGoodsSize.setText("规格/" + item.getSpuUnitName()); mViewBinding.imgGoods.setImageURI(item.getSpuImg());
// mViewBinding.tvGoodsPrice.setText(ConvertUtil.fenToYuan(item.getSkuCost(), false)); mViewBinding.tvGoodsName.setText(item.getSpuName());
// mViewBinding.tvStock.setText(item.getSkuStock() + ""); mViewBinding.tvGoodsCode.setText(item.getSpuBarcode() + "");
// if (item.getSkuCnt() != null) { mViewBinding.tvGoodsSize.setText("规格/" + item.getSpuUnitName());
// mViewBinding.etCount.setText(item.getSkuCnt() + ""); mViewBinding.tvGoodsPrice.setText(ConvertUtil.fenToYuan(item.getSkuCost(), false));
// } else { mViewBinding.tvStock.setText(item.getSkuStock() + "");
// item.setSkuCnt(1); if (item.getSkuCnt() != null) {
// } mViewBinding.etCount.setText(item.getSkuCnt() + "");
// } else {
// if (!isTouch) { item.setSkuCnt(1);
// mViewBinding.etCount.setEnabled(false); }
// mViewBinding.etCount.setTextColor(ContextCompat.getColor(mContext,R.color.white_cargo));
// mViewBinding.btnDown.setVisibility(View.GONE); if (!isTouch) {
// mViewBinding.btnUp.setVisibility(View.GONE); mViewBinding.etCount.setEnabled(false);
// } mViewBinding.etCount.setTextColor(ContextCompat.getColor(mContext, R.color.white_cargo));
// } mViewBinding.btnDown.setVisibility(View.GONE);
// mViewBinding.btnUp.setVisibility(View.GONE);
// }
// @Override }
// protected void convert(BaseViewHolder helper, Sssku item) {
//
// if (isTouch) { @Override
// helper.getView(R.id.btn_up).setOnClickListener(v -> { protected void convert(BaseViewHolder helper, Sssku item) {
// Integer sellCount = item.getSkuCnt();
// if (sellCount >= 0 && sellCount < 9999) { if (isTouch) {
// helper.setText(R.id.et_count, String.valueOf(++sellCount)); helper.getView(R.id.btn_up).setOnClickListener(v -> {
// item.setSkuCnt(sellCount); Integer sellCount = item.getSkuCnt();
//// mUpdatePriceListener.updatePrice(1L*(item.getSkuCost())); if (sellCount >= 0 && sellCount < 9999) {
// } helper.setText(R.id.et_count, String.valueOf(++sellCount));
// }); item.setSkuCnt(sellCount);
// helper.getView(R.id.btn_down).setOnClickListener(v -> { // mUpdatePriceListener.updatePrice(1L*(item.getSkuCost()));
// Integer sellCount = item.getSkuCnt(); }
// if (sellCount == 1) { });
// return; helper.getView(R.id.btn_down).setOnClickListener(v -> {
// } Integer sellCount = item.getSkuCnt();
// if (sellCount > 1 && sellCount <= 9999) { if (sellCount == 1) {
// helper.setText(R.id.et_count, String.valueOf(--sellCount)); return;
// item.setSkuCnt(sellCount); }
//// mUpdatePriceListener.updatePrice(-1L*(item.getSkuCost())); if (sellCount > 1 && sellCount <= 9999) {
// helper.setText(R.id.et_count, String.valueOf(--sellCount));
// } item.setSkuCnt(sellCount);
// }); // mUpdatePriceListener.updatePrice(-1L*(item.getSkuCost()));
// ((EditText) helper.getView(R.id.et_count)).addTextChangedListener((new TextWatcher() {
// }
// @Override });
// public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) { ((EditText) helper.getView(R.id.et_count)).addTextChangedListener((new TextWatcher() {
//
// } @Override
// public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {
// @Override
// public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) { }
// Integer sellCount = ((EditText) helper.getView(R.id.et_count)).getText().toString().length() == 0 ? 1 : Integer.valueOf(((EditText) helper.getView(R.id.et_count)).getText().toString());
// if (sellCount==0){ @Override
// sellCount=1; public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
// helper.setText(R.id.et_count,""); Integer sellCount = ((EditText) helper.getView(R.id.et_count)).getText().toString().length() == 0 ? 1 : Integer.valueOf(((EditText) helper.getView(R.id.et_count)).getText().toString());
// if (sellCount == 0) {
// } sellCount = 1;
// Integer changedNum = sellCount - item.getSkuCnt(); helper.setText(R.id.et_count, "");
// item.setSkuCnt(sellCount);
// mUpdatePriceListener.updatePrice(item.getSkuCost() * changedNum); }
// } Integer changedNum = sellCount - item.getSkuCnt();
// item.setSkuCnt(sellCount);
// @Override mUpdatePriceListener.updatePrice(item.getSkuCost() * changedNum);
// public void afterTextChanged(Editable editable) { }
// }
// @Override
// public void afterTextChanged(Editable editable) {
// })); }
// }
// super.convert(helper, item);
// } }));
// }
// @Override super.convert(helper, item);
// protected View getItemView(int layoutResId, ViewGroup parent) { }
// return super.getItemView(layoutResId, parent);
// }
//
// public void setmUpdatePriceListener(UpdatePriceListener updatePriceListener) {
// public void setmUpdatePriceListener(UpdatePriceListener updatePriceListener) { this.mUpdatePriceListener = updatePriceListener;
// this.mUpdatePriceListener = updatePriceListener; }
// }
//
// public abstract static class UpdatePriceListener {
// public abstract static class UpdatePriceListener {
// public abstract void updatePrice(long amt);
// public abstract void updatePrice(long amt); }
// }
// }
//}
//package com.xingdata.zzdpos.ui.manage.replenishment.fragment; 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.support.v7.widget.LinearLayoutManager; import android.renderscript.ScriptGroup;
//import android.view.KeyEvent; import android.support.v7.widget.LinearLayoutManager;
//import android.view.View; import android.text.InputType;
//import android.widget.TextView; import android.view.KeyEvent;
// import android.view.View;
//import com.blankj.utilcode.util.KeyboardUtils; import android.widget.TextView;
//import com.blankj.utilcode.util.TimeUtils;
//import com.blankj.utilcode.util.ToastUtils; import com.blankj.utilcode.util.KeyboardUtils;
//import com.xingdata.api.print.ZX_PrintPOS; import com.blankj.utilcode.util.TimeUtils;
//import com.xingdata.zzdhd.R; import com.blankj.utilcode.util.ToastUtils;
//import com.xingdata.zzdhd.base.BaseActivity; import com.xingdata.api.print.ZX_PrintPOS;
//import com.xingdata.zzdhd.base.BaseFragment; import com.xingdata.zzdpos.R;
//import com.xingdata.zzdhd.databinding.FragmentReplenishementDetailBinding; import com.xingdata.zzdpos.base.BaseActivity;
//import com.xingdata.zzdhd.model.Psb; import com.xingdata.zzdpos.base.BaseFragment;
//import com.xingdata.zzdhd.model.Sssku; import com.xingdata.zzdpos.databinding.FragmentReplenishementDetailBinding;
//import com.xingdata.zzdhd.ui.dialog.PromptDialog; import com.xingdata.zzdpos.model.Psb;
//import com.xingdata.zzdhd.ui.login.LoginPresenter; import com.xingdata.zzdpos.model.Sssku;
//import com.xingdata.zzdhd.ui.manager.replenishment.ReplenishmentPresenter; import com.xingdata.zzdpos.ui.dialog.PromptDialog;
//import com.xingdata.zzdhd.ui.manager.replenishment.adpter.ReplenishmentDetailAdapter; import com.xingdata.zzdpos.ui.login.LoginPresenter;
//import com.xingdata.zzdhd.util.ConvertUtil; import com.xingdata.zzdpos.ui.manage.replenishment.ReplenishmentPresenter;
//import com.xingdata.zzdhd.util.OnClickListener; import com.xingdata.zzdpos.ui.manage.replenishment.adpter.ReplenishmentDetailAdapter;
// import com.xingdata.zzdpos.util.ConvertUtil;
//import java.util.ArrayList; import com.xingdata.zzdpos.util.OnClickListener;
//import java.util.List;
//import java.util.regex.Matcher;
//import java.util.regex.Pattern; import java.util.ArrayList;
// import java.util.List;
// import java.util.regex.Matcher;
///** import java.util.regex.Pattern;
// * Created by Administrator on 2017/11/24.
// */
// /**
//public class ReplenishmentDetailFragment extends BaseFragment<ReplenishmentPresenter, FragmentReplenishementDetailBinding> { * Created by Administrator on 2017/11/24.
// */
// private ReplenishmentDetailAdapter mReplenishmentDetailAdapter;
// private List<Sssku> ssskuList = new ArrayList<>(); public class ReplenishmentDetailFragment extends BaseFragment<ReplenishmentPresenter, FragmentReplenishementDetailBinding> {
// private Psb mPsb;
// private long sumPrice; private ReplenishmentDetailAdapter mReplenishmentDetailAdapter;
// private boolean isAdd = true; private List<Sssku> ssskuList = new ArrayList<>();
// private Psb mPsb;
// @Override private long sumPrice;
// public int getLayoutId() { private boolean isAdd = true;
// return R.layout.fragment_replenishement_detail;
// } @Override
// public int getLayoutId() {
// @Override return R.layout.fragment_replenishement_detail;
// public void initView() { }
//
// initRecycycler(); @Override
// mViewBinding.btnSearch.setOnClickListener(view -> { public void initView() {
// scrollToItem(mViewBinding.etKeyword.getText().toString().trim()); mViewBinding.lyTitle.edTitle.setHint(R.string.inventory_add_et_hint);
// }); mViewBinding.lyTitle.edTitle.setText("");
// mViewBinding.etKeyword.setOnKeyListener((v, keyCode, event) -> { Drawable drawableTop = getResources().getDrawable(R.mipmap.but_up);
// if (keyCode == KeyEvent.KEYCODE_ENTER) Drawable drawableBottom = getResources().getDrawable(R.mipmap.but_unfurled);
// scrollToItem(mViewBinding.etKeyword.getText().toString().trim()); drawableTop.setBounds(0, 0, (int) mViewBinding.tvShopTitle.getTextSize() - 10, (int) mViewBinding.tvShopTitle.getTextSize() - 10);
// return false; drawableBottom.setBounds(0, 0, (int) mViewBinding.tvShopTitle.getTextSize() - 10, (int) mViewBinding.tvShopTitle.getTextSize() - 10);
// }); mViewBinding.tvShopTitle.setCompoundDrawables(null, null, drawableTop, null);
// mViewBinding.btnCanel.setOnClickListener(view -> { mViewBinding.tvSupplierTitle.setCompoundDrawables(null, null, drawableTop, null);
// this.pop(); initRecycycler();
// }); mViewBinding.tvShopTitle.setOnClickListener(new OnClickListener() {
// @Override
// mViewBinding.btnEnd.setOnClickListener(view -> { protected void myOnClickListener(View v) {
// if (mPsb == null || mPsb.getPsbStatus() == null) { if (mViewBinding.llShop.getVisibility() != View.VISIBLE) {
// Psb psb = new Psb(); mViewBinding.llShop.setVisibility(View.VISIBLE);
// psb.setPsbType("0"); mViewBinding.tvShopTitle.setCompoundDrawables(null, null, drawableBottom, null);
// psb.setSsskuList(mReplenishmentDetailAdapter.getData()); } else {
// mPresenter.clickReplenishmentSubmit(psb); mViewBinding.llShop.setVisibility(View.GONE);
// } else { mViewBinding.tvShopTitle.setCompoundDrawables(null, null, drawableTop, null);
// switch (mPsb.getPsbStatus()) { }
// case 3: }
// mPsb.setPsbdetailList(mReplenishmentDetailAdapter.getData()); });
// mPresenter.clickReplenishmentUpdate(mPsb); mViewBinding.tvSupplierTitle.setOnClickListener(new OnClickListener() {
// break; @Override
// case 1: protected void myOnClickListener(View v) {
// mPresenter.clickReplenishmentConfirm(mPsb.getPsbNo()); if (mViewBinding.llSupplier.getVisibility() != View.VISIBLE) {
// break; mViewBinding.llSupplier.setVisibility(View.VISIBLE);
// } mViewBinding.tvSupplierTitle.setCompoundDrawables(null, null, drawableBottom, null);
// } } else {
// }); mViewBinding.llSupplier.setVisibility(View.GONE);
// mViewBinding.btnPrint.setOnClickListener(new OnClickListener() { mViewBinding.tvSupplierTitle.setCompoundDrawables(null, null, drawableTop, null);
// @Override }
// protected void myOnClickListener(View v) { }
// ZX_PrintPOS.getInstance(mContext).printOrder(1, mPsb); });
// } mViewBinding.lyTitle.ivRight.setVisibility(View.GONE);
// }); mViewBinding.lyTitle.edTitle.setOnKeyListener((v, keyCode, event) -> {
// } if (keyCode == KeyEvent.KEYCODE_ENTER)
// scrollToItem(mViewBinding.lyTitle.edTitle.getText().toString().trim());
// private void initRecycycler() { return false;
// mViewBinding.replenishmentRightRecycler.setLayoutManager(new LinearLayoutManager(getActivity())); });
// if (mPsb != null && mPsb.getPsbStatus() != null) { mViewBinding.lyTitle.ivBack.setOnClickListener(view -> {
// switch (mPsb.getPsbStatus()) { this.pop();
// case 3: });
// mReplenishmentDetailAdapter = new ReplenishmentDetailAdapter(ssskuList, true);
// break; mViewBinding.btnOk.setOnClickListener(view -> {
// case 1: if (mPsb == null || mPsb.getPsbStatus() == null) {
// mReplenishmentDetailAdapter = new ReplenishmentDetailAdapter(ssskuList, true); Psb psb = new Psb();
// break; psb.setPsbType("0");
// case 0: psb.setSsskuList(mReplenishmentDetailAdapter.getData());
// mReplenishmentDetailAdapter = new ReplenishmentDetailAdapter(ssskuList, false); mPresenter.clickReplenishmentSubmit(psb);
// break; } else {
// default: switch (mPsb.getPsbStatus()) {
// mReplenishmentDetailAdapter = new ReplenishmentDetailAdapter(ssskuList, true); case 3:
// break; mPsb.setPsbdetailList(mReplenishmentDetailAdapter.getData());
// } mPresenter.clickReplenishmentUpdate(mPsb);
// } else { break;
// mReplenishmentDetailAdapter = new ReplenishmentDetailAdapter(ssskuList, true); case 1:
// } mPresenter.clickReplenishmentConfirm(mPsb.getPsbNo());
// mReplenishmentDetailAdapter.setEmptyView(getEmptyView()); break;
// mViewBinding.replenishmentRightRecycler.setAdapter(mReplenishmentDetailAdapter); }
// mReplenishmentDetailAdapter.setOnItemLongClickListener((adapter, view, position) -> { }
// PromptDialog delDialog = new PromptDialog(); });
// delDialog.setDialogType(PromptDialog.PROMPTDIALOG_SELECT, "是否删除").setClick(new View.OnClickListener() { mViewBinding.btnCancel.setOnClickListener(new OnClickListener() {
// @Override @Override
// public void onClick(View view) { protected void myOnClickListener(View v) {
// mReplenishmentDetailAdapter.getData().remove(position); pop();
// mReplenishmentDetailAdapter.notifyDataSetChanged(); }
// delDialog.dismiss(); });
// } }
// }, new View.OnClickListener() {
// @Override //
// public void onClick(View view) { private void initRecycycler() {
// delDialog.dismiss(); mViewBinding.recyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
// } if (mPsb != null && mPsb.getPsbStatus() != null) {
// }).setCancelables(false).show((BaseActivity) mContext); switch (mPsb.getPsbStatus()) {
// return false; case 3:
// }); mReplenishmentDetailAdapter = new ReplenishmentDetailAdapter(ssskuList, true);
// mReplenishmentDetailAdapter.setmUpdatePriceListener(new ReplenishmentDetailAdapter.UpdatePriceListener() { break;
// @Override case 1:
// public void updatePrice(long amt) { mReplenishmentDetailAdapter = new ReplenishmentDetailAdapter(ssskuList, true);
// sumPrice = sumPrice + amt; break;
// mViewBinding.setFinallyPrice(ConvertUtil.fenToYuan(sumPrice, true)); case 0:
// } mReplenishmentDetailAdapter = new ReplenishmentDetailAdapter(ssskuList, false);
// }); break;
// initData(); default:
// } mReplenishmentDetailAdapter = new ReplenishmentDetailAdapter(ssskuList, true);
// break;
// private void initData() { }
// if (isAdd) { } else {
// mViewBinding.setIsShowSupplier(false); mReplenishmentDetailAdapter = new ReplenishmentDetailAdapter(ssskuList, true);
// } else { }
// mViewBinding.setIsShowSupplier(true); mReplenishmentDetailAdapter.setEmptyView(getEmptyView());
// mViewBinding.setSupplierName(mPsb.getOutChannelNameabcn()); mViewBinding.recyclerView.setAdapter(mReplenishmentDetailAdapter);
// mViewBinding.setSupplierAddress(mPsb.getOutCityProvName() + mPsb.getOutCityName() + mPsb.getOutCityCountyName() + mPsb.getOutCityAddress()); mReplenishmentDetailAdapter.setOnItemLongClickListener((adapter, view, position) -> {
// mViewBinding.setSupplierTel(mPsb.getOutContactMob()); PromptDialog delDialog = new PromptDialog();
// mViewBinding.setDate(TimeUtils.millis2String(mPsb.getCreateTime())); delDialog.setDialogType(PromptDialog.PROMPTDIALOG_SELECT, "是否删除").setClick(new View.OnClickListener() {
// mViewBinding.setNo(mPsb.getPsbNo()); @Override
// } public void onClick(View view) {
// if (this.ssskuList.size() != 0) { mReplenishmentDetailAdapter.getData().remove(position);
// mViewBinding.setSumNum(ssskuList.size() + "种"); mReplenishmentDetailAdapter.notifyDataSetChanged();
// mViewBinding.setFinallyPrice(ConvertUtil.fenToYuan(getSumPrice(), true)); delDialog.dismiss();
// } else { }
// mViewBinding.setSumNum("0个"); }, new View.OnClickListener() {
// mViewBinding.setFinallyPrice("¥0.00"); @Override
// } public void onClick(View view) {
// mViewBinding.setShopOderName(LoginPresenter.loginReturnBean.getOperName()); delDialog.dismiss();
// mViewBinding.setShopName(LoginPresenter.loginReturnBean.getShopNameAbcn()); }
// mViewBinding.setShopAddress(LoginPresenter.loginReturnBean.getCityProvName() + LoginPresenter.loginReturnBean.getCityName() + LoginPresenter.loginReturnBean.getCityCountyName() + LoginPresenter.loginReturnBean.getCityAddress()); }).setCancelables(false).show((BaseActivity) mContext);
// mViewBinding.setShopTel(LoginPresenter.loginReturnBean.getContactTel()); return false;
// });
// if (mPsb != null && mPsb.getPsbStatus() != null) { mReplenishmentDetailAdapter.setmUpdatePriceListener(new ReplenishmentDetailAdapter.UpdatePriceListener() {
// switch (mPsb.getPsbStatus()) { @Override
// case 3: public void updatePrice(long amt) {
// mViewBinding.btnEnd.setText("修改订单"); sumPrice = sumPrice + amt;
// mViewBinding.btnPrint.setVisibility(View.VISIBLE); mViewBinding.setFinallyPrice(ConvertUtil.fenToYuan(sumPrice, true));
// break; }
// case 1: });
// mViewBinding.btnEnd.setText("确认收货"); initData();
// mViewBinding.btnPrint.setVisibility(View.VISIBLE); }
// break;
// case 0: private void initData() {
// mViewBinding.btnEnd.setVisibility(View.GONE); if (isAdd) {
// mViewBinding.btnPrint.setVisibility(View.VISIBLE); mViewBinding.setIsShowSupplier(false);
// break; } else {
// default: mViewBinding.setIsShowSupplier(true);
// break; mViewBinding.setSupplierName(mPsb.getOutChannelNameabcn());
// } mViewBinding.setSupplierAddress(mPsb.getOutCityProvName() + mPsb.getOutCityName() + mPsb.getOutCityCountyName() + mPsb.getOutCityAddress());
// } mViewBinding.setSupplierTel(mPsb.getOutContactMob());
// mViewBinding.setDate(TimeUtils.millis2String(mPsb.getCreateTime()));
// } mViewBinding.setNo(mPsb.getPsbNo());
// }
// public long getSumPrice() { if (this.ssskuList.size() != 0) {
// sumPrice = 0; mViewBinding.setSumNum(ssskuList.size() + "种");
// for (Sssku sssku : mReplenishmentDetailAdapter.getData()) { mViewBinding.setFinallyPrice(ConvertUtil.fenToYuan(getSumPrice(), true));
// sumPrice = sumPrice + sssku.getSellSumAmt(); } else {
// } mViewBinding.setSumNum("0个");
// return sumPrice; mViewBinding.setFinallyPrice("¥0.00");
// } }
// mViewBinding.setShopOderName(LoginPresenter.loginReturnBean.getOperName());
// mViewBinding.setShopName(LoginPresenter.loginReturnBean.getShopNameAbcn());
// public void setSsskuList(List<Sssku> ssskuList) { mViewBinding.setShopAddress(LoginPresenter.loginReturnBean.getCityProvName() + LoginPresenter.loginReturnBean.getCityName() + LoginPresenter.loginReturnBean.getCityCountyName() + LoginPresenter.loginReturnBean.getCityAddress());
// this.ssskuList = ssskuList; mViewBinding.setShopTel(LoginPresenter.loginReturnBean.getContactTel());
// isAdd = true;
// this.mPsb = null; if (mPsb != null && mPsb.getPsbStatus() != null) {
// } switch (mPsb.getPsbStatus()) {
// case 3:
// public void setPsb(Psb psb) { mViewBinding.btnOk.setText("修改订单");
// this.mPsb = psb;
// this.ssskuList = psb.getSsskuList(); break;
// isAdd = false; case 1:
// } mViewBinding.btnOk.setText("确认收货");
//
// break;
// @Override case 0:
// public void onDestroy() { mViewBinding.llBottom.setVisibility(View.GONE);
// mPresenter.isAllowFragment(true);
// super.onDestroy(); break;
// } default:
// break;
// /** }
// * 获取空页面 }
// *
// * }
// * @return 空页面
// */ public long getSumPrice() {
// protected View getEmptyView() { sumPrice = 0;
// @SuppressLint("InflateParams") View view = getLayoutInflater().inflate(R.layout.view_empty, null); for (Sssku sssku : mReplenishmentDetailAdapter.getData()) {
// Drawable drawable=getResources().getDrawable(R.mipmap.bg_no_null); sumPrice = sumPrice + sssku.getSellSumAmt();
// drawable.setBounds(0,0,200,200); }
// return sumPrice;
// TextView textView=((TextView) view.findViewById(R.id.tv_empty)); }
// textView.setCompoundDrawablesRelative(null,drawable,null,null);
// textView.setText(R.string.replenishment_detail_full);
// textView.setTextColor(getResources().getColor(R.color.black)); public void setSsskuList(List<Sssku> ssskuList) {
// return view; this.ssskuList = ssskuList;
// } isAdd = true;
// private void scrollToItem(String string) { this.mPsb = null;
// }
// if (string.length() == 0) {
// ToastUtils.showShort("请输入搜索内容"); public void setPsb(Psb psb) {
// return; this.mPsb = psb;
// } this.ssskuList = psb.getSsskuList();
// Pattern pattern = Pattern.compile(string, Pattern.CASE_INSENSITIVE); isAdd = false;
// }
// for (int i = 0; i < mReplenishmentDetailAdapter.getData().size(); i++) {
// Matcher matcher = pattern.matcher((mReplenishmentDetailAdapter.getData().get(i)).getSpuBarcode() + "");
// if (matcher.find()) { @Override
// ((LinearLayoutManager) mViewBinding.replenishmentRightRecycler.getLayoutManager()).scrollToPositionWithOffset(i, 0); public void onDestroy() {
// ToastUtils.showShort("已找到商品:" + mReplenishmentDetailAdapter.getData().get(i).getSpuName()); mPresenter.isAllowFragment(true);
// KeyboardUtils.hideSoftInput(getActivity()); super.onDestroy();
// return; }
// }
// matcher = pattern.matcher((mReplenishmentDetailAdapter.getData().get(i)).getSpuAb() + ""); /**
// if (matcher.find()) { * 获取空页面
// ((LinearLayoutManager) mViewBinding.replenishmentRightRecycler.getLayoutManager()).scrollToPositionWithOffset(i, 0); *
// ToastUtils.showShort("已找到商品:" + mReplenishmentDetailAdapter.getData().get(i).getSpuName()); * @return 空页面
// KeyboardUtils.hideSoftInput(getActivity()); */
// return; protected View getEmptyView() {
// } @SuppressLint("InflateParams") View view = getLayoutInflater().inflate(R.layout.view_empty, null);
// matcher = pattern.matcher((mReplenishmentDetailAdapter.getData().get(i)).getSpuName() + ""); TextView textView = ((TextView) view.findViewById(R.id.tv_empty));
// if (matcher.find()) { textView.setText(R.string.replenishment_detail_full);
// ((LinearLayoutManager) mViewBinding.replenishmentRightRecycler.getLayoutManager()).scrollToPositionWithOffset(i, 0); textView.setTextColor(getResources().getColor(R.color.black));
// ToastUtils.showShort("已找到商品:" + mReplenishmentDetailAdapter.getData().get(i).getSpuName()); return view;
// KeyboardUtils.hideSoftInput(getActivity()); }
// return;
// } private void scrollToItem(String string) {
// }
// if (string.length() == 0) {
// ToastUtils.showShort("没有找到相关货品"); ToastUtils.showShort("请输入搜索内容");
// } return;
//} }
Pattern pattern = Pattern.compile(string, Pattern.CASE_INSENSITIVE);
for (int i = 0; i < mReplenishmentDetailAdapter.getData().size(); i++) {
Matcher matcher = pattern.matcher((mReplenishmentDetailAdapter.getData().get(i)).getSpuBarcode() + "");
if (matcher.find()) {
((LinearLayoutManager) mViewBinding.recyclerView.getLayoutManager()).scrollToPositionWithOffset(i, 0);
ToastUtils.showShort("已找到商品:" + mReplenishmentDetailAdapter.getData().get(i).getSpuName());
KeyboardUtils.hideSoftInput(getActivity());
return;
}
matcher = pattern.matcher((mReplenishmentDetailAdapter.getData().get(i)).getSpuAb() + "");
if (matcher.find()) {
((LinearLayoutManager) mViewBinding.recyclerView.getLayoutManager()).scrollToPositionWithOffset(i, 0);
ToastUtils.showShort("已找到商品:" + mReplenishmentDetailAdapter.getData().get(i).getSpuName());
KeyboardUtils.hideSoftInput(getActivity());
return;
}
matcher = pattern.matcher((mReplenishmentDetailAdapter.getData().get(i)).getSpuName() + "");
if (matcher.find()) {
((LinearLayoutManager) mViewBinding.recyclerView.getLayoutManager()).scrollToPositionWithOffset(i, 0);
ToastUtils.showShort("已找到商品:" + mReplenishmentDetailAdapter.getData().get(i).getSpuName());
KeyboardUtils.hideSoftInput(getActivity());
return;
}
}
ToastUtils.showShort("没有找到相关货品");
}
}
...@@ -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;
...@@ -19,6 +20,7 @@ import com.xingdata.zzdpos.ui.dialog.LoadingDialog; ...@@ -19,6 +20,7 @@ import com.xingdata.zzdpos.ui.dialog.LoadingDialog;
import com.xingdata.zzdpos.ui.main.adapter.FragmentViewAdapter; import com.xingdata.zzdpos.ui.main.adapter.FragmentViewAdapter;
import com.xingdata.zzdpos.ui.manage.replenishment.ReplenishmentPresenter; import com.xingdata.zzdpos.ui.manage.replenishment.ReplenishmentPresenter;
import com.xingdata.zzdpos.ui.manage.replenishment.adpter.ReplenishmentAdapter; import com.xingdata.zzdpos.ui.manage.replenishment.adpter.ReplenishmentAdapter;
import com.xingdata.zzdpos.util.OnClickListener;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
...@@ -39,6 +41,9 @@ public class ReplenishmentFragment extends BaseFragment<ReplenishmentPresenter, ...@@ -39,6 +41,9 @@ public class ReplenishmentFragment extends BaseFragment<ReplenishmentPresenter,
private int[] titleInts = {R.string.manage_replenishment_unConfirmed, R.string.manage_replenishment_unReceive, R.string.manage_replenishment_finished}; private int[] titleInts = {R.string.manage_replenishment_unConfirmed, R.string.manage_replenishment_unReceive, R.string.manage_replenishment_finished};
private FragmentViewAdapter mFragmentPagerAdapter; private FragmentViewAdapter mFragmentPagerAdapter;
private List<BaseFragment> fragments; private List<BaseFragment> fragments;
private List<Psb> psbA;
private List<Psb> psbB;
private List<Psb> psbC;
@Override @Override
...@@ -50,14 +55,26 @@ public class ReplenishmentFragment extends BaseFragment<ReplenishmentPresenter, ...@@ -50,14 +55,26 @@ public class ReplenishmentFragment extends BaseFragment<ReplenishmentPresenter,
public void initView() { public void initView() {
initData(); initData();
initTab(); initTab();
mPresenter.queryPsbList();
((ReplenishmentListFragment) fragments.get(0)).setData(psbA);
((ReplenishmentListFragment) fragments.get(1)).setData(psbB);
((ReplenishmentListFragment) fragments.get(2)).setData(psbC);
mViewBinding.btnAdd.setOnClickListener(view -> { mViewBinding.btnAdd.setOnClickListener(view -> {
mPresenter.clickAdd(); mPresenter.clickAdd();
}); });
mViewBinding.icTitle.ivRight.setImageResource(R.mipmap.but_sweep_yard); mViewBinding.icTitle.setOnClickListener(new OnClickListener() {
mViewBinding.icTitle.edTitle.setHint("请输入供货商名称"); @Override
protected void myOnClickListener(View v) {
getActivity().finish();
}
});
mViewBinding.icTitle.ivRight.setVisibility(View.GONE);
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("请输入供货商名称");
...@@ -143,10 +160,16 @@ public class ReplenishmentFragment extends BaseFragment<ReplenishmentPresenter, ...@@ -143,10 +160,16 @@ public class ReplenishmentFragment extends BaseFragment<ReplenishmentPresenter,
} }
public void showReplenishmentList(List<Psb> A, List<Psb> B, List<Psb> C) { public void showReplenishmentList(List<Psb> A, List<Psb> B, List<Psb> C,boolean isFrist) {
((ReplenishmentListFragment) fragments.get(0)).setData(A, true); if (isFrist){
((ReplenishmentListFragment) fragments.get(1)).setData(B, true); this.psbA = A;
((ReplenishmentListFragment) fragments.get(2)).setData(C, true); this.psbB = B;
this.psbC = C;
}else {
((ReplenishmentListFragment) fragments.get(0)).setData(psbA,true);
((ReplenishmentListFragment) fragments.get(1)).setData(psbB,true);
((ReplenishmentListFragment) fragments.get(2)).setData(psbC,true);
}
} }
......
...@@ -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,6 +33,7 @@ import java.util.regex.Pattern; ...@@ -32,6 +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() {
...@@ -41,7 +43,7 @@ public class ReplenishmentListFragment extends BaseFragment<ReplenishmentPresent ...@@ -41,7 +43,7 @@ public class ReplenishmentListFragment extends BaseFragment<ReplenishmentPresent
@Override @Override
public void initView() { public void initView() {
if (mReplenishmentAdapter == null) { if (mReplenishmentAdapter == null) {
mReplenishmentAdapter = new ReplenishmentAdapter(psbArrayList); mReplenishmentAdapter = new ReplenishmentAdapter(new ArrayList<>());
mViewBinding.recycler.setLayoutManager(new LinearLayoutManager(getActivity())); mViewBinding.recycler.setLayoutManager(new LinearLayoutManager(getActivity()));
mViewBinding.recycler.setAdapter(mReplenishmentAdapter); mViewBinding.recycler.setAdapter(mReplenishmentAdapter);
...@@ -51,17 +53,17 @@ public class ReplenishmentListFragment extends BaseFragment<ReplenishmentPresent ...@@ -51,17 +53,17 @@ 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);
setData(psbArrayList,true);
} }
private void onRefresh() { private void onRefresh() {
...@@ -83,10 +85,11 @@ public class ReplenishmentListFragment extends BaseFragment<ReplenishmentPresent ...@@ -83,10 +85,11 @@ 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) { if (mReplenishmentAdapter==null){
psbArrayList = psbList; this.psbArrayList=psbList;
return; return;
} }
if (isRefresh) { if (isRefresh) {
mReplenishmentAdapter.setEnableLoadMore(true); mReplenishmentAdapter.setEnableLoadMore(true);
mViewBinding.srlProduct.setRefreshing(false); mViewBinding.srlProduct.setRefreshing(false);
...@@ -103,9 +106,13 @@ public class ReplenishmentListFragment extends BaseFragment<ReplenishmentPresent ...@@ -103,9 +106,13 @@ public class ReplenishmentListFragment extends BaseFragment<ReplenishmentPresent
} }
public void setData(List<Psb> psbList){
this.psbArrayList=psbList;
}
public void searchSucc(String wd) { public void searchSucc(String wd) {
List<Psb> psbs = new ArrayList<>(); List<Psb> psbs = new ArrayList<>();
if (psbArrayList == null) { if (psbArrayList .size()==0) {
return; return;
} }
for (Psb psb : psbArrayList) { for (Psb psb : psbArrayList) {
...@@ -133,7 +140,7 @@ public class ReplenishmentListFragment extends BaseFragment<ReplenishmentPresent ...@@ -133,7 +140,7 @@ public class ReplenishmentListFragment extends BaseFragment<ReplenishmentPresent
} }
} }
}, 500); }, 300);
} }
} }
package com.xingdata.zzdpos.ui.manage.sssku;
import android.view.inputmethod.EditorInfo;
import com.blankj.utilcode.util.KeyboardUtils;
import com.blankj.utilcode.util.StringUtils;
import com.xingdata.zzdpos.C;
import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseActivity;
import com.xingdata.zzdpos.databinding.ActivitySsskuBinding;
import com.xingdata.zzdpos.model.Sskugrp;
import com.xingdata.zzdpos.model.Sssku;
import com.xingdata.zzdpos.ui.dialog.LoadingDialog;
import com.xingdata.zzdpos.ui.manage.sssku.fragment.DetailFragment;
import com.xingdata.zzdpos.ui.manage.sssku.fragment.EditorFragment;
import com.xingdata.zzdpos.ui.manage.sssku.fragment.ManagerFragment;
import com.xingdata.zzdpos.ui.manage.sssku.fragment.SearchFragment;
import com.xingdata.zzdpos.ui.manage.sssku.fragment.SkugrpFragment;
import java.util.List;
public class SsskuActivity extends BaseActivity<SsskuPresenter, ActivitySsskuBinding> implements SsskuContract.View {
private ManagerFragment mManagerFragment = new ManagerFragment();
private SearchFragment mSearchFragment = new SearchFragment();
private SkugrpFragment mSkugrpFragment = new SkugrpFragment();
private EditorFragment mEditorFragment = new EditorFragment();
private DetailFragment mDetailFragment = new DetailFragment();
private LoadingDialog mLoadingDialog = new LoadingDialog();
@Override
public int getLayoutId() {
return R.layout.activity_sssku;
}
@Override
public void initView() {
this.showTitleBarByTitleMode(C.TITLE_MODE.SKU);
this.loadRootFragment(R.id.f_sssku, mManagerFragment);
mViewBinding.btnBack.setOnClickListener(view -> {
getTopFragment().onBackPressedSupport();
});
mViewBinding.etSearch.setOnEditorActionListener((textView, i, keyEvent) -> {
if (i == EditorInfo.IME_ACTION_SEARCH && !StringUtils.isEmpty(textView.getText())) {
KeyboardUtils.hideSoftInput(textView);
mPresenter.searchSku(textView.getText().toString());
}
return false;
});
mViewBinding.etSearch.setOnFocusChangeListener((view, b) -> {
mPresenter.searchBarFocusChanged(b);
});
}
@Override
public void loadSkus(List<Sssku> skus, boolean isRefresh) {
mManagerFragment.loadSkus(skus, isRefresh);
}
@Override
public void loadSkugrps(List<Sskugrp> sskugrps) {
mManagerFragment.loadSkugrps(sskugrps);
}
@Override
public void loadSkugrpState(Long skugrpId) {
mManagerFragment.loadSkugrpState(skugrpId);
}
@Override
public void loadReplenishCount(int count) {
mManagerFragment.loadReplenishCount(count);
}
@Override
public void loadSsskuCount(int count) {
mManagerFragment.loadSsskuCount(count);
}
@Override
public void loadSearchResult(List<Sssku> skus, boolean isRefresh) {
mSearchFragment.loadSkus(skus, isRefresh);
}
@Override
public void showSearchFragment(int searchType) {
if (mSearchFragment.isAdded()) return;
this.showTitleBarByTitleMode(searchType);
this.start(mSearchFragment.setSearchType(searchType));
}
@Override
public void showEditorFragment(Sssku sku) {
this.showTitleBarByTitleMode(C.TITLE_MODE.TEXT);
mViewBinding.tvTitle.setText(R.string.sssku_update);
this.start(mEditorFragment);
}
@Override
public void showEditorFragment() {
this.showTitleBarByTitleMode(C.TITLE_MODE.TEXT);
mViewBinding.tvTitle.setText(R.string.sssku_add);
this.start(mEditorFragment);
}
@Override
public void showDetailFragment(Sssku sku) {
this.showTitleBarByTitleMode(C.TITLE_MODE.SKU_DETAIL);
mViewBinding.tvTitle.setText(R.string.sssku_detail);
this.start(mDetailFragment);
}
@Override
public void showSkugrpFragment() {
this.showTitleBarByTitleMode(C.TITLE_MODE.TEXT);
mViewBinding.tvTitle.setText(R.string.sssku_skugrp);
this.start(mSkugrpFragment);
}
@Override
public void backToEditFragment() {
this.showTitleBarByTitleMode(C.TITLE_MODE.TEXT);
}
@Override
public void backToManagerFragment() {
this.showTitleBarByTitleMode(C.TITLE_MODE.SKU);
this.resetSearchBar();
}
@Override
public void showLoadingDialog() {
mLoadingDialog.show(this);
}
@Override
public void dismissLoadingDialog() {
mLoadingDialog.dismiss();
}
/**
* 根据titleMode显示TitleBar
*
* @param titleMode 标题模式
*/
private void showTitleBarByTitleMode(int titleMode) {
if (mViewBinding.getTitleMode() == titleMode) return;
mViewBinding.setTitleMode(titleMode);
mViewBinding.etSearch.setText("");
switch (titleMode) {
case C.TITLE_MODE.SKU:
mViewBinding.etSearch.setHint(R.string.sssku_search_hint);
break;
case C.TITLE_MODE.PKG:
mViewBinding.etSearch.setHint(R.string.sssku_search_hint);
break;
case C.TITLE_MODE.SKU_DETAIL:
break;
}
}
/**
* 重置搜索栏
*/
private void resetSearchBar() {
mViewBinding.etSearch.setText("");
mViewBinding.clTitle.requestFocus();
mViewBinding.clTitle.requestFocusFromTouch();
}
}
package com.xingdata.zzdpos.ui.manage.sssku;
import com.xingdata.zzdpos.base.BasePresenter;
import com.xingdata.zzdpos.base.BaseView;
import com.xingdata.zzdpos.model.Sskugrp;
import com.xingdata.zzdpos.model.Sssku;
import java.util.List;
public interface SsskuContract {
interface View extends BaseView {
/**
* 加载商品
*
* @param skus 商品列表
* @param isRefresh 是否刷新列表
*/
void loadSkus(List<Sssku> skus, boolean isRefresh);
/**
* 加载商品分组
*
* @param sskugrps 商品分组列表
*/
void loadSkugrps(List<Sskugrp> sskugrps);
/**
* 加载分组选中状态
*
* @param skugrpId 分组ID
*/
void loadSkugrpState(Long skugrpId);
/**
* 加载需要补货商品的数量
*
* @param count 数量
*/
void loadReplenishCount(int count);
/**
* 加载商品种类的总数
*/
void loadSsskuCount(int count);
/**
* 加载搜索结果
*
* @param skus 商品列表
* @param isRefresh 是否刷新列表
*/
void loadSearchResult(List<Sssku> skus, boolean isRefresh);
/**
* 显示搜索页面
*/
void showSearchFragment(int searchType);
/**
* 显示编辑页面
*
* @param sku 要编辑的商品
*/
void showEditorFragment(Sssku sku);
/**
* 显示编辑页面
*/
void showEditorFragment();
/**
* 显示详情页面
*
* @param sku 要显示的商品
*/
void showDetailFragment(Sssku sku);
/**
* 显示商品分组页面
*/
void showSkugrpFragment();
/**
* 返回编辑页面
*/
void backToEditFragment();
/**
* 返回管理页面
*/
void backToManagerFragment();
/**
* 显示读取对话框
*/
void showLoadingDialog();
/**
* 隐藏读取对话框
*/
void dismissLoadingDialog();
}
abstract class Presenter extends BasePresenter<View> {
/**
* 管理页面 - 初始化
*/
public abstract void initManager();
/**
* 管理页面 - 刷新商品
*/
public abstract void refreshSku();
/**
* 管理页面 - 加载更多商品
*/
public abstract void loadMoreSku();
/**
* 管理页面 - 点击商品
*
* @param sssku 商品信息
*/
public abstract void clickSku(Sssku sssku);
/**
* 管理页面 - 切换分组
*
* @param sskugrp 分组
*/
public abstract void clickSkugrp(Sskugrp sskugrp);
/**
* 管理页面 - 点击添加商品
*/
public abstract void clickAddSku();
/**
* 管理页面 - 点击添加分组
*/
public abstract void clickAddSkugrp();
/**
* 管理页面 - 点击一键补货
*/
public abstract void clickReplenish();
/**
* 搜索页面 - 点击搜索
*/
public abstract void searchSku(String keyword);
/**
* 搜索页面 - 加载更多搜索结果
*/
public abstract void loadMoreSearchResult();
/**
* 搜索页面 - 点击商品
*
* @param sssku 商品信息
* @param searchType 搜索类型
*/
public abstract void clickSku(Sssku sssku, int searchType);
/**
* 详情页面 - 编辑商品
*
* @param sssku 要编辑的商品
*/
public abstract void clickEditSku(Sssku sssku);
/**
* 分组页面 - 删除分组.
*
* @param sskugrp 要删除的分组
*/
public abstract void clickDeleteSkugrp(Sskugrp sskugrp);
/**
* 分组页面 - 编辑分组
*
* @param sskugrp 要编辑的分组
*/
public abstract void clickEditSkugrp(Sskugrp sskugrp);
/**
* 主页面 - 搜索框焦点改变
*
* @param b 获取焦点
*/
public abstract void searchBarFocusChanged(boolean b);
}
}
package com.xingdata.zzdpos.ui.manage.sssku;
import com.xingdata.zzdpos.C;
import com.xingdata.zzdpos.api.ApiFactory;
import com.xingdata.zzdpos.model.Sskugrp;
import com.xingdata.zzdpos.model.Sssku;
public class SsskuPresenter extends SsskuContract.Presenter {
private int mPageNum;
private Long mSkuGrpId;
private int mSearchPageNum;
private String mKeyword;
@Override
public void onAttached() {
}
@Override
public void initManager() {
this.getSkugrp();
this.getReplenish();
this.refreshSku();
}
@Override
public void refreshSku() {
this.mPageNum = 0;
this.mSkuGrpId = 0L;
mView.loadSkugrpState(mSkuGrpId);
this.getSku();
}
@Override
public void loadMoreSku() {
this.mPageNum++;
this.getSku();
}
@Override
public void clickSku(Sssku sssku) {
mView.showDetailFragment(sssku);
}
@Override
public void clickSkugrp(Sskugrp sskugrp) {
this.mPageNum = 0;
this.mSkuGrpId = sskugrp.getSkuGrpId();
mView.loadSkugrpState(mSkuGrpId);
this.getSku();
}
@Override
public void clickAddSku() {
mView.showEditorFragment();
}
@Override
public void clickAddSkugrp() {
mView.showSkugrpFragment();
}
@Override
public void clickReplenish() {
//TODO 跳转到补货界面
}
@Override
public void searchSku(String keyword) {
this.mSearchPageNum = 0;
this.mKeyword = keyword;
this.getSearchSku();
}
@Override
public void loadMoreSearchResult() {
this.mSearchPageNum++;
this.getSearchSku();
}
@Override
public void clickSku(Sssku sssku, int searchType) {
switch (searchType) {
case C.TITLE_MODE.SKU:
mView.showDetailFragment(sssku);
break;
case C.TITLE_MODE.PKG:
break;
}
}
@Override
public void clickEditSku(Sssku sssku) {
mView.showEditorFragment(sssku);
}
@Override
public void clickDeleteSkugrp(Sskugrp sskugrp) {
}
@Override
public void clickEditSkugrp(Sskugrp sskugrp) {
}
@Override
public void searchBarFocusChanged(boolean b) {
if (b) mView.showSearchFragment(C.TITLE_MODE.SKU);
}
/**
* 获取商品
*/
private void getSku() {
mView.showLoadingDialog();
mCompositeDisposable.add(
ApiFactory.Sssku.querySssku(mPageNum, "", mSkuGrpId)
.doOnSubscribe(subscription -> mView.dismissLoadingDialog())
.subscribe(ssskuPager -> {
if (mPageNum == 0) mView.loadSsskuCount(ssskuPager.getTotalRow());
mView.loadSkus(ssskuPager.getList(), mPageNum == 0);
})
);
}
/**
* 获取搜索商品
*/
private void getSearchSku() {
mView.showLoadingDialog();
mCompositeDisposable.add(
ApiFactory.Sssku.querySssku(mSearchPageNum, mKeyword)
.doOnSubscribe(subscription -> mView.dismissLoadingDialog())
.subscribe(ssskuPager -> mView.loadSearchResult(ssskuPager.getList(), mSearchPageNum == 0))
);
}
/**
* 获取分组
*/
private void getSkugrp() {
mCompositeDisposable.add(
ApiFactory.Sskugrp.querySskugrp().subscribe(sskugrpPager -> {
Sskugrp sskugrp = new Sskugrp();
sskugrp.setSkuGrpId(0L);
sskugrp.setSkuGrpName("全部分组");
sskugrp.setSelected(true);
sskugrpPager.getList().add(0, sskugrp);
mView.loadSkugrps(sskugrpPager.getList());
}
)
);
}
/**
* 获取补货信息
*/
private void getReplenish() {
mCompositeDisposable.add(
ApiFactory.Psb.preOrder().subscribe(ssskuPager -> mView.loadReplenishCount(ssskuPager.getTotalRow()))
);
}
}
package com.xingdata.zzdpos.ui.manage.sssku.adapter;
import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseAdapter;
import com.xingdata.zzdpos.databinding.ItemSsskuSkuBinding;
import com.xingdata.zzdpos.model.Sssku;
import com.xingdata.zzdpos.util.ConvertUtil;
import java.util.ArrayList;
public class SkuAdapter extends BaseAdapter<Sssku, ItemSsskuSkuBinding> {
public SkuAdapter() {
super(R.layout.item_sssku_sku, new ArrayList<>());
}
@Override
protected void convert(ItemSsskuSkuBinding mViewBinding, Sssku item) {
mViewBinding.ivPic.setImageURI(item.getSpuImg());
mViewBinding.tvAmt.setText(ConvertUtil.fenToYuan(item.getSkuRetailPrice1()));
mViewBinding.setSpuName(item.getSpuName());
mViewBinding.setSpuUnitName(item.getSpuUnitName());
}
}
package com.xingdata.zzdpos.ui.manage.sssku.adapter;
import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseSelectedAdapter;
import com.xingdata.zzdpos.base.BaseViewHolder;
import com.xingdata.zzdpos.databinding.ItemSelectorBinding;
import com.xingdata.zzdpos.model.Sskugrp;
import java.util.ArrayList;
public class SkugrpAdapter extends BaseSelectedAdapter<Sskugrp, ItemSelectorBinding> {
public SkugrpAdapter() {
super(R.layout.item_selector, new ArrayList<>(), false);
}
@Override
protected void convert(BaseViewHolder helper, ItemSelectorBinding mViewBinding, Sskugrp item) {
mViewBinding.setSelected(getSelectedPosition() == helper.getAdapterPosition());
mViewBinding.tvName.getPaint().setFakeBoldText(getSelectedPosition() == helper.getAdapterPosition());
mViewBinding.tvName.setText(item.getSkuGrpName());
}
}
package com.xingdata.zzdpos.ui.manage.sssku.dialog;
import android.view.View;
import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseDialog;
import com.xingdata.zzdpos.databinding.DialogSkugrpDeleteBinding;
import com.xingdata.zzdpos.model.Sskugrp;
import com.xingdata.zzdpos.ui.manage.sssku.SsskuPresenter;
public class SkugrpDeleteDialog extends BaseDialog<SsskuPresenter, DialogSkugrpDeleteBinding> {
private Sskugrp mSskugrp;
public SkugrpDeleteDialog setSskugrp(Sskugrp sskugrp) {
this.mSskugrp = sskugrp;
return this;
}
@Override
protected boolean isShowTitle() {
return false;
}
@Override
public int getLayoutId() {
return R.layout.dialog_skugrp_delete;
}
@Override
public void initView() {
}
@Override
public void onConfirmClick(View view) {
super.onConfirmClick(view);
mPresenter.clickDeleteSkugrp(mSskugrp);
}
}
package com.xingdata.zzdpos.ui.manage.sssku.dialog;
import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseDialog;
import com.xingdata.zzdpos.databinding.DialogSkugrpEditorBinding;
import com.xingdata.zzdpos.model.Sskugrp;
import com.xingdata.zzdpos.ui.manage.sssku.SsskuPresenter;
public class SkugrpEditorDialog extends BaseDialog<SsskuPresenter, DialogSkugrpEditorBinding> {
private Sskugrp mSskugrp;
public SkugrpEditorDialog setSskugrp(Sskugrp sskugrp) {
this.mSskugrp = sskugrp;
return this;
}
@Override
protected boolean isShowTitle() {
return false;
}
@Override
public int getLayoutId() {
return R.layout.dialog_skugrp_editor;
}
@Override
public void initView() {
}
}
package com.xingdata.zzdpos.ui.manage.sssku.dialog;
import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseSheetDialog;
import com.xingdata.zzdpos.databinding.DialogSkugrpMenuBinding;
import com.xingdata.zzdpos.model.Sskugrp;
import com.xingdata.zzdpos.ui.manage.sssku.SsskuPresenter;
public class SkugrpMenuDialog extends BaseSheetDialog<SsskuPresenter, DialogSkugrpMenuBinding> {
private Sskugrp mSskugrp;
public SkugrpMenuDialog setSskugrp(Sskugrp sskugrp) {
this.mSskugrp = sskugrp;
return this;
}
@Override
public int getLayoutId() {
return R.layout.dialog_skugrp_menu;
}
@Override
public void initView() {
}
}
package com.xingdata.zzdpos.ui.manage.sssku.fragment;
import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseFragment;
import com.xingdata.zzdpos.databinding.FragmentSsskuDetailBinding;
import com.xingdata.zzdpos.model.Sssku;
import com.xingdata.zzdpos.ui.manage.sssku.SsskuActivity;
import com.xingdata.zzdpos.ui.manage.sssku.SsskuPresenter;
public class DetailFragment extends BaseFragment<SsskuPresenter, FragmentSsskuDetailBinding> {
private Sssku mSssku;
@Override
public int getLayoutId() {
return R.layout.fragment_sssku_detail;
}
@Override
public void initView() {
mViewBinding.tvEdit.setOnClickListener(view -> {
this.pop();
mPresenter.clickEditSku(mSssku);
});
}
/**
* 设置商品
*
* @param sssku 商品信息
*/
public DetailFragment setSssku(Sssku sssku) {
this.mSssku = sssku;
return this;
}
@Override
public boolean onBackPressedSupport() {
((SsskuActivity) getActivity()).backToManagerFragment();
return super.onBackPressedSupport();
}
}
package com.xingdata.zzdpos.ui.manage.sssku.fragment;
import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseFragment;
import com.xingdata.zzdpos.databinding.FragmentSsskuEditorBinding;
import com.xingdata.zzdpos.model.Sssku;
import com.xingdata.zzdpos.ui.manage.sssku.SsskuActivity;
import com.xingdata.zzdpos.ui.manage.sssku.SsskuPresenter;
public class EditorFragment extends BaseFragment<SsskuPresenter, FragmentSsskuEditorBinding> {
private Sssku mSssku;
@Override
public int getLayoutId() {
return R.layout.fragment_sssku_editor;
}
@Override
public void initView() {
}
/**
* 设置商品
*
* @param sssku 商品信息
*/
public EditorFragment setSssku(Sssku sssku) {
this.mSssku = sssku;
return this;
}
@Override
public boolean onBackPressedSupport() {
((SsskuActivity) getActivity()).backToManagerFragment();
return super.onBackPressedSupport();
}
}
\ No newline at end of file
package com.xingdata.zzdpos.ui.manage.sssku.fragment;
import android.annotation.SuppressLint;
import android.support.v4.app.ActivityCompat;
import android.support.v7.widget.LinearLayoutManager;
import android.view.View;
import com.xingdata.zzdpos.C;
import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseFragment;
import com.xingdata.zzdpos.databinding.FragmentSsskuManagerBinding;
import com.xingdata.zzdpos.model.Sskugrp;
import com.xingdata.zzdpos.model.Sssku;
import com.xingdata.zzdpos.ui.manage.sssku.SsskuPresenter;
import com.xingdata.zzdpos.ui.manage.sssku.adapter.SkuAdapter;
import com.xingdata.zzdpos.ui.manage.sssku.adapter.SkugrpAdapter;
import java.util.List;
public class ManagerFragment extends BaseFragment<SsskuPresenter, FragmentSsskuManagerBinding> {
private SkuAdapter mSkuAdapter;
private SkugrpAdapter mSkugrpAdapter;
@Override
public int getLayoutId() {
return R.layout.fragment_sssku_manager;
}
@Override
public void initView() {
// init sku
mSkuAdapter = new SkuAdapter();
mViewBinding.rlSku.setAdapter(mSkuAdapter);
mViewBinding.rlSku.setLayoutManager(new LinearLayoutManager(mContext));
// init skugrp
mSkugrpAdapter = new SkugrpAdapter();
mViewBinding.rlSkugrp.setAdapter(mSkugrpAdapter);
mViewBinding.rlSkugrp.setLayoutManager(new LinearLayoutManager(mContext));
// set sku listener
mViewBinding.srlSku.setOnRefreshListener(this::refreshSku);
mSkuAdapter.setOnLoadMoreListener(this::loadMoreSku, mViewBinding.rlSku);
mSkuAdapter.setOnItemClickListener((adapter, view, position) -> mPresenter.clickSku(mSkuAdapter.getItem(position)));
// set grp listener
mSkugrpAdapter.setOnItemClickListener((adapter, view, position) -> mPresenter.clickSkugrp(mSkugrpAdapter.getData().get(position)));
// set other listener
mViewBinding.llSsskuAdd.setOnClickListener(view -> mPresenter.clickAddSku());
mViewBinding.tvReplenish.setOnClickListener(view -> mPresenter.clickReplenish());
mViewBinding.llSkugrpAdd.setOnClickListener(view -> mPresenter.clickAddSkugrp());
// set empty
@SuppressLint("InflateParams") View view = getLayoutInflater().inflate(R.layout.view_empty, null);
mSkuAdapter.setEmptyView(view);
mSkuAdapter.isUseEmpty(false);
// init data
mPresenter.initManager();
}
/**
* 加载商品
*
* @param skus 商品信息
* @param isRefresh 是否需要刷新
*/
public void loadSkus(List<Sssku> skus, boolean isRefresh) {
if (isRefresh) {
mSkuAdapter.isUseEmpty(true);
mSkuAdapter.setEnableLoadMore(true);
mViewBinding.srlSku.setRefreshing(false);
mSkuAdapter.setNewData(skus);
} else if (skus.size() > 0) mSkuAdapter.addData(skus);
if (skus.size() < C.PRODUCT.PAGE_SIZE) mSkuAdapter.loadMoreEnd(isRefresh);
else mSkuAdapter.loadMoreComplete();
}
/**
* 加载商品分组
*
* @param sskugrps 分组信息
*/
public void loadSkugrps(List<Sskugrp> sskugrps) {
mSkugrpAdapter.setNewData(sskugrps);
}
/**
* 加载分组状态
*
* @param skugrpId 当前选中的分组ID
*/
public void loadSkugrpState(Long skugrpId) {
for (int i = 0; i < mSkugrpAdapter.getData().size(); i++) {
if (mSkugrpAdapter.getData().get(i).getSkuGrpId().longValue() == skugrpId) {
mSkugrpAdapter.setSelectedPosition(i);
}
}
mSkugrpAdapter.notifyDataSetChanged();
}
/**
* 加载需要补货的商品数量
*
* @param count 数量
*/
public void loadReplenishCount(int count) {
mViewBinding.tvReplenishCount.setText(String.valueOf(count));
}
/**
* 加载商品总数
*
* @param count 商品总数
*/
public void loadSsskuCount(int count) {
mViewBinding.tvTotalCount.setText(String.valueOf(count));
}
/**
* 刷新商品
*/
private void refreshSku() {
mSkuAdapter.setEnableLoadMore(false);
mPresenter.refreshSku();
}
/**
* 加载更多商品
*/
private void loadMoreSku() {
mPresenter.loadMoreSku();
}
@Override
public boolean onBackPressedSupport() {
ActivityCompat.finishAfterTransition(getActivity());
return super.onBackPressedSupport();
}
}
package com.xingdata.zzdpos.ui.manage.sssku.fragment;
import android.annotation.SuppressLint;
import android.support.v7.widget.LinearLayoutManager;
import android.view.View;
import com.xingdata.zzdpos.C;
import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseFragment;
import com.xingdata.zzdpos.databinding.FragmentSsskuSearchBinding;
import com.xingdata.zzdpos.model.Sssku;
import com.xingdata.zzdpos.ui.manage.sssku.SsskuActivity;
import com.xingdata.zzdpos.ui.manage.sssku.SsskuPresenter;
import com.xingdata.zzdpos.ui.marketing.ms.adapter.SkuAdapter;
import java.util.List;
public class SearchFragment extends BaseFragment<SsskuPresenter, FragmentSsskuSearchBinding> {
private int mSearchType;
private SkuAdapter<Sssku> mSkuAdapter;
@Override
public int getLayoutId() {
return R.layout.fragment_sssku_search;
}
@Override
public void initView() {
// init sku
mSkuAdapter = new SkuAdapter<>();
mViewBinding.rlSku.setAdapter(mSkuAdapter);
mViewBinding.rlSku.setLayoutManager(new LinearLayoutManager(mContext));
// set sku listener
mSkuAdapter.setOnLoadMoreListener(this::loadMoreSku, mViewBinding.rlSku);
mSkuAdapter.setOnItemClickListener((adapter, view, position) -> {
this.pop();
mPresenter.clickSku(mSkuAdapter.getData().get(position), mSearchType);
});
// set empty
@SuppressLint("InflateParams") View view = getLayoutInflater().inflate(R.layout.view_empty, null);
mSkuAdapter.setEmptyView(view);
mSkuAdapter.isUseEmpty(false);
}
/**
* 加载更多商品
*/
private void loadMoreSku() {
mPresenter.loadMoreSearchResult();
}
/**
* 加载商品
*
* @param skus 商品
* @param isRefresh 是否刷新
*/
public void loadSkus(List<Sssku> skus, boolean isRefresh) {
if (isRefresh) {
mSkuAdapter.isUseEmpty(true);
mSkuAdapter.setEnableLoadMore(true);
mSkuAdapter.setNewData(skus);
} else if (skus.size() > 0) mSkuAdapter.addData(skus);
if (skus.size() < C.PRODUCT.PAGE_SIZE) mSkuAdapter.loadMoreEnd(isRefresh);
else mSkuAdapter.loadMoreComplete();
}
/**
* 设置搜索类型
*
* @param searchType 搜索类型
* @return this
*/
public SearchFragment setSearchType(int searchType) {
this.mSearchType = searchType;
return this;
}
@Override
public boolean onBackPressedSupport() {
switch (mSearchType) {
case C.TITLE_MODE.SKU:
((SsskuActivity) getActivity()).backToManagerFragment();
break;
case C.TITLE_MODE.PKG:
((SsskuActivity) getActivity()).backToEditFragment();
break;
}
return super.onBackPressedSupport();
}
}
package com.xingdata.zzdpos.ui.manage.sssku.fragment;
import android.view.View;
import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseFragment;
import com.xingdata.zzdpos.databinding.FragmentSsskuSkugrpBinding;
import com.xingdata.zzdpos.ui.manage.sssku.SsskuActivity;
import com.xingdata.zzdpos.ui.manage.sssku.SsskuPresenter;
import com.xingdata.zzdpos.ui.manage.sssku.dialog.SkugrpEditorDialog;
public class SkugrpFragment extends BaseFragment<SsskuPresenter, FragmentSsskuSkugrpBinding> {
@Override
public int getLayoutId() {
return R.layout.fragment_sssku_skugrp;
}
@Override
public void initView() {
mViewBinding.setVisibility(View.GONE);
mViewBinding.llSkugrpAdd.setOnClickListener(view -> {
new SkugrpEditorDialog().show(((SsskuActivity) getActivity()));
});
}
@Override
public boolean onBackPressedSupport() {
((SsskuActivity) getActivity()).backToManagerFragment();
return super.onBackPressedSupport();
}
}
package com.xingdata.zzdpos.ui.marketing.integral.fragment; package com.xingdata.zzdpos.ui.marketing.integral.fragment;
import android.app.IntentService;
import android.text.TextUtils; import android.text.TextUtils;
import android.view.View; import android.view.View;
import android.widget.ImageView; import android.widget.ImageView;
......
package com.xingdata.zzdpos.ui.marketing.ms; package com.xingdata.zzdpos.ui.marketing.ms;
import com.blankj.utilcode.util.LogUtils; import android.view.inputmethod.EditorInfo;
import com.blankj.utilcode.util.KeyboardUtils;
import com.blankj.utilcode.util.ToastUtils;
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;
import com.xingdata.zzdpos.base.BaseSku; import com.xingdata.zzdpos.base.BaseSku;
...@@ -11,6 +15,8 @@ import com.xingdata.zzdpos.ui.dialog.LoadingDialog; ...@@ -11,6 +15,8 @@ import com.xingdata.zzdpos.ui.dialog.LoadingDialog;
import com.xingdata.zzdpos.ui.marketing.ms.fragment.AddFragment; import com.xingdata.zzdpos.ui.marketing.ms.fragment.AddFragment;
import com.xingdata.zzdpos.ui.marketing.ms.fragment.EditorFragment; import com.xingdata.zzdpos.ui.marketing.ms.fragment.EditorFragment;
import com.xingdata.zzdpos.ui.marketing.ms.fragment.ManagerFragment; import com.xingdata.zzdpos.ui.marketing.ms.fragment.ManagerFragment;
import com.xingdata.zzdpos.ui.marketing.ms.fragment.ScanFragment;
import com.xingdata.zzdpos.ui.marketing.ms.fragment.SearchFragment;
import com.xingdata.zzdpos.ui.marketing.ms.model.Area; import com.xingdata.zzdpos.ui.marketing.ms.model.Area;
import com.xingdata.zzdpos.ui.marketing.ms.model.Group; import com.xingdata.zzdpos.ui.marketing.ms.model.Group;
import com.xingdata.zzdpos.ui.marketing.ms.model.Type; import com.xingdata.zzdpos.ui.marketing.ms.model.Type;
...@@ -18,12 +24,15 @@ import com.xingdata.zzdpos.ui.marketing.ms.model.User; ...@@ -18,12 +24,15 @@ import com.xingdata.zzdpos.ui.marketing.ms.model.User;
import java.util.List; import java.util.List;
public class MsActivity extends BaseActivity<MsPresenter, ActivityMsBinding> implements MsContract.View { public class MsActivity<Sku extends BaseSku> extends BaseActivity<MsPresenter, ActivityMsBinding> implements MsContract.View<Sku> {
private ManagerFragment mManagerFragment = new ManagerFragment(); private ManagerFragment mManagerFragment = new ManagerFragment();
private EditorFragment mEditorFragment = new EditorFragment(); private EditorFragment mEditorFragment = new EditorFragment();
private AddFragment mAddFragment = new AddFragment(); private AddFragment mAddFragment = new AddFragment();
private SearchFragment<Sku> mSearchFragment = new SearchFragment<>();
private ScanFragment<Sku> mScanFragment = new ScanFragment<>();
private LoadingDialog mLoadingDialog = new LoadingDialog(); private LoadingDialog mLoadingDialog = new LoadingDialog();
@Override @Override
...@@ -34,7 +43,24 @@ public class MsActivity extends BaseActivity<MsPresenter, ActivityMsBinding> imp ...@@ -34,7 +43,24 @@ public class MsActivity extends BaseActivity<MsPresenter, ActivityMsBinding> imp
@Override @Override
public void initView() { public void initView() {
this.loadRootFragment(R.id.f_ms, mManagerFragment); this.loadRootFragment(R.id.f_ms, mManagerFragment);
mViewBinding.btnBack.setOnClickListener(view -> onBackPressedSupport());
mViewBinding.setTitleMode(C.TITLE_MODE.TEXT);
mViewBinding.btnBack.setOnClickListener(view -> {
getTopFragment().onBackPressedSupport();
onBackPressedSupport();
});
mViewBinding.etSearch.setOnEditorActionListener((textView, i, keyEvent) -> {
if (i == EditorInfo.IME_ACTION_SEARCH) {
KeyboardUtils.hideSoftInput(textView);
mPresenter.clickSearchButton(textView.getText().toString());
}
return false;
});
}
@Override
public void showMsg(String msg) {
ToastUtils.showShort(msg);
} }
@Override @Override
...@@ -49,16 +75,27 @@ public class MsActivity extends BaseActivity<MsPresenter, ActivityMsBinding> imp ...@@ -49,16 +75,27 @@ public class MsActivity extends BaseActivity<MsPresenter, ActivityMsBinding> imp
@Override @Override
public void showEditorFragment(Ms ms) { public void showEditorFragment(Ms ms) {
LogUtils.e("编辑 " + ms.getMsName()); start(mEditorFragment.setMs(ms).setEditMode(C.MS_EDITOR_MODE.UPDATE));
start(mEditorFragment);
} }
@Override @Override
public void showEditorFragment(int msType) { public void showEditorFragment(int msType) {
LogUtils.e("添加 " + msType); start(mEditorFragment.setMs(msType).setEditMode(C.MS_EDITOR_MODE.ADD));
start(mEditorFragment); }
@Override
public void showSearchFragment(int searchType) {
this.showTitleBarByTitleMode(searchType);
this.start(mSearchFragment.setSearchType(searchType));
}
@Override
public void showScanFragment(int searchType) {
this.showTitleBarByTitleMode(searchType);
this.start(mScanFragment.setSearchType(searchType));
} }
@Override @Override
public void loadTypes(List<Type> types) { public void loadTypes(List<Type> types) {
mAddFragment.loadTypes(types); mAddFragment.loadTypes(types);
...@@ -80,15 +117,41 @@ public class MsActivity extends BaseActivity<MsPresenter, ActivityMsBinding> imp ...@@ -80,15 +117,41 @@ public class MsActivity extends BaseActivity<MsPresenter, ActivityMsBinding> imp
} }
@Override @Override
public <Sku extends BaseSku> void loadGroupSkuSssku(Sku sku) { public void loadSkus(List<Sku> skus, boolean isRefresh) {
mSearchFragment.loadSkus(skus, isRefresh);
}
@Override
public void loadGroupSku(Sku sku) {
mEditorFragment.loadGroupSku(sku); mEditorFragment.loadGroupSku(sku);
} }
@Override @Override
public <Sku extends BaseSku> void loadTypeGiftSssku(Sku sku) { public void loadTypeGift(Sku sku) {
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
public void backToEditFragment() {
this.popTo(EditorFragment.class, false);
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);
...@@ -98,4 +161,25 @@ public class MsActivity extends BaseActivity<MsPresenter, ActivityMsBinding> imp ...@@ -98,4 +161,25 @@ public class MsActivity extends BaseActivity<MsPresenter, ActivityMsBinding> imp
public void dismissLoadingDialog() { public void dismissLoadingDialog() {
mLoadingDialog.dismiss(); mLoadingDialog.dismiss();
} }
/**
* 根据titleMode显示TitleBar
*
* @param titleMode 标题模式
*/
private void showTitleBarByTitleMode(int titleMode) {
if (mViewBinding.getTitleMode() == titleMode) return;
mViewBinding.setTitleMode(titleMode);
mViewBinding.etSearch.setText("");
switch (titleMode) {
case C.TITLE_MODE.SKU:
mViewBinding.etSearch.setHint(R.string.ms_editor_type_gift_search_hint);
break;
case C.TITLE_MODE.GIFT:
mViewBinding.etSearch.setHint(R.string.ms_editor_type_gift_search_hint);
break;
}
}
} }
...@@ -4,7 +4,6 @@ import com.xingdata.zzdpos.base.BasePresenter; ...@@ -4,7 +4,6 @@ import com.xingdata.zzdpos.base.BasePresenter;
import com.xingdata.zzdpos.base.BaseSku; import com.xingdata.zzdpos.base.BaseSku;
import com.xingdata.zzdpos.base.BaseView; import com.xingdata.zzdpos.base.BaseView;
import com.xingdata.zzdpos.model.Ms; import com.xingdata.zzdpos.model.Ms;
import com.xingdata.zzdpos.model.Sssku;
import com.xingdata.zzdpos.ui.marketing.ms.model.Area; import com.xingdata.zzdpos.ui.marketing.ms.model.Area;
import com.xingdata.zzdpos.ui.marketing.ms.model.Group; import com.xingdata.zzdpos.ui.marketing.ms.model.Group;
import com.xingdata.zzdpos.ui.marketing.ms.model.Type; import com.xingdata.zzdpos.ui.marketing.ms.model.Type;
...@@ -14,7 +13,13 @@ import java.util.List; ...@@ -14,7 +13,13 @@ import java.util.List;
interface MsContract { interface MsContract {
interface View extends BaseView { interface View<Sku extends BaseSku> extends BaseView {
/**
* 显示文字内容
*
* @param msg 要显示的内容
*/
void showMsg(String msg);
/** /**
* 加载营销计划数据 * 加载营销计划数据
...@@ -40,6 +45,18 @@ interface MsContract { ...@@ -40,6 +45,18 @@ interface MsContract {
*/ */
void showEditorFragment(int msType); void showEditorFragment(int msType);
/**
* 显示搜索页面
*/
void showSearchFragment(int searchType);
/**
* 显示扫描页面
*
* @param searchType 搜索类型
*/
void showScanFragment(int searchType);
/** /**
* 加载营销类型 * 加载营销类型
* *
...@@ -68,19 +85,51 @@ interface MsContract { ...@@ -68,19 +85,51 @@ interface MsContract {
*/ */
void loadUsers(List<User> users); void loadUsers(List<User> users);
/**
* 加载商品对象
*
* @param skus 商品对象列表
* @param isRefresh 是否刷新
*/
void loadSkus(List<Sku> skus, boolean isRefresh);
/** /**
* 加载作为主体的商品信息 * 加载作为主体的商品信息
* *
* @param sku 加载编辑信息 * @param sku 加载编辑信息
*/ */
<Sku extends BaseSku> void loadGroupSkuSssku(Sku sku); void loadGroupSku(Sku sku);
/** /**
* 加载换购的商品 * 加载换购的商品
* *
* @param sku 包装内的商品 * @param sku 包装内的商品
*/ */
<Sku extends BaseSku> void loadTypeGiftSssku(Sku sku); void loadTypeGift(Sku sku);
/**
* 添加营销
*
* @param ms 要添加的营销实体
*/
void addMs(Ms ms);
/**
* 更新营销
*
* @param ms 更新营销实体
*/
void updateMs(Ms ms);
/**
* 返回编辑页面
*/
void backToEditFragment();
/**
* 返回管理页面
*/
void backToManagerFragment();
/** /**
* 显示读取对话框 * 显示读取对话框
...@@ -93,7 +142,7 @@ interface MsContract { ...@@ -93,7 +142,7 @@ interface MsContract {
void dismissLoadingDialog(); void dismissLoadingDialog();
} }
abstract class Presenter extends BasePresenter<View> { abstract class Presenter<Sku extends BaseSku> extends BasePresenter<View<Sku>> {
/** /**
* 管理页面 - 刷新营销计划 * 管理页面 - 刷新营销计划
...@@ -131,27 +180,47 @@ interface MsContract { ...@@ -131,27 +180,47 @@ interface MsContract {
public abstract void initEditor(); public abstract void initEditor();
/** /**
* 编辑页面 - 点击GroupSkuView里的搜索按钮 * 编辑页面 - 点击营销主体商品的搜索框
*/
public abstract void clickGroupSkuSearch();
/**
* 编辑页面 - 点击营销类型商品的搜索框
*/
public abstract void clickTypeSkuSearch();
/**
* 编辑页面 - 点击搜索按钮
* *
* @param barcode 条形码 * @param keyword 搜索关键字
*/ */
public abstract void clickGroupSearchButton(String barcode); public abstract void clickSearchButton(String keyword);
/** /**
* 编辑页面 - 点击TypeGift里的搜索按钮 * 编辑页面 - 点击编辑器的确定
* *
* @param barcode 条形码 * @param ms 要保存的营销计划
* @param editMode 编辑模式
*/ */
public abstract void clickTypeSearchButton(String barcode); public abstract void clickEditorConfirm(Ms ms, Integer editMode);
/** /**
* 商品列表页面 - 确认选择 * 搜索页面 - 加载更多搜索信息
*/
public abstract void loadMoreSearchResult();
/**
* 搜索页面 - 点击商品
* *
* @param sssku 商品 * @param sku 商品
* @param res 使用的地方 * @param searchType 搜索类型
*/ */
public abstract void selectedSkuInDialog(Sssku sssku, int res); public abstract void clickSku(Sku sku, int searchType);
/**
* 搜素页面 - 退出
*/
public abstract void exitSearchFragment();
} }
} }
...@@ -3,9 +3,10 @@ package com.xingdata.zzdpos.ui.marketing.ms; ...@@ -3,9 +3,10 @@ package com.xingdata.zzdpos.ui.marketing.ms;
import com.xingdata.zzdpos.C; import com.xingdata.zzdpos.C;
import com.xingdata.zzdpos.api.ApiFactory; import com.xingdata.zzdpos.api.ApiFactory;
import com.xingdata.zzdpos.base.BaseSku;
import com.xingdata.zzdpos.db.DBFactory; import com.xingdata.zzdpos.db.DBFactory;
import com.xingdata.zzdpos.model.Ms; import com.xingdata.zzdpos.model.Ms;
import com.xingdata.zzdpos.model.Sssku; import com.xingdata.zzdpos.ui.login.LoginPresenter;
import com.xingdata.zzdpos.ui.marketing.ms.model.Area; import com.xingdata.zzdpos.ui.marketing.ms.model.Area;
import com.xingdata.zzdpos.ui.marketing.ms.model.Group; import com.xingdata.zzdpos.ui.marketing.ms.model.Group;
import com.xingdata.zzdpos.ui.marketing.ms.model.Type; import com.xingdata.zzdpos.ui.marketing.ms.model.Type;
...@@ -14,13 +15,16 @@ import com.xingdata.zzdpos.ui.marketing.ms.model.User; ...@@ -14,13 +15,16 @@ import com.xingdata.zzdpos.ui.marketing.ms.model.User;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
public class MsPresenter extends MsContract.Presenter { public class MsPresenter<Sku extends BaseSku> extends MsContract.Presenter<Sku> {
/** /**
* 页码 * 页码
*/ */
private int mPageNum = 1; private int mPageNum = 1;
private int mSkuPageNum = 1;
private String mSkuKeyword;
@Override @Override
public void onAttached() { public void onAttached() {
} }
...@@ -44,7 +48,13 @@ public class MsPresenter extends MsContract.Presenter { ...@@ -44,7 +48,13 @@ public class MsPresenter extends MsContract.Presenter {
@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
...@@ -70,12 +80,12 @@ public class MsPresenter extends MsContract.Presenter { ...@@ -70,12 +80,12 @@ public class MsPresenter extends MsContract.Presenter {
groups.add(new Group(C.MS_GROUP.SKU, "指定商品")); groups.add(new Group(C.MS_GROUP.SKU, "指定商品"));
List<Area> areas = new ArrayList<>(); List<Area> areas = new ArrayList<>();
areas.add(new Area(0, "所有门店")); areas.add(new Area(C.MS_AREA.MER, "所有门店", LoginPresenter.loginReturnBean.getMerMapId()));
areas.add(new Area(1, "本店")); areas.add(new Area(C.MS_AREA.LOCAL, "本店", LoginPresenter.loginReturnBean.getMerMapId()));
List<User> users = new ArrayList<>(); List<User> users = new ArrayList<>();
users.add(new User(0, "所有顾客", 0)); users.add(new User(C.MS_USER.ALL, "所有顾客", 0));
users.add(new User(0, "所有会员", 0)); users.add(new User(C.MS_USER.VIP, "所有会员", 0));
DBFactory.Marketing.Ms.queryLevel() DBFactory.Marketing.Ms.queryLevel()
.doFinally(() -> { .doFinally(() -> {
...@@ -91,18 +101,74 @@ public class MsPresenter extends MsContract.Presenter { ...@@ -91,18 +101,74 @@ public class MsPresenter extends MsContract.Presenter {
} }
@Override @Override
public void clickGroupSearchButton(String barcode) { public void clickGroupSkuSearch() {
mView.showSearchFragment(C.TITLE_MODE.SKU);
}
@Override
public void clickTypeSkuSearch() {
mView.showSearchFragment(C.TITLE_MODE.GIFT);
} }
@Override @Override
public void clickTypeSearchButton(String barcode) { public void clickSearchButton(String keyword) {
this.mSkuPageNum = 0;
this.mSkuKeyword = keyword;
this.getSearchSku();
}
@Override
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 @Override
public void selectedSkuInDialog(Sssku sssku, int res) { public void loadMoreSearchResult() {
this.mSkuPageNum++;
this.getSearchSku();
}
@Override
public void clickSku(Sku sku, int searchType) {
switch (searchType) {
case C.TITLE_MODE.SKU:
mView.loadGroupSku(sku);
break;
case C.TITLE_MODE.GIFT:
mView.loadTypeGift(sku);
break;
}
}
@Override
public void exitSearchFragment() {
mView.backToEditFragment();
} }
/** /**
...@@ -112,4 +178,19 @@ public class MsPresenter extends MsContract.Presenter { ...@@ -112,4 +178,19 @@ public class MsPresenter extends MsContract.Presenter {
mCompositeDisposable.add(ApiFactory.Ms.query(mPageNum).subscribe(msPager -> mView.loadMss(msPager.getList(), mPageNum == 1))); mCompositeDisposable.add(ApiFactory.Ms.query(mPageNum).subscribe(msPager -> mView.loadMss(msPager.getList(), mPageNum == 1)));
} }
/**
* 搜索商品
*/
private void getSearchSku() {
mView.showLoadingDialog();
mCompositeDisposable.add(
DBFactory.Store.querySku(mSkuPageNum, mSkuKeyword)
.doOnSubscribe(subscription -> mView.dismissLoadingDialog())
.subscribe(ssskus -> {
mView.loadSkus((List<Sku>) ssskus, mSkuPageNum == 0);
})
);
}
} }
package com.xingdata.zzdpos.ui.marketing.ms.adapter; package com.xingdata.zzdpos.ui.marketing.ms.adapter;
import android.support.annotation.Nullable;
import com.xingdata.zzdpos.R; import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseSelectedAdapter; import com.xingdata.zzdpos.base.BaseSelectedAdapter;
import com.xingdata.zzdpos.base.BaseViewHolder; import com.xingdata.zzdpos.base.BaseViewHolder;
...@@ -7,21 +9,43 @@ import com.xingdata.zzdpos.databinding.ItemSelectorBinding; ...@@ -7,21 +9,43 @@ import com.xingdata.zzdpos.databinding.ItemSelectorBinding;
import com.xingdata.zzdpos.ui.marketing.ms.model.BaseBean; import com.xingdata.zzdpos.ui.marketing.ms.model.BaseBean;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List;
public class BeanAdapter<T extends BaseBean> extends BaseSelectedAdapter<T, ItemSelectorBinding> { public class BeanAdapter<B extends BaseBean> extends BaseSelectedAdapter<B, ItemSelectorBinding> {
public BeanAdapter() { public BeanAdapter() {
super(R.layout.item_selector, new ArrayList<>(), true); super(R.layout.item_selector, new ArrayList<>(), true);
} }
public interface OnItemSelectedListener {
void onItemSelected(String item);
}
private OnItemSelectedListener mOnItemSelectedListener;
@Override @Override
protected void convert(BaseViewHolder helper, ItemSelectorBinding mViewBinding, T item) { protected void convert(BaseViewHolder helper, ItemSelectorBinding mViewBinding, B item) {
mViewBinding.setSelected(getSelectedPosition() == helper.getAdapterPosition()); mViewBinding.setSelected(getSelectedPosition() == helper.getAdapterPosition());
mViewBinding.tvName.getPaint().setFakeBoldText(getSelectedPosition() == helper.getAdapterPosition()); mViewBinding.tvName.getPaint().setFakeBoldText(getSelectedPosition() == helper.getAdapterPosition());
mViewBinding.tvName.setText(item.getName()); mViewBinding.tvName.setText(item.getName());
} }
public void setNewData(@Nullable List<B> data) {
if (b != null && data != null) {
for (int i = 0; i < data.size(); i++) {
if (data.get(i).getId() == b.getId() && data.get(i).getInfo() == b.getInfo()) {
if (mOnItemSelectedListener != null) {
this.mOnItemSelectedListener.onItemSelected(data.get(i).getName());
}
this.setSelectedPosition(i);
}
}
}
super.setNewData(data);
}
public String[] getStrs() { public String[] getStrs() {
String[] strs = new String[getData().size()]; String[] strs = new String[getData().size()];
for (int i = 0; i < getData().size(); i++) { for (int i = 0; i < getData().size(); i++) {
...@@ -30,8 +54,17 @@ public class BeanAdapter<T extends BaseBean> extends BaseSelectedAdapter<T, Item ...@@ -30,8 +54,17 @@ public class BeanAdapter<T extends BaseBean> extends BaseSelectedAdapter<T, Item
return strs; return strs;
} }
public <B extends BaseBean> void setItemId(B b) { private B b;
public void setBean(B b) {
this.b = b;
} }
public void setOnItemSelectedListener(OnItemSelectedListener onItemSelectedListener) {
this.mOnItemSelectedListener = onItemSelectedListener;
}
public OnItemSelectedListener getOnItemSelectedListener() {
return mOnItemSelectedListener;
}
} }
package com.xingdata.zzdpos.ui.marketing.ms.adapter;
import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseAdapter;
import com.xingdata.zzdpos.base.BaseSku;
import com.xingdata.zzdpos.databinding.ItemMsSkuBinding;
import com.xingdata.zzdpos.util.ConvertUtil;
import java.util.ArrayList;
public class SkuAdapter<T extends BaseSku> extends BaseAdapter<T, ItemMsSkuBinding> {
public SkuAdapter() {
super(R.layout.item_ms_sku, new ArrayList<>());
}
@Override
protected void convert(ItemMsSkuBinding mViewBinding, T item) {
mViewBinding.ivPic.setImageURI(item.getSpuImg());
mViewBinding.tvName.setText(item.getSpuName());
mViewBinding.tvAmt.setText(ConvertUtil.fenToYuan(item.getSkuRetailPrice1()));
}
}
...@@ -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,22 +20,31 @@ import com.xingdata.zzdpos.base.BaseSku; ...@@ -17,22 +20,31 @@ 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;
import com.xingdata.zzdpos.ui.marketing.ms.model.Group; import com.xingdata.zzdpos.ui.marketing.ms.model.Group;
import com.xingdata.zzdpos.ui.marketing.ms.model.User; import com.xingdata.zzdpos.ui.marketing.ms.model.User;
import com.xingdata.zzdpos.ui.marketing.ms.view.BaseGroupView; import com.xingdata.zzdpos.ui.marketing.ms.view.BaseGroupView;
import com.xingdata.zzdpos.ui.marketing.ms.view.BaseTypeView;
import com.xingdata.zzdpos.ui.marketing.ms.view.GroupAllView; 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.TypeGiftView;
import com.xingdata.zzdpos.ui.marketing.ms.view.TypeMoneyOffView;
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;
...@@ -44,11 +56,13 @@ public class EditorFragment extends BaseFragment<MsPresenter, FragmentMsEditorBi ...@@ -44,11 +56,13 @@ public class EditorFragment extends BaseFragment<MsPresenter, FragmentMsEditorBi
private ViewTimeDetailBinding mTimeDetailBinding; private ViewTimeDetailBinding mTimeDetailBinding;
private BaseGroupView mGroupView; private BaseGroupView mGroupView;
private BaseTypeView mTypeView;
private GroupAllView mGroupAllView = new GroupAllView(); private GroupAllView mGroupAllView = new GroupAllView();
private GroupCateView mGroupCateView = new GroupCateView(); private GroupCateView mGroupCateView = new GroupCateView();
private GroupSkuView mGroupSkuView = new GroupSkuView(); private GroupSkuView mGroupSkuView = new GroupSkuView();
@Override @Override
public int getLayoutId() { public int getLayoutId() {
return R.layout.fragment_ms_editor; return R.layout.fragment_ms_editor;
...@@ -56,30 +70,77 @@ public class EditorFragment extends BaseFragment<MsPresenter, FragmentMsEditorBi ...@@ -56,30 +70,77 @@ public class EditorFragment extends BaseFragment<MsPresenter, FragmentMsEditorBi
@Override @Override
public void initView() { public void initView() {
{//TODO DELETE
mMs = new Ms();
mMs.setMsDateBegin(20170105L);
mMs.setMsDateEnd(20170115L);
mMs.setMsTimeBegin(000000L);
mMs.setMsTimeEnd(235959L);
mMs.setMsWeekPlan("1,2,3,5");
}
initInfoViews(); initInfoViews();
initTimeViews(); initTimeViews();
initMsViews(); initMsViews();
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;
}
/** /**
* 加载主体对象 * 加载主体对象
* *
...@@ -118,12 +179,11 @@ public class EditorFragment extends BaseFragment<MsPresenter, FragmentMsEditorBi ...@@ -118,12 +179,11 @@ public class EditorFragment extends BaseFragment<MsPresenter, FragmentMsEditorBi
} }
/** /**
* TODO 加载换购的商品 * 加载换购的商品
* *
* @param sssku 商品 * @param sssku 商品
*/ */
public <Sku extends BaseSku> void loadTypeSku(Sku sssku) { public <Sku extends BaseSku> void loadTypeSku(Sku sssku) {
// if (mTypeView instanceof TypeGiftView) ((TypeGiftView) mTypeView).loadSssku(sssku);
} }
/** /**
...@@ -138,7 +198,9 @@ public class EditorFragment extends BaseFragment<MsPresenter, FragmentMsEditorBi ...@@ -138,7 +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());
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()));
} }
/** /**
...@@ -156,7 +218,6 @@ public class EditorFragment extends BaseFragment<MsPresenter, FragmentMsEditorBi ...@@ -156,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();
}); });
...@@ -216,28 +277,48 @@ public class EditorFragment extends BaseFragment<MsPresenter, FragmentMsEditorBi ...@@ -216,28 +277,48 @@ public class EditorFragment extends BaseFragment<MsPresenter, FragmentMsEditorBi
* 初始化活动信息界面 * 初始化活动信息界面
*/ */
private void initMsViews() { private void initMsViews() {
// group
mGroupAdapter = new BeanAdapter<>();
mViewBinding.rlGroup.setAdapter(mGroupAdapter);
mViewBinding.rlGroup.setLayoutManager(new LinearLayoutManager(mContext));
// area // area
mAreaAdapter = new BeanAdapter<>(); mAreaAdapter = new BeanAdapter<>();
mAreaAdapter.setOnItemSelectedListener(item -> mViewBinding.setArea(item));
// user // user
mUserAdapter = new BeanAdapter<>(); mUserAdapter = new BeanAdapter<>();
mUserAdapter.setOnItemSelectedListener(item -> mViewBinding.setUser(item));
// group
mGroupAdapter = new BeanAdapter<>();
mViewBinding.rlGroup.setAdapter(mGroupAdapter);
mViewBinding.rlGroup.setLayoutManager(new LinearLayoutManager(mContext));
// listener // listener
mGroupAdapter.setOnItemClickListener((adapter, view, position) -> {
});
mViewBinding.llArea.setOnClickListener(view -> showSelectorDialog(R.string.ms_editor_area, mAreaAdapter, (dialog, which) -> { mViewBinding.llArea.setOnClickListener(view -> showSelectorDialog(R.string.ms_editor_area, mAreaAdapter, (dialog, which) -> {
mViewBinding.setArea(mAreaAdapter.getStrs()[which]); switch (mAreaAdapter.getData().get(which).getId()) {
case C.MS_AREA.MER:
mMs.setMsRangeTag((byte) C.MS_AREA.MER);
mMs.setMerMapId(LoginPresenter.loginReturnBean.getMerMapId());
break;
case C.MS_AREA.LOCAL:
mMs.setMsRangeTag((byte) C.MS_AREA.LOCAL);
mMs.setShopMapId(LoginPresenter.loginReturnBean.getShopMapId());
break;
}
mAreaAdapter.getOnItemSelectedListener().onItemSelected(mAreaAdapter.getStrs()[which]);
mAreaAdapter.setSelectedPosition(which); mAreaAdapter.setSelectedPosition(which);
dialog.dismiss(); dialog.dismiss();
}) })
); );
mViewBinding.llUser.setOnClickListener(view -> showSelectorDialog(R.string.ms_editor_user, mUserAdapter, (dialog, which) -> { mViewBinding.llUser.setOnClickListener(view -> showSelectorDialog(R.string.ms_editor_user, mUserAdapter, (dialog, which) -> {
mViewBinding.setUser(mUserAdapter.getStrs()[which]); switch (mUserAdapter.getData().get(which).getId()) {
case C.MS_USER.ALL:
mMs.setMsCoustomTag((byte) C.MS_USER.ALL);
mMs.setVipLevel((byte) 0);
break;
case C.MS_USER.VIP:
mMs.setMsCoustomTag((byte) C.MS_USER.VIP);
mMs.setVipLevel((byte) mUserAdapter.getData().get(which).getLevelId());
break;
}
mUserAdapter.getOnItemSelectedListener().onItemSelected(mUserAdapter.getStrs()[which]);
mUserAdapter.setSelectedPosition(which); mUserAdapter.setSelectedPosition(which);
dialog.dismiss(); dialog.dismiss();
}) })
...@@ -261,6 +342,29 @@ public class EditorFragment extends BaseFragment<MsPresenter, FragmentMsEditorBi ...@@ -261,6 +342,29 @@ public class EditorFragment extends BaseFragment<MsPresenter, FragmentMsEditorBi
FragmentUtils.replace(getChildFragmentManager(), mGroupView, R.id.f_group); FragmentUtils.replace(getChildFragmentManager(), mGroupView, R.id.f_group);
} }
}); });
//type
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));
} }
/** /**
...@@ -358,4 +462,44 @@ public class EditorFragment extends BaseFragment<MsPresenter, FragmentMsEditorBi ...@@ -358,4 +462,44 @@ 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.etName.getText().toString());
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;
}
}
}
/** /**
* 刷新营销计划 * 刷新营销计划
*/ */
......
package com.xingdata.zzdpos.ui.marketing.ms.fragment;
import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseFragment;
import com.xingdata.zzdpos.base.BaseSku;
import com.xingdata.zzdpos.databinding.FragmentMsScanBinding;
import com.xingdata.zzdpos.ui.store.StorePresenter;
public class ScanFragment<Sku extends BaseSku> extends BaseFragment<StorePresenter, FragmentMsScanBinding> {
private int mSearchType;
@Override
public int getLayoutId() {
return R.layout.fragment_ms_scan;
}
@Override
public void initView() {
}
/**
* 设置搜索类型
*
* @param searchType 搜索类型
* @return this
*/
public ScanFragment setSearchType(int searchType) {
this.mSearchType = searchType;
return this;
}
}
package com.xingdata.zzdpos.ui.marketing.ms.fragment;
import android.annotation.SuppressLint;
import android.support.v7.widget.LinearLayoutManager;
import android.view.View;
import com.xingdata.zzdpos.C;
import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseFragment;
import com.xingdata.zzdpos.base.BaseSku;
import com.xingdata.zzdpos.databinding.FragmentMsSearchBinding;
import com.xingdata.zzdpos.ui.marketing.ms.MsPresenter;
import com.xingdata.zzdpos.ui.marketing.ms.adapter.SkuAdapter;
import java.util.List;
public class SearchFragment<Sku extends BaseSku> extends BaseFragment<MsPresenter, FragmentMsSearchBinding> {
private int mSearchType;
private SkuAdapter<Sku> mSkuAdapter;
@Override
public int getLayoutId() {
return R.layout.fragment_ms_search;
}
@Override
public void initView() {
// init sku
mSkuAdapter = new SkuAdapter<>();
mViewBinding.rlSku.setAdapter(mSkuAdapter);
mViewBinding.rlSku.setLayoutManager(new LinearLayoutManager(mContext));
// set sku listener
mSkuAdapter.setOnLoadMoreListener(this::loadMoreSku, mViewBinding.rlSku);
mSkuAdapter.setOnItemClickListener((adapter, view, position) -> {
mPresenter.clickSku(mSkuAdapter.getData().get(position), mSearchType);
this.pop();
});
// set empty
@SuppressLint("InflateParams") View view = getLayoutInflater().inflate(R.layout.view_empty, null);
mSkuAdapter.setEmptyView(view);
mSkuAdapter.isUseEmpty(false);
}
@Override
public void onDestroyView() {
mPresenter.exitSearchFragment();
super.onDestroyView();
}
/**
* 加载更多商品
*/
private void loadMoreSku() {
mPresenter.loadMoreSearchResult();
}
/**
* 加载商品
*
* @param skus 商品
* @param isRefresh 是否刷新
*/
public void loadSkus(List<Sku> skus, boolean isRefresh) {
if (isRefresh) {
mSkuAdapter.isUseEmpty(true);
mSkuAdapter.setEnableLoadMore(true);
mSkuAdapter.setNewData(skus);
} else if (skus.size() > 0) mSkuAdapter.addData(skus);
if (skus.size() < C.PRODUCT.PAGE_SIZE) mSkuAdapter.loadMoreEnd(isRefresh);
else mSkuAdapter.loadMoreComplete();
}
/**
* 设置搜索类型
*
* @param searchType 搜索类型
* @return this
*/
public SearchFragment setSearchType(int searchType) {
this.mSearchType = searchType;
return this;
}
}
package com.xingdata.zzdpos.ui.marketing.ms.model; package com.xingdata.zzdpos.ui.marketing.ms.model;
public class Area extends BaseBean { public class Area extends BaseBean {
public Area(int id, String name) { public Area(int id, String name, Long merId) {
setId(id); setId(id);
setName(name); setName(name);
setInfo(merId);
}
public Area(int id, long merId) {
setId(id);
setInfo(merId);
}
public void setMerId(int merId) {
setInfo(merId);
}
public long getMerId() {
return getInfo();
} }
} }
...@@ -4,6 +4,7 @@ package com.xingdata.zzdpos.ui.marketing.ms.model; ...@@ -4,6 +4,7 @@ package com.xingdata.zzdpos.ui.marketing.ms.model;
public class BaseBean { public class BaseBean {
private int id; private int id;
private String name; private String name;
private long info;
public int getId() { public int getId() {
return id; return id;
...@@ -20,4 +21,12 @@ public class BaseBean { ...@@ -20,4 +21,12 @@ public class BaseBean {
public void setName(String name) { public void setName(String name) {
this.name = name; this.name = name;
} }
public long getInfo() {
return info;
}
public void setInfo(long info) {
this.info = info;
}
} }
...@@ -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);
}
} }
package com.xingdata.zzdpos.ui.marketing.ms.model; package com.xingdata.zzdpos.ui.marketing.ms.model;
public class User extends BaseBean { public class User extends BaseBean {
public User(int id, String name, int levelId) { public User(int id, String name, long levelId) {
setId(id); setId(id);
setName(name); setName(name);
setLevelId(levelId); setInfo(levelId);
} }
private int levelId; public User(int id, long levelId) {
setId(id);
setInfo(levelId);
}
public int getLevelId() { public void setLevelId(long levelId) {
return levelId; setInfo(levelId);
} }
public void setLevelId(int levelId) { public long getLevelId() {
this.levelId = levelId; return getInfo();
} }
} }
...@@ -10,7 +10,6 @@ public abstract class BaseGroupView<B extends ViewDataBinding> extends BaseFragm ...@@ -10,7 +10,6 @@ public abstract class BaseGroupView<B extends ViewDataBinding> extends BaseFragm
public Ms mMs; public Ms mMs;
@Override @Override
public void initView() { public void initView() {
if (mMs != null) setViewByMs(); if (mMs != null) setViewByMs();
......
package com.xingdata.zzdpos.ui.marketing.ms.view;
import android.databinding.ViewDataBinding;
import com.xingdata.zzdpos.base.BaseFragment;
import com.xingdata.zzdpos.model.Ms;
import com.xingdata.zzdpos.ui.marketing.ms.MsPresenter;
public abstract class BaseTypeView<B extends ViewDataBinding> extends BaseFragment<MsPresenter, B> {
public Ms mMs;
@Override
public void initView() {
if (mMs != null) setViewByMs();
}
protected abstract void setViewByMs();
/**
* 设置营销计划
*
* @param ms 营销计划实体
* @return this
*/
public BaseTypeView setMs(Ms ms) {
this.mMs = ms;
return this;
}
/**
* 获取当前页面的属性赋给营销计划实体
*
* @param ms 要编辑的营销计划
* @return 是否成功赋值
*/
public abstract boolean processMs(Ms ms);
@Override
public void onDestroyView() {
if (mMs != null) processMs(mMs);
super.onDestroyView();
}
}
...@@ -34,7 +34,7 @@ public class GroupCateView extends BaseGroupView<ViewGroupCateBinding> { ...@@ -34,7 +34,7 @@ public class GroupCateView extends BaseGroupView<ViewGroupCateBinding> {
mGrpPosition = 0; mGrpPosition = 0;
mCatePosition = 0; mCatePosition = 0;
mViewBinding.nsType3.setVisibility(View.INVISIBLE); mViewBinding.nsType3.setVisibility(View.GONE);
loadGrp(mClas.get(i)); loadGrp(mClas.get(i));
cateId = mClas.get(i).getSpuCateId(); cateId = mClas.get(i).getSpuCateId();
...@@ -49,7 +49,7 @@ public class GroupCateView extends BaseGroupView<ViewGroupCateBinding> { ...@@ -49,7 +49,7 @@ public class GroupCateView extends BaseGroupView<ViewGroupCateBinding> {
mViewBinding.nsType3.setVisibility(View.VISIBLE); mViewBinding.nsType3.setVisibility(View.VISIBLE);
} else { } else {
cateId = mClas.get(mClaPosition).getSpuCateId(); cateId = mClas.get(mClaPosition).getSpuCateId();
mViewBinding.nsType3.setVisibility(View.INVISIBLE); mViewBinding.nsType3.setVisibility(View.GONE);
} }
break; break;
...@@ -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));
}, },
......
...@@ -26,10 +26,9 @@ public class GroupSkuView<Sku extends BaseSku> extends BaseGroupView<ViewGroupSk ...@@ -26,10 +26,9 @@ public class GroupSkuView<Sku extends BaseSku> extends BaseGroupView<ViewGroupSk
@Override @Override
public void initView() { public void initView() {
super.initView(); super.initView();
mViewBinding.etSearch.setOnClickListener(view -> { mViewBinding.etSearch.setOnFocusChangeListener((view, b) -> {
mPresenter.clickGroupSearchButton(mViewBinding.etSearch.getText().toString()); if (b) mPresenter.clickGroupSkuSearch();
}); });
mViewBinding.etSearch.requestFocus();
} }
@SuppressLint("SetTextI18n") @SuppressLint("SetTextI18n")
...@@ -38,8 +37,8 @@ public class GroupSkuView<Sku extends BaseSku> extends BaseGroupView<ViewGroupSk ...@@ -38,8 +37,8 @@ public class GroupSkuView<Sku extends BaseSku> extends BaseGroupView<ViewGroupSk
if (mMs.getMsTouchTag2() == null || mMs.getMsTouchTag2() != C.MS_GROUP.SKU) return; if (mMs.getMsTouchTag2() == null || mMs.getMsTouchTag2() != C.MS_GROUP.SKU) return;
mViewBinding.llProduct.setVisibility(View.VISIBLE); mViewBinding.llProduct.setVisibility(View.VISIBLE);
mViewBinding.etSearch.setText(ConvertUtil.longToString(mMs.getSkuBarCode())); mViewBinding.etSearch.setText(ConvertUtil.longToString(mMs.getSkuBarCode()));
mViewBinding.tvProductName.setText(getString(R.string.ms_editor_group_sku_name) + mMs.getSkuName()); mViewBinding.setName(mMs.getSkuName());
mViewBinding.tvProductPrice.setText(getString(R.string.ms_editor_group_sku_price) + ConvertUtil.fenToYuan(mMs.getSkuPrice1(), true)); mViewBinding.setPrice(ConvertUtil.fenToYuan(mMs.getSkuPrice1(), true));
} }
@Override @Override
...@@ -55,8 +54,8 @@ public class GroupSkuView<Sku extends BaseSku> extends BaseGroupView<ViewGroupSk ...@@ -55,8 +54,8 @@ public class GroupSkuView<Sku extends BaseSku> extends BaseGroupView<ViewGroupSk
this.mSku = sku; this.mSku = sku;
if (sku != null) { if (sku != null) {
mViewBinding.etSearch.setText(ConvertUtil.longToString(sku.getSpuBarcode())); mViewBinding.etSearch.setText(ConvertUtil.longToString(sku.getSpuBarcode()));
mViewBinding.tvProductName.setText(getString(R.string.ms_editor_group_sku_name) + sku.getSpuName()); mViewBinding.setName(sku.getSpuName());
mViewBinding.tvProductPrice.setText(getString(R.string.ms_editor_group_sku_price) + ConvertUtil.fenToYuan(sku.getSkuRetailPrice1(), true)); mViewBinding.setPrice(ConvertUtil.fenToYuan(sku.getSkuRetailPrice1(), true));
mViewBinding.llProduct.setVisibility(View.VISIBLE); mViewBinding.llProduct.setVisibility(View.VISIBLE);
} else { } else {
mViewBinding.llProduct.setVisibility(View.GONE); mViewBinding.llProduct.setVisibility(View.GONE);
......
package com.xingdata.zzdpos.ui.marketing.ms.view;
import com.blankj.utilcode.util.StringUtils;
import com.xingdata.zzdpos.C;
import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.databinding.ViewTypeDisBinding;
import com.xingdata.zzdpos.model.Ms;
public class TypeDisView extends BaseTypeView<ViewTypeDisBinding> {
@Override
protected void setViewByMs() {
if (mMs.getMsTools() == null) return;
if (mMs.getMsTools() == C.MS_TYPE.DIS) mViewBinding.rbDis.setChecked(true);
if (mMs.getMsTools() == C.MS_TYPE.SECOND) mViewBinding.rbSecond.setChecked(true);
if (mMs.getPriceDiscount() != null) {
mViewBinding.etDis.setText(String.valueOf(mMs.getPriceDiscount()));
}
}
@Override
public boolean processMs(Ms ms) {
ms.setMsTools(mViewBinding.rbDis.isChecked() ? C.MS_TYPE.DIS : C.MS_TYPE.SECOND);
String strDis = mViewBinding.etDis.getText().toString();
if (StringUtils.isEmpty(strDis)) return false;
ms.setPriceDiscount(Byte.valueOf(strDis));
return true;
}
@Override
public int getLayoutId() {
return R.layout.view_type_dis;
}
}
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;
}
}
package com.xingdata.zzdpos.ui.marketing.ms.view;
import android.text.Editable;
import android.text.TextWatcher;
import com.blankj.utilcode.util.StringUtils;
import com.xingdata.zzdpos.C;
import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.databinding.ViewTypeMoneyOffBinding;
import com.xingdata.zzdpos.model.Ms;
import com.xingdata.zzdpos.util.ConvertUtil;
import com.xingdata.zzdpos.util.InputFilters;
/**
* 满减返现页面
*/
public class TypeMoneyOffView extends BaseTypeView<ViewTypeMoneyOffBinding> {
@Override
public int getLayoutId() {
return R.layout.view_type_money_off;
}
@Override
public void initView() {
super.initView();
mViewBinding.etAmt.setFilters(InputFilters.getMoneyFilter(6));
mViewBinding.etDisAmt.setFilters(InputFilters.getMoneyFilter(6));
mViewBinding.etAmt.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {
}
@Override
public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
}
@Override
public void afterTextChanged(Editable editable) {
if (ConvertUtil.yuanToFen(mViewBinding.etAmt.getText().toString()) <
ConvertUtil.yuanToFen(mViewBinding.etDisAmt.getText().toString())) {
mViewBinding.etDisAmt.setText(mViewBinding.etAmt.getText());
}
}
});
mViewBinding.etDisAmt.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {
}
@Override
public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
}
@Override
public void afterTextChanged(Editable editable) {
if (ConvertUtil.yuanToFen(mViewBinding.etDisAmt.getText().toString()) >
ConvertUtil.yuanToFen(mViewBinding.etAmt.getText().toString())) {
mViewBinding.etAmt.setText(mViewBinding.etDisAmt.getText());
}
}
});
}
@Override
protected void setViewByMs() {
if (mMs.getMsTools() == null || mMs.getMsTools() != C.MS_TYPE.MONEY_OFF) return;
mViewBinding.etAmt.setText(ConvertUtil.fenToYuan(mMs.getPayAmt()));
mViewBinding.etDisAmt.setText(ConvertUtil.fenToYuan(mMs.getGiftOffAmt()));
}
@Override
public boolean processMs(Ms ms) {
ms.setMsTools(C.MS_TYPE.MONEY_OFF);
String strAmt = mViewBinding.etAmt.getText().toString();
if (StringUtils.isEmpty(strAmt)) return false;
ms.setPayAmt(ConvertUtil.yuanToFen(strAmt));
String strDisAmt = mViewBinding.etDisAmt.getText().toString();
if (StringUtils.isEmpty(strDisAmt)) return false;
if (ConvertUtil.yuanToFen(strDisAmt) > ConvertUtil.yuanToFen(strAmt)) return false;
ms.setGiftOffAmt(ConvertUtil.yuanToFen(strDisAmt));
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.ViewTypePromotionBinding;
import com.xingdata.zzdpos.model.Ms;
/**
* 促销页面
*/
public class TypePromotionView extends BaseTypeView<ViewTypePromotionBinding> {
@Override
public int getLayoutId() {
return R.layout.view_type_promotion;
}
@Override
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
public boolean processMs(Ms ms) {
ms.setMsTools(mViewBinding.rbPro.isChecked() ? C.MS_TYPE.PROMOTION : C.MS_TYPE.SECOND_PRO);
return true;
}
}
...@@ -243,6 +243,7 @@ public class SendTickerFragment extends BaseFragment<SendTicketPresenter, ...@@ -243,6 +243,7 @@ public class SendTickerFragment extends BaseFragment<SendTicketPresenter,
private boolean isNull() { private boolean isNull() {
if (nowtype == 0) { if (nowtype == 0) {
//单个会员发券 //单个会员发券
if (null == nowVip || nowTickerItemId < 0) { if (null == nowVip || nowTickerItemId < 0) {
ToastUtils.showLong("请选择会员或优惠券"); ToastUtils.showLong("请选择会员或优惠券");
return false; return false;
......
...@@ -6,7 +6,6 @@ import android.view.View; ...@@ -6,7 +6,6 @@ import android.view.View;
import android.widget.TextView; import android.widget.TextView;
import com.blankj.utilcode.util.KeyboardUtils; import com.blankj.utilcode.util.KeyboardUtils;
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;
import com.xingdata.zzdpos.databinding.FragmentSendTickerVipBinding; import com.xingdata.zzdpos.databinding.FragmentSendTickerVipBinding;
...@@ -84,7 +83,7 @@ public class VipFragment extends BaseFragment<SendTicketPresenter, FragmentSendT ...@@ -84,7 +83,7 @@ public class VipFragment extends BaseFragment<SendTicketPresenter, FragmentSendT
@Override @Override
public void onDestroyView() { public void onDestroyView() {
if (getActivity() instanceof SettleActivity) { if (getActivity() instanceof SettleActivity) {
((SettleActivity) getActivity()).showTitleBarByTitleMode(C.TITLE_MODE.TEXT); // ((SettleActivity) getActivity()).showTitleBarByTitleMode(C.TITLE_MODE.TEXT);
} }
super.onDestroyView(); super.onDestroyView();
} }
......
...@@ -75,12 +75,6 @@ public class SettleActivity extends BaseActivity<SettlePresenter, ActivitySettle ...@@ -75,12 +75,6 @@ public class SettleActivity extends BaseActivity<SettlePresenter, ActivitySettle
mSettleFragment.setViewBySettleMode(settleMode); mSettleFragment.setViewBySettleMode(settleMode);
} }
@Override
public void showSettleFragment() {
this.popTo(mSettleFragment.getClass(), false);
mViewBinding.tvTitle.setText(R.string.settle_title);
}
@Override @Override
public void showVipFragment() { public void showVipFragment() {
this.showTitleBarByTitleMode(C.TITLE_MODE.VIP); this.showTitleBarByTitleMode(C.TITLE_MODE.VIP);
...@@ -169,6 +163,13 @@ public class SettleActivity extends BaseActivity<SettlePresenter, ActivitySettle ...@@ -169,6 +163,13 @@ public class SettleActivity extends BaseActivity<SettlePresenter, ActivitySettle
mViewBinding.tvTitle.setText(R.string.settle_pay_result_title); mViewBinding.tvTitle.setText(R.string.settle_pay_result_title);
} }
@Override
public void backToSettleFragment() {
this.popTo(mSettleFragment.getClass(), false);
this.showTitleBarByTitleMode(C.TITLE_MODE.TEXT);
mViewBinding.tvTitle.setText(R.string.settle_title);
}
@Override @Override
public void backToMainActivity() { public void backToMainActivity() {
ActivityUtils.startActivity(this, MainActivity.class); ActivityUtils.startActivity(this, MainActivity.class);
......
...@@ -28,11 +28,6 @@ interface SettleContract { ...@@ -28,11 +28,6 @@ interface SettleContract {
*/ */
void setSettleFragmentBySettleMode(int settleMode); void setSettleFragmentBySettleMode(int settleMode);
/**
* 显示结算Fragment
*/
void showSettleFragment();
/** /**
* 显示会员Fragment * 显示会员Fragment
*/ */
...@@ -131,12 +126,16 @@ interface SettleContract { ...@@ -131,12 +126,16 @@ interface SettleContract {
*/ */
void showPayFailFragment(Throwable throwable, Saleorder saleorder); void showPayFailFragment(Throwable throwable, Saleorder saleorder);
/**
* 返回结算主页面
*/
void backToSettleFragment();
/** /**
* 返回主页面 * 返回主页面
*/ */
void backToMainActivity(); void backToMainActivity();
/** /**
* 关闭密码页面 * 关闭密码页面
*/ */
...@@ -261,6 +260,11 @@ interface SettleContract { ...@@ -261,6 +260,11 @@ interface SettleContract {
*/ */
public abstract void clickRetry(); public abstract void clickRetry();
/**
* 退出会员查询页面
*/
public abstract void exitVipFragment();
} }
} }
package com.xingdata.zzdpos.ui.settle; package com.xingdata.zzdpos.ui.settle;
import android.content.Context;
import com.blankj.utilcode.util.StringUtils; import com.blankj.utilcode.util.StringUtils;
import com.xingdata.api.print.ZX_PrintPOS; import com.xingdata.api.print.ZX_PrintPOS;
import com.xingdata.zzdpos.App;
import com.xingdata.zzdpos.C; import com.xingdata.zzdpos.C;
import com.xingdata.zzdpos.api.ApiFactory; import com.xingdata.zzdpos.api.ApiFactory;
import com.xingdata.zzdpos.db.DBFactory; import com.xingdata.zzdpos.db.DBFactory;
...@@ -257,7 +254,12 @@ public class SettlePresenter extends SettleContract.Presenter { ...@@ -257,7 +254,12 @@ public class SettlePresenter extends SettleContract.Presenter {
@Override @Override
public void clickRetry() { public void clickRetry() {
mView.showSettleFragment(); mView.backToSettleFragment();
}
@Override
public void exitVipFragment() {
mView.backToSettleFragment();
} }
......
...@@ -5,12 +5,10 @@ import android.support.v7.widget.LinearLayoutManager; ...@@ -5,12 +5,10 @@ import android.support.v7.widget.LinearLayoutManager;
import android.view.View; import android.view.View;
import android.widget.TextView; import android.widget.TextView;
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;
import com.xingdata.zzdpos.databinding.FragmentSettleVipBinding; import com.xingdata.zzdpos.databinding.FragmentSettleVipBinding;
import com.xingdata.zzdpos.model.Vip; import com.xingdata.zzdpos.model.Vip;
import com.xingdata.zzdpos.ui.settle.SettleActivity;
import com.xingdata.zzdpos.ui.settle.SettlePresenter; import com.xingdata.zzdpos.ui.settle.SettlePresenter;
import com.xingdata.zzdpos.ui.settle.adapter.VipAdapter; import com.xingdata.zzdpos.ui.settle.adapter.VipAdapter;
...@@ -61,9 +59,7 @@ public class VipFragment extends BaseFragment<SettlePresenter, FragmentSettleVip ...@@ -61,9 +59,7 @@ public class VipFragment extends BaseFragment<SettlePresenter, FragmentSettleVip
@Override @Override
public void onDestroyView() { public void onDestroyView() {
if (getActivity() instanceof SettleActivity) { mPresenter.exitVipFragment();
((SettleActivity) getActivity()).showTitleBarByTitleMode(C.TITLE_MODE.TEXT);
}
super.onDestroyView(); super.onDestroyView();
} }
} }
...@@ -52,7 +52,6 @@ public class StoreActivity extends BaseActivity<StorePresenter, ActivityStoreBin ...@@ -52,7 +52,6 @@ public class StoreActivity extends BaseActivity<StorePresenter, ActivityStoreBin
mViewBinding.tvSettle.setOnClickListener(view -> mPresenter.clickSettle()); mViewBinding.tvSettle.setOnClickListener(view -> mPresenter.clickSettle());
mViewBinding.btnBack.setOnClickListener(view -> { mViewBinding.btnBack.setOnClickListener(view -> {
getTopFragment().onBackPressedSupport();
onBackPressedSupport(); onBackPressedSupport();
}); });
mViewBinding.etSearch.setOnEditorActionListener((textView, i, keyEvent) -> { mViewBinding.etSearch.setOnEditorActionListener((textView, i, keyEvent) -> {
...@@ -122,7 +121,7 @@ public class StoreActivity extends BaseActivity<StorePresenter, ActivityStoreBin ...@@ -122,7 +121,7 @@ public class StoreActivity extends BaseActivity<StorePresenter, ActivityStoreBin
@Override @Override
public void showCartDialog(Saleorder saleorder, List<Saledetail> saledetails) { public void showCartDialog(Saleorder saleorder, List<Saledetail> saledetails) {
mCartDialog.setSaleorder(saleorder).setSaledetails(saledetails).show(this); mCartDialog.setSaleorder(saleorder).setSaledetails(saledetails).show(this);
} }
@Override @Override
public void showMsDialog(List<Ms> mss) { public void showMsDialog(List<Ms> mss) {
......
...@@ -181,19 +181,18 @@ interface StoreContract { ...@@ -181,19 +181,18 @@ interface StoreContract {
/** /**
* 购物车界面 - 关闭 * 购物车界面 - 关闭
*/ */
public abstract void onCartDialogCancel(); public abstract void exitCartDialog();
/** /**
* 搜索界面 - 关闭 * 搜索界面 - 关闭
*/ */
public abstract void onSearchFragmentCancel(); public abstract void exitSearchFragment();
/** /**
* 购物车界面 - 清空购物车 * 购物车界面 - 清空购物车
*/ */
public abstract void clearCart(); public abstract void clearCart();
/** /**
* 主页面 - 搜索框焦点改变 * 主页面 - 搜索框焦点改变
* *
......
...@@ -157,13 +157,13 @@ public class StorePresenter extends StoreContract.Presenter { ...@@ -157,13 +157,13 @@ public class StorePresenter extends StoreContract.Presenter {
} }
@Override @Override
public void onCartDialogCancel() { public void exitCartDialog() {
//发送购物车信息并刷新页面 //发送购物车信息并刷新页面
mView.loadSaledetails(mSaledetails, true); mView.loadSaledetails(mSaledetails, true);
} }
@Override @Override
public void onSearchFragmentCancel() { public void exitSearchFragment() {
//发送购物车信息并刷新页面 //发送购物车信息并刷新页面
mView.loadSaledetails(mSaledetails, true); mView.loadSaledetails(mSaledetails, true);
//充值搜索栏 //充值搜索栏
......
...@@ -25,6 +25,7 @@ public class SkuAdapter<T extends BaseSku> extends BaseAdapter<T, ItemStoreSkuBi ...@@ -25,6 +25,7 @@ public class SkuAdapter<T extends BaseSku> extends BaseAdapter<T, ItemStoreSkuBi
private StoreFragment.OnCountChangeListener mOnCountChangeListener; private StoreFragment.OnCountChangeListener mOnCountChangeListener;
public void setSaledetails(List<Saledetail> saledetails) { public void setSaledetails(List<Saledetail> saledetails) {
if (saledetails == null) return;
this.mSaledetails = saledetails; this.mSaledetails = saledetails;
} }
......
package com.xingdata.zzdpos.ui.store.dialog; package com.xingdata.zzdpos.ui.store.dialog;
import android.content.DialogInterface;
import android.support.design.widget.BottomSheetBehavior; import android.support.design.widget.BottomSheetBehavior;
import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.LinearLayoutManager;
...@@ -97,8 +96,9 @@ public class CartDialog extends BaseSheetDialog<StorePresenter, DialogStoreCartB ...@@ -97,8 +96,9 @@ public class CartDialog extends BaseSheetDialog<StorePresenter, DialogStoreCartB
} }
@Override @Override
public void onDismiss(DialogInterface dialog) { public void onDestroyView() {
super.onDismiss(dialog); mPresenter.exitCartDialog();
mPresenter.onCartDialogCancel(); super.onDestroyView();
} }
} }
...@@ -46,10 +46,11 @@ public class SearchFragment extends BaseFragment<StorePresenter, FragmentStoreSe ...@@ -46,10 +46,11 @@ public class SearchFragment extends BaseFragment<StorePresenter, FragmentStoreSe
mSkuAdapter.isUseEmpty(false); mSkuAdapter.isUseEmpty(false);
} }
@Override @Override
public boolean onBackPressedSupport() { public void onDestroyView() {
mPresenter.onSearchFragmentCancel(); mPresenter.exitSearchFragment();
return false; super.onDestroyView();
} }
/** /**
......
...@@ -307,6 +307,7 @@ public class StoreFragment extends BaseFragment<StorePresenter, FragmentStoreBin ...@@ -307,6 +307,7 @@ public class StoreFragment extends BaseFragment<StorePresenter, FragmentStoreBin
@Override @Override
public void onAnimationEnd(Animator animation) { public void onAnimationEnd(Animator animation) {
// 执行添加方法
mPresenter.clickAddSku(sku, value); mPresenter.clickAddSku(sku, value);
// 把执行动画的商品图片从父布局中移除 // 把执行动画的商品图片从父布局中移除
mViewBinding.clStore.removeView(icon); mViewBinding.clStore.removeView(icon);
......
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<!-- This is the main color -->
<item>
<shape>
<!-- 边框颜色 -->
<solid android:color="@color/black_baozheng"/>
</shape>
</item>
<!-- 给View的上 左 右设置8dp的边框 -->
<item android:bottom="@dimen/view_line_L050" android:top="@dimen/view_line_L050"
android:start="@dimen/view_line_L050" android:end="@dimen/view_line_L050">
<shape>
<!-- View填充颜色 -->
<solid android:color="@color/gray_zhouyu" />
</shape>
</item>
</layer-list>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:app="http://schemas.android.com/apk/res-auto">
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<FrameLayout
android:id="@+id/f_bottom"
android:layout_width="0dp"
android:layout_height="0dp"
android:background="@color/white"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent">
</FrameLayout>
</android.support.constraint.ConstraintLayout>
</layout>
\ No newline at end of file
...@@ -2,6 +2,15 @@ ...@@ -2,6 +2,15 @@
<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="titleMode"
type="int" />
</data>
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
...@@ -24,6 +33,30 @@ ...@@ -24,6 +33,30 @@
android:src="@mipmap/back_black" android:src="@mipmap/back_black"
app:layout_constraintLeft_toLeftOf="parent" /> app:layout_constraintLeft_toLeftOf="parent" />
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginEnd="@dimen/all_margin"
android:visibility="@{titleMode>1?0:8}"
app:layout_constraintBottom_toTopOf="parent"
app:layout_constraintLeft_toRightOf="@id/btn_back"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="parent">
<EditText
android:id="@+id/et_search"
style="@style/searchBarEditor"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:inputType="number"
android:labelFor="@+id/et_search"
android:textColor="@color/black_likui"
android:textColorHint="@color/gray_huanggai"
android:textSize="@dimen/all_text_size" />
</LinearLayout>
<TextView <TextView
android:id="@+id/tv_title" android:id="@+id/tv_title"
android:layout_width="wrap_content" android:layout_width="wrap_content"
...@@ -32,6 +65,7 @@ ...@@ -32,6 +65,7 @@
android:text="@string/ms_title" android:text="@string/ms_title"
android:textColor="@color/black_baozheng" android:textColor="@color/black_baozheng"
android:textSize="@dimen/all_sub_title_size" android:textSize="@dimen/all_sub_title_size"
android:visibility="@{titleMode>1?View.GONE:View.VISIBLE}"
app:layout_constraintLeft_toRightOf="parent" app:layout_constraintLeft_toRightOf="parent"
app:layout_constraintRight_toLeftOf="parent" /> app:layout_constraintRight_toLeftOf="parent" />
......
<?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_left_right"
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
<?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>
<variable
name="titleMode"
type="int" />
</data>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<android.support.constraint.ConstraintLayout
android:id="@+id/cl_title"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="@color/white_caocao"
android:focusable="true"
android:focusableInTouchMode="true">
<ImageButton
android:id="@+id/btn_back"
android:layout_width="?attr/actionBarSize"
android:layout_height="match_parent"
android:background="?attr/actionBarItemBackground"
android:contentDescription="@string/all_go_back"
android:gravity="center"
android:padding="@dimen/all_margin"
android:src="@mipmap/back_black"
app:layout_constraintLeft_toLeftOf="parent" />
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginEnd="@dimen/all_margin"
android:visibility="@{titleMode==1||titleMode==6?8:0}"
app:layout_constraintBottom_toTopOf="parent"
app:layout_constraintLeft_toRightOf="@id/btn_back"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="parent">
<EditText
android:id="@+id/et_search"
style="@style/searchBarEditor"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:inputType="number"
android:labelFor="@+id/et_search"
android:textColor="@color/black_likui"
android:textColorHint="@color/gray_huanggai"
android:textSize="@dimen/all_text_size" />
</LinearLayout>
<TextView
android:id="@+id/tv_title"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="center"
android:text="@string/sssku_title"
android:textColor="@color/black_baozheng"
android:textSize="@dimen/all_sub_title_size"
android:visibility="@{titleMode==1||titleMode==6?0:8}"
app:layout_constraintLeft_toRightOf="parent"
app:layout_constraintRight_toLeftOf="parent" />
<View
android:layout_width="match_parent"
android:layout_height="@dimen/all_line_width"
android:background="@color/gray_huanggai"
app:layout_constraintBottom_toBottomOf="parent" />
</android.support.constraint.ConstraintLayout>
<FrameLayout
android:id="@+id/f_sssku"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</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">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/all_margin"
android:gravity="center"
android:text="提示"
android:textColor="@color/black_baozheng"
android:textSize="@dimen/all_sub_title_size"
android:textStyle="bold" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/all_margin"
android:layout_marginTop="@dimen/all_margin"
android:text="确定删除吗?"
android:textColor="@color/black_baozheng"
android:textSize="@dimen/all_body_size" />
</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">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/all_margin"
android:gravity="center"
android:text="提示"
android:textColor="@color/black_baozheng"
android:textSize="@dimen/all_sub_title_size"
android:textStyle="bold" />
<EditText
android:id="@+id/et_pwd"
style="@style/editText_new"
android:layout_marginBottom="@dimen/all_margin"
android:layout_marginTop="@dimen/et_margin_edittext"
android:hint="@string/skugrp_add_hint"
android:maxLength="16" />
</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">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@color/transparent">
</LinearLayout>
</layout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:tools="http://schemas.android.com/tools">
<data>
</data>
<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/white_caocao"
android:orientation="vertical"
android:splitMotionEvents="false">
<include
android:id="@+id/ic_title"
layout="@layout/title_order"
app:layout_constraintTop_toTopOf="parent" />
<View
android:layout_width="match_parent"
android:layout_height="@dimen/view_line_L050"
android:background="@color/gray_kongming" />
<LinearLayout
android:id="@+id/btn_add"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?android:attr/selectableItemBackground"
android:gravity="center"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawablePadding="@dimen/dp_4"
android:drawableStart="@mipmap/but_add"
android:gravity="center"
android:padding="@dimen/all_padding"
android:text="@string/manage_inventory_add"
android:textColor="@color/red_lvzhi"
android:textSize="@dimen/big_text_size" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="@dimen/view_line_L050"
android:background="@color/gray_kongming" />
<TextView
android:id="@+id/tv_count"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/gray_zhouyu"
android:paddingBottom="@dimen/all_padding"
android:paddingStart="@dimen/all_padding_left_right"
android:paddingTop="@dimen/all_padding"
android:text="共0人次盘库记录"
android:textColor="@color/black_baozheng"
android:textSize="@dimen/all_text_size_low"
android:textStyle="bold" />
<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_inventory"
android:background="@color/gray_zhouyu"
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
<?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>
<variable
name="cartCount"
type="int" />
<variable
name="result"
type="String" />
</data>
<android.support.constraint.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<include
android:id="@+id/ic_title"
layout="@layout/title_order"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tv_title_small"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/gray_zhouyu"
android:paddingBottom="@dimen/all_padding"
android:paddingStart="@dimen/all_padding_left_right"
android:paddingTop="@dimen/all_padding"
android:text="@string/manage_inventory_add_title"
android:textColor="@color/black_baozheng"
android:textSize="@dimen/all_text_size_small_title"
android:textStyle="bold"
app:layout_constraintTop_toBottomOf="@id/ic_title" />
<android.support.v7.widget.RecyclerView
android:id="@+id/recycler_view"
android:layout_width="0dp"
android:layout_height="0dp"
app:layout_constraintBottom_toTopOf="@id/fl_cart"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_title_small">
</android.support.v7.widget.RecyclerView>
<FrameLayout
android:id="@+id/fl_cart"
android:layout_width="0dp"
android:layout_height="?attr/actionBarSize"
android:background="@color/white_caocao"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/all_spacing"
android:animateLayoutChanges="true"
app:layout_constraintBottom_toTopOf="@id/fl_cart"
app:layout_constraintLeft_toRightOf="@id/fl_logo"
app:layout_constraintTop_toBottomOf="@id/fl_cart">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="结果:"
android:textColor="@color/black_baozheng"
android:textSize="@dimen/all_text_size" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textColor="@color/red_guanyu"
android:text="@{result}"
android:textSize="@dimen/all_sub_title_size"
android:textStyle="bold" />
</LinearLayout>
<TextView
android:id="@+id/tv_settle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/all_margin"
android:background="@drawable/shape_red_round_rectangle_more_round"
android:foreground="?android:attr/actionBarItemBackground"
android:paddingBottom="@dimen/all_spacing"
android:paddingEnd="@dimen/all_margin_big"
android:paddingStart="@dimen/all_margin_big"
android:paddingTop="@dimen/all_spacing"
android:text="@string/manage_inventory_add_end"
android:textColor="@color/white_caocao"
app:layout_constraintBottom_toTopOf="@id/fl_cart"
app:layout_constraintRight_toRightOf="@id/fl_cart"
app:layout_constraintTop_toBottomOf="@id/fl_cart" />
<FrameLayout
android:id="@+id/fl_logo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/all_margin_big"
android:animateLayoutChanges="true"
app:layout_constraintBottom_toBottomOf="@id/tv_settle"
app:layout_constraintLeft_toLeftOf="@id/fl_cart">
<ImageView
android:id="@+id/iv_cart"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/all_spacing"
android:contentDescription="@string/store_cart"
android:foreground="?attr/actionBarItemBackground"
android:src="@mipmap/shopping_cart" />
<TextView
android:layout_width="@dimen/store_cart_count"
android:layout_height="@dimen/store_cart_count"
android:layout_gravity="end"
android:background="@drawable/shape_white_oval"
android:gravity="center"
android:text='@{cartCount+""}'
android:textColor="@color/red_guanyu"
android:textSize="@dimen/all_caption_size"
android:textStyle="bold" />
</FrameLayout>
</android.support.constraint.ConstraintLayout>
</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" />
......
...@@ -7,6 +7,50 @@ ...@@ -7,6 +7,50 @@
android:background="@color/gray_zhouyu" android:background="@color/gray_zhouyu"
android:orientation="vertical"> android:orientation="vertical">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="@color/white_caocao"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginEnd="@dimen/all_margin"
android:layout_marginStart="@dimen/all_margin"
android:background="@drawable/shape_gray_r1"
android:gravity="center_vertical"
android:padding="@dimen/all_spacing">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/shape_red_r1"
android:paddingBottom="@dimen/all_shape_radius"
android:paddingEnd="@dimen/all_spacing"
android:paddingStart="@dimen/all_spacing"
android:paddingTop="@dimen/all_shape_radius"
android:text="@string/ms_user_title"
android:textColor="@color/white_caocao" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/all_spacing"
android:layout_weight="1"
android:singleLine="true"
android:text="@string/ms_user_hint"
android:textColor="@color/black_baozheng" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="@dimen/all_line_width"
android:layout_gravity="bottom"
android:background="@color/gray_kongming" />
</FrameLayout>
<LinearLayout <LinearLayout
android:id="@+id/ll_add" android:id="@+id/ll_add"
......
<?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">
<android.support.design.widget.CoordinatorLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/gray_zhouyu"
android:orientation="vertical">
</android.support.design.widget.CoordinatorLayout>
</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">
<data>
</data>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/gray_zhouyu"
android:orientation="vertical">
<android.support.v7.widget.RecyclerView
android:id="@+id/rl_sku"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="@dimen/all_margin" />
</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">
<data>
<variable
name="shopName"
type="String" />
<variable
name="address"
type="String" />
<variable
name="phone"
type="String" />
<variable
name="stock"
type="String" />
</data>
<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:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="¥"
android:layout_marginBottom="@dimen/view_line_L2"
android:textColor="@color/red_lvzhi"
android:textSize="@dimen/all_text_size_small"
app:layout_constraintBottom_toBottomOf="@id/tv_price"
app:layout_constraintEnd_toStartOf="@id/tv_price"
/>
<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:textColor="@color/red_lvzhi"
android:textSize="@dimen/big_text_size"
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
style="@style/textView_body"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@drawable/singleline_white_gray"
android:text="邻库" />
<TextView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@drawable/singleline_white_gray"
android:gravity="right"
android:padding="@dimen/all_padding"
android:text="@{stock}"
android:textColor="@color/red_lvzhi" />
</LinearLayout>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white_caocao"
android:drawablePadding="@dimen/all_padding"
android:drawableStart="@mipmap/icon_stores"
android:paddingStart="@dimen/all_padding_left_right"
android:paddingEnd="@dimen/all_padding_left_right"
android:paddingTop="@dimen/all_padding_left_right"
android:text="@{shopName}"
android:textSize="@dimen/all_text_size_low" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:drawablePadding="@dimen/all_padding"
android:background="@color/white_caocao"
android:drawableStart="@mipmap/icon_address"
android:paddingStart="@dimen/all_padding_left_right"
android:paddingEnd="@dimen/all_padding_left_right"
android:paddingTop="@dimen/all_padding_left_right"
android:text="@{address}"
android:textSize="@dimen/all_text_size_low" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:drawablePadding="@dimen/all_padding"
android:background="@color/white_caocao"
android:drawableStart="@mipmap/icon_telephone"
android:paddingStart="@dimen/all_padding_left_right"
android:paddingEnd="@dimen/all_padding_left_right"
android:paddingTop="@dimen/all_padding_left_right"
android:paddingBottom="@dimen/all_padding_left_right"
android:text="@{phone}"
android:textSize="@dimen/all_text_size_low" />
</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
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
android:background="@color/gray_kongming" /> android:background="@color/gray_kongming" />
<LinearLayout <LinearLayout
android:id="@+id/btn_add"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="?android:attr/selectableItemBackground" android:background="?android:attr/selectableItemBackground"
...@@ -31,7 +32,7 @@ ...@@ -31,7 +32,7 @@
android:orientation="horizontal"> android:orientation="horizontal">
<TextView <TextView
android:id="@+id/btn_add"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:drawablePadding="@dimen/dp_4" android:drawablePadding="@dimen/dp_4"
......
...@@ -55,525 +55,504 @@ ...@@ -55,525 +55,504 @@
type="String" /> type="String" />
</data> </data>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" <RelativeLayout 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"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="@color/white" android:background="@color/gray_zhouyu"
android:splitMotionEvents="false"> android:splitMotionEvents="false">
<!--<android.support.v7.widget.CardView--> <include
<!--android:id="@+id/f_left"--> android:id="@+id/ly_title"
<!--android:layout_width="0dp"--> layout="@layout/title_order"
<!--android:layout_height="0dp"--> app:layout_constraintTop_toTopOf="parent" />
<!--android:layout_marginEnd="@dimen/all_padding"-->
<!--android:background="@color/white"--> <android.support.constraint.ConstraintLayout
<!--app:cardElevation="@dimen/all_padding"--> android:id="@+id/cl_default"
<!--app:layout_constraintBottom_toBottomOf="parent"--> android:layout_width="match_parent"
<!--app:layout_constraintHorizontal_weight="10"--> android:layout_height="wrap_content"
<!--app:layout_constraintLeft_toLeftOf="parent"--> android:layout_below="@id/ly_title"
<!--app:layout_constraintRight_toLeftOf="@+id/f_right"--> android:layout_marginTop="@dimen/all_margin"
<!--app:layout_constraintTop_toTopOf="parent"--> android:background="@color/white_caocao">
<!--app:layout_constraintVertical_weight="25">-->
<TextView
<!--<android.support.constraint.ConstraintLayout--> android:id="@+id/tv_supplier_title"
<!--android:layout_width="match_parent"--> android:layout_width="match_parent"
<!--android:layout_height="match_parent"--> android:layout_height="wrap_content"
<!--android:background="@color/white">--> android:layout_marginEnd="@dimen/all_padding_left_right"
android:paddingBottom="@dimen/all_padding"
android:paddingStart="@dimen/all_padding_left_right"
<!--<TextView--> android:paddingTop="@dimen/all_padding"
<!--android:id="@+id/tv_supplier_title"--> android:text="供货方"
<!--android:layout_width="wrap_content"--> android:textColor="@color/black"
<!--android:layout_height="wrap_content"--> android:textSize="@dimen/all_text_size"
<!--android:layout_margin="@dimen/all_margin"--> android:visibility="@{isShowSupplier? View.VISIBLE: View.GONE}"
<!--android:text="供货方"--> app:layout_constraintLeft_toLeftOf="parent"
<!--android:textColor="@color/black"--> app:layout_constraintRight_toRightOf="parent"
<!--android:textSize="@dimen/all_text_size_big"--> app:layout_constraintStart_toStartOf="parent"
<!--android:visibility="@{isShowSupplier? View.VISIBLE: View.GONE}"--> app:layout_constraintTop_toTopOf="parent" />
<!--app:layout_constraintStart_toStartOf="parent"-->
<!--app:layout_constraintTop_toTopOf="parent" />--> <TextView
android:id="@+id/tv_supplier_name"
<!--<View--> android:layout_width="wrap_content"
<!--android:id="@+id/view_line_left_1"--> android:layout_height="wrap_content"
<!--android:layout_width="match_parent"--> android:layout_margin="@dimen/all_margin"
<!--android:layout_height="@dimen/all_slight_line_width"--> android:drawableStart="@mipmap/icon_stores"
<!--android:layout_margin="@dimen/all_margin"--> android:text="@{supplierName}"
<!--android:background="@color/line"--> android:textColor="@color/black"
<!--android:visibility="@{isShowSupplier? View.VISIBLE: View.GONE}"--> android:textSize="@dimen/all_text_size_low"
<!--app:layout_constraintTop_toBottomOf="@id/tv_supplier_title" />--> android:visibility="@{isShowSupplier? View.VISIBLE: View.GONE}"
app:layout_constraintBottom_toBottomOf="@id/tv_supplier_title"
app:layout_constraintEnd_toEndOf="@id/tv_supplier_title"
<!--<LinearLayout--> app:layout_constraintTop_toTopOf="@id/tv_supplier_title" />
<!--android:id="@+id/ll_supplier_name"-->
<!--android:layout_width="0dp"--> <View
<!--android:layout_height="wrap_content"--> android:layout_width="match_parent"
<!--android:layout_margin="@dimen/all_margin"--> android:layout_height="@dimen/all_slight_line_width"
<!--android:gravity="center_vertical"--> android:background="@color/gray_kongming"
<!--android:orientation="horizontal"--> android:visibility="@{isShowSupplier? View.VISIBLE: View.GONE}"
<!--android:visibility="@{isShowSupplier? View.VISIBLE: View.GONE}"--> app:layout_constraintTop_toTopOf="@id/tv_supplier_title" />
<!--app:layout_constraintEnd_toEndOf="parent"-->
<!--app:layout_constraintStart_toStartOf="parent"--> <View
<!--app:layout_constraintTop_toTopOf="@id/view_line_left_1">--> android:id="@+id/view_line_left_1"
android:layout_width="match_parent"
<!--<ImageView--> android:layout_height="@dimen/all_slight_line_width"
<!--android:layout_width="wrap_content"--> android:background="@color/gray_kongming"
<!--android:layout_height="wrap_content"--> android:visibility="@{isShowSupplier? View.VISIBLE: View.GONE}"
<!--android:src="@mipmap/icon_stores" />--> app:layout_constraintTop_toBottomOf="@id/tv_supplier_title" />
<!--<TextView--> <LinearLayout
<!--android:layout_width="wrap_content"--> android:id="@+id/ll_supplier"
<!--android:layout_height="wrap_content"--> android:layout_width="match_parent"
<!--android:paddingBottom="@dimen/dp_4"--> android:layout_height="wrap_content"
<!--android:paddingLeft="@dimen/all_padding"--> android:orientation="vertical"
<!--android:paddingTop="@dimen/dp_4"--> android:paddingEnd="@dimen/all_padding_left_right"
<!--android:text="@{supplierName}"--> android:paddingStart="@dimen/all_padding_left_right"
<!--android:textColor="@color/black" />--> android:visibility="gone"
<!--</LinearLayout>--> app:layout_constraintTop_toTopOf="@id/view_line_left_1">
<!--<LinearLayout--> <LinearLayout
<!--android:id="@+id/ll_supplier_address"--> android:id="@+id/ll_supplier_name"
<!--android:layout_width="0dp"--> android:layout_width="match_parent"
<!--android:layout_height="wrap_content"--> android:layout_height="wrap_content"
<!--android:gravity="center_vertical"--> android:gravity="center_vertical"
android:orientation="horizontal"
<!--android:orientation="horizontal"--> android:visibility="@{isShowSupplier? View.VISIBLE: View.GONE}">
<!--android:visibility="@{isShowSupplier? View.VISIBLE: View.GONE}"-->
<!--app:layout_constraintEnd_toEndOf="@id/ll_supplier_name"--> <ImageView
<!--app:layout_constraintStart_toStartOf="@id/ll_supplier_name"--> android:layout_width="wrap_content"
<!--app:layout_constraintTop_toBottomOf="@id/ll_supplier_name">--> android:layout_height="wrap_content"
android:src="@mipmap/icon_stores" />
<!--<ImageView-->
<!--android:layout_width="wrap_content"--> <TextView
<!--android:layout_height="wrap_content"--> android:layout_width="wrap_content"
<!--android:src="@mipmap/icon_address" />--> android:layout_height="wrap_content"
android:paddingBottom="@dimen/dp_4"
<!--<TextView--> android:paddingLeft="@dimen/all_padding"
<!--android:layout_width="wrap_content"--> android:paddingTop="@dimen/dp_4"
<!--android:layout_height="wrap_content"--> android:text="@{supplierName}"
<!--android:paddingBottom="@dimen/dp_4"--> android:textColor="@color/black"
<!--android:paddingLeft="@dimen/all_padding"--> android:textSize="@dimen/all_text_size_low" />
<!--android:paddingTop="@dimen/dp_4"--> </LinearLayout>
<!--android:text="@{supplierAddress}"-->
<!--android:textColor="@color/black" />--> <LinearLayout
<!--</LinearLayout>--> android:id="@+id/ll_supplier_address"
android:layout_width="match_parent"
<!--<LinearLayout--> android:layout_height="wrap_content"
<!--android:id="@+id/ll_supplier_phone"--> android:gravity="center_vertical"
<!--android:layout_width="0dp"-->
<!--android:layout_height="wrap_content"--> android:orientation="horizontal"
<!--android:gravity="center_vertical"--> android:visibility="@{isShowSupplier? View.VISIBLE: View.GONE}">
<!--android:orientation="horizontal"--> <ImageView
<!--android:visibility="@{isShowSupplier? View.VISIBLE: View.GONE}"--> android:layout_width="wrap_content"
<!--app:layout_constraintEnd_toEndOf="@id/ll_supplier_name"--> android:layout_height="wrap_content"
<!--app:layout_constraintStart_toStartOf="@id/ll_supplier_name"--> android:src="@mipmap/icon_address" />
<!--app:layout_constraintTop_toBottomOf="@id/ll_supplier_address">-->
<TextView
<!--<ImageView--> android:layout_width="wrap_content"
<!--android:layout_width="wrap_content"--> android:layout_height="wrap_content"
<!--android:layout_height="wrap_content"--> android:paddingBottom="@dimen/dp_4"
<!--android:src="@mipmap/icon_telephone" />--> android:paddingLeft="@dimen/all_padding"
android:paddingTop="@dimen/dp_4"
<!--<TextView--> android:text="@{supplierAddress}"
<!--android:layout_width="wrap_content"--> android:textColor="@color/black"
<!--android:layout_height="wrap_content"--> android:textSize="@dimen/all_text_size_low" />
<!--android:paddingBottom="@dimen/dp_4"--> </LinearLayout>
<!--android:paddingLeft="@dimen/all_padding"-->
<!--android:paddingTop="@dimen/dp_4"--> <LinearLayout
<!--android:text="@{supplierTel}"--> android:id="@+id/ll_supplier_phone"
<!--android:textColor="@color/black" />--> android:layout_width="match_parent"
<!--</LinearLayout>--> android:layout_height="wrap_content"
android:gravity="center_vertical"
<!--<TextView--> android:orientation="horizontal"
<!--android:id="@+id/tv_shop_title"--> android:visibility="@{isShowSupplier? View.VISIBLE: View.GONE}">
<!--android:layout_width="wrap_content"-->
<!--android:layout_height="wrap_content"--> <ImageView
<!--android:layout_marginEnd="@dimen/all_margin"--> android:layout_width="wrap_content"
<!--android:layout_marginStart="@dimen/all_margin"--> android:layout_height="wrap_content"
<!--android:layout_marginTop="@dimen/all_margin_big"--> android:src="@mipmap/icon_telephone" />
<!--android:text="定货方"-->
<!--android:textColor="@color/black"--> <TextView
<!--android:textSize="@dimen/all_text_size_big"--> android:layout_width="wrap_content"
<!--app:layout_constraintStart_toStartOf="parent"--> android:layout_height="wrap_content"
<!--app:layout_constraintTop_toBottomOf="@id/ll_supplier_phone"--> android:paddingBottom="@dimen/dp_4"
<!--app:layout_goneMarginTop="@dimen/all_margin" />--> android:paddingLeft="@dimen/all_padding"
android:paddingTop="@dimen/dp_4"
<!--<View--> android:text="@{supplierTel}"
<!--android:id="@+id/view_line_left_2"--> android:textColor="@color/black"
<!--android:layout_width="match_parent"--> android:textSize="@dimen/all_text_size_low" />
<!--android:layout_height="@dimen/all_slight_line_width"--> </LinearLayout>
<!--android:layout_margin="@dimen/all_margin"-->
<!--android:background="@color/line"-->
</LinearLayout>
<!--app:layout_constraintTop_toBottomOf="@id/tv_shop_title" />-->
<TextView
android:id="@+id/tv_shop_title"
<!--<LinearLayout--> android:layout_width="match_parent"
<!--android:id="@+id/ll_shop_name"--> android:layout_height="wrap_content"
<!--android:layout_width="0dp"--> android:layout_marginEnd="@dimen/all_padding_left_right"
<!--android:layout_height="wrap_content"--> android:paddingBottom="@dimen/all_padding"
<!--android:layout_margin="@dimen/all_margin"--> android:paddingStart="@dimen/all_padding_left_right"
<!--android:gravity="center_vertical"--> android:paddingTop="@dimen/all_padding"
<!--android:orientation="horizontal"--> android:text="定货方"
<!--app:layout_constraintEnd_toEndOf="parent"--> android:textColor="@color/black"
<!--app:layout_constraintStart_toStartOf="parent"--> android:textSize="@dimen/all_text_size"
<!--app:layout_constraintTop_toTopOf="@id/view_line_left_2">--> app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/ll_supplier"
<!--<ImageView--> />
<!--android:layout_width="wrap_content"-->
<!--android:layout_height="wrap_content"--> <TextView
<!--android:src="@mipmap/icon_stores" />--> android:id="@+id/tv_shop_name"
android:layout_width="wrap_content"
<!--<TextView--> android:layout_height="wrap_content"
<!--android:layout_width="wrap_content"--> android:layout_marginEnd="@dimen/all_margin"
<!--android:layout_height="wrap_content"--> android:drawableStart="@mipmap/icon_stores"
<!--android:paddingBottom="@dimen/dp_4"--> android:text="@{shopName}"
<!--android:paddingLeft="@dimen/all_padding"--> android:textColor="@color/black"
<!--android:paddingTop="@dimen/dp_4"--> android:textSize="@dimen/all_text_size"
<!--android:text="@{shopName}"--> app:layout_constraintBottom_toBottomOf="@id/tv_shop_title"
<!--android:textColor="@color/black" />--> app:layout_constraintEnd_toEndOf="@id/tv_shop_title"
<!--</LinearLayout>--> app:layout_constraintTop_toTopOf="@id/tv_shop_title" />
<!--<LinearLayout--> <View
<!--android:id="@+id/ll_shop_address"--> android:layout_width="match_parent"
<!--android:layout_width="0dp"--> android:layout_height="@dimen/all_slight_line_width"
<!--android:layout_height="wrap_content"--> android:background="@color/gray_kongming"
app:layout_constraintTop_toTopOf="@id/tv_shop_title" />
<!--android:gravity="center_vertical"-->
<!--android:orientation="horizontal"--> <View
<!--app:layout_constraintEnd_toEndOf="@id/ll_shop_name"--> android:id="@+id/view_line_left_2"
<!--app:layout_constraintStart_toStartOf="@id/ll_shop_name"--> android:layout_width="match_parent"
<!--app:layout_constraintTop_toBottomOf="@id/ll_shop_name">--> android:layout_height="@dimen/all_slight_line_width"
android:background="@color/gray_kongming"
<!--<ImageView--> app:layout_constraintTop_toBottomOf="@id/tv_shop_title" />
<!--android:layout_width="wrap_content"-->
<!--android:layout_height="wrap_content"--> <LinearLayout
<!--android:src="@mipmap/icon_address" />--> android:id="@+id/ll_shop"
android:layout_width="match_parent"
<!--<TextView--> android:layout_height="wrap_content"
<!--android:layout_width="wrap_content"--> android:orientation="vertical"
<!--android:layout_height="wrap_content"--> android:paddingEnd="@dimen/all_padding_left_right"
<!--android:paddingBottom="@dimen/dp_4"--> android:paddingStart="@dimen/all_padding_left_right"
<!--android:paddingLeft="@dimen/all_padding"--> android:visibility="gone"
<!--android:paddingTop="@dimen/dp_4"--> app:layout_constraintTop_toBottomOf="@id/tv_shop_title">
<!--android:text="@{shopAddress}"-->
<!--android:textColor="@color/black" />--> <LinearLayout
<!--</LinearLayout>--> android:id="@+id/ll_shop_name"
android:layout_width="match_parent"
<!--<LinearLayout--> android:layout_height="wrap_content"
<!--android:id="@+id/ll_shop_phone"--> android:gravity="center_vertical"
<!--android:layout_width="0dp"--> android:orientation="horizontal"
<!--android:layout_height="wrap_content"--> app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
<!--android:gravity="center_vertical"--> app:layout_constraintTop_toTopOf="@id/view_line_left_2">
<!--android:orientation="horizontal"-->
<!--app:layout_constraintEnd_toEndOf="@id/ll_shop_name"--> <ImageView
<!--app:layout_constraintStart_toStartOf="@id/ll_shop_name"--> android:layout_width="wrap_content"
<!--app:layout_constraintTop_toBottomOf="@id/ll_shop_address">--> android:layout_height="wrap_content"
android:src="@mipmap/icon_stores" />
<!--<ImageView-->
<!--android:layout_width="wrap_content"--> <TextView
<!--android:layout_height="wrap_content"--> android:layout_width="wrap_content"
<!--android:src="@mipmap/icon_telephone" />--> android:layout_height="wrap_content"
android:paddingBottom="@dimen/dp_4"
<!--<TextView--> android:paddingLeft="@dimen/all_padding"
<!--android:layout_width="wrap_content"--> android:paddingTop="@dimen/dp_4"
<!--android:layout_height="wrap_content"--> android:text="@{shopName}"
<!--android:paddingBottom="@dimen/dp_4"--> android:textColor="@color/black"
<!--android:paddingLeft="@dimen/all_padding"--> android:textSize="@dimen/all_text_size_low" />
<!--android:paddingTop="@dimen/dp_4"--> </LinearLayout>
<!--android:text="@{shopTel}"-->
<!--android:textColor="@color/black" />--> <LinearLayout
<!--</LinearLayout>--> android:id="@+id/ll_shop_address"
android:layout_width="match_parent"
<!--<View--> android:layout_height="wrap_content"
<!--android:id="@+id/view_line_left_3"-->
<!--android:layout_width="match_parent"--> android:gravity="center_vertical"
<!--android:layout_height="@dimen/all_slight_line_width"--> android:orientation="horizontal"
<!--android:layout_margin="@dimen/all_margin"--> app:layout_constraintEnd_toEndOf="@id/ll_shop_name"
<!--android:background="@color/line"--> app:layout_constraintStart_toStartOf="@id/ll_shop_name"
app:layout_constraintTop_toBottomOf="@id/ll_shop_name">
<!--android:visibility="@{isShowSupplier? View.VISIBLE: View.GONE}"-->
<!--app:layout_constraintTop_toBottomOf="@id/ll_shop_phone" />--> <ImageView
android:layout_width="wrap_content"
<!--<LinearLayout--> android:layout_height="wrap_content"
<!--android:id="@+id/ll_date"--> android:src="@mipmap/icon_address" />
<!--android:layout_width="0dp"-->
<!--android:layout_height="wrap_content"--> <TextView
<!--android:layout_marginTop="@dimen/all_margin"--> android:layout_width="wrap_content"
<!--android:gravity="center_vertical"--> android:layout_height="wrap_content"
<!--android:orientation="horizontal"--> android:paddingBottom="@dimen/dp_4"
<!--android:visibility="@{isShowSupplier? View.VISIBLE: View.GONE}"--> android:paddingLeft="@dimen/all_padding"
<!--app:layout_constraintEnd_toEndOf="@id/ll_shop_name"--> android:paddingTop="@dimen/dp_4"
<!--app:layout_constraintStart_toStartOf="@id/ll_shop_name"--> android:text="@{shopAddress}"
<!--app:layout_constraintTop_toBottomOf="@id/view_line_left_3">--> android:textColor="@color/black"
android:textSize="@dimen/all_text_size_low" />
<!--<ImageView--> </LinearLayout>
<!--android:layout_width="wrap_content"-->
<!--android:layout_height="wrap_content"--> <LinearLayout
<!--android:src="@mipmap/icon_dates_green" />--> android:id="@+id/ll_shop_phone"
android:layout_width="match_parent"
<!--<TextView--> android:layout_height="wrap_content"
<!--android:layout_width="wrap_content"--> android:gravity="center_vertical"
<!--android:layout_height="wrap_content"--> android:orientation="horizontal"
<!--android:paddingBottom="@dimen/dp_4"-->
<!--android:paddingLeft="@dimen/all_padding"--> app:layout_constraintEnd_toEndOf="@id/ll_shop_name"
<!--android:paddingTop="@dimen/dp_4"--> app:layout_constraintStart_toStartOf="@id/ll_shop_name"
<!--android:text="@{date}"--> app:layout_constraintTop_toBottomOf="@id/ll_shop_address">
<!--android:textColor="@color/black" />-->
<!--</LinearLayout>--> <ImageView
android:layout_width="wrap_content"
<!--<LinearLayout--> android:layout_height="wrap_content"
<!--android:id="@+id/ll_no"--> android:src="@mipmap/icon_telephone" />
<!--android:layout_width="0dp"-->
<!--android:layout_height="wrap_content"--> <TextView
<!--android:gravity="center_vertical"--> android:layout_width="wrap_content"
android:layout_height="wrap_content"
<!--android:orientation="horizontal"--> android:paddingBottom="@dimen/dp_4"
<!--android:visibility="@{isShowSupplier? View.VISIBLE: View.GONE}"--> android:paddingLeft="@dimen/all_padding"
<!--app:layout_constraintEnd_toEndOf="@id/ll_shop_name"--> android:paddingTop="@dimen/dp_4"
<!--app:layout_constraintStart_toStartOf="@id/ll_shop_name"--> android:text="@{shopTel}"
<!--app:layout_constraintTop_toBottomOf="@id/ll_date">--> android:textColor="@color/black"
android:textSize="@dimen/all_text_size_low" />
<!--<ImageView--> </LinearLayout>
<!--android:layout_width="wrap_content"--> </LinearLayout>
<!--android:layout_height="wrap_content"-->
<!--android:src="@mipmap/icon_no_green" />-->
<View
<!--<TextView--> android:id="@+id/view_line_left_3"
<!--android:layout_width="wrap_content"--> android:layout_width="match_parent"
<!--android:layout_height="wrap_content"--> android:layout_height="@dimen/all_slight_line_width"
<!--android:paddingBottom="@dimen/dp_4"--> android:background="@color/gray_kongming"
<!--android:paddingLeft="@dimen/all_padding"--> android:visibility="@{isShowSupplier? View.VISIBLE: View.GONE}"
<!--android:paddingTop="@dimen/dp_4"--> app:layout_constraintTop_toBottomOf="@id/ll_shop" />
<!--android:text="@{no}"-->
<!--android:textColor="@color/black" />--> <LinearLayout
<!--</LinearLayout>--> android:id="@+id/ll_date"
android:layout_width="0dp"
android:layout_height="wrap_content"
<!--<LinearLayout--> android:gravity="center_vertical"
<!--android:id="@+id/ll_result"--> android:orientation="horizontal"
<!--android:layout_width="0dp"--> android:paddingEnd="@dimen/all_padding_left_right"
<!--android:layout_height="wrap_content"--> android:paddingStart="@dimen/all_padding_left_right"
<!--android:layout_marginBottom="@dimen/all_margin"--> android:visibility="@{isShowSupplier? View.VISIBLE: View.GONE}"
<!--android:gravity="center"--> app:layout_constraintEnd_toEndOf="@id/ll_shop"
<!--android:orientation="horizontal"--> app:layout_constraintStart_toStartOf="@id/ll_shop"
<!--app:layout_constraintBottom_toBottomOf="parent"--> app:layout_constraintTop_toBottomOf="@id/view_line_left_3">
<!--app:layout_constraintEnd_toEndOf="parent"-->
<!--app:layout_constraintHorizontal_weight="1"--> <ImageView
<!--app:layout_constraintStart_toEndOf="@id/ll_num">--> android:layout_width="wrap_content"
android:layout_height="wrap_content"
<!--<TextView--> android:src="@mipmap/icon_dates_green" />
<!--android:layout_width="wrap_content"-->
<!--android:layout_height="wrap_content"--> <TextView
<!--android:gravity="center"--> android:layout_width="wrap_content"
<!--android:paddingBottom="@dimen/dp_4"--> android:layout_height="wrap_content"
<!--android:paddingLeft="@dimen/all_padding"--> android:paddingBottom="@dimen/dp_4"
<!--android:paddingRight="@dimen/all_padding"--> android:paddingLeft="@dimen/all_padding"
<!--android:paddingTop="@dimen/dp_4"--> android:paddingTop="@dimen/dp_4"
<!--android:text="@{finallyPrice}"--> android:text="@{date}"
<!--android:textColor="@color/reddeep"--> android:textColor="@color/black"
<!--android:textSize="@dimen/all_text_size_big" />--> android:textSize="@dimen/all_text_size_low" />
<!--</LinearLayout>--> </LinearLayout>
<LinearLayout
<!--<LinearLayout--> android:id="@+id/ll_no"
<!--android:id="@+id/ll_num"--> android:layout_width="0dp"
<!--android:layout_width="0dp"--> android:layout_height="wrap_content"
<!--android:layout_height="wrap_content"--> android:gravity="center_vertical"
<!--android:gravity="center"--> android:orientation="horizontal"
<!--android:orientation="horizontal"--> android:paddingEnd="@dimen/all_padding_left_right"
<!--app:layout_constraintBottom_toBottomOf="@id/ll_result"--> android:paddingStart="@dimen/all_padding_left_right"
<!--app:layout_constraintEnd_toStartOf="@id/ll_result"--> android:visibility="@{isShowSupplier? View.VISIBLE: View.GONE}"
<!--app:layout_constraintHorizontal_weight="1"--> app:layout_constraintEnd_toEndOf="@id/ll_shop"
<!--app:layout_constraintStart_toStartOf="parent"--> app:layout_constraintStart_toStartOf="@id/ll_shop"
<!--app:layout_constraintTop_toTopOf="@id/ll_result">--> app:layout_constraintTop_toBottomOf="@id/ll_date">
<!--<TextView--> <ImageView
<!--android:layout_width="wrap_content"--> android:layout_width="wrap_content"
<!--android:layout_height="wrap_content"--> android:layout_height="wrap_content"
<!--android:padding="@dimen/dp_4"--> android:src="@mipmap/icon_no_green" />
<!--android:text="@{sumNum}"-->
<!--android:textColor="@color/reddeep"--> <TextView
<!--android:textSize="@dimen/all_text_size_big"--> android:layout_width="wrap_content"
<!--android:textStyle="bold" />--> android:layout_height="wrap_content"
android:paddingBottom="@dimen/dp_4"
android:paddingLeft="@dimen/all_padding"
<!--</LinearLayout>--> android:paddingTop="@dimen/dp_4"
android:text="@{no}"
<!--<TextView--> android:textColor="@color/black"
<!--android:id="@+id/tv_result_hint"--> android:textSize="@dimen/all_text_size_low" />
<!--android:layout_width="wrap_content"--> </LinearLayout>
<!--android:layout_height="wrap_content"-->
<!--android:layout_margin="@dimen/all_margin"-->
<!--android:text="金额"--> <LinearLayout
<!--android:textColor="@color/black"--> android:id="@+id/ll_result"
<!--app:layout_constraintBottom_toTopOf="@id/ll_result"--> android:layout_width="0dp"
<!--app:layout_constraintEnd_toEndOf="@id/ll_result"--> android:layout_height="wrap_content"
<!--app:layout_constraintStart_toStartOf="@id/ll_result" />--> android:layout_marginBottom="@dimen/all_margin"
android:gravity="center"
<!--<TextView--> android:orientation="horizontal"
<!--android:layout_width="wrap_content"--> app:layout_constraintEnd_toEndOf="parent"
<!--android:layout_height="wrap_content"--> app:layout_constraintHorizontal_weight="1"
<!--android:layout_margin="@dimen/all_margin"--> app:layout_constraintStart_toEndOf="@id/ll_num"
<!--android:text="种类"--> app:layout_constraintTop_toBottomOf="@id/tv_result_hint">
<!--android:textColor="@color/black"-->
<!--app:layout_constraintBottom_toBottomOf="@id/tv_result_hint"--> <TextView
<!--app:layout_constraintEnd_toEndOf="@id/ll_num"--> android:layout_width="wrap_content"
<!--app:layout_constraintStart_toStartOf="@id/ll_num"--> android:layout_height="wrap_content"
<!--app:layout_constraintTop_toTopOf="@id/tv_result_hint" />--> android:gravity="center"
android:paddingBottom="@dimen/dp_4"
<!--<View--> android:paddingLeft="@dimen/all_padding"
<!--android:id="@+id/view_line_left_bottom"--> android:paddingRight="@dimen/all_padding"
<!--android:layout_width="match_parent"--> android:paddingTop="@dimen/all_padding"
<!--android:layout_height="@dimen/all_margin"--> android:text="@{finallyPrice}"
<!--android:layout_marginBottom="100dp"--> android:textColor="@color/reddeep"
<!--android:background="@color/lyt_main_bg"--> android:textSize="@dimen/big_big_text_size" />
<!--app:layout_constraintBottom_toBottomOf="parent" />--> </LinearLayout>
<!--</android.support.constraint.ConstraintLayout>-->
<!--</android.support.v7.widget.CardView>-->
<LinearLayout
android:id="@+id/ll_num"
<!--<android.support.constraint.ConstraintLayout--> android:layout_width="0dp"
<!--android:id="@+id/f_right"--> android:layout_height="wrap_content"
<!--android:layout_width="0dp"--> android:gravity="center"
<!--android:layout_height="0dp"--> android:orientation="horizontal"
<!--android:background="@color/white"--> app:layout_constraintBottom_toBottomOf="@id/ll_result"
<!--android:splitMotionEvents="false"--> app:layout_constraintEnd_toStartOf="@id/ll_result"
<!--app:layout_constraintBottom_toBottomOf="parent"--> app:layout_constraintHorizontal_weight="1"
<!--app:layout_constraintHorizontal_weight="22"--> app:layout_constraintStart_toStartOf="parent"
<!--app:layout_constraintLeft_toRightOf="@+id/f_left"--> app:layout_constraintTop_toTopOf="@id/ll_result">
<!--app:layout_constraintRight_toRightOf="parent"-->
<!--app:layout_constraintTop_toTopOf="parent"--> <TextView
<!--app:layout_constraintVertical_weight="25">--> android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="@dimen/all_padding"
<!--<EditText--> android:text="@{sumNum}"
<!--android:id="@+id/et_keyword"--> android:textColor="@color/reddeep"
<!--style="@style/dialog_edit"--> android:textSize="@dimen/big_big_text_size"
<!--android:layout_width="wrap_content"--> android:textStyle="bold" />
<!--android:layout_height="0dp"-->
<!--android:layout_marginEnd="@dimen/all_margin"-->
<!--android:drawableEnd="@mipmap/ic_scan"--> </LinearLayout>
<!--android:hint="@string/inventory_add_et_hint"-->
<!--android:inputType="number"--> <View
<!--android:maxLength="19"--> android:layout_width="match_parent"
<!--android:minWidth="@dimen/fragment_store_et_min_width"--> android:layout_height="@dimen/all_slight_line_width"
<!--android:paddingEnd="@dimen/fragment_detail_padding_end"--> android:background="@color/gray_kongming"
<!--android:paddingStart="@dimen/all_margin"--> app:layout_constraintTop_toBottomOf="@id/ll_no" />
<!--android:singleLine="true"-->
<!--app:layout_constraintBottom_toBottomOf="@id/btn_search"--> <TextView
<!--app:layout_constraintRight_toRightOf="@id/btn_search"--> android:id="@+id/tv_result_hint"
<!--app:layout_constraintTop_toTopOf="@id/btn_search" />--> android:layout_width="wrap_content"
android:layout_height="wrap_content"
<!--<ImageButton--> android:layout_marginEnd="8dp"
<!--android:id="@+id/btn_search"--> android:paddingTop="@dimen/all_padding"
<!--android:layout_width="@dimen/fragment_store_btn_width"--> android:text="金额"
<!--android:layout_height="@dimen/fragment_store_et_height"--> android:textColor="@color/black"
<!--android:layout_marginEnd="@dimen/all_margin"--> android:textSize="@dimen/all_text_size_low"
<!--android:layout_marginTop="@dimen/all_margin"--> app:layout_constraintEnd_toEndOf="@+id/ll_result"
<!--android:background="@drawable/shape_store_btn_search_select"--> app:layout_constraintStart_toStartOf="@id/ll_result"
<!--android:contentDescription="@string/store_search"--> app:layout_constraintTop_toBottomOf="@id/ll_no" />
<!--android:scaleType="centerInside"-->
<!--android:src="@mipmap/store_search"--> <TextView
<!--app:layout_constraintEnd_toEndOf="parent"--> android:layout_width="wrap_content"
<!--app:layout_constraintTop_toTopOf="parent" />--> android:layout_height="wrap_content"
android:layout_margin="@dimen/all_margin"
<!--<TextView--> android:paddingTop="@dimen/all_padding"
<!--android:layout_width="wrap_content"--> android:text="缺货种类"
<!--android:layout_height="wrap_content"--> android:textColor="@color/black"
<!--android:layout_margin="@dimen/all_margin"--> android:textSize="@dimen/all_text_size_low"
<!--android:text="@string/replenishment_detail_title"--> app:layout_constraintBottom_toBottomOf="@id/tv_result_hint"
<!--android:textColor="@color/black"--> app:layout_constraintEnd_toEndOf="@id/ll_num"
<!--android:textSize="@dimen/all_sub_title_size"--> app:layout_constraintStart_toStartOf="@id/ll_num"
<!--app:layout_constraintBottom_toBottomOf="@id/et_keyword"--> app:layout_constraintTop_toTopOf="@id/tv_result_hint" />
<!--app:layout_constraintStart_toStartOf="parent"-->
<!--app:layout_constraintTop_toTopOf="@id/et_keyword" />--> <TextView
android:layout_width="match_parent"
<!--<View--> android:layout_height="wrap_content"
<!--android:id="@+id/view_line"--> android:background="@color/gray_zhouyu"
<!--android:layout_width="match_parent"--> android:padding="@dimen/all_padding_left_right"
<!--android:layout_height="@dimen/all_slight_line_width"--> android:text="定货明细"
<!--android:layout_marginLeft="@dimen/all_padding"--> android:textColor="@color/black_baozheng"
<!--android:layout_marginRight="@dimen/all_margin"--> android:textSize="@dimen/all_text_size_small_title"
<!--android:layout_marginTop="@dimen/all_padding"--> android:textStyle="bold"
<!--android:background="@color/line"--> app:layout_constraintTop_toBottomOf="@id/ll_result" />
<!--app:layout_constraintTop_toBottomOf="@id/et_keyword" />--> </android.support.constraint.ConstraintLayout>
<!--<android.support.v7.widget.RecyclerView--> <android.support.v7.widget.RecyclerView
<!--android:id="@+id/replenishment_right_recycler"--> android:id="@+id/recycler_view"
<!--android:layout_width="0dp"--> android:layout_width="match_parent"
<!--android:layout_height="0dp"--> android:layout_height="wrap_content"
<!--android:layout_marginTop="@dimen/view_line_L1"--> android:layout_above="@id/ll_bottom"
<!--android:splitMotionEvents="false"--> android:layout_below="@id/cl_default">
<!--app:layout_constraintBottom_toTopOf="@id/cl_btn"-->
<!--app:layout_constraintEnd_toEndOf="parent"--> </android.support.v7.widget.RecyclerView>
<!--app:layout_constraintStart_toStartOf="parent"-->
<!--app:layout_constraintTop_toBottomOf="@id/view_line" />--> <LinearLayout
android:id="@+id/ll_bottom"
<!--<android.support.constraint.ConstraintLayout--> android:layout_width="match_parent"
<!--android:id="@+id/cl_btn"--> android:layout_height="wrap_content"
<!--android:layout_width="match_parent"--> android:layout_alignParentBottom="true"
<!--android:layout_height="100dp"--> android:layout_alignParentStart="true"
<!--app:layout_constraintBottom_toBottomOf="parent"--> android:background="@color/white_caocao"
<!--app:layout_constraintTop_toBottomOf="@id/replenishment_right_recycler">--> android:elevation="@dimen/view_line_L2"
android:orientation="horizontal"
<!--<View--> app:layout_constraintBottom_toBottomOf="parent">
<!--android:layout_width="match_parent"-->
<!--android:layout_height="@dimen/all_slight_line_width"--> <Button
<!--android:layout_marginLeft="@dimen/all_padding"--> android:id="@+id/btn_cancel"
<!--android:layout_marginRight="@dimen/all_margin"--> style="@style/button_passive"
<!--android:layout_marginTop="@dimen/view_line_L1"--> android:layout_width="0dp"
<!--android:background="@color/line"--> android:layout_height="wrap_content"
android:layout_margin="@dimen/all_padding"
<!--app:layout_constraintTop_toTopOf="parent" />--> android:layout_weight="1"
android:stateListAnimator="@null"
<!--<Button--> android:text="取消"
<!--android:id="@+id/btn_end"--> android:textSize="@dimen/all_text_size"
<!--style="@style/button_positive"--> app:layout_constraintBottom_toBottomOf="parent"
<!--android:layout_width="wrap_content"--> app:layout_constraintLeft_toLeftOf="parent"
<!--android:layout_height="wrap_content"--> app:layout_constraintRight_toLeftOf="@id/btn_confirm"
<!--android:layout_marginBottom="@dimen/all_margin"--> app:layout_constraintTop_toTopOf="parent" />
<!--android:layout_marginLeft="@dimen/all_margin"-->
<!--android:layout_marginRight="@dimen/all_margin"--> <Button
<!--android:stateListAnimator="@null"--> android:id="@+id/btn_ok"
<!--android:text="@string/replenishment_detail_submit"--> style="@style/button_positive"
<!--app:layout_constraintBottom_toBottomOf="parent"--> android:layout_width="0dp"
<!--app:layout_constraintEnd_toEndOf="parent" />--> android:layout_height="wrap_content"
android:layout_margin="@dimen/all_padding"
<!--<Button--> android:layout_weight="1"
<!--android:id="@+id/btn_print"--> android:stateListAnimator="@null"
<!--style="@style/button_positive"--> android:text="定货提交"
<!--android:layout_width="wrap_content"--> android:textSize="@dimen/all_text_size"
<!--android:layout_height="wrap_content"--> app:layout_constraintBottom_toBottomOf="parent"
<!--android:layout_marginBottom="@dimen/all_margin"--> app:layout_constraintLeft_toRightOf="@id/btn_cancel"
<!--android:layout_marginLeft="@dimen/all_margin"--> app:layout_constraintRight_toRightOf="parent"
<!--android:layout_marginRight="@dimen/all_margin"--> app:layout_constraintTop_toTopOf="parent" />
<!--android:stateListAnimator="@null"-->
<!--android:text="@string/replenishment_detail_print"--> </LinearLayout>
<!--android:visibility="gone"--> </RelativeLayout>
<!--app:layout_constraintBottom_toBottomOf="parent"-->
<!--app:layout_constraintStart_toStartOf="parent" />-->
<!--<Button-->
<!--android:id="@+id/btn_canel"-->
<!--style="@style/button_passive"-->
<!--android:layout_width="wrap_content"-->
<!--android:layout_height="wrap_content"-->
<!--android:layout_marginBottom="@dimen/all_margin"-->
<!--android:layout_marginEnd="@dimen/all_margin_big"-->
<!--android:stateListAnimator="@null"-->
<!--android:text="@string/replenishment_detail_cancel"-->
<!--app:layout_constraintBottom_toBottomOf="parent"-->
<!--app:layout_constraintEnd_toStartOf="@id/btn_end"-->
<!--app:layout_goneMarginLeft="@dimen/all_margin"-->
<!--app:layout_goneMarginRight="@dimen/all_margin" />-->
<!--</android.support.constraint.ConstraintLayout>-->
<!--</android.support.constraint.ConstraintLayout>-->
</android.support.constraint.ConstraintLayout>
</layout> </layout>
\ No newline at end of file
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/all_line_width" android:layout_height="@dimen/all_line_width"
android:layout_gravity="bottom" android:layout_gravity="bottom"
android:layout_marginTop="@dimen/all_margin" android:layout_marginTop="@dimen/all_spacing"
android:background="@color/gray_huanggai" /> android:background="@color/gray_huanggai" />
<LinearLayout <LinearLayout
......
<?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="match_parent"
android:background="@color/red_guanyu"
android:orientation="vertical">
<TextView
android:id="@+id/tv_edit"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="编辑" />
</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">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/blue_mawu"
android:orientation="vertical">
</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">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/gray_zhouyu"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white_caocao"
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingBottom="@dimen/all_margin"
android:paddingTop="@dimen/all_margin">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="共"
android:textColor="@color/black_baozheng" />
<TextView
android:id="@+id/tv_total_count"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/all_spacing"
android:layout_marginStart="@dimen/all_spacing"
android:textColor="@color/black_baozheng"
android:textSize="@dimen/all_title_size" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="件"
android:textColor="@color/black_baozheng" />
</LinearLayout>
<View
android:layout_width="@dimen/view_line_L2"
android:layout_height="match_parent"
android:background="@color/golden_yuji" />
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="center_vertical"
android:text="今日需补货"
android:textColor="@color/black_baozheng" />
<TextView
android:id="@+id/tv_replenish_count"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/all_spacing"
android:text="6"
android:textColor="@color/red_guanyu"
android:textSize="@dimen/all_title_size" />
</LinearLayout>
<TextView
android:id="@+id/tv_replenish"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginEnd="@dimen/all_margin"
android:background="@drawable/shape_red_round_rectangle_more_round"
android:foreground="?android:attr/actionBarItemBackground"
android:gravity="center"
android:paddingBottom="@dimen/all_spacing"
android:paddingEnd="@dimen/all_margin_big"
android:paddingStart="@dimen/all_margin_big"
android:paddingTop="@dimen/all_spacing"
android:text="一键补货"
android:textColor="@color/white_caocao" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="@dimen/all_line_width"
android:background="@color/gray_huanggai" />
<View
android:layout_width="match_parent"
android:layout_height="@dimen/all_line_width"
android:layout_marginTop="@dimen/all_margin"
android:background="@color/gray_huanggai" />
<LinearLayout
android:id="@+id/ll_sssku_add"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white_caocao"
android:foreground="?android:attr/selectableItemBackground"
android:gravity="center"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="?attr/actionBarSize"
android:drawablePadding="@dimen/all_spacing"
android:drawableStart="@mipmap/add_bg"
android:gravity="center"
android:text="@string/sssku_add"
android:textColor="@color/red_guanyu"
android:textSize="@dimen/all_sub_title_size" />
<View
android:layout_width="match_parent"
android:layout_height="@dimen/all_line_width"
android:background="@color/gray_kongming" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:baselineAligned="false">
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="vertical">
<android.support.v7.widget.RecyclerView
android:id="@+id/rl_skugrp"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<FrameLayout
android:id="@+id/ll_skugrp_add"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:foreground="?android:attr/selectableItemBackground">
<ImageView
android:layout_width="match_parent"
android:layout_height="@dimen/all_sub_title_size"
android:layout_gravity="center"
android:contentDescription="@null"
android:src="@mipmap/grp_add" />
</FrameLayout>
</LinearLayout>
<android.support.v4.widget.SwipeRefreshLayout
android:id="@+id/srl_sku"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="3"
android:background="@color/white_caocao">
<android.support.v7.widget.RecyclerView
android:id="@+id/rl_sku"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</android.support.v4.widget.SwipeRefreshLayout>
</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">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/gray_zhouyu"
android:orientation="vertical">
<android.support.v7.widget.RecyclerView
android:id="@+id/rl_sku"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</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">
<data>
<variable
name="visibility"
type="int" />
</data>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<View
android:layout_width="match_parent"
android:layout_height="@dimen/all_line_width"
android:background="@color/gray_kongming" />
<LinearLayout
android:id="@+id/ll_skugrp_add"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white_caocao"
android:foreground="?android:attr/selectableItemBackground"
android:gravity="center"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="?attr/actionBarSize"
android:drawablePadding="@dimen/all_spacing"
android:drawableStart="@mipmap/add_bg"
android:gravity="center"
android:text="@string/sssku_skugrp_add"
android:textColor="@color/red_guanyu"
android:textSize="@dimen/all_sub_title_size" />
<View
android:layout_width="match_parent"
android:layout_height="@dimen/all_line_width"
android:background="@color/gray_huanggai" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="@dimen/all_line_width"
android:layout_marginTop="@dimen/all_margin"
android:background="@color/gray_huanggai"
android:visibility="@{visibility}" />
<android.support.v7.widget.RecyclerView
android:id="@+id/rl_skugrp"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
</layout>
\ No newline at end of file
...@@ -2,11 +2,6 @@ ...@@ -2,11 +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>
</data>
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
...@@ -16,7 +11,6 @@ ...@@ -16,7 +11,6 @@
<android.support.v7.widget.RecyclerView <android.support.v7.widget.RecyclerView
android:id="@+id/rl_sku" android:id="@+id/rl_sku"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent" />
android:layout_marginTop="@dimen/all_margin" />
</LinearLayout> </LinearLayout>
</layout> </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">
<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="@color/white_caocao"
android:padding="@dimen/all_padding_left_right">
<ImageView
android:id="@+id/img"
android:layout_width="50dp"
android:layout_height="50dp"
android:src="@mipmap/img_boss"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tv_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="@dimen/all_padding_left_right"
android:text=""
android:textColor="@color/black"
android:textSize="@dimen/all_text_size"
app:layout_constraintBottom_toBottomOf="@id/img"
app:layout_constraintStart_toEndOf="@id/img"
app:layout_constraintTop_toTopOf="@id/img" />
<TextView
android:id="@+id/tv_phone"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingStart="@dimen/all_padding_left_right"
android:text=""
android:textColor="@color/black"
android:textSize="@dimen/all_text_size_low"
app:layout_constraintBottom_toBottomOf="@id/tv_name"
app:layout_constraintStart_toEndOf="@id/tv_name" />
<View
android:id="@+id/view_line"
android:layout_width="match_parent"
android:layout_height="@dimen/view_line_L050"
android:layout_marginTop="@dimen/all_padding_left_right"
android:background="@color/gray_kongming"
app:layout_constraintTop_toBottomOf="@id/img" />
<TextView
android:id="@+id/tv_unit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/singleline_white_gray"
android:padding="@dimen/all_padding"
android:text="件"
android:textColor="@color/black"
android:textSize="@dimen/sp_14"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@id/view_line" />
<TextView
android:id="@+id/tv_num"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="0dp"
android:paddingEnd="@dimen/all_padding"
android:text=""
android:textColor="@color/black"
android:textSize="@dimen/all_text_size_low"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="@id/tv_unit"
app:layout_constraintEnd_toStartOf="@id/tv_unit"
app:layout_constraintTop_toTopOf="@id/tv_unit" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:background="@drawable/singleline_white_gray"
android:padding="@dimen/all_padding"
android:text="盘点件数:"
android:textColor="@color/black"
android:textSize="@dimen/all_text_size_low"
app:layout_constraintBottom_toBottomOf="@id/tv_unit"
app:layout_constraintEnd_toStartOf="@id/tv_unit"
app:layout_constraintStart_toStartOf="parent" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:background="@drawable/singleline_white_gray"
android:padding="@dimen/all_padding"
android:text="盘点结果:"
android:textColor="@color/black"
android:textSize="@dimen/all_text_size_low"
app:layout_constraintEnd_toStartOf="@id/tv_result"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_unit" />
<TextView
android:id="@+id/tv_result"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/singleline_white_gray"
android:padding="@dimen/all_padding"
android:paddingEnd="@dimen/all_margin"
android:text="不相符"
android:textColor="@color/black"
android:textSize="@dimen/all_text_size_low"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_unit" />
<TextView
android:id="@+id/tv_date"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="@dimen/all_padding"
android:text="2017-10-01 12:25"
android:textColor="@color/black_baozheng"
android:textSize="@dimen/all_text_size_low"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_result" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="@dimen/all_padding"
android:text="盘点时间"
android:textColor="@color/black_baozheng"
android:textSize="@dimen/all_text_size_low"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_result" />
<ImageView
android:id="@+id/img_inventory"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@mipmap/ic_not_consistent"
app:layout_constraintBottom_toBottomOf="@id/tv_result"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@id/tv_result" />
</android.support.constraint.ConstraintLayout>
</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">
<data>
<import type="android.view.View" />
<variable
name="count"
type="long" />
</data>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="@color/white_caocao"
android:gravity="center"
android:paddingEnd="@dimen/all_margin"
android:paddingStart="@dimen/all_margin">
<TextView
android:id="@+id/tv_name"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="2"
android:singleLine="true"
android:textColor="@color/black_baozheng"
android:textSize="@dimen/all_text_size" />
<TextView
android:id="@+id/tv_price"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:textColor="@color/black_baozheng"
android:textSize="@dimen/all_text_size" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="@dimen/all_line_width"
android:layout_marginEnd="@dimen/all_margin"
android:layout_marginStart="@dimen/all_margin"
android:background="@color/gray_kongming" />
</LinearLayout>
</layout>
<?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:padding="@dimen/all_padding">
<com.facebook.drawee.view.SimpleDraweeView
android:id="@+id/img_goods"
android:layout_width="65dp"
android:layout_height="65dp"
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"
style="@style/other_select_smallstyle"
android:layout_width="wrap_content"
android:layout_height="28dp"
android:layout_marginTop="@dimen/all_padding"
android:text="条码:"
app:layout_constraintStart_toStartOf="@id/tv_goods_name"
app:layout_constraintTop_toBottomOf="@id/tv_goods_name" />
<TextView
android:id="@+id/tv_goods_code"
style="@style/other_select_smallstyle"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:text="12783163981789"
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_constraintBottom_toBottomOf="@id/tv_goods_code"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@id/tv_goods_code" />
<TextView
android:id="@+id/tv_goods_price"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="999"
android:textColor="@color/store_product_price"
android:textSize="@dimen/big_text_size"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="@id/tv_price_hint"
app:layout_constraintStart_toEndOf="@id/tv_rmb"
app:layout_constraintTop_toTopOf="@id/tv_price_hint"
/>
<TextView
android:id="@+id/tv_rmb"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/dp_4"
android:text="@string/money_rmb"
android:textColor="@color/store_product_price"
android:textSize="@dimen/all_text_size_small"
app:layout_constraintBottom_toBottomOf="@id/tv_price_hint"
app:layout_constraintStart_toEndOf="@+id/tv_price_hint"
/>
<LinearLayout
android:id="@+id/linearLayout"
android:layout_width="wrap_content"
android:layout_height="@dimen/dialog_cart_item_button_height"
android:gravity="center"
android:orientation="horizontal"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tv_num_hint">
<ImageButton
android:id="@+id/btn_down"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginEnd="@dimen/all_margin"
android:layout_weight="1"
android:background="@color/white"
android:src="@mipmap/but_reduce" />
<EditText
android:id="@+id/et_count"
android:layout_width="50dp"
android:layout_height="match_parent"
android:layout_marginBottom="@dimen/dp_4"
android:layout_marginTop="@dimen/dp_4"
android:layout_weight="1"
android:background="@drawable/selector_edit_frame_blue_background"
android:gravity="center"
android:hint="1"
android:inputType="number"
android:maxLength="4"
android:saveEnabled="false"
android:textSize="@dimen/all_text_size_low" />
<ImageButton
android:id="@+id/btn_up"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginStart="@dimen/all_margin"
android:layout_weight="1"
android:background="@color/white"
android:src="@mipmap/but_add"
tools:layout_editor_absoluteX="666dp"
tools:layout_editor_absoluteY="97dp" />
</LinearLayout>
<TextView
android:id="@+id/tv_num_hint"
style="@style/other_select_smallstyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/all_padding"
android:text="构成数量:"
android:textStyle="bold"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_goods_price" />
<TextView
android:id="@+id/tv_stock_hint"
style="@style/other_select_smallstyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/all_padding"
android:layout_marginStart="@dimen/all_padding_left_right"
android:text="系统库存:"
android:textStyle="bold"
app:layout_constraintStart_toEndOf="@id/tv_goods_price"
app:layout_constraintTop_toBottomOf="@id/tv_goods_code_hint" />
<TextView
android:id="@+id/tv_stock"
style="@style/other_select_smallstyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="0个"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="@id/tv_stock_hint"
app:layout_constraintStart_toEndOf="@id/tv_stock_hint"
app:layout_constraintTop_toTopOf="@id/tv_stock_hint" />
<TextView
android:id="@+id/tv_price_hint"
style="@style/other_select_smallstyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/all_padding"
android:text="进价:"
android:textStyle="bold"
app:layout_constraintStart_toStartOf="@id/tv_goods_code_hint"
app:layout_constraintTop_toBottomOf="@id/tv_goods_code_hint" />
<TextView
android:id="@+id/btn_ok"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/shape_red_round_rectangle_more_round"
android:foreground="?android:attr/actionBarItemBackground"
android:paddingBottom="@dimen/all_spacing"
android:paddingEnd="@dimen/all_margin_big"
android:paddingStart="@dimen/all_margin_big"
android:paddingTop="@dimen/all_spacing"
android:text="@string/all_confirm"
android:textColor="@color/white_caocao"
app:layout_constraintBottom_toBottomOf="@id/linearLayout"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@id/linearLayout" />
</android.support.constraint.ConstraintLayout>
</layout>
\ No newline at end of file
...@@ -9,9 +9,9 @@ ...@@ -9,9 +9,9 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="@dimen/all_padding_left_right" android:layout_marginTop="@dimen/all_padding_left_right"
android:background="@color/white" android:background="@color/white"
android:foreground="?android:attr/selectableItemBackground"
android:orientation="horizontal"> android:orientation="horizontal">
...@@ -28,10 +28,9 @@ ...@@ -28,10 +28,9 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_toLeftOf="@+id/iv" android:layout_toLeftOf="@+id/iv"
android:paddingTop="@dimen/all_padding"
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">
<ImageView <ImageView
android:id="@+id/iv_logo" android:id="@+id/iv_logo"
...@@ -55,6 +54,7 @@ ...@@ -55,6 +54,7 @@
android:layout_height="@dimen/view_line_L050" android:layout_height="@dimen/view_line_L050"
android:layout_alignParentTop="true" android:layout_alignParentTop="true"
android:background="@color/gray_kongming" /> android:background="@color/gray_kongming" />
<View <View
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/view_line_L050" android:layout_height="@dimen/view_line_L050"
......
<?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">
<data>
<import type="android.view.View" />
<variable
name="count"
type="int" />
</data>
<android.support.constraint.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white_caocao"
android:foreground="?android:attr/selectableItemBackground"
android:paddingEnd="@dimen/all_margin"
android:paddingStart="@dimen/all_margin"
android:paddingTop="@dimen/all_margin">
<com.facebook.drawee.view.SimpleDraweeView
android:id="@+id/iv_pic"
android:layout_width="80dp"
android:layout_height="80dp"
app:failureImage="@mipmap/icon_goods_default"
app:placeholderImage="@mipmap/icon_goods_default"
app:roundedCornerRadius="@dimen/all_shape_radius" />
<TextView
android:id="@+id/tv_name"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/all_margin"
android:lines="2"
android:textColor="@color/black_baozheng"
android:textSize="@dimen/all_text_size"
app:layout_constraintLeft_toRightOf="@id/iv_pic"
app:layout_constraintRight_toRightOf="parent" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/all_margin"
app:layout_constraintLeft_toLeftOf="@id/tv_name"
app:layout_constraintTop_toBottomOf="@id/tv_name">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/money_rmb"
android:textColor="@color/red_guanyu"
android:textSize="@dimen/all_caption_size"
android:textStyle="bold" />
<TextView
android:id="@+id/tv_amt"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/red_guanyu"
android:textSize="@dimen/all_text_size"
android:textStyle="bold" />
</LinearLayout>
<View
android:layout_width="0dp"
android:layout_height="@dimen/all_line_width"
android:layout_marginTop="@dimen/all_margin"
android:background="@color/gray_kongming"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/iv_pic" />
</android.support.constraint.ConstraintLayout>
</layout>
<?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
...@@ -67,10 +67,10 @@ ...@@ -67,10 +67,10 @@
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:paddingTop="@dimen/all_padding" android:paddingStart="@dimen/all_padding"
android:text="@{shopName}" android:text="@{shopName}"
android:textColor="@color/black" android:textColor="@color/black"
android:textSize="@dimen/all_text_size" /> android:textSize="@dimen/all_text_size_low" />
</LinearLayout> </LinearLayout>
<TextView <TextView
...@@ -108,7 +108,7 @@ ...@@ -108,7 +108,7 @@
android:paddingTop="@dimen/dp_4" android:paddingTop="@dimen/dp_4"
android:text="@{date}" android:text="@{date}"
android:textColor="@color/black" android:textColor="@color/black"
android:textSize="@dimen/all_text_size" /> android:textSize="@dimen/all_text_size_low" />
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout
...@@ -130,7 +130,7 @@ ...@@ -130,7 +130,7 @@
android:paddingStart="@dimen/all_padding" android:paddingStart="@dimen/all_padding"
android:text="@{no}" android:text="@{no}"
android:textColor="@color/black" android:textColor="@color/black"
android:textSize="@dimen/all_text_size" /> android:textSize="@dimen/all_text_size_low" />
</LinearLayout> </LinearLayout>
...@@ -192,7 +192,7 @@ ...@@ -192,7 +192,7 @@
android:padding="@dimen/dp_4" android:padding="@dimen/dp_4"
android:text="@{supplierName}" android:text="@{supplierName}"
android:textColor="@color/black" android:textColor="@color/black"
android:textSize="@dimen/all_text_size" /> android:textSize="@dimen/all_text_size_low" />
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout
...@@ -215,7 +215,7 @@ ...@@ -215,7 +215,7 @@
android:padding="@dimen/dp_4" android:padding="@dimen/dp_4"
android:text="@{supplierAddress}" android:text="@{supplierAddress}"
android:textColor="@color/black" android:textColor="@color/black"
android:textSize="@dimen/all_text_size" /> android:textSize="@dimen/all_text_size_low" />
</LinearLayout> </LinearLayout>
<android.support.constraint.Guideline <android.support.constraint.Guideline
......
...@@ -9,219 +9,190 @@ ...@@ -9,219 +9,190 @@
</data> </data>
<android.support.v7.widget.CardView <android.support.constraint.ConstraintLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="@dimen/all_padding" android:background="@drawable/singleline_white_gray"
android:layout_marginEnd="@dimen/all_margin" android:padding="@dimen/all_padding">
android:layout_marginStart="@dimen/all_padding"
android:layout_marginBottom="@dimen/all_padding" <com.facebook.drawee.view.SimpleDraweeView
app:cardCornerRadius="@dimen/all_shape_radius" android:id="@+id/img_goods"
app:cardElevation="1dp"> android:layout_width="65dp"
android:layout_height="65dp"
<!--<android.support.constraint.ConstraintLayout--> app:placeholderImage="@mipmap/icon_goods_default" />
<!--android:layout_width="match_parent"-->
<!--android:layout_height="wrap_content"--> <TextView
<!--android:padding="@dimen/all_padding"--> android:id="@+id/tv_goods_name"
<!--android:background="@drawable/black_border">--> style="@style/other_select_blacktext_style"
android:layout_width="0dp"
<!--<com.facebook.drawee.view.SimpleDraweeView--> android:layout_height="wrap_content"
<!--android:id="@+id/img_goods"--> android:layout_marginEnd="@dimen/all_padding_left_right"
<!--android:layout_width="130dp"--> android:layout_marginStart="@dimen/all_padding_left_right"
<!--android:layout_height="130dp"--> android:text="贝斯克莱因和美妖精生日巧克力蛋糕"
<!--app:placeholderImage="@mipmap/icon_goods_default" />--> app:layout_constraintStart_toEndOf="@id/img_goods"
app:layout_constraintTop_toTopOf="@id/img_goods" />
<!--<TextView-->
<!--android:id="@+id/tv_goods_name"--> <TextView
<!--style="@style/other_select_blacktext_style"--> android:id="@+id/tv_goods_code_hint"
<!--android:layout_width="0dp"--> style="@style/other_select_smallstyle"
<!--android:layout_height="wrap_content"--> android:layout_width="wrap_content"
<!--android:layout_marginEnd="@dimen/all_margin"--> android:layout_height="28dp"
<!--android:layout_marginTop="@dimen/all_margin"--> android:layout_marginTop="@dimen/all_padding"
<!--android:layout_marginStart="@dimen/all_padding"--> android:text="条码:"
<!--android:text="贝斯克莱因和美妖精生日巧克力蛋糕"--> app:layout_constraintStart_toStartOf="@id/tv_goods_name"
<!--app:layout_constraintEnd_toEndOf="@id/guideline_center"--> app:layout_constraintTop_toBottomOf="@id/tv_goods_name" />
<!--app:layout_constraintStart_toEndOf="@id/img_goods"-->
<!--app:layout_constraintTop_toTopOf="@id/img_goods" />--> <TextView
android:id="@+id/tv_goods_code"
<!--<TextView--> style="@style/other_select_smallstyle"
<!--android:id="@+id/tv_goods_code_hint"--> android:layout_width="wrap_content"
<!--style="@style/other_select_smallstyle"--> android:layout_height="0dp"
<!--android:layout_width="wrap_content"--> android:text="12783163981789"
<!--android:layout_height="wrap_content"--> app:layout_constraintBottom_toBottomOf="@id/tv_goods_code_hint"
<!--android:layout_marginTop="@dimen/all_padding"--> app:layout_constraintStart_toEndOf="@id/tv_goods_code_hint"
<!--android:text="条码:"--> app:layout_constraintTop_toTopOf="@id/tv_goods_code_hint" />
<!--app:layout_constraintStart_toStartOf="@id/tv_goods_name"-->
<!--app:layout_constraintTop_toBottomOf="@id/tv_goods_name" />-->
<TextView
<!--<TextView--> android:id="@+id/tv_goods_size"
<!--android:id="@+id/tv_goods_code"--> android:layout_width="wrap_content"
<!--style="@style/other_select_smallstyle"--> android:layout_height="wrap_content"
<!--android:layout_width="wrap_content"--> android:background="@drawable/frame_frame_zhouyu_bg"
<!--android:layout_height="0dp"--> android:padding="@dimen/dp_4"
<!--android:text="12783163981789"--> android:text="规格"
<!--app:layout_constraintBottom_toBottomOf="@id/tv_goods_code_hint"--> android:textSize="@dimen/all_text_size_small"
<!--app:layout_constraintStart_toEndOf="@id/tv_goods_code_hint"--> app:layout_constraintBottom_toBottomOf="@id/tv_goods_code"
<!--app:layout_constraintTop_toTopOf="@id/tv_goods_code_hint" />--> app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@id/tv_goods_code" />
<!--<TextView--> <TextView
<!--android:id="@+id/tv_goods_size"--> android:id="@+id/tv_goods_price"
<!--style="@style/store_product_size"--> android:layout_width="wrap_content"
<!--android:layout_width="wrap_content"--> android:layout_height="wrap_content"
<!--android:layout_height="wrap_content"--> android:text="999"
<!--android:text="规格"--> android:textColor="@color/store_product_price"
<!--app:layout_constraintBottom_toBottomOf="@id/tv_goods_price"--> android:textSize="@dimen/big_text_size"
<!--app:layout_constraintStart_toStartOf="@id/tv_goods_name"--> android:textStyle="bold"
<!--app:layout_constraintTop_toBottomOf="@id/tv_goods_code_hint" />--> app:layout_constraintBottom_toBottomOf="@id/tv_rmb"
app:layout_constraintStart_toEndOf="@id/tv_rmb"
<!--<TextView--> app:layout_constraintTop_toTopOf="@id/tv_price_hint" />
<!--android:id="@+id/tv_goods_price"-->
<!--android:layout_width="wrap_content"--> <TextView
<!--android:layout_height="wrap_content"--> android:id="@+id/tv_rmb"
<!--android:layout_marginBottom="@dimen/all_margin"--> android:layout_width="wrap_content"
<!--android:layout_marginEnd="@dimen/all_margin"--> android:layout_height="wrap_content"
<!--android:text="999"--> android:layout_marginBottom="2dp"
<!--android:textColor="@color/store_product_price"--> android:text="@string/money_rmb"
<!--android:textSize="@dimen/fragment_store_product_price"--> android:textColor="@color/store_product_price"
<!--app:layout_constraintBottom_toBottomOf="@id/img_goods"--> android:textSize="@dimen/all_text_size_small"
<!--app:layout_constraintEnd_toEndOf="@id/guideline_center" />--> app:layout_constraintBottom_toBottomOf="@id/tv_price_hint"
app:layout_constraintStart_toEndOf="@+id/tv_price_hint"
<!--<TextView--> app:layout_constraintTop_toTopOf="@id/tv_price_hint" />
<!--android:layout_width="wrap_content"-->
<!--android:layout_height="wrap_content"-->
<!--android:layout_marginBottom="2dp"--> <LinearLayout
<!--android:text="@string/money_rmb"--> android:id="@+id/linearLayout"
<!--android:textColor="@color/store_product_price"--> android:layout_width="wrap_content"
<!--android:textSize="@dimen/item_superpurchase_textsize_big"--> android:layout_height="@dimen/dialog_cart_item_button_height"
<!--app:layout_constraintBottom_toBottomOf="@id/tv_goods_price"--> android:gravity="center"
<!--app:layout_constraintEnd_toStartOf="@+id/tv_goods_price" />--> android:orientation="horizontal"
app:layout_constraintBottom_toBottomOf="@id/tv_price_hint"
app:layout_constraintEnd_toEndOf="parent">
<!--<View-->
<!--android:layout_width="@dimen/all_line_width"--> <ImageButton
<!--android:layout_height="0dp"--> android:id="@+id/btn_down"
<!--android:layout_marginBottom="@dimen/all_margin"--> android:layout_width="wrap_content"
<!--android:layout_marginTop="@dimen/all_margin"--> android:layout_height="match_parent"
<!--android:background="@color/lyt_main_bg"--> android:layout_marginEnd="@dimen/all_margin"
<!--app:layout_constraintBottom_toBottomOf="@id/img_goods"--> android:layout_weight="1"
<!--app:layout_constraintEnd_toEndOf="@id/guideline_center"--> android:background="@color/white"
<!--app:layout_constraintTop_toTopOf="@id/img_goods" />--> android:src="@mipmap/but_reduce" />
<!--<LinearLayout--> <EditText
<!--android:id="@+id/linearLayout"--> android:id="@+id/et_count"
<!--android:layout_width="wrap_content"--> android:layout_width="50dp"
<!--android:layout_height="@dimen/dialog_cart_item_button_height"--> android:layout_height="match_parent"
<!--android:layout_margin="@dimen/all_margin"--> android:layout_marginBottom="@dimen/dp_4"
<!--android:gravity="center"--> android:layout_marginTop="@dimen/dp_4"
<!--android:orientation="horizontal"--> android:layout_weight="1"
android:background="@drawable/selector_edit_frame_blue_background"
<!--app:layout_constraintBottom_toBottomOf="parent"--> android:gravity="center"
<!--app:layout_constraintEnd_toEndOf="parent"--> android:hint="1"
<!--app:layout_constraintStart_toStartOf="@id/guideline_center">--> android:inputType="number"
android:maxLength="4"
<!--<ImageButton--> android:saveEnabled="false"
<!--android:id="@+id/btn_down"--> android:textSize="@dimen/all_text_size_low" />
<!--android:layout_width="wrap_content"-->
<!--android:layout_height="match_parent"--> <ImageButton
<!--android:layout_marginEnd="@dimen/all_margin"--> android:id="@+id/btn_up"
<!--android:layout_weight="1"--> android:layout_width="wrap_content"
<!--android:background="@color/white"--> android:layout_height="match_parent"
<!--android:src="@mipmap/but_cut"--> android:layout_marginStart="@dimen/all_margin"
<!--tools:layout_editor_absoluteX="602dp"--> android:layout_weight="1"
<!--tools:layout_editor_absoluteY="97dp" />--> android:background="@color/white"
android:src="@mipmap/but_add"
<!--<EditText--> tools:layout_editor_absoluteX="666dp"
<!--android:id="@+id/et_count"--> tools:layout_editor_absoluteY="97dp" />
<!--android:layout_width="100dp"--> </LinearLayout>
<!--android:layout_height="match_parent"-->
<!--android:layout_weight="1"-->
<!--android:background="@drawable/hint_border"--> <TextView
<!--android:gravity="center"--> android:id="@+id/tv_stock_hint"
<!--android:hint="1"--> style="@style/other_select_smallstyle"
<!--android:inputType="number"--> android:layout_width="wrap_content"
<!--android:maxLength="4"--> android:layout_height="wrap_content"
<!--android:saveEnabled="false"--> android:layout_marginTop="@dimen/all_padding"
<!--tools:layout_editor_absoluteX="540dp"--> android:text="库存:"
<!--tools:layout_editor_absoluteY="192dp" />--> android:textStyle="bold"
app:layout_constraintStart_toStartOf="@id/tv_goods_code_hint"
<!--<ImageButton--> app:layout_constraintTop_toBottomOf="@id/tv_goods_code_hint" />
<!--android:id="@+id/btn_up"-->
<!--android:layout_width="wrap_content"--> <TextView
<!--android:layout_height="match_parent"--> android:id="@+id/tv_stock"
<!--android:layout_marginStart="@dimen/all_margin"--> style="@style/other_select_smallstyle"
<!--android:layout_weight="1"--> android:layout_width="wrap_content"
<!--android:background="@color/white"--> android:layout_height="wrap_content"
<!--android:src="@mipmap/but_plus"--> android:text="0个"
<!--tools:layout_editor_absoluteX="666dp"--> android:textStyle="bold"
<!--tools:layout_editor_absoluteY="97dp" />--> app:layout_constraintBottom_toBottomOf="@id/tv_stock_hint"
<!--</LinearLayout>--> app:layout_constraintStart_toEndOf="@id/tv_goods_code_hint"
app:layout_constraintTop_toTopOf="@id/tv_stock_hint" />
<!--<TextView--> <TextView
<!--android:id="@+id/tv_stock_hint"--> android:id="@+id/tv_traffic_hint"
<!--android:layout_width="0dp"--> style="@style/other_select_smallstyle"
<!--android:layout_height="wrap_content"--> android:layout_width="wrap_content"
<!--android:gravity="right"--> android:layout_height="wrap_content"
<!--android:text="库存:"--> android:layout_marginStart="@dimen/all_margin_big"
<!--android:textColor="@color/black"--> android:text="在途:"
<!--android:textSize="@dimen/big_text_size"--> android:textStyle="bold"
<!--app:layout_constraintBottom_toTopOf="@id/linearLayout"--> app:layout_constraintBottom_toBottomOf="@id/tv_stock"
<!--app:layout_constraintEnd_toStartOf="@id/tv_stock"--> app:layout_constraintStart_toEndOf="@id/tv_stock"
<!--app:layout_constraintHorizontal_weight="1"--> app:layout_constraintTop_toTopOf="@id/tv_stock" />
<!--app:layout_constraintStart_toStartOf="@id/guideline_center"-->
<!--app:layout_constraintTop_toTopOf="parent" />--> <TextView
android:id="@+id/tv_traffic"
<!--<TextView--> style="@style/other_select_smallstyle"
<!--android:id="@+id/tv_stock"--> android:layout_width="wrap_content"
<!--android:layout_width="0dp"--> android:layout_height="wrap_content"
<!--android:layout_height="wrap_content"--> android:text="0个"
<!--android:text="0个"--> android:textStyle="bold"
<!--android:textColor="@color/black"--> app:layout_constraintBottom_toBottomOf="@id/tv_traffic_hint"
<!--android:textSize="@dimen/big_text_size"--> app:layout_constraintStart_toEndOf="@id/tv_traffic_hint" />
<!--app:layout_constraintBottom_toTopOf="@id/linearLayout"-->
<!--app:layout_constraintEnd_toStartOf="@id/tv_traffic_hint"--> <TextView
<!--app:layout_constraintHorizontal_weight="1"--> android:id="@+id/tv_price_hint"
<!--app:layout_constraintStart_toEndOf="@id/tv_stock_hint"--> style="@style/other_select_smallstyle"
<!--app:layout_constraintTop_toTopOf="parent" />--> android:layout_width="wrap_content"
android:layout_height="wrap_content"
<!--<TextView--> android:layout_marginTop="@dimen/all_padding"
<!--android:id="@+id/tv_traffic_hint"--> android:text="进价:"
<!--android:layout_width="0dp"--> android:textStyle="bold"
<!--android:layout_height="wrap_content"--> app:layout_constraintStart_toStartOf="@id/tv_stock_hint"
<!--android:gravity="right"--> app:layout_constraintTop_toBottomOf="@id/tv_stock_hint" />
<!--android:text="在途:"-->
<!--android:textColor="@color/black"-->
<!--android:textSize="@dimen/big_text_size"--> </android.support.constraint.ConstraintLayout>
<!--app:layout_constraintBottom_toTopOf="@id/linearLayout"-->
<!--app:layout_constraintEnd_toStartOf="@id/tv_traffic"-->
<!--app:layout_constraintHorizontal_weight="1"-->
<!--app:layout_constraintStart_toEndOf="@id/tv_stock"-->
<!--app:layout_constraintTop_toTopOf="parent" />-->
<!--<TextView-->
<!--android:id="@+id/tv_traffic"-->
<!--android:layout_width="0dp"-->
<!--android:layout_height="wrap_content"-->
<!--android:text="0个"-->
<!--android:textColor="@color/black"-->
<!--android:textSize="@dimen/big_text_size"-->
<!--app:layout_constraintBottom_toTopOf="@id/linearLayout"-->
<!--app:layout_constraintEnd_toEndOf="parent"-->
<!--app:layout_constraintHorizontal_weight="1"-->
<!--app:layout_constraintStart_toEndOf="@id/tv_traffic_hint"-->
<!--app:layout_constraintTop_toTopOf="parent" />-->
<!--<android.support.constraint.Guideline-->
<!--android:id="@+id/guideline_center"-->
<!--android:layout_width="wrap_content"-->
<!--android:layout_height="wrap_content"-->
<!--android:orientation="vertical"-->
<!--app:layout_constraintGuide_percent="0.60" />-->
<!--</android.support.constraint.ConstraintLayout>-->
</android.support.v7.widget.CardView>
</layout> </layout>
\ No newline at end of file
...@@ -10,13 +10,13 @@ ...@@ -10,13 +10,13 @@
</data> </data>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="@dimen/all_padding" android:layout_marginTop="@dimen/all_padding"
android:orientation="horizontal"> android:orientation="horizontal">
<LinearLayout <LinearLayout
android:layout_width="wrap_content" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="@dimen/all_padding" android:layout_marginTop="@dimen/all_padding"
android:orientation="horizontal"> android:orientation="horizontal">
......
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:gravity="center" android:gravity="center"
android:text="撒看见那"
android:textColor="@color/black_baozheng" android:textColor="@color/black_baozheng"
android:textSize="@{selected?@dimen/all_sub_title_size:@dimen/all_text_size}" /> android:textSize="@{selected?@dimen/all_sub_title_size:@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">
<data>
<import type="android.view.View" />
<variable
name="spuName"
type="String" />
<variable
name="spuUnitName"
type="String" />
</data>
<android.support.constraint.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white_caocao"
android:foreground="?android:attr/selectableItemBackground"
android:paddingEnd="@dimen/all_margin"
android:paddingStart="@dimen/all_margin"
android:paddingTop="@dimen/all_margin">
<com.facebook.drawee.view.SimpleDraweeView
android:id="@+id/iv_pic"
android:layout_width="80dp"
android:layout_height="80dp"
app:failureImage="@mipmap/icon_goods_default"
app:placeholderImage="@mipmap/icon_goods_default"
app:roundedCornerRadius="@dimen/all_shape_radius" />
<TextView
android:id="@+id/tv_name"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/all_margin"
android:lines="2"
android:text="@{spuName}"
android:textColor="@color/black_baozheng"
android:textSize="@dimen/all_text_size"
app:layout_constraintLeft_toRightOf="@id/iv_pic"
app:layout_constraintRight_toRightOf="parent" />
<TextView
android:id="@+id/tv_size"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/all_margin"
android:background="@drawable/shape_gray_r1"
android:padding="@dimen/all_spacing"
android:text="@{@string/sku_size+spuUnitName}"
android:textSize="@dimen/all_caption_size"
app:layout_constraintBottom_toBottomOf="@id/ll_price"
app:layout_constraintLeft_toLeftOf="@id/tv_name" />
<LinearLayout
android:id="@+id/ll_price"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/all_margin"
app:layout_constraintRight_toRightOf="@id/tv_name"
app:layout_constraintTop_toBottomOf="@id/tv_name">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/money_rmb"
android:textColor="@color/red_guanyu"
android:textSize="@dimen/all_caption_size"
android:textStyle="bold" />
<TextView
android:id="@+id/tv_amt"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/red_guanyu"
android:textSize="@dimen/all_text_size"
android:textStyle="bold" />
</LinearLayout>
<View
android:layout_width="0dp"
android:layout_height="@dimen/all_line_width"
android:layout_marginTop="@dimen/all_margin"
android:background="@color/gray_kongming"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/iv_pic" />
</android.support.constraint.ConstraintLayout>
</layout>
...@@ -5,11 +5,12 @@ ...@@ -5,11 +5,12 @@
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="wrap_content" android:layout_height="wrap_content"
android:background="@color/white_caocao"> android:background="@color/white_caocao"
android:padding="@dimen/all_margin">
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="@dimen/editor_item_height" android:layout_height="wrap_content"
android:gravity="center" android:gravity="center"
android:text="@{@string/ms_editor_buy + @string/ms_editor_group_all_hint}" android:text="@{@string/ms_editor_buy + @string/ms_editor_group_all_hint}"
android:textColor="@color/black" android:textColor="@color/black"
......
...@@ -6,9 +6,10 @@ ...@@ -6,9 +6,10 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@color/white_caocao" android:background="@color/white_caocao"
android:orientation="vertical"> android:orientation="vertical"
android:padding="@dimen/all_margin">
<LinearLayout <android.support.constraint.ConstraintLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="horizontal"> android:orientation="horizontal">
...@@ -16,13 +17,14 @@ ...@@ -16,13 +17,14 @@
<TextView <TextView
android:id="@+id/tv_hint" android:id="@+id/tv_hint"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="@dimen/editor_item_height" android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/ms_editor_buy" android:text="@string/ms_editor_buy"
android:textColor="@color/black" android:textColor="@color/black"
android:textSize="@dimen/big_text_size" android:textSize="@dimen/big_text_size"
app:layout_constraintBottom_toBottomOf="@id/ns_type_1"
app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintRight_toLeftOf="@id/ns_type_1"
app:layout_constraintTop_toTopOf="@id/ns_type_1" />
<org.angmarch.views.NiceSpinner <org.angmarch.views.NiceSpinner
android:id="@+id/ns_type_1" android:id="@+id/ns_type_1"
...@@ -31,26 +33,30 @@ ...@@ -31,26 +33,30 @@
android:layout_marginStart="@dimen/all_spacing" android:layout_marginStart="@dimen/all_spacing"
android:layout_weight="1" android:layout_weight="1"
app:layout_constraintLeft_toRightOf="@id/tv_hint" app:layout_constraintLeft_toRightOf="@id/tv_hint"
app:layout_constraintTop_toTopOf="@id/tv_hint" /> app:layout_constraintRight_toLeftOf="@id/ns_type_2"
app:layout_constraintTop_toTopOf="parent" />
<org.angmarch.views.NiceSpinner <org.angmarch.views.NiceSpinner
android:id="@+id/ns_type_2" android:id="@+id/ns_type_2"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
app:layout_constraintLeft_toLeftOf="@id/ns_type_1" app:layout_constraintLeft_toRightOf="@id/ns_type_1"
app:layout_constraintTop_toBottomOf="@id/ns_type_1" /> app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<org.angmarch.views.NiceSpinner <org.angmarch.views.NiceSpinner
android:id="@+id/ns_type_3" android:id="@+id/ns_type_3"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:visibility="gone"
android:visibility="invisible" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="@id/ns_type_2" app:layout_constraintLeft_toLeftOf="@id/ns_type_1"
app:layout_constraintTop_toBottomOf="@id/ns_type_2" /> app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/ns_type_1" />
</android.support.constraint.ConstraintLayout>
</LinearLayout>
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
...@@ -59,9 +65,7 @@ ...@@ -59,9 +65,7 @@
android:gravity="center" android:gravity="center"
android:text="@string/ms_editor_group_skugrp_hint" android:text="@string/ms_editor_group_skugrp_hint"
android:textColor="@color/black" android:textColor="@color/black"
android:textSize="@dimen/big_text_size" android:textSize="@dimen/big_text_size" />
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="@id/ns_type_3" />
</LinearLayout> </LinearLayout>
</layout> </layout>
\ No newline at end of file
...@@ -2,6 +2,19 @@ ...@@ -2,6 +2,19 @@
<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="name"
type="String" />
<variable
name="price"
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"
...@@ -25,6 +38,7 @@ ...@@ -25,6 +38,7 @@
android:hint="@string/ms_editor_type_gift_search_hint" android:hint="@string/ms_editor_type_gift_search_hint"
android:inputType="text" android:inputType="text"
android:labelFor="@+id/et_search" android:labelFor="@+id/et_search"
android:saveEnabled="false"
android:textColor="@color/black_likui" android:textColor="@color/black_likui"
android:textColorHint="@color/gray_huanggai" android:textColorHint="@color/gray_huanggai"
android:textSize="@dimen/all_text_size" /> android:textSize="@dimen/all_text_size" />
...@@ -43,7 +57,8 @@ ...@@ -43,7 +57,8 @@
android:id="@+id/ll_product" android:id="@+id/ll_product"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical"> android:orientation="vertical"
android:visibility="@{name.length()>0?View.VISIBLE:View.GONE }">
<View <View
android:layout_width="match_parent" android:layout_width="match_parent"
...@@ -76,14 +91,14 @@ ...@@ -76,14 +91,14 @@
android:id="@+id/tv_product_name" android:id="@+id/tv_product_name"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/ms_editor_group_sku_name" /> android:text="@{@string/ms_editor_group_sku_name+name}" />
<TextView <TextView
android:id="@+id/tv_product_price" android:id="@+id/tv_product_price"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="@dimen/all_margin" android:layout_marginTop="@dimen/all_margin"
android:text="@string/ms_editor_group_sku_price" /> android:text="@{@string/ms_editor_group_sku_price+price}" />
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
......
<?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
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:gravity="center_vertical"
android:paddingEnd="@dimen/all_margin"
android:paddingStart="@dimen/all_margin">
<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" />
<RadioGroup
android:id="@+id/rg_type"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/all_margin"
android:gravity="center_vertical"
android:orientation="horizontal">
<RadioButton
android:id="@+id/rb_dis"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="true"
android:text="@string/ms_type_dis" />
<RadioButton
android:id="@+id/rb_second"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/all_margin"
android:text="@string/ms_type_second" />
</RadioGroup>
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="@dimen/all_line_width"
android:layout_marginEnd="@dimen/all_margin"
android:layout_marginStart="@dimen/all_margin"
android:background="@color/gray_kongming" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:gravity="center_vertical"
android:paddingEnd="@dimen/all_margin"
android:paddingStart="@dimen/all_margin">
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="center_vertical"
android:text="@string/ms_editor_type_dis_hint"
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>
</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">
<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
<?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/white_caocao"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:layout_marginEnd="@dimen/all_margin"
android:layout_marginStart="@dimen/all_margin"
android:gravity="center_vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/ms_editor_type_money_off_text1"
android:textColor="@color/black"
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_marginStart="@dimen/all_margin"
android:background="@color/gray_kongming" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:layout_marginEnd="@dimen/all_margin"
android:layout_marginStart="@dimen/all_margin"
android:gravity="center_vertical">
<TextView
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"
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>
</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">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white_caocao"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:gravity="center_vertical"
android:paddingEnd="@dimen/all_margin"
android:paddingStart="@dimen/all_margin">
<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" />
<RadioGroup
android:id="@+id/rg_type"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/all_margin"
android:gravity="center_vertical"
android:orientation="horizontal">
<RadioButton
android:id="@+id/rb_pro"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="true"
android:text="@string/ms_type_promotion" />
<RadioButton
android:id="@+id/rb_second_pro"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/all_margin"
android:text="@string/ms_type_second_pro" />
</RadioGroup>
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="@dimen/all_line_width"
android:layout_marginEnd="@dimen/all_margin"
android:layout_marginStart="@dimen/all_margin"
android:background="@color/gray_kongming" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/all_margin"
android:layout_marginStart="@dimen/all_margin"
android:layout_marginTop="@dimen/all_margin"
android:gravity="center_vertical"
android:text="@string/ms_editor_type_promotion_text1"
android:textColor="@color/black_baozheng"
android:textSize="@dimen/all_text_size" />
<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>
</layout>
\ No newline at end of file
...@@ -125,7 +125,7 @@ ...@@ -125,7 +125,7 @@
<color name="red_diaochan">#ff8964</color> <color name="red_diaochan">#ff8964</color>
<color name="red_lvzhi">#a22929</color> <color name="red_lvzhi">#a22929</color>
<color name="gray_zhouyu">#f1f3f7</color> <color name="gray_zhouyu">#f6f6f6</color>
<color name="gray_huanggai">#afb9c3</color> <color name="gray_huanggai">#afb9c3</color>
<color name="gray_kongming">#e6e6e6</color> <color name="gray_kongming">#e6e6e6</color>
...@@ -153,5 +153,4 @@ ...@@ -153,5 +153,4 @@
<color name="purple_yanqing">#6590e6</color> <color name="purple_yanqing">#6590e6</color>
</resources> </resources>
...@@ -9,8 +9,10 @@ ...@@ -9,8 +9,10 @@
<dimen name="all_spacing">6dp</dimen> <dimen name="all_spacing">6dp</dimen>
<dimen name="all_sub_title_size">20sp</dimen> <dimen name="all_sub_title_size">20sp</dimen>
<dimen name="big_text_size">18sp</dimen> <dimen name="big_text_size">18sp</dimen>
<dimen name="big_big_text_size">20sp</dimen>
<dimen name="sbig_text_size">25sp</dimen> <dimen name="sbig_text_size">25sp</dimen>
<dimen name="all_text_size">16sp</dimen> <dimen name="all_text_size">16sp</dimen>
<dimen name="all_text_size_small_title">17sp</dimen>
<dimen name="all_text_size_low">14sp</dimen> <dimen name="all_text_size_low">14sp</dimen>
<dimen name="all_text_size_small">12sp</dimen> <dimen name="all_text_size_small">12sp</dimen>
<dimen name="all_text_size_small_small">10sp</dimen> <dimen name="all_text_size_small_small">10sp</dimen>
...@@ -20,7 +22,7 @@ ...@@ -20,7 +22,7 @@
<dimen name="all_tiny_size">9sp</dimen> <dimen name="all_tiny_size">9sp</dimen>
<dimen name="all_title_size">26sp</dimen> <dimen name="all_title_size">26sp</dimen>
<dimen name="all_padding">10dp</dimen> <dimen name="all_padding">10dp</dimen>
<dimen name="all_padding_left_right">15dp</dimen> <dimen name="all_padding_left_right">16dp</dimen>
<dimen name="all_text_size_big">22sp</dimen> <dimen name="all_text_size_big">22sp</dimen>
<dimen name="all_text_size_big_big">30sp</dimen> <dimen name="all_text_size_big_big">30sp</dimen>
<dimen name="all_text_size_super_big">25sp</dimen> <dimen name="all_text_size_super_big">25sp</dimen>
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
<string name="visible">visible</string> <string name="visible">visible</string>
<string name="gone">gone</string> <string name="gone">gone</string>
<string name="password"></string> <string name="password"></string>
<string name="rate">%</string>
<!--返回--> <!--返回-->
<string name="all_go_back">返回</string> <string name="all_go_back">返回</string>
...@@ -182,7 +183,6 @@ ...@@ -182,7 +183,6 @@
<!--商品页面 <WHERE>_<DESCRIPTION>--> <!--商品页面 <WHERE>_<DESCRIPTION>-->
<string name="store_title">商品页面</string> <string name="store_title">商品页面</string>
<string name="store_size">规格/</string>
<string name="store_price_unit"></string> <string name="store_price_unit"></string>
<string name="store_group">商品分组 </string> <string name="store_group">商品分组 </string>
<string name="store_sssku">标准商品 </string> <string name="store_sssku">标准商品 </string>
...@@ -262,8 +262,8 @@ ...@@ -262,8 +262,8 @@
<string name="title_activity_splash">SplashActivity</string> <string name="title_activity_splash">SplashActivity</string>
<!--库查询界面--> <!--库查询界面-->
<string name="other_selcet_meun">库查询</string> <string name="other_selcet_meun">库查询</string>
<string name="other_selcet_edit_hint">商品名称/商品条码/商品助记码</string> <string name="other_selcet_edit_hint">商品名称/商品条码/商品助记码</string>
<string name="other_selcet_shop">共%s个门店库存</string> <string name="other_selcet_shop">共%s个门店库存</string>
...@@ -320,6 +320,8 @@ ...@@ -320,6 +320,8 @@
<!--营销计划--> <!--营销计划-->
<string name="ms_title">营销计划</string> <string name="ms_title">营销计划</string>
<string name="ms_add">添加营销计划</string> <string name="ms_add">添加营销计划</string>
<string name="ms_user_title">旗舰</string>
<string name="ms_user_hint">营销计划功能限时免费使用 3 个月</string>
<string name="ms_count">共%s个营销计划</string> <string name="ms_count">共%s个营销计划</string>
<string name="ms_search_hint">请输入活动名称</string> <string name="ms_search_hint">请输入活动名称</string>
<string name="ms_empty_hint">没有搜到此计划\n请重新搜索,或点击添加按钮进行添加~</string> <string name="ms_empty_hint">没有搜到此计划\n请重新搜索,或点击添加按钮进行添加~</string>
...@@ -351,13 +353,13 @@ ...@@ -351,13 +353,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>
...@@ -372,7 +374,12 @@ ...@@ -372,7 +374,12 @@
<!--商品管理--> <!--商品管理-->
<string name="sssku_title">商品维护</string> <string name="sssku_title">商品维护</string>
<string name="sssku_add">添加商品</string> <string name="sssku_add">添加商品</string>
<string name="sssku_update">编辑商品</string>
<string name="sssku_detail">商品详情</string>
<string name="sssku_skugrp">分组信息</string>
<string name="sssku_skugrp_add">添加分组</string>
<string name="sssku_search_hint">请输入商品名称/助记码/条码</string> <string name="sssku_search_hint">请输入商品名称/助记码/条码</string>
<string name="sssku_empty_hint">没有搜到此商品\n请重新搜索,或点击添加按钮进行添加~</string> <string name="sssku_empty_hint">没有搜到此商品\n请重新搜索,或点击添加按钮进行添加~</string>
...@@ -493,7 +500,7 @@ ...@@ -493,7 +500,7 @@
<string name="menu_manager_goods">商品维护</string> <string name="menu_manager_goods">商品维护</string>
<string name="menu_manager_bale">商品组合</string> <string name="menu_manager_bale">商品组合</string>
<string name="menu_manager_replenishment">补货订货</string> <string name="menu_manager_replenishment">补货订货</string>
<string name="menu_manager_other">库查询</string> <string name="menu_manager_other">库查询</string>
<string name="menu_manager_inventory">库存盘点</string> <string name="menu_manager_inventory">库存盘点</string>
<string name="menu_announcement">公告通知</string> <string name="menu_announcement">公告通知</string>
...@@ -594,18 +601,20 @@ ...@@ -594,18 +601,20 @@
<string name="ms_type_dis">打折</string> <string name="ms_type_dis">打折</string>
<string name="ms_type_dis_info">享受%s折优惠</string> <string name="ms_type_dis_info">享受%s折优惠</string>
<string name="ms_type_dis_abbr"></string> <string name="ms_type_dis_abbr"></string>
<string name="ms_type_dis_hint">请输入折扣比例(%)</string>
<string name="ms_type_promotion">促销</string> <string name="ms_type_promotion">促销</string>
<string name="ms_type_promotion_info">享受促销价</string> <string name="ms_type_promotion_info">享受促销价</string>
<string name="ms_type_promotion_abbr"></string> <string name="ms_type_promotion_abbr"></string>
<string name="ms_type_money_off">满减</string> <string name="ms_type_money_off">满减</string>
<string name="ms_type_money_off_info">满%s元减%s元</string> <string name="ms_type_money_off_info">满%s元减%s元</string>
<string name="ms_type_money_off_abbr"></string> <string name="ms_type_money_off_abbr"></string>
<string name="ms_type_second"></string> <string name="ms_type_second">第二件</string>
<string name="ms_type_second_info">第二件享受%s折优惠</string> <string name="ms_type_second_info">第二件享受%s折优惠</string>
<string name="ms_type_second_abbr"></string> <string name="ms_type_second_abbr"></string>
<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>
...@@ -667,6 +676,13 @@ ...@@ -667,6 +676,13 @@
<string name="manage_replenishment_unConfirmed">待确认</string> <string name="manage_replenishment_unConfirmed">待确认</string>
<string name="manage_replenishment_unReceive">待收货</string> <string name="manage_replenishment_unReceive">待收货</string>
<string name="manage_replenishment_finished">已入库</string> <string name="manage_replenishment_finished">已入库</string>
<string name="manage_inventory_add">开始盘库</string>
<string name="manage_inventory_add_title">商品盘点</string>
<string name="manage_inventory_add_end">盘库结束</string>
<!--商品维护-->
<string name="sku_size">规格/</string>
<string name="skugrp_add_hint">请输入分组名称/</string>
</resources> </resources>
...@@ -17,9 +17,9 @@ ...@@ -17,9 +17,9 @@
<item name="windowNoTitle">true</item> <item name="windowNoTitle">true</item>
</style> </style>
<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar"/> <style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />
<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light"/> <style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />
<style name="vicescreen_textview_stlye"> <style name="vicescreen_textview_stlye">
...@@ -43,6 +43,7 @@ ...@@ -43,6 +43,7 @@
<item name="android:textColor">@color/black</item> <item name="android:textColor">@color/black</item>
<item name="android:textSize">@dimen/detail_textview_size</item> <item name="android:textSize">@dimen/detail_textview_size</item>
</style> </style>
<style name="default_blacktext_nopadding_smallstyle"> <style name="default_blacktext_nopadding_smallstyle">
<item name="android:layout_width">wrap_content</item> <item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">match_parent</item> <item name="android:layout_height">match_parent</item>
...@@ -64,6 +65,7 @@ ...@@ -64,6 +65,7 @@
<item name="android:textColor">@color/black</item> <item name="android:textColor">@color/black</item>
<item name="android:textSize">@dimen/detail_textview_size</item> <item name="android:textSize">@dimen/detail_textview_size</item>
</style> </style>
<style name="default_bluetext_popbutton"> <style name="default_bluetext_popbutton">
<item name="android:layout_width">wrap_content</item> <item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">match_parent</item> <item name="android:layout_height">match_parent</item>
...@@ -75,7 +77,6 @@ ...@@ -75,7 +77,6 @@
</style> </style>
<style name="default_title"> <style name="default_title">
<item name="android:gravity">center_vertical</item> <item name="android:gravity">center_vertical</item>
<item name="android:singleLine">true</item> <item name="android:singleLine">true</item>
...@@ -324,6 +325,7 @@ ...@@ -324,6 +325,7 @@
</style> </style>
<style name="button_passive" parent="android:ButtonBar"> <style name="button_passive" parent="android:ButtonBar">
<item name="android:foreground">?android:attr/selectableItemBackgroundBorderless</item>
<item name="android:background">@drawable/selector_gradient_gray_button_background</item> <item name="android:background">@drawable/selector_gradient_gray_button_background</item>
<item name="android:textColor">@drawable/selector_gray_button_text_color</item> <item name="android:textColor">@drawable/selector_gray_button_text_color</item>
<item name="android:gravity">center</item> <item name="android:gravity">center</item>
...@@ -347,16 +349,15 @@ ...@@ -347,16 +349,15 @@
</style> </style>
<style name="editText_new" parent="view_base"> <style name="editText_new" parent="view_base">
<item name=" android:background">@drawable/selector_white_background_stroke</item> <item name="android:background">@drawable/selector_white_background_stroke</item>
<item name="android:padding">@dimen/et_padding</item> <item name="android:padding">@dimen/et_padding</item>
<item name=" android:saveEnabled">false</item> <item name="android:saveEnabled">false</item>
<item name="android:gravity">center|left</item> <item name="android:gravity">center|left</item>
<item name="android:textSize">@dimen/et_textsize</item> <item name="android:textSize">@dimen/et_textsize</item>
<item name="android:textColorHint">@color/hint</item> <item name="android:textColorHint">@color/hint</item>
</style> </style>
<style name="button" parent="view_base"> <style name="button" parent="view_base">
<item name=" android:background">@drawable/red_border</item> <item name=" android:background">@drawable/red_border</item>
<item name=" android:saveEnabled">false</item> <item name=" android:saveEnabled">false</item>
......
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