Compare commits

...

2 Commits

Author SHA1 Message Date
renhaoting 333e7616de bug修复7 2025-12-22 14:34:35 +08:00
renhaoting 189a85896a bug修复7 2025-12-22 14:32:16 +08:00
4 changed files with 40 additions and 8 deletions

View File

@ -14,6 +14,7 @@ import com.ama.core.architecture.highlightpro.parameter.Constraints
import com.ama.core.architecture.highlightpro.parameter.HighlightParameter import com.ama.core.architecture.highlightpro.parameter.HighlightParameter
import com.ama.core.architecture.highlightpro.parameter.MarginOffset import com.ama.core.architecture.highlightpro.parameter.MarginOffset
import com.ama.core.architecture.highlightpro.shape.RectShape import com.ama.core.architecture.highlightpro.shape.RectShape
import com.ama.core.architecture.util.ResUtil
import com.ama.core.architecture.util.ResUtil.dp import com.ama.core.architecture.util.ResUtil.dp
import com.ama.core.architecture.util.SpUtil import com.ama.core.architecture.util.SpUtil
import com.ama.core.architecture.util.setOnClickBatch import com.ama.core.architecture.util.setOnClickBatch
@ -128,8 +129,14 @@ class WithDrawActivity : AppViewsEmptyViewModelActivity<ViewBinding>() {
private fun updateUICashTotal() { private fun updateUICashTotal() {
binding.tvCashTotal.text = AccountManager.getCash().toString() binding.tvCashTotal.text = AccountManager.getCash().toString()
binding.tvAllCashHasWithdrawed.text = buildString {
append(ResUtil.getString(R.string.cash))
append(" ")
append(WithdrawManager.instance().getHasWithdrawSuccessCashCount())
}
} }
override fun ViewBinding.initListeners() { override fun ViewBinding.initListeners() {
registerEvents({ data-> registerEvents({ data->
when (data?.mEventType) { when (data?.mEventType) {
@ -148,6 +155,7 @@ class WithDrawActivity : AppViewsEmptyViewModelActivity<ViewBinding>() {
if (record.itemIndex == 0) { if (record.itemIndex == 0) {
showTransactionResultDialog(record) showTransactionResultDialog(record)
} }
updateUICashTotal()
} catch (e: Exception) { } catch (e: Exception) {
e.printStackTrace() e.printStackTrace()
} }

View File

@ -30,7 +30,7 @@ class WithDrawItemView @JvmOverloads constructor(
fun setNumAndAction(itemIndex: Int, cashNum: Float, clickAction: (Int)->Unit) { fun setNumAndAction(itemIndex: Int, cashNum: Float, clickAction: (Int)->Unit) {
mItemIndex = itemIndex mItemIndex = itemIndex
mCashNum = cashNum mCashNum = cashNum
mBinding.tvWithdrawNum.text = ResUtil.getString(R.string.cash) + cashNum.toString() mBinding.tvWithdrawNum.text = ResUtil.getString(R.string.cash) + " " + cashNum.toString()
mBinding.tvSacar.setOnClickListener { mBinding.tvSacar.setOnClickListener {
clickAction.invoke(mItemIndex) clickAction.invoke(mItemIndex)
} }

View File

@ -115,6 +115,16 @@ class WithdrawManager private constructor() {
} }
fun getHasWithdrawSuccessCashCount(): Float {
var count = 0F
for (record in mRecordList) {
if (record.state == TRANSACTION_STATE_SUCCESS) {
count += record.cashNum
}
}
return count
}
fun addAdEarnForSubBean(itemIndex: Int, selectedSubIndex: Int, earnMoneyNum: Float) : Boolean { fun addAdEarnForSubBean(itemIndex: Int, selectedSubIndex: Int, earnMoneyNum: Float) : Boolean {
if (itemIndex >= 0 && itemIndex < mItemList.size) { if (itemIndex >= 0 && itemIndex < mItemList.size) {
try { try {

View File

@ -46,15 +46,29 @@
android:layout_centerVertical="true" android:layout_centerVertical="true"
/> />
<androidx.appcompat.widget.AppCompatTextView <LinearLayout
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textSize="14sp" android:orientation="horizontal"
android:textColor="@color/black_13" android:layout_alignParentRight="true">
android:text="@string/total_cash" <androidx.appcompat.widget.AppCompatTextView
android:layout_alignParentRight="true" android:layout_width="wrap_content"
android:layout_centerVertical="true" android:layout_height="wrap_content"
/> android:textSize="14sp"
android:textColor="@color/black_13"
android:text="@string/total_cash"
/>
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/tv_all_cash_has_withdrawed"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="14sp"
android:textColor="@color/black_13"
/>
</LinearLayout>
</RelativeLayout> </RelativeLayout>