Commit 97c1896d by 刘鹏

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

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