|
|
@@ -3,10 +3,13 @@ package com.adealink.weparty.profile.me.comp
|
|
|
import androidx.lifecycle.LifecycleOwner
|
|
|
import com.adealink.frame.base.fastLazy
|
|
|
import com.adealink.frame.mvvm.view.ViewComponent
|
|
|
+import com.adealink.frame.router.Router
|
|
|
import com.adealink.frame.util.onClick
|
|
|
+import com.adealink.weparty.module.wallet.Wallet
|
|
|
import com.adealink.weparty.module.wallet.WalletModule
|
|
|
import com.adealink.weparty.module.wallet.data.Currency
|
|
|
import com.adealink.weparty.profile.databinding.LayoutMeWalletBinding
|
|
|
+import com.adealink.weparty.util.formatNumberStr
|
|
|
|
|
|
class MeWalletComp(
|
|
|
lifecycleOwner: LifecycleOwner,
|
|
|
@@ -36,10 +39,10 @@ class MeWalletComp(
|
|
|
|
|
|
private fun observeViewModel() {
|
|
|
walletViewModel?.coinLD?.observe(viewLifecycleOwner) {
|
|
|
-
|
|
|
+ binding.tvCoin.text = formatNumberStr(it)
|
|
|
}
|
|
|
walletViewModel?.diamondLD?.observe(viewLifecycleOwner) {
|
|
|
-
|
|
|
+ binding.tvDiamond.text = formatNumberStr(it)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -48,12 +51,15 @@ class MeWalletComp(
|
|
|
}
|
|
|
|
|
|
private fun goWallet(currency: Currency) {
|
|
|
+ val act = activity ?: return
|
|
|
when (currency) {
|
|
|
Currency.COIN -> {
|
|
|
+ Router.build(act, Wallet.Wallet.PATH).start()
|
|
|
|
|
|
}
|
|
|
|
|
|
Currency.DIAMOND -> {
|
|
|
+ Router.build(act, Wallet.Wallet.PATH).start()
|
|
|
}
|
|
|
}
|
|
|
}
|