钱包提现优化
This commit is contained in:
parent
643b50b20a
commit
0d88ea3f3a
@ -33,7 +33,7 @@ class EditBankCardActivity : BaseActivity<ActivityAuthBankcardBinding>() {
|
||||
var perInfoBean: UserDetail = UserDetail()
|
||||
override fun initView(savedInstanceState: Bundle?) {
|
||||
setStatusBarColor(R.color.white)
|
||||
setTitleBar("实名认证", true)
|
||||
setTitleBar("更换银行卡", true)
|
||||
|
||||
binding.run {
|
||||
tvNote.visibility = View.GONE
|
||||
|
@ -70,6 +70,8 @@ class PersonInfoActivity : BaseActivity<ActivityPersonInfoBinding>(), View.OnCli
|
||||
.subscribe(BaseObserver(mContext, object : RxHttpCallBack<UserDetail>() {
|
||||
override fun onSuccess(t: CommonResponseBean<UserDetail>) {
|
||||
super.onSuccess(t)
|
||||
if (t.data==null)
|
||||
return
|
||||
initViewByData(t.data)
|
||||
}
|
||||
}))
|
||||
|
@ -2,18 +2,30 @@ package com.dahe.gldriver.ui.mine.activity
|
||||
|
||||
import android.graphics.Color
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
import android.widget.LinearLayout
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.dahe.gldriver.adapter.CarsAdapter
|
||||
import com.dahe.gldriver.adapter.WalletAdapter
|
||||
import com.dahe.gldriver.base.AppConfig
|
||||
import com.dahe.gldriver.databinding.ActivityWalletBinding
|
||||
import com.dahe.gldriver.net.BaseObserver
|
||||
import com.dahe.gldriver.net.DataManager
|
||||
import com.dahe.gldriver.net.RxHttpCallBack
|
||||
import com.dahe.gldriver.ui.account.authperson.EditBankCardActivity
|
||||
import com.dahe.gldriver.utils.CommonPopUtils
|
||||
import com.dahe.glex.bean.UserDetail
|
||||
import com.dahe.glex.bean.WayBillBean
|
||||
import com.dahe.mylibrary.base.BaseActivity
|
||||
import com.dahe.mylibrary.net.CommonResponseBean
|
||||
import com.dahe.mylibrary.recycleviewswipe.RecycleViewDivider
|
||||
import com.dahe.mylibrary.utils.ActivityUtils
|
||||
import com.dahe.mylibrary.utils.ConvertUtils
|
||||
import com.dahe.mylibrary.utils.ImageLoader
|
||||
import com.dahe.mylibrary.utils.ToastUtils
|
||||
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers
|
||||
import io.reactivex.rxjava3.schedulers.Schedulers
|
||||
|
||||
/**
|
||||
* @ClassName WalletActivity
|
||||
@ -24,8 +36,14 @@ import com.dahe.mylibrary.utils.ConvertUtils
|
||||
class WalletActivity : BaseActivity<ActivityWalletBinding>() {
|
||||
override fun initView(savedInstanceState: Bundle?) {
|
||||
setStatusHeightParams(binding.rlTop)
|
||||
setTitleBar("钱包",true,true,"更换银行卡"){
|
||||
ActivityUtils.startActivity(mContext,EditBankCardActivity::class.java)
|
||||
setTitleBar("钱包", true, true)
|
||||
binding.run {
|
||||
tvLeft.setOnClickListener {
|
||||
ActivityUtils.startActivity(mContext, EditBankCardActivity::class.java)
|
||||
}
|
||||
tvRight.setOnClickListener {
|
||||
getCurrBank()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -57,4 +75,27 @@ class WalletActivity : BaseActivity<ActivityWalletBinding>() {
|
||||
|
||||
adapter.submitList(datas)
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取当前银行卡
|
||||
*/
|
||||
private fun getCurrBank() {
|
||||
DataManager.getInstance().getUserDetail()
|
||||
.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(BaseObserver(mContext, object : RxHttpCallBack<UserDetail>() {
|
||||
override fun onSuccess(t: CommonResponseBean<UserDetail>) {
|
||||
super.onSuccess(t)
|
||||
if (t.data != null && t.data.driverBankcardNumber.isNullOrEmpty()) {
|
||||
ToastUtils.showToast(mContext, "请先绑定银行卡")
|
||||
return
|
||||
}
|
||||
|
||||
CommonPopUtils.getInstance().showPickMoney(mContext, t.data) {
|
||||
val toDouble = it.toDouble()
|
||||
ToastUtils.showToast(mContext, "值是::::$toDouble")
|
||||
}
|
||||
}
|
||||
}))
|
||||
}
|
||||
}
|
@ -11,7 +11,9 @@ import com.dahe.gldriver.callback.OnResultListener
|
||||
import com.dahe.gldriver.mypop.AgreementAlert
|
||||
import com.dahe.gldriver.mypop.OnCarSelectListener
|
||||
import com.dahe.gldriver.mypop.PopBottomCar
|
||||
import com.dahe.gldriver.weight.pop.InputMoneyPop
|
||||
import com.dahe.gldriver.weight.pop.UpAppPop
|
||||
import com.dahe.glex.bean.UserDetail
|
||||
import com.dahe.mylibrary.base.SingletonNoPHolder
|
||||
import com.dahe.mylibrary.utils.ConvertUtils
|
||||
import com.lxj.xpopup.XPopup
|
||||
@ -162,4 +164,23 @@ class CommonPopUtils private constructor() {
|
||||
.show()
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 提现弹窗
|
||||
* @param context Context
|
||||
* @param userInfo UserDetail
|
||||
* @param listener OnInputConfirmListener
|
||||
*/
|
||||
fun showPickMoney(context: Context, userInfo : UserDetail, listener: OnInputConfirmListener){
|
||||
XPopup.Builder(context)
|
||||
.dismissOnBackPressed(true)
|
||||
.dismissOnTouchOutside(true)
|
||||
.asCustom(
|
||||
InputMoneyPop(
|
||||
context,userInfo,listener
|
||||
)
|
||||
)
|
||||
.show()
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,65 @@
|
||||
package com.dahe.gldriver.weight.pop
|
||||
|
||||
import android.content.Context
|
||||
import android.widget.Button
|
||||
import android.widget.EditText
|
||||
import android.widget.TextView
|
||||
import androidx.core.widget.addTextChangedListener
|
||||
import com.dahe.gldriver.R
|
||||
import com.dahe.glex.bean.UserDetail
|
||||
import com.dahe.mylibrary.utils.ToastUtils
|
||||
import com.lxj.xpopup.core.CenterPopupView
|
||||
import com.lxj.xpopup.interfaces.OnInputConfirmListener
|
||||
|
||||
/**
|
||||
* @ClassName InputMoneyPop
|
||||
* @Author john
|
||||
* @Date 2024/4/11 14:58
|
||||
* @Description TODO
|
||||
*/
|
||||
class InputMoneyPop(
|
||||
context: Context,
|
||||
val userInfo: UserDetail,
|
||||
val listener: OnInputConfirmListener
|
||||
) :
|
||||
CenterPopupView(context) {
|
||||
|
||||
override fun getImplLayoutId() = R.layout.pop_input_money
|
||||
|
||||
override fun onCreate() {
|
||||
super.onCreate()
|
||||
|
||||
val tvName = findViewById<TextView>(R.id.tvName)
|
||||
val etMoney = findViewById<EditText>(R.id.etMoney)
|
||||
val btnOk = findViewById<Button>(R.id.btnOk)
|
||||
|
||||
tvName.text = """提现到
|
||||
|${userInfo.driverBankcardAddress}${userInfo.driverBankcardNumber.substring(userInfo.driverBankcardNumber.length - 4)}
|
||||
""".trimMargin()
|
||||
etMoney.setSelection(etMoney.length())
|
||||
|
||||
etMoney.addTextChangedListener {
|
||||
}
|
||||
etMoney.addTextChangedListener {
|
||||
if (it.toString().indexOf(".") == 0) {
|
||||
etMoney.setText("0.")
|
||||
etMoney.setSelection(etMoney.length())
|
||||
return@addTextChangedListener
|
||||
}
|
||||
// if (it.toString().indexOf("0") == 0 ) {
|
||||
// etMoney.setText(it.toString().substring(1))
|
||||
// etMoney.setSelection(etMoney.length())
|
||||
// }
|
||||
|
||||
// if (it.toString().isNullOrEmpty()){
|
||||
// etMoney.setText("0")
|
||||
// etMoney.setSelection(etMoney.length())
|
||||
// }
|
||||
}
|
||||
|
||||
btnOk.setOnClickListener {
|
||||
listener.onConfirm(etMoney.text.toString().trim())
|
||||
dismiss()
|
||||
}
|
||||
}
|
||||
}
|
8
app/src/main/res/drawable/shape_blue_12.xml
Normal file
8
app/src/main/res/drawable/shape_blue_12.xml
Normal file
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<solid android:color="#8AA5E1" />
|
||||
|
||||
<corners android:radius="@dimen/dp_12"></corners>
|
||||
|
||||
</shape>
|
@ -153,6 +153,7 @@
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/llId"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/tvInfo"
|
||||
@ -166,7 +167,6 @@
|
||||
android:background="@color/color_c" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/llId"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_46"
|
||||
android:gravity="center"
|
||||
|
@ -96,11 +96,12 @@
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvLeft"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:text="提现记录"
|
||||
android:text="更换银行卡"
|
||||
android:textColor="@color/color_3"
|
||||
android:textSize="@dimen/sp_17" />
|
||||
|
||||
@ -110,6 +111,7 @@
|
||||
android:background="#C99D54" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvRight"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
|
113
app/src/main/res/layout/pop_input_money.xml
Normal file
113
app/src/main/res/layout/pop_input_money.xml
Normal file
@ -0,0 +1,113 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/shape_blue_12"
|
||||
android:orientation="vertical"
|
||||
android:paddingTop="@dimen/dp_20"
|
||||
android:paddingBottom="@dimen/dp_20">
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvName"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp_28"
|
||||
android:layout_marginTop="@dimen/dp_11"
|
||||
android:text="提现到\n招商银行3002"
|
||||
android:textColor="#ffffffff"
|
||||
android:textSize="@dimen/sp_18" />
|
||||
|
||||
|
||||
<EditText
|
||||
android:id="@+id/etMoney"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginLeft="@dimen/dp_28"
|
||||
android:layout_marginTop="@dimen/dp_40"
|
||||
android:layout_marginRight="@dimen/dp_28"
|
||||
android:background="@null"
|
||||
android:digits="0123456789."
|
||||
android:gravity="center"
|
||||
android:paddingTop="@dimen/dp_10"
|
||||
android:paddingBottom="@dimen/dp_10"
|
||||
android:inputType="numberDecimal"
|
||||
android:maxLength="6"
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
android:text="0"
|
||||
android:textColor="#ffffffff"
|
||||
android:textSize="@dimen/dp_26" />
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp_30"
|
||||
android:layout_marginTop="@dimen/dp_28"
|
||||
android:layout_marginRight="@dimen/dp_30"
|
||||
android:orientation="horizontal"
|
||||
android:visibility="gone">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_weight="1"
|
||||
android:text="费率"
|
||||
android:textColor="#ffffffff"
|
||||
android:textSize="@dimen/sp_12" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvFl"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:gravity="center"
|
||||
android:textColor="#ffffffff"
|
||||
android:textSize="@dimen/sp_12"
|
||||
tools:text="0.10% (最低¥0.10)" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp_30"
|
||||
android:layout_marginTop="@dimen/dp_8"
|
||||
android:layout_marginRight="@dimen/dp_30"
|
||||
android:orientation="horizontal"
|
||||
android:visibility="gone">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_weight="1"
|
||||
android:text="提示:"
|
||||
android:textColor="#ffffffff"
|
||||
android:textSize="@dimen/sp_12" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:gravity="center"
|
||||
android:text="服务费为银行收取,实际到账金额=提现金额-服务费"
|
||||
android:textColor="#ffffffff"
|
||||
android:textSize="@dimen/sp_12" />
|
||||
</LinearLayout>
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnOk"
|
||||
android:layout_width="@dimen/dp_230"
|
||||
android:layout_height="@dimen/dp_44"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginTop="@dimen/dp_34"
|
||||
android:background="@drawable/shape_white_8"
|
||||
android:text="确认提现"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="@dimen/sp_18" />
|
||||
|
||||
</LinearLayout>
|
Loading…
Reference in New Issue
Block a user