Commit 071d4bd6 authored by mengcuiguang's avatar mengcuiguang

代码优化

parent b2119c53
......@@ -59,11 +59,16 @@ class VipAdapter(val vipList: MutableList<VipBean.ListBean>) :
holder.tvVipItemLable.text = vipBean.topTitle
holder.tvVipItemLable.visibility = View.VISIBLE
}
if (vipBean.price < 1) {
holder.tvVipItemCurMoney.text = "¥${vipBean.price}"
if (vipBean.price == 0.0) {
holder.tvVipItemCurMoney.text = "免费试用"
} else {
holder.tvVipItemCurMoney.text = "¥${String.format("%.0f", vipBean.price)}"
if (vipBean.price < 1) {
holder.tvVipItemCurMoney.text = "¥${vipBean.price}"
} else {
holder.tvVipItemCurMoney.text = "¥${String.format("%.0f", vipBean.price)}"
}
}
if (vipBean.oldPrice > 0) {
holder.tvVipItemMoney.visibility = View.VISIBLE
holder.tvVipItemMoney.getPaint().setFlags(Paint.STRIKE_THRU_TEXT_FLAG) //中间横线(删除线)
......
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