Browse Source

检查拼单地址修改

zengjiebin 7 years ago
parent
commit
25bf288995

+ 7 - 7
app/src/main/java/com/sheep/gamegroup/util/CommonUtil.java

@@ -58,6 +58,7 @@ import com.sheep.gamegroup.model.entity.TaskChild;
 import com.sheep.gamegroup.model.entity.TaskDescEntity;
 import com.sheep.gamegroup.model.entity.TaskDescEntity;
 import com.sheep.gamegroup.model.entity.TaskEty;
 import com.sheep.gamegroup.model.entity.TaskEty;
 import com.sheep.gamegroup.model.entity.UserEntity;
 import com.sheep.gamegroup.model.entity.UserEntity;
+import com.sheep.gamegroup.model.entity.WebParams;
 import com.sheep.gamegroup.model.entity.WithdrawalEty;
 import com.sheep.gamegroup.model.entity.WithdrawalEty;
 import com.sheep.gamegroup.model.entity.XiaomiGameEntity;
 import com.sheep.gamegroup.model.entity.XiaomiGameEntity;
 import com.sheep.gamegroup.model.util.EntityUtils;
 import com.sheep.gamegroup.model.util.EntityUtils;
@@ -2676,13 +2677,12 @@ public class CommonUtil {
                                 });
                                 });
                 return true;
                 return true;
             }
             }
-        } else if(url.contains("/#/placing-orders/")) {
-            String goodsId = ListUtil.getLast(StringUtils.getPathSegments(url));
-            if(!TextUtils.isEmpty(goodsId)){
-                ViewUtil.showMsgDialog(SheepApp.getInstance().getCurrentActivity(), new DialogConfig().setMsg("你有一个拼单邀请,是否立即前往?")
-                    .setBtnLeftText("取消").setBtnRightText("前往").setBtnRightOnClickListener(view -> Jump2View.getInstance().goWeb(SheepApp.getInstance().getCurrentActivity(), url)));
-                return true;
-            }
+        } else if(url.contains("/#/placing-orders/") && url.contains("?merchandise_id=")) {//http://10.8.220.248:8080/#/placing-orders/6504256768225316864?merchandise_id=2
+            closeListener.onClick(null);
+            ViewUtil.showMsgDialog(SheepApp.getInstance().getCurrentActivity(), new DialogConfig().setMsg("你有一个拼单邀请,是否立即前往?")
+                .setBtnLeftText("取消").setBtnRightText("前往")
+                .setBtnRightOnClickListener(view -> Jump2View.getInstance().goWeb(SheepApp.getInstance().getCurrentActivity(), new WebParams(url).setTitle("爱奇艺VIP会员卡"))));
+            return true;
         }
         }
         return false;
         return false;
     }
     }

+ 4 - 2
app/src/main/java/com/sheep/jiuyan/samllsheep/SheepApp.java

@@ -506,8 +506,10 @@ public class SheepApp extends MultiDexApplication {
         public void onActivityResumed(Activity activity) {
         public void onActivityResumed(Activity activity) {
             if (activityRef != null) activityRef.clear();
             if (activityRef != null) activityRef.clear();
             activityRef = new WeakReference<>(activity);
             activityRef = new WeakReference<>(activity);
-            if (getCurrentActivity() != null && !(getCurrentActivity() instanceof SplashAct)) { // 应用回到前台
-                CommonUtil.getInstance().checkCopyText();
+            if (mActivityCount == 1) { // 应用回到前台
+                if (getCurrentActivity() != null && !(getCurrentActivity() instanceof SplashAct)) { // 当前activity存在
+                    CommonUtil.getInstance().checkCopyText();
+                }
             }
             }
         }
         }