hanjing лет назад: 6
Родитель
Сommit
cf1f78d11a

+ 17 - 12
app/src/main/java/com/sheep/gamegroup/module/pay/activity/ActPayPassword.java

@@ -87,7 +87,7 @@ public class ActPayPassword extends BaseContainerActivity {
     public static void setPwd(Context context) {
         CommonUtil.getInstance().getUserInfo(SpUtils.getToken(context), (user)->{
             Intent in = new Intent(context, ActPayPassword.class);
-            if (TextUtils.isEmpty(user.getMobile()) || user.getCertification_count() <= 0) {
+            if (TextUtils.isEmpty(user.getMobile())) {
                 in.putExtra("action", ACTION_COMPLETION);
             } else if (user.hasPayPwd()) {
                 in.putExtra("action", ACTION_CONFIRM_UPDATE);
@@ -98,17 +98,22 @@ public class ActPayPassword extends BaseContainerActivity {
         });
     }
 
-    public static boolean verifyPwd(Activity activity, String ext) {
-        UserEntity user = DataUtil.getInstance().getUserEntity();
-        if(user.hasPayPwd()) {
-            Intent in = new Intent(activity, ActPayPassword.class);
-            in.putExtra("action", ACTION_VERIFY_PAY_PWD);
-            in.putExtra("ext", ext);
-            activity.startActivityForResult(in, 3);
-            return true;
-        } else{
-            return false;
-        }
+    public static void verifyPwd(Activity activity, String token, String ext, PayPasswordCallback callback) {
+        CommonUtil.getInstance().getUserInfo(token, (user)->{
+            if(user.hasPayPwd()) {
+                Intent in = new Intent(activity, ActPayPassword.class);
+                in.putExtra("action", ACTION_VERIFY_PAY_PWD);
+                in.putExtra("ext", ext);
+                activity.startActivityForResult(in, 3);
+                callback.callback(true);
+            } else{
+                callback.callback(false);
+            }
+        });
+    }
+
+    public interface PayPasswordCallback{
+        void callback(boolean ret);
     }
 
     public static class PayPasswordEvent {

+ 1 - 1
app/src/main/java/com/sheep/gamegroup/util/TestUtil.java

@@ -514,7 +514,7 @@ public class TestUtil {
                 break;
             case "测试内部h5": {
 //                Jump2View.getInstance().goWeb(activity, StringUtils.getCopyText().toString(), "小绵羊官网");
-                String url = "http://10.8.240.193:8082/#/payment?authorization=64239%40e90a3bf5f9cfd223%40f2c7d20cc681423c74da740fc899f21e&order=6557891279164801024&ssnocache=1";
+                String url = "http://10.8.240.193:8082/#/payment?authorization=64239%40e90a3bf5f9cfd223%40024e900d3cc2db1c2c064d5bb0d52a95&order=6557891279164801024&ssnocache=1";
                 Jump2View.getInstance().goWeb(activity, url, "支付");
             }
                 break;

+ 6 - 2
app/src/main/java/com/sheep/gamegroup/util/js/KFZSJs.java

@@ -541,7 +541,11 @@ public class KFZSJs {
     }
 
     @JavascriptInterface
-    public boolean checkPayPassword(String ext) {
-        return ActPayPassword.verifyPwd(activity, ext);
+    public void checkPayPassword(String token, String ext) {
+        ActPayPassword.verifyPwd(activity, token, ext, (ret) -> {
+            if (!ret) {
+                iWeb.loadJs("payNext(\"" + ext + "\")");
+            }
+        });
     }
 }

+ 6 - 3
app/src/main/java/com/sheep/gamegroup/view/activity/WithdrawalAct.java

@@ -32,6 +32,7 @@ import com.sheep.gamegroup.view.adapter.WithdrawalAdapter;
 import com.sheep.jiuyan.samllsheep.R;
 import com.sheep.jiuyan.samllsheep.SheepApp;
 import com.sheep.jiuyan.samllsheep.utils.G;
+import com.sheep.jiuyan.samllsheep.utils.SpUtils;
 import com.sheep.jiuyan.samllsheep.utils.TitleBarUtils;
 
 
@@ -153,9 +154,11 @@ public class WithdrawalAct extends BaseActivity implements WithdrawalContract.Vi
     public void onViewClicked(View view) {
         switch (view.getId()) {
             case R.id.withdrawal_sure:
-                if (!ActPayPassword.verifyPwd(this, "")) {
-                    doWithdrawal();
-                }
+                ActPayPassword.verifyPwd(this, SpUtils.getToken(this), "",(ret)->{
+                   if(!ret){
+                       doWithdrawal();
+                   }
+                });
                 break;
         }
     }

+ 1 - 1
app/src/main/res/layout/pay_pwd_completion_fgt.xml

@@ -5,7 +5,7 @@
     android:layout_height="match_parent"
     android:gravity="center_vertical"
     android:padding="20dp"
-    android:text="检测到你的账号未实名认证或绑定手机,为了账号安全,设置支付密码请先绑定手机号和实名认证。"
+    android:text="检测到你的账号未绑定手机,为了账号安全,设置支付密码请先绑定手机号。"
     android:textColor="@color/black_666666"
     android:textSize="13sp">