Browse Source

1.云钱包提现。

shihuiyun 2 years ago
parent
commit
b61ed3767b

+ 1 - 1
app/src/main/java/com/hdl/xl/utils/net/ApiService.kt

@@ -764,7 +764,7 @@ interface ApiService {
     @POST("User_center/withdraw")
     suspend fun withdraw(
         @Field("money") money: String?, @Field("cloud_password") cloud_password: String?,
-        @Field("source") source: String?
+        @Field("source") source: String?, @Field("random_key") random_key: String?
     ): Resp<WithdrawBean>
 
 

+ 6 - 3
app/src/main/java/com/hdl/xl/vmodel/CloudWithVModel.kt

@@ -4,6 +4,7 @@ import android.app.Activity
 import android.app.Application
 import android.text.Editable
 import android.text.TextUtils
+import android.util.Log
 import android.widget.LinearLayout
 import androidx.databinding.Bindable
 import androidx.lifecycle.MutableLiveData
@@ -52,10 +53,11 @@ class CloudWithVModel(application: Application) : BViewModel<BRepository>(applic
 
     fun toSuessTips(password: String) {
 
+        Log.e("-password-", "password=: "+password )
         //弹框确认
         viewModelScope.launch {
 
-            var it = repository().lreq { NetEngine.service.withdraw(money, password, "10") }
+            var it = repository().lreq { NetEngine.service.withdraw(money, password, "10",bean.value?.random_key) }
 
             if(it.code==0){
                 toast(it.msg)
@@ -63,7 +65,8 @@ class CloudWithVModel(application: Application) : BViewModel<BRepository>(applic
 
             if (it.ok()) {
 
-                if (it.data?.ret_code == "8889"||it.data?.ret_code == "0000") {
+                if (it.data?.ret_code == "8888") {
+                    //需要二次验证
 
                     //弹框
                     PopuSurePasswordUtils.show(repository().context,ll!!, "确定",object : ChoiceData {
@@ -91,7 +94,7 @@ class CloudWithVModel(application: Application) : BViewModel<BRepository>(applic
     fun setSendSms(bean: WithdrawBean?,code:String?){
 
         viewModelScope.launch {
-            var it=repository().lreq { NetEngine.service.validationSms(bean?.user_id,bean?.txn_seqno,bean?.total_amount,bean?.token,code) }
+            var it=repository().lreq { NetEngine.service.validationSms(User.get()?.id,bean?.txn_seqno,bean?.total_amount,bean?.token,code) }
             if(it.ok()){
                if(it.data?.ret_code=="0000") {
                    toast("提现成功")