提交 1fe1c23c authored 作者: lgd's avatar lgd

1.下单

2.//TODO erp用户激活测试,忘记/重置密码测试,坩埚下单页面,往来(客户两个库),产品下单还差附件,mes,消息,刷新token
上级 b1225e47
......@@ -792,6 +792,31 @@
android:screenOrientation="portrait"
android:theme="@style/Work.Base"
android:windowSoftInputMode="adjustPan" />
<activity
android:name=".ui.activity.bat.store.StoreTradingProductActivity"
android:configChanges="keyboardHidden|orientation"
android:label="选择产品"
android:launchMode="singleTop"
android:screenOrientation="portrait"
android:theme="@style/Work.Base"
android:windowSoftInputMode="adjustPan" />
<activity
android:name=".ui.activity.bat.store.StoreTradingCarActivity"
android:configChanges="keyboardHidden|orientation"
android:label="购物车"
android:launchMode="singleTop"
android:screenOrientation="portrait"
android:theme="@style/Work.Base"
android:windowSoftInputMode="adjustPan" />
<activity
android:name=".ui.activity.bat.store.StoreTradingConfirmActivity"
android:configChanges="keyboardHidden|orientation"
android:label="购物车"
android:launchMode="singleTop"
android:screenOrientation="portrait"
android:theme="@style/Work.Base"
android:windowSoftInputMode="adjustPan" />
<provider
android:name="androidx.core.content.FileProvider"
android:authorities="com.wd.workoffice.fileprovider"
......
......@@ -171,6 +171,15 @@ public class ProductBean {
private int factoryId;
private String factoryName;
private String url;
private String chooseNum;
public String getChooseNum() {
return chooseNum;
}
public void setChooseNum(String chooseNum) {
this.chooseNum = chooseNum;
}
public String getUrl() {
return url;
......
......@@ -1042,4 +1042,22 @@ public interface ApiService {
@Multipart
@POST("/open/uploadImgs")
Observable<JSONObject> upload(@Part MultipartBody.Part avatar);
/**
* 取产品源(获取退货仓库产品数量)
*
* @return
*/
@GET("/stockQuantity/return-stock/page/list")
Observable<BaseBean> tradingPro(@QueryMap Map<String,Object> param);
/**
* 获取产品去向(搜索置换产品)
*
* @return
*/
@GET("/product/search-list")
Observable<BaseBean> tradingProDialog(@Query("soleCode") String soleCode);
}
......@@ -90,11 +90,11 @@ public class StoreOutsourcingActivity extends WorkToolBarActivity implements Bat
}
@OnClick({R.id.rl_client, R.id.rl_dep, R.id.rl_process, R.id.rl_product,R.id.rl_supplier})
@OnClick({R.id.rl_client, R.id.rl_dep, R.id.rl_process, R.id.rl_product, R.id.rl_supplier})
public void onViewClicked(View view) {
switch (view.getId()) {
case R.id.rl_client:
startActivityForResult(StoreSaleClientActivity.class, 10001,"code","CUSTOMER");
startActivityForResult(StoreSaleClientActivity.class, 10001, "code", "CUSTOMER");
break;
case R.id.rl_dep:
depDialog.show();
......@@ -109,7 +109,7 @@ public class StoreOutsourcingActivity extends WorkToolBarActivity implements Bat
return;
}
startActivityForResult(StoreSaleClientActivity.class, 10002,
"depId",chooseDep.getId()+"","flag","1","code","SUPPLIER","supplier","选择供应商");
"depId", chooseDep.getId() + "", "flag", "1", "code", "SUPPLIER", "supplier", "选择供应商");
break;
case R.id.rl_process:
if (clientId == null) {
......@@ -143,6 +143,7 @@ public class StoreOutsourcingActivity extends WorkToolBarActivity implements Bat
"transitPartId", supplierId.toString(),
"supplierId", supplierId.toString(),
"supplierName", tvSupplier.getText().toString(),
"subProcessId", chooseProcess.getId() + "",
"code", PermissionType.PROCESS_PURCHASE.getCode());
break;
}
......@@ -196,7 +197,7 @@ public class StoreOutsourcingActivity extends WorkToolBarActivity implements Bat
clientId = data.getIntExtra("id", 0);
tvClient.setText(clientName);
batSalePresenter.getProcess(PermissionType.PROCESS_SALE.getCode(), clientId);
}else if (requestCode == 10002 && resultCode == 10002){
} else if (requestCode == 10002 && resultCode == 10002) {
String clientName = data.getStringExtra("clientName");
supplierId = data.getIntExtra("id", 0);
tvSupplier.setText(clientName);
......
......@@ -105,6 +105,7 @@ public class StoreSaleCarActivity extends WorkToolBarActivity {
startActivity(StoreSaleConfirmActivity.class, "pro", JSON.toJSONString(productList),
"subProcess", getIntent().getStringExtra("subProcess"),
"supplierId",getIntent().getStringExtra("supplierId"),
"subProcessId", getIntent().getStringExtra("subProcessId"),
"inStockId",getIntent().getStringExtra("inStockId"),
"customerId", getIntent().getStringExtra("customerId"),
"receiveDeptId", getIntent().getStringExtra("receiveDeptId"),
......
......@@ -64,7 +64,7 @@ import okhttp3.MultipartBody;
import okhttp3.RequestBody;
/**
* 商店-销售-产品-确认订单
* 商店-销售/供应/外采购-产品-确认订单
* author : flexible
* email : lgd19940421@163.com
* github: https://github.com/FlexibleXd
......@@ -149,16 +149,16 @@ public class StoreSaleConfirmActivity extends WorkToolBarActivity {
proAdapter.notifyDataSetChanged();
changeNumAndPrice();
param = new HashMap<>();
if (TextUtils.isEmpty(getIntent().getStringExtra("supplierId"))) {
if (!TextUtils.isEmpty(getIntent().getStringExtra("supplierId"))) {
param.put("supplierId", getIntent().getStringExtra("supplierId"));
}
if (TextUtils.isEmpty(getIntent().getStringExtra("subProcess"))) {
param.put("subProcessId", getIntent().getStringExtra("subProcess"));
if (!TextUtils.isEmpty(getIntent().getStringExtra("subProcessId"))) {
param.put("subProcessId", getIntent().getStringExtra("subProcessId"));
}
if (TextUtils.isEmpty(getIntent().getStringExtra("customerId"))) {
if (!TextUtils.isEmpty(getIntent().getStringExtra("customerId"))) {
param.put("customerId", getIntent().getStringExtra("customerId"));
}
if (TextUtils.isEmpty(getIntent().getStringExtra("inStockId"))) {
if (!TextUtils.isEmpty(getIntent().getStringExtra("inStockId"))) {
param.put("inStockId", getIntent().getStringExtra("inStockId"));
}
param.put("receiveDeptId", getIntent().getStringExtra("receiveDeptId"));
......@@ -335,7 +335,7 @@ public class StoreSaleConfirmActivity extends WorkToolBarActivity {
tvNum.setText("共 ".concat(proList.size() + "").concat(" 件"));
String allPrice = "";
for (ProductBean.RecordsBean recordsBean : proList) {
allPrice = MathUtils.add(allPrice, MathUtils.multiply(recordsBean.getCarNum() + "", recordsBean.getInternalPrice()+"", 2), 2);
allPrice = MathUtils.add(allPrice, MathUtils.multiply(recordsBean.getCarNum() + "", recordsBean.getInternalPrice() + "", 2), 2);
}
tvPrice.setText("总计: ¥ ".concat(allPrice));
}
......@@ -350,10 +350,10 @@ public class StoreSaleConfirmActivity extends WorkToolBarActivity {
proList.get(position).setFactoryId(clientId);
proList.get(position).setFactoryName(name);
proAdapter.notifyItemChanged(position);
} else if (requestCode==10002 && resultCode == RESULT_OK){
} else if (requestCode == 10002 && resultCode == RESULT_OK) {
if (Matisse.obtainResult(data).size() != 0) {
showLoading();
File file = WorkUtils.uriToFile(Matisse.obtainResult(data).get(0),this);
File file = WorkUtils.uriToFile(Matisse.obtainResult(data).get(0), this);
RequestBody requestFile = RequestBody.create(MediaType.parse("multipart/form-data"), file);
RtfHelper.getInstance().getApiService(ApiService.class).
upload(MultipartBody.Part.createFormData("newUploadImgs", file.getName(), requestFile)).
......
......@@ -295,6 +295,8 @@ public class StoreSaleProductActivity extends WorkToolBarActivity {
"pro", JSON.toJSONString(carList),
"supplierId", getIntent().getStringExtra("supplierId"),
"subProcess", getIntent().getStringExtra("subProcess"),
"subProcessId", getIntent().getStringExtra("subProcessId"),
"inStockId", getIntent().getStringExtra("inStockId"),
"customerId", getIntent().getStringExtra("customerId"),
"receiveDeptId", getIntent().getStringExtra("depId"),
......
......@@ -103,7 +103,8 @@ public class StoreTradingActivity extends WorkToolBarActivity implements BatSale
toast("请选择入库仓库");
return;
}
startActivity(StoreSaleProductActivity.class, "depId", chooseDep.getId() + "",
startActivity(StoreTradingProductActivity.class,
"depId", chooseDep.getId() + "", "inStockId", chooseStock.getId() + "",
"depName", chooseDep.getName(), "code", PermissionType.PROCESS_INSIDE.getCode());
break;
}
......
package com.wd.workoffice.ui.activity.bat.store;
import android.os.Bundle;
import android.view.View;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.alibaba.fastjson.JSON;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.qmuiteam.qmui.widget.dialog.QMUIDialog;
import com.qmuiteam.qmui.widget.dialog.QMUIDialogAction;
import com.wd.workoffice.R;
import com.wd.workoffice.app.WorkToolBarActivity;
import com.wd.workoffice.bean.ProductBean;
import com.wd.workoffice.bean.TradingBean;
import com.wd.workoffice.bean.event.ModifyCarEvent;
import com.wd.workoffice.ui.adapter.TradingProCarAdapter;
import com.wd.workoffice.util.DialogUtils;
import com.wd.workoffice.util.MathUtils;
import com.wd.workoffice.widget.AddAndReduceDoubleView;
import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
/**
* 商店-销售-购物车
* author : flexible
* email : lgd19940421@163.com
* github: https://github.com/FlexibleXd
**/
public class StoreTradingCarActivity extends WorkToolBarActivity {
@BindView(R.id.tv_num)
TextView tvNum;
@BindView(R.id.tv_price)
TextView tvPrice;
@BindView(R.id.tv_ok)
TextView tvOk;
@BindView(R.id.ll_bottom)
RelativeLayout llBottom;
@BindView(R.id.tv_name)
TextView tvName;
@BindView(R.id.tv_card)
TextView tvCard;
@BindView(R.id.tv_card_name)
TextView tvCardName;
@BindView(R.id.tv_dept)
TextView tvDept;
@BindView(R.id.tv_apply_num)
TextView tvApplyNum;
@BindView(R.id.ar_use_num)
AddAndReduceDoubleView arUseNum;
@BindView(R.id.rv_product)
RecyclerView rvProduct;
private List<ProductBean.RecordsBean> productList;
private TradingProCarAdapter productAdapter;
@Override
protected void initView() {
ButterKnife.bind(this);
rvProduct.setLayoutManager(new LinearLayoutManager(this, RecyclerView.VERTICAL, false));
}
@Override
protected void initData() {
Map data = JSON.parseObject(getIntent().getStringExtra("pro"), Map.class);
TradingBean.RecordsBean pro = JSON.parseObject(data.get("pro").toString(), TradingBean.RecordsBean.class);
tvName.setText(pro.getProductName());
tvCard.setText(pro.getProductSimpleCode());
tvCardName.setText(pro.getProductSoleCode());
tvApplyNum.setText(String.valueOf(pro.getQuantity()));
tvDept.setText(pro.getDeptName());
arUseNum.setMaxNum(pro.getQuantity());
arUseNum.setNumber(Double.valueOf(pro.getChooseNum()));
productList = new ArrayList<>();
productAdapter = new TradingProCarAdapter(R.layout.item_trading_product_car, productList);
productAdapter.bindToRecyclerView(rvProduct);
productList.addAll(JSON.parseArray(data.get("proDetail").toString(), ProductBean.RecordsBean.class));
productAdapter.notifyDataSetChanged();
changeNumAndPrice();
}
@Override
protected void initEvent() {
// productAdapter.setOnItemChildClickListener(new BaseQuickAdapter.OnItemChildClickListener() {
// @Override
// public void onItemChildClick(BaseQuickAdapter adapter, View view, int position) {
// QMUIDialog.MessageDialogBuilder dialog = DialogUtils.okAndCancelDialog(StoreTradingCarActivity.this);
// dialog.setMessage("是否删除").addAction("取消", new QMUIDialogAction.ActionListener() {
// @Override
// public void onClick(QMUIDialog dialog, int index) {
// dialog.dismiss();
// }
// }).addAction("确定", new QMUIDialogAction.ActionListener() {
// @Override
// public void onClick(QMUIDialog dialog, int index) {
// dialog.dismiss();
// productList.remove(position);
// productAdapter.notifyDataSetChanged();
// EventBus.getDefault().post(new ModifyCarEvent(JSON.toJSONString(productList)));
// }
// }).show();
// }
// });
}
@Override
protected int layoutId() {
return R.layout.activity_treading_shopcar;
}
@OnClick(R.id.tv_ok)
public void onViewClicked() {
String allPrice = "";
for (ProductBean.RecordsBean recordsBean : productList) {
allPrice = MathUtils.add(allPrice, MathUtils.multiply(recordsBean.getCarNum() + "", recordsBean.getInternalPrice() + "", 2), 2);
}
startActivity(StoreTradingConfirmActivity.class, "pro", getIntent().getStringExtra("pro"),
"subProcess", getIntent().getStringExtra("subProcess"),
"supplierId", getIntent().getStringExtra("supplierId"),
"inStockId", getIntent().getStringExtra("inStockId"),
"customerId", getIntent().getStringExtra("customerId"),
"receiveDeptId", getIntent().getStringExtra("receiveDeptId"),
"code", getIntent().getStringExtra("code"),
"launchOrderAmount", allPrice);
}
@Override
public void onStart() {
super.onStart();
EventBus.getDefault().register(this);
}
@Override
public void onStop() {
super.onStop();
EventBus.getDefault().unregister(this);
}
@Subscribe(threadMode = ThreadMode.MAIN)
public void onMessageEvent(ModifyCarEvent event) {
changeNumAndPrice();
}
private void changeNumAndPrice() {
tvNum.setText("共 ".concat(productList.size() + "").concat(" 件"));
String allPrice = "";
for (ProductBean.RecordsBean recordsBean : productList) {
allPrice = MathUtils.add(allPrice, MathUtils.multiply(recordsBean.getCarNum() + "", recordsBean.getInternalPrice() + "", 2), 2);
}
tvPrice.setText("总计: ¥ ".concat(allPrice));
}
}
......@@ -46,7 +46,7 @@ public class StoreCarAdapter extends BaseQuickAdapter<ProductBean.RecordsBean, B
helper.setText(R.id.tv_spec, item.getSpec());
helper.setText(R.id.tv_price, "¥".concat(String.valueOf(item.getInternalPrice())));
helper.setText(R.id.tv_unit, String.valueOf(item.getWeight()).concat("吨"));
helper.setText(R.id.tv_all_price, MathUtils.multiply(item.getCarNum() + "", item.getCarPrice(), 2));
helper.setText(R.id.tv_all_price, MathUtils.multiply(item.getCarNum() + "", item.getInternalPrice()+"", 2));
if (type == 1) {
helper.addOnClickListener(R.id.rl_choose_dep);
helper.addOnClickListener(R.id.rl_upload);
......
package com.wd.workoffice.ui.adapter;
import android.text.Editable;
import android.text.TextUtils;
import android.text.TextWatcher;
import android.widget.EditText;
import com.alibaba.fastjson.JSON;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.wd.workoffice.R;
import com.wd.workoffice.bean.ProductBean;
import com.wd.workoffice.bean.event.ModifyCarEvent;
import com.wd.workoffice.util.MathUtils;
import com.wd.workoffice.widget.AddAndReduceView;
import org.greenrobot.eventbus.EventBus;
import java.util.List;
import flexible.xd.android_base.utils.ToastUtil;
/**
* Created by flexible on 2018/8/13.
*/
public class TradingConfimProAdapter extends BaseQuickAdapter<ProductBean.RecordsBean, BaseViewHolder> {
public TradingConfimProAdapter(int layoutResId, List data) {
super(layoutResId, data);
}
@Override
protected void convert(BaseViewHolder helper, ProductBean.RecordsBean item) {
helper.setText(R.id.tv_name, item.getName());
helper.setText(R.id.tv_num, String.valueOf(item.getCarNum()));
helper.setText(R.id.tv_all_price, MathUtils.multiply(item.getCarNum() + "", item.getInternalPrice() + "", 2));
helper.addOnClickListener(R.id.rl_upload);
}
}
package com.wd.workoffice.ui.adapter;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import com.alibaba.fastjson.JSON;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.wd.workoffice.R;
import com.wd.workoffice.bean.ProductBean;
import com.wd.workoffice.bean.event.ModifyCarEvent;
import com.wd.workoffice.util.MathUtils;
import com.wd.workoffice.widget.AddAndReduceView;
import org.greenrobot.eventbus.EventBus;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* Created by flexible on 2018/8/13.
*/
public class TradingProCarAdapter extends BaseQuickAdapter<ProductBean.RecordsBean, BaseViewHolder> {
public TradingProCarAdapter(int layoutResId, List data) {
super(layoutResId, data);
}
@Override
protected void convert(BaseViewHolder helper, ProductBean.RecordsBean item) {
helper.setText(R.id.tv_name, item.getName());
helper.setText(R.id.tv_card, item.getSoleCode());
helper.setText(R.id.tv_card_name, item.getSoleCode());
helper.setText(R.id.tv_spec, item.getSpec());
helper.setText(R.id.tv_price, String.valueOf(item.getInternalPrice()));
helper.setText(R.id.tv_all_price, "小计:"+MathUtils.multiply(item.getCarNum() + "", item.getInternalPrice() + "", 2));
AddAndReduceView num = helper.getView(R.id.ar_num);
num.setNumber(item.getCarNum());
num.setOnNumberChangedListener(new AddAndReduceView.OnNumberChangedListener() {
@Override
public void OnNumberChanged(int vs) {
item.setCarNum(vs);
helper.setText(R.id.tv_all_price, "小计:"+MathUtils.multiply(vs + "", item.getInternalPrice() + "", 2));
EventBus.getDefault().post(new ModifyCarEvent(JSON.toJSONString(getData())));
}
});
}
}
package com.wd.workoffice.ui.adapter;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.wd.workoffice.R;
import com.wd.workoffice.bean.LogisticDetailBean;
import com.wd.workoffice.bean.ProductBean;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* Created by flexible on 2018/8/13.
*/
public class TradingProDetailAdapter extends BaseQuickAdapter<ProductBean.RecordsBean, BaseViewHolder> {
Map<Integer, Boolean> isChoose = new HashMap<>();
public TradingProDetailAdapter(int layoutResId, List data) {
super(layoutResId, data);
for (int i = 0; i < isChoose.entrySet().size(); i++) {
isChoose.put(i, false);
}
}
@Override
protected void convert(BaseViewHolder helper, ProductBean.RecordsBean item) {
helper.setText(R.id.tv_name,item.getName() );
helper.setText(R.id.tv_card, item.getSoleCode() );
helper.setText(R.id.tv_card_name, item.getSoleCode());
helper.setText(R.id.tv_spec,item.getSpec());
helper.setText(R.id.tv_price,String.valueOf(item.getInternalPrice()));
CheckBox cbChoose = helper.getView(R.id.cb_check);
cbChoose.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
isChoose.put(helper.getAdapterPosition(), cbChoose.isChecked());
}
});
}
public Map<Integer, Boolean> getIsChoose() {
return isChoose;
}
public void setIsChoose(Map<Integer, Boolean> isChoose) {
this.isChoose = isChoose;
}
}
package com.wd.workoffice.ui.adapter;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.wd.workoffice.R;
import com.wd.workoffice.bean.ProductBean;
import com.wd.workoffice.bean.TradingBean;
import java.util.List;
/**
* Created by flexible on 2018/8/13.
*/
public class TradingProductAdapter extends BaseQuickAdapter<TradingBean.RecordsBean, BaseViewHolder> {
public TradingProductAdapter(int layoutResId, List data) {
super(layoutResId, data);
}
@Override
protected void convert(BaseViewHolder helper, TradingBean.RecordsBean item) {
helper.setText(R.id.tv_name,item.getProductName() );
helper.setText(R.id.tv_card, item.getProductSimpleCode() );
helper.setText(R.id.tv_card_name, item.getProductSoleCode());
helper.setText(R.id.tv_num, String.valueOf(item.getQuantity()));
helper.setText(R.id.tv_dept, item.getDeptName());
helper.addOnClickListener(R.id.tv_cart);
}
}
......@@ -11,8 +11,6 @@ import com.qmuiteam.qmui.widget.dialog.QMUIDialog;
**/
public class DialogUtils {
public static QMUIDialog.MenuDialogBuilder listDialog(Context context) {
QMUIDialog.MenuDialogBuilder dialog = new QMUIDialog.MenuDialogBuilder(context);
return dialog;
......
package com.wd.workoffice.widget;
import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;
import com.wd.workoffice.R;
import flexible.xd.android_base.utils.ToastUtil;
public class AddAndReduceDoubleView extends LinearLayout implements View.OnClickListener {
private final Button add;
private final Button remove;
private final TextView tvNum;
private double num = 0;
private double maxNum = 10000;
public AddAndReduceDoubleView(Context context, AttributeSet attrs) {
super(context, attrs);
LayoutInflater.from(context).inflate(R.layout.view_add_remove, this);
add = findViewById(R.id.btn_add);
remove = findViewById(R.id.btn_reduce);
tvNum = findViewById(R.id.tv_num);
tvNum.setText("0");
add.setOnClickListener(this);
remove.setOnClickListener(this);
}
public void setNumber(double number) {
num = number;
tvNum.setText(number + "");
}
public double getNumber() {
return num;
}
@Override
public void onClick(View v) {
String s = tvNum.getText().toString();
num = Double.parseDouble(s);
switch (v.getId()) {
case R.id.btn_add:
if (maxNum - num < 1) {
num = maxNum;
tvNum.setText(num + "");
if (mOnNumberChangedListener != null)
mOnNumberChangedListener.OnNumberChanged(String.valueOf(num));
ToastUtil.showShort("目前已选择最大数量");
return;
}
num++;
tvNum.setText(num + "");
if (mOnNumberChangedListener != null)
mOnNumberChangedListener.OnNumberChanged(String.valueOf(num));
break;
case R.id.btn_reduce:
if (num < 1) {
Toast.makeText(getContext(), "不能小于0", Toast.LENGTH_SHORT).show();
} else {
num--;
tvNum.setText(num + "");
if (mOnNumberChangedListener != null)
mOnNumberChangedListener.OnNumberChanged(String.valueOf(num));
}
break;
}
}
public double getMaxNum() {
return maxNum;
}
public void setMaxNum(double maxNum) {
this.maxNum = maxNum;
}
public interface OnNumberChangedListener {
void OnNumberChanged(String vs);
}
private OnNumberChangedListener mOnNumberChangedListener;
public void setOnNumberChangedListener(OnNumberChangedListener onNumberChangedListener) {
mOnNumberChangedListener = onNumberChangedListener;
}
}
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout
android:id="@+id/ll_bottom"
android:layout_width="match_parent"
android:layout_height="60mm"
android:layout_alignParentBottom="true"
android:orientation="horizontal">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_alignParentLeft="true"
android:layout_marginLeft="15mm"
android:gravity="center_vertical"
android:orientation="vertical">
<TextView
android:id="@+id/tv_num"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="共 0 件"
android:textSize="13sp" />
<TextView
android:id="@+id/tv_price"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10mm"
android:text="总计: ¥ "
android:textSize="16sp" />
</LinearLayout>
<TextView
android:id="@+id/tv_ok"
android:layout_width="80mm"
android:layout_height="match_parent"
android:layout_alignParentRight="true"
android:background="@color/red_btn_bg"
android:gravity="center"
android:text="申请下单"
android:textColor="@color/white" />
</RelativeLayout>
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@id/ll_bottom">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:orientation="vertical"
android:paddingHorizontal="20mm"
android:paddingVertical="10mm">
<TextView
android:id="@+id/tv_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="图号TH82739857"
android:textColor="@color/black"
android:textSize="16sp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="14mm"
android:background="#FCFCFD"
android:orientation="vertical"
android:padding="10mm">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:text="品号"
android:textColor="@color/flexible_text_gray"
android:textSize="12sp" />
<TextView
android:id="@+id/tv_card"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:text="品号"
android:textColor="@color/flexible_text_gray"
android:textSize="12sp" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10mm">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:text="图号"
android:textColor="@color/flexible_text_gray"
android:textSize="12sp" />
<TextView
android:id="@+id/tv_card_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:text="品号"
android:textColor="@color/flexible_text_gray"
android:textSize="12sp" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10mm">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:text="来源仓库"
android:textColor="@color/flexible_text_gray"
android:textSize="12sp" />
<TextView
android:id="@+id/tv_dept"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:text="品号"
android:textColor="@color/flexible_text_gray"
android:textSize="12sp" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10mm">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:text="可申请数量"
android:textColor="@color/flexible_text_gray"
android:textSize="12sp" />
<TextView
android:id="@+id/tv_apply_num"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:text="品号"
android:textColor="@color/flexible_text_gray"
android:textSize="12sp" />
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10mm"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="使用数量"
android:textColor="@color/flexible_text_sup"
android:textSize="16sp" />
<com.wd.workoffice.widget.AddAndReduceDoubleView
android:id="@+id/ar_use_num"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10mm" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_product"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
</androidx.core.widget.NestedScrollView>
</RelativeLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:orientation="vertical"
android:paddingHorizontal="20mm"
android:paddingVertical="10mm">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10mm"
android:background="#9FE5F0FD"
android:orientation="vertical"
android:padding="10mm">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:text="品号"
android:textColor="@color/flexible_text_gray"
android:textSize="12sp" />
<TextView
android:id="@+id/tv_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:textColor="@color/flexible_text_gray"
android:textSize="12sp" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10mm">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:text="置换数量"
android:textColor="@color/flexible_text_gray"
android:textSize="12sp" />
<TextView
android:id="@+id/tv_num"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:textColor="@color/flexible_text_gray"
android:textSize="12sp" />
</RelativeLayout>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:layout_marginTop="20mm">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="小计: ¥ "
android:textSize="12sp" />
<TextView
android:id="@+id/tv_all_price"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="14sp"
android:textStyle="bold" />
</LinearLayout>
<RelativeLayout
android:id="@+id/rl_upload"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingVertical="9mm">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:text="上传附件(选填)"
android:textColor="@color/flexible_text_gray"
android:textSize="14sp" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:gravity="center_vertical">
<TextView
android:id="@+id/tv_upload"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_marginRight="3mm"
android:text="点击上传"
android:textColor="@color/flexible_text_gray"
android:textSize="14sp" />
<ImageView
android:layout_width="15mm"
android:layout_height="20mm"
android:src="@mipmap/arrow_right_gray" />
</LinearLayout>
</RelativeLayout>
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:orientation="vertical"
android:paddingHorizontal="20mm"
android:paddingVertical="10mm">
<TextView
android:id="@+id/tv_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="图号TH82739857"
android:textColor="@color/black"
android:textSize="16sp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="14mm"
android:background="#FCFCFD"
android:orientation="vertical"
android:padding="10mm">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:text="品号"
android:textColor="@color/flexible_text_gray"
android:textSize="12sp" />
<TextView
android:id="@+id/tv_card"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:text="品号"
android:textColor="@color/flexible_text_gray"
android:textSize="12sp" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10mm">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:text="图号"
android:textColor="@color/flexible_text_gray"
android:textSize="12sp" />
<TextView
android:id="@+id/tv_card_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:text="品号"
android:textColor="@color/flexible_text_gray"
android:textSize="12sp" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10mm">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:text="来源仓库"
android:textColor="@color/flexible_text_gray"
android:textSize="12sp" />
<TextView
android:id="@+id/tv_dept"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:text="品号"
android:textColor="@color/flexible_text_gray"
android:textSize="12sp" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10mm">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:text="可申请数量"
android:textColor="@color/flexible_text_gray"
android:textSize="12sp" />
<TextView
android:id="@+id/tv_num"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:text="品号"
android:textColor="@color/flexible_text_gray"
android:textSize="12sp" />
</RelativeLayout>
</LinearLayout>
<TextView
android:id="@+id/tv_cart"
android:layout_width="90mm"
android:layout_height="26mm"
android:layout_gravity="right"
android:layout_marginTop="10mm"
android:background="@mipmap/product_add_cart" />
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:orientation="vertical"
android:paddingHorizontal="20mm"
android:paddingVertical="10mm">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:orientation="vertical"
android:paddingHorizontal="20mm"
android:paddingVertical="10mm">
<TextView
android:id="@+id/tv_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="图号TH82739857"
android:textColor="@color/black"
android:textSize="16sp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="14mm"
android:background="#FCFCFD"
android:orientation="vertical"
android:padding="10mm">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:text="品号"
android:textColor="@color/flexible_text_gray"
android:textSize="12sp" />
<TextView
android:id="@+id/tv_card"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:text="品号"
android:textColor="@color/flexible_text_gray"
android:textSize="12sp" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10mm">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:text="图号"
android:textColor="@color/flexible_text_gray"
android:textSize="12sp" />
<TextView
android:id="@+id/tv_card_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:text="品号"
android:textColor="@color/flexible_text_gray"
android:textSize="12sp" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10mm">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:text="规格"
android:textColor="@color/flexible_text_gray"
android:textSize="12sp" />
<TextView
android:id="@+id/tv_spec"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:text="品号"
android:textColor="@color/flexible_text_gray"
android:textSize="12sp" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10mm">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:text="内部价格"
android:textColor="@color/flexible_text_gray"
android:textSize="12sp" />
<TextView
android:id="@+id/tv_price"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:text="品号"
android:textColor="@color/flexible_text_gray"
android:textSize="12sp" />
</RelativeLayout>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10mm"
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingHorizontal="20mm">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="置换数量"
android:textColor="@color/flexible_text_sup"
android:textSize="16sp" />
<com.wd.workoffice.widget.AddAndReduceView
android:id="@+id/ar_num"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10mm" />
</LinearLayout>
<TextView
android:id="@+id/tv_all_price"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:layout_marginTop="5mm"
android:gravity="center"
android:textColor="@color/flexible_text_sup"
android:textSize="13sp" />
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:orientation="horizontal"
android:paddingHorizontal="20mm"
android:paddingVertical="10mm">
<CheckBox
android:id="@+id/cb_check"
android:layout_width="wrap_content"
android:layout_height="match_parent" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:orientation="vertical"
android:paddingHorizontal="20mm"
android:paddingVertical="10mm">
<TextView
android:id="@+id/tv_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="图号TH82739857"
android:textColor="@color/black"
android:textSize="16sp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="14mm"
android:background="#FCFCFD"
android:orientation="vertical"
android:padding="10mm">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:text="品号"
android:textColor="@color/flexible_text_gray"
android:textSize="12sp" />
<TextView
android:id="@+id/tv_card"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:text="品号"
android:textColor="@color/flexible_text_gray"
android:textSize="12sp" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10mm">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:text="图号"
android:textColor="@color/flexible_text_gray"
android:textSize="12sp" />
<TextView
android:id="@+id/tv_card_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:text="品号"
android:textColor="@color/flexible_text_gray"
android:textSize="12sp" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10mm">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:text="规格"
android:textColor="@color/flexible_text_gray"
android:textSize="12sp" />
<TextView
android:id="@+id/tv_spec"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:text="品号"
android:textColor="@color/flexible_text_gray"
android:textSize="12sp" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10mm">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:text="内部价格"
android:textColor="@color/flexible_text_gray"
android:textSize="12sp" />
<TextView
android:id="@+id/tv_price"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:text="品号"
android:textColor="@color/flexible_text_gray"
android:textSize="12sp" />
</RelativeLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#d1f8f8f8"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20mm"
android:gravity="center"
android:text="加入购物车"
android:textSize="17sp"
android:textStyle="bold" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="25mm"
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingHorizontal="20mm">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="使用数量"
android:textColor="@color/flexible_text_sup"
android:textSize="17sp" />
<com.wd.workoffice.widget.AddAndReduceDoubleView
android:id="@+id/ar_use_num"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10mm" />
</LinearLayout>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20mm"
android:gravity="center"
android:text="选择置换产品"
android:textSize="17sp"
android:textStyle="bold" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_pro"
android:layout_width="match_parent"
android:layout_height="200mm"
android:layout_marginTop="5mm" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="25mm"
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingHorizontal="20mm">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="置换数量"
android:textColor="@color/flexible_text_sup"
android:textSize="17sp" />
<com.wd.workoffice.widget.AddAndReduceView
android:id="@+id/ar_num"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10mm" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="30mm"
android:orientation="horizontal">
<TextView
android:id="@+id/tv_cancel"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:paddingVertical="15mm"
android:text="取消"
android:textColor="#007AFF"
android:textSize="17sp" />
<View
android:layout_width="1dp"
android:layout_height="match_parent"
android:background="#D8DCE6" />
<TextView
android:id="@+id/tv_ok"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:paddingVertical="15mm"
android:text="确定"
android:textColor="#007AFF"
android:textSize="17sp" />
</LinearLayout>
</LinearLayout>
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论