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

1.修改标准下单文案

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