hanjing 6 年 前
コミット
5d2f460144

+ 10 - 4
app/src/main/java/com/sheep/gamegroup/util/CertificationUtil.java

@@ -15,6 +15,7 @@ import com.sheep.gamegroup.model.entity.UserEntity;
 import com.sheep.gamegroup.model.util.SheepSubscriber;
 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 io.reactivex.android.schedulers.AndroidSchedulers;
@@ -46,10 +47,15 @@ public class CertificationUtil {
         new Handler(Looper.getMainLooper()).postDelayed(new Runnable() {
             @Override
             public void run() {
-                SheepApp.getInstance().setGamePackgeName("");
-                SheepApp.getInstance().setGameCode("");
-                SheepApp.getInstance().setGameFlag(false);
-                activity.finish();
+                if (TextUtils.isEmpty(errorMsg)) {
+                    SheepApp.getInstance().setGamePackgeName("");
+                    SheepApp.getInstance().setGameCode("");
+                    SheepApp.getInstance().setGameFlag(false);
+                    activity.finish();
+                } else {
+                    G.showToast(errorMsg);
+                    Jump2View.getInstance().goLoginViewWithoutFinish(activity, SheepApp.getInstance().getGameCode());
+                }
             }
         }, skip_time);
     }

+ 5 - 0
app/src/main/java/com/sheep/gamegroup/util/Jump2View.java

@@ -2959,6 +2959,11 @@ public class Jump2View {
         WebParams webParams = new WebParams(url, "抢购优惠").setShowTitle(false);
         Jump2View.getInstance().goWeb(SheepApp.getInstance().getCurrentActivity(), webParams);
     }
+    public void gotoGameVipRecharge(int discountId, String packageName, String token) {
+        String url = Config.getUrlByPath(Config.PATH_DIRECTIONAL_RECHARGE + "/" + discountId, "packagename", packageName, "authorization", token, "ssnocache", "1");
+        WebParams webParams = new WebParams(url, "抢购优惠").setShowTitle(false);
+        Jump2View.getInstance().goWeb(SheepApp.getInstance().getCurrentActivity(), webParams);
+    }
 
     /**
      * 小绵羊3.4.10新增 -- 跳转新春活动 界面

+ 13 - 0
app/src/main/java/com/sheep/gamegroup/util/js/KFZSJs.java

@@ -2,6 +2,7 @@ package com.sheep.gamegroup.util.js;
 
 import android.Manifest;
 import android.app.Activity;
+import android.content.ComponentName;
 import android.content.Intent;
 import android.content.pm.PackageManager;
 import android.net.Uri;
@@ -782,4 +783,16 @@ public class KFZSJs {
                 });
     }
 
+    @JavascriptInterface
+    public void discountRechargeBack(String packageName) {
+        ComponentName appName = new ComponentName(packageName, "com.yog.kothoth.view.activity.SSPaymentActivity");
+        Intent intent = new Intent();
+        intent.setComponent(appName);
+        intent.putExtra("action", 777);
+        intent.putExtra("status", 2);
+        intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
+        activity.startActivity(intent);
+        activity.finish();
+    }
+
 }

+ 15 - 3
app/src/main/java/com/sheep/gamegroup/view/activity/MiddleSchemeAct.java

@@ -59,7 +59,9 @@ public class MiddleSchemeAct extends Activity {
             case Intent.ACTION_VIEW:
                 Uri uri = intent.getData();
                 if (uri != null) {
-                    if (SheepApp.getInstance().mActivityCount == 0 && !"game_coupon".equals(uri.getQueryParameter("type"))) {
+                    if (SheepApp.getInstance().mActivityCount == 0
+                            && !"game_coupon".equals(uri.getQueryParameter("type"))
+                            && !"discountrecharge".equals(uri.getQueryParameter("type"))) {
                         ActionUtil.getInstance().addNextAction("scheme", uri);
                         tryGoSplashAct(SheepApp.getInstance(), uri);
                     } else {
@@ -82,7 +84,8 @@ public class MiddleSchemeAct extends Activity {
         }
         //尝试解密数据
         String json = uri.getQueryParameter("data");
-        if (!type.equals("h5game")) {
+        if (!type.equals("h5game")
+                && !type.equals("discountrecharge")) {
             json = BaseMessageConverter.decrypt(json);
         }
         switch (type) {
@@ -109,6 +112,14 @@ public class MiddleSchemeAct extends Activity {
                                 "代金券中心"),
                         true);
                 break;
+            case "discountrecharge": {
+                String[] paras = json.split(",");
+                int discountId = Integer.parseInt(paras[0]);
+                String packageName = paras[1];
+                String token = paras[2];
+                Jump2View.getInstance().gotoGameVipRecharge(discountId, packageName, token);
+                break;
+            }
             //sheep://small.kfzs.com/xmy?type=jhl&data={"Jump":"1"}
             case "jump_home_list"://跳转homeList
             case "jhl":
@@ -158,7 +169,7 @@ public class MiddleSchemeAct extends Activity {
             //sheep://small.kfzs.com/xmy?type=run&className=com.sheep.gamegroup.view.activity.ActInvitation 邀请赚钱界面
             //sheep://small.kfzs.com/xmy?type=run&className=com.sheep.gamegroup.view.activity.ActSignCardRecord 我的战绩界面
             case "run_app":
-            case "run":
+            case "run": {
                 String packageName = uri.getQueryParameter("packageName");
                 String className = uri.getQueryParameter("className");
                 boolean packageNameIsEmpty = TextUtils.isEmpty(packageName);
@@ -173,6 +184,7 @@ public class MiddleSchemeAct extends Activity {
                     runApp(context, packageName, className);
                 }
                 break;
+            }
             //sheep://small.kfzs.com/xmy?type=po&a=6506346179440152576&b=1
             case "placing-orders":
             case "po":

+ 1 - 1
app/src/main/java/com/sheep/jiuyan/samllsheep/Config.java

@@ -39,7 +39,7 @@ public class Config {
     //邀请赚钱
     private static final String STATION_SMALL_SHEEP_INVITATION = "/small_sheep_invitation/#";
     //游戏金币
-    private static final String STATION_SMALL_SHEEP_GAME_COINS = "/small_sheep_game_payment/#";
+    private static final String STATION_SMALL_SHEEP_GAME_COINS = "/small_sheep_game_coins/#";
     private static final String STATION_SMALL_SHEEP_GAME_COUPON = "/small_sheep_coupon/#";
     //定向奖励
     private static final String STATION_APPOINT_TASK = "/appoint_task/#";