提交 4aed0f08 authored 作者: lgd's avatar lgd

1.修改标准下单文案

上级 9bf86ecf
......@@ -170,7 +170,12 @@ public class ChooseInfoActivity extends WorkToolBarActivity implements BatChoose
@Override
protected void initData() {
proList = new ArrayList<>();
proAdapter = new StoreProductAdapter(R.layout.item_store_product, proList);
if (TextUtils.equals("3", type)) {
proAdapter = new StoreProductAdapter(R.layout.item_store_product, proList,2);
}else {
proAdapter = new StoreProductAdapter(R.layout.item_store_product, proList);
}
proAdapter.bindToRecyclerView(rvData);
proAdapter.setEmptyView(R.layout.view_empty_order, rvData);
param = WorkUtils.pageKey();
......@@ -773,6 +778,7 @@ public class ChooseInfoActivity extends WorkToolBarActivity implements BatChoose
chooseProduct.setCarPrice(price);
carList.add(chooseProduct);
}
proAdapter.notifyDataSetChanged();
toast("加入购物车成功");
changeCarBadge();
}
......
package com.wd.workoffice.ui.adapter;
import android.text.TextUtils;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.wd.workoffice.R;
......@@ -16,7 +18,7 @@ import androidx.annotation.Nullable;
*/
public class StoreProductAdapter extends BaseQuickAdapter<ProductBean.RecordsBean, BaseViewHolder> {
int type;//1坩埚页面
int type;//1坩埚页面 ,2 供应不显示销售价格
public StoreProductAdapter(int layoutResId, List data) {
super(layoutResId, data);
......@@ -33,13 +35,24 @@ public class StoreProductAdapter extends BaseQuickAdapter<ProductBean.RecordsBea
helper.setText(R.id.tv_card, item.getSoleCode());
helper.setText(R.id.tv_card_name, item.getName());
helper.setText(R.id.tv_spec, item.getSpec());
helper.setText(R.id.tv_price, "¥".concat(MathUtils.converData(item.getInternalPrice(),3)));
helper.setText(R.id.tv_price, "¥".concat(MathUtils.converData(item.getInternalPrice(), 3)));
helper.setText(R.id.tv_unit, String.valueOf(item.getWeight()).concat("吨"));
if (!TextUtils.isEmpty(item.getCarNum())) {
helper.setVisible(R.id.ll_car,true);
helper.setText(R.id.tv_sale_price, MathUtils.converData(item.getCarPrice(), 3));
helper.setText(R.id.tv_car_num, MathUtils.converData(item.getCarNum(), 3));
}else{
helper.setVisible(R.id.ll_car,false);
}
helper.addOnClickListener(R.id.tv_cart);
if (type == 1) {
helper.setGone(R.id.rl_num, true);
helper.setText(R.id.tv_num, String.valueOf(item.getCanUseProductSum()));
}
if (type == 2) {
helper.setGone(R.id.tv_price_desc, false);
helper.setGone(R.id.tv_sale_price, false);
}
}
}
......@@ -136,12 +136,13 @@
android:textColor="@color/flexible_text_gray"
android:textSize="12sp" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/rl_num"
android:visibility="gone"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10mm">
android:layout_marginTop="10mm"
android:visibility="gone">
<TextView
android:layout_width="wrap_content"
......@@ -156,17 +157,65 @@
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
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical">
<LinearLayout
android:id="@+id/ll_car"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:visibility="invisible">
<TextView
android:id="@+id/tv_price_desc"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="销售单价:"
android:textColor="@color/red_btn_bg"
android:textSize="13sp" />
<TextView
android:id="@+id/tv_sale_price"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxWidth="100mm"
android:textColor="@color/red_btn_bg"
android:textSize="13sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="15mm"
android:text="购买数量:"
android:textColor="@color/red_btn_bg"
android:textSize="12sp" />
<TextView
android:id="@+id/tv_car_num"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxWidth="100mm"
android:textColor="@color/red_btn_bg"
android:textSize="12sp" />
</LinearLayout>
<TextView
android:id="@+id/tv_cart"
android:layout_width="90mm"
android:layout_height="26mm"
android:layout_gravity="right"
android:background="@mipmap/product_add_cart" />
</LinearLayout>
</LinearLayout>
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论