Skip to content
项目
Groups
代码片段
帮助
正在加载...
Sign in / Register
Toggle navigation
W
workoffice
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图表
统计图
Create a new issue
作业
提交
议题看板
Open sidebar
冷广德
workoffice
Commits
4aed0f08
提交
4aed0f08
authored
6月 21, 2020
作者:
lgd
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
1.修改标准下单文案
上级
9bf86ecf
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
82 行增加
和
13 行删除
+82
-13
ChooseInfoActivity.java
.../workoffice/ui/activity/bat/store/ChooseInfoActivity.java
+7
-1
StoreProductAdapter.java
...ava/com/wd/workoffice/ui/adapter/StoreProductAdapter.java
+15
-2
item_store_product.xml
app/src/main/res/layout/item_store_product.xml
+60
-10
没有找到文件。
app/src/main/java/com/wd/workoffice/ui/activity/bat/store/ChooseInfoActivity.java
浏览文件 @
4aed0f08
...
@@ -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
();
}
}
...
...
app/src/main/java/com/wd/workoffice/ui/adapter/StoreProductAdapter.java
浏览文件 @
4aed0f08
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
);
}
}
}
}
}
app/src/main/res/layout/item_store_product.xml
浏览文件 @
4aed0f08
...
@@ -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
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论