|
@@ -1,6 +1,5 @@
|
|
|
package cn.muchinfo.rma.view.base.main.withdrawmanagement
|
|
package cn.muchinfo.rma.view.base.main.withdrawmanagement
|
|
|
|
|
|
|
|
-import android.graphics.BitmapFactory
|
|
|
|
|
import android.net.Uri
|
|
import android.net.Uri
|
|
|
import android.os.Bundle
|
|
import android.os.Bundle
|
|
|
import android.view.Gravity
|
|
import android.view.Gravity
|
|
@@ -8,12 +7,13 @@ import android.view.View
|
|
|
import android.view.ViewGroup
|
|
import android.view.ViewGroup
|
|
|
import android.view.inputmethod.EditorInfo
|
|
import android.view.inputmethod.EditorInfo
|
|
|
import android.widget.EditText
|
|
import android.widget.EditText
|
|
|
-import android.widget.ImageView
|
|
|
|
|
import android.widget.LinearLayout
|
|
import android.widget.LinearLayout
|
|
|
|
|
+import android.widget.TextView
|
|
|
import androidx.lifecycle.MutableLiveData
|
|
import androidx.lifecycle.MutableLiveData
|
|
|
import androidx.viewpager.widget.PagerAdapter
|
|
import androidx.viewpager.widget.PagerAdapter
|
|
|
import androidx.viewpager.widget.ViewPager
|
|
import androidx.viewpager.widget.ViewPager
|
|
|
import cn.muchinfo.rma.R
|
|
import cn.muchinfo.rma.R
|
|
|
|
|
+import cn.muchinfo.rma.global.data.UserCollectConfigData
|
|
|
import cn.muchinfo.rma.lifecycle.bindOptional
|
|
import cn.muchinfo.rma.lifecycle.bindOptional
|
|
|
import cn.muchinfo.rma.netManage.base.InteractiveException
|
|
import cn.muchinfo.rma.netManage.base.InteractiveException
|
|
|
import cn.muchinfo.rma.netManage.utils.UpLoadUtils
|
|
import cn.muchinfo.rma.netManage.utils.UpLoadUtils
|
|
@@ -30,12 +30,13 @@ import com.alibaba.fastjson.JSON
|
|
|
import com.blankj.utilcode.util.ConvertUtils
|
|
import com.blankj.utilcode.util.ConvertUtils
|
|
|
import com.blankj.utilcode.util.LogUtils
|
|
import com.blankj.utilcode.util.LogUtils
|
|
|
import com.blankj.utilcode.util.SPUtils
|
|
import com.blankj.utilcode.util.SPUtils
|
|
|
|
|
+import com.blankj.utilcode.util.ToastUtils
|
|
|
|
|
+import com.cuieney.sdk.rxpay.RxPay
|
|
|
import com.qmuiteam.qmui.util.QMUIDisplayHelper
|
|
import com.qmuiteam.qmui.util.QMUIDisplayHelper
|
|
|
import com.qmuiteam.qmui.widget.tab.QMUITabIndicator
|
|
import com.qmuiteam.qmui.widget.tab.QMUITabIndicator
|
|
|
import com.qmuiteam.qmui.widget.tab.QMUITabSegment
|
|
import com.qmuiteam.qmui.widget.tab.QMUITabSegment
|
|
|
import com.zhy.http.okhttp.callback.StringCallback
|
|
import com.zhy.http.okhttp.callback.StringCallback
|
|
|
import mtp.polymer.com.autowidget.dialog.SelectData
|
|
import mtp.polymer.com.autowidget.dialog.SelectData
|
|
|
-import mtp.polymer.com.autowidget.dialog.creatBottomSheetDialog
|
|
|
|
|
import mtp.polymer.com.autowidget.dialog.creatBottomSheetNoTitleDialog
|
|
import mtp.polymer.com.autowidget.dialog.creatBottomSheetNoTitleDialog
|
|
|
import mtp.polymer.com.autowidget.dialog.createLoadingDialog
|
|
import mtp.polymer.com.autowidget.dialog.createLoadingDialog
|
|
|
import mtp.polymer.com.autowidget.utils.TaskUiModel
|
|
import mtp.polymer.com.autowidget.utils.TaskUiModel
|
|
@@ -47,7 +48,7 @@ import org.json.JSONArray
|
|
|
import org.json.JSONException
|
|
import org.json.JSONException
|
|
|
import org.json.JSONObject
|
|
import org.json.JSONObject
|
|
|
import java.io.File
|
|
import java.io.File
|
|
|
-import java.io.FileInputStream
|
|
|
|
|
|
|
+
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 充值提现
|
|
* 充值提现
|
|
@@ -108,6 +109,7 @@ class WithdrawalActivity : BaseActivity<WithdrawalViewModel>(){
|
|
|
verticalLayout {
|
|
verticalLayout {
|
|
|
createLoadingDialog(hintStr = "").bindTaskStatus(context, viewModel.loadingDialogStatus)
|
|
createLoadingDialog(hintStr = "").bindTaskStatus(context, viewModel.loadingDialogStatus)
|
|
|
initDataTitle()
|
|
initDataTitle()
|
|
|
|
|
+ viewModel.queryUserCollectConfig()
|
|
|
background = resources.getDrawable(R.color.rma_item_bg)
|
|
background = resources.getDrawable(R.color.rma_item_bg)
|
|
|
//页面标题
|
|
//页面标题
|
|
|
topBar {
|
|
topBar {
|
|
@@ -464,7 +466,7 @@ class MoneyInOnlineUI(private val activity: WithdrawalActivity,private val viewM
|
|
|
|
|
|
|
|
editText {
|
|
editText {
|
|
|
gravity = Gravity.CENTER_VERTICAL
|
|
gravity = Gravity.CENTER_VERTICAL
|
|
|
- isEnabled = false
|
|
|
|
|
|
|
+// isEnabled = false
|
|
|
amount_input = this
|
|
amount_input = this
|
|
|
hint = "请填写充值金额"
|
|
hint = "请填写充值金额"
|
|
|
background = null
|
|
background = null
|
|
@@ -506,6 +508,7 @@ class MoneyInOnlineUI(private val activity: WithdrawalActivity,private val viewM
|
|
|
pay_type.bindOptional(context){
|
|
pay_type.bindOptional(context){
|
|
|
text = it?.value
|
|
text = it?.value
|
|
|
}
|
|
}
|
|
|
|
|
+ text = "请选择充值渠道"
|
|
|
textSizeAuto = 36
|
|
textSizeAuto = 36
|
|
|
textColorInt = R.color.rma_black_33
|
|
textColorInt = R.color.rma_black_33
|
|
|
}.lparams(wrapContent, wrapContent){
|
|
}.lparams(wrapContent, wrapContent){
|
|
@@ -520,13 +523,58 @@ class MoneyInOnlineUI(private val activity: WithdrawalActivity,private val viewM
|
|
|
}.lparams(matchParent, autoSize(150))
|
|
}.lparams(matchParent, autoSize(150))
|
|
|
|
|
|
|
|
verticalEmptyView()
|
|
verticalEmptyView()
|
|
|
|
|
+ viewModel.payInfoRequest.bindOptional(context){
|
|
|
|
|
+ LogUtils.eTag("asdhasgfjahsdha",it)
|
|
|
|
|
+ RxPay(activity)
|
|
|
|
|
+ .requestAlipay(it ?: "")
|
|
|
|
|
+ .subscribe {
|
|
|
|
|
|
|
|
|
|
+ }
|
|
|
|
|
+// RxPay(activity)
|
|
|
|
|
+// .requestAlipay("")
|
|
|
|
|
+// .requestAlipay("服务器产生的订单信息")
|
|
|
|
|
+// .subscribe(object : Consumer<Boolean?> {
|
|
|
|
|
+// @Throws(java.lang.Exception::class)
|
|
|
|
|
+// fun accept(aBoolean: Boolean) {
|
|
|
|
|
+// payState.setText("阿里支付状态:$aBoolean")
|
|
|
|
|
+// }
|
|
|
|
|
+// }, object : Consumer<Throwable?> {
|
|
|
|
|
+// @Throws(java.lang.Exception::class)
|
|
|
|
|
+// fun accept(throwable: Throwable) {
|
|
|
|
|
+// payState.setText("阿里支付状态:" + throwable.message)
|
|
|
|
|
+// }
|
|
|
|
|
+// })
|
|
|
|
|
+// RxPay(activity).requestAlipay(it ?: "")
|
|
|
|
|
+// .subscribe(object : Consumer<Boolean>{
|
|
|
|
|
+// override fun accept(p0: Boolean) {
|
|
|
|
|
+// TODO("Not yet implemented")
|
|
|
|
|
+// }
|
|
|
|
|
+//
|
|
|
|
|
+// })
|
|
|
|
|
+
|
|
|
|
|
+// .subscribe(new Consumer<Boolean>() {
|
|
|
|
|
+// @Override
|
|
|
|
|
+// public void accept(Boolean aBoolean) throws Exception {
|
|
|
|
|
+// payState.setText("阿里支付状态:"+aBoolean);
|
|
|
|
|
+// }
|
|
|
|
|
+// }, new Consumer<Throwable>() {
|
|
|
|
|
+// @Override
|
|
|
|
|
+// public void accept(Throwable throwable) throws Exception {
|
|
|
|
|
+// payState.setText("阿里支付状态:"+throwable.getMessage());
|
|
|
|
|
+// }
|
|
|
|
|
+// });
|
|
|
|
|
+ }
|
|
|
linearLayout {
|
|
linearLayout {
|
|
|
background = resources.getDrawable(R.color.white)
|
|
background = resources.getDrawable(R.color.white)
|
|
|
gravity = Gravity.CENTER_VERTICAL
|
|
gravity = Gravity.CENTER_VERTICAL
|
|
|
textView {
|
|
textView {
|
|
|
onThrottleFirstClick {
|
|
onThrottleFirstClick {
|
|
|
-
|
|
|
|
|
|
|
+// RxPay(activity)
|
|
|
|
|
+// .requestAlipay("alipay_sdk=alipay-sdk-java-dynamicVersionNo&app_id=2021002151602507&biz_content=%7B%22body%22%3A%22%E6%88%91%E6%98%AF%E6%B5%8B%E8%AF%95%E6%95%B0%E6%8D%AE%22%2C%22out_trade_no%22%3A%2220170216test01%22%2C%22product_code%22%3A%22QUICK_MSECURITY_PAY%22%2C%22subject%22%3A%22App%E6%94%AF%E4%BB%98%E6%B5%8B%E8%AF%95%22%2C%22timeout_express%22%3A%2230m%22%2C%22total_amount%22%3A%220.01%22%7D&charset=utf-8&format=json&method=alipay.trade.app.pay¬ify_url=http%3A%2F%2Fwww.test.notify&sign=LAG%2BEkHUunMW7pd4fNZc2gzFB6l1rfkXhWPf0EZKZtun9mG8AJtAK2OJOYCSJJExdQjVzOhUHlXxAtVP3llmyiqNrHeX%2BzxKWLNqVwNKRTR39%2BLJI2fRfArFhl%2Bb3h0FWWjs%2FidbpSsGZyXjjkL7ZqaE79X4fIYdGxaQFk%2BeyQv9nEUpNiokz1fC3xFVEllUZPyjCY5Te7AAHNqoC2sVRt79v%2F%2FuySlkXfRsMP7H85vklkLGA5YPGxzwl4NqIPrU2cI57H1nLE%2F1xgEj9qKPJj9Lf3ggdnyMngimG8wuS2R1lfz8mMNepcV%2BPg71OzzpmUATrwZ49Vcs1p0S8xwxbA%3D%3D&sign_type=RSA2×tamp=2021-06-18+17%3A35%3A21&version=1.0")
|
|
|
|
|
+// .subscribe{
|
|
|
|
|
+//
|
|
|
|
|
+// }
|
|
|
|
|
+ viewModel.getPayInfo(totalAmount = "0.01",payType = "4",msgType = "9")
|
|
|
}
|
|
}
|
|
|
gravity = Gravity.CENTER
|
|
gravity = Gravity.CENTER
|
|
|
backgroundResource = R.mipmap.rma_submit_bg
|
|
backgroundResource = R.mipmap.rma_submit_bg
|
|
@@ -565,6 +613,11 @@ class MoneyInOutlineUI(private val activity: WithdrawalActivity,private val view
|
|
|
|
|
|
|
|
lateinit var viewPager: ViewPager
|
|
lateinit var viewPager: ViewPager
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 选择的银行卡
|
|
|
|
|
+ */
|
|
|
|
|
+ val selectCardType : MutableLiveData<Int> = MutableLiveData()
|
|
|
|
|
+
|
|
|
val root = _FrameLayout(activity).apply {
|
|
val root = _FrameLayout(activity).apply {
|
|
|
verticalLayout {
|
|
verticalLayout {
|
|
|
|
|
|
|
@@ -579,17 +632,46 @@ class MoneyInOutlineUI(private val activity: WithdrawalActivity,private val view
|
|
|
clipChildren = false
|
|
clipChildren = false
|
|
|
viewPager = this
|
|
viewPager = this
|
|
|
val dataList = arrayListOf(R.mipmap.qhj_withdraw_bg3,R.mipmap.qhj_withdraw_bg1,R.mipmap.qhj_withdraw_bg2)
|
|
val dataList = arrayListOf(R.mipmap.qhj_withdraw_bg3,R.mipmap.qhj_withdraw_bg1,R.mipmap.qhj_withdraw_bg2)
|
|
|
- val baseVPAdapter: CardViewAdapter<Int> =
|
|
|
|
|
- object : CardViewAdapter<Int>(activity, R.layout.item_card_view, dataList) {
|
|
|
|
|
- override fun bindView(view: View, data: Int?) {
|
|
|
|
|
- val linearLayout =
|
|
|
|
|
- view.findViewById<LinearLayout>(R.id.image_bg)
|
|
|
|
|
- linearLayout.setBackgroundResource(data!!)
|
|
|
|
|
|
|
+ viewModel.userCollectConfigDataList.bindOptional(context){
|
|
|
|
|
+ val baseVPAdapter: CardViewAdapter<UserCollectConfigData> =
|
|
|
|
|
+ object : CardViewAdapter<UserCollectConfigData>(activity, R.layout.item_card_view, it) {
|
|
|
|
|
+ override fun bindView(view: View, data: UserCollectConfigData?) {
|
|
|
|
|
+ val linearLayout =
|
|
|
|
|
+ view.findViewById<LinearLayout>(R.id.image_bg)
|
|
|
|
|
+ val account_name = view.findViewById<TextView>(R.id.account_name)//名字
|
|
|
|
|
+ val card_number = view.findViewById<TextView>(R.id.card_number)//卡号
|
|
|
|
|
+ val card_name = view.findViewById<TextView>(R.id.card_name)//银行名称
|
|
|
|
|
+ linearLayout.setBackgroundResource(R.mipmap.qhj_withdraw_bg3)
|
|
|
|
|
+ account_name.setText(data?.collectaccountname)
|
|
|
|
|
+ card_number.text = data?.collectaccountno
|
|
|
|
|
+ card_name.text = data?.collectbankname
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
+ adapter = baseVPAdapter
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ viewPager.setOnPageChangeListener(object : ViewPager.OnPageChangeListener{
|
|
|
|
|
+ override fun onPageScrollStateChanged(state: Int) {
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ override fun onPageScrolled(
|
|
|
|
|
+ position: Int,
|
|
|
|
|
+ positionOffset: Float,
|
|
|
|
|
+ positionOffsetPixels: Int
|
|
|
|
|
+ ) {
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ override fun onPageSelected(position: Int) {
|
|
|
|
|
+ selectCardType.postValue(position)
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ })
|
|
|
setOffscreenPageLimit(15)
|
|
setOffscreenPageLimit(15)
|
|
|
setPageTransformer(false, ScaleTransformerCardView(activity))
|
|
setPageTransformer(false, ScaleTransformerCardView(activity))
|
|
|
- adapter = baseVPAdapter
|
|
|
|
|
|
|
+
|
|
|
}.lparams(matchParent, autoSize(260)){
|
|
}.lparams(matchParent, autoSize(260)){
|
|
|
marginStart = autoSize(65)
|
|
marginStart = autoSize(65)
|
|
|
marginEnd = autoSize(65)
|
|
marginEnd = autoSize(65)
|
|
@@ -759,7 +841,7 @@ class MoneyInOutlineUI(private val activity: WithdrawalActivity,private val view
|
|
|
gravity = Gravity.CENTER_VERTICAL
|
|
gravity = Gravity.CENTER_VERTICAL
|
|
|
textView {
|
|
textView {
|
|
|
onThrottleFirstClick {
|
|
onThrottleFirstClick {
|
|
|
-
|
|
|
|
|
|
|
+ ToastUtils.showLong(viewModel.userCollectConfigDataList.value?.get(selectCardType.value ?: 0)?.collectconfigid)
|
|
|
}
|
|
}
|
|
|
gravity = Gravity.CENTER
|
|
gravity = Gravity.CENTER
|
|
|
backgroundResource = R.mipmap.rma_submit_bg
|
|
backgroundResource = R.mipmap.rma_submit_bg
|