Commit 97c1896d by 刘鹏

feat: 展示我的消息,展示数字

parent ca6144ec
......@@ -212,28 +212,29 @@ class MineFragment : BaseFragment(), SwipeRefreshLayout.OnRefreshListener, View.
val orderNum = response.data?.consultOrderNum ?: 0
if (orderNum > 0) {
iv_order_tip.visibility = View.VISIBLE
if (orderNum > 99) {
iv_order_tip.text = "99+"
var numberStr = if (orderNum > 99) {
"99+"
} else {
iv_order_tip.text = "$orderNum"
"$orderNum"
}
getLocal().setConsult(true)
iv_order_tip.text = numberStr
getLocal().setConsult(orderNum)
} else {
iv_order_tip.visibility = View.GONE
getLocal().setConsult(false)
getLocal().setConsult(0)
}
}else{
getLocal().setConfide(false)
getLocal().setConsult(false)
getLocal().setConsult(0)
}
}else{
getLocal().setConfide(false)
getLocal().setConsult(false)
getLocal().setConsult(0)
}
},{
getLocal().setConfide(false)
getLocal().setConsult(false)
getLocal().setConsult(0)
})
}
......@@ -245,7 +246,7 @@ class MineFragment : BaseFragment(), SwipeRefreshLayout.OnRefreshListener, View.
private fun refreshCouponData() {
getLocal().setCoupon(false)
getLocal().setConfide(false)
getLocal().setConsult(false)
getLocal().setConsult(0)
val userInfo = getUserInfo()
......
......@@ -22,9 +22,9 @@ interface AppLocal {
fun setCoupon(have:Boolean)
fun getConsult():Boolean
fun getConsult():Int
fun setConsult(have: Boolean)
fun setConsult(have: Int)
fun getConfide():Boolean
......
......@@ -50,12 +50,12 @@ internal class AppLocalImpl private constructor(): AppLocal {
getAppSP().edit().putBoolean(COUPON, have).apply()
}
override fun getConsult(): Boolean {
return getAppSP().getBoolean(CONSULT, false)
override fun getConsult(): Int {
return getAppSP().getInt(CONSULT, 0)
}
override fun setConsult(have: Boolean) {
getAppSP().edit().putBoolean(CONSULT, have).apply()
override fun setConsult(have: Int) {
getAppSP().edit().putInt(CONSULT, have).apply()
}
override fun getConfide(): Boolean {
......
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