Commit 7b99649d authored by 姜敏's avatar 姜敏

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	app/src/main/java/com/xingdata/zzdpos/App.java
parents 95080f44 3d2ec13b
......@@ -10,6 +10,7 @@
<w>huanggai</w>
<w>huangxin</w>
<w>inputer</w>
<w>jsonpay</w>
<w>kongming</w>
<w>kongrong</w>
<w>kongrun</w>
......
......@@ -3,8 +3,6 @@
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/TangKuPos.iml" filepath="$PROJECT_DIR$/TangKuPos.iml" />
<module fileurl="file://D:\Work\Android\AndroidProject\XingData\TangKuPos\.idea\TangKuPos.iml" filepath="D:\Work\Android\AndroidProject\XingData\TangKuPos\.idea\TangKuPos.iml" />
<module fileurl="file://C:\Users\JM_DEV\AndroidStudioProjects\TangKuPos\TangKuPos.iml" filepath="C:\Users\JM_DEV\AndroidStudioProjects\TangKuPos\TangKuPos.iml" />
<module fileurl="file://$PROJECT_DIR$/app/app.iml" filepath="$PROJECT_DIR$/app/app.iml" />
</modules>
</component>
......
......@@ -11,6 +11,9 @@ android {
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
ndk{
abiFilters("armeabi", "armeabi-v7a")
}
}
//解决问题的代码
dexOptions {
......@@ -41,7 +44,12 @@ android {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
sourceSets { main { assets.srcDirs = ['src/main/assets', 'src/main/assets/'] } }
sourceSets {
main {
assets.srcDirs = ['src/main/assets', 'src/main/assets/']
jniLibs.srcDirs = ['libs']
}
}
}
repositories {
flatDir {
......
......@@ -70,7 +70,7 @@ public class App extends Application {
.start();
// 初始化异常处理
// initEx();
initEx();
//初始化Fragment框架
initFragment();
......
......@@ -58,8 +58,9 @@ public class C {
}
public static final class URL {
// public static final String BASE_URL = "http://192.168.254.96:8080/";
public static final String BASE_URL = "http://demo.51zzd.cn:8080/";
public static final String TEMP_PAY_URL = "http://demo.51zzd.cn/";
private static final String PKG = "/tk/";
public final class SYNCHRONOUS {
......@@ -407,6 +408,9 @@ public class C {
public static final String query = ROOT_URL + "query";
}
public final class TEMP_PAY {
public static final String pay = "pay/payc/pay";
}
}
......@@ -564,7 +568,6 @@ public class C {
public static final int PKG = 5;
public static final int SKU_DETAIL = 6;
public static final int ADD_SKU = 7;
public static final int SKU_EDITOR = 8;
}
}
......@@ -2,6 +2,7 @@ package com.xingdata.zzdpos.api;
import android.support.annotation.NonNull;
import com.xingdata.zzdpos.C;
import java.util.ArrayList;
import java.util.HashMap;
......@@ -16,7 +17,6 @@ import okhttp3.OkHttpClient;
import okhttp3.logging.HttpLoggingInterceptor;
import retrofit2.Retrofit;
import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory;
import com.xingdata.zzdpos.C;
/**
......@@ -87,6 +87,4 @@ class Api {
service = retrofit.create(ApiService.class);
}
}
......@@ -21,7 +21,7 @@ import retrofit2.Retrofit;
public class ConverterFactory extends Converter.Factory {
static ConverterFactory create() {
public static ConverterFactory create() {
return new ConverterFactory();
}
......
package com.xingdata.zzdpos.api;
import android.support.annotation.NonNull;
import com.xingdata.zzdpos.C;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.concurrent.TimeUnit;
import okhttp3.Cookie;
import okhttp3.CookieJar;
import okhttp3.HttpUrl;
import okhttp3.Interceptor;
import okhttp3.OkHttpClient;
import okhttp3.logging.HttpLoggingInterceptor;
import retrofit2.Retrofit;
import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory;
public class Jni {
JniService service;
private static class JniHolder {
private static final Jni INSTANCE = new Jni();
}
static Jni getInstance() {
return Jni.JniHolder.INSTANCE;
}
private Jni() {
//LOG
HttpLoggingInterceptor logInterceptor = new HttpLoggingInterceptor();
logInterceptor.setLevel(HttpLoggingInterceptor.Level.BODY);
//HEAD
Interceptor headInterceptor = (chain) -> chain.proceed(
chain.request().newBuilder()
.addHeader("User-Agent", C.HEAD.USER_AGENT)
.addHeader("Connection", C.HEAD.CONNECTION)
.addHeader("Content-Type", C.HEAD.CONTENT_TYPE)
.addHeader("Content-Language", C.HEAD.CONTENT_LANGUAGE)
.addHeader("Cache-Control", C.HEAD.CACHE_CONTROL)
.build());
//COOKIE
CookieJar cookieJar = new CookieJar() {
private HashMap<String, Cookie> cookieMap = new HashMap<>();
@Override
public void saveFromResponse(@NonNull HttpUrl url, @NonNull List<Cookie> cookies) {
for (int i = 0; i < cookies.size(); i++) {
cookieMap.put(cookies.get(i).name(), cookies.get(i));
}
}
@Override
public List<Cookie> loadForRequest(@NonNull HttpUrl url) {
return new ArrayList<>(cookieMap.values());
}
};
//Client
OkHttpClient okHttpClient = new OkHttpClient.Builder()
.readTimeout(C.API_BUILDER.READ_TIMEOUT, TimeUnit.MILLISECONDS)
.connectTimeout(C.API_BUILDER.CONNECT_TIMEOUT, TimeUnit.MILLISECONDS)
.addInterceptor(headInterceptor)
.addInterceptor(logInterceptor)
.cookieJar(cookieJar)
.build();
Retrofit retrofit = new Retrofit.Builder()
.client(okHttpClient)
.addCallAdapterFactory(RxJava2CallAdapterFactory.create())
.addConverterFactory(ConverterFactory.create())
.baseUrl(C.URL.TEMP_PAY_URL)
.build();
service = retrofit.create(JniService.class);
}
}
package com.xingdata.zzdpos.api;
import io.reactivex.Observable;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.schedulers.Schedulers;
public class JniFactory {
public static class Settle {
public static Observable<Pay.Response> pay(String str) {
return Jni.getInstance().service.pay(str)
.onErrorReturn(new ErrorFilter<>())
.map(new ResultFilter<>())
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread());
}
}
}
package com.xingdata.zzdpos.api;
import com.xingdata.zzdpos.C;
import io.reactivex.Observable;
import retrofit2.http.GET;
import retrofit2.http.Query;
interface JniService {
@GET(C.URL.TEMP_PAY.pay)
Observable<HttpMessage<Pay.Response>> pay(@Query("para") String str);
}
package com.xingdata.zzdpos.api;
import com.alibaba.fastjson.annotation.JSONField;
public class Pay {
public static class Request {
private String OrderType;
private String PayChannelType;
private String DeviceType;
private String Agent_id;
private String Mch_id;
private String Ter_id;
private String OrderNo;
private String PosTrace;
private String OrderDateTime;
private String CurrencyType;
private String OrderAmt;
private String OrderName;
private String ChannelAuthCode;
private String Key;
private String NotifyUrl;
@JSONField(name = "OrderType")
public String getOrderType() {
return OrderType;
}
@JSONField(name = "OrderType")
public void setOrderType(String orderType) {
OrderType = orderType;
}
@JSONField(name = "PayChannelType")
public String getPayChannelType() {
return PayChannelType;
}
@JSONField(name = "PayChannelType")
public void setPayChannelType(String payChannelType) {
PayChannelType = payChannelType;
}
@JSONField(name = "DeviceType")
public String getDeviceType() {
return DeviceType;
}
@JSONField(name = "DeviceType")
public void setDeviceType(String deviceType) {
DeviceType = deviceType;
}
@JSONField(name = "Agent_id")
public String getAgent_id() {
return Agent_id;
}
@JSONField(name = "Agent_id")
public void setAgent_id(String agent_id) {
Agent_id = agent_id;
}
@JSONField(name = "Mch_id")
public String getMch_id() {
return Mch_id;
}
@JSONField(name = "Mch_id")
public void setMch_id(String mch_id) {
Mch_id = mch_id;
}
@JSONField(name = "Ter_id")
public String getTer_id() {
return Ter_id;
}
@JSONField(name = "Ter_id")
public void setTer_id(String ter_id) {
Ter_id = ter_id;
}
@JSONField(name = "OrderNo")
public String getOrderNo() {
return OrderNo;
}
@JSONField(name = "OrderNo")
public void setOrderNo(String orderNo) {
OrderNo = orderNo;
}
@JSONField(name = "PosTrace")
public String getPosTrace() {
return PosTrace;
}
@JSONField(name = "PosTrace")
public void setPosTrace(String posTrace) {
PosTrace = posTrace;
}
@JSONField(name = "OrderDateTime")
public String getOrderDateTime() {
return OrderDateTime;
}
@JSONField(name = "OrderDateTime")
public void setOrderDateTime(String orderDateTime) {
OrderDateTime = orderDateTime;
}
@JSONField(name = "CurrencyType")
public String getCurrencyType() {
return CurrencyType;
}
@JSONField(name = "CurrencyType")
public void setCurrencyType(String currencyType) {
CurrencyType = currencyType;
}
@JSONField(name = "OrderAmt")
public String getOrderAmt() {
return OrderAmt;
}
@JSONField(name = "OrderAmt")
public void setOrderAmt(String orderAmt) {
OrderAmt = orderAmt;
}
@JSONField(name = "OrderName")
public String getOrderName() {
return OrderName;
}
@JSONField(name = "OrderName")
public void setOrderName(String orderName) {
OrderName = orderName;
}
@JSONField(name = "ChannelAuthCode")
public String getChannelAuthCode() {
return ChannelAuthCode;
}
@JSONField(name = "ChannelAuthCode")
public void setChannelAuthCode(String channelAuthCode) {
ChannelAuthCode = channelAuthCode;
}
@JSONField(name = "Key")
public String getKey() {
return Key;
}
@JSONField(name = "Key")
public void setKey(String key) {
Key = key;
}
@JSONField(name = "NotifyUrl")
public String getNotifyUrl() {
return NotifyUrl;
}
@JSONField(name = "NotifyUrl")
public void setNotifyUrl(String notifyUrl) {
NotifyUrl = notifyUrl;
}
}
public class Response {
private int OrderType;
private String ResponseCode;
private String ResponseMsg;
private String TradeStatus;
private String Mch_id;
private String Ter_id;
private String OrderNo;
private String tn;
private String paySign;
public int getOrderType() {
return OrderType;
}
public void setOrderType(int orderType) {
OrderType = orderType;
}
public String getResponseCode() {
return ResponseCode;
}
public void setResponseCode(String responseCode) {
ResponseCode = responseCode;
}
public String getResponseMsg() {
return ResponseMsg;
}
public void setResponseMsg(String responseMsg) {
ResponseMsg = responseMsg;
}
public String getTradeStatus() {
return TradeStatus;
}
public void setTradeStatus(String tradeStatus) {
TradeStatus = tradeStatus;
}
public String getMch_id() {
return Mch_id;
}
public void setMch_id(String mch_id) {
Mch_id = mch_id;
}
public String getTer_id() {
return Ter_id;
}
public void setTer_id(String ter_id) {
Ter_id = ter_id;
}
public String getOrderNo() {
return OrderNo;
}
public void setOrderNo(String orderNo) {
OrderNo = orderNo;
}
public String getTn() {
return tn;
}
public void setTn(String tn) {
this.tn = tn;
}
public String getPaySign() {
return paySign;
}
public void setPaySign(String paySign) {
this.paySign = paySign;
}
}
}
......@@ -14,6 +14,7 @@ import com.xingdata.zzdpos.model.Sskugrp;
import com.xingdata.zzdpos.model.Sssku;
import com.xingdata.zzdpos.model.Ussku;
import com.xingdata.zzdpos.ui.main.MainPresenter;
import com.xingdata.zzdpos.ui.marketing.ms.MsPresenter;
import com.xingdata.zzdpos.ui.settle.SettlePresenter;
import com.xingdata.zzdpos.ui.store.StorePresenter;
import com.xingdata.zzdpos.ui.vip.VipPresenter;
......@@ -241,10 +242,23 @@ public class DBFactory {
public static class Marketing {
public static class Ms {
public static Observable<List<Level>> queryLevel() {
return Observable.just(DB.getInstance().get(MainPresenter.class).where(Level
return Observable.just(DB.getInstance().get(MsPresenter.class).where(Level
.class).findAll())
.flatMap(levels -> Observable.just(getList(levels)));
}
/**
* 查询商品名称
*
* @param skuId 商品Id
* @return 商品名称
*/
public static String querySpuNameBySkuId(Long skuId) {
List<Sssku> ssskus = getList(DB.getInstance().get(MsPresenter.class).where(Sssku
.class).equalTo("skuId", skuId).findAll());
if (ssskus.size() > 0) return ssskus.get(0).getSpuName();
else return null;
}
}
}
......
......@@ -20,7 +20,7 @@ public class Sskugrp extends RealmObject implements BaseModel, BaseBean {
Sskugrp sskugrp = new Sskugrp();
sskugrp.setSelected(true);
sskugrp.setSkuGrpId(0l);
sskugrp.setSkuGrpName("全部分组");
sskugrp.setSkuGrpName("全部商品");
return sskugrp;
}
......
......@@ -8,11 +8,6 @@ import com.blankj.utilcode.util.KeyboardUtils;
import com.blankj.utilcode.util.LogUtils;
import com.blankj.utilcode.util.SPUtils;
import com.blankj.utilcode.util.ToastUtils;
import java.util.ArrayList;
import java.util.List;
import com.xingdata.zzdpos.ui.main.MainActivity;
import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseActivity;
import com.xingdata.zzdpos.databinding.ActivityLoginBinding;
......@@ -22,12 +17,13 @@ import com.xingdata.zzdpos.ui.login.fragment.SignInFragment;
import com.xingdata.zzdpos.ui.login.fragment.bean.LoginReturnBean;
import com.xingdata.zzdpos.ui.login.fragment.bean.StoreAddressJsonBean;
import com.xingdata.zzdpos.ui.login.fragment.bean.StoreTypeJsonBean;
import com.xingdata.zzdpos.ui.marketing.integral.IntegralActivity;
import com.xingdata.zzdpos.ui.marketing.ticket.ReturnTicketActivity;
import com.xingdata.zzdpos.ui.payment.PaymentActivity;
import com.xingdata.zzdpos.ui.main.MainActivity;
import com.xingdata.zzdpos.ui.splash.SplashActivity;
import com.xingdata.zzdpos.view.PopupWindowDownList;
import java.util.ArrayList;
import java.util.List;
public class LoginActivity extends BaseActivity<LoginPresenter, ActivityLoginBinding> implements
LoginContract.View {
private long mExitTime;
......
......@@ -157,7 +157,7 @@ public class MainPresenter extends MainContract.Presenter {
//
// sskugrp = new Sskugrp();
// sskugrp.setSkuGrpId(0L);
// sskugrp.setSkuGrpName("全部分组");
// sskugrp.setSkuGrpName("全部商品");
// sskugrp.setSelected(true);
// sskugrps.add(0, sskugrp);
//
......
......@@ -2,7 +2,6 @@ package com.xingdata.zzdpos.ui.manage.bale.adpter;
import android.support.annotation.Nullable;
import com.xingdata.zzdpos.base.BaseAdapter;
import com.xingdata.zzdpos.databinding.ItemBaleEditQueryBinding;
import com.xingdata.zzdpos.model.Sssku;
......@@ -25,5 +24,6 @@ public class EditDialogQueryShopItemAdapter extends BaseAdapter<Sssku, ItemBaleE
mViewBinding.tvTitle.setText(item.getSpuName() + "");
mViewBinding.tvNo.setText(item.getSpuBarcode() + "");
mViewBinding.tvMoney.setText(ConvertUtil.fenToYuan(item.getSkuRetailPrice1()));
mViewBinding.tvGoodsSize.setText("规格/" + item.getSpuUnitName());
}
}
......@@ -25,6 +25,7 @@ import com.xingdata.zzdpos.model.Sssku;
import com.xingdata.zzdpos.model.Ussku;
import com.xingdata.zzdpos.model.UsskuParam;
import com.xingdata.zzdpos.ui.dialog.LoadingDialog;
import com.xingdata.zzdpos.ui.dialog.PromptDialog;
import com.xingdata.zzdpos.ui.manage.bale.BalePresenter;
import com.xingdata.zzdpos.ui.manage.bale.adpter.EditFragmentImgShopAdapter;
import com.xingdata.zzdpos.util.ConvertUtil;
......@@ -131,9 +132,27 @@ public class BaleEditFragment extends BaseFragment<BalePresenter, FragmentBaleEd
}
break;
case R.id.btn_dismantling: {
//拆解商品
loadingDialog.show((BaseActivity) getActivity());
mPresenter.usskuDelete(ussku.getSkuId() + "", loadingDialog);
PromptDialog promptDialog = new PromptDialog();
promptDialog.setDialogType(PromptDialog
.PROMPTDIALOG_SELECT, "确定拆解?")
.setClick(new View.OnClickListener() {
@Override
public void onClick(View view) {
//拆解商品
loadingDialog.show((BaseActivity) getActivity());
mPresenter.usskuDelete(ussku.getSkuId() + "",
loadingDialog);
promptDialog.dismiss();
}
}, new View.OnClickListener() {
@Override
public void onClick(View view) {
promptDialog.dismiss();
}
}).show((BaseActivity) getActivity());
}
break;
}
......
......@@ -3,16 +3,15 @@ package com.xingdata.zzdpos.ui.manage.bale.fragment;
import android.annotation.SuppressLint;
import android.view.KeyEvent;
import android.view.View;
import android.view.inputmethod.InputMethodManager;
import android.widget.TextView;
import com.blankj.utilcode.util.KeyboardUtils;
import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseActivity;
import com.xingdata.zzdpos.base.BaseFragment;
import com.xingdata.zzdpos.databinding.FragmentBaleSeachBinding;
import com.xingdata.zzdpos.ui.dialog.LoadingDialog;
import com.xingdata.zzdpos.ui.manage.bale.BalePresenter;
import com.xingdata.zzdpos.util.Global;
import com.xingdata.zzdpos.util.OnClickListener;
/**
......@@ -68,16 +67,13 @@ public class BaleSeachFragment extends BaseFragment<BalePresenter, FragmentBaleS
.getText()
.toString(),
loadingDialog);
pop();
pop();
return false;
}
}
);
mViewBinding.etKeyword.setFocusable(true);
mViewBinding.etKeyword.setFocusableInTouchMode(true);
mViewBinding.etKeyword.requestFocus();
KeyboardUtils.showSoftInput( mViewBinding.etKeyword);
Global.setFocus(mViewBinding.etKeyword, getActivity());
}
......
......@@ -6,7 +6,6 @@ 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.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseActivity;
......@@ -16,6 +15,7 @@ import com.xingdata.zzdpos.model.Sssku;
import com.xingdata.zzdpos.ui.dialog.LoadingDialog;
import com.xingdata.zzdpos.ui.manage.bale.BalePresenter;
import com.xingdata.zzdpos.ui.manage.bale.adpter.EditDialogQueryShopItemAdapter;
import com.xingdata.zzdpos.util.Global;
import com.xingdata.zzdpos.util.OnClickListener;
import java.util.ArrayList;
......@@ -106,12 +106,10 @@ public class BaleSeachShopFragment extends BaseFragment<BalePresenter,
}
);
mViewBinding.etKeyword.setFocusable(true);
mViewBinding.etKeyword.setFocusableInTouchMode(true);
mViewBinding.etKeyword.requestFocus();
KeyboardUtils.showSoftInput( mViewBinding.etKeyword);
}
public void setNewData(List<Sssku> newData, Boolean isLoadMore) {
nowData = newData;
isAddData = false;
......@@ -122,7 +120,7 @@ public class BaleSeachShopFragment extends BaseFragment<BalePresenter,
queryShopItemAdapter.setNewData(nowData);
getEmptyView("没有数据");
}
Global.setFocus(mViewBinding.etKeyword, getActivity());
}
public void setAddData(List<Sssku> addData, Boolean isLoadMore) {
......@@ -135,6 +133,7 @@ public class BaleSeachShopFragment extends BaseFragment<BalePresenter,
queryShopItemAdapter.addData(nowData);
getEmptyView("没有数据");
}
Global.setFocus(mViewBinding.etKeyword, getActivity());
}
/**
......
......@@ -38,9 +38,7 @@ public class InventoryAddFragment extends BaseFragment<InventoryPresenter, Fragm
private List<Sssku> topCsList = new ArrayList<>();
private InventoryGoodsAdapter mInventoryGoodsAdapter;
private CsCartDialog mCartDialog = new CsCartDialog();
private Drawable drawable;
private RecyclerViewUtil.ListCardItemDecoration emptyItemDecoration;
private RecyclerViewUtil.ListCardItemDecoration listItemDecoration;
/**
* 当前购物车信息
*/
......@@ -56,9 +54,7 @@ public class InventoryAddFragment extends BaseFragment<InventoryPresenter, Fragm
@Override
public void initView() {
drawable = getResources().getDrawable(R.drawable.singleline_zhouyu_huanggai);
emptyItemDecoration = new RecyclerViewUtil.ListCardItemDecoration(getActivity(), 50, drawable, 1);
listItemDecoration = new RecyclerViewUtil.ListCardItemDecoration(getActivity(), 50, drawable, 0);
initRecycler();
mViewBinding.setCartCount(0);
mViewBinding.icTitle.edTitle.setVisibility(View.GONE);
......@@ -114,20 +110,21 @@ public class InventoryAddFragment extends BaseFragment<InventoryPresenter, Fragm
mInventoryGoodsAdapter = new InventoryGoodsAdapter(topCsList);
mInventoryGoodsAdapter.setEmptyView(getEmptyView());
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);
if (bottomCsList.size() == 0) {
mPresenter.cancelInventoryAdd(mCs);
} else {
PromptDialog promptDialog = new PromptDialog();
promptDialog.setDialogType(PromptDialog.PROMPTDIALOG_SELECT, "退出前是否删除本次盘库记录").setClick(view1 -> {
mPresenter.cancelInventoryAdd(mCs);
promptDialog.dismiss();
}, view1 -> {
promptDialog.dismiss();
pop();
}).setCancelables(false).show((BaseActivity) mContext);
}
return false;
});
mInventoryGoodsAdapter.setOnItemChildClickListener((adapter, view, position) -> {
......@@ -146,10 +143,8 @@ public class InventoryAddFragment extends BaseFragment<InventoryPresenter, Fragm
}
});
Drawable drawable = getResources().getDrawable(R.drawable.singleline_zhouyu_huanggai);
mViewBinding.recyclerView.addItemDecoration(new RecyclerViewUtil.ListCardItemDecoration(getActivity(), 50, drawable));
mViewBinding.recyclerView.setAdapter(mInventoryGoodsAdapter);
mViewBinding.recyclerView.addItemDecoration(emptyItemDecoration);
}
......@@ -166,9 +161,14 @@ public class InventoryAddFragment extends BaseFragment<InventoryPresenter, Fragm
}
}
}
mInventoryGoodsAdapter.notifyDataSetChanged();
updateRecycler();
}
private void updateRecycler() {
mInventoryGoodsAdapter.notifyDataSetChanged();
}
public void addInventoryGoodsItem(Sssku sssku) {
if (!topCsList.contains(sssku)) {
......@@ -183,7 +183,7 @@ public class InventoryAddFragment extends BaseFragment<InventoryPresenter, Fragm
}
mInventoryGoodsAdapter.notifyDataSetChanged();
updateRecycler();
}
public void addInventoryDetailItem(CsDetail csDetail, Sssku sssku) {
......@@ -219,16 +219,21 @@ public class InventoryAddFragment extends BaseFragment<InventoryPresenter, Fragm
@Override
public boolean onBackPressedSupport() {
PromptDialog promptDialog = new PromptDialog();
promptDialog.setDialogType(PromptDialog.PROMPTDIALOG_SELECT, "退出前是否删除本次盘库记录").setClick(view1 -> {
if (bottomCsList.size() == 0) {
mPresenter.cancelInventoryAdd(mCs);
promptDialog.dismiss();
} else {
PromptDialog promptDialog = new PromptDialog();
promptDialog.setDialogType(PromptDialog.PROMPTDIALOG_SELECT, "退出前是否删除本次盘库记录").setClick(view1 -> {
mPresenter.cancelInventoryAdd(mCs);
promptDialog.dismiss();
}, view1 -> {
promptDialog.dismiss();
pop();
}, view1 -> {
promptDialog.dismiss();
pop();
}).setCancelables(false).show((BaseActivity) mContext);
}
}).setCancelables(false).show((BaseActivity) mContext);
return true;
}
......
......@@ -34,7 +34,6 @@ import java.util.List;
public class OtherListFragment extends BaseFragment<OtherSelectPresenter, FragmentOtherListBinding> {
private OtherSelectAdapter mOtherSelectAdapter;
private Drawable drawable;
private RecyclerViewUtil.ListCardItemDecoration emptyItemDecoration;
private RecyclerViewUtil.ListCardItemDecoration listItemDecoration;
......@@ -46,13 +45,12 @@ public class OtherListFragment extends BaseFragment<OtherSelectPresenter, Fragme
@Override
public void initView() {
drawable = getResources().getDrawable(R.drawable.singleline_zhouyu_huanggai);
emptyItemDecoration = new RecyclerViewUtil.ListCardItemDecoration(getActivity(), 50, drawable, 1);
listItemDecoration = new RecyclerViewUtil.ListCardItemDecoration(getActivity(), 50, drawable, 0);
mOtherSelectAdapter = new OtherSelectAdapter(new ArrayList<>());
mOtherSelectAdapter.setEmptyView(getEmptyView(R.string.empty_other_select));
mViewBinding.recyclerOtherSelcet.setLayoutManager(new LinearLayoutManager(getActivity()));
mViewBinding.recyclerOtherSelcet.setAdapter(mOtherSelectAdapter);
mViewBinding.recyclerOtherSelcet.addItemDecoration(emptyItemDecoration);
// mOtherSelectAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
// @Override
......@@ -90,13 +88,10 @@ public class OtherListFragment extends BaseFragment<OtherSelectPresenter, Fragme
mOtherSelectAdapter.setNewData(pager.getList());
if (pager.getList().size() == 0) {
mViewBinding.recyclerOtherSelcet.removeItemDecoration(listItemDecoration);
mViewBinding.recyclerOtherSelcet.removeItemDecoration(emptyItemDecoration);
mViewBinding.recyclerOtherSelcet.addItemDecoration(emptyItemDecoration);
mViewBinding.recyclerOtherSelcet.invalidateItemDecorations();
} else {
mViewBinding.recyclerOtherSelcet.removeItemDecoration(listItemDecoration);
mViewBinding.recyclerOtherSelcet.removeItemDecoration(emptyItemDecoration);
mViewBinding.recyclerOtherSelcet.addItemDecoration(listItemDecoration);
mViewBinding.recyclerOtherSelcet.invalidateItemDecorations();
}
......
......@@ -48,7 +48,7 @@ public class SsskuActivity extends BaseActivity<SsskuPresenter, ActivitySsskuBin
@Override
public void initView() {
this.showTitleBarByTitleMode(C.TITLE_MODE.SKU);
this.showTitleBarByTitleMode(C.TITLE_MODE.TEXT);
this.loadRootFragment(R.id.f_sssku, mManagerFragment);
mViewBinding.btnBack.setOnClickListener(view -> getTopFragment().onBackPressedSupport());
......@@ -59,7 +59,6 @@ public class SsskuActivity extends BaseActivity<SsskuPresenter, ActivitySsskuBin
}
return false;
});
mViewBinding.etSearch.setOnFocusChangeListener((view, b) -> mPresenter.searchBarFocusChanged(b, C.TITLE_MODE.SKU));
mViewBinding.btnMenu.setOnClickListener(view -> mPresenter.clickSkuMenu());
}
......@@ -138,17 +137,25 @@ public class SsskuActivity extends BaseActivity<SsskuPresenter, ActivitySsskuBin
@Override
public void showEditorFragment(Sssku sku, int editMode) {
this.showTitleBarByTitleMode(C.TITLE_MODE.TEXT);
switch (editMode) {
case C.SKU_EDITOR_MODE.ADD:
this.showTitleBarByTitleMode(C.TITLE_MODE.SKU_EDITOR);
mViewBinding.tvEditorHint.setText("已有");
mViewBinding.tvEditorHint.setBackgroundResource(R.drawable.shape_orange_r1);
mViewBinding.tvTitle.setText(R.string.sssku_add);
this.start(mEditorFragment.setSssku(sku).setEditMode(C.SKU_EDITOR_MODE.ADD));
break;
case C.SKU_EDITOR_MODE.UNKNOWN:
this.showTitleBarByTitleMode(C.TITLE_MODE.SKU_EDITOR);
mViewBinding.tvEditorHint.setText("新增");
mViewBinding.tvEditorHint.setBackgroundResource(R.drawable.shape_red_r1);
mViewBinding.tvTitle.setText(R.string.sssku_add);
this.start(mEditorFragment.setSssku(sku).setEditMode(C.SKU_EDITOR_MODE.UNKNOWN));
break;
case C.SKU_EDITOR_MODE.UPDATE:
this.showTitleBarByTitleMode(C.TITLE_MODE.TEXT);
mViewBinding.tvTitle.setText(R.string.sku_update);
this.start(mEditorFragment.setSssku(sku).setEditMode(C.SKU_EDITOR_MODE.UPDATE));
break;
......@@ -198,7 +205,8 @@ public class SsskuActivity extends BaseActivity<SsskuPresenter, ActivitySsskuBin
@Override
public void backToManagerFragment() {
this.showTitleBarByTitleMode(C.TITLE_MODE.SKU);
this.showTitleBarByTitleMode(C.TITLE_MODE.TEXT);
mViewBinding.tvTitle.setText(R.string.sssku_title);
this.resetSearchBar();
this.pop();
}
......
......@@ -213,6 +213,11 @@ public interface SsskuContract {
*/
public abstract void clickSku(Sssku sssku);
/**
* 管理页面 - 刷新商品分组
*/
public abstract void refreshSkugrp();
/**
* 管理页面 - 切换分组
*
......
......@@ -46,6 +46,11 @@ public class SsskuPresenter extends SsskuContract.Presenter {
clickSku(sssku, C.TITLE_MODE.SKU);
}
@Override
public void refreshSkugrp() {
this.getSkugrp();
}
@Override
public void clickSkugrp(Sskugrp sskugrp) {
//点击商品管理里的分组
......@@ -164,6 +169,12 @@ public class SsskuPresenter extends SsskuContract.Presenter {
@Override
public void clickDeleteSkugrp(Sskugrp sskugrp) {
mView.showLoadingDialog();
if (mSkuGrpId.longValue() == sskugrp.getSkuGrpId()) {
this.mPageNum = 0;
this.mSkuGrpId = 0L;
mView.loadSkugrpState(0L);
this.getSku();
}
mCompositeDisposable.add(
ApiFactory.Sskugrp.delete(sskugrp.getSkuGrpId())
.doOnSubscribe(subscription -> mView.dismissLoadingDialog())
......
......@@ -29,6 +29,7 @@ public class SkugrpDeleteDialog extends BaseDialog<SsskuPresenter, DialogSkugrpD
@Override
public void initView() {
mViewBinding.tvSkugrpName.setText(mSskugrp.getSkuGrpName());
}
@Override
......
......@@ -242,6 +242,7 @@ public class EditorFragment extends BaseFragment<SsskuPresenter, FragmentSsskuEd
private void setInfoViewByEditMode() {
switch (mEditorMode) {
case C.SKU_EDITOR_MODE.UNKNOWN:
mViewBinding.etName.setEnabled(true);
mViewBinding.nsType1.setVisibility(View.VISIBLE);
mViewBinding.nsType2.setVisibility(View.VISIBLE);
mViewBinding.nsType3.setVisibility(View.VISIBLE);
......@@ -251,6 +252,7 @@ public class EditorFragment extends BaseFragment<SsskuPresenter, FragmentSsskuEd
this.loadCla();
break;
default:
mViewBinding.etName.setEnabled(false);
mViewBinding.nsType1.setVisibility(View.INVISIBLE);
mViewBinding.nsType2.setVisibility(View.INVISIBLE);
mViewBinding.nsType3.setVisibility(View.GONE);
......@@ -520,6 +522,7 @@ public class EditorFragment extends BaseFragment<SsskuPresenter, FragmentSsskuEd
mSssku.setCreateTime(null);
mSssku.setUpdateTime(null);
mSssku.setSkuId(null);
}
@Override
......
......@@ -32,6 +32,8 @@ public class ManagerFragment extends BaseFragment<SsskuPresenter, FragmentSsskuM
@Override
public void initView() {
mViewBinding.setTotalCount(0);
// init sku
mSkuAdapter = new SkuAdapter();
mViewBinding.rlSku.setAdapter(mSkuAdapter);
......@@ -54,6 +56,7 @@ public class ManagerFragment extends BaseFragment<SsskuPresenter, FragmentSsskuM
mViewBinding.llSsskuAdd.setOnClickListener(view -> mPresenter.clickAddSku());
mViewBinding.tvReplenish.setOnClickListener(view -> mPresenter.clickReplenish());
mViewBinding.llSkugrpAdd.setOnClickListener(view -> mPresenter.clickAddSkugrp());
mViewBinding.tvSearch.setOnClickListener(view -> mPresenter.searchBarFocusChanged(true, C.TITLE_MODE.SKU));
// set empty
@SuppressLint("InflateParams") View view = getLayoutInflater().inflate(R.layout.view_empty, null);
......@@ -89,7 +92,7 @@ public class ManagerFragment extends BaseFragment<SsskuPresenter, FragmentSsskuM
public void loadSkugrps(List<Sskugrp> sskugrps) {
Sskugrp sskugrp = new Sskugrp();
sskugrp.setSkuGrpId(0L);
sskugrp.setSkuGrpName("全部分组");
sskugrp.setSkuGrpName("全部商品");
sskugrp.setSelected(true);
List<Sskugrp> _sskugrps = new ArrayList<>();
_sskugrps.addAll(sskugrps);
......@@ -126,7 +129,7 @@ public class ManagerFragment extends BaseFragment<SsskuPresenter, FragmentSsskuM
* @param count 商品总数
*/
public void loadSsskuCount(int count) {
mViewBinding.tvTotalCount.setText(String.valueOf(count));
mViewBinding.setTotalCount(count);
}
/**
......@@ -137,6 +140,7 @@ public class ManagerFragment extends BaseFragment<SsskuPresenter, FragmentSsskuM
public void addSku(Sssku sssku) {
mSkuAdapter.setEnableLoadMore(false);
mViewBinding.rlSku.scrollToPosition(0);
mViewBinding.setTotalCount(mViewBinding.getTotalCount() + 1);
mSkuAdapter.addData(0, sssku);
}
......
......@@ -37,6 +37,8 @@ public class SkugrpFragment extends BaseFragment<SsskuPresenter, FragmentSsskuSk
mViewBinding.rlSkugrp.setAdapter(mSkugrpAdapter);
mViewBinding.rlSkugrp.setLayoutManager(new LinearLayoutManager(mContext));
mViewBinding.srlSkugrp.setOnRefreshListener(this::refreshSkugrp);
mViewBinding.llSkugrpAdd.setOnClickListener(view -> {
new SkugrpEditorDialog().show(((SsskuActivity) getActivity()));
});
......@@ -46,6 +48,14 @@ public class SkugrpFragment extends BaseFragment<SsskuPresenter, FragmentSsskuSk
});
}
/**
* 刷新商品分组
*/
private void refreshSkugrp() {
mSkugrpAdapter.setEnableLoadMore(false);
mPresenter.refreshSkugrp();
}
/**
* 加载商品分组
*
......@@ -54,7 +64,10 @@ public class SkugrpFragment extends BaseFragment<SsskuPresenter, FragmentSsskuSk
public void loadSkugrps(List<Sskugrp> sskugrps) {
mSskugrps = sskugrps;
if (mSkugrpAdapter == null) return;
mSkugrpAdapter.setEnableLoadMore(true);
mViewBinding.srlSkugrp.setRefreshing(false);
mSkugrpAdapter.setNewData(mSskugrps);
mSkugrpAdapter.loadMoreEnd(true);
mViewBinding.setVisibility(sskugrps.size() > 0 ? View.VISIBLE : View.INVISIBLE);
}
......
......@@ -27,6 +27,7 @@ public class MsPresenter<Sku extends BaseSku> extends MsContract.Presenter<Sku>
@Override
public void onAttached() {
this.initRealm();
}
@Override
......
......@@ -2,11 +2,14 @@ package com.xingdata.zzdpos.ui.marketing.ms.adapter;
import android.annotation.SuppressLint;
import com.blankj.utilcode.util.StringUtils;
import com.xingdata.zzdpos.C;
import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseAdapter;
import com.xingdata.zzdpos.databinding.ItemMsBinding;
import com.xingdata.zzdpos.db.DBFactory;
import com.xingdata.zzdpos.model.Ms;
import com.xingdata.zzdpos.util.ConvertUtil;
import java.util.ArrayList;
......@@ -40,6 +43,8 @@ public class MsAdapter extends BaseAdapter<Ms, ItemMsBinding> {
}
mViewBinding.tvInfo.setText(getMsDescription(item));
StringBuilder sbDateBegin = new StringBuilder(item.getMsDateBegin().toString());
StringBuilder sbDateEnd = new StringBuilder(item.getMsDateEnd().toString());
sbDateBegin.insert(6, "-");
......@@ -48,4 +53,49 @@ public class MsAdapter extends BaseAdapter<Ms, ItemMsBinding> {
sbDateEnd.insert(4, "-");
mViewBinding.tvDate.setText(sbDateBegin.toString() + "~" + sbDateEnd.toString());
}
/**
* 获取营销计划的文字描述
*
* @param ms 营销计划
* @return 文字描述
*/
private String getMsDescription(Ms ms) {
String strGroup = "", strType = "";
switch (ms.getMsTouchTag2()) {
case C.MS_GROUP.ALL:
strGroup = mContext.getResources().getString(R.string.ms_group_all_info);
break;
case C.MS_GROUP.BRAND:
strGroup = mContext.getResources().getString(R.string.ms_group_all_info);
break;
case C.MS_GROUP.CATE:
strGroup = mContext.getResources().getString(R.string.ms_group_cate_info, ms.getCateName());
break;
case C.MS_GROUP.SKU:
String spuName = DBFactory.Marketing.Ms.querySpuNameBySkuId(ms.getSkuId());
strGroup = mContext.getResources().getString(R.string.ms_group_sku_info, !StringUtils.isEmpty(spuName) ? spuName : ms.getSkuId());
break;
}
switch (ms.getMsTools()) {
case C.MS_TYPE.DIS:
strType = mContext.getResources().getString(R.string.ms_type_dis_info, String.valueOf(Double.valueOf(ms.getPriceDiscount()) / 10));
break;
case C.MS_TYPE.PROMOTION:
strType = mContext.getResources().getString(R.string.ms_type_promotion_info);
break;
case C.MS_TYPE.SECOND:
strType = mContext.getResources().getString(R.string.ms_type_second_info, String.valueOf(Double.valueOf(ms.getPriceDiscount()) / 10));
break;
case C.MS_TYPE.MONEY_OFF:
strType = mContext.getResources().getString(R.string.ms_type_money_off_info, ConvertUtil.fenToYuan(ms.getPayAmt()), ConvertUtil.fenToYuan(ms.getGiftOffAmt()));
break;
case C.MS_TYPE.GIFT:
strType = mContext.getResources().getString(R.string.ms_type_gift_info, ConvertUtil.fenToYuan(ms.getPayAmt()), ConvertUtil.fenToYuan(ms.getGiftSkuPrice()), ms.getGiftSkuName());
break;
}
return strGroup + strType;
}
}
......@@ -10,7 +10,6 @@ import com.xingdata.zzdpos.databinding.ItemReturnTicketBinding;
import com.xingdata.zzdpos.model.Trule;
import com.xingdata.zzdpos.ui.marketing.ticket.ReturnTicketActivity;
import com.xingdata.zzdpos.ui.marketing.ticket.ReturnTicketPresenter;
import com.xingdata.zzdpos.ui.marketing.ticket.fragment.TickerAddFragment;
import com.xingdata.zzdpos.util.ConvertUtil;
import java.text.SimpleDateFormat;
......@@ -34,8 +33,7 @@ public class ReturnTicketAdapter extends BaseAdapter<Trule, ItemReturnTicketBind
// mViewBinding.tvSend.setText("\n");
// mViewBinding.tvTicketMoney.setText(mContext.getResources().getString(R.string.tv_money,
// ConvertUtil.fenToYuanNoPoint(item.getTruleValAmt())));
mViewBinding.tvTicketMoneys.setText(mContext.getResources().getString(R.string.money,
ConvertUtil.fenToYuanNoPoint(item.getTruleValAmt())));
mViewBinding.tvTicketMoneys.setText(ConvertUtil.fenToYuanNoPoint(item.getTruleValAmt()));
mViewBinding.tvRule.setText(mContext.getResources().getString(R.string.tv_rule,
ConvertUtil.fenToYuanNoPoint(item.getTruleOrderAmt())));
mViewBinding.tvDate.setText(mContext.getResources().getString(R.string.tv_date,
......
......@@ -29,7 +29,7 @@ public class TickerAddFragment extends BaseFragment<ReturnTicketPresenter,
DialogTicketAddSettingBinding> {
LoadingDialog loadingDialog = new LoadingDialog();
//0:正常 1暂停
private byte nowStatus = 1;
private byte nowStatus = 0;
//当前编辑的对象
private Trule trule = new Trule();
//1为新增,2为更新
......
package com.xingdata.zzdpos.ui.store.fragment;
package com.xingdata.zzdpos.ui.scan;
import android.content.Context;
import android.os.Handler;
import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseFragment;
import com.xingdata.zzdpos.base.BasePresenter;
import com.xingdata.zzdpos.databinding.FragmentStoreScanBinding;
import com.xingdata.zzdpos.ui.store.StorePresenter;
import me.dm7.barcodescanner.core.IViewFinder;
import me.dm7.barcodescanner.core.ViewFinderView;
import me.dm7.barcodescanner.zxing.ZXingScannerView;
public class ScanFragment extends BaseFragment<StorePresenter, FragmentStoreScanBinding> {
public class ScanFragment<P extends BasePresenter> extends BaseFragment<P, FragmentStoreScanBinding> {
private ZXingScannerView mScannerView;
private ZXingScannerView.ResultHandler mResultHandler;
......@@ -23,17 +22,33 @@ public class ScanFragment extends BaseFragment<StorePresenter, FragmentStoreScan
return R.layout.fragment_store_scan;
}
private OnScanCompletedListener mOnScanCompletedListener;
public OnScanCompletedListener getOnScanCompletedListener() {
return mOnScanCompletedListener;
}
public void setOnScanCompletedListener(OnScanCompletedListener onScanCompletedListener) {
this.mOnScanCompletedListener = onScanCompletedListener;
}
public interface OnScanCompletedListener {
void OnScanCompleted(String barcode);
}
@Override
public void initView() {
mScannerView = new ZXingScannerView(mContext) {
@Override
protected IViewFinder createViewFinderView(Context context) {
return new CustomViewFinderView(context);
return new ScanFragment.CustomViewFinderView(context);
}
};
mResultHandler = result -> {
mPresenter.scanComplete(result.getText());
if (mOnScanCompletedListener != null) {
mOnScanCompletedListener.OnScanCompleted(result.getText());
}
resetScanner();
};
......@@ -57,7 +72,7 @@ public class ScanFragment extends BaseFragment<StorePresenter, FragmentStoreScan
* 重置扫描器
*/
public void resetScanner() {
new Handler().postDelayed(() -> mScannerView.resumeCameraPreview(mResultHandler), 500);
new Handler().postDelayed(() -> mScannerView.resumeCameraPreview(mResultHandler), 1000);
}
private static class CustomViewFinderView extends ViewFinderView {
......@@ -67,7 +82,7 @@ public class ScanFragment extends BaseFragment<StorePresenter, FragmentStoreScan
int themeColor = getResources().getColor(R.color.blue_mawu);
this.setBorderColor(themeColor);
this.setBorderStrokeWidth(getResources().getDimensionPixelOffset(R.dimen.all_spacing));
this.setBorderStrokeWidth(getResources().getDimensionPixelOffset(R.dimen.all_shape_radius));
this.setLaserColor(themeColor);
this.setLaserEnabled(true);
......
package com.xingdata.zzdpos.ui.sendticke;
import com.blankj.utilcode.util.ActivityUtils;
import com.blankj.utilcode.util.LogUtils;
import com.blankj.utilcode.util.ToastUtils;
import com.xingdata.zzdpos.R;
......@@ -9,6 +10,7 @@ import com.xingdata.zzdpos.model.Pager;
import com.xingdata.zzdpos.model.Trule;
import com.xingdata.zzdpos.model.Vip;
import com.xingdata.zzdpos.ui.dialog.LoadingDialog;
import com.xingdata.zzdpos.ui.sendticke.fragment.SendTickerIndexFragment;
import java.util.List;
......@@ -57,11 +59,21 @@ public class SendTicketActivity extends BaseActivity<SendTicketPresenter,
}
@Override
public void sendTickerBeforSucc(long count,LoadingDialog loadingDialog) {
public void sendTickerBeforSucc(long count, LoadingDialog loadingDialog) {
closeLoading(loadingDialog);
mPresenter.sendTickerFragment.sendSuccBefor(count);
}
@Override
public void onBackPressedSupport() {
if (getTopFragment() instanceof SendTickerIndexFragment || getSupportFragmentManager()
.getFragments().size() <= 1) {
ActivityUtils.finishActivity(SendTicketActivity.class);
} else {
pop();
}
}
@Override
protected void onResume() {
super.onResume();
......
package com.xingdata.zzdpos.ui.sendticke.dialog;
import android.view.View;
import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseDialog;
import com.xingdata.zzdpos.databinding.DialogSendtickerBeforBinding;
......@@ -11,14 +13,36 @@ import com.xingdata.zzdpos.ui.sendticke.SendTicketPresenter;
public class SendTickerBeforDialog extends BaseDialog<SendTicketPresenter,
DialogSendtickerBeforBinding> {
String tickerName, sendObject;
long count;
@Override
public int getLayoutId() {
return R.layout.dialog_sendticker_befor;
}
@Override
public int getTitle() {
return R.string.send_ticker_dialog_title;
}
@Override
public void initView() {
mViewBinding.tvTicker.setText(tickerName);
mViewBinding.tvSendObject.setText(sendObject);
mViewBinding.tvSendCount.setText(count + "张");
}
public void setData(String tickerName, String sendObject, long count) {
this.tickerName = tickerName;
this.sendObject = sendObject;
this.count = count;
}
@Override
public void onConfirmClick(View view) {
mPresenter.sendTickerFragment.sendTicker();
this.dismiss();
super.onConfirmClick(view);
}
}
......@@ -22,6 +22,7 @@ import com.xingdata.zzdpos.ui.sendticke.SendTicketActivity;
import com.xingdata.zzdpos.ui.sendticke.SendTicketPresenter;
import com.xingdata.zzdpos.ui.sendticke.adapter.ReturnTicketAdapter;
import com.xingdata.zzdpos.ui.sendticke.adapter.VipGroupAdapter;
import com.xingdata.zzdpos.ui.sendticke.dialog.SendTickerBeforDialog;
import com.xingdata.zzdpos.util.ConvertUtil;
import com.xingdata.zzdpos.util.OnClickListener;
import com.xingdata.zzdpos.util.RecyclerViewUtil;
......@@ -179,6 +180,42 @@ public class SendTickerFragment extends BaseFragment<SendTicketPresenter,
}
}
//发券操作,对话框点击确认触发
public void sendTicker() {
long tickerId = truleList
.get(nowTickerItemId).getTruleMapId();
loadingDialog.show((BaseActivity) getActivity());
if (nowtype == 0) {
//单独会员发券
mPresenter.sendTicker(null, null, nowVip.getVipId(), tickerId,
loadingDialog);
} else if (nowtype == 1) {
Long tempLevelId = levelList.get(nowVipGroupId).getId();
if (tempLevelId == SendTickerC.getVipType().get(0).getId()) {
//选择全部会员
mPresenter.sendTicker(null, null, null, tickerId,
loadingDialog);
return;
}
for (int i = 1; i < SendTickerC.getVipType().size(); i++) {
long tempServerId = SendTickerC.getServerId(tempLevelId);
//选择 当月下月以及流失会员
if (tempLevelId == SendTickerC.getVipType().get(i).getId() &&
tempServerId != -1) {
mPresenter.sendTicker(tempServerId + "", null,
null, tickerId,
loadingDialog);
return;
}
}
//选择金牌银牌等会员类别
mPresenter.sendTicker(null, levelList.get(nowVipGroupId)
.getVipLevel() + "",
null, tickerId,
loadingDialog);
}
}
private void initVipGroupData() {
mViewBinding.llVipSingle.setVisibility(View.GONE);
......@@ -274,6 +311,12 @@ public class SendTickerFragment extends BaseFragment<SendTicketPresenter,
}
public void sendSuccBefor(long count) {
SendTickerBeforDialog sendTickerBeforDialog = new SendTickerBeforDialog();
sendTickerBeforDialog.setData(truleList
.get(nowTickerItemId).getTruleName(), mViewBinding.tvSelect.getText()
.toString(),
count);
sendTickerBeforDialog.show((BaseActivity) getActivity());
LogUtils.e("count-------------------------> " + count);
}
}
\ No newline at end of file
......@@ -13,6 +13,7 @@ import com.xingdata.zzdpos.model.Vip;
import com.xingdata.zzdpos.ui.sendticke.SendTicketPresenter;
import com.xingdata.zzdpos.ui.sendticke.adapter.VipAdapter;
import com.xingdata.zzdpos.ui.settle.SettleActivity;
import com.xingdata.zzdpos.util.Global;
import com.xingdata.zzdpos.util.OnClickListener;
import java.util.List;
......@@ -21,6 +22,7 @@ import java.util.List;
public class VipFragment extends BaseFragment<SendTicketPresenter, FragmentSendTickerVipBinding> {
private VipAdapter mVipAdapter;
@Override
public int getLayoutId() {
return R.layout.fragment_send_ticker_vip;
......@@ -41,7 +43,8 @@ public class VipFragment extends BaseFragment<SendTicketPresenter, FragmentSendT
mVipAdapter.setOnItemClickListener((adapter, view, position) -> {
mPresenter.selectVip(mVipAdapter.getData().get(position));
mPresenter.sendTickerFragment = new com.xingdata.zzdpos.ui.sendticke.fragment.SendTickerFragment();
mPresenter.sendTickerFragment = new com.xingdata.zzdpos.ui.sendticke.fragment
.SendTickerFragment();
mPresenter.sendTickerFragment.setNowtype(0);
mPresenter.sendTickerFragment.setNowVip(mVipAdapter.getData().get(position));
startWithPop(mPresenter.sendTickerFragment);
......@@ -66,10 +69,8 @@ public class VipFragment extends BaseFragment<SendTicketPresenter, FragmentSendT
mPresenter.searchVip(textView.getText().toString());
return false;
});
mViewBinding.etSearch.setFocusable(true);
mViewBinding.etSearch.setFocusableInTouchMode(true);
mViewBinding.etSearch.requestFocus();
KeyboardUtils.showSoftInput(mViewBinding.etSearch);
Global.setFocus(mViewBinding.etSearch, getActivity());
// KeyboardUtils.showSoftInput(getActivity());
}
......
......@@ -16,6 +16,7 @@ import com.xingdata.zzdpos.model.Ticket;
import com.xingdata.zzdpos.model.Vip;
import com.xingdata.zzdpos.ui.dialog.LoadingDialog;
import com.xingdata.zzdpos.ui.main.MainActivity;
import com.xingdata.zzdpos.ui.scan.ScanFragment;
import com.xingdata.zzdpos.ui.settle.fragment.CashPayFragment;
import com.xingdata.zzdpos.ui.settle.dialog.PasswordDialog;
import com.xingdata.zzdpos.ui.settle.fragment.PayResultFragment;
......@@ -131,6 +132,12 @@ public class SettleActivity extends BaseActivity<SettlePresenter, ActivitySettle
case C.PAY_CHANNEL.CARD:
mPasswordDialog.setSaleorder(saleorder).show(this);
break;
case C.PAY_CHANNEL.ALI:
case C.PAY_CHANNEL.WECHAT:
ScanFragment mScanFragment = new ScanFragment();
mScanFragment.setOnScanCompletedListener(barcode -> mPresenter.payInAli(barcode));
this.start(mScanFragment);
break;
}
}
......
package com.xingdata.zzdpos.ui.settle;
import com.alibaba.fastjson.JSON;
import com.blankj.utilcode.util.StringUtils;
import com.blankj.utilcode.util.TimeUtils;
import com.xingdata.api.print.ZX_PrintPOS;
import com.xingdata.zzdpos.C;
import com.xingdata.zzdpos.api.ApiFactory;
import com.xingdata.zzdpos.api.JniFactory;
import com.xingdata.zzdpos.api.Pay;
import com.xingdata.zzdpos.db.DBFactory;
import com.xingdata.zzdpos.model.HandoverInfo;
import com.xingdata.zzdpos.model.Ms;
......@@ -14,9 +18,12 @@ import com.xingdata.zzdpos.model.Ticket;
import com.xingdata.zzdpos.model.Vip;
import com.xingdata.zzdpos.ui.main.MainActivity;
import com.xingdata.zzdpos.ui.main.MainPresenter;
import com.xingdata.zzdpos.util.ConvertUtil;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
import io.reactivex.Observable;
......@@ -222,6 +229,26 @@ public class SettlePresenter extends SettleContract.Presenter {
@Override
public void payInAli(String payCode) {
Pay.Request q = new Pay.Request();
q.setOrderType("1");
q.setPayChannelType("3");
q.setDeviceType("2");
q.setMch_id("11");
q.setTer_id("11");
q.setOrderDateTime(TimeUtils.getNowString(new SimpleDateFormat("yyyymmddHHMMSS", Locale.getDefault())));
q.setCurrencyType("156");
q.setOrderAmt(ConvertUtil.longToString(mSaleorder.getOrderPayAmt()));
q.setOrderName("测试");
q.setChannelAuthCode(payCode);
q.setKey("Key");
q.setNotifyUrl("setNotifyUrl");
subscribePay(commitOrder().flatMap(s -> {
q.setOrderNo(s);
return JniFactory.Settle.pay(JSON.toJSONString(q));
}).flatMap(response -> ApiFactory.Saleorder.addOrderPayMis(mSaleorder.pay(q.getOrderNo(), C.PAY_CHANNEL.CASH))));
}
@Override
......@@ -375,6 +402,7 @@ public class SettlePresenter extends SettleContract.Presenter {
* 统计订单信息
*/
private void reprice() {
mSaleorder.settle();
mView.loadSaleorder(mSaleorder);
}
......
......@@ -48,11 +48,12 @@ public class VipFragment extends BaseFragment<SettlePresenter, FragmentSettleVip
* @param vips 会员列表
*/
public void loadVips(List<Vip> vips) {
mViewBinding.setEmpty(vips.size() == 0);
mVipAdapter.setNewData(vips);
if (vips.size() == 1) {
mPresenter.selectVip(vips.get(0));
this.pop();
} else {
mViewBinding.setEmpty(vips.size() == 0);
mVipAdapter.setNewData(vips);
}
}
......
......@@ -23,7 +23,9 @@ import java.util.List;
import io.reactivex.Observable;
import io.reactivex.ObservableEmitter;
import io.reactivex.ObservableOnSubscribe;
import io.reactivex.Observer;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.disposables.Disposable;
import io.reactivex.functions.Consumer;
import io.reactivex.schedulers.Schedulers;
......@@ -84,46 +86,62 @@ public class MsMainFragment extends BaseFragment<MainPresenter, FragmentMsMainBi
public void subscribe(ObservableEmitter<View> e) throws Exception {
e.onNext(getLayoutInflater().inflate(R.layout.item_string, null));
e.onNext(getLayoutInflater().inflate(R.layout.item_string, null));
e.onComplete();
}
}).subscribeOn(Schedulers.newThread()).observeOn(AndroidSchedulers.mainThread()).subscribe(new Consumer<View>() {
int i = 0;
}).subscribeOn(Schedulers.newThread()).
observeOn(AndroidSchedulers.mainThread()).
subscribe(new Observer<View>() {
private int i = 0;
@Override
public void onSubscribe(Disposable d) {
}
@Override
public void onNext(View view) {
ItemStringBinding itemMenuBottomBinding = DataBindingUtil.bind(view);
if (i == 0) {
itemMenuBottomBinding.itemTv.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD));
}
itemMenuBottomBinding.itemTv.setText(titleInts[i]);
itemMenuBottomBinding.itemTv.setPadding(0, 0, 0, 0);
mViewBinding.tabLayout.getTabAt(i).setCustomView(view);
i++;
}
@Override
public void onError(Throwable e) {
}
@Override
public void onComplete() {
mViewBinding.tabLayout.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() {
@Override
public void onTabSelected(TabLayout.Tab tab) {
TextView textView = (TextView) tab.getCustomView().findViewById(R.id.item_tv);
textView.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD));
textView.setText(tab.getText());
}
@Override
public void onTabUnselected(TabLayout.Tab tab) {
TextView textView = (TextView) tab.getCustomView().findViewById(R.id.item_tv);
textView.setTypeface(Typeface.defaultFromStyle(Typeface.NORMAL));
textView.setText(tab.getText());
}
@Override
public void onTabReselected(TabLayout.Tab tab) {
}
});
}
});
@Override
public void accept(View view) throws Exception {
ItemStringBinding itemMenuBottomBinding = DataBindingUtil.bind(view);
if (i == 0) {
itemMenuBottomBinding.itemTv.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD));
}
itemMenuBottomBinding.itemTv.setText(titleInts[i]);
itemMenuBottomBinding.itemTv.setPadding(0, 0, 0, 0);
mViewBinding.tabLayout.getTabAt(i).setCustomView(view);
i++;
}
});
mViewBinding.tabLayout.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() {
@Override
public void onTabSelected(TabLayout.Tab tab) {
TextView textView = (TextView) tab.getCustomView().findViewById(R.id.item_tv);
textView.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD));
textView.setText(tab.getText());
}
@Override
public void onTabUnselected(TabLayout.Tab tab) {
TextView textView = (TextView) tab.getCustomView().findViewById(R.id.item_tv);
textView.setTypeface(Typeface.defaultFromStyle(Typeface.NORMAL));
textView.setText(tab.getText());
}
@Override
public void onTabReselected(TabLayout.Tab tab) {
}
});
}
......
......@@ -136,14 +136,7 @@ public class OrderMainFragment extends BaseFragment<StatisticsPresenter, Fragmen
mFragmentStateAdapter = new FragmentStateAdapter(fragments, getChildFragmentManager());
mViewBinding.viewPagerData.setAdapter(mFragmentStateAdapter);
mViewBinding.tabLayout.setupWithViewPager(mViewBinding.viewPagerData);
if (mViewBinding.tabLayout.getSelectedTabPosition() != 0) {
new android.os.Handler().postDelayed(new Runnable() {
@Override
public void run() {
mViewBinding.viewPagerData.setCurrentItem(0, false);
}
}, 1);
}
for (int i = 0; i < fragments.size(); i++) {
if (month == 0) month = 12;
......@@ -180,6 +173,16 @@ public class OrderMainFragment extends BaseFragment<StatisticsPresenter, Fragmen
}
});
new android.os.Handler().postDelayed(new Runnable() {
@Override
public void run() {
if (mViewBinding.tabLayout.getSelectedTabPosition() != 0) {
mViewBinding.viewPagerData.setCurrentItem(0, false);
}
}
}, 1);
}
......
......@@ -23,10 +23,10 @@ import com.xingdata.zzdpos.model.Saledetail;
import com.xingdata.zzdpos.model.Saleorder;
import com.xingdata.zzdpos.model.Sskugrp;
import com.xingdata.zzdpos.ui.dialog.LoadingDialog;
import com.xingdata.zzdpos.ui.scan.ScanFragment;
import com.xingdata.zzdpos.ui.settle.SettleActivity;
import com.xingdata.zzdpos.ui.store.dialog.CartDialog;
import com.xingdata.zzdpos.ui.store.dialog.MsDialog;
import com.xingdata.zzdpos.ui.store.fragment.ScanFragment;
import com.xingdata.zzdpos.ui.store.fragment.SearchFragment;
import com.xingdata.zzdpos.ui.store.fragment.StoreFragment;
......@@ -53,13 +53,10 @@ public class StoreActivity extends BaseActivity<StorePresenter, ActivityStoreBin
@Override
public void initView() {
loadRootFragment(R.id.f_store, mStoreFragment);
mViewBinding.ivCart.setOnClickListener(view -> mPresenter.clickCartLogo());
mViewBinding.tvSettle.setOnClickListener(view -> mPresenter.clickSettle());
mViewBinding.btnBack.setOnClickListener(view -> onBackPressedSupport());
mViewBinding.btnBack.setOnClickListener(view -> {
onBackPressedSupport();
});
mViewBinding.etSearch.setOnEditorActionListener((textView, i, keyEvent) -> {
if (i == EditorInfo.IME_ACTION_SEARCH && !StringUtils.isEmpty(textView.getText())) {
KeyboardUtils.hideSoftInput(textView);
......@@ -67,28 +64,21 @@ public class StoreActivity extends BaseActivity<StorePresenter, ActivityStoreBin
}
return false;
});
mViewBinding.etSearch.setOnFocusChangeListener((view, b) -> {
mPresenter.searchBarFocusChanged(b);
});
mViewBinding.btnScan.setOnClickListener(view -> {
PermissionUtils.permission(PermissionConstants.CAMERA)
.rationale(new PermissionUtils.OnRationaleListener() {
@Override
public void rationale(final ShouldRequest shouldRequest) {
}
})
.callback(new PermissionUtils.FullCallback() {
@Override
public void onGranted(List<String> permissionsGranted) {
showScanFragment();
}
@Override
public void onDenied(List<String> permissionsDeniedForever, List<String> permissionsDenied) {
}
})
.request();
});
mViewBinding.btnScan.setOnClickListener(view -> PermissionUtils.permission(PermissionConstants.CAMERA)
.callback(new PermissionUtils.FullCallback() {
@Override
public void onGranted(List<String> permissionsGranted) {
mPresenter.clickScan();
}
@Override
public void onDenied(List<String> permissionsDeniedForever, List<String> permissionsDenied) {
}
})
.request());
mScanFragment.setOnScanCompletedListener(barcode -> mPresenter.scanComplete(barcode));
}
@Override
......@@ -123,49 +113,9 @@ public class StoreActivity extends BaseActivity<StorePresenter, ActivityStoreBin
mViewBinding.setOrderPayAmt(saleorder.getOrderPayAmt());
mViewBinding.setMsDisAmt(saleorder.getMsDisAmt());
if (mCartDialog.isShowing) mCartDialog.loadSaleorder(saleorder);
this.startShakeByPropertyAnim(mViewBinding.ivCart, 0.75f, 1f, 0.30f, 500L);
this.startShakeByPropertyAnim(mViewBinding.ivCart, 0.75f, 1f, 300L);
}
private void startShakeByPropertyAnim(View view, float scaleSmall, float scaleLarge, float shakeDegrees, long duration) {
if (view == null) {
return;
}
//先变小后变大
PropertyValuesHolder scaleXValuesHolder = PropertyValuesHolder.ofKeyframe(View.SCALE_X,
Keyframe.ofFloat(0f, 1.0f),
Keyframe.ofFloat(0.25f, scaleSmall),
Keyframe.ofFloat(0.5f, scaleLarge),
Keyframe.ofFloat(0.75f, scaleLarge),
Keyframe.ofFloat(1.0f, 1.0f)
);
PropertyValuesHolder scaleYValuesHolder = PropertyValuesHolder.ofKeyframe(View.SCALE_Y,
Keyframe.ofFloat(0f, 1.0f),
Keyframe.ofFloat(0.25f, scaleSmall),
Keyframe.ofFloat(0.5f, scaleLarge),
Keyframe.ofFloat(0.75f, scaleLarge),
Keyframe.ofFloat(1.0f, 1.0f)
);
//先往左再往右
PropertyValuesHolder rotateValuesHolder = PropertyValuesHolder.ofKeyframe(View.ROTATION,
Keyframe.ofFloat(0f, 0f),
Keyframe.ofFloat(0.1f, -shakeDegrees),
Keyframe.ofFloat(0.2f, shakeDegrees),
Keyframe.ofFloat(0.3f, -shakeDegrees),
Keyframe.ofFloat(0.4f, shakeDegrees),
Keyframe.ofFloat(0.5f, -shakeDegrees),
Keyframe.ofFloat(0.6f, shakeDegrees),
Keyframe.ofFloat(0.7f, -shakeDegrees),
Keyframe.ofFloat(0.8f, shakeDegrees),
Keyframe.ofFloat(0.9f, -shakeDegrees),
Keyframe.ofFloat(1.0f, 0f)
);
ObjectAnimator objectAnimator = ObjectAnimator.ofPropertyValuesHolder(view, scaleXValuesHolder, scaleYValuesHolder, rotateValuesHolder);
objectAnimator.setDuration(duration);
objectAnimator.start();
}
@Override
public void loadSaledetails(List<Saledetail> saledetails, boolean isRefresh) {
......@@ -206,18 +156,23 @@ public class StoreActivity extends BaseActivity<StorePresenter, ActivityStoreBin
@Override
public void showSearchFragment() {
if (!mSearchFragment.isAdded()) this.start(mSearchFragment);
if (!mSearchFragment.isAdded()) {
mViewBinding.setTitleMode(C.TITLE_MODE.SKU);
mViewBinding.etSearch.setText("");
mViewBinding.etSearch.requestFocus();
this.start(mSearchFragment);
}
}
@Override
public void showScanFragment() {
this.start(mScanFragment);
if (!mScanFragment.isAdded()) this.start(mScanFragment);
}
@Override
public void resetSearchBar() {
mViewBinding.etSearch.setText("");
mViewBinding.clTitle.requestFocus();
mViewBinding.setTitleMode(C.TITLE_MODE.TEXT);
}
@Override
......@@ -225,4 +180,36 @@ public class StoreActivity extends BaseActivity<StorePresenter, ActivityStoreBin
mScanFragment.resetScanner();
}
/**
* 执行抖动动画
*
* @param view 要执行的view
* @param scaleSmall 缩小比例
* @param scaleLarge 放大比例
* @param duration 时间
*/
private void startShakeByPropertyAnim(View view, float scaleSmall, float scaleLarge, long duration) {
if (view == null) {
return;
}
//先变小后变大
PropertyValuesHolder scaleXValuesHolder = PropertyValuesHolder.ofKeyframe(View.SCALE_X,
Keyframe.ofFloat(0f, 1.0f),
Keyframe.ofFloat(0.25f, scaleSmall),
Keyframe.ofFloat(0.5f, scaleLarge),
Keyframe.ofFloat(0.75f, scaleLarge),
Keyframe.ofFloat(1.0f, 1.0f)
);
PropertyValuesHolder scaleYValuesHolder = PropertyValuesHolder.ofKeyframe(View.SCALE_Y,
Keyframe.ofFloat(0f, 1.0f),
Keyframe.ofFloat(0.25f, scaleSmall),
Keyframe.ofFloat(0.5f, scaleLarge),
Keyframe.ofFloat(0.75f, scaleLarge),
Keyframe.ofFloat(1.0f, 1.0f)
);
ObjectAnimator objectAnimator = ObjectAnimator.ofPropertyValuesHolder(view, scaleXValuesHolder, scaleYValuesHolder);
objectAnimator.setDuration(duration);
objectAnimator.start();
}
}
......@@ -152,6 +152,11 @@ interface StoreContract {
*/
public abstract void searchSku(String keyword);
/**
* 商店页面 - 点击扫描按钮
*/
public abstract void clickScan();
/**
* 扫描页面 - 扫描完成
*
......
......@@ -110,6 +110,11 @@ public class StorePresenter extends StoreContract.Presenter {
this.getSearchSku();
}
@Override
public void clickScan() {
mView.showScanFragment();
}
@Override
public void scanComplete(String keyword) {
this.getProductByBarcode(keyword);
......@@ -211,7 +216,7 @@ public class StorePresenter extends StoreContract.Presenter {
sskugrp = new Sskugrp();
sskugrp.setSkuGrpId(0L);
sskugrp.setSkuGrpName("全部分组");
sskugrp.setSkuGrpName("全部商品");
sskugrp.setSelected(true);
sskugrps.add(0, sskugrp);
......
package com.xingdata.zzdpos.ui.store.fragment;
import android.animation.Animator;
import android.animation.ValueAnimator;
import android.annotation.SuppressLint;
import android.graphics.Path;
import android.graphics.PathMeasure;
import android.support.constraint.ConstraintLayout;
import android.support.v7.widget.LinearLayoutManager;
import android.view.View;
import android.view.animation.LinearInterpolator;
import android.widget.ImageView;
import com.blankj.utilcode.util.ScreenUtils;
import com.xingdata.zzdpos.C;
import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseFragment;
......@@ -36,7 +44,7 @@ public class SearchFragment extends BaseFragment<StorePresenter, FragmentStoreSe
// set sku listener
mSkuAdapter.setOnLoadMoreListener(this::loadMoreSku, mViewBinding.rlSku);
mSkuAdapter.setOnCountChangeListener((view, sku, value) -> {
if (value > 0) mPresenter.clickAddSku(sku, value);
if (value > 0) this.clickAdd(view, sku, value);
else mPresenter.clickRemoveSku(sku, value);
});
......@@ -98,4 +106,98 @@ public class SearchFragment extends BaseFragment<StorePresenter, FragmentStoreSe
public void setSaledetails(List<Saledetail> saledetails) {
this.mSaledetails = saledetails;
}
/**
* 点击添加按钮
*
* @param view 按钮
* @param sku 商品信息
* @param value 数量
*/
private void clickAdd(View view, BaseSku sku, int value) {
// 路径测量
PathMeasure mPathMeasure;
// 贝塞尔曲线中间过程点坐标
float[] mCurrentPosition = new float[2];
final ImageView icon = new ImageView(mContext);
icon.setImageDrawable(((ImageView) view).getDrawable());
ConstraintLayout.LayoutParams params = new ConstraintLayout.LayoutParams(view.getWidth(), view.getHeight());
mViewBinding.clStore.addView(icon, params);
int[] parentLocation = new int[2];
mViewBinding.clStore.getLocationInWindow(parentLocation);
int startLoc[] = new int[2];
view.getLocationInWindow(startLoc);
// 得到购物车图片的坐标(用于计算动画结束后的坐标)
int endLoc[] = new int[]{0, ScreenUtils.getScreenHeight()};
float startX = startLoc[0] - parentLocation[0];
float startY = startLoc[1] - parentLocation[1];
// 商品掉落后的终点坐标:购物车起始点-父布局起始点+购物车图片的1/5
float toX = endLoc[0] - parentLocation[0];
float toY = endLoc[1] - parentLocation[1];
// 开始绘制贝塞尔曲线
Path path = new Path();
// 移动到起始点(贝塞尔曲线的起点)
path.moveTo(startX, startY);
// 使用二阶贝塞尔曲线:注意第一个起始坐标越大,贝塞尔曲线的横向距离就会越大,一般按照下面的式子取即可
path.quadTo((startX + toX) / 2, startY, toX, toY);
// mPathMeasure用来计算贝塞尔曲线的曲线长度和贝塞尔曲线中间插值的坐标,如果是true,path会形成一个闭环
mPathMeasure = new PathMeasure(path, false);
// 属性动画实现(从0到贝塞尔曲线的长度之间进行插值计算,获取中间过程的距离值)
ValueAnimator valueAnimator = ValueAnimator.ofFloat(0, mPathMeasure.getLength());
valueAnimator.setDuration(300);
// 匀速线性插值器
valueAnimator.setInterpolator(new LinearInterpolator());
valueAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
// 当插值计算进行时,获取中间的每个值,
// 这里这个值是中间过程中的曲线长度(下面根据这个值来得出中间点的坐标值)
float value = (Float) animation.getAnimatedValue();
// 获取当前点坐标封装到mCurrentPosition
// boolean getPosTan(float distance, float[] pos, float[] tan) :
// 传入一个距离distance(0<=distance<=getLength()),然后会计算当前距离的坐标点和切线,pos会自动填充上坐标,这个方法很重要。
// mCurrentPosition此时就是中间距离点的坐标值
mPathMeasure.getPosTan(value, mCurrentPosition, null);
// 移动的商品图片(动画图片)的坐标设置为该中间点的坐标
icon.setTranslationX(mCurrentPosition[0]);
icon.setTranslationY(mCurrentPosition[1]);
}
});
// 开始执行动画
valueAnimator.start();
// 动画结束后的处理
valueAnimator.addListener(new Animator.AnimatorListener() {
@Override
public void onAnimationStart(Animator animation) {
}
@Override
public void onAnimationEnd(Animator animation) {
// 执行添加方法
mPresenter.clickAddSku(sku, value);
// 把执行动画的商品图片从父布局中移除
mViewBinding.clStore.removeView(icon);
}
@Override
public void onAnimationCancel(Animator animation) {
}
@Override
public void onAnimationRepeat(Animator animation) {
}
});
}
}
......@@ -70,6 +70,7 @@ public class StoreFragment extends BaseFragment<StorePresenter, FragmentStoreBin
// set other listener
mViewBinding.llMs.setOnClickListener(view -> mPresenter.clickMs());
mViewBinding.tvSearch.setOnClickListener(view -> mPresenter.searchBarFocusChanged(true));
// set empty
@SuppressLint("InflateParams") View view = getLayoutInflater().inflate(R.layout.view_empty, null);
......@@ -263,7 +264,6 @@ public class StoreFragment extends BaseFragment<StorePresenter, FragmentStoreBin
float toX = endLoc[0] - parentLocation[0];
float toY = endLoc[1] - parentLocation[1];
// 开始绘制贝塞尔曲线
Path path = new Path();
// 移动到起始点(贝塞尔曲线的起点)
......@@ -275,7 +275,7 @@ public class StoreFragment extends BaseFragment<StorePresenter, FragmentStoreBin
// 属性动画实现(从0到贝塞尔曲线的长度之间进行插值计算,获取中间过程的距离值)
ValueAnimator valueAnimator = ValueAnimator.ofFloat(0, mPathMeasure.getLength());
valueAnimator.setDuration(500);
valueAnimator.setDuration(300);
// 匀速线性插值器
valueAnimator.setInterpolator(new LinearInterpolator());
......
......@@ -6,17 +6,6 @@ import java.math.BigDecimal;
public class ConvertUtil {
// /**
// * 分转元
// *
// * @param fen 分
// * @return 元
// */
// public static String fenToYuan(Long fen) {
// BigDecimal decimal = new BigDecimal(fen);
// return decimal.divide(new BigDecimal(100)).setScale(2, BigDecimal.ROUND_DOWN).toString();
// }
/**
* 分转元
*
......@@ -25,10 +14,22 @@ public class ConvertUtil {
*/
public static String fenToYuan(Long fen) {
if (fen == null || fen == 0) return "0.00";
java.text.DecimalFormat df = new java.text.DecimalFormat("#.00");
return String.valueOf(df.format((double) fen / 100));
BigDecimal decimal = new BigDecimal(fen);
return decimal.divide(new BigDecimal(100), 2, BigDecimal.ROUND_DOWN).toString();
}
// /**
// * 分转元
// *
// * @param fen 分
// * @return 元
// */
// public static String fenToYuan(Long fen) {
// if (fen == null || fen == 0) return "0.00";
// java.text.DecimalFormat df = new java.text.DecimalFormat("#.00");
// return String.valueOf(df.format((double) fen / 100));
// }
/**
* 分转元
......
package com.xingdata.zzdpos.util;
import android.content.Context;
import android.view.View;
import android.view.inputmethod.InputMethodManager;
/**
* Created by Administrator on 2018/1/17.
*/
public class Global {
private static void fragmentShowKeyboard(Context context) {
InputMethodManager imm = (InputMethodManager) context.getSystemService(Context
.INPUT_METHOD_SERVICE);
imm.toggleSoftInput(InputMethodManager.SHOW_IMPLICIT, InputMethodManager.HIDE_NOT_ALWAYS);
}
public static void setFocus(View view, Context context) {
view.setFocusable(true);
view.setFocusableInTouchMode(true);
view.requestFocus();
Global.fragmentShowKeyboard(context);
}
}
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="4dp" />
<solid android:color="@color/white" />
</shape>
\ No newline at end of file
......@@ -2,6 +2,6 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="@dimen/all_shape_radius" />
<solid android:color="@color/gray_kongming" />
<solid android:color="@color/gray_zhouyu" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:left="-2dp"
android:right="-2dp">
<shape>
<solid android:color="@color/gray_zhouyu"/>
<stroke
android:width="0.5dp"
android:color="@color/gray_huanggai"/>
</shape>
</item>
</layer-list>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:left="-2dp"
android:right="-2dp">
<shape>
<solid android:color="@android:color/white"/>
<stroke
android:width="0.5dp"
android:color="@color/gray_huanggai"/>
</shape>
</item>
</layer-list>
\ No newline at end of file
......@@ -39,7 +39,7 @@
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginEnd="@dimen/all_margin"
android:visibility="@{titleMode==1||titleMode==6?8:0}"
android:visibility="@{titleMode==1||titleMode==6||titleMode==8?8:0}"
app:layout_constraintBottom_toTopOf="parent"
app:layout_constraintLeft_toRightOf="@id/btn_back"
app:layout_constraintRight_toRightOf="parent"
......@@ -66,10 +66,24 @@
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}"
android:visibility="@{titleMode==1||titleMode==6||titleMode==8?0:8}"
app:layout_constraintLeft_toRightOf="parent"
app:layout_constraintRight_toLeftOf="parent" />
<TextView
android:id="@+id/tv_editor_hint"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/all_spacing"
android:paddingBottom="@dimen/all_shape_radius"
android:paddingEnd="@dimen/all_spacing"
android:paddingStart="@dimen/all_spacing"
android:paddingTop="@dimen/all_shape_radius"
android:textColor="@color/white_caocao"
android:visibility="@{titleMode==8?0:8}"
app:layout_constraintBottom_toTopOf="@id/tv_title"
app:layout_constraintLeft_toRightOf="@id/tv_title"
app:layout_constraintTop_toBottomOf="@id/tv_title" />
<ImageButton
android:id="@+id/btn_menu"
......@@ -83,7 +97,6 @@
android:visibility="@{titleMode==6?0:8}"
app:layout_constraintRight_toRightOf="parent" />
<View
android:layout_width="match_parent"
android:layout_height="@dimen/all_line_width"
......
......@@ -22,7 +22,9 @@
name="msDisAmt"
type="long" />
<variable
name="titleMode"
type="int" />
</data>
<android.support.constraint.ConstraintLayout
......@@ -73,7 +75,8 @@
android:labelFor="@+id/et_search"
android:textColor="@color/black_likui"
android:textColorHint="@color/gray_huanggai"
android:textSize="@dimen/all_text_size" />
android:textSize="@dimen/all_text_size"
android:visibility="@{titleMode>1?View.VISIBLE:View.INVISIBLE}" />
<ImageButton
android:id="@+id/btn_scan"
......@@ -83,9 +86,20 @@
android:contentDescription="@string/store_scan"
android:foreground="?android:attr/actionBarItemBackground"
android:src="@mipmap/but_sweep_yard" />
</LinearLayout>
<TextView
android:id="@+id/tv_title"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="center"
android:text="@string/store_title"
android:textColor="@color/black_baozheng"
android:textSize="@dimen/all_sub_title_size"
android:visibility="@{titleMode>1?View.GONE:View.VISIBLE}"
app:layout_constraintLeft_toRightOf="parent"
app:layout_constraintRight_toLeftOf="parent" />
<View
android:layout_width="match_parent"
android:layout_height="@dimen/all_line_width"
......
......@@ -6,17 +6,18 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/lyt_main_bg"
android:orientation="vertical">
<TextView
android:id="@+id/tv_title"
style="@style/dialog_title"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<View
android:layout_width="match_parent"
android:layout_height="@dimen/all_line_width"
android:background="@color/gray_kongming" />
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/all_padding" />
<ViewStub
android:id="@+id/vs_center"
android:layout_width="match_parent"
......
......@@ -146,7 +146,7 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="2"
android:text=" 个积分等于1元"
android:text=" 个积分=1元"
android:textColor="@color/black_baozheng"
android:textSize="@dimen/et_textsize"/>
</LinearLayout>
......
......@@ -68,6 +68,7 @@
android:background="@color/gray_huanggai"></View>
<LinearLayout
android:id="@+id/ll_rules_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
......@@ -129,6 +130,7 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="5"
android:gravity="left"
android:orientation="horizontal">
<RadioButton
......@@ -140,6 +142,7 @@
android:layout_weight="1"
android:background="@drawable/selector_checkbox_bg"
android:button="@null"
android:gravity="left"
android:onClick="@{OnClickListener}"
android:text="暂停 "
android:textSize="@dimen/et_textsize"/>
......@@ -223,7 +226,7 @@
android:layout_marginRight="@dimen/all_margin"
android:layout_weight="5"
android:ems="10"
android:gravity="center"
android:gravity="left"
android:maxLength="5"
android:textColor="@color/black"
android:textColorHint="@color/hint"
......@@ -232,18 +235,11 @@
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="@dimen/all_line_width"
android:layout_marginLeft="@dimen/all_padding"
android:layout_marginRight="@dimen/all_padding"
android:background="@color/gray1"
android:visibility="gone"></View>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:background="@drawable/up_down_line_white"
android:gravity="center"
android:paddingBottom="@dimen/all_padding"
android:paddingTop="@dimen/all_padding">
......@@ -258,6 +254,7 @@
android:textSize="@dimen/et_textsize"/>
<RadioGroup
android:id="@+id/rg_type"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="5"
......@@ -306,14 +303,22 @@
android:textColor="@color/black_baozheng"
android:textSize="@dimen/et_textsize"/>
</RadioGroup>
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="@dimen/all_line_width"
android:layout_marginLeft="@dimen/all_padding"
android:layout_marginRight="@dimen/all_padding"
android:background="@color/gray1"></View>
<TextView
android:id="@+id/tv_type"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginRight="@dimen/all_margin"
android:layout_weight="5"
android:ems="10"
android:gravity="left"
android:maxLength="5"
android:textColor="@color/black"
android:textColorHint="@color/hint"
android:textSize="@dimen/et_textsize"
android:visibility="gone"/>
</LinearLayout>
<LinearLayout
......@@ -418,19 +423,12 @@
</LinearLayout>
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="@dimen/all_line_width"
android:layout_marginLeft="@dimen/all_padding"
android:layout_marginRight="@dimen/all_padding"
android:background="@color/gray1"></View>
<LinearLayout
android:id="@+id/ll_category"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:background="@drawable/up_down_line_white"
android:gravity="center"
android:orientation="vertical"
android:visibility="gone">
......@@ -458,7 +456,7 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_weight="1.5"
android:layout_weight="1.6"
android:drawableRight="@mipmap/createstore_drop_down"
android:ellipsize="end"
android:gravity="center"
......@@ -476,7 +474,7 @@
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginLeft="@dimen/all_padding"
android:layout_weight="1.5"
android:layout_weight="1.6"
android:drawableRight="@mipmap/createstore_drop_down"
android:ellipsize="end"
android:gravity="center"
......@@ -495,7 +493,7 @@
android:layout_centerHorizontal="true"
android:layout_marginLeft="@dimen/all_padding"
android:layout_marginRight="@dimen/all_bounced_padding"
android:layout_weight="1.5"
android:layout_weight="1.8"
android:drawableRight="@mipmap/createstore_drop_down"
android:ellipsize="end"
android:ems="10"
......@@ -512,13 +510,10 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginLeft="@dimen/all_padding"
android:layout_weight="4.5"
android:ellipsize="end"
android:ems="20"
android:gravity="center"
android:maxLength="20"
android:singleLine="true"
android:layout_marginRight="@dimen/all_margin"
android:layout_weight="5"
android:ems="@integer/all_content_weight"
android:gravity="left"
android:textColor="@color/black"
android:textColorHint="@color/hint"
android:textSize="@dimen/et_textsize"
......@@ -682,15 +677,15 @@
<LinearLayout
android:layout_width="match_parent"
android:background="@color/white"
android:layout_height="wrap_content">
android:layout_height="wrap_content"
android:background="@color/white">
<Button
android:id="@+id/btn_add"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/all_margin"
android:background="@color/red_guanyu"
android:background="@drawable/red_border"
android:onClick="@{OnClickListener}"
android:text="确定"
android:textColor="@color/white"
......
......@@ -5,17 +5,17 @@
<variable
name="onClickListener"
type="android.view.View.OnClickListener" />
type="android.view.View.OnClickListener"/>
</data>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/transparent_border"
android:gravity="center"
android:orientation="vertical">
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/transparent_border"
android:gravity="center"
android:orientation="vertical">
<RelativeLayout
......@@ -23,24 +23,35 @@
android:layout_height="@dimen/prompt_dialog_height"
android:background="@color/white_caocao"
android:gravity="center"
android:orientation="vertical"
>
android:orientation="vertical">
<TextView
android:id="@+id/tv_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:paddingBottom="@dimen/all_padding"
android:textSize="@dimen/text_three_title"
android:paddingTop="@dimen/all_padding"
android:text="系统提示"
android:textColor="@color/black_baozheng"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@+id/ll_bottom"
android:layout_below="@+id/tv_title"
android:gravity="center"
android:orientation="vertical">
<com.github.ybq.android.spinkit.SpinKitView xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/spin_kit"
style="@style/SpinKitView.Circle"
android:layout_width="@dimen/prompt_dialog_logo_size"
android:layout_height="@dimen/prompt_dialog_logo_size"
android:layout_marginTop="@dimen/all_bounced_padding"
android:visibility="gone"
app:SpinKit_Color="@color/black" />
android:id="@+id/spin_kit"
style="@style/SpinKitView.Circle"
android:layout_width="@dimen/prompt_dialog_logo_size"
android:layout_height="@dimen/prompt_dialog_logo_size"
android:layout_marginTop="@dimen/all_bounced_padding"
android:visibility="gone"
app:SpinKit_Color="@color/black"/>
<ImageView
android:id="@+id/iv_logo"
......@@ -61,7 +72,7 @@
android:gravity="center"
android:text="正在处理,请稍后."
android:textColor="@color/black_baozheng"
android:textSize="@dimen/all_text_size" />
android:textSize="@dimen/all_text_size"/>
</ScrollView>
......@@ -71,7 +82,7 @@
android:layout_width="@dimen/button1_width"
android:layout_height="@dimen/button1_height"
android:layout_marginBottom="@dimen/all_bounced_padding"
android:text="重新获取" />
android:text="重新获取"/>
</LinearLayout>
......@@ -92,7 +103,7 @@
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@id/btn_ok"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
app:layout_constraintTop_toTopOf="parent"/>
<Button
android:id="@+id/btn_ok"
......@@ -103,21 +114,14 @@
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/btn_cancel"
app:layout_constraintTop_toTopOf="parent" />
app:layout_constraintTop_toTopOf="parent"/>
<View
android:layout_width="match_parent"
android:layout_height="@dimen/view_line_L050"
android:background="@color/gray_kongming"
app:layout_constraintTop_toTopOf="parent" />
android:background="@color/gray_huanggai"
app:layout_constraintTop_toTopOf="parent"/>
<View
android:layout_width="@dimen/view_line_L050"
android:layout_height="match_parent"
android:background="@color/gray_kongming"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</android.support.constraint.ConstraintLayout>
</RelativeLayout>
......
......@@ -19,15 +19,15 @@
<RelativeLayout
android:layout_width="@dimen/prompt_dialog_width"
android:layout_height="@dimen/prompt_dialog_height"
android:background="@color/store_back"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="vertical">
android:orientation="vertical"
android:padding="@dimen/all_bounced_padding">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_height="wrap_content"
android:layout_above="@+id/ll_bottom"
android:gravity="center"
android:orientation="vertical">
......@@ -43,6 +43,7 @@
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="优惠券:"
android:textColor="@color/black_baozheng"
android:textSize="@dimen/all_text_size_low"/>
<TextView
......@@ -66,6 +67,7 @@
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="发送对象:"
android:textColor="@color/black_baozheng"
android:textSize="@dimen/all_text_size_low"/>
<TextView
......@@ -89,6 +91,7 @@
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="发送张数:"
android:textColor="@color/black_baozheng"
android:textSize="@dimen/all_text_size_low"/>
<TextView
......
......@@ -3,28 +3,36 @@
xmlns:app="http://schemas.android.com/apk/res-auto">
<LinearLayout
android:layout_width="wrap_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white_caocao"
android:orientation="vertical">
android:gravity="center"
android:orientation="horizontal">
<TextView
android:layout_width="match_parent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/all_margin"
android:gravity="center"
android:text="提示"
android:layout_marginBottom="@dimen/all_margin_big"
android:layout_marginTop="@dimen/all_margin_big"
android:text="确定删除"
android:textColor="@color/black_baozheng"
android:textSize="@dimen/all_sub_title_size"
android:textStyle="bold" />
android:textSize="@dimen/all_text_size" />
<TextView
android:id="@+id/tv_skugrp_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/all_margin_big"
android:layout_marginTop="@dimen/all_margin_big"
android:textColor="@color/black_baozheng"
android:textSize="@dimen/all_text_size" />
<TextView
android:layout_width="match_parent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/all_margin"
android:layout_marginStart="@dimen/all_margin"
android:layout_marginTop="@dimen/all_margin"
android:text="确定删除吗?"
android:layout_marginBottom="@dimen/all_margin_big"
android:layout_marginTop="@dimen/all_margin_big"
android:text="吗?"
android:textColor="@color/black_baozheng"
android:textSize="@dimen/all_text_size" />
......
......@@ -88,7 +88,7 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="5"
android:checkedButton="@id/rb_suspended"
android:checkedButton="@id/rb_start"
android:orientation="horizontal">
<RadioButton
......
......@@ -143,7 +143,7 @@
android:padding="@dimen/all_padding"
android:text="商品组合"
android:textColor="@color/black"
android:textSize="@dimen/all_text_size_big"/>
android:textSize="@dimen/text_secondary_title"/>
<Button
android:id="@+id/btn_dismantling"
......@@ -271,7 +271,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/ll_left"
android:background="@color/gray_zhouyu"
android:background="@drawable/up_down_line_gray"
android:orientation="horizontal">
......@@ -303,16 +303,15 @@
android:layout_above="@+id/ll_bottom"
android:layout_below="@+id/ll_shop_composition"
android:orientation="vertical"
android:paddingLeft="@dimen/all_padding"
android:paddingRight="@dimen/all_padding"
android:paddingLeft="@dimen/all_bounced_spacing"
android:paddingRight="@dimen/all_bounced_spacing"
>
<android.support.v7.widget.RecyclerView
android:id="@+id/rv_shop_item_list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="@dimen/all_padding"></android.support.v7.widget.RecyclerView>
android:layout_height="match_parent"></android.support.v7.widget.RecyclerView>
</LinearLayout>
......
......@@ -136,12 +136,12 @@
android:id="@+id/btn_group"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="@color/gray_zhouyu"
android:background="@drawable/up_down_line_gray"
android:gravity="left|center_vertical"
android:paddingLeft="@dimen/all_padding"
android:text="共 2 个组合"
android:textColor="@color/black_baozheng"
android:textSize="@dimen/text_three_title"
android:textSize="@dimen/all_text_size_low"
app:layout_constraintTop_toBottomOf="@+id/btn_add"/>
<View
......
......@@ -104,7 +104,7 @@
android:id="@+id/rv_shop_item"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/appBack">
android:background="@color/gray_zhouyu">
</android.support.v7.widget.RecyclerView>
</android.support.v4.widget.SwipeRefreshLayout>
......
......@@ -13,6 +13,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white">
<include
android:id="@+id/ic_title"
layout="@layout/title"/>
......@@ -63,6 +64,7 @@
<RadioGroup
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/up_down_line_white"
android:checkedButton="@id/rb_get"
android:gravity="center"
android:orientation="horizontal">
......
......@@ -108,12 +108,7 @@
app:layout_constraintEnd_toEndOf="@id/tv_supplier_title"
app:layout_constraintTop_toTopOf="@id/tv_supplier_title" />
<View
android:layout_width="match_parent"
android:layout_height="@dimen/all_slight_line_width"
android:background="@color/gray_kongming"
android:visibility="@{isShowSupplier? View.VISIBLE: View.GONE}"
app:layout_constraintTop_toTopOf="@id/tv_supplier_title" />
<View
android:id="@+id/view_line_left_1"
......@@ -522,7 +517,6 @@
android:layout_width="match_parent"
android:layout_height="@dimen/view_line_L050"
android:layout_above="@id/ed_title"
android:layout_marginTop="@dimen/all_bounced_padding"
android:background="@color/gray_huanggai" />
<View
......
......@@ -11,63 +11,70 @@
</data>
<RelativeLayout
<LinearLayout
android:id="@+id/ll_top"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/gray_zhouyu">
android:layout_above="@+id/ll_bottom"
android:layout_below="@+id/ic_title"
android:background="@color/gray_zhouyu"
android:orientation="vertical">
<include
android:id="@+id/ic_title"
layout="@layout/title"/>
<LinearLayout
android:id="@+id/ll_top"
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@+id/ll_bottom"
android:layout_below="@+id/ic_title"
android:orientation="vertical">
android:layout_height="wrap_content"
android:layout_margin="@dimen/all_margin">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="300dp"
android:layout_margin="@dimen/all_margin"
android:background="@color/white"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:orientation="vertical">
<RelativeLayout
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1">
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:id="@+id/iv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:layout_marginTop="@dimen/all_margin"
android:src="@mipmap/ic_succeed"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/iv"
android:layout_marginTop="@dimen/all_padding"
android:layout_marginTop="@dimen/all_margin"
android:gravity="center"
android:text="发券成功"
android:textSize="@dimen/text_three_title"
android:textColor="@color/black_baozheng"
android:textSize="@dimen/all_sub_title_size"
android:textStyle="bold"/>
</RelativeLayout>
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="@dimen/all_line_width"
android:background="@color/light_gray"></View>
android:layout_marginBottom="@dimen/all_margin"
android:layout_marginEnd="@dimen/all_spacing"
android:layout_marginStart="@dimen/all_spacing"
android:layout_marginTop="@dimen/all_margin"
android:background="@color/gray_kongming"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="vertical">
......@@ -75,75 +82,90 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:padding="@dimen/all_padding">
android:paddingBottom="@dimen/all_spacing"
android:paddingEnd="@dimen/all_margin"
android:paddingStart="@dimen/all_margin">
<TextView
android:layout_width="@dimen/all_textview_width"
android:layout_height="wrap_content"
android:text="优惠券:"
android:textSize="@dimen/et_textsize"/>
android:text="优惠券"
android:textColor="@color/black_baozheng"
android:textSize="@dimen/all_body_size"/>
<TextView
android:id="@+id/tv_ticker_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="right"
android:textSize="@dimen/et_textsize"/>
android:textColor="@color/black_likui"
android:textSize="@dimen/all_body_size"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:padding="@dimen/all_padding">
android:paddingBottom="@dimen/all_spacing"
android:paddingEnd="@dimen/all_margin"
android:paddingStart="@dimen/all_margin">
<TextView
android:layout_width="@dimen/all_textview_width"
android:layout_height="wrap_content"
android:text="发送对象:"
android:textSize="@dimen/et_textsize"/>
android:text="发送对象"
android:textColor="@color/black_baozheng"
android:textSize="@dimen/all_body_size"/>
<TextView
android:id="@+id/tv_send_ticker_user"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="right"
android:textSize="@dimen/et_textsize"/>
android:textColor="@color/black_likui"
android:textSize="@dimen/all_body_size"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:padding="@dimen/all_padding">
android:paddingBottom="@dimen/all_spacing"
android:paddingEnd="@dimen/all_margin"
android:layout_marginBottom="@dimen/all_margin"
android:paddingStart="@dimen/all_margin">
<TextView
android:layout_width="@dimen/all_textview_width"
android:layout_height="wrap_content"
android:text="发送时间:"
android:textSize="@dimen/et_textsize"/>
android:text="发送时间"
android:textColor="@color/black_baozheng"
android:textSize="@dimen/all_body_size"/>
<TextView
android:id="@+id/tv_send_ticker_time"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="right"
android:textSize="@dimen/et_textsize"/>
android:textColor="@color/black_likui"
android:textSize="@dimen/all_body_size"/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</android.support.v7.widget.CardView>
<Button
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:background="@drawable/shape_red_r1"
android:foreground="?android:attr/selectableItemBackground"
android:onClick="@{OnClickListener}"
android:text="确 定"
android:textColor="@color/white_caocao"
android:textSize="@dimen/all_text_size"/>
</LinearLayout>
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/all_margin"
android:layout_marginRight="@dimen/all_margin"
android:background="@drawable/red_border"
android:onClick="@{OnClickListener}"
android:text="确 定"
android:textColor="@color/white"
android:textSize="@dimen/three_grid_unit"/>
</LinearLayout>
</RelativeLayout>
</layout>
\ No newline at end of file
......@@ -50,8 +50,7 @@
<LinearLayout
android:id="@+id/ll_vip_single"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="2"
android:layout_height="wrap_content"
android:onClick="@{OnClickListener}"
android:orientation="vertical">
......@@ -59,9 +58,9 @@
<android.support.constraint.ConstraintLayout
android:id="@+id/cl_vip"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="@dimen/all_padding"
android:background="@color/white_caocao"
android:layout_height="@dimen/list3_height"
android:layout_marginTop="@dimen/all_bounced_padding"
android:background="@drawable/up_down_line_white"
android:foreground="?android:attr/selectableItemBackground">
<com.facebook.drawee.view.SimpleDraweeView
......@@ -145,15 +144,18 @@
android:id="@+id/ll_all"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/all_bounced_padding"
android:background="@drawable/up_down_line_white"
android:orientation="vertical"
android:visibility="gone">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/all_margin"
android:layout_marginTop="@dimen/all_margin"
android:background="@drawable/up_down_line_white"
android:paddingBottom="@dimen/all_margin"
android:paddingLeft="@dimen/all_padding"
android:paddingTop="@dimen/all_margin"
android:text="请选择发放对象"
android:textColor="@color/black_baozheng"
android:textSize="@dimen/text_three_title"/>
......@@ -164,13 +166,17 @@
android:layout_height="wrap_content"
android:background="@color/white"/>
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="@dimen/all_line_width"
android:layout_gravity="bottom"
android:background="@color/gray_huanggai"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/all_margin"
android:layout_marginTop="@dimen/all_margin"
android:paddingBottom="@dimen/all_margin"
android:paddingLeft="@dimen/all_padding"
android:paddingTop="@dimen/all_margin"
android:text="请选择要发送的优惠券"
android:textColor="@color/black_baozheng"
android:textSize="@dimen/text_three_title"/>
......@@ -203,7 +209,7 @@
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:layout_alignParentBottom="true"
android:background="@color/white"
android:background="@drawable/up_down_line_white"
android:gravity="center"
android:orientation="horizontal"
android:padding="@dimen/all_padding">
......
......@@ -19,12 +19,13 @@
android:id="@+id/ic_title"
layout="@layout/title"/>
<LinearLayout
android:id="@+id/ll_one"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:layout_marginTop="@dimen/all_padding"
android:background="@color/white"
android:layout_height="@dimen/list3_height"
android:layout_marginTop="@dimen/all_bounced_padding"
android:background="@drawable/up_down_line_white"
android:gravity="center"
android:onClick="@{OnClickListener}"
android:orientation="horizontal"
......@@ -57,9 +58,9 @@
<LinearLayout
android:id="@+id/ll_all"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:layout_marginTop="@dimen/all_padding"
android:background="@color/white"
android:layout_height="@dimen/list3_height"
android:layout_marginTop="@dimen/all_bounced_padding"
android:background="@drawable/up_down_line_white"
android:gravity="center"
android:onClick="@{OnClickListener}"
android:orientation="horizontal"
......
......@@ -233,7 +233,6 @@
<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" />
......@@ -280,7 +279,6 @@
<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" />
......@@ -323,7 +321,6 @@
<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" />
......@@ -340,7 +337,6 @@
<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" />
......@@ -436,7 +432,6 @@
<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" />
......@@ -478,7 +473,6 @@
<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" />
......
......@@ -74,12 +74,13 @@
android:layout_width="0dp"
android:layout_height="?attr/actionBarSize"
android:background="@color/transparent"
android:enabled="false"
android:gravity="center_vertical"
android:inputType="number"
android:labelFor="@+id/et_barcode"
android:saveEnabled="false"
android:textColor="@color/black_baozheng"
android:textSize="@dimen/all_text_size"
android:textSize="@dimen/all_body_size"
app:layout_constraintHorizontal_weight="3"
app:layout_constraintLeft_toRightOf="@id/tv_barcode_hint"
app:layout_constraintRight_toRightOf="parent" />
......@@ -117,7 +118,7 @@
android:labelFor="@+id/et_name"
android:saveEnabled="false"
android:textColor="@color/black_baozheng"
android:textSize="@dimen/all_text_size"
android:textSize="@dimen/all_body_size"
app:layout_constraintLeft_toLeftOf="@id/et_barcode"
app:layout_constraintRight_toRightOf="@id/et_barcode"
app:layout_constraintTop_toBottomOf="@id/et_barcode" />
......@@ -187,7 +188,7 @@
android:gravity="center_vertical"
android:saveEnabled="false"
android:textColor="@color/black_baozheng"
android:textSize="@dimen/all_text_size"
android:textSize="@dimen/all_body_size"
app:layout_constraintHorizontal_weight="1.5"
app:layout_constraintLeft_toRightOf="@id/tv_type_hint"
app:layout_constraintRight_toLeftOf="@id/ns_type_2" />
......@@ -199,7 +200,7 @@
android:gravity="center_vertical"
android:saveEnabled="false"
android:textColor="@color/black_baozheng"
android:textSize="@dimen/all_text_size"
android:textSize="@dimen/all_body_size"
app:layout_constraintHorizontal_weight="1.5"
app:layout_constraintLeft_toRightOf="@id/ns_type_1"
app:layout_constraintRight_toRightOf="parent" />
......@@ -211,7 +212,7 @@
android:gravity="center_vertical"
android:saveEnabled="false"
android:textColor="@color/black_baozheng"
android:textSize="@dimen/all_text_size"
android:textSize="@dimen/all_body_size"
app:layout_constraintLeft_toLeftOf="@id/ns_type_1"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/ns_type_1" />
......@@ -247,7 +248,7 @@
android:gravity="center_vertical"
android:saveEnabled="false"
android:textColor="@color/black_baozheng"
android:textSize="@dimen/all_text_size" />
android:textSize="@dimen/all_body_size" />
<TextView
android:id="@+id/tv_unit"
......@@ -289,7 +290,7 @@
android:layout_weight="3"
android:saveEnabled="false"
android:textColor="@color/black_baozheng"
android:textSize="@dimen/all_text_size" />
android:textSize="@dimen/all_body_size" />
</LinearLayout>
<View
......@@ -339,7 +340,7 @@
android:labelFor="@+id/et_price1"
android:saveEnabled="false"
android:textColor="@color/black_baozheng"
android:textSize="@dimen/all_text_size" />
android:textSize="@dimen/all_body_size" />
</LinearLayout>
<View
......@@ -375,7 +376,7 @@
android:labelFor="@+id/et_price2"
android:saveEnabled="false"
android:textColor="@color/black_baozheng"
android:textSize="@dimen/all_text_size" />
android:textSize="@dimen/all_body_size" />
</LinearLayout>
<View
......@@ -491,7 +492,7 @@
android:labelFor="@+id/et_point"
android:saveEnabled="false"
android:textColor="@color/black_baozheng"
android:textSize="@dimen/all_text_size" />
android:textSize="@dimen/all_body_size" />
<TextView
android:layout_width="wrap_content"
......@@ -594,7 +595,7 @@
android:id="@+id/et_search"
style="@style/searchBarEditor"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_height="30dp"
android:layout_marginEnd="@dimen/all_margin"
android:layout_marginStart="@dimen/all_margin"
android:layout_marginTop="@dimen/all_spacing"
......@@ -748,7 +749,7 @@
android:layout_weight="3"
android:saveEnabled="false"
android:textColor="@color/black_baozheng"
android:textSize="@dimen/all_text_size" />
android:textSize="@dimen/all_body_size" />
</LinearLayout>
<View
......@@ -838,7 +839,7 @@
android:labelFor="@+id/et_cost"
android:saveEnabled="false"
android:textColor="@color/black_baozheng"
android:textSize="@dimen/all_text_size" />
android:textSize="@dimen/all_body_size" />
</LinearLayout>
<View
......@@ -874,7 +875,7 @@
android:labelFor="@+id/et_stock_low_limit"
android:saveEnabled="false"
android:textColor="@color/black_baozheng"
android:textSize="@dimen/all_text_size" />
android:textSize="@dimen/all_body_size" />
</LinearLayout>
<View
......@@ -910,7 +911,7 @@
android:labelFor="@+id/et_stock_upper_limit"
android:saveEnabled="false"
android:textColor="@color/black_baozheng"
android:textSize="@dimen/all_text_size" />
android:textSize="@dimen/all_body_size" />
</LinearLayout>
<View
......@@ -946,7 +947,7 @@
android:labelFor="@+id/et_min_oder"
android:saveEnabled="false"
android:textColor="@color/black_baozheng"
android:textSize="@dimen/all_text_size" />
android:textSize="@dimen/all_body_size" />
</LinearLayout>
<View
......
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android">
<data>
<variable
name="totalCount"
type="Integer" />
</data>
<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="?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_search"
style="@style/searchBarEditor"
android:layout_width="match_parent"
android:layout_height="30dp"
android:gravity="center_vertical"
android:text="@string/store_search_hint"
android:textColor="@color/gray_huanggai"
android:textSize="@dimen/all_text_size" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="@dimen/all_line_width"
android:layout_gravity="top"
android:background="@color/gray_kongming" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
......@@ -35,6 +68,7 @@
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/all_spacing"
android:layout_marginStart="@dimen/all_spacing"
android:text='@{totalCount+""}'
android:textColor="@color/black_baozheng"
android:textSize="@dimen/all_title_size" />
......@@ -69,7 +103,6 @@
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>
......
......@@ -52,10 +52,17 @@
android:background="@color/gray_huanggai"
android:visibility="@{visibility}" />
<android.support.v7.widget.RecyclerView
android:id="@+id/rl_skugrp"
<android.support.v4.widget.SwipeRefreshLayout
android:id="@+id/srl_skugrp"
android:layout_width="match_parent"
android:layout_height="match_parent" />
android:layout_height="match_parent">
<android.support.v7.widget.RecyclerView
android:id="@+id/rl_skugrp"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</android.support.v4.widget.SwipeRefreshLayout>
</LinearLayout>
</layout>
\ No newline at end of file
......@@ -18,6 +18,26 @@
android:background="@color/gray_zhouyu"
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_search"
style="@style/searchBarEditor"
android:layout_width="match_parent"
android:layout_height="30dp"
android:gravity="center_vertical"
android:text="@string/store_search_hint"
android:textColor="@color/gray_huanggai"
android:textSize="@dimen/all_text_size" />
</LinearLayout>
<FrameLayout
android:id="@+id/ll_ms"
android:layout_width="match_parent"
......@@ -26,6 +46,12 @@
android:orientation="vertical"
android:visibility="@{msCount>0 ?View.VISIBLE:View.GONE}">
<View
android:layout_width="match_parent"
android:layout_height="@dimen/all_line_width"
android:layout_gravity="top"
android:background="@color/gray_kongming" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
......@@ -68,13 +94,13 @@
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="@dimen/all_line_width"
android:layout_gravity="bottom"
android:background="@color/gray_huanggai" />
</FrameLayout>
<View
android:layout_width="match_parent"
android:layout_height="@dimen/all_line_width"
android:layout_gravity="bottom"
android:background="@color/gray_huanggai" />
<View
android:layout_width="match_parent"
......
......@@ -2,15 +2,15 @@
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<LinearLayout
<android.support.constraint.ConstraintLayout
android:id="@+id/cl_store"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/gray_zhouyu"
android:orientation="vertical">
android:background="@color/gray_zhouyu">
<android.support.v7.widget.RecyclerView
android:id="@+id/rl_sku"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
</android.support.constraint.ConstraintLayout>
</layout>
\ No newline at end of file
......@@ -11,9 +11,11 @@
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="150dp"
android:layout_height="130dp"
android:background="@color/white"
android:foreground="?android:attr/selectableItemBackground">
android:foreground="?android:attr/selectableItemBackground"
android:paddingBottom="@dimen/all_bounced_spacing"
android:paddingTop="@dimen/all_bounced_spacing">
<!--<com.xingdata.zzdhd.ui.manager.bale.view.NineGridImageView-->
<!--android:id="@+id/iv_pic"-->
......@@ -30,14 +32,16 @@
<com.xingdata.zzdpos.ui.manage.bale.view.TribeAvatar
android:id="@+id/iv_pic"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_margin="@dimen/all_margin"
android:layout_width="90dp"
android:layout_height="90dp"
android:layout_marginBottom="@dimen/all_bounced_spacing"
android:layout_marginLeft="@dimen/all_bounced_spacing"
android:layout_marginRight="@dimen/all_bounced_padding"
android:layout_marginTop="@dimen/all_bounced_spacing"
android:background="@drawable/shape_black"
android:padding="2dp"
card_view:layout_constraintHorizontal_weight="1"
card_view:layout_constraintLeft_toLeftOf="parent"
card_view:layout_constraintBottom_toBottomOf="parent"
card_view:layout_constraintRight_toLeftOf="@id/ll_shop_message"
card_view:layout_constraintTop_toTopOf="parent">
......@@ -49,8 +53,7 @@
android:layout_width="0dp"
android:layout_height="0dp"
android:orientation="vertical"
android:gravity="center"
android:padding="@dimen/all_padding"
android:padding="@dimen/all_bounced_spacing"
card_view:layout_constraintBottom_toBottomOf="parent"
card_view:layout_constraintHorizontal_weight="1.5"
card_view:layout_constraintLeft_toRightOf="@id/iv_pic"
......@@ -61,6 +64,7 @@
android:id="@+id/tv_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/all_bounced_spacing"
android:ellipsize="end"
android:gravity="left"
android:lines="1"
......@@ -73,27 +77,29 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/all_padding"
android:layout_marginTop="@dimen/all_bounced_spacing"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="条码:"
android:textColor="@color/black_likui"/>
android:textColor="@color/black_likui"
android:textSize="@dimen/all_text_size_low"/>
<TextView
android:id="@+id/tv_barNo"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="8531651233213"
android:textColor="@color/black_likui"/>
android:textColor="@color/black_likui"
android:textSize="@dimen/all_text_size_low"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:layout_marginTop="@dimen/all_bounced_spacing"
android:orientation="horizontal">
<TextView
......@@ -101,7 +107,8 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="原价:"
android:textColor="@color/black_likui"/>
android:textColor="@color/black_likui"
android:textSize="@dimen/all_text_size_low"/>
<RelativeLayout
android:layout_width="75dp"
......@@ -115,7 +122,8 @@
android:gravity="center"
android:singleLine="true"
android:text="@string/money"
android:textColor="@color/black_likui"/>
android:textColor="@color/black_likui"
android:textSize="@dimen/all_text_size_low"/>
<View
android:layout_width="match_parent"
......@@ -129,7 +137,7 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:layout_marginTop="@dimen/all_bounced_spacing"
android:orientation="horizontal">
<TextView
......
......@@ -11,14 +11,16 @@
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="150dp"
android:layout_marginBottom="@dimen/all_padding"
android:foreground="?android:attr/selectableItemBackground">
android:layout_height="130dp"
android:foreground="?android:attr/selectableItemBackground"
android:paddingBottom="@dimen/all_bounced_spacing"
android:paddingTop="@dimen/all_bounced_spacing">
<com.facebook.drawee.view.SimpleDraweeView
android:id="@+id/iv_pic"
android:layout_width="65dp"
android:layout_height="65dp"
android:layout_marginLeft="@dimen/all_padding"
app:placeholderImage="@mipmap/icon_goods_default"/>
<TextView
......@@ -106,7 +108,7 @@
android:id="@+id/btn_down"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginEnd="@dimen/all_padding"
android:layout_marginEnd="@dimen/all_bounced_spacing"
android:layout_weight="1"
android:background="@color/white"
android:onClick="@{onClick}"
......@@ -136,7 +138,7 @@
android:id="@+id/btn_up"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginStart="@dimen/all_padding"
android:layout_marginStart="@dimen/all_bounced_spacing"
android:layout_weight="1"
android:background="@color/white"
android:onClick="@{onClick}"
......@@ -189,7 +191,7 @@
android:id="@+id/btn_edit_ok"
android:layout_width="55dp"
android:layout_height="27dp"
android:layout_marginStart="@dimen/all_margin"
android:layout_marginStart="@dimen/all_bounced_spacing"
android:background="@drawable/shape_black_solid_blue"
android:onClick="@{onClick}"
android:text="确定"
......@@ -203,7 +205,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/all_margin"
android:text="价:"
android:text="价:"
android:textStyle="bold"
app:layout_constraintStart_toStartOf="@id/tv_no_hint"
app:layout_constraintTop_toBottomOf="@id/tv_no_hint"/>
......
......@@ -11,19 +11,19 @@
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="180dp"
android:background="@drawable/shape_black_solid_write"
android:layout_height="120dp"
android:layout_marginTop="@dimen/all_padding"
android:background="@drawable/up_down_line_white"
android:foreground="?android:attr/selectableItemBackground"
android:padding="@dimen/all_margin">
android:paddingBottom="@dimen/all_bounced_spacing"
android:paddingTop="@dimen/all_padding">
<com.facebook.drawee.view.SimpleDraweeView
android:id="@+id/iv_pic"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_margin="@dimen/all_margin"
android:padding="@dimen/all_padding"
android:layout_width="65dp"
android:layout_height="65dp"
android:layout_marginLeft="@dimen/all_padding"
android:src="@mipmap/icon_qrcode"
card_view:layout_constraintBottom_toBottomOf="parent"
card_view:layout_constraintHorizontal_weight="1"
card_view:layout_constraintLeft_toLeftOf="parent"
card_view:layout_constraintRight_toLeftOf="@id/ll_shop_message"
......@@ -35,7 +35,6 @@
android:layout_width="0dp"
android:layout_height="0dp"
android:orientation="vertical"
android:padding="@dimen/all_padding"
card_view:layout_constraintBottom_toBottomOf="parent"
card_view:layout_constraintHorizontal_weight="1.5"
card_view:layout_constraintLeft_toRightOf="@id/iv_pic"
......@@ -44,8 +43,10 @@
<TextView
android:id="@+id/tv_title"
style="@style/other_select_blacktext_style"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/all_bounced_padding"
android:ellipsize="end"
android:gravity="left"
android:lines="1"
......@@ -59,18 +60,32 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/all_padding"
android:gravity="center|left"
android:orientation="horizontal">
<TextView
style="@style/other_select_smallstyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="条码:"/>
android:layout_height="28dp"
android:text="条码:"
/>
<TextView
android:id="@+id/tv_No"
android:layout_width="match_parent"
style="@style/other_select_smallstyle"
android:layout_width="150dp"
android:layout_height="wrap_content"
android:text="8531651233213"/>
<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"
/>
</LinearLayout>
......@@ -81,10 +96,10 @@
android:orientation="horizontal">
<TextView
style="@style/other_select_smallstyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="售价:"
android:textSize="@dimen/et_textsize"
android:textStyle="bold"/>
<TextView
......@@ -93,7 +108,7 @@
android:layout_height="wrap_content"
android:text="¥ 120.00"
android:textColor="@color/red"
android:textSize="@dimen/et_textsize"
android:textSize="@dimen/big_text_size"
android:textStyle="bold"/>
</LinearLayout>
......
......@@ -5,7 +5,7 @@
android:id="@+id/cv_item"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/all_padding"
android:layout_marginTop="@dimen/all_bounced_padding"
android:background="@color/gray_zhouyu"
android:orientation="horizontal">
......@@ -33,15 +33,18 @@
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/all_padding"
android:layout_marginRight="@dimen/all_padding"
android:layout_marginTop="55dp">
android:layout_marginTop="45dp"
android:background="@drawable/radius_4dp_white"
android:elevation="10dp"
android:padding="@dimen/all_bounced_padding">
<LinearLayout
android:id="@+id/ll_vip"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/all_bounced_spacing"
android:background="@color/white"
android:orientation="horizontal"
android:padding="@dimen/all_padding">
android:orientation="horizontal">
<TextView
android:id="@+id/tv_vip_title"
......@@ -50,7 +53,7 @@
android:layout_weight="1"
android:text="适用会员"
android:textColor="@color/black_baozheng"
android:textSize="@dimen/et_textsize"/>
android:textSize="@dimen/all_text_size_low"/>
<TextView
android:id="@+id/tv_vip"
......@@ -60,7 +63,7 @@
android:gravity="right"
android:text="金牌会员"
android:textColor="@color/black_baozheng"
android:textSize="@dimen/et_textsize"/>
android:textSize="@dimen/all_text_size_low"/>
</LinearLayout>
<LinearLayout
......@@ -68,9 +71,9 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/ll_vip"
android:layout_marginTop="@dimen/all_bounced_spacing"
android:background="@color/white"
android:orientation="horizontal"
android:padding="@dimen/all_padding">
android:orientation="horizontal">
<TextView
android:id="@+id/tv_source_title"
......@@ -79,7 +82,7 @@
android:layout_weight="1"
android:text="来源品类"
android:textColor="@color/black_baozheng"
android:textSize="@dimen/et_textsize"
android:textSize="@dimen/all_text_size_low"
/>
<TextView
......@@ -91,7 +94,7 @@
android:singleLine="true"
android:text="金牌会员"
android:textColor="@color/black_baozheng"
android:textSize="@dimen/et_textsize"/>
android:textSize="@dimen/all_text_size_low"/>
</LinearLayout>
<LinearLayout
......@@ -99,9 +102,9 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/ll_source"
android:layout_marginTop="@dimen/all_bounced_spacing"
android:background="@color/white"
android:orientation="horizontal"
android:padding="@dimen/all_padding">
android:orientation="horizontal">
<TextView
android:id="@+id/tv_status_title"
......@@ -110,7 +113,7 @@
android:layout_weight="1"
android:text="启用状态"
android:textColor="@color/black_baozheng"
android:textSize="@dimen/et_textsize"/>
android:textSize="@dimen/all_text_size_low"/>
<TextView
android:id="@+id/tv_status"
......@@ -120,7 +123,7 @@
android:gravity="right"
android:text="启用状态"
android:textColor="@color/black_baozheng"
android:textSize="@dimen/et_textsize"/>
android:textSize="@dimen/all_text_size_low"/>
</LinearLayout>
</RelativeLayout>
......
......@@ -61,7 +61,7 @@
android:id="@+id/tv_unit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/singleline_white_gray"
android:background="@color/white_caocao"
android:paddingTop="@dimen/all_padding"
android:paddingEnd="@dimen/all_padding"
android:paddingBottom="@dimen/all_padding"
......@@ -76,7 +76,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="@dimen/all_padding"
android:background="@drawable/singleline_white_gray"
android:background="@color/white_caocao"
android:textColor="@color/black_baozheng"
android:textSize="@dimen/all_text_size_low"
android:textStyle="bold"
......@@ -87,7 +87,7 @@
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:background="@drawable/singleline_white_gray"
android:background="@color/white_caocao"
android:padding="@dimen/all_padding"
android:text="盘点件数:"
android:textColor="@color/black"
......@@ -100,7 +100,7 @@
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:background="@drawable/singleline_white_gray"
android:background="@color/white_caocao"
android:padding="@dimen/all_padding"
android:text="盘点结果:"
android:textColor="@color/black"
......@@ -114,7 +114,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/all_padding"
android:background="@drawable/singleline_white_gray"
android:background="@color/white_caocao"
android:padding="@dimen/all_padding"
android:paddingEnd="@dimen/all_margin"
android:text="不相符"
......
......@@ -6,7 +6,15 @@
<data>
</data>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<View
android:layout_width="match_parent"
android:layout_height="@dimen/all_bounced_padding"
android:background="@drawable/singleline_zhouyu_huanggai"
/>
<android.support.constraint.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
......@@ -206,6 +214,6 @@
app:layout_constraintTop_toTopOf="@id/linearLayout" />
</android.support.constraint.ConstraintLayout>
</LinearLayout>
</layout>
\ No newline at end of file
......@@ -2,57 +2,66 @@
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<android.support.constraint.ConstraintLayout
<LinearLayout
android:layout_width="match_parent"
android:layout_height="130dp"
android:background="@drawable/shape_orange_b1"
android:foreground="?android:attr/selectableItemBackground">
<ImageView
android:id="@+id/iv_type"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/all_spacing"
android:layout_marginTop="@dimen/all_spacing"
android:contentDescription="@null"
android:src="@mipmap/icon_buy01"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tv_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/black_baozheng"
android:textSize="@dimen/all_sub_title_size"
android:textStyle="bold"
app:layout_constraintBottom_toTopOf="@id/tv_date"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tv_date"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/all_margin"
android:layout_marginEnd="@dimen/all_margin"
android:layout_marginStart="@dimen/all_margin"
android:background="@drawable/shape_orange_r2"
android:drawableStart="@mipmap/icon_time"
android:gravity="center"
android:paddingBottom="@dimen/view_line_L2"
android:paddingEnd="@dimen/all_spacing"
android:paddingStart="@dimen/all_spacing"
android:paddingTop="@dimen/view_line_L2"
android:textColor="@color/white_caocao"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent" />
</android.support.constraint.ConstraintLayout>
android:layout_height="wrap_content"
android:background="@mipmap/bg_marketing"
android:foreground="?android:attr/selectableItemBackground"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:orientation="horizontal">
<TextView
android:id="@+id/tv_name"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/all_margin"
android:layout_marginTop="@dimen/all_margin_big"
android:layout_weight="1"
android:textColor="@color/black_baozheng"
android:textSize="@dimen/all_sub_title_size" />
<ImageView
android:id="@+id/iv_type"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/all_margin"
android:layout_marginTop="@dimen/all_margin_big"
android:contentDescription="@null"
android:src="@mipmap/icon_buy01" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:orientation="vertical">
<TextView
android:id="@+id/tv_info"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/all_margin"
android:layout_marginTop="@dimen/all_margin"
android:textColor="@color/black_baozheng"
android:textSize="@dimen/all_text_size" />
<TextView
android:id="@+id/tv_date"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/all_margin"
android:layout_marginTop="@dimen/all_spacing"
android:textColor="@color/black_baozheng"
android:textSize="@dimen/all_caption_size" />
</LinearLayout>
</LinearLayout>
</layout>
......@@ -205,6 +205,7 @@
android:layout_marginTop="@dimen/all_padding"
android:text="进价:"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="@id/tv_stock_hint"
app:layout_constraintTop_toBottomOf="@id/tv_stock_hint" />
......
......@@ -20,7 +20,7 @@
android:foreground="?android:attr/selectableItemBackground">
<View
android:layout_width="@dimen/all_spacing"
android:layout_width="@dimen/all_shape_radius"
android:layout_height="@dimen/all_sub_title_size"
android:layout_gravity="center_vertical"
android:background="@color/red_guanyu"
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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